home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / unix_c / arcprogs / booz.tar < prev    next >
Tape Archive  |  1989-02-26  |  56.0 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: Tape Archive (archive/tar).

You can browse this item here: booz.tar

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Tape Archive (archive/tar) magic Supported
100% file tar archive default
99% file tar archive (V7), file booz/, mode 755 , uid 243 , gid 12 , size 0 , seconds 4402042261 default
98% file data default
100% TrID Sybase iAnywhere database files default (weak)
100% lsar Tar default
100% gt2 TAR Archiv gefunden (Auflistung ist deaktiviert) default
100% disktype Pre-POSIX tar archive default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 62 6f 6f 7a 2f 00 00 00 | 00 00 00 00 00 00 00 00 |booz/...|........|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000060| 00 00 00 00 20 20 20 37 | 35 35 20 00 20 20 20 32 |.... 7|55 . 2|
|00000070| 34 33 20 00 20 20 20 20 | 31 32 20 00 20 20 20 20 |43 . |12 . |
|00000080| 20 20 20 20 20 20 30 20 | 20 34 34 30 32 30 34 32 | 0 | 4402042|
|00000090| 32 36 31 20 20 20 34 37 | 35 37 00 20 00 00 00 00 |261 47|57. ....|
|000000a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000100| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000110| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000120| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000130| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000140| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000150| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000180| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000200| 62 6f 6f 7a 2f 61 64 64 | 62 66 63 72 63 2e 63 00 |booz/add|bfcrc.c.|
|00000210| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000220| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000230| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000260| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 32 |.... 6|44 . 2|
|00000270| 34 33 20 00 20 20 20 20 | 31 32 20 00 20 20 20 20 |43 . |12 . |
|00000280| 20 20 20 35 35 35 31 20 | 20 34 34 30 32 30 34 32 | 5551 | 4402042|
|00000290| 32 32 33 20 20 20 36 37 | 34 34 00 20 00 00 00 00 |223 67|44. ....|
|000002a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000300| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000310| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000320| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000330| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000340| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000350| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000380| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000390| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000400| 2f 2a 20 61 64 62 66 63 | 72 63 2e 63 20 2a 2f 0a |/* adbfc|rc.c */.|
|00000410| 0a 2f 2a 0a 61 64 64 62 | 66 63 72 63 28 29 20 61 |./*.addb|fcrc() a|
|00000420| 63 63 65 70 74 73 20 61 | 20 62 75 66 66 65 72 20 |ccepts a| buffer |
|00000430| 61 64 64 72 65 73 73 20 | 61 6e 64 20 61 20 63 6f |address |and a co|
|00000440| 75 6e 74 20 61 6e 64 20 | 61 64 64 73 20 74 68 65 |unt and |adds the|
|00000450| 20 43 52 43 20 66 6f 72 | 0a 61 6c 6c 20 62 79 74 | CRC for|.all byt|
|00000460| 65 73 20 69 6e 20 74 68 | 65 20 62 75 66 66 65 72 |es in th|e buffer|
|00000470| 20 74 6f 20 74 68 65 20 | 67 6c 6f 62 61 6c 20 76 | to the |global v|
|00000480| 61 72 69 61 62 6c 65 20 | 63 72 63 63 6f 64 65 20 |ariable |crccode |
|00000490| 75 73 69 6e 67 0a 43 52 | 43 2d 31 36 2e 0a 0a 43 |using.CR|C-16...C|
|000004a0| 52 43 20 63 6f 6d 70 75 | 74 61 74 69 6f 6e 20 61 |RC compu|tation a|
|000004b0| 6c 67 6f 72 69 74 68 6d | 20 74 61 6b 65 6e 20 66 |lgorithm| taken f|
|000004c0| 72 6f 6d 20 73 6f 75 72 | 63 65 20 63 6f 64 65 20 |rom sour|ce code |
|000004d0| 66 6f 72 20 41 52 43 20 | 35 2e 31 32 2c 20 77 68 |for ARC |5.12, wh|
|000004e0| 69 63 68 0a 69 6e 20 74 | 75 72 6e 20 74 6f 6f 6b |ich.in t|urn took|
|000004f0| 20 69 74 20 66 72 6f 6d | 20 61 6e 20 61 72 74 69 | it from| an arti|
|00000500| 63 6c 65 20 62 79 20 44 | 61 76 69 64 20 53 63 68 |cle by D|avid Sch|
|00000510| 77 61 64 65 72 65 72 20 | 69 6e 20 74 68 65 20 41 |waderer |in the A|
|00000520| 70 72 69 6c 20 31 39 38 | 35 0a 69 73 73 75 65 20 |pril 198|5.issue |
|00000530| 6f 66 20 50 43 20 54 65 | 63 68 20 4a 6f 75 72 6e |of PC Te|ch Journ|
|00000540| 61 6c 2e 0a 0a 49 20 63 | 6c 61 69 6d 20 6e 6f 20 |al...I c|laim no |
|00000550| 63 6f 70 79 72 69 67 68 | 74 20 6f 76 65 72 20 74 |copyrigh|t over t|
|00000560| 68 65 20 63 6f 6e 74 65 | 6e 74 73 20 6f 66 20 74 |he conte|nts of t|
|00000570| 68 69 73 20 66 69 6c 65 | 2e 0a 0a 20 20 20 20 20 |his file|... |
|00000580| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000590| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 2d | | -|
|000005a0| 2d 20 52 61 68 75 6c 20 | 44 68 65 73 69 20 31 39 |- Rahul |Dhesi 19|
|000005b0| 38 36 2f 31 32 2f 33 31 | 0a 2a 2f 0a 0a 75 6e 73 |86/12/31|.*/..uns|
|000005c0| 69 67 6e 65 64 20 69 6e | 74 20 63 72 63 63 6f 64 |igned in|t crccod|
|000005d0| 65 3b 0a 75 6e 73 69 67 | 6e 65 64 20 69 6e 74 20 |e;.unsig|ned int |
|000005e0| 63 72 63 74 61 62 5b 5d | 20 3d 20 7b 0a 20 20 20 |crctab[]| = {. |
|000005f0| 30 78 30 30 30 30 2c 20 | 30 78 63 30 63 31 2c 20 |0x0000, |0xc0c1, |
|00000600| 30 78 63 31 38 31 2c 20 | 30 78 30 31 34 30 2c 20 |0xc181, |0x0140, |
|00000610| 30 78 63 33 30 31 2c 20 | 30 78 30 33 63 30 2c 20 |0xc301, |0x03c0, |
|00000620| 30 78 30 32 38 30 2c 20 | 30 78 63 32 34 31 2c 20 |0x0280, |0xc241, |
|00000630| 30 78 63 36 30 31 2c 20 | 0a 20 20 20 30 78 30 36 |0xc601, |. 0x06|
|00000640| 63 30 2c 20 30 78 30 37 | 38 30 2c 20 30 78 63 37 |c0, 0x07|80, 0xc7|
|00000650| 34 31 2c 20 30 78 30 35 | 30 30 2c 20 30 78 63 35 |41, 0x05|00, 0xc5|
|00000660| 63 31 2c 20 30 78 63 34 | 38 31 2c 20 30 78 30 34 |c1, 0xc4|81, 0x04|
|00000670| 34 30 2c 20 30 78 63 63 | 30 31 2c 20 30 78 30 63 |40, 0xcc|01, 0x0c|
|00000680| 63 30 2c 20 0a 20 20 20 | 30 78 30 64 38 30 2c 20 |c0, . |0x0d80, |
|00000690| 30 78 63 64 34 31 2c 20 | 30 78 30 46 30 30 2c 20 |0xcd41, |0x0F00, |
|000006a0| 30 78 63 46 63 31 2c 20 | 30 78 63 65 38 31 2c 20 |0xcFc1, |0xce81, |
|000006b0| 30 78 30 65 34 30 2c 20 | 30 78 30 61 30 30 2c 20 |0x0e40, |0x0a00, |
|000006c0| 30 78 63 61 63 31 2c 20 | 30 78 63 62 38 31 2c 20 |0xcac1, |0xcb81, |
|000006d0| 0a 20 20 20 30 78 30 62 | 34 30 2c 20 30 78 63 39 |. 0x0b|40, 0xc9|
|000006e0| 30 31 2c 20 30 78 30 39 | 63 30 2c 20 30 78 30 38 |01, 0x09|c0, 0x08|
|000006f0| 38 30 2c 20 30 78 63 38 | 34 31 2c 20 30 78 64 38 |80, 0xc8|41, 0xd8|
|00000700| 30 31 2c 20 30 78 31 38 | 63 30 2c 20 30 78 31 39 |01, 0x18|c0, 0x19|
|00000710| 38 30 2c 20 30 78 64 39 | 34 31 2c 20 0a 20 20 20 |80, 0xd9|41, . |
|00000720| 30 78 31 62 30 30 2c 20 | 30 78 64 62 63 31 2c 20 |0x1b00, |0xdbc1, |
|00000730| 30 78 64 61 38 31 2c 20 | 30 78 31 61 34 30 2c 20 |0xda81, |0x1a40, |
|00000740| 30 78 31 65 30 30 2c 20 | 30 78 64 65 63 31 2c 20 |0x1e00, |0xdec1, |
|00000750| 30 78 64 46 38 31 2c 20 | 30 78 31 46 34 30 2c 20 |0xdF81, |0x1F40, |
|00000760| 30 78 64 64 30 31 2c 20 | 0a 20 20 20 30 78 31 64 |0xdd01, |. 0x1d|
|00000770| 63 30 2c 20 30 78 31 63 | 38 30 2c 20 30 78 64 63 |c0, 0x1c|80, 0xdc|
|00000780| 34 31 2c 20 30 78 31 34 | 30 30 2c 20 30 78 64 34 |41, 0x14|00, 0xd4|
|00000790| 63 31 2c 20 30 78 64 35 | 38 31 2c 20 30 78 31 35 |c1, 0xd5|81, 0x15|
|000007a0| 34 30 2c 20 30 78 64 37 | 30 31 2c 20 30 78 31 37 |40, 0xd7|01, 0x17|
|000007b0| 63 30 2c 20 0a 20 20 20 | 30 78 31 36 38 30 2c 20 |c0, . |0x1680, |
|000007c0| 30 78 64 36 34 31 2c 20 | 30 78 64 32 30 31 2c 20 |0xd641, |0xd201, |
|000007d0| 30 78 31 32 63 30 2c 20 | 30 78 31 33 38 30 2c 20 |0x12c0, |0x1380, |
|000007e0| 30 78 64 33 34 31 2c 20 | 30 78 31 31 30 30 2c 20 |0xd341, |0x1100, |
|000007f0| 30 78 64 31 63 31 2c 20 | 30 78 64 30 38 31 2c 20 |0xd1c1, |0xd081, |
|00000800| 0a 20 20 20 30 78 31 30 | 34 30 2c 20 30 78 46 30 |. 0x10|40, 0xF0|
|00000810| 30 31 2c 20 30 78 33 30 | 63 30 2c 20 30 78 33 31 |01, 0x30|c0, 0x31|
|00000820| 38 30 2c 20 30 78 46 31 | 34 31 2c 20 30 78 33 33 |80, 0xF1|41, 0x33|
|00000830| 30 30 2c 20 30 78 46 33 | 63 31 2c 20 30 78 46 32 |00, 0xF3|c1, 0xF2|
|00000840| 38 31 2c 20 30 78 33 32 | 34 30 2c 20 0a 20 20 20 |81, 0x32|40, . |
|00000850| 30 78 33 36 30 30 2c 20 | 30 78 46 36 63 31 2c 20 |0x3600, |0xF6c1, |
|00000860| 30 78 46 37 38 31 2c 20 | 30 78 33 37 34 30 2c 20 |0xF781, |0x3740, |
|00000870| 30 78 46 35 30 31 2c 20 | 30 78 33 35 63 30 2c 20 |0xF501, |0x35c0, |
|00000880| 30 78 33 34 38 30 2c 20 | 30 78 46 34 34 31 2c 20 |0x3480, |0xF441, |
|00000890| 30 78 33 63 30 30 2c 20 | 0a 20 20 20 30 78 46 63 |0x3c00, |. 0xFc|
|000008a0| 63 31 2c 20 30 78 46 64 | 38 31 2c 20 30 78 33 64 |c1, 0xFd|81, 0x3d|
|000008b0| 34 30 2c 20 30 78 46 46 | 30 31 2c 20 30 78 33 46 |40, 0xFF|01, 0x3F|
|000008c0| 63 30 2c 20 30 78 33 65 | 38 30 2c 20 30 78 46 65 |c0, 0x3e|80, 0xFe|
|000008d0| 34 31 2c 20 30 78 46 61 | 30 31 2c 20 30 78 33 61 |41, 0xFa|01, 0x3a|
|000008e0| 63 30 2c 20 0a 20 20 20 | 30 78 33 62 38 30 2c 20 |c0, . |0x3b80, |
|000008f0| 30 78 46 62 34 31 2c 20 | 30 78 33 39 30 30 2c 20 |0xFb41, |0x3900, |
|00000900| 30 78 46 39 63 31 2c 20 | 30 78 46 38 38 31 2c 20 |0xF9c1, |0xF881, |
|00000910| 30 78 33 38 34 30 2c 20 | 30 78 32 38 30 30 2c 20 |0x3840, |0x2800, |
|00000920| 30 78 65 38 63 31 2c 20 | 30 78 65 39 38 31 2c 20 |0xe8c1, |0xe981, |
|00000930| 0a 20 20 20 30 78 32 39 | 34 30 2c 20 30 78 65 62 |. 0x29|40, 0xeb|
|00000940| 30 31 2c 20 30 78 32 62 | 63 30 2c 20 30 78 32 61 |01, 0x2b|c0, 0x2a|
|00000950| 38 30 2c 20 30 78 65 61 | 34 31 2c 20 30 78 65 65 |80, 0xea|41, 0xee|
|00000960| 30 31 2c 20 30 78 32 65 | 63 30 2c 20 30 78 32 46 |01, 0x2e|c0, 0x2F|
|00000970| 38 30 2c 20 30 78 65 46 | 34 31 2c 20 0a 20 20 20 |80, 0xeF|41, . |
|00000980| 30 78 32 64 30 30 2c 20 | 30 78 65 64 63 31 2c 20 |0x2d00, |0xedc1, |
|00000990| 30 78 65 63 38 31 2c 20 | 30 78 32 63 34 30 2c 20 |0xec81, |0x2c40, |
|000009a0| 30 78 65 34 30 31 2c 20 | 30 78 32 34 63 30 2c 20 |0xe401, |0x24c0, |
|000009b0| 30 78 32 35 38 30 2c 20 | 30 78 65 35 34 31 2c 20 |0x2580, |0xe541, |
|000009c0| 30 78 32 37 30 30 2c 20 | 0a 20 20 20 30 78 65 37 |0x2700, |. 0xe7|
|000009d0| 63 31 2c 20 30 78 65 36 | 38 31 2c 20 30 78 32 36 |c1, 0xe6|81, 0x26|
|000009e0| 34 30 2c 20 30 78 32 32 | 30 30 2c 20 30 78 65 32 |40, 0x22|00, 0xe2|
|000009f0| 63 31 2c 20 30 78 65 33 | 38 31 2c 20 30 78 32 33 |c1, 0xe3|81, 0x23|
|00000a00| 34 30 2c 20 30 78 65 31 | 30 31 2c 20 30 78 32 31 |40, 0xe1|01, 0x21|
|00000a10| 63 30 2c 20 0a 20 20 20 | 30 78 32 30 38 30 2c 20 |c0, . |0x2080, |
|00000a20| 30 78 65 30 34 31 2c 20 | 30 78 61 30 30 31 2c 20 |0xe041, |0xa001, |
|00000a30| 30 78 36 30 63 30 2c 20 | 30 78 36 31 38 30 2c 20 |0x60c0, |0x6180, |
|00000a40| 30 78 61 31 34 31 2c 20 | 30 78 36 33 30 30 2c 20 |0xa141, |0x6300, |
|00000a50| 30 78 61 33 63 31 2c 20 | 30 78 61 32 38 31 2c 20 |0xa3c1, |0xa281, |
|00000a60| 0a 20 20 20 30 78 36 32 | 34 30 2c 20 30 78 36 36 |. 0x62|40, 0x66|
|00000a70| 30 30 2c 20 30 78 61 36 | 63 31 2c 20 30 78 61 37 |00, 0xa6|c1, 0xa7|
|00000a80| 38 31 2c 20 30 78 36 37 | 34 30 2c 20 30 78 61 35 |81, 0x67|40, 0xa5|
|00000a90| 30 31 2c 20 30 78 36 35 | 63 30 2c 20 30 78 36 34 |01, 0x65|c0, 0x64|
|00000aa0| 38 30 2c 20 30 78 61 34 | 34 31 2c 20 0a 20 20 20 |80, 0xa4|41, . |
|00000ab0| 30 78 36 63 30 30 2c 20 | 30 78 61 63 63 31 2c 20 |0x6c00, |0xacc1, |
|00000ac0| 30 78 61 64 38 31 2c 20 | 30 78 36 64 34 30 2c 20 |0xad81, |0x6d40, |
|00000ad0| 30 78 61 46 30 31 2c 20 | 30 78 36 46 63 30 2c 20 |0xaF01, |0x6Fc0, |
|00000ae0| 30 78 36 65 38 30 2c 20 | 30 78 61 65 34 31 2c 20 |0x6e80, |0xae41, |
|00000af0| 30 78 61 61 30 31 2c 20 | 0a 20 20 20 30 78 36 61 |0xaa01, |. 0x6a|
|00000b00| 63 30 2c 20 30 78 36 62 | 38 30 2c 20 30 78 61 62 |c0, 0x6b|80, 0xab|
|00000b10| 34 31 2c 20 30 78 36 39 | 30 30 2c 20 30 78 61 39 |41, 0x69|00, 0xa9|
|00000b20| 63 31 2c 20 30 78 61 38 | 38 31 2c 20 30 78 36 38 |c1, 0xa8|81, 0x68|
|00000b30| 34 30 2c 20 30 78 37 38 | 30 30 2c 20 30 78 62 38 |40, 0x78|00, 0xb8|
|00000b40| 63 31 2c 20 0a 20 20 20 | 30 78 62 39 38 31 2c 20 |c1, . |0xb981, |
|00000b50| 30 78 37 39 34 30 2c 20 | 30 78 62 62 30 31 2c 20 |0x7940, |0xbb01, |
|00000b60| 30 78 37 62 63 30 2c 20 | 30 78 37 61 38 30 2c 20 |0x7bc0, |0x7a80, |
|00000b70| 30 78 62 61 34 31 2c 20 | 30 78 62 65 30 31 2c 20 |0xba41, |0xbe01, |
|00000b80| 30 78 37 65 63 30 2c 20 | 30 78 37 46 38 30 2c 20 |0x7ec0, |0x7F80, |
|00000b90| 0a 20 20 20 30 78 62 46 | 34 31 2c 20 30 78 37 64 |. 0xbF|41, 0x7d|
|00000ba0| 30 30 2c 20 30 78 62 64 | 63 31 2c 20 30 78 62 63 |00, 0xbd|c1, 0xbc|
|00000bb0| 38 31 2c 20 30 78 37 63 | 34 30 2c 20 30 78 62 34 |81, 0x7c|40, 0xb4|
|00000bc0| 30 31 2c 20 30 78 37 34 | 63 30 2c 20 30 78 37 35 |01, 0x74|c0, 0x75|
|00000bd0| 38 30 2c 20 30 78 62 35 | 34 31 2c 20 0a 20 20 20 |80, 0xb5|41, . |
|00000be0| 30 78 37 37 30 30 2c 20 | 30 78 62 37 63 31 2c 20 |0x7700, |0xb7c1, |
|00000bf0| 30 78 62 36 38 31 2c 20 | 30 78 37 36 34 30 2c 20 |0xb681, |0x7640, |
|00000c00| 30 78 37 32 30 30 2c 20 | 30 78 62 32 63 31 2c 20 |0x7200, |0xb2c1, |
|00000c10| 30 78 62 33 38 31 2c 20 | 30 78 37 33 34 30 2c 20 |0xb381, |0x7340, |
|00000c20| 30 78 62 31 30 31 2c 20 | 0a 20 20 20 30 78 37 31 |0xb101, |. 0x71|
|00000c30| 63 30 2c 20 30 78 37 30 | 38 30 2c 20 30 78 62 30 |c0, 0x70|80, 0xb0|
|00000c40| 34 31 2c 20 30 78 35 30 | 30 30 2c 20 30 78 39 30 |41, 0x50|00, 0x90|
|00000c50| 63 31 2c 20 30 78 39 31 | 38 31 2c 20 30 78 35 31 |c1, 0x91|81, 0x51|
|00000c60| 34 30 2c 20 30 78 39 33 | 30 31 2c 20 30 78 35 33 |40, 0x93|01, 0x53|
|00000c70| 63 30 2c 20 0a 20 20 20 | 30 78 35 32 38 30 2c 20 |c0, . |0x5280, |
|00000c80| 30 78 39 32 34 31 2c 20 | 30 78 39 36 30 31 2c 20 |0x9241, |0x9601, |
|00000c90| 30 78 35 36 63 30 2c 20 | 30 78 35 37 38 30 2c 20 |0x56c0, |0x5780, |
|00000ca0| 30 78 39 37 34 31 2c 20 | 30 78 35 35 30 30 2c 20 |0x9741, |0x5500, |
|00000cb0| 30 78 39 35 63 31 2c 20 | 30 78 39 34 38 31 2c 20 |0x95c1, |0x9481, |
|00000cc0| 0a 20 20 20 30 78 35 34 | 34 30 2c 20 30 78 39 63 |. 0x54|40, 0x9c|
|00000cd0| 30 31 2c 20 30 78 35 63 | 63 30 2c 20 30 78 35 64 |01, 0x5c|c0, 0x5d|
|00000ce0| 38 30 2c 20 30 78 39 64 | 34 31 2c 20 30 78 35 46 |80, 0x9d|41, 0x5F|
|00000cf0| 30 30 2c 20 30 78 39 46 | 63 31 2c 20 30 78 39 65 |00, 0x9F|c1, 0x9e|
|00000d00| 38 31 2c 20 30 78 35 65 | 34 30 2c 20 0a 20 20 20 |81, 0x5e|40, . |
|00000d10| 30 78 35 61 30 30 2c 20 | 30 78 39 61 63 31 2c 20 |0x5a00, |0x9ac1, |
|00000d20| 30 78 39 62 38 31 2c 20 | 30 78 35 62 34 30 2c 20 |0x9b81, |0x5b40, |
|00000d30| 30 78 39 39 30 31 2c 20 | 30 78 35 39 63 30 2c 20 |0x9901, |0x59c0, |
|00000d40| 30 78 35 38 38 30 2c 20 | 30 78 39 38 34 31 2c 20 |0x5880, |0x9841, |
|00000d50| 30 78 38 38 30 31 2c 20 | 0a 20 20 20 30 78 34 38 |0x8801, |. 0x48|
|00000d60| 63 30 2c 20 30 78 34 39 | 38 30 2c 20 30 78 38 39 |c0, 0x49|80, 0x89|
|00000d70| 34 31 2c 20 30 78 34 62 | 30 30 2c 20 30 78 38 62 |41, 0x4b|00, 0x8b|
|00000d80| 63 31 2c 20 30 78 38 61 | 38 31 2c 20 30 78 34 61 |c1, 0x8a|81, 0x4a|
|00000d90| 34 30 2c 20 30 78 34 65 | 30 30 2c 20 30 78 38 65 |40, 0x4e|00, 0x8e|
|00000da0| 63 31 2c 20 0a 20 20 20 | 30 78 38 46 38 31 2c 20 |c1, . |0x8F81, |
|00000db0| 30 78 34 46 34 30 2c 20 | 30 78 38 64 30 31 2c 20 |0x4F40, |0x8d01, |
|00000dc0| 30 78 34 64 63 30 2c 20 | 30 78 34 63 38 30 2c 20 |0x4dc0, |0x4c80, |
|00000dd0| 30 78 38 63 34 31 2c 20 | 30 78 34 34 30 30 2c 20 |0x8c41, |0x4400, |
|00000de0| 30 78 38 34 63 31 2c 20 | 30 78 38 35 38 31 2c 20 |0x84c1, |0x8581, |
|00000df0| 0a 20 20 20 30 78 34 35 | 34 30 2c 20 30 78 38 37 |. 0x45|40, 0x87|
|00000e00| 30 31 2c 20 30 78 34 37 | 63 30 2c 20 30 78 34 36 |01, 0x47|c0, 0x46|
|00000e10| 38 30 2c 20 30 78 38 36 | 34 31 2c 20 30 78 38 32 |80, 0x86|41, 0x82|
|00000e20| 30 31 2c 20 30 78 34 32 | 63 30 2c 20 30 78 34 33 |01, 0x42|c0, 0x43|
|00000e30| 38 30 2c 20 30 78 38 33 | 34 31 2c 20 0a 20 20 20 |80, 0x83|41, . |
|00000e40| 30 78 34 31 30 30 2c 20 | 30 78 38 31 63 31 2c 20 |0x4100, |0x81c1, |
|00000e50| 30 78 38 30 38 31 2c 20 | 30 78 34 30 34 30 20 0a |0x8081, |0x4040 .|
|00000e60| 7d 3b 0a 0a 69 6e 74 20 | 61 64 64 62 66 63 72 63 |};..int |addbfcrc|
|00000e70| 28 62 75 66 66 65 72 2c | 63 6f 75 6e 74 29 0a 63 |(buffer,|count).c|
|00000e80| 68 61 72 20 2a 62 75 66 | 66 65 72 3b 0a 69 6e 74 |har *buf|fer;.int|
|00000e90| 20 63 6f 75 6e 74 3b 0a | 0a 7b 0a 20 20 20 72 65 | count;.|.{. re|
|00000ea0| 67 69 73 74 65 72 20 75 | 6e 73 69 67 6e 65 64 20 |gister u|nsigned |
|00000eb0| 69 6e 74 20 6c 6f 63 61 | 6c 63 72 63 3b 0a 20 20 |int loca|lcrc;. |
|00000ec0| 20 72 65 67 69 73 74 65 | 72 20 69 6e 74 20 69 3b | registe|r int i;|
|00000ed0| 0a 20 20 20 6c 6f 63 61 | 6c 63 72 63 20 3d 20 63 |. loca|lcrc = c|
|00000ee0| 72 63 63 6f 64 65 3b 0a | 0a 20 20 20 66 6f 72 20 |rccode;.|. for |
|00000ef0| 28 69 3d 30 3b 20 69 3c | 63 6f 75 6e 74 3b 20 69 |(i=0; i<|count; i|
|00000f00| 2b 2b 29 0a 20 20 20 20 | 20 20 6c 6f 63 61 6c 63 |++). | localc|
|00000f10| 72 63 20 3d 20 28 6c 6f | 63 61 6c 63 72 63 3e 3e |rc = (lo|calcrc>>|
|00000f20| 38 29 20 5e 20 63 72 63 | 74 61 62 5b 28 6c 6f 63 |8) ^ crc|tab[(loc|
|00000f30| 61 6c 63 72 63 20 5e 20 | 28 62 75 66 66 65 72 5b |alcrc ^ |(buffer[|
|00000f40| 69 5d 29 29 20 26 20 30 | 78 30 30 66 66 5d 3b 0a |i])) & 0|x00ff];.|
|00000f50| 20 20 20 63 72 63 63 6f | 64 65 20 3d 20 6c 6f 63 | crcco|de = loc|
|00000f60| 61 6c 63 72 63 3b 0a 7d | 0a 00 00 00 00 00 00 00 |alcrc;.}|........|
|00000f70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000fa0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000fb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000fc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000fd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000fe0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ff0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001000| 62 6f 6f 7a 2f 62 6f 6f | 7a 2e 63 00 00 00 00 00 |booz/boo|z.c.....|
|00001010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001040| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001060| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 32 |.... 6|44 . 2|
|00001070| 34 33 20 00 20 20 20 20 | 31 32 20 00 20 20 20 20 |43 . |12 . |
|00001080| 20 20 31 37 36 37 33 20 | 20 34 34 30 32 30 34 32 | 17673 | 4402042|
|00001090| 32 32 37 20 20 20 36 32 | 32 31 00 20 00 00 00 00 |227 62|21. ....|
|000010a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000010b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000010c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000010d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000010e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000010f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001100| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001110| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001120| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001130| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001140| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001150| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001180| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000011a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000011b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000011c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000011d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000011e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000011f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001200| 23 64 65 66 69 6e 65 20 | 20 56 45 52 53 49 4f 4e |#define | VERSION|
|00001210| 20 20 22 56 65 72 73 69 | 6f 6e 20 31 2e 30 32 20 | "Versi|on 1.02 |
|00001220| 28 31 39 38 38 2f 30 38 | 2f 32 35 29 5c 6e 22 0a |(1988/08|/25)\n".|
|00001230| 0a 2f 2a 20 62 6f 6f 7a | 2e 63 20 2d 2d 20 73 6d |./* booz|.c -- sm|
|00001240| 61 6c 6c 2c 20 6d 65 6d | 6f 72 79 2d 65 66 66 69 |all, mem|ory-effi|
|00001250| 63 69 65 6e 74 20 42 61 | 72 65 62 6f 6e 65 73 20 |cient Ba|rebones |
|00001260| 4f 6f 7a 20 74 6f 20 65 | 78 74 72 61 63 74 20 5a |Ooz to e|xtract Z|
|00001270| 6f 6f 20 61 72 63 68 69 | 76 65 73 2e 0a 0a 46 6f |oo archi|ves...Fo|
|00001280| 72 20 6d 61 78 69 6d 75 | 6d 20 70 6f 72 74 61 62 |r maximu|m portab|
|00001290| 69 6c 69 74 79 2c 20 42 | 6f 6f 7a 20 64 6f 65 73 |ility, B|ooz does|
|000012a0| 20 6e 6f 74 20 75 73 65 | 20 74 68 65 20 64 61 74 | not use| the dat|
|000012b0| 61 20 74 79 70 65 20 60 | 75 6e 73 69 67 6e 65 64 |a type `|unsigned|
|000012c0| 20 6c 6f 6e 67 27 2e 0a | 0a 54 68 65 20 66 75 6e | long'..|.The fun|
|000012d0| 63 74 69 6f 6e 73 20 61 | 6e 64 20 73 79 73 74 65 |ctions a|nd syste|
|000012e0| 6d 20 63 61 6c 6c 73 20 | 72 65 71 75 69 72 65 64 |m calls |required|
|000012f0| 20 62 79 20 54 69 6e 79 | 20 42 6f 6f 7a 20 61 72 | by Tiny| Booz ar|
|00001300| 65 3a 0a 20 20 20 72 65 | 61 64 28 29 0a 20 20 20 |e:. re|ad(). |
|00001310| 77 72 69 74 65 28 29 0a | 20 20 20 73 74 72 6c 65 |write().| strle|
|00001320| 6e 28 29 0a 20 20 20 65 | 78 69 74 28 29 0a 20 20 |n(). e|xit(). |
|00001330| 20 6d 61 6c 6c 6f 63 28 | 29 0a 20 20 20 6c 73 65 | malloc(|). lse|
|00001340| 65 6b 28 29 0a 20 20 20 | 6f 70 65 6e 28 29 20 61 |ek(). |open() a|
|00001350| 6e 64 2f 6f 72 20 63 72 | 65 61 74 28 29 0a 20 20 |nd/or cr|eat(). |
|00001360| 20 63 6c 6f 73 65 28 29 | 0a 20 20 20 75 6e 6c 69 | close()|. unli|
|00001370| 6e 6b 28 29 20 20 20 20 | 20 20 20 20 20 20 20 20 |nk() | |
|00001380| 20 20 20 20 2d 2d 20 6d | 61 79 20 62 65 20 64 65 | -- m|ay be de|
|00001390| 66 69 6e 65 64 20 74 6f | 20 62 65 20 61 6e 20 65 |fined to| be an e|
|000013a0| 6d 70 74 79 20 66 75 6e | 63 74 69 6f 6e 0a 0a 0a |mpty fun|ction...|
|000013b0| 53 6d 61 6c 6c 20 42 6f | 6f 7a 20 61 64 64 69 74 |Small Bo|oz addit|
|000013c0| 69 6f 6e 61 6c 6c 79 20 | 75 73 65 73 20 74 68 65 |ionally |uses the|
|000013d0| 20 66 6f 6c 6c 6f 77 69 | 6e 67 20 66 75 6e 63 74 | followi|ng funct|
|000013e0| 69 6f 6e 73 3a 0a 20 20 | 20 73 74 72 63 61 74 28 |ions:. | strcat(|
|000013f0| 29 0a 20 20 20 73 74 72 | 63 70 79 28 29 0a 0a 42 |). str|cpy()..B|
|00001400| 69 67 20 42 6f 6f 7a 20 | 61 64 64 69 74 69 6f 6e |ig Booz |addition|
|00001410| 61 6c 6c 79 20 75 73 65 | 20 74 68 65 20 66 6f 6c |ally use| the fol|
|00001420| 6c 6f 77 69 6e 67 20 66 | 75 6e 63 74 69 6f 6e 3a |lowing f|unction:|
|00001430| 0a 20 20 20 73 74 72 6e | 63 61 74 28 29 0a 2a 2f |. strn|cat().*/|
|00001440| 0a 0a 2f 2a 20 0a 54 68 | 65 20 63 6f 6e 74 65 6e |../* .Th|e conten|
|00001450| 74 73 20 6f 66 20 74 68 | 69 73 20 66 69 6c 65 20 |ts of th|is file |
|00001460| 61 72 65 20 68 65 72 65 | 62 79 20 72 65 6c 65 61 |are here|by relea|
|00001470| 73 65 64 20 74 6f 20 74 | 68 65 20 70 75 62 6c 69 |sed to t|he publi|
|00001480| 63 20 64 6f 6d 61 69 6e | 2e 0a 0a 20 20 20 20 20 |c domain|... |
|00001490| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000014a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2d 2d | | --|
|000014b0| 20 52 61 68 75 6c 20 44 | 68 65 73 69 20 31 39 38 | Rahul D|hesi 198|
|000014c0| 38 2f 30 38 2f 32 35 0a | 2a 2f 0a 0a 23 69 6e 63 |8/08/25.|*/..#inc|
|000014d0| 6c 75 64 65 20 22 6f 70 | 74 69 6f 6e 73 2e 68 22 |lude "op|tions.h"|
|000014e0| 0a 23 69 6e 63 6c 75 64 | 65 20 22 66 75 6e 63 2e |.#includ|e "func.|
|000014f0| 68 22 0a 23 69 6e 63 6c | 75 64 65 20 22 7a 6f 6f |h".#incl|ude "zoo|
|00001500| 2e 68 22 0a 0a 6d 61 69 | 6e 28 61 72 67 63 2c 61 |.h"..mai|n(argc,a|
|00001510| 72 67 76 29 0a 72 65 67 | 69 73 74 65 72 20 69 6e |rgv).reg|ister in|
|00001520| 74 20 61 72 67 63 3b 0a | 72 65 67 69 73 74 65 72 |t argc;.|register|
|00001530| 20 63 68 61 72 20 2a 2a | 61 72 67 76 3b 0a 7b 0a | char **|argv;.{.|
|00001540| 23 69 66 64 65 66 20 54 | 49 4e 59 0a 20 20 20 73 |#ifdef T|INY. s|
|00001550| 74 61 74 69 63 20 63 68 | 61 72 20 75 73 61 67 65 |tatic ch|ar usage|
|00001560| 5b 5d 3d 0a 20 20 20 20 | 20 20 22 55 73 61 67 65 |[]=. | "Usage|
|00001570| 3a 20 20 62 6f 6f 7a 20 | 61 72 63 68 69 76 65 2e |: booz |archive.|
|00001580| 7a 6f 6f 5c 6e 22 3b 0a | 20 20 20 69 66 20 28 61 |zoo\n";.| if (a|
|00001590| 72 67 63 20 3c 20 32 29 | 20 7b 0a 20 20 20 20 20 |rgc < 2)| {. |
|000015a0| 20 70 75 74 73 74 72 20 | 28 22 50 75 62 6c 69 63 | putstr |("Public|
|000015b0| 20 64 6f 6d 61 69 6e 20 | 42 61 72 65 62 6f 6e 65 | domain |Barebone|
|000015c0| 73 20 4f 6f 7a 5c 6e 5a | 6f 6f 20 61 72 63 68 69 |s Ooz\nZ|oo archi|
|000015d0| 76 65 20 65 78 74 72 61 | 63 74 6f 72 20 28 54 69 |ve extra|ctor (Ti|
|000015e0| 6e 79 29 20 62 79 20 52 | 61 68 75 6c 20 44 68 65 |ny) by R|ahul Dhe|
|000015f0| 73 69 5c 6e 22 29 3b 0a | 20 20 20 20 20 20 70 75 |si\n");.| pu|
|00001600| 74 73 74 72 20 28 56 45 | 52 53 49 4f 4e 29 3b 0a |tstr (VE|RSION);.|
|00001610| 20 20 20 20 20 20 70 75 | 74 73 74 72 20 28 75 73 | pu|tstr (us|
|00001620| 61 67 65 29 3b 0a 20 20 | 20 20 20 20 65 78 69 74 |age);. | exit|
|00001630| 20 28 31 29 3b 0a 20 20 | 20 7d 0a 23 65 6e 64 69 | (1);. | }.#endi|
|00001640| 66 0a 0a 23 69 66 64 65 | 66 20 53 4d 41 4c 4c 0a |f..#ifde|f SMALL.|
|00001650| 20 20 20 73 74 61 74 69 | 63 20 63 68 61 72 20 75 | stati|c char u|
|00001660| 73 61 67 65 5b 5d 3d 0a | 20 20 20 20 20 20 22 55 |sage[]=.| "U|
|00001670| 73 61 67 65 3a 20 20 62 | 6f 6f 7a 20 61 72 63 68 |sage: b|ooz arch|
|00001680| 69 76 65 5b 2e 7a 6f 6f | 5d 20 5b 20 66 69 6c 65 |ive[.zoo|] [ file|
|00001690| 20 2e 2e 2e 20 5d 5c 6e | 22 3b 0a 20 20 20 69 66 | ... ]\n|";. if|
|000016a0| 20 28 61 72 67 63 20 3c | 20 32 29 20 7b 0a 20 20 | (argc <| 2) {. |
|000016b0| 20 20 20 20 70 75 74 73 | 74 72 20 28 22 50 75 62 | puts|tr ("Pub|
|000016c0| 6c 69 63 20 64 6f 6d 61 | 69 6e 20 42 61 72 65 62 |lic doma|in Bareb|
|000016d0| 6f 6e 65 73 20 4f 6f 7a | 5c 6e 5a 6f 6f 20 61 72 |ones Ooz|\nZoo ar|
|000016e0| 63 68 69 76 65 20 65 78 | 74 72 61 63 74 6f 72 20 |chive ex|tractor |
|000016f0| 28 53 6d 61 6c 6c 29 20 | 62 79 20 52 61 68 75 6c |(Small) |by Rahul|
|00001700| 20 44 68 65 73 69 5c 6e | 22 29 3b 0a 20 20 20 20 | Dhesi\n|");. |
|00001710| 20 20 70 75 74 73 74 72 | 20 28 56 45 52 53 49 4f | putstr| (VERSIO|
|00001720| 4e 29 3b 0a 20 20 20 20 | 20 20 70 75 74 73 74 72 |N);. | putstr|
|00001730| 20 28 75 73 61 67 65 29 | 3b 0a 20 20 20 20 20 20 | (usage)|;. |
|00001740| 65 78 69 74 20 28 31 29 | 3b 0a 20 20 20 7d 0a 23 |exit (1)|;. }.#|
|00001750| 65 6e 64 69 66 0a 0a 23 | 69 66 64 65 66 20 42 49 |endif..#|ifdef BI|
|00001760| 47 0a 20 20 20 73 74 61 | 74 69 63 20 63 68 61 72 |G. sta|tic char|
|00001770| 20 75 73 61 67 65 5b 5d | 3d 0a 20 20 20 20 20 20 | usage[]|=. |
|00001780| 22 55 73 61 67 65 3a 20 | 20 62 6f 6f 7a 20 7b 6c |"Usage: | booz {l|
|00001790| 78 74 7d 20 61 72 63 68 | 69 76 65 5b 2e 7a 6f 6f |xt} arch|ive[.zoo|
|000017a0| 5d 20 5b 20 66 69 6c 65 | 20 2e 2e 2e 20 5d 5c 6e |] [ file| ... ]\n|
|000017b0| 22 3b 0a 20 20 20 69 66 | 20 28 61 72 67 63 20 3c |";. if| (argc <|
|000017c0| 20 33 29 20 7b 0a 20 20 | 20 20 20 20 70 75 74 73 | 3) {. | puts|
|000017d0| 74 72 20 28 22 50 75 62 | 6c 69 63 20 64 6f 6d 61 |tr ("Pub|lic doma|
|000017e0| 69 6e 20 42 61 72 65 62 | 6f 6e 65 73 20 4f 6f 7a |in Bareb|ones Ooz|
|000017f0| 5c 6e 5a 6f 6f 20 61 72 | 63 68 69 76 65 20 65 78 |\nZoo ar|chive ex|
|00001800| 74 72 61 63 74 6f 72 2f | 6c 69 73 74 65 72 20 28 |tractor/|lister (|
|00001810| 42 69 67 29 20 62 79 20 | 52 61 68 75 6c 20 44 68 |Big) by |Rahul Dh|
|00001820| 65 73 69 5c 6e 22 29 3b | 0a 20 20 20 20 20 20 70 |esi\n");|. p|
|00001830| 75 74 73 74 72 20 28 56 | 45 52 53 49 4f 4e 29 3b |utstr (V|ERSION);|
|00001840| 0a 20 20 20 20 20 20 70 | 75 74 73 74 72 20 28 75 |. p|utstr (u|
|00001850| 73 61 67 65 29 3b 0a 20 | 20 20 20 20 20 70 75 74 |sage);. | put|
|00001860| 73 74 72 20 28 22 6c 20 | 3d 20 6c 69 73 74 2c 20 |str ("l |= list, |
|00001870| 78 20 3d 20 65 78 74 72 | 61 63 74 2c 20 74 20 3d |x = extr|act, t =|
|00001880| 20 74 65 73 74 5c 6e 22 | 29 3b 0a 20 20 20 20 20 | test\n"|);. |
|00001890| 20 65 78 69 74 20 28 31 | 29 3b 0a 20 20 20 7d 0a | exit (1|);. }.|
|000018a0| 23 65 6e 64 69 66 0a 0a | 23 69 66 64 65 66 20 54 |#endif..|#ifdef T|
|000018b0| 49 4e 59 0a 20 20 20 6f | 6f 7a 65 78 74 20 28 61 |INY. o|ozext (a|
|000018c0| 72 67 76 5b 31 5d 29 3b | 0a 23 65 6e 64 69 66 0a |rgv[1]);|.#endif.|
|000018d0| 0a 23 69 66 64 65 66 20 | 53 4d 41 4c 4c 0a 20 20 |.#ifdef |SMALL. |
|000018e0| 20 6f 6f 7a 65 78 74 20 | 28 61 72 67 76 5b 31 5d | oozext |(argv[1]|
|000018f0| 2c 20 61 72 67 63 20 2d | 20 32 2c 20 26 61 72 67 |, argc -| 2, &arg|
|00001900| 76 5b 32 5d 29 3b 0a 23 | 65 6e 64 69 66 0a 0a 23 |v[2]);.#|endif..#|
|00001910| 69 66 64 65 66 20 42 49 | 47 0a 20 20 20 7b 0a 20 |ifdef BI|G. {. |
|00001920| 20 20 20 20 20 63 68 61 | 72 20 2a 70 3b 0a 20 20 | cha|r *p;. |
|00001930| 20 20 20 20 70 20 3d 20 | 61 72 67 76 5b 31 5d 3b | p = |argv[1];|
|00001940| 0a 20 20 20 20 20 20 69 | 66 20 28 2a 70 20 3d 3d |. i|f (*p ==|
|00001950| 20 27 4c 27 29 0a 20 20 | 20 20 20 20 20 20 20 2a | 'L'). | *|
|00001960| 70 20 3d 20 27 6c 27 3b | 0a 20 20 20 20 20 20 69 |p = 'l';|. i|
|00001970| 66 20 28 2a 70 20 3d 3d | 20 27 58 27 29 0a 20 20 |f (*p ==| 'X'). |
|00001980| 20 20 20 20 20 20 20 2a | 70 20 3d 20 27 78 27 3b | *|p = 'x';|
|00001990| 0a 20 20 20 20 20 20 69 | 66 20 28 2a 70 20 3d 3d |. i|f (*p ==|
|000019a0| 20 27 54 27 29 0a 20 20 | 20 20 20 20 20 20 20 2a | 'T'). | *|
|000019b0| 70 20 3d 20 27 74 27 3b | 0a 20 20 20 20 20 20 69 |p = 't';|. i|
|000019c0| 66 20 28 2a 70 20 21 3d | 20 27 6c 27 20 26 26 20 |f (*p !=| 'l' && |
|000019d0| 2a 70 20 21 3d 20 27 78 | 27 20 26 26 20 2a 70 20 |*p != 'x|' && *p |
|000019e0| 21 3d 20 27 74 27 29 20 | 7b 0a 20 20 20 20 20 20 |!= 't') |{. |
|000019f0| 20 20 20 70 75 74 73 74 | 72 20 28 75 73 61 67 65 | putst|r (usage|
|00001a00| 29 3b 0a 20 20 20 20 20 | 20 20 20 20 65 78 69 74 |);. | exit|
|00001a10| 20 28 31 29 3b 0a 20 20 | 20 20 20 20 7d 0a 20 20 | (1);. | }. |
|00001a20| 20 20 20 20 6f 6f 7a 65 | 78 74 20 28 61 72 67 76 | ooze|xt (argv|
|00001a30| 5b 32 5d 2c 20 70 2c 20 | 61 72 67 63 20 2d 20 33 |[2], p, |argc - 3|
|00001a40| 2c 20 26 61 72 67 76 5b | 33 5d 29 3b 0a 20 20 20 |, &argv[|3]);. |
|00001a50| 7d 0a 23 65 6e 64 69 66 | 0a 0a 20 20 20 65 78 69 |}.#endif|.. exi|
|00001a60| 74 20 28 30 29 3b 0a 7d | 0a 0a 2f 2a 2a 2a 2a 2a |t (0);.}|../*****|
|00001a70| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001a80| 2a 2f 0a 2f 2a 20 70 75 | 74 73 74 72 28 29 0a 54 |*/./* pu|tstr().T|
|00001a90| 68 69 73 20 66 75 6e 63 | 74 69 6f 6e 20 70 72 69 |his func|tion pri|
|00001aa0| 6e 74 73 20 61 20 73 74 | 72 69 6e 67 20 74 6f 20 |nts a st|ring to |
|00001ab0| 74 68 65 20 73 74 61 6e | 64 61 72 64 20 6f 75 74 |the stan|dard out|
|00001ac0| 70 75 74 20 68 61 6e 64 | 6c 65 20 77 69 74 68 6f |put hand|le witho|
|00001ad0| 75 74 0a 75 73 69 6e 67 | 20 70 72 69 6e 74 66 28 |ut.using| printf(|
|00001ae0| 29 20 6f 72 20 74 68 65 | 20 73 74 61 6e 64 61 72 |) or the| standar|
|00001af0| 64 20 49 2f 4f 20 6c 69 | 62 72 61 72 79 2e 20 20 |d I/O li|brary. |
|00001b00| 49 66 20 61 20 6e 75 6c | 6c 20 73 74 72 69 6e 67 |If a nul|l string|
|00001b10| 2c 20 6e 6f 74 68 69 6e | 67 20 0a 69 73 20 70 72 |, nothin|g .is pr|
|00001b20| 69 6e 74 65 64 20 28 6e | 6f 74 20 65 76 65 6e 20 |inted (n|ot even |
|00001b30| 74 68 65 20 6e 75 6c 6c | 20 63 68 61 72 61 63 74 |the null| charact|
|00001b40| 65 72 29 2e 0a 2a 2f 0a | 69 6e 74 20 70 75 74 73 |er)..*/.|int puts|
|00001b50| 74 72 20 28 73 74 72 29 | 0a 72 65 67 69 73 74 65 |tr (str)|.registe|
|00001b60| 72 20 63 68 61 72 20 2a | 73 74 72 3b 0a 7b 0a 20 |r char *|str;.{. |
|00001b70| 20 20 69 66 20 28 73 74 | 72 20 21 3d 20 28 63 68 | if (st|r != (ch|
|00001b80| 61 72 20 2a 29 20 30 29 | 0a 20 20 20 20 20 20 77 |ar *) 0)|. w|
|00001b90| 72 69 74 65 20 28 31 2c | 20 73 74 72 2c 20 73 74 |rite (1,| str, st|
|00001ba0| 72 6c 65 6e 28 73 74 72 | 29 29 3b 0a 7d 0a 0a 2f |rlen(str|));.}../|
|00001bb0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001bc0| 2a 2a 2a 2a 2a 2a 2f 0a | 2f 2a 20 70 72 74 65 72 |******/.|/* prter|
|00001bd0| 72 6f 72 28 29 0a 50 72 | 69 6e 74 73 20 61 6e 20 |ror().Pr|ints an |
|00001be0| 65 72 72 6f 72 20 6d 65 | 73 73 61 67 65 2e 20 20 |error me|ssage. |
|00001bf0| 54 68 65 20 66 69 72 73 | 74 20 63 68 61 72 61 63 |The firs|t charac|
|00001c00| 74 65 72 20 63 6f 6e 74 | 72 6f 6c 73 20 74 68 65 |ter cont|rols the|
|00001c10| 20 73 65 76 65 72 69 74 | 79 0a 6f 66 20 74 68 65 | severit|y.of the|
|00001c20| 20 65 72 72 6f 72 20 61 | 6e 64 20 74 68 65 20 72 | error a|nd the r|
|00001c30| 65 73 75 6c 74 2e 0a 0a | 20 20 20 27 6d 27 20 20 |esult...| 'm' |
|00001c40| 20 69 6e 66 6f 72 6d 61 | 74 69 76 65 20 6d 65 73 | informa|tive mes|
|00001c50| 73 61 67 65 0a 20 20 20 | 27 77 27 20 20 20 77 61 |sage. |'w' wa|
|00001c60| 72 6e 69 6e 67 20 20 20 | 20 20 2d 2d 20 65 78 65 |rning | -- exe|
|00001c70| 63 75 74 69 6f 6e 20 63 | 6f 6e 74 69 6e 75 65 73 |cution c|ontinues|
|00001c80| 0a 20 20 20 27 65 27 20 | 20 20 65 72 72 6f 72 20 |. 'e' | error |
|00001c90| 20 20 20 20 20 20 2d 2d | 20 65 78 65 63 75 74 69 | --| executi|
|00001ca0| 6f 6e 20 63 6f 6e 74 69 | 6e 75 65 73 0a 20 20 20 |on conti|nues. |
|00001cb0| 27 66 27 20 20 20 66 61 | 74 61 6c 20 65 72 72 6f |'f' fa|tal erro|
|00001cc0| 72 20 2d 2d 20 70 72 6f | 67 72 61 6d 20 65 78 69 |r -- pro|gram exi|
|00001cd0| 74 73 0a 2a 2f 0a 0a 69 | 6e 74 20 70 72 74 65 72 |ts.*/..i|nt prter|
|00001ce0| 72 6f 72 20 28 6c 65 76 | 65 6c 2c 20 61 2c 20 62 |ror (lev|el, a, b|
|00001cf0| 2c 20 63 29 0a 69 6e 74 | 20 6c 65 76 65 6c 3b 0a |, c).int| level;.|
|00001d00| 63 68 61 72 20 2a 61 2c | 20 2a 62 2c 20 2a 63 3b |char *a,| *b, *c;|
|00001d10| 0a 0a 7b 0a 0a 23 69 66 | 64 65 66 20 44 45 42 55 |..{..#if|def DEBU|
|00001d20| 47 0a 20 20 20 7b 0a 20 | 20 20 20 20 20 63 68 61 |G. {. | cha|
|00001d30| 72 20 74 6d 70 5b 32 5d | 3b 0a 20 20 20 20 20 20 |r tmp[2]|;. |
|00001d40| 74 6d 70 5b 30 5d 20 3d | 20 6c 65 76 65 6c 20 26 |tmp[0] =| level &|
|00001d50| 20 30 78 37 66 3b 0a 20 | 20 20 20 20 20 74 6d 70 | 0x7f;. | tmp|
|00001d60| 5b 31 5d 20 3d 20 27 5c | 30 27 3b 0a 20 20 20 20 |[1] = '\|0';. |
|00001d70| 20 20 70 75 74 73 74 72 | 20 28 22 70 72 74 65 72 | putstr| ("prter|
|00001d80| 72 6f 72 3a 20 20 6c 65 | 76 65 6c 20 3d 20 22 29 |ror: le|vel = ")|
|00001d90| 3b 0a 20 20 20 20 20 20 | 70 75 74 73 74 72 20 28 |;. |putstr (|
|00001da0| 74 6d 70 29 3b 0a 20 20 | 20 20 20 20 70 75 74 73 |tmp);. | puts|
|00001db0| 74 72 20 28 22 5c 6e 22 | 29 3b 0a 20 20 20 7d 0a |tr ("\n"|);. }.|
|00001dc0| 23 65 6e 64 69 66 0a 0a | 20 20 20 73 77 69 74 63 |#endif..| switc|
|00001dd0| 68 20 28 6c 65 76 65 6c | 20 26 20 30 78 37 66 29 |h (level| & 0x7f)|
|00001de0| 20 7b 0a 20 20 20 20 20 | 20 63 61 73 65 20 27 6d | {. | case 'm|
|00001df0| 27 3a 20 62 72 65 61 6b | 3b 0a 20 20 20 20 20 20 |': break|;. |
|00001e00| 63 61 73 65 20 27 77 27 | 3a 20 70 75 74 73 74 72 |case 'w'|: putstr|
|00001e10| 20 28 22 57 41 52 4e 49 | 4e 47 3a 20 20 22 29 3b | ("WARNI|NG: ");|
|00001e20| 20 62 72 65 61 6b 3b 0a | 20 20 20 20 20 20 63 61 | break;.| ca|
|00001e30| 73 65 20 27 65 27 3a 20 | 70 75 74 73 74 72 20 28 |se 'e': |putstr (|
|00001e40| 22 45 52 52 4f 52 3a 20 | 20 22 29 3b 20 62 72 65 |"ERROR: | "); bre|
|00001e50| 61 6b 3b 0a 20 20 20 20 | 20 20 63 61 73 65 20 27 |ak;. | case '|
|00001e60| 66 27 3a 20 70 75 74 73 | 74 72 20 28 22 46 41 54 |f': puts|tr ("FAT|
|00001e70| 41 4c 3a 20 20 22 29 3b | 20 62 72 65 61 6b 3b 0a |AL: ");| break;.|
|00001e80| 20 20 20 20 20 20 64 65 | 66 61 75 6c 74 3a 20 70 | de|fault: p|
|00001e90| 72 74 65 72 72 6f 72 20 | 28 27 66 27 2c 20 22 49 |rterror |('f', "I|
|00001ea0| 6e 74 65 72 6e 61 6c 20 | 65 72 72 6f 72 5c 6e 22 |nternal |error\n"|
|00001eb0| 2c 20 28 28 63 68 61 72 | 20 2a 29 20 30 29 2c 20 |, ((char| *) 0), |
|00001ec0| 28 28 63 68 61 72 20 2a | 29 20 30 29 29 3b 0a 20 |((char *|) 0));. |
|00001ed0| 20 20 7d 0a 20 20 20 70 | 75 74 73 74 72 20 28 61 | }. p|utstr (a|
|00001ee0| 29 3b 0a 20 20 20 70 75 | 74 73 74 72 20 28 62 29 |);. pu|tstr (b)|
|00001ef0| 3b 0a 20 20 20 70 75 74 | 73 74 72 20 28 63 29 3b |;. put|str (c);|
|00001f00| 0a 0a 20 20 20 69 66 20 | 28 6c 65 76 65 6c 20 3d |.. if |(level =|
|00001f10| 3d 20 27 66 27 29 20 20 | 20 20 20 20 20 2f 2a 20 |= 'f') | /* |
|00001f20| 61 6e 64 20 61 62 6f 72 | 74 20 6f 6e 20 66 61 74 |and abor|t on fat|
|00001f30| 61 6c 20 65 72 72 6f 72 | 20 27 66 27 20 62 75 74 |al error| 'f' but|
|00001f40| 20 6e 6f 74 20 27 46 27 | 20 2a 2f 0a 20 20 20 20 | not 'F'| */. |
|00001f50| 20 20 65 78 69 74 20 28 | 31 29 3b 0a 7d 0a 0a 2f | exit (|1);.}../|
|00001f60| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 0a 54 68 |********|*****.Th|
|00001f70| 69 73 20 66 75 6e 63 74 | 69 6f 6e 20 63 6f 70 69 |is funct|ion copi|
|00001f80| 65 73 20 63 6f 75 6e 74 | 20 63 68 61 72 61 63 74 |es count| charact|
|00001f90| 65 72 73 20 66 72 6f 6d | 20 74 68 65 20 73 6f 75 |ers from| the sou|
|00001fa0| 72 63 65 20 66 69 6c 65 | 20 74 6f 20 74 68 65 0a |rce file| to the.|
|00001fb0| 64 65 73 74 69 6e 61 74 | 69 6f 6e 20 46 75 6e 63 |destinat|ion Func|
|00001fc0| 74 69 6f 6e 20 72 65 74 | 75 72 6e 20 76 61 6c 75 |tion ret|urn valu|
|00001fd0| 65 20 69 73 20 30 20 69 | 66 20 6e 6f 20 65 72 72 |e is 0 i|f no err|
|00001fe0| 6f 72 2c 20 32 20 69 66 | 20 77 72 69 74 65 20 65 |or, 2 if| write e|
|00001ff0| 72 72 6f 72 2c 0a 61 6e | 64 20 33 20 69 66 20 72 |rror,.an|d 3 if r|
|00002000| 65 61 64 20 65 72 72 6f | 72 2e 20 20 0a 0a 54 68 |ead erro|r. ..Th|
|00002010| 65 20 67 6c 6f 62 61 6c | 20 76 61 72 69 61 62 6c |e global| variabl|
|00002020| 65 20 63 72 63 63 6f 64 | 65 20 69 73 20 75 70 64 |e crccod|e is upd|
|00002030| 61 74 65 64 2e 0a 2a 2f | 0a 65 78 74 65 72 6e 20 |ated..*/|.extern |
|00002040| 63 68 61 72 20 6f 75 74 | 5f 62 75 66 5f 61 64 72 |char out|_buf_adr|
|00002050| 5b 5d 3b 0a 0a 69 6e 74 | 20 67 65 74 66 69 6c 65 |[];..int| getfile|
|00002060| 28 69 6e 70 75 74 5f 68 | 61 6e 2c 20 6f 75 74 70 |(input_h|an, outp|
|00002070| 75 74 5f 68 61 6e 2c 20 | 63 6f 75 6e 74 29 0a 69 |ut_han, |count).i|
|00002080| 6e 74 20 69 6e 70 75 74 | 5f 68 61 6e 2c 20 6f 75 |nt input|_han, ou|
|00002090| 74 70 75 74 5f 68 61 6e | 3b 0a 6c 6f 6e 67 20 63 |tput_han|;.long c|
|000020a0| 6f 75 6e 74 3b 0a 7b 0a | 20 20 20 72 65 67 69 73 |ount;.{.| regis|
|000020b0| 74 65 72 20 69 6e 74 20 | 68 6f 77 5f 6d 75 63 68 |ter int |how_much|
|000020c0| 3b 0a 0a 20 20 20 77 68 | 69 6c 65 20 28 63 6f 75 |;.. wh|ile (cou|
|000020d0| 6e 74 20 3e 20 30 29 20 | 7b 0a 20 20 20 20 20 20 |nt > 0) |{. |
|000020e0| 69 66 20 28 63 6f 75 6e | 74 20 3e 20 4f 55 54 5f |if (coun|t > OUT_|
|000020f0| 42 55 46 5f 53 49 5a 45 | 29 0a 20 20 20 20 20 20 |BUF_SIZE|). |
|00002100| 20 20 20 68 6f 77 5f 6d | 75 63 68 20 3d 20 4f 55 | how_m|uch = OU|
|00002110| 54 5f 42 55 46 5f 53 49 | 5a 45 3b 0a 20 20 20 20 |T_BUF_SI|ZE;. |
|00002120| 20 20 65 6c 73 65 0a 20 | 20 20 20 20 20 20 20 20 | else. | |
|00002130| 68 6f 77 5f 6d 75 63 68 | 20 3d 20 63 6f 75 6e 74 |how_much| = count|
|00002140| 3b 0a 20 20 20 20 20 20 | 63 6f 75 6e 74 20 2d 3d |;. |count -=|
|00002150| 20 68 6f 77 5f 6d 75 63 | 68 3b 0a 20 20 20 20 20 | how_muc|h;. |
|00002160| 20 69 66 20 28 72 65 61 | 64 20 28 69 6e 70 75 74 | if (rea|d (input|
|00002170| 5f 68 61 6e 2c 20 6f 75 | 74 5f 62 75 66 5f 61 64 |_han, ou|t_buf_ad|
|00002180| 72 2c 20 68 6f 77 5f 6d | 75 63 68 29 20 21 3d 20 |r, how_m|uch) != |
|00002190| 68 6f 77 5f 6d 75 63 68 | 29 0a 20 20 20 20 20 20 |how_much|). |
|000021a0| 20 20 20 72 65 74 75 72 | 6e 20 28 33 29 3b 0a 20 | retur|n (3);. |
|000021b0| 20 20 20 20 20 61 64 64 | 62 66 63 72 63 20 28 6f | add|bfcrc (o|
|000021c0| 75 74 5f 62 75 66 5f 61 | 64 72 2c 20 68 6f 77 5f |ut_buf_a|dr, how_|
|000021d0| 6d 75 63 68 29 3b 0a 20 | 20 20 20 20 20 69 66 20 |much);. | if |
|000021e0| 28 6f 75 74 70 75 74 5f | 68 61 6e 20 21 3d 20 2d |(output_|han != -|
|000021f0| 32 20 26 26 0a 20 20 20 | 20 20 20 20 20 20 20 20 |2 &&. | |
|00002200| 20 77 72 69 74 65 20 28 | 6f 75 74 70 75 74 5f 68 | write (|output_h|
|00002210| 61 6e 2c 20 6f 75 74 5f | 62 75 66 5f 61 64 72 2c |an, out_|buf_adr,|
|00002220| 20 68 6f 77 5f 6d 75 63 | 68 29 20 21 3d 20 68 6f | how_muc|h) != ho|
|00002230| 77 5f 6d 75 63 68 29 0a | 20 20 20 20 20 20 20 20 |w_much).| |
|00002240| 20 72 65 74 75 72 6e 20 | 28 32 29 3b 0a 20 20 20 | return |(2);. |
|00002250| 7d 0a 20 20 20 72 65 74 | 75 72 6e 20 28 30 29 3b |}. ret|urn (0);|
|00002260| 0a 7d 0a 0a 23 69 66 6e | 64 65 66 20 54 49 4e 59 |.}..#ifn|def TINY|
|00002270| 0a 0a 69 6e 74 20 6e 65 | 65 64 65 64 20 28 66 6e |..int ne|eded (fn|
|00002280| 61 6d 65 2c 20 61 72 67 | 63 2c 20 61 72 67 76 29 |ame, arg|c, argv)|
|00002290| 0a 63 68 61 72 20 2a 66 | 6e 61 6d 65 3b 0a 69 6e |.char *f|name;.in|
|000022a0| 74 20 61 72 67 63 3b 0a | 63 68 61 72 20 2a 61 72 |t argc;.|char *ar|
|000022b0| 67 76 5b 5d 3b 0a 7b 0a | 20 20 20 72 65 67 69 73 |gv[];.{.| regis|
|000022c0| 74 65 72 20 69 6e 74 20 | 69 3b 0a 20 20 20 69 66 |ter int |i;. if|
|000022d0| 20 28 61 72 67 63 20 3d | 3d 20 30 29 0a 20 20 20 | (argc =|= 0). |
|000022e0| 20 20 20 72 65 74 75 72 | 6e 20 28 31 29 3b 0a 20 | retur|n (1);. |
|000022f0| 20 20 66 6f 72 20 28 69 | 20 3d 20 30 3b 20 69 20 | for (i| = 0; i |
|00002300| 3c 20 61 72 67 63 3b 20 | 69 2b 2b 29 20 7b 0a 20 |< argc; |i++) {. |
|00002310| 20 20 20 20 20 69 66 20 | 28 6d 61 74 63 68 20 28 | if |(match (|
|00002320| 66 6e 61 6d 65 2c 20 61 | 72 67 76 5b 69 5d 29 29 |fname, a|rgv[i]))|
|00002330| 0a 20 20 20 20 20 20 20 | 20 20 72 65 74 75 72 6e |. | return|
|00002340| 20 28 31 29 3b 0a 20 20 | 20 7d 0a 20 20 20 72 65 | (1);. | }. re|
|00002350| 74 75 72 6e 20 28 30 29 | 3b 0a 7d 0a 0a 2f 2a 2a |turn (0)|;.}../**|
|00002360| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002370| 2a 2a 2a 2a 2a 2f 0a 2f | 2a 0a 6d 61 74 63 68 28 |*****/./|*.match(|
|00002380| 29 20 63 6f 6d 70 61 72 | 65 73 20 61 20 70 61 74 |) compar|es a pat|
|00002390| 74 65 72 6e 20 77 69 74 | 68 20 61 20 73 74 72 69 |tern wit|h a stri|
|000023a0| 6e 67 2e 20 20 57 69 6c | 64 63 61 72 64 73 20 61 |ng. Wil|dcards a|
|000023b0| 63 63 65 70 74 65 64 20 | 69 6e 0a 74 68 65 20 70 |ccepted |in.the p|
|000023c0| 61 74 74 65 72 6e 20 61 | 72 65 3a 20 20 22 2a 22 |attern a|re: "*"|
|000023d0| 20 66 6f 72 20 7a 65 72 | 6f 20 6f 72 20 6d 6f 72 | for zer|o or mor|
|000023e0| 65 20 61 72 62 69 74 72 | 61 72 79 20 63 68 61 72 |e arbitr|ary char|
|000023f0| 61 63 74 65 72 73 3b 20 | 20 22 3f 22 0a 66 6f 72 |acters; | "?".for|
|00002400| 20 61 6e 79 20 6f 6e 65 | 20 63 68 61 72 61 63 74 | any one| charact|
|00002410| 65 72 73 2e 20 20 55 6e | 6c 69 6b 65 20 74 68 65 |ers. Un|like the|
|00002420| 20 4d 53 2d 44 4f 53 20 | 77 69 6c 64 63 61 72 64 | MS-DOS |wildcard|
|00002430| 20 6d 61 74 63 68 2c 20 | 22 2a 22 20 69 73 0a 63 | match, |"*" is.c|
|00002440| 6f 72 72 65 63 74 6c 79 | 20 68 61 6e 64 6c 65 64 |orrectly| handled|
|00002450| 20 65 76 65 6e 20 69 66 | 20 69 74 20 69 73 6e 27 | even if| it isn'|
|00002460| 74 20 61 74 20 74 68 65 | 20 65 6e 64 20 6f 66 20 |t at the| end of |
|00002470| 74 68 65 20 70 61 74 74 | 65 72 6e 2e 20 22 2e 27 |the patt|ern. ".'|
|00002480| 0a 69 73 20 6e 6f 74 20 | 73 70 65 63 69 61 6c 2e |.is not |special.|
|00002490| 0a 0a 4f 72 69 67 69 6e | 61 6c 6c 79 20 77 72 69 |..Origin|ally wri|
|000024a0| 74 74 65 6e 20 62 79 20 | 4a 65 66 66 20 44 61 6d |tten by |Jeff Dam|
|000024b0| 65 6e 73 20 6f 66 20 43 | 6f 6c 75 6d 62 69 61 20 |ens of C|olumbia |
|000024c0| 55 6e 69 76 65 72 73 69 | 74 79 20 43 65 6e 74 65 |Universi|ty Cente|
|000024d0| 72 20 66 6f 72 0a 43 6f | 6d 70 75 74 69 6e 67 20 |r for.Co|mputing |
|000024e0| 41 63 74 69 76 69 74 69 | 65 73 2e 20 20 54 61 6b |Activiti|es. Tak|
|000024f0| 65 6e 20 66 72 6f 6d 20 | 74 68 65 20 73 6f 75 72 |en from |the sour|
|00002500| 63 65 20 63 6f 64 65 20 | 66 6f 72 20 43 2d 4b 65 |ce code |for C-Ke|
|00002510| 72 6d 69 74 20 76 65 72 | 73 69 6f 6e 0a 34 43 2e |rmit ver|sion.4C.|
|00002520| 0a 2a 2f 0a 0a 69 6e 74 | 20 6d 61 74 63 68 20 28 |.*/..int| match (|
|00002530| 73 74 72 69 6e 67 2c 20 | 70 61 74 74 65 72 6e 29 |string, |pattern)|
|00002540| 20 0a 72 65 67 69 73 74 | 65 72 20 63 68 61 72 20 | .regist|er char |
|00002550| 2a 73 74 72 69 6e 67 2c | 20 2a 70 61 74 74 65 72 |*string,| *patter|
|00002560| 6e 3b 0a 7b 0a 20 20 20 | 63 68 61 72 20 2a 70 73 |n;.{. |char *ps|
|00002570| 61 76 65 2c 2a 73 73 61 | 76 65 3b 20 20 20 20 20 |ave,*ssa|ve; |
|00002580| 20 20 20 2f 2a 20 62 61 | 63 6b 20 75 70 20 70 6f | /* ba|ck up po|
|00002590| 69 6e 74 65 72 73 20 66 | 6f 72 20 66 61 69 6c 75 |inters f|or failu|
|000025a0| 72 65 20 2a 2f 0a 20 20 | 20 70 73 61 76 65 20 3d |re */. | psave =|
|000025b0| 20 73 73 61 76 65 20 3d | 20 28 28 63 68 61 72 20 | ssave =| ((char |
|000025c0| 2a 29 20 30 29 3b 0a 20 | 20 20 77 68 69 6c 65 20 |*) 0);. | while |
|000025d0| 28 31 29 20 7b 0a 20 20 | 20 20 20 20 66 6f 72 20 |(1) {. | for |
|000025e0| 28 3b 20 2a 70 61 74 74 | 65 72 6e 20 3d 3d 20 2a |(; *patt|ern == *|
|000025f0| 73 74 72 69 6e 67 3b 20 | 70 61 74 74 65 72 6e 2b |string; |pattern+|
|00002600| 2b 2c 73 74 72 69 6e 67 | 2b 2b 29 20 20 2f 2a 20 |+,string|++) /* |
|00002610| 73 6b 69 70 20 66 69 72 | 73 74 20 2a 2f 0a 20 20 |skip fir|st */. |
|00002620| 20 20 20 20 20 20 20 69 | 66 20 28 2a 73 74 72 69 | i|f (*stri|
|00002630| 6e 67 20 3d 3d 20 27 5c | 30 27 29 20 0a 20 20 20 |ng == '\|0') . |
|00002640| 20 20 20 20 20 20 20 20 | 20 72 65 74 75 72 6e 28 | | return(|
|00002650| 31 29 3b 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |1); | |
|00002660| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 2f 2a 20 | | /* |
|00002670| 65 6e 64 20 6f 66 20 73 | 74 72 69 6e 67 73 2c 20 |end of s|trings, |
|00002680| 73 75 63 63 65 65 64 20 | 2a 2f 0a 20 20 20 20 20 |succeed |*/. |
|00002690| 20 69 66 20 28 2a 73 74 | 72 69 6e 67 20 21 3d 20 | if (*st|ring != |
|000026a0| 27 5c 30 27 20 26 26 20 | 2a 70 61 74 74 65 72 6e |'\0' && |*pattern|
|000026b0| 20 3d 3d 20 27 3f 27 29 | 20 7b 0a 20 20 20 20 20 | == '?')| {. |
|000026c0| 20 20 20 20 70 61 74 74 | 65 72 6e 2b 2b 3b 20 20 | patt|ern++; |
|000026d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000026e0| 20 20 20 20 20 20 20 20 | 20 20 20 2f 2a 20 27 3f | | /* '?|
|000026f0| 27 2c 20 6c 65 74 20 69 | 74 20 6d 61 74 63 68 20 |', let i|t match |
|00002700| 2a 2f 0a 20 20 20 20 20 | 20 20 20 20 73 74 72 69 |*/. | stri|
|00002710| 6e 67 2b 2b 3b 0a 20 20 | 20 20 20 20 7d 20 65 6c |ng++;. | } el|
|00002720| 73 65 20 69 66 20 28 2a | 70 61 74 74 65 72 6e 20 |se if (*|pattern |
|00002730| 3d 3d 20 27 2a 27 29 20 | 7b 20 20 20 20 20 20 20 |== '*') |{ |
|00002740| 20 20 20 20 20 20 2f 2a | 20 27 2a 27 20 2e 2e 2e | /*| '*' ...|
|00002750| 20 2a 2f 0a 20 20 20 20 | 20 20 20 20 20 70 73 61 | */. | psa|
|00002760| 76 65 20 3d 20 2b 2b 70 | 61 74 74 65 72 6e 3b 20 |ve = ++p|attern; |
|00002770| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002780| 20 20 20 20 2f 2a 20 72 | 65 6d 65 6d 62 65 72 20 | /* r|emember |
|00002790| 77 68 65 72 65 20 77 65 | 20 73 61 77 20 69 74 20 |where we| saw it |
|000027a0| 2a 2f 0a 20 20 20 20 20 | 20 20 20 20 73 73 61 76 |*/. | ssav|
|000027b0| 65 20 3d 20 73 74 72 69 | 6e 67 3b 20 20 20 20 20 |e = stri|ng; |
|000027c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000027d0| 20 20 20 2f 2a 20 6c 65 | 74 20 69 74 20 6d 61 74 | /* le|t it mat|
|000027e0| 63 68 20 30 20 63 68 61 | 72 73 20 2a 2f 0a 20 20 |ch 0 cha|rs */. |
|000027f0| 20 20 20 20 7d 20 65 6c | 73 65 20 69 66 20 28 73 | } el|se if (s|
|00002800| 73 61 76 65 20 21 3d 20 | 28 28 63 68 61 72 20 2a |save != |((char *|
|00002810| 29 20 30 29 20 26 26 20 | 2a 73 73 61 76 65 20 21 |) 0) && |*ssave !|
|00002820| 3d 20 27 5c 30 27 29 20 | 7b 20 20 20 2f 2a 20 69 |= '\0') |{ /* i|
|00002830| 66 20 6e 6f 74 20 61 74 | 20 65 6e 64 20 20 2a 2f |f not at| end */|
|00002840| 0a 20 20 20 20 20 20 20 | 20 20 2f 2a 20 2e 2e 2e |. | /* ...|
|00002850| 68 61 76 65 20 73 65 65 | 6e 20 61 20 73 74 61 72 |have see|n a star|
|00002860| 20 2a 2f 0a 20 20 20 20 | 20 20 20 20 20 73 74 72 | */. | str|
|00002870| 69 6e 67 20 3d 20 2b 2b | 73 73 61 76 65 3b 20 20 |ing = ++|ssave; |
|00002880| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002890| 20 20 20 20 2f 2a 20 73 | 6b 69 70 20 31 20 63 68 | /* s|kip 1 ch|
|000028a0| 61 72 20 66 72 6f 6d 20 | 73 74 72 69 6e 67 20 2a |ar from |string *|
|000028b0| 2f 0a 20 20 20 20 20 20 | 20 20 20 70 61 74 74 65 |/. | patte|
|000028c0| 72 6e 20 3d 20 70 73 61 | 76 65 3b 20 20 20 20 20 |rn = psa|ve; |
|000028d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000028e0| 20 20 2f 2a 20 61 6e 64 | 20 62 61 63 6b 20 75 70 | /* and| back up|
|000028f0| 20 70 61 74 74 65 72 6e | 20 2a 2f 0a 20 20 20 20 | pattern| */. |
|00002900| 20 20 7d 20 65 6c 73 65 | 20 0a 20 20 20 20 20 20 | } else| . |
|00002910| 20 20 20 72 65 74 75 72 | 6e 28 30 29 3b 20 20 20 | retur|n(0); |
|00002920| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002930| 20 20 20 20 20 20 20 20 | 20 20 2f 2a 20 6f 74 68 | | /* oth|
|00002940| 65 72 77 69 73 65 20 6a | 75 73 74 20 66 61 69 6c |erwise j|ust fail|
|00002950| 20 2a 2f 0a 20 20 20 7d | 0a 7d 0a 0a 23 65 6e 64 | */. }|.}..#end|
|00002960| 69 66 20 2f 2a 20 6e 64 | 65 66 20 54 49 4e 59 20 |if /* nd|ef TINY |
|00002970| 2a 2f 0a 0a 69 6e 74 20 | 6d 65 6d 65 72 72 28 29 |*/..int |memerr()|
|00002980| 0a 7b 0a 20 20 20 70 72 | 74 65 72 72 6f 72 20 28 |.{. pr|terror (|
|00002990| 27 66 27 2c 20 22 52 61 | 6e 20 6f 75 74 20 6f 66 |'f', "Ra|n out of|
|000029a0| 20 6d 65 6d 6f 72 79 5c | 6e 22 29 3b 0a 7d 0a 0a | memory\|n");.}..|
|000029b0| 23 69 66 64 65 66 20 42 | 49 47 0a 2f 2a 20 63 66 |#ifdef B|IG./* cf|
|000029c0| 61 63 74 6f 72 28 29 20 | 63 61 6c 63 75 6c 61 74 |actor() |calculat|
|000029d0| 65 73 20 74 68 65 20 63 | 6f 6d 70 72 65 73 73 69 |es the c|ompressi|
|000029e0| 6f 6e 20 66 61 63 74 6f | 72 20 67 69 76 65 6e 20 |on facto|r given |
|000029f0| 61 20 64 69 72 65 63 74 | 6f 72 79 20 65 6e 74 72 |a direct|ory entr|
|00002a00| 79 20 2a 2f 0a 69 6e 74 | 20 63 66 61 63 74 6f 72 |y */.int| cfactor|
|00002a10| 20 28 6f 72 67 5f 73 69 | 7a 65 2c 20 73 69 7a 65 | (org_si|ze, size|
|00002a20| 5f 6e 6f 77 29 0a 6c 6f | 6e 67 20 6f 72 67 5f 73 |_now).lo|ng org_s|
|00002a30| 69 7a 65 2c 20 73 69 7a | 65 5f 6e 6f 77 3b 0a 7b |ize, siz|e_now;.{|
|00002a40| 0a 20 20 20 72 65 67 69 | 73 74 65 72 20 69 6e 74 |. regi|ster int|
|00002a50| 20 73 69 7a 65 5f 66 61 | 63 74 6f 72 3b 0a 0a 20 | size_fa|ctor;.. |
|00002a60| 20 20 77 68 69 6c 65 20 | 28 6f 72 67 5f 73 69 7a | while |(org_siz|
|00002a70| 65 20 3e 20 31 30 30 30 | 30 29 20 7b 20 2f 2a 20 |e > 1000|0) { /* |
|00002a80| 61 76 6f 69 64 20 6f 76 | 65 72 66 6c 6f 77 20 62 |avoid ov|erflow b|
|00002a90| 65 6c 6f 77 20 2a 2f 0a | 20 20 20 20 20 20 6f 72 |elow */.| or|
|00002aa0| 67 5f 73 69 7a 65 20 3d | 20 6f 72 67 5f 73 69 7a |g_size =| org_siz|
|00002ab0| 65 20 3e 3e 20 34 3b 0a | 20 20 20 20 20 20 73 69 |e >> 4;.| si|
|00002ac0| 7a 65 5f 6e 6f 77 20 3d | 20 73 69 7a 65 5f 6e 6f |ze_now =| size_no|
|00002ad0| 77 20 3e 3e 20 34 3b 0a | 20 20 20 7d 0a 20 20 20 |w >> 4;.| }. |
|00002ae0| 69 66 20 28 6f 72 67 5f | 73 69 7a 65 20 3d 3d 20 |if (org_|size == |
|00002af0| 30 29 20 20 20 20 20 20 | 20 20 20 2f 2a 20 61 76 |0) | /* av|
|00002b00| 6f 69 64 20 64 69 76 69 | 73 69 6f 6e 20 62 79 20 |oid divi|sion by |
|00002b10| 7a 65 72 6f 20 2a 2f 0a | 20 20 20 20 20 20 73 69 |zero */.| si|
|00002b20| 7a 65 5f 66 61 63 74 6f | 72 20 3d 20 30 3b 0a 20 |ze_facto|r = 0;. |
|00002b30| 20 20 65 6c 73 65 20 7b | 0a 20 20 20 20 20 20 73 | else {|. s|
|00002b40| 69 7a 65 5f 66 61 63 74 | 6f 72 20 3d 20 0a 20 20 |ize_fact|or = . |
|00002b50| 20 20 20 20 20 20 20 28 | 0a 20 20 20 20 20 20 20 | (|. |
|00002b60| 20 20 20 20 20 28 31 30 | 30 30 20 2a 20 0a 20 20 | (10|00 * . |
|00002b70| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 28 6f 72 | | (or|
|00002b80| 67 5f 73 69 7a 65 20 2d | 20 73 69 7a 65 5f 6e 6f |g_size -| size_no|
|00002b90| 77 29 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 29 |w). | )|
|00002ba0| 20 2f 20 6f 72 67 5f 73 | 69 7a 65 20 2b 20 35 0a | / org_s|ize + 5.|
|00002bb0| 20 20 20 20 20 20 20 20 | 20 29 20 2f 20 31 30 3b | | ) / 10;|
|00002bc0| 0a 20 20 20 7d 0a 20 20 | 20 72 65 74 75 72 6e 20 |. }. | return |
|00002bd0| 28 73 69 7a 65 5f 66 61 | 63 74 6f 72 29 3b 0a 7d |(size_fa|ctor);.}|
|00002be0| 0a 0a 2f 2a 2a 2a 2a 2a | 2a 0a 46 75 6e 63 74 69 |../*****|*.Functi|
|00002bf0| 6f 6e 20 69 74 6f 61 28 | 29 20 63 6f 6e 76 65 72 |on itoa(|) conver|
|00002c00| 74 73 20 61 20 70 6f 73 | 69 74 69 76 65 20 6c 6f |ts a pos|itive lo|
|00002c10| 6e 67 20 69 6e 74 65 67 | 65 72 20 69 6e 74 6f 20 |ng integ|er into |
|00002c20| 61 20 74 65 78 74 20 73 | 74 72 69 6e 67 20 6f 66 |a text s|tring of|
|00002c30| 0a 64 69 67 69 74 73 2e | 20 20 54 68 65 20 62 75 |.digits.| The bu|
|00002c40| 66 66 65 72 20 70 6f 69 | 6e 74 65 72 20 62 75 66 |ffer poi|nter buf|
|00002c50| 20 6d 75 73 74 20 70 6f | 69 6e 74 20 74 6f 20 61 | must po|int to a|
|00002c60| 20 62 75 66 66 65 72 20 | 74 6f 20 72 65 63 65 69 | buffer |to recei|
|00002c70| 76 65 20 74 68 65 0a 64 | 69 67 69 74 20 73 74 72 |ve the.d|igit str|
|00002c80| 69 6e 67 2e 20 20 54 68 | 65 20 64 69 67 69 74 20 |ing. Th|e digit |
|00002c90| 73 74 72 69 6e 67 20 69 | 73 20 73 74 6f 72 65 64 |string i|s stored|
|00002ca0| 20 72 69 67 68 74 20 6a | 75 73 74 69 66 69 65 64 | right j|ustified|
|00002cb0| 20 69 6e 20 74 68 65 0a | 62 75 66 66 65 72 20 77 | in the.|buffer w|
|00002cc0| 69 74 68 20 6c 65 61 64 | 69 6e 67 20 62 6c 61 6e |ith lead|ing blan|
|00002cd0| 6b 73 2e 20 20 49 66 20 | 74 68 65 20 73 75 70 70 |ks. If |the supp|
|00002ce0| 6c 69 65 64 20 6e 75 6d | 62 65 72 20 69 73 20 6e |lied num|ber is n|
|00002cf0| 65 67 61 74 69 76 65 2c | 20 6f 72 20 69 66 0a 6f |egative,| or if.o|
|00002d00| 76 65 72 66 6c 6f 77 20 | 6f 63 63 75 72 73 2c 20 |verflow |occurs, |
|00002d10| 61 20 73 69 6e 67 6c 65 | 20 27 2a 27 20 69 73 20 |a single| '*' is |
|00002d20| 72 65 74 75 72 6e 65 64 | 2e 0a 2a 2f 0a 0a 63 68 |returned|..*/..ch|
|00002d30| 61 72 20 2a 69 74 6f 61 | 20 28 70 61 64 5f 63 68 |ar *itoa| (pad_ch|
|00002d40| 2c 20 6e 2c 20 62 75 66 | 2c 20 62 75 66 6c 65 6e |, n, buf|, buflen|
|00002d50| 29 0a 63 68 61 72 20 70 | 61 64 5f 63 68 3b 20 20 |).char p|ad_ch; |
|00002d60| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002d70| 2f 2a 20 6c 65 61 64 69 | 6e 67 20 70 61 64 20 63 |/* leadi|ng pad c|
|00002d80| 68 61 72 61 63 74 65 72 | 20 2a 2f 0a 6c 6f 6e 67 |haracter| */.long|
|00002d90| 20 6e 3b 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | n; | |
|00002da0| 20 20 20 20 20 20 20 20 | 20 20 2f 2a 20 70 6f 73 | | /* pos|
|00002db0| 69 74 69 76 65 20 6c 6f | 6e 67 20 69 6e 74 20 74 |itive lo|ng int t|
|00002dc0| 6f 20 63 6f 6e 76 65 72 | 74 20 2a 2f 0a 63 68 61 |o conver|t */.cha|
|00002dd0| 72 20 2a 62 75 66 3b 20 | 20 20 20 20 20 20 20 20 |r *buf; | |
|00002de0| 20 20 20 20 20 20 20 20 | 20 20 20 2f 2a 20 62 75 | | /* bu|
|00002df0| 66 66 65 72 20 74 6f 20 | 72 65 63 65 69 76 65 20 |ffer to |receive |
|00002e00| 64 69 67 69 74 20 73 74 | 72 69 6e 67 20 2a 2f 0a |digit st|ring */.|
|00002e10| 69 6e 74 20 62 75 66 6c | 65 6e 3b 20 20 20 20 20 |int bufl|en; |
|00002e20| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2f 2a | | /*|
|00002e30| 20 6c 65 6e 67 74 68 20 | 6f 66 20 62 75 66 66 65 | length |of buffe|
|00002e40| 72 20 2a 2f 0a 7b 0a 20 | 20 20 63 68 61 72 20 2a |r */.{. | char *|
|00002e50| 70 3b 0a 20 20 20 69 6e | 74 20 69 3b 0a 20 20 20 |p;. in|t i;. |
|00002e60| 66 6f 72 20 28 69 20 3d | 20 30 3b 20 20 69 20 3c |for (i =| 0; i <|
|00002e70| 20 62 75 66 6c 65 6e 3b | 20 20 69 2b 2b 29 20 20 | buflen;| i++) |
|00002e80| 20 20 20 20 20 20 20 2f | 2a 20 66 69 6c 6c 20 62 | /|* fill b|
|00002e90| 75 66 66 65 72 20 77 69 | 74 68 20 70 61 64 20 63 |uffer wi|th pad c|
|00002ea0| 68 61 72 20 2a 2f 0a 20 | 20 20 20 20 20 62 75 66 |har */. | buf|
|00002eb0| 5b 69 5d 20 3d 20 70 61 | 64 5f 63 68 3b 0a 20 20 |[i] = pa|d_ch;. |
|00002ec0| 20 70 20 3d 20 62 75 66 | 20 2b 20 62 75 66 6c 65 | p = buf| + bufle|
|00002ed0| 6e 20 2d 20 31 3b 0a 20 | 20 20 2a 70 2d 2d 20 3d |n - 1;. | *p-- =|
|00002ee0| 20 27 5c 30 27 3b 20 20 | 20 20 20 20 20 20 20 20 | '\0'; | |
|00002ef0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002f00| 20 2f 2a 20 65 6e 73 75 | 72 65 20 6e 75 6c 6c 20 | /* ensu|re null |
|00002f10| 74 65 72 6d 69 6e 61 74 | 69 6f 6e 20 2a 2f 0a 20 |terminat|ion */. |
|00002f20| 20 20 69 20 3d 20 62 75 | 66 6c 65 6e 20 2d 20 31 | i = bu|flen - 1|
|00002f30| 3b 0a 20 20 20 66 6f 72 | 20 28 3b 3b 29 20 7b 0a |;. for| (;;) {.|
|00002f40| 20 20 20 20 20 20 69 66 | 20 28 6e 20 3c 20 30 29 | if| (n < 0)|
|00002f50| 20 7b 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | { | |
|00002f60| 20 20 20 20 20 20 20 20 | 20 20 2f 2a 20 63 61 6e | | /* can|
|00002f70| 27 74 20 68 61 6e 64 6c | 65 20 6e 65 67 61 74 69 |'t handl|e negati|
|00002f80| 76 65 20 6e 20 2a 2f 0a | 20 20 20 20 20 20 20 20 |ve n */.| |
|00002f90| 20 67 6f 74 6f 20 6f 76 | 65 72 66 6c 6f 77 3b 0a | goto ov|erflow;.|
|00002fa0| 20 20 20 20 20 20 7d 20 | 65 6c 73 65 20 7b 0a 20 | } |else {. |
|00002fb0| 20 20 20 20 20 20 20 20 | 2a 70 2d 2d 20 3d 20 28 | |*p-- = (|
|00002fc0| 69 6e 74 29 20 28 6e 20 | 25 20 31 30 29 20 2b 20 |int) (n |% 10) + |
|00002fd0| 27 30 27 3b 20 20 20 20 | 20 2f 2a 20 73 74 6f 72 |'0'; | /* stor|
|00002fe0| 65 20 61 20 63 6f 6e 76 | 65 72 74 65 64 20 64 69 |e a conv|erted di|
|00002ff0| 67 69 74 20 2a 2f 0a 20 | 20 20 20 20 20 20 20 20 |git */. | |
|00003000| 6e 20 3d 20 6e 20 2f 20 | 31 30 3b 0a 20 20 20 20 |n = n / |10;. |
|00003010| 20 20 20 20 20 69 2d 2d | 3b 0a 20 20 20 20 20 20 | i--|;. |
|00003020| 20 20 20 69 66 20 28 6e | 20 3d 3d 20 30 20 7c 7c | if (n| == 0 |||
|00003030| 20 69 20 3d 3d 20 30 29 | 0a 20 20 20 20 20 20 20 | i == 0)|. |
|00003040| 20 20 20 20 20 62 72 65 | 61 6b 3b 0a 20 20 20 20 | bre|ak;. |
|00003050| 20 20 7d 20 2f 2a 20 65 | 6e 64 20 6f 66 20 65 6c | } /* e|nd of el|
|00003060| 73 65 20 6f 66 20 69 66 | 20 28 6e 20 3c 20 30 29 |se of if| (n < 0)|
|00003070| 20 2a 2f 0a 20 20 20 7d | 20 2f 2a 20 65 6e 64 20 | */. }| /* end |
|00003080| 77 68 69 6c 65 20 28 62 | 75 66 6c 65 6e 20 3e 20 |while (b|uflen > |
|00003090| 30 29 20 2a 2f 0a 20 20 | 20 69 66 20 28 6e 20 21 |0) */. | if (n !|
|000030a0| 3d 20 30 29 20 20 20 20 | 20 20 20 20 20 20 20 20 |= 0) | |
|000030b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000030c0| 2f 2a 20 62 75 66 66 65 | 72 20 6f 76 65 72 66 6c |/* buffe|r overfl|
|000030d0| 6f 77 20 2a 2f 0a 20 20 | 20 20 20 20 67 6f 74 6f |ow */. | goto|
|000030e0| 20 6f 76 65 72 66 6c 6f | 77 3b 0a 20 20 20 72 65 | overflo|w;. re|
|000030f0| 74 75 72 6e 20 28 62 75 | 66 29 3b 0a 0a 6f 76 65 |turn (bu|f);..ove|
|00003100| 72 66 6c 6f 77 3a 20 20 | 20 20 20 20 20 20 20 20 |rflow: | |
|00003110| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003120| 20 20 20 20 20 20 20 2f | 2a 20 62 61 64 20 76 61 | /|* bad va|
|00003130| 6c 75 65 20 66 69 6c 6c | 65 64 20 77 69 74 68 20 |lue fill|ed with |
|00003140| 73 74 61 72 73 20 2a 2f | 0a 20 20 20 66 6f 72 20 |stars */|. for |
|00003150| 28 69 20 3d 20 30 3b 20 | 69 20 3c 20 62 75 66 6c |(i = 0; |i < bufl|
|00003160| 65 6e 3b 20 69 2b 2b 29 | 0a 20 20 20 20 20 20 62 |en; i++)|. b|
|00003170| 75 66 5b 69 5d 20 3d 20 | 27 2a 27 3b 0a 20 20 20 |uf[i] = |'*';. |
|00003180| 62 75 66 5b 62 75 66 6c | 65 6e 2d 31 5d 20 3d 20 |buf[bufl|en-1] = |
|00003190| 27 5c 30 27 3b 0a 20 20 | 20 72 65 74 75 72 6e 20 |'\0';. | return |
|000031a0| 28 62 75 66 29 3b 0a 7d | 0a 0a 23 65 6e 64 69 66 |(buf);.}|..#endif|
|000031b0| 20 2f 2a 20 42 49 47 20 | 2a 2f 0a 00 00 00 00 00 | /* BIG |*/......|
|000031c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000031d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000031e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000031f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003200| 62 6f 6f 7a 2f 62 6f 6f | 7a 2e 64 6f 63 00 00 00 |booz/boo|z.doc...|
|00003210| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003220| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003230| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003260| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 32 |.... 6|44 . 2|
|00003270| 34 33 20 00 20 20 20 20 | 31 32 20 00 20 20 20 20 |43 . |12 . |
|00003280| 20 20 31 34 37 36 35 20 | 20 34 34 30 32 30 34 32 | 14765 | 4402042|
|00003290| 32 33 33 20 20 20 36 35 | 34 30 00 20 00 00 00 00 |233 65|40. ....|
|000032a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000032b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000032c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000032d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000032e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000032f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003300| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003310| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003320| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003330| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003340| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003350| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003380| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003390| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000033a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000033b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000033c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000033d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000033e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000033f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003400| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003410| 20 20 20 20 20 20 42 6f | 6f 7a 20 31 2e 30 32 20 | Bo|oz 1.02 |
|00003420| 2d 2d 20 42 61 72 65 62 | 6f 6e 65 73 20 4f 6f 7a |-- Bareb|ones Ooz|
|00003430| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00003440| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003450| 20 20 20 61 0a 20 20 20 | 20 20 20 20 20 20 20 20 | a. | |
|00003460| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 5a 6f | | Zo|
|00003470| 6f 20 45 78 74 72 61 63 | 74 6f 72 2f 4c 69 73 74 |o Extrac|tor/List|
|00003480| 65 72 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |er. | |
|00003490| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000034a0| 20 20 20 20 20 62 79 0a | 20 20 20 20 20 20 20 20 | by.| |
|000034b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000034c0| 20 20 20 20 20 52 61 68 | 75 6c 20 44 68 65 73 69 | Rah|ul Dhesi|
|000034d0| 0a 0a 42 6f 6f 7a 20 31 | 2e 30 32 20 69 73 20 61 |..Booz 1|.02 is a|
|000034e0| 20 73 6d 61 6c 6c 2c 20 | 6d 65 6d 6f 72 79 2d 65 | small, |memory-e|
|000034f0| 66 66 69 63 69 65 6e 74 | 20 5a 6f 6f 20 61 72 63 |fficient| Zoo arc|
|00003500| 68 69 76 65 20 65 78 74 | 72 61 63 74 6f 72 2f 6c |hive ext|ractor/l|
|00003510| 69 73 74 65 72 2e 20 0a | 49 74 20 69 73 20 6e 6f |ister. .|It is no|
|00003520| 74 20 66 61 6e 63 79 2e | 20 20 49 74 20 64 6f 65 |t fancy.| It doe|
|00003530| 73 20 6e 6f 74 20 72 65 | 63 6f 67 6e 69 7a 65 20 |s not re|cognize |
|00003540| 74 68 65 20 61 64 76 61 | 6e 63 65 64 20 66 65 61 |the adva|nced fea|
|00003550| 74 75 72 65 73 0a 61 76 | 61 69 6c 61 62 6c 65 20 |tures.av|ailable |
|00003560| 69 6e 20 63 75 72 72 65 | 6e 74 20 76 65 72 73 69 |in curre|nt versi|
|00003570| 6f 6e 73 20 6f 66 20 5a | 6f 6f 2c 20 73 75 63 68 |ons of Z|oo, such|
|00003580| 20 61 73 20 6c 6f 6e 67 | 20 66 69 6c 65 6e 61 6d | as long| filenam|
|00003590| 65 73 2c 0a 64 69 72 65 | 63 74 6f 72 79 20 6e 61 |es,.dire|ctory na|
|000035a0| 6d 65 73 2c 20 63 6f 6d | 6d 65 6e 74 73 2c 20 61 |mes, com|ments, a|
|000035b0| 6e 64 20 6d 75 6c 74 69 | 70 6c 65 20 66 69 6c 65 |nd multi|ple file|
|000035c0| 20 67 65 6e 65 72 61 74 | 69 6f 6e 73 2e 20 20 45 | generat|ions. E|
|000035d0| 78 74 72 61 63 74 69 6f | 6e 0a 61 6c 77 61 79 73 |xtractio|n.always|
|000035e0| 20 75 73 65 73 20 61 20 | 73 68 6f 72 74 20 4d 53 | uses a |short MS|
|000035f0| 2d 44 4f 53 20 66 6f 72 | 6d 61 74 20 66 69 6c 65 |-DOS for|mat file|
|00003600| 6e 61 6d 65 20 61 6e 64 | 20 61 6c 6c 20 65 78 74 |name and| all ext|
|00003610| 72 61 63 74 65 64 20 66 | 69 6c 65 73 20 67 6f 0a |racted f|iles go.|
|00003620| 69 6e 74 6f 20 74 68 65 | 20 63 75 72 72 65 6e 74 |into the| current|
|00003630| 20 64 69 72 65 63 74 6f | 72 79 2e 0a 0a 42 75 74 | directo|ry...But|
|00003640| 20 42 6f 6f 7a 20 31 2e | 30 32 20 69 73 20 73 69 | Booz 1.|02 is si|
|00003650| 6d 70 6c 65 20 61 6e 64 | 20 70 6f 72 74 61 62 6c |mple and| portabl|
|00003660| 65 20 61 6e 64 20 63 61 | 6e 20 62 65 20 69 6d 70 |e and ca|n be imp|
|00003670| 6c 65 6d 65 6e 74 65 64 | 20 69 6e 20 61 62 6f 75 |lemented| in abou|
|00003680| 74 0a 66 69 66 74 65 65 | 6e 20 6d 69 6e 75 74 65 |t.fiftee|n minute|
|00003690| 73 20 6f 6e 20 61 6e 79 | 20 73 79 73 74 65 6d 20 |s on any| system |
|000036a0| 77 69 74 68 20 61 20 72 | 65 61 73 6f 6e 61 62 6c |with a r|easonabl|
|000036b0| 79 20 67 6f 6f 64 20 43 | 20 63 6f 6d 70 69 6c 65 |y good C| compile|
|000036c0| 72 20 74 68 61 74 0a 70 | 72 6f 76 69 64 65 73 20 |r that.p|rovides |
|000036d0| 2a 2a 49 58 2d 63 6f 6d | 70 61 74 69 62 6c 65 20 |**IX-com|patible |
|000036e0| 72 65 61 64 28 29 2c 20 | 77 72 69 74 65 28 29 2c |read(), |write(),|
|000036f0| 20 61 6e 64 20 6c 73 65 | 65 6b 28 29 20 66 75 6e | and lse|ek() fun|
|00003700| 63 74 69 6f 6e 73 2e 0a | 41 6e 64 20 42 6f 6f 7a |ctions..|And Booz|
|00003710| 20 31 2e 30 32 20 63 61 | 6e 20 65 78 74 72 61 63 | 1.02 ca|n extrac|
|00003720| 74 20 61 6e 64 20 6c 69 | 73 74 20 61 6c 6c 20 61 |t and li|st all a|
|00003730| 72 63 68 69 76 65 73 20 | 63 72 65 61 74 65 64 20 |rchives |created |
|00003740| 62 79 20 61 6c 6c 0a 63 | 75 72 72 65 6e 74 6c 79 |by all.c|urrently|
|00003750| 2d 65 78 69 73 74 69 6e | 67 20 76 65 72 73 69 6f |-existin|g versio|
|00003760| 6e 73 20 6f 66 20 5a 6f | 6f 2e 0a 0a 41 74 20 63 |ns of Zo|o...At c|
|00003770| 6f 6d 70 69 6c 61 74 69 | 6f 6e 20 74 69 6d 65 2c |ompilati|on time,|
|00003780| 20 63 6f 6e 64 69 74 69 | 6f 6e 61 6c 20 63 6f 6d | conditi|onal com|
|00003790| 70 69 6c 61 74 69 6f 6e | 20 73 65 6c 65 63 74 73 |pilation| selects|
|000037a0| 20 6f 6e 65 20 6f 66 20 | 74 68 72 65 65 0a 6c 65 | one of |three.le|
|000037b0| 76 65 6c 73 20 6f 66 20 | 73 6f 70 68 69 73 74 69 |vels of |sophisti|
|000037c0| 63 61 74 69 6f 6e 20 66 | 6f 72 20 42 6f 6f 7a 20 |cation f|or Booz |
|000037d0| 31 2e 30 32 2e 20 20 54 | 68 65 20 74 68 72 65 65 |1.02. T|he three|
|000037e0| 20 6f 70 74 69 6f 6e 73 | 20 61 72 65 20 61 73 0a | options| are as.|
|000037f0| 66 6f 6c 6c 6f 77 73 2e | 0a 0a 54 68 65 20 54 69 |follows.|..The Ti|
|00003800| 6e 79 20 6f 70 74 69 6f | 6e 3a 20 20 42 6f 6f 7a |ny optio|n: Booz|
|00003810| 20 63 6f 6d 70 69 6c 65 | 64 20 77 69 74 68 20 74 | compile|d with t|
|00003820| 68 65 20 54 69 6e 79 20 | 6f 70 74 69 6f 6e 20 69 |he Tiny |option i|
|00003830| 73 20 76 65 72 79 20 66 | 72 75 67 61 6c 0a 61 6e |s very f|rugal.an|
|00003840| 64 20 73 68 6f 75 6c 64 | 20 63 6f 6d 70 69 6c 65 |d should| compile|
|00003850| 20 61 6e 64 20 72 75 6e | 20 75 6e 64 65 72 20 43 | and run| under C|
|00003860| 50 2f 4d 20 61 6e 64 20 | 6f 74 68 65 72 20 73 79 |P/M and |other sy|
|00003870| 73 74 65 6d 73 20 77 69 | 74 68 20 6c 69 6d 69 74 |stems wi|th limit|
|00003880| 65 64 0a 6d 65 6d 6f 72 | 79 2e 20 20 54 69 6e 79 |ed.memor|y. Tiny|
|00003890| 20 42 6f 6f 7a 20 61 6c | 77 61 79 73 20 65 78 74 | Booz al|ways ext|
|000038a0| 72 61 63 74 73 20 61 6e | 20 65 6e 74 69 72 65 20 |racts an| entire |
|000038b0| 61 72 63 68 69 76 65 20 | 61 74 20 61 20 74 69 6d |archive |at a tim|
|000038c0| 65 20 61 6e 64 0a 64 6f | 65 73 20 6e 6f 74 20 61 |e and.do|es not a|
|000038d0| 74 74 65 6d 70 74 20 74 | 6f 20 70 72 65 76 65 6e |ttempt t|o preven|
|000038e0| 74 20 61 6e 20 65 78 63 | 74 72 61 63 74 65 64 20 |t an exc|tracted |
|000038f0| 66 69 6c 65 20 66 72 6f | 6d 20 6f 76 65 72 77 72 |file fro|m overwr|
|00003900| 69 74 69 6e 67 0a 61 6e | 6f 74 68 65 72 2e 20 20 |iting.an|other. |
|00003910| 54 69 6e 79 20 42 6f 6f | 7a 20 72 65 71 75 69 72 |Tiny Boo|z requir|
|00003920| 65 73 20 79 6f 75 20 74 | 6f 20 74 79 70 65 20 74 |es you t|o type t|
|00003930| 68 65 20 65 6e 74 69 72 | 65 20 66 69 6c 65 6e 61 |he entir|e filena|
|00003940| 6d 65 20 6f 66 20 74 68 | 65 0a 61 72 63 68 69 76 |me of th|e.archiv|
|00003950| 65 20 62 65 69 6e 67 20 | 65 78 74 72 61 63 74 65 |e being |extracte|
|00003960| 64 2c 20 69 6e 63 6c 75 | 64 69 6e 67 20 74 68 65 |d, inclu|ding the|
|00003970| 20 22 2e 7a 6f 6f 22 20 | 65 78 74 65 6e 73 69 6f | ".zoo" |extensio|
|00003980| 6e 2e 0a 0a 54 68 65 20 | 53 6d 61 6c 6c 20 6f 70 |n...The |Small op|
|00003990| 74 69 6f 6e 3a 20 20 42 | 6f 6f 7a 20 63 6f 6d 70 |tion: B|ooz comp|
|000039a0| 69 6c 65 64 20 77 69 74 | 68 20 74 68 65 20 53 6d |iled wit|h the Sm|
|000039b0| 61 6c 6c 20 6f 70 74 69 | 6f 6e 20 69 73 20 61 20 |all opti|on is a |
|000039c0| 6c 69 74 74 6c 65 0a 6d | 6f 72 65 20 73 6f 70 68 |little.m|ore soph|
|000039d0| 69 73 74 69 63 61 74 65 | 64 20 74 68 61 6e 20 54 |isticate|d than T|
|000039e0| 69 6e 79 20 42 6f 6f 7a | 2e 20 20 53 6d 61 6c 6c |iny Booz|. Small|
|000039f0| 20 42 6f 6f 7a 20 61 73 | 73 75 6d 65 73 20 74 68 | Booz as|sumes th|
|00003a00| 65 20 64 65 66 61 75 6c | 74 0a 65 78 74 65 6e 73 |e defaul|t.extens|
|00003a10| 69 6f 6e 20 22 2e 7a 6f | 6f 22 20 66 6f 72 20 61 |ion ".zo|o" for a|
|00003a20| 6e 20 61 72 63 68 69 76 | 65 20 69 66 20 69 74 20 |n archiv|e if it |
|00003a30| 69 73 20 6e 6f 74 20 73 | 70 65 63 69 66 69 65 64 |is not s|pecified|
|00003a40| 2e 20 20 49 74 20 77 69 | 6c 6c 20 6c 65 74 0a 79 |. It wi|ll let.y|
|00003a50| 6f 75 20 73 70 65 63 69 | 66 79 20 77 68 69 63 68 |ou speci|fy which|
|00003a60| 20 66 69 6c 65 73 20 73 | 68 6f 75 6c 64 20 62 65 | files s|hould be|
|00003a70| 20 65 78 74 72 61 63 74 | 65 64 20 66 72 6f 6d 20 | extract|ed from |
|00003a80| 61 6e 20 61 72 63 68 69 | 76 65 2e 20 20 53 6d 61 |an archi|ve. Sma|
|00003a90| 6c 6c 0a 42 6f 6f 7a 20 | 61 63 63 65 70 74 73 20 |ll.Booz |accepts |
|00003aa0| 74 68 65 73 65 20 77 69 | 6c 64 63 61 72 64 20 73 |these wi|ldcard s|
|00003ab0| 79 6d 62 6f 6c 73 20 69 | 6e 20 74 68 65 20 6e 61 |ymbols i|n the na|
|00003ac0| 6d 65 73 20 6f 66 20 66 | 69 6c 65 73 20 74 6f 20 |mes of f|iles to |
|00003ad0| 62 65 0a 65 78 74 72 61 | 63 74 65 64 3a 20 20 22 |be.extra|cted: "|
|00003ae0| 3f 22 20 73 74 61 6e 64 | 73 20 66 6f 72 20 61 6e |?" stand|s for an|
|00003af0| 79 20 6f 6e 65 20 63 68 | 61 72 61 63 74 65 72 20 |y one ch|aracter |
|00003b00| 61 6e 64 20 22 2a 22 20 | 73 74 61 6e 64 73 20 66 |and "*" |stands f|
|00003b10| 6f 72 20 61 6e 79 0a 73 | 65 71 75 65 6e 63 65 20 |or any.s|equence |
|00003b20| 6f 66 20 7a 65 72 6f 20 | 6f 72 20 6d 6f 72 65 20 |of zero |or more |
|00003b30| 63 68 61 72 61 63 74 65 | 72 73 2e 20 20 43 6f 6d |characte|rs. Com|
|00003b40| 62 69 6e 61 74 69 6f 6e | 73 20 6f 66 20 74 68 65 |bination|s of the|
|00003b50| 73 65 20 61 72 65 0a 70 | 65 72 6d 69 74 74 65 64 |se are.p|ermitted|
|00003b60| 20 73 6f 2c 20 66 6f 72 | 20 65 78 61 6d 70 6c 65 | so, for| example|
|00003b70| 2c 20 22 2a 63 3f 74 2a | 68 22 20 6d 61 74 63 68 |, "*c?t*|h" match|
|00003b80| 65 73 20 66 69 6c 65 6e | 61 6d 65 73 20 65 6e 64 |es filen|ames end|
|00003b90| 69 6e 67 20 77 69 74 68 | 20 22 68 22 0a 61 6e 64 |ing with| "h".and|
|00003ba0| 20 63 6f 6e 74 61 69 6e | 69 6e 67 20 22 63 22 20 | contain|ing "c" |
|00003bb0| 61 6e 64 20 22 74 22 20 | 73 65 70 61 72 61 74 65 |and "t" |separate|
|00003bc0| 64 20 62 79 20 6f 6e 65 | 20 63 68 61 72 61 63 74 |d by one| charact|
|00003bd0| 65 72 2e 20 20 53 6d 61 | 6c 6c 20 42 6f 6f 7a 20 |er. Sma|ll Booz |
|00003be0| 69 73 0a 6e 65 61 72 6c | 79 20 61 73 20 6d 65 6d |is.nearl|y as mem|
|00003bf0| 6f 72 79 2d 65 66 66 69 | 63 69 65 6e 74 20 61 73 |ory-effi|cient as|
|00003c00| 20 54 69 6e 79 20 42 6f | 6f 7a 20 61 6e 64 20 69 | Tiny Bo|oz and i|
|00003c10| 74 20 76 65 72 79 20 6c | 69 6b 65 6c 79 20 74 68 |t very l|ikely th|
|00003c20| 61 74 20 69 74 0a 77 69 | 6c 6c 20 63 6f 6d 70 69 |at it.wi|ll compi|
|00003c30| 6c 65 20 61 6e 64 20 72 | 75 6e 20 75 6e 64 65 72 |le and r|un under|
|00003c40| 20 43 50 2f 4d 2e 0a 0a | 54 68 65 20 42 69 67 20 | CP/M...|The Big |
|00003c50| 6f 70 74 69 6f 6e 3a 20 | 20 42 6f 6f 7a 20 63 6f |option: | Booz co|
|00003c60| 6d 70 69 6c 65 64 20 77 | 69 74 68 20 74 68 65 20 |mpiled w|ith the |
|00003c70| 42 69 67 20 6f 70 74 69 | 6f 6e 20 64 6f 65 73 20 |Big opti|on does |
|00003c80| 65 76 65 72 79 74 68 69 | 6e 67 0a 74 68 61 74 20 |everythi|ng.that |
|00003c90| 53 6d 61 6c 6c 20 42 6f | 6f 7a 20 64 6f 65 73 20 |Small Bo|oz does |
|00003ca0| 61 6e 64 20 69 6e 20 61 | 64 64 69 74 69 6f 6e 20 |and in a|ddition |
|00003cb0| 69 74 20 63 61 6e 20 67 | 69 76 65 20 74 68 65 20 |it can g|ive the |
|00003cc0| 64 69 72 65 63 74 6f 72 | 79 0a 6c 69 73 74 69 6e |director|y.listin|
|00003cd0| 67 20 6f 66 20 61 20 5a | 6f 6f 20 61 72 63 68 69 |g of a Z|oo archi|
|00003ce0| 76 65 20 6f 72 20 74 65 | 73 74 20 69 74 73 20 69 |ve or te|st its i|
|00003cf0| 6e 74 65 67 72 69 74 79 | 2e 20 20 44 65 73 70 69 |ntegrity|. Despi|
|00003d00| 74 65 20 69 74 73 20 6e | 61 6d 65 2c 0a 42 69 67 |te its n|ame,.Big|
|00003d10| 20 42 6f 6f 7a 20 69 73 | 20 73 74 69 6c 6c 20 71 | Booz is| still q|
|00003d20| 75 69 74 65 20 66 72 75 | 67 61 6c 2e 20 20 55 6e |uite fru|gal. Un|
|00003d30| 64 65 72 20 4d 53 2d 44 | 4f 53 2c 20 77 68 65 6e |der MS-D|OS, when|
|00003d40| 20 63 6f 6d 70 69 6c 65 | 64 20 77 69 74 68 0a 74 | compile|d with.t|
|00003d50| 68 65 20 4d 69 63 72 6f | 73 6f 66 74 20 43 20 63 |he Micro|soft C c|
|00003d60| 6f 6d 70 69 6c 65 72 20 | 76 65 72 73 69 6f 6e 20 |ompiler |version |
|00003d70| 33 2e 30 30 2c 20 69 74 | 20 72 75 6e 73 20 69 6e |3.00, it| runs in|
|00003d80| 20 61 62 6f 75 74 20 35 | 30 20 6b 69 6c 6f 62 79 | about 5|0 kiloby|
|00003d90| 74 65 73 0a 6f 66 20 66 | 72 65 65 20 6d 65 6d 6f |tes.of f|ree memo|
|00003da0| 72 79 20 61 6e 64 20 6f | 63 63 75 70 69 65 73 20 |ry and o|ccupies |
|00003db0| 61 62 6f 75 74 20 39 2e | 35 20 6b 69 6c 6f 62 79 |about 9.|5 kiloby|
|00003dc0| 74 65 73 20 6f 6e 20 64 | 69 73 6b 2e 0a 0a 0a 20 |tes on d|isk.... |
|00003dd0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003de0| 20 20 20 20 20 20 20 20 | 43 4f 4d 50 49 4c 49 4e | |COMPILIN|
|00003df0| 47 20 42 4f 4f 5a 20 31 | 2e 30 32 0a 0a 31 2e 0a |G BOOZ 1|.02..1..|
|00003e00| 4d 61 6b 65 20 73 75 72 | 65 20 74 68 61 74 20 74 |Make sur|e that t|
|00003e10| 68 65 20 74 77 6f 20 6d | 61 63 72 6f 73 20 4f 50 |he two m|acros OP|
|00003e20| 45 4e 20 61 6e 64 20 43 | 52 45 41 54 45 20 61 72 |EN and C|REATE ar|
|00003e30| 65 20 63 6f 72 72 65 63 | 74 6c 79 20 64 65 66 69 |e correc|tly defi|
|00003e40| 6e 65 64 0a 66 6f 72 20 | 79 6f 75 72 20 73 79 73 |ned.for |your sys|
|00003e50| 74 65 6d 20 69 6e 20 66 | 69 6c 65 20 60 6f 6f 7a |tem in f|ile `ooz|
|00003e60| 69 6f 2e 68 27 2e 20 20 | 53 6f 6d 65 20 73 61 6d |io.h'. |Some sam|
|00003e70| 70 6c 65 20 6d 61 63 72 | 6f 73 20 61 72 65 20 70 |ple macr|os are p|
|00003e80| 72 6f 76 69 64 65 64 2e | 20 0a 54 68 65 20 6d 61 |rovided.| .The ma|
|00003e90| 63 72 6f 73 20 6d 75 73 | 74 20 62 65 20 64 65 66 |cros mus|t be def|
|00003ea0| 69 6e 65 64 20 74 6f 20 | 6f 70 65 6e 20 66 69 6c |ined to |open fil|
|00003eb0| 65 73 20 69 6e 20 62 69 | 6e 61 72 79 20 6d 6f 64 |es in bi|nary mod|
|00003ec0| 65 20 28 69 2e 65 2e 2c | 0a 77 69 74 68 6f 75 74 |e (i.e.,|.without|
|00003ed0| 20 6e 65 77 6c 69 6e 65 | 20 63 6f 6e 76 65 72 73 | newline| convers|
|00003ee0| 69 6f 6e 73 29 2e 0a 0a | 54 68 65 20 6d 61 63 72 |ions)...|The macr|
|00003ef0| 6f 20 4f 50 45 4e 20 69 | 73 20 73 75 70 70 6c 69 |o OPEN i|s suppli|
|00003f00| 65 64 20 61 20 66 69 6c | 65 6e 61 6d 65 20 61 6e |ed a fil|ename an|
|00003f10| 64 20 69 74 20 6d 75 73 | 74 20 6f 70 65 6e 20 74 |d it mus|t open t|
|00003f20| 68 65 20 66 69 6c 65 20 | 66 6f 72 0a 72 65 61 64 |he file |for.read|
|00003f30| 69 6e 67 20 61 6e 64 20 | 72 65 74 75 72 6e 20 61 |ing and |return a|
|00003f40| 6e 20 6f 70 65 6e 20 66 | 69 6c 65 20 64 65 73 63 |n open f|ile desc|
|00003f50| 72 69 70 74 6f 72 2c 20 | 6f 72 20 2d 31 20 69 66 |riptor, |or -1 if|
|00003f60| 20 74 68 65 20 6f 70 65 | 6e 20 66 61 69 6c 73 2e | the ope|n fails.|
|00003f70| 20 0a 49 74 20 69 73 20 | 75 73 65 64 20 74 6f 20 | .It is |used to |
|00003f80| 6f 70 65 6e 20 74 68 65 | 20 61 72 63 68 69 76 65 |open the| archive|
|00003f90| 20 62 65 69 6e 67 20 65 | 78 74 72 61 63 74 65 64 | being e|xtracted|
|00003fa0| 20 6f 72 20 6c 69 73 74 | 65 64 2c 20 61 6e 64 20 | or list|ed, and |
|00003fb0| 74 6f 20 74 65 73 74 0a | 74 68 65 20 65 78 69 73 |to test.|the exis|
|00003fc0| 74 65 6e 63 65 20 6f 66 | 20 61 20 66 69 6c 65 20 |tence of| a file |
|00003fd0| 61 62 6f 75 74 20 74 6f | 20 62 65 20 65 78 74 72 |about to| be extr|
|00003fe0| 61 63 74 65 64 2e 0a 0a | 54 68 65 20 6d 61 63 72 |acted...|The macr|
|00003ff0| 6f 20 43 52 45 41 54 45 | 20 69 73 20 73 75 70 70 |o CREATE| is supp|
|00004000| 6c 69 65 64 20 61 20 66 | 69 6c 65 6e 61 6d 65 20 |lied a f|ilename |
|00004010| 61 6e 64 20 69 74 20 6d | 75 73 74 20 63 72 65 61 |and it m|ust crea|
|00004020| 74 65 20 61 20 6e 65 77 | 20 66 69 6c 65 0a 66 6f |te a new| file.fo|
|00004030| 72 20 77 72 69 74 69 6e | 67 20 61 6e 64 20 72 65 |r writin|g and re|
|00004040| 74 75 72 6e 20 61 6e 20 | 6f 70 65 6e 20 66 69 6c |turn an |open fil|
|00004050| 65 20 64 65 73 63 72 69 | 70 74 6f 72 2c 20 6f 72 |e descri|ptor, or|
|00004060| 20 2d 31 20 69 66 20 74 | 68 65 20 63 72 65 61 74 | -1 if t|he creat|
|00004070| 65 0a 66 61 69 6c 73 2e | 20 20 49 74 20 69 73 20 |e.fails.| It is |
|00004080| 75 73 65 64 20 66 6f 72 | 20 63 72 65 61 74 69 6e |used for| creatin|
|00004090| 67 20 65 61 63 68 20 66 | 69 6c 65 20 74 68 61 74 |g each f|ile that|
|000040a0| 20 69 73 20 65 78 74 72 | 61 63 74 65 64 2e 0a 0a | is extr|acted...|
|000040b0| 32 2e 0a 49 66 20 79 6f | 75 72 20 43 20 6c 69 62 |2..If yo|ur C lib|
|000040c0| 72 61 72 79 20 64 6f 65 | 73 20 6e 6f 74 20 70 72 |rary doe|s not pr|
|000040d0| 6f 76 69 64 65 20 74 68 | 65 20 75 6e 6c 69 6e 6b |ovide th|e unlink|
|000040e0| 28 29 20 66 75 6e 63 74 | 69 6f 6e 20 28 77 68 69 |() funct|ion (whi|
|000040f0| 63 68 0a 64 65 6c 65 74 | 65 73 20 61 20 66 69 6c |ch.delet|es a fil|
|00004100| 65 20 67 69 76 65 6e 20 | 69 74 73 20 6e 61 6d 65 |e given |its name|
|00004110| 29 2c 20 64 65 66 69 6e | 65 20 61 6e 20 65 6d 70 |), defin|e an emp|
|00004120| 74 79 20 66 75 6e 63 74 | 69 6f 6e 20 62 79 20 74 |ty funct|ion by t|
|00004130| 68 61 74 0a 6e 61 6d 65 | 2c 20 6f 72 20 64 65 66 |hat.name|, or def|
|00004140| 69 6e 65 20 61 20 73 75 | 69 74 61 62 6c 65 20 28 |ine a su|itable (|
|00004150| 70 6f 73 73 69 62 6c 79 | 20 65 6d 70 74 79 29 20 |possibly| empty) |
|00004160| 6d 61 63 72 6f 20 62 79 | 20 74 68 61 74 20 6e 61 |macro by| that na|
|00004170| 6d 65 20 69 6e 0a 66 69 | 6c 65 20 60 6f 6f 7a 69 |me in.fi|le `oozi|
|00004180| 6f 2e 68 27 2e 0a 0a 33 | 2e 0a 44 65 63 69 64 65 |o.h'...3|..Decide|
|00004190| 20 77 68 69 63 68 20 6f | 66 20 74 68 65 20 74 68 | which o|f the th|
|000041a0| 72 65 65 20 6f 70 74 69 | 6f 6e 73 2c 20 54 69 6e |ree opti|ons, Tin|
|000041b0| 79 2c 20 53 6d 61 6c 6c | 2c 20 6f 72 20 42 69 67 |y, Small|, or Big|
|000041c0| 2c 20 79 6f 75 20 77 69 | 6c 6c 20 75 73 65 2e 0a |, you wi|ll use..|
|000041d0| 49 66 20 6d 65 6d 6f 72 | 79 20 69 73 20 74 69 67 |If memor|y is tig|
|000041e0| 68 74 20 75 73 65 20 74 | 68 65 20 54 69 6e 79 20 |ht use t|he Tiny |
|000041f0| 6f 70 74 69 6f 6e 20 66 | 69 72 73 74 20 74 6f 20 |option f|irst to |
|00004200| 67 65 74 20 61 20 5a 6f | 6f 20 65 78 74 72 61 63 |get a Zo|o extrac|
|00004210| 74 6f 72 0a 71 75 69 63 | 6b 6c 79 20 72 75 6e 6e |tor.quic|kly runn|
|00004220| 69 6e 67 20 6f 6e 20 79 | 6f 75 72 20 73 79 73 74 |ing on y|our syst|
|00004230| 65 6d 2e 20 20 54 68 65 | 6e 20 65 78 70 65 72 69 |em. The|n experi|
|00004240| 6d 65 6e 74 20 77 69 74 | 68 20 74 68 65 20 6f 74 |ment wit|h the ot|
|00004250| 68 65 72 0a 6f 70 74 69 | 6f 6e 73 2e 20 20 49 66 |her.opti|ons. If|
|00004260| 20 6d 65 6d 6f 72 79 20 | 69 73 20 6e 6f 74 20 74 | memory |is not t|
|00004270| 69 67 68 74 2c 20 75 73 | 65 20 74 68 65 20 42 69 |ight, us|e the Bi|
|00004280| 67 20 6f 70 74 69 6f 6e | 2e 20 20 44 65 66 69 6e |g option|. Defin|
|00004290| 65 20 61 6e 79 20 6f 6e | 65 0a 6f 66 20 74 68 65 |e any on|e.of the|
|000042a0| 20 73 79 6d 62 6f 6c 73 | 20 54 49 4e 59 2c 20 53 | symbols| TINY, S|
|000042b0| 4d 41 4c 4c 2c 20 6f 72 | 20 42 49 47 20 69 6e 20 |MALL, or| BIG in |
|000042c0| 74 68 65 20 66 69 6c 65 | 20 60 6f 70 74 69 6f 6e |the file| `option|
|000042d0| 73 2e 68 27 20 28 6f 72 | 0a 61 6c 74 65 72 6e 61 |s.h' (or|.alterna|
|000042e0| 74 69 76 65 6c 79 20 64 | 65 66 69 6e 65 20 69 74 |tively d|efine it|
|000042f0| 20 6f 6e 20 74 68 65 20 | 63 6f 6d 6d 61 6e 64 20 | on the |command |
|00004300| 6c 69 6e 65 20 74 68 61 | 74 20 69 6e 76 6f 6b 65 |line tha|t invoke|
|00004310| 73 20 79 6f 75 72 20 43 | 0a 63 6f 6d 70 69 6c 65 |s your C|.compile|
|00004320| 72 29 2e 20 20 45 78 61 | 63 74 6c 79 20 6f 6e 65 |r). Exa|ctly one|
|00004330| 20 6f 66 20 74 68 65 73 | 65 20 74 68 72 65 65 20 | of thes|e three |
|00004340| 73 79 6d 62 6f 6c 73 20 | 6d 75 73 74 20 62 65 20 |symbols |must be |
|00004350| 64 65 66 69 6e 65 64 2e | 0a 0a 34 2e 0a 43 68 6f |defined.|..4..Cho|
|00004360| 6f 73 65 20 61 70 70 72 | 6f 70 72 69 61 74 65 20 |ose appr|opriate |
|00004370| 73 69 7a 65 73 20 66 6f | 72 20 74 68 65 20 69 6e |sizes fo|r the in|
|00004380| 70 75 74 2f 6f 75 74 70 | 75 74 20 62 75 66 66 65 |put/outp|ut buffe|
|00004390| 72 73 20 61 6e 64 20 66 | 6f 72 20 74 68 65 0a 73 |rs and f|or the.s|
|000043a0| 69 7a 65 20 6f 66 20 74 | 68 65 20 64 65 63 6f 6d |ize of t|he decom|
|000043b0| 70 72 65 73 73 69 6f 6e | 20 73 74 61 63 6b 20 69 |pression| stack i|
|000043c0| 6e 20 66 69 6c 65 20 60 | 6f 70 74 69 6f 6e 73 2e |n file `|options.|
|000043d0| 68 27 2e 20 20 49 66 20 | 6d 65 6d 6f 72 79 0a 70 |h'. If |memory.p|
|000043e0| 65 72 6d 69 74 73 2c 20 | 6d 61 6b 65 20 74 68 65 |ermits, |make the|
|000043f0| 20 62 75 66 66 65 72 73 | 20 38 31 39 32 20 65 61 | buffers| 8192 ea|
|00004400| 63 68 2e 20 20 20 28 42 | 69 67 67 65 72 20 73 69 |ch. (B|igger si|
|00004410| 7a 65 73 2c 20 70 65 72 | 68 61 70 73 20 75 70 20 |zes, per|haps up |
|00004420| 74 6f 0a 31 36 33 38 34 | 2c 20 63 6f 75 6c 64 20 |to.16384|, could |
|00004430| 62 65 20 75 73 65 64 20 | 62 75 74 20 74 68 65 79 |be used |but they|
|00004440| 20 68 61 76 65 20 6e 6f | 74 20 62 65 65 6e 20 74 | have no|t been t|
|00004450| 65 73 74 65 64 20 61 6e | 64 20 63 6f 75 6c 64 0a |ested an|d could.|
|00004460| 63 6f 6e 63 65 69 76 61 | 62 6c 79 20 63 61 75 73 |conceiva|bly caus|
|00004470| 65 20 6f 76 65 72 66 6c | 6f 77 20 69 6e 20 63 65 |e overfl|ow in ce|
|00004480| 72 74 61 69 6e 20 62 69 | 74 2d 73 68 69 66 74 20 |rtain bi|t-shift |
|00004490| 6f 70 65 72 61 74 69 6f | 6e 73 20 69 6e 20 66 69 |operatio|ns in fi|
|000044a0| 6c 65 0a 60 6c 7a 64 2e | 63 27 29 2e 20 20 41 20 |le.`lzd.|c'). A |
|000044b0| 72 65 61 73 6f 6e 61 62 | 6c 65 20 73 74 61 63 6b |reasonab|le stack|
|000044c0| 20 73 69 7a 65 20 69 73 | 20 32 30 30 30 2c 20 62 | size is| 2000, b|
|000044d0| 75 74 20 69 6e 20 70 61 | 74 68 6f 6c 6f 67 69 63 |ut in pa|thologic|
|000044e0| 61 6c 20 63 61 73 65 73 | 0a 65 78 74 72 61 63 74 |al cases|.extract|
|000044f0| 69 6f 6e 20 6f 66 20 61 | 20 66 69 6c 65 20 63 6f |ion of a| file co|
|00004500| 75 6c 64 20 72 65 71 75 | 69 72 65 20 61 20 6c 61 |uld requ|ire a la|
|00004510| 72 67 65 72 20 73 74 61 | 63 6b 2e 0a 0a 49 66 20 |rger sta|ck...If |
|00004520| 6d 65 6d 6f 72 79 20 69 | 73 20 74 69 67 68 74 2c |memory i|s tight,|
|00004530| 20 64 65 63 72 65 61 73 | 65 20 74 68 65 20 69 6e | decreas|e the in|
|00004540| 70 75 74 2f 6f 75 74 70 | 75 74 20 62 75 66 66 65 |put/outp|ut buffe|
|00004550| 72 73 20 74 6f 20 31 30 | 32 34 20 65 61 63 68 0a |rs to 10|24 each.|
|00004560| 65 61 63 68 20 61 6e 64 | 20 74 68 65 20 73 74 61 |each and| the sta|
|00004570| 63 6b 20 74 6f 20 31 30 | 30 30 2e 0a 0a 35 2e 0a |ck to 10|00...5..|
|00004580| 43 6f 6d 70 69 6c 65 20 | 61 6e 64 20 6c 69 6e 6b |Compile |and link|
|00004590| 20 61 6c 6c 20 74 68 65 | 20 43 20 66 69 6c 65 73 | all the| C files|
|000045a0| 2e 20 20 54 77 6f 20 6d | 61 6b 65 66 69 6c 65 73 |. Two m|akefiles|
|000045b0| 20 61 72 65 20 73 75 70 | 70 6c 69 65 64 2c 20 6f | are sup|plied, o|
|000045c0| 6e 65 0a 73 75 69 74 61 | 62 6c 65 20 66 6f 72 20 |ne.suita|ble for |
|000045d0| 2a 2a 49 58 20 73 79 73 | 74 65 6d 73 20 61 6e 64 |**IX sys|tems and|
|000045e0| 20 74 68 65 20 6f 74 68 | 65 72 20 66 6f 72 20 4d | the oth|er for M|
|000045f0| 69 63 72 6f 73 6f 66 74 | 20 43 20 33 2e 30 20 75 |icrosoft| C 3.0 u|
|00004600| 6e 64 65 72 0a 4d 53 2d | 44 4f 53 2e 20 20 4d 6f |nder.MS-|DOS. Mo|
|00004610| 64 69 66 79 20 74 68 65 | 73 65 20 61 73 20 6e 65 |dify the|se as ne|
|00004620| 63 65 73 73 61 72 79 20 | 66 6f 72 20 79 6f 75 72 |cessary |for your|
|00004630| 20 73 79 73 74 65 6d 2e | 20 20 41 6c 73 6f 20 73 | system.| Also s|
|00004640| 75 70 70 6c 69 65 64 20 | 69 73 0a 61 20 70 72 6f |upplied |is.a pro|
|00004650| 6a 65 63 74 20 66 69 6c | 65 20 62 6f 6f 7a 2e 70 |ject fil|e booz.p|
|00004660| 72 6a 20 66 6f 72 20 75 | 73 65 20 77 69 74 68 20 |rj for u|se with |
|00004670| 54 75 72 62 6f 20 43 20 | 31 2e 30 20 6f 6e 20 4d |Turbo C |1.0 on M|
|00004680| 53 2d 44 4f 53 2e 0a 0a | 0a 20 20 20 20 20 20 20 |S-DOS...|. |
|00004690| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000046a0| 20 20 20 4d 41 43 48 49 | 4e 45 20 44 45 50 45 4e | MACHI|NE DEPEN|
|000046b0| 44 45 4e 43 45 0a 0a 42 | 6f 6f 7a 20 69 73 20 72 |DENCE..B|ooz is r|
|000046c0| 65 6c 61 74 69 76 65 6c | 79 20 69 6e 64 65 70 65 |elativel|y indepe|
|000046d0| 6e 64 65 6e 74 20 6f 66 | 20 6d 61 63 68 69 6e 65 |ndent of| machine|
|000046e0| 20 61 72 63 68 69 74 65 | 63 74 75 72 65 2c 20 65 | archite|cture, e|
|000046f0| 78 63 65 70 74 20 74 68 | 61 74 0a 28 61 29 20 74 |xcept th|at.(a) t|
|00004700| 68 65 20 6d 61 63 68 69 | 6e 65 20 6d 75 73 74 20 |he machi|ne must |
|00004710| 62 65 20 61 20 32 27 73 | 20 63 6f 6d 70 6c 65 6d |be a 2's| complem|
|00004720| 65 6e 74 20 6d 61 63 68 | 69 6e 65 20 28 61 6c 6c |ent mach|ine (all|
|00004730| 20 6d 6f 64 65 72 6e 20 | 6d 61 63 68 69 6e 65 73 | modern |machines|
|00004740| 0a 61 72 65 29 20 61 6e | 64 20 28 62 29 20 60 63 |.are) an|d (b) `c|
|00004750| 68 61 72 27 20 6d 75 73 | 74 20 62 65 20 65 78 61 |har' mus|t be exa|
|00004760| 63 74 6c 79 20 38 20 62 | 69 74 73 2c 20 60 69 6e |ctly 8 b|its, `in|
|00004770| 74 27 20 6d 75 73 74 20 | 62 65 20 31 36 20 62 69 |t' must |be 16 bi|
|00004780| 74 73 20 6f 72 0a 6c 61 | 72 67 65 72 2c 20 61 6e |ts or.la|rger, an|
|00004790| 64 20 60 6c 6f 6e 67 27 | 20 6d 75 73 74 20 62 65 |d `long'| must be|
|000047a0| 20 33 32 20 62 69 74 73 | 20 6f 72 20 6c 61 72 67 | 32 bits| or larg|
|000047b0| 65 72 20 28 74 68 6f 75 | 67 68 20 61 20 60 6c 6f |er (thou|gh a `lo|
|000047c0| 6e 67 27 20 6f 66 20 61 | 0a 6c 69 74 74 6c 65 20 |ng' of a|.little |
|000047d0| 6c 65 73 73 20 74 68 61 | 6e 20 33 32 20 62 69 74 |less tha|n 32 bit|
|000047e0| 73 20 6d 61 79 20 77 6f | 72 6b 29 2e 0a 0a 42 6f |s may wo|rk)...Bo|
|000047f0| 6f 7a 20 6d 61 6b 65 73 | 20 6e 6f 20 61 73 73 75 |oz makes| no assu|
|00004800| 6d 70 74 69 6f 6e 73 20 | 61 62 6f 75 74 20 74 68 |mptions |about th|
|00004810| 65 20 66 69 6c 65 6e 61 | 6d 65 20 73 79 6e 74 61 |e filena|me synta|
|00004820| 78 20 6f 66 20 74 68 65 | 20 68 6f 73 74 0a 6d 61 |x of the| host.ma|
|00004830| 63 68 69 6e 65 2c 20 65 | 78 63 65 70 74 20 74 68 |chine, e|xcept th|
|00004840| 61 74 20 53 6d 61 6c 6c | 20 61 6e 64 20 42 69 67 |at Small| and Big|
|00004850| 20 42 6f 6f 7a 20 61 73 | 73 75 6d 65 20 74 68 61 | Booz as|sume tha|
|00004860| 74 20 64 6f 74 20 22 2e | 22 20 69 73 20 75 73 65 |t dot ".|" is use|
|00004870| 64 20 74 6f 0a 73 65 70 | 61 72 61 74 65 20 74 68 |d to.sep|arate th|
|00004880| 65 20 65 78 74 65 6e 73 | 69 6f 6e 20 22 7a 6f 6f |e extens|ion "zoo|
|00004890| 22 20 66 72 6f 6d 20 74 | 68 65 20 72 65 73 74 20 |" from t|he rest |
|000048a0| 6f 66 20 74 68 65 20 6e | 61 6d 65 20 6f 66 20 74 |of the n|ame of t|
|000048b0| 68 65 0a 61 72 63 68 69 | 76 65 2e 20 20 54 68 65 |he.archi|ve. The|
|000048c0| 79 20 77 69 6c 6c 20 61 | 70 70 65 6e 64 20 22 2e |y will a|ppend ".|
|000048d0| 7a 6f 6f 22 20 74 6f 20 | 74 68 65 20 61 72 63 68 |zoo" to |the arch|
|000048e0| 69 76 65 20 6e 61 6d 65 | 20 69 66 20 69 74 20 63 |ive name| if it c|
|000048f0| 6f 6e 74 61 69 6e 73 0a | 6e 6f 20 64 6f 74 3b 20 |ontains.|no dot; |
|00004900| 20 74 68 69 73 20 66 61 | 69 6c 73 20 69 66 20 61 | this fa|ils if a|
|00004910| 6e 20 61 72 63 68 69 76 | 65 20 6e 61 6d 65 20 6f |n archiv|e name o|
|00004920| 66 20 74 68 65 20 74 79 | 70 65 20 22 2e 2e 2f 6a |f the ty|pe "../j|
|00004930| 75 6e 6b 22 20 69 73 0a | 73 70 65 63 69 66 69 65 |unk" is.|specifie|
|00004940| 64 2e 20 20 0a 0a 49 66 | 20 79 6f 75 72 20 73 79 |d. ..If| your sy|
|00004950| 73 74 65 6d 20 75 73 65 | 73 20 61 20 64 69 66 66 |stem use|s a diff|
|00004960| 65 72 65 6e 74 20 66 69 | 6c 65 6e 61 6d 65 20 73 |erent fi|lename s|
|00004970| 79 6e 74 61 78 2c 20 79 | 6f 75 20 6d 61 79 20 6e |yntax, y|ou may n|
|00004980| 65 65 64 20 74 6f 0a 63 | 68 61 6e 67 65 20 74 68 |eed to.c|hange th|
|00004990| 65 20 63 6f 64 65 2e 20 | 20 41 6c 73 6f 2c 20 69 |e code. | Also, i|
|000049a0| 66 20 79 6f 75 72 20 73 | 79 73 74 65 6d 20 63 61 |f your s|ystem ca|
|000049b0| 6e 6e 6f 74 20 61 63 63 | 65 70 74 20 73 6f 6d 65 |nnot acc|ept some|
|000049c0| 20 6f 66 20 74 68 65 0a | 63 68 61 72 61 63 74 65 | of the.|characte|
|000049d0| 72 73 20 6c 65 67 61 6c | 20 69 6e 20 4d 53 2d 44 |rs legal| in MS-D|
|000049e0| 4f 53 20 66 69 6c 65 6e | 61 6d 65 73 2c 20 79 6f |OS filen|ames, yo|
|000049f0| 75 20 6d 61 79 20 6e 65 | 65 64 20 74 6f 20 61 64 |u may ne|ed to ad|
|00004a00| 64 20 61 20 66 75 6e 63 | 74 69 6f 6e 0a 74 68 61 |d a func|tion.tha|
|00004a10| 74 20 77 69 6c 6c 20 66 | 69 78 20 74 68 65 20 66 |t will f|ix the f|
|00004a20| 69 6c 65 6e 61 6d 65 20 | 62 65 66 6f 72 65 20 65 |ilename |before e|
|00004a30| 78 74 72 61 63 74 69 6f | 6e 2e 20 20 41 20 73 61 |xtractio|n. A sa|
|00004a40| 6d 70 6c 65 20 66 75 6e | 63 74 69 6f 6e 0a 60 66 |mple fun|ction.`f|
|00004a50| 69 78 66 6e 61 6d 65 28 | 29 27 20 69 73 20 69 6e |ixfname(|)' is in|
|00004a60| 63 6c 75 64 65 64 20 69 | 6e 20 74 68 65 20 66 69 |cluded i|n the fi|
|00004a70| 6c 65 20 60 6f 6f 7a 65 | 78 74 2e 63 27 2e 20 20 |le `ooze|xt.c'. |
|00004a80| 49 74 20 62 65 63 6f 6d | 65 73 20 61 63 74 69 76 |It becom|es activ|
|00004a90| 61 74 65 64 0a 6f 6e 6c | 79 20 69 66 20 74 68 65 |ated.onl|y if the|
|00004aa0| 20 70 72 65 70 72 6f 63 | 65 73 73 6f 72 20 73 79 | preproc|essor sy|
|00004ab0| 6d 62 6f 6c 20 46 49 58 | 46 4e 41 4d 45 20 69 73 |mbol FIX|FNAME is|
|00004ac0| 20 64 65 66 69 6e 65 64 | 2e 0a 0a 09 09 09 09 20 | defined|....... |
|00004ad0| 4e 4f 54 45 0a 0a 54 68 | 69 73 20 70 72 6f 67 72 |NOTE..Th|is progr|
|00004ae0| 61 6d 20 64 6f 65 73 20 | 6e 6f 74 20 61 74 74 65 |am does |not atte|
|00004af0| 6d 70 74 20 74 6f 20 62 | 65 20 63 61 73 65 2d 69 |mpt to b|e case-i|
|00004b00| 6e 73 65 6e 73 69 74 69 | 76 65 2e 20 20 54 68 65 |nsensiti|ve. The|
|00004b10| 72 65 66 6f 72 65 20 79 | 6f 75 0a 77 69 6c 6c 20 |refore y|ou.will |
|00004b20| 6e 65 65 64 20 74 6f 20 | 74 79 70 65 20 6e 61 6d |need to |type nam|
|00004b30| 65 73 20 6f 66 20 66 69 | 6c 65 73 20 74 6f 20 62 |es of fi|les to b|
|00004b40| 65 20 65 78 74 72 61 63 | 74 65 64 20 69 6e 20 74 |e extrac|ted in t|
|00004b50| 68 65 20 63 6f 72 72 65 | 63 74 0a 63 61 73 65 2e |he corre|ct.case.|
|00004b60| 20 20 4e 6f 74 65 2c 20 | 68 6f 77 65 76 65 72 2c | Note, |however,|
|00004b70| 20 74 68 61 74 20 73 6f | 6d 65 20 6f 70 65 72 61 | that so|me opera|
|00004b80| 74 69 6e 67 20 73 79 73 | 74 65 6d 73 20 28 70 6f |ting sys|tems (po|
|00004b90| 73 73 69 62 6c 79 20 43 | 50 2f 4d 29 20 6d 61 79 |ssibly C|P/M) may|
|00004ba0| 0a 66 6f 6c 64 20 63 6f | 6d 6d 61 6e 64 20 6c 69 |.fold co|mmand li|
|00004bb0| 6e 65 20 61 72 67 75 6d | 65 6e 74 73 20 74 6f 20 |ne argum|ents to |
|00004bc0| 75 70 70 65 72 63 61 73 | 65 2e 20 20 49 66 20 74 |uppercas|e. If t|
|00004bd0| 68 69 73 20 68 61 70 70 | 65 6e 73 2c 20 79 6f 75 |his happ|ens, you|
|00004be0| 72 0a 62 65 73 74 20 62 | 65 74 20 69 73 20 74 6f |r.best b|et is to|
|00004bf0| 20 65 78 74 72 61 63 74 | 20 61 6c 6c 20 66 69 6c | extract| all fil|
|00004c00| 65 73 20 66 72 6f 6d 20 | 61 6e 20 61 72 63 68 69 |es from |an archi|
|00004c10| 76 65 20 69 6e 73 74 65 | 61 64 20 6f 66 0a 73 70 |ve inste|ad of.sp|
|00004c20| 65 63 69 66 79 69 6e 67 | 20 73 70 65 63 69 66 69 |ecifying| specifi|
|00004c30| 63 20 6e 61 6d 65 73 2e | 0a 0a 09 09 09 20 20 20 |c names.|..... |
|00004c40| 52 45 56 49 53 49 4f 4e | 20 48 49 53 54 4f 52 59 |REVISION| HISTORY|
|00004c50| 0a 0a 56 65 72 73 69 6f | 6e 20 31 2e 30 30 0a 20 |..Versio|n 1.00. |
|00004c60| 20 20 20 20 43 6f 72 72 | 65 73 70 6f 6e 64 65 64 | Corr|esponded|
|00004c70| 20 74 6f 20 6a 75 73 74 | 20 74 68 65 20 54 69 6e | to just| the Tin|
|00004c80| 79 20 62 6f 6f 7a 20 31 | 2e 30 32 0a 0a 56 65 72 |y booz 1|.02..Ver|
|00004c90| 73 69 6f 6e 20 31 2e 30 | 31 0a 20 20 20 20 20 49 |sion 1.0|1. I|
|00004ca0| 6e 63 6c 75 64 65 64 20 | 54 49 4e 59 2c 20 53 4d |ncluded |TINY, SM|
|00004cb0| 41 4c 4c 2c 20 42 49 47 | 20 63 6f 6d 70 69 6c 61 |ALL, BIG| compila|
|00004cc0| 74 69 6f 6e 20 6f 70 74 | 69 6f 6e 73 2e 20 20 48 |tion opt|ions. H|
|00004cd0| 61 64 20 61 20 62 75 67 | 20 69 6e 0a 20 20 20 20 |ad a bug| in. |
|00004ce0| 20 66 75 6e 63 74 69 6f | 6e 20 6e 65 65 64 65 64 | functio|n needed|
|00004cf0| 28 29 20 74 68 61 74 20 | 73 6f 6d 65 74 69 6d 65 |() that |sometime|
|00004d00| 73 20 63 61 75 73 65 20 | 66 69 6c 65 20 65 78 74 |s cause |file ext|
|00004d10| 72 61 63 74 69 6f 6e 20 | 74 6f 20 66 61 69 6c 2e |raction |to fail.|
|00004d20| 0a 0a 56 65 72 73 69 6f | 6e 20 31 2e 30 32 0a 20 |..Versio|n 1.02. |
|00004d30| 20 20 20 20 46 69 78 65 | 64 20 62 75 67 20 69 6e | Fixe|d bug in|
|00004d40| 20 66 75 6e 63 74 69 6f | 6e 20 6e 65 65 64 65 64 | functio|n needed|
|00004d50| 28 29 2e 20 20 41 64 64 | 65 64 20 73 75 70 70 6f |(). Add|ed suppo|
|00004d60| 72 74 20 66 6f 72 20 54 | 75 72 62 6f 20 43 20 31 |rt for T|urbo C 1|
|00004d70| 2e 30 2e 0a 20 20 20 20 | 20 52 65 76 69 73 65 64 |.0.. | Revised|
|00004d80| 20 74 68 69 73 20 64 6f | 63 75 6d 65 6e 74 61 74 | this do|cumentat|
|00004d90| 69 6f 6e 20 61 6e 64 20 | 73 6f 6d 65 20 63 6f 6d |ion and |some com|
|00004da0| 6d 65 6e 74 73 20 69 6e | 20 74 68 65 20 73 6f 75 |ments in| the sou|
|00004db0| 72 63 65 20 63 6f 64 65 | 2e 0a 0a 20 20 20 20 20 |rce code|... |
|00004dc0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004dd0| 20 20 20 20 20 20 20 20 | 20 20 20 2d 2d 20 52 61 | | -- Ra|
|00004de0| 68 75 6c 20 44 68 65 73 | 69 20 31 39 38 38 2f 30 |hul Dhes|i 1988/0|
|00004df0| 38 2f 32 35 0a 74 6f 20 | 72 65 63 65 69 76 65 20 |8/25.to |receive |
|00004e00| 62 6f 6f 7a 2f 62 6f 6f | 7a 2e 70 72 6a 00 00 00 |booz/boo|z.prj...|
|00004e10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004e20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004e30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004e40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004e50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004e60| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 32 |.... 6|44 . 2|
|00004e70| 34 33 20 00 20 20 20 20 | 31 32 20 00 20 20 20 20 |43 . |12 . |
|00004e80| 20 20 20 20 32 31 32 20 | 20 34 34 30 32 30 34 32 | 212 | 4402042|
|00004e90| 32 33 35 20 20 20 36 35 | 30 36 00 20 00 00 00 00 |235 65|06. ....|
|00004ea0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004eb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ec0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ed0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ee0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ef0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f00| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004fa0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004fb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004fc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004fd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004fe0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ff0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005000| 62 6f 6f 7a 2e 63 09 09 | 28 6f 70 74 69 6f 6e 73 |booz.c..|(options|
|00005010| 2e 68 20 7a 6f 6f 2e 68 | 20 66 75 6e 63 2e 68 29 |.h zoo.h| func.h)|
|00005020| 0a 61 64 64 62 66 63 72 | 63 2e 63 0a 6c 7a 64 2e |.addbfcr|c.c.lzd.|
|00005030| 63 09 09 28 6f 70 74 69 | 6f 6e 73 2e 68 20 66 75 |c..(opti|ons.h fu|
|00005040| 6e 63 2e 68 29 0a 6f 6f | 7a 65 78 74 2e 63 09 28 |nc.h).oo|zext.c.(|
|00005050| 6f 70 74 69 6f 6e 73 2e | 68 20 7a 6f 6f 2e 68 20 |options.|h zoo.h |
|00005060| 6f 6f 7a 69 6f 2e 68 20 | 66 75 6e 63 2e 68 29 0a |oozio.h |func.h).|
|00005070| 70 6f 72 74 61 62 6c 65 | 2e 63 09 28 66 75 6e 63 |portable|.c.(func|
|00005080| 2e 68 20 7a 6f 6f 2e 68 | 29 0a 0c 00 6d 61 6b 65 |.h zoo.h|)...make|
|00005090| 66 69 6c 65 2e 6d 73 63 | 00 00 00 00 0b 08 00 00 |file.msc|........|
|000050a0| 18 00 0c 00 6d 61 6b 65 | 66 69 6c 65 2e 6e 69 78 |....make|file.nix|
|000050b0| 00 00 00 00 0c 08 00 00 | 14 00 08 00 6f 6f 7a 65 |........|....ooze|
|000050c0| 78 74 2e 63 00 00 00 00 | 0d 08 00 00 10 00 07 00 |xt.c....|........|
|000050d0| 6f 6f 7a 69 6f 2e 68 00 | 0e 08 00 00 14 00 09 00 |oozio.h.|........|
|000050e0| 6f 70 74 69 6f 6e 73 2e | 68 00 00 00 10 08 00 00 |options.|h.......|
|000050f0| 14 00 0a 00 70 6f 72 74 | 61 62 6c 65 2e 63 00 00 |....port|able.c..|
|00005100| 11 08 00 00 00 01 05 00 | 7a 6f 6f 2e 68 00 00 00 |........|zoo.h...|
|00005110| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005120| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005130| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005140| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005150| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005180| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000051a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000051b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000051c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000051d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000051e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000051f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005200| 62 6f 6f 7a 2f 66 75 6e | 63 2e 68 00 00 00 00 00 |booz/fun|c.h.....|
|00005210| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005220| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005230| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005260| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 32 |.... 6|44 . 2|
|00005270| 34 33 20 00 20 20 20 20 | 31 32 20 00 20 20 20 20 |43 . |12 . |
|00005280| 20 20 20 20 37 37 31 20 | 20 34 34 30 32 30 34 32 | 771 | 4402042|
|00005290| 32 33 36 20 20 20 36 31 | 33 37 00 20 00 00 00 00 |236 61|37. ....|
|000052a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000052b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000052c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000052d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000052e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000052f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005300| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005310| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005320| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005330| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005340| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005350| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005380| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005390| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000053a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000053b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000053c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000053d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000053e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000053f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005400| 2f 2a 20 0a 54 68 65 20 | 63 6f 6e 74 65 6e 74 73 |/* .The |contents|
|00005410| 20 6f 66 20 74 68 69 73 | 20 66 69 6c 65 20 61 72 | of this| file ar|
|00005420| 65 20 68 65 72 65 62 79 | 20 72 65 6c 65 61 73 65 |e hereby| release|
|00005430| 64 20 74 6f 20 74 68 65 | 20 70 75 62 6c 69 63 20 |d to the| public |
|00005440| 64 6f 6d 61 69 6e 2e 0a | 20 20 20 20 20 20 20 20 |domain..| |
|00005450| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005460| 20 20 20 20 20 20 20 20 | 20 20 20 2d 2d 20 52 61 | | -- Ra|
|00005470| 68 75 6c 20 44 68 65 73 | 69 20 31 39 38 37 2f 30 |hul Dhes|i 1987/0|
|00005480| 32 2f 30 38 0a 2a 2f 0a | 0a 2f 2a 20 46 75 6e 63 |2/08.*/.|./* Func|
|00005490| 74 69 6f 6e 73 20 64 65 | 66 69 6e 65 64 20 62 79 |tions de|fined by|
|000054a0| 20 42 6f 6f 7a 20 2a 2f | 0a 0a 69 6e 74 20 67 65 | Booz */|..int ge|
|000054b0| 74 66 69 6c 65 20 28 29 | 3b 0a 69 6e 74 20 6c 7a |tfile ()|;.int lz|
|000054c0| 64 20 28 29 3b 0a 69 6e | 74 20 72 65 61 64 64 69 |d ();.in|t readdi|
|000054d0| 72 20 28 29 3b 0a 69 6e | 74 20 72 64 5f 7a 6f 6f |r ();.in|t rd_zoo|
|000054e0| 68 20 28 29 3b 0a 69 6e | 74 20 72 64 5f 64 69 72 |h ();.in|t rd_dir|
|000054f0| 20 28 29 3b 0a 69 6e 74 | 20 61 64 64 62 66 63 72 | ();.int| addbfcr|
|00005500| 63 28 29 3b 0a 69 6e 74 | 20 70 72 74 65 72 72 6f |c();.int| prterro|
|00005510| 72 28 29 3b 0a 69 6e 74 | 20 6f 6f 7a 65 78 74 20 |r();.int| oozext |
|00005520| 28 29 3b 0a 69 6e 74 20 | 70 75 74 73 74 72 20 28 |();.int |putstr (|
|00005530| 29 3b 0a 63 68 61 72 20 | 2a 69 74 6f 61 20 28 29 |);.char |*itoa ()|
|00005540| 3b 0a 69 6e 74 20 66 69 | 78 66 6e 61 6d 65 20 28 |;.int fi|xfname (|
|00005550| 29 3b 0a 0a 2f 2a 20 53 | 74 61 6e 64 61 72 64 20 |);../* S|tandard |
|00005560| 66 75 6e 63 74 69 6f 6e | 73 20 2a 2f 0a 0a 63 68 |function|s */..ch|
|00005570| 61 72 20 2a 6d 61 6c 6c | 6f 63 20 28 29 3b 0a 69 |ar *mall|oc ();.i|
|00005580| 6e 74 20 63 6c 6f 73 65 | 20 28 29 3b 0a 69 6e 74 |nt close| ();.int|
|00005590| 20 63 72 65 61 74 20 28 | 29 3b 0a 69 6e 74 20 6f | creat (|);.int o|
|000055a0| 70 65 6e 20 28 29 3b 0a | 69 6e 74 20 72 65 61 64 |pen ();.|int read|
|000055b0| 20 28 29 3b 0a 69 6e 74 | 20 75 6e 6c 69 6e 6b 20 | ();.int| unlink |
|000055c0| 28 29 3b 0a 69 6e 74 20 | 77 72 69 74 65 20 28 29 |();.int |write ()|
|000055d0| 3b 0a 6c 6f 6e 67 20 6c | 73 65 65 6b 20 28 29 3b |;.long l|seek ();|
|000055e0| 0a 75 6e 73 69 67 6e 65 | 64 20 69 6e 74 20 73 74 |.unsigne|d int st|
|000055f0| 72 6c 65 6e 20 28 29 3b | 0a 00 00 00 00 00 00 00 |rlen ();|........|
|00005600| 62 6f 6f 7a 2f 6c 7a 64 | 2e 63 00 00 00 00 00 00 |booz/lzd|.c......|
|00005610| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005620| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005630| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005640| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005650| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005660| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 32 |.... 6|44 . 2|
|00005670| 34 33 20 00 20 20 20 20 | 31 32 20 00 20 20 20 20 |43 . |12 . |
|00005680| 20 20 31 33 32 37 37 20 | 20 34 34 30 32 30 34 32 | 13277 | 4402042|
|00005690| 32 34 31 20 20 20 36 30 | 33 31 00 20 00 00 00 00 |241 60|31. ....|
|000056a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000056b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000056c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000056d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000056e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000056f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005700| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005710| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005720| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005730| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005740| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005750| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005760| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005770| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005780| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005790| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000057a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000057b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000057c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000057d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000057e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000057f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005800| 2f 2a 0a 4c 65 6d 70 65 | 6c 2d 5a 69 76 20 64 65 |/*.Lempe|l-Ziv de|
|00005810| 63 6f 6d 70 72 65 73 73 | 69 6f 6e 2e 20 20 4d 6f |compress|ion. Mo|
|00005820| 73 74 6c 79 20 62 61 73 | 65 64 20 6f 6e 20 54 6f |stly bas|ed on To|
|00005830| 6d 20 50 66 61 75 27 73 | 20 61 73 73 65 6d 62 6c |m Pfau's| assembl|
|00005840| 79 20 6c 61 6e 67 75 61 | 67 65 0a 63 6f 64 65 2e |y langua|ge.code.|
|00005850| 20 20 54 68 65 20 63 6f | 6e 74 65 6e 74 73 20 6f | The co|ntents o|
|00005860| 66 20 74 68 69 73 20 66 | 69 6c 65 20 61 72 65 20 |f this f|ile are |
|00005870| 68 65 72 65 62 79 20 72 | 65 6c 65 61 73 65 64 20 |hereby r|eleased |
|00005880| 74 6f 20 74 68 65 20 70 | 75 62 6c 69 63 20 64 6f |to the p|ublic do|
|00005890| 6d 61 69 6e 2e 0a 20 20 | 20 20 20 20 20 20 20 20 |main.. | |
|000058a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000058b0| 20 20 20 20 20 20 20 2d | 2d 20 52 61 68 75 6c 20 | -|- Rahul |
|000058c0| 44 68 65 73 69 20 31 39 | 38 36 2f 31 31 2f 31 34 |Dhesi 19|86/11/14|
|000058d0| 2c 20 31 39 38 37 2f 30 | 32 2f 30 38 0a 2a 2f 0a |, 1987/0|2/08.*/.|
|000058e0| 0a 23 69 6e 63 6c 75 64 | 65 20 22 66 75 6e 63 2e |.#includ|e "func.|
|000058f0| 68 22 0a 23 69 6e 63 6c | 75 64 65 20 22 6f 70 74 |h".#incl|ude "opt|
|00005900| 69 6f 6e 73 2e 68 22 0a | 0a 23 64 65 66 69 6e 65 |ions.h".|.#define|
|00005910| 20 20 49 4e 42 55 46 53 | 49 5a 20 20 20 20 28 49 | INBUFS|IZ (I|
|00005920| 4e 5f 42 55 46 5f 53 49 | 5a 45 20 2d 20 53 50 41 |N_BUF_SI|ZE - SPA|
|00005930| 52 45 29 0a 23 64 65 66 | 69 6e 65 20 20 4f 55 54 |RE).#def|ine OUT|
|00005940| 42 55 46 53 49 5a 20 20 | 20 28 4f 55 54 5f 42 55 |BUFSIZ | (OUT_BU|
|00005950| 46 5f 53 49 5a 45 20 2d | 20 53 50 41 52 45 29 0a |F_SIZE -| SPARE).|
|00005960| 23 64 65 66 69 6e 65 20 | 20 4d 45 4d 45 52 52 20 |#define | MEMERR |
|00005970| 20 20 20 20 20 32 0a 23 | 64 65 66 69 6e 65 20 20 | 2.#|define |
|00005980| 49 4f 45 52 52 20 20 20 | 20 20 20 20 31 0a 23 64 |IOERR | 1.#d|
|00005990| 65 66 69 6e 65 20 20 4d | 41 58 42 49 54 53 20 20 |efine M|AXBITS |
|000059a0| 20 20 20 31 33 0a 23 64 | 65 66 69 6e 65 20 20 43 | 13.#d|efine C|
|000059b0| 4c 45 41 52 20 20 20 20 | 20 20 20 32 35 36 20 20 |LEAR | 256 |
|000059c0| 20 20 20 20 20 20 20 2f | 2a 20 63 6c 65 61 72 20 | /|* clear |
|000059d0| 63 6f 64 65 20 2a 2f 0a | 23 64 65 66 69 6e 65 20 |code */.|#define |
|000059e0| 20 5a 5f 45 4f 46 20 20 | 20 20 20 20 20 32 35 37 | Z_EOF | 257|
|000059f0| 20 20 20 20 20 20 20 20 | 20 2f 2a 20 65 6e 64 20 | | /* end |
|00005a00| 6f 66 20 66 69 6c 65 20 | 6d 61 72 6b 65 72 20 2a |of file |marker *|
|00005a10| 2f 0a 23 64 65 66 69 6e | 65 20 20 46 49 52 53 54 |/.#defin|e FIRST|
|00005a20| 5f 46 52 45 45 20 20 32 | 35 38 20 20 20 20 20 20 |_FREE 2|58 |
|00005a30| 20 20 20 2f 2a 20 66 69 | 72 73 74 20 66 72 65 65 | /* fi|rst free|
|00005a40| 20 63 6f 64 65 20 2a 2f | 0a 23 64 65 66 69 6e 65 | code */|.#define|
|00005a50| 20 20 4d 41 58 4d 41 58 | 20 20 20 20 20 20 38 31 | MAXMAX| 81|
|00005a60| 39 32 20 20 20 20 20 20 | 20 20 2f 2a 20 6d 61 78 |92 | /* max|
|00005a70| 20 63 6f 64 65 20 2b 20 | 31 20 2a 2f 0a 0a 23 64 | code + |1 */..#d|
|00005a80| 65 66 69 6e 65 20 20 53 | 50 41 52 45 20 20 20 20 |efine S|PARE |
|00005a90| 20 20 20 35 0a 0a 73 74 | 72 75 63 74 20 74 61 62 | 5..st|ruct tab|
|00005aa0| 65 6e 74 72 79 20 7b 0a | 20 20 20 75 6e 73 69 67 |entry {.| unsig|
|00005ab0| 6e 65 64 20 6e 65 78 74 | 3b 0a 20 20 20 63 68 61 |ned next|;. cha|
|00005ac0| 72 20 7a 5f 63 68 3b 0a | 7d 3b 0a 0a 73 74 72 75 |r z_ch;.|};..stru|
|00005ad0| 63 74 20 74 61 62 65 6e | 74 72 79 20 2a 74 61 62 |ct taben|try *tab|
|00005ae0| 6c 65 3b 0a 69 6e 74 20 | 20 20 67 6f 74 6d 65 6d |le;.int | gotmem|
|00005af0| 20 3d 20 30 3b 0a 0a 69 | 6e 74 20 69 6e 69 74 5f | = 0;..i|nt init_|
|00005b00| 64 74 61 62 28 29 3b 0a | 75 6e 73 69 67 6e 65 64 |dtab();.|unsigned|
|00005b10| 20 72 64 5f 64 63 6f 64 | 65 28 29 3b 0a 69 6e 74 | rd_dcod|e();.int|
|00005b20| 20 77 72 5f 64 63 68 61 | 72 28 29 3b 0a 69 6e 74 | wr_dcha|r();.int|
|00005b30| 20 61 64 5f 64 63 6f 64 | 65 28 29 3b 0a 0a 75 6e | ad_dcod|e();..un|
|00005b40| 73 69 67 6e 65 64 20 6c | 7a 64 5f 73 70 20 3d 20 |signed l|zd_sp = |
|00005b50| 30 3b 0a 75 6e 73 69 67 | 6e 65 64 20 6c 7a 64 5f |0;.unsig|ned lzd_|
|00005b60| 73 74 61 63 6b 5b 53 54 | 41 43 4b 53 49 5a 45 20 |stack[ST|ACKSIZE |
|00005b70| 2b 20 53 50 41 52 45 5d | 3b 0a 0a 69 6e 74 20 70 |+ SPARE]|;..int p|
|00005b80| 75 73 68 28 63 68 29 0a | 69 6e 74 20 63 68 3b 0a |ush(ch).|int ch;.|
|00005b90| 7b 0a 20 20 20 6c 7a 64 | 5f 73 74 61 63 6b 5b 6c |{. lzd|_stack[l|
|00005ba0| 7a 64 5f 73 70 2b 2b 5d | 20 3d 20 63 68 3b 0a 20 |zd_sp++]| = ch;. |
|00005bb0| 20 20 69 66 20 28 6c 7a | 64 5f 73 70 20 3e 3d 20 | if (lz|d_sp >= |
|00005bc0| 53 54 41 43 4b 53 49 5a | 45 29 0a 20 20 20 20 20 |STACKSIZ|E). |
|00005bd0| 20 70 72 74 65 72 72 6f | 72 20 28 27 66 27 2c 20 | prterro|r ('f', |
|00005be0| 22 53 74 61 63 6b 20 6f | 76 65 72 66 6c 6f 77 20 |"Stack o|verflow |
|00005bf0| 69 6e 20 6c 7a 64 28 29 | 5c 6e 22 2c 20 28 63 68 |in lzd()|\n", (ch|
|00005c00| 61 72 20 2a 29 20 30 2c | 20 28 63 68 61 72 20 2a |ar *) 0,| (char *|
|00005c10| 29 20 30 29 3b 0a 7d 0a | 20 20 20 0a 23 64 65 66 |) 0);.}.| .#def|
|00005c20| 69 6e 65 20 20 70 6f 70 | 28 29 20 20 20 20 28 6c |ine pop|() (l|
|00005c30| 7a 64 5f 73 74 61 63 6b | 5b 2d 2d 6c 7a 64 5f 73 |zd_stack|[--lzd_s|
|00005c40| 70 5d 29 0a 0a 63 68 61 | 72 20 6f 75 74 5f 62 75 |p])..cha|r out_bu|
|00005c50| 66 5f 61 64 72 5b 49 4e | 5f 42 55 46 5f 53 49 5a |f_adr[IN|_BUF_SIZ|
|00005c60| 45 20 2b 20 53 50 41 52 | 45 5d 3b 0a 63 68 61 72 |E + SPAR|E];.char|
|00005c70| 20 69 6e 5f 62 75 66 5f | 61 64 72 5b 4f 55 54 5f | in_buf_|adr[OUT_|
|00005c80| 42 55 46 5f 53 49 5a 45 | 20 2b 20 53 50 41 52 45 |BUF_SIZE| + SPARE|
|00005c90| 5d 3b 0a 0a 63 68 61 72 | 20 6d 65 6d 66 6c 61 67 |];..char| memflag|
|00005ca0| 20 3d 20 30 3b 20 20 20 | 20 20 20 20 20 20 20 20 | = 0; | |
|00005cb0| 20 20 20 20 20 2f 2a 20 | 6d 65 6d 6f 72 79 20 61 | /* |memory a|
|00005cc0| 6c 6c 6f 63 61 74 65 64 | 3f 20 66 6c 61 67 20 2a |llocated|? flag *|
|00005cd0| 2f 0a 0a 75 6e 73 69 67 | 6e 65 64 20 63 75 72 5f |/..unsig|ned cur_|
|00005ce0| 63 6f 64 65 3b 0a 75 6e | 73 69 67 6e 65 64 20 6f |code;.un|signed o|
|00005cf0| 6c 64 5f 63 6f 64 65 3b | 0a 75 6e 73 69 67 6e 65 |ld_code;|.unsigne|
|00005d00| 64 20 69 6e 5f 63 6f 64 | 65 3b 0a 0a 75 6e 73 69 |d in_cod|e;..unsi|
|00005d10| 67 6e 65 64 20 66 72 65 | 65 5f 63 6f 64 65 3b 0a |gned fre|e_code;.|
|00005d20| 69 6e 74 20 6e 62 69 74 | 73 3b 0a 75 6e 73 69 67 |int nbit|s;.unsig|
|00005d30| 6e 65 64 20 6d 61 78 5f | 63 6f 64 65 3b 0a 0a 63 |ned max_|code;..c|
|00005d40| 68 61 72 20 66 69 6e 5f | 63 68 61 72 3b 0a 63 68 |har fin_|char;.ch|
|00005d50| 61 72 20 6b 3b 0a 75 6e | 73 69 67 6e 65 64 20 6d |ar k;.un|signed m|
|00005d60| 61 73 6b 73 5b 5d 20 3d | 20 7b 20 30 2c 20 30 2c |asks[] =| { 0, 0,|
|00005d70| 20 30 2c 20 30 2c 20 30 | 2c 20 30 2c 20 30 2c 20 | 0, 0, 0|, 0, 0, |
|00005d80| 30 2c 20 30 2c 0a 20 20 | 20 20 20 20 20 20 20 20 |0, 0,. | |
|00005d90| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 30 78 | | 0x|
|00005da0| 31 66 66 2c 20 30 78 33 | 66 66 2c 20 30 78 37 66 |1ff, 0x3|ff, 0x7f|
|00005db0| 66 2c 20 30 78 66 66 66 | 2c 20 30 78 31 66 66 66 |f, 0xfff|, 0x1fff|
|00005dc0| 20 7d 3b 0a 75 6e 73 69 | 67 6e 65 64 20 62 69 74 | };.unsi|gned bit|
|00005dd0| 5f 6f 66 66 73 65 74 3b | 0a 75 6e 73 69 67 6e 65 |_offset;|.unsigne|
|00005de0| 64 20 6f 75 74 70 75 74 | 5f 6f 66 66 73 65 74 3b |d output|_offset;|
|00005df0| 0a 69 6e 74 20 69 6e 5f | 68 61 6e 2c 20 6f 75 74 |.int in_|han, out|
|00005e00| 5f 68 61 6e 3b 20 0a 0a | 69 6e 74 20 6c 7a 64 28 |_han; ..|int lzd(|
|00005e10| 69 6e 70 75 74 5f 68 61 | 6e 64 6c 65 2c 20 6f 75 |input_ha|ndle, ou|
|00005e20| 74 70 75 74 5f 68 61 6e | 64 6c 65 29 0a 69 6e 74 |tput_han|dle).int|
|00005e30| 20 69 6e 70 75 74 5f 68 | 61 6e 64 6c 65 2c 20 6f | input_h|andle, o|
|00005e40| 75 74 70 75 74 5f 68 61 | 6e 64 6c 65 3b 20 20 20 |utput_ha|ndle; |
|00005e50| 20 20 20 20 20 20 20 2f | 2a 20 69 6e 70 75 74 20 | /|* input |
|00005e60| 26 20 6f 75 74 70 75 74 | 20 66 69 6c 65 20 68 61 |& output| file ha|
|00005e70| 6e 64 6c 65 73 20 2a 2f | 0a 7b 0a 20 20 20 69 6e |ndles */|.{. in|
|00005e80| 5f 68 61 6e 20 3d 20 69 | 6e 70 75 74 5f 68 61 6e |_han = i|nput_han|
|00005e90| 64 6c 65 3b 20 20 20 20 | 20 20 20 20 20 20 20 20 |dle; | |
|00005ea0| 20 20 20 20 20 2f 2a 20 | 6d 61 6b 65 20 69 74 20 | /* |make it |
|00005eb0| 61 76 61 69 6c 20 74 6f | 20 6f 74 68 65 72 20 66 |avail to| other f|
|00005ec0| 6e 73 20 2a 2f 0a 20 20 | 20 6f 75 74 5f 68 61 6e |ns */. | out_han|
|00005ed0| 20 3d 20 6f 75 74 70 75 | 74 5f 68 61 6e 64 6c 65 | = outpu|t_handle|
|00005ee0| 3b 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |; | |
|00005ef0| 2f 2a 20 64 69 74 74 6f | 20 2a 2f 0a 20 20 20 6e |/* ditto| */. n|
|00005f00| 62 69 74 73 20 3d 20 39 | 3b 0a 20 20 20 6d 61 78 |bits = 9|;. max|
|00005f10| 5f 63 6f 64 65 20 3d 20 | 35 31 32 3b 0a 20 20 20 |_code = |512;. |
|00005f20| 66 72 65 65 5f 63 6f 64 | 65 20 3d 20 46 49 52 53 |free_cod|e = FIRS|
|00005f30| 54 5f 46 52 45 45 3b 0a | 20 20 20 6c 7a 64 5f 73 |T_FREE;.| lzd_s|
|00005f40| 70 20 3d 20 30 3b 0a 20 | 20 20 62 69 74 5f 6f 66 |p = 0;. | bit_of|
|00005f50| 66 73 65 74 20 3d 20 30 | 3b 0a 20 20 20 6f 75 74 |fset = 0|;. out|
|00005f60| 70 75 74 5f 6f 66 66 73 | 65 74 20 3d 20 30 3b 0a |put_offs|et = 0;.|
|00005f70| 0a 20 20 20 69 66 20 28 | 67 6f 74 6d 65 6d 20 3d |. if (|gotmem =|
|00005f80| 3d 20 30 29 20 7b 0a 20 | 20 20 20 20 20 74 61 62 |= 0) {. | tab|
|00005f90| 6c 65 20 3d 20 28 73 74 | 72 75 63 74 20 74 61 62 |le = (st|ruct tab|
|00005fa0| 65 6e 74 72 79 20 2a 29 | 20 0a 20 20 20 20 20 20 |entry *)| . |
|00005fb0| 20 20 20 6d 61 6c 6c 6f | 63 20 28 4d 41 58 4d 41 | mallo|c (MAXMA|
|00005fc0| 58 20 2a 20 73 69 7a 65 | 6f 66 20 28 73 74 72 75 |X * size|of (stru|
|00005fd0| 63 74 20 74 61 62 65 6e | 74 72 79 29 20 2b 20 53 |ct taben|try) + S|
|00005fe0| 50 41 52 45 29 3b 0a 20 | 20 20 20 20 20 67 6f 74 |PARE);. | got|
|00005ff0| 6d 65 6d 2b 2b 3b 0a 20 | 20 20 7d 0a 20 20 20 69 |mem++;. | }. i|
|00006000| 66 20 28 74 61 62 6c 65 | 20 3d 3d 20 28 73 74 72 |f (table| == (str|
|00006010| 75 63 74 20 74 61 62 65 | 6e 74 72 79 20 2a 29 20 |uct tabe|ntry *) |
|00006020| 30 29 0a 20 20 20 20 20 | 20 6d 65 6d 65 72 72 28 |0). | memerr(|
|00006030| 29 3b 0a 0a 20 20 20 69 | 66 20 28 72 65 61 64 28 |);.. i|f (read(|
|00006040| 69 6e 5f 68 61 6e 2c 20 | 69 6e 5f 62 75 66 5f 61 |in_han, |in_buf_a|
|00006050| 64 72 2c 20 49 4e 42 55 | 46 53 49 5a 29 20 3d 3d |dr, INBU|FSIZ) ==|
|00006060| 20 2d 31 29 0a 20 20 20 | 20 20 20 72 65 74 75 72 | -1). | retur|
|00006070| 6e 28 49 4f 45 52 52 29 | 3b 0a 0a 20 20 20 69 6e |n(IOERR)|;.. in|
|00006080| 69 74 5f 64 74 61 62 28 | 29 3b 20 20 20 20 20 20 |it_dtab(|); |
|00006090| 20 20 20 20 20 20 20 2f | 2a 20 69 6e 69 74 69 61 | /|* initia|
|000060a0| 6c 69 7a 65 20 74 61 62 | 6c 65 20 2a 2f 0a 0a 6c |lize tab|le */..l|
|000060b0| 6f 6f 70 3a 0a 20 20 20 | 63 75 72 5f 63 6f 64 65 |oop:. |cur_code|
|000060c0| 20 3d 20 72 64 5f 64 63 | 6f 64 65 28 29 3b 0a 20 | = rd_dc|ode();. |
|000060d0| 20 20 69 66 20 28 63 75 | 72 5f 63 6f 64 65 20 3d | if (cu|r_code =|
|000060e0| 3d 20 5a 5f 45 4f 46 29 | 20 7b 0a 20 20 20 20 20 |= Z_EOF)| {. |
|000060f0| 20 69 66 20 28 6f 75 74 | 70 75 74 5f 6f 66 66 73 | if (out|put_offs|
|00006100| 65 74 20 21 3d 20 30 29 | 20 7b 0a 20 20 20 20 20 |et != 0)| {. |
|00006110| 20 20 20 20 69 66 20 28 | 6f 75 74 5f 68 61 6e 20 | if (|out_han |
|00006120| 21 3d 20 2d 32 29 20 7b | 0a 20 20 20 20 20 20 20 |!= -2) {|. |
|00006130| 20 20 20 20 20 69 66 20 | 28 77 72 69 74 65 28 6f | if |(write(o|
|00006140| 75 74 5f 68 61 6e 2c 20 | 6f 75 74 5f 62 75 66 5f |ut_han, |out_buf_|
|00006150| 61 64 72 2c 20 6f 75 74 | 70 75 74 5f 6f 66 66 73 |adr, out|put_offs|
|00006160| 65 74 29 20 21 3d 20 6f | 75 74 70 75 74 5f 6f 66 |et) != o|utput_of|
|00006170| 66 73 65 74 29 0a 20 20 | 20 20 20 20 20 20 20 20 |fset). | |
|00006180| 20 20 20 20 20 70 72 74 | 65 72 72 6f 72 20 28 27 | prt|error ('|
|00006190| 66 27 2c 20 22 4f 75 74 | 70 75 74 20 65 72 72 6f |f', "Out|put erro|
|000061a0| 72 20 69 6e 20 6c 7a 64 | 28 29 5c 6e 22 2c 20 0a |r in lzd|()\n", .|
|000061b0| 09 09 09 09 09 09 28 63 | 68 61 72 20 2a 29 20 30 |......(c|har *) 0|
|000061c0| 2c 20 28 63 68 61 72 20 | 2a 29 20 30 29 3b 0a 20 |, (char |*) 0);. |
|000061d0| 20 20 20 20 20 20 20 20 | 7d 0a 20 20 20 20 20 20 | |}. |
|000061e0| 20 20 20 61 64 64 62 66 | 63 72 63 28 6f 75 74 5f | addbf|crc(out_|
|000061f0| 62 75 66 5f 61 64 72 2c | 20 6f 75 74 70 75 74 5f |buf_adr,| output_|
|00006200| 6f 66 66 73 65 74 29 3b | 0a 20 20 20 20 20 20 7d |offset);|. }|
|00006210| 0a 20 20 20 20 20 20 72 | 65 74 75 72 6e 20 28 30 |. r|eturn (0|
|00006220| 29 3b 0a 20 20 20 7d 0a | 0a 20 20 20 69 66 20 28 |);. }.|. if (|
|00006230| 63 75 72 5f 63 6f 64 65 | 20 3d 3d 20 43 4c 45 41 |cur_code| == CLEA|
|00006240| 52 29 20 7b 0a 20 20 20 | 20 20 20 69 6e 69 74 5f |R) {. | init_|
|00006250| 64 74 61 62 28 29 3b 0a | 20 20 20 20 20 20 66 69 |dtab();.| fi|
|00006260| 6e 5f 63 68 61 72 20 3d | 20 6b 20 3d 20 6f 6c 64 |n_char =| k = old|
|00006270| 5f 63 6f 64 65 20 3d 20 | 63 75 72 5f 63 6f 64 65 |_code = |cur_code|
|00006280| 20 3d 20 72 64 5f 64 63 | 6f 64 65 28 29 3b 0a 20 | = rd_dc|ode();. |
|00006290| 20 20 20 20 20 77 72 5f | 64 63 68 61 72 28 6b 29 | wr_|dchar(k)|
|000062a0| 3b 0a 20 20 20 20 20 20 | 67 6f 74 6f 20 6c 6f 6f |;. |goto loo|
|000062b0| 70 3b 0a 20 20 20 7d 0a | 0a 20 20 20 69 6e 5f 63 |p;. }.|. in_c|
|000062c0| 6f 64 65 20 3d 20 63 75 | 72 5f 63 6f 64 65 3b 0a |ode = cu|r_code;.|
|000062d0| 20 20 20 69 66 20 28 63 | 75 72 5f 63 6f 64 65 20 | if (c|ur_code |
|000062e0| 3e 3d 20 66 72 65 65 5f | 63 6f 64 65 29 20 7b 20 |>= free_|code) { |
|000062f0| 20 20 20 20 20 20 20 2f | 2a 20 69 66 20 63 6f 64 | /|* if cod|
|00006300| 65 20 6e 6f 74 20 69 6e | 20 74 61 62 6c 65 20 28 |e not in| table (|
|00006310| 6b 3c 77 3e 6b 3c 77 3e | 6b 29 20 2a 2f 0a 20 20 |k<w>k<w>|k) */. |
|00006320| 20 20 20 20 63 75 72 5f | 63 6f 64 65 20 3d 20 6f | cur_|code = o|
|00006330| 6c 64 5f 63 6f 64 65 3b | 20 20 20 20 20 20 20 20 |ld_code;| |
|00006340| 20 20 20 20 20 2f 2a 20 | 70 72 65 76 69 6f 75 73 | /* |previous|
|00006350| 20 63 6f 64 65 20 62 65 | 63 6f 6d 65 73 20 63 75 | code be|comes cu|
|00006360| 72 72 65 6e 74 20 2a 2f | 0a 20 20 20 20 20 20 70 |rrent */|. p|
|00006370| 75 73 68 28 66 69 6e 5f | 63 68 61 72 29 3b 0a 20 |ush(fin_|char);. |
|00006380| 20 20 7d 0a 0a 20 20 20 | 77 68 69 6c 65 20 28 63 | }.. |while (c|
|00006390| 75 72 5f 63 6f 64 65 20 | 3e 20 32 35 35 29 20 7b |ur_code |> 255) {|
|000063a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 2f | | /|
|000063b0| 2a 20 69 66 20 63 6f 64 | 65 2c 20 6e 6f 74 20 63 |* if cod|e, not c|
|000063c0| 68 61 72 61 63 74 65 72 | 20 2a 2f 0a 20 20 20 20 |haracter| */. |
|000063d0| 20 20 70 75 73 68 28 74 | 61 62 6c 65 5b 63 75 72 | push(t|able[cur|
|000063e0| 5f 63 6f 64 65 5d 2e 7a | 5f 63 68 29 3b 20 20 20 |_code].z|_ch); |
|000063f0| 20 20 20 20 20 20 2f 2a | 20 70 75 73 68 20 73 75 | /*| push su|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.