home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / unix_c / macintsh / sit.tar < prev    next >
Tape Archive  |  1989-03-05  |  32.0 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


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

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Tape Archive (archive/tar) magic Supported
100% file tar archive default
99% file tar archive (V7), file sit/, mode 755 , uid 243 , gid 12 , size 0 , seconds 4404334102 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| 73 69 74 2f 00 00 00 00 | 00 00 00 00 00 00 00 00 |sit/....|........|
|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 34 33 33 34 | 0 | 4404334|
|00000090| 31 30 32 20 20 20 34 36 | 30 35 00 20 00 00 00 00 |102 46|05. ....|
|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| 73 69 74 2f 53 68 61 72 | 46 69 6c 65 2e 48 65 61 |sit/Shar|File.Hea|
|00000210| 64 65 72 73 00 00 00 00 | 00 00 00 00 00 00 00 00 |ders....|........|
|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 20 35 33 33 20 | 20 34 34 30 34 33 33 34 | 533 | 4404334|
|00000290| 31 30 33 20 20 20 37 36 | 34 36 00 20 00 00 00 00 |103 76|46. ....|
|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| 3d 3d 3d 20 73 69 74 2e | 73 68 61 72 20 3d 3d 3d |=== sit.|shar ===|
|00000410| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000420| 3d 3d 3d 3d 3d 3d 0a 46 | 72 6f 6d 3a 20 74 77 62 |======.F|rom: twb|
|00000430| 40 72 6f 6c 65 78 2e 55 | 55 43 50 20 28 54 6f 6d |@rolex.U|UCP (Tom|
|00000440| 20 42 65 72 65 69 74 65 | 72 29 0a 4e 65 77 73 67 | Bereite|r).Newsg|
|00000450| 72 6f 75 70 73 3a 20 63 | 6f 6d 70 2e 73 6f 75 72 |roups: c|omp.sour|
|00000460| 63 65 73 2e 6d 61 63 0a | 53 75 62 6a 65 63 74 3a |ces.mac.|Subject:|
|00000470| 20 53 74 75 66 66 49 74 | 20 55 74 69 6c 69 74 79 | StuffIt| Utility|
|00000480| 20 66 6f 72 20 55 4e 2a | 58 0a 44 61 74 65 3a 20 | for UN*|X.Date: |
|00000490| 36 20 44 65 63 20 38 38 | 20 31 36 3a 33 30 3a 34 |6 Dec 88| 16:30:4|
|000004a0| 35 20 47 4d 54 0a 41 70 | 70 72 6f 76 65 64 3a 20 |5 GMT.Ap|proved: |
|000004b0| 62 79 74 65 62 75 67 40 | 64 68 77 36 38 6b 2e 63 |bytebug@|dhw68k.c|
|000004c0| 74 73 2e 63 6f 6d 20 28 | 52 6f 67 65 72 20 4c 2e |ts.com (|Roger L.|
|000004d0| 20 4c 6f 6e 67 29 0a 0a | 5b 53 74 75 66 66 49 74 | Long)..|[StuffIt|
|000004e0| 20 55 74 69 6c 69 74 79 | 20 66 6f 72 20 55 4e 2a | Utility| for UN*|
|000004f0| 58 5d 0a 0a 41 66 74 65 | 72 20 73 65 65 69 6e 67 |X]..Afte|r seeing|
|00000500| 20 73 65 76 65 72 61 6c | 20 72 65 71 75 65 73 74 | several| request|
|00000510| 73 20 66 6f 72 20 61 20 | 76 65 72 73 69 6f 6e 20 |s for a |version |
|00000520| 6f 66 20 53 74 75 66 66 | 69 74 20 66 6f 72 20 55 |of Stuff|it for U|
|00000530| 4e 2a 58 20 49 20 74 68 | 6f 75 67 68 74 0a 49 27 |N*X I th|ought.I'|
|00000540| 64 20 70 6f 73 74 20 74 | 68 65 20 66 6f 6c 6c 6f |d post t|he follo|
|00000550| 77 69 6e 67 3a 0a 0a 2d | 2d 2d 0a 00 00 00 00 00 |wing:..-|--......|
|00000560| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000570| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000580| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000590| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000600| 73 69 74 2f 52 45 41 44 | 4d 45 00 00 00 00 00 00 |sit/READ|ME......|
|00000610| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000620| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000630| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000640| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000650| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000660| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 32 |.... 6|44 . 2|
|00000670| 34 33 20 00 20 20 20 20 | 31 32 20 00 20 20 20 20 |43 . |12 . |
|00000680| 20 20 20 32 32 37 31 20 | 20 34 34 30 34 33 33 34 | 2271 | 4404334|
|00000690| 30 36 35 20 20 20 35 35 | 36 34 00 20 00 00 00 00 |065 55|64. ....|
|000006a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000700| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000710| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000720| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000730| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000740| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000750| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000760| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000770| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000780| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000790| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000800| 54 68 69 73 20 73 68 61 | 72 20 66 69 6c 65 20 63 |This sha|r file c|
|00000810| 6f 6e 74 61 69 6e 73 20 | 74 68 65 20 73 6f 75 72 |ontains |the sour|
|00000820| 63 65 20 74 6f 20 22 73 | 69 74 22 20 61 20 55 4e |ce to "s|it" a UN|
|00000830| 49 58 20 75 74 69 6c 69 | 74 79 20 77 68 69 63 68 |IX utili|ty which|
|00000840| 20 70 72 6f 64 75 63 65 | 73 0a 53 74 75 66 66 69 | produce|s.Stuffi|
|00000850| 74 20 61 72 63 68 69 76 | 65 73 20 66 6f 72 20 64 |t archiv|es for d|
|00000860| 6f 77 6e 6c 6f 61 64 69 | 6e 67 20 74 6f 20 74 68 |ownloadi|ng to th|
|00000870| 65 20 6d 61 63 2e 20 20 | 41 73 20 61 20 62 6f 6e |e mac. |As a bon|
|00000880| 75 73 20 49 27 76 65 20 | 61 6c 73 6f 20 69 6e 63 |us I've |also inc|
|00000890| 6c 75 64 65 64 0a 22 6d | 61 63 62 69 6e 66 69 6c |luded."m|acbinfil|
|000008a0| 74 22 2c 20 61 20 66 69 | 6c 74 65 72 20 77 68 69 |t", a fi|lter whi|
|000008b0| 63 68 20 74 61 6b 65 73 | 20 61 72 74 69 63 6c 65 |ch takes| article|
|000008c0| 73 20 66 72 6f 6d 20 63 | 6f 6d 70 2e 62 69 6e 61 |s from c|omp.bina|
|000008d0| 72 69 65 73 2e 6d 61 63 | 2c 20 70 75 74 73 20 74 |ries.mac|, puts t|
|000008e0| 68 65 0a 70 61 72 74 73 | 20 69 6e 20 74 68 65 20 |he.parts| in the |
|000008f0| 63 6f 72 72 65 63 74 20 | 6f 72 64 65 72 2c 20 61 |correct |order, a|
|00000900| 6e 64 20 74 68 72 6f 77 | 73 20 6f 75 74 20 61 6c |nd throw|s out al|
|00000910| 6c 20 74 68 65 20 22 6e | 6f 69 73 65 22 20 6c 69 |l the "n|oise" li|
|00000920| 6e 65 73 2e 0a 0a 54 6f | 20 75 73 65 20 74 68 65 |nes...To| use the|
|00000930| 20 73 69 74 20 63 6f 64 | 65 20 79 6f 75 20 6e 65 | sit cod|e you ne|
|00000940| 65 64 20 74 68 65 20 67 | 65 74 6f 70 74 28 33 29 |ed the g|etopt(3)|
|00000950| 20 6c 69 62 72 61 72 79 | 20 72 6f 75 74 69 6e 65 | library| routine|
|00000960| 20 61 6e 64 20 74 68 65 | 20 63 6f 6d 70 72 65 73 | and the| compres|
|00000970| 73 28 31 29 0a 75 74 69 | 6c 69 74 79 2c 20 62 6f |s(1).uti|lity, bo|
|00000980| 74 68 20 6f 66 20 77 68 | 69 63 68 20 6d 6f 73 74 |th of wh|ich most|
|00000990| 20 65 76 65 72 79 6f 6e | 65 20 73 65 65 6d 73 20 | everyon|e seems |
|000009a0| 74 6f 20 68 61 76 65 20 | 62 79 20 6e 6f 77 2e 0a |to have |by now..|
|000009b0| 0a 54 68 65 72 65 20 69 | 73 20 6e 6f 74 20 6d 75 |.There i|s not mu|
|000009c0| 63 68 20 6f 72 69 67 69 | 6e 61 6c 20 63 6f 64 65 |ch origi|nal code|
|000009d0| 20 68 65 72 65 3a 20 65 | 76 65 72 79 74 68 69 6e | here: e|verythin|
|000009e0| 67 20 69 73 20 72 65 76 | 65 72 73 65 20 65 6e 67 |g is rev|erse eng|
|000009f0| 69 6e 65 65 72 65 64 20 | 66 72 6f 6d 0a 74 68 65 |ineered |from.the|
|00000a00| 20 75 6e 73 69 74 20 75 | 74 69 6c 69 74 79 20 62 | unsit u|tility b|
|00000a10| 79 20 41 6c 61 6e 20 57 | 65 62 65 72 2e 20 20 54 |y Alan W|eber. T|
|00000a20| 68 65 20 75 70 64 63 72 | 63 2e 63 20 66 69 6c 65 |he updcr|c.c file|
|00000a30| 20 69 73 20 65 78 61 63 | 74 6c 79 20 74 68 65 20 | is exac|tly the |
|00000a40| 73 61 6d 65 20 66 69 6c | 65 0a 66 72 6f 6d 20 74 |same fil|e.from t|
|00000a50| 68 65 20 75 6e 73 69 74 | 20 70 61 63 6b 61 67 65 |he unsit| package|
|00000a60| 2e 0a 0a 49 27 76 65 20 | 74 65 73 74 65 64 20 74 |...I've |tested t|
|00000a70| 68 65 20 63 6f 64 65 20 | 6f 6e 20 62 6f 74 68 20 |he code |on both |
|00000a80| 42 53 44 20 61 6e 64 20 | 53 59 53 56 20 6d 61 63 |BSD and |SYSV mac|
|00000a90| 68 69 6e 65 73 2e 20 42 | 6f 74 68 20 6d 61 63 68 |hines. B|oth mach|
|00000aa0| 69 6e 65 73 20 77 65 72 | 65 20 62 69 67 0a 65 6e |ines wer|e big.en|
|00000ab0| 64 69 61 6e 20 73 6f 20 | 62 79 74 65 20 6f 72 64 |dian so |byte ord|
|00000ac0| 65 72 20 70 72 6f 62 6c | 65 6d 73 20 6d 61 79 20 |er probl|ems may |
|00000ad0| 73 74 69 6c 6c 20 62 65 | 20 6c 75 72 6b 69 6e 67 |still be| lurking|
|00000ae0| 2e 0a 0a 57 68 65 6e 20 | 79 6f 75 20 74 72 61 6e |...When |you tran|
|00000af0| 73 66 65 72 20 61 72 63 | 68 69 76 65 73 20 74 6f |sfer arc|hives to|
|00000b00| 20 79 6f 75 72 20 6d 61 | 63 20 62 65 20 73 75 72 | your ma|c be sur|
|00000b10| 65 20 74 6f 20 75 73 65 | 20 22 62 69 6e 61 72 79 |e to use| "binary|
|00000b20| 22 20 6d 6f 64 65 2e 20 | 20 49 6e 20 0a 6f 72 64 |" mode. | In .ord|
|00000b30| 65 72 20 66 6f 72 20 53 | 75 66 66 69 74 20 74 6f |er for S|uffit to|
|00000b40| 20 72 65 63 6f 67 6e 69 | 7a 65 20 79 6f 75 72 20 | recogni|ze your |
|00000b50| 64 6f 77 6e 6c 6f 61 64 | 65 64 20 66 69 6c 65 20 |download|ed file |
|00000b60| 69 74 20 6d 75 73 74 20 | 68 61 76 65 20 61 20 74 |it must |have a t|
|00000b70| 79 70 65 20 6f 66 0a 22 | 53 49 54 21 22 2e 20 20 |ype of."|SIT!". |
|00000b80| 49 66 20 79 6f 75 72 20 | 63 6f 6d 6d 75 6e 69 63 |If your |communic|
|00000b90| 61 74 69 6f 6e 20 70 72 | 6f 67 72 61 6d 20 64 6f |ation pr|ogram do|
|00000ba0| 65 73 6e 27 74 20 61 6c | 6c 6f 77 20 79 6f 75 20 |esn't al|low you |
|00000bb0| 74 6f 20 73 70 65 63 69 | 66 79 20 74 68 65 20 74 |to speci|fy the t|
|00000bc0| 79 70 65 0a 79 6f 75 27 | 6c 6c 20 6e 65 65 64 20 |ype.you'|ll need |
|00000bd0| 74 6f 20 52 65 73 45 64 | 69 74 20 69 74 20 69 6e |to ResEd|it it in|
|00000be0| 2e 20 20 49 74 20 73 68 | 6f 75 6c 64 20 62 65 20 |. It sh|ould be |
|00000bf0| 71 75 69 74 65 20 73 69 | 6d 70 6c 65 20 74 6f 20 |quite si|mple to |
|00000c00| 6d 6f 64 69 66 79 20 73 | 69 74 2e 63 0a 74 6f 20 |modify s|it.c.to |
|00000c10| 70 75 74 20 61 20 4d 61 | 63 42 69 6e 61 72 79 20 |put a Ma|cBinary |
|00000c20| 68 65 61 64 65 72 20 6f | 6e 20 74 68 65 20 61 72 |header o|n the ar|
|00000c30| 63 68 69 76 65 2e 0a 0a | 41 73 20 77 69 74 68 20 |chive...|As with |
|00000c40| 65 76 65 72 79 74 68 69 | 6e 67 20 69 6e 20 74 68 |everythi|ng in th|
|00000c50| 65 20 6d 6f 64 65 72 6e | 20 77 6f 72 6c 64 3a 20 |e modern| world: |
|00000c60| 75 73 65 20 61 74 20 79 | 6f 75 72 20 6f 77 6e 20 |use at y|our own |
|00000c70| 72 69 73 6b 2e 0a 0a 2d | 2d 54 6f 6d 20 42 65 72 |risk...-|-Tom Ber|
|00000c80| 65 69 74 65 72 0a 20 20 | 2e 2e 21 7b 72 75 74 67 |eiter. |..!{rutg|
|00000c90| 65 72 73 2c 61 6d 65 73 | 7d 21 63 73 2e 75 74 65 |ers,ames|}!cs.ute|
|00000ca0| 78 61 73 2e 65 64 75 21 | 68 61 6c 6c 65 79 21 72 |xas.edu!|halley!r|
|00000cb0| 6f 6c 65 78 21 74 77 62 | 0a 00 00 00 00 00 00 00 |olex!twb|........|
|00000cc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000cd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ce0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000cf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d00| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000da0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000db0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000dc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000dd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000de0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000df0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000e00| 73 69 74 2f 4d 61 6b 65 | 66 69 6c 65 00 00 00 00 |sit/Make|file....|
|00000e10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000e20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000e30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000e40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000e50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000e60| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 32 |.... 6|44 . 2|
|00000e70| 34 33 20 00 20 20 20 20 | 31 32 20 00 20 20 20 20 |43 . |12 . |
|00000e80| 20 20 20 20 31 30 33 20 | 20 34 34 30 34 33 33 34 | 103 | 4404334|
|00000e90| 30 36 37 20 20 20 36 33 | 31 36 00 20 00 00 00 00 |067 63|16. ....|
|00000ea0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000eb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ec0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ed0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ee0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ef0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f00| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|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| 61 6c 6c 3a 09 73 69 74 | 20 6d 61 63 62 69 6e 66 |all:.sit| macbinf|
|00001010| 69 6c 74 0a 0a 73 69 74 | 3a 09 73 69 74 2e 6f 20 |ilt..sit|:.sit.o |
|00001020| 75 70 64 63 72 63 2e 6f | 0a 09 63 63 20 2d 6f 20 |updcrc.o|..cc -o |
|00001030| 73 69 74 20 73 69 74 2e | 6f 20 75 70 64 63 72 63 |sit sit.|o updcrc|
|00001040| 2e 6f 0a 00 1e 30 00 00 | 14 00 08 00 4d 61 6b 65 |.o...0..|....Make|
|00001050| 66 69 6c 65 00 00 00 00 | 1f 30 00 00 10 00 05 00 |file....|.0......|
|00001060| 73 69 74 2e 68 00 00 00 | 20 30 00 00 10 00 05 00 |sit.h...| 0......|
|00001070| 73 69 74 2e 63 00 00 00 | 21 30 00 00 14 00 08 00 |sit.c...|!0......|
|00001080| 75 70 64 63 72 63 2e 63 | 00 00 00 00 22 30 00 00 |updcrc.c|...."0..|
|00001090| 74 01 0c 00 6d 61 63 62 | 69 6e 66 69 6c 74 2e 63 |t...macb|infilt.c|
|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| 73 69 74 2f 73 69 74 2e | 68 00 00 00 00 00 00 00 |sit/sit.|h.......|
|00001210| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001220| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001230| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001260| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 32 |.... 6|44 . 2|
|00001270| 34 33 20 00 20 20 20 20 | 31 32 20 00 20 20 20 20 |43 . |12 . |
|00001280| 20 20 20 33 34 35 32 20 | 20 34 34 30 34 33 33 34 | 3452 | 4404334|
|00001290| 30 37 31 20 20 20 35 36 | 35 33 00 20 00 00 00 00 |071 56|53. ....|
|000012a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000012b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000012c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000012d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000012e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000012f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001300| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001310| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001320| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001330| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001340| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001350| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001380| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001390| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000013a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000013b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000013c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000013d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000013e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000013f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001400| 0a 2f 2a 20 73 69 74 2e | 68 3a 20 63 6f 6e 74 61 |./* sit.|h: conta|
|00001410| 69 6e 73 20 64 65 63 6c | 61 72 61 74 69 6f 6e 73 |ins decl|arations|
|00001420| 20 66 6f 72 20 53 49 54 | 20 68 65 61 64 65 72 73 | for SIT| headers|
|00001430| 20 2a 2f 0a 0a 74 79 70 | 65 64 65 66 20 73 74 72 | */..typ|edef str|
|00001440| 75 63 74 20 73 69 74 48 | 64 72 20 7b 09 09 2f 2a |uct sitH|dr {../*|
|00001450| 20 32 32 20 62 79 74 65 | 73 20 2a 2f 0a 09 75 5f | 22 byte|s */..u_|
|00001460| 63 68 61 72 09 73 69 67 | 31 5b 34 5d 3b 09 09 2f |char.sig|1[4];../|
|00001470| 2a 20 3d 20 27 53 49 54 | 21 27 20 2d 2d 20 66 6f |* = 'SIT|!' -- fo|
|00001480| 72 20 76 65 72 69 66 69 | 63 61 74 69 6f 6e 20 2a |r verifi|cation *|
|00001490| 2f 0a 09 75 5f 63 68 61 | 72 09 6e 75 6d 46 69 6c |/..u_cha|r.numFil|
|000014a0| 65 73 5b 32 5d 3b 09 2f | 2a 20 6e 75 6d 62 65 72 |es[2];./|* number|
|000014b0| 20 6f 66 20 66 69 6c 65 | 73 20 69 6e 20 61 72 63 | of file|s in arc|
|000014c0| 68 69 76 65 20 2a 2f 0a | 09 75 5f 63 68 61 72 09 |hive */.|.u_char.|
|000014d0| 61 72 63 4c 65 6e 5b 34 | 5d 3b 09 09 2f 2a 20 6c |arcLen[4|];../* l|
|000014e0| 65 6e 67 74 68 20 6f 66 | 20 65 6e 74 69 72 65 20 |ength of| entire |
|000014f0| 61 72 63 68 69 76 65 20 | 69 6e 63 6c 2e 20 2a 2f |archive |incl. */|
|00001500| 0a 09 75 5f 63 68 61 72 | 09 73 69 67 32 5b 34 5d |..u_char|.sig2[4]|
|00001510| 3b 09 09 2f 2a 20 3d 20 | 27 72 4c 61 75 27 20 2d |;../* = |'rLau' -|
|00001520| 2d 20 66 6f 72 20 76 65 | 72 69 66 69 63 61 74 69 |- for ve|rificati|
|00001530| 6f 6e 20 2a 2f 0a 09 75 | 5f 63 68 61 72 09 76 65 |on */..u|_char.ve|
|00001540| 72 73 69 6f 6e 3b 09 09 | 2f 2a 20 76 65 72 73 69 |rsion;..|/* versi|
|00001550| 6f 6e 20 6e 75 6d 62 65 | 72 20 2a 2f 0a 09 63 68 |on numbe|r */..ch|
|00001560| 61 72 20 72 65 73 65 72 | 76 65 64 5b 37 5d 3b 0a |ar reser|ved[7];.|
|00001570| 7d 3b 0a 0a 74 79 70 65 | 64 65 66 20 73 74 72 75 |};..type|def stru|
|00001580| 63 74 20 66 69 6c 65 48 | 64 72 20 7b 09 2f 2a 20 |ct fileH|dr {./* |
|00001590| 31 31 32 20 62 79 74 65 | 73 20 2a 2f 0a 09 75 5f |112 byte|s */..u_|
|000015a0| 63 68 61 72 09 63 6f 6d | 70 52 4d 65 74 68 6f 64 |char.com|pRMethod|
|000015b0| 3b 09 09 2f 2a 20 72 73 | 72 63 20 66 6f 72 6b 20 |;../* rs|rc fork |
|000015c0| 63 6f 6d 70 72 65 73 73 | 69 6f 6e 20 6d 65 74 68 |compress|ion meth|
|000015d0| 6f 64 20 2a 2f 0a 09 75 | 5f 63 68 61 72 09 63 6f |od */..u|_char.co|
|000015e0| 6d 70 44 4d 65 74 68 6f | 64 3b 09 09 2f 2a 20 64 |mpDMetho|d;../* d|
|000015f0| 61 74 61 20 66 6f 72 6b | 20 63 6f 6d 70 72 65 73 |ata fork| compres|
|00001600| 73 69 6f 6e 20 6d 65 74 | 68 6f 64 20 2a 2f 0a 09 |sion met|hod */..|
|00001610| 75 5f 63 68 61 72 09 66 | 4e 61 6d 65 5b 36 34 5d |u_char.f|Name[64]|
|00001620| 3b 09 09 09 2f 2a 20 61 | 20 53 54 52 36 33 20 2a |;.../* a| STR63 *|
|00001630| 2f 0a 09 63 68 61 72 09 | 66 54 79 70 65 5b 34 5d |/..char.|fType[4]|
|00001640| 3b 09 09 09 2f 2a 20 66 | 69 6c 65 20 74 79 70 65 |;.../* f|ile type|
|00001650| 20 2a 2f 0a 09 63 68 61 | 72 09 66 43 72 65 61 74 | */..cha|r.fCreat|
|00001660| 6f 72 5b 34 5d 3b 09 09 | 2f 2a 20 63 72 65 61 74 |or[4];..|/* creat|
|00001670| 6f 72 2e 2e 2e 20 2a 2f | 0a 09 63 68 61 72 09 46 |or... */|..char.F|
|00001680| 6e 64 72 46 6c 61 67 73 | 5b 32 5d 3b 09 09 2f 2a |ndrFlags|[2];../*|
|00001690| 20 63 6f 70 79 20 6f 66 | 20 46 69 6e 64 65 72 20 | copy of| Finder |
|000016a0| 66 6c 61 67 73 20 2a 2f | 0a 09 63 68 61 72 09 63 |flags */|..char.c|
|000016b0| 44 61 74 65 5b 34 5d 3b | 09 09 09 2f 2a 20 63 72 |Date[4];|.../* cr|
|000016c0| 65 61 74 69 6f 6e 20 64 | 61 74 65 20 2a 2f 0a 09 |eation d|ate */..|
|000016d0| 63 68 61 72 09 6d 44 61 | 74 65 5b 34 5d 3b 09 09 |char.mDa|te[4];..|
|000016e0| 09 2f 2a 20 21 72 65 73 | 74 6f 72 65 64 2d 63 6f |./* !res|tored-co|
|000016f0| 6d 70 61 74 20 77 2f 62 | 61 63 6b 75 70 20 70 72 |mpat w/b|ackup pr|
|00001700| 67 6d 73 20 2a 2f 0a 09 | 75 5f 63 68 61 72 09 72 |gms */..|u_char.r|
|00001710| 4c 65 6e 5b 34 5d 3b 09 | 09 09 2f 2a 20 64 65 63 |Len[4];.|../* dec|
|00001720| 6f 6d 20 72 73 72 63 20 | 6c 65 6e 67 74 68 20 2a |om rsrc |length *|
|00001730| 2f 0a 09 75 5f 63 68 61 | 72 09 64 4c 65 6e 5b 34 |/..u_cha|r.dLen[4|
|00001740| 5d 3b 09 09 09 2f 2a 20 | 64 65 63 6f 6d 70 20 64 |];.../* |decomp d|
|00001750| 61 74 61 20 6c 65 6e 67 | 74 68 20 2a 2f 0a 09 75 |ata leng|th */..u|
|00001760| 5f 63 68 61 72 09 63 52 | 4c 65 6e 5b 34 5d 3b 09 |_char.cR|Len[4];.|
|00001770| 09 09 2f 2a 20 63 6f 6d | 70 72 65 73 73 65 64 20 |../* com|pressed |
|00001780| 6c 65 6e 67 74 68 73 20 | 2a 2f 0a 09 75 5f 63 68 |lengths |*/..u_ch|
|00001790| 61 72 09 63 44 4c 65 6e | 5b 34 5d 3b 0a 09 75 5f |ar.cDLen|[4];..u_|
|000017a0| 63 68 61 72 09 72 73 72 | 63 43 52 43 5b 32 5d 3b |char.rsr|cCRC[2];|
|000017b0| 09 09 09 2f 2a 20 63 72 | 63 20 6f 66 20 72 73 72 |.../* cr|c of rsr|
|000017c0| 63 20 66 6f 72 6b 20 2a | 2f 0a 09 75 5f 63 68 61 |c fork *|/..u_cha|
|000017d0| 72 09 64 61 74 61 43 52 | 43 5b 32 5d 3b 09 09 09 |r.dataCR|C[2];...|
|000017e0| 2f 2a 20 63 72 63 20 6f | 66 20 64 61 74 61 20 66 |/* crc o|f data f|
|000017f0| 6f 72 6b 20 2a 2f 0a 09 | 63 68 61 72 09 72 65 73 |ork */..|char.res|
|00001800| 65 72 76 65 64 5b 36 5d | 3b 0a 09 75 5f 63 68 61 |erved[6]|;..u_cha|
|00001810| 72 09 68 64 72 43 52 43 | 5b 32 5d 3b 09 09 09 2f |r.hdrCRC|[2];.../|
|00001820| 2a 20 63 72 63 20 6f 66 | 20 66 69 6c 65 20 68 65 |* crc of| file he|
|00001830| 61 64 65 72 20 2a 2f 0a | 7d 3b 0a 0a 2f 2a 20 66 |ader */.|};../* f|
|00001840| 69 6c 65 20 66 6f 72 6d | 61 74 20 69 73 3a 0a 09 |ile form|at is:..|
|00001850| 73 69 74 41 72 63 68 69 | 76 65 48 64 72 0a 09 09 |sitArchi|veHdr...|
|00001860| 66 69 6c 65 31 48 64 72 | 0a 09 09 09 66 69 6c 65 |file1Hdr|....file|
|00001870| 31 52 73 72 63 46 6f 72 | 6b 0a 09 09 09 66 69 6c |1RsrcFor|k....fil|
|00001880| 65 31 44 61 74 61 46 6f | 72 6b 0a 09 09 66 69 6c |e1DataFo|rk...fil|
|00001890| 65 32 48 64 72 0a 09 09 | 09 66 69 6c 65 32 52 73 |e2Hdr...|.file2Rs|
|000018a0| 72 63 46 6f 72 6b 0a 09 | 09 09 66 69 6c 65 32 44 |rcFork..|..file2D|
|000018b0| 61 74 61 46 6f 72 6b 0a | 09 09 2e 0a 09 09 2e 0a |ataFork.|........|
|000018c0| 09 09 2e 0a 09 09 66 69 | 6c 65 4e 48 64 72 0a 09 |......fi|leNHdr..|
|000018d0| 09 09 66 69 6c 65 4e 52 | 73 72 63 46 6f 72 6b 0a |..fileNR|srcFork.|
|000018e0| 09 09 09 66 69 6c 65 4e | 44 61 74 61 46 6f 72 6b |...fileN|DataFork|
|000018f0| 0a 2a 2f 0a 0a 0a 0a 2f | 2a 20 63 6f 6d 70 72 65 |.*/..../|* compre|
|00001900| 73 73 69 6f 6e 20 6d 65 | 74 68 6f 64 73 20 2a 2f |ssion me|thods */|
|00001910| 0a 23 64 65 66 69 6e 65 | 20 6e 6f 43 6f 6d 70 09 |.#define| noComp.|
|00001920| 30 09 2f 2a 20 6a 75 73 | 74 20 72 65 61 64 20 65 |0./* jus|t read e|
|00001930| 61 63 68 20 62 79 74 65 | 20 61 6e 64 20 77 72 69 |ach byte| and wri|
|00001940| 74 65 20 69 74 20 74 6f | 20 61 72 63 68 69 76 65 |te it to| archive|
|00001950| 20 2a 2f 0a 23 64 65 66 | 69 6e 65 20 72 65 70 43 | */.#def|ine repC|
|00001960| 6f 6d 70 20 31 09 2f 2a | 20 52 4c 45 20 63 6f 6d |omp 1./*| RLE com|
|00001970| 70 72 65 73 73 69 6f 6e | 20 2a 2f 0a 23 64 65 66 |pression| */.#def|
|00001980| 69 6e 65 20 6c 70 7a 43 | 6f 6d 70 20 32 09 2f 2a |ine lpzC|omp 2./*|
|00001990| 20 4c 5a 57 20 63 6f 6d | 70 72 65 73 73 69 6f 6e | LZW com|pression|
|000019a0| 20 2a 2f 0a 23 64 65 66 | 69 6e 65 20 68 75 66 43 | */.#def|ine hufC|
|000019b0| 6f 6d 70 20 33 09 2f 2a | 20 48 75 66 66 6d 61 6e |omp 3./*| Huffman|
|000019c0| 20 63 6f 6d 70 72 65 73 | 73 69 6f 6e 20 2a 2f 0a | compres|sion */.|
|000019d0| 0a 2f 2a 20 61 6c 6c 20 | 6f 74 68 65 72 20 6e 75 |./* all |other nu|
|000019e0| 6d 62 65 72 73 20 61 72 | 65 20 72 65 73 65 72 76 |mbers ar|e reserv|
|000019f0| 65 64 20 2a 2f 0a 0a 2f | 2a 0a 20 2a 20 74 68 65 |ed */../|*. * the|
|00001a00| 20 66 6f 72 6d 61 74 20 | 6f 66 20 61 20 2a 2e 69 | format |of a *.i|
|00001a10| 6e 66 6f 20 66 69 6c 65 | 20 6d 61 64 65 20 62 79 |nfo file| made by|
|00001a20| 20 78 62 69 6e 0a 20 2a | 2f 0a 73 74 72 75 63 74 | xbin. *|/.struct|
|00001a30| 20 69 6e 66 6f 68 64 72 | 20 7b 0a 09 63 68 61 72 | infohdr| {..char|
|00001a40| 09 72 65 73 30 3b 0a 09 | 63 68 61 72 09 6e 61 6d |.res0;..|char.nam|
|00001a50| 65 5b 36 34 5d 3b 09 2f | 2a 20 20 32 20 28 61 20 |e[64];./|* 2 (a |
|00001a60| 73 74 72 20 36 33 29 20 | 2a 2f 0a 09 63 68 61 72 |str 63) |*/..char|
|00001a70| 09 74 79 70 65 5b 34 5d | 3b 09 2f 2a 20 36 35 20 |.type[4]|;./* 65 |
|00001a80| 2a 2f 0a 09 63 68 61 72 | 09 63 72 65 61 74 6f 72 |*/..char|.creator|
|00001a90| 5b 34 5d 3b 09 2f 2a 20 | 36 39 20 2a 2f 0a 09 63 |[4];./* |69 */..c|
|00001aa0| 68 61 72 09 66 6c 61 67 | 5b 32 5d 3b 09 2f 2a 20 |har.flag|[2];./* |
|00001ab0| 37 33 20 2a 2f 0a 09 63 | 68 61 72 09 72 65 73 31 |73 */..c|har.res1|
|00001ac0| 5b 38 5d 3b 0a 09 63 68 | 61 72 09 64 6c 65 6e 5b |[8];..ch|ar.dlen[|
|00001ad0| 34 5d 3b 09 2f 2a 20 38 | 33 20 2a 2f 0a 09 63 68 |4];./* 8|3 */..ch|
|00001ae0| 61 72 09 72 6c 65 6e 5b | 34 5d 3b 09 2f 2a 20 38 |ar.rlen[|4];./* 8|
|00001af0| 37 20 2a 2f 0a 09 63 68 | 61 72 09 63 74 69 6d 65 |7 */..ch|ar.ctime|
|00001b00| 5b 34 5d 3b 09 2f 2a 20 | 39 31 20 2a 2f 0a 09 63 |[4];./* |91 */..c|
|00001b10| 68 61 72 09 6d 74 69 6d | 65 5b 34 5d 3b 09 2f 2a |har.mtim|e[4];./*|
|00001b20| 20 39 35 20 2a 2f 0a 7d | 3b 0a 00 00 00 00 00 00 | 95 */.}|;.......|
|00001b30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ba0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001bb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001bc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001bd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001be0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001bf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001c00| 73 69 74 2f 73 69 74 2e | 63 00 00 00 00 00 00 00 |sit/sit.|c.......|
|00001c10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001c20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001c30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001c40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001c50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001c60| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 32 |.... 6|44 . 2|
|00001c70| 34 33 20 00 20 20 20 20 | 31 32 20 00 20 20 20 20 |43 . |12 . |
|00001c80| 20 20 31 33 36 35 37 20 | 20 34 34 30 34 33 33 34 | 13657 | 4404334|
|00001c90| 30 37 34 20 20 20 35 37 | 30 31 00 20 00 00 00 00 |074 57|01. ....|
|00001ca0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001cb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001cc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001cd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ce0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001cf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001d00| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001d10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001d20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001d30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001d40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001d50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001d60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001d70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001d80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001d90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001da0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001db0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001dc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001dd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001de0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001df0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001e00| 2f 2a 0a 20 2a 20 73 69 | 74 20 2d 20 53 74 75 66 |/*. * si|t - Stuf|
|00001e10| 66 69 74 20 66 6f 72 20 | 55 4e 49 58 0a 20 2a 20 |fit for |UNIX. * |
|00001e20| 20 50 75 74 73 20 75 6e | 69 78 20 64 61 74 61 20 | Puts un|ix data |
|00001e30| 66 69 6c 65 73 20 69 6e | 74 6f 20 73 74 75 66 66 |files in|to stuff|
|00001e40| 69 74 20 61 72 63 68 69 | 76 65 20 73 75 69 74 61 |it archi|ve suita|
|00001e50| 62 6c 65 20 66 6f 72 20 | 64 6f 77 6e 6c 6f 61 64 |ble for |download|
|00001e60| 69 6e 67 0a 20 2a 09 74 | 6f 20 61 20 4d 61 63 2e |ing. *.t|o a Mac.|
|00001e70| 20 20 41 75 74 6f 6d 61 | 74 69 63 61 6c 6c 79 20 | Automa|tically |
|00001e80| 70 72 6f 63 65 73 73 65 | 73 20 66 69 6c 65 73 20 |processe|s files |
|00001e90| 6f 75 74 70 75 74 20 66 | 72 6f 6d 20 78 62 69 6e |output f|rom xbin|
|00001ea0| 2e 0a 20 2a 0a 20 2a 20 | 20 52 65 76 65 72 73 65 |.. *. * | Reverse|
|00001eb0| 20 65 6e 67 69 6e 65 65 | 72 65 64 20 66 72 6f 6d | enginee|red from|
|00001ec0| 20 75 6e 73 69 74 20 62 | 79 20 41 6c 6c 61 6e 20 | unsit b|y Allan |
|00001ed0| 47 2e 20 57 65 62 65 72 | 2c 20 77 68 69 63 68 20 |G. Weber|, which |
|00001ee0| 77 61 73 20 62 61 73 65 | 64 20 6f 6e 0a 20 2a 20 |was base|d on. * |
|00001ef0| 20 6d 61 63 70 75 74 2c | 20 77 68 69 63 68 20 77 | macput,| which w|
|00001f00| 61 73 20 62 61 73 65 64 | 20 6f 6e 20 2e 2e 2e 0a |as based| on ....|
|00001f10| 20 2a 20 20 4a 75 73 74 | 20 6c 69 6b 65 20 75 6e | * Just| like un|
|00001f20| 73 69 74 20 74 68 69 73 | 20 75 73 65 73 20 74 68 |sit this| uses th|
|00001f30| 65 20 68 6f 73 74 27 73 | 20 76 65 72 73 69 6f 6e |e host's| version|
|00001f40| 20 6f 66 20 63 6f 6d 70 | 72 65 73 73 20 74 6f 20 | of comp|ress to |
|00001f50| 64 6f 20 74 68 65 20 77 | 6f 72 6b 2e 0a 20 2a 0a |do the w|ork.. *.|
|00001f60| 20 2a 20 45 78 61 6d 70 | 6c 65 73 3a 0a 20 2a 20 | * Examp|les:. * |
|00001f70| 20 20 31 29 20 74 61 6b | 65 20 63 6f 6c 6c 65 63 | 1) tak|e collec|
|00001f80| 74 69 6f 6e 20 6f 66 20 | 55 4e 49 58 20 74 65 78 |tion of |UNIX tex|
|00001f90| 74 20 66 69 6c 65 73 20 | 61 6e 64 20 6d 61 6b 65 |t files |and make|
|00001fa0| 20 74 68 65 6d 20 4c 53 | 43 20 74 65 78 74 20 66 | them LS|C text f|
|00001fb0| 69 6c 65 73 20 0a 20 2a | 09 77 68 65 6e 20 75 6e |iles . *|.when un|
|00001fc0| 63 6f 6d 70 72 65 73 73 | 65 64 20 6f 6e 20 74 68 |compress|ed on th|
|00001fd0| 65 20 6d 61 63 3a 0a 20 | 2a 09 20 20 20 73 69 74 |e mac:. |*. sit|
|00001fe0| 20 2d 75 20 2d 54 20 54 | 45 58 54 20 2d 43 20 4b | -u -T T|EXT -C K|
|00001ff0| 41 48 4c 20 66 69 6c 65 | 20 2e 2e 2e 0a 20 2a 20 |AHL file| .... * |
|00002000| 20 20 32 29 20 50 72 6f | 63 65 73 73 20 6f 75 74 | 2) Pro|cess out|
|00002010| 70 75 74 20 66 72 6f 6d | 20 78 62 69 6e 3a 0a 20 |put from| xbin:. |
|00002020| 2a 09 20 20 20 78 62 69 | 6e 20 66 69 6c 65 31 09 |*. xbi|n file1.|
|00002030| 20 28 70 72 6f 64 75 63 | 65 73 20 46 69 6c 65 4f | (produc|es FileO|
|00002040| 6e 65 2e 7b 69 6e 66 6f | 2c 72 73 72 63 2c 64 61 |ne.{info|,rsrc,da|
|00002050| 74 61 7d 29 0a 20 2a 09 | 20 20 20 73 69 74 20 66 |ta}). *.| sit f|
|00002060| 69 6c 65 31 0a 20 2a 0a | 20 2a 20 20 54 6f 6d 20 |ile1. *.| * Tom |
|00002070| 42 65 72 65 69 74 65 72 | 0a 20 2a 09 2e 2e 21 7b |Bereiter|. *...!{|
|00002080| 72 75 74 67 65 72 73 2c | 61 6d 65 73 7d 21 63 73 |rutgers,|ames}!cs|
|00002090| 2e 75 74 65 78 61 73 2e | 65 64 75 21 68 61 6c 6c |.utexas.|edu!hall|
|000020a0| 65 79 21 72 6f 6c 65 78 | 21 74 77 62 0a 20 2a 2f |ey!rolex|!twb. */|
|000020b0| 0a 23 64 65 66 69 6e 65 | 20 42 53 44 0a 0a 23 69 |.#define| BSD..#i|
|000020c0| 6e 63 6c 75 64 65 20 3c | 73 79 73 2f 74 79 70 65 |nclude <|sys/type|
|000020d0| 73 2e 68 3e 0a 23 69 6e | 63 6c 75 64 65 20 3c 73 |s.h>.#in|clude <s|
|000020e0| 79 73 2f 73 74 61 74 2e | 68 3e 0a 23 69 6e 63 6c |ys/stat.|h>.#incl|
|000020f0| 75 64 65 20 3c 73 74 64 | 69 6f 2e 68 3e 0a 23 69 |ude <std|io.h>.#i|
|00002100| 6e 63 6c 75 64 65 20 22 | 73 69 74 2e 68 22 0a 23 |nclude "|sit.h".#|
|00002110| 69 66 64 65 66 20 42 53 | 44 0a 23 69 6e 63 6c 75 |ifdef BS|D.#inclu|
|00002120| 64 65 20 3c 73 79 73 2f | 74 69 6d 65 2e 68 3e 0a |de <sys/|time.h>.|
|00002130| 23 69 6e 63 6c 75 64 65 | 20 3c 73 79 73 2f 74 69 |#include| <sys/ti|
|00002140| 6d 65 62 2e 68 3e 0a 23 | 65 6c 73 65 0a 23 69 6e |meb.h>.#|else.#in|
|00002150| 63 6c 75 64 65 20 3c 74 | 69 6d 65 2e 68 3e 0a 65 |clude <t|ime.h>.e|
|00002160| 78 74 65 72 6e 20 6c 6f | 6e 67 20 74 69 6d 65 7a |xtern lo|ng timez|
|00002170| 6f 6e 65 3b 0a 23 65 6e | 64 69 66 0a 0a 23 69 66 |one;.#en|dif..#if|
|00002180| 6e 64 65 66 20 6d 69 6e | 0a 23 64 65 66 69 6e 65 |ndef min|.#define|
|00002190| 20 6d 69 6e 28 61 2c 62 | 29 20 28 28 61 29 3c 28 | min(a,b|) ((a)<(|
|000021a0| 62 29 3f 28 61 29 3a 28 | 62 29 29 0a 23 65 6e 64 |b)?(a):(|b)).#end|
|000021b0| 69 66 0a 0a 2f 2a 20 4d | 61 63 20 74 69 6d 65 20 |if../* M|ac time |
|000021c0| 6f 66 20 30 30 3a 30 30 | 3a 30 30 20 47 4d 54 2c |of 00:00|:00 GMT,|
|000021d0| 20 4a 61 6e 20 31 2c 20 | 31 39 37 30 20 2a 2f 0a | Jan 1, |1970 */.|
|000021e0| 23 64 65 66 69 6e 65 20 | 54 49 4d 45 44 49 46 46 |#define |TIMEDIFF|
|000021f0| 20 30 78 37 63 32 35 62 | 30 38 30 0a 0a 73 74 72 | 0x7c25b|080..str|
|00002200| 75 63 74 20 73 69 74 48 | 64 72 20 73 68 3b 0a 73 |uct sitH|dr sh;.s|
|00002210| 74 72 75 63 74 20 66 69 | 6c 65 48 64 72 20 66 68 |truct fi|leHdr fh|
|00002220| 3b 0a 0a 63 68 61 72 20 | 62 75 66 5b 42 55 46 53 |;..char |buf[BUFS|
|00002230| 49 5a 5d 3b 0a 63 68 61 | 72 20 2a 64 65 66 6f 75 |IZ];.cha|r *defou|
|00002240| 74 66 69 6c 65 20 3d 20 | 22 61 72 63 68 69 76 65 |tfile = |"archive|
|00002250| 2e 73 69 74 22 3b 0a 69 | 6e 74 20 6f 66 64 3b 0a |.sit";.i|nt ofd;.|
|00002260| 75 73 68 6f 72 74 20 63 | 72 63 3b 0a 69 6e 74 20 |ushort c|rc;.int |
|00002270| 63 6c 65 6e 3b 0a 69 6e | 74 20 72 6d 66 69 6c 65 |clen;.in|t rmfile|
|00002280| 73 3b 0a 69 6e 74 09 75 | 6e 69 78 66 3b 0a 63 68 |s;.int.u|nixf;.ch|
|00002290| 61 72 20 2a 43 72 65 61 | 74 6f 72 2c 20 2a 54 79 |ar *Crea|tor, *Ty|
|000022a0| 70 65 3b 0a 0a 75 73 61 | 67 65 28 29 20 7b 20 66 |pe;..usa|ge() { f|
|000022b0| 70 72 69 6e 74 66 28 73 | 74 64 65 72 72 2c 22 55 |printf(s|tderr,"U|
|000022c0| 73 61 67 65 3a 20 73 69 | 74 20 66 69 6c 65 5c 6e |sage: si|t file\n|
|000022d0| 22 29 3b 20 7d 0a 65 78 | 74 65 72 6e 20 63 68 61 |"); }.ex|tern cha|
|000022e0| 72 20 2a 6f 70 74 61 72 | 67 3b 0a 65 78 74 65 72 |r *optar|g;.exter|
|000022f0| 6e 20 69 6e 74 20 6f 70 | 74 69 6e 64 3b 0a 0a 6d |n int op|tind;..m|
|00002300| 61 69 6e 28 61 72 67 63 | 2c 61 72 67 76 29 20 63 |ain(argc|,argv) c|
|00002310| 68 61 72 20 2a 2a 61 72 | 67 76 3b 20 7b 0a 09 69 |har **ar|gv; {..i|
|00002320| 6e 74 20 69 2c 6e 3b 0a | 09 69 6e 74 20 74 6f 74 |nt i,n;.|.int tot|
|00002330| 61 6c 2c 20 6e 66 69 6c | 65 73 3b 0a 09 69 6e 74 |al, nfil|es;..int|
|00002340| 20 63 3b 0a 0a 20 20 20 | 20 77 68 69 6c 65 20 28 | c;.. | while (|
|00002350| 28 63 3d 67 65 74 6f 70 | 74 28 61 72 67 63 2c 20 |(c=getop|t(argc, |
|00002360| 61 72 67 76 2c 20 22 72 | 6f 3a 75 43 3a 54 3a 22 |argv, "r|o:uC:T:"|
|00002370| 29 29 20 21 3d 20 45 4f | 46 29 0a 09 73 77 69 74 |)) != EO|F)..swit|
|00002380| 63 68 20 28 63 29 20 7b | 0a 09 09 63 61 73 65 20 |ch (c) {|...case |
|00002390| 27 72 27 3a 0a 09 09 09 | 72 6d 66 69 6c 65 73 2b |'r':....|rmfiles+|
|000023a0| 2b 3b 09 2f 2a 20 72 65 | 6d 6f 76 65 20 66 69 6c |+;./* re|move fil|
|000023b0| 65 73 20 77 68 65 6e 20 | 64 6f 6e 65 20 2a 2f 0a |es when |done */.|
|000023c0| 09 09 09 62 72 65 61 6b | 3b 0a 09 09 63 61 73 65 |...break|;...case|
|000023d0| 20 27 6f 27 3a 09 09 2f | 2a 20 73 70 65 63 69 66 | 'o':../|* specif|
|000023e0| 79 20 6f 75 74 70 75 74 | 20 66 69 6c 65 20 2a 2f |y output| file */|
|000023f0| 0a 09 09 09 64 65 66 6f | 75 74 66 69 6c 65 20 3d |....defo|utfile =|
|00002400| 20 6f 70 74 61 72 67 3b | 0a 09 09 09 62 72 65 61 | optarg;|....brea|
|00002410| 6b 3b 0a 09 09 63 61 73 | 65 20 27 75 27 3a 09 09 |k;...cas|e 'u':..|
|00002420| 2f 2a 20 75 6e 69 78 20 | 66 69 6c 65 20 2d 2d 20 |/* unix |file -- |
|00002430| 63 68 61 6e 67 65 20 27 | 5c 6e 27 20 74 6f 20 27 |change '|\n' to '|
|00002440| 5c 72 27 20 2a 2f 0a 09 | 09 09 75 6e 69 78 66 2b |\r' */..|..unixf+|
|00002450| 2b 3b 0a 09 09 09 62 72 | 65 61 6b 3b 0a 09 09 63 |+;....br|eak;...c|
|00002460| 61 73 65 20 27 43 27 3a | 09 09 2f 2a 20 73 65 74 |ase 'C':|../* set|
|00002470| 20 4d 61 63 20 63 72 65 | 61 74 6f 72 20 2a 2f 0a | Mac cre|ator */.|
|00002480| 09 09 09 43 72 65 61 74 | 6f 72 20 3d 20 6f 70 74 |...Creat|or = opt|
|00002490| 61 72 67 3b 0a 09 09 09 | 62 72 65 61 6b 3b 0a 09 |arg;....|break;..|
|000024a0| 09 63 61 73 65 20 27 54 | 27 3a 09 09 2f 2a 20 73 |.case 'T|':../* s|
|000024b0| 65 74 20 4d 61 63 20 66 | 69 6c 65 20 74 79 70 65 |et Mac f|ile type|
|000024c0| 20 2a 2f 0a 09 09 09 54 | 79 70 65 20 3d 20 6f 70 | */....T|ype = op|
|000024d0| 74 61 72 67 3b 0a 09 09 | 09 62 72 65 61 6b 3b 0a |targ;...|.break;.|
|000024e0| 09 09 63 61 73 65 20 27 | 3f 27 3a 0a 09 09 09 75 |..case '|?':....u|
|000024f0| 73 61 67 65 28 29 3b 0a | 09 09 09 65 78 69 74 28 |sage();.|...exit(|
|00002500| 31 29 3b 0a 09 7d 0a 0a | 09 69 66 20 28 28 6f 66 |1);..}..|.if ((of|
|00002510| 64 3d 63 72 65 61 74 28 | 64 65 66 6f 75 74 66 69 |d=creat(|defoutfi|
|00002520| 6c 65 2c 30 36 34 34 29 | 29 3c 30 29 20 7b 0a 09 |le,0644)|)<0) {..|
|00002530| 09 70 65 72 72 6f 72 28 | 64 65 66 6f 75 74 66 69 |.perror(|defoutfi|
|00002540| 6c 65 29 3b 0a 09 09 65 | 78 69 74 28 31 29 3b 0a |le);...e|xit(1);.|
|00002550| 09 7d 0a 09 2f 2a 20 65 | 6d 70 74 79 20 68 65 61 |.}../* e|mpty hea|
|00002560| 64 65 72 2c 20 77 69 6c | 6c 20 73 65 65 6b 20 62 |der, wil|l seek b|
|00002570| 61 63 6b 20 61 6e 64 20 | 66 69 6c 6c 20 69 6e 20 |ack and |fill in |
|00002580| 6c 61 74 65 72 20 2a 2f | 0a 09 77 72 69 74 65 28 |later */|..write(|
|00002590| 6f 66 64 2c 26 73 68 2c | 73 69 7a 65 6f 66 20 73 |ofd,&sh,|sizeof s|
|000025a0| 68 29 3b 0a 0a 09 66 6f | 72 20 28 69 3d 6f 70 74 |h);...fo|r (i=opt|
|000025b0| 69 6e 64 3b 20 69 3c 61 | 72 67 63 3b 20 69 2b 2b |ind; i<a|rgc; i++|
|000025c0| 29 20 7b 0a 09 09 6e 20 | 3d 20 70 75 74 5f 66 69 |) {...n |= put_fi|
|000025d0| 6c 65 28 61 72 67 76 5b | 69 5d 29 3b 0a 09 09 69 |le(argv[|i]);...i|
|000025e0| 66 20 28 6e 29 20 7b 0a | 09 09 09 74 6f 74 61 6c |f (n) {.|...total|
|000025f0| 20 2b 3d 20 6e 3b 0a 09 | 09 09 6e 66 69 6c 65 73 | += n;..|..nfiles|
|00002600| 2b 2b 3b 0a 09 09 7d 0a | 09 7d 0a 09 6c 73 65 65 |++;...}.|.}..lsee|
|00002610| 6b 28 6f 66 64 2c 30 2c | 30 29 3b 0a 0a 09 74 6f |k(ofd,0,|0);...to|
|00002620| 74 61 6c 20 2b 3d 20 73 | 69 7a 65 6f 66 28 73 68 |tal += s|izeof(sh|
|00002630| 29 3b 0a 09 2f 2a 20 68 | 65 61 64 65 72 20 68 65 |);../* h|eader he|
|00002640| 61 64 65 72 20 2a 2f 0a | 20 20 20 20 73 74 72 6e |ader */.| strn|
|00002650| 63 70 79 28 73 68 2e 73 | 69 67 31 2c 22 53 49 54 |cpy(sh.s|ig1,"SIT|
|00002660| 21 22 2c 34 29 3b 0a 20 | 20 20 20 63 70 32 28 6e |!",4);. | cp2(n|
|00002670| 66 69 6c 65 73 2c 73 68 | 2e 6e 75 6d 46 69 6c 65 |files,sh|.numFile|
|00002680| 73 29 3b 0a 20 20 20 20 | 63 70 34 28 74 6f 74 61 |s);. |cp4(tota|
|00002690| 6c 2c 73 68 2e 61 72 63 | 4c 65 6e 29 3b 0a 20 20 |l,sh.arc|Len);. |
|000026a0| 20 20 73 74 72 6e 63 70 | 79 28 73 68 2e 73 69 67 | strncp|y(sh.sig|
|000026b0| 32 2c 22 72 4c 61 75 22 | 2c 34 29 3b 0a 20 20 20 |2,"rLau"|,4);. |
|000026c0| 20 73 68 2e 76 65 72 73 | 69 6f 6e 20 3d 20 31 3b | sh.vers|ion = 1;|
|000026d0| 0a 0a 09 77 72 69 74 65 | 28 6f 66 64 2c 26 73 68 |...write|(ofd,&sh|
|000026e0| 2c 73 69 7a 65 6f 66 20 | 73 68 29 3b 0a 7d 0a 0a |,sizeof |sh);.}..|
|000026f0| 70 75 74 5f 66 69 6c 65 | 28 6e 61 6d 65 29 0a 63 |put_file|(name).c|
|00002700| 68 61 72 20 6e 61 6d 65 | 5b 5d 3b 0a 7b 0a 09 73 |har name|[];.{..s|
|00002710| 74 72 75 63 74 20 73 74 | 61 74 20 73 74 3b 0a 09 |truct st|at st;..|
|00002720| 73 74 72 75 63 74 20 69 | 6e 66 6f 68 64 72 20 69 |struct i|nfohdr i|
|00002730| 68 3b 0a 09 69 6e 74 20 | 69 2c 6e 2c 66 64 3b 0a |h;..int |i,n,fd;.|
|00002740| 09 6c 6f 6e 67 20 66 70 | 6f 73 31 2c 20 66 70 6f |.long fp|os1, fpo|
|00002750| 73 32 3b 0a 09 63 68 61 | 72 20 6e 62 75 66 5b 32 |s2;..cha|r nbuf[2|
|00002760| 35 36 5d 2c 20 2a 70 3b | 0a 09 69 6e 74 20 66 6f |56], *p;|..int fo|
|00002770| 72 6b 3d 30 3b 0a 09 6c | 6f 6e 67 20 74 64 69 66 |rk=0;..l|ong tdif|
|00002780| 66 3b 0a 09 73 74 72 75 | 63 74 20 74 6d 20 2a 74 |f;..stru|ct tm *t|
|00002790| 70 3b 0a 23 69 66 64 65 | 66 20 42 53 44 0a 09 73 |p;.#ifde|f BSD..s|
|000027a0| 74 72 75 63 74 20 74 69 | 6d 65 62 20 74 62 75 66 |truct ti|meb tbuf|
|000027b0| 3b 0a 23 65 6c 73 65 0a | 09 6c 6f 6e 67 20 62 73 |;.#else.|.long bs|
|000027c0| 3b 0a 23 65 6e 64 69 66 | 0a 0a 09 66 70 6f 73 31 |;.#endif|...fpos1|
|000027d0| 20 3d 20 6c 73 65 65 6b | 28 6f 66 64 2c 30 2c 31 | = lseek|(ofd,0,1|
|000027e0| 29 3b 20 2f 2a 20 72 65 | 6d 65 6d 62 65 72 20 77 |); /* re|member w|
|000027f0| 68 65 72 65 20 77 65 20 | 61 72 65 20 2a 2f 0a 09 |here we |are */..|
|00002800| 2f 2a 20 77 72 69 74 65 | 20 65 6d 70 74 79 20 68 |/* write| empty h|
|00002810| 65 61 64 65 72 2c 20 77 | 69 6c 6c 20 73 65 65 6b |eader, w|ill seek|
|00002820| 20 62 61 63 6b 20 61 6e | 64 20 66 69 6c 6c 20 69 | back an|d fill i|
|00002830| 6e 20 6c 61 74 65 72 20 | 2a 2f 0a 09 62 7a 65 72 |n later |*/..bzer|
|00002840| 6f 28 26 66 68 2c 73 69 | 7a 65 6f 66 20 66 68 29 |o(&fh,si|zeof fh)|
|00002850| 3b 0a 09 77 72 69 74 65 | 28 6f 66 64 2c 26 66 68 |;..write|(ofd,&fh|
|00002860| 2c 73 69 7a 65 6f 66 20 | 66 68 29 3b 0a 0a 09 2f |,sizeof |fh);.../|
|00002870| 2a 20 6c 6f 6f 6b 20 66 | 6f 72 20 72 65 73 6f 75 |* look f|or resou|
|00002880| 72 63 65 20 66 6f 72 6b | 20 2a 2f 0a 09 73 74 72 |rce fork| */..str|
|00002890| 63 70 79 28 6e 62 75 66 | 2c 6e 61 6d 65 29 3b 0a |cpy(nbuf|,name);.|
|000028a0| 09 73 74 72 63 61 74 28 | 6e 62 75 66 2c 22 2e 72 |.strcat(|nbuf,".r|
|000028b0| 73 72 63 22 29 3b 0a 09 | 69 66 20 28 73 74 61 74 |src");..|if (stat|
|000028c0| 28 6e 62 75 66 2c 26 73 | 74 29 3e 3d 30 20 26 26 |(nbuf,&s|t)>=0 &&|
|000028d0| 20 73 74 2e 73 74 5f 73 | 69 7a 65 29 20 7b 09 2f | st.st_s|ize) {./|
|000028e0| 2a 20 72 65 73 6f 75 72 | 63 65 20 66 6f 72 6b 20 |* resour|ce fork |
|000028f0| 65 78 69 73 74 73 20 2a | 2f 0a 09 09 64 6f 66 6f |exists *|/...dofo|
|00002900| 72 6b 28 6e 62 75 66 29 | 3b 0a 09 09 63 70 34 28 |rk(nbuf)|;...cp4(|
|00002910| 73 74 2e 73 74 5f 73 69 | 7a 65 2c 66 68 2e 72 4c |st.st_si|ze,fh.rL|
|00002920| 65 6e 29 3b 0a 09 09 63 | 70 34 28 63 6c 65 6e 2c |en);...c|p4(clen,|
|00002930| 66 68 2e 63 52 4c 65 6e | 29 3b 0a 09 09 63 70 32 |fh.cRLen|);...cp2|
|00002940| 28 63 72 63 2c 66 68 2e | 72 73 72 63 43 52 43 29 |(crc,fh.|rsrcCRC)|
|00002950| 3b 0a 09 09 66 68 2e 63 | 6f 6d 70 52 4d 65 74 68 |;...fh.c|ompRMeth|
|00002960| 6f 64 20 3d 20 6c 70 7a | 43 6f 6d 70 3b 0a 09 09 |od = lpz|Comp;...|
|00002970| 66 6f 72 6b 2b 2b 3b 0a | 09 7d 0a 09 69 66 20 28 |fork++;.|.}..if (|
|00002980| 72 6d 66 69 6c 65 73 29 | 20 75 6e 6c 69 6e 6b 28 |rmfiles)| unlink(|
|00002990| 6e 62 75 66 29 3b 09 2f | 2a 20 69 67 6e 6f 72 65 |nbuf);./|* ignore|
|000029a0| 20 65 72 72 6f 72 73 20 | 2a 2f 0a 0a 09 2f 2a 20 | errors |*/.../* |
|000029b0| 6c 6f 6f 6b 20 66 6f 72 | 20 64 61 74 61 20 66 6f |look for| data fo|
|000029c0| 72 6b 20 2a 2f 0a 09 73 | 74 2e 73 74 5f 73 69 7a |rk */..s|t.st_siz|
|000029d0| 65 20 3d 20 30 3b 0a 09 | 73 74 72 63 70 79 28 6e |e = 0;..|strcpy(n|
|000029e0| 62 75 66 2c 6e 61 6d 65 | 29 3b 0a 09 69 66 20 28 |buf,name|);..if (|
|000029f0| 73 74 61 74 28 6e 62 75 | 66 2c 26 73 74 29 3c 30 |stat(nbu|f,&st)<0|
|00002a00| 29 20 7b 09 09 2f 2a 20 | 66 69 72 73 74 20 74 72 |) {../* |first tr|
|00002a10| 79 20 70 6c 61 69 6e 20 | 6e 61 6d 65 20 2a 2f 0a |y plain |name */.|
|00002a20| 09 09 73 74 72 63 61 74 | 28 6e 62 75 66 2c 22 2e |..strcat|(nbuf,".|
|00002a30| 64 61 74 61 22 29 3b 0a | 09 09 73 74 61 74 28 6e |data");.|..stat(n|
|00002a40| 62 75 66 2c 26 73 74 29 | 3b 0a 09 7d 0a 09 69 66 |buf,&st)|;..}..if|
|00002a50| 20 28 73 74 2e 73 74 5f | 73 69 7a 65 29 20 7b 09 | (st.st_|size) {.|
|00002a60| 09 2f 2a 20 64 61 74 61 | 20 66 6f 72 6b 20 65 78 |./* data| fork ex|
|00002a70| 69 73 74 73 20 2a 2f 0a | 09 09 64 6f 66 6f 72 6b |ists */.|..dofork|
|00002a80| 28 6e 62 75 66 29 3b 0a | 09 09 63 70 34 28 73 74 |(nbuf);.|..cp4(st|
|00002a90| 2e 73 74 5f 73 69 7a 65 | 2c 66 68 2e 64 4c 65 6e |.st_size|,fh.dLen|
|00002aa0| 29 3b 0a 09 09 63 70 34 | 28 63 6c 65 6e 2c 66 68 |);...cp4|(clen,fh|
|00002ab0| 2e 63 44 4c 65 6e 29 3b | 0a 09 09 63 70 32 28 63 |.cDLen);|...cp2(c|
|00002ac0| 72 63 2c 66 68 2e 64 61 | 74 61 43 52 43 29 3b 0a |rc,fh.da|taCRC);.|
|00002ad0| 09 09 66 68 2e 63 6f 6d | 70 44 4d 65 74 68 6f 64 |..fh.com|pDMethod|
|00002ae0| 20 3d 20 6c 70 7a 43 6f | 6d 70 3b 0a 09 09 66 6f | = lpzCo|mp;...fo|
|00002af0| 72 6b 2b 2b 3b 0a 09 7d | 0a 09 69 66 20 28 66 6f |rk++;..}|..if (fo|
|00002b00| 72 6b 20 3d 3d 20 30 29 | 20 7b 0a 09 09 66 70 72 |rk == 0)| {...fpr|
|00002b10| 69 6e 74 66 28 73 74 64 | 65 72 72 2c 22 25 73 3a |intf(std|err,"%s:|
|00002b20| 20 6e 6f 20 64 61 74 61 | 20 6f 72 20 72 65 73 6f | no data| or reso|
|00002b30| 75 72 63 65 20 66 69 6c | 65 73 5c 6e 22 2c 6e 61 |urce fil|es\n",na|
|00002b40| 6d 65 29 3b 0a 09 09 72 | 65 74 75 72 6e 20 30 3b |me);...r|eturn 0;|
|00002b50| 0a 09 7d 0a 09 69 66 20 | 28 72 6d 66 69 6c 65 73 |..}..if |(rmfiles|
|00002b60| 29 20 75 6e 6c 69 6e 6b | 28 6e 62 75 66 29 3b 09 |) unlink|(nbuf);.|
|00002b70| 2f 2a 20 69 67 6e 6f 72 | 65 20 65 72 72 6f 72 73 |/* ignor|e errors|
|00002b80| 20 2a 2f 0a 0a 09 2f 2a | 20 6c 6f 6f 6b 20 66 6f | */.../*| look fo|
|00002b90| 72 20 2e 69 6e 66 6f 20 | 66 69 6c 65 20 2a 2f 0a |r .info |file */.|
|00002ba0| 09 73 74 72 63 70 79 28 | 6e 62 75 66 2c 6e 61 6d |.strcpy(|nbuf,nam|
|00002bb0| 65 29 3b 0a 09 73 74 72 | 63 61 74 28 6e 62 75 66 |e);..str|cat(nbuf|
|00002bc0| 2c 22 2e 69 6e 66 6f 22 | 29 3b 0a 09 69 66 20 28 |,".info"|);..if (|
|00002bd0| 28 66 64 3d 6f 70 65 6e | 28 6e 62 75 66 2c 30 29 |(fd=open|(nbuf,0)|
|00002be0| 29 3e 3d 30 20 26 26 20 | 72 65 61 64 28 66 64 2c |)>=0 && |read(fd,|
|00002bf0| 26 69 68 2c 73 69 7a 65 | 6f 66 28 69 68 29 29 3d |&ih,size|of(ih))=|
|00002c00| 3d 73 69 7a 65 6f 66 28 | 69 68 29 29 20 7b 0a 09 |=sizeof(|ih)) {..|
|00002c10| 09 73 74 72 6e 63 70 79 | 28 66 68 2e 66 4e 61 6d |.strncpy|(fh.fNam|
|00002c20| 65 2c 20 69 68 2e 6e 61 | 6d 65 2c 36 34 29 3b 0a |e, ih.na|me,64);.|
|00002c30| 09 09 73 74 72 6e 63 70 | 79 28 66 68 2e 66 54 79 |..strncp|y(fh.fTy|
|00002c40| 70 65 2c 20 69 68 2e 74 | 79 70 65 2c 20 34 29 3b |pe, ih.t|ype, 4);|
|00002c50| 0a 09 09 73 74 72 6e 63 | 70 79 28 66 68 2e 66 43 |...strnc|py(fh.fC|
|00002c60| 72 65 61 74 6f 72 2c 20 | 69 68 2e 63 72 65 61 74 |reator, |ih.creat|
|00002c70| 6f 72 2c 20 34 29 3b 0a | 09 09 73 74 72 6e 63 70 |or, 4);.|..strncp|
|00002c80| 79 28 66 68 2e 46 6e 64 | 72 46 6c 61 67 73 2c 20 |y(fh.Fnd|rFlags, |
|00002c90| 69 68 2e 66 6c 61 67 2c | 20 32 29 3b 0a 09 09 73 |ih.flag,| 2);...s|
|00002ca0| 74 72 6e 63 70 79 28 66 | 68 2e 63 44 61 74 65 2c |trncpy(f|h.cDate,|
|00002cb0| 20 69 68 2e 63 74 69 6d | 65 2c 20 34 29 3b 0a 09 | ih.ctim|e, 4);..|
|00002cc0| 09 73 74 72 6e 63 70 79 | 28 66 68 2e 6d 44 61 74 |.strncpy|(fh.mDat|
|00002cd0| 65 2c 20 69 68 2e 6d 74 | 69 6d 65 2c 20 34 29 3b |e, ih.mt|ime, 4);|
|00002ce0| 0a 09 7d 0a 09 65 6c 73 | 65 20 7b 09 2f 2a 20 6e |..}..els|e {./* n|
|00002cf0| 6f 20 69 6e 66 6f 20 66 | 69 6c 65 20 73 6f 20 66 |o info f|ile so f|
|00002d00| 61 6b 65 20 69 74 20 2a | 2f 0a 09 09 73 74 72 6e |ake it *|/...strn|
|00002d10| 63 70 79 28 26 66 68 2e | 66 4e 61 6d 65 5b 31 5d |cpy(&fh.|fName[1]|
|00002d20| 2c 20 6e 61 6d 65 2c 36 | 33 29 3b 20 66 68 2e 66 |, name,6|3); fh.f|
|00002d30| 4e 61 6d 65 5b 30 5d 20 | 3d 20 6d 69 6e 28 73 74 |Name[0] |= min(st|
|00002d40| 72 6c 65 6e 28 6e 61 6d | 65 29 2c 36 33 29 3b 0a |rlen(nam|e),63);.|
|00002d50| 09 09 2f 2a 20 64 65 66 | 61 75 6c 74 20 74 6f 20 |../* def|ault to |
|00002d60| 4c 53 43 20 74 65 78 74 | 20 66 69 6c 65 20 2a 2f |LSC text| file */|
|00002d70| 0a 09 09 73 74 72 6e 63 | 70 79 28 66 68 2e 66 54 |...strnc|py(fh.fT|
|00002d80| 79 70 65 2c 20 54 79 70 | 65 20 3f 20 54 79 70 65 |ype, Typ|e ? Type|
|00002d90| 20 3a 20 22 54 45 58 54 | 22 2c 20 34 29 3b 0a 09 | : "TEXT|", 4);..|
|00002da0| 09 73 74 72 6e 63 70 79 | 28 66 68 2e 66 43 72 65 |.strncpy|(fh.fCre|
|00002db0| 61 74 6f 72 2c 20 43 72 | 65 61 74 6f 72 20 3f 20 |ator, Cr|eator ? |
|00002dc0| 43 72 65 61 74 6f 72 20 | 3a 20 22 4b 41 48 4c 22 |Creator |: "KAHL"|
|00002dd0| 2c 20 34 29 3b 0a 09 09 | 2f 2a 20 63 6f 6e 76 65 |, 4);...|/* conve|
|00002de0| 72 74 20 75 6e 69 78 20 | 66 69 6c 65 20 74 69 6d |rt unix |file tim|
|00002df0| 65 20 74 6f 20 6d 61 63 | 20 74 69 6d 65 20 66 6f |e to mac| time fo|
|00002e00| 72 6d 61 74 20 2a 2f 0a | 23 69 66 64 65 66 20 42 |rmat */.|#ifdef B|
|00002e10| 53 44 0a 09 09 66 74 69 | 6d 65 28 26 74 62 75 66 |SD...fti|me(&tbuf|
|00002e20| 29 3b 0a 09 09 74 70 20 | 3d 20 6c 6f 63 61 6c 74 |);...tp |= localt|
|00002e30| 69 6d 65 28 26 74 62 75 | 66 2e 74 69 6d 65 29 3b |ime(&tbu|f.time);|
|00002e40| 0a 09 09 74 64 69 66 66 | 20 3d 20 54 49 4d 45 44 |...tdiff| = TIMED|
|00002e50| 49 46 46 20 2d 20 74 62 | 75 66 2e 74 69 6d 65 7a |IFF - tb|uf.timez|
|00002e60| 6f 6e 65 20 2a 20 36 30 | 3b 0a 09 09 69 66 20 28 |one * 60|;...if (|
|00002e70| 74 70 2d 3e 74 6d 5f 69 | 73 64 73 74 29 0a 09 09 |tp->tm_i|sdst)...|
|00002e80| 09 74 64 69 66 66 20 2b | 3d 20 36 30 20 2a 20 36 |.tdiff +|= 60 * 6|
|00002e90| 30 3b 0a 23 65 6c 73 65 | 0a 09 09 2f 2a 20 49 20 |0;.#else|.../* I |
|00002ea0| 68 6f 70 65 20 74 68 69 | 73 20 69 73 20 72 69 67 |hope thi|s is rig|
|00002eb0| 68 74 21 20 2d 61 6e 64 | 79 20 2a 2f 0a 09 09 74 |ht! -and|y */...t|
|00002ec0| 69 6d 65 28 26 62 73 29 | 3b 0a 09 09 74 70 20 3d |ime(&bs)|;...tp =|
|00002ed0| 20 6c 6f 63 61 6c 74 69 | 6d 65 28 26 62 73 29 3b | localti|me(&bs);|
|00002ee0| 0a 09 09 74 64 69 66 66 | 20 3d 20 54 49 4d 45 44 |...tdiff| = TIMED|
|00002ef0| 49 46 46 20 2d 20 74 69 | 6d 65 7a 6f 6e 65 3b 0a |IFF - ti|mezone;.|
|00002f00| 09 09 69 66 20 28 74 70 | 2d 3e 74 6d 5f 69 73 64 |..if (tp|->tm_isd|
|00002f10| 73 74 29 0a 09 09 09 74 | 64 69 66 66 20 2b 3d 20 |st)....t|diff += |
|00002f20| 36 30 20 2a 20 36 30 3b | 0a 23 65 6e 64 69 66 0a |60 * 60;|.#endif.|
|00002f30| 09 09 63 70 34 28 73 74 | 2e 73 74 5f 63 74 69 6d |..cp4(st|.st_ctim|
|00002f40| 65 20 2b 20 74 64 69 66 | 66 2c 20 66 68 2e 63 44 |e + tdif|f, fh.cD|
|00002f50| 61 74 65 29 3b 0a 09 09 | 63 70 34 28 73 74 2e 73 |ate);...|cp4(st.s|
|00002f60| 74 5f 6d 74 69 6d 65 20 | 2b 20 74 64 69 66 66 2c |t_mtime |+ tdiff,|
|00002f70| 20 66 68 2e 6d 44 61 74 | 65 29 3b 0a 09 7d 0a 09 | fh.mDat|e);..}..|
|00002f80| 63 6c 6f 73 65 28 66 64 | 29 3b 0a 09 69 66 20 28 |close(fd|);..if (|
|00002f90| 72 6d 66 69 6c 65 73 29 | 20 75 6e 6c 69 6e 6b 28 |rmfiles)| unlink(|
|00002fa0| 6e 62 75 66 29 3b 09 2f | 2a 20 69 67 6e 6f 72 65 |nbuf);./|* ignore|
|00002fb0| 20 65 72 72 6f 72 73 20 | 2a 2f 0a 0a 09 63 72 63 | errors |*/...crc|
|00002fc0| 20 3d 20 75 70 64 63 72 | 63 28 30 2c 26 66 68 2c | = updcr|c(0,&fh,|
|00002fd0| 28 73 69 7a 65 6f 66 20 | 66 68 29 2d 32 29 3b 0a |(sizeof |fh)-2);.|
|00002fe0| 09 63 70 32 28 63 72 63 | 2c 20 66 68 2e 68 64 72 |.cp2(crc|, fh.hdr|
|00002ff0| 43 52 43 29 3b 0a 0a 09 | 66 70 6f 73 32 20 3d 20 |CRC);...|fpos2 = |
|00003000| 6c 73 65 65 6b 28 6f 66 | 64 2c 30 2c 31 29 3b 09 |lseek(of|d,0,1);.|
|00003010| 09 2f 2a 20 72 65 6d 65 | 6d 62 65 72 20 77 68 65 |./* reme|mber whe|
|00003020| 72 65 20 77 65 20 61 72 | 65 20 2a 2f 0a 09 6c 73 |re we ar|e */..ls|
|00003030| 65 65 6b 28 6f 66 64 2c | 66 70 6f 73 31 2c 30 29 |eek(ofd,|fpos1,0)|
|00003040| 3b 09 09 09 09 2f 2a 20 | 73 65 65 6b 20 62 61 63 |;..../* |seek bac|
|00003050| 6b 20 6f 76 65 72 20 66 | 69 6c 65 28 73 29 20 61 |k over f|ile(s) a|
|00003060| 6e 64 20 68 65 61 64 65 | 72 20 2a 2f 0a 09 77 72 |nd heade|r */..wr|
|00003070| 69 74 65 28 6f 66 64 2c | 26 66 68 2c 73 69 7a 65 |ite(ofd,|&fh,size|
|00003080| 6f 66 20 66 68 29 3b 09 | 09 2f 2a 20 77 72 69 74 |of fh);.|./* writ|
|00003090| 65 20 62 61 63 6b 20 68 | 65 61 64 65 72 20 2a 2f |e back h|eader */|
|000030a0| 0a 09 66 70 6f 73 32 3d | 6c 73 65 65 6b 28 6f 66 |..fpos2=|lseek(of|
|000030b0| 64 2c 66 70 6f 73 32 2c | 30 29 3b 09 09 09 09 2f |d,fpos2,|0);..../|
|000030c0| 2a 20 73 65 65 6b 20 66 | 6f 72 77 61 72 64 20 66 |* seek f|orward f|
|000030d0| 69 6c 65 20 2a 2f 0a 0a | 09 72 65 74 75 72 6e 20 |ile */..|.return |
|000030e0| 28 66 70 6f 73 32 20 2d | 20 66 70 6f 73 31 29 3b |(fpos2 -| fpos1);|
|000030f0| 0a 7d 0a 09 0a 64 6f 66 | 6f 72 6b 28 6e 61 6d 65 |.}...dof|ork(name|
|00003100| 29 0a 63 68 61 72 20 6e | 61 6d 65 5b 5d 3b 0a 7b |).char n|ame[];.{|
|00003110| 0a 09 46 49 4c 45 20 2a | 66 73 3b 0a 09 69 6e 74 |..FILE *|fs;..int|
|00003120| 20 6e 2c 20 66 64 2c 20 | 75 66 64 3b 0a 09 63 68 | n, fd, |ufd;..ch|
|00003130| 61 72 20 2a 70 3b 0a 0a | 09 69 66 20 28 28 66 64 |ar *p;..|.if ((fd|
|00003140| 3d 6f 70 65 6e 28 6e 61 | 6d 65 2c 30 29 29 3c 30 |=open(na|me,0))<0|
|00003150| 29 20 7b 0a 09 09 70 65 | 72 72 6f 72 28 6e 61 6d |) {...pe|rror(nam|
|00003160| 65 29 3b 0a 09 09 72 65 | 74 75 72 6e 20 30 3b 0a |e);...re|turn 0;.|
|00003170| 09 7d 20 20 20 0a 09 69 | 66 20 28 75 6e 69 78 66 |.} ..i|f (unixf|
|00003180| 29 09 09 2f 2a 20 62 75 | 69 6c 64 20 63 6f 6e 76 |)../* bu|ild conv|
|00003190| 65 72 73 69 6f 6e 20 66 | 69 6c 65 20 2a 2f 0a 09 |ersion f|ile */..|
|000031a0| 09 69 66 20 28 28 75 66 | 64 3d 63 72 65 61 74 28 |.if ((uf|d=creat(|
|000031b0| 22 73 69 74 2b 74 65 6d | 70 22 2c 30 36 34 34 29 |"sit+tem|p",0644)|
|000031c0| 29 3c 30 29 20 7b 0a 09 | 09 09 70 65 72 72 6f 72 |)<0) {..|..perror|
|000031d0| 28 22 73 69 74 2b 74 65 | 6d 70 22 29 3b 0a 09 09 |("sit+te|mp");...|
|000031e0| 09 72 65 74 75 72 6e 20 | 30 3b 0a 09 09 7d 20 20 |.return |0;...} |
|000031f0| 20 0a 09 2f 2a 20 64 6f | 20 63 72 63 20 6f 66 20 | ../* do| crc of |
|00003200| 66 69 6c 65 3a 20 2a 2f | 0a 09 63 72 63 20 3d 20 |file: */|..crc = |
|00003210| 30 3b 0a 09 77 68 69 6c | 65 20 28 28 6e 3d 72 65 |0;..whil|e ((n=re|
|00003220| 61 64 28 66 64 2c 62 75 | 66 2c 42 55 46 53 49 5a |ad(fd,bu|f,BUFSIZ|
|00003230| 29 29 3e 30 29 20 7b 0a | 09 09 69 66 20 28 75 6e |))>0) {.|..if (un|
|00003240| 69 78 66 29 20 7b 09 2f | 2a 20 63 6f 6e 76 65 72 |ixf) {./|* conver|
|00003250| 74 20 27 5c 6e 27 20 74 | 6f 20 27 5c 72 27 20 2a |t '\n' t|o '\r' *|
|00003260| 2f 0a 09 09 09 66 6f 72 | 20 28 70 3d 62 75 66 3b |/....for| (p=buf;|
|00003270| 20 70 3c 26 62 75 66 5b | 6e 5d 3b 20 70 2b 2b 29 | p<&buf[|n]; p++)|
|00003280| 0a 09 09 09 09 69 66 20 | 28 2a 70 20 3d 3d 20 27 |.....if |(*p == '|
|00003290| 5c 6e 27 29 20 2a 70 20 | 3d 20 27 5c 72 27 3b 0a |\n') *p |= '\r';.|
|000032a0| 09 09 09 77 72 69 74 65 | 28 75 66 64 2c 62 75 66 |...write|(ufd,buf|
|000032b0| 2c 6e 29 3b 0a 09 09 7d | 0a 09 09 63 72 63 20 3d |,n);...}|...crc =|
|000032c0| 20 75 70 64 63 72 63 28 | 63 72 63 2c 62 75 66 2c | updcrc(|crc,buf,|
|000032d0| 6e 29 3b 0a 09 7d 0a 09 | 63 6c 6f 73 65 28 66 64 |n);..}..|close(fd|
|000032e0| 29 3b 0a 09 2f 2a 0a 09 | 20 2a 20 6f 70 65 6e 20 |);../*..| * open |
|000032f0| 70 69 70 65 20 74 6f 20 | 63 6f 6d 70 72 65 73 73 |pipe to |compress|
|00003300| 20 66 69 6c 65 0a 09 20 | 2a 20 20 20 49 66 20 61 | file.. |* If a|
|00003310| 20 75 6e 69 78 20 66 69 | 6c 65 20 28 27 5c 6e 27 | unix fi|le ('\n'|
|00003320| 20 2d 3e 20 27 5c 72 27 | 20 63 6f 6e 76 65 72 73 | -> '\r'| convers|
|00003330| 69 6f 6e 29 20 27 73 69 | 74 2b 74 65 6d 70 27 20 |ion) 'si|t+temp' |
|00003340| 77 69 6c 6c 20 62 65 20 | 61 20 6e 65 77 20 63 6f |will be |a new co|
|00003350| 70 79 0a 09 20 2a 20 20 | 20 77 69 74 68 20 74 68 |py.. * | with th|
|00003360| 65 20 63 6f 6e 76 65 72 | 73 69 6f 6e 20 64 6f 6e |e conver|sion don|
|00003370| 65 2e 09 4f 74 68 65 72 | 77 69 73 65 2c 20 27 73 |e..Other|wise, 's|
|00003380| 69 74 2b 74 65 6d 70 27 | 20 69 73 20 6a 75 73 74 |it+temp'| is just|
|00003390| 20 61 20 6c 69 6e 6b 20 | 74 6f 20 0a 09 20 2a 20 | a link |to .. * |
|000033a0| 20 20 74 68 65 20 69 6e | 70 75 74 20 66 69 6c 65 | the in|put file|
|000033b0| 2e 0a 09 20 2a 2f 0a 09 | 69 66 20 28 75 6e 69 78 |... */..|if (unix|
|000033c0| 66 29 0a 09 09 63 6c 6f | 73 65 28 75 66 64 29 3b |f)...clo|se(ufd);|
|000033d0| 0a 09 65 6c 73 65 20 6c | 69 6e 6b 28 6e 61 6d 65 |..else l|ink(name|
|000033e0| 2c 22 73 69 74 2b 74 65 | 6d 70 22 29 3b 0a 09 66 |,"sit+te|mp");..f|
|000033f0| 73 20 3d 20 70 6f 70 65 | 6e 28 22 63 6f 6d 70 72 |s = pope|n("compr|
|00003400| 65 73 73 20 2d 63 20 2d | 6e 20 2d 62 20 31 34 20 |ess -c -|n -b 14 |
|00003410| 73 69 74 2b 74 65 6d 70 | 22 2c 22 72 22 29 3b 0a |sit+temp|","r");.|
|00003420| 09 69 66 20 28 66 73 20 | 3d 3d 20 4e 55 4c 4c 29 |.if (fs |== NULL)|
|00003430| 20 7b 0a 09 09 70 65 72 | 72 6f 72 28 6e 61 6d 65 | {...per|ror(name|
|00003440| 29 3b 0a 09 09 72 65 74 | 75 72 6e 20 30 3b 0a 09 |);...ret|urn 0;..|
|00003450| 7d 0a 09 2f 2a 20 77 72 | 69 74 65 20 6f 75 74 20 |}../* wr|ite out |
|00003460| 63 6f 6d 70 72 65 73 73 | 65 64 20 66 69 6c 65 20 |compress|ed file |
|00003470| 2a 2f 0a 09 63 6c 65 6e | 20 3d 20 30 3b 0a 09 77 |*/..clen| = 0;..w|
|00003480| 68 69 6c 65 20 28 28 6e | 3d 66 72 65 61 64 28 62 |hile ((n|=fread(b|
|00003490| 75 66 2c 31 2c 42 55 46 | 53 49 5a 2c 66 73 29 29 |uf,1,BUF|SIZ,fs))|
|000034a0| 3e 30 29 20 7b 0a 09 09 | 77 72 69 74 65 28 6f 66 |>0) {...|write(of|
|000034b0| 64 2c 62 75 66 2c 6e 29 | 3b 0a 09 09 63 6c 65 6e |d,buf,n)|;...clen|
|000034c0| 20 2b 3d 20 6e 3b 0a 09 | 7d 0a 09 70 63 6c 6f 73 | += n;..|}..pclos|
|000034d0| 65 28 66 73 29 3b 0a 09 | 75 6e 6c 69 6e 6b 28 22 |e(fs);..|unlink("|
|000034e0| 73 69 74 2b 74 65 6d 70 | 22 29 3b 0a 7d 0a 0a 63 |sit+temp|");.}..c|
|000034f0| 70 32 28 78 2c 64 65 73 | 74 29 0a 75 6e 73 69 67 |p2(x,des|t).unsig|
|00003500| 6e 65 64 20 73 68 6f 72 | 74 20 78 3b 0a 63 68 61 |ned shor|t x;.cha|
|00003510| 72 20 64 65 73 74 5b 5d | 3b 0a 7b 0a 09 64 65 73 |r dest[]|;.{..des|
|00003520| 74 5b 30 5d 20 3d 20 78 | 3e 3e 38 3b 0a 09 64 65 |t[0] = x|>>8;..de|
|00003530| 73 74 5b 31 5d 20 3d 20 | 78 3b 0a 7d 0a 0a 63 70 |st[1] = |x;.}..cp|
|00003540| 34 28 78 2c 64 65 73 74 | 29 0a 75 6e 73 69 67 6e |4(x,dest|).unsign|
|00003550| 65 64 20 6c 6f 6e 67 20 | 78 3b 0a 63 68 61 72 20 |ed long |x;.char |
|00003560| 64 65 73 74 5b 5d 3b 0a | 7b 0a 09 64 65 73 74 5b |dest[];.|{..dest[|
|00003570| 30 5d 20 3d 20 78 3e 3e | 32 34 3b 0a 09 64 65 73 |0] = x>>|24;..des|
|00003580| 74 5b 31 5d 20 3d 20 78 | 3e 3e 31 36 3b 0a 09 64 |t[1] = x|>>16;..d|
|00003590| 65 73 74 5b 32 5d 20 3d | 20 78 3e 3e 38 3b 0a 09 |est[2] =| x>>8;..|
|000035a0| 64 65 73 74 5b 33 5d 20 | 3d 20 78 3b 0a 7d 0a 00 |dest[3] |= x;.}..|
|000035b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000035c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000035d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000035e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000035f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003600| 73 69 74 2f 75 70 64 63 | 72 63 2e 63 00 00 00 00 |sit/updc|rc.c....|
|00003610| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003620| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003630| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003640| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003650| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003660| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 32 |.... 6|44 . 2|
|00003670| 34 33 20 00 20 20 20 20 | 31 32 20 00 20 20 20 20 |43 . |12 . |
|00003680| 20 20 31 33 33 33 30 20 | 20 34 34 30 34 33 33 34 | 13330 | 4404334|
|00003690| 30 37 37 20 20 20 36 33 | 35 31 00 20 00 00 00 00 |077 63|51. ....|
|000036a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000036b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000036c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000036d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000036e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000036f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003700| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003710| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003720| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003730| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003740| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003750| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003760| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003770| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003780| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003790| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000037a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000037b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000037c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000037d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000037e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000037f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003800| 2f 2a 20 75 70 64 63 72 | 63 28 33 29 2c 20 63 72 |/* updcr|c(3), cr|
|00003810| 63 28 31 29 20 2d 20 63 | 61 6c 63 75 6c 61 74 65 |c(1) - c|alculate|
|00003820| 20 63 72 63 20 70 6f 6c | 79 6e 6f 6d 69 61 6c 73 | crc pol|ynomials|
|00003830| 0a 20 2a 0a 20 2a 20 43 | 61 6c 63 75 6c 61 74 65 |. *. * C|alculate|
|00003840| 2c 20 69 6e 74 65 6c 6c | 69 67 65 6e 74 6c 79 2c |, intell|igently,|
|00003850| 20 74 68 65 20 43 52 43 | 20 6f 66 20 61 20 64 61 | the CRC| of a da|
|00003860| 74 61 73 65 74 20 69 6e | 63 72 65 6d 65 6e 74 61 |taset in|crementa|
|00003870| 6c 6c 79 20 67 69 76 65 | 6e 20 61 20 0a 20 2a 20 |lly give|n a . * |
|00003880| 62 75 66 66 65 72 20 66 | 75 6c 6c 20 61 74 20 61 |buffer f|ull at a|
|00003890| 20 74 69 6d 65 2e 0a 20 | 2a 20 0a 20 2a 20 55 73 | time.. |* . * Us|
|000038a0| 61 67 65 3a 0a 20 2a 20 | 09 6e 65 77 63 72 63 20 |age:. * |.newcrc |
|000038b0| 3d 20 75 70 64 63 72 63 | 28 20 6f 6c 64 63 72 63 |= updcrc|( oldcrc|
|000038c0| 2c 20 62 75 66 61 64 72 | 2c 20 62 75 66 6c 65 6e |, bufadr|, buflen|
|000038d0| 20 29 0a 20 2a 20 09 09 | 75 6e 73 69 67 6e 65 64 | ). * ..|unsigned|
|000038e0| 20 69 6e 74 20 6f 6c 64 | 63 72 63 2c 20 62 75 66 | int old|crc, buf|
|000038f0| 6c 65 6e 3b 0a 20 2a 20 | 09 09 63 68 61 72 20 2a |len;. * |..char *|
|00003900| 62 75 66 61 64 72 3b 0a | 20 2a 0a 20 2a 20 43 6f |bufadr;.| *. * Co|
|00003910| 6d 70 69 6c 69 6e 67 20 | 77 69 74 68 20 2d 44 54 |mpiling |with -DT|
|00003920| 45 53 54 20 63 72 65 61 | 74 65 73 20 61 20 70 72 |EST crea|tes a pr|
|00003930| 6f 67 72 61 6d 20 74 6f | 20 70 72 69 6e 74 20 74 |ogram to| print t|
|00003940| 68 65 20 43 52 43 20 6f | 66 20 73 74 64 69 6e 20 |he CRC o|f stdin |
|00003950| 74 6f 20 73 74 64 6f 75 | 74 2e 0a 20 2a 20 43 6f |to stdou|t.. * Co|
|00003960| 6d 70 69 6c 65 20 77 69 | 74 68 20 2d 44 4d 41 4b |mpile wi|th -DMAK|
|00003970| 45 54 41 42 20 74 6f 20 | 70 72 69 6e 74 20 76 61 |ETAB to |print va|
|00003980| 6c 75 65 73 20 66 6f 72 | 20 63 72 63 74 61 62 20 |lues for| crctab |
|00003990| 74 6f 20 73 74 64 6f 75 | 74 2e 20 20 49 66 20 79 |to stdou|t. If y|
|000039a0| 6f 75 20 63 68 61 6e 67 | 65 0a 20 2a 09 74 68 65 |ou chang|e. *.the|
|000039b0| 20 43 52 43 20 70 6f 6c | 79 6e 6f 6d 69 61 6c 20 | CRC pol|ynomial |
|000039c0| 70 61 72 61 6d 65 74 65 | 72 73 2c 20 62 65 20 73 |paramete|rs, be s|
|000039d0| 75 72 65 20 74 6f 20 64 | 6f 20 74 68 69 73 20 61 |ure to d|o this a|
|000039e0| 6e 64 20 63 68 61 6e 67 | 65 0a 20 2a 09 63 72 63 |nd chang|e. *.crc|
|000039f0| 74 61 62 27 73 20 69 6e | 69 74 69 61 6c 20 76 61 |tab's in|itial va|
|00003a00| 6c 75 65 2e 0a 20 2a 0a | 20 2a 20 4e 6f 74 65 73 |lue.. *.| * Notes|
|00003a10| 3a 0a 20 2a 20 20 52 65 | 67 61 72 64 73 20 74 68 |:. * Re|gards th|
|00003a20| 65 20 64 61 74 61 20 73 | 74 72 65 61 6d 20 61 73 |e data s|tream as|
|00003a30| 20 61 6e 20 69 6e 74 65 | 67 65 72 20 77 68 6f 73 | an inte|ger whos|
|00003a40| 65 20 4d 53 42 20 69 73 | 20 74 68 65 20 4d 53 42 |e MSB is| the MSB|
|00003a50| 20 6f 66 20 74 68 65 20 | 66 69 72 73 74 0a 20 2a | of the |first. *|
|00003a60| 20 20 62 79 74 65 20 72 | 65 63 69 65 76 65 64 2e | byte r|ecieved.|
|00003a70| 20 20 54 68 69 73 20 6e | 75 6d 62 65 72 20 69 73 | This n|umber is|
|00003a80| 20 27 64 69 76 69 64 65 | 64 27 20 28 75 73 69 6e | 'divide|d' (usin|
|00003a90| 67 20 78 6f 72 20 69 6e | 73 74 65 61 64 20 6f 66 |g xor in|stead of|
|00003aa0| 20 73 75 62 74 72 61 63 | 74 69 6f 6e 29 0a 20 2a | subtrac|tion). *|
|00003ab0| 20 20 62 79 20 74 68 65 | 20 63 72 63 2d 70 6f 6c | by the| crc-pol|
|00003ac0| 79 6e 6f 6d 69 61 6c 20 | 50 2e 0a 20 2a 20 20 58 |ynomial |P.. * X|
|00003ad0| 4d 4f 44 45 4d 20 64 6f | 65 73 20 74 68 69 6e 67 |MODEM do|es thing|
|00003ae0| 73 20 61 20 6c 69 74 74 | 6c 65 20 64 69 66 66 65 |s a litt|le diffe|
|00003af0| 72 65 6e 74 6c 79 2c 20 | 65 73 73 65 6e 74 69 61 |rently, |essentia|
|00003b00| 6c 6c 79 20 74 72 65 61 | 74 69 6e 67 20 74 68 65 |lly trea|ting the|
|00003b10| 20 4c 53 42 20 6f 66 0a | 20 2a 20 74 68 65 20 66 | LSB of.| * the f|
|00003b20| 69 72 73 74 20 64 61 74 | 61 20 62 79 74 65 20 61 |irst dat|a byte a|
|00003b30| 73 20 74 68 65 20 4d 53 | 42 20 6f 66 20 74 68 65 |s the MS|B of the|
|00003b40| 20 69 6e 74 65 67 65 72 | 2e 20 44 65 66 69 6e 65 | integer|. Define|
|00003b50| 20 53 57 41 50 50 45 44 | 20 74 6f 20 6d 61 6b 65 | SWAPPED| to make|
|00003b60| 0a 20 2a 20 74 68 69 6e | 67 73 20 62 65 68 61 76 |. * thin|gs behav|
|00003b70| 65 20 69 6e 20 74 68 69 | 73 20 6d 61 6e 6e 65 72 |e in thi|s manner|
|00003b80| 2e 0a 20 2a 0a 20 2a 20 | 41 75 74 68 6f 72 3a 09 |.. *. * |Author:.|
|00003b90| 4d 61 72 6b 20 47 2e 20 | 4d 65 6e 64 65 6c 2c 20 |Mark G. |Mendel, |
|00003ba0| 37 2f 38 36 0a 20 2a 09 | 09 55 55 43 50 3a 20 69 |7/86. *.|.UUCP: i|
|00003bb0| 68 6e 70 34 21 75 6d 6e | 2d 63 73 21 68 79 70 65 |hnp4!umn|-cs!hype|
|00003bc0| 72 21 6d 61 72 6b 2c 20 | 47 45 6e 69 65 3a 20 6d |r!mark, |GEnie: m|
|00003bd0| 67 6d 0a 20 2a 2f 0a 0a | 2f 2a 20 54 68 65 20 43 |gm. */..|/* The C|
|00003be0| 52 43 20 70 6f 6c 79 6e | 6f 6d 69 61 6c 2e 0a 20 |RC polyn|omial.. |
|00003bf0| 2a 20 54 68 65 73 65 20 | 34 20 76 61 6c 75 65 73 |* These |4 values|
|00003c00| 20 64 65 66 69 6e 65 20 | 74 68 65 20 63 72 63 2d | define |the crc-|
|00003c10| 70 6f 6c 79 6e 6f 6d 69 | 61 6c 2e 0a 20 2a 20 49 |polynomi|al.. * I|
|00003c20| 66 20 79 6f 75 20 63 68 | 61 6e 67 65 20 74 68 65 |f you ch|ange the|
|00003c30| 6d 2c 20 79 6f 75 20 6d | 75 73 74 20 63 68 61 6e |m, you m|ust chan|
|00003c40| 67 65 20 63 72 63 74 61 | 62 5b 5d 27 73 20 69 6e |ge crcta|b[]'s in|
|00003c50| 69 74 69 61 6c 20 76 61 | 6c 75 65 20 74 6f 20 77 |itial va|lue to w|
|00003c60| 68 61 74 20 69 73 0a 20 | 2a 20 70 72 69 6e 74 65 |hat is. |* printe|
|00003c70| 64 20 62 79 20 69 6e 69 | 74 63 72 63 74 61 62 28 |d by ini|tcrctab(|
|00003c80| 29 20 5b 73 65 65 20 27 | 63 6f 6d 70 69 6c 65 20 |) [see '|compile |
|00003c90| 77 69 74 68 20 2d 44 4d | 41 4b 45 54 41 42 27 20 |with -DM|AKETAB' |
|00003ca0| 61 62 6f 76 65 5d 2e 0a | 20 2a 2f 0a 20 20 20 20 |above]..| */. |
|00003cb0| 2f 2a 20 56 61 6c 75 65 | 20 75 73 65 64 20 62 79 |/* Value| used by|
|00003cc0| 3a 09 20 20 20 20 09 09 | 43 49 54 54 09 58 4d 4f |:. ..|CITT.XMO|
|00003cd0| 44 45 4d 09 41 52 43 20 | 20 09 2a 2f 0a 23 64 65 |DEM.ARC | .*/.#de|
|00003ce0| 66 69 6e 65 09 50 09 20 | 30 78 41 30 30 31 09 20 |fine.P. |0xA001. |
|00003cf0| 2f 2a 20 74 68 65 20 70 | 6f 6c 79 3a 09 30 78 31 |/* the p|oly:.0x1|
|00003d00| 30 32 31 09 30 78 31 30 | 32 31 09 41 30 30 31 09 |021.0x10|21.A001.|
|00003d10| 2a 2f 0a 23 64 65 66 69 | 6e 65 20 49 4e 49 54 5f |*/.#defi|ne INIT_|
|00003d20| 43 52 43 20 30 4c 09 20 | 2f 2a 20 69 6e 69 74 20 |CRC 0L. |/* init |
|00003d30| 76 61 6c 75 65 3a 09 2d | 31 09 30 09 30 09 2a 2f |value:.-|1.0.0.*/|
|00003d40| 0a 23 64 65 66 69 6e 65 | 20 53 57 41 50 50 45 44 |.#define| SWAPPED|
|00003d50| 09 09 20 2f 2a 20 62 69 | 74 20 6f 72 64 65 72 3a |.. /* bi|t order:|
|00003d60| 09 75 6e 64 65 66 09 64 | 65 66 69 6e 65 64 09 64 |.undef.d|efined.d|
|00003d70| 65 66 69 6e 65 64 20 2a | 2f 0a 23 64 65 66 69 6e |efined *|/.#defin|
|00003d80| 65 20 57 09 31 36 09 20 | 2f 2a 20 62 69 74 73 20 |e W.16. |/* bits |
|00003d90| 69 6e 20 43 52 43 3a 31 | 36 09 31 36 09 31 36 09 |in CRC:1|6.16.16.|
|00003da0| 2a 2f 0a 0a 20 20 20 20 | 2f 2a 20 64 61 74 61 20 |*/.. |/* data |
|00003db0| 74 79 70 65 20 74 68 61 | 74 20 68 6f 6c 64 73 20 |type tha|t holds |
|00003dc0| 61 20 57 2d 62 69 74 20 | 75 6e 73 69 67 6e 65 64 |a W-bit |unsigned|
|00003dd0| 20 69 6e 74 65 67 65 72 | 20 2a 2f 0a 23 69 66 20 | integer| */.#if |
|00003de0| 57 20 3c 3d 20 31 36 0a | 23 20 20 64 65 66 69 6e |W <= 16.|# defin|
|00003df0| 65 20 57 54 59 50 45 09 | 75 6e 73 69 67 6e 65 64 |e WTYPE.|unsigned|
|00003e00| 20 73 68 6f 72 74 0a 23 | 65 6c 73 65 0a 23 20 20 | short.#|else.# |
|00003e10| 64 65 66 69 6e 65 20 57 | 54 59 50 45 20 20 20 75 |define W|TYPE u|
|00003e20| 6e 73 69 67 6e 65 64 20 | 6c 6f 6e 67 0a 23 65 6e |nsigned |long.#en|
|00003e30| 64 69 66 0a 0a 20 20 20 | 20 2f 2a 20 74 68 65 20 |dif.. | /* the |
|00003e40| 6e 75 6d 62 65 72 20 6f | 66 20 62 69 74 73 20 70 |number o|f bits p|
|00003e50| 65 72 20 63 68 61 72 3a | 20 64 6f 6e 27 74 20 63 |er char:| don't c|
|00003e60| 68 61 6e 67 65 20 69 74 | 2e 20 2a 2f 0a 23 64 65 |hange it|. */.#de|
|00003e70| 66 69 6e 65 20 42 09 38 | 0a 0a 73 74 61 74 69 63 |fine B.8|..static|
|00003e80| 20 57 54 59 50 45 20 63 | 72 63 74 61 62 5b 31 3c | WTYPE c|rctab[1<|
|00003e90| 3c 42 5d 20 3d 20 2f 2a | 20 61 73 20 63 61 6c 63 |<B] = /*| as calc|
|00003ea0| 75 6c 61 74 65 64 20 62 | 79 20 69 6e 69 74 63 72 |ulated b|y initcr|
|00003eb0| 63 74 61 62 28 29 20 2a | 2f 20 7b 0a 30 78 30 2c |ctab() *|/ {.0x0,|
|00003ec0| 20 20 30 78 63 30 63 31 | 2c 20 20 30 78 63 31 38 | 0xc0c1|, 0xc18|
|00003ed0| 31 2c 20 20 30 78 31 34 | 30 2c 20 20 30 78 63 33 |1, 0x14|0, 0xc3|
|00003ee0| 30 31 2c 20 20 30 78 33 | 63 30 2c 20 20 30 78 32 |01, 0x3|c0, 0x2|
|00003ef0| 38 30 2c 20 20 30 78 63 | 32 34 31 2c 0a 30 78 63 |80, 0xc|241,.0xc|
|00003f00| 36 30 31 2c 20 20 30 78 | 36 63 30 2c 20 20 30 78 |601, 0x|6c0, 0x|
|00003f10| 37 38 30 2c 20 20 30 78 | 63 37 34 31 2c 20 20 30 |780, 0x|c741, 0|
|00003f20| 78 35 30 30 2c 20 20 30 | 78 63 35 63 31 2c 20 20 |x500, 0|xc5c1, |
|00003f30| 30 78 63 34 38 31 2c 20 | 20 30 78 34 34 30 2c 0a |0xc481, | 0x440,.|
|00003f40| 30 78 63 63 30 31 2c 20 | 20 30 78 63 63 30 2c 20 |0xcc01, | 0xcc0, |
|00003f50| 20 30 78 64 38 30 2c 20 | 20 30 78 63 64 34 31 2c | 0xd80, | 0xcd41,|
|00003f60| 20 20 30 78 66 30 30 2c | 20 20 30 78 63 66 63 31 | 0xf00,| 0xcfc1|
|00003f70| 2c 20 20 30 78 63 65 38 | 31 2c 20 20 30 78 65 34 |, 0xce8|1, 0xe4|
|00003f80| 30 2c 0a 30 78 61 30 30 | 2c 20 20 30 78 63 61 63 |0,.0xa00|, 0xcac|
|00003f90| 31 2c 20 20 30 78 63 62 | 38 31 2c 20 20 30 78 62 |1, 0xcb|81, 0xb|
|00003fa0| 34 30 2c 20 20 30 78 63 | 39 30 31 2c 20 20 30 78 |40, 0xc|901, 0x|
|00003fb0| 39 63 30 2c 20 20 30 78 | 38 38 30 2c 20 20 30 78 |9c0, 0x|880, 0x|
|00003fc0| 63 38 34 31 2c 0a 30 78 | 64 38 30 31 2c 20 20 30 |c841,.0x|d801, 0|
|00003fd0| 78 31 38 63 30 2c 20 20 | 30 78 31 39 38 30 2c 20 |x18c0, |0x1980, |
|00003fe0| 20 30 78 64 39 34 31 2c | 20 20 30 78 31 62 30 30 | 0xd941,| 0x1b00|
|00003ff0| 2c 20 20 30 78 64 62 63 | 31 2c 20 20 30 78 64 61 |, 0xdbc|1, 0xda|
|00004000| 38 31 2c 20 20 30 78 31 | 61 34 30 2c 0a 30 78 31 |81, 0x1|a40,.0x1|
|00004010| 65 30 30 2c 20 20 30 78 | 64 65 63 31 2c 20 20 30 |e00, 0x|dec1, 0|
|00004020| 78 64 66 38 31 2c 20 20 | 30 78 31 66 34 30 2c 20 |xdf81, |0x1f40, |
|00004030| 20 30 78 64 64 30 31 2c | 20 20 30 78 31 64 63 30 | 0xdd01,| 0x1dc0|
|00004040| 2c 20 20 30 78 31 63 38 | 30 2c 20 20 30 78 64 63 |, 0x1c8|0, 0xdc|
|00004050| 34 31 2c 0a 30 78 31 34 | 30 30 2c 20 20 30 78 64 |41,.0x14|00, 0xd|
|00004060| 34 63 31 2c 20 20 30 78 | 64 35 38 31 2c 20 20 30 |4c1, 0x|d581, 0|
|00004070| 78 31 35 34 30 2c 20 20 | 30 78 64 37 30 31 2c 20 |x1540, |0xd701, |
|00004080| 20 30 78 31 37 63 30 2c | 20 20 30 78 31 36 38 30 | 0x17c0,| 0x1680|
|00004090| 2c 20 20 30 78 64 36 34 | 31 2c 0a 30 78 64 32 30 |, 0xd64|1,.0xd20|
|000040a0| 31 2c 20 20 30 78 31 32 | 63 30 2c 20 20 30 78 31 |1, 0x12|c0, 0x1|
|000040b0| 33 38 30 2c 20 20 30 78 | 64 33 34 31 2c 20 20 30 |380, 0x|d341, 0|
|000040c0| 78 31 31 30 30 2c 20 20 | 30 78 64 31 63 31 2c 20 |x1100, |0xd1c1, |
|000040d0| 20 30 78 64 30 38 31 2c | 20 20 30 78 31 30 34 30 | 0xd081,| 0x1040|
|000040e0| 2c 0a 30 78 66 30 30 31 | 2c 20 20 30 78 33 30 63 |,.0xf001|, 0x30c|
|000040f0| 30 2c 20 20 30 78 33 31 | 38 30 2c 20 20 30 78 66 |0, 0x31|80, 0xf|
|00004100| 31 34 31 2c 20 20 30 78 | 33 33 30 30 2c 20 20 30 |141, 0x|3300, 0|
|00004110| 78 66 33 63 31 2c 20 20 | 30 78 66 32 38 31 2c 20 |xf3c1, |0xf281, |
|00004120| 20 30 78 33 32 34 30 2c | 0a 30 78 33 36 30 30 2c | 0x3240,|.0x3600,|
|00004130| 20 20 30 78 66 36 63 31 | 2c 20 20 30 78 66 37 38 | 0xf6c1|, 0xf78|
|00004140| 31 2c 20 20 30 78 33 37 | 34 30 2c 20 20 30 78 66 |1, 0x37|40, 0xf|
|00004150| 35 30 31 2c 20 20 30 78 | 33 35 63 30 2c 20 20 30 |501, 0x|35c0, 0|
|00004160| 78 33 34 38 30 2c 20 20 | 30 78 66 34 34 31 2c 0a |x3480, |0xf441,.|
|00004170| 30 78 33 63 30 30 2c 20 | 20 30 78 66 63 63 31 2c |0x3c00, | 0xfcc1,|
|00004180| 20 20 30 78 66 64 38 31 | 2c 20 20 30 78 33 64 34 | 0xfd81|, 0x3d4|
|00004190| 30 2c 20 20 30 78 66 66 | 30 31 2c 20 20 30 78 33 |0, 0xff|01, 0x3|
|000041a0| 66 63 30 2c 20 20 30 78 | 33 65 38 30 2c 20 20 30 |fc0, 0x|3e80, 0|
|000041b0| 78 66 65 34 31 2c 0a 30 | 78 66 61 30 31 2c 20 20 |xfe41,.0|xfa01, |
|000041c0| 30 78 33 61 63 30 2c 20 | 20 30 78 33 62 38 30 2c |0x3ac0, | 0x3b80,|
|000041d0| 20 20 30 78 66 62 34 31 | 2c 20 20 30 78 33 39 30 | 0xfb41|, 0x390|
|000041e0| 30 2c 20 20 30 78 66 39 | 63 31 2c 20 20 30 78 66 |0, 0xf9|c1, 0xf|
|000041f0| 38 38 31 2c 20 20 30 78 | 33 38 34 30 2c 0a 30 78 |881, 0x|3840,.0x|
|00004200| 32 38 30 30 2c 20 20 30 | 78 65 38 63 31 2c 20 20 |2800, 0|xe8c1, |
|00004210| 30 78 65 39 38 31 2c 20 | 20 30 78 32 39 34 30 2c |0xe981, | 0x2940,|
|00004220| 20 20 30 78 65 62 30 31 | 2c 20 20 30 78 32 62 63 | 0xeb01|, 0x2bc|
|00004230| 30 2c 20 20 30 78 32 61 | 38 30 2c 20 20 30 78 65 |0, 0x2a|80, 0xe|
|00004240| 61 34 31 2c 0a 30 78 65 | 65 30 31 2c 20 20 30 78 |a41,.0xe|e01, 0x|
|00004250| 32 65 63 30 2c 20 20 30 | 78 32 66 38 30 2c 20 20 |2ec0, 0|x2f80, |
|00004260| 30 78 65 66 34 31 2c 20 | 20 30 78 32 64 30 30 2c |0xef41, | 0x2d00,|
|00004270| 20 20 30 78 65 64 63 31 | 2c 20 20 30 78 65 63 38 | 0xedc1|, 0xec8|
|00004280| 31 2c 20 20 30 78 32 63 | 34 30 2c 0a 30 78 65 34 |1, 0x2c|40,.0xe4|
|00004290| 30 31 2c 20 20 30 78 32 | 34 63 30 2c 20 20 30 78 |01, 0x2|4c0, 0x|
|000042a0| 32 35 38 30 2c 20 20 30 | 78 65 35 34 31 2c 20 20 |2580, 0|xe541, |
|000042b0| 30 78 32 37 30 30 2c 20 | 20 30 78 65 37 63 31 2c |0x2700, | 0xe7c1,|
|000042c0| 20 20 30 78 65 36 38 31 | 2c 20 20 30 78 32 36 34 | 0xe681|, 0x264|
|000042d0| 30 2c 0a 30 78 32 32 30 | 30 2c 20 20 30 78 65 32 |0,.0x220|0, 0xe2|
|000042e0| 63 31 2c 20 20 30 78 65 | 33 38 31 2c 20 20 30 78 |c1, 0xe|381, 0x|
|000042f0| 32 33 34 30 2c 20 20 30 | 78 65 31 30 31 2c 20 20 |2340, 0|xe101, |
|00004300| 30 78 32 31 63 30 2c 20 | 20 30 78 32 30 38 30 2c |0x21c0, | 0x2080,|
|00004310| 20 20 30 78 65 30 34 31 | 2c 0a 30 78 61 30 30 31 | 0xe041|,.0xa001|
|00004320| 2c 20 20 30 78 36 30 63 | 30 2c 20 20 30 78 36 31 |, 0x60c|0, 0x61|
|00004330| 38 30 2c 20 20 30 78 61 | 31 34 31 2c 20 20 30 78 |80, 0xa|141, 0x|
|00004340| 36 33 30 30 2c 20 20 30 | 78 61 33 63 31 2c 20 20 |6300, 0|xa3c1, |
|00004350| 30 78 61 32 38 31 2c 20 | 20 30 78 36 32 34 30 2c |0xa281, | 0x6240,|
|00004360| 0a 30 78 36 36 30 30 2c | 20 20 30 78 61 36 63 31 |.0x6600,| 0xa6c1|
|00004370| 2c 20 20 30 78 61 37 38 | 31 2c 20 20 30 78 36 37 |, 0xa78|1, 0x67|
|00004380| 34 30 2c 20 20 30 78 61 | 35 30 31 2c 20 20 30 78 |40, 0xa|501, 0x|
|00004390| 36 35 63 30 2c 20 20 30 | 78 36 34 38 30 2c 20 20 |65c0, 0|x6480, |
|000043a0| 30 78 61 34 34 31 2c 0a | 30 78 36 63 30 30 2c 20 |0xa441,.|0x6c00, |
|000043b0| 20 30 78 61 63 63 31 2c | 20 20 30 78 61 64 38 31 | 0xacc1,| 0xad81|
|000043c0| 2c 20 20 30 78 36 64 34 | 30 2c 20 20 30 78 61 66 |, 0x6d4|0, 0xaf|
|000043d0| 30 31 2c 20 20 30 78 36 | 66 63 30 2c 20 20 30 78 |01, 0x6|fc0, 0x|
|000043e0| 36 65 38 30 2c 20 20 30 | 78 61 65 34 31 2c 0a 30 |6e80, 0|xae41,.0|
|000043f0| 78 61 61 30 31 2c 20 20 | 30 78 36 61 63 30 2c 20 |xaa01, |0x6ac0, |
|00004400| 20 30 78 36 62 38 30 2c | 20 20 30 78 61 62 34 31 | 0x6b80,| 0xab41|
|00004410| 2c 20 20 30 78 36 39 30 | 30 2c 20 20 30 78 61 39 |, 0x690|0, 0xa9|
|00004420| 63 31 2c 20 20 30 78 61 | 38 38 31 2c 20 20 30 78 |c1, 0xa|881, 0x|
|00004430| 36 38 34 30 2c 0a 30 78 | 37 38 30 30 2c 20 20 30 |6840,.0x|7800, 0|
|00004440| 78 62 38 63 31 2c 20 20 | 30 78 62 39 38 31 2c 20 |xb8c1, |0xb981, |
|00004450| 20 30 78 37 39 34 30 2c | 20 20 30 78 62 62 30 31 | 0x7940,| 0xbb01|
|00004460| 2c 20 20 30 78 37 62 63 | 30 2c 20 20 30 78 37 61 |, 0x7bc|0, 0x7a|
|00004470| 38 30 2c 20 20 30 78 62 | 61 34 31 2c 0a 30 78 62 |80, 0xb|a41,.0xb|
|00004480| 65 30 31 2c 20 20 30 78 | 37 65 63 30 2c 20 20 30 |e01, 0x|7ec0, 0|
|00004490| 78 37 66 38 30 2c 20 20 | 30 78 62 66 34 31 2c 20 |x7f80, |0xbf41, |
|000044a0| 20 30 78 37 64 30 30 2c | 20 20 30 78 62 64 63 31 | 0x7d00,| 0xbdc1|
|000044b0| 2c 20 20 30 78 62 63 38 | 31 2c 20 20 30 78 37 63 |, 0xbc8|1, 0x7c|
|000044c0| 34 30 2c 0a 30 78 62 34 | 30 31 2c 20 20 30 78 37 |40,.0xb4|01, 0x7|
|000044d0| 34 63 30 2c 20 20 30 78 | 37 35 38 30 2c 20 20 30 |4c0, 0x|7580, 0|
|000044e0| 78 62 35 34 31 2c 20 20 | 30 78 37 37 30 30 2c 20 |xb541, |0x7700, |
|000044f0| 20 30 78 62 37 63 31 2c | 20 20 30 78 62 36 38 31 | 0xb7c1,| 0xb681|
|00004500| 2c 20 20 30 78 37 36 34 | 30 2c 0a 30 78 37 32 30 |, 0x764|0,.0x720|
|00004510| 30 2c 20 20 30 78 62 32 | 63 31 2c 20 20 30 78 62 |0, 0xb2|c1, 0xb|
|00004520| 33 38 31 2c 20 20 30 78 | 37 33 34 30 2c 20 20 30 |381, 0x|7340, 0|
|00004530| 78 62 31 30 31 2c 20 20 | 30 78 37 31 63 30 2c 20 |xb101, |0x71c0, |
|00004540| 20 30 78 37 30 38 30 2c | 20 20 30 78 62 30 34 31 | 0x7080,| 0xb041|
|00004550| 2c 0a 30 78 35 30 30 30 | 2c 20 20 30 78 39 30 63 |,.0x5000|, 0x90c|
|00004560| 31 2c 20 20 30 78 39 31 | 38 31 2c 20 20 30 78 35 |1, 0x91|81, 0x5|
|00004570| 31 34 30 2c 20 20 30 78 | 39 33 30 31 2c 20 20 30 |140, 0x|9301, 0|
|00004580| 78 35 33 63 30 2c 20 20 | 30 78 35 32 38 30 2c 20 |x53c0, |0x5280, |
|00004590| 20 30 78 39 32 34 31 2c | 0a 30 78 39 36 30 31 2c | 0x9241,|.0x9601,|
|000045a0| 20 20 30 78 35 36 63 30 | 2c 20 20 30 78 35 37 38 | 0x56c0|, 0x578|
|000045b0| 30 2c 20 20 30 78 39 37 | 34 31 2c 20 20 30 78 35 |0, 0x97|41, 0x5|
|000045c0| 35 30 30 2c 20 20 30 78 | 39 35 63 31 2c 20 20 30 |500, 0x|95c1, 0|
|000045d0| 78 39 34 38 31 2c 20 20 | 30 78 35 34 34 30 2c 0a |x9481, |0x5440,.|
|000045e0| 30 78 39 63 30 31 2c 20 | 20 30 78 35 63 63 30 2c |0x9c01, | 0x5cc0,|
|000045f0| 20 20 30 78 35 64 38 30 | 2c 20 20 30 78 39 64 34 | 0x5d80|, 0x9d4|
|00004600| 31 2c 20 20 30 78 35 66 | 30 30 2c 20 20 30 78 39 |1, 0x5f|00, 0x9|
|00004610| 66 63 31 2c 20 20 30 78 | 39 65 38 31 2c 20 20 30 |fc1, 0x|9e81, 0|
|00004620| 78 35 65 34 30 2c 0a 30 | 78 35 61 30 30 2c 20 20 |x5e40,.0|x5a00, |
|00004630| 30 78 39 61 63 31 2c 20 | 20 30 78 39 62 38 31 2c |0x9ac1, | 0x9b81,|
|00004640| 20 20 30 78 35 62 34 30 | 2c 20 20 30 78 39 39 30 | 0x5b40|, 0x990|
|00004650| 31 2c 20 20 30 78 35 39 | 63 30 2c 20 20 30 78 35 |1, 0x59|c0, 0x5|
|00004660| 38 38 30 2c 20 20 30 78 | 39 38 34 31 2c 0a 30 78 |880, 0x|9841,.0x|
|00004670| 38 38 30 31 2c 20 20 30 | 78 34 38 63 30 2c 20 20 |8801, 0|x48c0, |
|00004680| 30 78 34 39 38 30 2c 20 | 20 30 78 38 39 34 31 2c |0x4980, | 0x8941,|
|00004690| 20 20 30 78 34 62 30 30 | 2c 20 20 30 78 38 62 63 | 0x4b00|, 0x8bc|
|000046a0| 31 2c 20 20 30 78 38 61 | 38 31 2c 20 20 30 78 34 |1, 0x8a|81, 0x4|
|000046b0| 61 34 30 2c 0a 30 78 34 | 65 30 30 2c 20 20 30 78 |a40,.0x4|e00, 0x|
|000046c0| 38 65 63 31 2c 20 20 30 | 78 38 66 38 31 2c 20 20 |8ec1, 0|x8f81, |
|000046d0| 30 78 34 66 34 30 2c 20 | 20 30 78 38 64 30 31 2c |0x4f40, | 0x8d01,|
|000046e0| 20 20 30 78 34 64 63 30 | 2c 20 20 30 78 34 63 38 | 0x4dc0|, 0x4c8|
|000046f0| 30 2c 20 20 30 78 38 63 | 34 31 2c 0a 30 78 34 34 |0, 0x8c|41,.0x44|
|00004700| 30 30 2c 20 20 30 78 38 | 34 63 31 2c 20 20 30 78 |00, 0x8|4c1, 0x|
|00004710| 38 35 38 31 2c 20 20 30 | 78 34 35 34 30 2c 20 20 |8581, 0|x4540, |
|00004720| 30 78 38 37 30 31 2c 20 | 20 30 78 34 37 63 30 2c |0x8701, | 0x47c0,|
|00004730| 20 20 30 78 34 36 38 30 | 2c 20 20 30 78 38 36 34 | 0x4680|, 0x864|
|00004740| 31 2c 0a 30 78 38 32 30 | 31 2c 20 20 30 78 34 32 |1,.0x820|1, 0x42|
|00004750| 63 30 2c 20 20 30 78 34 | 33 38 30 2c 20 20 30 78 |c0, 0x4|380, 0x|
|00004760| 38 33 34 31 2c 20 20 30 | 78 34 31 30 30 2c 20 20 |8341, 0|x4100, |
|00004770| 30 78 38 31 63 31 2c 20 | 20 30 78 38 30 38 31 2c |0x81c1, | 0x8081,|
|00004780| 20 20 30 78 34 30 34 30 | 2c 0a 7d 20 3b 0a 0a 57 | 0x4040|,.} ;..W|
|00004790| 54 59 50 45 0a 75 70 64 | 63 72 63 28 20 69 63 72 |TYPE.upd|crc( icr|
|000047a0| 63 2c 20 69 63 70 2c 20 | 69 63 6e 74 20 29 0a 20 |c, icp, |icnt ). |
|000047b0| 20 20 20 57 54 59 50 45 | 20 69 63 72 63 3b 0a 20 | WTYPE| icrc;. |
|000047c0| 20 20 20 75 6e 73 69 67 | 6e 65 64 20 63 68 61 72 | unsig|ned char|
|000047d0| 20 2a 69 63 70 3b 0a 20 | 20 20 20 69 6e 74 20 69 | *icp;. | int i|
|000047e0| 63 6e 74 3b 0a 7b 0a 20 | 20 20 20 72 65 67 69 73 |cnt;.{. | regis|
|000047f0| 74 65 72 20 57 54 59 50 | 45 20 63 72 63 20 3d 20 |ter WTYP|E crc = |
|00004800| 69 63 72 63 3b 0a 20 20 | 20 20 72 65 67 69 73 74 |icrc;. | regist|
|00004810| 65 72 20 75 6e 73 69 67 | 6e 65 64 20 63 68 61 72 |er unsig|ned char|
|00004820| 20 2a 63 70 20 3d 20 69 | 63 70 3b 0a 20 20 20 20 | *cp = i|cp;. |
|00004830| 72 65 67 69 73 74 65 72 | 20 69 6e 74 20 63 6e 74 |register| int cnt|
|00004840| 20 3d 20 69 63 6e 74 3b | 0a 0a 20 20 20 20 77 68 | = icnt;|.. wh|
|00004850| 69 6c 65 28 20 63 6e 74 | 2d 2d 20 29 20 7b 0a 23 |ile( cnt|-- ) {.#|
|00004860| 69 66 6e 64 65 66 20 53 | 57 41 50 50 45 44 0a 09 |ifndef S|WAPPED..|
|00004870| 63 72 63 20 3d 20 28 63 | 72 63 3c 3c 42 29 20 5e |crc = (c|rc<<B) ^|
|00004880| 20 63 72 63 74 61 62 5b | 28 63 72 63 3e 3e 28 57 | crctab[|(crc>>(W|
|00004890| 2d 42 29 29 20 5e 20 2a | 63 70 2b 2b 5d 3b 0a 23 |-B)) ^ *|cp++];.#|
|000048a0| 65 6c 73 65 0a 09 63 72 | 63 20 3d 20 28 63 72 63 |else..cr|c = (crc|
|000048b0| 3e 3e 42 29 20 5e 20 63 | 72 63 74 61 62 5b 28 63 |>>B) ^ c|rctab[(c|
|000048c0| 72 63 20 26 20 28 28 31 | 3c 3c 42 29 2d 31 29 29 |rc & ((1|<<B)-1))|
|000048d0| 20 5e 20 2a 63 70 2b 2b | 5d 3b 20 0a 23 65 6e 64 | ^ *cp++|]; .#end|
|000048e0| 69 66 20 53 57 41 50 50 | 45 44 0a 20 20 20 20 7d |if SWAPP|ED. }|
|000048f0| 0a 0a 20 20 20 20 72 65 | 74 75 72 6e 28 20 63 72 |.. re|turn( cr|
|00004900| 63 20 29 3b 0a 7d 0a 0a | 23 69 66 64 65 66 20 4d |c );.}..|#ifdef M|
|00004910| 41 4b 45 54 41 42 0a 0a | 23 69 6e 63 6c 75 64 65 |AKETAB..|#include|
|00004920| 20 3c 73 74 64 69 6f 2e | 68 3e 0a 6d 61 69 6e 28 | <stdio.|h>.main(|
|00004930| 29 0a 7b 0a 20 20 20 20 | 69 6e 69 74 63 72 63 74 |).{. |initcrct|
|00004940| 61 62 28 29 3b 0a 7d 0a | 0a 69 6e 69 74 63 72 63 |ab();.}.|.initcrc|
|00004950| 74 61 62 28 29 0a 7b 0a | 20 20 20 20 72 65 67 69 |tab().{.| regi|
|00004960| 73 74 65 72 20 20 69 6e | 74 20 62 2c 20 69 3b 0a |ster in|t b, i;.|
|00004970| 20 20 20 20 57 54 59 50 | 45 20 76 3b 0a 0a 20 20 | WTYP|E v;.. |
|00004980| 20 20 0a 20 20 20 20 66 | 6f 72 28 20 62 20 3d 20 | . f|or( b = |
|00004990| 30 3b 20 62 20 3c 3d 20 | 28 31 3c 3c 42 29 2d 31 |0; b <= |(1<<B)-1|
|000049a0| 3b 20 2b 2b 62 20 29 20 | 7b 0a 23 69 66 6e 64 65 |; ++b ) |{.#ifnde|
|000049b0| 66 20 53 57 41 50 50 45 | 44 0a 09 66 6f 72 28 20 |f SWAPPE|D..for( |
|000049c0| 76 20 3d 20 62 3c 3c 28 | 57 2d 42 29 2c 20 69 20 |v = b<<(|W-B), i |
|000049d0| 3d 20 42 3b 20 2d 2d 69 | 20 3e 3d 20 30 3b 20 29 |= B; --i| >= 0; )|
|000049e0| 0a 09 20 20 20 20 76 20 | 3d 20 76 20 26 20 28 28 |.. v |= v & ((|
|000049f0| 57 54 59 50 45 29 31 3c | 3c 28 57 2d 31 29 29 20 |WTYPE)1<|<(W-1)) |
|00004a00| 3f 20 28 76 3c 3c 31 29 | 5e 50 20 3a 20 76 3c 3c |? (v<<1)|^P : v<<|
|00004a10| 31 3b 0a 23 65 6c 73 65 | 0a 09 66 6f 72 28 20 76 |1;.#else|..for( v|
|00004a20| 20 3d 20 62 2c 20 69 20 | 3d 20 42 3b 20 2d 2d 69 | = b, i |= B; --i|
|00004a30| 20 3e 3d 20 30 3b 20 29 | 0a 09 20 20 20 20 76 20 | >= 0; )|.. v |
|00004a40| 3d 20 76 20 26 20 31 20 | 3f 20 28 76 3e 3e 31 29 |= v & 1 |? (v>>1)|
|00004a50| 5e 50 20 3a 20 76 3e 3e | 31 3b 0a 23 65 6e 64 69 |^P : v>>|1;.#endi|
|00004a60| 66 09 20 20 20 20 0a 09 | 63 72 63 74 61 62 5b 62 |f. ..|crctab[b|
|00004a70| 5d 20 3d 20 76 3b 0a 0a | 09 70 72 69 6e 74 66 28 |] = v;..|.printf(|
|00004a80| 20 22 30 78 25 6c 78 2c | 22 2c 20 76 20 26 20 28 | "0x%lx,|", v & (|
|00004a90| 28 31 4c 3c 3c 57 29 2d | 31 4c 29 29 3b 0a 09 69 |(1L<<W)-|1L));..i|
|00004aa0| 66 28 20 28 62 26 37 29 | 20 3d 3d 20 37 20 29 0a |f( (b&7)| == 7 ).|
|00004ab0| 09 20 20 20 20 70 72 69 | 6e 74 66 28 22 5c 6e 22 |. pri|ntf("\n"|
|00004ac0| 20 29 3b 0a 09 65 6c 73 | 65 0a 09 20 20 20 20 70 | );..els|e.. p|
|00004ad0| 72 69 6e 74 66 28 22 20 | 20 22 29 3b 0a 20 20 20 |rintf(" | ");. |
|00004ae0| 20 7d 0a 7d 0a 23 65 6e | 64 69 66 0a 0a 23 69 66 | }.}.#en|dif..#if|
|00004af0| 64 65 66 20 54 45 53 54 | 0a 0a 23 69 6e 63 6c 75 |def TEST|..#inclu|
|00004b00| 64 65 20 3c 73 74 64 69 | 6f 2e 68 3e 0a 23 69 6e |de <stdi|o.h>.#in|
|00004b10| 63 6c 75 64 65 20 3c 66 | 63 6e 74 6c 2e 68 3e 0a |clude <f|cntl.h>.|
|00004b20| 0a 23 64 65 66 69 6e 65 | 20 4d 41 58 42 55 46 09 |.#define| MAXBUF.|
|00004b30| 34 30 39 36 0a 0a 0a 0a | 6d 61 69 6e 28 20 61 63 |4096....|main( ac|
|00004b40| 2c 20 61 76 20 29 0a 20 | 20 20 20 69 6e 74 20 61 |, av ). | int a|
|00004b50| 63 3b 20 63 68 61 72 20 | 2a 2a 61 76 3b 0a 7b 0a |c; char |**av;.{.|
|00004b60| 20 20 20 20 69 6e 74 20 | 66 64 3b 0a 20 20 20 20 | int |fd;. |
|00004b70| 69 6e 74 20 6e 72 3b 0a | 20 20 20 20 69 6e 74 20 |int nr;.| int |
|00004b80| 69 3b 0a 20 20 20 20 63 | 68 61 72 20 62 75 66 5b |i;. c|har buf[|
|00004b90| 4d 41 58 42 55 46 5d 3b | 0a 20 20 20 20 57 54 59 |MAXBUF];|. WTY|
|00004ba0| 50 45 20 63 72 63 2c 20 | 63 72 63 32 3b 0a 0a 20 |PE crc, |crc2;.. |
|00004bb0| 20 20 20 66 64 20 3d 20 | 30 3b 0a 20 20 20 20 69 | fd = |0;. i|
|00004bc0| 66 28 20 61 63 20 3e 20 | 31 20 29 0a 09 69 66 28 |f( ac > |1 )..if(|
|00004bd0| 20 28 66 64 20 3d 20 6f | 70 65 6e 28 20 61 76 5b | (fd = o|pen( av[|
|00004be0| 31 5d 2c 20 4f 5f 52 44 | 4f 4e 4c 59 20 29 29 20 |1], O_RD|ONLY )) |
|00004bf0| 3c 20 30 20 29 20 7b 0a | 09 20 20 20 20 70 65 72 |< 0 ) {.|. per|
|00004c00| 72 6f 72 28 20 61 76 5b | 31 5d 20 29 3b 0a 09 20 |ror( av[|1] );.. |
|00004c10| 20 20 20 65 78 69 74 28 | 20 2d 31 20 29 3b 0a 09 | exit(| -1 );..|
|00004c20| 7d 0a 20 20 20 20 63 72 | 63 20 3d 20 63 72 63 32 |}. cr|c = crc2|
|00004c30| 20 3d 20 49 4e 49 54 5f | 43 52 43 3b 0a 0a 20 20 | = INIT_|CRC;.. |
|00004c40| 20 20 77 68 69 6c 65 28 | 20 28 6e 72 20 3d 20 72 | while(| (nr = r|
|00004c50| 65 61 64 28 20 66 64 2c | 20 62 75 66 2c 20 4d 41 |ead( fd,| buf, MA|
|00004c60| 58 42 55 46 20 29 29 20 | 3e 20 30 20 29 20 7b 0a |XBUF )) |> 0 ) {.|
|00004c70| 09 63 72 63 20 3d 20 75 | 70 64 63 72 63 28 20 63 |.crc = u|pdcrc( c|
|00004c80| 72 63 2c 20 62 75 66 2c | 20 6e 72 20 29 3b 0a 20 |rc, buf,| nr );. |
|00004c90| 20 20 20 7d 0a 0a 20 20 | 20 20 69 66 28 20 6e 72 | }.. | if( nr|
|00004ca0| 20 21 3d 20 30 20 29 0a | 09 70 65 72 72 6f 72 28 | != 0 ).|.perror(|
|00004cb0| 20 22 72 65 61 64 69 6e | 67 22 20 29 3b 0a 20 20 | "readin|g" );. |
|00004cc0| 20 20 65 6c 73 65 20 7b | 0a 09 70 72 69 6e 74 66 | else {|..printf|
|00004cd0| 28 20 22 25 6c 78 5c 6e | 22 2c 20 63 72 63 20 29 |( "%lx\n|", crc )|
|00004ce0| 3b 0a 20 20 20 20 7d 0a | 0a 23 69 66 64 65 66 20 |;. }.|.#ifdef |
|00004cf0| 4d 41 47 49 43 43 48 45 | 43 4b 0a 20 20 20 20 2f |MAGICCHE|CK. /|
|00004d00| 2a 20 74 61 63 6b 20 6f | 6e 65 27 73 20 63 6f 6d |* tack o|ne's com|
|00004d10| 70 6c 65 6d 65 6e 74 20 | 6f 66 20 63 72 63 20 6f |plement |of crc o|
|00004d20| 6e 74 6f 20 64 61 74 61 | 20 73 74 72 65 61 6d 2c |nto data| stream,|
|00004d30| 20 61 6e 64 0a 20 20 20 | 20 20 20 20 63 6f 6e 74 | and. | cont|
|00004d40| 69 6e 75 65 20 63 72 63 | 20 63 61 6c 63 75 6c 61 |inue crc| calcula|
|00004d50| 74 69 6f 6e 2e 20 20 53 | 68 6f 75 6c 64 20 67 65 |tion. S|hould ge|
|00004d60| 74 20 61 20 63 6f 6e 73 | 74 61 6e 74 20 28 6d 61 |t a cons|tant (ma|
|00004d70| 67 69 63 20 6e 75 6d 62 | 65 72 29 0a 20 20 20 20 |gic numb|er). |
|00004d80| 20 20 20 64 65 70 65 6e | 64 65 6e 74 20 6f 6e 6c | depen|dent onl|
|00004d90| 79 20 6f 6e 20 50 2c 20 | 6e 6f 74 20 74 68 65 20 |y on P, |not the |
|00004da0| 64 61 74 61 2e 0a 20 20 | 20 20 20 2a 2f 0a 20 20 |data.. | */. |
|00004db0| 20 20 63 72 63 32 20 3d | 20 63 72 63 20 5e 20 2d | crc2 =| crc ^ -|
|00004dc0| 31 4c 3b 0a 20 20 20 20 | 66 6f 72 28 20 6e 72 20 |1L;. |for( nr |
|00004dd0| 3d 20 57 2d 42 3b 20 6e | 72 20 3e 3d 20 30 3b 20 |= W-B; n|r >= 0; |
|00004de0| 6e 72 20 2d 3d 20 42 20 | 29 20 7b 0a 09 62 75 66 |nr -= B |) {..buf|
|00004df0| 5b 30 5d 20 3d 20 28 63 | 72 63 32 20 3e 3e 20 6e |[0] = (c|rc2 >> n|
|00004e00| 72 29 3b 0a 09 63 72 63 | 20 3d 20 75 70 64 63 72 |r);..crc| = updcr|
|00004e10| 63 28 63 72 63 2c 20 62 | 75 66 2c 20 31 29 3b 0a |c(crc, b|uf, 1);.|
|00004e20| 20 20 20 20 7d 0a 0a 20 | 20 20 20 2f 2a 20 63 72 | }.. | /* cr|
|00004e30| 63 20 73 68 6f 75 6c 64 | 20 6e 6f 77 20 65 71 75 |c should| now equ|
|00004e40| 61 6c 20 6d 61 67 69 63 | 20 2a 2f 0a 20 20 20 20 |al magic| */. |
|00004e50| 62 75 66 5b 30 5d 20 3d | 20 62 75 66 5b 31 5d 20 |buf[0] =| buf[1] |
|00004e60| 3d 20 62 75 66 5b 32 5d | 20 3d 20 62 75 66 5b 33 |= buf[2]| = buf[3|
|00004e70| 5d 20 3d 20 30 3b 0a 20 | 20 20 20 70 72 69 6e 74 |] = 0;. | print|
|00004e80| 66 28 20 22 6d 61 67 69 | 63 20 74 65 73 74 3a 20 |f( "magi|c test: |
|00004e90| 25 6c 78 20 3d 3f 3d 20 | 25 6c 78 5c 6e 22 2c 20 |%lx =?= |%lx\n", |
|00004ea0| 63 72 63 2c 20 75 70 64 | 63 72 63 28 2d 31 2c 20 |crc, upd|crc(-1, |
|00004eb0| 62 75 66 2c 20 57 2f 42 | 29 29 3b 0a 23 65 6e 64 |buf, W/B|));.#end|
|00004ec0| 69 66 20 4d 41 47 49 43 | 43 48 45 43 4b 0a 7d 0a |if MAGIC|CHECK.}.|
|00004ed0| 0a 23 65 6e 64 69 66 0a | 6d 65 28 26 62 73 29 3b |.#endif.|me(&bs);|
|00004ee0| 0a 09 09 74 64 69 66 66 | 20 3d 20 54 49 4d 45 44 |...tdiff| = TIMED|
|00004ef0| 49 46 46 20 2d 20 74 69 | 6d 65 7a 6f 6e 65 3b 0a |IFF - ti|mezone;.|
|00004f00| 09 09 69 66 20 28 74 70 | 2d 3e 74 6d 5f 69 73 64 |..if (tp|->tm_isd|
|00004f10| 73 74 29 0a 09 09 09 74 | 64 69 66 66 20 2b 3d 20 |st)....t|diff += |
|00004f20| 36 30 20 2a 20 36 30 3b | 0a 23 65 6e 64 69 66 0a |60 * 60;|.#endif.|
|00004f30| 09 09 63 70 34 28 73 74 | 2e 73 74 5f 63 74 69 6d |..cp4(st|.st_ctim|
|00004f40| 65 20 2b 20 74 64 69 66 | 66 2c 20 66 68 2e 63 44 |e + tdif|f, fh.cD|
|00004f50| 61 74 65 29 3b 0a 09 09 | 63 70 34 28 73 74 2e 73 |ate);...|cp4(st.s|
|00004f60| 74 5f 6d 74 69 6d 65 20 | 2b 20 74 64 69 66 66 2c |t_mtime |+ tdiff,|
|00004f70| 20 66 68 2e 6d 44 61 74 | 65 29 3b 0a 09 7d 0a 09 | fh.mDat|e);..}..|
|00004f80| 63 6c 6f 73 65 28 66 64 | 29 3b 0a 09 69 66 20 28 |close(fd|);..if (|
|00004f90| 72 6d 66 69 6c 65 73 29 | 20 75 6e 6c 69 6e 6b 28 |rmfiles)| unlink(|
|00004fa0| 6e 62 75 66 29 3b 09 2f | 2a 20 69 67 6e 6f 72 65 |nbuf);./|* ignore|
|00004fb0| 20 65 72 72 6f 72 73 20 | 2a 2f 0a 0a 09 63 72 63 | errors |*/...crc|
|00004fc0| 20 3d 20 75 70 64 63 72 | 63 28 30 2c 26 66 68 2c | = updcr|c(0,&fh,|
|00004fd0| 28 73 69 7a 65 6f 66 20 | 66 68 29 2d 32 29 3b 0a |(sizeof |fh)-2);.|
|00004fe0| 09 63 70 32 28 63 72 63 | 2c 20 66 68 2e 68 64 72 |.cp2(crc|, fh.hdr|
|00004ff0| 43 52 43 29 3b 0a 0a 09 | 66 70 6f 73 32 20 3d 20 |CRC);...|fpos2 = |
|00005000| 73 69 74 2f 6d 61 63 62 | 69 6e 66 69 6c 74 2e 63 |sit/macb|infilt.c|
|00005010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005040| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005060| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 32 |.... 6|44 . 2|
|00005070| 34 33 20 00 20 20 20 20 | 31 32 20 00 20 20 20 20 |43 . |12 . |
|00005080| 20 20 20 37 30 36 36 20 | 20 34 34 30 34 33 33 34 | 7066 | 4404334|
|00005090| 31 30 32 20 20 20 37 31 | 35 37 00 20 00 00 00 00 |102 71|57. ....|
|000050a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000050b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000050c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000050d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000050e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000050f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005100| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|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| 2f 2a 0a 20 2a 20 6d 61 | 63 62 69 6e 66 69 6c 74 |/*. * ma|cbinfilt|
|00005210| 20 2d 2d 20 66 69 6c 74 | 65 72 73 20 75 73 65 6e | -- filt|ers usen|
|00005220| 65 74 20 61 72 74 69 63 | 6c 65 73 20 66 72 6f 6d |et artic|les from|
|00005230| 20 63 6f 6d 70 2e 62 69 | 6e 61 72 69 65 73 2e 6d | comp.bi|naries.m|
|00005240| 61 63 20 69 6e 74 6f 20 | 61 20 66 6f 72 6d 0a 20 |ac into |a form. |
|00005250| 2a 20 20 73 75 69 74 61 | 62 6c 65 20 66 6f 72 20 |* suita|ble for |
|00005260| 78 62 69 6e 20 74 6f 20 | 64 65 63 6f 64 65 2e 20 |xbin to |decode. |
|00005270| 20 57 69 6c 6c 20 72 65 | 61 72 61 6e 67 65 20 70 | Will re|arange p|
|00005280| 61 72 74 73 20 6f 66 20 | 66 69 6c 65 20 69 66 20 |arts of |file if |
|00005290| 74 68 65 79 20 61 72 65 | 20 6e 6f 74 0a 20 2a 20 |they are| not. * |
|000052a0| 20 69 6e 20 6f 72 64 65 | 72 2e 20 20 53 74 72 69 | in orde|r. Stri|
|000052b0| 70 73 20 6f 75 74 20 61 | 6c 6c 20 65 78 74 72 61 |ps out a|ll extra|
|000052c0| 6e 65 6f 75 73 20 6c 69 | 6e 65 73 2e 0a 20 2a 20 |neous li|nes.. * |
|000052d0| 20 44 6f 65 73 20 61 6c | 6c 20 6f 66 20 74 68 69 | Does al|l of thi|
|000052e0| 73 20 62 79 20 6d 61 6b | 69 6e 67 20 6d 61 6e 79 |s by mak|ing many|
|000052f0| 20 62 6f 6c 64 20 61 73 | 73 75 6d 74 69 6f 6e 73 | bold as|sumtions|
|00005300| 2d 2d 62 75 74 20 69 74 | 27 73 20 77 6f 72 6b 65 |--but it|'s worke|
|00005310| 64 20 73 6f 20 66 61 72 | 2e 0a 20 2a 0a 20 2a 20 |d so far|.. *. * |
|00005320| 20 4f 6e 6c 79 20 77 6f | 72 6b 73 20 6f 6e 20 6f | Only wo|rks on o|
|00005330| 6e 65 20 61 72 74 69 63 | 6c 65 20 61 74 20 61 20 |ne artic|le at a |
|00005340| 74 69 6d 65 2e 20 20 41 | 6c 6c 20 66 69 6c 65 73 |time. A|ll files|
|00005350| 20 6f 6e 20 74 68 65 20 | 69 6e 70 75 74 20 6c 69 | on the |input li|
|00005360| 6e 65 20 61 72 65 0a 20 | 2a 20 20 63 6f 6e 73 69 |ne are. |* consi|
|00005370| 64 65 72 65 64 20 70 61 | 72 74 73 20 6f 66 20 74 |dered pa|rts of t|
|00005380| 68 65 20 73 61 6d 65 20 | 61 72 74 69 63 6c 65 2e |he same |article.|
|00005390| 0a 20 2a 0a 20 2a 20 20 | 49 66 20 79 6f 75 20 68 |. *. * |If you h|
|000053a0| 61 76 65 20 74 68 65 20 | 73 79 73 56 20 72 65 67 |ave the |sysV reg|
|000053b0| 75 61 6c 61 72 20 65 78 | 70 72 65 73 73 69 6f 6e |ualar ex|pression|
|000053c0| 20 72 6f 75 74 69 6e 65 | 73 20 28 72 65 67 63 6d | routine|s (regcm|
|000053d0| 70 2c 20 72 65 67 65 78 | 29 20 74 68 65 6e 0a 20 |p, regex|) then. |
|000053e0| 2a 20 20 64 65 66 69 6e | 65 20 48 41 56 45 5f 52 |* defin|e HAVE_R|
|000053f0| 45 47 43 4d 50 20 66 6f | 72 20 61 20 6d 6f 72 65 |EGCMP fo|r a more|
|00005400| 20 72 6f 62 75 73 74 20 | 70 61 74 74 65 72 6e 20 | robust |pattern |
|00005410| 6d 61 74 63 68 2e 0a 20 | 2a 0a 20 2a 20 20 2d 2d |match.. |*. * --|
|00005420| 54 6f 6d 20 42 65 72 65 | 69 74 65 72 0a 20 2a 20 |Tom Bere|iter. * |
|00005430| 20 20 20 2e 2e 21 7b 72 | 75 74 67 65 72 73 2c 61 | ..!{r|utgers,a|
|00005440| 6d 65 73 7d 21 63 73 2e | 75 74 65 78 61 73 2e 65 |mes}!cs.|utexas.e|
|00005450| 64 75 21 68 61 6c 6c 65 | 79 21 72 6f 6c 65 78 21 |du!halle|y!rolex!|
|00005460| 74 77 62 0a 20 2a 2f 0a | 23 69 6e 63 6c 75 64 65 |twb. */.|#include|
|00005470| 20 3c 73 74 64 69 6f 2e | 68 3e 0a 0a 69 6e 74 20 | <stdio.|h>..int |
|00005480| 63 75 72 5f 70 61 72 74 | 2c 70 61 72 74 2c 64 69 |cur_part|,part,di|
|00005490| 76 65 72 74 5f 70 61 72 | 74 3b 0a 69 6e 74 20 6d |vert_par|t;.int m|
|000054a0| 61 78 5f 70 61 72 74 3b | 0a 23 64 65 66 69 6e 65 |ax_part;|.#define|
|000054b0| 20 49 42 55 46 53 5a 09 | 35 31 32 0a 63 68 61 72 | IBUFSZ.|512.char|
|000054c0| 20 69 62 75 66 5b 49 42 | 55 46 53 5a 5d 3b 0a 63 | ibuf[IB|UFSZ];.c|
|000054d0| 68 61 72 20 70 6e 61 6d | 65 5b 38 30 5d 3b 0a 46 |har pnam|e[80];.F|
|000054e0| 49 4c 45 20 2a 6f 66 73 | 3d 73 74 64 6f 75 74 3b |ILE *ofs|=stdout;|
|000054f0| 0a 46 49 4c 45 20 2a 73 | 61 76 65 6f 66 73 3b 0a |.FILE *s|aveofs;.|
|00005500| 46 49 4c 45 20 2a 70 61 | 72 74 73 5b 31 30 30 5d |FILE *pa|rts[100]|
|00005510| 3b 0a 0a 23 69 66 64 65 | 66 20 48 41 56 45 5f 52 |;..#ifde|f HAVE_R|
|00005520| 45 47 43 4d 50 0a 23 64 | 65 66 69 6e 65 20 45 58 |EGCMP.#d|efine EX|
|00005530| 50 20 22 2e 2a 5b 50 70 | 5d 5b 41 61 5d 5b 52 72 |P ".*[Pp|][Aa][Rr|
|00005540| 5d 5b 54 74 5d 5b 20 5c | 74 5d 2a 28 5b 30 2d 39 |][Tt][ \|t]*([0-9|
|00005550| 5d 2b 29 24 30 5b 20 5c | 74 5d 2a 5b 4f 6f 5d 5b |]+)$0[ \|t]*[Oo][|
|00005560| 46 66 5d 5b 20 5c 74 5d | 2a 28 5b 30 2d 39 5d 2b |Ff][ \t]|*([0-9]+|
|00005570| 29 24 31 22 0a 23 65 6c | 73 65 0a 23 64 65 66 69 |)$1".#el|se.#defi|
|00005580| 6e 65 20 45 58 50 20 22 | 70 61 72 74 20 25 64 20 |ne EXP "|part %d |
|00005590| 6f 66 20 25 64 22 0a 23 | 65 6e 64 69 66 0a 63 68 |of %d".#|endif.ch|
|000055a0| 61 72 20 2a 65 78 70 3b | 0a 0a 6d 61 69 6e 28 61 |ar *exp;|..main(a|
|000055b0| 72 67 63 2c 61 72 67 76 | 29 20 63 68 61 72 20 2a |rgc,argv|) char *|
|000055c0| 2a 61 72 67 76 5b 5d 3b | 20 7b 0a 09 46 49 4c 45 |*argv[];| {..FILE|
|000055d0| 20 2a 66 73 3b 0a 09 69 | 6e 74 20 69 2c 72 63 3d | *fs;..i|nt i,rc=|
|000055e0| 30 3b 0a 0a 23 69 66 64 | 65 66 20 48 41 56 45 5f |0;..#ifd|ef HAVE_|
|000055f0| 52 45 47 43 4d 50 0a 09 | 65 78 70 20 3d 20 28 63 |REGCMP..|exp = (c|
|00005600| 68 61 72 20 2a 29 72 65 | 67 63 6d 70 28 45 58 50 |har *)re|gcmp(EXP|
|00005610| 2c 30 29 3b 0a 23 65 6c | 73 65 0a 09 65 78 70 20 |,0);.#el|se..exp |
|00005620| 3d 20 45 58 50 3b 0a 23 | 65 6e 64 69 66 0a 0a 09 |= EXP;.#|endif...|
|00005630| 66 70 75 74 73 28 22 28 | 54 68 69 73 20 66 69 6c |fputs("(|This fil|
|00005640| 65 20 6d 75 73 74 20 62 | 65 20 63 6f 6e 76 65 72 |e must b|e conver|
|00005650| 74 65 64 20 77 69 74 68 | 20 42 69 6e 48 65 78 20 |ted with| BinHex |
|00005660| 34 2e 30 29 5c 6e 5c 6e | 22 2c 6f 66 73 29 3b 0a |4.0)\n\n|",ofs);.|
|00005670| 0a 09 69 66 20 28 61 72 | 67 63 20 3d 3d 20 31 29 |..if (ar|gc == 1)|
|00005680| 0a 09 09 66 69 6c 74 65 | 72 28 73 74 64 69 6e 29 |...filte|r(stdin)|
|00005690| 3b 0a 09 65 6c 73 65 20 | 77 68 69 6c 65 20 28 2d |;..else |while (-|
|000056a0| 2d 61 72 67 63 29 20 7b | 0a 09 09 69 66 20 28 28 |-argc) {|...if ((|
|000056b0| 66 73 3d 66 6f 70 65 6e | 28 2a 2b 2b 61 72 67 76 |fs=fopen|(*++argv|
|000056c0| 2c 22 72 22 29 29 3d 3d | 4e 55 4c 4c 29 20 7b 0a |,"r"))==|NULL) {.|
|000056d0| 09 09 09 70 65 72 72 6f | 72 28 2a 61 72 67 76 29 |...perro|r(*argv)|
|000056e0| 3b 20 65 78 69 74 28 2d | 31 29 3b 20 7d 0a 09 09 |; exit(-|1); }...|
|000056f0| 66 69 6c 74 65 72 28 66 | 73 29 3b 0a 09 09 66 63 |filter(f|s);...fc|
|00005700| 6c 6f 73 65 28 66 73 29 | 3b 0a 09 7d 0a 09 2f 2a |lose(fs)|;..}../*|
|00005710| 20 61 64 64 20 61 6e 79 | 20 72 65 6d 61 69 6e 69 | add any| remaini|
|00005720| 6e 67 20 70 61 72 74 73 | 20 2a 2f 0a 09 66 6f 72 |ng parts| */..for|
|00005730| 20 28 69 3d 63 75 72 5f | 70 61 72 74 2b 31 3b 20 | (i=cur_|part+1; |
|00005740| 69 3c 3d 6d 61 78 5f 70 | 61 72 74 3b 20 69 2b 2b |i<=max_p|art; i++|
|00005750| 29 0a 09 09 69 66 20 28 | 70 61 72 74 73 5b 69 5d |)...if (|parts[i]|
|00005760| 29 0a 09 09 09 70 75 74 | 70 61 72 74 28 69 29 3b |)....put|part(i);|
|00005770| 0a 09 09 65 6c 73 65 20 | 7b 0a 09 09 09 66 70 72 |...else |{....fpr|
|00005780| 69 6e 74 66 28 73 74 64 | 65 72 72 2c 22 4d 69 73 |intf(std|err,"Mis|
|00005790| 73 69 6e 67 20 70 61 72 | 74 20 25 64 5c 6e 22 2c |sing par|t %d\n",|
|000057a0| 69 29 3b 0a 09 09 09 72 | 63 20 3d 20 2d 31 3b 0a |i);....r|c = -1;.|
|000057b0| 09 09 7d 0a 09 65 78 69 | 74 28 72 63 29 3b 0a 7d |..}..exi|t(rc);.}|
|000057c0| 0a 0a 2f 2a 20 76 61 6c | 69 64 20 78 62 69 6e 20 |../* val|id xbin |
|000057d0| 63 68 61 72 73 20 2b 20 | 27 5c 6e 27 20 61 6e 64 |chars + |'\n' and|
|000057e0| 20 27 5c 72 27 20 2a 2f | 0a 23 64 65 66 69 6e 65 | '\r' */|.#define|
|000057f0| 09 42 74 73 74 28 69 29 | 20 28 62 6d 61 70 5b 69 |.Btst(i)| (bmap[i|
|00005800| 3e 3e 33 5d 20 26 20 28 | 31 3c 3c 28 69 26 30 37 |>>3] & (|1<<(i&07|
|00005810| 29 29 29 0a 63 68 61 72 | 20 62 6d 61 70 5b 5d 3d |))).char| bmap[]=|
|00005820| 7b 30 78 30 30 2c 30 78 | 32 34 2c 30 78 30 30 2c |{0x00,0x|24,0x00,|
|00005830| 30 78 30 30 2c 30 78 66 | 65 2c 30 78 33 66 2c 30 |0x00,0xf|e,0x3f,0|
|00005840| 78 37 66 2c 30 78 30 37 | 2c 0a 09 09 09 20 30 78 |x7f,0x07|,.... 0x|
|00005850| 66 66 2c 30 78 37 66 2c | 30 78 37 66 2c 30 78 30 |ff,0x7f,|0x7f,0x0|
|00005860| 66 2c 30 78 37 66 2c 30 | 78 33 66 2c 30 78 30 37 |f,0x7f,0|x3f,0x07|
|00005870| 2c 30 78 30 30 7d 3b 0a | 0a 2f 2a 20 66 69 6c 74 |,0x00};.|./* filt|
|00005880| 65 72 20 6f 75 74 20 65 | 78 74 72 61 6e 65 6f 75 |er out e|xtraneou|
|00005890| 73 20 6c 69 6e 65 73 20 | 61 6e 64 20 6c 6f 6f 6b |s lines |and look|
|000058a0| 20 66 6f 72 20 6c 69 6e | 65 73 20 6f 66 20 74 68 | for lin|es of th|
|000058b0| 65 20 66 6f 72 6d 3a 0a | 20 2a 20 20 20 20 70 61 |e form:.| * pa|
|000058c0| 72 74 20 6e 20 6f 66 20 | 6d 0a 20 2a 20 41 20 6c |rt n of |m. * A l|
|000058d0| 69 6e 65 20 69 73 20 63 | 6f 6e 73 69 64 65 72 65 |ine is c|onsidere|
|000058e0| 64 20 76 61 6c 69 64 20 | 69 66 20 69 74 20 68 61 |d valid |if it ha|
|000058f0| 73 20 6f 6e 6c 79 20 76 | 61 6c 69 64 20 78 62 69 |s only v|alid xbi|
|00005900| 6e 20 63 68 61 72 61 63 | 74 65 72 73 20 61 6e 64 |n charac|ters and|
|00005910| 20 69 73 0a 20 2a 20 65 | 69 74 68 65 72 20 67 72 | is. * e|ither gr|
|00005920| 65 61 74 65 72 20 74 68 | 61 6e 20 36 30 20 63 68 |eater th|an 60 ch|
|00005930| 61 72 61 63 74 65 72 73 | 20 6f 72 20 65 6e 64 73 |aracters| or ends|
|00005940| 20 69 6e 20 61 20 27 3a | 27 0a 20 2a 2f 0a 0a 66 | in a ':|'. */..f|
|00005950| 69 6c 74 65 72 28 66 73 | 29 20 46 49 4c 45 20 2a |ilter(fs|) FILE *|
|00005960| 66 73 3b 20 7b 0a 09 72 | 65 67 69 73 74 65 72 20 |fs; {..r|egister |
|00005970| 63 68 61 72 20 2a 70 2c | 2a 69 6e 70 3b 0a 0a 72 |char *p,|*inp;..r|
|00005980| 65 67 65 74 3a 0a 09 77 | 68 69 6c 65 20 28 28 69 |eget:..w|hile ((i|
|00005990| 6e 70 3d 66 67 65 74 73 | 28 69 62 75 66 2c 49 42 |np=fgets|(ibuf,IB|
|000059a0| 55 46 53 5a 2c 66 73 29 | 29 29 20 7b 0a 09 09 66 |UFSZ,fs)|)) {...f|
|000059b0| 6f 72 20 28 70 3d 69 6e | 70 3b 20 2a 70 3b 20 70 |or (p=in|p; *p; p|
|000059c0| 2b 2b 29 0a 09 09 09 69 | 66 20 28 42 74 73 74 28 |++)....i|f (Btst(|
|000059d0| 2a 70 29 20 3d 3d 20 30 | 29 20 7b 09 2f 2a 20 69 |*p) == 0|) {./* i|
|000059e0| 6e 76 61 6c 69 64 20 63 | 68 61 72 61 63 74 65 72 |nvalid c|haracter|
|000059f0| 20 2a 2f 0a 09 09 09 09 | 63 68 65 63 6b 70 61 72 | */.....|checkpar|
|00005a00| 74 73 28 69 6e 70 29 3b | 0a 09 09 09 09 67 6f 74 |ts(inp);|.....got|
|00005a10| 6f 20 72 65 67 65 74 3b | 0a 09 09 09 7d 0a 09 09 |o reget;|....}...|
|00005a20| 69 66 20 28 70 2d 69 6e | 70 20 3e 20 36 30 20 7c |if (p-in|p > 60 ||
|00005a30| 7c 20 69 6e 70 5b 28 70 | 2d 69 6e 70 29 2d 32 5d || inp[(p|-inp)-2]|
|00005a40| 3d 3d 27 3a 27 29 09 2f | 2a 20 61 72 62 69 74 72 |==':')./|* arbitr|
|00005a50| 61 72 79 20 6d 61 78 20 | 6f 72 20 65 6e 64 20 2a |ary max |or end *|
|00005a60| 2f 0a 09 09 09 66 70 75 | 74 73 28 69 62 75 66 2c |/....fpu|ts(ibuf,|
|00005a70| 6f 66 73 29 3b 0a 09 7d | 0a 09 69 66 20 28 64 69 |ofs);..}|..if (di|
|00005a80| 76 65 72 74 5f 70 61 72 | 74 29 09 2f 2a 20 64 69 |vert_par|t)./* di|
|00005a90| 76 65 72 73 69 6f 6e 20 | 69 6e 20 70 72 6f 67 72 |version |in progr|
|00005aa0| 65 73 73 20 2a 2f 0a 09 | 09 65 6e 64 5f 6f 73 65 |ess */..|.end_ose|
|00005ab0| 71 28 29 3b 0a 7d 0a 0a | 63 68 65 63 6b 70 61 72 |q();.}..|checkpar|
|00005ac0| 74 73 28 73 74 72 29 20 | 63 68 61 72 20 2a 73 74 |ts(str) |char *st|
|00005ad0| 72 3b 20 7b 0a 09 63 68 | 61 72 20 2a 70 3b 0a 09 |r; {..ch|ar *p;..|
|00005ae0| 63 68 61 72 20 6e 75 6d | 30 5b 34 30 5d 2c 20 6e |char num|0[40], n|
|00005af0| 75 6d 31 5b 34 30 5d 3b | 0a 0a 23 69 66 64 65 66 |um1[40];|..#ifdef|
|00005b00| 20 48 41 56 45 5f 52 45 | 47 45 58 50 0a 09 69 66 | HAVE_RE|GEXP..if|
|00005b10| 20 28 72 65 67 65 78 28 | 65 78 70 2c 20 73 74 72 | (regex(|exp, str|
|00005b20| 2c 20 6e 75 6d 30 2c 6e | 75 6d 31 29 21 3d 4e 55 |, num0,n|um1)!=NU|
|00005b30| 4c 4c 29 20 7b 0a 09 09 | 70 61 72 74 20 3d 20 61 |LL) {...|part = a|
|00005b40| 74 6f 69 28 6e 75 6d 30 | 29 3b 0a 09 09 6d 61 78 |toi(num0|);...max|
|00005b50| 5f 70 61 72 74 20 3d 20 | 61 74 6f 69 28 6e 75 6d |_part = |atoi(num|
|00005b60| 31 29 3b 0a 66 70 72 69 | 6e 74 66 28 73 74 64 65 |1);.fpri|ntf(stde|
|00005b70| 72 72 2c 22 70 61 72 74 | 20 25 64 20 6f 66 20 25 |rr,"part| %d of %|
|00005b80| 64 5c 6e 22 2c 70 61 72 | 74 2c 6d 61 78 5f 70 61 |d\n",par|t,max_pa|
|00005b90| 72 74 29 3b 0a 09 09 64 | 6f 70 61 72 74 28 29 3b |rt);...d|opart();|
|00005ba0| 0a 09 7d 0a 23 65 6c 73 | 65 0a 09 66 6f 72 20 28 |..}.#els|e..for (|
|00005bb0| 70 3d 73 74 72 3b 20 2a | 70 3b 20 70 2b 2b 29 09 |p=str; *|p; p++).|
|00005bc0| 2f 2a 20 72 65 73 63 61 | 6e 20 66 6f 72 20 27 70 |/* resca|n for 'p|
|00005bd0| 61 72 74 27 20 73 74 72 | 69 6e 67 20 2a 2f 0a 09 |art' str|ing */..|
|00005be0| 09 69 66 20 28 2a 70 3d | 3d 65 78 70 5b 30 5d 29 |.if (*p=|=exp[0])|
|00005bf0| 0a 09 09 09 69 66 20 28 | 73 73 63 61 6e 66 28 70 |....if (|sscanf(p|
|00005c00| 2c 65 78 70 2c 26 70 61 | 72 74 2c 26 6d 61 78 5f |,exp,&pa|rt,&max_|
|00005c10| 70 61 72 74 29 20 3d 3d | 20 32 29 20 7b 0a 09 09 |part) ==| 2) {...|
|00005c20| 09 09 64 6f 70 61 72 74 | 28 29 3b 0a 09 09 09 09 |..dopart|();.....|
|00005c30| 62 72 65 61 6b 3b 0a 09 | 09 09 7d 0a 23 65 6e 64 |break;..|..}.#end|
|00005c40| 69 66 0a 7d 0a 0a 64 6f | 70 61 72 74 28 29 20 7b |if.}..do|part() {|
|00005c50| 0a 09 69 66 20 28 64 69 | 76 65 72 74 5f 70 61 72 |..if (di|vert_par|
|00005c60| 74 29 20 7b 09 2f 2a 20 | 64 69 76 65 72 73 69 6f |t) {./* |diversio|
|00005c70| 6e 20 69 6e 20 70 72 6f | 67 72 65 73 73 20 2a 2f |n in pro|gress */|
|00005c80| 0a 09 09 69 66 20 28 70 | 61 72 74 20 3d 3d 20 64 |...if (p|art == d|
|00005c90| 69 76 65 72 74 5f 70 61 | 72 74 29 09 2f 2a 20 61 |ivert_pa|rt)./* a|
|00005ca0| 6e 6f 74 68 65 72 20 6d | 65 6e 74 69 6f 6e 20 6f |nother m|ention o|
|00005cb0| 66 20 63 75 72 72 65 6e | 74 20 70 61 72 74 20 2a |f curren|t part *|
|00005cc0| 2f 0a 09 09 09 72 65 74 | 75 72 6e 3b 0a 09 09 65 |/....ret|urn;...e|
|00005cd0| 6e 64 5f 6f 73 65 71 28 | 29 3b 0a 09 7d 0a 09 69 |nd_oseq(|);..}..i|
|00005ce0| 66 20 28 70 61 72 74 20 | 3d 3d 20 63 75 72 5f 70 |f (part |== cur_p|
|00005cf0| 61 72 74 2b 31 29 20 09 | 2f 2a 20 4f 4b 3a 20 6e |art+1) .|/* OK: n|
|00005d00| 65 78 74 20 69 6e 20 73 | 65 71 75 65 6e 63 65 20 |ext in s|equence |
|00005d10| 2a 2f 0a 09 09 63 75 72 | 5f 70 61 72 74 20 3d 20 |*/...cur|_part = |
|00005d20| 70 61 72 74 3b 0a 09 65 | 6c 73 65 20 69 66 20 28 |part;..e|lse if (|
|00005d30| 70 61 72 74 20 3e 20 63 | 75 72 5f 70 61 72 74 29 |part > c|ur_part)|
|00005d40| 20 09 2f 2a 20 6f 75 74 | 20 6f 66 20 73 65 71 75 | ./* out| of sequ|
|00005d50| 65 6e 63 65 20 2a 2f 0a | 09 09 6f 73 65 71 28 29 |ence */.|..oseq()|
|00005d60| 3b 0a 09 65 6c 73 65 20 | 09 2f 2a 20 22 63 61 6e |;..else |./* "can|
|00005d70| 27 74 22 20 68 61 70 70 | 65 6e 20 2a 2f 0a 09 09 |'t" happ|en */...|
|00005d80| 66 70 72 69 6e 74 66 28 | 73 74 64 65 72 72 2c 22 |fprintf(|stderr,"|
|00005d90| 50 61 72 74 20 25 64 20 | 75 6e 65 78 70 65 63 74 |Part %d |unexpect|
|00005da0| 65 64 5c 6e 22 2c 70 61 | 72 74 29 3b 0a 7d 0a 0a |ed\n",pa|rt);.}..|
|00005db0| 2f 2a 20 70 61 72 74 20 | 6f 75 74 20 6f 66 20 73 |/* part |out of s|
|00005dc0| 65 71 75 65 6e 63 65 20 | 2a 2f 0a 6f 73 65 71 28 |equence |*/.oseq(|
|00005dd0| 29 20 7b 0a 09 69 6e 74 | 20 69 3b 0a 0a 09 2f 2a |) {..int| i;.../*|
|00005de0| 20 74 72 79 20 61 6e 64 | 20 66 69 6c 6c 20 69 6e | try and| fill in|
|00005df0| 20 67 61 70 20 2a 2f 0a | 09 66 6f 72 20 28 69 3d | gap */.|.for (i=|
|00005e00| 63 75 72 5f 70 61 72 74 | 2b 31 3b 20 69 3c 70 61 |cur_part|+1; i<pa|
|00005e10| 72 74 3b 20 69 2b 2b 29 | 0a 09 09 69 66 20 28 70 |rt; i++)|...if (p|
|00005e20| 61 72 74 73 5b 69 5d 29 | 20 7b 0a 09 09 09 70 75 |arts[i])| {....pu|
|00005e30| 74 70 61 72 74 28 69 29 | 3b 0a 09 09 09 63 75 72 |tpart(i)|;....cur|
|00005e40| 5f 70 61 72 74 20 3d 20 | 69 3b 0a 09 09 7d 0a 09 |_part = |i;...}..|
|00005e50| 09 65 6c 73 65 20 67 6f | 74 6f 20 69 73 67 61 70 |.else go|to isgap|
|00005e60| 3b 0a 09 2f 2a 20 61 6c | 6c 20 6d 69 73 73 69 6e |;../* al|l missin|
|00005e70| 67 20 70 61 72 74 73 20 | 72 65 73 74 6f 72 65 64 |g parts |restored|
|00005e80| 20 2d 2d 20 63 6f 6e 74 | 69 6e 75 65 20 2a 2f 0a | -- cont|inue */.|
|00005e90| 09 72 65 74 75 72 6e 3b | 0a 69 73 67 61 70 3a 0a |.return;|.isgap:.|
|00005ea0| 09 2f 2a 20 73 74 61 72 | 74 20 64 69 76 65 72 73 |./* star|t divers|
|00005eb0| 69 6f 6e 20 2a 2f 0a 09 | 64 69 76 65 72 74 5f 70 |ion */..|divert_p|
|00005ec0| 61 72 74 20 3d 20 70 61 | 72 74 3b 0a 09 73 61 76 |art = pa|rt;..sav|
|00005ed0| 65 6f 66 73 20 3d 20 6f | 66 73 3b 0a 09 73 70 72 |eofs = o|fs;..spr|
|00005ee0| 69 6e 74 66 28 70 6e 61 | 6d 65 2c 22 70 61 72 74 |intf(pna|me,"part|
|00005ef0| 25 64 22 2c 70 61 72 74 | 29 3b 0a 09 69 66 20 28 |%d",part|);..if (|
|00005f00| 28 6f 66 73 20 3d 20 66 | 6f 70 65 6e 28 70 6e 61 |(ofs = f|open(pna|
|00005f10| 6d 65 2c 22 77 2b 22 29 | 29 20 3d 3d 20 4e 55 4c |me,"w+")|) == NUL|
|00005f20| 4c 29 20 7b 0a 09 09 70 | 65 72 72 6f 72 28 70 6e |L) {...p|error(pn|
|00005f30| 61 6d 65 29 3b 20 65 78 | 69 74 28 2d 31 29 3b 20 |ame); ex|it(-1); |
|00005f40| 7d 0a 09 70 61 72 74 73 | 5b 70 61 72 74 5d 20 3d |}..parts|[part] =|
|00005f50| 20 6f 66 73 3b 0a 7d 0a | 65 6e 64 5f 6f 73 65 71 | ofs;.}.|end_oseq|
|00005f60| 28 29 20 7b 0a 09 64 69 | 76 65 72 74 5f 70 61 72 |() {..di|vert_par|
|00005f70| 74 20 3d 20 30 3b 0a 09 | 6f 66 73 20 3d 20 73 61 |t = 0;..|ofs = sa|
|00005f80| 76 65 6f 66 73 3b 0a 7d | 0a 0a 70 75 74 70 61 72 |veofs;.}|..putpar|
|00005f90| 74 28 6e 29 20 7b 0a 09 | 46 49 4c 45 20 2a 66 73 |t(n) {..|FILE *fs|
|00005fa0| 3b 0a 09 72 65 67 69 73 | 74 65 72 20 69 6e 74 20 |;..regis|ter int |
|00005fb0| 63 3b 0a 0a 09 66 73 20 | 3d 20 70 61 72 74 73 5b |c;...fs |= parts[|
|00005fc0| 6e 5d 3b 0a 09 72 65 77 | 69 6e 64 28 66 73 29 3b |n];..rew|ind(fs);|
|00005fd0| 0a 09 77 68 69 6c 65 20 | 28 28 63 3d 67 65 74 63 |..while |((c=getc|
|00005fe0| 28 66 73 29 29 21 3d 45 | 4f 46 29 0a 09 09 70 75 |(fs))!=E|OF)...pu|
|00005ff0| 74 63 28 63 2c 6f 66 73 | 29 3b 0a 09 66 63 6c 6f |tc(c,ofs|);..fclo|
|00006000| 73 65 28 66 73 29 3b 0a | 09 73 70 72 69 6e 74 66 |se(fs);.|.sprintf|
|00006010| 28 70 6e 61 6d 65 2c 22 | 70 61 72 74 25 64 22 2c |(pname,"|part%d",|
|00006020| 6e 29 3b 0a 09 75 6e 6c | 69 6e 6b 28 70 6e 61 6d |n);..unl|ink(pnam|
|00006030| 65 29 3b 0a 7d 0a 62 69 | 6e 61 72 69 65 73 2e 6d |e);.}.bi|naries.m|
|00006040| 61 63 20 69 6e 74 6f 20 | 61 20 66 6f 72 6d 0a 20 |ac into |a form. |
|00006050| 2a 20 20 73 75 69 74 61 | 62 6c 65 20 66 6f 72 20 |* suita|ble for |
|00006060| 78 62 69 6e 20 74 6f 20 | 64 65 63 6f 64 65 2e 20 |xbin to |decode. |
|00006070| 20 57 69 6c 6c 20 72 65 | 61 72 61 6e 67 65 20 70 | Will re|arange p|
|00006080| 61 72 74 73 20 6f 66 20 | 66 69 6c 65 20 69 66 20 |arts of |file if |
|00006090| 74 68 65 79 20 61 72 65 | 20 6e 6f 74 0a 20 2a 20 |they are| not. * |
|000060a0| 20 69 6e 20 6f 72 64 65 | 72 2e 20 20 53 74 72 69 | in orde|r. Stri|
|000060b0| 70 73 20 6f 75 74 20 61 | 6c 6c 20 65 78 74 72 61 |ps out a|ll extra|
|000060c0| 6e 65 6f 75 73 20 6c 69 | 6e 65 73 2e 0a 20 2a 20 |neous li|nes.. * |
|000060d0| 20 44 6f 65 73 20 61 6c | 6c 20 6f 66 20 74 68 69 | Does al|l of thi|
|000060e0| 73 20 62 79 20 6d 61 6b | 69 6e 67 20 6d 61 6e 79 |s by mak|ing many|
|000060f0| 20 62 6f 6c 64 20 61 73 | 73 75 6d 74 69 6f 6e 73 | bold as|sumtions|
|00006100| 2d 2d 62 75 74 20 69 74 | 27 73 20 77 6f 72 6b 65 |--but it|'s worke|
|00006110| 64 20 73 6f 20 66 61 72 | 2e 0a 20 2a 0a 20 2a 20 |d so far|.. *. * |
|00006120| 20 4f 6e 6c 79 20 77 6f | 72 6b 73 20 6f 6e 20 6f | Only wo|rks on o|
|00006130| 6e 65 20 61 72 74 69 63 | 6c 65 20 61 74 20 61 20 |ne artic|le at a |
|00006140| 74 69 6d 65 2e 20 20 41 | 6c 6c 20 66 69 6c 65 73 |time. A|ll files|
|00006150| 20 6f 6e 20 74 68 65 20 | 69 6e 70 75 74 20 6c 69 | on the |input li|
|00006160| 6e 65 20 61 72 65 0a 20 | 2a 20 20 63 6f 6e 73 69 |ne are. |* consi|
|00006170| 64 65 72 65 64 20 70 61 | 72 74 73 20 6f 66 20 74 |dered pa|rts of t|
|00006180| 68 65 20 73 61 6d 65 20 | 61 72 74 69 63 6c 65 2e |he same |article.|
|00006190| 0a 20 2a 0a 20 2a 20 20 | 49 66 20 79 6f 75 20 68 |. *. * |If you h|
|000061a0| 61 76 65 20 74 68 65 20 | 73 79 73 56 20 72 65 67 |ave the |sysV reg|
|000061b0| 75 61 6c 61 72 20 65 78 | 70 72 65 73 73 69 6f 6e |ualar ex|pression|
|000061c0| 20 72 6f 75 74 69 6e 65 | 73 20 28 72 65 67 63 6d | routine|s (regcm|
|000061d0| 70 2c 20 72 65 67 65 78 | 29 20 74 68 65 6e 0a 20 |p, regex|) then. |
|000061e0| 2a 20 20 64 65 66 69 6e | 65 20 48 41 56 45 5f 52 |* defin|e HAVE_R|
|000061f0| 45 47 43 4d 50 20 66 6f | 72 20 61 20 6d 6f 72 65 |EGCMP fo|r a more|
|00006200| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006210| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006220| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006230| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006260| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006270| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006280| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006290| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000062a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000062b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000062c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000062d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000062e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000062f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006300| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006310| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006320| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006330| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006340| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006350| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006380| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006390| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000063a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000063b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000063c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000063d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000063e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000063f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.