home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume7 / nstrings.bsd < prev    next >
SHell self-extracting ARchive  |  1989-06-03  |  54.5 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


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

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert SHell self-extracting ARchive (archive/shar) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file 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 63 6f 6d 70 |Newsgrou|ps: comp|
|00000010| 2e 73 6f 75 72 63 65 73 | 2e 6d 69 73 63 0a 46 72 |.sources|.misc.Fr|
|00000020| 6f 6d 3a 20 61 6c 6c 62 | 65 72 79 40 75 75 6e 65 |om: allb|ery@uune|
|00000030| 74 2e 55 55 2e 4e 45 54 | 20 28 42 72 61 6e 64 6f |t.UU.NET| (Brando|
|00000040| 6e 20 53 2e 20 41 6c 6c | 62 65 72 79 20 2d 20 63 |n S. All|bery - c|
|00000050| 6f 6d 70 2e 73 6f 75 72 | 63 65 73 2e 6d 69 73 63 |omp.sour|ces.misc|
|00000060| 29 0a 53 75 62 6a 65 63 | 74 3a 20 76 30 37 69 30 |).Subjec|t: v07i0|
|00000070| 31 32 3a 20 53 6f 75 72 | 63 65 20 6f 66 20 73 74 |12: Sour|ce of st|
|00000080| 72 69 6e 67 73 2c 20 61 | 20 72 65 70 6c 61 63 65 |rings, a| replace|
|00000090| 6d 65 6e 74 20 66 6f 72 | 20 74 68 65 20 42 53 44 |ment for| the BSD|
|000000a0| 20 63 6f 6d 6d 61 6e 64 | 20 6f 66 20 74 68 65 20 | command| of the |
|000000b0| 73 61 6d 65 20 6e 61 6d | 65 2e 0a 52 65 70 6c 79 |same nam|e..Reply|
|000000c0| 2d 54 6f 3a 20 67 72 65 | 69 6d 40 73 62 73 76 61 |-To: gre|im@sbsva|
|000000d0| 78 2e 69 6e 66 6f 72 6d | 61 74 69 6b 2e 75 6e 69 |x.inform|atik.uni|
|000000e0| 2d 73 61 61 72 6c 61 6e | 64 2e 64 62 70 2e 64 65 |-saarlan|d.dbp.de|
|000000f0| 20 28 4d 69 63 68 61 65 | 6c 20 47 72 65 69 6d 29 | (Michae|l Greim)|
|00000100| 0a 0a 50 6f 73 74 69 6e | 67 2d 6e 75 6d 62 65 72 |..Postin|g-number|
|00000110| 3a 20 56 6f 6c 75 6d 65 | 20 37 2c 20 49 73 73 75 |: Volume| 7, Issu|
|00000120| 65 20 31 32 0a 53 75 62 | 6d 69 74 74 65 64 2d 62 |e 12.Sub|mitted-b|
|00000130| 79 3a 20 67 72 65 69 6d | 40 73 62 73 76 61 78 2e |y: greim|@sbsvax.|
|00000140| 69 6e 66 6f 72 6d 61 74 | 69 6b 2e 75 6e 69 2d 73 |informat|ik.uni-s|
|00000150| 61 61 72 6c 61 6e 64 2e | 64 62 70 2e 64 65 20 28 |aarland.|dbp.de (|
|00000160| 4d 69 63 68 61 65 6c 20 | 47 72 65 69 6d 29 0a 41 |Michael |Greim).A|
|00000170| 72 63 68 69 76 65 2d 6e | 61 6d 65 3a 20 6e 73 74 |rchive-n|ame: nst|
|00000180| 72 69 6e 67 73 2e 62 73 | 64 0a 0a 5b 41 6e 79 6f |rings.bs|d..[Anyo|
|00000190| 6e 65 20 77 61 6e 74 20 | 74 6f 20 76 6f 6c 75 6e |ne want |to volun|
|000001a0| 74 65 65 72 20 74 6f 20 | 63 6f 6e 76 65 72 74 20 |teer to |convert |
|000001b0| 74 68 69 73 20 66 6f 72 | 20 43 4f 46 46 3f 20 20 |this for| COFF? |
|000001c0| 2b 2b 62 73 61 5d 0a 0a | 48 65 72 65 20 69 73 20 |++bsa]..|Here is |
|000001d0| 73 74 72 69 6e 67 73 2c | 20 61 20 72 65 70 6c 61 |strings,| a repla|
|000001e0| 63 65 6d 65 6e 74 20 66 | 6f 72 20 74 68 65 20 42 |cement f|or the B|
|000001f0| 53 44 20 70 72 6f 67 72 | 61 6d 20 6f 66 20 74 68 |SD progr|am of th|
|00000200| 65 20 73 61 6d 65 20 6e | 61 6d 65 2c 0a 66 6f 72 |e same n|ame,.for|
|00000210| 20 64 69 73 74 72 69 62 | 75 74 69 6f 6e 20 69 6e | distrib|ution in|
|00000220| 20 63 6f 6d 70 2e 73 6f | 75 72 63 65 73 2e 6d 69 | comp.so|urces.mi|
|00000230| 73 63 2e 0a 0a 49 20 77 | 72 6f 74 65 20 74 68 69 |sc...I w|rote thi|
|00000240| 73 20 62 65 63 61 75 73 | 65 20 49 20 62 65 63 61 |s becaus|e I beca|
|00000250| 6d 65 20 61 6e 6e 6f 79 | 65 64 20 62 79 20 0a 2d |me annoy|ed by .-|
|00000260| 20 6f 6c 64 20 73 74 72 | 69 6e 67 73 20 69 73 20 | old str|ings is |
|00000270| 73 6c 6f 77 0a 2d 20 6f | 6c 64 20 73 74 72 69 6e |slow.- o|ld strin|
|00000280| 67 73 20 69 73 20 6e 6f | 74 20 63 6f 72 72 65 63 |gs is no|t correc|
|00000290| 74 2e 20 49 74 20 74 68 | 69 6e 6b 73 20 5e 4c 20 |t. It th|inks ^L |
|000002a0| 61 6e 64 20 73 6f 6d 65 | 74 69 6d 65 73 20 65 76 |and some|times ev|
|000002b0| 65 6e 20 30 78 38 30 20 | 74 6f 20 62 65 0a 20 20 |en 0x80 |to be. |
|000002c0| 70 72 69 6e 74 61 62 6c | 65 2e 20 28 53 65 65 20 |printabl|e. (See |
|000002d0| 52 45 41 44 4d 45 20 66 | 6f 72 20 6d 6f 72 65 20 |README f|or more |
|000002e0| 64 65 74 61 69 6c 73 29 | 0a 5b 41 6d 65 6e 20 74 |details)|.[Amen t|
|000002f0| 6f 20 74 68 61 74 21 20 | 20 2b 2b 62 73 61 5d 0a |o that! | ++bsa].|
|00000300| 2d 20 6f 6c 64 20 73 74 | 72 69 6e 67 73 20 68 61 |- old st|rings ha|
|00000310| 73 20 74 72 6f 75 62 6c | 65 20 77 69 74 68 20 74 |s troubl|e with t|
|00000320| 68 65 20 73 65 67 6d 65 | 6e 74 20 6f 66 20 69 6e |he segme|nt of in|
|00000330| 69 74 69 61 6c 69 7a 65 | 64 20 64 61 74 61 20 6f |itialize|d data o|
|00000340| 6e 20 73 6f 6d 65 0a 20 | 20 73 79 73 74 65 6d 73 |n some. | systems|
|00000350| 0a 2d 20 6f 6e 20 73 6f | 6d 65 20 73 79 73 74 65 |.- on so|me syste|
|00000360| 6d 73 20 74 68 65 72 65 | 20 69 73 20 73 74 72 69 |ms there| is stri|
|00000370| 6e 67 73 2c 20 6f 6e 20 | 73 6f 6d 65 20 74 68 65 |ngs, on |some the|
|00000380| 72 65 20 69 73 6e 27 74 | 0a 0a 49 74 20 69 73 20 |re isn't|..It is |
|00000390| 6e 6f 74 20 6f 6e 6c 79 | 20 66 6f 72 20 55 4e 49 |not only| for UNI|
|000003a0| 58 20 73 79 73 74 65 6d | 73 2c 20 62 75 74 20 49 |X system|s, but I|
|000003b0| 20 68 61 76 65 20 6f 6e | 6c 79 20 74 72 69 65 64 | have on|ly tried|
|000003c0| 20 69 74 20 6f 6e 20 55 | 4e 49 58 20 61 6e 64 0a | it on U|NIX and.|
|000003d0| 56 4d 53 20 73 6f 20 66 | 61 72 2e 0a 0a 41 62 73 |VMS so f|ar...Abs|
|000003e0| 6f 72 62 2c 20 61 70 70 | 6c 79 20 61 6e 64 20 65 |orb, app|ly and e|
|000003f0| 6e 6a 6f 79 2c 0a 09 2d | 6d 67 0a 0a 2d 2d 0a 4d |njoy,..-|mg..--.M|
|00000400| 69 63 68 61 65 6c 20 47 | 72 65 69 6d 20 20 20 20 |ichael G|reim |
|00000410| 45 6d 61 69 6c 20 3a 20 | 67 72 65 69 6d 40 73 62 |Email : |greim@sb|
|00000420| 73 76 61 78 2e 69 6e 66 | 6f 72 6d 61 74 69 6b 2e |svax.inf|ormatik.|
|00000430| 75 6e 69 2d 73 61 61 72 | 6c 61 6e 64 2e 64 62 70 |uni-saar|land.dbp|
|00000440| 2e 64 65 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |.de. | |
|00000450| 20 20 20 20 20 6f 72 20 | 20 20 20 3a 20 2e 2e 2e | or | : ...|
|00000460| 21 75 75 6e 65 74 21 75 | 6e 69 64 6f 21 73 62 73 |!uunet!u|nido!sbs|
|00000470| 76 61 78 21 67 72 65 69 | 6d 0a 0a 23 21 20 2f 62 |vax!grei|m..#! /b|
|00000480| 69 6e 2f 73 68 0a 23 20 | 54 68 69 73 20 69 73 20 |in/sh.# |This is |
|00000490| 61 20 73 68 65 6c 6c 20 | 61 72 63 68 69 76 65 2e |a shell |archive.|
|000004a0| 20 20 52 65 6d 6f 76 65 | 20 61 6e 79 74 68 69 6e | Remove| anythin|
|000004b0| 67 20 62 65 66 6f 72 65 | 20 74 68 69 73 20 6c 69 |g before| this li|
|000004c0| 6e 65 2c 20 74 68 65 6e | 20 75 6e 70 61 63 6b 0a |ne, then| unpack.|
|000004d0| 23 20 69 74 20 62 79 20 | 73 61 76 69 6e 67 20 69 |# it by |saving i|
|000004e0| 74 20 69 6e 74 6f 20 61 | 20 66 69 6c 65 20 61 6e |t into a| file an|
|000004f0| 64 20 74 79 70 69 6e 67 | 20 22 73 68 20 66 69 6c |d typing| "sh fil|
|00000500| 65 22 2e 20 20 54 6f 20 | 6f 76 65 72 77 72 69 74 |e". To |overwrit|
|00000510| 65 20 65 78 69 73 74 69 | 6e 67 0a 23 20 66 69 6c |e existi|ng.# fil|
|00000520| 65 73 2c 20 74 79 70 65 | 20 22 73 68 20 66 69 6c |es, type| "sh fil|
|00000530| 65 20 2d 63 22 2e 20 20 | 59 6f 75 20 63 61 6e 20 |e -c". |You can |
|00000540| 61 6c 73 6f 20 66 65 65 | 64 20 74 68 69 73 20 61 |also fee|d this a|
|00000550| 73 20 73 74 61 6e 64 61 | 72 64 20 69 6e 70 75 74 |s standa|rd input|
|00000560| 20 76 69 61 0a 23 20 75 | 6e 73 68 61 72 2c 20 6f | via.# u|nshar, o|
|00000570| 72 20 62 79 20 74 79 70 | 69 6e 67 20 22 73 68 20 |r by typ|ing "sh |
|00000580| 3c 66 69 6c 65 22 2c 20 | 65 2e 67 2e 2e 20 20 49 |<file", |e.g.. I|
|00000590| 66 20 74 68 69 73 20 61 | 72 63 68 69 76 65 20 69 |f this a|rchive i|
|000005a0| 73 20 63 6f 6d 70 6c 65 | 74 65 2c 20 79 6f 75 0a |s comple|te, you.|
|000005b0| 23 20 77 69 6c 6c 20 73 | 65 65 20 74 68 65 20 66 |# will s|ee the f|
|000005c0| 6f 6c 6c 6f 77 69 6e 67 | 20 6d 65 73 73 61 67 65 |ollowing| message|
|000005d0| 20 61 74 20 74 68 65 20 | 65 6e 64 3a 0a 23 09 09 | at the |end:.#..|
|000005e0| 22 45 6e 64 20 6f 66 20 | 61 72 63 68 69 76 65 20 |"End of |archive |
|000005f0| 31 20 28 6f 66 20 31 29 | 2e 22 0a 23 20 43 6f 6e |1 (of 1)|.".# Con|
|00000600| 74 65 6e 74 73 3a 20 20 | 43 4f 50 59 49 4e 47 20 |tents: |COPYING |
|00000610| 4d 41 4e 49 46 45 53 54 | 20 4d 61 6b 65 66 69 6c |MANIFEST| Makefil|
|00000620| 65 20 52 45 41 44 4d 45 | 20 63 6f 6e 66 69 67 2e |e README| config.|
|00000630| 68 20 6c 69 6d 69 74 73 | 2e 63 0a 23 20 20 20 6f |h limits|.c.# o|
|00000640| 75 74 70 75 74 2e 63 20 | 73 74 72 69 6e 67 73 2e |utput.c |strings.|
|00000650| 31 20 73 74 72 69 6e 67 | 73 2e 63 20 73 74 72 69 |1 string|s.c stri|
|00000660| 6e 67 73 2e 68 20 73 74 | 72 69 6e 67 73 2e 74 78 |ngs.h st|rings.tx|
|00000670| 74 20 74 65 73 74 5f 69 | 6e 70 75 74 0a 23 20 20 |t test_i|nput.# |
|00000680| 20 74 75 6e 65 2e 68 0a | 23 20 57 72 61 70 70 65 | tune.h.|# Wrappe|
|00000690| 64 20 62 79 20 67 72 65 | 69 6d 40 73 62 73 76 61 |d by gre|im@sbsva|
|000006a0| 78 20 6f 6e 20 54 75 65 | 20 4d 61 79 20 32 33 20 |x on Tue| May 23 |
|000006b0| 31 38 3a 31 33 3a 31 35 | 20 31 39 38 39 0a 50 41 |18:13:15| 1989.PA|
|000006c0| 54 48 3d 2f 62 69 6e 3a | 2f 75 73 72 2f 62 69 6e |TH=/bin:|/usr/bin|
|000006d0| 3a 2f 75 73 72 2f 75 63 | 62 20 3b 20 65 78 70 6f |:/usr/uc|b ; expo|
|000006e0| 72 74 20 50 41 54 48 0a | 69 66 20 74 65 73 74 20 |rt PATH.|if test |
|000006f0| 2d 66 20 27 43 4f 50 59 | 49 4e 47 27 20 2d 61 20 |-f 'COPY|ING' -a |
|00000700| 22 24 7b 31 7d 22 20 21 | 3d 20 22 2d 63 22 20 3b |"${1}" !|= "-c" ;|
|00000710| 20 74 68 65 6e 20 0a 20 | 20 65 63 68 6f 20 73 68 | then . | echo sh|
|00000720| 61 72 3a 20 57 69 6c 6c | 20 6e 6f 74 20 63 6c 6f |ar: Will| not clo|
|00000730| 62 62 65 72 20 65 78 69 | 73 74 69 6e 67 20 66 69 |bber exi|sting fi|
|00000740| 6c 65 20 5c 22 27 43 4f | 50 59 49 4e 47 27 5c 22 |le \"'CO|PYING'\"|
|00000750| 0a 65 6c 73 65 0a 65 63 | 68 6f 20 73 68 61 72 3a |.else.ec|ho shar:|
|00000760| 20 45 78 74 72 61 63 74 | 69 6e 67 20 5c 22 27 43 | Extract|ing \"'C|
|00000770| 4f 50 59 49 4e 47 27 5c | 22 20 5c 28 31 32 36 38 |OPYING'\|" \(1268|
|00000780| 20 63 68 61 72 61 63 74 | 65 72 73 5c 29 0a 73 65 | charact|ers\).se|
|00000790| 64 20 22 73 2f 5e 58 2f | 2f 22 20 3e 27 43 4f 50 |d "s/^X/|/" >'COP|
|000007a0| 59 49 4e 47 27 20 3c 3c | 27 45 4e 44 5f 4f 46 5f |YING' <<|'END_OF_|
|000007b0| 46 49 4c 45 27 0a 58 0a | 58 09 73 74 72 69 6e 67 |FILE'.X.|X.string|
|000007c0| 73 0a 58 0a 58 09 28 43 | 29 20 43 6f 70 79 72 69 |s.X.X.(C|) Copyri|
|000007d0| 67 68 74 20 62 79 20 4d | 69 63 68 61 65 6c 20 47 |ght by M|ichael G|
|000007e0| 72 65 69 6d 2c 20 35 2f | 32 33 2f 38 39 0a 58 0a |reim, 5/|23/89.X.|
|000007f0| 58 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |X-------|--------|
|00000800| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000810| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000820| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 0a 58 |--------|------.X|
|00000830| 0a 58 54 68 65 20 61 75 | 74 68 6f 72 2c 20 4d 69 |.XThe au|thor, Mi|
|00000840| 63 68 61 65 6c 20 47 72 | 65 69 6d 2c 20 61 6c 6c |chael Gr|eim, all|
|00000850| 6f 77 73 20 61 6e 79 6f | 6e 65 20 74 6f 20 64 6f |ows anyo|ne to do|
|00000860| 20 61 6e 79 74 68 69 6e | 67 20 68 65 2f 73 68 65 | anythin|g he/she|
|00000870| 2f 69 74 20 77 61 6e 74 | 73 20 77 69 74 68 0a 58 |/it want|s with.X|
|00000880| 22 73 74 72 69 6e 67 73 | 22 2c 20 70 72 6f 76 69 |"strings|", provi|
|00000890| 64 65 64 20 74 68 65 20 | 66 6f 6c 6c 6f 77 69 6e |ded the |followin|
|000008a0| 67 20 63 6f 6e 64 69 74 | 69 6f 6e 73 20 61 72 65 |g condit|ions are|
|000008b0| 20 6d 65 74 3a 0a 58 0a | 58 2d 20 74 68 65 20 70 | met:.X.|X- the p|
|000008c0| 72 6f 67 72 61 6d 20 6d | 61 79 20 6e 6f 74 20 62 |rogram m|ay not b|
|000008d0| 65 20 73 6f 6c 64 20 77 | 69 74 68 6f 75 74 20 74 |e sold w|ithout t|
|000008e0| 68 65 20 61 75 74 68 6f | 72 73 20 77 72 69 74 74 |he autho|rs writt|
|000008f0| 65 6e 20 70 65 72 6d 69 | 73 73 69 6f 6e 0a 58 2d |en permi|ssion.X-|
|00000900| 20 74 68 69 73 20 6e 6f | 74 69 63 65 20 73 74 61 | this no|tice sta|
|00000910| 79 73 20 69 6e 20 70 6c | 61 63 65 0a 58 2d 20 61 |ys in pl|ace.X- a|
|00000920| 6e 79 20 63 68 61 6e 67 | 65 73 20 74 6f 20 74 68 |ny chang|es to th|
|00000930| 65 20 6f 72 69 67 69 6e | 61 6c 20 61 72 65 20 6d |e origin|al are m|
|00000940| 61 72 6b 65 64 20 61 73 | 20 73 75 63 68 0a 58 0a |arked as| such.X.|
|00000950| 58 0a 58 54 68 65 20 61 | 75 74 68 6f 72 20 65 78 |X.XThe a|uthor ex|
|00000960| 70 6c 69 63 69 74 6c 79 | 20 61 73 6b 73 20 61 6e |plicitly| asks an|
|00000970| 79 62 6f 64 79 20 3a 0a | 58 0a 58 2d 20 74 6f 20 |ybody :.|X.X- to |
|00000980| 70 6f 72 74 20 74 68 69 | 73 20 70 72 6f 67 72 61 |port thi|s progra|
|00000990| 6d 20 74 6f 20 61 73 20 | 6d 75 63 68 20 63 6f 6d |m to as |much com|
|000009a0| 70 75 74 65 72 20 73 79 | 73 74 65 6d 73 20 61 73 |puter sy|stems as|
|000009b0| 20 70 6f 73 73 69 62 6c | 65 20 61 6e 64 20 73 65 | possibl|e and se|
|000009c0| 6e 64 0a 58 20 20 68 69 | 6d 20 63 6f 6d 70 6c 61 |nd.X hi|m compla|
|000009d0| 69 6e 74 73 2c 20 72 65 | 73 75 6c 74 73 2c 20 62 |ints, re|sults, b|
|000009e0| 75 67 20 66 69 78 65 73 | 2c 20 70 72 61 69 73 65 |ug fixes|, praise|
|000009f0| 20 2e 2e 2e 0a 58 2d 20 | 74 6f 20 69 6e 63 6f 72 | ....X- |to incor|
|00000a00| 70 6f 72 61 74 65 20 74 | 68 69 73 20 70 72 6f 67 |porate t|his prog|
|00000a10| 72 61 6d 20 69 6e 20 61 | 6e 79 20 70 61 63 6b 61 |ram in a|ny packa|
|00000a20| 67 65 20 6f 66 20 50 75 | 62 6c 69 63 20 44 6f 6d |ge of Pu|blic Dom|
|00000a30| 61 69 6e 20 70 72 6f 67 | 72 61 6d 73 20 66 6f 72 |ain prog|rams for|
|00000a40| 0a 58 20 20 66 72 65 65 | 20 64 69 73 74 72 69 62 |.X free| distrib|
|00000a50| 75 74 69 6f 6e 20 28 47 | 4e 55 20 77 6f 75 6c 64 |ution (G|NU would|
|00000a60| 20 62 65 20 77 65 6c 63 | 6f 6d 65 29 0a 58 0a 58 | be welc|ome).X.X|
|00000a70| 0a 58 54 68 65 72 65 20 | 69 73 20 6e 6f 20 77 61 |.XThere |is no wa|
|00000a80| 72 72 61 6e 74 79 20 6f | 66 20 6d 65 72 63 68 61 |rranty o|f mercha|
|00000a90| 6e 74 61 62 69 6c 69 74 | 79 20 6e 6f 72 20 61 6e |ntabilit|y nor an|
|00000aa0| 79 20 77 61 72 72 61 6e | 74 79 20 6f 66 20 66 69 |y warran|ty of fi|
|00000ab0| 74 6e 65 73 73 20 66 6f | 72 20 61 0a 58 70 61 72 |tness fo|r a.Xpar|
|00000ac0| 74 69 63 75 6c 61 72 20 | 70 75 72 70 6f 73 65 20 |ticular |purpose |
|00000ad0| 6e 6f 72 20 61 6e 79 20 | 6f 74 68 65 72 20 77 61 |nor any |other wa|
|00000ae0| 72 72 61 6e 74 79 2c 20 | 65 69 74 68 65 72 20 65 |rranty, |either e|
|00000af0| 78 70 72 65 73 73 20 6f | 72 20 69 6d 70 6c 69 65 |xpress o|r implie|
|00000b00| 64 2c 20 61 73 0a 58 74 | 6f 20 74 68 65 20 61 63 |d, as.Xt|o the ac|
|00000b10| 63 75 72 61 63 79 20 6f | 66 20 74 68 65 20 68 65 |curacy o|f the he|
|00000b20| 72 65 77 69 74 68 20 70 | 75 62 6c 69 73 68 65 64 |rewith p|ublished|
|00000b30| 20 70 72 6f 67 72 61 6d | 2c 20 6f 72 20 61 73 20 | program|, or as |
|00000b40| 74 6f 20 69 74 73 0a 58 | 73 75 69 74 61 62 69 6c |to its.X|suitabil|
|00000b50| 69 74 79 20 66 6f 72 20 | 61 6e 79 20 70 61 72 74 |ity for |any part|
|00000b60| 69 63 75 6c 61 72 20 70 | 75 72 70 6f 73 65 2e 0a |icular p|urpose..|
|00000b70| 58 41 63 63 6f 72 64 69 | 6e 67 6c 79 2c 20 49 2c |XAccordi|ngly, I,|
|00000b80| 20 4d 69 63 68 61 65 6c | 20 47 72 65 69 6d 2c 20 | Michael| Greim, |
|00000b90| 61 73 73 75 6d 65 20 6e | 6f 20 72 65 73 70 6f 6e |assume n|o respon|
|00000ba0| 73 69 62 69 6c 69 74 79 | 0a 58 66 6f 72 20 69 74 |sibility|.Xfor it|
|00000bb0| 73 20 75 73 65 20 62 79 | 20 74 68 65 20 72 65 63 |s use by| the rec|
|00000bc0| 69 70 69 65 6e 74 2e 20 | 46 75 72 74 68 65 72 2c |ipient. |Further,|
|00000bd0| 20 49 2c 20 4d 69 63 68 | 61 65 6c 20 47 72 65 69 | I, Mich|ael Grei|
|00000be0| 6d 2c 20 61 73 73 75 6d | 65 20 6e 6f 0a 58 6f 62 |m, assum|e no.Xob|
|00000bf0| 6c 69 67 61 74 69 6f 6e | 20 74 6f 20 66 75 72 6e |ligation| to furn|
|00000c00| 69 73 68 20 61 6e 79 20 | 61 73 73 69 73 74 61 6e |ish any |assistan|
|00000c10| 63 65 20 6f 66 20 61 6e | 79 20 6b 69 6e 64 20 77 |ce of an|y kind w|
|00000c20| 68 61 74 73 6f 65 76 65 | 72 2c 0a 58 6f 72 20 74 |hatsoeve|r,.Xor t|
|00000c30| 6f 20 66 75 72 6e 69 73 | 68 20 61 6e 79 20 61 64 |o furnis|h any ad|
|00000c40| 64 69 74 69 6f 6e 61 6c | 20 69 6e 66 6f 72 6d 61 |ditional| informa|
|00000c50| 74 69 6f 6e 20 6f 72 20 | 64 6f 63 75 6d 65 6e 74 |tion or |document|
|00000c60| 61 74 69 6f 6e 2e 0a 58 | 0a 58 28 42 75 74 20 69 |ation..X|.X(But i|
|00000c70| 66 20 79 6f 75 20 61 73 | 6b 20 6d 65 20 6e 69 63 |f you as|k me nic|
|00000c80| 65 2c 20 49 20 6d 69 67 | 68 74 20 63 6f 6e 73 69 |e, I mig|ht consi|
|00000c90| 64 65 72 20 74 6f 20 74 | 68 69 6e 6b 20 61 62 6f |der to t|hink abo|
|00000ca0| 75 74 20 73 74 61 72 74 | 69 6e 67 20 74 6f 0a 58 |ut start|ing to.X|
|00000cb0| 20 73 70 65 63 75 6c 61 | 74 65 20 61 62 6f 75 74 | specula|te about|
|00000cc0| 20 69 74 20 2e 2e 2e 20 | 3a 2d 29 0a 45 4e 44 5f | it ... |:-).END_|
|00000cd0| 4f 46 5f 46 49 4c 45 0a | 69 66 20 74 65 73 74 20 |OF_FILE.|if test |
|00000ce0| 31 32 36 38 20 2d 6e 65 | 20 60 77 63 20 2d 63 20 |1268 -ne| `wc -c |
|00000cf0| 3c 27 43 4f 50 59 49 4e | 47 27 60 3b 20 74 68 65 |<'COPYIN|G'`; the|
|00000d00| 6e 0a 20 20 20 20 65 63 | 68 6f 20 73 68 61 72 3a |n. ec|ho shar:|
|00000d10| 20 5c 22 27 43 4f 50 59 | 49 4e 47 27 5c 22 20 75 | \"'COPY|ING'\" u|
|00000d20| 6e 70 61 63 6b 65 64 20 | 77 69 74 68 20 77 72 6f |npacked |with wro|
|00000d30| 6e 67 20 73 69 7a 65 21 | 0a 66 69 0a 23 20 65 6e |ng size!|.fi.# en|
|00000d40| 64 20 6f 66 20 27 43 4f | 50 59 49 4e 47 27 0a 66 |d of 'CO|PYING'.f|
|00000d50| 69 0a 69 66 20 74 65 73 | 74 20 2d 66 20 27 4d 41 |i.if tes|t -f 'MA|
|00000d60| 4e 49 46 45 53 54 27 20 | 2d 61 20 22 24 7b 31 7d |NIFEST' |-a "${1}|
|00000d70| 22 20 21 3d 20 22 2d 63 | 22 20 3b 20 74 68 65 6e |" != "-c|" ; then|
|00000d80| 20 0a 20 20 65 63 68 6f | 20 73 68 61 72 3a 20 57 | . echo| shar: W|
|00000d90| 69 6c 6c 20 6e 6f 74 20 | 63 6c 6f 62 62 65 72 20 |ill not |clobber |
|00000da0| 65 78 69 73 74 69 6e 67 | 20 66 69 6c 65 20 5c 22 |existing| file \"|
|00000db0| 27 4d 41 4e 49 46 45 53 | 54 27 5c 22 0a 65 6c 73 |'MANIFES|T'\".els|
|00000dc0| 65 0a 65 63 68 6f 20 73 | 68 61 72 3a 20 45 78 74 |e.echo s|har: Ext|
|00000dd0| 72 61 63 74 69 6e 67 20 | 5c 22 27 4d 41 4e 49 46 |racting |\"'MANIF|
|00000de0| 45 53 54 27 5c 22 20 5c | 28 38 33 30 20 63 68 61 |EST'\" \|(830 cha|
|00000df0| 72 61 63 74 65 72 73 5c | 29 0a 73 65 64 20 22 73 |racters\|).sed "s|
|00000e00| 2f 5e 58 2f 2f 22 20 3e | 27 4d 41 4e 49 46 45 53 |/^X//" >|'MANIFES|
|00000e10| 54 27 20 3c 3c 27 45 4e | 44 5f 4f 46 5f 46 49 4c |T' <<'EN|D_OF_FIL|
|00000e20| 45 27 0a 58 20 20 20 46 | 69 6c 65 20 4e 61 6d 65 |E'.X F|ile Name|
|00000e30| 09 09 41 72 63 68 69 76 | 65 20 23 09 44 65 73 63 |..Archiv|e #.Desc|
|00000e40| 72 69 70 74 69 6f 6e 0a | 58 2d 2d 2d 2d 2d 2d 2d |ription.|X-------|
|00000e50| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000e60| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000e70| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000e80| 2d 2d 2d 2d 0a 58 20 43 | 4f 50 59 49 4e 47 20 20 |----.X C|OPYING |
|00000e90| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000ea0| 20 20 31 09 43 6f 70 79 | 72 69 67 68 74 20 4e 6f | 1.Copy|right No|
|00000eb0| 74 69 63 65 2e 0a 58 20 | 4d 41 4e 49 46 45 53 54 |tice..X |MANIFEST|
|00000ec0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000ed0| 20 20 20 31 09 54 68 69 | 73 20 73 68 69 70 70 69 | 1.Thi|s shippi|
|00000ee0| 6e 67 20 6c 69 73 74 0a | 58 20 4d 61 6b 65 66 69 |ng list.|X Makefi|
|00000ef0| 6c 65 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |le | |
|00000f00| 20 20 20 20 20 31 09 0a | 58 20 52 45 41 44 4d 45 | 1..|X README|
|00000f10| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000f20| 20 20 20 20 20 31 09 57 | 68 61 74 20 69 73 20 73 | 1.W|hat is s|
|00000f30| 74 72 69 6e 67 73 20 3f | 20 48 6f 77 20 74 6f 20 |trings ?| How to |
|00000f40| 70 6f 72 74 20 69 74 2e | 20 0a 58 20 63 6f 6e 66 |port it.| .X conf|
|00000f50| 69 67 2e 68 20 20 20 20 | 20 20 20 20 20 20 20 20 |ig.h | |
|00000f60| 20 20 20 20 20 20 20 31 | 09 44 65 66 61 75 6c 74 | 1|.Default|
|00000f70| 20 70 61 72 61 6d 65 74 | 65 72 73 20 66 6f 72 20 | paramet|ers for |
|00000f80| 64 69 66 66 65 72 65 6e | 74 20 6d 61 63 68 69 6e |differen|t machin|
|00000f90| 65 73 2e 0a 58 20 6c 69 | 6d 69 74 73 2e 63 20 20 |es..X li|mits.c |
|00000fa0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000fb0| 20 31 09 47 65 74 20 6c | 69 6d 69 74 73 20 6f 66 | 1.Get l|imits of|
|00000fc0| 20 69 6e 69 74 69 61 6c | 69 7a 65 64 20 64 61 74 | initial|ized dat|
|00000fd0| 61 20 73 65 67 6d 65 6e | 74 2e 0a 58 20 6f 75 74 |a segmen|t..X out|
|00000fe0| 70 75 74 2e 63 20 20 20 | 20 20 20 20 20 20 20 20 |put.c | |
|00000ff0| 20 20 20 20 20 20 20 20 | 31 09 4f 75 74 70 75 74 | |1.Output|
|00001000| 20 72 6f 75 74 69 6e 65 | 73 2e 0a 58 20 73 74 72 | routine|s..X str|
|00001010| 69 6e 67 73 2e 31 20 20 | 20 20 20 20 20 20 20 20 |ings.1 | |
|00001020| 20 20 20 20 20 20 20 20 | 31 09 4d 61 6e 75 61 6c | |1.Manual|
|00001030| 20 65 6e 74 72 79 2e 0a | 58 20 73 74 72 69 6e 67 | entry..|X string|
|00001040| 73 2e 63 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |s.c | |
|00001050| 20 20 20 20 20 31 09 4d | 61 69 6e 20 70 61 72 74 | 1.M|ain part|
|00001060| 20 6f 66 20 70 72 6f 67 | 72 61 6d 2e 0a 58 20 73 | of prog|ram..X s|
|00001070| 74 72 69 6e 67 73 2e 68 | 20 20 20 20 20 20 20 20 |trings.h| |
|00001080| 20 20 20 20 20 20 20 20 | 20 20 31 09 0a 58 20 73 | | 1..X s|
|00001090| 74 72 69 6e 67 73 2e 74 | 78 74 20 20 20 20 20 20 |trings.t|xt |
|000010a0| 20 20 20 20 20 20 20 20 | 20 20 31 09 4d 61 6e 75 | | 1.Manu|
|000010b0| 61 6c 20 65 6e 74 72 79 | 20 61 73 20 70 6c 61 69 |al entry| as plai|
|000010c0| 6e 20 74 65 78 74 20 66 | 69 6c 65 2e 0a 58 20 74 |n text f|ile..X t|
|000010d0| 65 73 74 5f 69 6e 70 75 | 74 20 20 20 20 20 20 20 |est_inpu|t |
|000010e0| 20 20 20 20 20 20 20 20 | 20 20 31 09 73 61 6d 70 | | 1.samp|
|000010f0| 6c 65 20 28 62 74 6f 61 | 27 64 29 20 66 69 6c 65 |le (btoa|'d) file|
|00001100| 20 74 6f 20 64 65 6d 6f | 6e 73 74 72 61 74 65 20 | to demo|nstrate |
|00001110| 65 72 72 6f 72 73 20 6f | 66 20 6f 6c 64 20 22 73 |errors o|f old "s|
|00001120| 74 72 69 6e 67 73 22 2e | 0a 58 20 74 75 6e 65 2e |trings".|.X tune.|
|00001130| 68 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |h | |
|00001140| 20 20 20 20 20 20 31 09 | 50 61 72 61 6d 65 74 65 | 1.|Paramete|
|00001150| 72 20 73 65 74 74 69 6e | 67 73 20 66 6f 72 20 63 |r settin|gs for c|
|00001160| 75 72 72 65 6e 74 20 6d | 61 63 68 69 6e 65 2e 0a |urrent m|achine..|
|00001170| 45 4e 44 5f 4f 46 5f 46 | 49 4c 45 0a 69 66 20 74 |END_OF_F|ILE.if t|
|00001180| 65 73 74 20 38 33 30 20 | 2d 6e 65 20 60 77 63 20 |est 830 |-ne `wc |
|00001190| 2d 63 20 3c 27 4d 41 4e | 49 46 45 53 54 27 60 3b |-c <'MAN|IFEST'`;|
|000011a0| 20 74 68 65 6e 0a 20 20 | 20 20 65 63 68 6f 20 73 | then. | echo s|
|000011b0| 68 61 72 3a 20 5c 22 27 | 4d 41 4e 49 46 45 53 54 |har: \"'|MANIFEST|
|000011c0| 27 5c 22 20 75 6e 70 61 | 63 6b 65 64 20 77 69 74 |'\" unpa|cked wit|
|000011d0| 68 20 77 72 6f 6e 67 20 | 73 69 7a 65 21 0a 66 69 |h wrong |size!.fi|
|000011e0| 0a 23 20 65 6e 64 20 6f | 66 20 27 4d 41 4e 49 46 |.# end o|f 'MANIF|
|000011f0| 45 53 54 27 0a 66 69 0a | 69 66 20 74 65 73 74 20 |EST'.fi.|if test |
|00001200| 2d 66 20 27 4d 61 6b 65 | 66 69 6c 65 27 20 2d 61 |-f 'Make|file' -a|
|00001210| 20 22 24 7b 31 7d 22 20 | 21 3d 20 22 2d 63 22 20 | "${1}" |!= "-c" |
|00001220| 3b 20 74 68 65 6e 20 0a | 20 20 65 63 68 6f 20 73 |; then .| echo s|
|00001230| 68 61 72 3a 20 57 69 6c | 6c 20 6e 6f 74 20 63 6c |har: Wil|l not cl|
|00001240| 6f 62 62 65 72 20 65 78 | 69 73 74 69 6e 67 20 66 |obber ex|isting f|
|00001250| 69 6c 65 20 5c 22 27 4d | 61 6b 65 66 69 6c 65 27 |ile \"'M|akefile'|
|00001260| 5c 22 0a 65 6c 73 65 0a | 65 63 68 6f 20 73 68 61 |\".else.|echo sha|
|00001270| 72 3a 20 45 78 74 72 61 | 63 74 69 6e 67 20 5c 22 |r: Extra|cting \"|
|00001280| 27 4d 61 6b 65 66 69 6c | 65 27 5c 22 20 5c 28 39 |'Makefil|e'\" \(9|
|00001290| 30 37 20 63 68 61 72 61 | 63 74 65 72 73 5c 29 0a |07 chara|cters\).|
|000012a0| 73 65 64 20 22 73 2f 5e | 58 2f 2f 22 20 3e 27 4d |sed "s/^|X//" >'M|
|000012b0| 61 6b 65 66 69 6c 65 27 | 20 3c 3c 27 45 4e 44 5f |akefile'| <<'END_|
|000012c0| 4f 46 5f 46 49 4c 45 27 | 0a 58 23 0a 58 23 20 4d |OF_FILE'|.X#.X# M|
|000012d0| 61 6b 65 66 69 6c 65 20 | 66 6f 72 20 27 73 74 72 |akefile |for 'str|
|000012e0| 69 6e 67 73 27 0a 58 23 | 0a 58 23 20 73 63 63 73 |ings'.X#|.X# sccs|
|000012f0| 69 64 20 3d 20 40 28 23 | 29 20 20 52 45 4c 2e 4d |id = @(#|) REL.M|
|00001300| 66 69 6c 65 20 20 28 76 | 31 2e 33 20 35 2f 32 32 |file (v|1.3 5/22|
|00001310| 2f 38 39 29 0a 58 23 0a | 58 53 48 45 4c 4c 3d 2f |/89).X#.|XSHELL=/|
|00001320| 62 69 6e 2f 73 68 0a 58 | 0a 58 23 20 49 66 20 79 |bin/sh.X|.X# If y|
|00001330| 6f 75 20 77 61 6e 74 20 | 74 6f 20 70 6c 61 79 20 |ou want |to play |
|00001340| 69 74 20 73 61 66 65 2c | 20 64 65 66 69 6e 65 20 |it safe,| define |
|00001350| 53 41 46 45 54 59 5f 46 | 49 52 53 54 2e 20 54 68 |SAFETY_F|IRST. Th|
|00001360| 65 20 70 72 6f 67 72 61 | 6d 20 77 69 6c 6c 20 6d |e progra|m will m|
|00001370| 6f 73 74 0a 58 23 20 70 | 72 6f 62 61 62 6c 79 20 |ost.X# p|robably |
|00001380| 77 6f 72 6b 20 61 6e 64 | 20 79 6f 75 20 77 6f 6e |work and| you won|
|00001390| 27 74 20 68 61 76 65 20 | 74 6f 20 73 70 65 6e 64 |'t have |to spend|
|000013a0| 20 74 69 6d 65 20 6f 6e | 20 70 6f 72 74 69 6e 67 | time on| porting|
|000013b0| 20 69 74 2e 0a 58 23 20 | 49 66 20 79 6f 75 20 68 | it..X# |If you h|
|000013c0| 61 76 65 20 64 65 66 69 | 6e 65 64 20 74 68 69 6e |ave defi|ned thin|
|000013d0| 67 73 20 79 6f 75 72 73 | 65 6c 66 20 61 6e 64 20 |gs yours|elf and |
|000013e0| 79 6f 75 20 77 61 6e 74 | 20 74 68 65 20 70 72 6f |you want| the pro|
|000013f0| 67 72 61 6d 0a 58 23 20 | 74 6f 20 75 73 65 20 74 |gram.X# |to use t|
|00001400| 68 65 73 65 20 64 65 66 | 69 6e 69 74 69 6f 6e 73 |hese def|initions|
|00001410| 2c 20 79 6f 75 20 6d 75 | 73 74 20 64 65 66 69 6e |, you mu|st defin|
|00001420| 65 20 55 53 45 5f 55 53 | 45 52 5f 44 45 46 49 4e |e USE_US|ER_DEFIN|
|00001430| 45 53 2e 0a 58 23 20 49 | 66 20 79 6f 75 20 64 6f |ES..X# I|f you do|
|00001440| 6e 27 74 20 64 65 66 69 | 6e 65 20 53 41 46 45 54 |n't defi|ne SAFET|
|00001450| 59 5f 46 49 52 53 54 20 | 61 6e 64 20 55 53 45 5f |Y_FIRST |and USE_|
|00001460| 55 53 45 52 5f 44 45 46 | 49 4e 45 53 2c 20 74 68 |USER_DEF|INES, th|
|00001470| 65 20 70 72 6f 67 72 61 | 6d 0a 58 23 20 77 69 6c |e progra|m.X# wil|
|00001480| 6c 20 74 72 79 20 74 6f | 20 69 64 65 6e 74 69 66 |l try to| identif|
|00001490| 79 20 79 6f 75 72 20 73 | 79 73 74 65 6d 20 61 6e |y your s|ystem an|
|000014a0| 64 20 74 68 65 6e 20 75 | 73 65 20 69 74 73 20 64 |d then u|se its d|
|000014b0| 65 66 61 75 6c 74 73 2e | 0a 58 55 46 4c 41 47 53 |efaults.|.XUFLAGS|
|000014c0| 3d 0a 58 23 55 46 4c 41 | 47 53 3d 2d 44 55 53 45 |=.X#UFLA|GS=-DUSE|
|000014d0| 5f 55 53 45 52 5f 44 45 | 46 49 4e 45 53 0a 58 23 |_USER_DE|FINES.X#|
|000014e0| 55 46 4c 41 47 53 3d 2d | 44 53 41 46 45 54 59 5f |UFLAGS=-|DSAFETY_|
|000014f0| 46 49 52 53 54 0a 58 0a | 58 23 20 44 65 66 69 6e |FIRST.X.|X# Defin|
|00001500| 65 20 44 45 42 55 47 20 | 74 6f 20 67 65 74 20 61 |e DEBUG |to get a|
|00001510| 20 6c 6f 74 20 6f 66 20 | 64 65 62 75 67 20 6f 75 | lot of |debug ou|
|00001520| 74 70 75 74 20 6f 6e 20 | 22 70 72 6f 74 22 2e 0a |tput on |"prot"..|
|00001530| 58 44 45 42 55 47 46 4c | 41 47 53 3d 0a 58 0a 58 |XDEBUGFL|AGS=.X.X|
|00001540| 43 46 4c 41 47 53 3d 20 | 2d 4f 20 24 7b 44 45 42 |CFLAGS= |-O ${DEB|
|00001550| 55 47 46 4c 41 47 53 7d | 20 24 7b 55 46 4c 41 47 |UGFLAGS}| ${UFLAG|
|00001560| 53 7d 0a 58 0a 58 48 45 | 41 44 45 52 53 3d 09 73 |S}.X.XHE|ADERS=.s|
|00001570| 74 72 69 6e 67 73 2e 68 | 20 63 6f 6e 66 69 67 2e |trings.h| config.|
|00001580| 68 20 74 75 6e 65 2e 68 | 0a 58 4f 42 4a 53 3d 09 |h tune.h|.XOBJS=.|
|00001590| 09 73 74 72 69 6e 67 73 | 2e 6f 20 6c 69 6d 69 74 |.strings|.o limit|
|000015a0| 73 2e 6f 20 6f 75 74 70 | 75 74 2e 6f 0a 58 0a 58 |s.o outp|ut.o.X.X|
|000015b0| 61 6c 6c 3a 20 73 74 72 | 69 6e 67 73 0a 58 0a 58 |all: str|ings.X.X|
|000015c0| 73 74 72 69 6e 67 73 3a | 20 24 7b 4f 42 4a 53 7d |strings:| ${OBJS}|
|000015d0| 0a 58 09 63 63 20 2d 6f | 20 73 74 72 69 6e 67 73 |.X.cc -o| strings|
|000015e0| 20 24 7b 4f 42 4a 53 7d | 0a 58 0a 58 24 7b 4f 42 | ${OBJS}|.X.X${OB|
|000015f0| 4a 53 7d 3a 09 24 7b 48 | 45 41 44 45 52 53 7d 0a |JS}:.${H|EADERS}.|
|00001600| 58 0a 58 23 73 74 72 69 | 6e 67 73 2e 6f 3a 20 73 |X.X#stri|ngs.o: s|
|00001610| 74 72 69 6e 67 73 2e 68 | 20 63 6f 6e 66 69 67 2e |trings.h| config.|
|00001620| 68 20 74 75 6e 65 2e 68 | 0a 58 23 6c 69 6d 69 74 |h tune.h|.X#limit|
|00001630| 73 2e 6f 20 3a 20 73 74 | 72 69 6e 67 73 2e 68 20 |s.o : st|rings.h |
|00001640| 63 6f 6e 66 69 67 2e 68 | 20 74 75 6e 65 2e 68 0a |config.h| tune.h.|
|00001650| 58 23 6f 75 74 70 75 74 | 2e 6f 20 3a 20 73 74 72 |X#output|.o : str|
|00001660| 69 6e 67 73 2e 68 20 63 | 6f 6e 66 69 67 2e 68 20 |ings.h c|onfig.h |
|00001670| 74 75 6e 65 2e 68 0a 45 | 4e 44 5f 4f 46 5f 46 49 |tune.h.E|ND_OF_FI|
|00001680| 4c 45 0a 69 66 20 74 65 | 73 74 20 39 30 37 20 2d |LE.if te|st 907 -|
|00001690| 6e 65 20 60 77 63 20 2d | 63 20 3c 27 4d 61 6b 65 |ne `wc -|c <'Make|
|000016a0| 66 69 6c 65 27 60 3b 20 | 74 68 65 6e 0a 20 20 20 |file'`; |then. |
|000016b0| 20 65 63 68 6f 20 73 68 | 61 72 3a 20 5c 22 27 4d | echo sh|ar: \"'M|
|000016c0| 61 6b 65 66 69 6c 65 27 | 5c 22 20 75 6e 70 61 63 |akefile'|\" unpac|
|000016d0| 6b 65 64 20 77 69 74 68 | 20 77 72 6f 6e 67 20 73 |ked with| wrong s|
|000016e0| 69 7a 65 21 0a 66 69 0a | 23 20 65 6e 64 20 6f 66 |ize!.fi.|# end of|
|000016f0| 20 27 4d 61 6b 65 66 69 | 6c 65 27 0a 66 69 0a 69 | 'Makefi|le'.fi.i|
|00001700| 66 20 74 65 73 74 20 2d | 66 20 27 52 45 41 44 4d |f test -|f 'READM|
|00001710| 45 27 20 2d 61 20 22 24 | 7b 31 7d 22 20 21 3d 20 |E' -a "$|{1}" != |
|00001720| 22 2d 63 22 20 3b 20 74 | 68 65 6e 20 0a 20 20 65 |"-c" ; t|hen . e|
|00001730| 63 68 6f 20 73 68 61 72 | 3a 20 57 69 6c 6c 20 6e |cho shar|: Will n|
|00001740| 6f 74 20 63 6c 6f 62 62 | 65 72 20 65 78 69 73 74 |ot clobb|er exist|
|00001750| 69 6e 67 20 66 69 6c 65 | 20 5c 22 27 52 45 41 44 |ing file| \"'READ|
|00001760| 4d 45 27 5c 22 0a 65 6c | 73 65 0a 65 63 68 6f 20 |ME'\".el|se.echo |
|00001770| 73 68 61 72 3a 20 45 78 | 74 72 61 63 74 69 6e 67 |shar: Ex|tracting|
|00001780| 20 5c 22 27 52 45 41 44 | 4d 45 27 5c 22 20 5c 28 | \"'READ|ME'\" \(|
|00001790| 37 36 30 31 20 63 68 61 | 72 61 63 74 65 72 73 5c |7601 cha|racters\|
|000017a0| 29 0a 73 65 64 20 22 73 | 2f 5e 58 2f 2f 22 20 3e |).sed "s|/^X//" >|
|000017b0| 27 52 45 41 44 4d 45 27 | 20 3c 3c 27 45 4e 44 5f |'README'| <<'END_|
|000017c0| 4f 46 5f 46 49 4c 45 27 | 0a 58 31 2e 29 20 57 68 |OF_FILE'|.X1.) Wh|
|000017d0| 61 74 20 64 6f 20 77 65 | 20 68 61 76 65 20 68 65 |at do we| have he|
|000017e0| 72 65 3f 0a 58 0a 58 54 | 68 69 73 20 69 73 20 74 |re?.X.XT|his is t|
|000017f0| 68 65 20 52 45 41 44 4d | 45 20 66 69 6c 65 20 66 |he READM|E file f|
|00001800| 6f 72 20 27 73 74 72 69 | 6e 67 73 27 2e 20 27 73 |or 'stri|ngs'. 's|
|00001810| 74 72 69 6e 67 73 27 20 | 69 73 20 61 20 72 65 77 |trings' |is a rew|
|00001820| 72 69 74 65 0a 58 61 6e | 64 20 72 65 70 6c 61 63 |rite.Xan|d replac|
|00001830| 65 6d 65 6e 74 20 66 6f | 72 20 74 68 65 20 34 42 |ement fo|r the 4B|
|00001840| 53 44 20 70 72 6f 67 72 | 61 6d 20 6f 66 20 74 68 |SD progr|am of th|
|00001850| 65 20 73 61 6d 65 20 6e | 61 6d 65 2e 0a 58 27 73 |e same n|ame..X's|
|00001860| 74 72 69 6e 67 73 27 20 | 6c 6f 6f 6b 73 20 66 6f |trings' |looks fo|
|00001870| 72 20 73 65 71 75 65 6e | 63 65 73 20 6f 66 20 70 |r sequen|ces of p|
|00001880| 72 69 6e 74 61 62 6c 65 | 20 63 68 61 72 61 63 74 |rintable| charact|
|00001890| 65 72 73 20 69 6e 20 61 | 20 66 69 6c 65 20 61 6e |ers in a| file an|
|000018a0| 64 0a 58 6f 75 74 70 75 | 74 73 20 74 68 65 6d 2e |d.Xoutpu|ts them.|
|000018b0| 0a 58 0a 58 43 75 72 72 | 65 6e 74 20 76 65 72 73 |.X.XCurr|ent vers|
|000018c0| 69 6f 6e 20 69 73 20 31 | 2e 36 2e 39 2e 0a 58 0a |ion is 1|.6.9..X.|
|000018d0| 58 28 54 6f 20 67 65 74 | 20 62 65 73 74 20 72 65 |X(To get| best re|
|000018e0| 73 75 6c 74 73 20 77 68 | 65 6e 20 72 65 61 64 69 |sults wh|en readi|
|000018f0| 6e 67 20 74 68 65 73 65 | 20 66 69 6c 65 73 2c 20 |ng these| files, |
|00001900| 75 73 65 20 61 6e 20 6f | 70 74 69 6f 6e 20 69 6e |use an o|ption in|
|00001910| 20 79 6f 75 72 0a 58 20 | 66 61 76 6f 75 72 69 74 | your.X |favourit|
|00001920| 65 20 65 64 69 74 6f 72 | 20 74 6f 20 65 78 70 61 |e editor| to expa|
|00001930| 6e 64 20 61 20 54 41 42 | 20 74 6f 20 34 20 53 50 |nd a TAB| to 4 SP|
|00001940| 41 43 45 73 2e 20 45 2e | 67 2e 20 69 6e 20 76 69 |ACEs. E.|g. in vi|
|00001950| 20 69 74 20 69 73 0a 58 | 20 22 73 65 74 20 74 61 | it is.X| "set ta|
|00001960| 62 73 74 6f 70 3d 34 22 | 29 0a 58 0a 58 59 6f 75 |bstop=4"|).X.XYou|
|00001970| 20 73 68 6f 75 6c 64 20 | 68 61 76 65 20 74 68 65 | should |have the|
|00001980| 20 66 69 6c 65 73 3a 0a | 58 09 52 45 41 44 4d 45 | files:.|X.README|
|00001990| 09 09 2d 20 74 68 69 73 | 20 66 69 6c 65 0a 58 09 |..- this| file.X.|
|000019a0| 43 4f 50 59 49 4e 47 09 | 09 2d 20 43 6f 70 79 72 |COPYING.|.- Copyr|
|000019b0| 69 67 68 74 20 4e 6f 74 | 69 63 65 0a 58 09 4d 61 |ight Not|ice.X.Ma|
|000019c0| 6b 65 66 69 6c 65 09 2d | 20 4d 61 6b 65 66 69 6c |kefile.-| Makefil|
|000019d0| 65 0a 58 09 73 74 72 69 | 6e 67 73 2e 68 0a 58 09 |e.X.stri|ngs.h.X.|
|000019e0| 63 6f 6e 66 69 67 2e 68 | 0a 58 09 74 75 6e 65 2e |config.h|.X.tune.|
|000019f0| 68 0a 58 09 73 74 72 69 | 6e 67 73 2e 63 09 2d 20 |h.X.stri|ngs.c.- |
|00001a00| 74 68 65 20 6d 61 69 6e | 20 73 6f 75 72 63 65 0a |the main| source.|
|00001a10| 58 09 6c 69 6d 69 74 73 | 2e 63 09 2d 20 74 68 65 |X.limits|.c.- the|
|00001a20| 20 55 4e 49 58 20 28 74 | 72 61 64 65 6d 61 72 6b | UNIX (t|rademark|
|00001a30| 20 6f 66 20 41 54 26 54 | 29 20 73 70 65 63 69 66 | of AT&T|) specif|
|00001a40| 69 63 20 73 74 75 66 66 | 20 74 6f 20 69 64 65 6e |ic stuff| to iden|
|00001a50| 74 69 66 79 0a 58 09 09 | 09 09 20 20 61 6e 20 69 |tify.X..|.. an i|
|00001a60| 6e 69 74 69 61 6c 69 7a | 65 64 20 64 61 74 61 20 |nitializ|ed data |
|00001a70| 73 65 67 6d 65 6e 74 0a | 58 09 6f 75 74 70 75 74 |segment.|X.output|
|00001a80| 2e 63 09 2d 20 6f 75 74 | 70 75 74 20 72 6f 75 74 |.c.- out|put rout|
|00001a90| 69 6e 65 73 0a 58 09 74 | 65 73 74 5f 69 6e 70 75 |ines.X.t|est_inpu|
|00001aa0| 74 09 2d 20 61 20 66 69 | 6c 65 20 63 6f 6e 74 61 |t.- a fi|le conta|
|00001ab0| 69 6e 69 6e 67 20 74 68 | 65 20 32 20 63 68 61 72 |ining th|e 2 char|
|00001ac0| 61 63 74 65 72 73 20 74 | 68 65 20 6f 72 69 67 69 |acters t|he origi|
|00001ad0| 6e 61 6c 20 73 74 72 69 | 6e 67 73 0a 58 09 09 09 |nal stri|ngs.X...|
|00001ae0| 09 20 20 73 74 75 6d 62 | 6c 65 64 20 6f 76 65 72 |. stumb|led over|
|00001af0| 2e 20 55 6e 70 61 63 6b | 20 69 74 20 77 69 74 68 |. Unpack| it with|
|00001b00| 20 61 74 6f 62 2e 0a 58 | 09 73 74 72 69 6e 67 73 | atob..X|.strings|
|00001b10| 2e 31 09 2d 20 6d 61 6e | 75 61 6c 20 70 61 67 65 |.1.- man|ual page|
|00001b20| 2e 0a 58 09 73 74 72 69 | 6e 67 73 2e 74 78 74 20 |..X.stri|ngs.txt |
|00001b30| 2d 20 6d 61 6e 75 61 6c | 20 70 61 67 65 20 77 69 |- manual| page wi|
|00001b40| 74 68 6f 75 74 20 6e 72 | 6f 66 66 20 73 65 71 75 |thout nr|off sequ|
|00001b50| 65 6e 63 65 73 0a 58 0a | 58 32 2e 29 20 48 6f 77 |ences.X.|X2.) How|
|00001b60| 20 74 6f 20 62 75 69 6c | 64 20 73 74 72 69 6e 67 | to buil|d string|
|00001b70| 73 2e 0a 58 0a 58 4e 6f | 77 20 74 68 61 74 20 79 |s..X.XNo|w that y|
|00001b80| 6f 75 20 68 61 76 65 20 | 73 74 72 69 6e 67 73 20 |ou have |strings |
|00001b90| 79 6f 75 20 77 69 6c 6c | 20 77 61 6e 74 20 74 6f |you will| want to|
|00001ba0| 20 62 75 69 6c 64 20 69 | 74 2e 0a 58 54 68 65 20 | build i|t..XThe |
|00001bb0| 70 72 6f 67 72 61 6d 20 | 69 73 20 73 68 69 70 70 |program |is shipp|
|00001bc0| 65 64 20 77 69 74 68 20 | 55 46 4c 41 47 53 20 75 |ed with |UFLAGS u|
|00001bd0| 6e 64 65 66 69 6e 65 64 | 20 28 73 65 65 20 62 65 |ndefined| (see be|
|00001be0| 6c 6f 77 20 66 6f 72 20 | 61 6e 20 65 78 70 6c 61 |low for |an expla|
|00001bf0| 6e 61 74 69 6f 6e 29 2e | 0a 58 4f 6e 20 55 4e 49 |nation).|.XOn UNI|
|00001c00| 58 20 28 74 72 61 64 65 | 6d 61 72 6b 20 6f 66 20 |X (trade|mark of |
|00001c10| 41 54 26 54 29 20 73 79 | 73 74 65 6d 73 2c 20 79 |AT&T) sy|stems, y|
|00001c20| 6f 75 20 73 68 6f 75 6c | 64 20 62 65 20 61 62 6c |ou shoul|d be abl|
|00001c30| 65 20 74 6f 20 62 75 69 | 6c 64 20 74 68 65 0a 58 |e to bui|ld the.X|
|00001c40| 70 72 6f 67 72 61 6d 20 | 62 79 20 6a 75 73 74 20 |program |by just |
|00001c50| 74 79 70 69 6e 67 20 22 | 6d 61 6b 65 22 2e 20 4f |typing "|make". O|
|00001c60| 6e 20 6e 6f 6e 2d 55 4e | 49 58 20 73 79 73 74 65 |n non-UN|IX syste|
|00001c70| 6d 73 20 79 6f 75 20 6d | 69 67 68 74 20 68 61 76 |ms you m|ight hav|
|00001c80| 65 20 70 72 6f 62 6c 65 | 6d 73 2e 0a 58 0a 58 61 |e proble|ms..X.Xa|
|00001c90| 2e 29 20 65 64 69 74 20 | 4d 61 6b 65 66 69 6c 65 |.) edit |Makefile|
|00001ca0| 2e 20 49 66 20 79 6f 75 | 20 77 61 6e 74 20 74 6f |. If you| want to|
|00001cb0| 20 70 6c 61 79 20 69 74 | 20 73 61 66 65 2c 20 73 | play it| safe, s|
|00001cc0| 65 74 20 55 46 4c 41 47 | 53 3d 2d 44 53 41 46 45 |et UFLAG|S=-DSAFE|
|00001cd0| 54 59 5f 46 49 52 53 54 | 2e 0a 58 09 73 74 72 69 |TY_FIRST|..X.stri|
|00001ce0| 6e 67 73 20 73 68 6f 75 | 6c 64 20 6e 6f 77 20 63 |ngs shou|ld now c|
|00001cf0| 6f 6d 70 69 6c 65 20 77 | 69 74 68 6f 75 74 20 61 |ompile w|ithout a|
|00001d00| 6e 79 20 70 72 6f 62 6c | 65 6d 73 2e 0a 58 09 59 |ny probl|ems..X.Y|
|00001d10| 6f 75 20 77 6f 6e 27 74 | 20 67 65 74 20 74 68 65 |ou won't| get the|
|00001d20| 20 55 4e 49 58 20 73 70 | 65 63 69 66 69 63 20 73 | UNIX sp|ecific s|
|00001d30| 74 75 66 66 3a 20 74 68 | 65 20 70 72 6f 67 72 61 |tuff: th|e progra|
|00001d40| 6d 20 64 6f 65 73 20 6e | 6f 74 0a 58 09 74 72 79 |m does n|ot.X.try|
|00001d50| 20 74 6f 20 69 64 65 6e | 74 69 66 79 20 74 68 65 | to iden|tify the|
|00001d60| 20 69 6e 69 74 69 61 6c | 69 7a 65 64 20 64 61 74 | initial|ized dat|
|00001d70| 61 20 73 65 67 6d 65 6e | 74 2e 0a 58 0a 58 62 2e |a segmen|t..X.Xb.|
|00001d80| 29 20 49 66 20 79 6f 75 | 20 64 6f 6e 27 74 20 77 |) If you| don't w|
|00001d90| 61 6e 74 20 74 6f 20 70 | 6c 61 79 20 69 74 20 73 |ant to p|lay it s|
|00001da0| 61 66 65 2c 20 62 75 74 | 20 72 61 74 68 65 72 20 |afe, but| rather |
|00001db0| 79 6f 75 20 77 61 6e 74 | 20 74 6f 20 63 6f 6e 66 |you want| to conf|
|00001dc0| 69 67 75 72 65 0a 58 09 | 73 74 72 69 6e 67 73 20 |igure.X.|strings |
|00001dd0| 74 6f 20 79 6f 75 72 20 | 73 79 73 74 65 6d 2c 20 |to your |system, |
|00001de0| 74 61 6b 65 20 61 20 6c | 6f 6f 6b 20 61 74 20 63 |take a l|ook at c|
|00001df0| 6f 6e 66 69 67 20 66 69 | 72 73 74 2e 20 54 68 65 |onfig fi|rst. The|
|00001e00| 72 65 20 69 73 20 61 0a | 58 09 6c 69 73 74 20 6f |re is a.|X.list o|
|00001e10| 66 20 73 79 73 74 65 6d | 73 2e 20 49 66 20 6f 6e |f system|s. If on|
|00001e20| 65 20 6f 66 20 74 68 65 | 73 65 20 69 73 20 79 6f |e of the|se is yo|
|00001e30| 75 72 73 2c 20 65 64 69 | 74 20 4d 61 6b 65 66 69 |urs, edi|t Makefi|
|00001e40| 6c 65 20 61 6e 64 0a 58 | 09 73 65 74 20 55 46 4c |le and.X|.set UFL|
|00001e50| 41 47 53 20 74 6f 20 6e | 6f 74 68 69 6e 67 2e 20 |AGS to n|othing. |
|00001e60| 57 68 65 6e 20 63 6f 6d | 70 69 6c 69 6e 67 20 74 |When com|piling t|
|00001e70| 68 65 20 64 65 66 69 6e | 65 73 20 66 6f 72 20 74 |he defin|es for t|
|00001e80| 68 65 20 73 79 73 74 65 | 6d 0a 58 09 61 72 65 20 |he syste|m.X.are |
|00001e90| 75 73 65 64 2e 0a 58 09 | 57 41 52 4e 49 4e 47 3a |used..X.|WARNING:|
|00001ea0| 20 73 6f 6d 65 20 74 68 | 69 6e 67 73 20 6d 61 79 | some th|ings may|
|00001eb0| 20 64 69 66 66 65 72 20 | 62 65 74 77 65 65 6e 20 | differ |between |
|00001ec0| 64 69 66 66 65 72 65 6e | 74 20 76 65 72 73 69 6f |differen|t versio|
|00001ed0| 6e 73 20 6f 66 20 74 68 | 65 0a 58 09 73 61 6d 65 |ns of th|e.X.same|
|00001ee0| 20 73 79 73 74 65 6d 2e | 20 4f 6e 20 73 6f 6d 65 | system.| On some|
|00001ef0| 20 6d 61 63 68 69 6e 65 | 73 20 74 68 65 72 65 20 | machine|s there |
|00001f00| 69 73 20 6e 6f 20 65 61 | 73 79 20 77 61 79 20 74 |is no ea|sy way t|
|00001f10| 6f 20 64 69 73 74 69 6e | 67 75 69 73 68 0a 58 09 |o distin|guish.X.|
|00001f20| 62 65 74 77 65 65 6e 20 | 73 75 63 68 20 76 65 72 |between |such ver|
|00001f30| 73 69 6f 6e 73 2e 0a 58 | 09 49 66 20 79 6f 75 20 |sions..X|.If you |
|00001f40| 77 65 72 65 20 77 72 6f | 6e 67 2c 20 61 6e 64 20 |were wro|ng, and |
|00001f50| 74 68 65 20 73 79 73 74 | 65 6d 20 79 6f 75 20 61 |the syst|em you a|
|00001f60| 72 65 20 75 73 69 6e 67 | 20 69 73 20 6e 6f 74 20 |re using| is not |
|00001f70| 69 6e 20 74 68 65 0a 58 | 09 6c 69 73 74 20 6f 66 |in the.X|.list of|
|00001f80| 20 6b 6e 6f 77 6e 20 73 | 79 6d 62 6f 6c 73 2c 20 | known s|ymbols, |
|00001f90| 74 68 65 20 6d 69 6e 69 | 6d 61 6c 20 64 65 66 61 |the mini|mal defa|
|00001fa0| 75 6c 74 73 2c 20 6c 69 | 6b 65 20 69 6e 20 61 2e |ults, li|ke in a.|
|00001fb0| 29 20 77 69 6c 6c 20 62 | 65 0a 58 09 75 73 65 64 |) will b|e.X.used|
|00001fc0| 2e 0a 58 0a 58 63 2e 29 | 20 59 6f 75 20 77 61 6e |..X.Xc.)| You wan|
|00001fd0| 74 20 74 6f 20 63 6f 6e | 66 69 67 75 72 65 20 73 |t to con|figure s|
|00001fe0| 74 72 69 6e 67 73 2c 20 | 61 6e 64 20 79 6f 75 72 |trings, |and your|
|00001ff0| 20 73 79 73 74 65 6d 20 | 69 73 20 6e 6f 74 20 69 | system |is not i|
|00002000| 6e 20 74 68 65 20 6c 69 | 73 74 0a 58 09 6f 66 20 |n the li|st.X.of |
|00002010| 6b 6e 6f 77 6e 20 73 79 | 73 74 65 6d 73 2e 0a 58 |known sy|stems..X|
|00002020| 09 45 64 69 74 20 4d 61 | 6b 65 66 69 6c 65 20 61 |.Edit Ma|kefile a|
|00002030| 6e 64 20 73 65 74 20 55 | 46 4c 41 47 53 3d 2d 44 |nd set U|FLAGS=-D|
|00002040| 55 53 45 5f 55 53 45 52 | 5f 44 45 46 49 4e 45 53 |USE_USER|_DEFINES|
|00002050| 2e 0a 58 09 45 64 69 74 | 20 74 75 6e 65 2e 68 20 |..X.Edit| tune.h |
|00002060| 61 6e 64 20 73 65 74 20 | 74 68 69 6e 67 73 20 75 |and set |things u|
|00002070| 70 20 66 6f 72 20 79 6f | 75 72 20 73 79 73 74 65 |p for yo|ur syste|
|00002080| 6d 2e 20 54 68 65 20 76 | 61 72 69 61 62 6c 65 73 |m. The v|ariables|
|00002090| 20 61 72 65 0a 58 09 63 | 6f 6d 6d 65 6e 74 65 64 | are.X.c|ommented|
|000020a0| 2e 0a 58 0a 58 54 68 65 | 72 65 20 61 72 65 20 33 |..X.XThe|re are 3|
|000020b0| 20 68 65 61 64 65 72 20 | 66 69 6c 65 73 2e 20 54 | header |files. T|
|000020c0| 68 65 20 69 6e 63 6c 75 | 73 69 6f 6e 20 77 6f 72 |he inclu|sion wor|
|000020d0| 6b 73 20 6c 69 6b 65 20 | 74 68 69 73 2e 0a 58 28 |ks like |this..X(|
|000020e0| 79 6f 75 20 63 61 6e 20 | 73 6b 69 70 20 74 68 69 |you can |skip thi|
|000020f0| 73 29 0a 58 0a 58 20 20 | 20 20 20 20 20 20 28 72 |s).X.X | (r|
|00002100| 65 61 64 69 6e 67 20 73 | 74 72 69 6e 67 73 2e 68 |eading s|trings.h|
|00002110| 29 0a 58 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |).X | |
|00002120| 20 20 7c 0a 58 20 20 20 | 20 20 20 20 20 20 20 20 | |.X | |
|00002130| 20 20 20 20 76 0a 58 20 | 20 20 20 20 20 20 20 28 | v.X | (|
|00002140| 69 6e 63 6c 75 64 69 6e | 67 20 63 6f 6e 66 69 67 |includin|g config|
|00002150| 2e 68 29 0a 58 09 20 20 | 20 20 20 20 20 20 20 20 |.h).X. | |
|00002160| 20 7c 0a 58 09 20 20 20 | 20 20 20 20 20 20 20 20 | |.X. | |
|00002170| 76 0a 58 09 3c 2d 2d 2d | 2d 2d 20 69 73 20 53 41 |v.X.<---|-- is SA|
|00002180| 46 45 54 59 5f 46 49 52 | 53 54 20 64 65 66 69 6e |FETY_FIR|ST defin|
|00002190| 65 64 3f 0a 58 09 7c 20 | 20 20 20 20 20 20 20 20 |ed?.X.| | |
|000021a0| 20 7c 0a 58 09 7c 20 20 | 20 20 20 20 20 20 20 20 | |.X.| | |
|000021b0| 7c 20 2d 0a 58 09 7c 20 | 20 20 20 20 20 20 20 20 || -.X.| | |
|000021c0| 20 76 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | v | |
|000021d0| 20 20 20 20 20 20 20 20 | 2b 0a 58 09 7c 20 20 69 | |+.X.| i|
|000021e0| 73 20 55 53 45 5f 55 53 | 45 52 5f 44 45 46 49 4e |s USE_US|ER_DEFIN|
|000021f0| 45 53 20 64 65 66 69 6e | 65 64 3f 20 2d 2d 2d 2d |ES defin|ed? ----|
|00002200| 3e 75 73 65 20 73 74 75 | 66 66 20 66 72 6f 6d 20 |>use stu|ff from |
|00002210| 74 75 6e 65 2e 68 20 2d | 2d 2d 3e 20 63 6f 6e 74 |tune.h -|--> cont|
|00002220| 69 6e 75 65 0a 58 09 7c | 20 20 20 20 20 20 20 20 |inue.X.|| |
|00002230| 20 20 7c 0a 58 09 7c 20 | 20 20 20 20 20 20 20 20 | |.X.| | |
|00002240| 20 7c 20 2d 0a 58 09 7c | 20 20 20 20 20 20 20 20 | | -.X.|| |
|00002250| 20 20 76 0a 58 09 7c 20 | 20 20 20 20 20 69 73 20 | v.X.| | is |
|00002260| 74 68 69 73 20 6d 61 63 | 68 69 6e 65 20 31 20 3f |this mac|hine 1 ?|
|00002270| 0a 58 09 7c 20 20 20 20 | 20 20 20 20 20 20 7c 0a |.X.| | |.|
|00002280| 58 09 7c 20 20 20 20 20 | 20 20 20 20 20 7c 20 2d |X.| | | -|
|00002290| 0a 58 09 7c 20 20 20 20 | 20 20 20 20 20 20 76 0a |.X.| | v.|
|000022a0| 58 09 7c 20 20 20 20 20 | 20 69 73 20 74 68 69 73 |X.| | is this|
|000022b0| 20 6d 61 63 68 69 6e 65 | 20 32 20 3f 0a 58 09 7c | machine| 2 ?.X.||
|000022c0| 20 20 20 20 20 20 20 20 | 20 20 7c 0a 58 09 7c 20 | | |.X.| |
|000022d0| 20 20 20 20 20 20 20 20 | 20 7c 20 2d 0a 58 09 7c | | | -.X.||
|000022e0| 20 20 20 20 20 20 20 20 | 20 20 76 0a 58 09 7c 20 | | v.X.| |
|000022f0| 20 20 20 20 20 20 20 20 | 2e 2e 2e 0a 58 09 7c 20 | |....X.| |
|00002300| 20 20 20 20 20 20 20 20 | 20 7c 0a 58 09 7c 20 20 | | |.X.| |
|00002310| 20 20 20 20 20 20 20 20 | 7c 20 2d 0a 58 09 76 20 | || -.X.v |
|00002320| 20 20 20 20 20 20 20 20 | 20 76 0a 58 09 75 73 65 | | v.X.use|
|00002330| 20 73 61 66 65 20 64 65 | 66 61 75 6c 74 73 0a 58 | safe de|faults.X|
|00002340| 09 7c 0a 58 09 76 0a 58 | 09 63 6f 6e 74 69 6e 75 |.|.X.v.X|.continu|
|00002350| 65 0a 58 0a 58 54 68 65 | 20 70 72 6f 67 72 61 6d |e.X.XThe| program|
|00002360| 2c 20 6f 72 20 72 61 74 | 68 65 72 20 74 68 65 20 |, or rat|her the |
|00002370| 68 65 61 64 65 72 66 69 | 6c 65 73 20 6b 6e 6f 77 |headerfi|les know|
|00002380| 20 61 62 6f 75 74 20 74 | 68 65 20 66 6f 6c 6c 6f | about t|he follo|
|00002390| 77 69 6e 67 20 6d 61 63 | 68 69 6e 65 73 3a 0a 58 |wing mac|hines:.X|
|000023a0| 0a 58 2d 20 56 41 58 20 | 31 31 2f 37 38 30 20 28 |.X- VAX |11/780 (|
|000023b0| 34 2e 33 20 42 53 44 29 | 20 62 79 20 22 75 6e 69 |4.3 BSD)| by "uni|
|000023c0| 78 22 20 61 6e 64 20 22 | 76 61 78 22 20 61 6e 64 |x" and "|vax" and|
|000023d0| 20 6e 6f 74 20 22 75 6c | 74 72 69 78 22 0a 58 2d | not "ul|trix".X-|
|000023e0| 20 53 49 45 4d 45 4e 53 | 20 50 43 2d 4d 58 32 20 | SIEMENS| PC-MX2 |
|000023f0| 28 53 49 4e 49 58 20 76 | 32 2e 31 29 20 62 79 20 |(SINIX v|2.1) by |
|00002400| 22 6e 73 63 33 32 30 30 | 22 20 61 6e 64 20 22 73 |"nsc3200|" and "s|
|00002410| 69 6e 69 78 22 20 61 6e | 64 20 22 6e 73 31 36 30 |inix" an|d "ns160|
|00002420| 30 30 22 0a 58 2d 20 53 | 75 6e 20 33 2f 32 36 30 |00".X- S|un 3/260|
|00002430| 20 28 53 75 6e 4f 53 20 | 33 2e 35 29 20 62 79 20 | (SunOS |3.5) by |
|00002440| 22 75 6e 69 78 22 20 61 | 6e 64 20 22 73 75 6e 22 |"unix" a|nd "sun"|
|00002450| 20 61 6e 64 20 22 6d 63 | 36 38 30 32 30 22 0a 58 | and "mc|68020".X|
|00002460| 2d 20 56 41 58 20 36 38 | 30 30 20 28 55 6c 74 72 |- VAX 68|00 (Ultr|
|00002470| 69 78 20 32 2e 31 29 20 | 62 79 20 22 75 6e 69 78 |ix 2.1) |by "unix|
|00002480| 22 20 61 6e 64 20 22 75 | 6c 74 72 69 78 22 20 61 |" and "u|ltrix" a|
|00002490| 6e 64 20 22 62 73 64 34 | 5f 32 22 09 0a 58 2d 20 |nd "bsd4|_2"..X- |
|000024a0| 75 56 41 58 20 28 56 4d | 53 20 35 2e 31 29 20 62 |uVAX (VM|S 5.1) b|
|000024b0| 79 20 22 76 6d 73 22 20 | 61 6e 64 20 22 76 61 78 |y "vms" |and "vax|
|000024c0| 22 0a 58 0a 58 33 2e 29 | 20 57 68 79 20 69 73 20 |".X.X3.)| Why is |
|000024d0| 74 68 69 73 20 73 74 72 | 69 6e 67 73 20 62 65 74 |this str|ings bet|
|000024e0| 74 65 72 20 74 68 61 6e | 20 74 68 65 20 73 74 61 |ter than| the sta|
|000024f0| 6e 64 61 72 64 20 6f 6e | 65 3f 0a 58 0a 58 09 61 |ndard on|e?.X.X.a|
|00002500| 2e 29 20 54 68 69 73 20 | 76 65 72 73 69 6f 6e 20 |.) This |version |
|00002510| 6f 66 20 73 74 72 69 6e | 67 73 20 69 73 20 61 74 |of strin|gs is at|
|00002520| 20 6c 65 61 73 74 20 34 | 20 74 69 6d 65 73 20 66 | least 4| times f|
|00002530| 61 73 74 65 72 20 74 68 | 61 6e 20 74 68 65 20 6f |aster th|an the o|
|00002540| 72 69 67 69 6e 61 6c 0a | 58 09 09 6f 6e 65 2e 20 |riginal.|X..one. |
|00002550| 49 66 20 74 68 65 20 6d | 69 6e 69 6d 61 6c 20 73 |If the m|inimal s|
|00002560| 74 72 69 6e 67 20 6c 65 | 6e 67 74 68 20 69 73 20 |tring le|ngth is |
|00002570| 73 65 74 20 74 6f 20 73 | 6f 6d 65 74 68 69 6e 67 |set to s|omething|
|00002580| 20 65 6c 73 65 2c 20 69 | 74 20 6d 69 67 68 74 0a | else, i|t might.|
|00002590| 58 09 09 65 76 65 6e 20 | 62 65 20 31 30 20 74 69 |X..even |be 10 ti|
|000025a0| 6d 65 73 20 66 61 73 74 | 65 72 2e 0a 58 09 62 2e |mes fast|er..X.b.|
|000025b0| 29 20 54 68 65 20 6f 72 | 69 67 69 6e 61 6c 20 6f |) The or|iginal o|
|000025c0| 6e 65 20 68 61 64 20 73 | 65 76 65 72 61 6c 20 62 |ne had s|everal b|
|000025d0| 75 67 73 2e 0a 58 09 63 | 2e 29 20 54 68 69 73 20 |ugs..X.c|.) This |
|000025e0| 6f 6e 65 20 69 73 20 70 | 75 62 6c 69 63 20 64 6f |one is p|ublic do|
|000025f0| 6d 61 69 6e 2e 20 59 6f | 75 20 67 65 74 20 73 6f |main. Yo|u get so|
|00002600| 75 72 63 65 2e 0a 58 0a | 58 09 61 64 20 61 2e 29 |urce..X.|X.ad a.)|
|00002610| 0a 58 09 09 48 65 72 65 | 20 61 72 65 20 72 65 73 |.X..Here| are res|
|00002620| 75 6c 74 73 20 6f 66 20 | 73 6f 6d 65 20 74 65 73 |ults of |some tes|
|00002630| 74 73 3a 0a 58 0a 58 09 | 09 6d 61 63 68 69 6e 65 |ts:.X.X.|.machine|
|00002640| 3a 20 50 43 2d 4d 58 32 | 2c 20 20 20 4f 53 3a 20 |: PC-MX2|, OS: |
|00002650| 53 49 4e 49 58 20 76 32 | 2e 31 09 09 66 69 6c 65 |SINIX v2|.1..file|
|00002660| 3a 20 2f 76 6d 73 69 6e | 69 78 09 28 32 38 39 30 |: /vmsin|ix.(2890|
|00002670| 38 34 29 0a 58 09 09 6f | 6c 64 20 3a 09 09 75 09 |84).X..o|ld :..u.|
|00002680| 34 33 2e 36 09 09 73 09 | 31 2e 31 09 09 09 3d 09 |43.6..s.|1.1...=.|
|00002690| 34 34 2e 37 0a 58 09 09 | 6e 65 77 20 3a 09 09 75 |44.7.X..|new :..u|
|000026a0| 09 20 33 2e 38 09 09 73 | 09 32 2e 33 09 09 09 3d |. 3.8..s|.2.3...=|
|000026b0| 09 20 36 2e 31 0a 58 0a | 58 09 09 6d 61 63 68 69 |. 6.1.X.|X..machi|
|000026c0| 6e 65 3a 20 56 41 58 20 | 31 31 2f 37 38 30 09 20 |ne: VAX |11/780. |
|000026d0| 20 20 4f 53 3a 20 34 2e | 33 42 53 44 20 20 20 20 | OS: 4.|3BSD |
|000026e0| 09 66 69 6c 65 3a 20 2f | 76 6d 75 6e 69 78 09 28 |.file: /|vmunix.(|
|000026f0| 33 32 39 37 32 38 29 0a | 58 09 09 6f 6c 64 20 3a |329728).|X..old :|
|00002700| 09 09 75 09 31 38 2e 30 | 09 09 73 09 32 2e 37 09 |..u.18.0|..s.2.7.|
|00002710| 09 09 3d 09 32 30 2e 37 | 0a 58 09 09 6e 65 77 20 |..=.20.7|.X..new |
|00002720| 3a 09 09 75 09 20 31 2e | 35 09 09 73 09 30 2e 39 |:..u. 1.|5..s.0.9|
|00002730| 09 09 09 3d 09 20 32 2e | 34 0a 58 0a 58 09 09 6d |...=. 2.|4.X.X..m|
|00002740| 61 63 68 69 6e 65 3a 20 | 53 55 4e 20 33 2f 32 36 |achine: |SUN 3/26|
|00002750| 30 20 09 20 20 20 4f 53 | 3a 20 53 75 6e 4f 53 20 |0 . OS|: SunOS |
|00002760| 33 2e 35 20 09 66 69 6c | 65 3a 20 2f 76 6d 75 6e |3.5 .fil|e: /vmun|
|00002770| 69 78 09 28 35 35 38 33 | 35 39 29 0a 58 09 09 6f |ix.(5583|59).X..o|
|00002780| 6c 64 20 3a 09 09 75 09 | 20 36 2e 35 09 09 73 09 |ld :..u.| 6.5..s.|
|00002790| 30 2e 36 09 09 09 3d 09 | 20 37 2e 31 0a 58 09 09 |0.6...=.| 7.1.X..|
|000027a0| 6e 65 77 20 3a 09 09 75 | 09 20 31 2e 36 09 09 73 |new :..u|. 1.6..s|
|000027b0| 09 30 2e 32 09 09 09 3d | 09 20 31 2e 38 0a 58 0a |.0.2...=|. 1.8.X.|
|000027c0| 58 09 09 6d 61 63 68 69 | 6e 65 3a 20 56 41 58 20 |X..machi|ne: VAX |
|000027d0| 36 38 30 30 20 20 09 20 | 20 20 4f 53 3a 20 55 6c |6800 . | OS: Ul|
|000027e0| 74 72 69 78 20 32 2e 31 | 09 66 69 6c 65 3a 20 2f |trix 2.1|.file: /|
|000027f0| 76 6d 75 6e 69 78 09 28 | 36 36 32 35 32 38 29 0a |vmunix.(|662528).|
|00002800| 58 09 09 6f 6c 64 20 3a | 09 09 75 09 20 35 2e 32 |X..old :|..u. 5.2|
|00002810| 09 09 73 09 30 2e 34 09 | 09 09 3d 09 20 35 2e 36 |..s.0.4.|..=. 5.6|
|00002820| 0a 58 09 09 6e 65 77 20 | 3a 09 09 75 09 20 30 2e |.X..new |:..u. 0.|
|00002830| 36 09 09 73 09 30 2e 30 | 09 09 09 3d 09 20 30 2e |6..s.0.0|...=. 0.|
|00002840| 36 0a 58 0a 58 09 09 55 | 73 65 72 2c 20 73 79 73 |6.X.X..U|ser, sys|
|00002850| 20 61 6e 64 20 74 6f 74 | 61 6c 20 74 69 6d 65 73 | and tot|al times|
|00002860| 20 69 6e 20 73 65 63 6f | 6e 64 73 2e 0a 58 0a 58 | in seco|nds..X.X|
|00002870| 09 61 64 20 62 2e 29 0a | 58 09 09 54 68 65 20 6f |.ad b.).|X..The o|
|00002880| 72 69 67 69 6e 61 6c 20 | 73 74 72 69 6e 67 73 0a |riginal |strings.|
|00002890| 58 09 09 2d 20 74 68 69 | 6e 6b 73 20 63 6f 6e 74 |X..- thi|nks cont|
|000028a0| 72 6f 6c 2d 4c 20 28 30 | 78 30 63 29 20 69 73 20 |rol-L (0|x0c) is |
|000028b0| 61 20 70 72 69 6e 74 61 | 62 6c 65 20 63 68 61 72 |a printa|ble char|
|000028c0| 61 63 74 65 72 0a 58 09 | 09 2d 20 75 6e 64 65 72 |acter.X.|.- under|
|000028d0| 20 73 6f 6d 65 20 63 69 | 72 63 75 6d 73 74 61 6e | some ci|rcumstan|
|000028e0| 63 65 73 20 74 68 69 6e | 6b 73 20 30 78 38 30 20 |ces thin|ks 0x80 |
|000028f0| 69 73 20 70 72 69 6e 74 | 61 62 6c 65 2e 20 49 6e |is print|able. In|
|00002900| 20 74 68 65 0a 58 09 09 | 20 20 70 61 63 6b 61 67 | the.X..| packag|
|00002910| 65 20 74 68 65 72 65 20 | 69 73 20 61 20 66 69 6c |e there |is a fil|
|00002920| 65 2c 20 74 65 73 74 5f | 69 6e 70 75 74 2e 20 55 |e, test_|input. U|
|00002930| 6e 70 61 63 6b 20 74 68 | 69 73 20 66 69 6c 65 20 |npack th|is file |
|00002940| 77 69 74 68 0a 58 09 09 | 20 20 61 74 6f 62 2e 20 |with.X..| atob. |
|00002950| 54 68 65 20 66 69 6c 65 | 20 6e 6f 77 20 63 6f 6e |The file| now con|
|00002960| 74 61 69 6e 73 20 73 65 | 76 65 72 61 6c 20 6c 69 |tains se|veral li|
|00002970| 6e 65 73 20 6f 66 20 63 | 68 61 72 61 63 74 65 72 |nes of c|haracter|
|00002980| 73 20 69 6e 63 6c 75 64 | 69 6e 67 0a 58 09 09 20 |s includ|ing.X.. |
|00002990| 20 61 20 6c 69 6e 65 20 | 77 69 74 68 20 63 6f 6e | a line |with con|
|000029a0| 74 72 6f 6c 2d 4c 20 61 | 6e 64 20 6f 6e 65 20 77 |trol-L a|nd one w|
|000029b0| 69 74 68 20 61 20 30 78 | 38 30 2e 20 54 68 65 20 |ith a 0x|80. The |
|000029c0| 6f 72 69 67 69 6e 61 6c | 20 73 74 72 69 6e 67 73 |original| strings|
|000029d0| 0a 58 09 09 20 20 65 72 | 72 73 20 66 6f 72 20 62 |.X.. er|rs for b|
|000029e0| 6f 74 68 20 63 61 73 65 | 73 2e 0a 58 09 09 2d 20 |oth case|s..X..- |
|000029f0| 64 69 64 20 6e 6f 74 20 | 67 65 74 20 74 68 65 20 |did not |get the |
|00002a00| 73 74 61 72 74 20 61 64 | 64 72 65 73 73 20 6f 66 |start ad|dress of|
|00002a10| 20 74 68 65 20 69 6e 69 | 74 69 61 6c 69 7a 65 64 | the ini|tialized|
|00002a20| 20 64 61 74 61 20 72 69 | 67 68 74 20 6f 6e 0a 58 | data ri|ght on.X|
|00002a30| 09 09 20 20 73 6f 6d 65 | 20 73 79 73 74 65 6d 73 |.. some| systems|
|00002a40| 2e 0a 58 09 09 2d 20 68 | 61 64 20 70 72 6f 62 6c |..X..- h|ad probl|
|00002a50| 65 6d 73 20 77 68 65 6e | 20 64 65 61 6c 69 6e 67 |ems when| dealing|
|00002a60| 20 77 69 74 68 20 74 68 | 65 20 73 74 61 6e 64 61 | with th|e standa|
|00002a70| 72 64 20 69 6e 70 75 74 | 2e 0a 58 09 09 54 68 65 |rd input|..X..The|
|00002a80| 20 66 69 72 73 74 20 74 | 77 6f 20 62 75 67 73 20 | first t|wo bugs |
|00002a90| 68 61 76 65 20 62 65 65 | 6e 20 66 6f 75 6e 64 20 |have bee|n found |
|00002aa0| 6f 6e 20 34 33 42 53 44 | 2c 20 53 75 6e 4f 53 20 |on 43BSD|, SunOS |
|00002ab0| 61 6e 64 20 55 4c 54 52 | 49 58 2c 20 74 68 65 0a |and ULTR|IX, the.|
|00002ac0| 58 09 09 74 68 69 72 64 | 20 6f 6e 6c 79 20 6f 6e |X..third| only on|
|00002ad0| 20 4d 58 32 20 53 49 4e | 49 58 20 76 32 2e 31 2e | MX2 SIN|IX v2.1.|
|00002ae0| 0a 58 0a 58 34 2e 29 20 | 57 68 61 74 20 61 62 6f |.X.X4.) |What abo|
|00002af0| 75 74 20 62 75 67 73 3f | 0a 58 0a 58 09 49 66 20 |ut bugs?|.X.X.If |
|00002b00| 79 6f 75 20 66 69 6e 64 | 20 62 75 67 73 2c 20 74 |you find| bugs, t|
|00002b10| 65 6c 6c 20 6d 65 2e 20 | 49 66 20 79 6f 75 20 66 |ell me. |If you f|
|00002b20| 69 78 65 64 20 74 68 65 | 6d 20 6f 72 20 69 66 20 |ixed the|m or if |
|00002b30| 79 6f 75 20 6d 61 64 65 | 20 61 6e 0a 58 09 65 78 |you made| an.X.ex|
|00002b40| 74 65 6e 73 69 6f 6e 20 | 77 68 69 63 68 20 72 65 |tension |which re|
|00002b50| 61 6c 6c 79 20 69 73 20 | 6f 6e 65 2c 20 64 72 6f |ally is |one, dro|
|00002b60| 70 20 6d 65 20 61 20 6e | 6f 74 65 2e 0a 58 0a 58 |p me a n|ote..X.X|
|00002b70| 35 2e 29 20 4e 6f 74 65 | 73 0a 58 0a 58 09 54 68 |5.) Note|s.X.X.Th|
|00002b80| 69 73 20 70 72 6f 67 72 | 61 6d 20 69 73 20 61 62 |is progr|am is ab|
|00002b90| 6f 75 74 20 37 20 74 69 | 6d 65 73 20 66 61 73 74 |out 7 ti|mes fast|
|00002ba0| 65 72 20 74 68 61 6e 20 | 74 68 65 20 6f 72 69 67 |er than |the orig|
|00002bb0| 6e 61 6c 20 6f 6e 65 2e | 0a 58 09 54 68 65 72 65 |nal one.|.X.There|
|00002bc0| 20 61 72 65 20 74 77 6f | 20 72 65 61 73 6f 6e 73 | are two| reasons|
|00002bd0| 20 66 6f 72 20 74 68 69 | 73 3a 0a 58 09 2d 20 49 | for thi|s:.X.- I|
|00002be0| 74 20 64 6f 65 73 20 6e | 6f 74 20 75 73 65 20 66 |t does n|ot use f|
|00002bf0| 67 65 74 63 2f 66 70 75 | 74 63 20 74 6f 20 67 65 |getc/fpu|tc to ge|
|00002c00| 74 20 6f 72 20 70 75 74 | 20 63 68 61 72 61 63 74 |t or put| charact|
|00002c10| 65 72 73 2c 20 62 75 74 | 0a 58 09 20 20 72 65 61 |ers, but|.X. rea|
|00002c20| 64 73 20 63 68 61 72 61 | 63 74 65 72 73 20 69 6e |ds chara|cters in|
|00002c30| 20 62 6c 6f 63 6b 73 2e | 20 49 74 20 64 6f 65 73 | blocks.| It does|
|00002c40| 20 6e 6f 74 20 63 6f 70 | 79 20 74 68 65 6d 20 62 | not cop|y them b|
|00002c50| 75 74 20 72 61 74 68 65 | 72 20 6d 6f 76 65 73 0a |ut rathe|r moves.|
|00002c60| 58 09 20 20 70 6f 69 6e | 74 65 72 73 20 61 72 6f |X. poin|ters aro|
|00002c70| 75 6e 64 20 6f 6e 20 74 | 68 65 20 69 6e 70 75 74 |und on t|he input|
|00002c80| 20 62 75 66 66 65 72 2e | 20 54 68 65 72 65 20 69 | buffer.| There i|
|00002c90| 73 20 6e 6f 0a 58 09 20 | 20 70 72 6f 63 65 64 75 |s no.X. | procedu|
|00002ca0| 72 65 20 63 61 6c 6c 20 | 6e 65 65 64 65 64 20 74 |re call |needed t|
|00002cb0| 6f 20 67 65 74 20 61 74 | 20 65 61 63 68 20 63 68 |o get at| each ch|
|00002cc0| 61 72 61 63 74 65 72 2e | 0a 58 09 20 20 57 68 65 |aracter.|.X. Whe|
|00002cd0| 6e 20 61 20 73 65 71 75 | 65 6e 63 65 20 69 73 20 |n a sequ|ence is |
|00002ce0| 66 6f 75 6e 64 2c 20 69 | 74 20 69 73 20 70 75 74 |found, i|t is put|
|00002cf0| 20 69 6e 74 6f 20 74 68 | 65 20 6f 75 74 70 75 74 | into th|e output|
|00002d00| 20 62 75 66 66 65 72 20 | 69 6e 20 6f 6e 65 0a 58 | buffer |in one.X|
|00002d10| 09 20 20 62 6c 6f 63 6b | 2c 20 74 68 75 73 20 74 |. block|, thus t|
|00002d20| 68 65 72 65 20 69 73 20 | 6e 6f 20 6e 65 65 64 2c |here is |no need,|
|00002d30| 20 6c 69 6b 65 20 69 6e | 20 66 70 75 74 63 2c 20 | like in| fputc, |
|00002d40| 74 6f 20 63 68 65 63 6b | 20 66 6f 72 20 70 6f 73 |to check| for pos|
|00002d50| 73 69 62 6c 65 0a 58 09 | 20 20 6f 76 65 72 66 6c |sible.X.| overfl|
|00002d60| 6f 77 20 66 6f 72 20 65 | 61 63 68 20 63 68 61 72 |ow for e|ach char|
|00002d70| 61 63 74 65 72 2e 0a 58 | 09 2d 20 57 68 65 6e 20 |acter..X|.- When |
|00002d80| 74 68 65 20 70 72 6f 67 | 72 61 6d 20 73 65 61 72 |the prog|ram sear|
|00002d90| 63 68 65 73 20 66 6f 72 | 20 61 20 73 65 71 75 65 |ches for| a seque|
|00002da0| 6e 63 65 20 6f 66 20 70 | 72 69 6e 74 61 62 6c 65 |nce of p|rintable|
|00002db0| 20 63 68 61 72 61 63 74 | 65 72 73 0a 58 09 20 20 | charact|ers.X. |
|00002dc0| 69 74 20 6f 6e 6c 79 20 | 65 78 61 6d 69 6e 65 73 |it only |examines|
|00002dd0| 20 65 61 63 68 20 6d 69 | 6e 5f 73 74 72 5f 6c 65 | each mi|n_str_le|
|00002de0| 6e 20 63 68 61 72 61 63 | 74 65 72 20 69 6e 73 74 |n charac|ter inst|
|00002df0| 65 61 64 20 6f 66 20 65 | 61 63 68 20 6f 6e 65 2e |ead of e|ach one.|
|00002e00| 0a 58 20 09 20 20 6d 69 | 6e 5f 73 74 72 5f 6c 65 |.X . mi|n_str_le|
|00002e10| 6e 20 64 65 66 61 75 6c | 74 73 20 74 6f 20 34 20 |n defaul|ts to 4 |
|00002e20| 61 6e 64 20 63 61 6e 20 | 62 65 20 73 65 74 20 77 |and can |be set w|
|00002e30| 69 74 68 20 63 6f 6d 6d | 61 6e 64 20 6c 69 6e 65 |ith comm|and line|
|00002e40| 20 6f 70 74 69 6f 6e 0a | 58 09 20 20 6c 69 6b 65 | option.|X. like|
|00002e50| 20 22 73 74 72 69 6e 67 | 73 20 2d 33 22 2e 0a 58 | "string|s -3"..X|
|00002e60| 0a 58 09 49 74 20 63 61 | 6e 20 62 65 20 73 70 65 |.X.It ca|n be spe|
|00002e70| 64 20 75 70 20 73 6f 6d | 65 20 6d 6f 72 65 2c 20 |d up som|e more, |
|00002e80| 62 75 74 20 74 68 65 6e | 20 69 74 20 77 6f 75 6c |but then| it woul|
|00002e90| 64 20 62 65 20 64 69 66 | 66 69 63 75 6c 74 20 74 |d be dif|ficult t|
|00002ea0| 6f 20 70 6f 72 74 0a 58 | 09 69 74 20 74 6f 20 64 |o port.X|.it to d|
|00002eb0| 69 66 66 65 72 65 6e 74 | 20 73 79 73 74 65 6d 73 |ifferent| systems|
|00002ec0| 2e 0a 58 09 45 78 61 6d | 70 6c 65 3a 0a 58 09 43 |..X.Exam|ple:.X.C|
|00002ed0| 75 72 72 65 6e 74 6c 79 | 20 74 68 65 20 70 72 6f |urrently| the pro|
|00002ee0| 67 72 61 6d 20 74 61 6b | 65 73 20 36 2e 30 20 73 |gram tak|es 6.0 s|
|00002ef0| 65 63 6f 6e 64 73 20 6f | 6e 20 4d 58 32 20 66 6f |econds o|n MX2 fo|
|00002f00| 72 20 2f 76 6d 73 69 6e | 69 78 2e 0a 58 09 54 68 |r /vmsin|ix..X.Th|
|00002f10| 65 20 69 6d 70 72 6f 76 | 65 64 20 76 65 72 73 69 |e improv|ed versi|
|00002f20| 6f 6e 20 6f 6e 6c 79 20 | 6e 65 65 64 73 20 35 2e |on only |needs 5.|
|00002f30| 35 20 73 65 63 6f 6e 64 | 73 2e 20 49 74 20 69 73 |5 second|s. It is|
|00002f40| 20 61 6c 73 6f 20 6d 75 | 63 68 20 73 6d 61 6c 6c | also mu|ch small|
|00002f50| 65 72 3a 0a 58 09 36 39 | 37 36 20 62 79 74 65 73 |er:.X.69|76 bytes|
|00002f60| 20 63 6f 6d 70 61 72 65 | 64 20 74 6f 20 31 30 35 | compare|d to 105|
|00002f70| 39 36 2e 0a 58 09 57 61 | 79 73 20 74 6f 20 69 6d |96..X.Wa|ys to im|
|00002f80| 70 72 6f 76 65 20 74 68 | 65 20 70 72 6f 67 72 61 |prove th|e progra|
|00002f90| 6d 3a 0a 58 09 2d 20 4f | 6e 20 73 6f 6d 65 20 6d |m:.X.- O|n some m|
|00002fa0| 61 63 68 69 6e 65 73 20 | 61 6e 6f 74 68 65 72 20 |achines |another |
|00002fb0| 6d 65 74 68 6f 64 20 74 | 6f 20 74 65 73 74 20 77 |method t|o test w|
|00002fc0| 68 65 74 68 65 72 20 61 | 20 63 68 61 72 61 63 74 |hether a| charact|
|00002fd0| 65 72 20 69 73 20 70 72 | 69 6e 74 61 62 6c 65 0a |er is pr|intable.|
|00002fe0| 58 09 20 20 77 69 6c 6c | 20 62 65 20 66 61 73 74 |X. will| be fast|
|00002ff0| 65 72 2e 20 4e 6f 77 20 | 74 68 65 20 70 72 6f 67 |er. Now |the prog|
|00003000| 72 61 6d 20 75 73 65 73 | 20 61 6e 20 61 72 72 61 |ram uses| an arra|
|00003010| 79 20 28 69 73 70 29 2c | 20 75 73 65 73 20 61 20 |y (isp),| uses a |
|00003020| 63 68 61 72 61 63 74 65 | 72 0a 58 09 20 20 63 61 |characte|r.X. ca|
|00003030| 73 74 20 74 6f 20 61 20 | 28 73 69 67 6e 65 64 29 |st to a |(signed)|
|00003040| 20 69 6e 74 65 67 65 72 | 20 61 73 20 69 6e 64 65 | integer| as inde|
|00003050| 78 20 69 6e 74 6f 20 74 | 68 69 73 20 61 72 72 61 |x into t|his arra|
|00003060| 79 20 28 69 73 70 5f 6d | 69 64 20 69 73 20 74 68 |y (isp_m|id is th|
|00003070| 65 0a 58 09 20 20 62 61 | 73 65 20 66 72 6f 6d 20 |e.X. ba|se from |
|00003080| 77 68 69 63 68 20 6f 66 | 66 73 65 74 73 20 61 72 |which of|fsets ar|
|00003090| 65 20 63 6f 6d 70 75 74 | 65 64 29 2e 0a 58 09 20 |e comput|ed)..X. |
|000030a0| 20 4f 6e 20 4d 58 32 2c | 20 61 6e 64 2c 20 69 66 | On MX2,| and, if|
|000030b0| 20 49 20 62 65 6c 69 65 | 76 65 20 6d 79 20 74 65 | I belie|ve my te|
|000030c0| 73 74 73 2c 20 6f 6e 20 | 56 41 58 2c 20 69 74 20 |sts, on |VAX, it |
|000030d0| 69 73 20 66 61 73 74 65 | 72 2c 20 74 6f 20 75 73 |is faste|r, to us|
|000030e0| 65 0a 58 09 20 20 75 6e | 73 69 67 6e 65 64 20 63 |e.X. un|signed c|
|000030f0| 68 61 72 61 63 74 65 72 | 73 20 61 73 20 69 6e 64 |haracter|s as ind|
|00003100| 65 78 20 69 6e 74 6f 20 | 74 68 69 73 20 61 72 72 |ex into |this arr|
|00003110| 61 79 2e 0a 58 09 20 20 | 49 66 20 79 6f 75 20 77 |ay..X. |If you w|
|00003120| 61 6e 74 20 74 6f 20 70 | 6c 61 79 20 61 72 6f 75 |ant to p|lay arou|
|00003130| 6e 64 20 77 69 74 68 20 | 74 68 69 73 2c 20 6a 75 |nd with |this, ju|
|00003140| 73 74 20 63 68 61 6e 67 | 65 20 43 48 41 52 5f 54 |st chang|e CHAR_T|
|00003150| 59 50 45 20 74 6f 0a 58 | 09 20 20 27 75 6e 73 69 |YPE to.X|. 'unsi|
|00003160| 67 6e 65 64 20 62 79 74 | 65 27 20 61 6e 64 20 64 |gned byt|e' and d|
|00003170| 65 66 69 6e 65 20 74 68 | 65 20 6d 61 63 72 6f 20 |efine th|e macro |
|00003180| 49 53 5f 50 52 49 4e 54 | 41 42 4c 45 20 61 63 63 |IS_PRINT|ABLE acc|
|00003190| 6f 72 64 69 6e 67 6c 79 | 20 74 6f 0a 58 09 20 20 |ordingly| to.X. |
|000031a0| 27 28 69 73 70 5b 63 5d | 29 27 0a 58 09 2d 20 49 |'(isp[c]|)'.X.- I|
|000031b0| 74 20 6d 61 6b 65 73 20 | 61 20 64 69 66 66 65 72 |t makes |a differ|
|000031c0| 65 6e 63 65 20 28 61 6c | 74 68 6f 75 67 68 20 61 |ence (al|though a|
|000031d0| 20 73 6d 61 6c 6c 20 6f | 6e 65 29 2c 20 77 68 61 | small o|ne), wha|
|000031e0| 74 20 62 61 73 69 63 20 | 74 79 70 65 20 79 6f 75 |t basic |type you|
|000031f0| 0a 58 09 20 20 63 68 6f | 6f 73 65 20 66 6f 72 20 |.X. cho|ose for |
|00003200| 74 68 65 20 69 73 70 20 | 61 72 72 61 79 2e 20 4f |the isp |array. O|
|00003210| 6e 20 4d 58 32 20 73 68 | 6f 72 74 20 69 73 20 62 |n MX2 sh|ort is b|
|00003220| 65 73 74 2c 20 62 75 74 | 20 63 68 61 72 20 69 73 |est, but| char is|
|00003230| 20 6e 65 61 72 6c 79 0a | 58 09 20 20 61 73 20 67 | nearly.|X. as g|
|00003240| 6f 6f 64 2e 0a 58 09 2d | 20 59 6f 75 20 63 61 6e |ood..X.-| You can|
|00003250| 20 6d 61 6b 65 20 69 74 | 20 73 6d 61 6c 6c 65 72 | make it| smaller|
|00003260| 2e 20 54 68 65 20 70 72 | 6f 67 72 61 6d 20 64 6f |. The pr|ogram do|
|00003270| 65 73 20 6e 6f 74 20 6e | 65 65 64 20 73 74 64 69 |es not n|eed stdi|
|00003280| 6f 2e 20 42 75 74 0a 58 | 09 20 20 65 78 69 74 20 |o. But.X|. exit |
|00003290| 6e 6f 72 6d 61 6c 6c 79 | 20 63 6c 6f 73 65 73 20 |normally| closes |
|000032a0| 66 69 6c 65 20 64 65 73 | 63 72 69 70 74 6f 72 73 |file des|criptors|
|000032b0| 2c 20 61 6e 64 20 74 68 | 65 72 65 66 6f 72 65 20 |, and th|erefore |
|000032c0| 69 6e 63 6c 75 64 65 73 | 20 61 0a 58 09 20 20 6c |includes| a.X. l|
|000032d0| 61 72 67 65 20 70 61 72 | 74 20 6f 66 20 74 68 65 |arge par|t of the|
|000032e0| 20 73 74 64 69 6f 20 73 | 74 75 66 66 2e 20 57 65 | stdio s|tuff. We|
|000032f0| 6c 6c 2c 20 61 62 6f 75 | 74 20 34 20 4b 20 6f 6e |ll, abou|t 4 K on|
|00003300| 20 73 6f 6d 65 20 73 79 | 73 74 65 6d 73 2e 0a 58 | some sy|stems..X|
|00003310| 09 20 20 49 66 20 79 6f | 75 20 6b 6e 6f 77 20 77 |. If yo|u know w|
|00003320| 68 61 74 20 79 6f 75 72 | 20 65 78 69 74 20 64 6f |hat your| exit do|
|00003330| 65 73 2c 20 79 6f 75 20 | 63 61 6e 20 73 75 62 73 |es, you |can subs|
|00003340| 74 69 74 75 74 65 20 61 | 20 73 75 69 74 61 62 6c |titute a| suitabl|
|00003350| 65 0a 58 09 20 20 72 6f | 75 74 69 6e 65 20 6f 66 |e.X. ro|utine of|
|00003360| 20 79 6f 75 72 20 6f 77 | 6e 2e 20 45 2e 67 2e 20 | your ow|n. E.g. |
|00003370| 6f 6e 20 4d 58 32 2c 20 | 65 78 69 74 20 63 61 6c |on MX2, |exit cal|
|00003380| 6c 73 20 5f 63 6c 65 61 | 6e 75 70 2c 20 77 68 69 |ls _clea|nup, whi|
|00003390| 63 68 0a 58 09 20 20 6f | 6e 6c 79 20 63 6c 6f 73 |ch.X. o|nly clos|
|000033a0| 65 73 20 61 6c 6c 20 6f | 70 65 6e 20 66 69 6c 65 |es all o|pen file|
|000033b0| 20 64 65 73 63 72 69 70 | 74 6f 72 73 2e 20 41 73 | descrip|tors. As|
|000033c0| 20 49 20 6b 6e 6f 77 20 | 74 68 61 74 20 6f 6e 6c | I know |that onl|
|000033d0| 79 20 74 68 65 0a 58 09 | 20 20 73 74 61 6e 64 61 |y the.X.| standa|
|000033e0| 72 64 20 64 65 73 63 72 | 69 70 74 6f 72 73 20 61 |rd descr|iptors a|
|000033f0| 72 65 20 6f 70 65 6e 20 | 61 74 20 74 68 65 20 65 |re open |at the e|
|00003400| 6e 64 20 6f 66 20 74 68 | 65 20 70 72 6f 67 72 61 |nd of th|e progra|
|00003410| 6d 2c 20 49 20 63 61 6e | 0a 58 09 20 20 77 72 69 |m, I can|.X. wri|
|00003420| 74 65 20 61 20 5f 63 6c | 65 61 6e 75 70 20 77 68 |te a _cl|eanup wh|
|00003430| 69 63 68 20 6f 6e 6c 79 | 20 64 6f 65 73 20 61 20 |ich only| does a |
|00003440| 63 6c 6f 73 65 20 6f 6e | 20 30 2c 20 31 2c 20 61 |close on| 0, 1, a|
|00003450| 6e 64 20 32 2e 0a 58 0a | 58 09 54 68 65 20 73 61 |nd 2..X.|X.The sa|
|00003460| 76 69 6e 67 73 20 74 68 | 61 74 20 79 6f 75 20 67 |vings th|at you g|
|00003470| 65 74 20 61 72 65 20 61 | 6c 6d 6f 73 74 20 69 6e |et are a|lmost in|
|00003480| 76 69 73 69 62 6c 65 2c | 20 74 68 65 79 20 61 72 |visible,| they ar|
|00003490| 65 20 6e 6f 74 20 65 61 | 73 69 6c 79 0a 58 09 70 |e not ea|sily.X.p|
|000034a0| 6f 72 74 61 62 6c 65 2c | 20 62 75 74 20 72 61 74 |ortable,| but rat|
|000034b0| 68 65 72 20 72 65 71 75 | 69 72 65 20 61 20 63 65 |her requ|ire a ce|
|000034c0| 72 74 61 69 6e 20 61 6d | 6f 75 6e 74 20 6f 66 20 |rtain am|ount of |
|000034d0| 72 65 73 65 61 72 63 68 | 20 6f 6e 20 70 61 72 74 |research| on part|
|000034e0| 0a 58 09 6f 66 20 74 68 | 65 20 70 65 72 73 6f 6e |.X.of th|e person|
|000034f0| 20 64 6f 69 6e 67 20 74 | 68 65 20 20 70 6f 72 74 | doing t|he port|
|00003500| 69 6e 67 2e 20 49 20 63 | 68 6f 73 65 20 6e 6f 74 |ing. I c|hose not|
|00003510| 20 74 6f 20 66 69 74 20 | 74 68 65 20 70 72 6f 67 | to fit |the prog|
|00003520| 72 61 6d 73 20 77 69 74 | 68 0a 58 09 6f 70 74 69 |rams wit|h.X.opti|
|00003530| 6f 6e 73 20 74 6f 20 61 | 64 6a 75 73 74 20 74 68 |ons to a|djust th|
|00003540| 65 73 65 20 74 68 69 6e | 67 73 2e 0a 58 0a 58 09 |ese thin|gs..X.X.|
|00003550| 54 68 65 72 65 20 61 72 | 65 20 73 74 69 6c 6c 20 |There ar|e still |
|00003560| 73 6f 6d 65 20 44 45 42 | 55 47 20 73 74 61 74 65 |some DEB|UG state|
|00003570| 6d 65 6e 74 73 20 69 6e | 20 74 68 65 20 63 6f 64 |ments in| the cod|
|00003580| 65 2e 20 59 6f 75 20 67 | 65 74 20 74 68 65 6d 0a |e. You g|et them.|
|00003590| 58 09 69 66 20 79 6f 75 | 20 73 65 74 20 44 45 42 |X.if you| set DEB|
|000035a0| 55 47 46 4c 41 47 53 3d | 2d 44 44 45 42 55 47 2e |UGFLAGS=|-DDEBUG.|
|000035b0| 0a 58 0a 58 36 2e 29 20 | 53 74 61 74 75 73 0a 58 |.X.X6.) |Status.X|
|000035c0| 0a 58 09 54 68 69 73 20 | 70 72 6f 67 72 61 6d 20 |.X.This |program |
|000035d0| 69 73 20 70 6c 61 63 65 | 64 20 69 6e 74 6f 20 74 |is place|d into t|
|000035e0| 68 65 20 70 75 62 6c 69 | 63 20 64 6f 6d 61 69 6e |he publi|c domain|
|000035f0| 2e 0a 58 09 54 68 65 20 | 43 6f 70 79 72 69 67 68 |..X.The |Copyrigh|
|00003600| 74 20 4e 6f 74 69 63 65 | 20 69 6e 20 43 4f 50 59 |t Notice| in COPY|
|00003610| 49 4e 47 20 61 70 70 6c | 69 65 73 2e 0a 58 0a 58 |ING appl|ies..X.X|
|00003620| 41 62 73 6f 72 62 2c 20 | 61 70 70 6c 79 20 61 6e |Absorb, |apply an|
|00003630| 64 20 65 6e 6a 6f 79 2c | 0a 58 09 09 4d 69 63 68 |d enjoy,|.X..Mich|
|00003640| 61 65 6c 20 47 72 65 69 | 6d 0a 45 4e 44 5f 4f 46 |ael Grei|m.END_OF|
|00003650| 5f 46 49 4c 45 0a 69 66 | 20 74 65 73 74 20 37 36 |_FILE.if| test 76|
|00003660| 30 31 20 2d 6e 65 20 60 | 77 63 20 2d 63 20 3c 27 |01 -ne `|wc -c <'|
|00003670| 52 45 41 44 4d 45 27 60 | 3b 20 74 68 65 6e 0a 20 |README'`|; then. |
|00003680| 20 20 20 65 63 68 6f 20 | 73 68 61 72 3a 20 5c 22 | echo |shar: \"|
|00003690| 27 52 45 41 44 4d 45 27 | 5c 22 20 75 6e 70 61 63 |'README'|\" unpac|
|000036a0| 6b 65 64 20 77 69 74 68 | 20 77 72 6f 6e 67 20 73 |ked with| wrong s|
|000036b0| 69 7a 65 21 0a 66 69 0a | 23 20 65 6e 64 20 6f 66 |ize!.fi.|# end of|
|000036c0| 20 27 52 45 41 44 4d 45 | 27 0a 66 69 0a 69 66 20 | 'README|'.fi.if |
|000036d0| 74 65 73 74 20 2d 66 20 | 27 63 6f 6e 66 69 67 2e |test -f |'config.|
|000036e0| 68 27 20 2d 61 20 22 24 | 7b 31 7d 22 20 21 3d 20 |h' -a "$|{1}" != |
|000036f0| 22 2d 63 22 20 3b 20 74 | 68 65 6e 20 0a 20 20 65 |"-c" ; t|hen . e|
|00003700| 63 68 6f 20 73 68 61 72 | 3a 20 57 69 6c 6c 20 6e |cho shar|: Will n|
|00003710| 6f 74 20 63 6c 6f 62 62 | 65 72 20 65 78 69 73 74 |ot clobb|er exist|
|00003720| 69 6e 67 20 66 69 6c 65 | 20 5c 22 27 63 6f 6e 66 |ing file| \"'conf|
|00003730| 69 67 2e 68 27 5c 22 0a | 65 6c 73 65 0a 65 63 68 |ig.h'\".|else.ech|
|00003740| 6f 20 73 68 61 72 3a 20 | 45 78 74 72 61 63 74 69 |o shar: |Extracti|
|00003750| 6e 67 20 5c 22 27 63 6f | 6e 66 69 67 2e 68 27 5c |ng \"'co|nfig.h'\|
|00003760| 22 20 5c 28 32 37 36 35 | 20 63 68 61 72 61 63 74 |" \(2765| charact|
|00003770| 65 72 73 5c 29 0a 73 65 | 64 20 22 73 2f 5e 58 2f |ers\).se|d "s/^X/|
|00003780| 2f 22 20 3e 27 63 6f 6e | 66 69 67 2e 68 27 20 3c |/" >'con|fig.h' <|
|00003790| 3c 27 45 4e 44 5f 4f 46 | 5f 46 49 4c 45 27 0a 58 |<'END_OF|_FILE'.X|
|000037a0| 2f 2a 0a 58 20 2a 20 54 | 68 69 73 20 66 69 6c 65 |/*.X * T|his file|
|000037b0| 20 69 73 20 75 73 65 64 | 20 77 69 74 68 69 6e 20 | is used| within |
|000037c0| 73 74 72 69 6e 67 73 2e | 0a 58 20 2a 20 59 6f 75 |strings.|.X * You|
|000037d0| 20 63 61 6e 20 61 64 64 | 20 73 70 65 63 69 66 69 | can add| specifi|
|000037e0| 63 20 64 65 66 69 6e 65 | 73 20 66 6f 72 20 61 20 |c define|s for a |
|000037f0| 6d 61 63 68 69 6e 65 20 | 62 65 6c 6f 77 2e 20 44 |machine |below. D|
|00003800| 65 66 69 6e 65 20 6e 65 | 69 74 68 65 72 0a 58 20 |efine ne|ither.X |
|00003810| 2a 20 53 41 46 45 54 59 | 5f 46 49 52 53 54 20 6e |* SAFETY|_FIRST n|
|00003820| 6f 72 20 55 53 45 5f 55 | 53 45 52 5f 44 45 46 49 |or USE_U|SER_DEFI|
|00003830| 4e 45 53 0a 58 20 2a 20 | 44 65 66 69 6e 65 73 20 |NES.X * |Defines |
|00003840| 66 6f 72 20 79 6f 75 72 | 20 63 75 72 72 65 6e 74 |for your| current|
|00003850| 20 6d 61 63 68 69 6e 65 | 20 73 68 6f 75 6c 64 20 | machine| should |
|00003860| 67 6f 20 69 6e 20 74 75 | 6e 65 2e 68 2e 20 44 65 |go in tu|ne.h. De|
|00003870| 66 69 6e 65 0a 58 20 2a | 20 55 53 45 5f 55 53 45 |fine.X *| USE_USE|
|00003880| 52 5f 44 45 46 49 4e 45 | 53 2e 0a 58 20 2a 0a 58 |R_DEFINE|S..X *.X|
|00003890| 20 2a 20 73 63 63 73 69 | 64 20 3a 20 40 28 23 29 | * sccsi|d : @(#)|
|000038a0| 20 20 63 6f 6e 66 69 67 | 2e 68 20 20 28 76 36 2e | config|.h (v6.|
|000038b0| 35 20 35 2f 32 32 2f 38 | 39 29 0a 58 20 2a 0a 58 |5 5/22/8|9).X *.X|
|000038c0| 20 2a 20 46 4f 55 4e 44 | 20 77 69 6c 6c 20 63 6f | * FOUND| will co|
|000038d0| 6e 74 61 69 6e 20 61 20 | 73 74 72 69 6e 67 20 74 |ntain a |string t|
|000038e0| 65 6c 6c 69 6e 67 20 77 | 68 61 74 20 64 65 66 69 |elling w|hat defi|
|000038f0| 6e 65 73 20 68 61 76 65 | 20 62 65 65 6e 20 75 73 |nes have| been us|
|00003900| 65 64 2e 0a 58 20 2a 2f | 0a 58 0a 58 23 20 69 66 |ed..X */|.X.X# if|
|00003910| 6e 64 65 66 20 53 41 46 | 45 54 59 5f 46 49 52 53 |ndef SAF|ETY_FIRS|
|00003920| 54 0a 58 23 09 69 66 64 | 65 66 20 55 53 45 5f 55 |T.X#.ifd|ef USE_U|
|00003930| 53 45 52 5f 44 45 46 49 | 4e 45 53 0a 58 23 09 09 |SER_DEFI|NES.X#..|
|00003940| 64 65 66 69 6e 65 20 46 | 4f 55 4e 44 09 09 22 55 |define F|OUND.."U|
|00003950| 73 69 6e 67 20 74 68 65 | 20 75 73 65 72 20 64 65 |sing the| user de|
|00003960| 66 69 6e 65 73 2e 22 0a | 58 23 09 09 69 6e 63 6c |fines.".|X#..incl|
|00003970| 75 64 65 20 22 74 75 6e | 65 2e 68 22 0a 58 23 09 |ude "tun|e.h".X#.|
|00003980| 65 6c 73 65 20 55 53 45 | 5f 55 53 45 52 5f 44 45 |else USE|_USER_DE|
|00003990| 46 49 4e 45 53 0a 58 09 | 09 2f 2a 0a 58 09 09 20 |FINES.X.|./*.X.. |
|000039a0| 2a 20 41 64 64 20 28 61 | 6c 6c 29 20 64 65 66 69 |* Add (a|ll) defi|
|000039b0| 6e 65 73 20 66 6f 72 20 | 79 6f 75 72 20 6d 61 63 |nes for |your mac|
|000039c0| 68 69 6e 65 20 68 65 72 | 65 2e 0a 58 09 09 20 2a |hine her|e..X.. *|
|000039d0| 2f 0a 58 23 09 09 69 66 | 20 64 65 66 69 6e 65 64 |/.X#..if| defined|
|000039e0| 28 6e 73 63 33 32 30 30 | 30 29 20 26 26 20 64 65 |(nsc3200|0) && de|
|000039f0| 66 69 6e 65 64 28 73 69 | 6e 69 78 29 20 26 26 20 |fined(si|nix) && |
|00003a00| 64 65 66 69 6e 65 64 28 | 6e 73 31 36 30 30 30 29 |defined(|ns16000)|
|00003a10| 0a 58 23 09 09 09 64 65 | 66 69 6e 65 20 46 4f 55 |.X#...de|fine FOU|
|00003a20| 4e 44 09 09 09 09 09 09 | 22 55 73 69 6e 67 20 64 |ND......|"Using d|
|00003a30| 65 66 61 75 6c 74 73 20 | 66 6f 72 20 73 69 6e 69 |efaults |for sini|
|00003a40| 78 20 4d 58 32 2e 22 0a | 58 23 09 09 09 64 65 66 |x MX2.".|X#...def|
|00003a50| 69 6e 65 20 46 43 4e 54 | 4c 09 09 09 09 09 09 32 |ine FCNT|L......2|
|00003a60| 0a 58 23 09 09 09 64 65 | 66 69 6e 65 20 46 41 53 |.X#...de|fine FAS|
|00003a70| 54 5f 43 4f 50 59 28 66 | 72 6f 6d 2c 74 6f 2c 63 |T_COPY(f|rom,to,c|
|00003a80| 6f 75 6e 74 29 09 09 62 | 63 6f 70 79 28 66 72 6f |ount)..b|copy(fro|
|00003a90| 6d 2c 74 6f 2c 63 6f 75 | 6e 74 29 0a 58 23 09 09 |m,to,cou|nt).X#..|
|00003aa0| 09 64 65 66 69 6e 65 20 | 57 48 41 54 5f 4c 53 45 |.define |WHAT_LSE|
|00003ab0| 45 4b 09 09 09 09 09 31 | 0a 58 23 09 09 09 64 65 |EK.....1|.X#...de|
|00003ac0| 66 69 6e 65 20 49 5f 53 | 50 45 43 49 41 4c 0a 58 |fine I_S|PECIAL.X|
|00003ad0| 23 09 09 09 64 65 66 69 | 6e 65 20 49 4e 5f 42 55 |#...defi|ne IN_BU|
|00003ae0| 46 5f 4c 45 4e 09 09 09 | 09 09 31 30 32 34 0a 58 |F_LEN...|..1024.X|
|00003af0| 23 09 09 09 64 65 66 69 | 6e 65 20 4f 55 54 5f 42 |#...defi|ne OUT_B|
|00003b00| 55 46 5f 4c 45 4e 09 09 | 09 09 09 38 31 39 32 0a |UF_LEN..|...8192.|
|00003b10| 58 23 09 09 09 64 65 66 | 69 6e 65 20 54 48 52 45 |X#...def|ine THRE|
|00003b20| 53 48 4f 4c 44 09 09 09 | 09 09 31 30 32 34 0a 58 |SHOLD...|..1024.X|
|00003b30| 23 09 09 65 6e 64 69 66 | 20 2f 2a 20 6e 73 63 33 |#..endif| /* nsc3|
|00003b40| 32 30 30 30 20 26 26 20 | 73 69 6e 69 78 20 26 26 |2000 && |sinix &&|
|00003b50| 20 6e 73 31 36 30 30 30 | 20 2a 2f 0a 58 23 09 09 | ns16000| */.X#..|
|00003b60| 69 66 20 64 65 66 69 6e | 65 64 28 75 6e 69 78 29 |if defin|ed(unix)|
|00003b70| 20 26 26 20 64 65 66 69 | 6e 65 64 28 76 61 78 29 | && defi|ned(vax)|
|00003b80| 20 26 26 20 21 64 65 66 | 69 6e 65 64 28 75 6c 74 | && !def|ined(ult|
|00003b90| 72 69 78 29 0a 58 23 09 | 09 09 64 65 66 69 6e 65 |rix).X#.|..define|
|00003ba0| 20 46 4f 55 4e 44 09 09 | 09 09 09 09 22 55 73 69 | FOUND..|...."Usi|
|00003bb0| 6e 67 20 64 65 66 61 75 | 6c 74 73 20 66 6f 72 20 |ng defau|lts for |
|00003bc0| 56 41 58 20 28 42 53 44 | 3f 29 2e 22 0a 58 23 09 |VAX (BSD|?).".X#.|
|00003bd0| 09 09 64 65 66 69 6e 65 | 20 46 43 4e 54 4c 09 09 |..define| FCNTL..|
|00003be0| 09 09 09 09 31 0a 58 23 | 09 09 09 64 65 66 69 6e |....1.X#|...defin|
|00003bf0| 65 20 46 41 53 54 5f 43 | 4f 50 59 28 66 72 6f 6d |e FAST_C|OPY(from|
|00003c00| 2c 74 6f 2c 63 6f 75 6e | 74 29 09 09 62 63 6f 70 |,to,coun|t)..bcop|
|00003c10| 79 28 66 72 6f 6d 2c 74 | 6f 2c 63 6f 75 6e 74 29 |y(from,t|o,count)|
|00003c20| 0a 58 23 09 09 09 64 65 | 66 69 6e 65 20 57 48 41 |.X#...de|fine WHA|
|00003c30| 54 5f 4c 53 45 45 4b 09 | 09 09 09 09 31 0a 58 23 |T_LSEEK.|....1.X#|
|00003c40| 09 09 09 64 65 66 69 6e | 65 20 49 5f 53 50 45 43 |...defin|e I_SPEC|
|00003c50| 49 41 4c 0a 58 23 09 09 | 09 64 65 66 69 6e 65 20 |IAL.X#..|.define |
|00003c60| 49 4e 5f 42 55 46 5f 4c | 45 4e 09 09 09 09 09 34 |IN_BUF_L|EN.....4|
|00003c70| 30 39 36 0a 58 23 09 09 | 09 64 65 66 69 6e 65 20 |096.X#..|.define |
|00003c80| 4f 55 54 5f 42 55 46 5f | 4c 45 4e 09 09 09 09 09 |OUT_BUF_|LEN.....|
|00003c90| 31 36 33 38 34 0a 58 23 | 09 09 09 64 65 66 69 6e |16384.X#|...defin|
|00003ca0| 65 20 54 48 52 45 53 48 | 4f 4c 44 09 09 09 09 09 |e THRESH|OLD.....|
|00003cb0| 34 30 39 36 0a 58 23 09 | 09 65 6e 64 69 66 20 2f |4096.X#.|.endif /|
|00003cc0| 2a 20 76 61 78 20 2a 2f | 0a 58 23 09 09 69 66 20 |* vax */|.X#..if |
|00003cd0| 64 65 66 69 6e 65 64 28 | 75 6e 69 78 29 20 26 26 |defined(|unix) &&|
|00003ce0| 20 64 65 66 69 6e 65 64 | 28 73 75 6e 29 20 26 26 | defined|(sun) &&|
|00003cf0| 20 64 65 66 69 6e 65 64 | 28 6d 63 36 38 30 32 30 | defined|(mc68020|
|00003d00| 29 0a 58 23 09 09 09 64 | 65 66 69 6e 65 20 46 4f |).X#...d|efine FO|
|00003d10| 55 4e 44 09 09 09 09 09 | 09 22 55 73 69 6e 67 20 |UND.....|."Using |
|00003d20| 64 65 66 61 75 6c 74 73 | 20 66 6f 72 20 53 55 4e |defaults| for SUN|
|00003d30| 20 28 53 55 4e 20 4f 53 | 20 33 2e 2a 29 2e 22 0a | (SUN OS| 3.*).".|
|00003d40| 58 23 09 09 09 64 65 66 | 69 6e 65 20 46 43 4e 54 |X#...def|ine FCNT|
|00003d50| 4c 09 09 09 09 09 09 31 | 0a 58 23 09 09 09 64 65 |L......1|.X#...de|
|00003d60| 66 69 6e 65 20 46 41 53 | 54 5f 43 4f 50 59 28 66 |fine FAS|T_COPY(f|
|00003d70| 72 6f 6d 2c 74 6f 2c 63 | 6f 75 6e 74 29 09 09 62 |rom,to,c|ount)..b|
|00003d80| 63 6f 70 79 28 66 72 6f | 6d 2c 74 6f 2c 63 6f 75 |copy(fro|m,to,cou|
|00003d90| 6e 74 29 0a 58 23 09 09 | 09 64 65 66 69 6e 65 20 |nt).X#..|.define |
|00003da0| 57 48 41 54 5f 4c 53 45 | 45 4b 09 09 09 09 09 31 |WHAT_LSE|EK.....1|
|00003db0| 0a 58 23 09 09 09 64 65 | 66 69 6e 65 20 49 5f 53 |.X#...de|fine I_S|
|00003dc0| 50 45 43 49 41 4c 0a 58 | 23 09 09 09 64 65 66 69 |PECIAL.X|#...defi|
|00003dd0| 6e 65 20 49 4e 5f 42 55 | 46 5f 4c 45 4e 09 09 09 |ne IN_BU|F_LEN...|
|00003de0| 09 09 34 30 39 36 0a 58 | 23 09 09 09 64 65 66 69 |..4096.X|#...defi|
|00003df0| 6e 65 20 4f 55 54 5f 42 | 55 46 5f 4c 45 4e 09 09 |ne OUT_B|UF_LEN..|
|00003e00| 09 09 09 31 36 33 38 34 | 0a 58 23 09 09 09 64 65 |...16384|.X#...de|
|00003e10| 66 69 6e 65 20 54 48 52 | 45 53 48 4f 4c 44 09 09 |fine THR|ESHOLD..|
|00003e20| 09 09 09 34 30 39 36 0a | 58 23 09 09 65 6e 64 69 |...4096.|X#..endi|
|00003e30| 66 20 2f 2a 20 73 75 6e | 20 2a 2f 0a 58 23 09 09 |f /* sun| */.X#..|
|00003e40| 69 66 20 64 65 66 69 6e | 65 64 28 75 6e 69 78 29 |if defin|ed(unix)|
|00003e50| 20 26 26 20 64 65 66 69 | 6e 65 64 28 75 6c 74 72 | && defi|ned(ultr|
|00003e60| 69 78 29 20 26 26 20 64 | 65 66 69 6e 65 64 28 62 |ix) && d|efined(b|
|00003e70| 73 64 34 5f 32 29 0a 58 | 23 09 09 09 64 65 66 69 |sd4_2).X|#...defi|
|00003e80| 6e 65 20 46 4f 55 4e 44 | 09 09 09 09 09 09 22 55 |ne FOUND|......"U|
|00003e90| 73 69 6e 67 20 64 65 66 | 61 75 6c 74 73 20 66 6f |sing def|aults fo|
|00003ea0| 72 20 56 41 58 20 28 55 | 4c 54 52 49 58 20 32 2e |r VAX (U|LTRIX 2.|
|00003eb0| 30 29 22 0a 58 23 09 09 | 09 64 65 66 69 6e 65 20 |0)".X#..|.define |
|00003ec0| 46 43 4e 54 4c 09 09 09 | 09 09 09 31 0a 58 23 09 |FCNTL...|...1.X#.|
|00003ed0| 09 09 64 65 66 69 6e 65 | 20 46 41 53 54 5f 43 4f |..define| FAST_CO|
|00003ee0| 50 59 28 66 72 6f 6d 2c | 74 6f 2c 63 6f 75 6e 74 |PY(from,|to,count|
|00003ef0| 29 09 09 62 63 6f 70 79 | 28 66 72 6f 6d 2c 74 6f |)..bcopy|(from,to|
|00003f00| 2c 63 6f 75 6e 74 29 0a | 58 23 09 09 09 64 65 66 |,count).|X#...def|
|00003f10| 69 6e 65 20 57 48 41 54 | 5f 4c 53 45 45 4b 09 09 |ine WHAT|_LSEEK..|
|00003f20| 09 09 09 31 0a 58 23 09 | 09 09 64 65 66 69 6e 65 |...1.X#.|..define|
|00003f30| 20 49 5f 53 50 45 43 49 | 41 4c 0a 58 23 09 09 09 | I_SPECI|AL.X#...|
|00003f40| 64 65 66 69 6e 65 20 49 | 4e 5f 42 55 46 5f 4c 45 |define I|N_BUF_LE|
|00003f50| 4e 09 09 09 09 09 34 30 | 39 36 0a 58 23 09 09 09 |N.....40|96.X#...|
|00003f60| 64 65 66 69 6e 65 20 4f | 55 54 5f 42 55 46 5f 4c |define O|UT_BUF_L|
|00003f70| 45 4e 09 09 09 09 09 31 | 36 33 38 34 0a 58 23 09 |EN.....1|6384.X#.|
|00003f80| 09 09 64 65 66 69 6e 65 | 20 54 48 52 45 53 48 4f |..define| THRESHO|
|00003f90| 4c 44 09 09 09 09 09 34 | 30 39 36 0a 58 23 09 09 |LD.....4|096.X#..|
|00003fa0| 65 6e 64 69 66 20 2f 2a | 20 76 61 78 20 75 6c 74 |endif /*| vax ult|
|00003fb0| 72 69 78 20 2a 2f 0a 58 | 23 09 09 69 66 20 64 65 |rix */.X|#..if de|
|00003fc0| 66 69 6e 65 64 28 76 6d | 73 29 20 26 26 20 64 65 |fined(vm|s) && de|
|00003fd0| 66 69 6e 65 64 28 76 61 | 78 29 0a 58 23 09 09 09 |fined(va|x).X#...|
|00003fe0| 64 65 66 69 6e 65 20 46 | 4f 55 4e 44 09 09 09 09 |define F|OUND....|
|00003ff0| 09 09 22 55 73 69 6e 67 | 20 64 65 66 61 75 6c 74 |.."Using| default|
|00004000| 73 20 66 6f 72 20 56 41 | 58 20 28 56 4d 53 29 22 |s for VA|X (VMS)"|
|00004010| 0a 58 2f 2a 20 64 6f 6e | 27 74 20 64 65 66 69 6e |.X/* don|'t defin|
|00004020| 65 20 46 43 4e 54 4c 2c | 20 4f 5f 52 44 4f 4e 4c |e FCNTL,| O_RDONL|
|00004030| 59 20 66 6c 61 67 20 69 | 73 20 69 6e 20 66 69 6c |Y flag i|s in fil|
|00004040| 65 2e 68 20 61 6e 64 20 | 69 73 20 30 20 2a 2f 0a |e.h and |is 0 */.|
|00004050| 58 23 09 09 09 64 65 66 | 69 6e 65 20 46 41 53 54 |X#...def|ine FAST|
|00004060| 5f 43 4f 50 59 28 66 72 | 6f 6d 2c 74 6f 2c 63 6f |_COPY(fr|om,to,co|
|00004070| 75 6e 74 29 09 09 6d 65 | 6d 63 70 79 28 74 6f 2c |unt)..me|mcpy(to,|
|00004080| 66 72 6f 6d 2c 63 6f 75 | 6e 74 29 0a 58 23 09 09 |from,cou|nt).X#..|
|00004090| 09 64 65 66 69 6e 65 20 | 57 48 41 54 5f 4c 53 45 |.define |WHAT_LSE|
|000040a0| 45 4b 09 09 09 09 09 32 | 0a 58 2f 2a 09 09 09 64 |EK.....2|.X/*...d|
|000040b0| 65 66 69 6e 65 20 49 5f | 53 50 45 43 49 41 4c 2a |efine I_|SPECIAL*|
|000040c0| 2f 0a 58 23 09 09 09 64 | 65 66 69 6e 65 20 49 4e |/.X#...d|efine IN|
|000040d0| 5f 42 55 46 5f 4c 45 4e | 09 09 09 09 09 34 30 39 |_BUF_LEN|.....409|
|000040e0| 36 0a 58 23 09 09 09 64 | 65 66 69 6e 65 20 4f 55 |6.X#...d|efine OU|
|000040f0| 54 5f 42 55 46 5f 4c 45 | 4e 09 09 09 09 09 31 36 |T_BUF_LE|N.....16|
|00004100| 33 38 34 0a 58 23 09 09 | 09 64 65 66 69 6e 65 20 |384.X#..|.define |
|00004110| 54 48 52 45 53 48 4f 4c | 44 09 09 09 09 09 34 30 |THRESHOL|D.....40|
|00004120| 39 36 0a 58 23 09 09 65 | 6e 64 69 66 20 2f 2a 20 |96.X#..e|ndif /* |
|00004130| 76 61 78 20 75 6c 74 72 | 69 78 20 2a 2f 0a 58 23 |vax ultr|ix */.X#|
|00004140| 09 65 6e 64 69 66 20 55 | 53 45 5f 55 53 45 52 5f |.endif U|SE_USER_|
|00004150| 44 45 46 49 4e 45 53 0a | 58 23 20 65 6e 64 69 66 |DEFINES.|X# endif|
|00004160| 20 53 41 46 45 54 59 5f | 46 49 52 53 54 0a 58 0a | SAFETY_|FIRST.X.|
|00004170| 58 23 20 69 66 6e 64 65 | 66 20 46 4f 55 4e 44 0a |X# ifnde|f FOUND.|
|00004180| 58 2f 2a 0a 58 20 2a 20 | 57 65 20 68 61 76 65 20 |X/*.X * |We have |
|00004190| 74 6f 20 75 73 65 20 74 | 68 65 20 64 65 66 61 75 |to use t|he defau|
|000041a0| 6c 74 73 2e 0a 58 20 2a | 2f 0a 58 23 09 64 65 66 |lts..X *|/.X#.def|
|000041b0| 69 6e 65 20 46 4f 55 4e | 44 09 09 09 09 09 09 09 |ine FOUN|D.......|
|000041c0| 22 55 73 69 6e 67 20 6d | 69 6e 69 6d 61 6c 20 64 |"Using m|inimal d|
|000041d0| 65 66 61 75 6c 74 73 2e | 22 0a 58 2f 2a 20 64 6f |efaults.|".X/* do|
|000041e0| 6e 74 09 64 65 66 69 6e | 65 20 46 43 4e 54 4c 20 |nt.defin|e FCNTL |
|000041f0| 2a 2f 0a 58 2f 2a 20 46 | 41 53 54 5f 43 4f 50 59 |*/.X/* F|AST_COPY|
|00004200| 20 77 69 6c 6c 20 62 65 | 20 61 20 72 65 61 6c 20 | will be| a real |
|00004210| 72 6f 75 74 69 6e 65 20 | 2a 2f 0a 58 23 09 64 65 |routine |*/.X#.de|
|00004220| 66 69 6e 65 20 57 48 41 | 54 5f 4c 53 45 45 4b 09 |fine WHA|T_LSEEK.|
|00004230| 09 09 09 09 09 31 0a 58 | 2f 2a 20 64 6f 6e 27 74 |.....1.X|/* don't|
|00004240| 20 64 65 66 69 6e 65 20 | 49 5f 53 50 45 43 49 41 | define |I_SPECIA|
|00004250| 4c 20 2a 2f 0a 58 23 09 | 64 65 66 69 6e 65 20 49 |L */.X#.|define I|
|00004260| 4e 5f 42 55 46 5f 4c 45 | 4e 09 09 09 09 09 09 31 |N_BUF_LE|N......1|
|00004270| 30 32 34 0a 58 23 09 64 | 65 66 69 6e 65 20 4f 55 |024.X#.d|efine OU|
|00004280| 54 5f 42 55 46 5f 4c 45 | 4e 09 09 09 09 09 09 38 |T_BUF_LE|N......8|
|00004290| 31 39 32 0a 58 23 09 64 | 65 66 69 6e 65 20 54 48 |192.X#.d|efine TH|
|000042a0| 52 45 53 48 4f 4c 44 09 | 09 09 09 09 09 31 30 32 |RESHOLD.|.....102|
|000042b0| 34 0a 58 0a 58 23 20 65 | 6e 64 69 66 20 46 4f 55 |4.X.X# e|ndif FOU|
|000042c0| 4e 44 0a 45 4e 44 5f 4f | 46 5f 46 49 4c 45 0a 69 |ND.END_O|F_FILE.i|
|000042d0| 66 20 74 65 73 74 20 32 | 37 36 35 20 2d 6e 65 20 |f test 2|765 -ne |
|000042e0| 60 77 63 20 2d 63 20 3c | 27 63 6f 6e 66 69 67 2e |`wc -c <|'config.|
|000042f0| 68 27 60 3b 20 74 68 65 | 6e 0a 20 20 20 20 65 63 |h'`; the|n. ec|
|00004300| 68 6f 20 73 68 61 72 3a | 20 5c 22 27 63 6f 6e 66 |ho shar:| \"'conf|
|00004310| 69 67 2e 68 27 5c 22 20 | 75 6e 70 61 63 6b 65 64 |ig.h'\" |unpacked|
|00004320| 20 77 69 74 68 20 77 72 | 6f 6e 67 20 73 69 7a 65 | with wr|ong size|
|00004330| 21 0a 66 69 0a 23 20 65 | 6e 64 20 6f 66 20 27 63 |!.fi.# e|nd of 'c|
|00004340| 6f 6e 66 69 67 2e 68 27 | 0a 66 69 0a 69 66 20 74 |onfig.h'|.fi.if t|
|00004350| 65 73 74 20 2d 66 20 27 | 6c 69 6d 69 74 73 2e 63 |est -f '|limits.c|
|00004360| 27 20 2d 61 20 22 24 7b | 31 7d 22 20 21 3d 20 22 |' -a "${|1}" != "|
|00004370| 2d 63 22 20 3b 20 74 68 | 65 6e 20 0a 20 20 65 63 |-c" ; th|en . ec|
|00004380| 68 6f 20 73 68 61 72 3a | 20 57 69 6c 6c 20 6e 6f |ho shar:| Will no|
|00004390| 74 20 63 6c 6f 62 62 65 | 72 20 65 78 69 73 74 69 |t clobbe|r existi|
|000043a0| 6e 67 20 66 69 6c 65 20 | 5c 22 27 6c 69 6d 69 74 |ng file |\"'limit|
|000043b0| 73 2e 63 27 5c 22 0a 65 | 6c 73 65 0a 65 63 68 6f |s.c'\".e|lse.echo|
|000043c0| 20 73 68 61 72 3a 20 45 | 78 74 72 61 63 74 69 6e | shar: E|xtractin|
|000043d0| 67 20 5c 22 27 6c 69 6d | 69 74 73 2e 63 27 5c 22 |g \"'lim|its.c'\"|
|000043e0| 20 5c 28 31 31 38 33 20 | 63 68 61 72 61 63 74 65 | \(1183 |characte|
|000043f0| 72 73 5c 29 0a 73 65 64 | 20 22 73 2f 5e 58 2f 2f |rs\).sed| "s/^X//|
|00004400| 22 20 3e 27 6c 69 6d 69 | 74 73 2e 63 27 20 3c 3c |" >'limi|ts.c' <<|
|00004410| 27 45 4e 44 5f 4f 46 5f | 46 49 4c 45 27 0a 58 73 |'END_OF_|FILE'.Xs|
|00004420| 74 61 74 69 63 20 63 68 | 61 72 20 2a 20 73 63 63 |tatic ch|ar * scc|
|00004430| 73 69 64 20 3d 20 22 40 | 28 23 29 20 20 6c 69 6d |sid = "@|(#) lim|
|00004440| 69 74 73 2e 63 20 20 28 | 76 36 2e 32 20 35 2f 31 |its.c (|v6.2 5/1|
|00004450| 39 2f 38 39 29 22 3b 0a | 58 0a 58 23 20 69 6e 63 |9/89)";.|X.X# inc|
|00004460| 6c 75 64 65 20 22 73 74 | 72 69 6e 67 73 2e 68 22 |lude "st|rings.h"|
|00004470| 0a 58 0a 58 23 20 69 66 | 64 65 66 20 49 5f 53 50 |.X.X# if|def I_SP|
|00004480| 45 43 49 41 4c 0a 58 0a | 58 23 09 69 66 64 65 66 |ECIAL.X.|X#.ifdef|
|00004490| 20 73 75 6e 0a 58 23 09 | 09 69 6e 63 6c 75 64 65 | sun.X#.|.include|
|000044a0| 20 3c 73 79 73 2f 65 78 | 65 63 2e 68 3e 0a 58 23 | <sys/ex|ec.h>.X#|
|000044b0| 09 65 6e 64 69 66 20 73 | 75 6e 0a 58 23 09 69 6e |.endif s|un.X#.in|
|000044c0| 63 6c 75 64 65 20 3c 61 | 2e 6f 75 74 2e 68 3e 0a |clude <a|.out.h>.|
|000044d0| 58 0a 58 67 65 74 5f 6c | 69 6d 69 74 73 20 28 66 |X.Xget_l|imits (f|
|000044e0| 64 2c 20 66 69 72 73 74 | 2c 20 6c 61 73 74 29 0a |d, first|, last).|
|000044f0| 58 69 6e 74 20 66 64 3b | 0a 58 4c 53 45 45 4b 5f |Xint fd;|.XLSEEK_|
|00004500| 54 59 50 45 20 2a 20 66 | 69 72 73 74 2c 20 2a 20 |TYPE * f|irst, * |
|00004510| 6c 61 73 74 3b 0a 58 2f | 2a 0a 58 20 2a 20 48 61 |last;.X/|*.X * Ha|
|00004520| 76 65 20 61 20 6c 6f 6f | 6b 20 69 6e 74 6f 20 74 |ve a loo|k into t|
|00004530| 68 65 20 69 6e 70 75 74 | 20 66 69 6c 65 20 6f 70 |he input| file op|
|00004540| 65 6e 20 75 6e 64 65 72 | 20 66 64 2e 0a 58 20 2a |en under| fd..X *|
|00004550| 20 49 66 20 77 65 20 74 | 68 69 6e 6b 20 69 74 20 | If we t|hink it |
|00004560| 69 73 20 61 6e 20 6f 62 | 6a 65 63 74 20 66 69 6c |is an ob|ject fil|
|00004570| 65 2c 20 74 68 61 6e 20 | 67 65 74 20 74 68 65 20 |e, than |get the |
|00004580| 73 74 61 72 74 20 61 6e | 64 0a 58 20 2a 20 73 69 |start an|d.X * si|
|00004590| 7a 65 20 6f 66 20 69 6e | 69 74 69 61 6c 69 7a 65 |ze of in|itialize|
|000045a0| 64 20 64 61 74 61 20 61 | 6e 64 20 73 65 74 0a 58 |d data a|nd set.X|
|000045b0| 20 2a 20 2a 66 69 72 73 | 74 20 3a 20 61 64 64 72 | * *firs|t : addr|
|000045c0| 65 73 73 20 77 68 65 72 | 65 20 65 78 61 6d 69 6e |ess wher|e examin|
|000045d0| 61 74 69 6f 6e 20 6f 66 | 20 66 69 6c 65 20 77 69 |ation of| file wi|
|000045e0| 6c 6c 20 73 74 61 72 74 | 0a 58 20 2a 20 2a 6c 61 |ll start|.X * *la|
|000045f0| 73 74 20 20 3a 20 66 69 | 72 73 74 20 61 64 64 72 |st : fi|rst addr|
|00004600| 65 73 73 20 77 68 69 63 | 68 20 77 69 6c 6c 20 6e |ess whic|h will n|
|00004610| 6f 74 20 62 65 20 65 78 | 61 6d 69 6e 65 64 2e 0a |ot be ex|amined..|
|00004620| 58 20 2a 2f 0a 58 7b 0a | 58 09 72 65 67 69 73 74 |X */.X{.|X.regist|
|00004630| 65 72 20 69 6e 74 20 69 | 3b 0a 58 09 73 74 72 75 |er int i|;.X.stru|
|00004640| 63 74 20 65 78 65 63 20 | 65 3b 0a 58 09 4c 53 45 |ct exec |e;.X.LSE|
|00004650| 45 4b 5f 54 59 50 45 20 | 6c 3b 0a 58 0a 58 09 2a |EK_TYPE |l;.X.X.*|
|00004660| 66 69 72 73 74 20 3d 20 | 28 4c 53 45 45 4b 5f 54 |first = |(LSEEK_T|
|00004670| 59 50 45 29 30 3b 0a 58 | 09 2a 6c 61 73 74 20 3d |YPE)0;.X|.*last =|
|00004680| 20 28 4c 53 45 45 4b 5f | 54 59 50 45 29 28 2d 31 | (LSEEK_|TYPE)(-1|
|00004690| 29 3b 0a 58 09 69 66 20 | 28 6c 73 65 65 6b 20 28 |);.X.if |(lseek (|
|000046a0| 66 64 2c 20 28 4c 53 45 | 45 4b 5f 54 59 50 45 29 |fd, (LSE|EK_TYPE)|
|000046b0| 30 2c 20 30 29 20 21 3d | 20 28 4c 53 45 45 4b 5f |0, 0) !=| (LSEEK_|
|000046c0| 54 59 50 45 29 30 29 20 | 7b 0a 58 23 20 69 66 64 |TYPE)0) |{.X# ifd|
|000046d0| 65 66 20 44 45 42 55 47 | 0a 58 09 09 66 70 72 69 |ef DEBUG|.X..fpri|
|000046e0| 6e 74 66 20 28 70 72 6f | 74 2c 20 22 49 6e 70 75 |ntf (pro|t, "Inpu|
|000046f0| 74 20 6e 6f 74 20 73 65 | 65 6b 61 62 6c 65 5c 6e |t not se|ekable\n|
|00004700| 22 29 3b 0a 58 23 20 65 | 6e 64 69 66 0a 58 09 09 |");.X# e|ndif.X..|
|00004710| 72 65 74 75 72 6e 3b 0a | 58 09 7d 0a 58 09 69 20 |return;.|X.}.X.i |
|00004720| 3d 20 72 65 61 64 20 28 | 66 64 2c 20 28 63 68 61 |= read (|fd, (cha|
|00004730| 72 2a 29 28 26 65 29 2c | 20 73 69 7a 65 6f 66 20 |r*)(&e),| sizeof |
|00004740| 28 65 29 29 3b 0a 58 09 | 69 66 20 28 69 20 21 3d |(e));.X.|if (i !=|
|00004750| 20 73 69 7a 65 6f 66 28 | 65 29 29 20 7b 0a 58 23 | sizeof(|e)) {.X#|
|00004760| 20 69 66 64 65 66 20 44 | 45 42 55 47 0a 58 09 09 | ifdef D|EBUG.X..|
|00004770| 66 70 72 69 6e 74 66 20 | 28 70 72 6f 74 2c 20 22 |fprintf |(prot, "|
|00004780| 66 69 6c 65 20 74 6f 6f | 20 73 6d 61 6c 6c 5c 6e |file too| small\n|
|00004790| 22 29 3b 0a 58 23 20 65 | 6e 64 69 66 0a 58 09 09 |");.X# e|ndif.X..|
|000047a0| 72 65 74 75 72 6e 3b 0a | 58 09 7d 0a 58 09 69 66 |return;.|X.}.X.if|
|000047b0| 20 28 4e 5f 42 41 44 4d | 41 47 28 65 29 29 20 7b | (N_BADM|AG(e)) {|
|000047c0| 0a 58 23 20 69 66 64 65 | 66 20 44 45 42 55 47 0a |.X# ifde|f DEBUG.|
|000047d0| 58 09 09 66 70 72 69 6e | 74 66 20 28 70 72 6f 74 |X..fprin|tf (prot|
|000047e0| 2c 20 22 62 61 64 20 6d | 61 67 69 63 5c 6e 22 29 |, "bad m|agic\n")|
|000047f0| 3b 0a 58 23 20 65 6e 64 | 69 66 0a 58 09 09 72 65 |;.X# end|if.X..re|
|00004800| 74 75 72 6e 3b 0a 58 09 | 7d 0a 58 09 6c 20 3d 20 |turn;.X.|}.X.l = |
|00004810| 4e 5f 54 58 54 4f 46 46 | 28 65 29 20 2b 20 65 2e |N_TXTOFF|(e) + e.|
|00004820| 61 5f 74 65 78 74 3b 0a | 58 23 20 69 66 64 65 66 |a_text;.|X# ifdef|
|00004830| 20 44 45 42 55 47 0a 58 | 09 66 70 72 69 6e 74 66 | DEBUG.X|.fprintf|
|00004840| 20 28 70 72 6f 74 2c 20 | 22 73 74 61 72 74 20 6f | (prot, |"start o|
|00004850| 66 20 69 6e 69 74 69 61 | 6c 69 7a 65 64 20 64 61 |f initia|lized da|
|00004860| 74 61 20 61 74 20 25 6c | 64 5c 6e 22 2c 20 28 6c |ta at %l|d\n", (l|
|00004870| 6f 6e 67 29 69 29 3b 0a | 58 09 66 70 72 69 6e 74 |ong)i);.|X.fprint|
|00004880| 66 20 28 70 72 6f 74 2c | 20 22 6c 65 6e 67 74 68 |f (prot,| "length|
|00004890| 20 3d 20 25 31 6c 64 5c | 6e 22 2c 20 28 6c 6f 6e | = %1ld\|n", (lon|
|000048a0| 67 29 28 65 2e 61 5f 64 | 61 74 61 29 29 3b 0a 58 |g)(e.a_d|ata));.X|
|000048b0| 23 20 65 6e 64 69 66 0a | 58 09 2a 66 69 72 73 74 |# endif.|X.*first|
|000048c0| 20 3d 20 6c 3b 0a 58 09 | 2a 6c 61 73 74 20 3d 20 | = l;.X.|*last = |
|000048d0| 6c 20 2b 20 65 2e 61 5f | 64 61 74 61 3b 0a 58 7d |l + e.a_|data;.X}|
|000048e0| 0a 58 0a 58 23 20 65 6e | 64 69 66 20 49 5f 53 50 |.X.X# en|dif I_SP|
|000048f0| 45 43 49 41 4c 0a 45 4e | 44 5f 4f 46 5f 46 49 4c |ECIAL.EN|D_OF_FIL|
|00004900| 45 0a 69 66 20 74 65 73 | 74 20 31 31 38 33 20 2d |E.if tes|t 1183 -|
|00004910| 6e 65 20 60 77 63 20 2d | 63 20 3c 27 6c 69 6d 69 |ne `wc -|c <'limi|
|00004920| 74 73 2e 63 27 60 3b 20 | 74 68 65 6e 0a 20 20 20 |ts.c'`; |then. |
|00004930| 20 65 63 68 6f 20 73 68 | 61 72 3a 20 5c 22 27 6c | echo sh|ar: \"'l|
|00004940| 69 6d 69 74 73 2e 63 27 | 5c 22 20 75 6e 70 61 63 |imits.c'|\" unpac|
|00004950| 6b 65 64 20 77 69 74 68 | 20 77 72 6f 6e 67 20 73 |ked with| wrong s|
|00004960| 69 7a 65 21 0a 66 69 0a | 23 20 65 6e 64 20 6f 66 |ize!.fi.|# end of|
|00004970| 20 27 6c 69 6d 69 74 73 | 2e 63 27 0a 66 69 0a 69 | 'limits|.c'.fi.i|
|00004980| 66 20 74 65 73 74 20 2d | 66 20 27 6f 75 74 70 75 |f test -|f 'outpu|
|00004990| 74 2e 63 27 20 2d 61 20 | 22 24 7b 31 7d 22 20 21 |t.c' -a |"${1}" !|
|000049a0| 3d 20 22 2d 63 22 20 3b | 20 74 68 65 6e 20 0a 20 |= "-c" ;| then . |
|000049b0| 20 65 63 68 6f 20 73 68 | 61 72 3a 20 57 69 6c 6c | echo sh|ar: Will|
|000049c0| 20 6e 6f 74 20 63 6c 6f | 62 62 65 72 20 65 78 69 | not clo|bber exi|
|000049d0| 73 74 69 6e 67 20 66 69 | 6c 65 20 5c 22 27 6f 75 |sting fi|le \"'ou|
|000049e0| 74 70 75 74 2e 63 27 5c | 22 0a 65 6c 73 65 0a 65 |tput.c'\|".else.e|
|000049f0| 63 68 6f 20 73 68 61 72 | 3a 20 45 78 74 72 61 63 |cho shar|: Extrac|
|00004a00| 74 69 6e 67 20 5c 22 27 | 6f 75 74 70 75 74 2e 63 |ting \"'|output.c|
|00004a10| 27 5c 22 20 5c 28 35 39 | 35 33 20 63 68 61 72 61 |'\" \(59|53 chara|
|00004a20| 63 74 65 72 73 5c 29 0a | 73 65 64 20 22 73 2f 5e |cters\).|sed "s/^|
|00004a30| 58 2f 2f 22 20 3e 27 6f | 75 74 70 75 74 2e 63 27 |X//" >'o|utput.c'|
|00004a40| 20 3c 3c 27 45 4e 44 5f | 4f 46 5f 46 49 4c 45 27 | <<'END_|OF_FILE'|
|00004a50| 0a 58 73 74 61 74 69 63 | 20 63 68 61 72 20 2a 20 |.Xstatic| char * |
|00004a60| 73 63 63 73 69 64 20 3d | 20 22 40 28 23 29 20 20 |sccsid =| "@(#) |
|00004a70| 6f 75 74 70 75 74 2e 63 | 20 20 28 76 36 2e 35 20 |output.c| (v6.5 |
|00004a80| 35 2f 31 39 2f 38 39 29 | 22 3b 0a 58 2f 2a 0a 58 |5/19/89)|";.X/*.X|
|00004a90| 20 2a 20 4f 75 74 70 75 | 74 20 72 6f 75 74 69 6e | * Outpu|t routin|
|00004aa0| 65 73 20 66 6f 72 20 27 | 73 74 72 69 6e 67 73 27 |es for '|strings'|
|00004ab0| 2e 0a 58 20 2a 20 57 65 | 20 72 6f 6c 6c 20 6f 75 |..X * We| roll ou|
|00004ac0| 72 20 6f 77 6e 20 68 65 | 72 65 2c 20 62 65 63 61 |r own he|re, beca|
|00004ad0| 75 73 65 20 73 74 64 69 | 6f 20 65 69 74 68 65 72 |use stdi|o either|
|00004ae0| 20 65 78 70 65 63 74 73 | 20 4e 55 4c 20 74 65 72 | expects| NUL ter|
|00004af0| 6d 69 6e 61 74 65 64 0a | 58 20 2a 20 73 74 72 69 |minated.|X * stri|
|00004b00| 6e 67 73 2c 20 77 68 69 | 63 68 20 77 65 20 64 6f |ngs, whi|ch we do|
|00004b10| 6e 27 74 20 68 61 76 65 | 2c 20 6f 72 20 74 65 73 |n't have|, or tes|
|00004b20| 74 73 20 66 6f 72 20 62 | 75 66 66 65 72 20 6f 76 |ts for b|uffer ov|
|00004b30| 65 72 66 6c 6f 77 20 61 | 74 20 65 61 63 68 0a 58 |erflow a|t each.X|
|00004b40| 20 2a 20 63 68 61 72 61 | 63 74 65 72 2e 20 42 75 | * chara|cter. Bu|
|00004b50| 74 20 77 65 20 6b 6e 6f | 77 20 68 6f 77 20 6d 75 |t we kno|w how mu|
|00004b60| 63 68 20 63 68 61 72 61 | 63 74 65 72 73 20 77 69 |ch chara|cters wi|
|00004b70| 6c 6c 20 62 65 20 61 64 | 64 65 64 20 74 6f 20 74 |ll be ad|ded to t|
|00004b80| 68 65 0a 58 20 2a 20 6f | 75 74 70 75 74 20 62 6c |he.X * o|utput bl|
|00004b90| 6f 63 6b 2c 20 73 6f 20 | 77 65 20 63 61 6e 20 6d |ock, so |we can m|
|00004ba0| 61 6b 65 20 64 6f 20 77 | 69 74 68 20 74 77 6f 20 |ake do w|ith two |
|00004bb0| 6f 72 20 74 68 72 65 65 | 20 74 65 73 74 73 20 70 |or three| tests p|
|00004bc0| 65 72 20 73 65 71 75 65 | 6e 63 65 0a 58 20 2a 20 |er seque|nce.X * |
|00004bd0| 6f 66 20 70 72 69 6e 74 | 61 62 6c 65 20 63 68 61 |of print|able cha|
|00004be0| 72 61 63 74 65 72 73 2e | 0a 58 20 2a 0a 58 20 2a |racters.|.X *.X *|
|00004bf0| 20 53 65 71 75 65 6e 63 | 65 73 20 61 72 65 20 73 | Sequenc|es are s|
|00004c00| 74 75 66 66 65 64 20 69 | 6e 74 6f 20 74 68 65 20 |tuffed i|nto the |
|00004c10| 6f 75 74 70 75 74 20 62 | 75 66 66 65 72 2c 20 65 |output b|uffer, e|
|00004c20| 76 65 6e 20 74 65 6d 70 | 6f 72 61 72 69 6c 79 20 |ven temp|orarily |
|00004c30| 77 68 65 6e 0a 58 20 2a | 20 77 65 20 63 6f 75 6c |when.X *| we coul|
|00004c40| 64 20 6e 6f 74 20 64 65 | 63 69 64 65 20 77 68 61 |d not de|cide wha|
|00004c50| 74 20 74 6f 20 64 6f 20 | 77 69 74 68 20 74 68 65 |t to do |with the|
|00004c60| 6d 2c 20 79 65 74 20 68 | 61 64 20 74 6f 20 72 65 |m, yet h|ad to re|
|00004c70| 6d 65 6d 62 65 72 20 74 | 68 65 0a 58 20 2a 20 63 |member t|he.X * c|
|00004c80| 68 61 72 61 63 74 65 72 | 73 2e 20 57 68 65 6e 20 |haracter|s. When |
|00004c90| 61 20 74 65 6d 70 6f 72 | 61 72 79 20 73 65 71 75 |a tempor|ary sequ|
|00004ca0| 65 6e 63 65 20 69 73 20 | 6d 61 64 65 20 70 65 72 |ence is |made per|
|00004cb0| 6d 61 6e 65 6e 74 20 6f | 72 20 61 0a 58 20 2a 20 |manent o|r a.X * |
|00004cc0| 70 65 72 6d 61 6e 65 6e | 74 20 73 65 71 75 65 6e |permanen|t sequen|
|00004cd0| 63 65 20 61 64 64 65 64 | 2c 20 61 6e 64 20 74 68 |ce added|, and th|
|00004ce0| 65 20 6e 65 77 20 6c 65 | 6e 67 74 68 20 6f 66 20 |e new le|ngth of |
|00004cf0| 64 61 74 61 20 69 6e 20 | 74 68 65 20 6f 75 74 70 |data in |the outp|
|00004d00| 75 74 0a 58 20 2a 20 62 | 75 66 66 65 72 20 65 78 |ut.X * b|uffer ex|
|00004d10| 63 65 65 64 73 20 61 20 | 74 68 72 65 73 68 6f 6c |ceeds a |threshol|
|00004d20| 64 2c 20 69 74 20 69 73 | 20 6f 75 74 70 75 74 2e |d, it is| output.|
|00004d30| 0a 58 20 2a 20 49 66 20 | 74 68 65 20 62 75 66 66 |.X * If |the buff|
|00004d40| 65 72 20 6f 76 65 72 66 | 6c 6f 77 73 20 69 6e 20 |er overf|lows in |
|00004d50| 62 65 74 77 65 65 6e 20 | 69 74 20 69 73 20 65 78 |between |it is ex|
|00004d60| 74 65 6e 64 65 64 20 77 | 69 74 68 20 61 20 63 61 |tended w|ith a ca|
|00004d70| 6c 6c 20 74 6f 0a 58 20 | 2a 20 72 65 61 6c 6c 6f |ll to.X |* reallo|
|00004d80| 63 2e 20 54 68 69 73 20 | 72 61 72 65 6c 79 20 65 |c. This |rarely e|
|00004d90| 76 65 72 20 68 61 70 70 | 65 6e 73 2c 20 62 75 74 |ver happ|ens, but|
|00004da0| 20 69 66 20 69 74 20 68 | 61 70 70 65 6e 73 2c 20 | if it h|appens, |
|00004db0| 74 68 65 6e 0a 58 20 2a | 20 79 6f 75 20 77 69 6c |then.X *| you wil|
|00004dc0| 6c 20 72 61 74 68 65 72 | 20 68 61 76 65 20 73 74 |l rather| have st|
|00004dd0| 72 69 6e 67 73 20 74 6f | 20 62 65 20 73 6c 6f 77 |rings to| be slow|
|00004de0| 69 6e 67 20 64 6f 77 6e | 20 74 68 61 6e 20 64 75 |ing down| than du|
|00004df0| 6d 70 20 63 6f 72 65 2e | 0a 58 20 2a 2f 0a 58 0a |mp core.|.X */.X.|
|00004e00| 58 23 20 69 6e 63 6c 75 | 64 65 20 22 73 74 72 69 |X# inclu|de "stri|
|00004e10| 6e 67 73 2e 68 22 0a 58 | 0a 58 2f 2a 0a 58 20 2a |ngs.h".X|.X/*.X *|
|00004e20| 20 54 68 65 20 63 68 61 | 72 61 63 74 65 72 73 20 | The cha|racters |
|00004e30| 69 6e 20 6f 75 74 5f 62 | 75 66 20 75 6e 74 69 6c |in out_b|uf until|
|00004e40| 20 6e 75 6d 5f 6f 75 74 | 5f 62 75 66 20 61 72 65 | num_out|_buf are|
|00004e50| 20 61 6c 72 65 61 64 79 | 20 61 63 63 65 70 74 65 | already| accepte|
|00004e60| 64 2e 0a 58 20 2a 20 6c | 65 76 65 6c 20 70 6f 69 |d..X * l|evel poi|
|00004e70| 6e 74 73 20 61 74 20 74 | 68 65 20 65 6e 64 20 6f |nts at t|he end o|
|00004e80| 66 20 61 6c 6c 20 63 68 | 61 72 61 63 74 65 72 73 |f all ch|aracters|
|00004e90| 20 69 6e 20 6f 75 74 5f | 62 75 66 2c 20 65 76 65 | in out_|buf, eve|
|00004ea0| 6e 20 74 68 65 0a 58 20 | 2a 20 74 65 6d 70 6f 72 |n the.X |* tempor|
|00004eb0| 61 72 69 6c 79 20 73 61 | 76 65 64 20 6f 6e 65 73 |arily sa|ved ones|
|00004ec0| 2e 0a 58 20 2a 20 73 61 | 76 65 64 20 69 73 20 74 |..X * sa|ved is t|
|00004ed0| 68 65 20 6e 75 6d 62 65 | 72 20 6f 66 20 63 68 61 |he numbe|r of cha|
|00004ee0| 72 61 63 74 65 72 73 20 | 74 65 6d 70 6f 72 61 72 |racters |temporar|
|00004ef0| 69 6c 79 20 73 61 76 65 | 64 2e 0a 58 20 2a 20 4e |ily save|d..X * N|
|00004f00| 6f 74 65 20 74 68 61 74 | 20 6c 65 76 65 6c 20 61 |ote that| level a|
|00004f10| 6e 64 20 73 61 76 65 64 | 20 61 72 65 20 6e 6f 74 |nd saved| are not|
|00004f20| 20 74 68 65 20 73 61 6d | 65 2e 20 49 66 20 74 68 | the sam|e. If th|
|00004f30| 65 72 65 20 61 72 65 20 | 6e 75 6d 62 65 72 20 62 |ere are |number b|
|00004f40| 65 66 6f 72 65 0a 58 20 | 2a 20 74 68 65 20 73 65 |efore.X |* the se|
|00004f50| 71 75 65 6e 63 65 73 2c | 20 74 68 65 6e 20 62 75 |quences,| then bu|
|00004f60| 66 2b 6e 75 6d 5f 6f 75 | 74 5f 62 75 66 2b 73 61 |f+num_ou|t_buf+sa|
|00004f70| 76 65 64 20 21 3d 20 6c | 65 76 65 6c 20 21 21 0a |ved != l|evel !!.|
|00004f80| 58 20 2a 20 4e 6f 74 65 | 20 74 68 61 74 20 73 6f |X * Note| that so|
|00004f90| 6d 65 74 69 6d 65 73 20 | 49 20 68 61 76 65 20 74 |metimes |I have t|
|00004fa0| 6f 20 63 6f 6d 70 75 74 | 65 20 74 68 65 20 6e 75 |o comput|e the nu|
|00004fb0| 6d 62 65 72 20 6f 66 20 | 63 68 61 72 61 63 74 65 |mber of |characte|
|00004fc0| 72 73 20 62 65 74 77 65 | 65 6e 0a 58 20 2a 20 6f |rs betwe|en.X * o|
|00004fd0| 75 74 5f 62 75 66 20 61 | 6e 64 20 6c 65 76 65 6c |ut_buf a|nd level|
|00004fe0| 2e 20 49 20 64 6f 20 74 | 68 69 73 20 62 79 20 73 |. I do t|his by s|
|00004ff0| 75 62 74 72 61 63 74 69 | 6e 67 20 74 68 65 20 74 |ubtracti|ng the t|
|00005000| 77 6f 20 70 6f 69 6e 74 | 65 72 73 2e 20 49 20 61 |wo point|ers. I a|
|00005010| 73 73 75 6d 65 0a 58 20 | 2a 20 74 68 61 74 20 74 |ssume.X |* that t|
|00005020| 68 65 20 72 65 73 75 6c | 74 20 69 73 20 69 6e 74 |he resul|t is int|
|00005030| 20 6f 72 20 63 6f 6e 76 | 65 72 74 69 62 6c 65 20 | or conv|ertible |
|00005040| 74 6f 20 69 6e 74 2c 20 | 62 75 74 20 49 20 64 6f |to int, |but I do|
|00005050| 6e 27 74 20 68 61 76 65 | 20 74 68 65 0a 58 20 2a |n't have| the.X *|
|00005060| 20 61 75 74 68 6f 72 69 | 74 79 20 61 74 20 68 61 | authori|ty at ha|
|00005070| 6e 64 20 74 6f 20 70 72 | 6f 76 65 20 74 68 69 73 |nd to pr|ove this|
|00005080| 2e 0a 58 20 2a 2f 0a 58 | 43 48 41 52 5f 54 59 50 |..X */.X|CHAR_TYP|
|00005090| 45 20 2a 20 6f 75 74 5f | 62 75 66 3b 0a 58 69 6e |E * out_|buf;.Xin|
|000050a0| 74 20 6e 75 6d 5f 6f 75 | 74 5f 62 75 66 20 3d 20 |t num_ou|t_buf = |
|000050b0| 30 3b 09 09 09 09 2f 2a | 20 6e 75 6d 62 65 72 73 |0;..../*| numbers|
|000050c0| 20 6f 66 20 63 68 61 72 | 73 20 69 6e 20 6f 75 74 | of char|s in out|
|000050d0| 5f 62 75 66 20 2a 2f 0a | 58 43 48 41 52 5f 54 59 |_buf */.|XCHAR_TY|
|000050e0| 50 45 20 2a 20 6c 65 76 | 65 6c 3b 0a 58 69 6e 74 |PE * lev|el;.Xint|
|000050f0| 20 62 75 66 5f 6c 65 6e | 3b 0a 58 69 6e 74 20 73 | buf_len|;.Xint s|
|00005100| 61 76 65 64 20 3d 20 30 | 3b 0a 58 0a 58 65 78 74 |aved = 0|;.X.Xext|
|00005110| 65 72 6e 20 69 6e 74 20 | 69 6e 64 5f 6f 66 66 73 |ern int |ind_offs|
|00005120| 65 74 3b 0a 58 65 78 74 | 65 72 6e 20 69 6e 74 20 |et;.Xext|ern int |
|00005130| 69 6e 64 5f 70 72 65 66 | 69 78 3b 0a 58 65 78 74 |ind_pref|ix;.Xext|
|00005140| 65 72 6e 20 43 48 41 52 | 5f 54 59 50 45 20 62 75 |ern CHAR|_TYPE bu|
|00005150| 66 5b 5d 3b 0a 58 65 78 | 74 65 72 6e 20 4c 53 45 |f[];.Xex|tern LSE|
|00005160| 45 4b 5f 54 59 50 45 20 | 6f 66 66 73 65 74 3b 0a |EK_TYPE |offset;.|
|00005170| 58 65 78 74 65 72 6e 20 | 63 68 61 72 20 2a 20 63 |Xextern |char * c|
|00005180| 75 72 5f 66 69 6c 65 5f | 6e 61 6d 65 3b 0a 58 0a |ur_file_|name;.X.|
|00005190| 58 65 78 74 65 72 6e 20 | 63 68 61 72 20 2a 20 6d |Xextern |char * m|
|000051a0| 61 6c 6c 6f 63 20 28 29 | 3b 0a 58 65 78 74 65 72 |alloc ()|;.Xexter|
|000051b0| 6e 20 63 68 61 72 20 2a | 20 72 65 61 6c 6c 6f 63 |n char *| realloc|
|000051c0| 20 28 29 3b 0a 58 0a 58 | 69 6e 69 74 5f 6f 75 74 | ();.X.X|init_out|
|000051d0| 70 75 74 20 28 29 0a 58 | 7b 0a 58 09 6f 75 74 5f |put ().X|{.X.out_|
|000051e0| 62 75 66 20 3d 20 28 43 | 48 41 52 5f 54 59 50 45 |buf = (C|HAR_TYPE|
|000051f0| 20 2a 29 20 6d 61 6c 6c | 6f 63 20 28 73 69 7a 65 | *) mall|oc (size|
|00005200| 6f 66 20 28 43 48 41 52 | 5f 54 59 50 45 29 20 2a |of (CHAR|_TYPE) *|
|00005210| 20 4f 55 54 5f 42 55 46 | 5f 4c 45 4e 29 3b 0a 58 | OUT_BUF|_LEN);.X|
|00005220| 09 6c 65 76 65 6c 20 3d | 20 6f 75 74 5f 62 75 66 |.level =| out_buf|
|00005230| 3b 0a 58 09 6e 75 6d 5f | 6f 75 74 5f 62 75 66 20 |;.X.num_|out_buf |
|00005240| 3d 20 30 3b 0a 58 09 62 | 75 66 5f 6c 65 6e 20 3d |= 0;.X.b|uf_len =|
|00005250| 20 4f 55 54 5f 42 55 46 | 5f 4c 45 4e 3b 0a 58 7d | OUT_BUF|_LEN;.X}|
|00005260| 0a 58 0a 58 66 6c 75 73 | 68 5f 6f 75 74 70 75 74 |.X.Xflus|h_output|
|00005270| 20 28 29 0a 58 2f 2a 0a | 58 20 2a 20 4e 75 6d 5f | ().X/*.|X * Num_|
|00005280| 6f 75 74 5f 62 75 66 20 | 63 68 61 72 61 63 74 65 |out_buf |characte|
|00005290| 72 73 20 66 72 6f 6d 20 | 74 68 65 20 62 75 66 66 |rs from |the buff|
|000052a0| 65 72 20 61 72 65 20 77 | 72 69 74 74 65 6e 2e 0a |er are w|ritten..|
|000052b0| 58 20 2a 2f 0a 58 7b 0a | 58 09 69 66 20 28 6e 75 |X */.X{.|X.if (nu|
|000052c0| 6d 5f 6f 75 74 5f 62 75 | 66 20 3e 20 30 29 20 7b |m_out_bu|f > 0) {|
|000052d0| 0a 58 23 20 69 66 64 65 | 66 20 44 45 42 55 47 0a |.X# ifde|f DEBUG.|
|000052e0| 58 09 09 66 70 72 69 6e | 74 66 20 28 70 72 6f 74 |X..fprin|tf (prot|
|000052f0| 2c 20 22 66 6c 75 73 68 | 5f 6f 75 74 70 75 74 20 |, "flush|_output |
|00005300| 3a 20 77 72 69 74 65 20 | 25 64 20 63 68 61 72 73 |: write |%d chars|
|00005310| 5c 6e 22 2c 20 6e 75 6d | 5f 6f 75 74 5f 62 75 66 |\n", num|_out_buf|
|00005320| 29 3b 0a 58 23 20 65 6e | 64 69 66 0a 58 09 09 69 |);.X# en|dif.X..i|
|00005330| 66 20 28 77 72 69 74 65 | 20 28 31 2c 20 6f 75 74 |f (write| (1, out|
|00005340| 5f 62 75 66 2c 20 6e 75 | 6d 5f 6f 75 74 5f 62 75 |_buf, nu|m_out_bu|
|00005350| 66 29 20 21 3d 20 6e 75 | 6d 5f 6f 75 74 5f 62 75 |f) != nu|m_out_bu|
|00005360| 66 29 20 7b 0a 58 09 09 | 09 6f 75 74 20 28 22 50 |f) {.X..|.out ("P|
|00005370| 41 4e 49 43 20 3a 20 77 | 72 69 74 65 20 65 72 72 |ANIC : w|rite err|
|00005380| 6f 72 5c 6e 22 29 3b 0a | 58 09 09 09 65 78 69 74 |or\n");.|X...exit|
|00005390| 20 28 31 29 3b 0a 58 09 | 09 7d 0a 58 09 09 6e 75 | (1);.X.|.}.X..nu|
|000053a0| 6d 5f 6f 75 74 5f 62 75 | 66 20 3d 20 30 3b 0a 58 |m_out_bu|f = 0;.X|
|000053b0| 09 7d 0a 58 09 6c 65 76 | 65 6c 20 3d 20 6f 75 74 |.}.X.lev|el = out|
|000053c0| 5f 62 75 66 3b 0a 58 7d | 0a 58 0a 58 73 74 61 74 |_buf;.X}|.X.Xstat|
|000053d0| 69 63 0a 58 6d 61 6b 65 | 5f 72 6f 6f 6d 20 28 6e |ic.Xmake|_room (n|
|000053e0| 29 0a 58 72 65 67 69 73 | 74 65 72 20 69 6e 74 20 |).Xregis|ter int |
|000053f0| 6e 3b 0a 58 2f 2a 0a 58 | 20 2a 20 4d 75 73 74 20 |n;.X/*.X| * Must |
|00005400| 72 65 61 6c 6c 6f 63 61 | 74 65 2e 0a 58 20 2a 20 |realloca|te..X * |
|00005410| 42 75 66 66 65 72 20 69 | 73 20 65 6e 6c 61 72 67 |Buffer i|s enlarg|
|00005420| 65 64 20 62 79 20 61 74 | 20 6c 65 61 73 74 20 49 |ed by at| least I|
|00005430| 4e 5f 42 55 46 5f 4c 45 | 4e 20 63 68 61 72 61 63 |N_BUF_LE|N charac|
|00005440| 74 65 72 73 2e 20 54 68 | 65 20 6c 61 72 67 65 73 |ters. Th|e larges|
|00005450| 74 0a 58 20 2a 20 70 69 | 65 63 65 20 77 68 69 63 |t.X * pi|ece whic|
|00005460| 68 20 68 61 73 20 74 6f | 20 62 65 20 70 75 74 20 |h has to| be put |
|00005470| 69 6e 74 6f 20 74 68 65 | 20 62 75 66 66 65 72 20 |into the| buffer |
|00005480| 77 69 6c 6c 20 62 65 20 | 61 74 20 6d 6f 73 74 20 |will be |at most |
|00005490| 49 4e 5f 42 55 46 5f 4c | 45 4e 0a 58 20 2a 20 63 |IN_BUF_L|EN.X * c|
|000054a0| 68 61 72 61 63 74 65 72 | 73 2e 20 49 66 20 74 68 |haracter|s. If th|
|000054b0| 65 72 65 20 69 73 20 61 | 20 73 65 71 75 65 6e 63 |ere is a| sequenc|
|000054c0| 65 20 6f 66 20 70 75 74 | 73 2c 20 74 68 65 20 62 |e of put|s, the b|
|000054d0| 75 66 66 65 72 20 77 69 | 6c 6c 20 62 65 20 65 6e |uffer wi|ll be en|
|000054e0| 6c 61 72 67 65 64 0a 58 | 20 2a 20 65 61 63 68 20 |larged.X| * each |
|000054f0| 74 69 6d 65 2e 20 54 68 | 69 73 20 73 68 6f 75 6c |time. Th|is shoul|
|00005500| 64 20 68 61 70 70 65 6e | 20 76 65 72 79 20 72 61 |d happen| very ra|
|00005510| 72 65 6c 79 2e 0a 58 20 | 2a 2f 0a 58 7b 0a 58 09 |rely..X |*/.X{.X.|
|00005520| 72 65 67 69 73 74 65 72 | 20 69 6e 74 20 69 3b 0a |register| int i;.|
|00005530| 58 23 20 69 66 64 65 66 | 20 44 45 42 55 47 0a 58 |X# ifdef| DEBUG.X|
|00005540| 09 66 70 72 69 6e 74 66 | 20 28 70 72 6f 74 2c 20 |.fprintf| (prot, |
|00005550| 22 6d 61 6b 65 5f 72 6f | 6f 6d 20 3a 3a 20 52 45 |"make_ro|om :: RE|
|00005560| 41 4c 4c 4f 43 20 72 65 | 61 6c 6c 6f 63 20 63 61 |ALLOC re|alloc ca|
|00005570| 6c 6c 65 64 2e 5c 6e 22 | 29 3b 0a 58 09 66 66 6c |lled.\n"|);.X.ffl|
|00005580| 75 73 68 20 28 70 72 6f | 74 29 3b 0a 58 23 20 65 |ush (pro|t);.X# e|
|00005590| 6e 64 69 66 0a 58 09 2f | 2a 0a 58 09 20 2a 20 4c |ndif.X./|*.X. * L|
|000055a0| 65 76 65 6c 20 69 73 20 | 61 20 70 6f 69 6e 74 65 |evel is |a pointe|
|000055b0| 72 20 69 6e 74 6f 20 6f | 75 74 5f 62 75 66 2e 20 |r into o|ut_buf. |
|000055c0| 57 65 20 68 61 76 65 20 | 74 6f 20 73 61 76 65 20 |We have |to save |
|000055d0| 69 74 20 68 65 72 65 20 | 61 6e 64 0a 58 09 20 2a |it here |and.X. *|
|000055e0| 20 72 65 73 74 6f 72 65 | 20 69 74 20 6c 61 74 65 | restore| it late|
|000055f0| 72 2c 20 62 65 63 61 75 | 73 65 20 72 65 61 6c 6c |r, becau|se reall|
|00005600| 6f 63 20 6d 69 67 68 74 | 20 63 61 75 73 65 20 61 |oc might| cause a|
|00005610| 20 63 6f 70 79 69 6e 67 | 20 6f 66 20 74 68 65 0a | copying| of the.|
|00005620| 58 09 20 2a 20 63 6f 6e | 74 65 6e 74 73 20 6f 66 |X. * con|tents of|
|00005630| 20 6f 75 74 5f 62 75 66 | 20 74 6f 20 61 20 6e 65 | out_buf| to a ne|
|00005640| 77 20 61 64 64 72 65 73 | 73 2e 0a 58 09 20 2a 2f |w addres|s..X. */|
|00005650| 0a 58 09 69 20 3d 20 6c | 65 76 65 6c 20 2d 20 6f |.X.i = l|evel - o|
|00005660| 75 74 5f 62 75 66 3b 0a | 58 09 62 75 66 5f 6c 65 |ut_buf;.|X.buf_le|
|00005670| 6e 20 2b 3d 20 6e 3e 49 | 4e 5f 42 55 46 5f 4c 45 |n += n>I|N_BUF_LE|
|00005680| 4e 3f 6e 3a 49 4e 5f 42 | 55 46 5f 4c 45 4e 3b 0a |N?n:IN_B|UF_LEN;.|
|00005690| 58 23 20 69 66 64 65 66 | 20 44 45 42 55 47 0a 58 |X# ifdef| DEBUG.X|
|000056a0| 09 66 70 72 69 6e 74 66 | 20 28 70 72 6f 74 2c 20 |.fprintf| (prot, |
|000056b0| 22 6d 61 6b 65 5f 72 6f | 6f 6d 20 3a 3a 20 6f 75 |"make_ro|om :: ou|
|000056c0| 74 70 75 74 20 62 75 66 | 66 65 72 20 77 69 6c 6c |tput buf|fer will|
|000056d0| 20 62 65 20 65 6e 6c 61 | 72 67 65 64 20 74 6f 20 | be enla|rged to |
|000056e0| 25 64 5c 6e 22 2c 20 62 | 75 66 5f 6c 65 6e 29 3b |%d\n", b|uf_len);|
|000056f0| 0a 58 23 20 65 6e 64 69 | 66 0a 58 09 6f 75 74 5f |.X# endi|f.X.out_|
|00005700| 62 75 66 20 3d 20 28 43 | 48 41 52 5f 54 59 50 45 |buf = (C|HAR_TYPE|
|00005710| 20 2a 29 20 72 65 61 6c | 6c 6f 63 20 28 6f 75 74 | *) real|loc (out|
|00005720| 5f 62 75 66 2c 20 28 75 | 6e 73 69 67 6e 65 64 20 |_buf, (u|nsigned |
|00005730| 69 6e 74 29 62 75 66 5f | 6c 65 6e 29 3b 0a 58 09 |int)buf_|len);.X.|
|00005740| 69 66 20 28 6f 75 74 5f | 62 75 66 20 3d 3d 20 4e |if (out_|buf == N|
|00005750| 55 4c 4c 29 20 7b 09 09 | 09 2f 2a 20 70 61 6e 69 |ULL) {..|./* pani|
|00005760| 63 20 2a 2f 0a 58 09 09 | 28 76 6f 69 64 29 77 72 |c */.X..|(void)wr|
|00005770| 69 74 65 20 28 32 2c 20 | 22 52 45 41 4c 4c 4f 43 |ite (2, |"REALLOC|
|00005780| 20 45 52 52 4f 52 2e 5c | 6e 22 2c 20 31 35 29 3b | ERROR.\|n", 15);|
|00005790| 0a 58 09 09 65 78 69 74 | 20 28 31 29 3b 0a 58 09 |.X..exit| (1);.X.|
|000057a0| 7d 0a 58 09 6c 65 76 65 | 6c 20 3d 20 6f 75 74 5f |}.X.leve|l = out_|
|000057b0| 62 75 66 20 2b 20 69 3b | 0a 58 7d 0a 58 0a 58 76 |buf + i;|.X}.X.Xv|
|000057c0| 6f 69 64 0a 58 61 64 64 | 5f 63 75 72 5f 66 69 6c |oid.Xadd|_cur_fil|
|000057d0| 65 5f 6e 61 6d 65 20 28 | 29 0a 58 2f 2a 0a 58 20 |e_name (|).X/*.X |
|000057e0| 2a 20 4f 6e 6c 79 20 63 | 61 6c 6c 65 64 20 69 66 |* Only c|alled if|
|000057f0| 20 63 6f 6d 6d 61 6e 64 | 20 6c 69 6e 65 20 66 6c | command| line fl|
|00005800| 61 67 20 27 2d 70 27 20 | 77 61 73 20 73 70 65 63 |ag '-p' |was spec|
|00005810| 69 66 69 65 64 2e 0a 58 | 20 2a 20 41 64 64 20 74 |ified..X| * Add t|
|00005820| 68 65 20 6e 61 6d 65 20 | 6f 66 20 74 68 65 20 63 |he name |of the c|
|00005830| 75 72 72 65 6e 74 20 69 | 6e 70 75 74 20 66 69 6c |urrent i|nput fil|
|00005840| 65 20 74 6f 20 74 68 65 | 20 6f 75 74 70 75 74 20 |e to the| output |
|00005850| 73 74 72 65 61 6d 2e 0a | 58 20 2a 2f 0a 58 7b 0a |stream..|X */.X{.|
|00005860| 58 09 72 65 67 69 73 74 | 65 72 20 69 6e 74 20 69 |X.regist|er int i|
|00005870| 3b 0a 58 0a 58 09 69 66 | 20 28 63 75 72 5f 66 69 |;.X.X.if| (cur_fi|
|00005880| 6c 65 5f 6e 61 6d 65 20 | 3d 3d 20 4e 55 4c 4c 29 |le_name |== NULL)|
|00005890| 0a 58 09 09 72 65 74 75 | 72 6e 3b 0a 58 09 69 20 |.X..retu|rn;.X.i |
|000058a0| 3d 20 73 74 72 6c 65 6e | 20 28 63 75 72 5f 66 69 |= strlen| (cur_fi|
|000058b0| 6c 65 5f 6e 61 6d 65 29 | 3b 0a 58 09 2f 2a 0a 58 |le_name)|;.X./*.X|
|000058c0| 09 20 2a 20 49 73 20 74 | 68 65 72 65 20 73 70 61 |. * Is t|here spa|
|000058d0| 63 65 20 66 6f 72 20 28 | 69 2b 31 29 20 63 68 61 |ce for (|i+1) cha|
|000058e0| 72 61 63 74 65 72 73 20 | 61 74 20 74 68 65 20 65 |racters |at the e|
|000058f0| 6e 64 20 6f 66 20 74 68 | 65 20 6f 75 74 70 75 74 |nd of th|e output|
|00005900| 20 62 75 66 66 65 72 3f | 0a 58 09 20 2a 20 49 66 | buffer?|.X. * If|
|00005910| 20 6e 6f 74 2c 20 66 6c | 75 73 68 20 69 74 2e 0a | not, fl|ush it..|
|00005920| 58 09 20 2a 2f 0a 58 09 | 69 66 20 28 28 69 6e 74 |X. */.X.|if ((int|
|00005930| 29 28 6c 65 76 65 6c 20 | 2d 20 6f 75 74 5f 62 75 |)(level |- out_bu|
|00005940| 66 29 20 2b 20 69 20 2b | 20 31 20 3e 20 62 75 66 |f) + i +| 1 > buf|
|00005950| 5f 6c 65 6e 29 0a 58 09 | 09 6d 61 6b 65 5f 72 6f |_len).X.|.make_ro|
|00005960| 6f 6d 20 28 69 2b 31 29 | 3b 0a 58 09 46 41 53 54 |om (i+1)|;.X.FAST|
|00005970| 5f 43 4f 50 59 20 28 63 | 75 72 5f 66 69 6c 65 5f |_COPY (c|ur_file_|
|00005980| 6e 61 6d 65 2c 20 6c 65 | 76 65 6c 2c 20 69 29 3b |name, le|vel, i);|
|00005990| 0a 58 09 6c 65 76 65 6c | 20 2b 3d 20 69 3b 0a 58 |.X.level| += i;.X|
|000059a0| 09 2a 6c 65 76 65 6c 2b | 2b 20 3d 20 27 3a 27 3b |.*level+|+ = ':';|
|000059b0| 0a 58 7d 0a 58 0a 58 61 | 70 70 65 6e 64 20 28 62 |.X}.X.Xa|ppend (b|
|000059c0| 31 2c 20 62 32 2c 20 69 | 6e 64 5f 70 65 72 6d 29 |1, b2, i|nd_perm)|
|000059d0| 0a 58 72 65 67 69 73 74 | 65 72 20 43 48 41 52 5f |.Xregist|er CHAR_|
|000059e0| 54 59 50 45 20 2a 20 62 | 31 2c 20 2a 20 62 32 3b |TYPE * b|1, * b2;|
|000059f0| 0a 58 69 6e 74 20 69 6e | 64 5f 70 65 72 6d 3b 0a |.Xint in|d_perm;.|
|00005a00| 58 2f 2a 0a 58 20 2a 20 | 41 70 70 65 6e 64 20 61 |X/*.X * |Append a|
|00005a10| 20 73 65 71 75 65 6e 63 | 65 20 70 65 72 6d 61 6e | sequenc|e perman|
|00005a20| 65 6e 74 6c 79 2e 20 53 | 65 74 20 74 68 65 20 70 |ently. S|et the p|
|00005a30| 6f 69 6e 74 65 72 73 2e | 0a 58 20 2a 20 49 66 20 |ointers.|.X * If |
|00005a40| 74 68 65 72 65 20 61 72 | 65 20 6d 6f 72 65 20 74 |there ar|e more t|
|00005a50| 68 61 6e 20 54 48 52 45 | 53 48 4f 4c 44 20 63 68 |han THRE|SHOLD ch|
|00005a60| 61 72 61 63 74 65 72 73 | 20 74 68 65 6e 20 77 72 |aracters| then wr|
|00005a70| 69 74 65 20 74 68 65 6d | 2e 0a 58 20 2a 2f 0a 58 |ite them|..X */.X|
|00005a80| 7b 0a 58 09 72 65 67 69 | 73 74 65 72 20 69 6e 74 |{.X.regi|ster int|
|00005a90| 20 6e 3b 0a 58 0a 58 09 | 2f 2a 0a 58 09 20 2a 20 | n;.X.X.|/*.X. * |
|00005aa0| 49 66 20 74 68 65 20 75 | 73 65 72 20 77 61 6e 74 |If the u|ser want|
|00005ab0| 73 20 69 74 20 61 6e 64 | 20 74 68 69 73 20 69 73 |s it and| this is|
|00005ac0| 20 74 68 65 20 66 69 72 | 73 74 20 70 61 72 74 20 | the fir|st part |
|00005ad0| 6f 66 20 61 20 73 65 71 | 75 65 6e 63 65 2c 0a 58 |of a seq|uence,.X|
|00005ae0| 09 20 2a 20 61 64 64 20 | 6e 61 6d 65 20 6f 66 20 |. * add |name of |
|00005af0| 63 75 72 72 65 6e 74 20 | 66 69 6c 65 20 61 73 20 |current |file as |
|00005b00| 70 72 65 66 69 78 2e 0a | 58 09 20 2a 2f 0a 58 09 |prefix..|X. */.X.|
|00005b10| 69 66 20 28 69 6e 64 5f | 70 72 65 66 69 78 20 26 |if (ind_|prefix &|
|00005b20| 26 20 73 61 76 65 64 20 | 3d 3d 20 30 29 0a 58 09 |& saved |== 0).X.|
|00005b30| 09 61 64 64 5f 63 75 72 | 5f 66 69 6c 65 5f 6e 61 |.add_cur|_file_na|
|00005b40| 6d 65 20 28 29 3b 0a 58 | 09 2f 2a 0a 58 09 20 2a |me ();.X|./*.X. *|
|00005b50| 20 49 66 20 74 68 65 72 | 65 20 61 72 65 20 6e 6f | If ther|e are no|
|00005b60| 20 73 61 76 65 64 20 63 | 68 61 72 61 63 74 65 72 | saved c|haracter|
|00005b70| 73 20 61 6e 64 20 74 68 | 65 20 75 73 65 72 20 77 |s and th|e user w|
|00005b80| 61 6e 74 73 20 6f 66 66 | 73 65 74 73 2c 0a 58 09 |ants off|sets,.X.|
|00005b90| 20 2a 20 74 68 65 6e 20 | 77 65 20 68 61 76 65 20 | * then |we have |
|00005ba0| 74 6f 20 61 64 64 20 61 | 6e 20 6f 66 66 73 65 74 |to add a|n offset|
|00005bb0| 20 66 69 72 73 74 2e 0a | 58 09 20 2a 2f 0a 58 09 | first..|X. */.X.|
|00005bc0| 69 66 20 28 69 6e 64 5f | 6f 66 66 73 65 74 20 26 |if (ind_|offset &|
|00005bd0| 26 20 73 61 76 65 64 20 | 3d 3d 20 30 29 0a 58 09 |& saved |== 0).X.|
|00005be0| 09 6f 75 74 70 75 74 5f | 6f 66 66 73 65 74 20 28 |.output_|offset (|
|00005bf0| 62 31 29 3b 0a 58 09 2f | 2a 0a 58 09 20 2a 20 49 |b1);.X./|*.X. * I|
|00005c00| 73 20 74 68 65 72 65 20 | 65 6e 6f 75 67 68 20 73 |s there |enough s|
|00005c10| 70 61 63 65 20 69 6e 20 | 6f 75 74 20 6f 75 74 62 |pace in |out outb|
|00005c20| 75 66 20 3f 0a 58 09 20 | 2a 2f 0a 58 09 6e 20 3d |uf ?.X. |*/.X.n =|
|00005c30| 20 62 32 20 2d 20 62 31 | 3b 0a 58 09 69 66 20 28 | b2 - b1|;.X.if (|
|00005c40| 28 69 6e 74 29 28 6c 65 | 76 65 6c 20 2d 20 6f 75 |(int)(le|vel - ou|
|00005c50| 74 5f 62 75 66 29 20 2b | 20 6e 20 2b 20 31 20 3e |t_buf) +| n + 1 >|
|00005c60| 20 62 75 66 5f 6c 65 6e | 29 0a 58 09 09 6d 61 6b | buf_len|).X..mak|
|00005c70| 65 5f 72 6f 6f 6d 20 28 | 6e 29 3b 0a 58 09 2f 2a |e_room (|n);.X./*|
|00005c80| 0a 58 09 20 2a 20 43 6f | 70 79 20 74 68 65 20 73 |.X. * Co|py the s|
|00005c90| 65 71 75 65 6e 63 65 2e | 20 49 74 20 6d 61 79 20 |equence.| It may |
|00005ca0| 62 65 20 65 6d 70 74 79 | 2c 20 73 6f 20 64 6f 6e |be empty|, so don|
|00005cb0| 27 74 20 66 6f 72 67 65 | 74 20 74 6f 20 61 64 64 |'t forge|t to add|
|00005cc0| 20 61 20 4c 46 20 68 65 | 72 65 2e 0a 58 09 20 2a | a LF he|re..X. *|
|00005cd0| 2f 0a 58 09 69 66 20 28 | 6e 20 3e 20 30 29 20 7b |/.X.if (|n > 0) {|
|00005ce0| 0a 58 09 09 46 41 53 54 | 5f 43 4f 50 59 20 28 62 |.X..FAST|_COPY (b|
|00005cf0| 31 2c 20 6c 65 76 65 6c | 2c 20 6e 29 3b 0a 58 09 |1, level|, n);.X.|
|00005d00| 09 6c 65 76 65 6c 20 2b | 3d 20 6e 3b 0a 58 09 7d |.level +|= n;.X.}|
|00005d10| 0a 58 09 69 66 20 28 69 | 6e 64 5f 70 65 72 6d 20 |.X.if (i|nd_perm |
|00005d20| 3d 3d 20 31 29 20 7b 0a | 58 09 09 2a 6c 65 76 65 |== 1) {.|X..*leve|
|00005d30| 6c 2b 2b 20 3d 20 27 5c | 6e 27 3b 0a 58 09 09 2f |l++ = '\|n';.X../|
|00005d40| 2a 0a 58 09 09 20 2a 20 | 54 68 65 72 65 20 6d 61 |*.X.. * |There ma|
|00005d50| 79 20 62 65 20 73 6f 6d | 65 20 74 65 6d 70 6f 72 |y be som|e tempor|
|00005d60| 61 72 69 6c 79 20 73 61 | 76 65 64 20 63 68 61 72 |arily sa|ved char|
|00005d70| 61 63 74 65 72 73 20 69 | 6e 20 6f 75 74 5f 62 75 |acters i|n out_bu|
|00005d80| 66 2e 20 4d 61 6b 65 0a | 58 09 09 20 2a 20 74 68 |f. Make.|X.. * th|
|00005d90| 65 6d 20 70 65 72 6d 61 | 6e 65 6e 74 2e 0a 58 09 |em perma|nent..X.|
|00005da0| 09 20 2a 2f 0a 58 09 09 | 6e 75 6d 5f 6f 75 74 5f |. */.X..|num_out_|
|00005db0| 62 75 66 20 3d 20 6c 65 | 76 65 6c 20 2d 20 6f 75 |buf = le|vel - ou|
|00005dc0| 74 5f 62 75 66 3b 0a 58 | 09 09 2f 2a 0a 58 09 09 |t_buf;.X|../*.X..|
|00005dd0| 20 2a 20 49 66 20 6e 65 | 63 65 73 73 61 72 79 2c | * If ne|cessary,|
|00005de0| 20 77 72 69 74 65 2e 0a | 58 09 09 20 2a 2f 0a 58 | write..|X.. */.X|
|00005df0| 09 09 69 66 20 28 6e 75 | 6d 5f 6f 75 74 5f 62 75 |..if (nu|m_out_bu|
|00005e00| 66 20 3e 20 54 48 52 45 | 53 48 4f 4c 44 29 0a 58 |f > THRE|SHOLD).X|
|00005e10| 09 09 09 66 6c 75 73 68 | 5f 6f 75 74 70 75 74 20 |...flush|_output |
|00005e20| 28 29 3b 0a 58 09 09 73 | 61 76 65 64 20 3d 20 30 |();.X..s|aved = 0|
|00005e30| 3b 0a 58 09 7d 20 65 6c | 73 65 0a 58 09 09 73 61 |;.X.} el|se.X..sa|
|00005e40| 76 65 64 20 3d 20 6e 3b | 0a 58 7d 0a 58 0a 58 6f |ved = n;|.X}.X.Xo|
|00005e50| 75 74 70 75 74 5f 6f 66 | 66 73 65 74 20 28 62 31 |utput_of|fset (b1|
|00005e60| 29 0a 58 43 48 41 52 5f | 54 59 50 45 20 2a 20 62 |).XCHAR_|TYPE * b|
|00005e70| 31 3b 0a 58 2f 2a 0a 58 | 20 2a 20 43 6f 6e 76 65 |1;.X/*.X| * Conve|
|00005e80| 72 74 20 6e 20 74 6f 20 | 69 74 73 20 63 68 61 72 |rt n to |its char|
|00005e90| 61 63 74 65 72 20 72 65 | 70 72 65 73 65 6e 74 61 |acter re|presenta|
|00005ea0| 74 69 6f 6e 20 69 6e 20 | 64 65 63 69 6d 61 6c 20 |tion in |decimal |
|00005eb0| 61 6e 64 20 61 70 70 65 | 6e 64 20 74 68 69 73 0a |and appe|nd this.|
|00005ec0| 58 20 2a 20 61 74 20 74 | 68 65 20 65 6e 64 20 6f |X * at t|he end o|
|00005ed0| 66 20 74 68 65 20 6f 75 | 74 70 75 74 20 62 75 66 |f the ou|tput buf|
|00005ee0| 66 65 72 2e 0a 58 20 2a | 20 4e 6f 72 6d 61 6c 6c |fer..X *| Normall|
|00005ef0| 79 20 77 65 20 6f 75 74 | 70 75 74 20 37 20 63 68 |y we out|put 7 ch|
|00005f00| 61 72 61 63 74 65 72 73 | 2e 20 49 66 20 74 68 65 |aracters|. If the|
|00005f10| 20 6e 75 6d 62 65 72 20 | 6e 65 65 64 73 20 6d 6f | number |needs mo|
|00005f20| 72 65 20 77 65 20 65 78 | 70 61 6e 64 2e 0a 58 20 |re we ex|pand..X |
|00005f30| 2a 2f 0a 58 7b 0a 58 09 | 72 65 67 69 73 74 65 72 |*/.X{.X.|register|
|00005f40| 20 69 6e 74 20 69 3b 0a | 58 09 72 65 67 69 73 74 | int i;.|X.regist|
|00005f50| 65 72 20 6c 6f 6e 67 20 | 6a 3b 0a 58 09 72 65 67 |er long |j;.X.reg|
|00005f60| 69 73 74 65 72 20 4c 53 | 45 45 4b 5f 54 59 50 45 |ister LS|EEK_TYPE|
|00005f70| 20 6c 3b 0a 58 09 43 48 | 41 52 5f 54 59 50 45 20 | l;.X.CH|AR_TYPE |
|00005f80| 2a 20 62 3b 0a 58 0a 58 | 09 6c 20 3d 20 6f 66 66 |* b;.X.X|.l = off|
|00005f90| 73 65 74 20 2b 20 28 69 | 6e 74 29 28 62 31 20 2d |set + (i|nt)(b1 -|
|00005fa0| 20 62 75 66 29 3b 0a 58 | 09 2f 2a 0a 58 09 20 2a | buf);.X|./*.X. *|
|00005fb0| 20 48 6f 77 20 6d 61 6e | 79 20 63 68 61 72 61 63 | How man|y charac|
|00005fc0| 74 65 72 73 20 6d 75 73 | 74 20 77 65 20 6f 75 74 |ters mus|t we out|
|00005fd0| 70 75 74 20 3f 0a 58 09 | 20 2a 2f 0a 58 09 66 6f |put ?.X.| */.X.fo|
|00005fe0| 72 20 28 69 20 3d 20 37 | 2c 20 6a 20 3d 20 31 30 |r (i = 7|, j = 10|
|00005ff0| 30 30 30 30 30 30 4c 3b | 20 6c 20 3e 3d 20 6a 3b |000000L;| l >= j;|
|00006000| 20 6a 20 2a 3d 20 31 30 | 2c 20 69 2b 2b 29 3b 0a | j *= 10|, i++);.|
|00006010| 58 0a 58 09 2f 2a 0a 58 | 09 20 2a 20 49 73 20 74 |X.X./*.X|. * Is t|
|00006020| 68 65 72 65 20 73 70 61 | 63 65 20 66 6f 72 20 28 |here spa|ce for (|
|00006030| 69 2b 31 29 20 63 68 61 | 72 61 63 74 65 72 73 20 |i+1) cha|racters |
|00006040| 61 74 20 74 68 65 20 65 | 6e 64 20 6f 66 20 74 68 |at the e|nd of th|
|00006050| 65 20 6f 75 74 70 75 74 | 20 62 75 66 66 65 72 3f |e output| buffer?|
|00006060| 0a 58 09 20 2a 20 49 66 | 20 6e 6f 74 2c 20 66 6c |.X. * If| not, fl|
|00006070| 75 73 68 20 69 74 2e 0a | 58 09 20 2a 2f 0a 58 09 |ush it..|X. */.X.|
|00006080| 69 66 20 28 28 69 6e 74 | 29 28 6c 65 76 65 6c 20 |if ((int|)(level |
|00006090| 2d 20 6f 75 74 5f 62 75 | 66 29 20 2b 20 69 2b 31 |- out_bu|f) + i+1|
|000060a0| 20 3e 20 62 75 66 5f 6c | 65 6e 29 0a 58 09 09 6d | > buf_l|en).X..m|
|000060b0| 61 6b 65 5f 72 6f 6f 6d | 20 28 69 2b 31 29 3b 0a |ake_room| (i+1);.|
|000060c0| 58 0a 58 09 62 20 3d 20 | 6c 65 76 65 6c 3b 0a 58 |X.X.b = |level;.X|
|000060d0| 09 6c 65 76 65 6c 20 2b | 3d 20 69 2b 31 3b 0a 58 |.level +|= i+1;.X|
|000060e0| 0a 58 09 62 5b 69 2d 2d | 5d 20 3d 20 27 20 27 3b |.X.b[i--|] = ' ';|
|000060f0| 0a 58 09 2f 2a 0a 58 09 | 20 2a 20 43 6f 6e 76 65 |.X./*.X.| * Conve|
|00006100| 72 74 20 74 68 65 20 6e | 75 6d 62 65 72 2e 0a 58 |rt the n|umber..X|
|00006110| 09 20 2a 2f 0a 58 09 64 | 6f 20 7b 0a 58 09 09 62 |. */.X.d|o {.X..b|
|00006120| 5b 69 2d 2d 5d 20 3d 20 | 27 30 27 20 2b 20 6c 20 |[i--] = |'0' + l |
|00006130| 25 20 31 30 3b 0a 58 09 | 09 6c 20 2f 3d 20 31 30 |% 10;.X.|.l /= 10|
|00006140| 3b 0a 58 09 7d 20 77 68 | 69 6c 65 20 28 6c 20 21 |;.X.} wh|ile (l !|
|00006150| 3d 20 30 29 3b 0a 58 09 | 2f 2a 0a 58 09 20 2a 20 |= 0);.X.|/*.X. * |
|00006160| 41 64 64 20 73 6f 6d 65 | 20 62 6c 61 6e 6b 73 20 |Add some| blanks |
|00006170| 69 6e 20 66 72 6f 6e 74 | 20 6f 66 20 6e 75 6d 62 |in front| of numb|
|00006180| 65 72 0a 58 09 20 2a 2f | 0a 58 09 66 6f 72 20 28 |er.X. */|.X.for (|
|00006190| 3b 20 69 20 3e 3d 20 30 | 3b 20 69 2d 2d 29 0a 58 |; i >= 0|; i--).X|
|000061a0| 09 09 62 20 5b 69 5d 20 | 3d 20 27 20 27 3b 0a 58 |..b [i] |= ' ';.X|
|000061b0| 7d 0a 58 0a 58 23 20 69 | 66 64 65 66 20 44 45 42 |}.X.X# i|fdef DEB|
|000061c0| 55 47 0a 58 6f 75 74 20 | 28 73 29 0a 58 7b 0a 58 |UG.Xout |(s).X{.X|
|000061d0| 09 66 70 75 74 63 20 28 | 73 2c 20 73 74 64 65 72 |.fputc (|s, stder|
|000061e0| 72 29 3b 0a 58 7d 0a 58 | 23 20 65 6c 73 65 20 44 |r);.X}.X|# else D|
|000061f0| 45 42 55 47 0a 58 2f 2a | 0a 58 20 2a 20 54 68 65 |EBUG.X/*|.X * The|
|00006200| 20 6d 61 69 6e 20 70 72 | 6f 67 72 61 6d 20 63 61 | main pr|ogram ca|
|00006210| 6c 6c 73 20 61 20 72 6f | 75 74 69 6e 65 20 63 61 |lls a ro|utine ca|
|00006220| 6c 6c 65 64 20 27 6f 75 | 74 27 2e 0a 58 20 2a 2f |lled 'ou|t'..X */|
|00006230| 0a 58 6f 75 74 20 28 73 | 29 0a 58 72 65 67 69 73 |.Xout (s|).Xregis|
|00006240| 74 65 72 20 63 68 61 72 | 20 2a 20 73 3b 0a 58 7b |ter char| * s;.X{|
|00006250| 0a 58 09 28 76 6f 69 64 | 29 77 72 69 74 65 20 28 |.X.(void|)write (|
|00006260| 32 2c 20 73 2c 20 73 74 | 72 6c 65 6e 28 73 29 29 |2, s, st|rlen(s))|
|00006270| 3b 0a 58 7d 0a 58 23 20 | 65 6e 64 69 66 20 44 45 |;.X}.X# |endif DE|
|00006280| 42 55 47 0a 45 4e 44 5f | 4f 46 5f 46 49 4c 45 0a |BUG.END_|OF_FILE.|
|00006290| 69 66 20 74 65 73 74 20 | 35 39 35 33 20 2d 6e 65 |if test |5953 -ne|
|000062a0| 20 60 77 63 20 2d 63 20 | 3c 27 6f 75 74 70 75 74 | `wc -c |<'output|
|000062b0| 2e 63 27 60 3b 20 74 68 | 65 6e 0a 20 20 20 20 65 |.c'`; th|en. e|
|000062c0| 63 68 6f 20 73 68 61 72 | 3a 20 5c 22 27 6f 75 74 |cho shar|: \"'out|
|000062d0| 70 75 74 2e 63 27 5c 22 | 20 75 6e 70 61 63 6b 65 |put.c'\"| unpacke|
|000062e0| 64 20 77 69 74 68 20 77 | 72 6f 6e 67 20 73 69 7a |d with w|rong siz|
|000062f0| 65 21 0a 66 69 0a 23 20 | 65 6e 64 20 6f 66 20 27 |e!.fi.# |end of '|
|00006300| 6f 75 74 70 75 74 2e 63 | 27 0a 66 69 0a 69 66 20 |output.c|'.fi.if |
|00006310| 74 65 73 74 20 2d 66 20 | 27 73 74 72 69 6e 67 73 |test -f |'strings|
|00006320| 2e 31 27 20 2d 61 20 22 | 24 7b 31 7d 22 20 21 3d |.1' -a "|${1}" !=|
|00006330| 20 22 2d 63 22 20 3b 20 | 74 68 65 6e 20 0a 20 20 | "-c" ; |then . |
|00006340| 65 63 68 6f 20 73 68 61 | 72 3a 20 57 69 6c 6c 20 |echo sha|r: Will |
|00006350| 6e 6f 74 20 63 6c 6f 62 | 62 65 72 20 65 78 69 73 |not clob|ber exis|
|00006360| 74 69 6e 67 20 66 69 6c | 65 20 5c 22 27 73 74 72 |ting fil|e \"'str|
|00006370| 69 6e 67 73 2e 31 27 5c | 22 0a 65 6c 73 65 0a 65 |ings.1'\|".else.e|
|00006380| 63 68 6f 20 73 68 61 72 | 3a 20 45 78 74 72 61 63 |cho shar|: Extrac|
|00006390| 74 69 6e 67 20 5c 22 27 | 73 74 72 69 6e 67 73 2e |ting \"'|strings.|
|000063a0| 31 27 5c 22 20 5c 28 34 | 38 36 33 20 63 68 61 72 |1'\" \(4|863 char|
|000063b0| 61 63 74 65 72 73 5c 29 | 0a 73 65 64 20 22 73 2f |acters\)|.sed "s/|
|000063c0| 5e 58 2f 2f 22 20 3e 27 | 73 74 72 69 6e 67 73 2e |^X//" >'|strings.|
|000063d0| 31 27 20 3c 3c 27 45 4e | 44 5f 4f 46 5f 46 49 4c |1' <<'EN|D_OF_FIL|
|000063e0| 45 27 0a 58 2e 54 48 20 | 53 54 52 49 4e 47 53 20 |E'.X.TH |STRINGS |
|000063f0| 31 20 22 35 2f 32 32 2f | 38 39 22 0a 58 2e 53 48 |1 "5/22/|89".X.SH|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.