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: untic
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| SHell self-extracting ARchive (archive/shar)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| C source text
| default
| |
99%
| file
| C source, ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/329 Shell Archive Format
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 4e 65 77 73 67 72 6f 75 | 70 73 3a 20 6d 6f 64 2e |Newsgrou|ps: mod.|
|00000010| 73 6f 75 72 63 65 73 0a | 53 75 62 6a 65 63 74 3a |sources.|Subject:|
|00000020| 20 75 6e 74 69 63 20 2d | 20 64 65 63 6f 6d 70 69 | untic -| decompi|
|00000030| 6c 65 20 74 65 72 6d 69 | 6e 66 6f 20 64 65 73 63 |le termi|nfo desc|
|00000040| 72 69 70 74 69 6f 6e 20 | 66 69 6c 65 2e 0a 41 70 |ription |file..Ap|
|00000050| 70 72 6f 76 65 64 3a 20 | 6a 70 6e 40 70 61 6e 64 |proved: |jpn@pand|
|00000060| 61 2e 55 55 43 50 0a 0a | 4d 6f 64 2e 73 6f 75 72 |a.UUCP..|Mod.sour|
|00000070| 63 65 73 3a 20 20 56 6f | 6c 75 6d 65 20 35 2c 20 |ces: Vo|lume 5, |
|00000080| 49 73 73 75 65 20 31 35 | 0a 53 75 62 6d 69 74 74 |Issue 15|.Submitt|
|00000090| 65 64 20 62 79 3a 20 44 | 61 76 65 20 52 65 67 61 |ed by: D|ave Rega|
|000000a0| 6e 20 3c 74 61 6c 63 6f | 74 74 21 63 6d 63 6c 32 |n <talco|tt!cmcl2|
|000000b0| 21 68 70 2d 70 63 64 21 | 6f 72 73 74 63 73 21 72 |!hp-pcd!|orstcs!r|
|000000c0| 65 67 61 6e 3e 0a 0a 23 | 21 20 2f 62 69 6e 2f 73 |egan>..#|! /bin/s|
|000000d0| 68 0a 23 20 54 68 69 73 | 20 69 73 20 61 20 73 68 |h.# This| is a sh|
|000000e0| 65 6c 6c 20 61 72 63 68 | 69 76 65 2c 20 6d 65 61 |ell arch|ive, mea|
|000000f0| 6e 69 6e 67 3a 0a 23 20 | 31 2e 20 52 65 6d 6f 76 |ning:.# |1. Remov|
|00000100| 65 20 65 76 65 72 79 74 | 68 69 6e 67 20 61 62 6f |e everyt|hing abo|
|00000110| 76 65 20 74 68 65 20 23 | 21 20 2f 62 69 6e 2f 73 |ve the #|! /bin/s|
|00000120| 68 20 6c 69 6e 65 2e 0a | 23 20 32 2e 20 53 61 76 |h line..|# 2. Sav|
|00000130| 65 20 74 68 65 20 72 65 | 73 75 6c 74 69 6e 67 20 |e the re|sulting |
|00000140| 74 65 78 74 20 69 6e 20 | 61 20 66 69 6c 65 2e 0a |text in |a file..|
|00000150| 23 20 33 2e 20 45 78 65 | 63 75 74 65 20 74 68 65 |# 3. Exe|cute the|
|00000160| 20 66 69 6c 65 20 77 69 | 74 68 20 2f 62 69 6e 2f | file wi|th /bin/|
|00000170| 73 68 20 28 6e 6f 74 20 | 63 73 68 29 20 74 6f 20 |sh (not |csh) to |
|00000180| 63 72 65 61 74 65 20 74 | 68 65 20 66 69 6c 65 73 |create t|he files|
|00000190| 3a 0a 23 09 52 45 41 44 | 4d 45 0a 23 09 75 6e 74 |:.#.READ|ME.#.unt|
|000001a0| 69 63 2e 31 0a 23 09 4d | 61 6b 65 66 69 6c 65 0a |ic.1.#.M|akefile.|
|000001b0| 23 09 75 6e 74 69 63 2e | 63 0a 23 20 54 68 69 73 |#.untic.|c.# This|
|000001c0| 20 61 72 63 68 69 76 65 | 20 63 72 65 61 74 65 64 | archive| created|
|000001d0| 3a 20 57 65 64 20 4d 61 | 79 20 32 31 20 32 33 3a |: Wed Ma|y 21 23:|
|000001e0| 30 30 3a 32 39 20 31 39 | 38 36 0a 65 78 70 6f 72 |00:29 19|86.expor|
|000001f0| 74 20 50 41 54 48 3b 20 | 50 41 54 48 3d 2f 62 69 |t PATH; |PATH=/bi|
|00000200| 6e 3a 24 50 41 54 48 0a | 69 66 20 74 65 73 74 20 |n:$PATH.|if test |
|00000210| 2d 66 20 27 52 45 41 44 | 4d 45 27 0a 74 68 65 6e |-f 'READ|ME'.then|
|00000220| 0a 09 65 63 68 6f 20 73 | 68 61 72 3a 20 77 69 6c |..echo s|har: wil|
|00000230| 6c 20 6e 6f 74 20 6f 76 | 65 72 2d 77 72 69 74 65 |l not ov|er-write|
|00000240| 20 65 78 69 73 74 69 6e | 67 20 66 69 6c 65 20 22 | existin|g file "|
|00000250| 27 52 45 41 44 4d 45 27 | 22 0a 65 6c 73 65 0a 63 |'README'|".else.c|
|00000260| 61 74 20 3c 3c 20 5c 53 | 48 41 52 5f 45 4f 46 20 |at << \S|HAR_EOF |
|00000270| 3e 20 27 52 45 41 44 4d | 45 27 0a 75 6e 74 69 63 |> 'READM|E'.untic|
|00000280| 20 2d 2d 20 44 65 63 6f | 6d 70 69 6c 65 20 61 20 | -- Deco|mpile a |
|00000290| 22 74 65 72 6d 69 6e 66 | 6f 22 20 74 65 72 6d 69 |"terminf|o" termi|
|000002a0| 6e 61 6c 20 64 65 73 63 | 72 69 70 74 69 6f 6e 20 |nal desc|ription |
|000002b0| 66 69 6c 65 20 66 6f 72 | 20 53 79 73 74 65 6d 20 |file for| System |
|000002c0| 56 2e 0a 0a 49 20 77 72 | 6f 74 65 20 74 68 65 20 |V...I wr|ote the |
|000002d0| 66 6f 6c 6c 6f 77 69 6e | 67 20 70 72 6f 67 72 61 |followin|g progra|
|000002e0| 6d 2c 20 22 75 6e 74 69 | 63 22 2c 20 62 65 63 61 |m, "unti|c", beca|
|000002f0| 75 73 65 20 49 20 6e 65 | 65 64 65 64 20 74 6f 20 |use I ne|eded to |
|00000300| 6d 61 6b 65 20 61 20 74 | 65 72 6d 69 6e 61 6c 0a |make a t|erminal.|
|00000310| 64 65 73 63 72 69 70 74 | 69 6f 6e 20 66 69 6c 65 |descript|ion file|
|00000320| 20 77 68 69 63 68 20 77 | 61 73 20 6a 75 73 74 20 | which w|as just |
|00000330| 73 6c 69 67 68 74 6c 79 | 20 64 69 66 66 65 72 65 |slightly| differe|
|00000340| 6e 74 20 66 72 6f 6d 20 | 6f 6e 65 20 6f 66 20 74 |nt from |one of t|
|00000350| 68 65 20 65 78 69 73 74 | 69 6e 67 0a 74 65 72 6d |he exist|ing.term|
|00000360| 69 6e 61 6c 20 64 65 73 | 63 72 69 70 74 69 6f 6e |inal des|cription|
|00000370| 73 2e 0a 0a 54 68 69 73 | 20 70 72 6f 67 72 61 6d |s...This| program|
|00000380| 20 6c 6f 6f 6b 73 20 75 | 70 20 74 68 65 20 64 65 | looks u|p the de|
|00000390| 73 63 72 69 70 74 69 6f | 6e 20 64 69 72 65 63 74 |scriptio|n direct|
|000003a0| 6c 79 20 66 72 6f 6d 20 | 74 68 65 20 63 6f 6d 70 |ly from |the comp|
|000003b0| 69 6c 65 64 20 64 65 73 | 63 72 69 70 74 69 6f 6e |iled des|cription|
|000003c0| 0a 66 69 6c 65 2e 20 20 | 54 68 75 73 20 69 74 20 |.file. |Thus it |
|000003d0| 70 72 6f 64 75 63 65 73 | 20 61 20 66 69 6c 65 2c |produces| a file,|
|000003e0| 20 77 68 69 63 68 20 77 | 68 65 6e 20 63 6f 6d 70 | which w|hen comp|
|000003f0| 69 6c 65 64 2c 20 67 65 | 6e 65 72 61 74 65 64 20 |iled, ge|nerated |
|00000400| 65 78 61 63 74 6c 79 20 | 74 68 65 0a 73 61 6d 65 |exactly |the.same|
|00000410| 20 69 6e 66 6f 72 6d 61 | 74 69 6f 6e 20 61 73 20 | informa|tion as |
|00000420| 77 61 73 20 69 6e 20 74 | 68 65 20 6f 72 69 67 69 |was in t|he origi|
|00000430| 6e 61 6c 20 66 69 6c 65 | 2e 0a 0a 54 68 69 73 20 |nal file|...This |
|00000440| 22 73 68 61 72 22 20 66 | 69 6c 65 20 63 6f 6e 74 |"shar" f|ile cont|
|00000450| 61 69 6e 73 20 74 68 65 | 20 66 6f 6c 6c 6f 77 69 |ains the| followi|
|00000460| 6e 67 20 66 69 6c 65 73 | 3a 0a 09 52 45 41 44 4d |ng files|:..READM|
|00000470| 45 09 09 54 68 69 73 20 | 66 69 6c 65 0a 09 75 6e |E..This |file..un|
|00000480| 74 69 63 2e 31 09 09 41 | 20 28 76 65 72 79 20 73 |tic.1..A| (very s|
|00000490| 69 6d 70 6c 65 29 20 6d | 61 6e 75 61 6c 20 70 61 |imple) m|anual pa|
|000004a0| 67 65 0a 09 4d 61 6b 65 | 66 69 6c 65 09 41 20 28 |ge..Make|file.A (|
|000004b0| 76 65 72 79 20 73 69 6d | 70 6c 65 29 20 6d 61 6b |very sim|ple) mak|
|000004c0| 65 20 66 69 6c 65 0a 09 | 75 6e 74 69 63 2e 63 09 |e file..|untic.c.|
|000004d0| 09 54 68 65 20 70 72 6f | 67 72 61 6d 0a 0a 49 20 |.The pro|gram..I |
|000004e0| 68 6f 70 65 20 74 68 69 | 73 20 70 72 6f 67 72 61 |hope thi|s progra|
|000004f0| 6d 20 69 73 20 6f 66 20 | 73 6f 6d 65 20 75 73 65 |m is of |some use|
|00000500| 20 74 6f 20 70 65 6f 70 | 6c 65 2e 0a 0a 09 09 09 | to peop|le......|
|00000510| 44 61 76 65 20 52 65 67 | 61 6e 0a 09 09 09 32 31 |Dave Reg|an....21|
|00000520| 20 4d 61 79 20 31 39 38 | 36 0a 09 09 09 50 4f 20 | May 198|6....PO |
|00000530| 42 6f 78 20 36 30 31 0a | 09 09 09 43 6f 72 76 61 |Box 601.|...Corva|
|00000540| 6c 6c 69 73 20 4f 52 20 | 39 37 33 33 39 0a 09 09 |llis OR |97339...|
|00000550| 09 68 70 6c 61 62 73 21 | 68 70 2d 70 63 64 21 6f |.hplabs!|hp-pcd!o|
|00000560| 72 73 74 63 73 21 72 65 | 67 61 6e 09 28 49 20 74 |rstcs!re|gan.(I t|
|00000570| 68 69 6e 6b 29 0a 53 48 | 41 52 5f 45 4f 46 0a 66 |hink).SH|AR_EOF.f|
|00000580| 69 20 23 20 65 6e 64 20 | 6f 66 20 6f 76 65 72 77 |i # end |of overw|
|00000590| 72 69 74 69 6e 67 20 63 | 68 65 63 6b 0a 69 66 20 |riting c|heck.if |
|000005a0| 74 65 73 74 20 2d 66 20 | 27 75 6e 74 69 63 2e 31 |test -f |'untic.1|
|000005b0| 27 0a 74 68 65 6e 0a 09 | 65 63 68 6f 20 73 68 61 |'.then..|echo sha|
|000005c0| 72 3a 20 77 69 6c 6c 20 | 6e 6f 74 20 6f 76 65 72 |r: will |not over|
|000005d0| 2d 77 72 69 74 65 20 65 | 78 69 73 74 69 6e 67 20 |-write e|xisting |
|000005e0| 66 69 6c 65 20 22 27 75 | 6e 74 69 63 2e 31 27 22 |file "'u|ntic.1'"|
|000005f0| 0a 65 6c 73 65 0a 63 61 | 74 20 3c 3c 20 5c 53 48 |.else.ca|t << \SH|
|00000600| 41 52 5f 45 4f 46 20 3e | 20 27 75 6e 74 69 63 2e |AR_EOF >| 'untic.|
|00000610| 31 27 0a 2e 54 48 20 55 | 4e 54 49 43 20 31 20 50 |1'..TH U|NTIC 1 P|
|00000620| 75 62 6c 69 63 20 44 6f | 6d 61 69 6e 0a 2e 53 48 |ublic Do|main..SH|
|00000630| 20 4e 41 4d 45 0a 75 6e | 74 69 63 20 5c 2d 20 55 | NAME.un|tic \- U|
|00000640| 6e 63 6f 6d 70 69 6c 65 | 20 74 65 72 6d 69 6e 66 |ncompile| terminf|
|00000650| 6f 20 74 65 72 6d 69 6e | 61 6c 20 64 65 73 63 72 |o termin|al descr|
|00000660| 69 70 74 69 6f 6e 20 66 | 69 6c 65 73 0a 2e 53 48 |iption f|iles..SH|
|00000670| 20 53 59 4e 4f 50 53 49 | 53 0a 2e 42 20 75 6e 74 | SYNOPSI|S..B unt|
|00000680| 69 63 0a 2e 42 20 74 65 | 72 6d 69 6e 61 6c 5f 6e |ic..B te|rminal_n|
|00000690| 61 6d 65 0a 5b 0a 2e 42 | 20 2e 20 2e 20 2e 0a 5d |ame.[..B| . . ..]|
|000006a0| 0a 2e 53 48 20 44 45 53 | 43 52 49 50 54 49 4f 4e |..SH DES|CRIPTION|
|000006b0| 0a 2e 42 20 75 6e 74 69 | 63 0a 63 6f 6e 76 65 72 |..B unti|c.conver|
|000006c0| 74 20 74 68 65 20 74 65 | 72 6d 69 6e 66 6f 20 66 |t the te|rminfo f|
|000006d0| 69 6c 65 20 77 68 69 63 | 68 20 63 6f 72 72 65 73 |ile whic|h corres|
|000006e0| 70 6f 6e 64 73 20 74 6f | 20 74 68 65 20 73 70 65 |ponds to| the spe|
|000006f0| 63 69 66 69 65 64 20 74 | 65 72 6d 69 6e 61 6c 20 |cified t|erminal |
|00000700| 6e 61 6d 65 0a 69 6e 74 | 6f 20 61 20 66 69 6c 65 |name.int|o a file|
|00000710| 20 74 68 61 74 20 63 61 | 6e 20 62 65 20 70 72 6f | that ca|n be pro|
|00000720| 63 65 73 73 65 64 20 62 | 79 0a 2e 42 20 74 69 63 |cessed b|y..B tic|
|00000730| 2e 0a 2e 50 50 0a 49 66 | 20 6d 75 6c 74 69 70 6c |...PP.If| multipl|
|00000740| 65 20 74 65 72 6d 69 6e | 61 6c 20 6e 61 6d 65 73 |e termin|al names|
|00000750| 20 61 72 65 20 67 69 76 | 65 6e 2c 20 61 20 74 65 | are giv|en, a te|
|00000760| 72 6d 69 6e 61 6c 20 64 | 65 73 63 72 69 70 74 69 |rminal d|escripti|
|00000770| 6f 6e 20 69 73 20 67 65 | 6e 65 72 61 74 65 64 0a |on is ge|nerated.|
|00000780| 66 6f 72 20 65 61 63 68 | 20 6f 66 20 74 68 65 20 |for each| of the |
|00000790| 6e 61 6d 65 64 20 74 65 | 72 6d 69 6e 61 6c 73 2e |named te|rminals.|
|000007a0| 0a 54 68 65 20 6f 75 74 | 70 75 74 20 69 73 20 77 |.The out|put is w|
|000007b0| 72 69 74 74 65 6e 20 6f | 6e 20 73 74 61 6e 64 61 |ritten o|n standa|
|000007c0| 72 64 20 6f 75 74 70 75 | 74 2e 0a 2e 50 50 0a 49 |rd outpu|t...PP.I|
|000007d0| 74 20 69 73 20 77 69 73 | 65 20 74 6f 20 62 61 63 |t is wis|e to bac|
|000007e0| 6b 75 70 20 74 68 65 20 | 6f 72 69 67 69 6e 61 6c |kup the |original|
|000007f0| 20 74 65 72 6d 69 6e 61 | 6c 20 64 65 73 63 72 69 | termina|l descri|
|00000800| 70 74 69 6f 6e 0a 28 66 | 72 6f 6d 20 2f 75 73 72 |ption.(f|rom /usr|
|00000810| 2f 6c 69 62 2f 74 65 72 | 6d 69 6e 66 6f 29 0a 62 |/lib/ter|minfo).b|
|00000820| 65 66 6f 72 65 20 63 6f | 6d 70 69 6c 69 6e 67 20 |efore co|mpiling |
|00000830| 74 68 65 20 67 65 6e 65 | 72 61 74 65 64 20 66 69 |the gene|rated fi|
|00000840| 6c 65 2e 0a 2e 53 48 20 | 45 58 41 4d 50 4c 45 53 |le...SH |EXAMPLES|
|00000850| 0a 54 6f 20 75 6e 63 6f | 6d 70 69 6c 65 20 74 68 |.To unco|mpile th|
|00000860| 65 20 74 65 72 6d 69 6e | 61 6c 20 64 65 73 63 72 |e termin|al descr|
|00000870| 69 70 74 69 6f 6e 20 66 | 6f 72 20 61 20 22 76 74 |iption f|or a "vt|
|00000880| 31 30 30 22 2c 20 74 79 | 70 65 3a 0a 2e 52 53 0a |100", ty|pe:..RS.|
|00000890| 75 6e 74 69 63 20 76 74 | 31 30 30 20 3e 76 74 31 |untic vt|100 >vt1|
|000008a0| 30 30 0a 2e 52 45 0a 54 | 6f 20 63 6f 6d 70 69 6c |00..RE.T|o compil|
|000008b0| 65 20 74 68 69 73 20 67 | 65 6e 65 72 61 74 65 64 |e this g|enerated|
|000008c0| 20 66 69 6c 65 2c 20 79 | 6f 75 20 70 72 6f 62 61 | file, y|ou proba|
|000008d0| 62 6c 79 20 6e 65 65 64 | 20 72 6f 6f 74 20 70 65 |bly need| root pe|
|000008e0| 72 6d 69 73 73 69 6f 6e | 73 20 61 6e 64 20 74 79 |rmission|s and ty|
|000008f0| 70 65 3a 0a 2e 52 53 0a | 74 69 63 20 76 74 31 30 |pe:..RS.|tic vt10|
|00000900| 30 0a 2e 52 45 0a 2e 53 | 48 20 4e 4f 54 45 53 0a |0..RE..S|H NOTES.|
|00000910| 49 66 20 6e 65 77 20 63 | 61 70 61 62 69 6c 69 74 |If new c|apabilit|
|00000920| 69 65 73 20 61 72 65 20 | 61 64 64 65 64 20 74 6f |ies are |added to|
|00000930| 20 74 68 65 20 74 65 72 | 6d 69 6e 66 6f 20 64 61 | the ter|minfo da|
|00000940| 74 61 62 61 73 65 2c 0a | 74 68 65 0a 2e 42 20 75 |tabase,.|the..B u|
|00000950| 6e 74 69 63 0a 70 72 6f | 67 72 61 6d 20 77 69 6c |ntic.pro|gram wil|
|00000960| 6c 20 6e 65 65 64 20 74 | 6f 20 62 65 20 6d 6f 64 |l need t|o be mod|
|00000970| 69 66 69 65 64 2e 0a 57 | 69 74 68 20 6c 75 63 6b |ified..W|ith luck|
|00000980| 2c 20 74 68 65 20 6e 65 | 77 20 65 6e 74 72 69 65 |, the ne|w entrie|
|00000990| 73 20 77 69 6c 6c 20 67 | 6f 20 61 74 20 74 68 65 |s will g|o at the|
|000009a0| 20 65 6e 64 20 6f 66 20 | 74 68 65 20 61 70 70 72 | end of |the appr|
|000009b0| 6f 70 72 69 61 74 65 20 | 74 61 62 6c 65 73 2e 0a |opriate |tables..|
|000009c0| 2e 50 50 0a 4d 6f 73 74 | 20 6f 66 20 74 68 65 20 |.PP.Most| of the |
|000009d0| 63 61 70 61 62 69 6c 69 | 74 69 65 73 20 61 72 65 |capabili|ties are|
|000009e0| 20 69 6e 20 74 68 65 20 | 74 61 62 6c 65 73 20 69 | in the |tables i|
|000009f0| 6e 20 74 68 65 20 6f 72 | 64 65 72 20 74 68 61 74 |n the or|der that|
|00000a00| 20 74 68 65 20 63 61 70 | 61 62 69 6c 69 74 65 73 | the cap|abilites|
|00000a10| 0a 61 72 65 20 64 6f 63 | 75 6d 65 6e 74 65 64 2e |.are doc|umented.|
|00000a20| 0a 54 68 65 72 65 20 61 | 72 65 20 61 20 66 65 77 |.There a|re a few|
|00000a30| 20 65 78 63 65 70 74 69 | 6f 6e 73 20 69 6e 20 74 | excepti|ons in t|
|00000a40| 68 65 20 73 74 72 69 6e | 67 20 76 61 72 69 61 62 |he strin|g variab|
|00000a50| 6c 65 73 2e 0a 2e 50 50 | 0a 54 68 69 73 20 70 72 |les...PP|.This pr|
|00000a60| 6f 67 72 61 6d 20 69 73 | 20 70 6c 61 63 65 64 20 |ogram is| placed |
|00000a70| 69 6e 74 6f 20 74 68 65 | 20 70 75 62 6c 69 63 20 |into the| public |
|00000a80| 64 6f 6d 61 69 6e 2e 0a | 54 68 61 74 20 6d 65 61 |domain..|That mea|
|00000a90| 6e 73 20 74 68 61 74 20 | 79 6f 75 20 63 61 6e 20 |ns that |you can |
|00000aa0| 64 6f 20 61 6e 79 74 68 | 69 6e 67 20 79 6f 75 20 |do anyth|ing you |
|00000ab0| 77 61 6e 74 20 74 6f 20 | 77 69 74 68 20 69 74 2e |want to |with it.|
|00000ac0| 0a 2e 53 48 20 42 55 47 | 53 0a 4e 6f 6e 65 20 6b |..SH BUG|S.None k|
|00000ad0| 6e 6f 77 6e 2c 20 62 75 | 74 20 2e 20 2e 20 2e 0a |nown, bu|t . . ..|
|00000ae0| 2e 53 48 20 46 49 4c 45 | 53 0a 54 68 65 20 74 65 |.SH FILE|S.The te|
|00000af0| 72 6d 69 6e 61 6c 20 64 | 65 73 63 72 69 70 74 69 |rminal d|escripti|
|00000b00| 6f 6e 73 20 61 72 65 20 | 73 74 6f 72 65 64 20 69 |ons are |stored i|
|00000b10| 6e 0a 2e 42 20 2f 75 73 | 72 2f 6c 69 62 2f 74 65 |n..B /us|r/lib/te|
|00000b20| 72 6d 69 6e 66 6f 2f 3f | 2f 2a 0a 53 48 41 52 5f |rminfo/?|/*.SHAR_|
|00000b30| 45 4f 46 0a 66 69 20 23 | 20 65 6e 64 20 6f 66 20 |EOF.fi #| end of |
|00000b40| 6f 76 65 72 77 72 69 74 | 69 6e 67 20 63 68 65 63 |overwrit|ing chec|
|00000b50| 6b 0a 69 66 20 74 65 73 | 74 20 2d 66 20 27 4d 61 |k.if tes|t -f 'Ma|
|00000b60| 6b 65 66 69 6c 65 27 0a | 74 68 65 6e 0a 09 65 63 |kefile'.|then..ec|
|00000b70| 68 6f 20 73 68 61 72 3a | 20 77 69 6c 6c 20 6e 6f |ho shar:| will no|
|00000b80| 74 20 6f 76 65 72 2d 77 | 72 69 74 65 20 65 78 69 |t over-w|rite exi|
|00000b90| 73 74 69 6e 67 20 66 69 | 6c 65 20 22 27 4d 61 6b |sting fi|le "'Mak|
|00000ba0| 65 66 69 6c 65 27 22 0a | 65 6c 73 65 0a 63 61 74 |efile'".|else.cat|
|00000bb0| 20 3c 3c 20 5c 53 48 41 | 52 5f 45 4f 46 20 3e 20 | << \SHA|R_EOF > |
|00000bc0| 27 4d 61 6b 65 66 69 6c | 65 27 0a 43 46 4c 41 47 |'Makefil|e'.CFLAG|
|00000bd0| 53 20 3d 20 2d 4f 0a 44 | 45 53 54 44 49 52 20 3d |S = -O.D|ESTDIR =|
|00000be0| 20 2f 75 73 72 2f 6c 6f | 63 61 6c 2f 62 69 6e 0a | /usr/lo|cal/bin.|
|00000bf0| 44 4f 43 44 49 52 20 3d | 20 2f 75 73 72 2f 6c 6f |DOCDIR =| /usr/lo|
|00000c00| 63 61 6c 2f 6d 61 6e 2f | 6d 61 6e 31 0a 0a 75 6e |cal/man/|man1..un|
|00000c10| 74 69 63 3a 09 75 6e 74 | 69 63 2e 63 0a 09 24 28 |tic:.unt|ic.c..$(|
|00000c20| 43 43 29 20 24 28 43 46 | 4c 41 47 53 29 20 75 6e |CC) $(CF|LAGS) un|
|00000c30| 74 69 63 2e 63 20 2d 6f | 20 75 6e 74 69 63 0a 0a |tic.c -o| untic..|
|00000c40| 6c 69 6e 74 3a 0a 09 6c | 69 6e 74 20 75 6e 74 69 |lint:..l|int unti|
|00000c50| 63 2e 63 0a 0a 69 6e 73 | 74 61 6c 6c 3a 09 75 6e |c.c..ins|tall:.un|
|00000c60| 74 69 63 0a 09 63 70 20 | 75 6e 74 69 63 20 24 28 |tic..cp |untic $(|
|00000c70| 44 45 53 54 44 49 52 29 | 2f 75 6e 74 69 63 0a 09 |DESTDIR)|/untic..|
|00000c80| 73 74 72 69 70 20 24 28 | 44 45 53 54 44 49 52 29 |strip $(|DESTDIR)|
|00000c90| 2f 75 6e 74 69 63 0a 23 | 09 63 70 20 75 6e 74 69 |/untic.#|.cp unti|
|00000ca0| 63 2e 31 20 24 28 44 4f | 43 44 49 52 29 2f 75 6e |c.1 $(DO|CDIR)/un|
|00000cb0| 74 69 63 2e 31 0a 0a 63 | 6c 65 61 6e 3a 0a 09 72 |tic.1..c|lean:..r|
|00000cc0| 6d 20 75 6e 74 69 63 0a | 53 48 41 52 5f 45 4f 46 |m untic.|SHAR_EOF|
|00000cd0| 0a 66 69 20 23 20 65 6e | 64 20 6f 66 20 6f 76 65 |.fi # en|d of ove|
|00000ce0| 72 77 72 69 74 69 6e 67 | 20 63 68 65 63 6b 0a 69 |rwriting| check.i|
|00000cf0| 66 20 74 65 73 74 20 2d | 66 20 27 75 6e 74 69 63 |f test -|f 'untic|
|00000d00| 2e 63 27 0a 74 68 65 6e | 0a 09 65 63 68 6f 20 73 |.c'.then|..echo s|
|00000d10| 68 61 72 3a 20 77 69 6c | 6c 20 6e 6f 74 20 6f 76 |har: wil|l not ov|
|00000d20| 65 72 2d 77 72 69 74 65 | 20 65 78 69 73 74 69 6e |er-write| existin|
|00000d30| 67 20 66 69 6c 65 20 22 | 27 75 6e 74 69 63 2e 63 |g file "|'untic.c|
|00000d40| 27 22 0a 65 6c 73 65 0a | 63 61 74 20 3c 3c 20 5c |'".else.|cat << \|
|00000d50| 53 48 41 52 5f 45 4f 46 | 20 3e 20 27 75 6e 74 69 |SHAR_EOF| > 'unti|
|00000d60| 63 2e 63 27 0a 2f 2a 0a | 20 2a 20 55 6e 74 69 63 |c.c'./*.| * Untic|
|00000d70| 2e 63 20 2d 2d 20 55 6e | 63 6f 6d 70 69 6c 65 20 |.c -- Un|compile |
|00000d80| 61 20 74 65 72 6d 69 6e | 66 6f 20 66 69 6c 65 0a |a termin|fo file.|
|00000d90| 20 2a 0a 20 2a 20 55 73 | 61 67 65 3a 0a 20 2a 09 | *. * Us|age:. *.|
|00000da0| 75 6e 74 69 63 20 74 65 | 72 6d 69 6e 61 6c 5f 6e |untic te|rminal_n|
|00000db0| 61 6d 65 20 2e 20 2e 20 | 2e 0a 20 2a 0a 20 2a 20 |ame . . |.. *. * |
|00000dc0| 54 68 69 73 20 70 72 6f | 67 72 61 6d 20 66 69 6e |This pro|gram fin|
|00000dd0| 64 73 20 74 68 65 20 74 | 65 72 6d 69 6e 61 6c 20 |ds the t|erminal |
|00000de0| 64 65 73 63 72 69 70 74 | 69 6f 6e 20 69 6e 0a 20 |descript|ion in. |
|00000df0| 2a 09 2f 75 73 72 2f 6c | 69 62 2f 74 65 72 6d 69 |*./usr/l|ib/termi|
|00000e00| 6e 66 6f 2f 3f 2f 74 65 | 72 6d 69 6e 61 6c 5f 6e |nfo/?/te|rminal_n|
|00000e10| 61 6d 65 0a 20 2a 20 49 | 74 20 74 68 65 6e 20 63 |ame. * I|t then c|
|00000e20| 6f 6e 76 65 72 74 73 20 | 74 68 65 20 69 6e 66 6f |onverts |the info|
|00000e30| 72 6d 61 74 69 6f 6e 20 | 69 6e 74 6f 20 61 6e 20 |rmation |into an |
|00000e40| 41 53 43 49 49 20 66 69 | 6c 65 20 73 75 69 74 61 |ASCII fi|le suita|
|00000e50| 62 6c 65 20 66 6f 72 0a | 20 2a 20 72 75 6e 6e 69 |ble for.| * runni|
|00000e60| 6e 67 20 69 6e 74 6f 20 | 22 74 69 63 22 2e 20 20 |ng into |"tic". |
|00000e70| 54 68 65 20 72 65 73 75 | 6c 74 69 6e 67 20 66 69 |The resu|lting fi|
|00000e80| 6c 65 20 69 73 20 77 72 | 69 74 74 65 6e 20 74 6f |le is wr|itten to|
|00000e90| 20 73 74 61 6e 64 61 72 | 64 20 6f 75 74 70 75 74 | standar|d output|
|00000ea0| 2e 0a 20 2a 0a 20 2a 20 | 43 6f 6d 70 69 6c 65 20 |.. *. * |Compile |
|00000eb0| 62 79 3a 0a 20 2a 09 63 | 63 20 2d 4f 20 2d 6f 20 |by:. *.c|c -O -o |
|00000ec0| 75 6e 74 69 63 20 75 6e | 74 69 63 2e 63 0a 20 2a |untic un|tic.c. *|
|00000ed0| 0a 20 2a 20 49 74 20 69 | 73 20 70 72 6f 62 61 62 |. * It i|s probab|
|00000ee0| 6c 79 20 61 20 67 6f 6f | 64 20 69 64 65 61 20 74 |ly a goo|d idea t|
|00000ef0| 6f 20 65 6e 73 75 72 65 | 20 74 68 61 74 20 74 68 |o ensure| that th|
|00000f00| 65 20 66 69 6c 65 20 70 | 72 6f 64 75 63 65 64 20 |e file p|roduced |
|00000f10| 77 69 6c 6c 20 63 6f 6d | 70 69 6c 65 0a 20 2a 20 |will com|pile. * |
|00000f20| 74 6f 20 74 68 65 20 6f | 72 69 67 69 6e 61 6c 20 |to the o|riginal |
|00000f30| 66 69 6c 65 20 62 65 66 | 6f 72 65 20 74 72 75 73 |file bef|ore trus|
|00000f40| 74 69 6e 67 20 22 75 6e | 74 69 63 22 2e 0a 20 2a |ting "un|tic".. *|
|00000f50| 0a 20 2a 20 53 74 72 75 | 63 74 75 72 65 20 6f 66 |. * Stru|cture of|
|00000f60| 20 74 65 72 6d 69 6e 66 | 6f 20 66 69 6c 65 3a 0a | terminf|o file:.|
|00000f70| 20 2a 09 73 68 6f 72 74 | 09 6d 61 67 69 63 20 6e | *.short|.magic n|
|00000f80| 75 6d 62 65 72 0a 20 2a | 09 73 68 6f 72 74 09 6c |umber. *|.short.l|
|00000f90| 65 6e 67 74 68 20 6f 66 | 20 74 65 72 6d 69 6e 61 |ength of| termina|
|00000fa0| 6c 20 6e 61 6d 65 73 20 | 2b 20 4e 55 4c 0a 20 2a |l names |+ NUL. *|
|00000fb0| 09 73 68 6f 72 74 09 6c | 65 6e 67 74 68 20 6f 66 |.short.l|ength of|
|00000fc0| 20 62 6f 6f 6c 65 61 6e | 73 0a 20 2a 09 73 68 6f | boolean|s. *.sho|
|00000fd0| 72 74 09 6c 65 6e 67 74 | 68 20 6f 66 20 6e 75 6d |rt.lengt|h of num|
|00000fe0| 65 72 69 63 73 0a 20 2a | 09 73 68 6f 72 74 09 6c |erics. *|.short.l|
|00000ff0| 65 6e 67 74 68 20 6f 66 | 20 73 74 72 69 6e 67 73 |ength of| strings|
|00001000| 0a 20 2a 09 73 68 6f 72 | 74 09 6c 65 6e 67 74 68 |. *.shor|t.length|
|00001010| 20 6f 66 20 73 74 72 69 | 6e 67 20 74 61 62 6c 65 | of stri|ng table|
|00001020| 0a 20 2a 09 63 68 61 72 | 73 09 4e 55 4c 20 74 65 |. *.char|s.NUL te|
|00001030| 72 6d 69 6e 61 74 65 64 | 20 74 65 72 6d 69 6e 61 |rminated| termina|
|00001040| 6c 20 6e 61 6d 65 0a 20 | 2a 09 63 68 61 72 73 09 |l name. |*.chars.|
|00001050| 62 6f 6f 6c 65 61 6e 20 | 66 6c 61 67 73 20 66 6f |boolean |flags fo|
|00001060| 72 20 65 61 63 68 20 6f | 66 20 74 68 65 20 70 6f |r each o|f the po|
|00001070| 73 73 69 62 6c 65 20 62 | 6f 6f 6c 65 61 6e 73 0a |ssible b|ooleans.|
|00001080| 20 2a 09 73 68 6f 72 74 | 73 09 76 61 6c 75 65 73 | *.short|s.values|
|00001090| 20 66 6f 72 20 65 61 63 | 68 20 6f 66 20 74 68 65 | for eac|h of the|
|000010a0| 20 70 6f 73 73 69 62 6c | 65 20 6e 75 6d 65 72 69 | possibl|e numeri|
|000010b0| 63 73 0a 20 2a 09 73 68 | 6f 72 74 73 09 6f 66 66 |cs. *.sh|orts.off|
|000010c0| 73 65 74 73 20 28 66 72 | 6f 6d 20 73 74 61 72 74 |sets (fr|om start|
|000010d0| 20 6f 66 20 73 74 72 69 | 6e 67 73 29 20 66 6f 72 | of stri|ngs) for|
|000010e0| 20 65 61 63 68 20 6f 66 | 20 74 68 65 0a 20 2a 09 | each of| the. *.|
|000010f0| 09 70 6f 73 73 69 62 6c | 65 20 73 74 72 69 6e 67 |.possibl|e string|
|00001100| 73 0a 20 2a 09 63 68 61 | 72 73 09 4e 55 4c 20 74 |s. *.cha|rs.NUL t|
|00001110| 65 72 6d 69 6e 61 74 65 | 64 20 73 74 72 69 6e 67 |erminate|d string|
|00001120| 73 20 66 6f 72 20 65 61 | 63 68 20 6f 66 20 74 68 |s for ea|ch of th|
|00001130| 65 20 64 65 66 69 6e 65 | 64 20 73 74 72 69 6e 67 |e define|d string|
|00001140| 73 0a 20 2a 0a 20 2a 20 | 4d 6f 73 74 20 6f 66 20 |s. *. * |Most of |
|00001150| 74 68 65 20 76 61 72 69 | 61 62 6c 65 73 20 61 72 |the vari|ables ar|
|00001160| 65 20 69 6e 20 74 68 65 | 20 6f 72 64 65 72 20 74 |e in the| order t|
|00001170| 68 61 74 20 74 68 65 20 | 64 6f 63 75 6d 65 6e 74 |hat the |document|
|00001180| 61 74 69 6f 6e 20 6c 69 | 73 74 73 0a 20 2a 20 74 |ation li|sts. * t|
|00001190| 68 65 6d 2e 20 20 54 68 | 69 73 20 69 73 20 69 6d |hem. Th|is is im|
|000011a0| 70 6f 72 74 61 6e 74 2c | 20 61 73 20 74 68 65 20 |portant,| as the |
|000011b0| 69 6e 66 6f 72 6d 61 74 | 69 6f 6e 20 69 73 20 73 |informat|ion is s|
|000011c0| 74 6f 72 65 64 20 69 6e | 20 74 68 65 20 66 69 6c |tored in| the fil|
|000011d0| 65 0a 20 2a 20 62 61 73 | 65 64 20 75 70 6f 6e 20 |e. * bas|ed upon |
|000011e0| 74 68 65 20 6f 72 64 69 | 6e 61 6c 20 70 6f 73 69 |the ordi|nal posi|
|000011f0| 74 69 6f 6e 20 6f 66 20 | 74 68 65 20 76 61 72 69 |tion of |the vari|
|00001200| 61 62 6c 65 2e 20 20 53 | 6f 6d 65 20 6f 66 20 74 |able. S|ome of t|
|00001210| 68 65 20 73 74 72 69 6e | 67 0a 20 2a 20 76 61 72 |he strin|g. * var|
|00001220| 69 61 62 6c 65 73 20 61 | 72 65 20 6e 6f 74 20 69 |iables a|re not i|
|00001230| 6e 20 6f 72 64 65 72 2e | 20 20 50 72 65 73 75 6d |n order.| Presum|
|00001240| 61 62 6c 79 2c 20 69 66 | 20 74 68 65 79 20 61 64 |ably, if| they ad|
|00001250| 64 20 6d 6f 72 65 20 76 | 61 72 69 61 62 6c 65 73 |d more v|ariables|
|00001260| 2c 0a 20 2a 20 69 74 20 | 77 69 6c 6c 20 62 65 20 |,. * it |will be |
|00001270| 74 6f 20 74 68 65 20 65 | 6e 64 20 6f 66 20 74 68 |to the e|nd of th|
|00001280| 65 20 6c 69 73 74 2c 20 | 61 6e 64 20 6e 6f 74 20 |e list, |and not |
|00001290| 69 6e 20 74 68 65 20 6d | 69 64 64 6c 65 2e 0a 20 |in the m|iddle.. |
|000012a0| 2a 0a 20 2a 20 54 68 69 | 73 20 68 61 73 20 62 65 |*. * Thi|s has be|
|000012b0| 65 6e 20 74 65 73 74 65 | 64 20 6f 6e 0a 20 2a 09 |en teste|d on. *.|
|000012c0| 50 6c 65 78 75 73 20 50 | 32 30 20 28 4d 36 38 30 |Plexus P|20 (M680|
|000012d0| 31 30 29 2c 20 53 79 73 | 74 65 6d 20 35 20 52 65 |10), Sys|tem 5 Re|
|000012e0| 6c 65 61 73 65 20 32 20 | 28 49 20 74 68 69 6e 6b |lease 2 |(I think|
|000012f0| 29 0a 20 2a 0a 20 2a 20 | 42 75 67 73 3a 0a 20 2a |). *. * |Bugs:. *|
|00001300| 09 54 68 65 20 6c 6f 6e | 67 65 73 74 20 73 74 72 |.The lon|gest str|
|00001310| 69 6e 67 20 63 61 70 61 | 62 69 6c 69 74 79 20 69 |ing capa|bility i|
|00001320| 73 20 6c 69 6d 69 74 65 | 64 20 74 6f 20 34 30 39 |s limite|d to 409|
|00001330| 36 20 62 79 74 65 73 2e | 20 20 49 66 20 61 20 6c |6 bytes.| If a l|
|00001340| 6f 6e 67 65 72 0a 20 2a | 09 73 74 72 69 6e 67 20 |onger. *|.string |
|00001350| 69 73 20 65 6e 63 6f 75 | 6e 74 65 72 65 64 2c 20 |is encou|ntered, |
|00001360| 74 68 65 20 70 72 6f 67 | 72 61 6d 20 77 69 6c 6c |the prog|ram will|
|00001370| 20 64 6f 20 75 6e 70 72 | 65 64 69 63 61 74 61 62 | do unpr|edicatab|
|00001380| 6c 65 20 74 68 69 6e 67 | 73 2e 0a 20 2a 09 28 57 |le thing|s.. *.(W|
|00001390| 68 6f 20 75 73 65 73 20 | 73 74 72 69 6e 67 73 20 |ho uses |strings |
|000013a0| 74 68 61 74 20 6c 6f 6e | 67 20 61 6e 79 77 61 79 |that lon|g anyway|
|000013b0| 3f 29 20 20 54 68 65 20 | 6c 6f 6e 67 65 73 74 20 |?) The |longest |
|000013c0| 74 68 61 74 20 74 68 65 | 20 74 65 72 6d 69 6e 66 |that the| terminf|
|000013d0| 6f 0a 20 2a 09 66 69 6c | 65 20 63 61 6e 20 62 65 |o. *.fil|e can be|
|000013e0| 20 69 73 20 34 30 39 36 | 20 62 79 74 65 73 20 61 | is 4096| bytes a|
|000013f0| 6e 79 77 61 79 2c 20 73 | 6f 20 74 68 69 73 20 69 |nyway, s|o this i|
|00001400| 73 6e 27 74 20 74 6f 6f | 20 62 69 67 20 61 20 70 |sn't too| big a p|
|00001410| 72 6f 62 6c 65 6d 2e 0a | 20 2a 0a 20 2a 20 43 72 |roblem..| *. * Cr|
|00001420| 65 64 69 74 73 3a 0a 20 | 2a 09 57 72 69 74 74 65 |edits:. |*.Writte|
|00001430| 6e 20 62 79 20 44 61 76 | 65 20 52 65 67 61 6e 0a |n by Dav|e Regan.|
|00001440| 20 2a 09 6f 72 73 74 63 | 73 21 72 65 67 61 6e 0a | *.orstc|s!regan.|
|00001450| 20 2a 09 31 36 20 4d 61 | 79 20 38 36 0a 20 2a 0a | *.16 Ma|y 86. *.|
|00001460| 20 2a 09 49 20 64 69 73 | 63 6c 61 69 6d 20 74 68 | *.I dis|claim th|
|00001470| 61 74 20 74 68 69 73 20 | 70 72 6f 67 72 61 6d 20 |at this |program |
|00001480| 64 6f 65 73 20 61 6e 79 | 74 68 69 6e 67 20 75 73 |does any|thing us|
|00001490| 65 66 75 6c 2e 20 20 49 | 74 20 6d 69 67 68 74 20 |eful. I|t might |
|000014a0| 61 6c 73 6f 0a 20 2a 09 | 64 6f 20 61 63 63 69 64 |also. *.|do accid|
|000014b0| 65 6e 74 61 6c 20 64 61 | 6d 61 67 65 2e 20 20 42 |ental da|mage. B|
|000014c0| 61 63 6b 75 70 20 79 6f | 75 72 20 6f 72 69 67 69 |ackup yo|ur origi|
|000014d0| 6e 61 6c 20 74 65 72 6d | 69 6e 66 6f 20 66 69 6c |nal term|info fil|
|000014e0| 65 73 2e 0a 20 2a 0a 20 | 2a 09 54 68 69 73 20 70 |es.. *. |*.This p|
|000014f0| 72 6f 67 72 61 6d 20 69 | 73 20 70 75 62 6c 69 63 |rogram i|s public|
|00001500| 20 64 6f 6d 61 69 6e 2e | 20 20 54 68 61 74 20 6d | domain.| That m|
|00001510| 65 61 6e 73 20 79 6f 75 | 20 63 61 6e 20 64 6f 20 |eans you| can do |
|00001520| 61 6e 79 74 68 69 6e 67 | 0a 20 2a 09 79 6f 75 20 |anything|. *.you |
|00001530| 77 61 6e 74 20 77 69 74 | 68 20 69 74 2e 0a 20 2a |want wit|h it.. *|
|00001540| 2f 0a 0a 0a 23 69 6e 63 | 6c 75 64 65 20 3c 73 74 |/...#inc|lude <st|
|00001550| 64 69 6f 2e 68 3e 0a 23 | 69 66 64 65 66 20 51 43 |dio.h>.#|ifdef QC|
|00001560| 0a 23 64 65 66 69 6e 65 | 09 4f 50 45 4e 5f 4d 4f |.#define|.OPEN_MO|
|00001570| 44 45 09 22 72 62 22 09 | 2f 2a 20 4d 6f 64 65 20 |DE."rb".|/* Mode |
|00001580| 75 73 65 64 20 74 6f 20 | 6f 70 65 6e 20 74 65 72 |used to |open ter|
|00001590| 6d 69 6e 66 6f 20 66 69 | 6c 65 73 09 2a 2f 0a 23 |minfo fi|les.*/.#|
|000015a0| 64 65 66 69 6e 65 09 76 | 6f 69 64 09 69 6e 74 09 |define.v|oid.int.|
|000015b0| 09 2f 2a 20 53 69 67 68 | 20 2e 20 2e 20 2e 09 09 |./* Sigh| . . ...|
|000015c0| 09 09 2a 2f 0a 23 65 6c | 73 65 09 09 2f 2a 20 51 |..*/.#el|se../* Q|
|000015d0| 43 20 2a 2f 0a 23 69 6e | 63 6c 75 64 65 20 3c 63 |C */.#in|clude <c|
|000015e0| 74 79 70 65 2e 68 3e 0a | 23 64 65 66 69 6e 65 09 |type.h>.|#define.|
|000015f0| 4f 50 45 4e 5f 4d 4f 44 | 45 09 22 72 22 09 2f 2a |OPEN_MOD|E."r"./*|
|00001600| 20 4d 6f 64 65 20 75 73 | 65 64 20 74 6f 20 6f 70 | Mode us|ed to op|
|00001610| 65 6e 20 74 65 72 6d 69 | 6e 66 6f 20 66 69 6c 65 |en termi|nfo file|
|00001620| 73 09 2a 2f 0a 23 65 6e | 64 69 66 09 09 2f 2a 20 |s.*/.#en|dif../* |
|00001630| 51 43 20 2a 2f 0a 23 69 | 66 6e 64 65 66 20 54 52 |QC */.#i|fndef TR|
|00001640| 55 45 0a 23 64 65 66 69 | 6e 65 09 54 52 55 45 09 |UE.#defi|ne.TRUE.|
|00001650| 31 0a 23 64 65 66 69 6e | 65 09 46 41 4c 53 45 09 |1.#defin|e.FALSE.|
|00001660| 30 0a 23 65 6e 64 69 66 | 09 09 2f 2a 20 54 52 55 |0.#endif|../* TRU|
|00001670| 45 20 2a 2f 0a 0a 23 64 | 65 66 69 6e 65 09 44 45 |E */..#d|efine.DE|
|00001680| 42 55 47 09 46 41 4c 53 | 45 09 09 2f 2a 20 54 52 |BUG.FALS|E../* TR|
|00001690| 55 45 2f 46 41 4c 53 45 | 20 74 6f 20 65 6e 61 62 |UE/FALSE| to enab|
|000016a0| 6c 65 20 64 65 62 75 67 | 67 69 6e 67 20 6f 75 74 |le debug|ging out|
|000016b0| 70 75 74 20 2a 2f 0a 0a | 23 69 66 64 65 66 20 42 |put */..|#ifdef B|
|000016c0| 53 44 0a 23 64 65 66 69 | 6e 65 09 54 45 52 4d 49 |SD.#defi|ne.TERMI|
|000016d0| 4e 46 4f 5f 44 49 52 09 | 22 2f 75 73 72 2f 73 74 |NFO_DIR.|"/usr/st|
|000016e0| 61 74 69 63 2f 73 79 73 | 35 72 32 76 32 2f 75 73 |atic/sys|5r2v2/us|
|000016f0| 72 2f 6c 69 62 2f 74 65 | 72 6d 69 6e 66 6f 22 0a |r/lib/te|rminfo".|
|00001700| 23 65 6e 64 69 66 09 09 | 2f 2a 20 42 53 44 20 2a |#endif..|/* BSD *|
|00001710| 2f 0a 23 69 66 6e 64 65 | 66 20 54 45 52 4d 49 4e |/.#ifnde|f TERMIN|
|00001720| 46 4f 5f 44 49 52 0a 23 | 64 65 66 69 6e 65 09 54 |FO_DIR.#|define.T|
|00001730| 45 52 4d 49 4e 46 4f 5f | 44 49 52 09 22 2f 75 73 |ERMINFO_|DIR."/us|
|00001740| 72 2f 6c 69 62 2f 74 65 | 72 6d 69 6e 66 6f 22 0a |r/lib/te|rminfo".|
|00001750| 23 65 6e 64 69 66 09 09 | 2f 2a 20 54 45 52 4d 49 |#endif..|/* TERMI|
|00001760| 4e 46 4f 5f 44 49 52 20 | 2a 2f 0a 0a 0a 23 64 65 |NFO_DIR |*/...#de|
|00001770| 66 69 6e 65 09 4d 41 47 | 49 43 09 30 78 30 31 31 |fine.MAG|IC.0x011|
|00001780| 41 09 09 2f 2a 20 54 65 | 72 6d 69 6e 66 6f 20 6d |A../* Te|rminfo m|
|00001790| 61 67 69 63 20 6e 75 6d | 62 65 72 09 09 2a 2f 0a |agic num|ber..*/.|
|000017a0| 23 64 65 66 69 6e 65 09 | 4d 41 58 4c 49 4e 45 09 |#define.|MAXLINE.|
|000017b0| 36 35 09 09 2f 2a 20 4c | 6f 6e 67 65 73 74 20 65 |65../* L|ongest e|
|000017c0| 6d 69 74 65 64 20 6c 69 | 6e 65 09 09 09 2a 2f 0a |mited li|ne...*/.|
|000017d0| 23 64 65 66 69 6e 65 09 | 4d 41 58 5f 43 41 50 09 |#define.|MAX_CAP.|
|000017e0| 34 30 39 36 09 09 2f 2a | 20 4c 6f 6e 67 65 73 74 |4096../*| Longest|
|000017f0| 20 73 69 6e 67 6c 65 20 | 63 61 70 61 62 69 6c 69 | single |capabili|
|00001800| 74 79 09 09 2a 2f 0a 0a | 65 78 74 65 72 6e 09 63 |ty..*/..|extern.c|
|00001810| 68 61 72 20 2a 73 74 72 | 63 70 79 28 29 3b 0a 0a |har *str|cpy();..|
|00001820| 69 6e 74 09 6c 69 6e 65 | 5f 6c 65 6e 3b 09 09 2f |int.line|_len;../|
|00001830| 2a 20 43 75 72 72 65 6e | 74 20 6c 65 6e 67 74 68 |* Curren|t length|
|00001840| 20 6f 66 20 6c 69 6e 65 | 09 09 2a 2f 0a 0a 6d 61 | of line|..*/..ma|
|00001850| 69 6e 28 61 72 67 63 2c | 20 61 72 67 76 29 0a 20 |in(argc,| argv). |
|00001860| 20 69 6e 74 09 61 72 67 | 63 3b 09 09 09 2f 2a 20 | int.arg|c;.../* |
|00001870| 4e 75 6d 62 65 72 20 6f | 66 20 70 61 72 61 6d 74 |Number o|f paramt|
|00001880| 65 72 73 09 09 09 2a 2f | 0a 20 20 63 68 61 72 09 |ers...*/|. char.|
|00001890| 2a 61 72 67 76 5b 5d 3b | 09 09 2f 2a 20 54 68 65 |*argv[];|../* The|
|000018a0| 20 70 61 72 61 6d 65 74 | 65 72 73 20 74 68 65 6d | paramet|ers them|
|000018b0| 73 65 6c 76 65 73 09 09 | 2a 2f 0a 20 20 20 20 7b |selves..|*/. {|
|000018c0| 0a 20 20 20 20 63 68 61 | 72 20 73 75 62 64 69 72 |. cha|r subdir|
|000018d0| 5b 32 5d 3b 09 09 2f 2a | 20 53 75 62 64 69 72 65 |[2];../*| Subdire|
|000018e0| 63 74 6f 72 79 20 6e 61 | 6d 65 09 09 09 2a 2f 0a |ctory na|me...*/.|
|000018f0| 20 20 20 20 46 49 4c 45 | 20 2a 66 69 6c 65 3b 0a | FILE| *file;.|
|00001900| 20 20 20 20 65 78 74 65 | 72 6e 20 46 49 4c 45 20 | exte|rn FILE |
|00001910| 2a 66 6f 70 65 6e 28 29 | 3b 0a 0a 23 69 66 64 65 |*fopen()|;..#ifde|
|00001920| 66 20 43 50 4d 0a 20 20 | 20 20 77 69 6c 64 65 78 |f CPM. | wildex|
|00001930| 70 28 26 61 72 67 63 2c | 20 26 61 72 67 76 29 3b |p(&argc,| &argv);|
|00001940| 0a 23 65 6e 64 69 66 09 | 09 2f 2a 20 43 50 4d 20 |.#endif.|./* CPM |
|00001950| 2a 2f 0a 0a 20 20 20 20 | 2f 2a 20 43 68 61 6e 67 |*/.. |/* Chang|
|00001960| 65 20 64 69 72 65 63 74 | 6f 72 79 20 74 6f 20 74 |e direct|ory to t|
|00001970| 68 65 20 77 6f 72 6b 69 | 6e 67 20 64 69 72 65 63 |he worki|ng direc|
|00001980| 74 6f 72 79 09 09 09 2a | 2f 0a 20 20 20 20 28 76 |tory...*|/. (v|
|00001990| 6f 69 64 29 63 68 64 69 | 72 28 54 45 52 4d 49 4e |oid)chdi|r(TERMIN|
|000019a0| 46 4f 5f 44 49 52 29 3b | 0a 0a 20 20 20 20 2f 2a |FO_DIR);|.. /*|
|000019b0| 20 47 6f 20 74 68 72 6f | 75 67 68 20 74 68 65 20 | Go thro|ugh the |
|000019c0| 61 72 67 75 6d 65 6e 74 | 73 09 09 09 09 09 09 2a |argument|s......*|
|000019d0| 2f 0a 20 20 20 20 73 75 | 62 64 69 72 5b 31 5d 20 |/. su|bdir[1] |
|000019e0| 3d 20 27 5c 30 27 3b 0a | 20 20 20 20 69 66 20 28 |= '\0';.| if (|
|000019f0| 61 72 67 63 20 3d 3d 20 | 31 29 0a 09 63 6f 6e 76 |argc == |1)..conv|
|00001a00| 65 72 74 28 73 74 64 69 | 6e 2c 20 22 73 74 64 69 |ert(stdi|n, "stdi|
|00001a10| 6e 22 29 3b 0a 20 20 20 | 20 65 6c 73 65 0a 09 7b |n");. | else..{|
|00001a20| 0a 09 77 68 69 6c 65 20 | 28 2d 2d 61 72 67 63 29 |..while |(--argc)|
|00001a30| 0a 09 20 20 20 20 7b 0a | 09 20 20 20 20 2b 2b 61 |.. {.|. ++a|
|00001a40| 72 67 76 3b 0a 09 20 20 | 20 20 73 75 62 64 69 72 |rgv;.. | subdir|
|00001a50| 5b 30 5d 20 3d 20 61 72 | 67 76 5b 30 5d 5b 30 5d |[0] = ar|gv[0][0]|
|00001a60| 3b 0a 09 20 20 20 20 28 | 76 6f 69 64 29 63 68 64 |;.. (|void)chd|
|00001a70| 69 72 28 73 75 62 64 69 | 72 29 3b 0a 09 20 20 20 |ir(subdi|r);.. |
|00001a80| 20 69 66 20 28 28 66 69 | 6c 65 20 3d 20 66 6f 70 | if ((fi|le = fop|
|00001a90| 65 6e 28 2a 61 72 67 76 | 2c 20 4f 50 45 4e 5f 4d |en(*argv|, OPEN_M|
|00001aa0| 4f 44 45 29 29 20 3d 3d | 20 4e 55 4c 4c 29 0a 09 |ODE)) ==| NULL)..|
|00001ab0| 09 7b 0a 09 09 70 65 72 | 72 6f 72 28 2a 61 72 67 |.{...per|ror(*arg|
|00001ac0| 76 29 3b 0a 09 09 7d 0a | 09 20 20 20 20 65 6c 73 |v);...}.|. els|
|00001ad0| 65 0a 09 09 7b 0a 09 09 | 63 6f 6e 76 65 72 74 28 |e...{...|convert(|
|00001ae0| 66 69 6c 65 2c 20 2a 61 | 72 67 76 29 3b 0a 09 09 |file, *a|rgv);...|
|00001af0| 28 76 6f 69 64 29 66 63 | 6c 6f 73 65 28 66 69 6c |(void)fc|lose(fil|
|00001b00| 65 29 3b 0a 09 09 7d 0a | 09 20 20 20 20 28 76 6f |e);...}.|. (vo|
|00001b10| 69 64 29 63 68 64 69 72 | 28 22 2e 2e 22 29 3b 0a |id)chdir|("..");.|
|00001b20| 09 20 20 20 20 7d 0a 09 | 7d 0a 20 20 20 20 7d 0a |. }..|}. }.|
|00001b30| 0a 0a 2f 2a 0a 20 2a 20 | 41 64 64 63 68 61 72 20 |../*. * |Addchar |
|00001b40| 2d 2d 20 41 64 64 20 61 | 20 63 68 61 72 61 63 74 |-- Add a| charact|
|00001b50| 65 72 0a 20 2a 2f 0a 63 | 68 61 72 20 2a 0a 61 64 |er. */.c|har *.ad|
|00001b60| 64 63 68 61 72 28 63 70 | 74 72 2c 20 63 68 29 0a |dchar(cp|tr, ch).|
|00001b70| 20 20 63 68 61 72 09 2a | 63 70 74 72 3b 0a 20 20 | char.*|cptr;. |
|00001b80| 69 6e 74 09 63 68 3b 0a | 20 20 20 20 7b 0a 20 20 |int.ch;.| {. |
|00001b90| 20 20 63 68 61 72 20 2a | 61 64 64 73 74 72 28 29 | char *|addstr()|
|00001ba0| 2c 20 2a 61 64 64 6f 63 | 74 61 6c 28 29 3b 0a 0a |, *addoc|tal();..|
|00001bb0| 20 20 20 20 69 66 20 28 | 63 68 20 3d 3d 20 30 78 | if (|ch == 0x|
|00001bc0| 31 42 29 0a 09 72 65 74 | 75 72 6e 20 28 61 64 64 |1B)..ret|urn (add|
|00001bd0| 73 74 72 28 63 70 74 72 | 2c 20 22 5c 5c 45 22 29 |str(cptr|, "\\E")|
|00001be0| 29 3b 0a 20 20 20 20 69 | 66 20 28 63 68 20 3d 3d |);. i|f (ch ==|
|00001bf0| 20 27 5c 6e 27 29 0a 09 | 72 65 74 75 72 6e 20 28 | '\n')..|return (|
|00001c00| 61 64 64 73 74 72 28 63 | 70 74 72 2c 20 22 5c 5c |addstr(c|ptr, "\\|
|00001c10| 6e 22 29 29 3b 0a 20 20 | 20 20 69 66 20 28 63 68 |n"));. | if (ch|
|00001c20| 20 3d 3d 20 27 5c 72 27 | 29 0a 09 72 65 74 75 72 | == '\r'|)..retur|
|00001c30| 6e 20 28 61 64 64 73 74 | 72 28 63 70 74 72 2c 20 |n (addst|r(cptr, |
|00001c40| 22 5c 5c 72 22 29 29 3b | 0a 20 20 20 20 69 66 20 |"\\r"));|. if |
|00001c50| 28 63 68 20 3d 3d 20 27 | 5c 74 27 29 0a 09 72 65 |(ch == '|\t')..re|
|00001c60| 74 75 72 6e 20 28 61 64 | 64 73 74 72 28 63 70 74 |turn (ad|dstr(cpt|
|00001c70| 72 2c 20 22 5c 5c 74 22 | 29 29 3b 0a 20 20 20 20 |r, "\\t"|));. |
|00001c80| 69 66 20 28 63 68 20 3d | 3d 20 27 5c 62 27 29 0a |if (ch =|= '\b').|
|00001c90| 09 72 65 74 75 72 6e 20 | 28 61 64 64 73 74 72 28 |.return |(addstr(|
|00001ca0| 63 70 74 72 2c 20 22 5c | 5c 62 22 29 29 3b 0a 20 |cptr, "\|\b"));. |
|00001cb0| 20 20 20 69 66 20 28 63 | 68 20 3d 3d 20 27 5c 66 | if (c|h == '\f|
|00001cc0| 27 29 0a 09 72 65 74 75 | 72 6e 20 28 61 64 64 73 |')..retu|rn (adds|
|00001cd0| 74 72 28 63 70 74 72 2c | 20 22 5c 5c 66 22 29 29 |tr(cptr,| "\\f"))|
|00001ce0| 3b 0a 20 20 20 20 69 66 | 20 28 63 68 20 3d 3d 20 |;. if| (ch == |
|00001cf0| 27 20 27 29 0a 09 72 65 | 74 75 72 6e 20 28 61 64 |' ')..re|turn (ad|
|00001d00| 64 73 74 72 28 63 70 74 | 72 2c 20 22 5c 5c 73 22 |dstr(cpt|r, "\\s"|
|00001d10| 29 29 3b 0a 20 20 20 20 | 69 66 20 28 63 68 20 3d |));. |if (ch =|
|00001d20| 3d 20 27 5e 27 29 0a 09 | 72 65 74 75 72 6e 20 28 |= '^')..|return (|
|00001d30| 61 64 64 73 74 72 28 63 | 70 74 72 2c 20 22 5c 5c |addstr(c|ptr, "\\|
|00001d40| 5e 22 29 29 3b 0a 20 20 | 20 20 69 66 20 28 63 68 |^"));. | if (ch|
|00001d50| 20 3d 3d 20 27 5c 5c 27 | 29 0a 09 72 65 74 75 72 | == '\\'|)..retur|
|00001d60| 6e 20 28 61 64 64 73 74 | 72 28 63 70 74 72 2c 20 |n (addst|r(cptr, |
|00001d70| 22 5c 5c 5c 5c 22 29 29 | 3b 0a 20 20 20 20 69 66 |"\\\\"))|;. if|
|00001d80| 20 28 63 68 20 3d 3d 20 | 27 2c 27 29 0a 09 72 65 | (ch == |',')..re|
|00001d90| 74 75 72 6e 20 28 61 64 | 64 73 74 72 28 63 70 74 |turn (ad|dstr(cpt|
|00001da0| 72 2c 20 22 5c 5c 2c 22 | 29 29 3b 0a 20 20 20 20 |r, "\\,"|));. |
|00001db0| 69 66 20 28 63 68 20 3d | 3d 20 27 3a 27 29 0a 09 |if (ch =|= ':')..|
|00001dc0| 72 65 74 75 72 6e 20 28 | 61 64 64 73 74 72 28 63 |return (|addstr(c|
|00001dd0| 70 74 72 2c 20 22 5c 5c | 3a 22 29 29 3b 0a 20 20 |ptr, "\\|:"));. |
|00001de0| 20 20 69 66 20 28 63 68 | 20 3e 3d 20 28 27 41 27 | if (ch| >= ('A'|
|00001df0| 20 2d 20 27 40 27 29 20 | 26 26 20 63 68 20 3c 3d | - '@') |&& ch <=|
|00001e00| 20 28 27 5a 27 20 2d 20 | 27 40 27 29 29 0a 09 7b | ('Z' - |'@'))..{|
|00001e10| 0a 09 2a 63 70 74 72 2b | 2b 20 3d 20 27 5e 27 3b |..*cptr+|+ = '^';|
|00001e20| 0a 09 2a 63 70 74 72 2b | 2b 20 3d 20 63 68 20 2b |..*cptr+|+ = ch +|
|00001e30| 20 27 40 27 3b 0a 09 72 | 65 74 75 72 6e 20 28 63 | '@';..r|eturn (c|
|00001e40| 70 74 72 29 3b 0a 09 7d | 0a 23 69 66 64 65 66 20 |ptr);..}|.#ifdef |
|00001e50| 6e 6f 74 64 65 66 0a 20 | 20 20 20 2f 2a 0a 20 20 |notdef. | /*. |
|00001e60| 20 20 20 2a 20 44 69 64 | 20 79 6f 75 20 6b 6e 6f | * Did| you kno|
|00001e70| 77 20 74 68 61 74 20 5c | 72 20 5c 6e 20 5c 66 20 |w that \|r \n \f |
|00001e80| 5c 74 20 61 72 65 20 4e | 4f 54 20 63 6f 6e 74 72 |\t are N|OT contr|
|00001e90| 6f 6c 20 63 68 61 72 61 | 63 74 65 72 73 0a 20 20 |ol chara|cters. |
|00001ea0| 20 20 20 2a 20 61 73 20 | 64 65 66 69 6e 65 64 20 | * as |defined |
|00001eb0| 62 79 20 22 69 73 63 6e | 74 72 6c 22 20 75 6e 64 |by "iscn|trl" und|
|00001ec0| 65 72 20 42 53 44 20 34 | 2e 32 3f 20 20 49 20 66 |er BSD 4|.2? I f|
|00001ed0| 69 6e 64 20 74 68 61 74 | 0a 20 20 20 20 20 2a 20 |ind that|. * |
|00001ee0| 72 61 74 68 65 72 20 6f | 64 64 2e 0a 20 20 20 20 |rather o|dd.. |
|00001ef0| 20 2a 2f 0a 23 65 6e 64 | 69 66 09 09 2f 2a 20 6e | */.#end|if../* n|
|00001f00| 6f 74 64 65 66 20 2a 2f | 0a 20 20 20 20 69 66 20 |otdef */|. if |
|00001f10| 28 69 73 63 6e 74 72 6c | 28 63 68 29 20 7c 7c 20 |(iscntrl|(ch) || |
|00001f20| 69 73 73 70 61 63 65 28 | 63 68 29 20 7c 7c 20 63 |isspace(|ch) || c|
|00001f30| 68 20 3e 20 30 78 37 46 | 29 0a 20 20 20 20 09 72 |h > 0x7F|). .r|
|00001f40| 65 74 75 72 6e 20 28 61 | 64 64 6f 63 74 61 6c 28 |eturn (a|ddoctal(|
|00001f50| 63 70 74 72 2c 20 63 68 | 29 29 3b 0a 20 20 20 20 |cptr, ch|));. |
|00001f60| 2a 63 70 74 72 2b 2b 20 | 3d 20 63 68 3b 0a 20 20 |*cptr++ |= ch;. |
|00001f70| 20 20 72 65 74 75 72 6e | 20 28 63 70 74 72 29 3b | return| (cptr);|
|00001f80| 0a 20 20 20 20 7d 0a 0a | 0a 2f 2a 0a 20 2a 20 41 |. }..|./*. * A|
|00001f90| 64 64 6f 63 74 61 6c 20 | 2d 2d 20 41 64 64 20 61 |ddoctal |-- Add a|
|00001fa0| 6e 20 6f 63 74 61 6c 20 | 63 68 61 72 61 63 74 65 |n octal |characte|
|00001fb0| 72 0a 20 2a 0a 20 2a 20 | 55 73 65 20 73 70 72 69 |r. *. * |Use spri|
|00001fc0| 6e 74 66 20 6a 75 73 74 | 20 69 6e 20 63 61 73 65 |ntf just| in case|
|00001fd0| 20 22 30 22 20 74 68 72 | 6f 75 67 68 20 22 37 22 | "0" thr|ough "7"|
|00001fe0| 20 61 72 65 20 6e 6f 74 | 20 63 6f 6e 74 69 67 75 | are not| contigu|
|00001ff0| 6f 75 73 2e 20 20 53 6f | 6d 65 0a 20 2a 20 6d 61 |ous. So|me. * ma|
|00002000| 63 68 69 6e 65 73 20 61 | 72 65 20 77 65 69 72 64 |chines a|re weird|
|00002010| 2e 0a 20 2a 2f 0a 63 68 | 61 72 20 2a 0a 61 64 64 |.. */.ch|ar *.add|
|00002020| 6f 63 74 61 6c 28 63 70 | 74 72 2c 20 63 68 29 0a |octal(cp|tr, ch).|
|00002030| 20 20 63 68 61 72 09 2a | 63 70 74 72 3b 0a 20 20 | char.*|cptr;. |
|00002040| 69 6e 74 09 63 68 3b 0a | 20 20 20 20 7b 0a 20 20 |int.ch;.| {. |
|00002050| 20 20 63 68 61 72 20 2a | 61 64 64 73 74 72 28 29 | char *|addstr()|
|00002060| 3b 0a 0a 20 20 20 20 63 | 68 20 26 3d 20 30 78 46 |;.. c|h &= 0xF|
|00002070| 46 3b 0a 0a 20 20 20 20 | 69 66 20 28 63 68 20 3d |F;.. |if (ch =|
|00002080| 3d 20 30 78 38 30 29 0a | 09 72 65 74 75 72 6e 20 |= 0x80).|.return |
|00002090| 28 61 64 64 73 74 72 28 | 63 70 74 72 2c 20 22 5c |(addstr(|cptr, "\|
|000020a0| 5c 30 22 29 29 3b 0a 20 | 20 20 20 28 76 6f 69 64 |\0"));. | (void|
|000020b0| 29 73 70 72 69 6e 74 66 | 28 63 70 74 72 2c 20 22 |)sprintf|(cptr, "|
|000020c0| 5c 5c 25 30 33 6f 22 2c | 20 63 68 29 3b 0a 20 20 |\\%03o",| ch);. |
|000020d0| 20 20 77 68 69 6c 65 20 | 28 2a 63 70 74 72 20 21 | while |(*cptr !|
|000020e0| 3d 20 27 5c 30 27 29 0a | 09 63 70 74 72 2b 2b 3b |= '\0').|.cptr++;|
|000020f0| 0a 20 20 20 20 72 65 74 | 75 72 6e 20 28 63 70 74 |. ret|urn (cpt|
|00002100| 72 29 3b 0a 20 20 20 20 | 7d 0a 0a 0a 2f 2a 0a 20 |r);. |}.../*. |
|00002110| 2a 20 41 64 64 73 74 72 | 20 2d 2d 20 41 64 64 20 |* Addstr| -- Add |
|00002120| 61 20 73 74 72 69 6e 67 | 20 74 6f 20 74 68 65 20 |a string| to the |
|00002130| 63 61 70 61 62 69 6c 69 | 74 79 0a 20 2a 2f 0a 63 |capabili|ty. */.c|
|00002140| 68 61 72 20 2a 0a 61 64 | 64 73 74 72 28 63 70 74 |har *.ad|dstr(cpt|
|00002150| 72 2c 20 73 74 72 29 0a | 20 20 63 68 61 72 09 2a |r, str).| char.*|
|00002160| 63 70 74 72 2c 20 2a 73 | 74 72 3b 0a 20 20 20 20 |cptr, *s|tr;. |
|00002170| 7b 0a 20 20 20 20 77 68 | 69 6c 65 20 28 2a 73 74 |{. wh|ile (*st|
|00002180| 72 29 0a 09 2a 63 70 74 | 72 2b 2b 20 3d 20 2a 73 |r)..*cpt|r++ = *s|
|00002190| 74 72 2b 2b 3b 0a 20 20 | 20 20 72 65 74 75 72 6e |tr++;. | return|
|000021a0| 20 28 63 70 74 72 29 3b | 0a 20 20 20 20 7d 0a 0a | (cptr);|. }..|
|000021b0| 0a 2f 2a 0a 20 2a 20 43 | 6f 6e 76 65 72 74 20 2d |./*. * C|onvert -|
|000021c0| 2d 20 44 6f 20 74 68 65 | 20 61 63 74 75 61 6c 20 |- Do the| actual |
|000021d0| 63 6f 6e 76 65 72 73 69 | 6f 6e 0a 20 2a 2f 0a 63 |conversi|on. */.c|
|000021e0| 6f 6e 76 65 72 74 28 66 | 69 6c 65 2c 20 6e 61 6d |onvert(f|ile, nam|
|000021f0| 65 29 0a 20 20 46 49 4c | 45 09 2a 66 69 6c 65 3b |e). FIL|E.*file;|
|00002200| 09 09 2f 2a 20 54 68 65 | 20 66 69 6c 65 20 77 69 |../* The| file wi|
|00002210| 74 68 20 74 68 65 20 63 | 6f 6d 70 69 6c 65 64 20 |th the c|ompiled |
|00002220| 69 6e 66 6f 72 6d 61 74 | 69 6f 6e 09 2a 2f 0a 20 |informat|ion.*/. |
|00002230| 20 63 68 61 72 09 2a 6e | 61 6d 65 3b 09 09 2f 2a | char.*n|ame;../*|
|00002240| 20 50 72 69 6e 74 61 62 | 6c 65 20 76 65 72 73 69 | Printab|le versi|
|00002250| 6f 6e 20 6f 66 20 74 68 | 65 20 66 69 6c 65 6e 61 |on of th|e filena|
|00002260| 6d 65 09 09 2a 2f 0a 20 | 20 20 20 7b 0a 20 20 20 |me..*/. | {. |
|00002270| 20 69 6e 74 09 63 68 2c | 20 76 61 6c 2c 20 69 2c | int.ch,| val, i,|
|00002280| 20 6a 2c 20 66 61 69 6c | 3b 0a 20 20 20 20 69 6e | j, fail|;. in|
|00002290| 74 20 6e 61 6d 65 5f 6c | 65 6e 67 74 68 2c 20 62 |t name_l|ength, b|
|000022a0| 6f 6f 6c 5f 6c 65 6e 67 | 74 68 2c 20 6e 75 6d 5f |ool_leng|th, num_|
|000022b0| 6c 65 6e 67 74 68 2c 20 | 73 74 72 5f 6c 65 6e 67 |length, |str_leng|
|000022c0| 74 68 2c 20 73 5f 6c 65 | 6e 67 74 68 3b 0a 20 20 |th, s_le|ngth;. |
|000022d0| 20 20 63 68 61 72 20 63 | 61 70 61 62 69 6c 69 74 | char c|apabilit|
|000022e0| 79 5b 4d 41 58 5f 43 41 | 50 2b 31 5d 2c 20 2a 63 |y[MAX_CA|P+1], *c|
|000022f0| 70 74 72 2c 20 2a 61 64 | 64 63 68 61 72 28 29 3b |ptr, *ad|dchar();|
|00002300| 0a 0a 20 20 20 20 73 74 | 61 74 69 63 20 63 68 61 |.. st|atic cha|
|00002310| 72 20 2a 62 6f 6f 6c 65 | 61 6e 73 5b 5d 20 3d 09 |r *boole|ans[] =.|
|00002320| 2f 2a 20 4e 61 6d 65 73 | 20 6f 66 20 62 6f 6f 6c |/* Names| of bool|
|00002330| 65 61 6e 20 76 61 72 69 | 61 62 6c 65 73 2c 20 69 |ean vari|ables, i|
|00002340| 6e 20 6f 72 64 65 72 09 | 2a 2f 0a 09 7b 20 22 62 |n order.|*/..{ "b|
|00002350| 77 22 2c 20 22 61 6d 22 | 2c 20 22 78 73 62 22 2c |w", "am"|, "xsb",|
|00002360| 20 22 78 68 70 22 2c 20 | 22 78 65 6e 6c 22 2c 20 | "xhp", |"xenl", |
|00002370| 22 65 6f 22 2c 20 22 67 | 6e 22 2c 20 22 68 63 22 |"eo", "g|n", "hc"|
|00002380| 2c 20 22 6b 6d 22 2c 0a | 09 20 20 22 68 73 22 2c |, "km",.|. "hs",|
|00002390| 20 22 69 6e 22 2c 20 22 | 64 61 22 2c 20 22 64 62 | "in", "|da", "db|
|000023a0| 22 2c 20 22 6d 69 72 22 | 2c 20 22 6d 73 67 72 22 |", "mir"|, "msgr"|
|000023b0| 2c 20 22 6f 73 22 2c 20 | 22 65 73 6c 6f 6b 22 2c |, "os", |"eslok",|
|000023c0| 20 22 78 74 22 2c 0a 09 | 20 20 22 68 7a 22 2c 20 | "xt",..| "hz", |
|000023d0| 22 75 6c 22 2c 20 22 78 | 6f 6e 22 20 7d 3b 0a 20 |"ul", "x|on" };. |
|000023e0| 20 20 20 73 74 61 74 69 | 63 20 63 68 61 72 20 2a | stati|c char *|
|000023f0| 6e 75 6d 65 72 69 63 73 | 5b 5d 20 3d 09 2f 2a 20 |numerics|[] =./* |
|00002400| 4e 61 6d 65 73 20 6f 66 | 20 6e 75 6d 65 72 69 63 |Names of| numeric|
|00002410| 20 76 61 72 69 61 62 6c | 65 73 2c 20 69 6e 20 6f | variabl|es, in o|
|00002420| 72 64 65 72 09 2a 2f 0a | 09 7b 20 22 63 6f 6c 73 |rder.*/.|.{ "cols|
|00002430| 22 2c 20 22 69 74 22 2c | 20 22 6c 69 6e 65 73 22 |", "it",| "lines"|
|00002440| 2c 20 22 6c 6d 22 2c 20 | 22 78 6d 63 22 2c 20 22 |, "lm", |"xmc", "|
|00002450| 70 62 22 2c 20 22 76 74 | 22 2c 20 22 77 73 6c 22 |pb", "vt|", "wsl"|
|00002460| 20 7d 3b 0a 20 20 20 20 | 73 74 61 74 69 63 20 63 | };. |static c|
|00002470| 68 61 72 20 2a 73 74 72 | 69 6e 67 73 5b 5d 20 3d |har *str|ings[] =|
|00002480| 09 2f 2a 20 4e 61 6d 65 | 73 20 6f 66 20 73 74 72 |./* Name|s of str|
|00002490| 69 6e 67 20 76 61 72 69 | 61 62 6c 65 73 2c 20 6e |ing vari|ables, n|
|000024a0| 6f 74 20 69 6e 20 73 74 | 72 69 63 74 0a 09 09 09 |ot in st|rict....|
|000024b0| 09 20 20 20 6f 72 64 65 | 72 2e 20 20 4d 61 6b 65 |. orde|r. Make|
|000024c0| 73 20 74 68 69 6e 67 73 | 20 61 20 6c 69 74 74 6c |s things| a littl|
|000024d0| 65 20 68 61 72 64 65 72 | 09 2a 2f 0a 09 7b 20 22 |e harder|.*/..{ "|
|000024e0| 63 62 74 22 2c 20 22 62 | 65 6c 22 2c 20 22 63 72 |cbt", "b|el", "cr|
|000024f0| 22 2c 20 22 63 73 72 22 | 2c 20 22 74 62 63 22 2c |", "csr"|, "tbc",|
|00002500| 20 22 63 6c 65 61 72 22 | 2c 20 22 65 6c 22 2c 20 | "clear"|, "el", |
|00002510| 22 65 64 22 2c 20 22 68 | 70 61 22 2c 0a 09 20 20 |"ed", "h|pa",.. |
|00002520| 22 63 6d 64 63 68 22 2c | 20 22 63 75 70 22 2c 20 |"cmdch",| "cup", |
|00002530| 22 63 75 64 31 22 2c 20 | 22 68 6f 6d 65 22 2c 20 |"cud1", |"home", |
|00002540| 22 63 69 76 69 73 22 2c | 20 22 63 75 62 31 22 2c |"civis",| "cub1",|
|00002550| 20 22 6d 72 63 75 70 22 | 2c 0a 09 20 20 22 63 6e | "mrcup"|,.. "cn|
|00002560| 6f 72 6d 22 2c 20 22 63 | 75 66 31 22 2c 20 22 6c |orm", "c|uf1", "l|
|00002570| 6c 22 2c 20 22 63 75 75 | 31 22 2c 20 22 63 76 76 |l", "cuu|1", "cvv|
|00002580| 69 73 22 2c 20 22 64 63 | 68 31 22 2c 20 22 64 6c |is", "dc|h1", "dl|
|00002590| 31 22 2c 20 22 64 73 6c | 22 2c 0a 09 20 20 22 68 |1", "dsl|",.. "h|
|000025a0| 64 22 2c 20 22 73 6d 61 | 63 73 22 2c 20 22 62 6c |d", "sma|cs", "bl|
|000025b0| 69 6e 6b 22 2c 20 22 62 | 6f 6c 64 22 2c 20 22 73 |ink", "b|old", "s|
|000025c0| 6d 63 75 70 22 2c 20 22 | 73 6d 64 63 22 2c 20 22 |mcup", "|smdc", "|
|000025d0| 64 69 6d 22 2c 20 22 73 | 6d 69 72 22 2c 0a 09 20 |dim", "s|mir",.. |
|000025e0| 20 22 69 6e 76 69 73 22 | 2c 20 22 70 72 6f 74 22 | "invis"|, "prot"|
|000025f0| 2c 20 22 72 65 76 22 2c | 20 22 73 6d 73 6f 22 2c |, "rev",| "smso",|
|00002600| 20 22 73 6d 75 6c 22 2c | 20 22 65 63 68 22 2c 20 | "smul",| "ech", |
|00002610| 22 72 6d 61 63 73 22 2c | 20 22 73 67 72 30 22 2c |"rmacs",| "sgr0",|
|00002620| 20 0a 09 20 20 22 72 6d | 63 75 70 22 2c 20 22 72 | .. "rm|cup", "r|
|00002630| 6d 64 63 22 2c 20 22 72 | 6d 69 72 22 2c 20 22 72 |mdc", "r|mir", "r|
|00002640| 6d 73 6f 22 2c 20 22 72 | 6d 75 6c 22 2c 20 22 66 |mso", "r|mul", "f|
|00002650| 6c 61 73 68 22 2c 20 22 | 66 66 22 2c 20 22 66 73 |lash", "|ff", "fs|
|00002660| 6c 22 2c 0a 09 20 20 22 | 69 73 31 22 2c 20 22 69 |l",.. "|is1", "i|
|00002670| 73 32 22 2c 20 22 69 73 | 33 22 2c 20 22 69 66 22 |s2", "is|3", "if"|
|00002680| 2c 20 22 69 63 68 31 22 | 2c 20 22 69 6c 31 22 2c |, "ich1"|, "il1",|
|00002690| 20 22 69 70 22 2c 20 22 | 6b 62 73 22 2c 20 22 6b | "ip", "|kbs", "k|
|000026a0| 74 62 63 22 2c 0a 09 20 | 20 22 6b 63 6c 72 22 2c |tbc",.. | "kclr",|
|000026b0| 20 22 6b 63 74 61 62 22 | 2c 20 22 6b 64 63 68 31 | "kctab"|, "kdch1|
|000026c0| 22 2c 20 22 6b 64 6c 31 | 22 2c 20 22 6b 63 75 64 |", "kdl1|", "kcud|
|000026d0| 31 22 2c 20 22 6b 72 6d | 69 72 22 2c 20 22 6b 65 |1", "krm|ir", "ke|
|000026e0| 6c 22 2c 20 22 6b 65 64 | 22 2c 0a 09 20 20 22 6b |l", "ked|",.. "k|
|000026f0| 66 30 22 2c 20 22 6b 66 | 31 22 2c 20 22 6b 66 31 |f0", "kf|1", "kf1|
|00002700| 30 22 2c 20 22 6b 66 32 | 22 2c 20 22 6b 66 33 22 |0", "kf2|", "kf3"|
|00002710| 2c 20 22 6b 66 34 22 2c | 20 22 6b 66 35 22 2c 20 |, "kf4",| "kf5", |
|00002720| 22 6b 66 36 22 2c 20 22 | 6b 66 37 22 2c 0a 09 20 |"kf6", "|kf7",.. |
|00002730| 20 22 6b 66 38 22 2c 20 | 22 6b 66 39 22 2c 20 22 | "kf8", |"kf9", "|
|00002740| 6b 68 6f 6d 65 22 2c 20 | 22 6b 69 63 68 31 22 2c |khome", |"kich1",|
|00002750| 20 22 6b 69 6c 31 22 2c | 20 22 6b 63 75 62 31 22 | "kil1",| "kcub1"|
|00002760| 2c 20 22 6b 6c 6c 22 2c | 20 22 6b 6e 70 22 2c 0a |, "kll",| "knp",.|
|00002770| 09 20 20 22 6b 70 70 22 | 2c 20 22 6b 63 75 66 31 |. "kpp"|, "kcuf1|
|00002780| 22 2c 20 22 6b 69 6e 64 | 22 2c 20 22 6b 72 69 22 |", "kind|", "kri"|
|00002790| 2c 20 22 6b 68 74 73 22 | 2c 20 22 6b 63 75 75 31 |, "khts"|, "kcuu1|
|000027a0| 22 2c 20 22 72 6d 6b 78 | 22 2c 20 22 73 6d 6b 78 |", "rmkx|", "smkx|
|000027b0| 22 2c 20 0a 09 20 20 22 | 6c 66 30 22 2c 20 22 6c |", .. "|lf0", "l|
|000027c0| 66 31 22 2c 20 22 6c 66 | 31 30 22 2c 20 22 6c 66 |f1", "lf|10", "lf|
|000027d0| 32 22 2c 20 22 6c 66 33 | 22 2c 20 22 6c 66 34 22 |2", "lf3|", "lf4"|
|000027e0| 2c 20 22 6c 66 35 22 2c | 20 22 6c 66 36 22 2c 20 |, "lf5",| "lf6", |
|000027f0| 22 6c 66 37 22 2c 0a 09 | 20 20 22 6c 66 38 22 2c |"lf7",..| "lf8",|
|00002800| 20 22 6c 66 39 22 2c 20 | 22 72 6d 6d 22 2c 20 22 | "lf9", |"rmm", "|
|00002810| 73 6d 6d 22 2c 20 22 6e | 65 6c 22 2c 20 22 70 61 |smm", "n|el", "pa|
|00002820| 64 22 2c 20 22 64 63 68 | 22 2c 20 22 64 6c 22 2c |d", "dch|", "dl",|
|00002830| 20 22 63 75 64 22 2c 0a | 09 20 20 22 69 63 68 22 | "cud",.|. "ich"|
|00002840| 2c 20 22 69 6e 64 6e 22 | 2c 20 22 69 6c 22 2c 20 |, "indn"|, "il", |
|00002850| 22 63 75 62 22 2c 20 22 | 63 75 66 22 2c 20 22 72 |"cub", "|cuf", "r|
|00002860| 69 6e 22 2c 20 22 63 75 | 75 22 2c 20 22 70 66 6b |in", "cu|u", "pfk|
|00002870| 65 79 22 2c 20 22 70 66 | 6c 6f 63 22 2c 0a 09 20 |ey", "pf|loc",.. |
|00002880| 20 22 70 66 78 22 2c 20 | 22 6d 63 30 22 2c 20 22 | "pfx", |"mc0", "|
|00002890| 6d 63 34 22 2c 20 22 6d | 63 35 22 2c 20 22 72 65 |mc4", "m|c5", "re|
|000028a0| 70 22 2c 20 22 72 73 31 | 22 2c 20 22 72 73 32 22 |p", "rs1|", "rs2"|
|000028b0| 2c 20 22 72 73 33 22 2c | 20 22 72 66 22 2c 0a 09 |, "rs3",| "rf",..|
|000028c0| 20 20 22 72 63 22 2c 20 | 22 76 70 61 22 2c 20 22 | "rc", |"vpa", "|
|000028d0| 73 63 22 2c 20 22 69 6e | 64 22 2c 20 22 72 69 22 |sc", "in|d", "ri"|
|000028e0| 2c 20 22 73 67 72 22 2c | 20 22 68 74 73 22 2c 20 |, "sgr",| "hts", |
|000028f0| 22 77 69 6e 64 22 2c 20 | 22 68 74 22 2c 20 22 74 |"wind", |"ht", "t|
|00002900| 73 6c 22 2c 0a 09 20 20 | 22 75 63 22 2c 20 22 68 |sl",.. |"uc", "h|
|00002910| 75 22 2c 20 22 69 70 72 | 6f 67 22 2c 20 22 6b 61 |u", "ipr|og", "ka|
|00002920| 31 22 2c 20 22 6b 61 33 | 22 2c 20 22 6b 62 32 22 |1", "ka3|", "kb2"|
|00002930| 2c 20 22 6b 63 31 22 2c | 20 22 6b 63 33 22 2c 20 |, "kc1",| "kc3", |
|00002940| 22 6d 63 35 70 22 20 7d | 3b 0a 20 20 20 20 69 6e |"mc5p" }|;. in|
|00002950| 74 20 73 74 72 5f 63 61 | 70 5b 73 69 7a 65 6f 66 |t str_ca|p[sizeof|
|00002960| 28 73 74 72 69 6e 67 73 | 29 20 2f 20 73 69 7a 65 |(strings|) / size|
|00002970| 6f 66 28 63 68 61 72 20 | 2a 29 5d 3b 0a 0a 20 20 |of(char |*)];.. |
|00002980| 20 20 2f 2a 20 43 68 65 | 63 6b 20 74 68 65 20 6d | /* Che|ck the m|
|00002990| 61 67 69 63 20 6e 75 6d | 62 65 72 20 6f 75 74 09 |agic num|ber out.|
|000029a0| 09 09 09 09 2a 2f 0a 20 | 20 20 20 69 66 20 28 67 |....*/. | if (g|
|000029b0| 65 74 32 28 66 69 6c 65 | 29 20 21 3d 20 4d 41 47 |et2(file|) != MAG|
|000029c0| 49 43 29 0a 09 7b 0a 09 | 66 70 72 69 6e 74 66 28 |IC)..{..|fprintf(|
|000029d0| 73 74 64 65 72 72 2c 20 | 22 5c 22 25 73 5c 22 20 |stderr, |"\"%s\" |
|000029e0| 69 73 20 6e 6f 74 20 61 | 20 74 65 72 6d 69 6e 66 |is not a| terminf|
|000029f0| 6f 20 66 69 6c 65 5c 6e | 22 2c 20 6e 61 6d 65 29 |o file\n|", name)|
|00002a00| 3b 0a 09 72 65 74 75 72 | 6e 3b 0a 09 7d 0a 0a 20 |;..retur|n;..}.. |
|00002a10| 20 20 20 2f 2a 20 47 65 | 74 20 74 68 65 20 72 65 | /* Ge|t the re|
|00002a20| 73 74 20 6f 66 20 74 68 | 65 20 68 65 61 64 65 72 |st of th|e header|
|00002a30| 20 69 6e 66 6f 72 6d 61 | 74 69 6f 6e 09 09 09 09 | informa|tion....|
|00002a40| 2a 2f 0a 20 20 20 20 6e | 61 6d 65 5f 6c 65 6e 67 |*/. n|ame_leng|
|00002a50| 74 68 20 3d 20 67 65 74 | 32 28 66 69 6c 65 29 3b |th = get|2(file);|
|00002a60| 09 2f 2a 20 47 65 74 20 | 74 68 65 20 6c 65 6e 67 |./* Get |the leng|
|00002a70| 74 68 20 6f 66 20 74 68 | 65 20 74 65 72 6d 69 6e |th of th|e termin|
|00002a80| 61 6c 20 6e 61 6d 65 73 | 09 2a 2f 0a 20 20 20 20 |al names|.*/. |
|00002a90| 62 6f 6f 6c 5f 6c 65 6e | 67 74 68 20 3d 20 67 65 |bool_len|gth = ge|
|00002aa0| 74 32 28 66 69 6c 65 29 | 3b 09 2f 2a 20 47 65 74 |t2(file)|;./* Get|
|00002ab0| 20 74 68 65 20 6c 65 6e | 67 74 68 20 6f 66 20 74 | the len|gth of t|
|00002ac0| 68 65 20 62 6f 6f 6c 65 | 61 6e 73 09 2a 2f 0a 20 |he boole|ans.*/. |
|00002ad0| 20 20 20 6e 75 6d 5f 6c | 65 6e 67 74 68 20 3d 20 | num_l|ength = |
|00002ae0| 67 65 74 32 28 66 69 6c | 65 29 3b 09 2f 2a 20 47 |get2(fil|e);./* G|
|00002af0| 65 74 20 74 68 65 20 6c | 65 6e 67 74 68 20 6f 66 |et the l|ength of|
|00002b00| 20 74 68 65 20 6e 75 6d | 65 72 69 63 73 09 2a 2f | the num|erics.*/|
|00002b10| 0a 20 20 20 20 73 74 72 | 5f 6c 65 6e 67 74 68 20 |. str|_length |
|00002b20| 3d 20 67 65 74 32 28 66 | 69 6c 65 29 3b 09 2f 2a |= get2(f|ile);./*|
|00002b30| 20 47 65 74 20 74 68 65 | 20 6c 65 6e 67 74 68 20 | Get the| length |
|00002b40| 6f 66 20 74 68 65 20 73 | 74 72 69 6e 67 73 09 2a |of the s|trings.*|
|00002b50| 2f 0a 20 20 20 20 73 5f | 6c 65 6e 67 74 68 20 3d |/. s_|length =|
|00002b60| 20 67 65 74 32 28 66 69 | 6c 65 29 3b 09 2f 2a 20 | get2(fi|le);./* |
|00002b70| 47 65 74 20 74 68 65 20 | 6c 65 6e 67 74 68 20 6f |Get the |length o|
|00002b80| 66 20 74 68 65 20 73 74 | 72 69 6e 67 20 74 61 62 |f the st|ring tab|
|00002b90| 6c 65 73 09 2a 2f 0a 0a | 20 20 20 20 2f 2a 20 43 |les.*/..| /* C|
|00002ba0| 68 65 63 6b 20 66 6f 72 | 20 74 6f 6f 20 6d 61 6e |heck for| too man|
|00002bb0| 79 20 64 61 74 61 20 69 | 74 65 6d 73 09 09 09 09 |y data i|tems....|
|00002bc0| 09 2a 2f 0a 20 20 20 20 | 66 61 69 6c 20 3d 20 46 |.*/. |fail = F|
|00002bd0| 41 4c 53 45 3b 0a 20 20 | 20 20 69 66 20 28 62 6f |ALSE;. | if (bo|
|00002be0| 6f 6c 5f 6c 65 6e 67 74 | 68 20 3e 20 28 73 69 7a |ol_lengt|h > (siz|
|00002bf0| 65 6f 66 28 62 6f 6f 6c | 65 61 6e 73 29 20 2f 20 |eof(bool|eans) / |
|00002c00| 73 69 7a 65 6f 66 28 63 | 68 61 72 20 2a 29 29 29 |sizeof(c|har *)))|
|00002c10| 0a 09 7b 0a 09 66 70 72 | 69 6e 74 66 28 73 74 64 |..{..fpr|intf(std|
|00002c20| 65 72 72 2c 20 22 42 6f | 6f 6c 65 61 6e 20 76 61 |err, "Bo|olean va|
|00002c30| 72 69 61 62 6c 65 73 20 | 68 61 76 65 20 62 65 65 |riables |have bee|
|00002c40| 6e 20 61 64 64 65 64 20 | 74 6f 20 74 65 72 6d 69 |n added |to termi|
|00002c50| 6e 66 6f 2e 5c 6e 22 29 | 3b 0a 09 66 61 69 6c 20 |nfo.\n")|;..fail |
|00002c60| 3d 20 54 52 55 45 3b 0a | 09 7d 0a 20 20 20 20 69 |= TRUE;.|.}. i|
|00002c70| 66 20 28 6e 75 6d 5f 6c | 65 6e 67 74 68 20 3e 20 |f (num_l|ength > |
|00002c80| 28 73 69 7a 65 6f 66 28 | 6e 75 6d 65 72 69 63 73 |(sizeof(|numerics|
|00002c90| 29 20 2f 20 73 69 7a 65 | 6f 66 28 63 68 61 72 20 |) / size|of(char |
|00002ca0| 2a 29 29 29 0a 09 7b 0a | 09 66 70 72 69 6e 74 66 |*)))..{.|.fprintf|
|00002cb0| 28 73 74 64 65 72 72 2c | 20 22 4e 75 6d 65 72 69 |(stderr,| "Numeri|
|00002cc0| 63 20 76 61 72 69 61 62 | 6c 65 73 20 68 61 76 65 |c variab|les have|
|00002cd0| 20 62 65 65 6e 20 61 64 | 64 65 64 20 74 6f 20 74 | been ad|ded to t|
|00002ce0| 65 72 6d 69 6e 66 6f 2e | 5c 6e 22 29 3b 0a 09 66 |erminfo.|\n");..f|
|00002cf0| 61 69 6c 20 3d 20 54 52 | 55 45 3b 0a 09 7d 0a 20 |ail = TR|UE;..}. |
|00002d00| 20 20 20 69 66 20 28 73 | 74 72 5f 6c 65 6e 67 74 | if (s|tr_lengt|
|00002d10| 68 20 3e 20 28 73 69 7a | 65 6f 66 28 73 74 72 69 |h > (siz|eof(stri|
|00002d20| 6e 67 73 29 20 2f 20 73 | 69 7a 65 6f 66 28 63 68 |ngs) / s|izeof(ch|
|00002d30| 61 72 20 2a 29 29 29 0a | 09 7b 0a 09 66 70 72 69 |ar *))).|.{..fpri|
|00002d40| 6e 74 66 28 73 74 64 65 | 72 72 2c 20 22 53 74 72 |ntf(stde|rr, "Str|
|00002d50| 69 6e 67 20 76 61 72 69 | 61 62 6c 65 73 20 68 61 |ing vari|ables ha|
|00002d60| 76 65 20 62 65 65 6e 20 | 61 64 64 65 64 20 74 6f |ve been |added to|
|00002d70| 20 74 65 72 6d 69 6e 66 | 6f 2e 5c 6e 22 29 3b 0a | terminf|o.\n");.|
|00002d80| 09 66 61 69 6c 20 3d 20 | 54 52 55 45 3b 0a 09 7d |.fail = |TRUE;..}|
|00002d90| 0a 20 20 20 20 69 66 20 | 28 66 61 69 6c 29 0a 09 |. if |(fail)..|
|00002da0| 7b 0a 09 66 70 72 69 6e | 74 66 28 73 74 64 65 72 |{..fprin|tf(stder|
|00002db0| 72 2c 0a 22 55 70 64 61 | 74 65 20 74 68 65 20 5c |r,."Upda|te the \|
|00002dc0| 22 75 6e 74 69 63 5c 22 | 20 70 72 6f 67 72 61 6d |"untic\"| program|
|00002dd0| 2e 20 20 55 73 65 20 5c | 22 78 78 78 5c 22 20 69 |. Use \|"xxx\" i|
|00002de0| 66 20 6e 65 65 64 65 64 | 2e 20 20 47 6f 6f 64 20 |f needed|. Good |
|00002df0| 6c 75 63 6b 2e 5c 6e 22 | 29 3b 0a 09 72 65 74 75 |luck.\n"|);..retu|
|00002e00| 72 6e 3b 0a 09 7d 0a 0a | 20 20 20 20 2f 2a 20 54 |rn;..}..| /* T|
|00002e10| 69 6d 65 20 74 6f 20 67 | 65 74 20 72 65 61 6c 20 |ime to g|et real |
|00002e20| 69 6e 66 6f 72 6d 61 74 | 69 6f 6e 09 09 09 09 09 |informat|ion.....|
|00002e30| 2a 2f 0a 20 20 20 20 77 | 68 69 6c 65 20 28 28 63 |*/. w|hile ((c|
|00002e40| 68 20 3d 20 67 65 74 63 | 28 66 69 6c 65 29 29 20 |h = getc|(file)) |
|00002e50| 21 3d 20 27 5c 30 27 20 | 26 26 20 63 68 20 21 3d |!= '\0' |&& ch !=|
|00002e60| 20 45 4f 46 29 0a 09 70 | 75 74 63 68 61 72 28 63 | EOF)..p|utchar(c|
|00002e70| 68 29 3b 0a 20 20 20 20 | 70 72 69 6e 74 66 28 22 |h);. |printf("|
|00002e80| 2c 5c 6e 5c 74 22 29 3b | 0a 0a 20 20 20 20 2f 2a |,\n\t");|.. /*|
|00002e90| 20 53 65 6e 64 20 6f 75 | 74 20 74 68 65 20 6e 6f | Send ou|t the no|
|00002ea0| 6e 2d 6e 75 6c 6c 20 62 | 6f 6f 6c 65 61 6e 20 76 |n-null b|oolean v|
|00002eb0| 61 72 69 61 62 6c 65 73 | 09 09 09 09 2a 2f 0a 20 |ariables|....*/. |
|00002ec0| 20 20 20 6c 69 6e 65 5f | 6c 65 6e 20 3d 20 30 3b | line_|len = 0;|
|00002ed0| 0a 20 20 20 20 66 6f 72 | 20 28 69 20 3d 20 30 3b |. for| (i = 0;|
|00002ee0| 20 69 20 3c 20 62 6f 6f | 6c 5f 6c 65 6e 67 74 68 | i < boo|l_length|
|00002ef0| 3b 20 69 2b 2b 29 0a 09 | 7b 0a 09 69 66 20 28 28 |; i++)..|{..if ((|
|00002f00| 63 68 20 3d 20 67 65 74 | 63 28 66 69 6c 65 29 29 |ch = get|c(file))|
|00002f10| 20 21 3d 20 30 29 0a 09 | 20 20 20 20 65 6d 69 74 | != 0)..| emit|
|00002f20| 28 62 6f 6f 6c 65 61 6e | 73 5b 69 5d 29 3b 0a 09 |(boolean|s[i]);..|
|00002f30| 7d 0a 0a 20 20 20 20 2f | 2a 20 54 68 65 20 72 65 |}.. /|* The re|
|00002f40| 73 74 20 6f 66 20 74 68 | 65 20 66 69 6c 65 20 69 |st of th|e file i|
|00002f50| 73 20 6f 6e 20 61 20 31 | 36 20 62 69 74 20 62 6f |s on a 1|6 bit bo|
|00002f60| 75 6e 64 61 72 79 2c 20 | 73 6f 20 61 64 6a 75 73 |undary, |so adjus|
|00002f70| 74 20 74 68 65 20 66 69 | 6c 65 09 2a 2f 0a 20 20 |t the fi|le.*/. |
|00002f80| 20 20 69 66 20 28 28 6e | 61 6d 65 5f 6c 65 6e 67 | if ((n|ame_leng|
|00002f90| 74 68 20 2b 20 62 6f 6f | 6c 5f 6c 65 6e 67 74 68 |th + boo|l_length|
|00002fa0| 29 20 26 20 30 78 30 31 | 29 0a 09 28 76 6f 69 64 |) & 0x01|)..(void|
|00002fb0| 29 67 65 74 63 28 66 69 | 6c 65 29 3b 0a 0a 20 20 |)getc(fi|le);.. |
|00002fc0| 20 20 2f 2a 20 47 65 74 | 20 74 68 65 20 6e 75 6d | /* Get| the num|
|00002fd0| 65 72 69 63 20 76 61 72 | 69 61 62 6c 65 73 09 09 |eric var|iables..|
|00002fe0| 09 09 09 2a 2f 0a 20 20 | 20 20 66 6f 72 20 28 69 |...*/. | for (i|
|00002ff0| 20 3d 20 30 3b 20 69 20 | 3c 20 6e 75 6d 5f 6c 65 | = 0; i |< num_le|
|00003000| 6e 67 74 68 3b 20 69 2b | 2b 29 0a 09 7b 0a 09 69 |ngth; i+|+)..{..i|
|00003010| 66 20 28 28 76 61 6c 20 | 3d 20 67 65 74 32 28 66 |f ((val |= get2(f|
|00003020| 69 6c 65 29 29 20 21 3d | 20 30 78 46 46 46 46 29 |ile)) !=| 0xFFFF)|
|00003030| 0a 09 20 20 20 20 7b 0a | 09 20 20 20 20 28 76 6f |.. {.|. (vo|
|00003040| 69 64 29 73 70 72 69 6e | 74 66 28 63 61 70 61 62 |id)sprin|tf(capab|
|00003050| 69 6c 69 74 79 2c 20 22 | 25 73 23 25 64 22 2c 20 |ility, "|%s#%d", |
|00003060| 6e 75 6d 65 72 69 63 73 | 5b 69 5d 2c 20 76 61 6c |numerics|[i], val|
|00003070| 29 3b 0a 09 20 20 20 20 | 65 6d 69 74 28 63 61 70 |);.. |emit(cap|
|00003080| 61 62 69 6c 69 74 79 29 | 3b 0a 09 20 20 20 20 7d |ability)|;.. }|
|00003090| 0a 09 7d 0a 0a 20 20 20 | 20 2f 2a 20 47 65 74 20 |..}.. | /* Get |
|000030a0| 74 68 65 20 73 74 72 69 | 6e 67 20 76 61 72 69 61 |the stri|ng varia|
|000030b0| 62 6c 65 73 20 6f 66 66 | 73 65 74 73 09 09 09 09 |bles off|sets....|
|000030c0| 09 2a 2f 0a 20 20 20 20 | 66 6f 72 20 28 69 20 3d |.*/. |for (i =|
|000030d0| 20 30 3b 20 69 20 3c 20 | 73 74 72 5f 6c 65 6e 67 | 0; i < |str_leng|
|000030e0| 74 68 3b 20 69 2b 2b 29 | 0a 09 73 74 72 5f 63 61 |th; i++)|..str_ca|
|000030f0| 70 5b 69 5d 20 3d 20 67 | 65 74 32 28 66 69 6c 65 |p[i] = g|et2(file|
|00003100| 29 3b 0a 0a 20 20 20 20 | 2f 2a 20 47 65 74 20 74 |);.. |/* Get t|
|00003110| 68 65 20 73 74 72 69 6e | 67 20 76 61 72 69 61 62 |he strin|g variab|
|00003120| 6c 65 73 20 74 68 65 6d | 73 65 6c 76 65 73 09 09 |les them|selves..|
|00003130| 09 09 2a 2f 0a 20 20 20 | 20 66 6f 72 20 28 69 20 |..*/. | for (i |
|00003140| 3d 20 30 3b 20 69 20 3c | 20 73 5f 6c 65 6e 67 74 |= 0; i <| s_lengt|
|00003150| 68 3b 20 69 2b 2b 29 0a | 09 7b 0a 09 66 6f 72 20 |h; i++).|.{..for |
|00003160| 28 6a 20 3d 20 30 3b 20 | 6a 20 3c 20 73 74 72 5f |(j = 0; |j < str_|
|00003170| 6c 65 6e 67 74 68 3b 20 | 6a 2b 2b 29 09 2f 2a 20 |length; |j++)./* |
|00003180| 46 69 6e 64 20 74 68 65 | 20 6e 61 6d 65 09 2a 2f |Find the| name.*/|
|00003190| 0a 09 20 20 20 20 69 66 | 20 28 73 74 72 5f 63 61 |.. if| (str_ca|
|000031a0| 70 5b 6a 5d 20 3d 3d 20 | 69 29 0a 09 09 62 72 65 |p[j] == |i)...bre|
|000031b0| 61 6b 3b 0a 23 69 66 20 | 44 45 42 55 47 0a 09 69 |ak;.#if |DEBUG..i|
|000031c0| 66 20 28 6a 20 3e 3d 20 | 73 74 72 5f 6c 65 6e 67 |f (j >= |str_leng|
|000031d0| 74 68 29 0a 09 20 20 20 | 20 66 70 72 69 6e 74 66 |th).. | fprintf|
|000031e0| 28 73 74 64 65 72 72 2c | 20 22 43 61 6e 6e 6f 74 |(stderr,| "Cannot|
|000031f0| 20 66 69 6e 64 20 61 64 | 64 72 65 73 73 20 25 64 | find ad|dress %d|
|00003200| 5c 6e 22 2c 20 69 29 3b | 0a 23 65 6e 64 69 66 09 |\n", i);|.#endif.|
|00003210| 09 2f 2a 20 44 45 42 55 | 47 20 2a 2f 0a 09 28 76 |./* DEBU|G */..(v|
|00003220| 6f 69 64 29 73 74 72 63 | 70 79 28 63 61 70 61 62 |oid)strc|py(capab|
|00003230| 69 6c 69 74 79 2c 20 73 | 74 72 69 6e 67 73 5b 6a |ility, s|trings[j|
|00003240| 5d 29 3b 0a 09 63 70 74 | 72 20 3d 20 26 63 61 70 |]);..cpt|r = &cap|
|00003250| 61 62 69 6c 69 74 79 5b | 73 74 72 6c 65 6e 28 63 |ability[|strlen(c|
|00003260| 61 70 61 62 69 6c 69 74 | 79 29 5d 3b 0a 09 2a 63 |apabilit|y)];..*c|
|00003270| 70 74 72 2b 2b 20 3d 20 | 27 3d 27 3b 0a 09 66 6f |ptr++ = |'=';..fo|
|00003280| 72 20 28 3b 20 28 63 68 | 20 3d 20 67 65 74 63 28 |r (; (ch| = getc(|
|00003290| 66 69 6c 65 29 29 20 21 | 3d 20 27 5c 30 27 20 26 |file)) !|= '\0' &|
|000032a0| 26 20 63 68 20 21 3d 20 | 45 4f 46 3b 20 69 2b 2b |& ch != |EOF; i++|
|000032b0| 29 0a 09 20 20 20 20 63 | 70 74 72 20 3d 20 61 64 |).. c|ptr = ad|
|000032c0| 64 63 68 61 72 28 63 70 | 74 72 2c 20 63 68 29 3b |dchar(cp|tr, ch);|
|000032d0| 0a 09 2a 63 70 74 72 20 | 3d 20 27 5c 30 27 3b 0a |..*cptr |= '\0';.|
|000032e0| 09 65 6d 69 74 28 63 61 | 70 61 62 69 6c 69 74 79 |.emit(ca|pability|
|000032f0| 29 3b 0a 09 7d 0a 0a 20 | 20 20 20 70 72 69 6e 74 |);..}.. | print|
|00003300| 66 28 22 5c 6e 5c 6e 22 | 29 3b 0a 20 20 20 20 7d |f("\n\n"|);. }|
|00003310| 0a 0a 0a 2f 2a 0a 20 2a | 20 45 6d 69 74 20 2d 2d |.../*. *| Emit --|
|00003320| 20 45 6d 69 74 20 74 68 | 65 20 73 74 72 69 6e 67 | Emit th|e string|
|00003330| 0a 20 2a 0a 20 2a 20 45 | 6d 69 74 20 74 68 65 20 |. *. * E|mit the |
|00003340| 67 69 76 65 6e 20 73 74 | 72 69 6e 67 2c 20 61 6e |given st|ring, an|
|00003350| 64 20 61 70 70 65 6e 64 | 20 61 20 63 6f 6d 6d 61 |d append| a comma|
|00003360| 2e 20 20 49 66 20 74 68 | 65 20 6c 69 6e 65 20 67 |. If th|e line g|
|00003370| 65 74 73 20 74 6f 6f 20 | 6c 6f 6e 67 2c 0a 20 2a |ets too |long,. *|
|00003380| 20 73 65 6e 64 20 6f 75 | 74 20 61 20 6e 65 77 6c | send ou|t a newl|
|00003390| 69 6e 65 20 61 6e 64 20 | 61 20 74 61 62 2e 0a 20 |ine and |a tab.. |
|000033a0| 2a 2f 0a 65 6d 69 74 28 | 73 74 72 29 0a 20 20 63 |*/.emit(|str). c|
|000033b0| 68 61 72 09 2a 73 74 72 | 3b 09 09 2f 2a 20 53 74 |har.*str|;../* St|
|000033c0| 72 69 6e 67 20 74 6f 20 | 65 6d 69 74 09 09 09 09 |ring to |emit....|
|000033d0| 2a 2f 0a 20 20 20 20 7b | 0a 20 20 20 20 69 66 20 |*/. {|. if |
|000033e0| 28 28 6c 69 6e 65 5f 6c | 65 6e 20 2b 3d 20 73 74 |((line_l|en += st|
|000033f0| 72 6c 65 6e 28 73 74 72 | 29 20 2b 20 32 29 20 3e |rlen(str|) + 2) >|
|00003400| 20 4d 41 58 4c 49 4e 45 | 29 0a 09 7b 0a 09 6c 69 | MAXLINE|)..{..li|
|00003410| 6e 65 5f 6c 65 6e 20 3d | 20 73 74 72 6c 65 6e 28 |ne_len =| strlen(|
|00003420| 73 74 72 29 20 2b 20 32 | 3b 0a 09 70 72 69 6e 74 |str) + 2|;..print|
|00003430| 66 28 22 5c 6e 5c 74 22 | 29 3b 0a 09 7d 0a 20 20 |f("\n\t"|);..}. |
|00003440| 20 20 70 72 69 6e 74 66 | 28 22 25 73 2c 20 22 2c | printf|("%s, ",|
|00003450| 20 73 74 72 29 3b 0a 20 | 20 20 20 7d 0a 0a 0a 2f | str);. | }.../|
|00003460| 2a 0a 20 2a 20 47 65 74 | 32 20 2d 2d 20 47 65 74 |*. * Get|2 -- Get|
|00003470| 20 61 20 74 77 6f 20 62 | 79 74 65 20 6e 75 6d 62 | a two b|yte numb|
|00003480| 65 72 0a 20 2a 2f 0a 67 | 65 74 32 28 66 69 6c 65 |er. */.g|et2(file|
|00003490| 29 0a 20 20 46 49 4c 45 | 20 2a 66 69 6c 65 3b 09 |). FILE| *file;.|
|000034a0| 09 2f 2a 20 54 68 65 20 | 66 69 6c 65 20 77 69 74 |./* The |file wit|
|000034b0| 68 20 74 68 65 20 63 6f | 6d 70 69 6c 65 64 20 69 |h the co|mpiled i|
|000034c0| 6e 66 6f 72 6d 61 74 69 | 6f 6e 09 2a 2f 0a 20 20 |nformati|on.*/. |
|000034d0| 20 20 7b 0a 20 20 20 20 | 73 68 6f 72 74 20 74 65 | {. |short te|
|000034e0| 6d 70 3b 0a 0a 20 20 20 | 20 74 65 6d 70 20 3d 20 |mp;.. | temp = |
|000034f0| 67 65 74 63 28 66 69 6c | 65 29 20 26 20 30 78 46 |getc(fil|e) & 0xF|
|00003500| 46 3b 0a 20 20 20 20 72 | 65 74 75 72 6e 20 28 74 |F;. r|eturn (t|
|00003510| 65 6d 70 20 2b 20 28 67 | 65 74 63 28 66 69 6c 65 |emp + (g|etc(file|
|00003520| 29 20 3c 3c 20 38 29 29 | 3b 0a 20 20 20 20 7d 0a |) << 8))|;. }.|
|00003530| 0a 0a 23 69 66 64 65 66 | 20 43 50 4d 0a 63 68 64 |..#ifdef| CPM.chd|
|00003540| 69 72 28 73 74 72 29 0a | 20 20 63 68 61 72 09 2a |ir(str).| char.*|
|00003550| 73 74 72 3b 0a 20 20 20 | 20 7b 0a 20 20 20 20 7d |str;. | {. }|
|00003560| 0a 0a 70 65 72 72 6f 72 | 28 73 74 72 29 0a 20 20 |..perror|(str). |
|00003570| 63 68 61 72 09 2a 73 74 | 72 3b 0a 20 20 20 20 7b |char.*st|r;. {|
|00003580| 0a 20 20 20 20 66 70 72 | 69 6e 74 66 28 73 74 64 |. fpr|intf(std|
|00003590| 65 72 72 2c 20 22 43 61 | 6e 6e 6f 74 20 6f 70 65 |err, "Ca|nnot ope|
|000035a0| 6e 20 5c 22 25 73 5c 22 | 5c 6e 22 2c 20 73 74 72 |n \"%s\"|\n", str|
|000035b0| 29 3b 0a 20 20 20 20 7d | 0a 23 65 6e 64 69 66 09 |);. }|.#endif.|
|000035c0| 09 2f 2a 20 43 50 4d 20 | 2a 2f 0a 53 48 41 52 5f |./* CPM |*/.SHAR_|
|000035d0| 45 4f 46 0a 66 69 20 23 | 20 65 6e 64 20 6f 66 20 |EOF.fi #| end of |
|000035e0| 6f 76 65 72 77 72 69 74 | 69 6e 67 20 63 68 65 63 |overwrit|ing chec|
|000035f0| 6b 0a 23 09 45 6e 64 20 | 6f 66 20 73 68 65 6c 6c |k.#.End |of shell|
|00003600| 20 61 72 63 68 69 76 65 | 0a 65 78 69 74 20 30 0a | archive|.exit 0.|
|00003610| 0a | |. | |
+--------+-------------------------+-------------------------+--------+--------+