home *** CD-ROM | disk | FTP | other *** search
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).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| Newsgroup Content (archive/news)
| magic
| Supported |
100%
| dexvert
| SHell self-extracting ARchive (archive/shar)
| magic
| Supported |
100%
| dexvert
| Internet Message Format (text/imf)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| news or mail, ASCII text
| default
| |
100%
| TrID
| E-Mail message (Var. 2)
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/329 Shell Archive Format
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
| |
100%
| xdgMime
| message/rfc822
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 46 72 6f 6d 3a 20 76 61 | 78 31 33 35 21 70 65 74 |From: va|x135!pet|
|00000010| 73 64 21 6a 6f 65 20 28 | 4a 6f 65 20 4f 72 6f 73 |sd!joe (|Joe Oros|
|00000020| 74 29 0a 53 75 62 6a 65 | 63 74 3a 20 43 6f 6d 70 |t).Subje|ct: Comp|
|00000030| 72 65 73 73 20 34 2e 30 | 20 28 70 61 72 74 20 32 |ress 4.0| (part 2|
|00000040| 20 6f 66 20 32 29 0a 4e | 65 77 73 67 72 6f 75 70 | of 2).N|ewsgroup|
|00000050| 73 3a 20 6d 6f 64 2e 73 | 6f 75 72 63 65 73 0a 41 |s: mod.s|ources.A|
|00000060| 70 70 72 6f 76 65 64 3a | 20 6a 6f 68 6e 40 67 65 |pproved:| john@ge|
|00000070| 6e 72 61 64 2e 55 55 43 | 50 0a 0a 4d 6f 64 2e 73 |nrad.UUC|P..Mod.s|
|00000080| 6f 75 72 63 65 73 3a 20 | 20 56 6f 6c 75 6d 65 20 |ources: | Volume |
|00000090| 32 2c 20 49 73 73 75 65 | 20 32 39 0a 53 75 62 6d |2, Issue| 29.Subm|
|000000a0| 69 74 74 65 64 20 62 79 | 3a 20 76 61 78 31 33 35 |itted by|: vax135|
|000000b0| 21 70 65 74 73 64 21 6a | 6f 65 20 28 4a 6f 65 20 |!petsd!j|oe (Joe |
|000000c0| 4f 72 6f 73 74 29 0a 0a | 23 21 20 2f 62 69 6e 2f |Orost)..|#! /bin/|
|000000d0| 73 68 0a 23 20 54 68 69 | 73 20 69 73 20 61 20 73 |sh.# Thi|s is a s|
|000000e0| 68 65 6c 6c 20 61 72 63 | 68 69 76 65 2c 20 6d 65 |hell arc|hive, me|
|000000f0| 61 6e 69 6e 67 3a 0a 23 | 20 31 2e 20 52 65 6d 6f |aning:.#| 1. Remo|
|00000100| 76 65 20 65 76 65 72 79 | 74 68 69 6e 67 20 61 62 |ve every|thing ab|
|00000110| 6f 76 65 20 74 68 65 20 | 23 21 20 2f 62 69 6e 2f |ove the |#! /bin/|
|00000120| 73 68 20 6c 69 6e 65 2e | 0a 23 20 32 2e 20 53 61 |sh line.|.# 2. Sa|
|00000130| 76 65 20 74 68 65 20 72 | 65 73 75 6c 74 69 6e 67 |ve the r|esulting|
|00000140| 20 74 65 78 74 20 69 6e | 20 61 20 66 69 6c 65 2e | text in| a file.|
|00000150| 0a 23 20 33 2e 20 45 78 | 65 63 75 74 65 20 74 68 |.# 3. Ex|ecute th|
|00000160| 65 20 66 69 6c 65 20 77 | 69 74 68 20 2f 62 69 6e |e file w|ith /bin|
|00000170| 2f 73 68 20 28 6e 6f 74 | 20 63 73 68 29 20 74 6f |/sh (not| csh) to|
|00000180| 20 63 72 65 61 74 65 20 | 74 68 65 20 66 69 6c 65 | create |the file|
|00000190| 73 3a 0a 23 09 52 45 41 | 44 4d 45 0a 23 09 52 45 |s:.#.REA|DME.#.RE|
|000001a0| 41 44 4d 45 33 2e 30 0a | 23 09 61 74 6f 62 2e 63 |ADME3.0.|#.atob.c|
|000001b0| 0a 23 09 62 74 6f 61 2e | 31 0a 23 09 62 74 6f 61 |.#.btoa.|1.#.btoa|
|000001c0| 2e 63 0a 23 09 63 6f 6d | 70 72 65 73 73 64 69 72 |.c.#.com|pressdir|
|000001d0| 0a 23 09 63 6f 6d 70 72 | 65 73 73 64 69 72 2e 31 |.#.compr|essdir.1|
|000001e0| 0a 23 09 74 61 72 6d 61 | 69 6c 0a 23 09 75 6e 63 |.#.tarma|il.#.unc|
|000001f0| 6f 6d 70 72 65 73 73 64 | 69 72 0a 23 09 75 6e 74 |ompressd|ir.#.unt|
|00000200| 61 72 6d 61 69 6c 0a 23 | 09 7a 63 6d 70 0a 23 09 |armail.#|.zcmp.#.|
|00000210| 7a 63 6d 70 2e 31 0a 23 | 09 7a 64 69 66 66 0a 23 |zcmp.1.#|.zdiff.#|
|00000220| 09 7a 6d 6f 72 65 0a 23 | 09 7a 6d 6f 72 65 2e 31 |.zmore.#|.zmore.1|
|00000230| 0a 23 20 54 68 69 73 20 | 61 72 63 68 69 76 65 20 |.# This |archive |
|00000240| 63 72 65 61 74 65 64 3a | 20 54 68 75 20 41 75 67 |created:| Thu Aug|
|00000250| 20 20 31 20 31 31 3a 35 | 33 3a 30 39 20 31 39 38 | 1 11:5|3:09 198|
|00000260| 35 0a 65 78 70 6f 72 74 | 20 50 41 54 48 3b 20 50 |5.export| PATH; P|
|00000270| 41 54 48 3d 2f 62 69 6e | 3a 24 50 41 54 48 0a 65 |ATH=/bin|:$PATH.e|
|00000280| 63 68 6f 20 73 68 61 72 | 3a 20 65 78 74 72 61 63 |cho shar|: extrac|
|00000290| 74 69 6e 67 20 22 27 52 | 45 41 44 4d 45 27 22 20 |ting "'R|EADME'" |
|000002a0| 27 28 33 31 39 34 20 63 | 68 61 72 61 63 74 65 72 |'(3194 c|haracter|
|000002b0| 73 29 27 0a 69 66 20 74 | 65 73 74 20 2d 66 20 27 |s)'.if t|est -f '|
|000002c0| 52 45 41 44 4d 45 27 0a | 74 68 65 6e 0a 09 65 63 |README'.|then..ec|
|000002d0| 68 6f 20 73 68 61 72 3a | 20 77 69 6c 6c 20 6e 6f |ho shar:| will no|
|000002e0| 74 20 6f 76 65 72 2d 77 | 72 69 74 65 20 65 78 69 |t over-w|rite exi|
|000002f0| 73 74 69 6e 67 20 66 69 | 6c 65 20 22 27 52 45 41 |sting fi|le "'REA|
|00000300| 44 4d 45 27 22 0a 65 6c | 73 65 0a 73 65 64 20 27 |DME'".el|se.sed '|
|00000310| 73 2f 5e 58 2f 2f 27 20 | 3c 3c 20 5c 53 48 41 52 |s/^X//' |<< \SHAR|
|00000320| 5f 45 4f 46 20 3e 20 27 | 52 45 41 44 4d 45 27 0a |_EOF > '|README'.|
|00000330| 43 6f 6d 70 72 65 73 73 | 20 76 65 72 73 69 6f 6e |Compress| version|
|00000340| 20 34 2e 30 20 69 6d 70 | 72 6f 76 65 6d 65 6e 74 | 4.0 imp|rovement|
|00000350| 73 3a 0a 09 6f 20 63 6f | 6d 70 72 65 73 73 28 29 |s:..o co|mpress()|
|00000360| 20 73 70 65 65 64 75 70 | 20 28 31 30 2d 35 30 25 | speedup| (10-50%|
|00000370| 29 20 62 79 20 63 68 61 | 6e 67 69 6e 67 20 64 69 |) by cha|nging di|
|00000380| 76 69 73 69 6f 6e 20 68 | 61 73 68 20 74 6f 20 78 |vision h|ash to x|
|00000390| 6f 72 0a 09 6f 20 64 65 | 63 6f 6d 70 72 65 73 73 |or..o de|compress|
|000003a0| 28 29 20 73 70 65 65 64 | 75 70 20 28 35 2d 31 30 |() speed|up (5-10|
|000003b0| 25 29 0a 09 6f 20 4d 65 | 6d 6f 72 79 20 72 65 71 |%)..o Me|mory req|
|000003c0| 75 69 72 65 6d 65 6e 74 | 73 20 72 65 64 75 63 65 |uirement|s reduce|
|000003d0| 64 20 28 33 2d 33 30 25 | 29 0a 09 6f 20 53 74 61 |d (3-30%|)..o Sta|
|000003e0| 63 6b 20 72 65 71 75 69 | 72 65 6d 65 6e 74 73 20 |ck requi|rements |
|000003f0| 72 65 64 75 63 65 64 20 | 74 6f 20 6c 65 73 73 20 |reduced |to less |
|00000400| 74 68 61 6e 20 34 6b 62 | 0a 09 6f 20 52 65 6d 6f |than 4kb|..o Remo|
|00000410| 76 65 64 20 27 42 69 67 | 2b 46 61 73 74 27 20 63 |ved 'Big|+Fast' c|
|00000420| 6f 6d 70 72 65 73 73 20 | 63 6f 64 65 20 28 46 42 |ompress |code (FB|
|00000430| 49 54 53 29 20 62 65 63 | 61 75 73 65 20 6f 66 20 |ITS) bec|ause of |
|00000440| 63 6f 6d 70 72 65 73 73 | 20 73 70 65 65 64 75 70 |compress| speedup|
|00000450| 0a 20 20 20 20 09 6f 20 | 50 6f 72 74 61 62 69 6c |. .o |Portabil|
|00000460| 69 74 79 20 6d 6f 64 73 | 20 66 6f 72 20 5a 38 30 |ity mods| for Z80|
|00000470| 30 30 20 61 6e 64 20 50 | 43 2f 58 54 20 28 62 75 |00 and P|C/XT (bu|
|00000480| 74 20 6e 6f 74 20 7a 65 | 75 73 20 33 2e 32 29 0a |t not ze|us 3.2).|
|00000490| 09 6f 20 44 65 66 61 75 | 6c 74 20 74 6f 20 27 71 |.o Defau|lt to 'q|
|000004a0| 75 69 65 74 27 20 6d 6f | 64 65 0a 09 6f 20 55 6e |uiet' mo|de..o Un|
|000004b0| 69 66 69 63 61 74 69 6f | 6e 20 6f 66 20 27 66 6f |ificatio|n of 'fo|
|000004c0| 72 63 65 27 20 66 6c 61 | 67 73 0a 09 6f 20 4d 61 |rce' fla|gs..o Ma|
|000004d0| 6e 75 61 6c 20 70 61 67 | 65 20 6f 76 65 72 68 61 |nual pag|e overha|
|000004e0| 75 6c 0a 09 6f 20 50 6f | 72 74 61 62 69 6c 69 74 |ul..o Po|rtabilit|
|000004f0| 79 20 65 6e 68 61 6e 63 | 65 6d 65 6e 74 20 66 6f |y enhanc|ement fo|
|00000500| 72 20 4d 5f 58 45 4e 49 | 58 0a 09 6f 20 52 65 6d |r M_XENI|X..o Rem|
|00000510| 6f 76 65 64 20 74 65 78 | 74 20 6f 6e 20 23 65 6c |oved tex|t on #el|
|00000520| 73 65 20 61 6e 64 20 23 | 65 6e 64 69 66 0a 09 6f |se and #|endif..o|
|00000530| 20 41 64 64 65 64 20 22 | 2d 56 22 20 73 77 69 74 | Added "|-V" swit|
|00000540| 63 68 20 74 6f 20 70 72 | 69 6e 74 20 76 65 72 73 |ch to pr|int vers|
|00000550| 69 6f 6e 20 61 6e 64 20 | 6f 70 74 69 6f 6e 73 0a |ion and |options.|
|00000560| 09 6f 20 41 64 64 65 64 | 20 23 64 65 66 69 6e 65 |.o Added| #define|
|00000570| 73 20 66 6f 72 20 53 49 | 47 4e 45 44 5f 43 4f 4d |s for SI|GNED_COM|
|00000580| 50 41 52 45 5f 53 4c 4f | 57 0a 09 6f 20 41 64 64 |PARE_SLO|W..o Add|
|00000590| 65 64 20 4d 61 6b 65 66 | 69 6c 65 20 61 6e 64 20 |ed Makef|ile and |
|000005a0| 22 75 73 65 72 6d 65 6d | 22 20 70 72 6f 67 72 61 |"usermem|" progra|
|000005b0| 6d 0a 09 6f 20 52 65 6d | 6f 76 65 64 20 61 6c 6c |m..o Rem|oved all|
|000005c0| 20 66 6c 6f 61 74 69 6e | 67 20 70 6f 69 6e 74 20 | floatin|g point |
|000005d0| 63 6f 6d 70 75 74 61 74 | 69 6f 6e 73 0a 09 6f 20 |computat|ions..o |
|000005e0| 4e 65 77 20 70 72 6f 67 | 72 61 6d 73 3a 0a 09 09 |New prog|rams:...|
|000005f0| 63 6f 6d 70 72 65 73 73 | 64 69 72 20 2d 20 63 6f |compress|dir - co|
|00000600| 6d 70 72 65 73 73 20 61 | 6c 6c 20 66 69 6c 65 73 |mpress a|ll files|
|00000610| 20 6f 6e 20 61 20 64 69 | 72 65 63 74 6f 72 79 0a | on a di|rectory.|
|00000620| 09 09 75 6e 63 6f 6d 70 | 72 65 73 73 64 69 72 20 |..uncomp|ressdir |
|00000630| 2d 20 75 6e 63 6f 6d 70 | 72 65 73 73 20 61 6c 6c |- uncomp|ress all|
|00000640| 20 66 69 6c 65 73 20 6f | 6e 20 61 20 64 69 72 65 | files o|n a dire|
|00000650| 63 74 6f 72 79 0a 09 09 | 7a 63 6d 70 20 2d 20 63 |ctory...|zcmp - c|
|00000660| 6d 70 20 63 6f 6d 70 72 | 65 73 73 65 64 20 66 69 |mp compr|essed fi|
|00000670| 6c 65 73 0a 09 09 7a 64 | 69 66 66 20 2d 20 64 69 |les...zd|iff - di|
|00000680| 66 66 20 63 6f 6d 70 72 | 65 73 73 65 64 20 66 69 |ff compr|essed fi|
|00000690| 6c 65 73 0a 09 20 20 54 | 68 65 20 66 6f 6c 6c 6f |les.. T|he follo|
|000006a0| 77 69 6e 67 20 61 72 65 | 20 77 69 74 68 20 74 68 |wing are| with th|
|000006b0| 61 6e 6b 73 20 74 6f 20 | 70 68 69 6c 61 62 73 21 |anks to |philabs!|
|000006c0| 70 65 72 3a 0a 09 09 62 | 74 6f 61 20 2d 20 63 6f |per:...b|toa - co|
|000006d0| 6e 76 65 72 74 20 62 69 | 6e 61 72 79 20 74 6f 20 |nvert bi|nary to |
|000006e0| 61 73 63 69 69 20 66 6f | 72 20 6d 61 69 6c 69 6e |ascii fo|r mailin|
|000006f0| 67 0a 09 09 61 74 6f 62 | 20 2d 20 63 6f 6e 76 65 |g...atob| - conve|
|00000700| 72 74 20 61 73 63 69 69 | 20 74 6f 20 62 69 6e 61 |rt ascii| to bina|
|00000710| 72 79 20 77 69 74 68 20 | 63 68 65 63 6b 73 75 6d |ry with |checksum|
|00000720| 0a 09 09 74 61 72 6d 61 | 69 6c 20 2d 20 74 61 72 |...tarma|il - tar|
|00000730| 2c 20 63 6f 6d 70 72 65 | 73 73 2c 20 62 74 6f 61 |, compre|ss, btoa|
|00000740| 2c 20 61 6e 64 20 6d 61 | 69 6c 20 66 69 6c 65 73 |, and ma|il files|
|00000750| 0a 09 09 75 6e 74 61 72 | 6d 61 69 6c 20 2d 20 72 |...untar|mail - r|
|00000760| 65 73 74 6f 72 65 20 22 | 74 61 72 6d 61 69 6c 22 |estore "|tarmail"|
|00000770| 20 66 69 6c 65 73 0a 0a | 09 09 57 41 52 4e 49 4e | files..|..WARNIN|
|00000780| 47 3a 20 54 68 65 73 65 | 20 6c 61 73 74 20 66 65 |G: These| last fe|
|00000790| 77 20 70 72 6f 67 72 61 | 6d 73 20 61 72 65 20 6e |w progra|ms are n|
|000007a0| 6f 74 20 63 6f 6d 70 61 | 74 69 62 6c 65 20 0a 09 |ot compa|tible ..|
|000007b0| 09 77 69 74 68 20 74 68 | 65 20 6f 72 69 67 69 6e |.with th|e origin|
|000007c0| 61 6c 20 6f 6e 65 73 20 | 66 72 6f 6d 20 74 68 65 |al ones |from the|
|000007d0| 20 6e 65 74 2e 20 20 54 | 68 65 20 65 6e 63 6f 64 | net. T|he encod|
|000007e0| 69 6e 67 0a 09 09 68 61 | 73 20 63 68 61 6e 67 65 |ing...ha|s change|
|000007f0| 64 2e 20 20 53 65 65 20 | 62 74 6f 61 2e 63 20 66 |d. See |btoa.c f|
|00000800| 6f 72 20 6d 6f 72 65 20 | 69 6e 66 6f 2e 0a 0a 54 |or more |info...T|
|00000810| 68 65 20 22 75 73 65 72 | 6d 65 6d 22 20 73 63 72 |he "user|mem" scr|
|00000820| 69 70 74 20 61 74 74 65 | 6d 70 74 73 20 74 6f 20 |ipt atte|mpts to |
|00000830| 64 65 74 65 72 6d 69 6e | 65 20 74 68 65 20 6d 61 |determin|e the ma|
|00000840| 78 69 6d 75 6d 20 70 72 | 6f 63 65 73 73 20 73 69 |ximum pr|ocess si|
|00000850| 7a 65 2e 20 20 53 6f 6d | 65 0a 65 64 69 74 69 6e |ze. Som|e.editin|
|00000860| 67 20 6f 66 20 74 68 65 | 20 73 63 72 69 70 74 20 |g of the| script |
|00000870| 6d 61 79 20 62 65 20 6e | 65 63 65 73 73 61 72 79 |may be n|ecessary|
|00000880| 20 28 73 65 65 20 74 68 | 65 20 63 6f 6d 6d 65 6e | (see th|e commen|
|00000890| 74 73 29 2e 20 20 49 66 | 20 79 6f 75 20 63 61 6e |ts). If| you can|
|000008a0| 27 74 20 67 65 74 0a 69 | 74 20 74 6f 20 77 6f 72 |'t get.i|t to wor|
|000008b0| 6b 20 61 74 20 61 6c 6c | 2c 20 6a 75 73 74 20 63 |k at all|, just c|
|000008c0| 72 65 61 74 65 20 66 69 | 6c 65 20 22 55 53 45 52 |reate fi|le "USER|
|000008d0| 4d 45 4d 22 20 63 6f 6e | 74 61 69 6e 69 6e 67 20 |MEM" con|taining |
|000008e0| 74 68 65 20 6d 61 78 69 | 6d 75 6d 20 70 72 6f 63 |the maxi|mum proc|
|000008f0| 65 73 73 0a 73 69 7a 65 | 20 69 6e 20 64 65 63 69 |ess.size| in deci|
|00000900| 6d 61 6c 2e 0a 0a 54 68 | 65 20 66 6f 6c 6c 6f 77 |mal...Th|e follow|
|00000910| 69 6e 67 20 70 72 65 70 | 72 6f 63 65 73 73 6f 72 |ing prep|rocessor|
|00000920| 20 73 79 6d 62 6f 6c 73 | 20 63 6f 6e 74 72 6f 6c | symbols| control|
|00000930| 20 74 68 65 20 63 6f 6d | 70 69 6c 61 74 69 6f 6e | the com|pilation|
|00000940| 20 6f 66 20 22 63 6f 6d | 70 72 65 73 73 2e 63 22 | of "com|press.c"|
|00000950| 3a 0a 0a 09 6f 20 55 53 | 45 52 4d 45 4d 09 09 4d |:...o US|ERMEM..M|
|00000960| 61 78 69 6d 75 6d 20 70 | 72 6f 63 65 73 73 20 6d |aximum p|rocess m|
|00000970| 65 6d 6f 72 79 20 6f 6e | 20 74 68 65 20 73 79 73 |emory on| the sys|
|00000980| 74 65 6d 0a 09 6f 20 53 | 41 43 52 45 44 4d 45 4d |tem..o S|ACREDMEM|
|00000990| 09 09 41 6d 6f 75 6e 74 | 20 74 6f 20 72 65 73 65 |..Amount| to rese|
|000009a0| 72 76 65 20 66 6f 72 20 | 6f 74 68 65 72 20 70 72 |rve for |other pr|
|000009b0| 6f 63 65 73 65 73 0a 09 | 6f 20 53 49 47 4e 45 44 |oceses..|o SIGNED|
|000009c0| 5f 43 4f 4d 50 41 52 45 | 5f 53 4c 4f 57 09 55 6e |_COMPARE|_SLOW.Un|
|000009d0| 73 69 67 6e 65 64 20 63 | 6f 6d 70 61 72 65 20 69 |signed c|ompare i|
|000009e0| 6e 73 74 72 75 63 74 69 | 6f 6e 73 20 61 72 65 20 |nstructi|ons are |
|000009f0| 66 61 73 74 65 72 0a 09 | 6f 20 4e 4f 5f 55 43 48 |faster..|o NO_UCH|
|00000a00| 41 52 09 09 44 6f 6e 27 | 74 20 75 73 65 20 22 75 |AR..Don'|t use "u|
|00000a10| 6e 73 69 67 6e 65 64 20 | 63 68 61 72 22 20 74 79 |nsigned |char" ty|
|00000a20| 70 65 73 0a 09 6f 20 42 | 49 54 53 09 09 09 4f 76 |pes..o B|ITS...Ov|
|00000a30| 65 72 72 75 6c 65 73 20 | 64 65 66 61 75 6c 74 20 |errules |default |
|00000a40| 73 65 74 20 62 79 20 55 | 53 45 52 4d 45 4d 2d 53 |set by U|SERMEM-S|
|00000a50| 41 43 52 45 44 4d 45 4d | 0a 09 6f 20 76 61 78 09 |ACREDMEM|..o vax.|
|00000a60| 09 09 47 65 6e 65 72 61 | 74 65 20 69 6e 6c 69 6e |..Genera|te inlin|
|00000a70| 65 20 61 73 73 65 6d 62 | 6c 65 72 0a 09 6f 20 69 |e assemb|ler..o i|
|00000a80| 6e 74 65 72 64 61 74 61 | 09 09 44 65 66 69 6e 65 |nterdata|..Define|
|00000a90| 73 20 53 49 47 4e 45 44 | 5f 43 4f 4d 50 41 52 45 |s SIGNED|_COMPARE|
|00000aa0| 5f 53 4c 4f 57 0a 09 6f | 20 4d 5f 58 45 4e 49 58 |_SLOW..o| M_XENIX|
|00000ab0| 09 09 4d 61 6b 65 73 20 | 61 72 72 61 79 73 20 3c |..Makes |arrays <|
|00000ac0| 20 36 35 35 33 36 20 62 | 79 74 65 73 20 65 61 63 | 65536 b|ytes eac|
|00000ad0| 68 0a 09 6f 20 70 64 70 | 31 31 09 09 09 42 49 54 |h..o pdp|11...BIT|
|00000ae0| 53 3d 31 32 2c 20 4e 4f | 5f 55 43 48 41 52 0a 09 |S=12, NO|_UCHAR..|
|00000af0| 6f 20 7a 38 30 30 30 09 | 09 09 42 49 54 53 3d 31 |o z8000.|..BITS=1|
|00000b00| 32 0a 09 6f 20 70 63 78 | 74 09 09 09 42 49 54 53 |2..o pcx|t...BITS|
|00000b10| 3d 31 32 0a 09 6f 20 42 | 53 44 34 5f 32 09 09 41 |=12..o B|SD4_2..A|
|00000b20| 6c 6c 6f 77 20 6c 6f 6e | 67 20 66 69 6c 65 6e 61 |llow lon|g filena|
|00000b30| 6d 65 73 20 28 20 3e 20 | 31 34 20 63 68 61 72 61 |mes ( > |14 chara|
|00000b40| 63 74 65 72 73 29 20 26 | 0a 09 09 09 09 43 61 6c |cters) &|.....Cal|
|00000b50| 6c 20 73 65 74 6c 69 6e | 65 62 75 66 28 73 74 64 |l setlin|ebuf(std|
|00000b60| 65 72 72 29 0a 0a 54 68 | 65 20 64 69 66 66 65 72 |err)..Th|e differ|
|00000b70| 65 6e 63 65 20 22 75 73 | 65 72 6d 65 6d 2d 73 61 |ence "us|ermem-sa|
|00000b80| 63 72 65 64 6d 65 6d 22 | 20 64 65 74 65 72 6d 69 |credmem"| determi|
|00000b90| 6e 65 73 20 74 68 65 20 | 6d 61 78 69 6d 75 6d 20 |nes the |maximum |
|00000ba0| 42 49 54 53 20 74 68 61 | 74 20 63 61 6e 20 62 65 |BITS tha|t can be|
|00000bb0| 0a 73 70 65 63 69 66 69 | 65 64 20 77 69 74 68 20 |.specifi|ed with |
|00000bc0| 74 68 65 20 22 2d 62 22 | 20 66 6c 61 67 2e 0a 0a |the "-b"| flag...|
|00000bd0| 6d 65 6d 6f 72 79 3a 20 | 61 74 20 6c 65 61 73 74 |memory: |at least|
|00000be0| 09 09 42 49 54 53 0a 2d | 2d 2d 2d 2d 2d 20 20 2d |..BITS.-|----- -|
|00000bf0| 2d 20 2d 2d 2d 2d 2d 20 | 20 20 20 20 20 20 20 20 |- ----- | |
|00000c00| 20 20 20 20 20 20 20 2d | 2d 2d 2d 0a 20 20 20 20 | -|---. |
|00000c10| 20 34 33 33 2c 34 38 34 | 09 09 09 20 31 36 0a 20 | 433,484|... 16. |
|00000c20| 20 20 20 20 32 32 39 2c | 36 30 30 09 09 09 20 31 | 229,|600... 1|
|00000c30| 35 0a 20 20 20 20 20 31 | 32 37 2c 35 33 36 09 09 |5. 1|27,536..|
|00000c40| 09 20 31 34 0a 20 20 20 | 20 20 20 37 33 2c 34 36 |. 14. | 73,46|
|00000c50| 34 09 09 09 20 31 33 0a | 20 20 20 20 20 20 20 20 |4... 13.| |
|00000c60| 20 20 20 30 09 09 09 20 | 31 32 0a 0a 54 68 65 20 | 0... |12..The |
|00000c70| 64 65 66 61 75 6c 74 20 | 69 73 20 42 49 54 53 3d |default |is BITS=|
|00000c80| 31 36 2e 0a 0a 54 68 65 | 20 6d 61 78 69 6d 75 6d |16...The| maximum|
|00000c90| 20 62 69 74 73 20 63 61 | 6e 20 62 65 20 6f 76 65 | bits ca|n be ove|
|00000ca0| 72 72 75 6c 6c 65 64 20 | 62 79 20 73 70 65 63 69 |rrulled |by speci|
|00000cb0| 66 79 69 6e 67 20 22 2d | 44 42 49 54 53 3d 62 69 |fying "-|DBITS=bi|
|00000cc0| 74 73 22 20 61 74 0a 63 | 6f 6d 70 69 6c 61 74 69 |ts" at.c|ompilati|
|00000cd0| 6f 6e 20 74 69 6d 65 2e | 0a 0a 57 41 52 4e 49 4e |on time.|..WARNIN|
|00000ce0| 47 3a 20 66 69 6c 65 73 | 20 63 6f 6d 70 72 65 73 |G: files| compres|
|00000cf0| 73 65 64 20 6f 6e 20 61 | 20 6c 61 72 67 65 20 6d |sed on a| large m|
|00000d00| 61 63 68 69 6e 65 20 77 | 69 74 68 20 6d 6f 72 65 |achine w|ith more|
|00000d10| 20 62 69 74 73 20 74 68 | 61 6e 20 61 6c 6c 6f 77 | bits th|an allow|
|00000d20| 65 64 20 62 79 20 0a 61 | 20 76 65 72 73 69 6f 6e |ed by .a| version|
|00000d30| 20 6f 66 20 63 6f 6d 70 | 72 65 73 73 20 6f 6e 20 | of comp|ress on |
|00000d40| 61 20 73 6d 61 6c 6c 65 | 72 20 6d 61 63 68 69 6e |a smalle|r machin|
|00000d50| 65 20 63 61 6e 6e 6f 74 | 20 62 65 20 64 65 63 6f |e cannot| be deco|
|00000d60| 6d 70 72 65 73 73 65 64 | 21 20 20 55 73 65 20 74 |mpressed|! Use t|
|00000d70| 68 65 0a 22 2d 62 31 32 | 22 20 66 6c 61 67 20 74 |he."-b12|" flag t|
|00000d80| 6f 20 67 65 6e 65 72 61 | 74 65 20 61 20 66 69 6c |o genera|te a fil|
|00000d90| 65 20 6f 6e 20 61 20 6c | 61 72 67 65 20 6d 61 63 |e on a l|arge mac|
|00000da0| 68 69 6e 65 20 74 68 61 | 74 20 63 61 6e 20 62 65 |hine tha|t can be|
|00000db0| 20 75 6e 63 6f 6d 70 72 | 65 73 73 65 64 20 0a 6f | uncompr|essed .o|
|00000dc0| 6e 20 61 20 31 36 2d 62 | 69 74 20 6d 61 63 68 69 |n a 16-b|it machi|
|00000dd0| 6e 65 2e 0a 0a 54 68 65 | 20 6f 75 74 70 75 74 20 |ne...The| output |
|00000de0| 6f 66 20 63 6f 6d 70 72 | 65 73 73 20 34 2e 30 20 |of compr|ess 4.0 |
|00000df0| 69 73 20 66 75 6c 6c 79 | 20 63 6f 6d 70 61 74 69 |is fully| compati|
|00000e00| 62 6c 65 20 77 69 74 68 | 20 74 68 61 74 20 6f 66 |ble with| that of|
|00000e10| 20 63 6f 6d 70 72 65 73 | 73 20 33 2e 30 2e 0a 49 | compres|s 3.0..I|
|00000e20| 6e 20 6f 74 68 65 72 20 | 77 6f 72 64 73 2c 20 74 |n other |words, t|
|00000e30| 68 65 20 6f 75 74 70 75 | 74 20 6f 66 20 63 6f 6d |he outpu|t of com|
|00000e40| 70 72 65 73 73 20 34 2e | 30 20 6d 61 79 20 62 65 |press 4.|0 may be|
|00000e50| 20 66 65 64 20 69 6e 74 | 6f 20 75 6e 63 6f 6d 70 | fed int|o uncomp|
|00000e60| 72 65 73 73 20 33 2e 30 | 20 6f 72 0a 74 68 65 20 |ress 3.0| or.the |
|00000e70| 6f 75 74 70 75 74 20 6f | 66 20 63 6f 6d 70 72 65 |output o|f compre|
|00000e80| 73 73 20 33 2e 30 20 6d | 61 79 20 62 65 20 66 65 |ss 3.0 m|ay be fe|
|00000e90| 64 20 69 6e 74 6f 20 75 | 6e 63 6f 6d 70 72 65 73 |d into u|ncompres|
|00000ea0| 73 20 34 2e 30 2e 0a 0a | 54 68 65 20 6f 75 74 70 |s 4.0...|The outp|
|00000eb0| 75 74 20 6f 66 20 63 6f | 6d 70 72 65 73 73 20 34 |ut of co|mpress 4|
|00000ec0| 2e 30 20 6e 6f 74 20 63 | 6f 6d 70 61 74 61 62 6c |.0 not c|ompatabl|
|00000ed0| 65 20 77 69 74 68 20 74 | 68 61 74 20 6f 66 0a 63 |e with t|hat of.c|
|00000ee0| 6f 6d 70 72 65 73 73 20 | 32 2e 30 2e 20 20 48 6f |ompress |2.0. Ho|
|00000ef0| 77 65 76 65 72 2c 20 63 | 6f 6d 70 72 65 73 73 20 |wever, c|ompress |
|00000f00| 34 2e 30 20 73 74 69 6c | 6c 20 61 63 63 65 70 74 |4.0 stil|l accept|
|00000f10| 73 20 74 68 65 20 6f 75 | 74 70 75 74 20 6f 66 0a |s the ou|tput of.|
|00000f20| 63 6f 6d 70 72 65 73 73 | 20 32 2e 30 2e 20 20 54 |compress| 2.0. T|
|00000f30| 6f 20 67 65 6e 65 72 61 | 74 65 20 6f 75 74 70 75 |o genera|te outpu|
|00000f40| 74 20 74 68 61 74 20 69 | 73 20 63 6f 6d 70 61 74 |t that i|s compat|
|00000f50| 61 62 6c 65 20 77 69 74 | 68 20 63 6f 6d 70 72 65 |able wit|h compre|
|00000f60| 73 73 0a 32 2e 30 2c 20 | 75 73 65 20 74 68 65 20 |ss.2.0, |use the |
|00000f70| 75 6e 64 6f 63 75 6d 65 | 6e 74 65 64 20 22 2d 43 |undocume|nted "-C|
|00000f80| 22 20 66 6c 61 67 2e 0a | 0a 43 68 65 63 6b 20 74 |" flag..|.Check t|
|00000f90| 68 65 20 4d 61 6b 65 66 | 69 6c 65 2c 20 74 68 65 |he Makef|ile, the|
|00000fa0| 6e 20 22 6d 61 6b 65 22 | 2e 0a 53 48 41 52 5f 45 |n "make"|..SHAR_E|
|00000fb0| 4f 46 0a 69 66 20 74 65 | 73 74 20 33 31 39 34 20 |OF.if te|st 3194 |
|00000fc0| 2d 6e 65 20 22 60 77 63 | 20 2d 63 20 3c 20 27 52 |-ne "`wc| -c < 'R|
|00000fd0| 45 41 44 4d 45 27 60 22 | 0a 74 68 65 6e 0a 09 65 |EADME'`"|.then..e|
|00000fe0| 63 68 6f 20 73 68 61 72 | 3a 20 65 72 72 6f 72 20 |cho shar|: error |
|00000ff0| 74 72 61 6e 73 6d 69 74 | 74 69 6e 67 20 22 27 52 |transmit|ting "'R|
|00001000| 45 41 44 4d 45 27 22 20 | 27 28 73 68 6f 75 6c 64 |EADME'" |'(should|
|00001010| 20 68 61 76 65 20 62 65 | 65 6e 20 33 31 39 34 20 | have be|en 3194 |
|00001020| 63 68 61 72 61 63 74 65 | 72 73 29 27 0a 66 69 0a |characte|rs)'.fi.|
|00001030| 66 69 20 23 20 65 6e 64 | 20 6f 66 20 6f 76 65 72 |fi # end| of over|
|00001040| 77 72 69 74 69 6e 67 20 | 63 68 65 63 6b 0a 65 63 |writing |check.ec|
|00001050| 68 6f 20 73 68 61 72 3a | 20 65 78 74 72 61 63 74 |ho shar:| extract|
|00001060| 69 6e 67 20 22 27 52 45 | 41 44 4d 45 33 2e 30 27 |ing "'RE|ADME3.0'|
|00001070| 22 20 27 28 38 31 34 32 | 20 63 68 61 72 61 63 74 |" '(8142| charact|
|00001080| 65 72 73 29 27 0a 69 66 | 20 74 65 73 74 20 2d 66 |ers)'.if| test -f|
|00001090| 20 27 52 45 41 44 4d 45 | 33 2e 30 27 0a 74 68 65 | 'README|3.0'.the|
|000010a0| 6e 0a 09 65 63 68 6f 20 | 73 68 61 72 3a 20 77 69 |n..echo |shar: wi|
|000010b0| 6c 6c 20 6e 6f 74 20 6f | 76 65 72 2d 77 72 69 74 |ll not o|ver-writ|
|000010c0| 65 20 65 78 69 73 74 69 | 6e 67 20 66 69 6c 65 20 |e existi|ng file |
|000010d0| 22 27 52 45 41 44 4d 45 | 33 2e 30 27 22 0a 65 6c |"'README|3.0'".el|
|000010e0| 73 65 0a 73 65 64 20 27 | 73 2f 5e 58 2f 2f 27 20 |se.sed '|s/^X//' |
|000010f0| 3c 3c 20 5c 53 48 41 52 | 5f 45 4f 46 20 3e 20 27 |<< \SHAR|_EOF > '|
|00001100| 52 45 41 44 4d 45 33 2e | 30 27 0a 45 6e 63 6c 6f |README3.|0'.Enclo|
|00001110| 73 65 64 20 69 73 20 63 | 6f 6d 70 72 65 73 73 20 |sed is c|ompress |
|00001120| 76 65 72 73 69 6f 6e 20 | 33 2e 30 20 77 69 74 68 |version |3.0 with|
|00001130| 20 74 68 65 20 66 6f 6c | 6c 6f 77 69 6e 67 20 63 | the fol|lowing c|
|00001140| 68 61 6e 67 65 73 3a 0a | 0a 31 2e 09 22 42 6c 6f |hanges:.|.1.."Blo|
|00001150| 63 6b 22 20 63 6f 6d 70 | 72 65 73 73 69 6f 6e 20 |ck" comp|ression |
|00001160| 69 73 20 70 65 72 66 6f | 72 6d 65 64 2e 20 20 41 |is perfo|rmed. A|
|00001170| 66 74 65 72 20 74 68 65 | 20 42 49 54 53 20 72 75 |fter the| BITS ru|
|00001180| 6e 20 6f 75 74 2c 20 74 | 68 65 0a 09 63 6f 6d 70 |n out, t|he..comp|
|00001190| 72 65 73 73 69 6f 6e 20 | 72 61 74 69 6f 20 69 73 |ression |ratio is|
|000011a0| 20 63 68 65 63 6b 65 64 | 20 65 76 65 72 79 20 73 | checked| every s|
|000011b0| 6f 20 6f 66 74 65 6e 2e | 20 20 49 66 20 69 74 20 |o often.| If it |
|000011c0| 69 73 20 64 65 63 72 65 | 61 73 69 6e 67 2c 0a 09 |is decre|asing,..|
|000011d0| 74 68 65 20 74 61 62 6c | 65 20 69 73 20 63 6c 65 |the tabl|e is cle|
|000011e0| 61 72 65 64 20 61 6e 64 | 20 61 20 6e 65 77 20 73 |ared and| a new s|
|000011f0| 65 74 20 6f 66 20 73 75 | 62 73 74 72 69 6e 67 73 |et of su|bstrings|
|00001200| 20 61 72 65 20 67 65 6e | 65 72 61 74 65 64 2e 0a | are gen|erated..|
|00001210| 0a 09 54 68 69 73 20 6d | 61 6b 65 73 20 74 68 65 |..This m|akes the|
|00001220| 20 6f 75 74 70 75 74 20 | 6f 66 20 63 6f 6d 70 72 | output |of compr|
|00001230| 65 73 73 20 33 2e 30 20 | 6e 6f 74 20 63 6f 6d 70 |ess 3.0 |not comp|
|00001240| 61 74 61 62 6c 65 20 77 | 69 74 68 20 74 68 61 74 |atable w|ith that|
|00001250| 20 6f 66 0a 09 63 6f 6d | 70 72 65 73 73 20 32 2e | of..com|press 2.|
|00001260| 30 2e 20 20 48 6f 77 65 | 76 65 72 2c 20 63 6f 6d |0. Howe|ver, com|
|00001270| 70 72 65 73 73 20 33 2e | 30 20 73 74 69 6c 6c 20 |press 3.|0 still |
|00001280| 61 63 63 65 70 74 73 20 | 74 68 65 20 6f 75 74 70 |accepts |the outp|
|00001290| 75 74 20 6f 66 0a 09 63 | 6f 6d 70 72 65 73 73 20 |ut of..c|ompress |
|000012a0| 32 2e 30 2e 20 20 54 6f | 20 67 65 6e 65 72 61 74 |2.0. To| generat|
|000012b0| 65 20 6f 75 74 70 75 74 | 20 74 68 61 74 20 69 73 |e output| that is|
|000012c0| 20 63 6f 6d 70 61 74 61 | 62 6c 65 20 77 69 74 68 | compata|ble with|
|000012d0| 20 63 6f 6d 70 72 65 73 | 73 0a 09 32 2e 30 2c 20 | compres|s..2.0, |
|000012e0| 75 73 65 20 74 68 65 20 | 75 6e 64 6f 63 75 6d 65 |use the |undocume|
|000012f0| 6e 74 65 64 20 22 2d 43 | 22 20 66 6c 61 67 2e 0a |nted "-C|" flag..|
|00001300| 0a 32 2e 09 41 20 71 75 | 69 65 74 20 22 2d 71 22 |.2..A qu|iet "-q"|
|00001310| 20 66 6c 61 67 20 68 61 | 73 20 62 65 65 6e 20 61 | flag ha|s been a|
|00001320| 64 64 65 64 20 66 6f 72 | 20 75 73 65 20 62 79 20 |dded for| use by |
|00001330| 74 68 65 20 6e 65 77 73 | 20 73 79 73 74 65 6d 2e |the news| system.|
|00001340| 0a 0a 33 2e 09 54 68 65 | 20 63 68 61 72 61 63 74 |..3..The| charact|
|00001350| 65 72 20 63 68 61 69 6e | 69 6e 67 20 68 61 73 20 |er chain|ing has |
|00001360| 62 65 65 6e 20 64 65 6c | 65 74 65 64 20 61 6e 64 |been del|eted and|
|00001370| 20 74 68 65 20 70 72 6f | 67 72 61 6d 20 6e 6f 77 | the pro|gram now|
|00001380| 20 75 73 65 73 0a 09 68 | 61 73 68 69 6e 67 2e 20 | uses..h|ashing. |
|00001390| 20 54 68 69 73 20 69 6d | 70 72 6f 76 65 73 20 74 | This im|proves t|
|000013a0| 68 65 20 73 70 65 65 64 | 20 6f 66 20 74 68 65 20 |he speed| of the |
|000013b0| 70 72 6f 67 72 61 6d 2c | 20 65 73 70 65 63 69 61 |program,| especia|
|000013c0| 6c 6c 79 0a 09 64 75 72 | 69 6e 67 20 64 65 63 6f |lly..dur|ing deco|
|000013d0| 6d 70 72 65 73 73 69 6f | 6e 2e 20 20 4f 74 68 65 |mpressio|n. Othe|
|000013e0| 72 20 73 70 65 65 64 20 | 69 6d 70 72 6f 76 65 6d |r speed |improvem|
|000013f0| 65 6e 74 73 20 68 61 76 | 65 20 62 65 65 6e 20 6d |ents hav|e been m|
|00001400| 61 64 65 2c 0a 09 73 75 | 63 68 20 61 73 20 75 73 |ade,..su|ch as us|
|00001410| 69 6e 67 20 70 75 74 63 | 28 29 20 69 6e 73 74 65 |ing putc|() inste|
|00001420| 61 64 20 6f 66 20 66 77 | 72 69 74 65 28 29 2e 0a |ad of fw|rite()..|
|00001430| 0a 34 2e 09 41 20 6c 61 | 72 67 65 20 74 61 62 6c |.4..A la|rge tabl|
|00001440| 65 20 69 73 20 75 73 65 | 64 20 6f 6e 20 6c 61 72 |e is use|d on lar|
|00001450| 67 65 20 6d 61 63 68 69 | 6e 65 73 20 77 68 65 6e |ge machi|nes when|
|00001460| 20 61 20 72 65 6c 61 74 | 69 76 65 6c 79 20 73 6d | a relat|ively sm|
|00001470| 61 6c 6c 0a 09 6e 75 6d | 62 65 72 20 6f 66 20 62 |all..num|ber of b|
|00001480| 69 74 73 20 69 73 20 73 | 70 65 63 69 66 69 65 64 |its is s|pecified|
|00001490| 2e 20 20 54 68 69 73 20 | 73 61 76 65 73 20 6d 75 |. This |saves mu|
|000014a0| 63 68 20 74 69 6d 65 20 | 77 68 65 6e 20 63 6f 6d |ch time |when com|
|000014b0| 70 72 65 73 73 69 6e 67 | 0a 09 66 6f 72 20 61 20 |pressing|..for a |
|000014c0| 31 36 2d 62 69 74 20 6d | 61 63 68 69 6e 65 20 6f |16-bit m|achine o|
|000014d0| 6e 20 61 20 33 32 2d 62 | 69 74 20 76 69 72 74 75 |n a 32-b|it virtu|
|000014e0| 61 6c 20 6d 61 63 68 69 | 6e 65 2e 20 20 4e 6f 74 |al machi|ne. Not|
|000014f0| 65 20 74 68 61 74 20 74 | 68 65 0a 09 73 70 65 65 |e that t|he..spee|
|00001500| 64 20 69 6d 70 72 6f 76 | 65 6d 65 6e 74 20 6f 6e |d improv|ement on|
|00001510| 6c 79 20 6f 63 63 75 72 | 73 20 77 68 65 6e 20 74 |ly occur|s when t|
|00001520| 68 65 20 69 6e 70 75 74 | 20 66 69 6c 65 20 69 73 |he input| file is|
|00001530| 20 3e 20 33 30 30 30 30 | 0a 09 63 68 61 72 61 63 | > 30000|..charac|
|00001540| 74 65 72 73 2c 20 61 6e | 64 20 74 68 65 20 2d 62 |ters, an|d the -b|
|00001550| 20 42 49 54 53 20 69 73 | 20 6c 65 73 73 20 74 68 | BITS is| less th|
|00001560| 61 6e 20 6f 72 20 65 71 | 75 61 6c 20 74 6f 20 74 |an or eq|ual to t|
|00001570| 68 65 20 63 75 74 6f 66 | 66 0a 09 64 65 73 63 72 |he cutof|f..descr|
|00001580| 69 62 65 64 20 62 65 6c | 6f 77 2e 0a 0a 4d 6f 73 |ibed bel|ow...Mos|
|00001590| 74 20 6f 66 20 74 68 65 | 73 65 20 63 68 61 6e 67 |t of the|se chang|
|000015a0| 65 73 20 77 65 72 65 20 | 6d 61 64 65 20 62 79 20 |es were |made by |
|000015b0| 4a 61 6d 65 73 20 41 2e | 20 57 6f 6f 64 73 20 28 |James A.| Woods (|
|000015c0| 61 6d 65 73 21 6a 61 77 | 29 2e 20 20 54 68 61 6e |ames!jaw|). Than|
|000015d0| 6b 20 79 6f 75 0a 4a 61 | 6d 65 73 21 0a 0a 56 65 |k you.Ja|mes!..Ve|
|000015e0| 72 73 69 6f 6e 20 33 2e | 30 20 68 61 73 20 62 65 |rsion 3.|0 has be|
|000015f0| 65 6e 20 62 65 74 61 20 | 74 65 73 74 65 64 20 6f |en beta |tested o|
|00001600| 6e 20 6d 61 6e 79 20 6d | 61 63 68 69 6e 65 73 2e |n many m|achines.|
|00001610| 0a 0a 54 6f 20 63 6f 6d | 70 69 6c 65 20 63 6f 6d |..To com|pile com|
|00001620| 70 72 65 73 73 3a 0a 0a | 09 63 63 20 2d 4f 20 2d |press:..|.cc -O -|
|00001630| 44 55 53 45 52 4d 45 4d | 3d 75 73 65 72 6d 65 6d |DUSERMEM|=usermem|
|00001640| 20 2d 6f 20 63 6f 6d 70 | 72 65 73 73 20 63 6f 6d | -o comp|ress com|
|00001650| 70 72 65 73 73 2e 63 0a | 0a 57 68 65 72 65 20 22 |press.c.|.Where "|
|00001660| 75 73 65 72 6d 65 6d 22 | 20 69 73 20 74 68 65 20 |usermem"| is the |
|00001670| 61 6d 6f 75 6e 74 20 6f | 66 20 70 68 79 73 69 63 |amount o|f physic|
|00001680| 61 6c 20 75 73 65 72 20 | 6d 65 6d 6f 72 79 20 61 |al user |memory a|
|00001690| 76 61 69 6c 61 62 6c 65 | 20 28 69 6e 20 62 79 74 |vailable| (in byt|
|000016a0| 65 73 29 2e 20 20 0a 49 | 66 20 61 6e 79 20 70 68 |es). .I|f any ph|
|000016b0| 79 73 69 63 61 6c 20 6d | 65 6d 6f 72 79 20 69 73 |ysical m|emory is|
|000016c0| 20 74 6f 20 62 65 20 72 | 65 73 65 72 76 65 64 20 | to be r|eserved |
|000016d0| 66 6f 72 20 6f 74 68 65 | 72 20 70 72 6f 63 65 73 |for othe|r proces|
|000016e0| 73 65 73 2c 20 70 75 74 | 20 69 6e 20 0a 22 2d 44 |ses, put| in ."-D|
|000016f0| 53 41 43 52 45 44 4d 45 | 4d 20 73 61 63 72 65 64 |SACREDME|M sacred|
|00001700| 6d 65 6d 22 2c 20 77 68 | 65 72 65 20 22 73 61 63 |mem", wh|ere "sac|
|00001710| 72 65 64 6d 65 6d 22 20 | 69 73 20 74 68 65 20 61 |redmem" |is the a|
|00001720| 6d 6f 75 6e 74 20 74 6f | 20 62 65 20 72 65 73 65 |mount to| be rese|
|00001730| 72 76 65 64 2e 0a 0a 54 | 68 65 20 64 69 66 66 65 |rved...T|he diffe|
|00001740| 72 65 6e 63 65 20 22 75 | 73 65 72 6d 65 6d 2d 73 |rence "u|sermem-s|
|00001750| 61 63 72 65 64 6d 65 6d | 22 20 64 65 74 65 72 6d |acredmem|" determ|
|00001760| 69 6e 65 73 20 74 68 65 | 20 6d 61 78 69 6d 75 6d |ines the| maximum|
|00001770| 20 42 49 54 53 20 74 68 | 61 74 20 63 61 6e 20 62 | BITS th|at can b|
|00001780| 65 0a 73 70 65 63 69 66 | 69 65 64 2c 20 61 6e 64 |e.specif|ied, and|
|00001790| 20 74 68 65 20 63 75 74 | 6f 66 66 20 62 69 74 73 | the cut|off bits|
|000017a0| 20 77 68 65 72 65 20 74 | 68 65 20 6c 61 72 67 65 | where t|he large|
|000017b0| 2b 66 61 73 74 20 74 61 | 62 6c 65 20 69 73 20 75 |+fast ta|ble is u|
|000017c0| 73 65 64 2e 0a 0a 6d 65 | 6d 6f 72 79 3a 20 61 74 |sed...me|mory: at|
|000017d0| 20 6c 65 61 73 74 09 09 | 42 49 54 53 09 09 63 75 | least..|BITS..cu|
|000017e0| 74 6f 66 66 0a 2d 2d 2d | 2d 2d 2d 20 20 2d 2d 20 |toff.---|--- -- |
|000017f0| 2d 2d 2d 2d 2d 20 20 20 | 20 20 20 20 20 20 20 20 |----- | |
|00001800| 20 20 20 20 20 2d 2d 2d | 2d 20 20 20 20 20 20 20 | ---|- |
|00001810| 20 20 20 20 20 2d 2d 2d | 2d 2d 2d 0a 20 20 20 34 | ---|---. 4|
|00001820| 2c 37 31 38 2c 35 39 32 | 20 09 09 09 20 31 36 09 |,718,592| ... 16.|
|00001830| 09 20 20 31 33 0a 20 20 | 20 32 2c 36 32 31 2c 34 |. 13. | 2,621,4|
|00001840| 34 30 20 09 09 09 20 31 | 36 09 09 20 20 31 32 0a |40 ... 1|6.. 12.|
|00001850| 20 20 20 31 2c 35 37 32 | 2c 38 36 34 09 09 09 20 | 1,572|,864... |
|00001860| 31 36 09 09 20 20 31 31 | 0a 20 20 20 31 2c 30 34 |16.. 11|. 1,04|
|00001870| 38 2c 35 37 36 09 09 09 | 20 31 36 09 09 20 20 31 |8,576...| 16.. 1|
|00001880| 30 0a 20 20 20 20 20 36 | 33 31 2c 38 30 38 09 09 |0. 6|31,808..|
|00001890| 09 20 31 36 20 20 20 20 | 20 20 20 20 20 20 20 20 |. 16 | |
|000018a0| 20 20 20 2d 2d 0a 20 20 | 20 20 20 33 32 39 2c 37 | --. | 329,7|
|000018b0| 32 38 09 09 09 20 31 35 | 20 20 20 20 20 20 20 20 |28... 15| |
|000018c0| 20 20 20 20 20 20 20 2d | 2d 0a 20 20 20 20 20 31 | -|-. 1|
|000018d0| 37 38 2c 31 37 36 09 09 | 09 20 31 34 09 09 20 20 |78,176..|. 14.. |
|000018e0| 2d 2d 0a 20 20 20 20 20 | 20 39 39 2c 33 32 38 09 |--. | 99,328.|
|000018f0| 09 09 20 31 33 09 09 20 | 20 2d 2d 0a 20 20 20 20 |.. 13.. | --. |
|00001900| 20 20 20 20 20 20 20 30 | 09 09 09 20 31 32 09 09 | 0|... 12..|
|00001910| 20 20 2d 2d 0a 0a 54 68 | 65 20 64 65 66 61 75 6c | --..Th|e defaul|
|00001920| 74 20 6d 65 6d 6f 72 79 | 20 73 69 7a 65 20 69 73 |t memory| size is|
|00001930| 20 37 35 30 2c 30 30 30 | 20 77 68 69 63 68 20 67 | 750,000| which g|
|00001940| 69 76 65 73 20 61 20 6d | 61 78 69 6d 75 6d 20 42 |ives a m|aximum B|
|00001950| 49 54 53 3d 31 36 20 61 | 6e 64 20 6e 6f 0a 6c 61 |ITS=16 a|nd no.la|
|00001960| 72 67 65 2b 66 61 73 74 | 20 74 61 62 6c 65 2e 0a |rge+fast| table..|
|00001970| 0a 54 68 65 20 6d 61 78 | 69 6d 75 6d 20 62 69 74 |.The max|imum bit|
|00001980| 73 20 63 61 6e 20 62 65 | 20 6f 76 65 72 72 75 6c |s can be| overrul|
|00001990| 6c 65 64 20 62 79 20 73 | 70 65 63 69 66 79 69 6e |led by s|pecifyin|
|000019a0| 67 20 22 2d 44 42 49 54 | 53 3d 62 69 74 73 22 20 |g "-DBIT|S=bits" |
|000019b0| 61 74 0a 63 6f 6d 70 69 | 6c 61 74 69 6f 6e 20 74 |at.compi|lation t|
|000019c0| 69 6d 65 2e 0a 0a 49 66 | 20 79 6f 75 72 20 6d 61 |ime...If| your ma|
|000019d0| 63 68 69 6e 65 20 64 6f | 65 73 6e 27 74 20 73 75 |chine do|esn't su|
|000019e0| 70 70 6f 72 74 20 75 6e | 73 69 67 6e 65 64 20 63 |pport un|signed c|
|000019f0| 68 61 72 61 63 74 65 72 | 73 2c 20 64 65 66 69 6e |haracter|s, defin|
|00001a00| 65 20 22 4e 4f 5f 55 43 | 48 41 52 22 20 0a 77 68 |e "NO_UC|HAR" .wh|
|00001a10| 65 6e 20 63 6f 6d 70 69 | 6c 69 6e 67 2e 0a 0a 49 |en compi|ling...I|
|00001a20| 66 20 79 6f 75 72 20 6d | 61 63 68 69 6e 65 20 68 |f your m|achine h|
|00001a30| 61 73 20 22 69 6e 74 22 | 20 61 73 20 31 36 2d 62 |as "int"| as 16-b|
|00001a40| 69 74 73 2c 20 64 65 66 | 69 6e 65 20 22 53 48 4f |its, def|ine "SHO|
|00001a50| 52 54 5f 49 4e 54 22 20 | 77 68 65 6e 20 63 6f 6d |RT_INT" |when com|
|00001a60| 70 69 6c 69 6e 67 2e 0a | 0a 41 66 74 65 72 20 63 |piling..|.After c|
|00001a70| 6f 6d 70 69 6c 61 74 69 | 6f 6e 2c 20 6d 6f 76 65 |ompilati|on, move|
|00001a80| 20 22 63 6f 6d 70 72 65 | 73 73 22 20 74 6f 20 61 | "compre|ss" to a|
|00001a90| 20 73 74 61 6e 64 61 72 | 64 20 65 78 65 63 75 74 | standar|d execut|
|00001aa0| 61 62 6c 65 20 6c 6f 63 | 61 74 69 6f 6e 2c 20 73 |able loc|ation, s|
|00001ab0| 75 63 68 20 0a 61 73 20 | 2f 75 73 72 2f 6c 6f 63 |uch .as |/usr/loc|
|00001ac0| 61 6c 2e 20 20 54 68 65 | 6e 3a 0a 09 63 64 20 2f |al. The|n:..cd /|
|00001ad0| 75 73 72 2f 6c 6f 63 61 | 6c 0a 09 6c 6e 20 63 6f |usr/loca|l..ln co|
|00001ae0| 6d 70 72 65 73 73 20 75 | 6e 63 6f 6d 70 72 65 73 |mpress u|ncompres|
|00001af0| 73 0a 09 6c 6e 20 63 6f | 6d 70 72 65 73 73 20 7a |s..ln co|mpress z|
|00001b00| 63 61 74 0a 0a 4f 6e 20 | 6d 61 63 68 69 6e 65 73 |cat..On |machines|
|00001b10| 20 74 68 61 74 20 68 61 | 76 65 20 61 20 66 69 78 | that ha|ve a fix|
|00001b20| 65 64 20 73 74 61 63 6b | 20 73 69 7a 65 20 28 73 |ed stack| size (s|
|00001b30| 75 63 68 20 61 73 20 50 | 65 72 6b 69 6e 2d 45 6c |uch as P|erkin-El|
|00001b40| 6d 65 72 29 2c 20 73 65 | 74 20 74 68 65 0a 73 74 |mer), se|t the.st|
|00001b50| 61 63 6b 20 74 6f 20 61 | 74 20 6c 65 61 73 74 20 |ack to a|t least |
|00001b60| 31 32 6b 62 2e 20 20 28 | 22 73 65 74 73 74 61 63 |12kb. (|"setstac|
|00001b70| 6b 20 63 6f 6d 70 72 65 | 73 73 20 31 32 22 20 6f |k compre|ss 12" o|
|00001b80| 6e 20 50 65 72 6b 69 6e | 2d 45 6c 6d 65 72 29 2e |n Perkin|-Elmer).|
|00001b90| 0a 0a 4e 65 78 74 2c 20 | 69 6e 73 74 61 6c 6c 20 |..Next, |install |
|00001ba0| 74 68 65 20 6d 61 6e 75 | 61 6c 20 28 63 6f 6d 70 |the manu|al (comp|
|00001bb0| 72 65 73 73 2e 6c 29 2e | 0a 09 63 70 20 63 6f 6d |ress.l).|..cp com|
|00001bc0| 70 72 65 73 73 2e 6c 20 | 2f 75 73 72 2f 6d 61 6e |press.l |/usr/man|
|00001bd0| 2f 6d 61 6e 6c 0a 09 63 | 64 20 2f 75 73 72 2f 6d |/manl..c|d /usr/m|
|00001be0| 61 6e 2f 6d 61 6e 6c 0a | 09 6c 6e 20 63 6f 6d 70 |an/manl.|.ln comp|
|00001bf0| 72 65 73 73 2e 6c 20 75 | 6e 63 6f 6d 70 72 65 73 |ress.l u|ncompres|
|00001c00| 73 2e 6c 0a 09 6c 6e 20 | 63 6f 6d 70 72 65 73 73 |s.l..ln |compress|
|00001c10| 2e 6c 20 7a 63 61 74 2e | 6c 0a 0a 09 09 2d 20 6f |.l zcat.|l....- o|
|00001c20| 72 20 2d 0a 0a 09 63 70 | 20 63 6f 6d 70 72 65 73 |r -...cp| compres|
|00001c30| 73 2e 6c 20 2f 75 73 72 | 2f 6d 61 6e 2f 6d 61 6e |s.l /usr|/man/man|
|00001c40| 31 2f 63 6f 6d 70 72 65 | 73 73 2e 31 0a 09 63 64 |1/compre|ss.1..cd|
|00001c50| 20 2f 75 73 72 2f 6d 61 | 6e 2f 6d 61 6e 31 0a 09 | /usr/ma|n/man1..|
|00001c60| 6c 6e 20 63 6f 6d 70 72 | 65 73 73 2e 31 20 75 6e |ln compr|ess.1 un|
|00001c70| 63 6f 6d 70 72 65 73 73 | 2e 31 0a 09 6c 6e 20 63 |compress|.1..ln c|
|00001c80| 6f 6d 70 72 65 73 73 2e | 31 20 7a 63 61 74 2e 31 |ompress.|1 zcat.1|
|00001c90| 0a 0a 54 68 65 20 7a 6d | 6f 72 65 20 73 68 65 6c |..The zm|ore shel|
|00001ca0| 6c 20 73 63 72 69 70 74 | 20 61 6e 64 20 6d 61 6e |l script| and man|
|00001cb0| 75 61 6c 20 70 61 67 65 | 20 61 72 65 20 66 6f 72 |ual page| are for|
|00001cc0| 20 75 73 65 20 6f 6e 20 | 73 79 73 74 65 6d 73 20 | use on |systems |
|00001cd0| 74 68 61 74 20 68 61 76 | 65 20 61 0a 22 6d 6f 72 |that hav|e a."mor|
|00001ce0| 65 28 31 29 22 20 70 72 | 6f 67 72 61 6d 2e 20 20 |e(1)" pr|ogram. |
|00001cf0| 49 6e 73 74 61 6c 6c 20 | 74 68 65 20 73 68 65 6c |Install |the shel|
|00001d00| 6c 20 73 63 72 69 70 74 | 20 61 6e 64 20 74 68 65 |l script| and the|
|00001d10| 20 6d 61 6e 75 61 6c 20 | 70 61 67 65 20 69 6e 20 | manual |page in |
|00001d20| 61 20 22 62 69 6e 22 0a | 61 6e 64 20 22 6d 61 6e |a "bin".|and "man|
|00001d30| 22 20 64 69 72 65 63 74 | 6f 72 79 2c 20 72 65 73 |" direct|ory, res|
|00001d40| 70 65 63 74 69 76 65 6c | 79 2e 20 20 49 66 20 79 |pectivel|y. If y|
|00001d50| 6f 75 72 20 73 79 73 74 | 65 6d 20 64 6f 65 73 6e |our syst|em doesn|
|00001d60| 27 74 20 68 61 76 65 20 | 74 68 65 0a 22 6d 6f 72 |'t have |the."mor|
|00001d70| 65 28 31 29 22 20 70 72 | 6f 67 72 61 6d 2c 20 6a |e(1)" pr|ogram, j|
|00001d80| 75 73 74 20 73 6b 69 70 | 20 22 7a 6d 6f 72 65 22 |ust skip| "zmore"|
|00001d90| 2e 0a 0a 09 09 09 09 09 | 72 65 67 61 72 64 73 2c |........|regards,|
|00001da0| 0a 09 09 09 09 09 70 65 | 74 73 64 21 6a 6f 65 0a |......pe|tsd!joe.|
|00001db0| 0a 48 65 72 65 20 69 73 | 20 74 68 65 20 52 45 41 |.Here is| the REA|
|00001dc0| 44 4d 45 20 66 69 6c 65 | 20 66 72 6f 6d 20 74 68 |DME file| from th|
|00001dd0| 65 20 70 72 65 76 69 6f | 75 73 20 76 65 72 73 69 |e previo|us versi|
|00001de0| 6f 6e 20 6f 66 20 63 6f | 6d 70 72 65 73 73 20 28 |on of co|mpress (|
|00001df0| 32 2e 30 29 3a 0a 0a 3e | 45 6e 63 6c 6f 73 65 64 |2.0):..>|Enclosed|
|00001e00| 20 69 73 20 63 6f 6d 70 | 72 65 73 73 2e 63 20 76 | is comp|ress.c v|
|00001e10| 65 72 73 69 6f 6e 20 32 | 2e 30 20 77 69 74 68 20 |ersion 2|.0 with |
|00001e20| 74 68 65 20 66 6f 6c 6c | 6f 77 69 6e 67 20 62 75 |the foll|owing bu|
|00001e30| 67 73 20 66 69 78 65 64 | 3a 0a 3e 0a 3e 31 2e 09 |gs fixed|:.>.>1..|
|00001e40| 54 68 65 20 70 61 63 6b | 65 64 20 66 69 6c 65 73 |The pack|ed files|
|00001e50| 20 70 72 6f 64 75 63 65 | 64 20 62 79 20 63 6f 6d | produce|d by com|
|00001e60| 70 72 65 73 73 20 61 72 | 65 20 64 69 66 66 65 72 |press ar|e differ|
|00001e70| 65 6e 74 20 6f 6e 20 64 | 69 66 66 65 72 65 6e 74 |ent on d|ifferent|
|00001e80| 0a 3e 09 6d 61 63 68 69 | 6e 65 73 20 61 6e 64 20 |.>.machi|nes and |
|00001e90| 64 65 70 65 6e 64 65 6e | 74 20 6f 6e 20 74 68 65 |dependen|t on the|
|00001ea0| 20 76 61 78 20 73 79 73 | 67 65 6e 20 6f 70 74 69 | vax sys|gen opti|
|00001eb0| 6f 6e 2e 0a 3e 09 09 54 | 68 65 20 62 75 67 20 77 |on..>..T|he bug w|
|00001ec0| 61 73 20 69 6e 20 74 68 | 65 20 64 69 66 66 65 72 |as in th|e differ|
|00001ed0| 65 6e 74 20 62 79 74 65 | 2f 62 69 74 20 6f 72 64 |ent byte|/bit ord|
|00001ee0| 65 72 69 6e 67 20 6f 6e | 20 74 68 65 0a 3e 09 09 |ering on| the.>..|
|00001ef0| 76 61 72 69 6f 75 73 20 | 6d 61 63 68 69 6e 65 73 |various |machines|
|00001f00| 2e 20 20 54 68 69 73 20 | 68 61 73 20 62 65 65 6e |. This |has been|
|00001f10| 20 66 69 78 65 64 2e 0a | 3e 0a 3e 09 09 54 68 69 | fixed..|>.>..Thi|
|00001f20| 73 20 76 65 72 73 69 6f | 6e 20 69 73 20 4e 4f 54 |s versio|n is NOT|
|00001f30| 20 63 6f 6d 70 61 74 69 | 62 6c 65 20 77 69 74 68 | compati|ble with|
|00001f40| 20 74 68 65 20 6f 72 69 | 67 69 6e 61 6c 20 76 61 | the ori|ginal va|
|00001f50| 78 20 70 6f 73 74 69 6e | 67 0a 3e 09 09 75 6e 6c |x postin|g.>..unl|
|00001f60| 65 73 73 20 74 68 65 20 | 27 2d 44 43 4f 4d 50 41 |ess the |'-DCOMPA|
|00001f70| 54 49 42 4c 45 27 20 6f | 70 74 69 6f 6e 20 69 73 |TIBLE' o|ption is|
|00001f80| 20 73 70 65 63 69 66 69 | 65 64 20 74 6f 20 74 68 | specifi|ed to th|
|00001f90| 65 20 43 0a 3e 09 09 63 | 6f 6d 70 69 6c 65 72 2e |e C.>..c|ompiler.|
|00001fa0| 20 20 54 68 65 20 6f 72 | 69 67 69 6e 61 6c 20 70 | The or|iginal p|
|00001fb0| 6f 73 74 69 6e 67 20 68 | 61 73 20 61 20 62 75 67 |osting h|as a bug|
|00001fc0| 20 77 68 69 63 68 20 49 | 20 66 69 78 65 64 2c 20 | which I| fixed, |
|00001fd0| 0a 3e 09 09 63 61 75 73 | 69 6e 67 20 69 6e 63 6f |.>..caus|ing inco|
|00001fe0| 6d 70 61 74 69 62 6c 65 | 20 66 69 6c 65 73 2e 20 |mpatible| files. |
|00001ff0| 20 49 20 72 65 63 6f 6d | 6d 65 6e 64 20 79 6f 75 | I recom|mend you|
|00002000| 20 4e 4f 54 20 74 6f 20 | 75 73 65 20 74 68 69 73 | NOT to |use this|
|00002010| 0a 3e 09 09 6f 70 74 69 | 6f 6e 20 75 6e 6c 65 73 |.>..opti|on unles|
|00002020| 73 20 79 6f 75 20 61 6c | 72 65 61 64 79 20 68 61 |s you al|ready ha|
|00002030| 76 65 20 61 20 6c 6f 74 | 20 6f 66 20 70 61 63 6b |ve a lot| of pack|
|00002040| 65 64 20 66 69 6c 65 73 | 20 66 72 6f 6d 0a 3e 09 |ed files| from.>.|
|00002050| 09 74 68 65 20 6f 72 69 | 67 69 6e 61 6c 20 70 6f |.the ori|ginal po|
|00002060| 73 74 69 6e 67 20 62 79 | 20 74 68 6f 6d 61 73 2e |sting by| thomas.|
|00002070| 0a 3e 32 2e 09 54 68 65 | 20 65 78 69 74 20 73 74 |.>2..The| exit st|
|00002080| 61 74 75 73 20 69 73 20 | 6e 6f 74 20 77 65 6c 6c |atus is |not well|
|00002090| 20 64 65 66 69 6e 65 64 | 20 28 6f 6e 20 73 6f 6d | defined| (on som|
|000020a0| 65 20 6d 61 63 68 69 6e | 65 73 29 20 63 61 75 73 |e machin|es) caus|
|000020b0| 69 6e 67 20 74 68 65 0a | 3e 09 73 63 72 69 70 74 |ing the.|>.script|
|000020c0| 73 20 74 6f 20 66 61 69 | 6c 2e 0a 3e 09 09 54 68 |s to fai|l..>..Th|
|000020d0| 65 20 65 78 69 74 20 73 | 74 61 74 75 73 20 69 73 |e exit s|tatus is|
|000020e0| 20 6e 6f 77 20 30 2c 31 | 20 6f 72 20 32 20 61 6e | now 0,1| or 2 an|
|000020f0| 64 20 69 73 20 64 6f 63 | 75 6d 65 6e 74 65 64 20 |d is doc|umented |
|00002100| 69 6e 0a 3e 09 09 63 6f | 6d 70 72 65 73 73 2e 6c |in.>..co|mpress.l|
|00002110| 2e 0a 3e 33 2e 09 54 68 | 65 20 66 75 6e 63 74 69 |..>3..Th|e functi|
|00002120| 6f 6e 20 67 65 74 6f 70 | 74 28 29 20 69 73 20 6e |on getop|t() is n|
|00002130| 6f 74 20 61 76 61 69 6c | 61 62 6c 65 20 69 6e 20 |ot avail|able in |
|00002140| 61 6c 6c 20 43 20 6c 69 | 62 72 61 72 69 65 73 2e |all C li|braries.|
|00002150| 0a 3e 09 09 54 68 65 20 | 66 75 6e 63 74 69 6f 6e |.>..The |function|
|00002160| 20 67 65 74 6f 70 74 28 | 29 20 69 73 20 6e 6f 20 | getopt(|) is no |
|00002170| 6c 6f 6e 67 65 72 20 72 | 65 66 65 72 65 6e 63 65 |longer r|eference|
|00002180| 64 20 62 79 20 74 68 65 | 0a 3e 09 09 70 72 6f 67 |d by the|.>..prog|
|00002190| 72 61 6d 2e 0a 3e 34 2e | 09 45 72 72 6f 72 20 73 |ram..>4.|.Error s|
|000021a0| 74 61 74 75 73 20 69 73 | 20 6e 6f 74 20 62 65 69 |tatus is| not bei|
|000021b0| 6e 67 20 63 68 65 63 6b | 65 64 20 6f 6e 20 74 68 |ng check|ed on th|
|000021c0| 65 20 66 77 72 69 74 65 | 28 29 20 61 6e 64 20 66 |e fwrite|() and f|
|000021d0| 66 6c 75 73 68 28 29 20 | 63 61 6c 6c 73 2e 0a 3e |flush() |calls..>|
|000021e0| 09 09 46 69 78 65 64 2e | 0a 3e 0a 3e 54 68 65 20 |..Fixed.|.>.>The |
|000021f0| 66 6f 6c 6c 6f 77 69 6e | 67 20 65 6e 68 61 6e 63 |followin|g enhanc|
|00002200| 65 6d 65 6e 74 73 20 68 | 61 76 65 20 62 65 65 6e |ements h|ave been|
|00002210| 20 6d 61 64 65 3a 0a 3e | 0a 3e 31 2e 09 41 64 64 | made:.>|.>1..Add|
|00002220| 65 64 20 66 61 63 69 6c | 69 74 69 65 73 20 6f 66 |ed facil|ities of|
|00002230| 20 22 63 6f 6d 70 61 63 | 74 22 20 69 6e 74 6f 20 | "compac|t" into |
|00002240| 74 68 65 20 63 6f 6d 70 | 72 65 73 73 20 70 72 6f |the comp|ress pro|
|00002250| 67 72 61 6d 2e 20 20 22 | 50 61 63 6b 22 2c 0a 3e |gram. "|Pack",.>|
|00002260| 09 22 55 6e 70 61 63 6b | 22 2c 20 61 6e 64 20 22 |."Unpack|", and "|
|00002270| 50 63 61 74 22 20 61 72 | 65 20 6e 6f 20 6c 6f 6e |Pcat" ar|e no lon|
|00002280| 67 65 72 20 72 65 71 75 | 69 72 65 64 20 28 6e 6f |ger requ|ired (no|
|00002290| 20 6c 6f 6e 67 65 72 20 | 73 75 70 70 6c 69 65 64 | longer |supplied|
|000022a0| 29 2e 0a 3e 32 2e 09 49 | 6e 73 74 61 6c 6c 65 64 |)..>2..I|nstalled|
|000022b0| 20 77 6f 72 6b 20 61 72 | 6f 75 6e 64 20 66 6f 72 | work ar|ound for|
|000022c0| 20 43 20 63 6f 6d 70 69 | 6c 65 72 20 62 75 67 20 | C compi|ler bug |
|000022d0| 77 69 74 68 20 22 2d 4f | 22 2e 0a 3e 33 2e 09 41 |with "-O|"..>3..A|
|000022e0| 64 64 65 64 20 61 20 6d | 61 67 69 63 20 6e 75 6d |dded a m|agic num|
|000022f0| 62 65 72 20 68 65 61 64 | 65 72 20 28 5c 30 33 37 |ber head|er (\037|
|00002300| 5c 32 33 35 29 2e 20 20 | 50 75 74 20 74 68 65 20 |\235). |Put the |
|00002310| 62 69 74 73 20 73 70 65 | 63 69 66 69 65 64 0a 3e |bits spe|cified.>|
|00002320| 09 69 6e 20 74 68 65 20 | 66 69 6c 65 2e 0a 3e 34 |.in the |file..>4|
|00002330| 2e 09 41 64 64 65 64 20 | 22 2d 66 22 20 66 6c 61 |..Added |"-f" fla|
|00002340| 67 20 74 6f 20 66 6f 72 | 63 65 20 6f 76 65 72 77 |g to for|ce overw|
|00002350| 72 69 74 65 20 6f 66 20 | 6f 75 74 70 75 74 20 66 |rite of |output f|
|00002360| 69 6c 65 2e 0a 3e 35 2e | 09 41 64 64 65 64 20 22 |ile..>5.|.Added "|
|00002370| 2d 63 22 20 66 6c 61 67 | 20 61 6e 64 20 22 7a 63 |-c" flag| and "zc|
|00002380| 61 74 22 20 70 72 6f 67 | 72 61 6d 2e 20 20 27 6c |at" prog|ram. 'l|
|00002390| 6e 20 63 6f 6d 70 72 65 | 73 73 20 7a 63 61 74 27 |n compre|ss zcat'|
|000023a0| 20 61 66 74 65 72 20 79 | 6f 75 0a 3e 09 63 6f 6d | after y|ou.>.com|
|000023b0| 70 69 6c 65 2e 0a 3e 36 | 2e 09 54 68 65 20 27 75 |pile..>6|..The 'u|
|000023c0| 6e 63 6f 6d 70 72 65 73 | 73 27 20 73 63 72 69 70 |ncompres|s' scrip|
|000023d0| 74 20 68 61 73 20 62 65 | 65 6e 20 64 65 6c 65 74 |t has be|en delet|
|000023e0| 65 64 3b 20 73 69 6d 70 | 6c 79 20 0a 3e 09 27 6c |ed; simp|ly .>.'l|
|000023f0| 6e 20 63 6f 6d 70 72 65 | 73 73 20 75 6e 63 6f 6d |n compre|ss uncom|
|00002400| 70 72 65 73 73 27 20 61 | 66 74 65 72 20 79 6f 75 |press' a|fter you|
|00002410| 20 63 6f 6d 70 69 6c 65 | 20 61 6e 64 20 69 74 20 | compile| and it |
|00002420| 77 69 6c 6c 20 77 6f 72 | 6b 2e 0a 3e 37 2e 09 52 |will wor|k..>7..R|
|00002430| 65 6d 6f 76 65 64 20 65 | 78 74 72 61 20 62 69 74 |emoved e|xtra bit|
|00002440| 20 6d 61 73 6b 69 6e 67 | 20 66 6f 72 20 6d 61 63 | masking| for mac|
|00002450| 68 69 6e 65 73 20 74 68 | 61 74 20 73 75 70 70 6f |hines th|at suppo|
|00002460| 72 74 20 75 6e 73 69 67 | 6e 65 64 0a 3e 09 63 68 |rt unsig|ned.>.ch|
|00002470| 61 72 61 63 74 65 72 73 | 2e 20 20 49 66 20 79 6f |aracters|. If yo|
|00002480| 75 72 20 6d 61 63 68 69 | 6e 65 20 64 6f 65 73 6e |ur machi|ne doesn|
|00002490| 27 74 20 73 75 70 70 6f | 72 74 20 75 6e 73 69 67 |'t suppo|rt unsig|
|000024a0| 6e 65 64 20 63 68 61 72 | 61 63 74 65 72 73 2c 0a |ned char|acters,.|
|000024b0| 3e 09 64 65 66 69 6e 65 | 20 22 4e 4f 5f 55 43 48 |>.define| "NO_UCH|
|000024c0| 41 52 22 20 77 68 65 6e | 20 63 6f 6d 70 69 6c 69 |AR" when| compili|
|000024d0| 6e 67 2e 0a 3e 0a 3e 43 | 6f 6d 70 69 6c 65 20 22 |ng..>.>C|ompile "|
|000024e0| 63 6f 6d 70 72 65 73 73 | 2e 63 22 20 77 69 74 68 |compress|.c" with|
|000024f0| 20 22 2d 4f 20 2d 6f 20 | 63 6f 6d 70 72 65 73 73 | "-O -o |compress|
|00002500| 22 20 66 6c 61 67 73 2e | 20 20 4d 6f 76 65 20 22 |" flags.| Move "|
|00002510| 63 6f 6d 70 72 65 73 73 | 22 20 74 6f 20 61 0a 3e |compress|" to a.>|
|00002520| 73 74 61 6e 64 61 72 64 | 20 65 78 65 63 75 74 61 |standard| executa|
|00002530| 62 6c 65 20 6c 6f 63 61 | 74 69 6f 6e 2c 20 73 75 |ble loca|tion, su|
|00002540| 63 68 20 61 73 20 2f 75 | 73 72 2f 6c 6f 63 61 6c |ch as /u|sr/local|
|00002550| 2e 20 20 54 68 65 6e 3a | 0a 3e 09 63 64 20 2f 75 |. Then:|.>.cd /u|
|00002560| 73 72 2f 6c 6f 63 61 6c | 0a 3e 09 6c 6e 20 63 6f |sr/local|.>.ln co|
|00002570| 6d 70 72 65 73 73 20 75 | 6e 63 6f 6d 70 72 65 73 |mpress u|ncompres|
|00002580| 73 0a 3e 09 6c 6e 20 63 | 6f 6d 70 72 65 73 73 20 |s.>.ln c|ompress |
|00002590| 7a 63 61 74 0a 3e 0a 3e | 4f 6e 20 6d 61 63 68 69 |zcat.>.>|On machi|
|000025a0| 6e 65 73 20 74 68 61 74 | 20 68 61 76 65 20 61 20 |nes that| have a |
|000025b0| 66 69 78 65 64 20 73 74 | 61 63 6b 20 73 69 7a 65 |fixed st|ack size|
|000025c0| 20 28 73 75 63 68 20 61 | 73 20 50 65 72 6b 69 6e | (such a|s Perkin|
|000025d0| 2d 45 6c 6d 65 72 29 2c | 20 73 65 74 20 74 68 65 |-Elmer),| set the|
|000025e0| 0a 3e 73 74 61 63 6b 20 | 74 6f 20 61 74 20 6c 65 |.>stack |to at le|
|000025f0| 61 73 74 20 31 32 6b 62 | 2e 20 20 28 22 73 65 74 |ast 12kb|. ("set|
|00002600| 73 74 61 63 6b 20 63 6f | 6d 70 72 65 73 73 20 31 |stack co|mpress 1|
|00002610| 32 22 20 6f 6e 20 50 65 | 72 6b 69 6e 2d 45 6c 6d |2" on Pe|rkin-Elm|
|00002620| 65 72 29 2e 0a 3e 0a 3e | 4e 65 78 74 2c 20 69 6e |er)..>.>|Next, in|
|00002630| 73 74 61 6c 6c 20 74 68 | 65 20 6d 61 6e 75 61 6c |stall th|e manual|
|00002640| 20 28 63 6f 6d 70 72 65 | 73 73 2e 6c 29 2e 0a 3e | (compre|ss.l)..>|
|00002650| 09 63 70 20 63 6f 6d 70 | 72 65 73 73 2e 6c 20 2f |.cp comp|ress.l /|
|00002660| 75 73 72 2f 6d 61 6e 2f | 6d 61 6e 6c 09 09 2d 20 |usr/man/|manl..- |
|00002670| 6f 72 20 2d 0a 3e 09 63 | 70 20 63 6f 6d 70 72 65 |or -.>.c|p compre|
|00002680| 73 73 2e 6c 20 2f 75 73 | 72 2f 6d 61 6e 2f 6d 61 |ss.l /us|r/man/ma|
|00002690| 6e 31 2f 63 6f 6d 70 72 | 65 73 73 2e 31 0a 3e 0a |n1/compr|ess.1.>.|
|000026a0| 3e 48 65 72 65 20 69 73 | 20 74 68 65 20 52 45 41 |>Here is| the REA|
|000026b0| 44 4d 45 20 74 68 61 74 | 20 49 20 73 65 6e 74 20 |DME that| I sent |
|000026c0| 77 69 74 68 20 6d 79 20 | 66 69 72 73 74 20 70 6f |with my |first po|
|000026d0| 73 74 69 6e 67 3a 0a 3e | 0a 3e 3e 45 6e 63 6c 6f |sting:.>|.>>Enclo|
|000026e0| 73 65 64 20 69 73 20 61 | 20 6d 6f 64 69 66 69 65 |sed is a| modifie|
|000026f0| 64 20 76 65 72 73 69 6f | 6e 20 6f 66 20 63 6f 6d |d versio|n of com|
|00002700| 70 72 65 73 73 2e 63 2c | 20 61 6c 6f 6e 67 20 77 |press.c,| along w|
|00002710| 69 74 68 20 73 63 72 69 | 70 74 73 20 74 6f 20 6d |ith scri|pts to m|
|00002720| 61 6b 65 20 69 74 0a 3e | 3e 72 75 6e 20 69 64 65 |ake it.>|>run ide|
|00002730| 6e 74 69 63 61 6c 6c 79 | 20 74 6f 20 70 61 63 6b |ntically| to pack|
|00002740| 28 31 29 2c 20 75 6e 70 | 61 63 6b 28 31 29 2c 20 |(1), unp|ack(1), |
|00002750| 61 6e 20 70 63 61 74 28 | 31 29 2e 20 20 48 65 72 |an pcat(|1). Her|
|00002760| 65 20 69 73 20 77 68 61 | 74 20 49 0a 3e 3e 28 70 |e is wha|t I.>>(p|
|00002770| 65 74 73 64 21 6a 6f 65 | 29 20 61 6e 64 20 61 20 |etsd!joe|) and a |
|00002780| 63 6f 6c 6c 65 61 67 75 | 65 20 28 70 65 74 73 64 |colleagu|e (petsd|
|00002790| 21 70 65 6f 72 61 21 73 | 72 64 29 20 64 69 64 3a |!peora!s|rd) did:|
|000027a0| 0a 3e 3e 0a 3e 3e 31 2e | 20 52 65 6d 6f 76 65 64 |.>>.>>1.| Removed|
|000027b0| 20 56 41 58 20 64 65 70 | 65 6e 64 65 6e 63 69 65 | VAX dep|endencie|
|000027c0| 73 2e 0a 3e 3e 32 2e 20 | 43 68 61 6e 67 65 64 20 |s..>>2. |Changed |
|000027d0| 74 68 65 20 73 74 72 75 | 63 74 20 74 6f 20 73 65 |the stru|ct to se|
|000027e0| 70 61 72 61 74 65 20 61 | 72 72 61 79 73 3b 20 73 |parate a|rrays; s|
|000027f0| 61 76 65 73 20 6d 75 63 | 68 6f 20 6d 65 6d 6f 72 |aves muc|ho memor|
|00002800| 79 2e 0a 3e 3e 33 2e 20 | 44 69 64 20 63 6f 6d 70 |y..>>3. |Did comp|
|00002810| 61 72 69 73 6f 6e 73 20 | 69 6e 20 75 6e 73 69 67 |arisons |in unsig|
|00002820| 6e 65 64 2c 20 77 68 65 | 72 65 20 70 6f 73 73 69 |ned, whe|re possi|
|00002830| 62 6c 65 2e 20 20 28 46 | 61 73 74 65 72 20 6f 6e |ble. (F|aster on|
|00002840| 20 50 65 72 6b 69 6e 2d | 45 6c 6d 65 72 2e 29 0a | Perkin-|Elmer.).|
|00002850| 3e 3e 34 2e 20 53 6f 72 | 74 65 64 20 74 68 65 20 |>>4. Sor|ted the |
|00002860| 63 68 61 72 61 63 74 65 | 72 20 6e 65 78 74 20 63 |characte|r next c|
|00002870| 68 61 69 6e 20 61 6e 64 | 20 63 68 61 6e 67 65 64 |hain and| changed|
|00002880| 20 74 68 65 20 73 65 61 | 72 63 68 20 74 6f 20 73 | the sea|rch to s|
|00002890| 74 6f 70 0a 3e 3e 70 72 | 65 6d 61 74 75 72 65 6c |top.>>pr|ematurel|
|000028a0| 79 2e 20 20 54 68 69 73 | 20 73 61 76 65 73 20 61 |y. This| saves a|
|000028b0| 20 6c 6f 74 20 6f 6e 20 | 74 68 65 20 65 78 65 63 | lot on |the exec|
|000028c0| 75 74 69 6f 6e 20 74 69 | 6d 65 20 77 68 65 6e 20 |ution ti|me when |
|000028d0| 63 6f 6d 70 72 65 73 73 | 69 6e 67 2e 0a 3e 3e 0a |compress|ing..>>.|
|000028e0| 3e 3e 54 68 69 73 20 76 | 65 72 73 69 6f 6e 20 69 |>>This v|ersion i|
|000028f0| 73 20 74 6f 74 61 6c 6c | 79 20 63 6f 6d 70 61 74 |s totall|y compat|
|00002900| 69 62 6c 65 20 77 69 74 | 68 20 74 68 65 20 6f 72 |ible wit|h the or|
|00002910| 69 67 69 6e 61 6c 20 76 | 65 72 73 69 6f 6e 2e 20 |iginal v|ersion. |
|00002920| 20 45 76 65 6e 20 74 68 | 6f 75 67 68 0a 3e 3e 6c | Even th|ough.>>l|
|00002930| 69 6e 74 28 31 29 20 2d | 70 20 68 61 73 20 6e 6f |int(1) -|p has no|
|00002940| 20 63 6f 6d 70 6c 61 69 | 6e 74 73 20 61 62 6f 75 | complai|nts abou|
|00002950| 74 20 63 6f 6d 70 72 65 | 73 73 2e 63 2c 20 69 74 |t compre|ss.c, it|
|00002960| 20 77 6f 6e 27 74 20 72 | 75 6e 20 6f 6e 20 61 20 | won't r|un on a |
|00002970| 31 36 2d 62 69 74 0a 3e | 3e 6d 61 63 68 69 6e 65 |16-bit.>|>machine|
|00002980| 2c 20 64 75 65 20 74 6f | 20 74 68 65 20 73 69 7a |, due to| the siz|
|00002990| 65 20 6f 66 20 74 68 65 | 20 61 72 72 61 79 73 2e |e of the| arrays.|
|000029a0| 0a 3e 3e 0a 3e 3e 48 65 | 72 65 20 69 73 20 74 68 |.>>.>>He|re is th|
|000029b0| 65 20 52 45 41 44 4d 45 | 20 66 69 6c 65 20 66 72 |e README| file fr|
|000029c0| 6f 6d 20 74 68 65 20 6f | 72 69 67 69 6e 61 6c 20 |om the o|riginal |
|000029d0| 61 75 74 68 6f 72 3a 0a | 3e 3e 20 0a 3e 3e 3e 57 |author:.|>> .>>>W|
|000029e0| 65 6c 6c 2c 20 77 69 74 | 68 20 61 6c 6c 20 74 68 |ell, wit|h all th|
|000029f0| 69 73 20 64 69 73 63 75 | 73 73 69 6f 6e 20 61 62 |is discu|ssion ab|
|00002a00| 6f 75 74 20 66 69 6c 65 | 20 63 6f 6d 70 72 65 73 |out file| compres|
|00002a10| 73 69 6f 6e 20 28 66 6f | 72 20 6e 65 77 73 20 62 |sion (fo|r news b|
|00002a20| 61 74 63 68 69 6e 67 0a | 3e 3e 3e 69 6e 20 70 61 |atching.|>>>in pa|
|00002a30| 72 74 69 63 75 6c 61 72 | 29 20 67 6f 69 6e 67 20 |rticular|) going |
|00002a40| 61 72 6f 75 6e 64 2c 20 | 49 20 64 65 63 69 64 65 |around, |I decide|
|00002a50| 64 20 74 6f 20 69 6d 70 | 6c 65 6d 65 6e 74 20 74 |d to imp|lement t|
|00002a60| 68 65 20 74 65 78 74 20 | 63 6f 6d 70 72 65 73 73 |he text |compress|
|00002a70| 69 6f 6e 0a 3e 3e 3e 61 | 6c 67 6f 72 69 74 68 6d |ion.>>>a|lgorithm|
|00002a80| 20 64 65 73 63 72 69 62 | 65 64 20 69 6e 20 74 68 | describ|ed in th|
|00002a90| 65 20 4a 75 6e 65 20 43 | 6f 6d 70 75 74 65 72 20 |e June C|omputer |
|00002aa0| 6d 61 67 61 7a 69 6e 65 | 2e 20 20 54 68 65 20 61 |magazine|. The a|
|00002ab0| 75 74 68 6f 72 20 63 6c | 61 69 6d 65 64 0a 3e 3e |uthor cl|aimed.>>|
|00002ac0| 3e 62 6c 69 6e 64 69 6e | 67 20 73 70 65 65 64 20 |>blindin|g speed |
|00002ad0| 61 6e 64 20 67 6f 6f 64 | 20 63 6f 6d 70 72 65 73 |and good| compres|
|00002ae0| 73 69 6f 6e 20 72 61 74 | 69 6f 73 2e 20 20 49 74 |sion rat|ios. It|
|00002af0| 27 73 20 63 65 72 74 61 | 69 6e 6c 79 20 66 61 73 |'s certa|inly fas|
|00002b00| 74 65 72 20 74 68 61 6e | 0a 3e 3e 3e 63 6f 6d 70 |ter than|.>>>comp|
|00002b10| 61 63 74 20 28 62 75 74 | 2c 20 74 68 65 6e 2c 20 |act (but|, then, |
|00002b20| 77 68 61 74 20 77 6f 75 | 6c 64 6e 27 74 20 62 65 |what wou|ldn't be|
|00002b30| 29 2c 20 62 75 74 20 69 | 74 27 73 20 61 6c 73 6f |), but i|t's also|
|00002b40| 20 74 68 65 20 73 61 6d | 65 20 73 70 65 65 64 20 | the sam|e speed |
|00002b50| 61 73 0a 3e 3e 3e 70 61 | 63 6b 2c 20 61 6e 64 20 |as.>>>pa|ck, and |
|00002b60| 67 65 74 73 20 62 65 74 | 74 65 72 20 63 6f 6d 70 |gets bet|ter comp|
|00002b70| 72 65 73 73 69 6f 6e 20 | 74 68 61 6e 20 62 6f 74 |ression |than bot|
|00002b80| 68 20 6f 66 20 74 68 65 | 6d 2e 20 20 4f 6e 20 33 |h of the|m. On 3|
|00002b90| 35 30 4b 20 62 79 74 65 | 73 20 6f 66 0a 3e 3e 3e |50K byte|s of.>>>|
|00002ba0| 75 6e 69 78 2d 77 69 7a | 61 72 64 73 2c 20 63 6f |unix-wiz|ards, co|
|00002bb0| 6d 70 61 63 74 20 74 6f | 6f 6b 20 61 62 6f 75 74 |mpact to|ok about|
|00002bc0| 20 38 20 6d 69 6e 75 74 | 65 73 20 6f 66 20 43 50 | 8 minut|es of CP|
|00002bd0| 55 2c 20 70 61 63 6b 20 | 74 6f 6f 6b 20 61 62 6f |U, pack |took abo|
|00002be0| 75 74 20 38 30 0a 3e 3e | 3e 73 65 63 6f 6e 64 73 |ut 80.>>|>seconds|
|00002bf0| 2c 20 61 6e 64 20 63 6f | 6d 70 72 65 73 73 20 28 |, and co|mpress (|
|00002c00| 68 65 72 65 69 6e 29 20 | 61 6c 73 6f 20 74 6f 6f |herein) |also too|
|00002c10| 6b 20 38 30 20 73 65 63 | 6f 6e 64 73 2e 20 20 42 |k 80 sec|onds. B|
|00002c20| 75 74 2c 20 63 6f 6d 70 | 61 63 74 20 61 6e 64 0a |ut, comp|act and.|
|00002c30| 3e 3e 3e 70 61 63 6b 20 | 67 6f 74 20 61 62 6f 75 |>>>pack |got abou|
|00002c40| 74 20 33 30 25 20 63 6f | 6d 70 72 65 73 73 69 6f |t 30% co|mpressio|
|00002c50| 6e 2c 20 77 68 65 72 65 | 61 73 20 63 6f 6d 70 72 |n, where|as compr|
|00002c60| 65 73 73 20 67 6f 74 20 | 6f 76 65 72 20 35 30 25 |ess got |over 50%|
|00002c70| 2e 20 20 53 6f 2c 20 49 | 0a 3e 3e 3e 64 65 63 69 |. So, I|.>>>deci|
|00002c80| 64 65 64 20 49 20 68 61 | 64 20 73 6f 6d 65 74 68 |ded I ha|d someth|
|00002c90| 69 6e 67 2c 20 61 6e 64 | 20 74 68 61 74 20 6f 74 |ing, and| that ot|
|00002ca0| 68 65 72 73 20 6d 69 67 | 68 74 20 62 65 20 69 6e |hers mig|ht be in|
|00002cb0| 74 65 72 65 73 74 65 64 | 2c 20 74 6f 6f 2e 0a 3e |terested|, too..>|
|00002cc0| 3e 3e 0a 3e 3e 3e 41 73 | 20 69 73 20 70 72 6f 62 |>>.>>>As| is prob|
|00002cd0| 61 62 6c 79 20 74 72 75 | 65 20 6f 66 20 63 6f 6d |ably tru|e of com|
|00002ce0| 70 61 63 74 20 61 6e 64 | 20 70 61 63 6b 20 28 61 |pact and| pack (a|
|00002cf0| 6c 74 68 6f 75 67 68 20 | 49 20 68 61 76 65 6e 27 |lthough |I haven'|
|00002d00| 74 20 63 68 65 63 6b 65 | 64 29 2c 0a 3e 3e 3e 74 |t checke|d),.>>>t|
|00002d10| 68 65 20 62 79 74 65 20 | 6f 72 64 65 72 20 77 69 |he byte |order wi|
|00002d20| 74 68 69 6e 20 61 20 77 | 6f 72 64 20 69 73 20 70 |thin a w|ord is p|
|00002d30| 72 6f 62 61 62 6c 79 20 | 72 65 6c 65 76 61 6e 74 |robably |relevant|
|00002d40| 20 68 65 72 65 2c 20 62 | 75 74 20 61 73 20 6c 6f | here, b|ut as lo|
|00002d50| 6e 67 20 61 73 0a 3e 3e | 3e 79 6f 75 20 73 74 61 |ng as.>>|>you sta|
|00002d60| 79 20 6f 6e 20 61 20 73 | 69 6e 67 6c 65 20 6d 61 |y on a s|ingle ma|
|00002d70| 63 68 69 6e 65 20 74 79 | 70 65 2c 20 79 6f 75 20 |chine ty|pe, you |
|00002d80| 73 68 6f 75 6c 64 20 62 | 65 20 6f 6b 2e 20 20 28 |should b|e ok. (|
|00002d90| 43 61 6e 20 61 6e 79 62 | 6f 64 79 0a 3e 3e 3e 65 |Can anyb|ody.>>>e|
|00002da0| 6c 75 63 69 64 61 74 65 | 20 6f 6e 20 74 68 69 73 |lucidate| on this|
|00002db0| 3f 29 20 20 54 68 65 72 | 65 20 61 72 65 20 61 20 |?) Ther|e are a |
|00002dc0| 63 6f 75 70 6c 65 20 6f | 66 20 61 73 6d 27 73 20 |couple o|f asm's |
|00002dd0| 69 6e 20 74 68 65 20 63 | 6f 64 65 20 28 65 78 74 |in the c|ode (ext|
|00002de0| 76 20 61 6e 64 0a 3e 3e | 3e 69 6e 73 76 20 69 6e |v and.>>|>insv in|
|00002df0| 73 74 72 75 63 74 69 6f | 6e 73 29 2c 20 73 6f 20 |structio|ns), so |
|00002e00| 61 6e 79 6f 6e 65 20 70 | 6f 72 74 69 6e 67 20 69 |anyone p|orting i|
|00002e10| 74 20 74 6f 20 61 6e 6f | 74 68 65 72 20 6d 61 63 |t to ano|ther mac|
|00002e20| 68 69 6e 65 20 77 69 6c | 6c 20 68 61 76 65 20 74 |hine wil|l have t|
|00002e30| 6f 0a 3e 3e 3e 64 65 61 | 6c 20 77 69 74 68 20 74 |o.>>>dea|l with t|
|00002e40| 68 69 73 20 61 6e 79 77 | 61 79 20 28 61 6e 64 20 |his anyw|ay (and |
|00002e50| 63 6f 75 6c 64 20 70 72 | 6f 62 61 62 6c 79 20 6d |could pr|obably m|
|00002e60| 61 6b 65 20 69 74 20 63 | 6f 6d 70 61 74 69 62 6c |ake it c|ompatibl|
|00002e70| 65 20 77 69 74 68 20 56 | 61 78 0a 3e 3e 3e 62 79 |e with V|ax.>>>by|
|00002e80| 74 65 20 6f 72 64 65 72 | 20 61 74 20 74 68 65 20 |te order| at the |
|00002e90| 73 61 6d 65 20 74 69 6d | 65 29 2e 20 20 41 6e 79 |same tim|e). Any|
|00002ea0| 77 61 79 2c 20 49 27 76 | 65 20 6c 69 6e 74 65 64 |way, I'v|e linted|
|00002eb0| 20 74 68 65 20 63 6f 64 | 65 20 28 62 6f 74 68 20 | the cod|e (both |
|00002ec0| 77 69 74 68 0a 3e 3e 3e | 61 6e 64 20 77 69 74 68 |with.>>>|and with|
|00002ed0| 6f 75 74 20 2d 70 29 2c | 20 73 6f 20 69 74 20 73 |out -p),| so it s|
|00002ee0| 68 6f 75 6c 64 20 72 75 | 6e 20 65 6c 73 65 77 68 |hould ru|n elsewh|
|00002ef0| 65 72 65 2e 20 20 4e 6f | 74 65 20 74 68 65 20 6c |ere. No|te the l|
|00002f00| 6f 6e 67 73 20 69 6e 20 | 74 68 65 0a 3e 3e 3e 63 |ongs in |the.>>>c|
|00002f10| 6f 64 65 2c 20 79 6f 75 | 20 63 61 6e 20 74 61 6b |ode, you| can tak|
|00002f20| 65 20 74 68 65 73 65 20 | 6f 75 74 20 69 66 20 79 |e these |out if y|
|00002f30| 6f 75 20 72 65 64 75 63 | 65 20 42 49 54 53 20 74 |ou reduc|e BITS t|
|00002f40| 6f 20 3c 3d 20 31 35 2e | 0a 3e 3e 3e 0a 3e 3e 3e |o <= 15.|.>>>.>>>|
|00002f50| 48 61 76 65 20 66 75 6e | 2c 20 61 6e 64 20 61 73 |Have fun|, and as|
|00002f60| 20 61 6c 77 61 79 73 2c | 20 69 66 20 79 6f 75 20 | always,| if you |
|00002f70| 6d 61 6b 65 20 67 6f 6f | 64 20 65 6e 68 61 6e 63 |make goo|d enhanc|
|00002f80| 65 6d 65 6e 74 73 2c 20 | 6f 72 20 62 75 67 20 66 |ements, |or bug f|
|00002f90| 69 78 65 73 2c 0a 3e 3e | 3e 49 27 64 20 6c 69 6b |ixes,.>>|>I'd lik|
|00002fa0| 65 20 74 6f 20 73 65 65 | 20 74 68 65 6d 2e 0a 3e |e to see| them..>|
|00002fb0| 3e 3e 0a 3e 3e 3e 3d 53 | 70 65 6e 63 65 72 20 28 |>>.>>>=S|pencer (|
|00002fc0| 74 68 6f 6d 61 73 40 75 | 74 61 68 2d 32 30 2c 20 |thomas@u|tah-20, |
|00002fd0| 7b 68 61 72 70 6f 2c 68 | 70 6c 61 62 73 2c 61 72 |{harpo,h|plabs,ar|
|00002fe0| 69 7a 6f 6e 61 7d 21 75 | 74 61 68 2d 63 73 21 74 |izona}!u|tah-cs!t|
|00002ff0| 68 6f 6d 61 73 29 0a 3e | 3e 0a 3e 3e 09 09 09 09 |homas).>|>.>>....|
|00003000| 09 72 65 67 61 72 64 73 | 2c 0a 3e 3e 09 09 09 09 |.regards|,.>>....|
|00003010| 09 6a 6f 65 0a 3e 3e 0a | 3e 3e 2d 2d 0a 3e 3e 46 |.joe.>>.|>>--.>>F|
|00003020| 75 6c 6c 2d 4e 61 6d 65 | 3a 20 20 4a 6f 73 65 70 |ull-Name|: Josep|
|00003030| 68 20 4d 2e 20 4f 72 6f | 73 74 0a 3e 3e 55 55 43 |h M. Oro|st.>>UUC|
|00003040| 50 3a 20 20 20 20 20 20 | 20 2e 2e 21 7b 64 65 63 |P: | ..!{dec|
|00003050| 76 61 78 2c 75 63 62 76 | 61 78 2c 69 68 6e 70 34 |vax,ucbv|ax,ihnp4|
|00003060| 7d 21 76 61 78 31 33 35 | 21 70 65 74 73 64 21 6a |}!vax135|!petsd!j|
|00003070| 6f 65 0a 3e 3e 55 53 20 | 4d 61 69 6c 3a 20 20 20 |oe.>>US |Mail: |
|00003080| 20 4d 53 20 33 31 33 3b | 20 50 65 72 6b 69 6e 2d | MS 313;| Perkin-|
|00003090| 45 6c 6d 65 72 3b 20 31 | 30 36 20 41 70 70 6c 65 |Elmer; 1|06 Apple|
|000030a0| 20 53 74 3b 20 54 69 6e | 74 6f 6e 20 46 61 6c 6c | St; Tin|ton Fall|
|000030b0| 73 2c 20 4e 4a 20 30 37 | 37 32 34 0a 3e 3e 50 68 |s, NJ 07|724.>>Ph|
|000030c0| 6f 6e 65 3a 20 20 20 20 | 20 20 28 32 30 31 29 20 |one: | (201) |
|000030d0| 38 37 30 2d 35 38 34 34 | 0a 53 48 41 52 5f 45 4f |870-5844|.SHAR_EO|
|000030e0| 46 0a 69 66 20 74 65 73 | 74 20 38 31 34 32 20 2d |F.if tes|t 8142 -|
|000030f0| 6e 65 20 22 60 77 63 20 | 2d 63 20 3c 20 27 52 45 |ne "`wc |-c < 'RE|
|00003100| 41 44 4d 45 33 2e 30 27 | 60 22 0a 74 68 65 6e 0a |ADME3.0'|`".then.|
|00003110| 09 65 63 68 6f 20 73 68 | 61 72 3a 20 65 72 72 6f |.echo sh|ar: erro|
|00003120| 72 20 74 72 61 6e 73 6d | 69 74 74 69 6e 67 20 22 |r transm|itting "|
|00003130| 27 52 45 41 44 4d 45 33 | 2e 30 27 22 20 27 28 73 |'README3|.0'" '(s|
|00003140| 68 6f 75 6c 64 20 68 61 | 76 65 20 62 65 65 6e 20 |hould ha|ve been |
|00003150| 38 31 34 32 20 63 68 61 | 72 61 63 74 65 72 73 29 |8142 cha|racters)|
|00003160| 27 0a 66 69 0a 66 69 20 | 23 20 65 6e 64 20 6f 66 |'.fi.fi |# end of|
|00003170| 20 6f 76 65 72 77 72 69 | 74 69 6e 67 20 63 68 65 | overwri|ting che|
|00003180| 63 6b 0a 65 63 68 6f 20 | 73 68 61 72 3a 20 65 78 |ck.echo |shar: ex|
|00003190| 74 72 61 63 74 69 6e 67 | 20 22 27 61 74 6f 62 2e |tracting| "'atob.|
|000031a0| 63 27 22 20 27 28 32 35 | 30 35 20 63 68 61 72 61 |c'" '(25|05 chara|
|000031b0| 63 74 65 72 73 29 27 0a | 69 66 20 74 65 73 74 20 |cters)'.|if test |
|000031c0| 2d 66 20 27 61 74 6f 62 | 2e 63 27 0a 74 68 65 6e |-f 'atob|.c'.then|
|000031d0| 0a 09 65 63 68 6f 20 73 | 68 61 72 3a 20 77 69 6c |..echo s|har: wil|
|000031e0| 6c 20 6e 6f 74 20 6f 76 | 65 72 2d 77 72 69 74 65 |l not ov|er-write|
|000031f0| 20 65 78 69 73 74 69 6e | 67 20 66 69 6c 65 20 22 | existin|g file "|
|00003200| 27 61 74 6f 62 2e 63 27 | 22 0a 65 6c 73 65 0a 73 |'atob.c'|".else.s|
|00003210| 65 64 20 27 73 2f 5e 58 | 2f 2f 27 20 3c 3c 20 5c |ed 's/^X|//' << \|
|00003220| 53 48 41 52 5f 45 4f 46 | 20 3e 20 27 61 74 6f 62 |SHAR_EOF| > 'atob|
|00003230| 2e 63 27 0a 2f 2a 20 61 | 74 6f 62 3a 20 76 65 72 |.c'./* a|tob: ver|
|00003240| 73 69 6f 6e 20 34 2e 30 | 0a 20 2a 20 73 74 72 65 |sion 4.0|. * stre|
|00003250| 61 6d 20 66 69 6c 74 65 | 72 20 74 6f 20 63 68 61 |am filte|r to cha|
|00003260| 6e 67 65 20 70 72 69 6e | 74 61 62 6c 65 20 61 73 |nge prin|table as|
|00003270| 63 69 69 20 66 72 6f 6d | 20 22 62 74 6f 61 22 20 |cii from| "btoa" |
|00003280| 62 61 63 6b 20 69 6e 74 | 6f 20 38 20 62 69 74 20 |back int|o 8 bit |
|00003290| 62 79 74 65 73 0a 20 2a | 20 69 66 20 62 61 64 20 |bytes. *| if bad |
|000032a0| 63 68 61 72 73 2c 20 6f | 72 20 43 73 75 6d 73 20 |chars, o|r Csums |
|000032b0| 64 6f 20 6e 6f 74 20 6d | 61 74 63 68 3a 20 65 78 |do not m|atch: ex|
|000032c0| 69 74 28 31 29 20 5b 61 | 6e 64 20 4e 4f 20 6f 75 |it(1) [a|nd NO ou|
|000032d0| 74 70 75 74 5d 0a 20 2a | 0a 20 2a 20 20 50 61 75 |tput]. *|. * Pau|
|000032e0| 6c 20 52 75 74 74 65 72 | 09 09 4a 6f 65 20 4f 72 |l Rutter|..Joe Or|
|000032f0| 6f 73 74 0a 20 2a 20 20 | 70 68 69 6c 61 62 73 21 |ost. * |philabs!|
|00003300| 70 65 72 09 09 70 65 74 | 73 64 21 6a 6f 65 0a 20 |per..pet|sd!joe. |
|00003310| 2a 2f 0a 0a 23 69 6e 63 | 6c 75 64 65 20 3c 73 74 |*/..#inc|lude <st|
|00003320| 64 69 6f 2e 68 3e 0a 0a | 23 64 65 66 69 6e 65 20 |dio.h>..|#define |
|00003330| 72 65 67 20 72 65 67 69 | 73 74 65 72 0a 0a 23 64 |reg regi|ster..#d|
|00003340| 65 66 69 6e 65 20 73 74 | 72 65 71 28 73 30 2c 20 |efine st|req(s0, |
|00003350| 73 31 29 20 20 73 74 72 | 63 6d 70 28 73 30 2c 20 |s1) str|cmp(s0, |
|00003360| 73 31 29 20 3d 3d 20 30 | 0a 0a 23 64 65 66 69 6e |s1) == 0|..#defin|
|00003370| 65 20 74 69 6d 65 73 38 | 35 28 78 29 09 28 28 28 |e times8|5(x).(((|
|00003380| 28 28 28 78 3c 3c 32 29 | 2b 78 29 3c 3c 32 29 2b |(((x<<2)|+x)<<2)+|
|00003390| 78 29 3c 3c 32 29 2b 78 | 29 0a 0a 6c 6f 6e 67 20 |x)<<2)+x|)..long |
|000033a0| 69 6e 74 20 43 65 6f 72 | 20 3d 20 30 3b 0a 6c 6f |int Ceor| = 0;.lo|
|000033b0| 6e 67 20 69 6e 74 20 43 | 73 75 6d 20 3d 20 30 3b |ng int C|sum = 0;|
|000033c0| 0a 6c 6f 6e 67 20 69 6e | 74 20 43 72 6f 74 20 3d |.long in|t Crot =|
|000033d0| 20 30 3b 0a 6c 6f 6e 67 | 20 69 6e 74 20 77 6f 72 | 0;.long| int wor|
|000033e0| 64 20 3d 20 30 3b 0a 6c | 6f 6e 67 20 69 6e 74 20 |d = 0;.l|ong int |
|000033f0| 62 63 6f 75 6e 74 20 3d | 20 30 3b 0a 0a 66 61 74 |bcount =| 0;..fat|
|00003400| 61 6c 28 29 20 7b 0a 20 | 20 66 70 72 69 6e 74 66 |al() {. | fprintf|
|00003410| 28 73 74 64 65 72 72 2c | 20 22 62 61 64 20 66 6f |(stderr,| "bad fo|
|00003420| 72 6d 61 74 20 6f 72 20 | 43 73 75 6d 20 74 6f 20 |rmat or |Csum to |
|00003430| 61 74 6f 62 5c 6e 22 29 | 3b 0a 20 20 65 78 69 74 |atob\n")|;. exit|
|00003440| 28 31 29 3b 0a 7d 0a 0a | 23 64 65 66 69 6e 65 20 |(1);.}..|#define |
|00003450| 44 45 28 63 29 20 28 28 | 63 29 20 2d 20 27 21 27 |DE(c) ((|c) - '!'|
|00003460| 29 0a 0a 64 65 63 6f 64 | 65 28 63 29 20 0a 20 20 |)..decod|e(c) . |
|00003470| 72 65 67 20 63 3b 0a 7b | 0a 20 20 69 66 20 28 63 |reg c;.{|. if (c|
|00003480| 20 3d 3d 20 27 7a 27 29 | 20 7b 0a 20 20 20 20 69 | == 'z')| {. i|
|00003490| 66 20 28 62 63 6f 75 6e | 74 20 21 3d 20 30 29 20 |f (bcoun|t != 0) |
|000034a0| 7b 0a 20 20 20 20 20 20 | 66 61 74 61 6c 28 29 3b |{. |fatal();|
|000034b0| 0a 20 20 20 20 7d 20 65 | 6c 73 65 20 7b 0a 20 20 |. } e|lse {. |
|000034c0| 20 20 20 20 62 79 74 65 | 6f 75 74 28 30 29 3b 0a | byte|out(0);.|
|000034d0| 20 20 20 20 20 20 62 79 | 74 65 6f 75 74 28 30 29 | by|teout(0)|
|000034e0| 3b 0a 20 20 20 20 20 20 | 62 79 74 65 6f 75 74 28 |;. |byteout(|
|000034f0| 30 29 3b 0a 20 20 20 20 | 20 20 62 79 74 65 6f 75 |0);. | byteou|
|00003500| 74 28 30 29 3b 0a 20 20 | 20 20 7d 0a 20 20 7d 20 |t(0);. | }. } |
|00003510| 65 6c 73 65 20 69 66 20 | 28 28 63 20 3e 3d 20 27 |else if |((c >= '|
|00003520| 21 27 29 20 26 26 20 28 | 63 20 3c 20 28 27 21 27 |!') && (|c < ('!'|
|00003530| 20 2b 20 38 35 29 29 29 | 20 7b 0a 20 20 20 20 69 | + 85)))| {. i|
|00003540| 66 20 28 62 63 6f 75 6e | 74 20 3d 3d 20 30 29 20 |f (bcoun|t == 0) |
|00003550| 7b 0a 20 20 20 20 20 20 | 77 6f 72 64 20 3d 20 44 |{. |word = D|
|00003560| 45 28 63 29 3b 0a 20 20 | 20 20 20 20 2b 2b 62 63 |E(c);. | ++bc|
|00003570| 6f 75 6e 74 3b 0a 20 20 | 20 20 7d 20 65 6c 73 65 |ount;. | } else|
|00003580| 20 69 66 20 28 62 63 6f | 75 6e 74 20 3c 20 34 29 | if (bco|unt < 4)|
|00003590| 20 7b 0a 20 20 20 20 20 | 20 77 6f 72 64 20 3d 20 | {. | word = |
|000035a0| 74 69 6d 65 73 38 35 28 | 77 6f 72 64 29 3b 0a 20 |times85(|word);. |
|000035b0| 20 20 20 20 20 77 6f 72 | 64 20 2b 3d 20 44 45 28 | wor|d += DE(|
|000035c0| 63 29 3b 0a 20 20 20 20 | 20 20 2b 2b 62 63 6f 75 |c);. | ++bcou|
|000035d0| 6e 74 3b 0a 20 20 20 20 | 7d 20 65 6c 73 65 20 7b |nt;. |} else {|
|000035e0| 0a 20 20 20 20 20 20 77 | 6f 72 64 20 3d 20 74 69 |. w|ord = ti|
|000035f0| 6d 65 73 38 35 28 77 6f | 72 64 29 20 2b 20 44 45 |mes85(wo|rd) + DE|
|00003600| 28 63 29 3b 0a 20 20 20 | 20 20 20 62 79 74 65 6f |(c);. | byteo|
|00003610| 75 74 28 28 69 6e 74 29 | 28 28 77 6f 72 64 20 3e |ut((int)|((word >|
|00003620| 3e 20 32 34 29 20 26 20 | 32 35 35 29 29 3b 0a 20 |> 24) & |255));. |
|00003630| 20 20 20 20 20 62 79 74 | 65 6f 75 74 28 28 69 6e | byt|eout((in|
|00003640| 74 29 28 28 77 6f 72 64 | 20 3e 3e 20 31 36 29 20 |t)((word| >> 16) |
|00003650| 26 20 32 35 35 29 29 3b | 0a 20 20 20 20 20 20 62 |& 255));|. b|
|00003660| 79 74 65 6f 75 74 28 28 | 69 6e 74 29 28 28 77 6f |yteout((|int)((wo|
|00003670| 72 64 20 3e 3e 20 38 29 | 20 26 20 32 35 35 29 29 |rd >> 8)| & 255))|
|00003680| 3b 0a 20 20 20 20 20 20 | 62 79 74 65 6f 75 74 28 |;. |byteout(|
|00003690| 28 69 6e 74 29 28 77 6f | 72 64 20 26 20 32 35 35 |(int)(wo|rd & 255|
|000036a0| 29 29 3b 0a 20 20 20 20 | 20 20 77 6f 72 64 20 3d |));. | word =|
|000036b0| 20 30 3b 0a 20 20 20 20 | 20 20 62 63 6f 75 6e 74 | 0;. | bcount|
|000036c0| 20 3d 20 30 3b 0a 20 20 | 20 20 7d 0a 20 20 7d 20 | = 0;. | }. } |
|000036d0| 65 6c 73 65 20 7b 0a 20 | 20 20 20 66 61 74 61 6c |else {. | fatal|
|000036e0| 28 29 3b 0a 20 20 7d 0a | 7d 0a 0a 58 46 49 4c 45 |();. }.|}..XFILE|
|000036f0| 20 2a 74 6d 70 5f 66 69 | 6c 65 3b 0a 0a 62 79 74 | *tmp_fi|le;..byt|
|00003700| 65 6f 75 74 28 63 29 20 | 0a 20 20 72 65 67 20 63 |eout(c) |. reg c|
|00003710| 3b 0a 7b 0a 20 20 43 65 | 6f 72 20 5e 3d 20 63 3b |;.{. Ce|or ^= c;|
|00003720| 0a 20 20 43 73 75 6d 20 | 2b 3d 20 63 3b 0a 20 20 |. Csum |+= c;. |
|00003730| 43 73 75 6d 20 2b 3d 20 | 31 3b 0a 20 20 69 66 20 |Csum += |1;. if |
|00003740| 28 28 43 72 6f 74 20 26 | 20 30 78 38 30 30 30 30 |((Crot &| 0x80000|
|00003750| 30 30 30 29 29 20 7b 0a | 20 20 20 20 43 72 6f 74 |000)) {.| Crot|
|00003760| 20 3c 3c 3d 20 31 3b 0a | 20 20 20 20 43 72 6f 74 | <<= 1;.| Crot|
|00003770| 20 2b 3d 20 31 3b 0a 20 | 20 7d 20 65 6c 73 65 20 | += 1;. | } else |
|00003780| 7b 0a 20 20 20 20 43 72 | 6f 74 20 3c 3c 3d 20 31 |{. Cr|ot <<= 1|
|00003790| 3b 0a 20 20 7d 0a 20 20 | 43 72 6f 74 20 2b 3d 20 |;. }. |Crot += |
|000037a0| 63 3b 0a 20 20 70 75 74 | 63 28 63 2c 20 74 6d 70 |c;. put|c(c, tmp|
|000037b0| 5f 66 69 6c 65 29 3b 0a | 7d 0a 0a 6d 61 69 6e 28 |_file);.|}..main(|
|000037c0| 61 72 67 63 2c 20 61 72 | 67 76 29 20 0a 20 20 63 |argc, ar|gv) . c|
|000037d0| 68 61 72 20 2a 2a 61 72 | 67 76 3b 0a 7b 0a 20 20 |har **ar|gv;.{. |
|000037e0| 72 65 67 20 63 3b 0a 20 | 20 72 65 67 20 6c 6f 6e |reg c;. | reg lon|
|000037f0| 67 20 69 6e 74 20 69 3b | 0a 20 20 63 68 61 72 20 |g int i;|. char |
|00003800| 74 6d 70 5f 6e 61 6d 65 | 5b 31 30 30 5d 3b 0a 20 |tmp_name|[100];. |
|00003810| 20 63 68 61 72 20 62 75 | 66 5b 31 30 30 5d 3b 0a | char bu|f[100];.|
|00003820| 20 20 6c 6f 6e 67 20 69 | 6e 74 20 6e 31 2c 20 6e | long i|nt n1, n|
|00003830| 32 2c 20 6f 65 6f 72 2c | 20 6f 73 75 6d 2c 20 6f |2, oeor,| osum, o|
|00003840| 72 6f 74 3b 0a 0a 20 20 | 69 66 20 28 61 72 67 63 |rot;.. |if (argc|
|00003850| 20 21 3d 20 31 29 20 7b | 0a 20 20 20 20 66 70 72 | != 1) {|. fpr|
|00003860| 69 6e 74 66 28 73 74 64 | 65 72 72 2c 22 62 61 64 |intf(std|err,"bad|
|00003870| 20 61 72 67 73 20 74 6f | 20 25 73 5c 6e 22 2c 20 | args to| %s\n", |
|00003880| 61 72 67 76 5b 30 5d 29 | 3b 0a 20 20 20 20 65 78 |argv[0])|;. ex|
|00003890| 69 74 28 32 29 3b 0a 20 | 20 7d 0a 20 20 73 70 72 |it(2);. | }. spr|
|000038a0| 69 6e 74 66 28 74 6d 70 | 5f 6e 61 6d 65 2c 20 22 |intf(tmp|_name, "|
|000038b0| 2f 75 73 72 2f 74 6d 70 | 2f 61 74 6f 62 2e 25 78 |/usr/tmp|/atob.%x|
|000038c0| 22 2c 20 67 65 74 70 69 | 64 28 29 29 3b 0a 20 20 |", getpi|d());. |
|000038d0| 74 6d 70 5f 66 69 6c 65 | 20 3d 20 66 6f 70 65 6e |tmp_file| = fopen|
|000038e0| 28 74 6d 70 5f 6e 61 6d | 65 2c 20 22 77 2b 22 29 |(tmp_nam|e, "w+")|
|000038f0| 3b 0a 20 20 69 66 20 28 | 74 6d 70 5f 66 69 6c 65 |;. if (|tmp_file|
|00003900| 20 3d 3d 20 4e 55 4c 4c | 29 20 7b 0a 20 20 20 20 | == NULL|) {. |
|00003910| 66 61 74 61 6c 28 29 3b | 0a 20 20 7d 0a 20 20 75 |fatal();|. }. u|
|00003920| 6e 6c 69 6e 6b 28 74 6d | 70 5f 6e 61 6d 65 29 3b |nlink(tm|p_name);|
|00003930| 09 2f 2a 20 4d 61 6b 65 | 20 66 69 6c 65 20 64 69 |./* Make| file di|
|00003940| 73 61 70 70 65 61 72 20 | 2a 2f 0a 20 20 2f 2a 73 |sappear |*/. /*s|
|00003950| 65 61 72 63 68 20 66 6f | 72 20 68 65 61 64 65 72 |earch fo|r header|
|00003960| 20 6c 69 6e 65 2a 2f 0a | 20 20 66 6f 72 20 28 3b | line*/.| for (;|
|00003970| 3b 29 20 7b 0a 20 20 20 | 20 69 66 20 28 66 67 65 |;) {. | if (fge|
|00003980| 74 73 28 62 75 66 2c 20 | 73 69 7a 65 6f 66 20 62 |ts(buf, |sizeof b|
|00003990| 75 66 2c 20 73 74 64 69 | 6e 29 20 3d 3d 20 4e 55 |uf, stdi|n) == NU|
|000039a0| 4c 4c 29 20 7b 0a 20 20 | 20 20 20 20 66 61 74 61 |LL) {. | fata|
|000039b0| 6c 28 29 3b 0a 20 20 20 | 20 7d 0a 20 20 20 20 69 |l();. | }. i|
|000039c0| 66 20 28 73 74 72 65 71 | 28 62 75 66 2c 20 22 78 |f (streq|(buf, "x|
|000039d0| 62 74 6f 61 20 42 65 67 | 69 6e 5c 6e 22 29 29 20 |btoa Beg|in\n")) |
|000039e0| 7b 0a 20 20 20 20 20 20 | 62 72 65 61 6b 3b 0a 20 |{. |break;. |
|000039f0| 20 20 20 7d 0a 20 20 7d | 0a 0a 20 20 77 68 69 6c | }. }|.. whil|
|00003a00| 65 20 28 28 63 20 3d 20 | 67 65 74 63 68 61 72 28 |e ((c = |getchar(|
|00003a10| 29 29 20 21 3d 20 45 4f | 46 29 20 7b 0a 20 20 20 |)) != EO|F) {. |
|00003a20| 20 69 66 20 28 63 20 3d | 3d 20 27 5c 6e 27 29 20 | if (c =|= '\n') |
|00003a30| 7b 0a 20 20 20 20 20 20 | 63 6f 6e 74 69 6e 75 65 |{. |continue|
|00003a40| 3b 0a 20 20 20 20 7d 20 | 65 6c 73 65 20 69 66 20 |;. } |else if |
|00003a50| 28 63 20 3d 3d 20 27 78 | 27 29 20 7b 0a 20 20 20 |(c == 'x|') {. |
|00003a60| 20 20 20 62 72 65 61 6b | 3b 0a 20 20 20 20 7d 20 | break|;. } |
|00003a70| 65 6c 73 65 20 7b 0a 20 | 20 20 20 20 20 64 65 63 |else {. | dec|
|00003a80| 6f 64 65 28 63 29 3b 0a | 20 20 20 20 7d 0a 20 20 |ode(c);.| }. |
|00003a90| 7d 0a 20 20 69 66 28 73 | 63 61 6e 66 28 22 62 74 |}. if(s|canf("bt|
|00003aa0| 6f 61 20 45 6e 64 20 4e | 20 25 6c 64 20 25 6c 78 |oa End N| %ld %lx|
|00003ab0| 20 45 20 25 6c 78 20 53 | 20 25 6c 78 20 52 20 25 | E %lx S| %lx R %|
|00003ac0| 6c 78 5c 6e 22 2c 0a 20 | 20 20 20 20 20 20 20 20 |lx\n",. | |
|00003ad0| 26 6e 31 2c 20 26 6e 32 | 2c 20 26 6f 65 6f 72 2c |&n1, &n2|, &oeor,|
|00003ae0| 20 26 6f 73 75 6d 2c 20 | 26 6f 72 6f 74 29 20 21 | &osum, |&orot) !|
|00003af0| 3d 20 35 29 20 7b 0a 20 | 20 20 20 66 61 74 61 6c |= 5) {. | fatal|
|00003b00| 28 29 3b 0a 20 20 7d 0a | 20 20 69 66 20 28 28 6e |();. }.| if ((n|
|00003b10| 31 20 21 3d 20 6e 32 29 | 20 7c 7c 20 28 6f 65 6f |1 != n2)| || (oeo|
|00003b20| 72 20 21 3d 20 43 65 6f | 72 29 20 7c 7c 20 28 6f |r != Ceo|r) || (o|
|00003b30| 73 75 6d 20 21 3d 20 43 | 73 75 6d 29 20 7c 7c 20 |sum != C|sum) || |
|00003b40| 28 6f 72 6f 74 20 21 3d | 20 43 72 6f 74 29 29 20 |(orot !=| Crot)) |
|00003b50| 7b 0a 20 20 20 20 66 61 | 74 61 6c 28 29 3b 0a 20 |{. fa|tal();. |
|00003b60| 20 7d 20 65 6c 73 65 20 | 7b 0a 20 20 20 20 2f 2a | } else |{. /*|
|00003b70| 63 6f 70 79 20 4f 4b 20 | 74 6d 70 20 66 69 6c 65 |copy OK |tmp file|
|00003b80| 20 74 6f 20 73 74 64 6f | 75 74 2a 2f 3b 0a 20 20 | to stdo|ut*/;. |
|00003b90| 20 20 66 73 65 65 6b 28 | 74 6d 70 5f 66 69 6c 65 | fseek(|tmp_file|
|00003ba0| 2c 20 30 4c 2c 20 30 29 | 3b 0a 20 20 20 20 66 6f |, 0L, 0)|;. fo|
|00003bb0| 72 20 28 69 20 3d 20 6e | 31 3b 20 2d 2d 69 20 3e |r (i = n|1; --i >|
|00003bc0| 3d 20 30 3b 29 20 7b 0a | 20 20 20 20 20 20 70 75 |= 0;) {.| pu|
|00003bd0| 74 63 68 61 72 28 67 65 | 74 63 28 74 6d 70 5f 66 |tchar(ge|tc(tmp_f|
|00003be0| 69 6c 65 29 29 3b 0a 20 | 20 20 20 7d 0a 20 20 7d |ile));. | }. }|
|00003bf0| 0a 20 20 65 78 69 74 28 | 30 29 3b 0a 7d 0a 53 48 |. exit(|0);.}.SH|
|00003c00| 41 52 5f 45 4f 46 0a 69 | 66 20 74 65 73 74 20 32 |AR_EOF.i|f test 2|
|00003c10| 35 30 35 20 2d 6e 65 20 | 22 60 77 63 20 2d 63 20 |505 -ne |"`wc -c |
|00003c20| 3c 20 27 61 74 6f 62 2e | 63 27 60 22 0a 74 68 65 |< 'atob.|c'`".the|
|00003c30| 6e 0a 09 65 63 68 6f 20 | 73 68 61 72 3a 20 65 72 |n..echo |shar: er|
|00003c40| 72 6f 72 20 74 72 61 6e | 73 6d 69 74 74 69 6e 67 |ror tran|smitting|
|00003c50| 20 22 27 61 74 6f 62 2e | 63 27 22 20 27 28 73 68 | "'atob.|c'" '(sh|
|00003c60| 6f 75 6c 64 20 68 61 76 | 65 20 62 65 65 6e 20 32 |ould hav|e been 2|
|00003c70| 35 30 35 20 63 68 61 72 | 61 63 74 65 72 73 29 27 |505 char|acters)'|
|00003c80| 0a 66 69 0a 66 69 20 23 | 20 65 6e 64 20 6f 66 20 |.fi.fi #| end of |
|00003c90| 6f 76 65 72 77 72 69 74 | 69 6e 67 20 63 68 65 63 |overwrit|ing chec|
|00003ca0| 6b 0a 65 63 68 6f 20 73 | 68 61 72 3a 20 65 78 74 |k.echo s|har: ext|
|00003cb0| 72 61 63 74 69 6e 67 20 | 22 27 62 74 6f 61 2e 31 |racting |"'btoa.1|
|00003cc0| 27 22 20 27 28 32 34 38 | 33 20 63 68 61 72 61 63 |'" '(248|3 charac|
|00003cd0| 74 65 72 73 29 27 0a 69 | 66 20 74 65 73 74 20 2d |ters)'.i|f test -|
|00003ce0| 66 20 27 62 74 6f 61 2e | 31 27 0a 74 68 65 6e 0a |f 'btoa.|1'.then.|
|00003cf0| 09 65 63 68 6f 20 73 68 | 61 72 3a 20 77 69 6c 6c |.echo sh|ar: will|
|00003d00| 20 6e 6f 74 20 6f 76 65 | 72 2d 77 72 69 74 65 20 | not ove|r-write |
|00003d10| 65 78 69 73 74 69 6e 67 | 20 66 69 6c 65 20 22 27 |existing| file "'|
|00003d20| 62 74 6f 61 2e 31 27 22 | 0a 65 6c 73 65 0a 73 65 |btoa.1'"|.else.se|
|00003d30| 64 20 27 73 2f 5e 58 2f | 2f 27 20 3c 3c 20 5c 53 |d 's/^X/|/' << \S|
|00003d40| 48 41 52 5f 45 4f 46 20 | 3e 20 27 62 74 6f 61 2e |HAR_EOF |> 'btoa.|
|00003d50| 31 27 0a 58 2e 54 48 20 | 42 54 4f 41 20 31 20 6c |1'.X.TH |BTOA 1 l|
|00003d60| 6f 63 61 6c 0a 58 2e 53 | 48 20 4e 41 4d 45 0a 62 |ocal.X.S|H NAME.b|
|00003d70| 74 6f 61 2c 20 61 74 6f | 62 2c 20 74 61 72 6d 61 |toa, ato|b, tarma|
|00003d80| 69 6c 2c 20 75 6e 74 61 | 72 6d 61 69 6c 20 5c 2d |il, unta|rmail \-|
|00003d90| 20 65 6e 63 6f 64 65 2f | 64 65 63 6f 64 65 20 62 | encode/|decode b|
|00003da0| 69 6e 61 72 79 20 74 6f | 20 70 72 69 6e 74 61 62 |inary to| printab|
|00003db0| 6c 65 20 41 53 43 49 49 | 0a 58 2e 53 48 20 53 59 |le ASCII|.X.SH SY|
|00003dc0| 4e 4f 50 53 49 53 0a 58 | 2e 42 20 62 74 6f 61 0a |NOPSIS.X|.B btoa.|
|00003dd0| 58 2e 62 72 0a 58 2e 42 | 20 61 74 6f 62 0a 58 2e |X.br.X.B| atob.X.|
|00003de0| 62 72 0a 58 2e 42 20 74 | 61 72 6d 61 69 6c 0a 77 |br.X.B t|armail.w|
|00003df0| 68 6f 20 73 75 62 6a 65 | 63 74 20 66 69 6c 65 73 |ho subje|ct files|
|00003e00| 20 2e 2e 2e 0a 58 2e 62 | 72 0a 58 2e 42 20 75 6e | ....X.b|r.X.B un|
|00003e10| 74 61 72 6d 61 69 6c 0a | 5b 20 66 69 6c 65 20 5d |tarmail.|[ file ]|
|00003e20| 0a 58 2e 53 48 20 44 45 | 53 43 52 49 50 54 49 4f |.X.SH DE|SCRIPTIO|
|00003e30| 4e 0a 58 2e 49 20 42 74 | 6f 61 0a 69 73 20 61 20 |N.X.I Bt|oa.is a |
|00003e40| 66 69 6c 74 65 72 20 74 | 68 61 74 20 72 65 61 64 |filter t|hat read|
|00003e50| 73 20 61 6e 79 74 68 69 | 6e 67 20 66 72 6f 6d 20 |s anythi|ng from |
|00003e60| 74 68 65 20 73 74 61 6e | 64 61 72 64 20 69 6e 70 |the stan|dard inp|
|00003e70| 75 74 2c 20 61 6e 64 20 | 65 6e 63 6f 64 65 73 20 |ut, and |encodes |
|00003e80| 69 74 20 69 6e 74 6f 0a | 70 72 69 6e 74 61 62 6c |it into.|printabl|
|00003e90| 65 20 41 53 43 49 49 20 | 6f 6e 20 74 68 65 20 73 |e ASCII |on the s|
|00003ea0| 74 61 6e 64 61 72 64 20 | 6f 75 74 70 75 74 2e 20 |tandard |output. |
|00003eb0| 20 49 74 20 61 6c 73 6f | 20 61 74 74 61 63 68 65 | It also| attache|
|00003ec0| 73 20 61 20 68 65 61 64 | 65 72 20 61 6e 64 20 63 |s a head|er and c|
|00003ed0| 68 65 63 6b 73 75 6d 0a | 69 6e 66 6f 72 6d 61 74 |hecksum.|informat|
|00003ee0| 69 6f 6e 20 75 73 65 64 | 20 62 79 20 74 68 65 20 |ion used| by the |
|00003ef0| 72 65 76 65 72 73 65 20 | 66 69 6c 74 65 72 20 0a |reverse |filter .|
|00003f00| 58 2e 49 20 61 74 6f 62 | 20 0a 74 6f 20 66 69 6e |X.I atob| .to fin|
|00003f10| 64 20 74 68 65 20 73 74 | 61 72 74 20 6f 66 20 74 |d the st|art of t|
|00003f20| 68 65 20 64 61 74 61 20 | 61 6e 64 20 74 6f 20 63 |he data |and to c|
|00003f30| 68 65 63 6b 20 69 6e 74 | 65 67 72 69 74 79 2e 0a |heck int|egrity..|
|00003f40| 58 2e 50 50 0a 58 2e 49 | 20 41 74 6f 62 0a 72 65 |X.PP.X.I| Atob.re|
|00003f50| 61 64 73 20 61 6e 20 65 | 6e 63 6f 64 65 64 20 66 |ads an e|ncoded f|
|00003f60| 69 6c 65 2c 20 73 74 72 | 69 70 73 20 6f 66 66 20 |ile, str|ips off |
|00003f70| 61 6e 79 20 6c 65 61 64 | 69 6e 67 20 61 6e 64 0a |any lead|ing and.|
|00003f80| 74 72 61 69 6c 69 6e 67 | 20 6c 69 6e 65 73 20 61 |trailing| lines a|
|00003f90| 64 64 65 64 20 62 79 20 | 6d 61 69 6c 65 72 73 2c |dded by |mailers,|
|00003fa0| 20 61 6e 64 20 72 65 63 | 72 65 61 74 65 73 20 61 | and rec|reates a|
|00003fb0| 20 63 6f 70 79 20 6f 66 | 20 74 68 65 20 6f 72 69 | copy of| the ori|
|00003fc0| 67 69 6e 61 6c 20 66 69 | 6c 65 0a 6f 6e 20 74 68 |ginal fi|le.on th|
|00003fd0| 65 20 73 74 61 6e 64 61 | 72 64 20 6f 75 74 70 75 |e standa|rd outpu|
|00003fe0| 74 2e 0a 58 2e 49 20 41 | 74 6f 62 20 0a 67 69 76 |t..X.I A|tob .giv|
|00003ff0| 65 73 20 4e 4f 20 6f 75 | 74 70 75 74 20 28 61 6e |es NO ou|tput (an|
|00004000| 64 20 65 78 69 74 73 20 | 77 69 74 68 20 61 6e 20 |d exits |with an |
|00004010| 65 72 72 6f 72 20 6d 65 | 73 73 61 67 65 29 20 69 |error me|ssage) i|
|00004020| 66 20 69 74 73 20 69 6e | 70 75 74 20 69 73 20 67 |f its in|put is g|
|00004030| 61 72 62 61 67 65 20 6f | 72 20 0a 74 68 65 20 63 |arbage o|r .the c|
|00004040| 68 65 63 6b 73 75 6d 73 | 20 64 6f 20 6e 6f 74 20 |hecksums| do not |
|00004050| 63 68 65 63 6b 2e 0a 58 | 2e 50 50 0a 58 2e 49 20 |check..X|.PP.X.I |
|00004060| 54 61 72 6d 61 69 6c 0a | 69 73 20 61 20 73 68 65 |Tarmail.|is a she|
|00004070| 6c 6c 20 73 63 72 69 70 | 74 20 74 68 61 74 20 74 |ll scrip|t that t|
|00004080| 61 72 27 73 20 75 70 20 | 61 6c 6c 20 74 68 65 20 |ar's up |all the |
|00004090| 67 69 76 65 6e 20 66 69 | 6c 65 73 2c 20 70 69 70 |given fi|les, pip|
|000040a0| 65 73 20 74 68 65 6d 20 | 0a 74 68 72 6f 75 67 68 |es them |.through|
|000040b0| 20 0a 58 2e 49 52 20 63 | 6f 6d 70 72 65 73 73 20 | .X.IR c|ompress |
|000040c0| 22 2c 22 0a 58 2e 49 52 | 20 62 74 6f 61 20 22 2c |",".X.IR| btoa ",|
|000040d0| 22 0a 61 6e 64 20 6d 61 | 69 6c 73 20 74 68 65 6d |".and ma|ils them|
|000040e0| 20 74 6f 20 74 68 65 20 | 67 69 76 65 6e 20 70 65 | to the |given pe|
|000040f0| 72 73 6f 6e 20 77 69 74 | 68 20 74 68 65 20 67 69 |rson wit|h the gi|
|00004100| 76 65 6e 20 73 75 62 6a | 65 63 74 20 70 68 72 61 |ven subj|ect phra|
|00004110| 73 65 2e 20 20 46 6f 72 | 0a 65 78 61 6d 70 6c 65 |se. For|.example|
|00004120| 3a 0a 58 2e 50 50 0a 58 | 2e 69 6e 20 31 69 0a 74 |:.X.PP.X|.in 1i.t|
|00004130| 61 72 6d 61 69 6c 20 72 | 61 6c 70 68 20 22 68 65 |armail r|alph "he|
|00004140| 72 65 20 69 74 20 69 73 | 20 72 61 6c 70 68 22 20 |re it is| ralph" |
|00004150| 66 6f 6f 2e 63 20 61 2e | 6f 75 74 0a 58 2e 69 6e |foo.c a.|out.X.in|
|00004160| 20 2d 31 69 0a 58 2e 50 | 50 0a 57 69 6c 6c 20 70 | -1i.X.P|P.Will p|
|00004170| 61 63 6b 61 67 65 20 75 | 70 20 66 69 6c 65 73 20 |ackage u|p files |
|00004180| 22 66 6f 6f 2e 63 22 20 | 61 6e 64 20 22 61 2e 6f |"foo.c" |and "a.o|
|00004190| 75 74 22 20 61 6e 64 20 | 6d 61 69 6c 20 74 68 65 |ut" and |mail the|
|000041a0| 6d 20 74 6f 20 22 72 61 | 6c 70 68 22 20 75 73 69 |m to "ra|lph" usi|
|000041b0| 6e 67 0a 73 75 62 6a 65 | 63 74 20 22 68 65 72 65 |ng.subje|ct "here|
|000041c0| 20 69 74 20 69 73 20 72 | 61 6c 70 68 22 2e 20 20 | it is r|alph". |
|000041d0| 4e 6f 74 69 63 65 20 74 | 68 65 20 71 75 6f 74 65 |Notice t|he quote|
|000041e0| 73 20 6f 6e 20 74 68 65 | 20 73 75 62 6a 65 63 74 |s on the| subject|
|000041f0| 2e 20 20 54 68 65 79 20 | 61 72 65 0a 6e 65 63 65 |. They |are.nece|
|00004200| 73 73 61 72 79 20 74 6f | 20 6d 61 6b 65 20 69 74 |ssary to| make it|
|00004210| 20 6f 6e 65 20 61 72 67 | 75 6d 65 6e 74 20 74 6f | one arg|ument to|
|00004220| 20 74 68 65 20 73 68 65 | 6c 6c 2e 0a 58 2e 50 50 | the she|ll..X.PP|
|00004230| 0a 58 2e 49 20 54 61 72 | 6d 61 69 6c 20 0a 77 69 |.X.I Tar|mail .wi|
|00004240| 74 68 20 6e 6f 20 61 72 | 67 73 20 77 69 6c 6c 20 |th no ar|gs will |
|00004250| 70 72 69 6e 74 20 61 20 | 73 68 6f 72 74 20 6d 65 |print a |short me|
|00004260| 73 73 61 67 65 20 72 65 | 6d 69 6e 64 69 6e 67 20 |ssage re|minding |
|00004270| 79 6f 75 20 77 68 61 74 | 20 74 68 65 20 72 65 71 |you what| the req|
|00004280| 75 69 72 65 64 20 61 72 | 67 73 20 0a 61 72 65 2e |uired ar|gs .are.|
|00004290| 20 20 57 68 65 6e 20 74 | 68 65 20 6d 61 69 6c 20 | When t|he mail |
|000042a0| 69 73 20 72 65 63 65 69 | 76 65 64 20 61 74 20 74 |is recei|ved at t|
|000042b0| 68 65 20 6f 74 68 65 72 | 20 65 6e 64 2c 20 74 68 |he other| end, th|
|000042c0| 61 74 20 70 65 72 73 6f | 6e 20 73 68 6f 75 6c 64 |at perso|n should|
|000042d0| 20 75 73 65 0a 6d 61 69 | 6c 20 74 6f 20 73 61 76 | use.mai|l to sav|
|000042e0| 65 20 74 68 65 20 6d 65 | 73 73 61 67 65 20 69 6e |e the me|ssage in|
|000042f0| 20 73 6f 6d 65 20 74 65 | 6d 70 6f 72 61 72 79 20 | some te|mporary |
|00004300| 66 69 6c 65 20 6e 61 6d | 65 20 28 73 61 79 20 22 |file nam|e (say "|
|00004310| 78 78 22 29 2e 0a 54 68 | 65 6e 20 73 61 79 69 6e |xx")..Th|en sayin|
|00004320| 67 20 22 75 6e 74 61 72 | 6d 61 69 6c 20 78 78 22 |g "untar|mail xx"|
|00004330| 0a 77 69 6c 6c 20 64 65 | 63 6f 64 65 20 74 68 65 |.will de|code the|
|00004340| 20 6d 65 73 73 61 67 65 | 20 61 6e 64 20 75 6e 74 | message| and unt|
|00004350| 61 72 20 69 74 2e 20 20 | 0a 58 2e 49 20 55 6e 74 |ar it. |.X.I Unt|
|00004360| 61 72 6d 61 69 6c 20 0a | 63 61 6e 20 61 6c 73 6f |armail .|can also|
|00004370| 20 62 65 20 75 73 65 64 | 20 61 73 20 61 20 66 69 | be used| as a fi|
|00004380| 6c 74 65 72 2e 20 20 42 | 79 20 75 73 69 6e 67 20 |lter. B|y using |
|00004390| 0a 58 2e 49 52 20 74 61 | 72 6d 61 69 6c 20 22 2c |.X.IR ta|rmail ",|
|000043a0| 22 0a 62 69 6e 61 72 79 | 20 66 69 6c 65 73 20 61 |".binary| files a|
|000043b0| 6e 64 0a 65 6e 74 69 72 | 65 20 64 69 72 65 63 74 |nd.entir|e direct|
|000043c0| 6f 72 79 20 73 74 72 75 | 63 74 75 72 65 73 20 63 |ory stru|ctures c|
|000043d0| 61 6e 20 62 65 20 65 61 | 73 69 6c 79 20 74 72 61 |an be ea|sily tra|
|000043e0| 6e 73 6d 69 74 74 65 64 | 20 62 65 74 77 65 65 6e |nsmitted| between|
|000043f0| 20 6d 61 63 68 69 6e 65 | 73 2e 0a 4e 61 74 75 72 | machine|s..Natur|
|00004400| 61 6c 6c 79 2c 20 79 6f | 75 20 73 68 6f 75 6c 64 |ally, yo|u should|
|00004410| 20 75 6e 64 65 72 73 74 | 61 6e 64 20 77 68 61 74 | underst|and what|
|00004420| 20 74 61 72 20 69 74 73 | 65 6c 66 20 64 6f 65 73 | tar its|elf does|
|00004430| 20 62 65 66 6f 72 65 20 | 79 6f 75 20 75 73 65 20 | before |you use |
|00004440| 0a 58 2e 49 52 20 74 61 | 72 6d 61 69 6c 20 22 2e |.X.IR ta|rmail ".|
|00004450| 22 0a 58 2e 50 50 0a 4f | 74 68 65 72 20 75 73 65 |".X.PP.O|ther use|
|00004460| 73 3a 0a 58 2e 50 50 0a | 63 6f 6d 70 72 65 73 73 |s:.X.PP.|compress|
|00004470| 20 3c 20 73 65 63 72 65 | 74 73 20 7c 20 63 72 79 | < secre|ts | cry|
|00004480| 70 74 20 7c 20 62 74 6f | 61 20 7c 20 6d 61 69 6c |pt | bto|a | mail|
|00004490| 20 72 61 6c 70 68 0a 58 | 2e 50 50 0a 77 69 6c 6c | ralph.X|.PP.will|
|000044a0| 20 6d 61 69 6c 20 74 68 | 65 20 65 6e 63 72 79 70 | mail th|e encryp|
|000044b0| 74 65 64 20 63 6f 6e 74 | 65 6e 74 73 20 6f 66 20 |ted cont|ents of |
|000044c0| 74 68 65 20 66 69 6c 65 | 20 22 73 65 63 72 65 74 |the file| "secret|
|000044d0| 73 22 20 74 6f 20 72 61 | 6c 70 68 2e 20 20 49 66 |s" to ra|lph. If|
|000044e0| 20 72 61 6c 70 68 0a 6b | 6e 6f 77 73 20 74 68 65 | ralph.k|nows the|
|000044f0| 20 65 6e 63 72 79 70 74 | 69 6f 6e 20 6b 65 79 2c | encrypt|ion key,|
|00004500| 20 68 65 20 63 61 6e 20 | 64 65 63 6f 64 65 20 69 | he can |decode i|
|00004510| 74 20 62 79 20 73 61 76 | 69 6e 67 20 74 68 65 20 |t by sav|ing the |
|00004520| 6d 61 69 6c 20 28 73 61 | 79 20 69 6e 20 22 78 78 |mail (sa|y in "xx|
|00004530| 22 29 2c 0a 61 6e 64 20 | 74 68 65 6e 20 72 75 6e |"),.and |then run|
|00004540| 6e 69 6e 67 3a 0a 58 2e | 50 50 0a 61 74 6f 62 20 |ning:.X.|PP.atob |
|00004550| 3c 20 78 78 20 7c 20 63 | 72 79 70 74 20 7c 20 75 |< xx | c|rypt | u|
|00004560| 6e 63 6f 6d 70 72 65 73 | 73 0a 58 2e 50 50 0a 28 |ncompres|s.X.PP.(|
|00004570| 63 72 79 70 74 20 72 65 | 71 75 65 73 74 73 20 74 |crypt re|quests t|
|00004580| 68 65 20 6b 65 79 20 66 | 72 6f 6d 20 74 68 65 20 |he key f|rom the |
|00004590| 74 65 72 6d 69 6e 61 6c | 2c 0a 61 6e 64 20 74 68 |terminal|,.and th|
|000045a0| 65 20 22 73 65 63 72 65 | 74 73 22 20 63 6f 6d 65 |e "secre|ts" come|
|000045b0| 20 6f 75 74 20 6f 6e 20 | 74 68 65 20 74 65 72 6d | out on |the term|
|000045c0| 69 6e 61 6c 29 2e 0a 58 | 2e 53 48 20 41 55 54 48 |inal)..X|.SH AUTH|
|000045d0| 4f 52 0a 50 61 75 6c 20 | 52 75 74 74 65 72 20 28 |OR.Paul |Rutter (|
|000045e0| 6d 6f 64 69 66 69 65 64 | 20 62 79 20 4a 6f 65 20 |modified| by Joe |
|000045f0| 4f 72 6f 73 74 29 0a 58 | 2e 53 48 20 46 45 41 54 |Orost).X|.SH FEAT|
|00004600| 55 52 45 53 0a 58 2e 49 | 20 42 74 6f 61 0a 75 73 |URES.X.I| Btoa.us|
|00004610| 65 73 20 61 20 63 6f 6d | 70 61 63 74 20 62 61 73 |es a com|pact bas|
|00004620| 65 2d 38 35 20 65 6e 63 | 6f 64 69 6e 67 20 73 6f |e-85 enc|oding so|
|00004630| 20 74 68 61 74 0a 34 20 | 62 79 74 65 73 20 61 72 | that.4 |bytes ar|
|00004640| 65 20 65 6e 63 6f 64 65 | 64 20 69 6e 74 6f 20 35 |e encode|d into 5|
|00004650| 20 63 68 61 72 61 63 74 | 65 72 73 20 28 66 69 6c | charact|ers (fil|
|00004660| 65 20 69 73 20 65 78 70 | 61 6e 64 65 64 20 62 79 |e is exp|anded by|
|00004670| 20 32 35 25 29 2e 0a 41 | 73 20 61 20 73 70 65 63 | 25%)..A|s a spec|
|00004680| 69 61 6c 20 63 61 73 65 | 2c 20 33 32 2d 62 69 74 |ial case|, 32-bit|
|00004690| 20 7a 65 72 6f 20 69 73 | 20 65 6e 63 6f 64 65 64 | zero is| encoded|
|000046a0| 20 61 73 20 6f 6e 65 20 | 63 68 61 72 61 63 74 65 | as one |characte|
|000046b0| 72 2e 20 20 54 68 69 73 | 20 65 6e 63 6f 64 69 6e |r. This| encodin|
|000046c0| 67 0a 70 72 6f 64 75 63 | 65 73 20 6c 65 73 73 20 |g.produc|es less |
|000046d0| 6f 75 74 70 75 74 20 74 | 68 61 6e 0a 58 2e 49 52 |output t|han.X.IR|
|000046e0| 20 75 75 65 6e 63 6f 64 | 65 20 22 28 31 29 2e 22 | uuencod|e "(1)."|
|000046f0| 0a 58 2e 53 48 20 22 53 | 45 45 20 41 4c 53 4f 22 |.X.SH "S|EE ALSO"|
|00004700| 0a 63 6f 6d 70 72 65 73 | 73 28 31 29 2c 20 63 72 |.compres|s(1), cr|
|00004710| 79 70 74 28 31 29 2c 20 | 75 75 65 6e 63 6f 64 65 |ypt(1), |uuencode|
|00004720| 28 31 29 2c 20 6d 61 69 | 6c 28 31 29 0a 53 48 41 |(1), mai|l(1).SHA|
|00004730| 52 5f 45 4f 46 0a 69 66 | 20 74 65 73 74 20 32 34 |R_EOF.if| test 24|
|00004740| 38 33 20 2d 6e 65 20 22 | 60 77 63 20 2d 63 20 3c |83 -ne "|`wc -c <|
|00004750| 20 27 62 74 6f 61 2e 31 | 27 60 22 0a 74 68 65 6e | 'btoa.1|'`".then|
|00004760| 0a 09 65 63 68 6f 20 73 | 68 61 72 3a 20 65 72 72 |..echo s|har: err|
|00004770| 6f 72 20 74 72 61 6e 73 | 6d 69 74 74 69 6e 67 20 |or trans|mitting |
|00004780| 22 27 62 74 6f 61 2e 31 | 27 22 20 27 28 73 68 6f |"'btoa.1|'" '(sho|
|00004790| 75 6c 64 20 68 61 76 65 | 20 62 65 65 6e 20 32 34 |uld have| been 24|
|000047a0| 38 33 20 63 68 61 72 61 | 63 74 65 72 73 29 27 0a |83 chara|cters)'.|
|000047b0| 66 69 0a 66 69 20 23 20 | 65 6e 64 20 6f 66 20 6f |fi.fi # |end of o|
|000047c0| 76 65 72 77 72 69 74 69 | 6e 67 20 63 68 65 63 6b |verwriti|ng check|
|000047d0| 0a 65 63 68 6f 20 73 68 | 61 72 3a 20 65 78 74 72 |.echo sh|ar: extr|
|000047e0| 61 63 74 69 6e 67 20 22 | 27 62 74 6f 61 2e 63 27 |acting "|'btoa.c'|
|000047f0| 22 20 27 28 32 33 33 33 | 20 63 68 61 72 61 63 74 |" '(2333| charact|
|00004800| 65 72 73 29 27 0a 69 66 | 20 74 65 73 74 20 2d 66 |ers)'.if| test -f|
|00004810| 20 27 62 74 6f 61 2e 63 | 27 0a 74 68 65 6e 0a 09 | 'btoa.c|'.then..|
|00004820| 65 63 68 6f 20 73 68 61 | 72 3a 20 77 69 6c 6c 20 |echo sha|r: will |
|00004830| 6e 6f 74 20 6f 76 65 72 | 2d 77 72 69 74 65 20 65 |not over|-write e|
|00004840| 78 69 73 74 69 6e 67 20 | 66 69 6c 65 20 22 27 62 |xisting |file "'b|
|00004850| 74 6f 61 2e 63 27 22 0a | 65 6c 73 65 0a 73 65 64 |toa.c'".|else.sed|
|00004860| 20 27 73 2f 5e 58 2f 2f | 27 20 3c 3c 20 5c 53 48 | 's/^X//|' << \SH|
|00004870| 41 52 5f 45 4f 46 20 3e | 20 27 62 74 6f 61 2e 63 |AR_EOF >| 'btoa.c|
|00004880| 27 0a 2f 2a 20 62 74 6f | 61 3a 20 76 65 72 73 69 |'./* bto|a: versi|
|00004890| 6f 6e 20 34 2e 30 0a 20 | 2a 20 73 74 72 65 61 6d |on 4.0. |* stream|
|000048a0| 20 66 69 6c 74 65 72 20 | 74 6f 20 63 68 61 6e 67 | filter |to chang|
|000048b0| 65 20 38 20 62 69 74 20 | 62 79 74 65 73 20 69 6e |e 8 bit |bytes in|
|000048c0| 74 6f 20 70 72 69 6e 74 | 61 62 6c 65 20 61 73 63 |to print|able asc|
|000048d0| 69 69 0a 20 2a 20 63 6f | 6d 70 75 74 65 73 20 74 |ii. * co|mputes t|
|000048e0| 68 65 20 6e 75 6d 62 65 | 72 20 6f 66 20 62 79 74 |he numbe|r of byt|
|000048f0| 65 73 2c 20 61 6e 64 20 | 74 68 72 65 65 20 6b 69 |es, and |three ki|
|00004900| 6e 64 73 20 6f 66 20 73 | 69 6d 70 6c 65 20 63 68 |nds of s|imple ch|
|00004910| 65 63 6b 73 75 6d 73 0a | 20 2a 20 69 6e 63 6f 6d |ecksums.| * incom|
|00004920| 69 6e 67 20 62 79 74 65 | 73 20 61 72 65 20 63 6f |ing byte|s are co|
|00004930| 6c 6c 65 63 74 65 64 20 | 69 6e 74 6f 20 33 32 2d |llected |into 32-|
|00004940| 62 69 74 20 77 6f 72 64 | 73 2c 20 74 68 65 6e 20 |bit word|s, then |
|00004950| 70 72 69 6e 74 65 64 20 | 69 6e 20 62 61 73 65 20 |printed |in base |
|00004960| 38 35 0a 20 2a 20 20 65 | 78 70 28 38 35 2c 35 29 |85. * e|xp(85,5)|
|00004970| 20 3e 20 65 78 70 28 32 | 2c 33 32 29 0a 20 2a 20 | > exp(2|,32). * |
|00004980| 74 68 65 20 41 53 43 49 | 49 20 63 68 61 72 61 63 |the ASCI|I charac|
|00004990| 74 65 72 73 20 75 73 65 | 64 20 61 72 65 20 62 65 |ters use|d are be|
|000049a0| 74 77 65 65 6e 20 27 21 | 27 20 61 6e 64 20 27 75 |tween '!|' and 'u|
|000049b0| 27 0a 20 2a 20 27 7a 27 | 20 65 6e 63 6f 64 65 73 |'. * 'z'| encodes|
|000049c0| 20 33 32 2d 62 69 74 20 | 7a 65 72 6f 3b 20 27 78 | 32-bit |zero; 'x|
|000049d0| 27 20 69 73 20 75 73 65 | 64 20 74 6f 20 6d 61 72 |' is use|d to mar|
|000049e0| 6b 20 74 68 65 20 65 6e | 64 20 6f 66 20 65 6e 63 |k the en|d of enc|
|000049f0| 6f 64 65 64 20 64 61 74 | 61 2e 0a 20 2a 0a 20 2a |oded dat|a.. *. *|
|00004a00| 20 20 50 61 75 6c 20 52 | 75 74 74 65 72 09 09 4a | Paul R|utter..J|
|00004a10| 6f 65 20 4f 72 6f 73 74 | 0a 20 2a 20 20 70 68 69 |oe Orost|. * phi|
|00004a20| 6c 61 62 73 21 70 65 72 | 09 09 70 65 74 73 64 21 |labs!per|..petsd!|
|00004a30| 6a 6f 65 0a 20 2a 0a 20 | 2a 20 20 57 41 52 4e 49 |joe. *. |* WARNI|
|00004a40| 4e 47 3a 20 74 68 69 73 | 20 76 65 72 73 69 6f 6e |NG: this| version|
|00004a50| 20 69 73 20 6e 6f 74 20 | 63 6f 6d 70 61 74 69 62 | is not |compatib|
|00004a60| 6c 65 20 77 69 74 68 20 | 74 68 65 20 6f 72 69 67 |le with |the orig|
|00004a70| 69 6e 61 6c 20 61 73 20 | 73 65 6e 74 20 6f 75 74 |inal as |sent out|
|00004a80| 0a 20 2a 20 20 6f 6e 20 | 74 68 65 20 6e 65 74 2e |. * on |the net.|
|00004a90| 20 20 54 68 65 20 6f 72 | 69 67 69 6e 61 6c 20 65 | The or|iginal e|
|00004aa0| 6e 63 6f 64 65 64 20 66 | 72 6f 6d 20 27 20 27 20 |ncoded f|rom ' ' |
|00004ab0| 74 6f 20 27 74 27 3b 20 | 77 68 69 63 68 20 63 61 |to 't'; |which ca|
|00004ac0| 75 73 65 20 70 72 6f 62 | 6c 65 6d 73 0a 20 2a 20 |use prob|lems. * |
|00004ad0| 20 77 69 74 68 20 73 6f | 6d 65 20 6d 61 69 6c 65 | with so|me maile|
|00004ae0| 72 73 20 28 73 74 72 69 | 70 70 69 6e 67 20 6f 66 |rs (stri|pping of|
|00004af0| 66 20 74 72 61 69 6c 69 | 6e 67 20 62 6c 61 6e 6b |f traili|ng blank|
|00004b00| 73 29 2e 0a 20 2a 2f 0a | 0a 23 69 6e 63 6c 75 64 |s).. */.|.#includ|
|00004b10| 65 20 3c 73 74 64 69 6f | 2e 68 3e 0a 0a 23 64 65 |e <stdio|.h>..#de|
|00004b20| 66 69 6e 65 20 72 65 67 | 20 72 65 67 69 73 74 65 |fine reg| registe|
|00004b30| 72 0a 0a 23 64 65 66 69 | 6e 65 20 4d 41 58 50 45 |r..#defi|ne MAXPE|
|00004b40| 52 4c 49 4e 45 20 37 38 | 0a 0a 6c 6f 6e 67 20 69 |RLINE 78|..long i|
|00004b50| 6e 74 20 43 65 6f 72 20 | 3d 20 30 3b 0a 6c 6f 6e |nt Ceor |= 0;.lon|
|00004b60| 67 20 69 6e 74 20 43 73 | 75 6d 20 3d 20 30 3b 0a |g int Cs|um = 0;.|
|00004b70| 6c 6f 6e 67 20 69 6e 74 | 20 43 72 6f 74 20 3d 20 |long int| Crot = |
|00004b80| 30 3b 0a 0a 6c 6f 6e 67 | 20 69 6e 74 20 63 63 6f |0;..long| int cco|
|00004b90| 75 6e 74 20 3d 20 30 3b | 0a 6c 6f 6e 67 20 69 6e |unt = 0;|.long in|
|00004ba0| 74 20 62 63 6f 75 6e 74 | 20 3d 20 30 3b 0a 6c 6f |t bcount| = 0;.lo|
|00004bb0| 6e 67 20 69 6e 74 20 77 | 6f 72 64 3b 0a 0a 23 64 |ng int w|ord;..#d|
|00004bc0| 65 66 69 6e 65 20 45 4e | 28 63 29 09 28 69 6e 74 |efine EN|(c).(int|
|00004bd0| 29 20 28 28 63 29 20 2b | 20 27 21 27 29 0a 0a 65 |) ((c) +| '!')..e|
|00004be0| 6e 63 6f 64 65 28 63 29 | 20 0a 20 20 72 65 67 20 |ncode(c)| . reg |
|00004bf0| 63 3b 0a 7b 0a 20 20 43 | 65 6f 72 20 5e 3d 20 63 |c;.{. C|eor ^= c|
|00004c00| 3b 0a 20 20 43 73 75 6d | 20 2b 3d 20 63 3b 0a 20 |;. Csum| += c;. |
|00004c10| 20 43 73 75 6d 20 2b 3d | 20 31 3b 0a 20 20 69 66 | Csum +=| 1;. if|
|00004c20| 20 28 28 43 72 6f 74 20 | 26 20 30 78 38 30 30 30 | ((Crot |& 0x8000|
|00004c30| 30 30 30 30 29 29 20 7b | 0a 20 20 20 20 43 72 6f |0000)) {|. Cro|
|00004c40| 74 20 3c 3c 3d 20 31 3b | 0a 20 20 20 20 43 72 6f |t <<= 1;|. Cro|
|00004c50| 74 20 2b 3d 20 31 3b 0a | 20 20 7d 20 65 6c 73 65 |t += 1;.| } else|
|00004c60| 20 7b 0a 20 20 20 20 43 | 72 6f 74 20 3c 3c 3d 20 | {. C|rot <<= |
|00004c70| 31 3b 0a 20 20 7d 0a 20 | 20 43 72 6f 74 20 2b 3d |1;. }. | Crot +=|
|00004c80| 20 63 3b 0a 0a 20 20 77 | 6f 72 64 20 3c 3c 3d 20 | c;.. w|ord <<= |
|00004c90| 38 3b 0a 20 20 77 6f 72 | 64 20 7c 3d 20 63 3b 0a |8;. wor|d |= c;.|
|00004ca0| 20 20 69 66 20 28 62 63 | 6f 75 6e 74 20 3d 3d 20 | if (bc|ount == |
|00004cb0| 33 29 20 7b 0a 20 20 20 | 20 77 6f 72 64 6f 75 74 |3) {. | wordout|
|00004cc0| 28 77 6f 72 64 29 3b 0a | 20 20 20 20 62 63 6f 75 |(word);.| bcou|
|00004cd0| 6e 74 20 3d 20 30 3b 0a | 20 20 7d 20 65 6c 73 65 |nt = 0;.| } else|
|00004ce0| 20 7b 0a 20 20 20 20 62 | 63 6f 75 6e 74 20 2b 3d | {. b|count +=|
|00004cf0| 20 31 3b 0a 20 20 7d 0a | 7d 0a 0a 77 6f 72 64 6f | 1;. }.|}..wordo|
|00004d00| 75 74 28 77 6f 72 64 29 | 20 0a 20 20 72 65 67 20 |ut(word)| . reg |
|00004d10| 6c 6f 6e 67 20 69 6e 74 | 20 77 6f 72 64 3b 0a 7b |long int| word;.{|
|00004d20| 0a 20 20 69 66 20 28 77 | 6f 72 64 20 3d 3d 20 30 |. if (w|ord == 0|
|00004d30| 29 20 7b 0a 20 20 20 20 | 63 68 61 72 6f 75 74 28 |) {. |charout(|
|00004d40| 27 7a 27 29 3b 0a 20 20 | 7d 20 65 6c 73 65 20 7b |'z');. |} else {|
|00004d50| 0a 20 20 20 20 72 65 67 | 20 69 6e 74 20 74 6d 70 |. reg| int tmp|
|00004d60| 20 3d 20 30 3b 0a 20 20 | 20 20 0a 20 20 20 20 69 | = 0;. | . i|
|00004d70| 66 28 77 6f 72 64 20 3c | 20 30 29 20 7b 09 2f 2a |f(word <| 0) {./*|
|00004d80| 20 42 65 63 61 75 73 65 | 20 73 6f 6d 65 20 64 6f | Because| some do|
|00004d90| 6e 27 74 20 73 75 70 70 | 6f 72 74 20 75 6e 73 69 |n't supp|ort unsi|
|00004da0| 67 6e 65 64 20 6c 6f 6e | 67 20 2a 2f 0a 20 20 20 |gned lon|g */. |
|00004db0| 20 20 20 74 6d 70 20 3d | 20 33 32 3b 0a 20 20 20 | tmp =| 32;. |
|00004dc0| 20 20 20 77 6f 72 64 20 | 3d 20 77 6f 72 64 20 2d | word |= word -|
|00004dd0| 20 28 6c 6f 6e 67 29 28 | 38 35 20 2a 20 38 35 20 | (long)(|85 * 85 |
|00004de0| 2a 20 38 35 20 2a 20 38 | 35 20 2a 20 33 32 29 3b |* 85 * 8|5 * 32);|
|00004df0| 0a 20 20 20 20 7d 0a 20 | 20 20 20 69 66 28 77 6f |. }. | if(wo|
|00004e00| 72 64 20 3c 20 30 29 20 | 7b 0a 20 20 20 20 20 20 |rd < 0) |{. |
|00004e10| 74 6d 70 20 3d 20 36 34 | 3b 0a 20 20 20 20 20 20 |tmp = 64|;. |
|00004e20| 77 6f 72 64 20 3d 20 77 | 6f 72 64 20 2d 20 28 6c |word = w|ord - (l|
|00004e30| 6f 6e 67 29 28 38 35 20 | 2a 20 38 35 20 2a 20 38 |ong)(85 |* 85 * 8|
|00004e40| 35 20 2a 20 38 35 20 2a | 20 33 32 29 3b 0a 20 20 |5 * 85 *| 32);. |
|00004e50| 20 20 7d 0a 20 20 20 20 | 63 68 61 72 6f 75 74 28 | }. |charout(|
|00004e60| 45 4e 28 28 77 6f 72 64 | 20 2f 20 28 6c 6f 6e 67 |EN((word| / (long|
|00004e70| 29 28 38 35 20 2a 20 38 | 35 20 2a 20 38 35 20 2a |)(85 * 8|5 * 85 *|
|00004e80| 20 38 35 29 29 20 2b 20 | 74 6d 70 29 29 3b 0a 20 | 85)) + |tmp));. |
|00004e90| 20 20 20 77 6f 72 64 20 | 25 3d 20 28 6c 6f 6e 67 | word |%= (long|
|00004ea0| 29 28 38 35 20 2a 20 38 | 35 20 2a 20 38 35 20 2a |)(85 * 8|5 * 85 *|
|00004eb0| 20 38 35 29 3b 0a 20 20 | 20 20 63 68 61 72 6f 75 | 85);. | charou|
|00004ec0| 74 28 45 4e 28 77 6f 72 | 64 20 2f 20 28 38 35 20 |t(EN(wor|d / (85 |
|00004ed0| 2a 20 38 35 20 2a 20 38 | 35 29 29 29 3b 0a 20 20 |* 85 * 8|5)));. |
|00004ee0| 20 20 77 6f 72 64 20 25 | 3d 20 28 38 35 20 2a 20 | word %|= (85 * |
|00004ef0| 38 35 20 2a 20 38 35 29 | 3b 0a 20 20 20 20 63 68 |85 * 85)|;. ch|
|00004f00| 61 72 6f 75 74 28 45 4e | 28 77 6f 72 64 20 2f 20 |arout(EN|(word / |
|00004f10| 28 38 35 20 2a 20 38 35 | 29 29 29 3b 0a 20 20 20 |(85 * 85|)));. |
|00004f20| 20 77 6f 72 64 20 25 3d | 20 28 38 35 20 2a 20 38 | word %=| (85 * 8|
|00004f30| 35 29 3b 0a 20 20 20 20 | 63 68 61 72 6f 75 74 28 |5);. |charout(|
|00004f40| 45 4e 28 77 6f 72 64 20 | 2f 20 38 35 29 29 3b 0a |EN(word |/ 85));.|
|00004f50| 20 20 20 20 77 6f 72 64 | 20 25 3d 20 38 35 3b 0a | word| %= 85;.|
|00004f60| 20 20 20 20 63 68 61 72 | 6f 75 74 28 45 4e 28 77 | char|out(EN(w|
|00004f70| 6f 72 64 29 29 3b 0a 20 | 20 7d 0a 7d 0a 0a 63 68 |ord));. | }.}..ch|
|00004f80| 61 72 6f 75 74 28 63 29 | 20 7b 0a 20 20 70 75 74 |arout(c)| {. put|
|00004f90| 63 68 61 72 28 63 29 3b | 0a 20 20 63 63 6f 75 6e |char(c);|. ccoun|
|00004fa0| 74 20 2b 3d 20 31 3b 0a | 20 20 69 66 20 28 63 63 |t += 1;.| if (cc|
|00004fb0| 6f 75 6e 74 20 3d 3d 20 | 4d 41 58 50 45 52 4c 49 |ount == |MAXPERLI|
|00004fc0| 4e 45 29 20 7b 0a 20 20 | 20 20 70 75 74 63 68 61 |NE) {. | putcha|
|00004fd0| 72 28 27 5c 6e 27 29 3b | 0a 20 20 20 20 63 63 6f |r('\n');|. cco|
|00004fe0| 75 6e 74 20 3d 20 30 3b | 0a 20 20 7d 0a 7d 0a 0a |unt = 0;|. }.}..|
|00004ff0| 6d 61 69 6e 28 61 72 67 | 63 2c 61 72 67 76 29 20 |main(arg|c,argv) |
|00005000| 0a 20 20 63 68 61 72 20 | 2a 2a 61 72 67 76 3b 0a |. char |**argv;.|
|00005010| 7b 0a 20 20 72 65 67 20 | 63 3b 0a 20 20 72 65 67 |{. reg |c;. reg|
|00005020| 20 6c 6f 6e 67 20 69 6e | 74 20 6e 3b 0a 0a 20 20 | long in|t n;.. |
|00005030| 69 66 20 28 61 72 67 63 | 20 21 3d 20 31 29 20 7b |if (argc| != 1) {|
|00005040| 0a 20 20 20 20 66 70 72 | 69 6e 74 66 28 73 74 64 |. fpr|intf(std|
|00005050| 65 72 72 2c 22 62 61 64 | 20 61 72 67 73 20 74 6f |err,"bad| args to|
|00005060| 20 25 73 5c 6e 22 2c 20 | 61 72 67 76 5b 30 5d 29 | %s\n", |argv[0])|
|00005070| 3b 0a 20 20 20 20 65 78 | 69 74 28 32 29 3b 0a 20 |;. ex|it(2);. |
|00005080| 20 7d 0a 20 20 70 72 69 | 6e 74 66 28 22 78 62 74 | }. pri|ntf("xbt|
|00005090| 6f 61 20 42 65 67 69 6e | 5c 6e 22 29 3b 0a 20 20 |oa Begin|\n");. |
|000050a0| 6e 20 3d 20 30 3b 0a 20 | 20 77 68 69 6c 65 20 28 |n = 0;. | while (|
|000050b0| 28 63 20 3d 20 67 65 74 | 63 68 61 72 28 29 29 20 |(c = get|char()) |
|000050c0| 21 3d 20 45 4f 46 29 20 | 7b 0a 20 20 20 20 65 6e |!= EOF) |{. en|
|000050d0| 63 6f 64 65 28 63 29 3b | 0a 20 20 20 20 6e 20 2b |code(c);|. n +|
|000050e0| 3d 20 31 3b 0a 20 20 7d | 0a 20 20 77 68 69 6c 65 |= 1;. }|. while|
|000050f0| 20 28 62 63 6f 75 6e 74 | 20 21 3d 20 30 29 20 7b | (bcount| != 0) {|
|00005100| 0a 20 20 20 20 65 6e 63 | 6f 64 65 28 30 29 3b 0a |. enc|ode(0);.|
|00005110| 20 20 7d 0a 20 20 2f 2a | 20 6e 20 69 73 20 77 72 | }. /*| n is wr|
|00005120| 69 74 74 65 6e 20 74 77 | 69 63 65 20 61 73 20 63 |itten tw|ice as c|
|00005130| 72 75 64 65 20 63 72 6f | 73 73 20 63 68 65 63 6b |rude cro|ss check|
|00005140| 2a 2f 0a 20 20 70 72 69 | 6e 74 66 28 22 5c 6e 78 |*/. pri|ntf("\nx|
|00005150| 62 74 6f 61 20 45 6e 64 | 20 4e 20 25 6c 64 20 25 |btoa End| N %ld %|
|00005160| 6c 78 20 45 20 25 6c 78 | 20 53 20 25 6c 78 20 52 |lx E %lx| S %lx R|
|00005170| 20 25 6c 78 5c 6e 22 2c | 20 6e 2c 20 6e 2c 20 43 | %lx\n",| n, n, C|
|00005180| 65 6f 72 2c 20 43 73 75 | 6d 2c 20 43 72 6f 74 29 |eor, Csu|m, Crot)|
|00005190| 3b 0a 20 20 65 78 69 74 | 28 30 29 3b 0a 7d 0a 53 |;. exit|(0);.}.S|
|000051a0| 48 41 52 5f 45 4f 46 0a | 69 66 20 74 65 73 74 20 |HAR_EOF.|if test |
|000051b0| 32 33 33 33 20 2d 6e 65 | 20 22 60 77 63 20 2d 63 |2333 -ne| "`wc -c|
|000051c0| 20 3c 20 27 62 74 6f 61 | 2e 63 27 60 22 0a 74 68 | < 'btoa|.c'`".th|
|000051d0| 65 6e 0a 09 65 63 68 6f | 20 73 68 61 72 3a 20 65 |en..echo| shar: e|
|000051e0| 72 72 6f 72 20 74 72 61 | 6e 73 6d 69 74 74 69 6e |rror tra|nsmittin|
|000051f0| 67 20 22 27 62 74 6f 61 | 2e 63 27 22 20 27 28 73 |g "'btoa|.c'" '(s|
|00005200| 68 6f 75 6c 64 20 68 61 | 76 65 20 62 65 65 6e 20 |hould ha|ve been |
|00005210| 32 33 33 33 20 63 68 61 | 72 61 63 74 65 72 73 29 |2333 cha|racters)|
|00005220| 27 0a 66 69 0a 66 69 20 | 23 20 65 6e 64 20 6f 66 |'.fi.fi |# end of|
|00005230| 20 6f 76 65 72 77 72 69 | 74 69 6e 67 20 63 68 65 | overwri|ting che|
|00005240| 63 6b 0a 65 63 68 6f 20 | 73 68 61 72 3a 20 65 78 |ck.echo |shar: ex|
|00005250| 74 72 61 63 74 69 6e 67 | 20 22 27 63 6f 6d 70 72 |tracting| "'compr|
|00005260| 65 73 73 64 69 72 27 22 | 20 27 28 33 30 32 20 63 |essdir'"| '(302 c|
|00005270| 68 61 72 61 63 74 65 72 | 73 29 27 0a 69 66 20 74 |haracter|s)'.if t|
|00005280| 65 73 74 20 2d 66 20 27 | 63 6f 6d 70 72 65 73 73 |est -f '|compress|
|00005290| 64 69 72 27 0a 74 68 65 | 6e 0a 09 65 63 68 6f 20 |dir'.the|n..echo |
|000052a0| 73 68 61 72 3a 20 77 69 | 6c 6c 20 6e 6f 74 20 6f |shar: wi|ll not o|
|000052b0| 76 65 72 2d 77 72 69 74 | 65 20 65 78 69 73 74 69 |ver-writ|e existi|
|000052c0| 6e 67 20 66 69 6c 65 20 | 22 27 63 6f 6d 70 72 65 |ng file |"'compre|
|000052d0| 73 73 64 69 72 27 22 0a | 65 6c 73 65 0a 73 65 64 |ssdir'".|else.sed|
|000052e0| 20 27 73 2f 5e 58 2f 2f | 27 20 3c 3c 20 5c 53 48 | 's/^X//|' << \SH|
|000052f0| 41 52 5f 45 4f 46 20 3e | 20 27 63 6f 6d 70 72 65 |AR_EOF >| 'compre|
|00005300| 73 73 64 69 72 27 0a 4f | 50 54 49 4f 4e 53 3d 0a |ssdir'.O|PTIONS=.|
|00005310| 58 46 49 4c 45 53 3d 0a | 66 6f 72 20 41 52 47 0a |XFILES=.|for ARG.|
|00005320| 64 6f 0a 09 63 61 73 65 | 20 22 24 41 52 47 22 20 |do..case| "$ARG" |
|00005330| 69 6e 0a 09 2d 2a 29 09 | 4f 50 54 49 4f 4e 53 3d |in..-*).|OPTIONS=|
|00005340| 22 24 4f 50 54 49 4f 4e | 53 20 24 41 52 47 22 3b |"$OPTION|S $ARG";|
|00005350| 3b 0a 09 2a 29 09 46 49 | 4c 45 53 3d 22 24 46 49 |;..*).FI|LES="$FI|
|00005360| 4c 45 53 20 24 41 52 47 | 22 3b 3b 0a 09 65 73 61 |LES $ARG|";;..esa|
|00005370| 63 0a 64 6f 6e 65 0a 69 | 66 20 74 65 73 74 20 2d |c.done.i|f test -|
|00005380| 7a 20 22 24 46 49 4c 45 | 53 22 3b 20 74 68 65 6e |z "$FILE|S"; then|
|00005390| 0a 09 46 49 4c 45 53 3d | 22 2e 22 0a 66 69 0a 73 |..FILES=|".".fi.s|
|000053a0| 65 74 20 24 46 49 4c 45 | 53 0a 66 69 6e 64 20 24 |et $FILE|S.find $|
|000053b0| 40 20 2d 74 79 70 65 20 | 66 20 2d 6c 69 6e 6b 73 |@ -type |f -links|
|000053c0| 20 31 20 2d 65 78 65 63 | 20 74 65 73 74 20 2d 72 | 1 -exec| test -r|
|000053d0| 20 7b 7d 20 2d 61 20 2d | 73 20 7b 7d 20 5c 3b 20 | {} -a -|s {} \; |
|000053e0| 5c 0a 2d 65 78 65 63 20 | 65 78 70 72 20 27 28 27 |\.-exec |expr '('|
|000053f0| 20 7b 7d 20 3a 20 27 2e | 2a 5c 2e 5a 27 20 27 29 | {} : '.|*\.Z' ')|
|00005400| 27 20 27 3d 27 20 30 20 | 5c 3b 20 5c 0a 2d 65 78 |' '=' 0 |\; \.-ex|
|00005410| 65 63 20 63 6f 6d 70 72 | 65 73 73 20 24 4f 50 54 |ec compr|ess $OPT|
|00005420| 49 4f 4e 53 20 7b 7d 20 | 5c 3b 20 3e 2f 64 65 76 |IONS {} |\; >/dev|
|00005430| 2f 6e 75 6c 6c 0a 53 48 | 41 52 5f 45 4f 46 0a 69 |/null.SH|AR_EOF.i|
|00005440| 66 20 74 65 73 74 20 33 | 30 32 20 2d 6e 65 20 22 |f test 3|02 -ne "|
|00005450| 60 77 63 20 2d 63 20 3c | 20 27 63 6f 6d 70 72 65 |`wc -c <| 'compre|
|00005460| 73 73 64 69 72 27 60 22 | 0a 74 68 65 6e 0a 09 65 |ssdir'`"|.then..e|
|00005470| 63 68 6f 20 73 68 61 72 | 3a 20 65 72 72 6f 72 20 |cho shar|: error |
|00005480| 74 72 61 6e 73 6d 69 74 | 74 69 6e 67 20 22 27 63 |transmit|ting "'c|
|00005490| 6f 6d 70 72 65 73 73 64 | 69 72 27 22 20 27 28 73 |ompressd|ir'" '(s|
|000054a0| 68 6f 75 6c 64 20 68 61 | 76 65 20 62 65 65 6e 20 |hould ha|ve been |
|000054b0| 33 30 32 20 63 68 61 72 | 61 63 74 65 72 73 29 27 |302 char|acters)'|
|000054c0| 0a 66 69 0a 63 68 6d 6f | 64 20 2b 78 20 27 63 6f |.fi.chmo|d +x 'co|
|000054d0| 6d 70 72 65 73 73 64 69 | 72 27 0a 66 69 20 23 20 |mpressdi|r'.fi # |
|000054e0| 65 6e 64 20 6f 66 20 6f | 76 65 72 77 72 69 74 69 |end of o|verwriti|
|000054f0| 6e 67 20 63 68 65 63 6b | 0a 65 63 68 6f 20 73 68 |ng check|.echo sh|
|00005500| 61 72 3a 20 65 78 74 72 | 61 63 74 69 6e 67 20 22 |ar: extr|acting "|
|00005510| 27 63 6f 6d 70 72 65 73 | 73 64 69 72 2e 31 27 22 |'compres|sdir.1'"|
|00005520| 20 27 28 37 33 36 20 63 | 68 61 72 61 63 74 65 72 | '(736 c|haracter|
|00005530| 73 29 27 0a 69 66 20 74 | 65 73 74 20 2d 66 20 27 |s)'.if t|est -f '|
|00005540| 63 6f 6d 70 72 65 73 73 | 64 69 72 2e 31 27 0a 74 |compress|dir.1'.t|
|00005550| 68 65 6e 0a 09 65 63 68 | 6f 20 73 68 61 72 3a 20 |hen..ech|o shar: |
|00005560| 77 69 6c 6c 20 6e 6f 74 | 20 6f 76 65 72 2d 77 72 |will not| over-wr|
|00005570| 69 74 65 20 65 78 69 73 | 74 69 6e 67 20 66 69 6c |ite exis|ting fil|
|00005580| 65 20 22 27 63 6f 6d 70 | 72 65 73 73 64 69 72 2e |e "'comp|ressdir.|
|00005590| 31 27 22 0a 65 6c 73 65 | 0a 73 65 64 20 27 73 2f |1'".else|.sed 's/|
|000055a0| 5e 58 2f 2f 27 20 3c 3c | 20 5c 53 48 41 52 5f 45 |^X//' <<| \SHAR_E|
|000055b0| 4f 46 20 3e 20 27 63 6f | 6d 70 72 65 73 73 64 69 |OF > 'co|mpressdi|
|000055c0| 72 2e 31 27 0a 58 2e 50 | 55 0a 58 2e 54 48 20 43 |r.1'.X.P|U.X.TH C|
|000055d0| 4f 4d 50 52 45 53 53 44 | 49 52 20 31 20 6c 6f 63 |OMPRESSD|IR 1 loc|
|000055e0| 61 6c 0a 58 2e 53 48 20 | 4e 41 4d 45 0a 63 6f 6d |al.X.SH |NAME.com|
|000055f0| 70 72 65 73 73 64 69 72 | 2c 20 75 6e 63 6f 6d 70 |pressdir|, uncomp|
|00005600| 72 65 73 73 64 69 72 20 | 5c 2d 20 20 63 6f 6d 70 |ressdir |\- comp|
|00005610| 72 65 73 73 20 61 6e 64 | 20 75 6e 63 6f 6d 70 72 |ress and| uncompr|
|00005620| 65 73 73 20 64 69 72 65 | 63 74 6f 72 69 65 73 20 |ess dire|ctories |
|00005630| 6f 66 20 66 69 6c 65 73 | 0a 58 2e 53 48 20 53 59 |of files|.X.SH SY|
|00005640| 4e 4f 50 53 49 53 0a 58 | 2e 6c 6c 20 2b 38 0a 58 |NOPSIS.X|.ll +8.X|
|00005650| 2e 42 20 63 6f 6d 70 72 | 65 73 73 64 69 72 0a 5b |.B compr|essdir.[|
|00005660| 20 66 6c 61 67 73 20 5d | 20 5b 0a 58 2e 49 20 22 | flags ]| [.X.I "|
|00005670| 64 69 72 65 63 74 6f 72 | 79 20 5c 26 2e 2e 2e 22 |director|y \&..."|
|00005680| 0a 5d 0a 58 2e 6c 6c 20 | 2d 38 0a 58 2e 62 72 0a |.].X.ll |-8.X.br.|
|00005690| 58 2e 42 20 75 6e 63 6f | 6d 70 72 65 73 73 64 69 |X.B unco|mpressdi|
|000056a0| 72 0a 5b 20 66 6c 61 67 | 73 20 5d 20 5b 0a 58 2e |r.[ flag|s ] [.X.|
|000056b0| 49 20 22 64 69 72 65 63 | 74 6f 72 79 20 5c 26 2e |I "direc|tory \&.|
|000056c0| 2e 2e 22 0a 5d 0a 58 2e | 53 48 20 44 45 53 43 52 |..".].X.|SH DESCR|
|000056d0| 49 50 54 49 4f 4e 0a 52 | 65 63 75 72 73 69 76 65 |IPTION.R|ecursive|
|000056e0| 6c 79 20 64 65 63 65 6e | 64 73 20 65 61 63 68 20 |ly decen|ds each |
|000056f0| 73 70 65 63 69 66 69 65 | 64 20 64 69 72 65 63 74 |specifie|d direct|
|00005700| 6f 72 79 20 61 6e 64 20 | 63 6f 6d 70 72 65 73 73 |ory and |compress|
|00005710| 65 73 20 65 61 63 68 0a | 66 69 6c 65 2e 0a 45 61 |es each.|file..Ea|
|00005720| 63 68 20 66 69 6c 65 20 | 69 73 20 72 65 70 6c 61 |ch file |is repla|
|00005730| 63 65 64 20 62 79 20 61 | 20 66 69 6c 65 20 77 69 |ced by a| file wi|
|00005740| 74 68 20 74 68 65 20 65 | 78 74 65 6e 73 69 6f 6e |th the e|xtension|
|00005750| 0a 58 2e 42 20 22 5c 26 | 2e 5a 2c 22 0a 62 75 74 |.X.B "\&|.Z,".but|
|00005760| 20 6f 6e 6c 79 20 69 66 | 20 74 68 65 20 66 69 6c | only if| the fil|
|00005770| 65 20 67 6f 74 20 73 6d | 61 6c 6c 65 72 2e 0a 49 |e got sm|aller..I|
|00005780| 66 20 6e 6f 20 64 69 72 | 65 63 74 6f 72 69 65 73 |f no dir|ectories|
|00005790| 20 61 72 65 20 73 70 65 | 63 69 66 69 65 64 2c 0a | are spe|cified,.|
|000057a0| 74 68 65 20 63 6f 6d 70 | 72 65 73 73 69 6f 6e 20 |the comp|ression |
|000057b0| 69 73 20 61 70 70 6c 69 | 65 64 20 74 6f 20 61 6c |is appli|ed to al|
|000057c0| 6c 20 66 69 6c 65 73 20 | 73 74 61 72 74 69 6e 67 |l files |starting|
|000057d0| 20 77 69 74 68 20 74 68 | 65 20 63 75 72 72 65 6e | with th|e curren|
|000057e0| 74 20 64 69 72 65 63 74 | 6f 72 79 2e 0a 43 6f 6d |t direct|ory..Com|
|000057f0| 70 72 65 73 73 65 64 20 | 66 69 6c 65 73 20 63 61 |pressed |files ca|
|00005800| 6e 20 62 65 20 72 65 73 | 74 6f 72 65 64 20 74 6f |n be res|tored to|
|00005810| 20 74 68 65 69 72 20 6f | 72 69 67 69 6e 61 6c 20 | their o|riginal |
|00005820| 66 6f 72 6d 20 62 79 20 | 72 75 6e 6e 69 6e 67 0a |form by |running.|
|00005830| 58 2e 49 20 75 6e 63 6f | 6d 70 72 65 73 73 64 69 |X.I unco|mpressdi|
|00005840| 72 0a 6f 6e 20 74 68 65 | 20 64 69 72 65 63 74 6f |r.on the| directo|
|00005850| 72 69 65 73 2e 0a 58 2e | 50 50 0a 54 68 65 0a 58 |ries..X.|PP.The.X|
|00005860| 2e 49 20 66 6c 61 67 73 | 0a 73 70 65 63 69 66 69 |.I flags|.specifi|
|00005870| 65 64 20 61 72 65 20 70 | 61 73 73 65 64 20 74 6f |ed are p|assed to|
|00005880| 20 74 68 65 20 63 6f 6d | 70 72 65 73 73 28 31 29 | the com|press(1)|
|00005890| 20 70 72 6f 67 72 61 6d | 2e 0a 58 2e 53 48 20 22 | program|..X.SH "|
|000058a0| 53 45 45 20 41 4c 53 4f | 22 0a 63 6f 6d 70 72 65 |SEE ALSO|".compre|
|000058b0| 73 73 28 31 29 0a 53 48 | 41 52 5f 45 4f 46 0a 69 |ss(1).SH|AR_EOF.i|
|000058c0| 66 20 74 65 73 74 20 37 | 33 36 20 2d 6e 65 20 22 |f test 7|36 -ne "|
|000058d0| 60 77 63 20 2d 63 20 3c | 20 27 63 6f 6d 70 72 65 |`wc -c <| 'compre|
|000058e0| 73 73 64 69 72 2e 31 27 | 60 22 0a 74 68 65 6e 0a |ssdir.1'|`".then.|
|000058f0| 09 65 63 68 6f 20 73 68 | 61 72 3a 20 65 72 72 6f |.echo sh|ar: erro|
|00005900| 72 20 74 72 61 6e 73 6d | 69 74 74 69 6e 67 20 22 |r transm|itting "|
|00005910| 27 63 6f 6d 70 72 65 73 | 73 64 69 72 2e 31 27 22 |'compres|sdir.1'"|
|00005920| 20 27 28 73 68 6f 75 6c | 64 20 68 61 76 65 20 62 | '(shoul|d have b|
|00005930| 65 65 6e 20 37 33 36 20 | 63 68 61 72 61 63 74 65 |een 736 |characte|
|00005940| 72 73 29 27 0a 66 69 0a | 66 69 20 23 20 65 6e 64 |rs)'.fi.|fi # end|
|00005950| 20 6f 66 20 6f 76 65 72 | 77 72 69 74 69 6e 67 20 | of over|writing |
|00005960| 63 68 65 63 6b 0a 65 63 | 68 6f 20 73 68 61 72 3a |check.ec|ho shar:|
|00005970| 20 65 78 74 72 61 63 74 | 69 6e 67 20 22 27 74 61 | extract|ing "'ta|
|00005980| 72 6d 61 69 6c 27 22 20 | 27 28 33 30 33 20 63 68 |rmail'" |'(303 ch|
|00005990| 61 72 61 63 74 65 72 73 | 29 27 0a 69 66 20 74 65 |aracters|)'.if te|
|000059a0| 73 74 20 2d 66 20 27 74 | 61 72 6d 61 69 6c 27 0a |st -f 't|armail'.|
|000059b0| 74 68 65 6e 0a 09 65 63 | 68 6f 20 73 68 61 72 3a |then..ec|ho shar:|
|000059c0| 20 77 69 6c 6c 20 6e 6f | 74 20 6f 76 65 72 2d 77 | will no|t over-w|
|000059d0| 72 69 74 65 20 65 78 69 | 73 74 69 6e 67 20 66 69 |rite exi|sting fi|
|000059e0| 6c 65 20 22 27 74 61 72 | 6d 61 69 6c 27 22 0a 65 |le "'tar|mail'".e|
|000059f0| 6c 73 65 0a 73 65 64 20 | 27 73 2f 5e 58 2f 2f 27 |lse.sed |'s/^X//'|
|00005a00| 20 3c 3c 20 5c 53 48 41 | 52 5f 45 4f 46 20 3e 20 | << \SHA|R_EOF > |
|00005a10| 27 74 61 72 6d 61 69 6c | 27 0a 69 66 20 74 65 73 |'tarmail|'.if tes|
|00005a20| 74 20 24 23 20 2d 6c 74 | 20 33 3b 20 74 68 65 6e |t $# -lt| 3; then|
|00005a30| 0a 20 20 65 63 68 6f 20 | 22 55 73 61 67 65 3a 20 |. echo |"Usage: |
|00005a40| 74 61 72 6d 61 69 6c 20 | 6d 61 69 6c 70 61 74 68 |tarmail |mailpath|
|00005a50| 20 5c 22 73 75 62 6a 65 | 63 74 2d 73 74 72 69 6e | \"subje|ct-strin|
|00005a60| 67 5c 22 20 64 69 72 65 | 63 74 6f 72 79 2d 6f 72 |g\" dire|ctory-or|
|00005a70| 2d 66 69 6c 65 28 73 29 | 22 0a 20 20 65 78 69 74 |-file(s)|". exit|
|00005a80| 0a 65 6c 73 65 0a 20 20 | 6d 61 69 6c 70 61 74 68 |.else. |mailpath|
|00005a90| 3d 24 31 0a 20 20 65 63 | 68 6f 20 22 6d 61 69 6c |=$1. ec|ho "mail|
|00005aa0| 70 61 74 68 20 3d 20 24 | 6d 61 69 6c 70 61 74 68 |path = $|mailpath|
|00005ab0| 22 0a 20 20 73 68 69 66 | 74 0a 20 20 73 75 62 6a |". shif|t. subj|
|00005ac0| 65 63 74 3d 22 24 31 22 | 0a 20 20 65 63 68 6f 20 |ect="$1"|. echo |
|00005ad0| 22 73 75 62 6a 65 63 74 | 2d 73 74 72 69 6e 67 20 |"subject|-string |
|00005ae0| 3d 20 24 73 75 62 6a 65 | 63 74 22 0a 20 20 73 68 |= $subje|ct". sh|
|00005af0| 69 66 74 0a 20 20 65 63 | 68 6f 20 66 69 6c 65 73 |ift. ec|ho files|
|00005b00| 20 3d 20 24 2a 0a 20 20 | 74 61 72 20 63 76 66 20 | = $*. |tar cvf |
|00005b10| 2d 20 24 2a 20 7c 20 63 | 6f 6d 70 72 65 73 73 20 |- $* | c|ompress |
|00005b20| 7c 20 62 74 6f 61 20 7c | 20 6d 61 69 6c 20 2d 73 || btoa || mail -s|
|00005b30| 20 22 24 73 75 62 6a 65 | 63 74 22 20 24 6d 61 69 | "$subje|ct" $mai|
|00005b40| 6c 70 61 74 68 0a 66 69 | 0a 53 48 41 52 5f 45 4f |lpath.fi|.SHAR_EO|
|00005b50| 46 0a 69 66 20 74 65 73 | 74 20 33 30 33 20 2d 6e |F.if tes|t 303 -n|
|00005b60| 65 20 22 60 77 63 20 2d | 63 20 3c 20 27 74 61 72 |e "`wc -|c < 'tar|
|00005b70| 6d 61 69 6c 27 60 22 0a | 74 68 65 6e 0a 09 65 63 |mail'`".|then..ec|
|00005b80| 68 6f 20 73 68 61 72 3a | 20 65 72 72 6f 72 20 74 |ho shar:| error t|
|00005b90| 72 61 6e 73 6d 69 74 74 | 69 6e 67 20 22 27 74 61 |ransmitt|ing "'ta|
|00005ba0| 72 6d 61 69 6c 27 22 20 | 27 28 73 68 6f 75 6c 64 |rmail'" |'(should|
|00005bb0| 20 68 61 76 65 20 62 65 | 65 6e 20 33 30 33 20 63 | have be|en 303 c|
|00005bc0| 68 61 72 61 63 74 65 72 | 73 29 27 0a 66 69 0a 63 |haracter|s)'.fi.c|
|00005bd0| 68 6d 6f 64 20 2b 78 20 | 27 74 61 72 6d 61 69 6c |hmod +x |'tarmail|
|00005be0| 27 0a 66 69 20 23 20 65 | 6e 64 20 6f 66 20 6f 76 |'.fi # e|nd of ov|
|00005bf0| 65 72 77 72 69 74 69 6e | 67 20 63 68 65 63 6b 0a |erwritin|g check.|
|00005c00| 65 63 68 6f 20 73 68 61 | 72 3a 20 65 78 74 72 61 |echo sha|r: extra|
|00005c10| 63 74 69 6e 67 20 22 27 | 75 6e 63 6f 6d 70 72 65 |cting "'|uncompre|
|00005c20| 73 73 64 69 72 27 22 20 | 27 28 32 39 30 20 63 68 |ssdir'" |'(290 ch|
|00005c30| 61 72 61 63 74 65 72 73 | 29 27 0a 69 66 20 74 65 |aracters|)'.if te|
|00005c40| 73 74 20 2d 66 20 27 75 | 6e 63 6f 6d 70 72 65 73 |st -f 'u|ncompres|
|00005c50| 73 64 69 72 27 0a 74 68 | 65 6e 0a 09 65 63 68 6f |sdir'.th|en..echo|
|00005c60| 20 73 68 61 72 3a 20 77 | 69 6c 6c 20 6e 6f 74 20 | shar: w|ill not |
|00005c70| 6f 76 65 72 2d 77 72 69 | 74 65 20 65 78 69 73 74 |over-wri|te exist|
|00005c80| 69 6e 67 20 66 69 6c 65 | 20 22 27 75 6e 63 6f 6d |ing file| "'uncom|
|00005c90| 70 72 65 73 73 64 69 72 | 27 22 0a 65 6c 73 65 0a |pressdir|'".else.|
|00005ca0| 73 65 64 20 27 73 2f 5e | 58 2f 2f 27 20 3c 3c 20 |sed 's/^|X//' << |
|00005cb0| 5c 53 48 41 52 5f 45 4f | 46 20 3e 20 27 75 6e 63 |\SHAR_EO|F > 'unc|
|00005cc0| 6f 6d 70 72 65 73 73 64 | 69 72 27 0a 4f 50 54 49 |ompressd|ir'.OPTI|
|00005cd0| 4f 4e 53 3d 0a 58 46 49 | 4c 45 53 3d 0a 66 6f 72 |ONS=.XFI|LES=.for|
|00005ce0| 20 41 52 47 0a 64 6f 0a | 09 63 61 73 65 20 22 24 | ARG.do.|.case "$|
|00005cf0| 41 52 47 22 20 69 6e 0a | 09 2d 2a 29 09 4f 50 54 |ARG" in.|.-*).OPT|
|00005d00| 49 4f 4e 53 3d 22 24 4f | 50 54 49 4f 4e 53 20 24 |IONS="$O|PTIONS $|
|00005d10| 41 52 47 22 3b 3b 0a 09 | 2a 29 09 46 49 4c 45 53 |ARG";;..|*).FILES|
|00005d20| 3d 22 24 46 49 4c 45 53 | 20 24 41 52 47 22 3b 3b |="$FILES| $ARG";;|
|00005d30| 0a 09 65 73 61 63 0a 64 | 6f 6e 65 0a 69 66 20 74 |..esac.d|one.if t|
|00005d40| 65 73 74 20 2d 7a 20 22 | 24 46 49 4c 45 53 22 3b |est -z "|$FILES";|
|00005d50| 20 74 68 65 6e 0a 09 46 | 49 4c 45 53 3d 22 2e 22 | then..F|ILES="."|
|00005d60| 0a 66 69 0a 73 65 74 20 | 24 46 49 4c 45 53 0a 66 |.fi.set |$FILES.f|
|00005d70| 69 6e 64 20 24 40 20 2d | 74 79 70 65 20 66 20 2d |ind $@ -|type f -|
|00005d80| 6c 69 6e 6b 73 20 31 20 | 2d 65 78 65 63 20 74 65 |links 1 |-exec te|
|00005d90| 73 74 20 2d 72 20 7b 7d | 20 2d 61 20 2d 73 20 7b |st -r {}| -a -s {|
|00005da0| 7d 20 5c 3b 20 5c 0a 2d | 65 78 65 63 20 65 78 70 |} \; \.-|exec exp|
|00005db0| 72 20 7b 7d 20 3a 20 27 | 2e 2a 5c 2e 5a 27 20 5c |r {} : '|.*\.Z' \|
|00005dc0| 3b 20 5c 0a 2d 65 78 65 | 63 20 75 6e 63 6f 6d 70 |; \.-exe|c uncomp|
|00005dd0| 72 65 73 73 20 24 4f 50 | 54 49 4f 4e 53 20 7b 7d |ress $OP|TIONS {}|
|00005de0| 20 5c 3b 20 3e 2f 64 65 | 76 2f 6e 75 6c 6c 0a 53 | \; >/de|v/null.S|
|00005df0| 48 41 52 5f 45 4f 46 0a | 69 66 20 74 65 73 74 20 |HAR_EOF.|if test |
|00005e00| 32 39 30 20 2d 6e 65 20 | 22 60 77 63 20 2d 63 20 |290 -ne |"`wc -c |
|00005e10| 3c 20 27 75 6e 63 6f 6d | 70 72 65 73 73 64 69 72 |< 'uncom|pressdir|
|00005e20| 27 60 22 0a 74 68 65 6e | 0a 09 65 63 68 6f 20 73 |'`".then|..echo s|
|00005e30| 68 61 72 3a 20 65 72 72 | 6f 72 20 74 72 61 6e 73 |har: err|or trans|
|00005e40| 6d 69 74 74 69 6e 67 20 | 22 27 75 6e 63 6f 6d 70 |mitting |"'uncomp|
|00005e50| 72 65 73 73 64 69 72 27 | 22 20 27 28 73 68 6f 75 |ressdir'|" '(shou|
|00005e60| 6c 64 20 68 61 76 65 20 | 62 65 65 6e 20 32 39 30 |ld have |been 290|
|00005e70| 20 63 68 61 72 61 63 74 | 65 72 73 29 27 0a 66 69 | charact|ers)'.fi|
|00005e80| 0a 63 68 6d 6f 64 20 2b | 78 20 27 75 6e 63 6f 6d |.chmod +|x 'uncom|
|00005e90| 70 72 65 73 73 64 69 72 | 27 0a 66 69 20 23 20 65 |pressdir|'.fi # e|
|00005ea0| 6e 64 20 6f 66 20 6f 76 | 65 72 77 72 69 74 69 6e |nd of ov|erwritin|
|00005eb0| 67 20 63 68 65 63 6b 0a | 65 63 68 6f 20 73 68 61 |g check.|echo sha|
|00005ec0| 72 3a 20 65 78 74 72 61 | 63 74 69 6e 67 20 22 27 |r: extra|cting "'|
|00005ed0| 75 6e 74 61 72 6d 61 69 | 6c 27 22 20 27 28 31 37 |untarmai|l'" '(17|
|00005ee0| 34 20 63 68 61 72 61 63 | 74 65 72 73 29 27 0a 69 |4 charac|ters)'.i|
|00005ef0| 66 20 74 65 73 74 20 2d | 66 20 27 75 6e 74 61 72 |f test -|f 'untar|
|00005f00| 6d 61 69 6c 27 0a 74 68 | 65 6e 0a 09 65 63 68 6f |mail'.th|en..echo|
|00005f10| 20 73 68 61 72 3a 20 77 | 69 6c 6c 20 6e 6f 74 20 | shar: w|ill not |
|00005f20| 6f 76 65 72 2d 77 72 69 | 74 65 20 65 78 69 73 74 |over-wri|te exist|
|00005f30| 69 6e 67 20 66 69 6c 65 | 20 22 27 75 6e 74 61 72 |ing file| "'untar|
|00005f40| 6d 61 69 6c 27 22 0a 65 | 6c 73 65 0a 73 65 64 20 |mail'".e|lse.sed |
|00005f50| 27 73 2f 5e 58 2f 2f 27 | 20 3c 3c 20 5c 53 48 41 |'s/^X//'| << \SHA|
|00005f60| 52 5f 45 4f 46 20 3e 20 | 27 75 6e 74 61 72 6d 61 |R_EOF > |'untarma|
|00005f70| 69 6c 27 0a 69 66 20 74 | 65 73 74 20 24 23 20 2d |il'.if t|est $# -|
|00005f80| 67 65 20 31 3b 20 74 68 | 65 6e 0a 20 20 20 61 74 |ge 1; th|en. at|
|00005f90| 6f 62 20 3c 20 24 31 20 | 7c 20 75 6e 63 6f 6d 70 |ob < $1 || uncomp|
|00005fa0| 72 65 73 73 20 7c 20 74 | 61 72 20 78 76 70 66 20 |ress | t|ar xvpf |
|00005fb0| 2d 0a 20 20 20 6d 76 20 | 24 31 20 2f 75 73 72 2f |-. mv |$1 /usr/|
|00005fc0| 74 6d 70 2f 24 31 2e 24 | 24 0a 20 20 20 65 63 68 |tmp/$1.$|$. ech|
|00005fd0| 6f 20 74 61 72 6d 61 69 | 6c 20 66 69 6c 65 20 6d |o tarmai|l file m|
|00005fe0| 6f 76 65 64 20 74 6f 3a | 20 2f 75 73 72 2f 74 6d |oved to:| /usr/tm|
|00005ff0| 70 2f 24 31 2e 24 24 0a | 65 6c 73 65 0a 20 20 20 |p/$1.$$.|else. |
|00006000| 61 74 6f 62 20 7c 20 75 | 6e 63 6f 6d 70 72 65 73 |atob | u|ncompres|
|00006010| 73 20 7c 20 74 61 72 20 | 78 76 70 66 20 2d 0a 66 |s | tar |xvpf -.f|
|00006020| 69 0a 53 48 41 52 5f 45 | 4f 46 0a 69 66 20 74 65 |i.SHAR_E|OF.if te|
|00006030| 73 74 20 31 37 34 20 2d | 6e 65 20 22 60 77 63 20 |st 174 -|ne "`wc |
|00006040| 2d 63 20 3c 20 27 75 6e | 74 61 72 6d 61 69 6c 27 |-c < 'un|tarmail'|
|00006050| 60 22 0a 74 68 65 6e 0a | 09 65 63 68 6f 20 73 68 |`".then.|.echo sh|
|00006060| 61 72 3a 20 65 72 72 6f | 72 20 74 72 61 6e 73 6d |ar: erro|r transm|
|00006070| 69 74 74 69 6e 67 20 22 | 27 75 6e 74 61 72 6d 61 |itting "|'untarma|
|00006080| 69 6c 27 22 20 27 28 73 | 68 6f 75 6c 64 20 68 61 |il'" '(s|hould ha|
|00006090| 76 65 20 62 65 65 6e 20 | 31 37 34 20 63 68 61 72 |ve been |174 char|
|000060a0| 61 63 74 65 72 73 29 27 | 0a 66 69 0a 63 68 6d 6f |acters)'|.fi.chmo|
|000060b0| 64 20 2b 78 20 27 75 6e | 74 61 72 6d 61 69 6c 27 |d +x 'un|tarmail'|
|000060c0| 0a 66 69 20 23 20 65 6e | 64 20 6f 66 20 6f 76 65 |.fi # en|d of ove|
|000060d0| 72 77 72 69 74 69 6e 67 | 20 63 68 65 63 6b 0a 65 |rwriting| check.e|
|000060e0| 63 68 6f 20 73 68 61 72 | 3a 20 65 78 74 72 61 63 |cho shar|: extrac|
|000060f0| 74 69 6e 67 20 22 27 7a | 63 6d 70 27 22 20 27 28 |ting "'z|cmp'" '(|
|00006100| 37 36 30 20 63 68 61 72 | 61 63 74 65 72 73 29 27 |760 char|acters)'|
|00006110| 0a 69 66 20 74 65 73 74 | 20 2d 66 20 27 7a 63 6d |.if test| -f 'zcm|
|00006120| 70 27 0a 74 68 65 6e 0a | 09 65 63 68 6f 20 73 68 |p'.then.|.echo sh|
|00006130| 61 72 3a 20 77 69 6c 6c | 20 6e 6f 74 20 6f 76 65 |ar: will| not ove|
|00006140| 72 2d 77 72 69 74 65 20 | 65 78 69 73 74 69 6e 67 |r-write |existing|
|00006150| 20 66 69 6c 65 20 22 27 | 7a 63 6d 70 27 22 0a 65 | file "'|zcmp'".e|
|00006160| 6c 73 65 0a 73 65 64 20 | 27 73 2f 5e 58 2f 2f 27 |lse.sed |'s/^X//'|
|00006170| 20 3c 3c 20 5c 53 48 41 | 52 5f 45 4f 46 20 3e 20 | << \SHA|R_EOF > |
|00006180| 27 7a 63 6d 70 27 0a 0a | 4f 50 54 49 4f 4e 53 3d |'zcmp'..|OPTIONS=|
|00006190| 0a 58 46 49 4c 45 53 3d | 0a 66 6f 72 20 41 52 47 |.XFILES=|.for ARG|
|000061a0| 0a 64 6f 0a 09 63 61 73 | 65 20 22 24 41 52 47 22 |.do..cas|e "$ARG"|
|000061b0| 20 69 6e 0a 09 2d 2a 29 | 09 4f 50 54 49 4f 4e 53 | in..-*)|.OPTIONS|
|000061c0| 3d 22 24 4f 50 54 49 4f | 4e 53 20 24 41 52 47 22 |="$OPTIO|NS $ARG"|
|000061d0| 3b 3b 0a 09 2a 29 09 46 | 49 4c 45 53 3d 22 24 46 |;;..*).F|ILES="$F|
|000061e0| 49 4c 45 53 20 24 41 52 | 47 22 3b 3b 0a 09 65 73 |ILES $AR|G";;..es|
|000061f0| 61 63 0a 64 6f 6e 65 0a | 69 66 20 74 65 73 74 20 |ac.done.|if test |
|00006200| 2d 7a 20 22 24 46 49 4c | 45 53 22 3b 20 74 68 65 |-z "$FIL|ES"; the|
|00006210| 6e 0a 09 65 63 68 6f 20 | 22 55 73 61 67 65 3a 20 |n..echo |"Usage: |
|00006220| 7a 63 6d 70 20 5b 63 6d | 70 5f 6f 70 74 69 6f 6e |zcmp [cm|p_option|
|00006230| 73 5d 20 66 69 6c 65 20 | 5b 66 69 6c 65 5d 22 0a |s] file |[file]".|
|00006240| 09 65 78 69 74 20 31 0a | 66 69 0a 73 65 74 20 24 |.exit 1.|fi.set $|
|00006250| 46 49 4c 45 53 0a 69 66 | 20 74 65 73 74 20 24 23 |FILES.if| test $#|
|00006260| 20 2d 65 71 20 31 3b 20 | 74 68 65 6e 0a 09 46 49 | -eq 1; |then..FI|
|00006270| 4c 45 3d 60 65 78 70 72 | 20 24 31 20 3a 20 27 5c |LE=`expr| $1 : '\|
|00006280| 28 2e 2a 5c 29 5c 2e 5a | 27 20 27 7c 27 20 24 31 |(.*\)\.Z|' '|' $1|
|00006290| 60 0a 09 7a 63 61 74 20 | 24 46 49 4c 45 20 7c 20 |`..zcat |$FILE | |
|000062a0| 63 6d 70 20 24 4f 50 54 | 49 4f 4e 53 20 2d 20 24 |cmp $OPT|IONS - $|
|000062b0| 46 49 4c 45 0a 09 53 54 | 41 54 3d 22 24 3f 22 0a |FILE..ST|AT="$?".|
|000062c0| 65 6c 69 66 20 74 65 73 | 74 20 24 23 20 2d 65 71 |elif tes|t $# -eq|
|000062d0| 20 32 3b 20 74 68 65 6e | 0a 09 63 61 73 65 20 22 | 2; then|..case "|
|000062e0| 24 31 22 20 69 6e 0a 09 | 2a 2e 5a 29 09 63 61 73 |$1" in..|*.Z).cas|
|000062f0| 65 20 22 24 32 22 20 69 | 6e 0a 09 09 2a 2e 5a 29 |e "$2" i|n...*.Z)|
|00006300| 09 46 3d 60 62 61 73 65 | 6e 61 6d 65 20 24 32 20 |.F=`base|name $2 |
|00006310| 2e 5a 60 0a 09 09 09 7a | 63 61 74 20 24 32 20 3e |.Z`....z|cat $2 >|
|00006320| 20 2f 74 6d 70 2f 24 46 | 2e 24 24 0a 09 09 09 7a | /tmp/$F|.$$....z|
|00006330| 63 61 74 20 24 31 20 7c | 20 63 6d 70 20 24 4f 50 |cat $1 || cmp $OP|
|00006340| 54 49 4f 4e 53 20 2d 20 | 2f 74 6d 70 2f 24 46 2e |TIONS - |/tmp/$F.|
|00006350| 24 24 0a 09 09 09 53 54 | 41 54 3d 22 24 3f 22 3b |$$....ST|AT="$?";|
|00006360| 3b 0a 09 09 2a 29 09 7a | 63 61 74 20 24 31 20 7c |;...*).z|cat $1 ||
|00006370| 20 63 6d 70 20 24 4f 50 | 54 49 4f 4e 53 20 2d 20 | cmp $OP|TIONS - |
|00006380| 24 32 3b 3b 0a 09 09 65 | 73 61 63 3b 3b 0a 09 2a |$2;;...e|sac;;..*|
|00006390| 29 09 63 61 73 65 20 22 | 24 32 22 20 69 6e 0a 09 |).case "|$2" in..|
|000063a0| 09 2a 2e 5a 29 09 46 3d | 60 62 61 73 65 6e 61 6d |.*.Z).F=|`basenam|
|000063b0| 65 20 24 32 20 2e 5a 60 | 0a 09 09 09 7a 63 61 74 |e $2 .Z`|....zcat|
|000063c0| 20 24 32 20 3e 20 2f 74 | 6d 70 2f 24 46 2e 24 24 | $2 > /t|mp/$F.$$|
|000063d0| 0a 09 09 09 63 6d 70 20 | 24 4f 50 54 49 4f 4e 53 |....cmp |$OPTIONS|
|000063e0| 20 24 31 20 2f 74 6d 70 | 2f 24 46 2e 24 24 0a 09 | $1 /tmp|/$F.$$..|
|000063f0| 09 09 53 54 41 54 3d 22 | 24 3f 22 3b 3b 0a 09 09 |..STAT="|$?";;...|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.