home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: SHell self-extracting ARchive
(archive/shar).
You can browse this item here: fcpio
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| SHell self-extracting ARchive (archive/shar)
| magic
| Supported |
100%
| dexvert
| Internet Message Format (text/imf)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| C source text
| default
| |
99%
| file
| C source, ASCII text
| default
| |
100%
| TrID
| E-Mail message (Var. 2)
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/329 Shell Archive Format
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
| |
100%
| xdgMime
| application/mbox
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 46 72 6f 6d 20 64 65 63 | 77 72 6c 21 6c 61 62 72 |From dec|wrl!labr|
|00000010| 65 61 21 72 75 74 67 65 | 72 73 21 6d 61 69 6c 72 |ea!rutge|rs!mailr|
|00000020| 75 73 21 74 75 74 2e 63 | 69 73 2e 6f 68 69 6f 2d |us!tut.c|is.ohio-|
|00000030| 73 74 61 74 65 2e 65 64 | 75 21 63 77 6a 63 63 21 |state.ed|u!cwjcc!|
|00000040| 68 61 6c 21 6e 63 6f 61 | 73 74 21 61 6c 6c 62 65 |hal!ncoa|st!allbe|
|00000050| 72 79 20 46 72 69 20 4f | 63 74 20 20 37 20 31 38 |ry Fri O|ct 7 18|
|00000060| 3a 35 34 3a 33 38 20 50 | 44 54 20 31 39 38 38 0a |:54:38 P|DT 1988.|
|00000070| 41 72 74 69 63 6c 65 20 | 36 36 30 20 6f 66 20 63 |Article |660 of c|
|00000080| 6f 6d 70 2e 73 6f 75 72 | 63 65 73 2e 6d 69 73 63 |omp.sour|ces.misc|
|00000090| 3a 0a 50 61 74 68 3a 20 | 67 72 61 6e 69 74 65 21 |:.Path: |granite!|
|000000a0| 64 65 63 77 72 6c 21 6c | 61 62 72 65 61 21 72 75 |decwrl!l|abrea!ru|
|000000b0| 74 67 65 72 73 21 6d 61 | 69 6c 72 75 73 21 74 75 |tgers!ma|ilrus!tu|
|000000c0| 74 2e 63 69 73 2e 6f 68 | 69 6f 2d 73 74 61 74 65 |t.cis.oh|io-state|
|000000d0| 2e 65 64 75 21 63 77 6a | 63 63 21 68 61 6c 21 6e |.edu!cwj|cc!hal!n|
|000000e0| 63 6f 61 73 74 21 61 6c | 6c 62 65 72 79 0a 46 72 |coast!al|lbery.Fr|
|000000f0| 6f 6d 3a 20 6a 6f 65 40 | 64 61 79 74 6f 6e 2e 44 |om: joe@|dayton.D|
|00000100| 48 44 53 43 2e 4d 4e 2e | 4f 52 47 20 28 4a 6f 73 |HDSC.MN.|ORG (Jos|
|00000110| 65 70 68 20 50 2e 20 4c | 61 72 73 6f 6e 29 0a 4e |eph P. L|arson).N|
|00000120| 65 77 73 67 72 6f 75 70 | 73 3a 20 63 6f 6d 70 2e |ewsgroup|s: comp.|
|00000130| 73 6f 75 72 63 65 73 2e | 6d 69 73 63 0a 53 75 62 |sources.|misc.Sub|
|00000140| 6a 65 63 74 3a 20 76 30 | 34 69 31 31 38 3a 20 66 |ject: v0|4i118: f|
|00000150| 63 70 69 6f 20 2d 20 61 | 20 66 61 73 74 20 63 70 |cpio - a| fast cp|
|00000160| 69 6f 20 70 61 72 74 69 | 61 6c 20 72 65 70 6c 61 |io parti|al repla|
|00000170| 63 65 6d 65 6e 74 0a 4d | 65 73 73 61 67 65 2d 49 |cement.M|essage-I|
|00000180| 44 3a 20 3c 38 38 31 30 | 30 35 30 39 35 34 2e 41 |D: <8810|050954.A|
|00000190| 41 32 37 32 36 39 40 64 | 61 79 74 6f 6e 2e 44 48 |A27269@d|ayton.DH|
|000001a0| 44 53 43 2e 4d 4e 2e 4f | 52 47 3e 0a 44 61 74 65 |DSC.MN.O|RG>.Date|
|000001b0| 3a 20 37 20 4f 63 74 20 | 38 38 20 30 30 3a 31 36 |: 7 Oct |88 00:16|
|000001c0| 3a 35 34 20 47 4d 54 0a | 53 65 6e 64 65 72 3a 20 |:54 GMT.|Sender: |
|000001d0| 61 6c 6c 62 65 72 79 40 | 6e 63 6f 61 73 74 2e 55 |allbery@|ncoast.U|
|000001e0| 55 43 50 0a 52 65 70 6c | 79 2d 54 6f 3a 20 6a 6f |UCP.Repl|y-To: jo|
|000001f0| 65 40 64 61 79 74 6f 6e | 2e 44 48 44 53 43 2e 4d |e@dayton|.DHDSC.M|
|00000200| 4e 2e 4f 52 47 20 28 4a | 6f 73 65 70 68 20 50 2e |N.ORG (J|oseph P.|
|00000210| 20 4c 61 72 73 6f 6e 29 | 0a 4c 69 6e 65 73 3a 20 | Larson)|.Lines: |
|00000220| 33 37 39 0a 41 70 70 72 | 6f 76 65 64 3a 20 61 6c |379.Appr|oved: al|
|00000230| 6c 62 65 72 79 40 6e 63 | 6f 61 73 74 2e 55 55 43 |lbery@nc|oast.UUC|
|00000240| 50 0a 0a 50 6f 73 74 69 | 6e 67 2d 6e 75 6d 62 65 |P..Posti|ng-numbe|
|00000250| 72 3a 20 56 6f 6c 75 6d | 65 20 34 2c 20 49 73 73 |r: Volum|e 4, Iss|
|00000260| 75 65 20 31 31 38 0a 53 | 75 62 6d 69 74 74 65 64 |ue 118.S|ubmitted|
|00000270| 2d 62 79 3a 20 22 4a 6f | 73 65 70 68 20 50 2e 20 |-by: "Jo|seph P. |
|00000280| 4c 61 72 73 6f 6e 22 20 | 3c 6a 6f 65 40 64 61 79 |Larson" |<joe@day|
|00000290| 74 6f 6e 2e 44 48 44 53 | 43 2e 4d 4e 2e 4f 52 47 |ton.DHDS|C.MN.ORG|
|000002a0| 3e 0a 41 72 63 68 69 76 | 65 2d 6e 61 6d 65 3a 20 |>.Archiv|e-name: |
|000002b0| 66 63 70 69 6f 0a 0a 49 | 6e 20 61 6e 79 20 63 61 |fcpio..I|n any ca|
|000002c0| 73 65 2c 20 49 20 77 72 | 6f 74 65 20 75 70 20 74 |se, I wr|ote up t|
|000002d0| 68 65 20 65 6e 63 6c 6f | 73 65 64 20 70 72 6f 67 |he enclo|sed prog|
|000002e0| 72 61 6d 20 6f 6e 65 20 | 64 61 79 20 77 68 65 6e |ram one |day when|
|000002f0| 20 49 20 67 6f 74 20 61 | 20 6c 69 74 74 6c 65 0a | I got a| little.|
|00000300| 74 6f 6f 20 61 6e 6e 6f | 79 65 64 20 77 69 74 68 |too anno|yed with|
|00000310| 20 63 70 69 6f 20 77 68 | 69 6c 65 20 64 65 61 6c | cpio wh|ile deal|
|00000320| 69 6e 67 20 77 69 74 68 | 20 73 6f 6d 65 20 72 61 |ing with| some ra|
|00000330| 74 68 65 72 20 6c 61 72 | 67 65 20 63 70 69 6f 20 |ther lar|ge cpio |
|00000340| 61 72 63 68 69 76 65 73 | 2e 0a 49 74 20 64 6f 65 |archives|..It doe|
|00000350| 73 6e 27 74 20 6e 65 65 | 64 20 61 20 6d 61 6b 65 |sn't nee|d a make|
|00000360| 66 69 6c 65 20 28 49 20 | 6a 75 73 74 20 73 61 79 |file (I |just say|
|00000370| 20 6d 61 6b 65 20 66 63 | 70 69 6f 29 2e 20 20 54 | make fc|pio). T|
|00000380| 68 65 20 74 77 6f 20 69 | 6e 63 6c 75 64 65 20 66 |he two i|nclude f|
|00000390| 69 6c 65 73 0a 61 72 65 | 20 66 72 6f 6d 20 6f 75 |iles.are| from ou|
|000003a0| 72 20 3c 64 61 79 74 6f | 6e 2f 3e 20 64 69 72 65 |r <dayto|n/> dire|
|000003b0| 63 74 6f 72 79 2c 20 73 | 6f 20 70 65 6f 70 6c 65 |ctory, s|o people|
|000003c0| 20 77 69 6c 6c 20 6e 65 | 65 64 20 74 6f 20 70 61 | will ne|ed to pa|
|000003d0| 74 63 68 20 74 68 65 20 | 2e 63 20 61 0a 6c 69 74 |tch the |.c a.lit|
|000003e0| 74 6c 65 20 74 6f 20 73 | 70 65 63 69 66 79 20 77 |tle to s|pecify w|
|000003f0| 68 65 72 65 20 74 68 65 | 73 65 20 63 61 6d 65 20 |here the|se came |
|00000400| 66 72 6f 6d 2e 20 20 28 | 54 68 65 79 20 41 52 45 |from. (|They ARE|
|00000410| 4e 27 54 20 72 65 70 6c | 61 63 65 6d 65 6e 74 73 |N'T repl|acements|
|00000420| 20 66 6f 72 0a 74 68 65 | 20 72 65 67 75 6c 61 72 | for.the| regular|
|00000430| 20 69 6e 63 6c 75 64 65 | 73 20 6f 66 20 74 68 65 | include|s of the|
|00000440| 20 73 61 6d 65 20 6e 61 | 6d 65 21 29 0a 0a 48 6f | same na|me!)..Ho|
|00000450| 70 65 20 73 6f 6d 65 6f | 6e 65 20 66 69 6e 64 73 |pe someo|ne finds|
|00000460| 20 74 68 69 73 20 75 73 | 65 66 75 6c 2e 20 20 2d | this us|eful. -|
|00000470| 4a 6f 65 0a 0a 0a 2d 2d | 2d 2d 43 75 74 20 48 65 |Joe...--|--Cut He|
|00000480| 72 65 2d 2d 2d 2d 0a 0a | 23 21 20 2f 62 69 6e 2f |re----..|#! /bin/|
|00000490| 73 68 0a 23 20 54 68 69 | 73 20 69 73 20 61 20 73 |sh.# Thi|s is a s|
|000004a0| 68 65 6c 6c 20 61 72 63 | 68 69 76 65 2c 20 6d 65 |hell arc|hive, me|
|000004b0| 61 6e 69 6e 67 3a 0a 23 | 20 31 2e 20 52 65 6d 6f |aning:.#| 1. Remo|
|000004c0| 76 65 20 65 76 65 72 79 | 74 68 69 6e 67 20 61 62 |ve every|thing ab|
|000004d0| 6f 76 65 20 74 68 65 20 | 23 21 20 2f 62 69 6e 2f |ove the |#! /bin/|
|000004e0| 73 68 20 6c 69 6e 65 2e | 0a 23 20 32 2e 20 53 61 |sh line.|.# 2. Sa|
|000004f0| 76 65 20 74 68 65 20 72 | 65 73 75 6c 74 69 6e 67 |ve the r|esulting|
|00000500| 20 74 65 78 74 20 69 6e | 20 61 20 66 69 6c 65 2e | text in| a file.|
|00000510| 0a 23 20 33 2e 20 45 78 | 65 63 75 74 65 20 74 68 |.# 3. Ex|ecute th|
|00000520| 65 20 66 69 6c 65 20 77 | 69 74 68 20 2f 62 69 6e |e file w|ith /bin|
|00000530| 2f 73 68 20 28 6e 6f 74 | 20 63 73 68 29 20 74 6f |/sh (not| csh) to|
|00000540| 20 63 72 65 61 74 65 3a | 0a 23 09 66 63 70 69 6f | create:|.#.fcpio|
|00000550| 2e 64 6f 63 0a 23 09 66 | 63 70 69 6f 2e 63 0a 23 |.doc.#.f|cpio.c.#|
|00000560| 09 6d 61 74 68 2e 68 0a | 23 09 73 74 64 74 79 70 |.math.h.|#.stdtyp|
|00000570| 2e 68 0a 23 20 54 68 69 | 73 20 61 72 63 68 69 76 |.h.# Thi|s archiv|
|00000580| 65 20 63 72 65 61 74 65 | 64 3a 20 57 65 64 20 4f |e create|d: Wed O|
|00000590| 63 74 20 20 35 20 30 39 | 3a 35 34 3a 30 31 20 31 |ct 5 09|:54:01 1|
|000005a0| 39 38 38 0a 65 78 70 6f | 72 74 20 50 41 54 48 3b |988.expo|rt PATH;|
|000005b0| 20 50 41 54 48 3d 2f 62 | 69 6e 3a 2f 75 73 72 2f | PATH=/b|in:/usr/|
|000005c0| 62 69 6e 3a 24 50 41 54 | 48 0a 69 66 20 74 65 73 |bin:$PAT|H.if tes|
|000005d0| 74 20 2d 66 20 27 66 63 | 70 69 6f 2e 64 6f 63 27 |t -f 'fc|pio.doc'|
|000005e0| 0a 74 68 65 6e 0a 09 65 | 63 68 6f 20 73 68 61 72 |.then..e|cho shar|
|000005f0| 3a 20 22 77 69 6c 6c 20 | 6e 6f 74 20 6f 76 65 72 |: "will |not over|
|00000600| 2d 77 72 69 74 65 20 65 | 78 69 73 74 69 6e 67 20 |-write e|xisting |
|00000610| 66 69 6c 65 20 27 66 63 | 70 69 6f 2e 64 6f 63 27 |file 'fc|pio.doc'|
|00000620| 22 0a 65 6c 73 65 0a 63 | 61 74 20 3c 3c 20 5c 53 |".else.c|at << \S|
|00000630| 48 41 52 5f 45 4f 46 20 | 3e 20 27 66 63 70 69 6f |HAR_EOF |> 'fcpio|
|00000640| 2e 64 6f 63 27 0a 50 52 | 4f 47 52 41 4d 3a 0a 0a |.doc'.PR|OGRAM:..|
|00000650| 09 66 63 70 69 6f 20 2d | 2d 20 61 20 66 61 73 74 |.fcpio -|- a fast|
|00000660| 20 63 70 69 6f 20 66 6f | 72 20 73 65 65 6b 61 62 | cpio fo|r seekab|
|00000670| 6c 65 20 64 65 76 69 63 | 65 73 0a 0a 0a 53 59 4e |le devic|es...SYN|
|00000680| 4f 50 53 49 53 3a 0a 0a | 09 66 63 70 69 6f 20 5b |OPSIS:..|.fcpio [|
|00000690| 2d 6f 70 74 69 6f 6e 73 | 5d 20 61 72 63 68 69 76 |-options|] archiv|
|000006a0| 65 2d 6e 61 6d 65 20 5b | 65 78 74 72 61 63 74 2d |e-name [|extract-|
|000006b0| 70 61 74 74 65 72 6e 31 | 20 5b 20 2e 2e 2e 20 65 |pattern1| [ ... e|
|000006c0| 78 74 72 61 63 74 2d 70 | 61 74 74 65 72 6e 6e 5d |xtract-p|atternn]|
|000006d0| 5d 0a 0a 09 4f 70 74 69 | 6f 6e 73 20 69 6d 70 6c |]...Opti|ons impl|
|000006e0| 65 6d 65 6e 74 65 64 20 | 74 6f 20 64 61 74 65 3a |emented |to date:|
|000006f0| 0a 0a 09 09 78 20 2d 20 | 65 78 74 72 61 63 74 20 |....x - |extract |
|00000700| 66 69 6c 65 73 0a 09 09 | 74 20 2d 20 74 61 62 6c |files...|t - tabl|
|00000710| 65 20 6f 66 20 63 6f 6e | 74 65 6e 74 73 0a 0a 0a |e of con|tents...|
|00000720| 44 45 53 43 52 49 50 54 | 49 4f 4e 3a 0a 0a 09 66 |DESCRIPT|ION:...f|
|00000730| 63 70 69 6f 20 69 73 20 | 61 20 70 61 72 74 69 61 |cpio is |a partia|
|00000740| 6c 20 63 70 69 6f 20 28 | 74 6d 20 4d 61 20 42 65 |l cpio (|tm Ma Be|
|00000750| 6c 6c 29 20 72 65 70 6c | 61 63 65 6d 65 6e 74 2e |ll) repl|acement.|
|00000760| 20 20 49 74 20 69 73 20 | 76 65 72 79 20 75 73 65 | It is |very use|
|00000770| 66 75 6c 0a 09 77 68 65 | 6e 20 70 65 72 66 6f 72 |ful..whe|n perfor|
|00000780| 6d 69 6e 67 20 65 78 74 | 72 61 63 74 73 20 6f 72 |ming ext|racts or|
|00000790| 20 72 65 74 72 69 65 76 | 69 6e 67 20 61 20 74 61 | retriev|ing a ta|
|000007a0| 62 6c 65 20 6f 66 20 63 | 6f 6e 74 65 6e 74 73 20 |ble of c|ontents |
|000007b0| 66 72 6f 6d 20 61 0a 09 | 64 69 73 6b 2d 72 65 73 |from a..|disk-res|
|000007c0| 69 64 65 6e 74 20 63 70 | 69 6f 20 61 72 63 68 69 |ident cp|io archi|
|000007d0| 76 65 2e 20 20 54 68 69 | 73 20 69 73 20 64 75 65 |ve. Thi|s is due|
|000007e0| 20 74 6f 20 75 73 65 20 | 6f 66 20 73 65 65 6b 73 | to use |of seeks|
|000007f0| 20 74 6f 20 73 6b 69 70 | 20 6f 76 65 72 0a 09 75 | to skip| over..u|
|00000800| 6e 77 61 6e 74 65 64 20 | 64 61 74 61 2e 20 20 28 |nwanted |data. (|
|00000810| 4f 75 72 20 63 6f 70 79 | 20 6f 66 20 63 70 69 6f |Our copy| of cpio|
|00000820| 20 72 65 61 64 73 20 74 | 68 72 6f 75 67 68 20 65 | reads t|hrough e|
|00000830| 76 65 72 79 74 68 69 6e | 67 20 61 73 20 69 74 20 |verythin|g as it |
|00000840| 6d 75 73 74 0a 09 61 73 | 73 75 6d 65 20 69 74 20 |must..as|sume it |
|00000850| 63 61 6e 27 74 20 73 65 | 65 6b 2e 29 20 20 54 68 |can't se|ek.) Th|
|00000860| 75 73 2c 20 61 20 2d 74 | 20 6f 6e 20 61 20 33 2e |us, a -t| on a 3.|
|00000870| 33 20 4d 65 67 20 66 69 | 6c 65 20 72 75 6e 73 20 |3 Meg fi|le runs |
|00000880| 61 74 20 6f 75 74 70 75 | 74 0a 09 28 39 36 30 30 |at outpu|t..(9600|
|00000890| 20 62 61 75 64 29 20 73 | 70 65 65 64 73 20 77 69 | baud) s|peeds wi|
|000008a0| 74 68 20 66 63 70 69 6f | 20 62 75 74 20 68 61 73 |th fcpio| but has|
|000008b0| 20 6c 6f 6e 67 20 70 61 | 75 73 65 73 20 77 69 74 | long pa|uses wit|
|000008c0| 68 20 63 70 69 6f 20 61 | 74 20 61 6c 6c 20 74 68 |h cpio a|t all th|
|000008d0| 65 0a 09 6c 6f 6e 67 20 | 28 3e 20 32 30 4b 29 20 |e..long |(> 20K) |
|000008e0| 66 69 6c 65 73 20 77 69 | 74 68 69 6e 20 74 68 65 |files wi|thin the|
|000008f0| 20 61 72 63 68 69 76 65 | 2e 20 20 41 6e 20 65 78 | archive|. An ex|
|00000900| 74 72 61 63 74 20 6f 66 | 20 61 20 66 65 77 20 69 |tract of| a few i|
|00000910| 74 65 6d 73 20 69 73 0a | 09 61 6c 73 6f 20 76 65 |tems is.|.also ve|
|00000920| 72 79 20 66 61 73 74 2e | 0a 0a 09 54 68 65 20 65 |ry fast.|...The e|
|00000930| 78 74 72 61 63 74 20 70 | 61 74 74 65 72 6e 73 20 |xtract p|atterns |
|00000940| 64 6f 20 6e 6f 74 20 73 | 75 70 70 6f 72 74 20 77 |do not s|upport w|
|00000950| 69 6c 64 20 63 61 72 64 | 69 6e 67 20 6f 72 20 61 |ild card|ing or a|
|00000960| 6e 79 74 68 69 6e 67 20 | 66 61 6e 63 79 20 2d 2d |nything |fancy --|
|00000970| 0a 09 66 63 70 69 6f 20 | 77 69 6c 6c 20 65 78 74 |..fcpio |will ext|
|00000980| 72 61 63 74 20 61 6e 79 | 20 66 69 6c 65 73 20 74 |ract any| files t|
|00000990| 68 61 74 20 62 65 67 69 | 6e 20 77 69 74 68 20 6f |hat begi|n with o|
|000009a0| 6e 65 20 6f 66 20 74 68 | 65 20 65 78 74 72 61 63 |ne of th|e extrac|
|000009b0| 74 20 70 61 74 74 65 72 | 6e 73 0a 09 28 6f 72 20 |t patter|ns..(or |
|000009c0| 61 6c 6c 20 66 69 6c 65 | 73 20 69 66 20 6e 6f 20 |all file|s if no |
|000009d0| 65 78 74 72 61 63 74 20 | 70 61 74 74 65 72 6e 20 |extract |pattern |
|000009e0| 69 73 20 73 70 65 63 69 | 66 69 65 64 29 2e 0a 0a |is speci|fied)...|
|000009f0| 0a 41 55 54 48 4f 52 3a | 0a 0a 09 4a 6f 65 20 4c |.AUTHOR:|...Joe L|
|00000a00| 61 72 73 6f 6e 0a 09 44 | 61 79 74 6f 6e 2d 48 75 |arson..D|ayton-Hu|
|00000a10| 64 73 6f 6e 20 44 65 70 | 61 72 74 6d 65 6e 74 20 |dson Dep|artment |
|00000a20| 53 74 6f 72 65 20 43 6f | 6d 70 61 6e 79 0a 09 37 |Store Co|mpany..7|
|00000a30| 30 30 20 4f 6e 20 74 68 | 65 20 4d 61 6c 6c 0a 09 |00 On th|e Mall..|
|00000a40| 4d 69 6e 6e 65 61 70 6f | 6c 69 73 2c 20 4d 69 6e |Minneapo|lis, Min|
|00000a50| 6e 65 73 6f 74 61 20 20 | 35 35 34 30 32 0a 0a 09 |nesota |55402...|
|00000a60| 36 31 32 2d 33 37 35 2d | 33 35 33 37 0a 0a 0a 42 |612-375-|3537...B|
|00000a70| 55 47 53 3a 0a 0a 09 31 | 2e 20 44 6f 65 73 20 6e |UGS:...1|. Does n|
|00000a80| 6f 74 20 73 75 70 70 6f | 72 74 20 6e 6f 6e 2d 73 |ot suppo|rt non-s|
|00000a90| 65 65 6b 61 62 6c 65 20 | 64 65 76 69 63 65 73 20 |eekable |devices |
|00000aa0| 28 6c 69 6b 65 20 70 69 | 70 65 73 3f 29 0a 09 32 |(like pi|pes?)..2|
|00000ab0| 2e 20 44 6f 65 73 20 6e | 6f 74 20 6d 61 69 6e 74 |. Does n|ot maint|
|00000ac0| 61 69 6e 20 74 68 65 20 | 66 69 6c 65 73 20 6f 72 |ain the |files or|
|00000ad0| 69 67 69 6e 61 6c 20 6d | 61 67 69 63 20 6e 75 6d |iginal m|agic num|
|00000ae0| 62 65 72 2c 20 55 49 44 | 20 6f 72 20 47 49 44 2e |ber, UID| or GID.|
|00000af0| 0a 09 33 2e 20 4d 61 79 | 20 6e 6f 74 20 68 61 6e |..3. May| not han|
|00000b00| 64 6c 65 20 67 61 72 62 | 61 67 65 20 61 74 20 74 |dle garb|age at t|
|00000b10| 68 65 20 65 6e 64 20 6f | 66 20 74 68 65 20 61 72 |he end o|f the ar|
|00000b20| 63 68 69 76 65 20 74 65 | 72 72 69 62 6c 79 20 77 |chive te|rribly w|
|00000b30| 65 6c 6c 2e 0a 09 09 28 | 4f 75 72 20 63 70 69 6f |ell....(|Our cpio|
|00000b40| 20 70 75 74 73 20 61 6e | 20 69 74 65 6d 20 63 61 | puts an| item ca|
|00000b50| 6c 6c 65 64 20 22 54 52 | 41 49 4c 45 52 21 21 21 |lled "TR|AILER!!!|
|00000b60| 22 20 61 74 20 74 68 65 | 20 65 6e 64 2c 20 73 6f |" at the| end, so|
|00000b70| 20 66 63 70 69 6f 0a 09 | 09 65 71 75 61 74 65 73 | fcpio..|.equates|
|00000b80| 20 74 68 61 74 20 77 69 | 74 68 20 45 4f 46 20 61 | that wi|th EOF a|
|00000b90| 73 20 77 65 6c 6c 20 61 | 73 20 65 6e 64 69 6e 67 |s well a|s ending|
|00000ba0| 20 6f 6e 20 45 4f 46 2e | 20 20 4f 74 68 65 72 20 | on EOF.| Other |
|00000bb0| 63 70 69 6f 73 0a 09 09 | 6d 61 79 20 62 65 68 61 |cpios...|may beha|
|00000bc0| 76 65 20 64 69 66 66 65 | 72 65 6e 74 6c 79 2e 2e |ve diffe|rently..|
|00000bd0| 2e 2e 29 0a 53 48 41 52 | 5f 45 4f 46 0a 66 69 0a |..).SHAR|_EOF.fi.|
|00000be0| 69 66 20 74 65 73 74 20 | 2d 66 20 27 66 63 70 69 |if test |-f 'fcpi|
|00000bf0| 6f 2e 63 27 0a 74 68 65 | 6e 0a 09 65 63 68 6f 20 |o.c'.the|n..echo |
|00000c00| 73 68 61 72 3a 20 22 77 | 69 6c 6c 20 6e 6f 74 20 |shar: "w|ill not |
|00000c10| 6f 76 65 72 2d 77 72 69 | 74 65 20 65 78 69 73 74 |over-wri|te exist|
|00000c20| 69 6e 67 20 66 69 6c 65 | 20 27 66 63 70 69 6f 2e |ing file| 'fcpio.|
|00000c30| 63 27 22 0a 65 6c 73 65 | 0a 63 61 74 20 3c 3c 20 |c'".else|.cat << |
|00000c40| 5c 53 48 41 52 5f 45 4f | 46 20 3e 20 27 66 63 70 |\SHAR_EO|F > 'fcp|
|00000c50| 69 6f 2e 63 27 0a 23 69 | 6e 63 6c 75 64 65 20 3c |io.c'.#i|nclude <|
|00000c60| 73 74 64 69 6f 2e 68 3e | 0a 23 69 6e 63 6c 75 64 |stdio.h>|.#includ|
|00000c70| 65 20 3c 73 79 73 2f 74 | 79 70 65 73 2e 68 3e 0a |e <sys/t|ypes.h>.|
|00000c80| 23 69 6e 63 6c 75 64 65 | 20 3c 66 63 6e 74 6c 2e |#include| <fcntl.|
|00000c90| 68 3e 0a 23 69 6e 63 6c | 75 64 65 20 3c 65 72 72 |h>.#incl|ude <err|
|00000ca0| 6e 6f 2e 68 3e 0a 23 69 | 6e 63 6c 75 64 65 20 3c |no.h>.#i|nclude <|
|00000cb0| 64 61 79 74 6f 6e 2f 6d | 61 74 68 2e 68 3e 0a 23 |dayton/m|ath.h>.#|
|00000cc0| 69 6e 63 6c 75 64 65 20 | 3c 64 61 79 74 6f 6e 2f |include |<dayton/|
|00000cd0| 73 74 64 74 79 70 2e 68 | 3e 0a 0a 2f 2a 0a 20 2a |stdtyp.h|>../*. *|
|00000ce0| 20 66 63 70 69 6f 20 2d | 20 66 61 73 74 20 63 70 | fcpio -| fast cp|
|00000cf0| 69 6f 20 66 6f 72 20 73 | 65 65 6b 2d 61 62 6c 65 |io for s|eek-able|
|00000d00| 20 64 65 76 69 63 65 73 | 2e 0a 20 2a 0a 20 2a 20 | devices|.. *. * |
|00000d10| 55 73 61 67 65 3a 0a 20 | 2a 0a 20 2a 09 09 66 63 |Usage:. |*. *..fc|
|00000d20| 70 69 6f 20 5b 2d 6f 70 | 74 69 6f 6e 73 5d 20 63 |pio [-op|tions] c|
|00000d30| 70 69 6f 2d 61 72 63 68 | 69 76 65 20 5b 65 78 74 |pio-arch|ive [ext|
|00000d40| 72 61 63 74 2d 70 61 74 | 74 65 72 6e 2d 6c 69 73 |ract-pat|tern-lis|
|00000d50| 74 5d 0a 20 2a 0a 20 2a | 20 49 6d 70 6c 65 6d 65 |t]. *. *| Impleme|
|00000d60| 6e 74 65 64 20 6f 70 74 | 69 6f 6e 73 20 61 72 65 |nted opt|ions are|
|00000d70| 3a 0a 20 2a 0a 20 2a 09 | 09 78 20 2d 20 65 78 74 |:. *. *.|.x - ext|
|00000d80| 72 61 63 74 20 74 68 65 | 20 6e 61 6d 65 64 20 65 |ract the| named e|
|00000d90| 78 74 72 61 63 74 2d 70 | 61 74 74 65 72 6e 20 66 |xtract-p|attern f|
|00000da0| 69 6c 65 73 2e 0a 20 2a | 09 09 74 20 2d 20 70 72 |iles.. *|..t - pr|
|00000db0| 69 6e 74 20 61 20 74 61 | 62 6c 65 20 6f 66 20 63 |int a ta|ble of c|
|00000dc0| 6f 6e 74 65 6e 74 73 2e | 0a 20 2a 0a 20 2a 20 49 |ontents.|. *. * I|
|00000dd0| 6e 20 65 78 74 72 61 63 | 74 20 6d 6f 64 65 2c 20 |n extrac|t mode, |
|00000de0| 74 68 65 20 65 78 74 72 | 61 63 74 65 64 20 66 69 |the extr|acted fi|
|00000df0| 6c 65 73 20 61 72 65 20 | 74 68 65 20 6f 6e 65 73 |les are |the ones|
|00000e00| 20 77 68 6f 73 65 20 6e | 61 6d 65 73 20 62 65 67 | whose n|ames beg|
|00000e10| 69 6e 0a 20 2a 09 09 77 | 69 74 68 20 61 6e 79 74 |in. *..w|ith anyt|
|00000e20| 68 69 6e 67 20 69 6e 20 | 74 68 65 20 6e 61 6d 65 |hing in |the name|
|00000e30| 64 20 6c 69 73 74 2e 20 | 20 53 6b 69 70 70 65 64 |d list. | Skipped|
|00000e40| 20 69 74 65 6d 73 20 61 | 72 65 20 64 69 73 70 6c | items a|re displ|
|00000e50| 61 79 65 64 0a 20 2a 09 | 09 62 79 20 61 20 22 2e |ayed. *.|.by a ".|
|00000e60| 22 20 74 6f 20 69 6e 64 | 69 63 61 74 65 20 70 72 |" to ind|icate pr|
|00000e70| 6f 67 72 65 73 73 20 62 | 65 69 6e 67 20 6d 61 64 |ogress b|eing mad|
|00000e80| 65 2e 0a 20 2a 0a 20 2a | 20 41 75 74 68 6f 72 3a |e.. *. *| Author:|
|00000e90| 0a 20 2a 0a 20 2a 09 09 | 4a 6f 65 20 4c 61 72 73 |. *. *..|Joe Lars|
|00000ea0| 6f 6e 0a 20 2a 09 09 44 | 61 79 74 6f 6e 2d 48 75 |on. *..D|ayton-Hu|
|00000eb0| 64 73 6f 6e 20 44 65 70 | 74 2e 20 53 74 6f 72 65 |dson Dep|t. Store|
|00000ec0| 20 43 6f 2e 0a 20 2a 09 | 09 37 30 30 20 4f 6e 20 | Co.. *.|.700 On |
|00000ed0| 54 68 65 20 4d 61 6c 6c | 0a 20 2a 09 09 4d 69 6e |The Mall|. *..Min|
|00000ee0| 6e 65 61 70 6f 6c 69 73 | 2c 20 4d 69 6e 6e 65 73 |neapolis|, Minnes|
|00000ef0| 6f 74 61 20 35 35 34 30 | 32 0a 20 2a 0a 20 2a 09 |ota 5540|2. *. *.|
|00000f00| 09 55 55 43 50 3a 6a 6f | 65 40 64 61 79 74 6f 6e |.UUCP:jo|e@dayton|
|00000f10| 0a 20 2a 2f 0a 0a 73 74 | 72 75 63 74 20 48 64 72 |. */..st|ruct Hdr|
|00000f20| 0a 7b 0a 09 73 68 6f 72 | 74 09 68 5f 6d 61 67 69 |.{..shor|t.h_magi|
|00000f30| 63 2c 0a 09 09 09 68 5f | 64 65 76 3b 0a 09 75 73 |c,....h_|dev;..us|
|00000f40| 68 6f 72 74 09 68 5f 69 | 6e 6f 2c 0a 09 09 09 68 |hort.h_i|no,....h|
|00000f50| 5f 6d 6f 64 65 2c 0a 09 | 09 09 68 5f 75 69 64 2c |_mode,..|..h_uid,|
|00000f60| 0a 09 09 09 68 5f 67 69 | 64 2c 0a 09 09 09 68 5f |....h_gi|d,....h_|
|00000f70| 6e 6c 69 6e 6b 2c 0a 09 | 09 09 68 5f 72 64 65 76 |nlink,..|..h_rdev|
|00000f80| 2c 0a 09 09 09 68 5f 6d | 74 69 6d 65 5b 32 5d 2c |,....h_m|time[2],|
|00000f90| 0a 09 09 09 68 5f 6e 61 | 6d 65 73 69 7a 65 2c 0a |....h_na|mesize,.|
|00000fa0| 09 09 09 68 5f 66 69 6c | 65 73 69 7a 65 5b 32 5d |...h_fil|esize[2]|
|00000fb0| 3b 0a 09 63 68 61 72 09 | 68 5f 6e 61 6d 65 5b 38 |;..char.|h_name[8|
|00000fc0| 30 5d 3b 0a 7d 3b 0a 0a | 23 64 65 66 69 6e 65 20 |0];.};..|#define |
|00000fd0| 52 45 41 44 42 55 46 53 | 49 5a 45 20 31 30 30 30 |READBUFS|IZE 1000|
|00000fe0| 30 30 0a 63 68 61 72 20 | 72 65 61 64 62 75 66 5b |00.char |readbuf[|
|00000ff0| 52 45 41 44 42 55 46 53 | 49 5a 45 5d 3b 0a 0a 6d |READBUFS|IZE];..m|
|00001000| 61 69 6e 28 61 72 67 63 | 2c 61 72 67 76 29 0a 69 |ain(argc|,argv).i|
|00001010| 6e 74 20 61 72 67 63 3b | 0a 63 68 61 72 20 2a 2a |nt argc;|.char **|
|00001020| 61 72 67 76 3b 0a 7b 0a | 09 73 74 72 75 63 74 20 |argv;.{.|.struct |
|00001030| 48 64 72 20 68 73 74 72 | 75 63 74 3b 09 09 2f 2a |Hdr hstr|uct;../*|
|00001040| 20 49 6e 64 69 76 2e 20 | 66 69 6c 65 20 68 65 61 | Indiv. |file hea|
|00001050| 64 65 72 20 69 6e 20 69 | 66 69 6c 65 2e 09 09 09 |der in i|file....|
|00001060| 09 2a 2f 0a 09 69 6e 74 | 09 09 69 66 69 6c 65 2c |.*/..int|..ifile,|
|00001070| 09 09 09 2f 2a 20 41 72 | 63 68 69 76 65 20 66 69 |.../* Ar|chive fi|
|00001080| 6c 65 09 09 09 09 09 09 | 09 09 2a 2f 0a 09 09 09 |le......|..*/....|
|00001090| 63 75 72 5f 70 6f 73 2c | 09 09 2f 2a 20 50 6f 73 |cur_pos,|../* Pos|
|000010a0| 69 74 69 6f 6e 20 69 6e | 20 69 66 69 6c 65 09 09 |ition in| ifile..|
|000010b0| 09 09 09 09 2a 2f 0a 09 | 09 09 66 70 6f 73 2c 09 |....*/..|..fpos,.|
|000010c0| 09 09 2f 2a 20 41 6e 6f | 74 68 65 72 20 70 6f 73 |../* Ano|ther pos|
|000010d0| 69 74 69 6f 6e 20 69 6e | 20 69 66 69 6c 65 09 09 |ition in| ifile..|
|000010e0| 09 09 2a 2f 0a 09 09 09 | 64 75 6d 6d 79 2c 09 09 |..*/....|dummy,..|
|000010f0| 09 2f 2a 20 48 6f 6c 64 | 73 20 6c 65 6e 67 74 68 |./* Hold|s length|
|00001100| 20 6f 66 20 63 75 72 72 | 65 6e 74 20 66 69 6c 65 | of curr|ent file|
|00001110| 20 69 6e 20 69 66 69 6c | 65 09 2a 2f 0a 09 09 09 | in ifil|e.*/....|
|00001120| 69 2c 09 09 09 09 2f 2a | 20 43 6f 75 6e 74 65 72 |i,..../*| Counter|
|00001130| 20 66 6f 72 20 6c 6f 74 | 73 20 6f 66 20 74 68 69 | for lot|s of thi|
|00001140| 6e 67 73 09 09 09 09 2a | 2f 0a 09 09 09 69 6c 65 |ngs....*|/....ile|
|00001150| 6e 73 5b 32 30 5d 2c 09 | 09 2f 2a 20 4c 65 6e 67 |ns[20],.|./* Leng|
|00001160| 74 68 73 20 6f 66 20 78 | 5f 6e 61 6d 65 73 5b 5d |ths of x|_names[]|
|00001170| 2e 09 09 09 09 09 2a 2f | 0a 09 09 09 63 6f 75 6e |......*/|....coun|
|00001180| 74 2c 09 09 09 2f 2a 20 | 23 20 6f 66 20 66 69 6c |t,.../* |# of fil|
|00001190| 65 73 20 77 65 27 76 65 | 20 73 6b 69 70 70 65 64 |es we've| skipped|
|000011a0| 2e 09 09 09 09 2a 2f 0a | 09 09 09 78 5f 63 6f 75 |.....*/.|...x_cou|
|000011b0| 6e 74 2c 09 09 2f 2a 20 | 4e 75 6d 62 65 72 20 6f |nt,../* |Number o|
|000011c0| 66 20 78 5f 6e 61 6d 65 | 73 5b 5d 2e 09 09 09 09 |f x_name|s[].....|
|000011d0| 09 09 2a 2f 0a 09 09 09 | 69 73 69 7a 65 3b 09 09 |..*/....|isize;..|
|000011e0| 09 2f 2a 20 55 73 65 64 | 20 69 6e 20 73 65 65 6b |./* Used| in seek|
|000011f0| 69 6e 67 2e 2e 2e 09 09 | 09 09 09 09 2a 2f 0a 09 |ing.....|....*/..|
|00001200| 63 68 61 72 09 2a 61 5f | 6e 61 6d 65 2c 09 09 2f |char.*a_|name,../|
|00001210| 2a 20 4e 61 6d 65 20 6f | 66 20 61 72 63 68 69 76 |* Name o|f archiv|
|00001220| 65 20 66 69 6c 65 09 09 | 09 09 09 09 2a 2f 0a 09 |e file..|....*/..|
|00001230| 09 09 2a 6f 70 74 69 6f | 6e 73 2c 09 09 2f 2a 20 |..*optio|ns,../* |
|00001240| 4f 70 74 69 6f 6e 20 73 | 74 72 69 6e 67 20 66 72 |Option s|tring fr|
|00001250| 6f 6d 20 63 6d 6e 64 20 | 6c 69 6e 65 2e 09 09 09 |om cmnd |line....|
|00001260| 2a 2f 0a 09 09 09 2a 78 | 5f 6e 61 6d 65 73 5b 32 |*/....*x|_names[2|
|00001270| 30 5d 3b 09 2f 2a 20 4e | 61 6d 65 20 6f 66 20 65 |0];./* N|ame of e|
|00001280| 78 74 72 61 63 74 20 66 | 69 6c 65 20 62 65 67 69 |xtract f|ile begi|
|00001290| 6e 6e 69 6e 67 73 2e 09 | 09 09 2a 2f 0a 09 62 6f |nnings..|..*/..bo|
|000012a0| 6f 6c 09 64 6f 5f 65 78 | 74 72 61 63 74 2c 09 09 |ol.do_ex|tract,..|
|000012b0| 2f 2a 20 45 78 74 72 61 | 63 74 20 66 69 6c 65 73 |/* Extra|ct files|
|000012c0| 3f 09 09 09 09 09 09 09 | 2a 2f 0a 09 09 09 64 6f |?.......|*/....do|
|000012d0| 5f 74 61 62 6c 65 2c 09 | 09 2f 2a 20 44 6f 20 61 |_table,.|./* Do a|
|000012e0| 20 74 61 62 6c 65 20 6f | 66 20 63 6f 6e 74 65 6e | table o|f conten|
|000012f0| 74 73 3f 09 09 09 09 09 | 2a 2f 0a 09 09 09 78 5f |ts?.....|*/....x_|
|00001300| 68 65 72 65 3b 09 09 09 | 2f 2a 20 45 78 74 72 61 |here;...|/* Extra|
|00001310| 63 74 20 74 68 69 73 20 | 66 69 6c 65 3f 09 09 09 |ct this |file?...|
|00001320| 09 09 09 2a 2f 0a 0a 09 | 61 5f 6e 61 6d 65 20 3d |...*/...|a_name =|
|00001330| 20 4e 55 4c 4c 3b 0a 09 | 6f 70 74 69 6f 6e 73 20 | NULL;..|options |
|00001340| 3d 20 22 78 22 3b 0a 09 | 78 5f 63 6f 75 6e 74 20 |= "x";..|x_count |
|00001350| 3d 20 30 3b 0a 09 64 6f | 5f 65 78 74 72 61 63 74 |= 0;..do|_extract|
|00001360| 20 3d 20 30 3b 0a 09 64 | 6f 5f 74 61 62 6c 65 20 | = 0;..d|o_table |
|00001370| 3d 20 30 3b 0a 09 66 6f | 72 20 28 69 20 3d 20 31 |= 0;..fo|r (i = 1|
|00001380| 3b 20 69 20 3c 20 61 72 | 67 63 3b 20 69 2b 2b 29 |; i < ar|gc; i++)|
|00001390| 0a 09 7b 0a 09 09 69 66 | 20 28 2a 61 72 67 76 5b |..{...if| (*argv[|
|000013a0| 69 5d 20 3d 3d 20 27 2d | 27 29 0a 09 09 09 6f 70 |i] == '-|')....op|
|000013b0| 74 69 6f 6e 73 20 3d 20 | 61 72 67 76 5b 69 5d 2b |tions = |argv[i]+|
|000013c0| 31 3b 0a 09 09 65 6c 73 | 65 20 69 66 20 28 61 5f |1;...els|e if (a_|
|000013d0| 6e 61 6d 65 20 3d 3d 20 | 4e 55 4c 4c 29 0a 09 09 |name == |NULL)...|
|000013e0| 09 61 5f 6e 61 6d 65 20 | 3d 20 61 72 67 76 5b 69 |.a_name |= argv[i|
|000013f0| 5d 3b 0a 09 09 65 6c 73 | 65 0a 09 09 09 78 5f 6e |];...els|e....x_n|
|00001400| 61 6d 65 73 5b 78 5f 63 | 6f 75 6e 74 2b 2b 5d 20 |ames[x_c|ount++] |
|00001410| 3d 20 61 72 67 76 5b 69 | 5d 3b 0a 09 7d 0a 09 69 |= argv[i|];..}..i|
|00001420| 66 20 28 61 5f 6e 61 6d | 65 20 3d 3d 20 4e 55 4c |f (a_nam|e == NUL|
|00001430| 4c 29 0a 09 7b 0a 09 09 | 75 73 61 67 65 28 61 72 |L)..{...|usage(ar|
|00001440| 67 76 5b 30 5d 29 3b 0a | 09 09 65 78 69 74 28 30 |gv[0]);.|..exit(0|
|00001450| 29 3b 0a 09 7d 0a 09 64 | 6f 5f 65 78 74 72 61 63 |);..}..d|o_extrac|
|00001460| 74 20 3d 20 28 73 74 72 | 63 68 72 28 6f 70 74 69 |t = (str|chr(opti|
|00001470| 6f 6e 73 2c 20 27 78 27 | 29 20 21 3d 20 4e 55 4c |ons, 'x'|) != NUL|
|00001480| 4c 29 3b 0a 09 64 6f 5f | 74 61 62 6c 65 20 3d 20 |L);..do_|table = |
|00001490| 28 73 74 72 63 68 72 28 | 6f 70 74 69 6f 6e 73 2c |(strchr(|options,|
|000014a0| 20 27 74 27 29 20 21 3d | 20 4e 55 4c 4c 29 3b 0a | 't') !=| NULL);.|
|000014b0| 09 69 66 69 6c 65 20 3d | 20 6f 70 65 6e 28 61 5f |.ifile =| open(a_|
|000014c0| 6e 61 6d 65 2c 20 4f 5f | 52 44 4f 4e 4c 59 29 3b |name, O_|RDONLY);|
|000014d0| 0a 09 69 66 20 28 69 66 | 69 6c 65 20 3d 3d 20 2d |..if (if|ile == -|
|000014e0| 31 29 0a 09 7b 0a 09 09 | 70 65 72 72 6f 72 28 61 |1)..{...|perror(a|
|000014f0| 5f 6e 61 6d 65 29 3b 0a | 09 09 65 78 69 74 28 65 |_name);.|..exit(e|
|00001500| 72 72 6e 6f 29 3b 0a 09 | 7d 0a 09 66 6f 72 20 28 |rrno);..|}..for (|
|00001510| 69 20 3d 20 30 3b 20 69 | 20 3c 20 78 5f 63 6f 75 |i = 0; i| < x_cou|
|00001520| 6e 74 3b 20 69 2b 2b 29 | 0a 09 09 69 6c 65 6e 73 |nt; i++)|...ilens|
|00001530| 5b 69 5d 20 3d 20 73 74 | 72 6c 65 6e 28 78 5f 6e |[i] = st|rlen(x_n|
|00001540| 61 6d 65 73 5b 69 5d 29 | 3b 0a 09 63 75 72 5f 70 |ames[i])|;..cur_p|
|00001550| 6f 73 20 3d 20 30 3b 0a | 09 63 6f 75 6e 74 20 3d |os = 0;.|.count =|
|00001560| 20 30 3b 0a 09 77 68 69 | 6c 65 28 31 29 0a 09 7b | 0;..whi|le(1)..{|
|00001570| 0a 09 09 69 66 20 28 72 | 65 61 64 28 69 66 69 6c |...if (r|ead(ifil|
|00001580| 65 2c 20 26 68 73 74 72 | 75 63 74 2c 20 73 69 7a |e, &hstr|uct, siz|
|00001590| 65 6f 66 28 73 74 72 75 | 63 74 20 48 64 72 29 29 |eof(stru|ct Hdr))|
|000015a0| 20 3c 20 73 69 7a 65 6f | 66 28 73 74 72 75 63 74 | < sizeo|f(struct|
|000015b0| 20 48 64 72 29 29 0a 09 | 09 09 62 72 65 61 6b 3b | Hdr))..|..break;|
|000015c0| 0a 09 09 69 66 20 28 21 | 73 74 72 63 6d 70 28 68 |...if (!|strcmp(h|
|000015d0| 73 74 72 75 63 74 2e 68 | 5f 6e 61 6d 65 2c 20 22 |struct.h|_name, "|
|000015e0| 54 52 41 49 4c 45 52 21 | 21 21 22 29 29 0a 09 09 |TRAILER!|!!"))...|
|000015f0| 09 62 72 65 61 6b 3b 0a | 09 09 64 75 6d 6d 79 20 |.break;.|..dummy |
|00001600| 3d 20 28 68 73 74 72 75 | 63 74 2e 68 5f 66 69 6c |= (hstru|ct.h_fil|
|00001610| 65 73 69 7a 65 5b 30 5d | 20 3c 3c 20 31 36 29 20 |esize[0]| << 16) |
|00001620| 2b 20 68 73 74 72 75 63 | 74 2e 68 5f 66 69 6c 65 |+ hstruc|t.h_file|
|00001630| 73 69 7a 65 5b 31 5d 3b | 0a 09 09 69 66 20 28 64 |size[1];|...if (d|
|00001640| 6f 5f 74 61 62 6c 65 29 | 0a 09 09 7b 0a 09 09 09 |o_table)|...{....|
|00001650| 66 70 72 69 6e 74 66 28 | 73 74 64 65 72 72 2c 20 |fprintf(|stderr, |
|00001660| 22 25 36 6c 64 20 25 73 | 5c 6e 22 2c 20 64 75 6d |"%6ld %s|\n", dum|
|00001670| 6d 79 2c 20 68 73 74 72 | 75 63 74 2e 68 5f 6e 61 |my, hstr|uct.h_na|
|00001680| 6d 65 29 3b 0a 09 09 09 | 66 66 6c 75 73 68 28 73 |me);....|fflush(s|
|00001690| 74 64 65 72 72 29 3b 0a | 09 09 7d 0a 09 09 69 73 |tderr);.|..}...is|
|000016a0| 69 7a 65 20 3d 20 28 68 | 73 74 72 75 63 74 2e 68 |ize = (h|struct.h|
|000016b0| 5f 6e 61 6d 65 73 69 7a | 65 20 2b 20 31 29 20 26 |_namesiz|e + 1) &|
|000016c0| 20 7e 28 31 4c 29 3b 0a | 09 09 69 66 20 28 64 6f | ~(1L);.|..if (do|
|000016d0| 5f 65 78 74 72 61 63 74 | 29 0a 09 09 7b 0a 09 09 |_extract|)...{...|
|000016e0| 09 78 5f 68 65 72 65 20 | 3d 20 21 28 78 5f 63 6f |.x_here |= !(x_co|
|000016f0| 75 6e 74 29 3b 09 2f 2a | 20 49 66 20 6e 6f 20 78 |unt);./*| If no x|
|00001700| 5f 6e 61 6d 65 73 2c 20 | 65 78 74 72 61 63 74 20 |_names, |extract |
|00001710| 61 6c 6c 20 2a 2f 0a 09 | 09 09 66 6f 72 20 28 69 |all */..|..for (i|
|00001720| 20 3d 20 30 3b 20 69 20 | 3c 20 78 5f 63 6f 75 6e | = 0; i |< x_coun|
|00001730| 74 3b 20 69 2b 2b 29 0a | 09 09 09 09 69 66 20 28 |t; i++).|....if (|
|00001740| 21 73 74 72 6e 63 6d 70 | 28 78 5f 6e 61 6d 65 73 |!strncmp|(x_names|
|00001750| 5b 69 5d 2c 20 68 73 74 | 72 75 63 74 2e 68 5f 6e |[i], hst|ruct.h_n|
|00001760| 61 6d 65 2c 20 69 6c 65 | 6e 73 5b 69 5d 29 29 0a |ame, ile|ns[i])).|
|00001770| 09 09 09 09 7b 0a 09 09 | 09 09 09 78 5f 68 65 72 |....{...|...x_her|
|00001780| 65 20 3d 20 31 3b 0a 09 | 09 09 09 09 62 72 65 61 |e = 1;..|....brea|
|00001790| 6b 3b 0a 09 09 09 09 7d | 0a 09 09 09 69 66 20 28 |k;.....}|....if (|
|000017a0| 78 5f 68 65 72 65 29 0a | 09 09 09 7b 0a 09 09 09 |x_here).|...{....|
|000017b0| 09 69 66 20 28 63 6f 75 | 6e 74 29 0a 09 09 09 09 |.if (cou|nt).....|
|000017c0| 09 66 70 72 69 6e 74 66 | 28 73 74 64 65 72 72 2c |.fprintf|(stderr,|
|000017d0| 20 22 5c 6e 22 29 3b 0a | 09 09 09 09 63 6f 75 6e | "\n");.|....coun|
|000017e0| 74 20 3d 20 30 3b 0a 09 | 09 09 09 66 70 6f 73 20 |t = 0;..|...fpos |
|000017f0| 3d 20 63 75 72 5f 70 6f | 73 20 2b 20 73 69 7a 65 |= cur_po|s + size|
|00001800| 6f 66 28 73 74 72 75 63 | 74 20 48 64 72 29 20 2d |of(struc|t Hdr) -|
|00001810| 20 38 30 20 2b 20 69 73 | 69 7a 65 3b 0a 09 09 09 | 80 + is|ize;....|
|00001820| 09 66 70 72 69 6e 74 66 | 28 73 74 64 65 72 72 2c |.fprintf|(stderr,|
|00001830| 20 22 58 3a 20 25 73 22 | 2c 20 68 73 74 72 75 63 | "X: %s"|, hstruc|
|00001840| 74 2e 68 5f 6e 61 6d 65 | 29 3b 0a 09 09 09 09 66 |t.h_name|);.....f|
|00001850| 66 6c 75 73 68 28 73 74 | 64 65 72 72 29 3b 0a 09 |flush(st|derr);..|
|00001860| 09 09 09 63 6f 70 79 5f | 66 69 6c 65 28 69 66 69 |...copy_|file(ifi|
|00001870| 6c 65 2c 20 66 70 6f 73 | 2c 20 26 68 73 74 72 75 |le, fpos|, &hstru|
|00001880| 63 74 2c 20 64 75 6d 6d | 79 29 3b 0a 09 09 09 09 |ct, dumm|y);.....|
|00001890| 66 70 72 69 6e 74 66 28 | 73 74 64 65 72 72 2c 20 |fprintf(|stderr, |
|000018a0| 22 2e 5c 6e 22 29 3b 0a | 09 09 09 7d 0a 09 09 09 |".\n");.|...}....|
|000018b0| 65 6c 73 65 0a 09 09 09 | 7b 0a 09 09 09 09 66 70 |else....|{.....fp|
|000018c0| 72 69 6e 74 66 28 73 74 | 64 65 72 72 2c 20 22 2e |rintf(st|derr, ".|
|000018d0| 22 29 3b 0a 09 09 09 09 | 69 66 20 28 2b 2b 63 6f |");.....|if (++co|
|000018e0| 75 6e 74 20 3d 3d 20 36 | 30 29 0a 09 09 09 09 7b |unt == 6|0).....{|
|000018f0| 0a 09 09 09 09 09 66 70 | 72 69 6e 74 66 28 73 74 |......fp|rintf(st|
|00001900| 64 65 72 72 2c 20 22 5c | 6e 22 29 3b 0a 09 09 09 |derr, "\|n");....|
|00001910| 09 09 63 6f 75 6e 74 20 | 3d 20 30 3b 0a 09 09 09 |..count |= 0;....|
|00001920| 09 7d 0a 09 09 09 09 65 | 6c 73 65 0a 09 09 09 09 |.}.....e|lse.....|
|00001930| 09 66 66 6c 75 73 68 28 | 73 74 64 65 72 72 29 3b |.fflush(|stderr);|
|00001940| 0a 09 09 09 7d 0a 09 09 | 7d 0a 09 09 63 75 72 5f |....}...|}...cur_|
|00001950| 70 6f 73 20 2b 3d 20 28 | 64 75 6d 6d 79 20 2b 20 |pos += (|dummy + |
|00001960| 73 69 7a 65 6f 66 28 73 | 74 72 75 63 74 20 48 64 |sizeof(s|truct Hd|
|00001970| 72 29 20 2d 20 38 30 20 | 2b 20 69 73 69 7a 65 20 |r) - 80 |+ isize |
|00001980| 2b 20 31 29 20 26 20 7e | 28 31 4c 29 3b 0a 09 09 |+ 1) & ~|(1L);...|
|00001990| 6c 73 65 65 6b 28 69 66 | 69 6c 65 2c 20 63 75 72 |lseek(if|ile, cur|
|000019a0| 5f 70 6f 73 2c 20 30 29 | 3b 0a 09 7d 0a 09 63 6c |_pos, 0)|;..}..cl|
|000019b0| 6f 73 65 28 69 66 69 6c | 65 29 3b 0a 7d 0a 0a 0a |ose(ifil|e);.}...|
|000019c0| 63 6f 70 79 5f 66 69 6c | 65 28 69 66 69 6c 65 2c |copy_fil|e(ifile,|
|000019d0| 20 66 70 6f 73 2c 20 68 | 73 74 72 75 63 74 2c 20 | fpos, h|struct, |
|000019e0| 69 6c 65 6e 29 0a 69 6e | 74 20 69 66 69 6c 65 2c |ilen).in|t ifile,|
|000019f0| 20 66 70 6f 73 2c 20 69 | 6c 65 6e 3b 0a 73 74 72 | fpos, i|len;.str|
|00001a00| 75 63 74 20 48 64 72 20 | 2a 68 73 74 72 75 63 74 |uct Hdr |*hstruct|
|00001a10| 3b 0a 2f 2a 0a 20 2a 20 | 43 6f 70 79 20 6f 75 74 |;./*. * |Copy out|
|00001a20| 20 74 68 69 73 20 66 69 | 6c 65 2e 20 20 54 68 69 | this fi|le. Thi|
|00001a30| 73 20 72 6f 75 74 69 6e | 65 20 73 74 69 6c 6c 20 |s routin|e still |
|00001a40| 6e 65 65 64 73 20 74 6f | 20 64 6f 20 73 6f 6d 65 |needs to| do some|
|00001a50| 20 74 68 69 6e 67 73 2e | 0a 20 2a 0a 20 2a 20 46 | things.|. *. * F|
|00001a60| 6f 72 20 69 6e 73 74 61 | 6e 63 65 2c 20 6e 6f 20 |or insta|nce, no |
|00001a70| 61 74 74 65 6d 70 74 20 | 69 73 20 6d 61 64 65 20 |attempt |is made |
|00001a80| 74 6f 20 70 72 65 73 65 | 72 76 65 20 74 68 65 20 |to prese|rve the |
|00001a90| 6f 72 69 67 69 6e 61 6c | 20 66 69 6c 65 73 0a 20 |original| files. |
|00001aa0| 2a 09 09 6d 61 67 69 63 | 20 6e 75 6d 62 65 72 2c |*..magic| number,|
|00001ab0| 20 63 2f 6d 2f 61 20 74 | 69 6d 65 73 2c 20 6f 77 | c/m/a t|imes, ow|
|00001ac0| 6e 65 72 20 6f 72 20 67 | 72 6f 75 70 2e 0a 20 2a |ner or g|roup.. *|
|00001ad0| 2f 0a 7b 0a 09 69 6e 74 | 20 6f 66 69 6c 65 2c 20 |/.{..int| ofile, |
|00001ae0| 72 6c 65 6e 2c 20 6e 6c | 65 6e 3b 0a 09 63 68 61 |rlen, nl|en;..cha|
|00001af0| 72 20 6e 61 6d 65 5b 31 | 33 32 5d 2c 20 2a 63 31 |r name[1|32], *c1|
|00001b00| 2c 20 2a 63 32 3b 0a 0a | 09 69 66 20 28 68 73 74 |, *c2;..|.if (hst|
|00001b10| 72 75 63 74 2d 3e 68 5f | 6d 6f 64 65 20 26 20 30 |ruct->h_|mode & 0|
|00001b20| 30 34 30 30 30 30 4c 29 | 0a 09 7b 0a 09 09 6d 61 |040000L)|..{...ma|
|00001b30| 6b 65 5f 70 61 74 68 28 | 68 73 74 72 75 63 74 2d |ke_path(|hstruct-|
|00001b40| 3e 68 5f 6e 61 6d 65 2c | 20 31 29 3b 0a 09 09 72 |>h_name,| 1);...r|
|00001b50| 65 74 75 72 6e 3b 0a 09 | 7d 0a 09 66 6f 72 20 28 |eturn;..|}..for (|
|00001b60| 63 31 20 3d 20 4e 55 4c | 4c 2c 20 63 32 3d 68 73 |c1 = NUL|L, c2=hs|
|00001b70| 74 72 75 63 74 2d 3e 68 | 5f 6e 61 6d 65 3b 20 2a |truct->h|_name; *|
|00001b80| 63 32 3b 20 63 32 2b 2b | 29 0a 09 09 69 66 20 28 |c2; c2++|)...if (|
|00001b90| 2a 63 32 20 3d 3d 20 27 | 2f 27 29 0a 09 09 09 63 |*c2 == '|/')....c|
|00001ba0| 31 20 3d 20 63 32 3b 0a | 09 69 66 20 28 63 31 20 |1 = c2;.|.if (c1 |
|00001bb0| 21 3d 20 4e 55 4c 4c 29 | 0a 09 7b 0a 09 09 6e 6c |!= NULL)|..{...nl|
|00001bc0| 65 6e 20 3d 20 63 31 20 | 2d 20 68 73 74 72 75 63 |en = c1 |- hstruc|
|00001bd0| 74 2d 3e 68 5f 6e 61 6d | 65 3b 0a 09 09 73 74 72 |t->h_nam|e;...str|
|00001be0| 6e 63 70 79 28 6e 61 6d | 65 2c 20 68 73 74 72 75 |ncpy(nam|e, hstru|
|00001bf0| 63 74 2d 3e 68 5f 6e 61 | 6d 65 2c 20 6e 6c 65 6e |ct->h_na|me, nlen|
|00001c00| 29 3b 0a 09 09 6e 61 6d | 65 5b 6e 6c 65 6e 5d 20 |);...nam|e[nlen] |
|00001c10| 3d 20 30 3b 0a 09 09 6d | 61 6b 65 5f 70 61 74 68 |= 0;...m|ake_path|
|00001c20| 28 6e 61 6d 65 2c 20 31 | 29 3b 0a 09 7d 0a 09 6f |(name, 1|);..}..o|
|00001c30| 66 69 6c 65 20 3d 20 6f | 70 65 6e 28 68 73 74 72 |file = o|pen(hstr|
|00001c40| 75 63 74 2d 3e 68 5f 6e | 61 6d 65 2c 20 4f 5f 57 |uct->h_n|ame, O_W|
|00001c50| 52 4f 4e 4c 59 20 7c 20 | 4f 5f 43 52 45 41 54 2c |RONLY | |O_CREAT,|
|00001c60| 20 68 73 74 72 75 63 74 | 2d 3e 68 5f 6d 6f 64 65 | hstruct|->h_mode|
|00001c70| 26 30 37 37 37 37 4c 29 | 3b 0a 09 69 66 20 28 6f |&07777L)|;..if (o|
|00001c80| 66 69 6c 65 20 3d 3d 20 | 2d 31 29 0a 09 7b 0a 09 |file == |-1)..{..|
|00001c90| 09 70 65 72 72 6f 72 28 | 68 73 74 72 75 63 74 2d |.perror(|hstruct-|
|00001ca0| 3e 68 5f 6e 61 6d 65 29 | 3b 0a 09 09 72 65 74 75 |>h_name)|;...retu|
|00001cb0| 72 6e 3b 0a 09 7d 0a 09 | 6c 73 65 65 6b 28 69 66 |rn;..}..|lseek(if|
|00001cc0| 69 6c 65 2c 20 66 70 6f | 73 2c 20 30 4c 29 3b 0a |ile, fpo|s, 0L);.|
|00001cd0| 09 77 68 69 6c 65 20 28 | 69 6c 65 6e 20 3e 20 30 |.while (|ilen > 0|
|00001ce0| 29 0a 09 7b 0a 09 09 72 | 6c 65 6e 20 3d 20 4d 49 |)..{...r|len = MI|
|00001cf0| 4e 28 52 45 41 44 42 55 | 46 53 49 5a 45 2c 20 69 |N(READBU|FSIZE, i|
|00001d00| 6c 65 6e 29 3b 0a 09 09 | 72 6c 65 6e 20 3d 20 72 |len);...|rlen = r|
|00001d10| 65 61 64 28 69 66 69 6c | 65 2c 20 72 65 61 64 62 |ead(ifil|e, readb|
|00001d20| 75 66 2c 20 72 6c 65 6e | 29 3b 0a 09 09 69 66 20 |uf, rlen|);...if |
|00001d30| 28 72 6c 65 6e 20 3e 20 | 30 29 0a 09 09 09 77 72 |(rlen > |0)....wr|
|00001d40| 69 74 65 28 6f 66 69 6c | 65 2c 20 72 65 61 64 62 |ite(ofil|e, readb|
|00001d50| 75 66 2c 20 72 6c 65 6e | 29 3b 0a 09 09 65 6c 73 |uf, rlen|);...els|
|00001d60| 65 0a 09 09 09 62 72 65 | 61 6b 3b 0a 09 09 69 6c |e....bre|ak;...il|
|00001d70| 65 6e 20 2d 3d 20 72 6c | 65 6e 3b 0a 09 7d 0a 09 |en -= rl|en;..}..|
|00001d80| 63 6c 6f 73 65 28 6f 66 | 69 6c 65 29 3b 0a 7d 0a |close(of|ile);.}.|
|00001d90| 0a 0a 0a 75 73 61 67 65 | 28 61 72 67 29 0a 63 68 |...usage|(arg).ch|
|00001da0| 61 72 20 2a 61 72 67 3b | 0a 7b 0a 09 66 70 72 69 |ar *arg;|.{..fpri|
|00001db0| 6e 74 66 28 73 74 64 65 | 72 72 2c 20 22 55 73 61 |ntf(stde|rr, "Usa|
|00001dc0| 67 65 3a 20 25 73 20 69 | 6e 66 69 6c 65 6e 61 6d |ge: %s i|nfilenam|
|00001dd0| 65 5c 6e 22 2c 20 61 72 | 67 29 3b 0a 7d 0a 0a 6d |e\n", ar|g);.}..m|
|00001de0| 61 6b 65 5f 70 61 74 68 | 28 70 2c 20 66 6c 61 67 |ake_path|(p, flag|
|00001df0| 29 0a 63 68 61 72 20 2a | 70 2c 20 66 6c 61 67 3b |).char *|p, flag;|
|00001e00| 0a 2f 2a 0a 20 2a 20 4d | 61 6b 65 20 73 75 72 65 |./*. * M|ake sure|
|00001e10| 20 74 68 69 73 20 65 6e | 74 69 72 65 20 70 61 74 | this en|tire pat|
|00001e20| 68 6e 61 6d 65 20 65 78 | 69 73 74 73 2e 0a 20 2a |hname ex|ists.. *|
|00001e30| 2f 0a 7b 0a 09 73 68 6f | 72 74 20 69 6c 65 6e 3b |/.{..sho|rt ilen;|
|00001e40| 0a 09 63 68 61 72 20 6e | 61 6d 65 5b 31 33 32 5d |..char n|ame[132]|
|00001e50| 2c 20 2a 63 31 2c 20 2a | 63 32 3b 0a 0a 09 69 66 |, *c1, *|c2;...if|
|00001e60| 20 28 61 63 63 65 73 73 | 28 70 2c 20 30 30 29 29 | (access|(p, 00))|
|00001e70| 0a 09 7b 0a 09 09 69 66 | 20 28 66 6c 61 67 29 0a |..{...if| (flag).|
|00001e80| 09 09 7b 0a 09 09 09 66 | 6f 72 20 28 63 31 20 3d |..{....f|or (c1 =|
|00001e90| 20 4e 55 4c 4c 2c 20 63 | 32 20 3d 20 70 3b 20 2a | NULL, c|2 = p; *|
|00001ea0| 63 32 3b 20 63 32 2b 2b | 29 0a 09 09 09 7b 0a 09 |c2; c2++|)....{..|
|00001eb0| 09 09 09 69 66 20 28 2a | 63 32 20 3d 3d 20 27 2f |...if (*|c2 == '/|
|00001ec0| 27 29 0a 09 09 09 09 7b | 0a 09 09 09 09 09 69 66 |').....{|......if|
|00001ed0| 20 28 63 31 20 21 3d 20 | 4e 55 4c 4c 29 0a 09 09 | (c1 != |NULL)...|
|00001ee0| 09 09 09 7b 0a 09 09 09 | 09 09 09 69 6c 65 6e 20 |...{....|...ilen |
|00001ef0| 3d 20 63 32 20 2d 20 70 | 3b 0a 09 09 09 09 09 09 |= c2 - p|;.......|
|00001f00| 73 74 72 6e 63 70 79 28 | 6e 61 6d 65 2c 20 70 2c |strncpy(|name, p,|
|00001f10| 20 69 6c 65 6e 29 3b 0a | 09 09 09 09 09 09 6e 61 | ilen);.|......na|
|00001f20| 6d 65 5b 69 6c 65 6e 5d | 20 3d 20 30 3b 0a 09 09 |me[ilen]| = 0;...|
|00001f30| 09 09 09 09 69 66 20 28 | 61 63 63 65 73 73 28 6e |....if (|access(n|
|00001f40| 61 6d 65 2c 20 30 30 29 | 29 0a 09 09 09 09 09 09 |ame, 00)|).......|
|00001f50| 09 6d 61 6b 65 5f 70 61 | 74 68 28 70 2c 20 30 29 |.make_pa|th(p, 0)|
|00001f60| 3b 0a 09 09 09 09 09 7d | 0a 09 09 09 09 09 63 31 |;......}|......c1|
|00001f70| 20 3d 20 63 32 3b 0a 09 | 09 09 09 7d 0a 09 09 09 | = c2;..|...}....|
|00001f80| 7d 0a 09 09 7d 0a 09 09 | 69 66 20 28 21 66 6f 72 |}...}...|if (!for|
|00001f90| 6b 28 29 29 0a 09 09 7b | 0a 09 09 09 65 78 65 63 |k())...{|....exec|
|00001fa0| 6c 70 28 22 6d 6b 64 69 | 72 22 2c 20 22 6d 6b 64 |lp("mkdi|r", "mkd|
|00001fb0| 69 72 22 2c 20 70 2c 20 | 30 29 3b 0a 09 09 09 65 |ir", p, |0);....e|
|00001fc0| 78 69 74 28 65 72 72 6e | 6f 29 3b 0a 09 09 7d 0a |xit(errn|o);...}.|
|00001fd0| 09 09 65 6c 73 65 0a 09 | 09 09 77 61 69 74 28 30 |..else..|..wait(0|
|00001fe0| 29 3b 0a 09 7d 0a 7d 0a | 53 48 41 52 5f 45 4f 46 |);..}.}.|SHAR_EOF|
|00001ff0| 0a 66 69 0a 69 66 20 74 | 65 73 74 20 2d 66 20 27 |.fi.if t|est -f '|
|00002000| 6d 61 74 68 2e 68 27 0a | 74 68 65 6e 0a 09 65 63 |math.h'.|then..ec|
|00002010| 68 6f 20 73 68 61 72 3a | 20 22 77 69 6c 6c 20 6e |ho shar:| "will n|
|00002020| 6f 74 20 6f 76 65 72 2d | 77 72 69 74 65 20 65 78 |ot over-|write ex|
|00002030| 69 73 74 69 6e 67 20 66 | 69 6c 65 20 27 6d 61 74 |isting f|ile 'mat|
|00002040| 68 2e 68 27 22 0a 65 6c | 73 65 0a 63 61 74 20 3c |h.h'".el|se.cat <|
|00002050| 3c 20 5c 53 48 41 52 5f | 45 4f 46 20 3e 20 27 6d |< \SHAR_|EOF > 'm|
|00002060| 61 74 68 2e 68 27 0a 2f | 2a 0a 20 2a 20 44 61 79 |ath.h'./|*. * Day|
|00002070| 74 6f 6e 27 73 20 6d 61 | 74 68 20 6c 69 62 72 61 |ton's ma|th libra|
|00002080| 72 79 20 64 65 66 69 6e | 69 74 69 6f 6e 73 2e 0a |ry defin|itions..|
|00002090| 20 2a 2f 0a 0a 23 64 65 | 66 69 6e 65 09 09 4d 49 | */..#de|fine..MI|
|000020a0| 4e 28 78 2c 79 29 09 28 | 28 78 20 3c 20 79 29 20 |N(x,y).(|(x < y) |
|000020b0| 3f 20 78 20 3a 20 79 29 | 0a 23 64 65 66 69 6e 65 |? x : y)|.#define|
|000020c0| 09 09 4d 41 58 28 78 2c | 79 29 09 28 28 78 20 3e |..MAX(x,|y).((x >|
|000020d0| 20 79 29 20 3f 20 78 20 | 3a 20 79 29 0a 23 64 65 | y) ? x |: y).#de|
|000020e0| 66 69 6e 65 09 09 41 42 | 53 28 78 29 09 09 28 28 |fine..AB|S(x)..((|
|000020f0| 78 20 3c 20 30 29 20 3f | 20 2d 78 20 3a 20 78 29 |x < 0) ?| -x : x)|
|00002100| 0a 53 48 41 52 5f 45 4f | 46 0a 66 69 0a 69 66 20 |.SHAR_EO|F.fi.if |
|00002110| 74 65 73 74 20 2d 66 20 | 27 73 74 64 74 79 70 2e |test -f |'stdtyp.|
|00002120| 68 27 0a 74 68 65 6e 0a | 09 65 63 68 6f 20 73 68 |h'.then.|.echo sh|
|00002130| 61 72 3a 20 22 77 69 6c | 6c 20 6e 6f 74 20 6f 76 |ar: "wil|l not ov|
|00002140| 65 72 2d 77 72 69 74 65 | 20 65 78 69 73 74 69 6e |er-write| existin|
|00002150| 67 20 66 69 6c 65 20 27 | 73 74 64 74 79 70 2e 68 |g file '|stdtyp.h|
|00002160| 27 22 0a 65 6c 73 65 0a | 63 61 74 20 3c 3c 20 5c |'".else.|cat << \|
|00002170| 53 48 41 52 5f 45 4f 46 | 20 3e 20 27 73 74 64 74 |SHAR_EOF| > 'stdt|
|00002180| 79 70 2e 68 27 0a 2f 2a | 0a 20 2a 20 53 74 61 6e |yp.h'./*|. * Stan|
|00002190| 64 61 72 64 20 74 79 70 | 65 73 20 61 6e 64 20 64 |dard typ|es and d|
|000021a0| 65 66 69 6e 65 73 20 66 | 6f 72 20 44 61 79 74 6f |efines f|or Dayto|
|000021b0| 6e 2d 48 75 64 73 6f 6e | 2e 0a 20 2a 0a 20 2a 2f |n-Hudson|.. *. */|
|000021c0| 0a 0a 23 69 6e 63 6c 75 | 64 65 09 3c 73 74 64 74 |..#inclu|de.<stdt|
|000021d0| 79 70 2e 68 3e 0a 0a 23 | 69 66 6e 64 65 66 09 09 |yp.h>..#|ifndef..|
|000021e0| 54 52 55 45 0a 23 64 65 | 66 69 6e 65 09 09 54 52 |TRUE.#de|fine..TR|
|000021f0| 55 45 09 28 31 29 0a 23 | 65 6e 64 69 66 0a 0a 23 |UE.(1).#|endif..#|
|00002200| 69 66 6e 64 65 66 09 09 | 46 41 4c 53 45 0a 23 64 |ifndef..|FALSE.#d|
|00002210| 65 66 69 6e 65 09 09 46 | 41 4c 53 45 09 28 30 29 |efine..F|ALSE.(0)|
|00002220| 0a 23 65 6e 64 69 66 0a | 0a 23 64 65 66 69 6e 65 |.#endif.|.#define|
|00002230| 20 55 4c 4f 4e 47 20 75 | 6e 73 69 67 6e 65 64 20 | ULONG u|nsigned |
|00002240| 6c 6f 6e 67 0a 53 48 41 | 52 5f 45 4f 46 0a 66 69 |long.SHA|R_EOF.fi|
|00002250| 0a 65 78 69 74 20 30 0a | 23 09 45 6e 64 20 6f 66 |.exit 0.|#.End of|
|00002260| 20 73 68 65 6c 6c 20 61 | 72 63 68 69 76 65 0a 0a | shell a|rchive..|
|00002270| 0a | |. | |
+--------+-------------------------+-------------------------+--------+--------+