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: 1813
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, ASCII text
| default
| |
100%
| TrID
| E-Mail message (Var. 2)
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/329 Shell Archive Format
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
| |
100%
| xdgMime
| message/rfc822
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 46 72 6f 6d 3a 20 72 6f | 67 65 72 73 40 73 75 64 |From: ro|gers@sud|
|00000010| 35 30 39 2e 65 64 2e 72 | 61 79 2e 63 6f 6d 20 28 |509.ed.r|ay.com (|
|00000020| 41 6e 64 72 65 77 20 52 | 6f 67 65 72 73 29 0a 4e |Andrew R|ogers).N|
|00000030| 65 77 73 67 72 6f 75 70 | 73 3a 20 61 6c 74 2e 73 |ewsgroup|s: alt.s|
|00000040| 6f 75 72 63 65 73 0a 53 | 75 62 6a 65 63 74 3a 20 |ources.S|ubject: |
|00000050| 50 63 61 6c 20 32 2e 31 | 20 2d 20 62 61 63 6b 20 |Pcal 2.1| - back |
|00000060| 64 65 73 70 69 74 65 20 | 70 6f 70 75 6c 61 72 20 |despite |popular |
|00000070| 64 65 6d 61 6e 64 0a 4d | 65 73 73 61 67 65 2d 49 |demand.M|essage-I|
|00000080| 44 3a 20 3c 32 33 39 33 | 40 73 75 64 35 30 39 2e |D: <2393|@sud509.|
|00000090| 65 64 2e 72 61 79 2e 63 | 6f 6d 3e 0a 44 61 74 65 |ed.ray.c|om>.Date|
|000000a0| 3a 20 31 32 20 53 65 70 | 20 39 30 20 31 38 3a 30 |: 12 Sep| 90 18:0|
|000000b0| 32 3a 30 36 20 47 4d 54 | 0a 0a 0a 4f 4b 2c 20 68 |2:06 GMT|...OK, h|
|000000c0| 65 72 65 20 69 73 20 74 | 68 65 20 6c 61 74 65 73 |ere is t|he lates|
|000000d0| 74 20 72 65 76 69 73 69 | 6f 6e 20 6f 66 20 50 63 |t revisi|on of Pc|
|000000e0| 61 6c 2e 20 20 54 68 65 | 72 65 20 61 72 65 20 73 |al. The|re are s|
|000000f0| 6f 6d 65 20 6e 65 77 20 | 66 6c 61 67 73 2c 20 62 |ome new |flags, b|
|00000100| 75 74 20 74 68 65 0a 6d | 6f 73 74 20 73 69 67 6e |ut the.m|ost sign|
|00000110| 69 66 69 63 61 6e 74 20 | 63 68 61 6e 67 65 20 69 |ificant |change i|
|00000120| 73 20 74 68 65 20 61 64 | 64 69 74 69 6f 6e 20 6f |s the ad|dition o|
|00000130| 66 20 65 6c 65 6d 65 6e | 74 61 72 79 20 63 70 70 |f elemen|tary cpp|
|00000140| 2d 6c 69 6b 65 20 66 75 | 6e 63 74 69 6f 6e 61 6c |-like fu|nctional|
|00000150| 69 74 79 0a 74 6f 20 74 | 68 65 20 64 61 74 65 20 |ity.to t|he date |
|00000160| 66 69 6c 65 2e 20 20 54 | 68 65 20 64 61 74 65 20 |file. T|he date |
|00000170| 66 69 6c 65 20 64 69 72 | 65 63 74 6f 72 79 20 61 |file dir|ectory a|
|00000180| 6e 64 20 70 72 6f 67 72 | 61 6d 20 64 65 66 61 75 |nd progr|am defau|
|00000190| 6c 74 73 20 6d 61 79 20 | 62 65 20 0a 6f 76 65 72 |lts may |be .over|
|000001a0| 72 69 64 64 65 6e 20 76 | 69 61 20 65 6e 76 69 72 |ridden v|ia envir|
|000001b0| 6f 6e 6d 65 6e 74 20 76 | 61 72 69 61 62 6c 65 73 |onment v|ariables|
|000001c0| 20 28 6f 72 20 74 68 65 | 69 72 20 65 71 75 69 76 | (or the|ir equiv|
|000001d0| 61 6c 65 6e 74 73 20 6f | 6e 20 56 4d 53 29 20 2d |alents o|n VMS) -|
|000001e0| 20 73 65 65 0a 74 68 65 | 20 52 65 61 64 4d 65 20 | see.the| ReadMe |
|000001f0| 66 69 6c 65 20 66 6f 72 | 20 6d 6f 72 65 20 64 65 |file for| more de|
|00000200| 74 61 69 6c 73 2e 0a 0a | 54 68 61 6e 6b 73 20 74 |tails...|Thanks t|
|00000210| 6f 20 4d 61 72 6b 20 4b | 61 6e 74 72 6f 77 69 74 |o Mark K|antrowit|
|00000220| 7a 2c 20 4a 6f 65 20 42 | 72 6f 77 6e 6c 65 65 2c |z, Joe B|rownlee,|
|00000230| 20 61 6e 64 20 45 72 69 | 63 20 48 61 6d 6d 6f 6e | and Eri|c Hammon|
|00000240| 64 20 66 6f 72 20 74 68 | 65 69 72 0a 63 6f 6e 74 |d for th|eir.cont|
|00000250| 72 69 62 75 74 69 6f 6e | 73 20 61 6e 64 20 73 75 |ribution|s and su|
|00000260| 67 67 65 73 74 69 6f 6e | 73 2e 0a 0a 41 6e 64 72 |ggestion|s...Andr|
|00000270| 65 77 20 57 2e 20 52 6f | 67 65 72 73 0a 0a 2d 2d |ew W. Ro|gers..--|
|00000280| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000290| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 20 63 |--------|------ c|
|000002a0| 75 74 20 68 65 72 65 20 | 2d 2d 2d 2d 2d 2d 2d 2d |ut here |--------|
|000002b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000002c0| 2d 2d 2d 2d 2d 2d 2d 2d | 0a 23 21 20 2f 62 69 6e |--------|.#! /bin|
|000002d0| 2f 73 68 0a 23 20 54 68 | 69 73 20 69 73 20 61 20 |/sh.# Th|is is a |
|000002e0| 73 68 65 6c 6c 20 61 72 | 63 68 69 76 65 2c 20 6d |shell ar|chive, m|
|000002f0| 65 61 6e 69 6e 67 3a 0a | 23 20 31 2e 20 52 65 6d |eaning:.|# 1. Rem|
|00000300| 6f 76 65 20 65 76 65 72 | 79 74 68 69 6e 67 20 61 |ove ever|ything a|
|00000310| 62 6f 76 65 20 74 68 65 | 20 23 21 20 2f 62 69 6e |bove the| #! /bin|
|00000320| 2f 73 68 20 6c 69 6e 65 | 2e 0a 23 20 32 2e 20 53 |/sh line|..# 2. S|
|00000330| 61 76 65 20 74 68 65 20 | 72 65 73 75 6c 74 69 6e |ave the |resultin|
|00000340| 67 20 74 65 78 74 20 69 | 6e 20 61 20 66 69 6c 65 |g text i|n a file|
|00000350| 2e 0a 23 20 33 2e 20 45 | 78 65 63 75 74 65 20 74 |..# 3. E|xecute t|
|00000360| 68 65 20 66 69 6c 65 20 | 77 69 74 68 20 2f 62 69 |he file |with /bi|
|00000370| 6e 2f 73 68 20 28 6e 6f | 74 20 63 73 68 29 20 74 |n/sh (no|t csh) t|
|00000380| 6f 20 63 72 65 61 74 65 | 3a 0a 23 09 20 4d 61 6b |o create|:.#. Mak|
|00000390| 65 66 69 6c 65 0a 23 09 | 20 52 65 61 64 4d 65 0a |efile.#.| ReadMe.|
|000003a0| 23 09 20 52 65 61 64 4d | 65 2e 6f 72 69 67 0a 23 |#. ReadM|e.orig.#|
|000003b0| 09 20 63 61 6c 65 6e 64 | 61 72 0a 23 09 20 70 63 |. calend|ar.#. pc|
|000003c0| 61 6c 2e 63 0a 23 09 20 | 70 63 61 6c 2e 68 6c 70 |al.c.#. |pcal.hlp|
|000003d0| 0a 23 09 20 70 63 61 6c | 2e 6d 61 6e 0a 23 09 20 |.#. pcal|.man.#. |
|000003e0| 70 63 61 6c 69 6e 69 74 | 2e 68 0a 23 20 54 68 69 |pcalinit|.h.# Thi|
|000003f0| 73 20 61 72 63 68 69 76 | 65 20 63 72 65 61 74 65 |s archiv|e create|
|00000400| 64 3a 20 57 65 64 20 53 | 65 70 20 31 32 20 31 33 |d: Wed S|ep 12 13|
|00000410| 3a 35 35 3a 30 34 20 45 | 44 54 20 31 39 39 30 0a |:55:04 E|DT 1990.|
|00000420| 65 78 70 6f 72 74 20 50 | 41 54 48 3b 20 50 41 54 |export P|ATH; PAT|
|00000430| 48 3d 2f 62 69 6e 3a 2f | 75 73 72 2f 62 69 6e 3a |H=/bin:/|usr/bin:|
|00000440| 24 50 41 54 48 0a 69 66 | 20 74 65 73 74 20 2d 66 |$PATH.if| test -f|
|00000450| 20 27 4d 61 6b 65 66 69 | 6c 65 27 0a 74 68 65 6e | 'Makefi|le'.then|
|00000460| 0a 09 65 63 68 6f 20 73 | 68 61 72 3a 20 77 69 6c |..echo s|har: wil|
|00000470| 6c 20 6e 6f 74 20 6f 76 | 65 72 2d 77 72 69 74 65 |l not ov|er-write|
|00000480| 20 65 78 69 73 74 69 6e | 67 20 66 69 6c 65 20 27 | existin|g file '|
|00000490| 4d 61 6b 65 66 69 6c 65 | 27 0a 65 6c 73 65 0a 63 |Makefile|'.else.c|
|000004a0| 61 74 20 3c 3c 20 5c 53 | 48 41 52 5f 45 4f 46 20 |at << \S|HAR_EOF |
|000004b0| 3e 20 27 4d 61 6b 65 66 | 69 6c 65 27 0a 23 0a 4d |> 'Makef|ile'.#.M|
|000004c0| 41 4e 44 49 52 3d 2f 75 | 73 72 31 2f 6a 61 64 2f |ANDIR=/u|sr1/jad/|
|000004d0| 6d 61 6e 09 09 09 23 20 | 6d 75 73 74 20 63 68 61 |man...# |must cha|
|000004e0| 6e 67 65 20 74 68 69 73 | 0a 0a 70 63 61 6c 3a 09 |nge this|..pcal:.|
|000004f0| 70 63 61 6c 2e 63 20 70 | 63 61 6c 69 6e 69 74 2e |pcal.c p|calinit.|
|00000500| 68 0a 09 24 28 43 43 29 | 20 24 28 43 46 4c 41 47 |h..$(CC)| $(CFLAG|
|00000510| 53 29 20 24 28 4c 44 46 | 4c 41 47 53 29 20 24 28 |S) $(LDF|LAGS) $(|
|00000520| 43 4f 50 54 53 29 20 2d | 6f 20 70 63 61 6c 20 70 |COPTS) -|o pcal p|
|00000530| 63 61 6c 2e 63 0a 0a 6d | 61 6e 3a 09 70 63 61 6c |cal.c..m|an:.pcal|
|00000540| 2e 6d 61 6e 0a 09 6e 72 | 6f 66 66 20 2d 6d 61 6e |.man..nr|off -man|
|00000550| 20 70 63 61 6c 2e 6d 61 | 6e 20 3e 20 70 63 61 6c | pcal.ma|n > pcal|
|00000560| 2e 31 0a 09 70 61 63 6b | 20 70 63 61 6c 2e 31 0a |.1..pack| pcal.1.|
|00000570| 23 09 6d 76 20 70 63 61 | 6c 2e 31 2e 7a 20 24 28 |#.mv pca|l.1.z $(|
|00000580| 4d 41 4e 44 49 52 29 0a | 53 48 41 52 5f 45 4f 46 |MANDIR).|SHAR_EOF|
|00000590| 0a 66 69 0a 69 66 20 74 | 65 73 74 20 2d 66 20 27 |.fi.if t|est -f '|
|000005a0| 52 65 61 64 4d 65 27 0a | 74 68 65 6e 0a 09 65 63 |ReadMe'.|then..ec|
|000005b0| 68 6f 20 73 68 61 72 3a | 20 77 69 6c 6c 20 6e 6f |ho shar:| will no|
|000005c0| 74 20 6f 76 65 72 2d 77 | 72 69 74 65 20 65 78 69 |t over-w|rite exi|
|000005d0| 73 74 69 6e 67 20 66 69 | 6c 65 20 27 52 65 61 64 |sting fi|le 'Read|
|000005e0| 4d 65 27 0a 65 6c 73 65 | 0a 63 61 74 20 3c 3c 20 |Me'.else|.cat << |
|000005f0| 5c 53 48 41 52 5f 45 4f | 46 20 3e 20 27 52 65 61 |\SHAR_EO|F > 'Rea|
|00000600| 64 4d 65 27 0a 54 68 69 | 73 20 69 73 20 73 74 69 |dMe'.Thi|s is sti|
|00000610| 6c 6c 20 61 6e 6f 74 68 | 65 72 20 6e 65 77 20 61 |ll anoth|er new a|
|00000620| 6e 64 20 69 6d 70 72 6f | 76 65 64 20 72 65 6c 65 |nd impro|ved rele|
|00000630| 61 73 65 20 28 32 2e 31 | 29 20 6f 66 20 74 68 65 |ase (2.1|) of the|
|00000640| 20 69 6e 66 61 6d 6f 75 | 73 20 50 63 61 6c 0a 70 | infamou|s Pcal.p|
|00000650| 72 6f 67 72 61 6d 2e 20 | 20 54 68 65 20 63 68 61 |rogram. | The cha|
|00000660| 6e 67 65 73 20 74 68 69 | 73 20 74 69 6d 65 20 61 |nges thi|s time a|
|00000670| 72 65 3a 0a 0a 09 31 29 | 20 45 6c 65 6d 65 6e 74 |re:...1)| Element|
|00000680| 61 72 79 20 63 70 70 2d | 6c 69 6b 65 20 66 75 6e |ary cpp-|like fun|
|00000690| 63 74 69 6f 6e 61 6c 69 | 74 79 20 68 61 73 20 62 |ctionali|ty has b|
|000006a0| 65 65 6e 20 61 64 64 65 | 64 3b 20 74 68 65 20 64 |een adde|d; the d|
|000006b0| 61 74 65 20 66 69 6c 65 | 0a 09 20 20 20 6e 6f 77 |ate file|.. now|
|000006c0| 20 73 75 70 70 6f 72 74 | 73 20 64 65 66 69 6e 65 | support|s define|
|000006d0| 7c 75 6e 64 65 66 2c 20 | 69 66 7b 6e 7d 64 65 66 ||undef, |if{n}def|
|000006e0| 20 2e 2e 2e 20 7b 20 65 | 6c 73 65 20 2e 2e 2e 20 | ... { e|lse ... |
|000006f0| 7d 20 65 6e 64 69 66 2c | 20 61 6e 64 0a 09 20 20 |} endif,| and.. |
|00000700| 20 69 6e 63 6c 75 64 65 | 3a 0a 0a 09 09 69 66 64 | include|:....ifd|
|00000710| 65 66 20 6d 65 65 74 69 | 6e 67 73 0a 09 09 69 6e |ef meeti|ngs...in|
|00000720| 63 6c 75 64 65 20 6d 65 | 65 74 69 6e 67 73 2e 64 |clude me|etings.d|
|00000730| 61 74 0a 09 09 75 6e 64 | 65 66 20 6d 65 65 74 69 |at...und|ef meeti|
|00000740| 6e 67 73 0a 09 09 65 6e | 64 69 66 0a 0a 09 20 20 |ngs...en|dif... |
|00000750| 20 53 79 6d 62 6f 6c 73 | 20 6d 61 79 20 62 65 20 | Symbols| may be |
|00000760| 7b 75 6e 7d 64 65 66 69 | 6e 65 64 20 6f 6e 20 74 |{un}defi|ned on t|
|00000770| 68 65 20 63 6f 6d 6d 61 | 6e 64 20 6c 69 6e 65 20 |he comma|nd line |
|00000780| 76 69 61 20 74 68 65 20 | 6e 65 77 20 2d 44 0a 09 |via the |new -D..|
|00000790| 20 20 20 61 6e 64 20 2d | 55 20 6f 70 74 69 6f 6e | and -|U option|
|000007a0| 73 20 64 65 73 63 72 69 | 62 65 64 20 62 65 6c 6f |s descri|bed belo|
|000007b0| 77 3b 20 73 79 6d 62 6f | 6c 20 6e 61 6d 65 73 20 |w; symbo|l names |
|000007c0| 61 72 65 20 74 72 65 61 | 74 65 64 20 69 6e 20 61 |are trea|ted in a|
|000007d0| 0a 09 20 20 20 63 61 73 | 65 2d 69 6e 73 65 6e 73 |.. cas|e-insens|
|000007e0| 69 74 69 76 65 20 6d 61 | 6e 6e 65 72 2e 20 20 22 |itive ma|nner. "|
|000007f0| 64 65 66 69 6e 65 22 20 | 61 6c 6f 6e 65 20 64 65 |define" |alone de|
|00000800| 6c 65 74 65 73 20 61 6c | 6c 20 73 79 6d 62 6f 6c |letes al|l symbol|
|00000810| 0a 09 20 20 20 64 65 66 | 69 6e 69 74 69 6f 6e 73 |.. def|initions|
|00000820| 3b 20 22 69 66 64 65 66 | 22 20 61 6c 6f 6e 65 20 |; "ifdef|" alone |
|00000830| 69 73 20 61 6c 77 61 79 | 73 20 66 61 6c 73 65 3b |is alway|s false;|
|00000840| 20 22 69 66 6e 64 65 66 | 22 20 61 6c 6f 6e 65 20 | "ifndef|" alone |
|00000850| 69 73 0a 09 20 20 20 61 | 6c 77 61 79 73 20 74 72 |is.. a|lways tr|
|00000860| 75 65 2e 0a 0a 09 20 20 | 20 54 68 65 20 6e 61 6d |ue.... | The nam|
|00000870| 65 73 20 6f 66 20 66 69 | 6c 65 73 20 74 6f 20 62 |es of fi|les to b|
|00000880| 65 20 69 6e 63 6c 75 64 | 65 64 20 6d 61 79 20 62 |e includ|ed may b|
|00000890| 65 20 6f 70 74 69 6f 6e | 61 6c 6c 79 20 73 75 72 |e option|ally sur|
|000008a0| 72 6f 75 6e 64 65 64 0a | 09 20 20 20 62 79 20 22 |rounded.|. by "|
|000008b0| 22 20 6f 72 20 3c 3e 3b | 20 6e 6f 6e 2d 61 62 73 |" or <>;| non-abs|
|000008c0| 6f 6c 75 74 65 20 70 61 | 74 68 20 6e 61 6d 65 73 |olute pa|th names|
|000008d0| 20 61 72 65 20 74 61 6b | 65 6e 20 74 6f 20 62 65 | are tak|en to be|
|000008e0| 20 72 65 6c 61 74 69 76 | 65 0a 09 20 20 20 74 6f | relativ|e.. to|
|000008f0| 20 74 68 65 20 64 69 72 | 65 63 74 6f 72 79 20 77 | the dir|ectory w|
|00000900| 68 65 72 65 20 74 68 65 | 20 66 69 6c 65 20 63 6f |here the| file co|
|00000910| 6e 74 61 69 6e 69 6e 67 | 20 74 68 65 20 69 6e 63 |ntaining| the inc|
|00000920| 6c 75 64 65 20 64 69 72 | 65 63 74 69 76 65 0a 09 |lude dir|ective..|
|00000930| 20 20 20 65 78 69 73 74 | 73 2e 20 20 54 68 65 20 | exist|s. The |
|00000940| 55 6e 2a 78 20 66 6c 61 | 76 6f 72 20 69 73 20 73 |Un*x fla|vor is s|
|00000950| 6d 61 72 74 20 65 6e 6f | 75 67 68 20 74 6f 20 74 |mart eno|ugh to t|
|00000960| 72 61 6e 73 6c 61 74 65 | 20 66 69 6c 65 20 6e 61 |ranslate| file na|
|00000970| 6d 65 73 0a 09 20 20 20 | 73 74 61 72 74 69 6e 67 |mes.. |starting|
|00000980| 20 77 69 74 68 20 22 7e | 2f 22 2e 0a 0a 09 32 29 | with "~|/"....2)|
|00000990| 20 50 63 61 6c 20 6e 6f | 77 20 6c 6f 6f 6b 73 20 | Pcal no|w looks |
|000009a0| 66 6f 72 20 65 6e 76 69 | 72 6f 6e 6d 65 6e 74 20 |for envi|ronment |
|000009b0| 76 61 72 69 61 62 6c 65 | 20 28 67 6c 6f 62 61 6c |variable| (global|
|000009c0| 20 73 79 6d 62 6f 6c 20 | 6f 6e 20 56 4d 53 29 0a | symbol |on VMS).|
|000009d0| 09 20 20 20 50 43 41 4c | 5f 4f 50 54 53 2c 20 77 |. PCAL|_OPTS, w|
|000009e0| 68 69 63 68 20 69 73 20 | 70 61 72 73 65 64 20 66 |hich is |parsed f|
|000009f0| 6f 72 20 63 6f 6d 6d 61 | 6e 64 20 6c 69 6e 65 20 |or comma|nd line |
|00000a00| 6f 70 74 69 6f 6e 73 3b | 20 66 6c 61 67 73 20 73 |options;| flags s|
|00000a10| 65 74 0a 09 20 20 20 74 | 68 65 72 65 20 6f 76 65 |et.. t|here ove|
|00000a20| 72 72 69 64 65 20 74 68 | 65 20 70 72 6f 67 72 61 |rride th|e progra|
|00000a30| 6d 20 64 65 66 61 75 6c | 74 73 20 62 75 74 20 61 |m defaul|ts but a|
|00000a40| 72 65 20 6f 76 65 72 72 | 69 64 64 65 6e 20 62 79 |re overr|idden by|
|00000a50| 20 76 61 6c 75 65 73 0a | 09 20 20 20 73 65 74 20 | values.|. set |
|00000a60| 69 6e 20 74 68 65 20 64 | 61 74 65 20 66 69 6c 65 |in the d|ate file|
|00000a70| 20 6f 72 20 65 78 70 6c | 69 63 69 74 6c 79 20 6f | or expl|icitly o|
|00000a80| 6e 20 74 68 65 20 63 6f | 6d 6d 61 6e 64 20 6c 69 |n the co|mmand li|
|00000a90| 6e 65 3a 0a 0a 09 09 73 | 65 74 65 6e 76 20 50 43 |ne:....s|etenv PC|
|00000aa0| 41 4c 5f 4f 50 54 53 20 | 22 2d 74 20 54 69 6d 65 |AL_OPTS |"-t Time|
|00000ab0| 73 2d 42 6f 6c 64 22 09 | 28 55 6e 2a 78 29 0a 09 |s-Bold".|(Un*x)..|
|00000ac0| 09 24 20 50 43 41 4c 5f | 4f 50 54 53 20 3d 3d 20 |.$ PCAL_|OPTS == |
|00000ad0| 22 2d 74 20 54 69 6d 65 | 73 2d 42 6f 6c 64 22 09 |"-t Time|s-Bold".|
|00000ae0| 09 28 56 4d 53 29 0a 0a | 09 33 29 20 50 63 61 6c |.(VMS)..|.3) Pcal|
|00000af0| 20 61 6c 73 6f 20 6c 6f | 6f 6b 73 20 66 6f 72 20 | also lo|oks for |
|00000b00| 65 6e 76 69 72 6f 6e 6d | 65 6e 74 20 76 61 72 69 |environm|ent vari|
|00000b10| 61 62 6c 65 20 28 6c 6f | 67 69 63 61 6c 20 6e 61 |able (lo|gical na|
|00000b20| 6d 65 20 6f 6e 20 56 4d | 53 29 0a 09 20 20 20 50 |me on VM|S).. P|
|00000b30| 43 41 4c 5f 44 49 52 20 | 77 68 69 63 68 20 70 6f |CAL_DIR |which po|
|00000b40| 69 6e 74 73 20 74 6f 20 | 74 68 65 20 64 65 66 61 |ints to |the defa|
|00000b50| 75 6c 74 20 64 69 72 65 | 63 74 6f 72 79 20 66 6f |ult dire|ctory fo|
|00000b60| 72 20 74 68 65 20 63 61 | 6c 65 6e 64 61 72 2f 0a |r the ca|lendar/.|
|00000b70| 09 20 20 20 43 41 4c 45 | 4e 44 41 52 2e 44 41 54 |. CALE|NDAR.DAT|
|00000b80| 20 66 69 6c 65 2e 0a 0a | 09 09 73 65 74 65 6e 76 | file...|..setenv|
|00000b90| 20 50 43 41 4c 5f 44 49 | 52 20 22 2f 75 34 2f 75 | PCAL_DI|R "/u4/u|
|00000ba0| 73 65 72 73 2f 61 77 72 | 2f 70 63 61 6c 22 09 28 |sers/awr|/pcal".(|
|00000bb0| 55 6e 2a 78 29 0a 09 09 | 24 20 64 65 66 69 6e 65 |Un*x)...|$ define|
|00000bc0| 20 50 43 41 4c 5f 44 49 | 52 20 22 44 49 53 4b 31 | PCAL_DI|R "DISK1|
|00000bd0| 31 3a 5b 41 57 52 2e 50 | 43 41 4c 5d 22 09 28 56 |1:[AWR.P|CAL]".(V|
|00000be0| 4d 53 29 0a 0a 09 20 20 | 20 49 6e 20 72 65 73 70 |MS)... | In resp|
|00000bf0| 6f 6e 73 65 20 74 6f 20 | 6d 61 6e 79 20 72 65 71 |onse to |many req|
|00000c00| 75 65 73 74 73 2c 20 55 | 6e 2a 78 20 70 63 61 6c |uests, U|n*x pcal|
|00000c10| 20 6c 6f 6f 6b 73 20 66 | 6f 72 20 2e 63 61 6c 65 | looks f|or .cale|
|00000c20| 6e 64 61 72 3b 20 69 66 | 0a 09 20 20 20 74 68 61 |ndar; if|.. tha|
|00000c30| 74 20 64 6f 65 73 20 6e | 6f 74 20 65 78 69 73 74 |t does n|ot exist|
|00000c40| 2c 20 69 74 20 6c 6f 6f | 6b 73 20 66 6f 72 20 63 |, it loo|ks for c|
|00000c50| 61 6c 65 6e 64 61 72 20 | 61 73 20 62 65 66 6f 72 |alendar |as befor|
|00000c60| 65 2e 0a 0a 09 34 29 20 | 54 68 65 20 2d 44 20 61 |e....4) |The -D a|
|00000c70| 6e 64 20 2d 55 20 66 6c | 61 67 73 20 68 61 76 65 |nd -U fl|ags have|
|00000c80| 20 62 65 65 6e 20 61 64 | 64 65 64 20 74 6f 20 64 | been ad|ded to d|
|00000c90| 65 66 69 6e 65 20 6f 72 | 20 75 6e 64 65 66 69 6e |efine or| undefin|
|00000ca0| 65 20 73 79 6d 62 6f 6c | 73 0a 09 20 20 20 66 6f |e symbol|s.. fo|
|00000cb0| 72 20 74 68 65 20 70 72 | 65 70 72 6f 63 65 73 73 |r the pr|eprocess|
|00000cc0| 6f 72 3b 20 69 66 20 74 | 68 65 73 65 20 61 72 65 |or; if t|hese are|
|00000cd0| 20 73 70 65 63 69 66 69 | 65 64 20 6f 6e 20 74 68 | specifi|ed on th|
|00000ce0| 65 20 63 6f 6d 6d 61 6e | 64 20 6c 69 6e 65 2c 0a |e comman|d line,.|
|00000cf0| 09 20 20 20 74 68 65 79 | 20 74 61 6b 65 20 65 66 |. they| take ef|
|00000d00| 66 65 63 74 20 70 72 69 | 6f 72 20 74 6f 20 72 65 |fect pri|or to re|
|00000d10| 61 64 69 6e 67 20 74 68 | 65 20 64 61 74 65 20 66 |ading th|e date f|
|00000d20| 69 6c 65 2e 20 20 2d 44 | 20 61 6c 6f 6e 65 20 63 |ile. -D| alone c|
|00000d30| 6c 65 61 72 73 0a 09 20 | 20 20 61 6c 6c 20 70 72 |lears.. | all pr|
|00000d40| 65 76 69 6f 75 73 6c 79 | 2d 64 65 66 69 6e 65 64 |eviously|-defined|
|00000d50| 20 73 79 6d 62 6f 6c 73 | 2e 0a 0a 09 09 70 63 61 | symbols|.....pca|
|00000d60| 6c 20 2d 44 20 6d 65 65 | 74 69 6e 67 73 09 09 09 |l -D mee|tings...|
|00000d70| 28 55 6e 2a 78 29 0a 09 | 09 24 20 70 63 61 6c 20 |(Un*x)..|.$ pcal |
|00000d80| 2d 22 44 22 20 6d 65 65 | 74 69 6e 67 73 09 09 09 |-"D" mee|tings...|
|00000d90| 28 56 4d 53 29 0a 0a 09 | 35 29 20 54 68 65 20 2d |(VMS)...|5) The -|
|00000da0| 4c 2c 20 2d 43 2c 20 61 | 6e 64 20 2d 52 20 66 6c |L, -C, a|nd -R fl|
|00000db0| 61 67 73 20 68 61 76 65 | 20 62 65 65 6e 20 61 64 |ags have| been ad|
|00000dc0| 64 65 64 20 74 6f 20 73 | 70 65 63 69 66 79 20 6c |ded to s|pecify l|
|00000dd0| 65 66 74 2c 20 63 65 6e | 74 65 72 2c 0a 09 20 20 |eft, cen|ter,.. |
|00000de0| 20 61 6e 64 20 72 69 67 | 68 74 20 66 6f 6f 74 20 | and rig|ht foot |
|00000df0| 73 74 72 69 6e 67 73 2e | 20 20 46 6f 6f 74 20 73 |strings.| Foot s|
|00000e00| 74 72 69 6e 67 73 20 63 | 6f 6e 73 69 73 74 69 6e |trings c|onsistin|
|00000e10| 67 20 6f 66 20 6d 75 6c | 74 69 70 6c 65 20 77 6f |g of mul|tiple wo|
|00000e20| 72 64 73 0a 09 20 20 20 | 73 68 6f 75 6c 64 20 62 |rds.. |should b|
|00000e30| 65 20 73 70 65 63 69 66 | 69 65 64 20 69 6e 20 73 |e specif|ied in s|
|00000e40| 69 6e 67 6c 65 20 6f 72 | 20 64 6f 75 62 6c 65 20 |ingle or| double |
|00000e50| 71 75 6f 74 65 73 3a 0a | 0a 09 09 6f 70 74 20 2d |quotes:.|...opt -|
|00000e60| 43 20 22 4c 61 6e 67 75 | 61 67 65 73 20 61 6e 64 |C "Langu|ages and|
|00000e70| 20 54 6f 6f 6c 73 20 47 | 72 6f 75 70 22 0a 0a 09 | Tools G|roup"...|
|00000e80| 36 29 20 54 68 65 20 27 | 2d 27 20 28 61 6c 73 6f |6) The '|-' (also|
|00000e90| 20 27 2d 2d 27 29 20 64 | 75 6d 6d 79 20 66 6c 61 | '--') d|ummy fla|
|00000ea0| 67 20 68 61 73 20 62 65 | 65 6e 20 61 64 64 65 64 |g has be|en added|
|00000eb0| 20 74 6f 20 64 69 73 61 | 6d 62 69 67 75 61 74 65 | to disa|mbiguate|
|00000ec0| 0a 09 20 20 20 63 61 73 | 65 73 20 73 75 63 68 20 |.. cas|es such |
|00000ed0| 61 73 20 74 68 65 20 66 | 6f 6c 6c 6f 77 69 6e 67 |as the f|ollowing|
|00000ee0| 3a 0a 0a 09 09 70 63 61 | 6c 20 2d 74 20 39 20 39 |:....pca|l -t 9 9|
|00000ef0| 30 0a 0a 09 20 20 20 77 | 68 69 63 68 20 6d 61 79 |0... w|hich may|
|00000f00| 20 6e 6f 77 20 62 65 20 | 73 70 65 63 69 66 69 65 | now be |specifie|
|00000f10| 64 20 61 73 0a 0a 09 09 | 70 63 61 6c 20 2d 74 20 |d as....|pcal -t |
|00000f20| 2d 20 39 20 39 30 09 09 | 6f 72 09 70 63 61 6c 20 |- 9 90..|or.pcal |
|00000f30| 2d 74 20 2d 2d 20 39 20 | 39 30 0a 0a 09 37 29 20 |-t -- 9 |90...7) |
|00000f40| 41 73 20 6d 61 6e 79 20 | 68 61 76 65 20 6e 6f 74 |As many |have not|
|00000f50| 69 63 65 64 2c 20 50 63 | 61 6c 20 75 73 65 64 20 |iced, Pc|al used |
|00000f60| 74 6f 20 6f 76 65 72 73 | 74 72 69 6b 65 20 6d 75 |to overs|trike mu|
|00000f70| 6c 74 69 70 6c 65 20 74 | 65 78 74 20 6c 69 6e 65 |ltiple t|ext line|
|00000f80| 73 0a 09 20 20 20 66 6f | 72 20 74 68 65 20 73 61 |s.. fo|r the sa|
|00000f90| 6d 65 20 64 61 74 65 20 | 69 66 20 74 68 65 20 6c |me date |if the l|
|00000fa0| 69 6e 65 73 20 77 65 72 | 65 20 6e 6f 74 20 63 6f |ines wer|e not co|
|00000fb0| 6e 74 69 67 75 6f 75 73 | 20 69 6e 20 74 68 65 20 |ntiguous| in the |
|00000fc0| 64 61 74 65 0a 09 20 20 | 20 66 69 6c 65 3b 20 74 |date.. | file; t|
|00000fd0| 68 69 73 20 68 61 73 20 | 62 65 65 6e 20 66 69 78 |his has |been fix|
|00000fe0| 65 64 2e 20 20 41 6c 73 | 6f 2c 20 74 68 65 20 74 |ed. Als|o, the t|
|00000ff0| 65 78 74 20 61 63 63 6f | 6d 70 61 6e 79 69 6e 67 |ext acco|mpanying|
|00001000| 20 68 6f 6c 69 64 61 79 | 73 0a 09 20 20 20 69 73 | holiday|s.. is|
|00001010| 20 77 72 69 74 74 65 6e | 20 69 6e 20 74 68 65 20 | written| in the |
|00001020| 6f 74 68 65 72 77 69 73 | 65 2d 75 6e 75 73 65 64 |otherwis|e-unused|
|00001030| 20 73 70 61 63 65 20 61 | 64 6a 61 63 65 6e 74 20 | space a|djacent |
|00001040| 74 6f 20 74 68 65 20 64 | 61 74 65 2e 0a 0a 54 68 |to the d|ate...Th|
|00001050| 65 20 61 63 63 6f 6d 70 | 61 6e 79 69 6e 67 20 66 |e accomp|anying f|
|00001060| 69 6c 65 20 63 61 6c 6c | 65 64 20 22 52 65 61 64 |ile call|ed "Read|
|00001070| 4d 65 2e 6f 72 69 67 22 | 20 63 61 6d 65 20 77 69 |Me.orig"| came wi|
|00001080| 74 68 20 74 68 65 20 6f | 72 69 67 69 6e 61 6c 20 |th the o|riginal |
|00001090| 64 69 73 74 72 69 62 75 | 74 69 6f 6e 0a 61 73 20 |distribu|tion.as |
|000010a0| 52 45 41 44 4d 45 20 61 | 6e 64 20 73 74 61 74 65 |README a|nd state|
|000010b0| 73 20 74 68 69 73 20 70 | 72 6f 67 72 61 6d 20 69 |s this p|rogram i|
|000010c0| 73 20 63 6f 70 79 72 69 | 67 68 74 65 64 20 62 75 |s copyri|ghted bu|
|000010d0| 74 20 77 69 74 68 20 70 | 65 72 6d 69 73 73 69 6f |t with p|ermissio|
|000010e0| 6e 20 74 6f 20 6d 6f 64 | 69 66 79 0a 61 6e 64 20 |n to mod|ify.and |
|000010f0| 72 65 64 69 73 74 72 69 | 62 75 74 65 2e 0a 0a 41 |redistri|bute...A|
|00001100| 6e 64 72 65 77 20 57 2e | 20 52 6f 67 65 72 73 0a |ndrew W.| Rogers.|
|00001110| 0a 41 64 64 69 74 69 6f | 6e 61 6c 20 6e 6f 74 65 |.Additio|nal note|
|00001120| 3a 20 54 68 69 73 20 64 | 69 73 74 72 69 62 75 74 |: This d|istribut|
|00001130| 69 6f 6e 20 69 6e 63 6c | 75 64 65 73 20 61 20 56 |ion incl|udes a V|
|00001140| 4d 53 20 48 45 4c 50 20 | 66 69 6c 65 20 77 72 69 |MS HELP |file wri|
|00001150| 74 74 65 6e 20 62 79 0a | 52 69 63 68 61 72 64 20 |tten by.|Richard |
|00001160| 44 79 73 6f 6e 2e 20 20 | 43 6f 75 6e 74 6c 65 73 |Dyson. |Countles|
|00001170| 73 20 6f 74 68 65 72 20 | 70 65 6f 70 6c 65 20 77 |s other |people w|
|00001180| 6f 72 6b 65 64 20 6f 6e | 20 70 63 61 6c 20 6c 6f |orked on| pcal lo|
|00001190| 6e 67 20 62 65 66 6f 72 | 65 20 6d 65 3b 20 73 65 |ng befor|e me; se|
|000011a0| 65 0a 74 68 65 20 52 65 | 61 64 4d 65 2e 6f 72 69 |e.the Re|adMe.ori|
|000011b0| 67 20 66 69 6c 65 20 61 | 6e 64 20 74 6f 70 6c 69 |g file a|nd topli|
|000011c0| 6e 65 20 63 6f 6d 6d 65 | 6e 74 73 20 69 6e 20 70 |ne comme|nts in p|
|000011d0| 63 61 6c 2e 63 3b 20 73 | 70 65 63 69 61 6c 20 74 |cal.c; s|pecial t|
|000011e0| 68 61 6e 6b 73 20 74 6f | 0a 4d 61 72 6b 20 4b 61 |hanks to|.Mark Ka|
|000011f0| 6e 74 72 6f 77 69 74 7a | 2c 20 4a 6f 65 20 42 72 |ntrowitz|, Joe Br|
|00001200| 6f 77 6e 6c 65 65 2c 20 | 61 6e 64 20 45 72 69 63 |ownlee, |and Eric|
|00001210| 20 48 61 6d 6d 6f 6e 64 | 20 66 6f 72 20 74 68 65 | Hammond| for the|
|00001220| 69 72 20 63 6f 6e 74 72 | 69 62 75 74 69 6f 6e 73 |ir contr|ibutions|
|00001230| 0a 61 6e 64 20 73 75 67 | 67 65 73 74 69 6f 6e 73 |.and sug|gestions|
|00001240| 20 77 68 69 63 68 20 49 | 20 68 61 76 65 20 69 6e | which I| have in|
|00001250| 63 6f 72 70 6f 72 61 74 | 65 64 20 69 6e 74 6f 20 |corporat|ed into |
|00001260| 72 65 6c 65 61 73 65 20 | 32 2e 31 2e 0a 53 48 41 |release |2.1..SHA|
|00001270| 52 5f 45 4f 46 0a 66 69 | 0a 69 66 20 74 65 73 74 |R_EOF.fi|.if test|
|00001280| 20 2d 66 20 27 52 65 61 | 64 4d 65 2e 6f 72 69 67 | -f 'Rea|dMe.orig|
|00001290| 27 0a 74 68 65 6e 0a 09 | 65 63 68 6f 20 73 68 61 |'.then..|echo sha|
|000012a0| 72 3a 20 77 69 6c 6c 20 | 6e 6f 74 20 6f 76 65 72 |r: will |not over|
|000012b0| 2d 77 72 69 74 65 20 65 | 78 69 73 74 69 6e 67 20 |-write e|xisting |
|000012c0| 66 69 6c 65 20 27 52 65 | 61 64 4d 65 2e 6f 72 69 |file 'Re|adMe.ori|
|000012d0| 67 27 0a 65 6c 73 65 0a | 63 61 74 20 3c 3c 20 5c |g'.else.|cat << \|
|000012e0| 53 48 41 52 5f 45 4f 46 | 20 3e 20 27 52 65 61 64 |SHAR_EOF| > 'Read|
|000012f0| 4d 65 2e 6f 72 69 67 27 | 0a 22 50 63 61 6c 22 20 |Me.orig'|."Pcal" |
|00001300| 69 73 20 61 20 70 72 6f | 67 72 61 6d 20 74 6f 20 |is a pro|gram to |
|00001310| 70 72 69 6e 74 20 50 6f | 73 74 53 63 72 69 70 74 |print Po|stScript|
|00001320| 20 63 61 6c 65 6e 64 61 | 72 73 20 66 6f 72 20 61 | calenda|rs for a|
|00001330| 6e 79 20 6d 6f 6e 74 68 | 20 61 6e 64 20 79 65 61 |ny month| and yea|
|00001340| 72 2e 0a 42 79 20 64 65 | 66 61 75 6c 74 2c 20 69 |r..By de|fault, i|
|00001350| 74 20 6c 6f 6f 6b 73 20 | 66 6f 72 20 61 20 66 69 |t looks |for a fi|
|00001360| 6c 65 20 69 6e 20 74 68 | 65 20 68 6f 6d 65 20 64 |le in th|e home d|
|00001370| 69 72 65 63 74 6f 72 79 | 20 6e 61 6d 65 64 20 22 |irectory| named "|
|00001380| 63 61 6c 65 6e 64 61 72 | 22 0a 66 6f 72 20 65 6e |calendar|".for en|
|00001390| 74 72 69 65 73 20 77 69 | 74 68 20 6c 65 61 64 69 |tries wi|th leadi|
|000013a0| 6e 67 20 64 61 74 65 73 | 20 6d 61 74 63 68 69 6e |ng dates| matchin|
|000013b0| 67 20 64 61 74 65 73 20 | 6f 6e 20 74 68 65 20 63 |g dates |on the c|
|000013c0| 61 6c 65 6e 64 61 72 2c | 20 61 6e 64 20 70 72 69 |alendar,| and pri|
|000013d0| 6e 74 73 0a 61 6e 79 20 | 66 6f 6c 6c 6f 77 69 6e |nts.any |followin|
|000013e0| 67 20 74 65 78 74 20 75 | 6e 64 65 72 20 74 68 65 |g text u|nder the|
|000013f0| 20 61 70 70 72 6f 70 72 | 69 61 74 65 20 64 61 79 | appropr|iate day|
|00001400| 2e 0a 0a 54 68 65 20 70 | 72 6f 67 72 61 6d 20 6d |...The p|rogram m|
|00001410| 61 79 20 62 65 20 61 20 | 6c 69 74 74 6c 65 20 53 |ay be a |little S|
|00001420| 79 73 74 65 6d 20 56 20 | 66 6c 61 76 6f 72 65 64 |ystem V |flavored|
|00001430| 20 28 67 65 74 6f 70 74 | 2c 20 74 69 6d 65 20 72 | (getopt|, time r|
|00001440| 6f 75 74 69 6e 65 73 29 | 0a 62 75 74 20 73 68 6f |outines)|.but sho|
|00001450| 75 6c 64 20 62 65 20 65 | 61 73 69 6c 79 20 70 6f |uld be e|asily po|
|00001460| 72 74 61 62 6c 65 20 74 | 6f 20 6f 74 68 65 72 20 |rtable t|o other |
|00001470| 76 69 6e 74 61 67 65 73 | 20 6f 66 20 55 4e 49 58 |vintages| of UNIX|
|00001480| 2e 0a 0a 50 63 61 6c 20 | 69 73 20 74 68 65 20 63 |...Pcal |is the c|
|00001490| 6f 6d 62 69 6e 65 64 20 | 65 66 66 6f 72 74 20 6f |ombined |effort o|
|000014a0| 66 20 73 65 76 65 72 61 | 6c 20 70 65 6f 70 6c 65 |f severa|l people|
|000014b0| 2c 20 6d 6f 73 74 20 6e | 6f 74 61 62 6c 79 20 50 |, most n|otably P|
|000014c0| 61 74 72 69 63 6b 20 57 | 6f 6f 64 0a 6f 66 20 50 |atrick W|ood.of P|
|000014d0| 69 70 65 6c 69 6e 65 20 | 41 73 73 6f 63 69 61 74 |ipeline |Associat|
|000014e0| 65 73 2c 20 49 6e 63 2e | 20 66 6f 72 20 74 68 65 |es, Inc.| for the|
|000014f0| 20 6f 72 69 67 69 6e 61 | 6c 20 50 6f 73 74 53 63 | origina|l PostSc|
|00001500| 72 69 70 74 20 63 6f 64 | 65 20 61 6e 64 20 42 69 |ript cod|e and Bi|
|00001510| 6c 6c 0a 56 6f 67 65 6c | 20 6f 66 20 41 54 26 54 |ll.Vogel| of AT&T|
|00001520| 20 66 6f 72 20 74 68 65 | 20 63 61 6c 65 6e 64 61 | for the| calenda|
|00001530| 72 20 66 69 6c 65 20 6d | 65 63 68 61 6e 69 73 6d |r file m|echanism|
|00001540| 2e 20 20 4d 79 20 70 61 | 72 74 20 77 61 73 20 73 |. My pa|rt was s|
|00001550| 69 6d 70 6c 65 0a 74 72 | 61 6e 73 6c 61 74 69 6f |imple.tr|anslatio|
|00001560| 6e 20 74 6f 20 61 20 22 | 43 22 20 70 72 6f 67 72 |n to a "|C" progr|
|00001570| 61 6d 2c 20 74 68 65 20 | 61 64 64 69 74 69 6f 6e |am, the |addition|
|00001580| 20 6f 66 20 61 20 63 6f | 75 70 6c 65 20 6f 70 74 | of a co|uple opt|
|00001590| 69 6f 6e 73 20 61 6e 64 | 20 61 20 6d 6f 72 65 0a |ions and| a more.|
|000015a0| 67 65 6e 65 72 61 6c 69 | 7a 65 64 20 64 61 74 65 |generali|zed date|
|000015b0| 20 73 65 61 72 63 68 69 | 6e 67 20 72 6f 75 74 69 | searchi|ng routi|
|000015c0| 6e 65 20 28 6f 68 20 79 | 65 73 2c 20 61 6e 64 20 |ne (oh y|es, and |
|000015d0| 61 20 6d 61 6e 75 61 6c | 20 70 61 67 65 20 3a 2d |a manual| page :-|
|000015e0| 29 2e 0a 0a 54 68 65 20 | 6f 72 69 67 69 6e 61 6c |)...The |original|
|000015f0| 20 63 61 6c 65 6e 64 61 | 72 20 50 6f 73 74 53 63 | calenda|r PostSc|
|00001600| 72 69 70 74 20 77 61 73 | 20 43 6f 70 79 72 69 67 |ript was| Copyrig|
|00001610| 68 74 20 28 63 29 20 31 | 39 38 37 20 62 79 20 50 |ht (c) 1|987 by P|
|00001620| 61 74 72 69 63 6b 20 57 | 6f 6f 64 0a 61 6e 64 20 |atrick W|ood.and |
|00001630| 50 69 70 65 6c 69 6e 65 | 20 41 73 73 6f 63 69 61 |Pipeline| Associa|
|00001640| 74 65 73 2c 20 49 6e 63 | 2e 20 77 69 74 68 20 70 |tes, Inc|. with p|
|00001650| 65 72 6d 69 73 73 69 6f | 6e 20 74 6f 20 6d 6f 64 |ermissio|n to mod|
|00001660| 69 66 79 20 61 6e 64 20 | 72 65 64 69 73 74 72 69 |ify and |redistri|
|00001670| 62 75 74 65 2e 0a 50 6c | 65 61 73 65 20 72 65 74 |bute..Pl|ease ret|
|00001680| 61 69 6e 20 74 68 69 73 | 20 52 45 41 44 4d 45 20 |ain this| README |
|00001690| 66 69 6c 65 20 77 69 74 | 68 20 74 68 65 20 70 61 |file wit|h the pa|
|000016a0| 63 6b 61 67 65 2e 0a 0a | 0a 4b 65 6e 20 4b 65 69 |ckage...|.Ken Kei|
|000016b0| 72 6e 61 6e 0a 50 61 63 | 69 66 69 63 20 42 65 6c |rnan.Pac|ific Bel|
|000016c0| 6c 0a 53 61 6e 20 52 61 | 6d 6f 6e 2c 20 43 41 2e |l.San Ra|mon, CA.|
|000016d0| 0a 53 48 41 52 5f 45 4f | 46 0a 66 69 0a 69 66 20 |.SHAR_EO|F.fi.if |
|000016e0| 74 65 73 74 20 2d 66 20 | 27 63 61 6c 65 6e 64 61 |test -f |'calenda|
|000016f0| 72 27 0a 74 68 65 6e 0a | 09 65 63 68 6f 20 73 68 |r'.then.|.echo sh|
|00001700| 61 72 3a 20 77 69 6c 6c | 20 6e 6f 74 20 6f 76 65 |ar: will| not ove|
|00001710| 72 2d 77 72 69 74 65 20 | 65 78 69 73 74 69 6e 67 |r-write |existing|
|00001720| 20 66 69 6c 65 20 27 63 | 61 6c 65 6e 64 61 72 27 | file 'c|alendar'|
|00001730| 0a 65 6c 73 65 0a 63 61 | 74 20 3c 3c 20 5c 53 48 |.else.ca|t << \SH|
|00001740| 41 52 5f 45 4f 46 20 3e | 20 27 63 61 6c 65 6e 64 |AR_EOF >| 'calend|
|00001750| 61 72 27 0a 23 20 53 61 | 6d 70 6c 65 20 63 61 6c |ar'.# Sa|mple cal|
|00001760| 65 6e 64 61 72 20 66 69 | 6c 65 20 66 6f 72 20 70 |endar fi|le for p|
|00001770| 63 61 6c 0a 23 0a 23 20 | 54 68 69 73 20 73 68 6f |cal.#.# |This sho|
|00001780| 75 6c 64 20 62 65 20 7e | 2f 63 61 6c 65 6e 64 61 |uld be ~|/calenda|
|00001790| 72 20 6f 6e 20 55 6e 69 | 78 2c 20 53 59 53 24 4c |r on Uni|x, SYS$L|
|000017a0| 4f 47 49 4e 3a 43 41 4c | 45 4e 44 41 52 2e 44 41 |OGIN:CAL|ENDAR.DA|
|000017b0| 54 20 6f 6e 20 56 4d 53 | 0a 23 0a 23 20 56 61 6c |T on VMS|.#.# Val|
|000017c0| 69 64 20 65 6e 74 72 69 | 65 73 20 61 72 65 20 6f |id entri|es are o|
|000017d0| 66 20 74 68 65 20 66 6f | 6c 6c 6f 77 69 6e 67 20 |f the fo|llowing |
|000017e0| 66 6f 72 6d 73 3a 0a 23 | 0a 23 09 6f 70 74 20 3c |forms:.#|.#.opt <|
|000017f0| 6f 70 74 69 6f 6e 73 3e | 0a 23 09 79 65 61 72 20 |options>|.#.year |
|00001800| 3c 79 65 61 72 3e 0a 23 | 09 3c 6d 6f 6e 74 68 5f |<year>.#|.<month_|
|00001810| 6e 61 6d 65 3e 20 3c 64 | 61 79 3e 7b 2a 7d 20 7b |name> <d|ay>{*} {|
|00001820| 3c 74 65 78 74 3e 7d 0a | 23 09 3c 6d 6f 6e 74 68 |<text>}.|#.<month|
|00001830| 3e 3c 73 65 70 3e 3c 64 | 61 79 3e 7b 3c 73 65 70 |><sep><d|ay>{<sep|
|00001840| 3e 3c 79 65 61 72 3e 7d | 7b 2a 7d 20 7b 3c 74 65 |><year>}|{*} {<te|
|00001850| 78 74 3e 7d 0a 23 0a 23 | 20 77 68 65 72 65 3a 0a |xt>}.#.#| where:.|
|00001860| 23 09 3c 6f 70 74 69 6f | 6e 73 3e 20 3a 3d 20 6f |#.<optio|ns> := o|
|00001870| 6e 65 20 6f 72 20 6d 6f | 72 65 20 76 61 6c 69 64 |ne or mo|re valid|
|00001880| 20 63 6f 6d 6d 61 6e 64 | 2d 6c 69 6e 65 20 6f 70 | command|-line op|
|00001890| 74 69 6f 6e 73 20 28 65 | 78 63 65 70 74 20 2d 65 |tions (e|xcept -e|
|000018a0| 20 61 6e 64 20 2d 66 29 | 0a 23 09 3c 6d 6f 6e 74 | and -f)|.#.<mont|
|000018b0| 68 5f 6e 61 6d 65 3e 20 | 3a 3d 20 66 69 72 73 74 |h_name> |:= first|
|000018c0| 20 33 2b 20 63 68 61 72 | 61 63 74 65 72 73 20 6f | 3+ char|acters o|
|000018d0| 66 20 6e 61 6d 65 20 6f | 66 20 6d 6f 6e 74 68 20 |f name o|f month |
|000018e0| 28 69 6e 20 45 6e 67 6c | 69 73 68 29 0a 23 09 3c |(in Engl|ish).#.<|
|000018f0| 73 65 70 3e 20 3a 3d 20 | 6f 6e 65 20 6f 72 20 6d |sep> := |one or m|
|00001900| 6f 72 65 20 6e 6f 6e 2d | 6e 75 6d 65 72 69 63 2c |ore non-|numeric,|
|00001910| 20 6e 6f 6e 2d 73 70 61 | 63 65 2c 20 6e 6f 6e 2d | non-spa|ce, non-|
|00001920| 27 2a 27 20 63 68 61 72 | 61 63 74 65 72 73 0a 23 |'*' char|acters.#|
|00001930| 09 3c 74 65 78 74 3e 20 | 69 73 20 74 68 65 20 74 |.<text> |is the t|
|00001940| 65 78 74 20 74 6f 20 62 | 65 20 70 72 69 6e 74 65 |ext to b|e printe|
|00001950| 64 20 69 6e 20 74 68 65 | 20 63 61 6c 65 6e 64 61 |d in the| calenda|
|00001960| 72 20 62 6f 78 0a 23 09 | 3c 64 61 79 3e 2c 20 3c |r box.#.|<day>, <|
|00001970| 6d 6f 6e 74 68 3e 2c 20 | 61 6e 64 20 3c 79 65 61 |month>, |and <yea|
|00001980| 72 3e 20 61 72 65 20 61 | 70 70 72 6f 70 72 69 61 |r> are a|ppropria|
|00001990| 74 65 20 69 6e 74 65 67 | 65 72 73 0a 23 0a 23 09 |te integ|ers.#.#.|
|000019a0| 77 68 69 74 65 73 70 61 | 63 65 20 69 73 20 74 6f |whitespa|ce is to|
|000019b0| 20 62 65 20 75 73 65 64 | 2f 61 76 6f 69 64 65 64 | be used|/avoided|
|000019c0| 20 61 73 20 69 6d 70 6c | 69 65 64 20 62 79 20 74 | as impl|ied by t|
|000019d0| 68 65 20 61 62 6f 76 65 | 20 70 72 6f 64 75 63 74 |he above| product|
|000019e0| 69 6f 6e 73 0a 23 09 27 | 2a 27 20 66 6c 61 67 73 |ions.#.'|*' flags|
|000019f0| 20 74 68 65 20 64 61 74 | 65 20 61 73 20 61 20 68 | the dat|e as a h|
|00001a00| 6f 6c 69 64 61 79 20 28 | 74 6f 20 62 65 20 70 72 |oliday (|to be pr|
|00001a10| 69 6e 74 65 64 20 69 6e | 20 67 72 61 79 29 0a 23 |inted in| gray).#|
|00001a20| 09 63 6f 6d 6d 65 6e 74 | 73 20 72 75 6e 20 66 72 |.comment|s run fr|
|00001a30| 6f 6d 20 27 23 27 20 74 | 68 72 6f 75 67 68 20 65 |om '#' t|hrough e|
|00001a40| 6e 64 2d 6f 66 2d 6c 69 | 6e 65 0a 0a 23 20 41 20 |nd-of-li|ne..# A |
|00001a50| 73 61 6d 70 6c 65 20 22 | 6f 70 74 22 20 6c 69 6e |sample "|opt" lin|
|00001a60| 65 20 74 6f 20 63 68 61 | 6e 67 65 20 74 68 65 20 |e to cha|nge the |
|00001a70| 66 6f 6e 74 73 20 61 6e | 64 20 6f 75 74 70 75 74 |fonts an|d output|
|00001a80| 20 66 69 6c 65 20 6e 61 | 6d 65 73 20 61 6e 64 20 | file na|mes and |
|00001a90| 74 6f 20 70 72 69 6e 74 | 0a 23 20 6f 6e 6c 79 20 |to print|.# only |
|00001aa0| 53 75 6e 64 61 79 73 20 | 69 6e 20 67 72 61 79 3a |Sundays |in gray:|
|00001ab0| 0a 23 0a 23 6f 70 74 20 | 2d 64 20 48 65 6c 76 65 |.#.#opt |-d Helve|
|00001ac0| 74 69 63 61 2d 42 6f 6c | 64 20 2d 74 20 48 65 6c |tica-Bol|d -t Hel|
|00001ad0| 76 65 74 69 63 61 2d 42 | 6f 6c 64 20 2d 6f 20 6d |vetica-B|old -o m|
|00001ae0| 79 66 69 6c 65 2e 70 73 | 20 2d 62 20 61 6c 6c 20 |yfile.ps| -b all |
|00001af0| 2d 67 20 73 75 6e 0a 0a | 79 65 61 72 20 31 39 39 |-g sun..|year 199|
|00001b00| 30 09 09 09 09 23 20 73 | 65 74 20 79 65 61 72 20 |0....# s|et year |
|00001b10| 65 78 70 6c 69 63 69 74 | 6c 79 0a 0a 35 2f 32 38 |explicit|ly..5/28|
|00001b20| 2a 20 4d 65 6d 6f 72 69 | 61 6c 20 44 61 79 20 28 |* Memori|al Day (|
|00001b30| 6f 62 73 65 72 76 65 64 | 29 09 09 23 20 27 2a 27 |observed|)..# '*'|
|00001b40| 20 70 72 69 6e 74 73 20 | 68 6f 6c 69 64 61 79 20 | prints |holiday |
|00001b50| 69 6e 20 67 72 61 79 0a | 35 2f 33 31 20 4d 65 6d |in gray.|5/31 Mem|
|00001b60| 6f 72 69 61 6c 20 44 61 | 79 0a 0a 37 2f 34 2f 39 |orial Da|y..7/4/9|
|00001b70| 30 2a 20 49 6e 64 65 70 | 65 6e 64 65 6e 63 65 20 |0* Indep|endence |
|00001b80| 44 61 79 09 09 23 20 66 | 75 6c 6c 20 64 61 74 65 |Day..# f|ull date|
|00001b90| 20 66 6f 72 6d 61 74 0a | 0a 53 65 70 20 33 2a 20 | format.|.Sep 3* |
|00001ba0| 4c 61 62 6f 72 20 44 61 | 79 09 09 09 23 20 6d 6f |Labor Da|y...# mo|
|00001bb0| 6e 74 68 20 77 72 69 74 | 74 65 6e 20 6f 75 74 0a |nth writ|ten out.|
|00001bc0| 0a 31 30 2f 38 2a 20 43 | 6f 6c 75 6d 62 75 73 20 |.10/8* C|olumbus |
|00001bd0| 44 61 79 20 28 6f 62 73 | 65 72 76 65 64 29 0a 31 |Day (obs|erved).1|
|00001be0| 30 2f 31 32 20 43 6f 6c | 75 6d 62 75 73 20 44 61 |0/12 Col|umbus Da|
|00001bf0| 79 0a 0a 31 31 2f 32 32 | 2a 20 54 68 61 6e 6b 73 |y..11/22|* Thanks|
|00001c00| 67 69 76 69 6e 67 0a 31 | 31 2f 32 33 2a 09 09 09 |giving.1|1/23*...|
|00001c10| 09 09 23 20 68 6f 6c 69 | 64 61 79 20 77 69 74 68 |..# holi|day with|
|00001c20| 6f 75 74 20 74 65 78 74 | 0a 0a 31 32 2f 32 34 2a |out text|..12/24*|
|00001c30| 20 23 20 43 68 72 69 73 | 74 6d 61 73 20 45 76 65 | # Chris|tmas Eve|
|00001c40| 0a 31 32 2f 32 35 2a 20 | 43 68 72 69 73 74 6d 61 |.12/25* |Christma|
|00001c50| 73 0a 0a 31 2f 31 2f 39 | 31 2a 20 4e 65 77 20 59 |s..1/1/9|1* New Y|
|00001c60| 65 61 72 27 73 20 44 61 | 79 09 09 09 23 20 73 65 |ear's Da|y...# se|
|00001c70| 74 20 6e 65 77 20 79 65 | 61 72 20 69 6d 70 6c 69 |t new ye|ar impli|
|00001c80| 63 69 74 6c 79 0a 53 48 | 41 52 5f 45 4f 46 0a 66 |citly.SH|AR_EOF.f|
|00001c90| 69 0a 69 66 20 74 65 73 | 74 20 2d 66 20 27 70 63 |i.if tes|t -f 'pc|
|00001ca0| 61 6c 2e 63 27 0a 74 68 | 65 6e 0a 09 65 63 68 6f |al.c'.th|en..echo|
|00001cb0| 20 73 68 61 72 3a 20 77 | 69 6c 6c 20 6e 6f 74 20 | shar: w|ill not |
|00001cc0| 6f 76 65 72 2d 77 72 69 | 74 65 20 65 78 69 73 74 |over-wri|te exist|
|00001cd0| 69 6e 67 20 66 69 6c 65 | 20 27 70 63 61 6c 2e 63 |ing file| 'pcal.c|
|00001ce0| 27 0a 65 6c 73 65 0a 63 | 61 74 20 3c 3c 20 5c 53 |'.else.c|at << \S|
|00001cf0| 48 41 52 5f 45 4f 46 20 | 3e 20 27 70 63 61 6c 2e |HAR_EOF |> 'pcal.|
|00001d00| 63 27 0a 2f 2a 0a 20 2a | 20 70 63 61 6c 2e 63 20 |c'./*. *| pcal.c |
|00001d10| 2d 20 67 65 6e 65 72 61 | 74 65 20 50 6f 73 74 53 |- genera|te PostS|
|00001d20| 63 72 69 70 74 20 66 69 | 6c 65 20 74 6f 20 70 72 |cript fi|le to pr|
|00001d30| 69 6e 74 20 63 61 6c 65 | 6e 64 61 72 20 66 6f 72 |int cale|ndar for|
|00001d40| 20 61 6e 79 20 6d 6f 6e | 74 68 20 61 6e 64 20 79 | any mon|th and y|
|00001d50| 65 61 72 0a 20 2a 0a 20 | 2a 20 54 68 65 20 6f 72 |ear. *. |* The or|
|00001d60| 69 67 69 6e 61 6c 20 50 | 6f 73 74 53 63 72 69 70 |iginal P|ostScrip|
|00001d70| 74 20 63 6f 64 65 20 74 | 6f 20 67 65 6e 65 72 61 |t code t|o genera|
|00001d80| 74 65 20 74 68 65 20 63 | 61 6c 65 6e 64 61 72 73 |te the c|alendars|
|00001d90| 20 77 61 73 20 77 72 69 | 74 74 65 6e 20 62 79 0a | was wri|tten by.|
|00001da0| 20 2a 20 50 61 74 72 69 | 63 6b 20 57 6f 6f 64 20 | * Patri|ck Wood |
|00001db0| 28 43 6f 70 79 72 69 67 | 68 74 20 28 63 29 20 31 |(Copyrig|ht (c) 1|
|00001dc0| 39 38 37 20 62 79 20 50 | 61 74 72 69 63 6b 20 57 |987 by P|atrick W|
|00001dd0| 6f 6f 64 20 6f 66 20 50 | 69 70 65 6c 69 6e 65 20 |ood of P|ipeline |
|00001de0| 41 73 73 6f 63 69 61 74 | 65 73 2c 0a 20 2a 20 49 |Associat|es,. * I|
|00001df0| 6e 63 2e 29 2c 20 61 6e | 64 20 61 75 74 68 6f 72 |nc.), an|d author|
|00001e00| 69 7a 65 64 20 66 6f 72 | 20 6d 6f 64 69 66 69 63 |ized for| modific|
|00001e10| 61 74 69 6f 6e 20 61 6e | 64 20 72 65 64 69 73 74 |ation an|d redist|
|00001e20| 72 69 62 75 74 69 6f 6e | 2e 20 20 54 68 65 20 63 |ribution|. The c|
|00001e30| 61 6c 65 6e 64 61 72 0a | 20 2a 20 66 69 6c 65 20 |alendar.| * file |
|00001e40| 69 6e 63 6c 75 73 69 6f | 6e 20 63 6f 64 65 20 77 |inclusio|n code w|
|00001e50| 61 73 20 6f 72 69 67 69 | 6e 61 6c 6c 79 20 77 72 |as origi|nally wr|
|00001e60| 69 74 74 65 6e 20 69 6e | 20 22 62 73 28 31 29 22 |itten in| "bs(1)"|
|00001e70| 20 62 79 20 42 69 6c 6c | 20 56 6f 67 65 6c 20 6f | by Bill| Vogel o|
|00001e80| 66 0a 20 2a 20 41 54 26 | 54 2e 20 20 50 61 74 72 |f. * AT&|T. Patr|
|00001e90| 69 63 6b 27 73 20 6f 72 | 69 67 69 6e 61 6c 20 50 |ick's or|iginal P|
|00001ea0| 6f 73 74 53 63 72 69 70 | 74 20 77 61 73 20 6d 6f |ostScrip|t was mo|
|00001eb0| 64 69 66 69 65 64 20 61 | 6e 64 20 65 6e 68 61 6e |dified a|nd enhan|
|00001ec0| 63 65 64 20 73 65 76 65 | 72 61 6c 0a 20 2a 20 74 |ced seve|ral. * t|
|00001ed0| 69 6d 65 73 20 62 79 20 | 6f 74 68 65 72 73 20 77 |imes by |others w|
|00001ee0| 68 6f 73 65 20 6e 61 6d | 65 73 20 68 61 76 65 20 |hose nam|es have |
|00001ef0| 72 65 67 72 65 74 74 61 | 62 6c 79 20 62 65 65 6e |regretta|bly been|
|00001f00| 20 6c 6f 73 74 2e 20 20 | 54 68 69 73 20 43 20 76 | lost. |This C v|
|00001f10| 65 72 73 69 6f 6e 0a 20 | 2a 20 77 61 73 20 6f 72 |ersion. |* was or|
|00001f20| 69 67 69 6e 61 6c 6c 79 | 20 63 72 65 61 74 65 64 |iginally| created|
|00001f30| 20 62 79 20 4b 65 6e 20 | 4b 65 69 72 6e 61 6e 20 | by Ken |Keirnan |
|00001f40| 6f 66 20 50 61 63 69 66 | 69 63 20 42 65 6c 6c 3b |of Pacif|ic Bell;|
|00001f50| 20 61 64 64 69 74 69 6f | 6e 61 6c 0a 20 2a 20 65 | additio|nal. * e|
|00001f60| 6e 68 61 6e 63 65 6d 65 | 6e 74 73 20 62 79 20 4a |nhanceme|nts by J|
|00001f70| 6f 73 65 70 68 20 50 2e | 20 4c 61 72 73 6f 6e 2c |oseph P.| Larson,|
|00001f80| 20 45 64 20 48 61 6e 64 | 2c 20 61 6e 64 20 41 6e | Ed Hand|, and An|
|00001f90| 64 72 65 77 20 52 6f 67 | 65 72 73 20 28 77 68 6f |drew Rog|ers (who|
|00001fa0| 20 61 6c 73 6f 0a 20 2a | 20 64 69 64 20 74 68 65 | also. *| did the|
|00001fb0| 20 56 4d 53 20 70 6f 72 | 74 29 2c 20 61 6e 64 20 | VMS por|t), and |
|00001fc0| 4d 61 72 6b 20 4b 61 6e | 74 72 6f 77 69 74 7a 2e |Mark Kan|trowitz.|
|00001fd0| 20 20 4d 61 6e 79 20 74 | 68 61 6e 6b 73 20 61 6c | Many t|hanks al|
|00001fe0| 73 6f 20 74 6f 20 4a 6f | 65 20 42 72 6f 77 6e 6c |so to Jo|e Brownl|
|00001ff0| 65 65 0a 20 2a 20 61 6e | 64 20 45 72 69 63 20 48 |ee. * an|d Eric H|
|00002000| 61 6d 6d 6f 6e 64 20 66 | 6f 72 20 74 68 65 69 72 |ammond f|or their|
|00002010| 20 73 75 67 67 65 73 74 | 69 6f 6e 73 2e 0a 20 2a | suggest|ions.. *|
|00002020| 0a 20 2a 20 52 65 76 69 | 73 69 6f 6e 20 68 69 73 |. * Revi|sion his|
|00002030| 74 6f 72 79 3a 0a 20 2a | 0a 20 2a 09 32 2e 31 09 |tory:. *|. *.2.1.|
|00002040| 4d 4b 2f 41 57 52 09 30 | 38 2f 32 37 2f 39 30 09 |MK/AWR.0|8/27/90.|
|00002050| 73 75 70 70 6f 72 74 20 | 2d 4c 2c 20 2d 43 2c 20 |support |-L, -C, |
|00002060| 2d 52 2c 20 2d 6e 20 6f | 70 74 69 6f 6e 73 3b 0a |-R, -n o|ptions;.|
|00002070| 20 2a 09 09 09 09 09 70 | 72 69 6e 74 20 68 6f 6c | *.....p|rint hol|
|00002080| 69 64 61 79 20 74 65 78 | 74 20 6e 65 78 74 20 74 |iday tex|t next t|
|00002090| 6f 20 64 61 74 65 0a 20 | 2a 0a 20 2a 09 09 41 57 |o date. |*. *..AW|
|000020a0| 52 09 30 38 2f 32 34 2f | 39 30 09 69 6e 63 6f 72 |R.08/24/|90.incor|
|000020b0| 70 6f 72 61 74 65 20 63 | 70 70 2d 6c 69 6b 65 20 |porate c|pp-like |
|000020c0| 66 75 6e 63 74 69 6f 6e | 61 6c 69 74 79 3b 0a 20 |function|ality;. |
|000020d0| 2a 09 09 09 09 09 61 64 | 64 20 2d 44 20 61 6e 64 |*.....ad|d -D and|
|000020e0| 20 2d 55 20 6f 70 74 69 | 6f 6e 73 3b 20 73 61 76 | -U opti|ons; sav|
|000020f0| 65 20 64 61 74 65 20 66 | 69 6c 65 0a 20 2a 09 09 |e date f|ile. *..|
|00002100| 09 09 09 69 6e 66 6f 72 | 6d 61 74 69 6f 6e 20 69 |...infor|mation i|
|00002110| 6e 20 69 6e 74 65 72 6e | 61 6c 20 64 61 74 61 20 |n intern|al data |
|00002120| 73 74 72 75 63 74 75 72 | 65 3b 0a 20 2a 09 09 09 |structur|e;. *...|
|00002130| 09 09 6c 6f 6f 6b 20 66 | 6f 72 20 50 43 41 4c 5f |..look f|or PCAL_|
|00002140| 4f 50 54 53 20 61 6e 64 | 20 50 43 41 4c 5f 44 49 |OPTS and| PCAL_DI|
|00002150| 52 3b 20 6c 6f 6f 6b 0a | 20 2a 09 09 09 09 09 66 |R; look.| *.....f|
|00002160| 6f 72 20 7e 2f 2e 63 61 | 6c 65 6e 64 61 72 20 61 |or ~/.ca|lendar a|
|00002170| 6e 64 20 7e 2f 63 61 6c | 65 6e 64 61 72 0a 20 2a |nd ~/cal|endar. *|
|00002180| 0a 20 2a 09 32 2e 30 09 | 41 57 52 09 30 38 2f 30 |. *.2.0.|AWR.08/0|
|00002190| 38 2f 39 30 09 69 6e 63 | 6c 75 64 65 64 20 72 65 |8/90.inc|luded re|
|000021a0| 76 69 73 69 6f 6e 20 68 | 69 73 74 6f 72 79 3b 20 |vision h|istory; |
|000021b0| 72 65 70 6c 61 63 65 64 | 20 2d 72 0a 20 2a 09 09 |replaced| -r. *..|
|000021c0| 09 09 09 66 6c 61 67 20 | 77 69 74 68 20 2d 6c 20 |...flag |with -l |
|000021d0| 61 6e 64 20 2d 70 3b 20 | 72 65 70 6c 61 63 65 64 |and -p; |replaced|
|000021e0| 20 2d 73 20 61 6e 64 20 | 2d 53 0a 20 2a 09 09 09 | -s and |-S. *...|
|000021f0| 09 09 66 6c 61 67 73 20 | 77 69 74 68 20 2d 62 20 |..flags |with -b |
|00002200| 61 6e 64 20 2d 67 3b 20 | 72 65 63 6f 67 6e 69 7a |and -g; |recogniz|
|00002210| 65 20 66 6c 61 67 73 0a | 20 2a 09 09 09 09 09 73 |e flags.| *.....s|
|00002220| 65 74 20 69 6e 20 64 61 | 74 65 20 66 69 6c 65 3b |et in da|te file;|
|00002230| 20 74 72 61 6e 73 6c 61 | 74 65 20 28 20 61 6e 64 | transla|te ( and|
|00002240| 20 29 20 69 6e 0a 20 2a | 09 09 09 09 09 74 65 78 | ) in. *|.....tex|
|00002250| 74 20 74 6f 20 6f 63 74 | 61 6c 20 65 73 63 61 70 |t to oct|al escap|
|00002260| 65 20 73 65 71 75 65 6e | 63 65 3b 20 75 73 61 67 |e sequen|ce; usag|
|00002270| 65 28 29 0a 20 2a 09 09 | 09 09 09 6d 65 73 73 61 |e(). *..|...messa|
|00002280| 67 65 20 63 6f 6e 64 65 | 6e 73 65 64 20 74 6f 20 |ge conde|nsed to |
|00002290| 66 69 74 20 32 34 78 38 | 30 20 73 63 72 65 65 6e |fit 24x8|0 screen|
|000022a0| 0a 20 2a 0a 20 2a 09 50 | 61 72 61 6d 65 74 65 72 |. *. *.P|arameter|
|000022b0| 73 3a 0a 20 2a 0a 20 2a | 09 09 70 63 61 6c 20 5b |s:. *. *|..pcal [|
|000022c0| 6f 70 74 73 5d 09 09 67 | 65 6e 65 72 61 74 65 20 |opts]..g|enerate |
|000022d0| 63 61 6c 65 6e 64 61 72 | 20 66 6f 72 20 63 75 72 |calendar| for cur|
|000022e0| 72 65 6e 74 20 6d 6f 6e | 74 68 2f 79 65 61 72 0a |rent mon|th/year.|
|000022f0| 20 2a 0a 20 2a 09 09 70 | 63 61 6c 20 5b 6f 70 74 | *. *..p|cal [opt|
|00002300| 73 5d 20 79 79 09 09 67 | 65 6e 65 72 61 74 65 20 |s] yy..g|enerate |
|00002310| 63 61 6c 65 6e 64 61 72 | 20 66 6f 72 20 65 6e 74 |calendar| for ent|
|00002320| 69 72 65 20 79 65 61 72 | 20 79 79 0a 20 2a 0a 20 |ire year| yy. *. |
|00002330| 2a 09 09 70 63 61 6c 20 | 5b 6f 70 74 73 5d 20 6d |*..pcal |[opts] m|
|00002340| 6d 20 79 79 09 67 65 6e | 65 72 61 74 65 20 63 61 |m yy.gen|erate ca|
|00002350| 6c 65 6e 64 61 72 20 66 | 6f 72 20 6d 6f 6e 74 68 |lendar f|or month|
|00002360| 20 6d 6d 0a 20 2a 09 09 | 09 09 09 28 4a 61 6e 20 | mm. *..|...(Jan |
|00002370| 3d 20 31 29 2c 20 79 65 | 61 72 20 79 79 20 28 31 |= 1), ye|ar yy (1|
|00002380| 39 79 79 20 69 66 20 79 | 79 20 3c 20 31 30 30 29 |9yy if y|y < 100)|
|00002390| 0a 20 2a 0a 20 2a 09 09 | 70 63 61 6c 20 5b 6f 70 |. *. *..|pcal [op|
|000023a0| 74 73 5d 20 6d 6d 20 79 | 79 20 6e 09 61 73 20 61 |ts] mm y|y n.as a|
|000023b0| 62 6f 76 65 2c 20 66 6f | 72 20 6e 20 63 6f 6e 73 |bove, fo|r n cons|
|000023c0| 65 63 75 74 69 76 65 20 | 6d 6f 6e 74 68 73 0a 20 |ecutive |months. |
|000023d0| 2a 0a 20 2a 09 4f 75 74 | 70 75 74 3a 0a 20 2a 0a |*. *.Out|put:. *.|
|000023e0| 20 2a 09 09 50 6f 73 74 | 53 63 72 69 70 74 20 66 | *..Post|Script f|
|000023f0| 69 6c 65 20 74 6f 20 70 | 72 69 6e 74 20 63 61 6c |ile to p|rint cal|
|00002400| 65 6e 64 61 72 73 20 66 | 6f 72 20 61 6c 6c 20 73 |endars f|or all s|
|00002410| 65 6c 65 63 74 65 64 20 | 6d 6f 6e 74 68 73 2e 0a |elected |months..|
|00002420| 20 2a 0a 20 2a 09 4f 70 | 74 69 6f 6e 73 3a 0a 20 | *. *.Op|tions:. |
|00002430| 2a 0a 20 2a 09 09 2d 62 | 20 3c 44 41 59 3e 09 70 |*. *..-b| <DAY>.p|
|00002440| 72 69 6e 74 20 73 70 65 | 63 69 66 69 65 64 20 77 |rint spe|cified w|
|00002450| 65 65 6b 64 61 79 20 69 | 6e 20 62 6c 61 63 6b 0a |eekday i|n black.|
|00002460| 20 2a 09 09 2d 67 20 3c | 44 41 59 3e 09 70 72 69 | *..-g <|DAY>.pri|
|00002470| 6e 74 20 73 70 65 63 69 | 66 69 65 64 20 77 65 65 |nt speci|fied wee|
|00002480| 6b 64 61 79 20 69 6e 20 | 67 72 61 79 0a 20 2a 09 |kday in |gray. *.|
|00002490| 09 09 09 28 64 65 66 61 | 75 6c 74 3a 20 70 72 69 |...(defa|ult: pri|
|000024a0| 6e 74 20 53 61 74 75 72 | 64 61 79 73 20 61 6e 64 |nt Satur|days and|
|000024b0| 20 53 75 6e 64 61 79 73 | 20 69 6e 20 67 72 61 79 | Sundays| in gray|
|000024c0| 29 0a 20 2a 09 09 0a 20 | 2a 09 09 2d 64 20 3c 46 |). *... |*..-d <F|
|000024d0| 4f 4e 54 3e 09 73 70 65 | 63 69 66 79 20 61 6c 74 |ONT>.spe|cify alt|
|000024e0| 65 72 6e 61 74 65 20 66 | 6f 6e 74 20 66 6f 72 20 |ernate f|ont for |
|000024f0| 64 61 79 20 6e 61 6d 65 | 73 0a 20 2a 09 09 09 09 |day name|s. *....|
|00002500| 28 64 65 66 61 75 6c 74 | 3a 20 54 69 6d 65 73 2d |(default|: Times-|
|00002510| 42 6f 6c 64 29 0a 20 2a | 0a 20 2a 09 09 2d 6e 20 |Bold). *|. *..-n |
|00002520| 3c 46 4f 4e 54 3e 09 73 | 70 65 63 69 66 79 20 61 |<FONT>.s|pecify a|
|00002530| 6c 74 65 72 6e 61 74 65 | 20 66 6f 6e 74 20 66 6f |lternate| font fo|
|00002540| 72 20 6e 6f 74 65 73 20 | 69 6e 20 62 6f 78 65 73 |r notes |in boxes|
|00002550| 0a 20 2a 09 09 09 09 28 | 64 65 66 61 75 6c 74 3a |. *....(|default:|
|00002560| 20 48 65 6c 76 65 74 69 | 63 61 2d 4e 61 72 72 6f | Helveti|ca-Narro|
|00002570| 77 29 0a 20 2a 0a 20 2a | 09 09 2d 74 20 3c 46 4f |w). *. *|..-t <FO|
|00002580| 4e 54 3e 09 73 70 65 63 | 69 66 79 20 61 6c 74 65 |NT>.spec|ify alte|
|00002590| 72 6e 61 74 65 20 66 6f | 6e 74 20 66 6f 72 20 74 |rnate fo|nt for t|
|000025a0| 69 74 6c 65 73 0a 20 2a | 09 09 09 09 28 64 65 66 |itles. *|....(def|
|000025b0| 61 75 6c 74 3a 20 54 69 | 6d 65 73 2d 42 6f 6c 64 |ault: Ti|mes-Bold|
|000025c0| 29 0a 20 2a 0a 20 2a 09 | 09 2d 44 20 3c 53 59 4d |). *. *.|.-D <SYM|
|000025d0| 3e 09 64 65 66 69 6e 65 | 20 70 72 65 70 72 6f 63 |>.define| preproc|
|000025e0| 65 73 73 6f 72 20 73 79 | 6d 62 6f 6c 0a 20 2a 09 |essor sy|mbol. *.|
|000025f0| 09 2d 55 20 3c 53 59 4d | 3e 09 75 6e 2d 64 65 66 |.-U <SYM|>.un-def|
|00002600| 69 6e 65 20 70 72 65 70 | 72 6f 63 65 73 73 6f 72 |ine prep|rocessor|
|00002610| 20 73 79 6d 62 6f 6c 0a | 20 2a 0a 20 2a 09 09 2d | symbol.| *. *..-|
|00002620| 65 09 09 67 65 6e 65 72 | 61 74 65 20 65 6d 70 74 |e..gener|ate empt|
|00002630| 79 20 63 61 6c 65 6e 64 | 61 72 20 28 69 67 6e 6f |y calend|ar (igno|
|00002640| 72 65 20 64 61 74 65 20 | 66 69 6c 65 29 0a 20 2a |re date |file). *|
|00002650| 0a 20 2a 09 09 2d 66 20 | 3c 46 49 4c 45 3e 09 73 |. *..-f |<FILE>.s|
|00002660| 70 65 63 69 66 79 20 61 | 6c 74 65 72 6e 61 74 65 |pecify a|lternate|
|00002670| 20 64 61 74 65 20 66 69 | 6c 65 20 28 64 65 66 61 | date fi|le (defa|
|00002680| 75 6c 74 3a 0a 20 2a 09 | 09 09 09 7e 2f 2e 63 61 |ult:. *.|...~/.ca|
|00002690| 6c 65 6e 64 61 72 20 6f | 6e 20 55 6e 2a 78 2c 20 |lendar o|n Un*x, |
|000026a0| 53 59 53 24 4c 4f 47 49 | 4e 3a 43 41 4c 45 4e 44 |SYS$LOGI|N:CALEND|
|000026b0| 41 52 2e 44 41 54 0a 20 | 2a 09 09 09 09 6f 6e 20 |AR.DAT. |*....on |
|000026c0| 56 4d 53 3b 20 69 66 20 | 65 6e 76 69 72 6f 6e 6d |VMS; if |environm|
|000026d0| 65 6e 74 20 76 61 72 69 | 61 62 6c 65 20 5b 6c 6f |ent vari|able [lo|
|000026e0| 67 69 63 61 6c 0a 20 2a | 09 09 09 09 6e 61 6d 65 |gical. *|....name|
|000026f0| 20 6f 6e 20 56 4d 53 5d | 20 50 43 41 4c 5f 44 49 | on VMS]| PCAL_DI|
|00002700| 52 20 65 78 69 73 74 73 | 2c 20 6c 6f 6f 6b 73 20 |R exists|, looks |
|00002710| 74 68 65 72 65 0a 20 2a | 09 09 09 09 69 6e 73 74 |there. *|....inst|
|00002720| 65 61 64 29 0a 20 2a 0a | 20 2a 09 09 2d 6f 20 3c |ead). *.| *..-o <|
|00002730| 46 49 4c 45 3e 09 73 70 | 65 63 69 66 79 20 61 6c |FILE>.sp|ecify al|
|00002740| 74 65 72 6e 61 74 65 20 | 6f 75 74 70 75 74 20 66 |ternate |output f|
|00002750| 69 6c 65 20 28 64 65 66 | 61 75 6c 74 3a 0a 20 2a |ile (def|ault:. *|
|00002760| 09 09 09 09 73 74 64 6f | 75 74 20 6f 6e 20 55 6e |....stdo|ut on Un|
|00002770| 2a 78 2c 20 43 41 4c 45 | 4e 44 41 52 2e 50 53 20 |*x, CALE|NDAR.PS |
|00002780| 6f 6e 20 56 4d 53 29 0a | 20 2a 0a 20 2a 09 09 2d |on VMS).| *. *..-|
|00002790| 4c 20 3c 53 54 52 49 4e | 47 3e 09 73 70 65 63 69 |L <STRIN|G>.speci|
|000027a0| 66 79 20 6c 65 66 74 20 | 66 6f 6f 74 20 73 74 72 |fy left |foot str|
|000027b0| 69 6e 67 20 20 20 28 64 | 65 66 61 75 6c 74 3a 20 |ing (d|efault: |
|000027c0| 22 22 29 0a 20 2a 09 09 | 2d 43 20 3c 53 54 52 49 |""). *..|-C <STRI|
|000027d0| 4e 47 3e 09 73 70 65 63 | 69 66 79 20 63 65 6e 74 |NG>.spec|ify cent|
|000027e0| 65 72 20 66 6f 6f 74 20 | 73 74 72 69 6e 67 20 28 |er foot |string (|
|000027f0| 64 65 66 61 75 6c 74 3a | 20 22 22 29 0a 20 2a 09 |default:| ""). *.|
|00002800| 09 2d 52 20 3c 53 54 52 | 49 4e 47 3e 09 73 70 65 |.-R <STR|ING>.spe|
|00002810| 63 69 66 79 20 72 69 67 | 68 74 20 66 6f 6f 74 20 |cify rig|ht foot |
|00002820| 73 74 72 69 6e 67 20 20 | 28 64 65 66 61 75 6c 74 |string |(default|
|00002830| 3a 20 22 22 29 0a 20 2a | 0a 20 2a 09 09 2d 6c 09 |: ""). *|. *..-l.|
|00002840| 09 67 65 6e 65 72 61 74 | 65 20 6c 61 6e 64 73 63 |.generat|e landsc|
|00002850| 61 70 65 2d 6d 6f 64 65 | 20 63 61 6c 65 6e 64 61 |ape-mode| calenda|
|00002860| 72 73 0a 20 2a 09 09 2d | 70 09 09 67 65 6e 65 72 |rs. *..-|p..gener|
|00002870| 61 74 65 20 70 6f 72 74 | 72 61 69 74 2d 6d 6f 64 |ate port|rait-mod|
|00002880| 65 20 63 61 6c 65 6e 64 | 61 72 73 0a 20 2a 09 09 |e calend|ars. *..|
|00002890| 09 09 28 64 65 66 61 75 | 6c 74 3a 20 6c 61 6e 64 |..(defau|lt: land|
|000028a0| 73 63 61 70 65 2d 6d 6f | 64 65 29 0a 20 2a 0a 20 |scape-mo|de). *. |
|000028b0| 2a 09 54 68 65 72 65 20 | 61 72 65 20 6d 61 6e 79 |*.There |are many|
|000028c0| 20 77 61 79 73 20 74 6f | 20 73 70 65 63 69 66 79 | ways to| specify|
|000028d0| 20 74 68 65 73 65 20 6f | 70 74 69 6f 6e 73 20 69 | these o|ptions i|
|000028e0| 6e 20 61 64 64 69 74 69 | 6f 6e 20 74 6f 20 75 73 |n additi|on to us|
|000028f0| 69 6e 67 20 74 68 65 0a | 20 2a 09 63 6f 6d 6d 61 |ing the.| *.comma|
|00002900| 6e 64 20 6c 69 6e 65 3b | 20 74 68 69 73 20 66 61 |nd line;| this fa|
|00002910| 63 69 6c 69 74 61 74 65 | 73 20 63 75 73 74 6f 6d |cilitate|s custom|
|00002920| 69 7a 61 74 69 6f 6e 20 | 74 6f 20 74 68 65 20 75 |ization |to the u|
|00002930| 73 65 72 27 73 20 6e 65 | 65 64 73 2e 0a 20 2a 0a |ser's ne|eds.. *.|
|00002940| 20 2a 09 49 66 20 74 68 | 65 20 65 6e 76 69 72 6f | *.If th|e enviro|
|00002950| 6e 6d 65 6e 74 20 76 61 | 72 69 61 62 6c 65 20 28 |nment va|riable (|
|00002960| 67 6c 6f 62 61 6c 20 73 | 79 6d 62 6f 6c 20 6f 6e |global s|ymbol on|
|00002970| 20 56 4d 53 29 20 50 43 | 41 4c 5f 4f 50 54 53 20 | VMS) PC|AL_OPTS |
|00002980| 69 73 0a 20 2a 09 70 72 | 65 73 65 6e 74 2c 20 69 |is. *.pr|esent, i|
|00002990| 74 73 20 76 61 6c 75 65 | 20 77 69 6c 6c 20 62 65 |ts value| will be|
|000029a0| 20 70 61 72 73 65 64 20 | 61 73 20 69 66 20 69 74 | parsed |as if it|
|000029b0| 20 77 65 72 65 20 61 20 | 63 6f 6d 6d 61 6e 64 20 | were a |command |
|000029c0| 6c 69 6e 65 2e 0a 20 2a | 09 41 6e 79 20 6f 70 74 |line.. *|.Any opt|
|000029d0| 69 6f 6e 73 20 73 70 65 | 63 69 66 69 65 64 20 77 |ions spe|cified w|
|000029e0| 69 6c 6c 20 6f 76 65 72 | 72 69 64 65 20 74 68 65 |ill over|ride the|
|000029f0| 20 70 72 6f 67 72 61 6d | 20 64 65 66 61 75 6c 74 | program| default|
|00002a00| 73 2e 0a 20 2a 0a 20 2a | 09 41 6c 6c 20 62 75 74 |s.. *. *|.All but|
|00002a10| 20 74 68 65 20 2d 65 2c | 20 2d 66 2c 20 2d 44 2c | the -e,| -f, -D,|
|00002a20| 20 61 6e 64 20 2d 55 20 | 6f 70 74 69 6f 6e 73 20 | and -U |options |
|00002a30| 6d 61 79 20 62 65 20 73 | 70 65 63 69 66 69 65 64 |may be s|pecified|
|00002a40| 20 69 6e 20 74 68 65 20 | 64 61 74 65 0a 20 2a 09 | in the |date. *.|
|00002a50| 66 69 6c 65 20 62 79 20 | 74 68 65 20 69 6e 63 6c |file by |the incl|
|00002a60| 75 73 69 6f 6e 20 6f 66 | 20 6f 6e 65 20 6f 72 20 |usion of| one or |
|00002a70| 6d 6f 72 65 20 6c 69 6e | 65 73 20 6f 66 20 74 68 |more lin|es of th|
|00002a80| 65 20 66 6f 72 6d 20 22 | 6f 70 74 20 3c 6f 70 74 |e form "|opt <opt|
|00002a90| 69 6f 6e 73 3e 22 2e 0a | 20 2a 09 41 6e 79 20 73 |ions>"..| *.Any s|
|00002aa0| 75 63 68 20 6f 70 74 69 | 6f 6e 73 20 6f 76 65 72 |uch opti|ons over|
|00002ab0| 72 69 64 65 20 61 6e 79 | 20 70 72 65 76 69 6f 75 |ride any| previou|
|00002ac0| 73 20 76 61 6c 75 65 73 | 20 73 65 74 20 65 69 74 |s values| set eit|
|00002ad0| 68 65 72 20 61 73 20 70 | 72 6f 67 72 61 6d 0a 20 |her as p|rogram. |
|00002ae0| 2a 09 64 65 66 61 75 6c | 74 73 2c 20 76 69 61 20 |*.defaul|ts, via |
|00002af0| 50 43 41 4c 5f 4f 50 54 | 53 2c 20 6f 72 20 69 6e |PCAL_OPT|S, or in|
|00002b00| 20 70 72 65 76 69 6f 75 | 73 20 22 6f 70 74 22 20 | previou|s "opt" |
|00002b10| 6c 69 6e 65 73 2e 0a 20 | 2a 0a 20 2a 09 4f 70 74 |lines.. |*. *.Opt|
|00002b20| 69 6f 6e 73 20 65 78 70 | 6c 69 63 69 74 6c 79 20 |ions exp|licitly |
|00002b30| 73 70 65 63 69 66 69 65 | 64 20 6f 6e 20 74 68 65 |specifie|d on the|
|00002b40| 20 63 6f 6d 6d 61 6e 64 | 20 6c 69 6e 65 20 69 6e | command| line in|
|00002b50| 20 74 75 72 6e 20 6f 76 | 65 72 72 69 64 65 20 61 | turn ov|erride a|
|00002b60| 6c 6c 0a 20 2a 09 6f 66 | 20 74 68 65 20 61 62 6f |ll. *.of| the abo|
|00002b70| 76 65 2e 0a 20 2a 0a 20 | 2a 09 54 68 65 20 2d 62 |ve.. *. |*.The -b|
|00002b80| 2c 20 2d 64 2c 20 2d 67 | 2c 20 2d 6e 2c 20 2d 6f |, -d, -g|, -n, -o|
|00002b90| 2c 20 2d 74 2c 20 2d 43 | 2c 20 2d 4c 2c 20 61 6e |, -t, -C|, -L, an|
|00002ba0| 64 20 2d 52 20 66 6c 61 | 67 73 20 6d 61 79 20 62 |d -R fla|gs may b|
|00002bb0| 65 20 73 70 65 63 69 66 | 69 65 64 20 61 74 0a 20 |e specif|ied at. |
|00002bc0| 2a 09 61 6e 79 20 70 6f | 69 6e 74 20 74 6f 20 72 |*.any po|int to r|
|00002bd0| 65 73 65 74 20 74 68 65 | 20 63 6f 72 72 65 73 70 |eset the| corresp|
|00002be0| 6f 6e 64 69 6e 67 20 6f | 70 74 69 6f 6e 20 74 6f |onding o|ption to|
|00002bf0| 20 69 74 73 20 64 65 66 | 61 75 6c 74 2e 20 20 2d | its def|ault. -|
|00002c00| 44 20 6d 61 79 0a 20 2a | 09 62 65 20 73 70 65 63 |D may. *|.be spec|
|00002c10| 69 66 69 65 64 20 77 69 | 74 68 6f 75 74 20 61 6e |ified wi|thout an|
|00002c20| 20 61 72 67 75 6d 65 6e | 74 20 69 6e 20 6f 72 64 | argumen|t in ord|
|00002c30| 65 72 20 74 6f 20 75 6e | 2d 64 65 66 69 6e 65 20 |er to un|-define |
|00002c40| 61 6c 6c 20 73 79 6d 62 | 6f 6c 73 2e 0a 20 2a 0a |all symb|ols.. *.|
|00002c50| 20 2a 09 50 61 72 61 6d | 65 74 65 72 73 20 61 6e | *.Param|eters an|
|00002c60| 64 20 66 6c 61 67 73 20 | 6d 61 79 20 62 65 20 6d |d flags |may be m|
|00002c70| 69 78 65 64 20 6f 6e 20 | 74 68 65 20 63 6f 6d 6d |ixed on |the comm|
|00002c80| 61 6e 64 20 6c 69 6e 65 | 2e 20 20 49 6e 20 73 6f |and line|. In so|
|00002c90| 6d 65 20 63 61 73 65 73 | 0a 20 2a 09 28 65 2e 67 |me cases|. *.(e.g|
|00002ca0| 2e 2c 20 77 68 65 6e 20 | 61 20 70 61 72 61 6d 65 |., when |a parame|
|00002cb0| 74 65 72 20 66 6f 6c 6c | 6f 77 73 20 61 20 66 6c |ter foll|ows a fl|
|00002cc0| 61 67 20 77 69 74 68 6f | 75 74 20 69 74 73 20 6f |ag witho|ut its o|
|00002cd0| 70 74 69 6f 6e 61 6c 20 | 61 72 67 75 6d 65 6e 74 |ptional |argument|
|00002ce0| 29 0a 20 2a 09 74 68 69 | 73 20 6d 61 79 20 6c 65 |). *.thi|s may le|
|00002cf0| 61 64 20 74 6f 20 61 6d | 62 69 67 75 69 74 79 3b |ad to am|biguity;|
|00002d00| 20 74 68 65 20 64 75 6d | 6d 79 20 66 6c 61 67 20 | the dum|my flag |
|00002d10| 27 2d 27 20 28 6f 72 20 | 27 2d 2d 27 29 20 6d 61 |'-' (or |'--') ma|
|00002d20| 79 20 62 65 20 75 73 65 | 64 0a 20 2a 09 74 6f 20 |y be use|d. *.to |
|00002d30| 73 65 70 61 72 61 74 65 | 20 74 68 65 6d 2c 20 69 |separate| them, i|
|00002d40| 2e 65 2e 20 22 70 63 61 | 6c 20 2d 74 20 2d 20 39 |.e. "pca|l -t - 9|
|00002d50| 20 39 30 22 2e 0a 20 2a | 0a 20 2a 09 53 69 6d 70 | 90".. *|. *.Simp|
|00002d60| 6c 65 20 63 70 70 2d 6c | 69 6b 65 20 66 75 6e 63 |le cpp-l|ike func|
|00002d70| 74 69 6f 6e 61 6c 69 74 | 79 20 69 73 20 70 72 6f |tionalit|y is pro|
|00002d80| 76 69 64 65 64 2e 20 20 | 54 68 65 20 64 61 74 65 |vided. |The date|
|00002d90| 20 66 69 6c 65 20 6d 61 | 79 20 69 6e 63 6c 75 64 | file ma|y includ|
|00002da0| 65 0a 20 2a 09 74 68 65 | 20 66 6f 6c 6c 6f 77 69 |e. *.the| followi|
|00002db0| 6e 67 20 63 6f 6d 6d 61 | 6e 64 73 2c 20 77 68 69 |ng comma|nds, whi|
|00002dc0| 63 68 20 77 6f 72 6b 20 | 6c 69 6b 65 20 74 68 65 |ch work |like the|
|00002dd0| 69 72 20 63 70 70 20 63 | 6f 75 6e 74 65 72 70 61 |ir cpp c|ounterpa|
|00002de0| 72 74 73 3a 0a 20 2a 0a | 20 2a 09 09 64 65 66 69 |rts:. *.| *..defi|
|00002df0| 6e 65 20 3c 73 79 6d 3e | 0a 20 2a 09 09 75 6e 64 |ne <sym>|. *..und|
|00002e00| 65 66 20 3c 73 79 6d 3e | 0a 20 2a 0a 20 2a 09 09 |ef <sym>|. *. *..|
|00002e10| 69 66 7b 6e 7d 64 65 66 | 20 3c 73 79 6d 3e 0a 20 |if{n}def| <sym>. |
|00002e20| 2a 09 09 20 20 20 2e 2e | 2e 0a 20 2a 09 09 7b 20 |*.. ..|.. *..{ |
|00002e30| 65 6c 73 65 0a 20 2a 09 | 09 20 20 20 2e 2e 2e 20 |else. *.|. ... |
|00002e40| 7d 0a 20 2a 09 09 65 6e | 64 69 66 0a 20 2a 0a 20 |}. *..en|dif. *. |
|00002e50| 2a 09 09 69 6e 63 6c 75 | 64 65 20 3c 66 69 6c 65 |*..inclu|de <file|
|00002e60| 3e 0a 20 2a 0a 20 2a 09 | 4e 6f 74 65 20 74 68 61 |>. *. *.|Note tha|
|00002e70| 74 20 74 68 65 73 65 20 | 64 6f 20 6e 6f 74 20 73 |t these |do not s|
|00002e80| 74 61 72 74 20 77 69 74 | 68 20 27 23 27 2c 20 77 |tart wit|h '#', w|
|00002e90| 68 69 63 68 20 69 73 20 | 72 65 73 65 72 76 65 64 |hich is |reserved|
|00002ea0| 20 61 73 20 61 20 63 6f | 6d 6d 65 6e 74 0a 20 2a | as a co|mment. *|
|00002eb0| 09 63 68 61 72 61 63 74 | 65 72 2e 0a 20 2a 0a 20 |.charact|er.. *. |
|00002ec0| 2a 09 22 64 65 66 69 6e | 65 22 20 61 6c 6f 6e 65 |*."defin|e" alone|
|00002ed0| 20 64 65 6c 65 74 65 73 | 20 61 6c 6c 20 74 68 65 | deletes| all the|
|00002ee0| 20 63 75 72 72 65 6e 74 | 20 64 65 66 69 6e 69 74 | current| definit|
|00002ef0| 69 6f 6e 73 3b 20 22 69 | 66 64 65 66 22 20 61 6c |ions; "i|fdef" al|
|00002f00| 6f 6e 65 20 69 73 0a 20 | 2a 09 61 6c 77 61 79 73 |one is. |*.always|
|00002f10| 20 66 61 6c 73 65 3b 20 | 22 69 66 6e 64 65 66 22 | false; |"ifndef"|
|00002f20| 20 61 6c 6f 6e 65 20 69 | 73 20 61 6c 77 61 79 73 | alone i|s always|
|00002f30| 20 74 72 75 65 2e 20 20 | 41 6c 6c 20 64 65 66 69 | true. |All defi|
|00002f40| 6e 65 64 20 73 79 6d 62 | 6f 6c 73 20 61 72 65 0a |ned symb|ols are.|
|00002f50| 20 2a 09 74 72 65 61 74 | 65 64 20 69 6e 20 61 20 | *.treat|ed in a |
|00002f60| 63 61 73 65 2d 69 6e 73 | 65 6e 73 69 74 69 76 65 |case-ins|ensitive|
|00002f70| 20 6d 61 6e 6e 65 72 2e | 0a 20 2a 0a 20 2a 09 54 | manner.|. *. *.T|
|00002f80| 68 65 20 66 69 6c 65 20 | 6e 61 6d 65 20 69 6e 20 |he file |name in |
|00002f90| 74 68 65 20 22 69 6e 63 | 6c 75 64 65 22 20 64 69 |the "inc|lude" di|
|00002fa0| 72 65 63 74 69 76 65 20 | 6d 61 79 20 6f 70 74 69 |rective |may opti|
|00002fb0| 6f 6e 61 6c 6c 79 20 62 | 65 20 73 75 72 72 6f 75 |onally b|e surrou|
|00002fc0| 6e 64 65 64 0a 20 2a 09 | 62 79 20 22 22 20 6f 72 |nded. *.|by "" or|
|00002fd0| 20 3c 3e 2e 0a 20 2a 0a | 20 2a 2f 0a 0a 0c 0a 23 | <>.. *.| */....#|
|00002fe0| 69 6e 63 6c 75 64 65 20 | 3c 73 74 64 69 6f 2e 68 |include |<stdio.h|
|00002ff0| 3e 0a 23 69 6e 63 6c 75 | 64 65 20 3c 63 74 79 70 |>.#inclu|de <ctyp|
|00003000| 65 2e 68 3e 0a 23 69 6e | 63 6c 75 64 65 20 3c 74 |e.h>.#in|clude <t|
|00003010| 69 6d 65 2e 68 3e 0a 23 | 69 6e 63 6c 75 64 65 20 |ime.h>.#|include |
|00003020| 3c 73 74 72 69 6e 67 2e | 68 3e 0a 0a 23 69 66 64 |<string.|h>..#ifd|
|00003030| 65 66 20 56 4d 53 09 09 | 2f 2a 20 56 4d 53 20 6f |ef VMS..|/* VMS o|
|00003040| 64 64 69 74 69 65 73 20 | 69 73 6f 6c 61 74 65 64 |ddities |isolated|
|00003050| 20 68 65 72 65 20 2a 2f | 0a 0a 23 69 6e 63 6c 75 | here */|..#inclu|
|00003060| 64 65 20 3c 73 73 64 65 | 66 2e 68 3e 09 2f 2a 20 |de <ssde|f.h>./* |
|00003070| 72 65 71 75 69 72 65 64 | 20 66 6f 72 20 74 72 6e |required| for trn|
|00003080| 6c 6f 67 28 29 20 2a 2f | 0a 23 69 6e 63 6c 75 64 |log() */|.#includ|
|00003090| 65 20 3c 64 65 73 63 72 | 69 70 2e 68 3e 0a 0a 23 |e <descr|ip.h>..#|
|000030a0| 64 65 66 69 6e 65 20 48 | 4f 4d 45 5f 44 49 52 09 |define H|OME_DIR.|
|000030b0| 22 53 59 53 24 4c 4f 47 | 49 4e 22 0a 23 64 65 66 |"SYS$LOG|IN".#def|
|000030c0| 69 6e 65 20 44 41 54 45 | 46 49 4c 45 09 22 63 61 |ine DATE|FILE."ca|
|000030d0| 6c 65 6e 64 61 72 2e 64 | 61 74 22 0a 23 64 65 66 |lendar.d|at".#def|
|000030e0| 69 6e 65 20 4f 55 54 46 | 49 4c 45 09 09 22 63 61 |ine OUTF|ILE.."ca|
|000030f0| 6c 65 6e 64 61 72 2e 70 | 73 22 0a 23 64 65 66 69 |lendar.p|s".#defi|
|00003100| 6e 65 20 53 54 41 52 54 | 5f 50 41 54 48 09 27 5b |ne START|_PATH.'[|
|00003110| 27 0a 23 64 65 66 69 6e | 65 20 45 4e 44 5f 50 41 |'.#defin|e END_PA|
|00003120| 54 48 09 27 5d 27 0a 0a | 23 64 65 66 69 6e 65 20 |TH.']'..|#define |
|00003130| 45 58 49 54 5f 53 55 43 | 43 45 53 53 20 31 0a 23 |EXIT_SUC|CESS 1.#|
|00003140| 64 65 66 69 6e 65 20 45 | 58 49 54 5f 46 41 49 4c |define E|XIT_FAIL|
|00003150| 55 52 45 20 33 0a 0a 23 | 65 6c 73 65 09 09 09 2f |URE 3..#|else.../|
|00003160| 2a 20 6e 6f 6e 2d 56 4d | 53 20 2d 20 61 73 73 75 |* non-VM|S - assu|
|00003170| 6d 65 20 55 6e 2a 78 20 | 6f 66 20 73 6f 6d 65 20 |me Un*x |of some |
|00003180| 73 6f 72 74 20 2a 2f 0a | 0a 23 64 65 66 69 6e 65 |sort */.|.#define|
|00003190| 20 48 4f 4d 45 5f 44 49 | 52 09 22 48 4f 4d 45 22 | HOME_DI|R."HOME"|
|000031a0| 0a 23 64 65 66 69 6e 65 | 20 44 41 54 45 46 49 4c |.#define| DATEFIL|
|000031b0| 45 09 22 2e 63 61 6c 65 | 6e 64 61 72 22 0a 23 64 |E.".cale|ndar".#d|
|000031c0| 65 66 69 6e 65 20 41 4c | 54 5f 44 41 54 45 46 49 |efine AL|T_DATEFI|
|000031d0| 4c 45 09 22 63 61 6c 65 | 6e 64 61 72 22 09 2f 2a |LE."cale|ndar"./*|
|000031e0| 20 66 6f 72 20 62 61 63 | 6b 77 61 72 64 20 63 6f | for bac|kward co|
|000031f0| 6d 70 61 74 69 62 69 6c | 69 74 79 20 2a 2f 0a 23 |mpatibil|ity */.#|
|00003200| 64 65 66 69 6e 65 20 4f | 55 54 46 49 4c 45 09 09 |define O|UTFILE..|
|00003210| 22 22 0a 23 64 65 66 69 | 6e 65 20 53 54 41 52 54 |"".#defi|ne START|
|00003220| 5f 50 41 54 48 09 27 2f | 27 0a 23 64 65 66 69 6e |_PATH.'/|'.#defin|
|00003230| 65 20 45 4e 44 5f 50 41 | 54 48 09 27 2f 27 0a 0a |e END_PA|TH.'/'..|
|00003240| 23 64 65 66 69 6e 65 20 | 45 58 49 54 5f 53 55 43 |#define |EXIT_SUC|
|00003250| 43 45 53 53 20 30 0a 23 | 64 65 66 69 6e 65 20 45 |CESS 0.#|define E|
|00003260| 58 49 54 5f 46 41 49 4c | 55 52 45 20 31 0a 0a 23 |XIT_FAIL|URE 1..#|
|00003270| 65 6e 64 69 66 0a 0a 23 | 64 65 66 69 6e 65 20 50 |endif..#|define P|
|00003280| 43 41 4c 5f 4f 50 54 53 | 09 22 50 43 41 4c 5f 4f |CAL_OPTS|."PCAL_O|
|00003290| 50 54 53 22 09 2f 2a 20 | 65 6e 76 69 72 6f 6e 6d |PTS"./* |environm|
|000032a0| 65 6e 74 20 76 61 72 69 | 61 62 6c 65 73 20 2a 2f |ent vari|ables */|
|000032b0| 0a 23 64 65 66 69 6e 65 | 20 50 43 41 4c 5f 44 49 |.#define| PCAL_DI|
|000032c0| 52 09 22 50 43 41 4c 5f | 44 49 52 22 0a 0a 23 64 |R."PCAL_|DIR"..#d|
|000032d0| 65 66 69 6e 65 20 49 53 | 5f 4c 45 41 50 28 79 29 |efine IS|_LEAP(y)|
|000032e0| 09 28 28 79 29 20 25 20 | 34 20 3d 3d 20 30 20 26 |.((y) % |4 == 0 &|
|000032f0| 26 20 28 28 79 29 20 25 | 20 31 30 30 20 21 3d 20 |& ((y) %| 100 != |
|00003300| 30 20 7c 7c 20 28 79 29 | 20 25 20 34 30 30 20 3d |0 || (y)| % 400 =|
|00003310| 3d 20 30 29 29 0a 23 64 | 65 66 69 6e 65 20 49 4e |= 0)).#d|efine IN|
|00003320| 49 54 5f 43 4f 4c 4f 52 | 53 09 6d 65 6d 63 70 79 |IT_COLOR|S.memcpy|
|00003330| 28 63 6f 6c 6f 72 2c 20 | 64 65 66 61 75 6c 74 5f |(color, |default_|
|00003340| 63 6f 6c 6f 72 2c 20 73 | 69 7a 65 6f 66 28 63 6f |color, s|izeof(co|
|00003350| 6c 6f 72 29 29 0a 23 64 | 65 66 69 6e 65 20 4c 41 |lor)).#d|efine LA|
|00003360| 53 54 43 48 41 52 28 70 | 29 09 28 28 70 29 20 26 |STCHAR(p|).((p) &|
|00003370| 26 20 2a 28 70 29 20 3f | 20 28 70 29 20 2b 20 73 |& *(p) ?| (p) + s|
|00003380| 74 72 6c 65 6e 28 70 29 | 20 2d 20 31 20 3a 20 4e |trlen(p)| - 1 : N|
|00003390| 55 4c 4c 29 0a 0a 23 69 | 66 64 65 66 20 5f 5f 53 |ULL)..#i|fdef __S|
|000033a0| 54 44 43 5f 5f 0a 23 64 | 65 66 69 6e 65 20 54 4f |TDC__.#d|efine TO|
|000033b0| 4c 4f 57 45 52 28 63 29 | 09 74 6f 6c 6f 77 65 72 |LOWER(c)|.tolower|
|000033c0| 28 63 29 0a 23 65 6c 73 | 65 0a 23 64 65 66 69 6e |(c).#els|e.#defin|
|000033d0| 65 20 54 4f 4c 4f 57 45 | 52 28 63 29 09 28 69 73 |e TOLOWE|R(c).(is|
|000033e0| 75 70 70 65 72 28 63 29 | 20 3f 20 74 6f 6c 6f 77 |upper(c)| ? tolow|
|000033f0| 65 72 28 63 29 20 3a 20 | 28 63 29 29 0a 23 65 6e |er(c) : |(c)).#en|
|00003400| 64 69 66 0a 0a 23 64 65 | 66 69 6e 65 20 50 52 54 |dif..#de|fine PRT|
|00003410| 09 09 28 76 6f 69 64 29 | 70 72 69 6e 74 66 0a 23 |..(void)|printf.#|
|00003420| 64 65 66 69 6e 65 20 46 | 50 52 09 09 28 76 6f 69 |define F|PR..(voi|
|00003430| 64 29 66 70 72 69 6e 74 | 66 0a 0a 23 64 65 66 69 |d)fprint|f..#defi|
|00003440| 6e 65 20 46 41 4c 53 45 | 09 30 0a 23 64 65 66 69 |ne FALSE|.0.#defi|
|00003450| 6e 65 20 54 52 55 45 09 | 31 0a 0a 23 64 65 66 69 |ne TRUE.|1..#defi|
|00003460| 6e 65 20 41 4c 4c 5f 46 | 4c 41 47 53 09 22 62 43 |ne ALL_F|LAGS."bC|
|00003470| 44 64 65 66 67 4c 6c 6e | 6f 70 52 74 55 22 09 2f |DdefgLln|opRtU"./|
|00003480| 2a 20 61 6c 6c 20 63 6f | 6d 6d 61 6e 64 2d 6c 69 |* all co|mmand-li|
|00003490| 6e 65 20 66 6c 61 67 73 | 20 2a 2f 0a 23 64 65 66 |ne flags| */.#def|
|000034a0| 69 6e 65 20 44 41 54 45 | 46 49 4c 45 5f 46 4c 41 |ine DATE|FILE_FLA|
|000034b0| 47 53 09 22 44 65 66 55 | 22 09 09 09 2f 2a 20 70 |GS."DefU|".../* p|
|000034c0| 61 72 73 65 64 20 62 65 | 66 6f 72 65 20 6f 70 65 |arsed be|fore ope|
|000034d0| 6e 69 6e 67 20 64 61 74 | 65 66 69 6c 65 20 2a 2f |ning dat|efile */|
|000034e0| 0a 23 64 65 66 69 6e 65 | 20 4f 54 48 45 52 5f 46 |.#define| OTHER_F|
|000034f0| 4c 41 47 53 09 22 62 43 | 64 67 4c 6c 6e 6f 70 52 |LAGS."bC|dgLlnopR|
|00003500| 74 22 09 09 2f 2a 20 70 | 61 72 73 65 64 20 69 6e |t"../* p|arsed in|
|00003510| 73 69 64 65 20 64 61 74 | 65 66 69 6c 65 20 2a 2f |side dat|efile */|
|00003520| 0a 0a 23 64 65 66 69 6e | 65 20 44 41 59 46 4f 4e |..#defin|e DAYFON|
|00003530| 54 09 09 22 54 69 6d 65 | 73 2d 42 6f 6c 64 22 09 |T.."Time|s-Bold".|
|00003540| 09 2f 2a 20 64 65 66 61 | 75 6c 74 20 66 6f 6e 74 |./* defa|ult font|
|00003550| 20 6e 61 6d 65 73 20 2a | 2f 0a 23 64 65 66 69 6e | names *|/.#defin|
|00003560| 65 20 54 49 54 4c 45 46 | 4f 4e 54 09 22 54 69 6d |e TITLEF|ONT."Tim|
|00003570| 65 73 2d 42 6f 6c 64 22 | 0a 23 64 65 66 69 6e 65 |es-Bold"|.#define|
|00003580| 20 4e 4f 54 45 53 46 4f | 4e 54 09 22 48 65 6c 76 | NOTESFO|NT."Helv|
|00003590| 65 74 69 63 61 2d 4e 61 | 72 72 6f 77 22 0a 0a 23 |etica-Na|rrow"..#|
|000035a0| 64 65 66 69 6e 65 20 4c | 46 4f 4f 54 20 09 09 22 |define L|FOOT .."|
|000035b0| 22 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |" | |
|000035c0| 20 20 20 20 20 20 20 20 | 20 2f 2a 20 64 65 66 61 | | /* defa|
|000035d0| 75 6c 74 20 66 6f 6f 74 | 20 73 74 72 69 6e 67 73 |ult foot| strings|
|000035e0| 20 2a 2f 0a 23 64 65 66 | 69 6e 65 20 43 46 4f 4f | */.#def|ine CFOO|
|000035f0| 54 20 09 09 22 22 0a 23 | 64 65 66 69 6e 65 20 52 |T .."".#|define R|
|00003600| 46 4f 4f 54 20 09 09 22 | 22 0a 0a 23 64 65 66 69 |FOOT .."|"..#defi|
|00003610| 6e 65 20 4c 41 4e 44 53 | 43 41 50 45 20 20 39 30 |ne LANDS|CAPE 90|
|00003620| 09 09 2f 2a 20 64 65 67 | 72 65 65 73 20 74 6f 20 |../* deg|rees to |
|00003630| 72 6f 74 61 74 65 20 66 | 6f 72 20 6c 61 6e 64 73 |rotate f|or lands|
|00003640| 63 61 70 65 2f 70 6f 72 | 74 72 61 69 74 20 2a 2f |cape/por|trait */|
|00003650| 0a 23 64 65 66 69 6e 65 | 20 50 4f 52 54 52 41 49 |.#define| PORTRAI|
|00003660| 54 20 20 20 20 30 0a 23 | 64 65 66 69 6e 65 20 52 |T 0.#|define R|
|00003670| 4f 54 41 54 45 09 20 20 | 20 4c 41 4e 44 53 43 41 |OTATE. | LANDSCA|
|00003680| 50 45 09 2f 2a 20 64 65 | 66 61 75 6c 74 20 2a 2f |PE./* de|fault */|
|00003690| 0a 0a 23 64 65 66 69 6e | 65 20 42 4c 41 43 4b 09 |..#defin|e BLACK.|
|000036a0| 09 30 09 2f 2a 20 63 6f | 6c 6f 72 73 20 66 6f 72 |.0./* co|lors for|
|000036b0| 20 64 61 74 65 73 20 2a | 2f 0a 23 64 65 66 69 6e | dates *|/.#defin|
|000036c0| 65 20 47 52 41 59 09 09 | 31 0a 0a 23 64 65 66 69 |e GRAY..|1..#defi|
|000036d0| 6e 65 20 4e 4f 5f 44 41 | 54 45 46 49 4c 45 20 09 |ne NO_DA|TEFILE .|
|000036e0| 30 09 2f 2a 20 64 61 74 | 65 20 66 69 6c 65 20 28 |0./* dat|e file (|
|000036f0| 69 66 20 61 6e 79 29 20 | 74 6f 20 75 73 65 20 2a |if any) |to use *|
|00003700| 2f 0a 23 64 65 66 69 6e | 65 20 55 53 45 52 5f 44 |/.#defin|e USER_D|
|00003710| 41 54 45 46 49 4c 45 09 | 31 0a 23 64 65 66 69 6e |ATEFILE.|1.#defin|
|00003720| 65 20 53 59 53 5f 44 41 | 54 45 46 49 4c 45 09 32 |e SYS_DA|TEFILE.2|
|00003730| 0a 0a 2f 2a 20 70 72 65 | 70 72 6f 63 65 73 73 6f |../* pre|processo|
|00003740| 72 20 74 6f 6b 65 6e 20 | 63 6f 64 65 73 20 2d 20 |r token |codes - |
|00003750| 6d 75 73 74 20 62 65 20 | 63 6f 6e 74 69 67 75 6f |must be |contiguo|
|00003760| 75 73 20 72 61 6e 67 65 | 20 6f 66 20 69 6e 74 65 |us range| of inte|
|00003770| 67 65 72 73 20 73 74 61 | 72 74 69 6e 67 0a 20 2a |gers sta|rting. *|
|00003780| 20 61 74 20 30 20 61 6e | 64 20 65 6e 64 69 6e 67 | at 0 an|d ending|
|00003790| 20 77 69 74 68 20 63 6f | 64 65 20 66 6f 72 20 6e | with co|de for n|
|000037a0| 6f 6e 2d 74 6f 6b 65 6e | 73 20 28 63 66 2e 20 70 |on-token|s (cf. p|
|000037b0| 70 5f 69 6e 66 6f 5b 5d | 2c 20 70 70 5f 74 6f 6b |p_info[]|, pp_tok|
|000037c0| 65 6e 28 29 29 0a 20 2a | 2f 0a 23 64 65 66 69 6e |en()). *|/.#defin|
|000037d0| 65 20 50 50 5f 44 45 46 | 49 4e 45 09 30 0a 23 64 |e PP_DEF|INE.0.#d|
|000037e0| 65 66 69 6e 65 20 50 50 | 5f 45 4c 53 45 09 09 31 |efine PP|_ELSE..1|
|000037f0| 0a 23 64 65 66 69 6e 65 | 20 50 50 5f 45 4e 44 49 |.#define| PP_ENDI|
|00003800| 46 09 32 0a 23 64 65 66 | 69 6e 65 20 50 50 5f 49 |F.2.#def|ine PP_I|
|00003810| 46 44 45 46 09 33 0a 23 | 64 65 66 69 6e 65 20 50 |FDEF.3.#|define P|
|00003820| 50 5f 49 46 4e 44 45 46 | 09 34 0a 23 64 65 66 69 |P_IFNDEF|.4.#defi|
|00003830| 6e 65 20 50 50 5f 49 4e | 43 4c 55 44 45 09 35 0a |ne PP_IN|CLUDE.5.|
|00003840| 23 64 65 66 69 6e 65 20 | 50 50 5f 55 4e 44 45 46 |#define |PP_UNDEF|
|00003850| 09 36 0a 23 64 65 66 69 | 6e 65 20 50 50 5f 4f 54 |.6.#defi|ne PP_OT|
|00003860| 48 45 52 09 37 09 2f 2a | 20 6e 6f 74 20 70 70 20 |HER.7./*| not pp |
|00003870| 74 6f 6b 65 6e 20 2a 2f | 0a 0a 23 64 65 66 69 6e |token */|..#defin|
|00003880| 65 20 4d 41 58 5f 4e 45 | 53 54 49 4e 47 09 31 30 |e MAX_NE|STING.10|
|00003890| 09 2f 2a 20 6d 61 78 69 | 6d 75 6d 20 6e 65 73 74 |./* maxi|mum nest|
|000038a0| 69 6e 67 20 6c 65 76 65 | 6c 20 66 6f 72 20 66 69 |ing leve|l for fi|
|000038b0| 6c 65 20 69 6e 63 6c 75 | 73 69 6f 6e 20 2a 2f 0a |le inclu|sion */.|
|000038c0| 0a 23 64 65 66 69 6e 65 | 20 4d 41 58 5f 50 50 5f |.#define| MAX_PP_|
|000038d0| 53 59 4d 53 09 31 30 30 | 09 2f 2a 20 6e 75 6d 62 |SYMS.100|./* numb|
|000038e0| 65 72 20 6f 66 20 64 65 | 66 69 6e 61 62 6c 65 20 |er of de|finable |
|000038f0| 70 72 65 70 72 6f 63 65 | 73 73 6f 72 20 73 79 6d |preproce|ssor sym|
|00003900| 62 6f 6c 73 20 2a 2f 0a | 23 64 65 66 69 6e 65 20 |bols */.|#define |
|00003910| 50 50 5f 53 59 4d 5f 55 | 4e 44 45 46 20 20 20 20 |PP_SYM_U|NDEF |
|00003920| 20 2d 31 09 2f 2a 20 66 | 6c 61 67 20 66 6f 72 20 | -1./* f|lag for |
|00003930| 75 6e 64 65 66 69 6e 65 | 64 20 73 79 6d 62 6f 6c |undefine|d symbol|
|00003940| 20 2a 2f 0a 0a 23 64 65 | 66 69 6e 65 20 4d 49 4e | */..#de|fine MIN|
|00003950| 5f 59 52 09 09 31 39 30 | 30 09 2f 2a 20 73 69 67 |_YR..190|0./* sig|
|00003960| 6e 69 66 69 63 61 6e 74 | 20 79 65 61 72 73 20 28 |nificant| years (|
|00003970| 63 61 6c 65 6e 64 61 72 | 20 6c 69 6d 69 74 73 29 |calendar| limits)|
|00003980| 20 2a 2f 0a 23 64 65 66 | 69 6e 65 20 4d 41 58 5f | */.#def|ine MAX_|
|00003990| 59 52 09 09 39 39 39 39 | 0a 0a 23 64 65 66 69 6e |YR..9999|..#defin|
|000039a0| 65 20 4a 41 4e 09 09 20 | 31 09 2f 2a 20 73 69 67 |e JAN.. |1./* sig|
|000039b0| 6e 69 66 69 63 61 6e 74 | 20 6d 6f 6e 74 68 73 20 |nificant| months |
|000039c0| 2a 2f 0a 23 64 65 66 69 | 6e 65 20 46 45 42 09 09 |*/.#defi|ne FEB..|
|000039d0| 20 32 0a 23 64 65 66 69 | 6e 65 20 44 45 43 09 09 | 2.#defi|ne DEC..|
|000039e0| 31 32 0a 0a 23 64 65 66 | 69 6e 65 20 50 41 52 53 |12..#def|ine PARS|
|000039f0| 45 5f 4f 4b 09 30 09 2f | 2a 20 72 65 74 75 72 6e |E_OK.0./|* return|
|00003a00| 73 20 66 72 6f 6d 20 70 | 61 72 73 65 28 29 2c 20 |s from p|arse(), |
|00003a10| 65 6e 74 65 72 5f 64 61 | 79 5f 69 6e 66 6f 28 29 |enter_da|y_info()|
|00003a20| 20 2a 2f 0a 23 64 65 66 | 69 6e 65 20 50 41 52 53 | */.#def|ine PARS|
|00003a30| 45 5f 49 4e 56 44 41 54 | 45 09 31 0a 23 64 65 66 |E_INVDAT|E.1.#def|
|00003a40| 69 6e 65 20 50 41 52 53 | 45 5f 49 4e 56 4c 49 4e |ine PARS|E_INVLIN|
|00003a50| 45 09 32 0a 0a 23 64 65 | 66 69 6e 65 20 53 54 52 |E.2..#de|fine STR|
|00003a60| 53 49 5a 09 32 30 30 09 | 09 2f 2a 20 73 69 7a 65 |SIZ.200.|./* size|
|00003a70| 20 6f 66 20 6d 69 73 63 | 2e 20 73 74 72 69 6e 67 | of misc|. string|
|00003a80| 73 20 2a 2f 0a 0a 23 64 | 65 66 69 6e 65 20 4d 41 |s */..#d|efine MA|
|00003a90| 58 41 52 47 53 20 33 09 | 09 2f 2a 20 6e 75 6d 65 |XARGS 3.|./* nume|
|00003aa0| 72 69 63 20 63 6f 6d 6d | 61 6e 64 2d 6c 69 6e 65 |ric comm|and-line|
|00003ab0| 20 61 72 67 73 20 2a 2f | 0a 0a 23 64 65 66 69 6e | args */|..#defin|
|00003ac0| 65 20 57 48 49 54 45 53 | 50 41 43 45 20 22 20 5c |e WHITES|PACE " \|
|00003ad0| 74 22 09 2f 2a 20 74 6f | 6b 65 6e 20 64 65 6c 69 |t"./* to|ken deli|
|00003ae0| 6d 69 74 65 72 73 20 69 | 6e 20 64 61 74 65 20 66 |miters i|n date f|
|00003af0| 69 6c 65 20 2a 2f 0a 0a | 2f 2a 0a 20 2a 20 47 6c |ile */..|/*. * Gl|
|00003b00| 6f 62 61 6c 20 74 79 70 | 65 64 65 66 20 64 65 63 |obal typ|edef dec|
|00003b10| 6c 61 72 61 74 69 6f 6e | 73 20 66 6f 72 20 64 61 |laration|s for da|
|00003b20| 74 61 20 73 74 72 75 63 | 74 75 72 65 0a 20 2a 2f |ta struc|ture. */|
|00003b30| 0a 0a 74 79 70 65 64 65 | 66 20 73 74 72 75 63 74 |..typede|f struct|
|00003b40| 20 64 5f 69 20 7b 0a 09 | 69 6e 74 20 69 73 5f 68 | d_i {..|int is_h|
|00003b50| 6f 6c 69 64 61 79 3b 0a | 09 63 68 61 72 20 2a 74 |oliday;.|.char *t|
|00003b60| 65 78 74 3b 0a 09 73 74 | 72 75 63 74 20 64 5f 69 |ext;..st|ruct d_i|
|00003b70| 20 2a 6e 65 78 74 3b 0a | 09 7d 20 64 61 79 5f 69 | *next;.|.} day_i|
|00003b80| 6e 66 6f 3b 0a 0a 74 79 | 70 65 64 65 66 20 73 74 |nfo;..ty|pedef st|
|00003b90| 72 75 63 74 20 6d 5f 69 | 20 7b 0a 09 75 6e 73 69 |ruct m_i| {..unsi|
|00003ba0| 67 6e 65 64 20 6c 6f 6e | 67 20 68 6f 6c 69 64 61 |gned lon|g holida|
|00003bb0| 79 73 3b 0a 09 64 61 79 | 5f 69 6e 66 6f 20 2a 64 |ys;..day|_info *d|
|00003bc0| 61 79 5b 33 31 5d 3b 0a | 09 7d 20 6d 6f 6e 74 68 |ay[31];.|.} month|
|00003bd0| 5f 69 6e 66 6f 3b 0a 0a | 74 79 70 65 64 65 66 20 |_info;..|typedef |
|00003be0| 73 74 72 75 63 74 20 79 | 5f 69 20 7b 0a 09 69 6e |struct y|_i {..in|
|00003bf0| 74 20 79 65 61 72 3b 0a | 09 6d 6f 6e 74 68 5f 69 |t year;.|.month_i|
|00003c00| 6e 66 6f 20 2a 6d 6f 6e | 74 68 5b 31 32 5d 3b 0a |nfo *mon|th[12];.|
|00003c10| 09 73 74 72 75 63 74 20 | 79 5f 69 20 2a 6e 65 78 |.struct |y_i *nex|
|00003c20| 74 3b 0a 09 7d 20 79 65 | 61 72 5f 69 6e 66 6f 3b |t;..} ye|ar_info;|
|00003c30| 0a 0a 0a 2f 2a 0a 20 2a | 20 47 6c 6f 62 61 6c 20 |.../*. *| Global |
|00003c40| 76 61 72 69 61 62 6c 65 | 73 3a 0a 20 2a 2f 0a 0a |variable|s:. */..|
|00003c50| 69 6e 74 20 64 6f 5f 64 | 65 66 69 6e 65 28 29 2c |int do_d|efine(),|
|00003c60| 20 64 6f 5f 69 66 64 65 | 66 28 29 2c 20 64 6f 5f | do_ifde|f(), do_|
|00003c70| 69 66 6e 64 65 66 28 29 | 2c 20 64 6f 5f 69 6e 63 |ifndef()|, do_inc|
|00003c80| 6c 75 64 65 28 29 2c 20 | 64 6f 5f 75 6e 64 65 66 |lude(), |do_undef|
|00003c90| 28 29 3b 0a 63 68 61 72 | 20 2a 74 72 6e 6c 6f 67 |();.char| *trnlog|
|00003ca0| 28 29 2c 20 2a 6d 6b 5f | 70 61 74 68 28 29 2c 20 |(), *mk_|path(), |
|00003cb0| 2a 6d 6b 5f 66 69 6c 65 | 73 70 65 63 28 29 3b 0a |*mk_file|spec();.|
|00003cc0| 0a 65 78 74 65 72 6e 20 | 63 68 61 72 20 2a 67 65 |.extern |char *ge|
|00003cd0| 74 65 6e 76 28 29 3b 0a | 0a 79 65 61 72 5f 69 6e |tenv();.|.year_in|
|00003ce0| 66 6f 20 2a 68 65 61 64 | 20 3d 20 4e 55 4c 4c 3b |fo *head| = NULL;|
|00003cf0| 09 09 2f 2a 20 68 65 61 | 64 20 6f 66 20 69 6e 74 |../* hea|d of int|
|00003d00| 65 72 6e 61 6c 20 64 61 | 74 61 20 73 74 72 75 63 |ernal da|ta struc|
|00003d10| 74 75 72 65 20 2a 2f 0a | 69 6e 74 20 6e 65 73 74 |ture */.|int nest|
|00003d20| 69 6e 67 5f 6c 65 76 65 | 6c 20 3d 20 30 3b 09 09 |ing_leve|l = 0;..|
|00003d30| 2f 2a 20 6c 65 76 65 6c | 20 6f 66 20 69 6e 63 6c |/* level| of incl|
|00003d40| 75 64 65 20 66 69 6c 65 | 20 6e 65 73 74 69 6e 67 |ude file| nesting|
|00003d50| 20 2a 2f 0a 69 6e 74 20 | 69 6e 69 74 5f 6d 6f 6e | */.int |init_mon|
|00003d60| 74 68 3b 09 09 09 2f 2a | 20 69 6e 69 74 69 61 6c |th;.../*| initial|
|00003d70| 20 6d 6f 6e 74 68 2c 20 | 79 65 61 72 2c 20 6e 75 | month, |year, nu|
|00003d80| 6d 62 65 72 20 6f 66 20 | 6d 6f 6e 74 68 73 20 2a |mber of |months *|
|00003d90| 2f 0a 69 6e 74 20 69 6e | 69 74 5f 79 65 61 72 3b |/.int in|it_year;|
|00003da0| 0a 69 6e 74 20 6e 6d 6f | 6e 74 68 73 3b 0a 69 6e |.int nmo|nths;.in|
|00003db0| 74 20 63 75 72 72 5f 79 | 65 61 72 3b 09 09 09 2f |t curr_y|ear;.../|
|00003dc0| 2a 20 63 75 72 72 65 6e | 74 20 64 65 66 61 75 6c |* curren|t defaul|
|00003dd0| 74 20 79 65 61 72 20 66 | 6f 72 20 64 61 74 65 20 |t year f|or date |
|00003de0| 66 69 6c 65 20 65 6e 74 | 72 69 65 73 20 2a 2f 0a |file ent|ries */.|
|00003df0| 63 68 61 72 20 2a 77 6f | 72 64 73 5b 31 30 30 5d |char *wo|rds[100]|
|00003e00| 3b 09 09 2f 2a 20 6d 61 | 78 69 6d 75 6d 20 6e 75 |;../* ma|ximum nu|
|00003e10| 6d 62 65 72 20 6f 66 20 | 77 6f 72 64 73 20 70 65 |mber of |words pe|
|00003e20| 72 20 64 61 74 65 20 66 | 69 6c 65 20 6c 69 6e 65 |r date f|ile line|
|00003e30| 20 2a 2f 0a 63 68 61 72 | 20 6c 62 75 66 5b 35 31 | */.char| lbuf[51|
|00003e40| 32 5d 3b 09 09 09 2f 2a | 20 6d 61 78 69 6d 75 6d |2];.../*| maximum|
|00003e50| 20 64 61 74 65 20 66 69 | 6c 65 20 6c 69 6e 65 20 | date fi|le line |
|00003e60| 73 69 7a 65 20 2a 2f 0a | 63 68 61 72 20 2a 70 70 |size */.|char *pp|
|00003e70| 5f 73 79 6d 5b 4d 41 58 | 5f 50 50 5f 53 59 4d 53 |_sym[MAX|_PP_SYMS|
|00003e80| 5d 3b 09 2f 2a 20 70 72 | 65 70 72 6f 63 65 73 73 |];./* pr|eprocess|
|00003e90| 6f 72 20 64 65 66 69 6e | 65 64 20 73 79 6d 62 6f |or defin|ed symbo|
|00003ea0| 6c 73 20 2a 2f 0a 63 68 | 61 72 20 70 72 6f 67 6e |ls */.ch|ar progn|
|00003eb0| 61 6d 65 5b 53 54 52 53 | 49 5a 5d 3b 09 09 2f 2a |ame[STRS|IZ];../*|
|00003ec0| 20 70 72 6f 67 72 61 6d | 20 6e 61 6d 65 20 28 66 | program| name (f|
|00003ed0| 6f 72 20 65 72 72 6f 72 | 20 6d 65 73 73 61 67 65 |or error| message|
|00003ee0| 73 29 20 2a 2f 0a 63 68 | 61 72 20 63 6f 6c 6f 72 |s) */.ch|ar color|
|00003ef0| 5b 37 5d 3b 09 09 09 2f | 2a 20 63 6f 6c 6f 72 73 |[7];.../|* colors|
|00003f00| 20 6f 66 20 77 65 65 6b | 64 61 79 73 20 2d 20 63 | of week|days - c|
|00003f10| 66 2e 20 64 65 66 61 75 | 6c 74 5f 63 6f 6c 6f 72 |f. defau|lt_color|
|00003f20| 5b 5d 20 2a 2f 0a 0a 2f | 2a 0a 20 2a 20 44 65 66 |[] */../|*. * Def|
|00003f30| 61 75 6c 74 20 76 61 6c | 75 65 73 20 66 6f 72 20 |ault val|ues for |
|00003f40| 63 6f 6d 6d 61 6e 64 2d | 6c 69 6e 65 20 6f 70 74 |command-|line opt|
|00003f50| 69 6f 6e 73 3a 0a 20 2a | 2f 0a 0a 63 68 61 72 20 |ions:. *|/..char |
|00003f60| 64 65 66 61 75 6c 74 5f | 63 6f 6c 6f 72 5b 37 5d |default_|color[7]|
|00003f70| 20 3d 20 7b 09 09 2f 2a | 20 2d 62 2c 20 2d 67 20 | = {../*| -b, -g |
|00003f80| 2a 2f 0a 09 47 52 41 59 | 2c 20 42 4c 41 43 4b 2c |*/..GRAY|, BLACK,|
|00003f90| 20 42 4c 41 43 4b 2c 20 | 42 4c 41 43 4b 2c 20 42 | BLACK, |BLACK, B|
|00003fa0| 4c 41 43 4b 2c 20 42 4c | 41 43 4b 2c 20 47 52 41 |LACK, BL|ACK, GRA|
|00003fb0| 59 09 2f 2a 20 63 66 2e | 20 43 4f 4c 4f 52 5f 4d |Y./* cf.| COLOR_M|
|00003fc0| 53 47 20 2a 2f 0a 09 7d | 3b 0a 0a 69 6e 74 20 64 |SG */..}|;..int d|
|00003fd0| 61 74 65 66 69 6c 65 5f | 74 79 70 65 20 3d 20 53 |atefile_|type = S|
|00003fe0| 59 53 5f 44 41 54 45 46 | 49 4c 45 3b 09 2f 2a 20 |YS_DATEF|ILE;./* |
|00003ff0| 2d 65 2c 20 2d 66 20 2a | 2f 0a 63 68 61 72 20 64 |-e, -f *|/.char d|
|00004000| 61 74 65 66 69 6c 65 5b | 53 54 52 53 49 5a 5d 20 |atefile[|STRSIZ] |
|00004010| 3d 20 22 22 3b 0a 63 68 | 61 72 20 64 65 66 61 75 |= "";.ch|ar defau|
|00004020| 6c 74 5f 64 69 72 5b 53 | 54 52 53 49 5a 5d 20 3d |lt_dir[S|TRSIZ] =|
|00004030| 20 22 22 3b 0a 0a 69 6e | 74 20 72 6f 74 61 74 65 | "";..in|t rotate|
|00004040| 20 3d 20 52 4f 54 41 54 | 45 3b 09 09 09 2f 2a 20 | = ROTAT|E;.../* |
|00004050| 2d 6c 2c 20 2d 70 20 2a | 2f 0a 0a 63 68 61 72 20 |-l, -p *|/..char |
|00004060| 64 61 79 66 6f 6e 74 5b | 53 54 52 53 49 5a 5d 20 |dayfont[|STRSIZ] |
|00004070| 3d 20 44 41 59 46 4f 4e | 54 3b 09 09 2f 2a 20 2d |= DAYFON|T;../* -|
|00004080| 64 2c 20 2d 74 2c 20 2d | 6e 20 2a 2f 0a 63 68 61 |d, -t, -|n */.cha|
|00004090| 72 20 74 69 74 6c 65 66 | 6f 6e 74 5b 53 54 52 53 |r titlef|ont[STRS|
|000040a0| 49 5a 5d 20 3d 20 54 49 | 54 4c 45 46 4f 4e 54 3b |IZ] = TI|TLEFONT;|
|000040b0| 0a 63 68 61 72 20 6e 6f | 74 65 73 66 6f 6e 74 5b |.char no|tesfont[|
|000040c0| 53 54 52 53 49 5a 5d 20 | 3d 20 4e 4f 54 45 53 46 |STRSIZ] |= NOTESF|
|000040d0| 4f 4e 54 3b 0a 0a 63 68 | 61 72 20 6c 66 6f 6f 74 |ONT;..ch|ar lfoot|
|000040e0| 5b 53 54 52 53 49 5a 5d | 20 3d 20 4c 46 4f 4f 54 |[STRSIZ]| = LFOOT|
|000040f0| 3b 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2f 2a |; | /*|
|00004100| 20 2d 4c 2c 20 2d 43 2c | 20 2d 52 20 2a 2f 0a 63 | -L, -C,| -R */.c|
|00004110| 68 61 72 20 63 66 6f 6f | 74 5b 53 54 52 53 49 5a |har cfoo|t[STRSIZ|
|00004120| 5d 20 3d 20 43 46 4f 4f | 54 3b 0a 63 68 61 72 20 |] = CFOO|T;.char |
|00004130| 72 66 6f 6f 74 5b 53 54 | 52 53 49 5a 5d 20 3d 20 |rfoot[ST|RSIZ] = |
|00004140| 52 46 4f 4f 54 3b 0a 0a | 63 68 61 72 20 6f 75 74 |RFOOT;..|char out|
|00004150| 66 69 6c 65 5b 53 54 52 | 53 49 5a 5d 20 3d 20 4f |file[STR|SIZ] = O|
|00004160| 55 54 46 49 4c 45 3b 09 | 09 2f 2a 20 2d 6f 20 2a |UTFILE;.|./* -o *|
|00004170| 2f 0a 0a 2f 2a 0a 20 2a | 20 4c 61 6e 67 75 61 67 |/../*. *| Languag|
|00004180| 65 2d 64 65 70 65 6e 64 | 65 6e 74 20 73 74 72 69 |e-depend|ent stri|
|00004190| 6e 67 73 20 28 6d 6f 6e | 74 68 20 61 6e 64 20 64 |ngs (mon|th and d|
|000041a0| 61 79 20 6e 61 6d 65 73 | 2c 20 6f 70 74 69 6f 6e |ay names|, option|
|000041b0| 20 66 69 6c 65 20 6b 65 | 79 77 6f 72 64 73 2c 0a | file ke|ywords,.|
|000041c0| 20 2a 20 70 72 65 70 72 | 6f 63 65 73 73 6f 72 20 | * prepr|ocessor |
|000041d0| 74 6f 6b 65 6e 73 29 3a | 0a 20 2a 2f 0a 0a 73 74 |tokens):|. */..st|
|000041e0| 61 74 69 63 20 63 68 61 | 72 20 2a 6d 6f 6e 74 68 |atic cha|r *month|
|000041f0| 73 5b 31 32 5d 20 3d 20 | 7b 0a 09 22 4a 61 6e 75 |s[12] = |{.."Janu|
|00004200| 61 72 79 22 2c 20 22 46 | 65 62 72 75 61 72 79 22 |ary", "F|ebruary"|
|00004210| 2c 20 22 4d 61 72 63 68 | 22 2c 20 22 41 70 72 69 |, "March|", "Apri|
|00004220| 6c 22 2c 20 22 4d 61 79 | 22 2c 20 22 4a 75 6e 65 |l", "May|", "June|
|00004230| 22 2c 0a 09 22 4a 75 6c | 79 22 2c 20 22 41 75 67 |",.."Jul|y", "Aug|
|00004240| 75 73 74 22 2c 20 22 53 | 65 70 74 65 6d 62 65 72 |ust", "S|eptember|
|00004250| 22 2c 20 22 4f 63 74 6f | 62 65 72 22 2c 20 22 4e |", "Octo|ber", "N|
|00004260| 6f 76 65 6d 62 65 72 22 | 2c 20 22 44 65 63 65 6d |ovember"|, "Decem|
|00004270| 62 65 72 22 0a 09 7d 3b | 0a 0a 73 74 61 74 69 63 |ber"..};|..static|
|00004280| 20 63 68 61 72 20 2a 64 | 61 79 73 5b 37 5d 20 3d | char *d|ays[7] =|
|00004290| 20 7b 0a 09 22 53 75 6e | 64 61 79 22 2c 20 22 4d | {.."Sun|day", "M|
|000042a0| 6f 6e 64 61 79 22 2c 20 | 22 54 75 65 73 64 61 79 |onday", |"Tuesday|
|000042b0| 22 2c 20 22 57 65 64 6e | 65 73 64 61 79 22 2c 20 |", "Wedn|esday", |
|000042c0| 22 54 68 75 72 73 64 61 | 79 22 2c 20 22 46 72 69 |"Thursda|y", "Fri|
|000042d0| 64 61 79 22 2c 0a 09 22 | 53 61 74 75 72 64 61 79 |day",.."|Saturday|
|000042e0| 22 0a 09 7d 3b 0a 0a 2f | 2a 20 70 72 65 70 72 6f |"..};../|* prepro|
|000042f0| 63 65 73 73 6f 72 20 74 | 6f 6b 65 6e 73 20 2d 20 |cessor t|okens - |
|00004300| 6d 75 73 74 20 62 65 20 | 69 6e 20 73 61 6d 65 20 |must be |in same |
|00004310| 6f 72 64 65 72 20 61 73 | 20 50 50 5f 58 58 58 58 |order as| PP_XXXX|
|00004320| 58 20 28 63 66 2e 20 70 | 70 5f 74 6f 6b 65 6e 28 |X (cf. p|p_token(|
|00004330| 29 29 20 2a 2f 0a 73 74 | 61 74 69 63 20 73 74 72 |)) */.st|atic str|
|00004340| 75 63 74 20 70 70 20 7b | 0a 09 63 68 61 72 09 2a |uct pp {|..char.*|
|00004350| 74 6f 6b 65 6e 3b 09 09 | 2f 2a 20 6e 61 6d 65 20 |token;..|/* name |
|00004360| 2a 2f 0a 09 69 6e 74 09 | 28 2a 70 66 63 6e 29 28 |*/..int.|(*pfcn)(|
|00004370| 29 3b 09 2f 2a 20 64 69 | 73 70 61 74 63 68 20 72 |);./* di|spatch r|
|00004380| 6f 75 74 69 6e 65 20 2a | 2f 0a 09 7d 20 70 70 5f |outine *|/..} pp_|
|00004390| 69 6e 66 6f 5b 5d 20 3d | 20 7b 0a 09 09 7b 20 22 |info[] =| {...{ "|
|000043a0| 64 65 66 69 6e 65 22 2c | 20 20 64 6f 5f 64 65 66 |define",| do_def|
|000043b0| 69 6e 65 20 20 7d 2c 09 | 09 2f 2a 20 50 50 5f 44 |ine },.|./* PP_D|
|000043c0| 45 46 49 4e 45 09 2a 2f | 0a 09 09 7b 20 22 65 6c |EFINE.*/|...{ "el|
|000043d0| 73 65 22 2c 20 20 20 20 | 4e 55 4c 4c 20 20 20 20 |se", |NULL |
|000043e0| 20 20 20 7d 2c 09 09 2f | 2a 20 50 50 5f 45 4c 53 | },../|* PP_ELS|
|000043f0| 45 09 2a 2f 0a 09 09 7b | 20 22 65 6e 64 69 66 22 |E.*/...{| "endif"|
|00004400| 2c 20 20 20 4e 55 4c 4c | 20 20 20 20 20 20 20 7d |, NULL| }|
|00004410| 2c 09 09 2f 2a 20 50 50 | 5f 45 4e 44 49 46 09 2a |,../* PP|_ENDIF.*|
|00004420| 2f 0a 09 09 7b 20 22 69 | 66 64 65 66 22 2c 20 20 |/...{ "i|fdef", |
|00004430| 20 64 6f 5f 69 66 64 65 | 66 20 20 20 7d 2c 09 09 | do_ifde|f },..|
|00004440| 2f 2a 20 50 50 5f 49 46 | 44 45 46 09 2a 2f 0a 09 |/* PP_IF|DEF.*/..|
|00004450| 09 7b 20 22 69 66 6e 64 | 65 66 22 2c 20 20 64 6f |.{ "ifnd|ef", do|
|00004460| 5f 69 66 6e 64 65 66 20 | 20 7d 2c 09 09 2f 2a 20 |_ifndef | },../* |
|00004470| 50 50 5f 49 46 4e 44 45 | 46 09 2a 2f 0a 09 09 7b |PP_IFNDE|F.*/...{|
|00004480| 20 22 69 6e 63 6c 75 64 | 65 22 2c 20 64 6f 5f 69 | "includ|e", do_i|
|00004490| 6e 63 6c 75 64 65 20 7d | 2c 09 09 2f 2a 20 50 50 |nclude }|,../* PP|
|000044a0| 5f 49 4e 43 4c 55 44 45 | 09 2a 2f 0a 09 09 7b 20 |_INCLUDE|.*/...{ |
|000044b0| 22 75 6e 64 65 66 22 2c | 20 20 20 64 6f 5f 75 6e |"undef",| do_un|
|000044c0| 64 65 66 20 20 20 7d 2c | 09 09 2f 2a 20 50 50 5f |def },|../* PP_|
|000044d0| 55 4e 44 45 46 09 2a 2f | 0a 09 09 7b 20 4e 55 4c |UNDEF.*/|...{ NUL|
|000044e0| 4c 2c 20 20 20 20 20 20 | 4e 55 4c 4c 20 20 20 20 |L, |NULL |
|000044f0| 20 20 20 7d 09 09 2f 2a | 20 50 50 5f 4f 54 48 45 | }../*| PP_OTHE|
|00004500| 52 09 2a 2f 0a 09 7d 3b | 0a 0a 23 64 65 66 69 6e |R.*/..};|..#defin|
|00004510| 65 20 4d 49 4e 5f 44 41 | 59 5f 4c 45 4e 20 20 20 |e MIN_DA|Y_LEN |
|00004520| 32 09 09 2f 2a 20 6d 69 | 6e 69 6d 75 6d 20 73 69 |2../* mi|nimum si|
|00004530| 7a 65 20 6f 66 20 61 62 | 62 72 65 76 69 61 74 69 |ze of ab|breviati|
|00004540| 6f 6e 73 20 20 2a 2f 0a | 23 64 65 66 69 6e 65 20 |ons */.|#define |
|00004550| 4d 49 4e 5f 4d 4f 4e 54 | 48 5f 4c 45 4e 20 33 0a |MIN_MONT|H_LEN 3.|
|00004560| 23 64 65 66 69 6e 65 20 | 4d 49 4e 5f 50 50 54 4f |#define |MIN_PPTO|
|00004570| 4b 5f 4c 45 4e 20 33 0a | 0a 23 64 65 66 69 6e 65 |K_LEN 3.|.#define|
|00004580| 20 41 4c 4c 09 22 61 6c | 6c 22 09 09 2f 2a 20 63 | ALL."al|l"../* c|
|00004590| 6f 6d 6d 61 6e 64 2d 6c | 69 6e 65 20 6f 72 20 64 |ommand-l|ine or d|
|000045a0| 61 74 65 20 66 69 6c 65 | 20 6b 65 79 77 6f 72 64 |ate file| keyword|
|000045b0| 73 20 2a 2f 0a 23 64 65 | 66 69 6e 65 20 4f 50 54 |s */.#de|fine OPT|
|000045c0| 09 22 6f 70 74 22 0a 23 | 64 65 66 69 6e 65 20 59 |."opt".#|define Y|
|000045d0| 45 41 52 09 22 79 65 61 | 72 22 0a 0a 23 64 65 66 |EAR."yea|r"..#def|
|000045e0| 69 6e 65 20 43 4f 4c 4f | 52 5f 4d 53 47 09 22 53 |ine COLO|R_MSG."S|
|000045f0| 61 74 2f 53 75 6e 20 69 | 6e 20 67 72 61 79 2c 20 |at/Sun i|n gray, |
|00004600| 6f 74 68 65 72 73 20 69 | 6e 20 62 6c 61 63 6b 22 |others i|n black"|
|00004610| 20 20 20 20 2f 2a 20 63 | 66 2e 20 75 73 61 67 65 | /* c|f. usage|
|00004620| 28 29 20 2a 2f 0a 0a 2f | 2a 0a 20 2a 20 50 6f 73 |() */../|*. * Pos|
|00004630| 74 53 63 72 69 70 74 20 | 62 6f 69 6c 65 72 70 6c |tScript |boilerpl|
|00004640| 61 74 65 0a 20 2a 2f 0a | 0a 23 69 6e 63 6c 75 64 |ate. */.|.#includ|
|00004650| 65 20 22 70 63 61 6c 69 | 6e 69 74 2e 68 22 0a 0a |e "pcali|nit.h"..|
|00004660| 0c 0a 2f 2a 0a 20 2a 20 | 4d 61 69 6e 20 70 72 6f |../*. * |Main pro|
|00004670| 67 72 61 6d 20 2d 20 70 | 61 72 73 65 20 61 6e 64 |gram - p|arse and|
|00004680| 20 76 61 6c 69 64 61 74 | 65 20 63 6f 6d 6d 61 6e | validat|e comman|
|00004690| 64 2d 6c 69 6e 65 20 61 | 72 67 75 6d 65 6e 74 73 |d-line a|rguments|
|000046a0| 2c 20 6f 70 65 6e 20 66 | 69 6c 65 73 2c 0a 20 2a |, open f|iles,. *|
|000046b0| 20 67 65 6e 65 72 61 74 | 65 20 50 6f 73 74 53 63 | generat|e PostSc|
|000046c0| 72 69 70 74 20 62 6f 69 | 6c 65 72 70 6c 61 74 65 |ript boi|lerplate|
|000046d0| 20 61 6e 64 20 63 6f 64 | 65 20 74 6f 20 67 65 6e | and cod|e to gen|
|000046e0| 65 72 61 74 65 20 63 61 | 6c 65 6e 64 61 72 73 2e |erate ca|lendars.|
|000046f0| 0a 20 2a 0a 20 2a 20 50 | 72 6f 67 72 61 6d 20 73 |. *. * P|rogram s|
|00004700| 74 72 75 63 74 75 72 65 | 3a 0a 20 2a 0a 20 2a 20 |tructure|:. *. * |
|00004710| 6d 61 69 6e 28 29 20 6c | 6f 6f 6b 73 20 66 6f 72 |main() l|ooks for|
|00004720| 20 74 68 65 20 65 6e 76 | 69 72 6f 6e 6d 65 6e 74 | the env|ironment|
|00004730| 20 76 61 72 69 61 62 6c | 65 20 28 67 6c 6f 62 61 | variabl|e (globa|
|00004740| 6c 20 73 79 6d 62 6f 6c | 20 6f 6e 20 56 4d 53 29 |l symbol| on VMS)|
|00004750| 20 50 43 41 4c 5f 4f 50 | 54 53 0a 20 2a 20 61 6e | PCAL_OP|TS. * an|
|00004760| 64 20 63 61 6c 6c 65 73 | 20 67 65 74 5f 61 72 67 |d calles| get_arg|
|00004770| 73 28 29 20 74 6f 20 70 | 61 72 73 65 20 69 74 2e |s() to p|arse it.|
|00004780| 20 20 49 74 20 74 68 65 | 6e 20 63 61 6c 6c 73 20 | It the|n calls |
|00004790| 67 65 74 5f 61 72 67 73 | 28 29 20 61 67 61 69 6e |get_args|() again|
|000047a0| 20 74 6f 20 70 61 72 73 | 65 0a 20 2a 20 74 68 65 | to pars|e. * the|
|000047b0| 20 63 6f 6d 6d 61 6e 64 | 20 6c 69 6e 65 20 66 6f | command| line fo|
|000047c0| 72 20 74 68 65 20 64 61 | 74 65 20 66 69 6c 65 20 |r the da|te file |
|000047d0| 6e 61 6d 65 2c 20 2d 44 | 20 61 6e 64 20 2d 55 20 |name, -D| and -U |
|000047e0| 6f 70 74 69 6f 6e 73 20 | 74 6f 20 62 65 20 69 6e |options |to be in|
|000047f0| 20 65 66 66 65 63 74 0a | 20 2a 20 70 72 69 6f 72 | effect.| * prior|
|00004800| 20 74 6f 20 72 65 61 64 | 69 6e 67 20 74 68 65 20 | to read|ing the |
|00004810| 64 61 74 65 20 66 69 6c | 65 2c 20 61 6e 64 20 61 |date fil|e, and a|
|00004820| 6e 79 20 6e 75 6d 65 72 | 69 63 20 61 72 67 75 6d |ny numer|ic argum|
|00004830| 65 6e 74 73 20 28 6d 6f | 6e 74 68 2c 20 79 65 61 |ents (mo|nth, yea|
|00004840| 72 2c 20 0a 20 2a 20 6e | 75 6d 62 65 72 20 6f 66 |r, . * n|umber of|
|00004850| 20 6d 6f 6e 74 68 73 29 | 2e 20 20 49 74 20 74 68 | months)|. It th|
|00004860| 65 6e 20 63 61 6c 6c 73 | 20 72 65 61 64 5f 64 61 |en calls| read_da|
|00004870| 74 65 66 69 6c 65 28 29 | 20 74 6f 20 72 65 61 64 |tefile()| to read|
|00004880| 20 61 6e 64 20 70 61 72 | 73 65 20 74 68 65 0a 20 | and par|se the. |
|00004890| 2a 20 64 61 74 65 20 66 | 69 6c 65 3b 20 61 6e 79 |* date f|ile; any|
|000048a0| 20 22 6f 70 74 22 20 6c | 69 6e 65 73 20 70 72 65 | "opt" l|ines pre|
|000048b0| 73 65 6e 74 20 77 69 6c | 6c 20 6f 76 65 72 72 69 |sent wil|l overri|
|000048c0| 64 65 20 74 68 65 20 64 | 65 66 61 75 6c 74 73 20 |de the d|efaults |
|000048d0| 66 6f 72 20 74 68 65 0a | 20 2a 20 63 6f 6d 6d 61 |for the.| * comma|
|000048e0| 6e 64 2d 6c 69 6e 65 20 | 66 6c 61 67 73 2e 20 20 |nd-line |flags. |
|000048f0| 49 74 20 74 68 65 6e 20 | 63 61 6c 6c 73 20 67 65 |It then |calls ge|
|00004900| 74 5f 61 72 67 73 28 29 | 20 61 67 61 69 6e 20 74 |t_args()| again t|
|00004910| 6f 20 70 72 6f 63 65 73 | 73 20 74 68 65 20 6f 74 |o proces|s the ot|
|00004920| 68 65 72 0a 20 2a 20 63 | 6f 6d 6d 61 6e 64 2d 6c |her. * c|ommand-l|
|00004930| 69 6e 65 20 66 6c 61 67 | 73 2c 20 77 68 69 63 68 |ine flag|s, which|
|00004940| 20 69 6e 20 74 75 72 6e | 20 6f 76 65 72 72 69 64 | in turn| overrid|
|00004950| 65 20 61 6e 79 20 73 70 | 65 63 69 66 69 65 64 20 |e any sp|ecified |
|00004960| 65 61 72 6c 69 65 72 2e | 0a 20 2a 0a 20 2a 20 6d |earlier.|. *. * m|
|00004970| 61 69 6e 28 29 20 74 68 | 65 6e 20 67 65 6e 65 72 |ain() th|en gener|
|00004980| 61 74 65 73 20 74 68 65 | 20 63 6f 6d 6d 6f 6e 20 |ates the| common |
|00004990| 50 6f 73 74 53 63 72 69 | 70 74 20 63 6f 64 65 20 |PostScri|pt code |
|000049a0| 61 6e 64 20 74 68 65 6e | 20 63 61 6c 6c 73 20 70 |and then| calls p|
|000049b0| 6d 6f 6e 74 68 28 29 20 | 74 6f 0a 20 2a 20 70 72 |month() |to. * pr|
|000049c0| 69 6e 74 20 74 68 65 20 | 63 61 6c 65 6e 64 61 72 |int the |calendar|
|000049d0| 73 2e 0a 20 2a 0a 20 2a | 20 72 65 61 64 5f 64 61 |s.. *. *| read_da|
|000049e0| 74 65 66 69 6c 65 28 29 | 20 63 61 6c 6c 73 20 67 |tefile()| calls g|
|000049f0| 65 74 6c 69 6e 65 28 29 | 20 74 6f 20 72 65 61 64 |etline()| to read|
|00004a00| 20 74 68 65 20 64 61 74 | 65 20 66 69 6c 65 2c 20 | the dat|e file, |
|00004a10| 64 6f 5f 78 78 78 78 78 | 28 29 20 74 6f 20 70 72 |do_xxxxx|() to pr|
|00004a20| 6f 63 65 73 73 0a 20 2a | 20 74 68 65 20 70 72 65 |ocess. *| the pre|
|00004a30| 70 72 6f 63 65 73 73 6f | 72 20 74 6f 6b 65 6e 73 |processo|r tokens|
|00004a40| 2c 20 61 6e 64 20 70 61 | 72 73 65 28 29 20 74 6f |, and pa|rse() to|
|00004a50| 20 70 61 72 73 65 20 65 | 61 63 68 20 64 61 74 65 | parse e|ach date|
|00004a60| 20 6c 69 6e 65 2e 0a 20 | 2a 0a 20 2a 20 67 65 74 | line.. |*. * get|
|00004a70| 6c 69 6e 65 28 29 20 72 | 65 61 64 73 20 6f 6e 65 |line() r|eads one|
|00004a80| 20 6f 72 20 6d 6f 72 65 | 20 6c 69 6e 65 73 20 66 | or more| lines f|
|00004a90| 72 6f 6d 20 74 68 65 20 | 64 61 74 65 20 66 69 6c |rom the |date fil|
|00004aa0| 65 2c 20 73 74 72 69 70 | 70 69 6e 67 20 63 6f 6d |e, strip|ping com|
|00004ab0| 6d 65 6e 74 73 0a 20 2a | 20 28 23 20 74 68 72 6f |ments. *| (# thro|
|00004ac0| 75 67 68 20 65 6e 64 2d | 6f 66 2d 6c 69 6e 65 29 |ugh end-|of-line)|
|00004ad0| 20 61 6e 64 20 69 67 6e | 6f 72 69 6e 67 20 62 6c | and ign|oring bl|
|00004ae0| 61 6e 6b 20 6c 69 6e 65 | 73 2e 0a 20 2a 0a 20 2a |ank line|s.. *. *|
|00004af0| 20 70 61 72 73 65 28 29 | 20 70 61 72 73 65 73 20 | parse()| parses |
|00004b00| 61 20 6c 69 6e 65 20 66 | 72 6f 6d 20 74 68 65 20 |a line f|rom the |
|00004b10| 64 61 74 65 20 66 69 6c | 65 20 61 6e 64 20 70 72 |date fil|e and pr|
|00004b20| 6f 63 65 73 73 65 73 20 | 69 74 2e 20 20 49 66 20 |ocesses |it. If |
|00004b30| 22 6f 70 74 22 2c 20 69 | 74 0a 20 2a 20 63 61 6c |"opt", i|t. * cal|
|00004b40| 6c 73 20 6c 6f 61 64 77 | 6f 72 64 73 28 29 20 74 |ls loadw|ords() t|
|00004b50| 6f 20 73 70 6c 69 74 20 | 74 68 65 20 6c 69 6e 65 |o split |the line|
|00004b60| 20 69 6e 74 6f 20 74 6f | 6b 65 6e 73 20 61 6e 64 | into to|kens and|
|00004b70| 20 67 65 74 5f 61 72 67 | 73 28 29 20 74 6f 0a 20 | get_arg|s() to. |
|00004b80| 2a 20 70 72 6f 63 65 73 | 73 20 74 68 65 6d 2e 20 |* proces|s them. |
|00004b90| 20 49 66 20 74 68 65 20 | 6c 69 6e 65 20 63 6f 6e | If the |line con|
|00004ba0| 74 61 69 6e 73 20 61 20 | 64 61 74 65 2c 20 69 74 |tains a |date, it|
|00004bb0| 20 63 61 6c 6c 73 20 65 | 6e 74 65 72 5f 64 61 79 | calls e|nter_day|
|00004bc0| 5f 69 6e 66 6f 28 29 20 | 74 6f 0a 20 2a 20 65 6e |_info() |to. * en|
|00004bd0| 74 65 72 20 74 68 65 20 | 64 61 79 20 61 6e 64 20 |ter the |day and |
|00004be0| 72 65 6c 61 74 65 64 20 | 74 65 78 74 20 69 6e 74 |related |text int|
|00004bf0| 6f 20 74 68 65 20 64 61 | 74 61 20 73 74 72 75 63 |o the da|ta struc|
|00004c00| 74 75 72 65 2e 0a 20 2a | 0a 20 2a 20 70 6d 6f 6e |ture.. *|. * pmon|
|00004c10| 74 68 28 29 20 63 61 6c | 6c 73 20 66 69 6e 64 5f |th() cal|ls find_|
|00004c20| 68 6f 6c 69 64 61 79 73 | 28 29 20 74 6f 20 67 65 |holidays|() to ge|
|00004c30| 6e 65 72 61 74 65 20 74 | 68 65 20 6c 69 73 74 20 |nerate t|he list |
|00004c40| 6f 66 20 68 6f 6c 69 64 | 61 79 73 20 74 6f 20 62 |of holid|ays to b|
|00004c50| 65 0a 20 2a 20 70 72 69 | 6e 74 65 64 20 69 6e 20 |e. * pri|nted in |
|00004c60| 67 72 61 79 3b 20 69 74 | 20 74 68 65 6e 20 63 61 |gray; it| then ca|
|00004c70| 6c 6c 73 20 66 69 6e 64 | 5f 64 61 79 74 65 78 74 |lls find|_daytext|
|00004c80| 28 29 20 74 6f 20 67 65 | 6e 65 72 61 74 65 20 74 |() to ge|nerate t|
|00004c90| 68 65 20 74 65 78 74 20 | 74 6f 0a 20 2a 20 62 65 |he text |to. * be|
|00004ca0| 20 70 72 69 6e 74 65 64 | 20 69 6e 73 69 64 65 20 | printed| inside |
|00004cb0| 74 68 65 20 63 61 6c 65 | 6e 64 61 72 20 62 6f 78 |the cale|ndar box|
|00004cc0| 65 73 2e 0a 20 2a 0a 20 | 2a 2f 0a 6d 61 69 6e 28 |es.. *. |*/.main(|
|00004cd0| 61 72 67 63 2c 20 61 72 | 67 76 29 0a 09 69 6e 74 |argc, ar|gv)..int|
|00004ce0| 20 61 72 67 63 3b 0a 09 | 63 68 61 72 20 2a 2a 61 | argc;..|char **a|
|00004cf0| 72 67 76 3b 0a 7b 0a 09 | 46 49 4c 45 20 2a 64 66 |rgv;.{..|FILE *df|
|00004d00| 70 20 3d 20 4e 55 4c 4c | 3b 09 09 2f 2a 20 64 61 |p = NULL|;../* da|
|00004d10| 74 65 20 66 69 6c 65 20 | 70 6f 69 6e 74 65 72 20 |te file |pointer |
|00004d20| 2a 2f 0a 09 63 68 61 72 | 20 2a 70 2c 20 2a 2a 61 |*/..char| *p, **a|
|00004d30| 70 3b 0a 09 69 6e 74 20 | 69 2c 20 6d 6f 6e 74 68 |p;..int |i, month|
|00004d40| 2c 20 79 65 61 72 2c 20 | 6e 67 72 61 79 3b 0a 0a |, year, |ngray;..|
|00004d50| 23 64 65 66 69 6e 65 20 | 44 4f 5f 48 45 41 44 45 |#define |DO_HEADE|
|00004d60| 52 28 70 68 64 72 29 09 | 66 6f 72 20 28 61 70 20 |R(phdr).|for (ap |
|00004d70| 3d 20 70 68 64 72 3b 20 | 2a 61 70 3b 20 61 70 2b |= phdr; |*ap; ap+|
|00004d80| 2b 29 20 50 52 54 28 22 | 25 73 5c 6e 22 2c 20 2a |+) PRT("|%s\n", *|
|00004d90| 61 70 29 0a 0a 09 49 4e | 49 54 5f 43 4f 4c 4f 52 |ap)...IN|IT_COLOR|
|00004da0| 53 3b 09 09 2f 2a 20 73 | 65 74 20 75 70 20 64 65 |S;../* s|et up de|
|00004db0| 66 61 75 6c 74 20 63 6f | 6c 6f 72 73 20 2a 2f 0a |fault co|lors */.|
|00004dc0| 0a 09 2f 2a 20 69 73 6f | 6c 61 74 65 20 72 6f 6f |../* iso|late roo|
|00004dd0| 74 20 70 72 6f 67 72 61 | 6d 20 6e 61 6d 65 20 28 |t progra|m name (|
|00004de0| 66 6f 72 20 75 73 65 20 | 69 6e 20 65 72 72 6f 72 |for use |in error|
|00004df0| 20 6d 65 73 73 61 67 65 | 73 29 20 2a 2f 0a 0a 09 | message|s) */...|
|00004e00| 73 74 72 63 70 79 28 70 | 72 6f 67 6e 61 6d 65 2c |strcpy(p|rogname,|
|00004e10| 20 2a 2a 61 72 67 76 20 | 3f 20 2a 61 72 67 76 20 | **argv |? *argv |
|00004e20| 3a 20 22 70 63 61 6c 22 | 29 3b 0a 0a 09 69 66 20 |: "pcal"|);...if |
|00004e30| 28 28 70 20 3d 20 73 74 | 72 72 63 68 72 28 70 72 |((p = st|rrchr(pr|
|00004e40| 6f 67 6e 61 6d 65 2c 20 | 45 4e 44 5f 50 41 54 48 |ogname, |END_PATH|
|00004e50| 29 29 20 21 3d 20 4e 55 | 4c 4c 29 0a 09 09 73 74 |)) != NU|LL)...st|
|00004e60| 72 63 70 79 28 70 72 6f | 67 6e 61 6d 65 2c 20 2b |rcpy(pro|gname, +|
|00004e70| 2b 70 29 3b 0a 09 69 66 | 20 28 28 70 20 3d 20 73 |+p);..if| ((p = s|
|00004e80| 74 72 63 68 72 28 70 72 | 6f 67 6e 61 6d 65 2c 20 |trchr(pr|ogname, |
|00004e90| 27 2e 27 29 29 20 21 3d | 20 4e 55 4c 4c 29 0a 09 |'.')) !=| NULL)..|
|00004ea0| 09 2a 70 20 3d 20 27 5c | 30 27 3b 0a 0a 09 2f 2a |.*p = '\|0';.../*|
|00004eb0| 0a 09 20 2a 20 47 65 74 | 20 74 68 65 20 61 72 67 |.. * Get| the arg|
|00004ec0| 75 6d 65 6e 74 73 20 66 | 72 6f 6d 20 61 29 20 74 |uments f|rom a) t|
|00004ed0| 68 65 20 65 6e 76 69 72 | 6f 6e 6d 65 6e 74 20 76 |he envir|onment v|
|00004ee0| 61 72 69 61 62 6c 65 2c | 20 62 29 20 22 6f 70 74 |ariable,| b) "opt|
|00004ef0| 22 20 6c 69 6e 65 73 0a | 09 20 2a 20 69 6e 20 74 |" lines.|. * in t|
|00004f00| 68 65 20 64 61 74 65 20 | 66 69 6c 65 2c 20 61 6e |he date |file, an|
|00004f10| 64 20 63 29 20 74 68 65 | 20 63 6f 6d 6d 61 6e 64 |d c) the| command|
|00004f20| 20 6c 69 6e 65 2c 20 69 | 6e 20 74 68 61 74 20 6f | line, i|n that o|
|00004f30| 72 64 65 72 0a 09 20 2a | 2f 0a 0a 09 2f 2a 20 6c |rder.. *|/.../* l|
|00004f40| 6f 6f 6b 20 66 6f 72 20 | 65 6e 76 69 72 6f 6e 6d |ook for |environm|
|00004f50| 65 6e 74 20 76 61 72 69 | 61 62 6c 65 20 66 6f 72 |ent vari|able for|
|00004f60| 20 6f 70 74 69 6f 6e 73 | 20 2a 2f 0a 0a 09 69 66 | options| */...if|
|00004f70| 20 28 28 70 20 3d 20 67 | 65 74 65 6e 76 28 50 43 | ((p = g|etenv(PC|
|00004f80| 41 4c 5f 4f 50 54 53 29 | 29 20 21 3d 20 4e 55 4c |AL_OPTS)|) != NUL|
|00004f90| 4c 29 20 7b 0a 09 09 73 | 74 72 63 70 79 28 6c 62 |L) {...s|trcpy(lb|
|00004fa0| 75 66 2c 20 22 78 20 22 | 29 3b 09 2f 2a 20 70 72 |uf, "x "|);./* pr|
|00004fb0| 65 70 65 6e 64 20 61 20 | 64 75 6d 6d 79 20 74 6f |epend a |dummy to|
|00004fc0| 6b 65 6e 20 2a 2f 0a 09 | 09 73 74 72 63 61 74 28 |ken */..|.strcat(|
|00004fd0| 6c 62 75 66 2c 20 70 29 | 3b 0a 09 09 6c 6f 61 64 |lbuf, p)|;...load|
|00004fe0| 77 6f 72 64 73 28 29 3b | 0a 09 09 69 66 20 28 21 |words();|...if (!|
|00004ff0| 20 67 65 74 5f 61 72 67 | 73 28 77 6f 72 64 73 2c | get_arg|s(words,|
|00005000| 20 41 4c 4c 5f 46 4c 41 | 47 53 2c 20 46 41 4c 53 | ALL_FLA|GS, FALS|
|00005010| 45 29 29 20 7b 0a 09 09 | 09 75 73 61 67 65 28 29 |E)) {...|.usage()|
|00005020| 3b 0a 09 09 09 65 78 69 | 74 28 45 58 49 54 5f 46 |;....exi|t(EXIT_F|
|00005030| 41 49 4c 55 52 45 29 3b | 0a 09 09 7d 0a 09 7d 0a |AILURE);|...}..}.|
|00005040| 0a 09 2f 2a 20 70 61 72 | 73 65 20 63 6f 6d 6d 61 |../* par|se comma|
|00005050| 6e 64 2d 6c 69 6e 65 20 | 61 72 67 75 6d 65 6e 74 |nd-line |argument|
|00005060| 73 20 6f 6e 63 65 20 74 | 6f 20 66 69 6e 64 20 6e |s once t|o find n|
|00005070| 61 6d 65 20 6f 66 20 64 | 61 74 65 20 66 69 6c 65 |ame of d|ate file|
|00005080| 2c 20 65 74 63 2e 20 2a | 2f 0a 0a 09 69 66 20 28 |, etc. *|/...if (|
|00005090| 21 67 65 74 5f 61 72 67 | 73 28 61 72 67 76 2c 20 |!get_arg|s(argv, |
|000050a0| 44 41 54 45 46 49 4c 45 | 5f 46 4c 41 47 53 2c 20 |DATEFILE|_FLAGS, |
|000050b0| 54 52 55 45 29 29 20 7b | 0a 09 09 75 73 61 67 65 |TRUE)) {|...usage|
|000050c0| 28 29 3b 0a 09 09 65 78 | 69 74 28 45 58 49 54 5f |();...ex|it(EXIT_|
|000050d0| 46 41 49 4c 55 52 45 29 | 3b 0a 09 7d 0a 0a 09 2f |FAILURE)|;..}.../|
|000050e0| 2a 20 41 74 74 65 6d 70 | 74 20 74 6f 20 6f 70 65 |* Attemp|t to ope|
|000050f0| 6e 20 74 68 65 20 64 61 | 74 65 20 66 69 6c 65 20 |n the da|te file |
|00005100| 61 73 20 73 70 65 63 69 | 66 69 65 64 20 62 79 20 |as speci|fied by |
|00005110| 74 68 65 20 5b 2d 65 20 | 7c 20 2d 66 5d 20 66 6c |the [-e || -f] fl|
|00005120| 61 67 73 20 2a 2f 0a 0a | 09 73 77 69 74 63 68 20 |ags */..|.switch |
|00005130| 28 64 61 74 65 66 69 6c | 65 5f 74 79 70 65 29 20 |(datefil|e_type) |
|00005140| 7b 0a 09 63 61 73 65 20 | 4e 4f 5f 44 41 54 45 46 |{..case |NO_DATEF|
|00005150| 49 4c 45 3a 0a 09 09 64 | 66 70 20 3d 20 4e 55 4c |ILE:...d|fp = NUL|
|00005160| 4c 3b 0a 09 09 62 72 65 | 61 6b 3b 0a 0a 09 63 61 |L;...bre|ak;...ca|
|00005170| 73 65 20 55 53 45 52 5f | 44 41 54 45 46 49 4c 45 |se USER_|DATEFILE|
|00005180| 3a 09 0a 09 09 2f 2a 20 | 41 74 74 65 6d 70 74 20 |:..../* |Attempt |
|00005190| 74 6f 20 6f 70 65 6e 20 | 75 73 65 72 2d 73 70 65 |to open |user-spe|
|000051a0| 63 69 66 69 65 64 20 63 | 61 6c 65 6e 64 61 72 20 |cified c|alendar |
|000051b0| 66 69 6c 65 20 2a 2f 0a | 09 09 69 66 20 28 28 64 |file */.|..if ((d|
|000051c0| 66 70 20 3d 20 66 6f 70 | 65 6e 28 64 61 74 65 66 |fp = fop|en(datef|
|000051d0| 69 6c 65 2c 20 22 72 22 | 29 29 20 3d 3d 20 4e 55 |ile, "r"|)) == NU|
|000051e0| 4c 4c 29 20 7b 0a 09 09 | 09 46 50 52 28 73 74 64 |LL) {...|.FPR(std|
|000051f0| 65 72 72 2c 20 22 25 73 | 3a 20 63 61 6e 27 74 20 |err, "%s|: can't |
|00005200| 6f 70 65 6e 20 66 69 6c | 65 20 25 73 5c 6e 22 2c |open fil|e %s\n",|
|00005210| 20 70 72 6f 67 6e 61 6d | 65 2c 20 0a 09 09 09 09 | prognam|e, .....|
|00005220| 64 61 74 65 66 69 6c 65 | 29 3b 0a 09 09 09 65 78 |datefile|);....ex|
|00005230| 69 74 28 45 58 49 54 5f | 46 41 49 4c 55 52 45 29 |it(EXIT_|FAILURE)|
|00005240| 3b 0a 09 09 7d 0a 09 09 | 6d 6b 5f 70 61 74 68 28 |;...}...|mk_path(|
|00005250| 64 65 66 61 75 6c 74 5f | 64 69 72 2c 20 64 61 74 |default_|dir, dat|
|00005260| 65 66 69 6c 65 29 3b 09 | 2f 2a 20 65 78 74 72 61 |efile);.|/* extra|
|00005270| 63 74 20 70 61 74 68 20 | 2a 2f 0a 09 09 62 72 65 |ct path |*/...bre|
|00005280| 61 6b 3b 0a 0a 09 63 61 | 73 65 20 53 59 53 5f 44 |ak;...ca|se SYS_D|
|00005290| 41 54 45 46 49 4c 45 3a | 0a 09 09 2f 2a 20 41 74 |ATEFILE:|.../* At|
|000052a0| 74 65 6d 70 74 20 74 6f | 20 6f 70 65 6e 20 73 79 |tempt to| open sy|
|000052b0| 73 74 65 6d 2d 73 70 65 | 63 69 66 69 65 64 20 63 |stem-spe|cified c|
|000052c0| 61 6c 65 6e 64 61 72 20 | 66 69 6c 65 20 2a 2f 0a |alendar |file */.|
|000052d0| 09 09 69 66 20 28 28 70 | 20 3d 20 74 72 6e 6c 6f |..if ((p| = trnlo|
|000052e0| 67 28 50 43 41 4c 5f 44 | 49 52 29 29 20 7c 7c 20 |g(PCAL_D|IR)) || |
|000052f0| 28 70 20 3d 20 74 72 6e | 6c 6f 67 28 48 4f 4d 45 |(p = trn|log(HOME|
|00005300| 5f 44 49 52 29 29 29 0a | 09 09 09 73 74 72 63 70 |_DIR))).|...strcp|
|00005310| 79 28 64 65 66 61 75 6c | 74 5f 64 69 72 2c 20 70 |y(defaul|t_dir, p|
|00005320| 29 3b 0a 0a 09 09 6d 6b | 5f 66 69 6c 65 73 70 65 |);....mk|_filespe|
|00005330| 63 28 64 61 74 65 66 69 | 6c 65 2c 20 64 65 66 61 |c(datefi|le, defa|
|00005340| 75 6c 74 5f 64 69 72 2c | 20 44 41 54 45 46 49 4c |ult_dir,| DATEFIL|
|00005350| 45 29 3b 0a 09 09 64 66 | 70 20 3d 20 66 6f 70 65 |E);...df|p = fope|
|00005360| 6e 28 64 61 74 65 66 69 | 6c 65 2c 20 22 72 22 29 |n(datefi|le, "r")|
|00005370| 3b 09 2f 2a 20 6e 6f 20 | 65 72 72 6f 72 20 69 66 |;./* no |error if|
|00005380| 20 6e 6f 6e 65 78 69 73 | 74 65 6e 74 20 2a 2f 0a | nonexis|tent */.|
|00005390| 23 69 66 64 65 66 20 41 | 4c 54 5f 44 41 54 45 46 |#ifdef A|LT_DATEF|
|000053a0| 49 4c 45 0a 09 09 69 66 | 20 28 21 64 66 70 29 20 |ILE...if| (!dfp) |
|000053b0| 7b 09 09 2f 2a 20 74 72 | 79 20 61 67 61 69 6e 20 |{../* tr|y again |
|000053c0| 77 69 74 68 20 61 6c 74 | 65 72 6e 61 74 65 20 66 |with alt|ernate f|
|000053d0| 69 6c 65 20 2a 2f 0a 09 | 09 09 6d 6b 5f 66 69 6c |ile */..|..mk_fil|
|000053e0| 65 73 70 65 63 28 64 61 | 74 65 66 69 6c 65 2c 20 |espec(da|tefile, |
|000053f0| 64 65 66 61 75 6c 74 5f | 64 69 72 2c 20 41 4c 54 |default_|dir, ALT|
|00005400| 5f 44 41 54 45 46 49 4c | 45 29 3b 0a 09 09 09 64 |_DATEFIL|E);....d|
|00005410| 66 70 20 3d 20 66 6f 70 | 65 6e 28 64 61 74 65 66 |fp = fop|en(datef|
|00005420| 69 6c 65 2c 20 22 72 22 | 29 3b 0a 09 09 7d 0a 23 |ile, "r"|);...}.#|
|00005430| 65 6e 64 69 66 0a 09 09 | 62 72 65 61 6b 3b 0a 09 |endif...|break;..|
|00005440| 7d 0a 0a 09 2f 2a 20 72 | 65 61 64 20 74 68 65 20 |}.../* r|ead the |
|00005450| 64 61 74 65 20 66 69 6c | 65 20 28 69 66 20 61 6e |date fil|e (if an|
|00005460| 79 29 20 61 6e 64 20 62 | 75 69 6c 64 20 69 6e 74 |y) and b|uild int|
|00005470| 65 72 6e 61 6c 20 64 61 | 74 61 20 73 74 72 75 63 |ernal da|ta struc|
|00005480| 74 75 72 65 20 2a 2f 0a | 0a 09 69 66 20 28 64 66 |ture */.|..if (df|
|00005490| 70 29 20 7b 0a 09 09 63 | 75 72 72 5f 79 65 61 72 |p) {...c|urr_year|
|000054a0| 20 3d 20 69 6e 69 74 5f | 79 65 61 72 3b 0a 09 09 | = init_|year;...|
|000054b0| 72 65 61 64 5f 64 61 74 | 65 66 69 6c 65 28 64 66 |read_dat|efile(df|
|000054c0| 70 2c 20 64 61 74 65 66 | 69 6c 65 29 3b 0a 09 09 |p, datef|ile);...|
|000054d0| 66 63 6c 6f 73 65 28 64 | 66 70 29 3b 0a 09 7d 0a |fclose(d|fp);..}.|
|000054e0| 0a 09 2f 2a 20 72 65 70 | 61 72 73 65 20 63 6f 6d |../* rep|arse com|
|000054f0| 6d 61 6e 64 20 6c 69 6e | 65 20 2d 20 66 6c 61 67 |mand lin|e - flag|
|00005500| 73 20 74 68 65 72 65 20 | 73 75 70 65 72 73 65 64 |s there |supersed|
|00005510| 65 20 74 68 6f 73 65 20 | 69 6e 20 64 61 74 65 20 |e those |in date |
|00005520| 66 69 6c 65 20 2a 2f 0a | 0a 09 67 65 74 5f 61 72 |file */.|..get_ar|
|00005530| 67 73 28 61 72 67 76 2c | 20 4f 54 48 45 52 5f 46 |gs(argv,| OTHER_F|
|00005540| 4c 41 47 53 2c 20 46 41 | 4c 53 45 29 3b 0a 0a 09 |LAGS, FA|LSE);...|
|00005550| 2f 2a 20 64 6f 6e 65 20 | 77 69 74 68 20 74 68 65 |/* done |with the|
|00005560| 20 61 72 67 75 6d 65 6e | 74 73 20 61 6e 64 20 66 | argumen|ts and f|
|00005570| 6c 61 67 73 20 2d 20 74 | 72 79 20 74 6f 20 6f 70 |lags - t|ry to op|
|00005580| 65 6e 20 74 68 65 20 6f | 75 74 70 75 74 20 66 69 |en the o|utput fi|
|00005590| 6c 65 20 2a 2f 0a 0a 09 | 69 66 20 28 2a 6f 75 74 |le */...|if (*out|
|000055a0| 66 69 6c 65 20 26 26 20 | 66 72 65 6f 70 65 6e 28 |file && |freopen(|
|000055b0| 6f 75 74 66 69 6c 65 2c | 20 22 77 22 2c 20 73 74 |outfile,| "w", st|
|000055c0| 64 6f 75 74 29 20 3d 3d | 20 28 46 49 4c 45 20 2a |dout) ==| (FILE *|
|000055d0| 29 20 4e 55 4c 4c 29 20 | 7b 0a 09 09 46 50 52 28 |) NULL) |{...FPR(|
|000055e0| 73 74 64 65 72 72 2c 20 | 22 25 73 3a 20 63 61 6e |stderr, |"%s: can|
|000055f0| 27 74 20 6f 70 65 6e 20 | 66 69 6c 65 20 25 73 5c |'t open |file %s\|
|00005600| 6e 22 2c 20 70 72 6f 67 | 6e 61 6d 65 2c 20 6f 75 |n", prog|name, ou|
|00005610| 74 66 69 6c 65 29 3b 0a | 09 09 65 78 69 74 28 45 |tfile);.|..exit(E|
|00005620| 58 49 54 5f 46 41 49 4c | 55 52 45 29 3b 0a 09 7d |XIT_FAIL|URE);..}|
|00005630| 0a 0a 09 2f 2a 0a 09 20 | 2a 20 57 72 69 74 65 20 |.../*.. |* Write |
|00005640| 6f 75 74 20 50 6f 73 74 | 53 63 72 69 70 74 20 70 |out Post|Script p|
|00005650| 72 6f 6c 6f 67 0a 09 20 | 2a 2f 0a 0a 09 2f 2a 20 |rolog.. |*/.../* |
|00005660| 66 6f 6e 74 20 6e 61 6d | 65 73 20 2a 2f 0a 0a 20 |font nam|es */.. |
|00005670| 09 50 52 54 28 22 25 25 | 21 5c 6e 22 29 3b 0a 09 |.PRT("%%|!\n");..|
|00005680| 50 52 54 28 22 2f 74 69 | 74 6c 65 66 6f 6e 74 20 |PRT("/ti|tlefont |
|00005690| 2f 25 73 20 64 65 66 5c | 6e 2f 64 61 79 66 6f 6e |/%s def\|n/dayfon|
|000056a0| 74 20 2f 25 73 20 64 65 | 66 5c 6e 2f 6e 6f 74 65 |t /%s de|f\n/note|
|000056b0| 73 66 6f 6e 74 20 2f 25 | 73 20 64 65 66 5c 6e 22 |sfont /%|s def\n"|
|000056c0| 2c 20 74 69 74 6c 65 66 | 6f 6e 74 2c 20 64 61 79 |, titlef|ont, day|
|000056d0| 66 6f 6e 74 2c 20 6e 6f | 74 65 73 66 6f 6e 74 29 |font, no|tesfont)|
|000056e0| 3b 0a 0a 09 2f 2a 20 66 | 6f 6f 74 20 73 74 72 69 |;.../* f|oot stri|
|000056f0| 6e 67 73 20 2a 2f 0a 0a | 09 64 65 66 5f 66 6f 6f |ngs */..|.def_foo|
|00005700| 74 73 74 72 69 6e 67 28 | 6c 66 6f 6f 74 2c 20 27 |tstring(|lfoot, '|
|00005710| 4c 27 29 3b 0a 09 64 65 | 66 5f 66 6f 6f 74 73 74 |L');..de|f_footst|
|00005720| 72 69 6e 67 28 63 66 6f | 6f 74 2c 20 27 43 27 29 |ring(cfo|ot, 'C')|
|00005730| 3b 0a 09 64 65 66 5f 66 | 6f 6f 74 73 74 72 69 6e |;..def_f|ootstrin|
|00005740| 67 28 72 66 6f 6f 74 2c | 20 27 52 27 29 3b 0a 0a |g(rfoot,| 'R');..|
|00005750| 09 2f 2a 20 6d 6f 6e 74 | 68 20 6e 61 6d 65 73 20 |./* mont|h names |
|00005760| 2a 2f 0a 0a 09 50 52 54 | 28 22 2f 6d 6f 6e 74 68 |*/...PRT|("/month|
|00005770| 5f 6e 61 6d 65 73 20 5b | 22 29 3b 0a 09 66 6f 72 |_names [|");..for|
|00005780| 20 28 69 20 3d 20 30 3b | 20 69 20 3c 20 31 32 3b | (i = 0;| i < 12;|
|00005790| 20 69 2b 2b 29 0a 09 09 | 50 52 54 28 22 25 73 28 | i++)...|PRT("%s(|
|000057a0| 25 73 29 20 22 2c 20 69 | 20 25 20 36 20 3d 3d 20 |%s) ", i| % 6 == |
|000057b0| 30 20 3f 20 22 5c 6e 5c | 74 22 20 3a 20 22 22 2c |0 ? "\n\|t" : "",|
|000057c0| 20 6d 6f 6e 74 68 73 5b | 69 5d 29 3b 0a 09 50 52 | months[|i]);..PR|
|000057d0| 54 28 22 5d 20 64 65 66 | 5c 6e 22 29 3b 0a 0a 09 |T("] def|\n");...|
|000057e0| 2f 2a 20 64 61 79 20 6e | 61 6d 65 73 20 2a 2f 0a |/* day n|ames */.|
|000057f0| 0a 09 50 52 54 28 22 2f | 64 61 79 5f 6e 61 6d 65 |..PRT("/|day_name|
|00005800| 73 20 5b 22 29 3b 0a 09 | 66 6f 72 20 28 69 20 3d |s [");..|for (i =|
|00005810| 20 30 3b 20 69 20 3c 20 | 37 3b 20 69 2b 2b 29 0a | 0; i < |7; i++).|
|00005820| 09 09 50 52 54 28 22 25 | 73 28 25 73 29 20 22 2c |..PRT("%|s(%s) ",|
|00005830| 20 69 20 25 20 36 20 3d | 3d 20 30 20 3f 20 22 5c | i % 6 =|= 0 ? "\|
|00005840| 6e 5c 74 22 20 3a 20 22 | 22 2c 20 64 61 79 73 5b |n\t" : "|", days[|
|00005850| 69 5d 29 3b 0a 09 50 52 | 54 28 22 5d 20 64 65 66 |i]);..PR|T("] def|
|00005860| 5c 6e 22 29 3b 0a 0a 09 | 2f 2a 20 63 6f 6c 6f 72 |\n");...|/* color|
|00005870| 73 20 28 62 6c 61 63 6b | 2f 67 72 61 79 29 20 74 |s (black|/gray) t|
|00005880| 6f 20 70 72 69 6e 74 20 | 77 65 65 6b 64 61 79 73 |o print |weekdays|
|00005890| 20 61 6e 64 20 68 6f 6c | 69 64 61 79 73 20 2a 2f | and hol|idays */|
|000058a0| 0a 0a 09 50 52 54 28 22 | 2f 64 61 79 5f 67 72 61 |...PRT("|/day_gra|
|000058b0| 79 20 5b 22 29 3b 0a 09 | 66 6f 72 20 28 6e 67 72 |y [");..|for (ngr|
|000058c0| 61 79 20 3d 20 69 20 3d | 20 30 3b 20 69 20 3c 20 |ay = i =| 0; i < |
|000058d0| 37 3b 20 6e 67 72 61 79 | 20 2b 3d 20 63 6f 6c 6f |7; ngray| += colo|
|000058e0| 72 5b 69 2b 2b 5d 20 3d | 3d 20 47 52 41 59 29 0a |r[i++] =|= GRAY).|
|000058f0| 09 09 50 52 54 28 22 20 | 25 73 22 2c 20 63 6f 6c |..PRT(" |%s", col|
|00005900| 6f 72 5b 69 5d 20 3d 3d | 20 47 52 41 59 20 3f 20 |or[i] ==| GRAY ? |
|00005910| 22 74 72 75 65 22 20 3a | 20 22 66 61 6c 73 65 22 |"true" :| "false"|
|00005920| 29 3b 0a 09 50 52 54 28 | 22 20 5d 20 64 65 66 5c |);..PRT(|" ] def\|
|00005930| 6e 22 29 3b 0a 09 50 52 | 54 28 22 2f 68 6f 6c 69 |n");..PR|T("/holi|
|00005940| 64 61 79 5f 67 72 61 79 | 20 25 73 20 64 65 66 5c |day_gray| %s def\|
|00005950| 6e 22 2c 20 6e 67 72 61 | 79 20 3c 3d 20 33 20 3f |n", ngra|y <= 3 ?|
|00005960| 20 22 74 72 75 65 22 20 | 3a 20 22 66 61 6c 73 65 | "true" |: "false|
|00005970| 22 29 3b 0a 0a 09 2f 2a | 20 50 6f 73 74 53 63 72 |");.../*| PostScr|
|00005980| 69 70 74 20 62 6f 69 6c | 65 72 70 6c 61 74 65 20 |ipt boil|erplate |
|00005990| 28 70 61 72 74 20 31 29 | 20 2a 2f 0a 0a 09 44 4f |(part 1)| */...DO|
|000059a0| 5f 48 45 41 44 45 52 28 | 68 65 61 64 65 72 5f 31 |_HEADER(|header_1|
|000059b0| 29 3b 0a 0a 09 2f 2a 20 | 6c 61 6e 64 73 63 61 70 |);.../* |landscap|
|000059c0| 65 20 6f 72 20 70 6f 72 | 74 72 61 69 74 20 6d 6f |e or por|trait mo|
|000059d0| 64 65 20 2a 2f 0a 0a 20 | 09 50 52 54 28 22 5c 74 |de */.. |.PRT("\t|
|000059e0| 25 64 20 72 6f 74 61 74 | 65 5c 6e 22 2c 20 72 6f |%d rotat|e\n", ro|
|000059f0| 74 61 74 65 29 3b 0a 20 | 09 69 66 20 28 72 6f 74 |tate);. |.if (rot|
|00005a00| 61 74 65 20 3d 3d 20 4c | 41 4e 44 53 43 41 50 45 |ate == L|ANDSCAPE|
|00005a10| 29 0a 20 09 09 50 52 54 | 28 22 5c 74 35 30 20 2d |). ..PRT|("\t50 -|
|00005a20| 31 32 30 20 74 72 61 6e | 73 6c 61 74 65 5c 6e 22 |120 tran|slate\n"|
|00005a30| 29 3b 0a 20 09 65 6c 73 | 65 0a 09 09 50 52 54 28 |);. .els|e...PRT(|
|00005a40| 22 5c 74 30 2e 37 35 20 | 30 2e 37 35 20 73 63 61 |"\t0.75 |0.75 sca|
|00005a50| 6c 65 5c 6e 5c 74 35 30 | 20 35 30 30 20 74 72 61 |le\n\t50| 500 tra|
|00005a60| 6e 73 6c 61 74 65 5c 6e | 22 29 3b 0a 0a 09 2f 2a |nslate\n|");.../*|
|00005a70| 20 50 6f 73 74 53 63 72 | 69 70 74 20 62 6f 69 6c | PostScr|ipt boil|
|00005a80| 65 72 70 6c 61 74 65 20 | 28 70 61 72 74 20 32 29 |erplate |(part 2)|
|00005a90| 20 2a 2f 0a 0a 09 44 4f | 5f 48 45 41 44 45 52 28 | */...DO|_HEADER(|
|00005aa0| 68 65 61 64 65 72 5f 32 | 29 3b 0a 0a 09 2f 2a 0a |header_2|);.../*.|
|00005ab0| 09 20 2a 20 57 72 69 74 | 65 20 6f 75 74 20 50 6f |. * Writ|e out Po|
|00005ac0| 73 74 53 63 72 69 70 74 | 20 63 6f 64 65 20 74 6f |stScript| code to|
|00005ad0| 20 70 72 69 6e 74 20 63 | 61 6c 65 6e 64 61 72 73 | print c|alendars|
|00005ae0| 0a 09 20 2a 2f 0a 0a 09 | 6d 6f 6e 74 68 20 3d 20 |.. */...|month = |
|00005af0| 69 6e 69 74 5f 6d 6f 6e | 74 68 3b 0a 09 79 65 61 |init_mon|th;..yea|
|00005b00| 72 20 3d 20 69 6e 69 74 | 5f 79 65 61 72 3b 0a 0a |r = init|_year;..|
|00005b10| 09 77 68 69 6c 65 20 28 | 6e 6d 6f 6e 74 68 73 2d |.while (|nmonths-|
|00005b20| 2d 29 20 7b 0a 09 09 70 | 6d 6f 6e 74 68 28 6d 6f |-) {...p|month(mo|
|00005b30| 6e 74 68 2c 20 79 65 61 | 72 29 3b 0a 09 09 69 66 |nth, yea|r);...if|
|00005b40| 20 28 2b 2b 6d 6f 6e 74 | 68 20 3e 20 44 45 43 29 | (++mont|h > DEC)|
|00005b50| 20 7b 0a 09 09 09 6d 6f | 6e 74 68 20 3d 20 4a 41 | {....mo|nth = JA|
|00005b60| 4e 3b 0a 09 09 09 79 65 | 61 72 2b 2b 3b 0a 09 09 |N;....ye|ar++;...|
|00005b70| 7d 0a 09 7d 0a 0a 09 63 | 6c 65 61 6e 75 70 28 29 |}..}...c|leanup()|
|00005b80| 3b 0a 0a 23 69 66 64 65 | 66 20 56 4d 53 0a 09 46 |;..#ifde|f VMS..F|
|00005b90| 50 52 28 73 74 64 65 72 | 72 2c 20 22 4f 75 74 70 |PR(stder|r, "Outp|
|00005ba0| 75 74 20 69 73 20 69 6e | 20 66 69 6c 65 20 25 73 |ut is in| file %s|
|00005bb0| 5c 6e 22 2c 20 6f 75 74 | 66 69 6c 65 29 3b 0a 23 |\n", out|file);.#|
|00005bc0| 65 6e 64 69 66 0a 09 65 | 78 69 74 28 45 58 49 54 |endif..e|xit(EXIT|
|00005bd0| 5f 53 55 43 43 45 53 53 | 29 3b 0a 7d 0a 0c 0a 2f |_SUCCESS|);.}.../|
|00005be0| 2a 0a 20 2a 20 67 65 74 | 5f 61 72 67 73 20 2d 20 |*. * get|_args - |
|00005bf0| 77 61 6c 6b 20 74 68 65 | 20 61 72 67 75 6d 65 6e |walk the| argumen|
|00005c00| 74 20 6c 69 73 74 2c 20 | 70 61 72 73 69 6e 67 20 |t list, |parsing |
|00005c10| 61 6c 6c 20 61 72 67 75 | 6d 65 6e 74 73 20 62 75 |all argu|ments bu|
|00005c20| 74 20 70 72 6f 63 65 73 | 73 69 6e 67 20 6f 6e 6c |t proces|sing onl|
|00005c30| 79 0a 20 2a 20 74 68 6f | 73 65 20 73 70 65 63 69 |y. * tho|se speci|
|00005c40| 66 69 65 64 20 69 6e 20 | 22 66 6c 61 67 73 22 2e |fied in |"flags".|
|00005c50| 20 20 49 66 20 22 64 6f | 5f 6e 75 6d 61 72 67 73 | If "do|_numargs|
|00005c60| 22 20 69 73 20 54 52 55 | 45 2c 20 70 72 6f 63 65 |" is TRU|E, proce|
|00005c70| 73 73 65 73 20 6e 75 6d | 65 72 69 63 0a 20 2a 20 |sses num|eric. * |
|00005c80| 61 72 67 75 6d 65 6e 74 | 73 20 28 6d 6f 6e 74 68 |argument|s (month|
|00005c90| 2c 20 79 65 61 72 2c 20 | 6e 75 6d 62 65 72 20 6f |, year, |number o|
|00005ca0| 66 20 6d 6f 6e 74 68 73 | 29 20 61 73 20 77 65 6c |f months|) as wel|
|00005cb0| 6c 2e 0a 20 2a 2f 0a 69 | 6e 74 20 67 65 74 5f 61 |l.. */.i|nt get_a|
|00005cc0| 72 67 73 28 61 72 67 76 | 2c 20 66 6c 61 67 73 2c |rgs(argv|, flags,|
|00005cd0| 20 64 6f 5f 6e 75 6d 61 | 72 67 73 29 0a 09 63 68 | do_numa|rgs)..ch|
|00005ce0| 61 72 20 2a 2a 61 72 67 | 76 3b 09 09 2f 2a 20 61 |ar **arg|v;../* a|
|00005cf0| 72 67 75 6d 65 6e 74 20 | 6c 69 73 74 20 2a 2f 0a |rgument |list */.|
|00005d00| 09 63 68 61 72 20 2a 66 | 6c 61 67 73 3b 09 09 2f |.char *f|lags;../|
|00005d10| 2a 20 77 68 69 63 68 20 | 66 6c 61 67 73 20 74 6f |* which |flags to|
|00005d20| 20 70 72 6f 63 65 73 73 | 20 2a 2f 0a 09 69 6e 74 | process| */..int|
|00005d30| 20 64 6f 5f 6e 75 6d 61 | 72 67 73 3b 09 09 2f 2a | do_numa|rgs;../*|
|00005d40| 20 70 72 6f 63 65 73 73 | 20 6e 75 6d 65 72 69 63 | process| numeric|
|00005d50| 20 61 72 67 75 6d 65 6e | 74 73 3f 20 2a 2f 0a 7b | argumen|ts? */.{|
|00005d60| 0a 09 63 68 61 72 20 2a | 70 2c 20 2a 6f 70 74 3b |..char *|p, *opt;|
|00005d70| 0a 09 69 6e 74 20 69 2c | 20 64 6f 5f 66 6c 61 67 |..int i,| do_flag|
|00005d80| 3b 0a 09 6c 6f 6e 67 20 | 74 6d 70 3b 09 09 09 2f |;..long |tmp;.../|
|00005d90| 2a 20 66 6f 72 20 67 65 | 74 74 69 6e 67 20 63 75 |* for ge|tting cu|
|00005da0| 72 72 65 6e 74 20 6d 6f | 6e 74 68 2f 79 65 61 72 |rrent mo|nth/year|
|00005db0| 20 2a 2f 0a 09 73 74 72 | 75 63 74 20 74 6d 20 2a | */..str|uct tm *|
|00005dc0| 70 5f 74 6d 3b 0a 09 69 | 6e 74 20 62 61 64 6f 70 |p_tm;..i|nt badop|
|00005dd0| 74 20 3d 20 46 41 4c 53 | 45 3b 09 09 2f 2a 20 66 |t = FALS|E;../* f|
|00005de0| 6c 61 67 20 73 65 74 20 | 69 66 20 62 61 64 20 70 |lag set |if bad p|
|00005df0| 61 72 61 6d 20 20 20 2a | 2f 0a 09 69 6e 74 20 6e |aram *|/..int n|
|00005e00| 61 72 67 73 20 3d 20 30 | 3b 09 09 09 2f 2a 20 63 |args = 0|;.../* c|
|00005e10| 6f 75 6e 74 20 6f 66 20 | 6e 6f 6e 2d 66 6c 61 67 |ount of |non-flag|
|00005e20| 20 61 72 67 73 20 20 2a | 2f 0a 09 69 6e 74 20 6e | args *|/..int n|
|00005e30| 75 6d 61 72 67 73 5b 4d | 41 58 41 52 47 53 5d 3b |umargs[M|AXARGS];|
|00005e40| 09 09 2f 2a 20 6e 6f 6e | 2d 66 6c 61 67 20 28 6e |../* non|-flag (n|
|00005e50| 75 6d 65 72 69 63 29 20 | 61 72 67 73 20 2a 2f 0a |umeric) |args */.|
|00005e60| 0a 2f 2a 20 4c 6f 6f 6b | 20 66 6f 72 20 74 68 65 |./* Look| for the|
|00005e70| 20 61 72 67 75 6d 65 6e | 74 20 66 6f 6c 6c 6f 77 | argumen|t follow|
|00005e80| 69 6e 67 20 66 6c 61 67 | 20 2d 20 6d 61 79 20 62 |ing flag| - may b|
|00005e90| 65 20 73 65 70 61 72 61 | 74 65 64 20 62 79 20 73 |e separa|ted by s|
|00005ea0| 70 61 63 65 73 20 6f 72 | 0a 20 2a 20 6e 6f 74 20 |paces or|. * not |
|00005eb0| 28 62 75 6d 70 73 20 61 | 72 67 76 20 69 6e 20 66 |(bumps a|rgv in f|
|00005ec0| 6f 72 6d 65 72 20 63 61 | 73 65 29 2e 20 20 49 66 |ormer ca|se). If|
|00005ed0| 20 6e 6f 20 6e 6f 6e 2d | 66 6c 61 67 20 61 72 67 | no non-|flag arg|
|00005ee0| 75 6d 65 6e 74 20 61 70 | 70 65 61 72 73 2c 20 73 |ument ap|pears, s|
|00005ef0| 65 74 0a 20 2a 20 22 61 | 72 67 22 20 74 6f 20 4e |et. * "a|rg" to N|
|00005f00| 55 4c 4c 20 28 2d 62 2c | 20 2d 43 2c 20 2d 64 2c |ULL (-b,| -C, -d,|
|00005f10| 20 2d 67 2c 20 2d 4c 2c | 20 2d 6e 2c 20 2d 6f 2c | -g, -L,| -n, -o,|
|00005f20| 20 2d 52 2c 20 61 6e 64 | 20 2d 74 20 77 69 74 68 | -R, and| -t with|
|00005f30| 6f 75 74 20 61 6e 20 61 | 72 67 75 6d 65 6e 74 0a |out an a|rgument.|
|00005f40| 20 2a 20 72 65 73 65 74 | 20 74 68 65 20 63 6f 72 | * reset| the cor|
|00005f50| 72 65 73 70 6f 6e 64 69 | 6e 67 20 6f 70 74 69 6f |respondi|ng optio|
|00005f60| 6e 20 74 6f 20 69 74 73 | 20 64 65 66 61 75 6c 74 |n to its| default|
|00005f70| 20 76 61 6c 75 65 29 2e | 0a 20 2a 2f 0a 23 64 65 | value).|. */.#de|
|00005f80| 66 69 6e 65 20 47 45 54 | 41 52 47 28 61 72 67 29 |fine GET|ARG(arg)|
|00005f90| 20 61 72 67 20 3d 20 2a | 28 2a 61 72 67 76 20 2b | arg = *|(*argv +|
|00005fa0| 20 32 29 20 3f 20 2a 61 | 72 67 76 20 2b 20 32 20 | 2) ? *a|rgv + 2 |
|00005fb0| 3a 20 5c 0a 09 09 09 28 | 2a 28 61 72 67 76 2b 31 |: \....(|*(argv+1|
|00005fc0| 29 20 26 26 20 2a 2a 28 | 61 72 67 76 2b 31 29 20 |) && **(|argv+1) |
|00005fd0| 21 3d 20 27 2d 27 20 3f | 20 2a 2b 2b 61 72 67 76 |!= '-' ?| *++argv|
|00005fe0| 20 3a 20 4e 55 4c 4c 29 | 0a 0a 09 2f 2a 20 57 61 | : NULL)|.../* Wa|
|00005ff0| 6c 6b 20 61 72 67 75 6d | 65 6e 74 20 6c 69 73 74 |lk argum|ent list|
|00006000| 2c 20 69 67 6e 6f 72 69 | 6e 67 20 66 69 72 73 74 |, ignori|ng first|
|00006010| 20 65 6c 65 6d 65 6e 74 | 20 28 70 72 6f 67 72 61 | element| (progra|
|00006020| 6d 20 6e 61 6d 65 29 20 | 2a 2f 0a 0a 20 09 77 68 |m name) |*/.. .wh|
|00006030| 69 6c 65 20 28 2a 2b 2b | 61 72 67 76 29 20 7b 0a |ile (*++|argv) {.|
|00006040| 0a 09 09 2f 2a 20 41 73 | 73 75 6d 65 20 74 68 61 |.../* As|sume tha|
|00006050| 74 20 61 6e 79 20 6e 6f | 6e 2d 66 6c 61 67 20 61 |t any no|n-flag a|
|00006060| 72 67 75 6d 65 6e 74 20 | 69 73 20 61 20 6e 75 6d |rgument |is a num|
|00006070| 65 72 69 63 20 61 72 67 | 75 6d 65 6e 74 20 2a 2f |eric arg|ument */|
|00006080| 0a 09 09 69 66 20 28 2a | 2a 61 72 67 76 20 21 3d |...if (*|*argv !=|
|00006090| 20 27 2d 27 29 20 7b 0a | 09 09 20 20 20 20 09 69 | '-') {.|.. .i|
|000060a0| 66 20 28 64 6f 5f 6e 75 | 6d 61 72 67 73 20 26 26 |f (do_nu|margs &&|
|000060b0| 20 6e 61 72 67 73 20 3c | 20 4d 41 58 41 52 47 53 | nargs <| MAXARGS|
|000060c0| 29 0a 09 09 09 09 6e 75 | 6d 61 72 67 73 5b 6e 61 |).....nu|margs[na|
|000060d0| 72 67 73 2b 2b 5d 20 3d | 20 61 74 6f 69 28 2a 61 |rgs++] =| atoi(*a|
|000060e0| 72 67 76 29 3b 0a 09 09 | 09 63 6f 6e 74 69 6e 75 |rgv);...|.continu|
|000060f0| 65 3b 0a 09 09 7d 0a 0a | 09 09 2f 2a 20 49 73 20 |e;...}..|../* Is |
|00006100| 74 68 69 73 20 66 6c 61 | 67 20 61 6d 6f 6e 67 20 |this fla|g among |
|00006110| 74 68 6f 73 65 20 74 6f | 20 62 65 20 70 72 6f 63 |those to| be proc|
|00006120| 65 73 73 65 64 20 62 65 | 79 6f 6e 64 20 70 61 72 |essed be|yond par|
|00006130| 73 69 6e 67 3f 20 2a 2f | 0a 0a 09 09 64 6f 5f 66 |sing? */|....do_f|
|00006140| 6c 61 67 20 3d 20 73 74 | 72 63 68 72 28 66 6c 61 |lag = st|rchr(fla|
|00006150| 67 73 2c 20 2a 28 6f 70 | 74 20 3d 20 2a 61 72 67 |gs, *(op|t = *arg|
|00006160| 76 20 2b 20 31 29 29 20 | 21 3d 20 4e 55 4c 4c 3b |v + 1)) |!= NULL;|
|00006170| 0a 0a 09 09 73 77 69 74 | 63 68 20 28 2a 6f 70 74 |....swit|ch (*opt|
|00006180| 29 20 7b 0a 0a 09 09 63 | 61 73 65 20 27 5c 30 27 |) {....c|ase '\0'|
|00006190| 3a 09 09 2f 2a 20 74 61 | 6b 65 20 2d 20 6f 72 20 |:../* ta|ke - or |
|000061a0| 2d 2d 20 61 73 20 64 75 | 6d 6d 79 20 66 6c 61 67 |-- as du|mmy flag|
|000061b0| 73 20 2a 2f 0a 09 09 63 | 61 73 65 20 27 2d 27 20 |s */...c|ase '-' |
|000061c0| 3a 0a 09 09 09 62 72 65 | 61 6b 3b 0a 0a 09 09 63 |:....bre|ak;....c|
|000061d0| 61 73 65 20 27 62 27 3a | 09 09 2f 2a 20 70 72 69 |ase 'b':|../* pri|
|000061e0| 6e 74 20 64 61 79 20 69 | 6e 20 62 6c 61 63 6b 20 |nt day i|n black |
|000061f0| 6f 72 20 67 72 61 79 20 | 2a 2f 0a 09 09 63 61 73 |or gray |*/...cas|
|00006200| 65 20 27 67 27 3a 0a 09 | 09 09 47 45 54 41 52 47 |e 'g':..|..GETARG|
|00006210| 28 70 29 3b 0a 09 09 09 | 69 66 20 28 64 6f 5f 66 |(p);....|if (do_f|
|00006220| 6c 61 67 29 0a 09 09 09 | 09 69 66 20 28 70 29 0a |lag)....|.if (p).|
|00006230| 09 09 09 09 09 73 65 74 | 5f 63 6f 6c 6f 72 28 70 |.....set|_color(p|
|00006240| 2c 20 2a 6f 70 74 20 3d | 3d 20 27 62 27 20 3f 20 |, *opt =|= 'b' ? |
|00006250| 42 4c 41 43 4b 20 3a 20 | 47 52 41 59 29 3b 0a 09 |BLACK : |GRAY);..|
|00006260| 09 09 09 65 6c 73 65 0a | 09 09 09 09 09 49 4e 49 |...else.|.....INI|
|00006270| 54 5f 43 4f 4c 4f 52 53 | 3b 09 2f 2a 20 72 65 73 |T_COLORS|;./* res|
|00006280| 65 74 20 74 6f 20 64 65 | 66 61 75 6c 74 73 20 2a |et to de|faults *|
|00006290| 2f 0a 09 09 09 62 72 65 | 61 6b 3b 0a 0a 09 09 63 |/....bre|ak;....c|
|000062a0| 61 73 65 20 27 43 27 3a | 09 09 2f 2a 20 73 70 65 |ase 'C':|../* spe|
|000062b0| 63 69 66 79 20 61 6c 74 | 65 72 6e 61 74 65 20 63 |cify alt|ernate c|
|000062c0| 65 6e 74 65 72 20 66 6f | 6f 74 20 2a 2f 0a 09 09 |enter fo|ot */...|
|000062d0| 09 47 45 54 41 52 47 28 | 70 29 3b 0a 09 09 09 69 |.GETARG(|p);....i|
|000062e0| 66 20 28 64 6f 5f 66 6c | 61 67 29 0a 09 09 09 09 |f (do_fl|ag).....|
|000062f0| 73 74 72 63 70 79 28 63 | 66 6f 6f 74 2c 20 70 20 |strcpy(c|foot, p |
|00006300| 3f 20 70 20 3a 20 43 46 | 4f 4f 54 29 3b 0a 09 09 |? p : CF|OOT);...|
|00006310| 09 62 72 65 61 6b 3b 0a | 0a 20 09 09 63 61 73 65 |.break;.|. ..case|
|00006320| 20 27 64 27 3a 09 09 2f | 2a 20 73 70 65 63 69 66 | 'd':../|* specif|
|00006330| 79 20 61 6c 74 65 72 6e | 61 74 65 20 64 61 79 20 |y altern|ate day |
|00006340| 66 6f 6e 74 20 2a 2f 0a | 20 09 09 09 47 45 54 41 |font */.| ...GETA|
|00006350| 52 47 28 70 29 3b 0a 09 | 09 09 69 66 20 28 64 6f |RG(p);..|..if (do|
|00006360| 5f 66 6c 61 67 29 0a 09 | 09 09 09 73 74 72 63 70 |_flag)..|...strcp|
|00006370| 79 28 64 61 79 66 6f 6e | 74 2c 20 70 20 3f 20 70 |y(dayfon|t, p ? p|
|00006380| 20 3a 20 44 41 59 46 4f | 4e 54 29 3b 0a 20 09 09 | : DAYFO|NT);. ..|
|00006390| 09 62 72 65 61 6b 3b 0a | 0a 09 09 63 61 73 65 20 |.break;.|...case |
|000063a0| 27 44 27 3a 09 09 2f 2a | 20 64 65 66 69 6e 65 20 |'D':../*| define |
|000063b0| 70 72 65 70 72 6f 63 65 | 73 73 6f 72 20 73 79 6d |preproce|ssor sym|
|000063c0| 62 6f 6c 20 2a 2f 0a 09 | 09 09 47 45 54 41 52 47 |bol */..|..GETARG|
|000063d0| 28 70 29 3b 0a 09 09 09 | 69 66 20 28 64 6f 5f 66 |(p);....|if (do_f|
|000063e0| 6c 61 67 29 0a 09 09 09 | 09 64 6f 5f 64 65 66 69 |lag)....|.do_defi|
|000063f0| 6e 65 28 70 29 3b 0a 09 | 09 09 62 72 65 61 6b 3b |ne(p);..|..break;|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.