home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1989-09-14 | 7.6 KB | [TEXT/????] |
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
You can browse this item here: list.c.bin
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| AMOS Picture Packer (image/amosPicturePacker)
| ext
| Supported |
10%
| dexvert
| Jesper Olsen Module (music/jesperOlsen)
| magic
| Supported |
1%
| dexvert
| Debian floppy split (archive/debianFloppySplit)
| ext
| Unsupported |
1%
| dexvert
| Sound Images sound sample (audio/soundImagesSoundSample)
| ext
| Unsupported |
1%
| dexvert
| DESI-III drawing (image/desiIIIDrawing)
| ext
| Unsupported |
1%
| dexvert
| MS-DOS PMODE extender executable (executable/msdosPMODEExtenderExecutable)
| ext
| Unsupported |
1%
| dexvert
| Alien Trilogytextures (other/alienTrilogyTextures)
| ext
| Unsupported |
1%
| dexvert
| APT cache data (other/aptCacheData)
| ext
| Unsupported |
1%
| dexvert
| CorelTRACE configuration (other/corelTRACEConfiguration)
| ext
| Unsupported |
1%
| dexvert
| Dreamcast Disc (other/dreamcastDisc)
| ext
| Unsupported |
1%
| dexvert
| EST flat binary (other/estFlatBinary)
| ext
| Unsupported |
1%
| dexvert
| Finale Enigma Binary Format (other/finaleEnigmaBinaryFormat)
| ext
| Unsupported |
1%
| dexvert
| Sega Genesis/Megadrive/32x ROM (other/genesisROM)
| ext
| Unsupported |
1%
| dexvert
| Myth: The Fallen Lords game archive (other/mythTheFallenLordsGameArchive)
| ext
| Unsupported |
1%
| dexvert
| Sound Images Sound Driver (other/soundImagesSoundDriver)
| ext
| Unsupported |
1%
| dexvert
| Symantec/Norton Config (other/symantecNortonConfig)
| ext
| Unsupported |
1%
| dexvert
| Vectrex ROM (other/vectrexROM)
| ext
| Unsupported |
1%
| dexvert
| BIS raP encoded format (other/bisraPEncoded)
| ext
| Unsupported |
1%
| dexvert
| Pascal Script binary (other/pascalScriptBinary)
| ext
| Unsupported |
1%
| dexvert
| 7th Level game data archive (other/seventhLevelGameDataArchive)
| ext
| Unsupported |
1%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Binary Text (image/binaryText)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary, Mon Apr 4 15:21:09 1988, modified Mon May 29 09:43:04 1989, creator '????', type ASCII, 7239 bytes "list.c" , at 0x1cc7 382 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
49%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
33%
| TrID
| TTComp archive compressed (bin-4K)
| default (weak)
| |
17%
| TrID
| MacBinary 1
| default (weak)
| |
100%
| lsar
| MacBinary
| default
| |
100%
| gt2
| MAC Bilddatei
| default (weak)
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [????] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 06 6c 69 73 74 2e 63 | 00 00 00 00 00 00 00 00 |..list.c|........|
|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 54 45 58 54 3f 3f 3f | 3f 00 00 00 00 00 00 00 |.TEXT???|?.......|
|00000050| 00 00 00 00 00 1c 47 00 | 00 01 7e 9e 7d 92 a5 a0 |......G.|..~.}...|
|00000060| a6 f9 68 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |..h.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000080| 2f 2a 0d 20 2a 20 4d 61 | 63 69 6e 74 6f 73 68 20 |/*. * Ma|cintosh |
|00000090| 54 61 72 0d 20 2a 0d 20 | 2a 20 4d 6f 64 69 66 69 |Tar. *. |* Modifi|
|000000a0| 65 64 20 62 79 20 43 72 | 61 69 67 20 52 75 66 66 |ed by Cr|aig Ruff|
|000000b0| 20 66 6f 72 20 75 73 65 | 20 6f 6e 20 74 68 65 20 | for use| on the |
|000000c0| 4d 61 63 69 6e 74 6f 73 | 68 2e 0d 20 2a 2f 0d 2f |Macintos|h.. */./|
|000000d0| 2a 0d 20 2a 20 4c 69 73 | 74 20 61 20 74 61 72 20 |*. * Lis|t a tar |
|000000e0| 61 72 63 68 69 76 65 2e | 0d 20 2a 0d 20 2a 20 41 |archive.|. *. * A|
|000000f0| 6c 73 6f 20 69 6e 63 6c | 75 64 65 73 20 73 75 70 |lso incl|udes sup|
|00000100| 70 6f 72 74 20 72 6f 75 | 74 69 6e 65 73 20 66 6f |port rou|tines fo|
|00000110| 72 20 72 65 61 64 69 6e | 67 20 61 20 74 61 72 20 |r readin|g a tar |
|00000120| 61 72 63 68 69 76 65 2e | 0d 20 2a 0d 20 2a 20 50 |archive.|. *. * P|
|00000130| 75 62 69 63 20 44 6f 6d | 61 69 6e 20 76 65 72 73 |ubic Dom|ain vers|
|00000140| 69 6f 6e 20 77 72 69 74 | 74 65 6e 20 32 36 20 41 |ion writ|ten 26 A|
|00000150| 75 67 20 31 39 38 35 20 | 62 79 20 4a 6f 68 6e 20 |ug 1985 |by John |
|00000160| 47 69 6c 6d 6f 72 65 20 | 28 69 68 6e 70 34 21 68 |Gilmore |(ihnp4!h|
|00000170| 6f 70 74 6f 61 64 21 67 | 6e 75 29 2e 0d 20 2a 0d |optoad!g|nu).. *.|
|00000180| 20 2a 20 40 28 23 29 6c | 69 73 74 2e 63 20 31 2e | * @(#)l|ist.c 1.|
|00000190| 31 38 20 39 2f 32 33 2f | 38 36 20 50 75 62 6c 69 |18 9/23/|86 Publi|
|000001a0| 63 20 44 6f 6d 61 69 6e | 20 2d 20 67 6e 75 0d 20 |c Domain| - gnu. |
|000001b0| 2a 2f 0d 23 69 6e 63 6c | 75 64 65 20 22 74 61 72 |*/.#incl|ude "tar|
|000001c0| 2e 68 22 0d 0d 63 68 61 | 72 20 2a 63 74 69 6d 65 |.h"..cha|r *ctime|
|000001d0| 28 29 3b 09 09 09 09 2f | 2a 20 46 72 6f 6d 20 6c |();..../|* From l|
|000001e0| 69 62 63 2e 61 20 2a 2f | 0d 0d 23 64 65 66 69 6e |ibc.a */|..#defin|
|000001f0| 65 09 69 73 6f 64 69 67 | 69 74 28 63 29 09 28 20 |e.isodig|it(c).( |
|00000200| 28 28 63 29 20 3e 3d 20 | 27 30 27 29 20 26 26 20 |((c) >= |'0') && |
|00000210| 28 28 63 29 20 3c 3d 20 | 27 37 27 29 20 29 0d 23 |((c) <= |'7') ).#|
|00000220| 64 65 66 69 6e 65 20 69 | 73 73 70 61 63 65 28 63 |define i|sspace(c|
|00000230| 29 09 28 28 63 29 20 3d | 3d 20 27 20 27 29 0d 0d |).((c) =|= ' ')..|
|00000240| 6c 6f 6e 67 20 46 72 6f | 6d 4f 63 74 28 29 3b 09 |long Fro|mOct();.|
|00000250| 09 09 2f 2a 20 44 65 63 | 6f 64 65 20 6f 63 74 61 |../* Dec|ode octa|
|00000260| 6c 20 6e 75 6d 62 65 72 | 20 2a 2f 0d 0d 75 6e 69 |l number| */..uni|
|00000270| 6f 6e 20 72 65 63 6f 72 | 64 20 2a 68 65 61 64 3b |on recor|d *head;|
|00000280| 09 09 2f 2a 20 50 6f 69 | 6e 74 73 20 74 6f 20 63 |../* Poi|nts to c|
|00000290| 75 72 72 65 6e 74 20 61 | 72 63 68 69 76 65 20 68 |urrent a|rchive h|
|000002a0| 65 61 64 65 72 20 2a 2f | 0d 73 74 72 75 63 74 20 |eader */|.struct |
|000002b0| 73 74 61 74 20 7b 0d 09 | 6c 6f 6e 67 09 73 74 5f |stat {..|long.st_|
|000002c0| 73 69 7a 65 3b 0d 09 6c | 6f 6e 67 09 73 74 5f 6d |size;..l|ong.st_m|
|000002d0| 74 69 6d 65 3b 0d 7d 20 | 68 73 74 61 74 3b 09 09 |time;.} |hstat;..|
|000002e0| 09 2f 2a 20 46 61 6b 65 | 20 73 74 61 74 20 73 74 |./* Fake| stat st|
|000002f0| 72 75 63 74 20 66 6f 72 | 20 63 6f 6d 70 61 74 2e |ruct for| compat.|
|00000300| 20 2a 2f 0d 0d 76 6f 69 | 64 09 50 72 69 6e 74 48 | */..voi|d.PrintH|
|00000310| 65 61 64 65 72 28 29 3b | 0d 76 6f 69 64 09 52 65 |eader();|.void.Re|
|00000320| 61 64 41 6e 64 28 29 3b | 0d 42 6f 6f 6c 65 61 6e |adAnd();|.Boolean|
|00000330| 09 4c 69 73 74 41 72 63 | 68 69 76 65 28 29 2c 20 |.ListArc|hive(), |
|00000340| 53 6b 69 70 46 69 6c 65 | 28 29 3b 0d 0d 2f 2a 0d |SkipFile|();../*.|
|00000350| 20 2a 20 4c 69 73 74 20 | 2d 20 6c 69 73 74 20 61 | * List |- list a|
|00000360| 6e 20 61 72 63 68 69 76 | 65 20 66 69 6c 65 0d 20 |n archiv|e file. |
|00000370| 2a 2f 0d 4c 69 73 74 28 | 29 20 7b 0d 09 50 6f 69 |*/.List(|) {..Poi|
|00000380| 6e 74 09 09 77 68 65 72 | 65 3b 0d 09 53 46 52 65 |nt..wher|e;..SFRe|
|00000390| 70 6c 79 09 09 72 65 70 | 6c 79 3b 0d 09 42 6f 6f |ply..rep|ly;..Boo|
|000003a0| 6c 65 61 6e 09 09 6f 6c | 64 41 75 74 6f 50 61 67 |lean..ol|dAutoPag|
|000003b0| 65 20 3d 20 61 75 74 6f | 50 61 67 65 3b 0d 0d 09 |e = auto|Page;...|
|000003c0| 2f 2a 0d 09 20 2a 20 55 | 73 65 20 73 74 61 6e 64 |/*.. * U|se stand|
|000003d0| 61 72 64 20 66 69 6c 65 | 20 74 6f 20 67 65 74 20 |ard file| to get |
|000003e0| 74 68 65 20 61 72 63 68 | 69 76 65 20 66 69 6c 65 |the arch|ive file|
|000003f0| 2e 0d 09 20 2a 20 41 6c | 77 61 79 73 20 64 6f 20 |... * Al|ways do |
|00000400| 61 20 73 63 72 65 65 6e | 20 61 74 20 61 20 74 69 |a screen| at a ti|
|00000410| 6d 65 20 69 66 20 74 6f | 20 74 68 65 20 73 63 72 |me if to| the scr|
|00000420| 65 65 6e 2e 0d 09 20 2a | 2f 0d 09 77 68 65 72 65 |een... *|/..where|
|00000430| 2e 68 20 3d 20 77 68 65 | 72 65 2e 76 20 3d 20 37 |.h = whe|re.v = 7|
|00000440| 35 3b 0d 09 53 46 47 65 | 74 46 69 6c 65 28 77 68 |5;..SFGe|tFile(wh|
|00000450| 65 72 65 2c 20 22 5c 70 | 4e 61 6d 65 20 6f 66 20 |ere, "\p|Name of |
|00000460| 54 41 52 20 66 69 6c 65 | 3a 22 2c 20 6e 69 6c 2c |TAR file|:", nil,|
|00000470| 20 2d 31 2c 20 6e 69 6c | 2c 20 6e 69 6c 2c 20 26 | -1, nil|, nil, &|
|00000480| 72 65 70 6c 79 29 3b 0d | 09 69 66 20 28 21 72 65 |reply);.|.if (!re|
|00000490| 70 6c 79 2e 67 6f 6f 64 | 29 0d 09 09 72 65 74 75 |ply.good|)...retu|
|000004a0| 72 6e 3b 0d 0d 09 61 72 | 56 52 65 66 4e 75 6d 20 |rn;...ar|VRefNum |
|000004b0| 3d 20 72 65 70 6c 79 2e | 76 52 65 66 4e 75 6d 3b |= reply.|vRefNum;|
|000004c0| 0d 09 61 72 4e 61 6d 65 | 20 3d 20 72 65 70 6c 79 |..arName| = reply|
|000004d0| 2e 66 4e 61 6d 65 3b 0d | 09 69 66 20 28 57 69 6e |.fName;.|.if (Win|
|000004e0| 64 49 6e 69 74 28 29 29 | 0d 09 09 72 65 74 75 72 |dInit())|...retur|
|000004f0| 6e 3b 0d 0d 09 61 75 74 | 6f 50 61 67 65 20 3d 20 |n;...aut|oPage = |
|00000500| 74 72 75 65 3b 0d 09 54 | 65 78 74 46 61 63 65 28 |true;..T|extFace(|
|00000510| 75 6e 64 65 72 6c 69 6e | 65 29 3b 0d 09 57 50 72 |underlin|e);..WPr|
|00000520| 69 6e 74 66 28 68 65 61 | 64 65 72 29 3b 0d 09 54 |intf(hea|der);..T|
|00000530| 65 78 74 46 61 63 65 28 | 30 29 3b 0d 0d 09 52 65 |extFace(|0);...Re|
|00000540| 61 64 41 6e 64 28 4c 69 | 73 74 41 72 63 68 69 76 |adAnd(Li|stArchiv|
|00000550| 65 29 3b 0d 09 43 6c 6f | 73 65 41 72 63 68 69 76 |e);..Clo|seArchiv|
|00000560| 65 28 29 3b 0d 09 57 69 | 6e 64 45 6e 64 28 74 72 |e();..Wi|ndEnd(tr|
|00000570| 75 65 29 3b 0d 09 61 75 | 74 6f 50 61 67 65 20 3d |ue);..au|toPage =|
|00000580| 20 6f 6c 64 41 75 74 6f | 50 61 67 65 3b 0d 7d 0d | oldAuto|Page;.}.|
|00000590| 0d 2f 2a 0d 20 2a 20 4d | 61 69 6e 20 6c 6f 6f 70 |./*. * M|ain loop|
|000005a0| 20 66 6f 72 20 72 65 61 | 64 69 6e 67 20 61 6e 20 | for rea|ding an |
|000005b0| 61 72 63 68 69 76 65 2e | 0d 20 2a 2f 0d 76 6f 69 |archive.|. */.voi|
|000005c0| 64 0d 52 65 61 64 41 6e | 64 28 64 6f 53 6f 6d 65 |d.ReadAn|d(doSome|
|000005d0| 74 68 69 6e 67 29 0d 42 | 6f 6f 6c 65 61 6e 20 28 |thing).B|oolean (|
|000005e0| 2a 64 6f 53 6f 6d 65 74 | 68 69 6e 67 29 28 29 3b |*doSomet|hing)();|
|000005f0| 0d 7b 0d 09 69 6e 74 20 | 09 09 73 74 61 74 75 73 |.{..int |..status|
|00000600| 20 3d 20 31 3b 0d 09 69 | 6e 74 20 09 09 70 72 65 | = 1;..i|nt ..pre|
|00000610| 76 53 74 61 74 75 73 3b | 0d 09 42 6f 6f 6c 65 61 |vStatus;|..Boolea|
|00000620| 6e 09 09 65 72 72 46 6f | 75 6e 64 20 3d 20 66 61 |n..errFo|und = fa|
|00000630| 6c 73 65 3b 0d 09 45 76 | 65 6e 74 52 65 63 6f 72 |lse;..Ev|entRecor|
|00000640| 64 09 65 3b 0d 09 43 75 | 72 73 48 61 6e 64 6c 65 |d.e;..Cu|rsHandle|
|00000650| 09 63 75 72 73 6f 72 3b | 0d 0d 09 69 66 20 28 28 |.cursor;|...if ((|
|00000660| 63 75 72 73 6f 72 20 3d | 20 47 65 74 43 75 72 73 |cursor =| GetCurs|
|00000670| 6f 72 28 77 61 74 63 68 | 43 75 72 73 6f 72 29 29 |or(watch|Cursor))|
|00000680| 20 21 3d 20 6e 69 6c 29 | 0d 09 09 53 65 74 43 75 | != nil)|...SetCu|
|00000690| 72 73 6f 72 28 2a 63 75 | 72 73 6f 72 29 3b 0d 0d |rsor(*cu|rsor);..|
|000006a0| 09 4f 70 65 6e 41 72 63 | 68 69 76 65 28 31 29 3b |.OpenArc|hive(1);|
|000006b0| 09 09 2f 2a 20 4f 70 65 | 6e 20 66 6f 72 20 72 65 |../* Ope|n for re|
|000006c0| 61 64 69 6e 67 20 2a 2f | 0d 0d 09 77 68 69 6c 65 |ading */|...while|
|000006d0| 20 28 21 65 72 72 46 6f | 75 6e 64 29 20 7b 0d 09 | (!errFo|und) {..|
|000006e0| 09 53 79 73 74 65 6d 54 | 61 73 6b 28 29 3b 0d 09 |.SystemT|ask();..|
|000006f0| 09 69 66 20 28 45 76 65 | 6e 74 41 76 61 69 6c 28 |.if (Eve|ntAvail(|
|00000700| 6b 65 79 44 6f 77 6e 4d | 61 73 6b 2c 20 26 65 29 |keyDownM|ask, &e)|
|00000710| 20 26 26 20 28 65 2e 77 | 68 61 74 20 21 3d 20 6e | && (e.w|hat != n|
|00000720| 75 6c 6c 45 76 65 6e 74 | 29 29 20 7b 0d 09 09 09 |ullEvent|)) {....|
|00000730| 69 66 20 28 0d 09 09 09 | 09 28 65 2e 6d 6f 64 69 |if (....|.(e.modi|
|00000740| 66 69 65 72 73 20 26 20 | 63 6d 64 4b 65 79 29 20 |fiers & |cmdKey) |
|00000750| 26 26 0d 09 09 09 09 28 | 28 65 2e 6d 65 73 73 61 |&&.....(|(e.messa|
|00000760| 67 65 20 26 20 63 68 61 | 72 43 6f 64 65 4d 61 73 |ge & cha|rCodeMas|
|00000770| 6b 29 20 3d 3d 20 27 2e | 27 29 0d 09 09 09 29 20 |k) == '.|')....) |
|00000780| 7b 0d 09 09 09 09 47 65 | 74 4e 65 78 74 45 76 65 |{.....Ge|tNextEve|
|00000790| 6e 74 28 6b 65 79 44 6f | 77 6e 4d 61 73 6b 2c 20 |nt(keyDo|wnMask, |
|000007a0| 26 65 29 3b 0d 09 09 09 | 09 62 72 65 61 6b 3b 0d |&e);....|.break;.|
|000007b0| 09 09 09 7d 0d 09 09 7d | 0d 0d 09 09 70 72 65 76 |...}...}|....prev|
|000007c0| 53 74 61 74 75 73 20 3d | 20 73 74 61 74 75 73 3b |Status =| status;|
|000007d0| 0d 09 09 73 74 61 74 75 | 73 20 3d 20 52 65 61 64 |...statu|s = Read|
|000007e0| 48 65 61 64 65 72 28 29 | 3b 0d 09 09 73 77 69 74 |Header()|;...swit|
|000007f0| 63 68 20 28 73 74 61 74 | 75 73 29 20 7b 0d 09 09 |ch (stat|us) {...|
|00000800| 63 61 73 65 20 31 3a 09 | 09 09 2f 2a 20 56 61 6c |case 1:.|../* Val|
|00000810| 69 64 20 68 65 61 64 65 | 72 20 2a 2f 0d 09 09 09 |id heade|r */....|
|00000820| 2f 2a 20 57 65 20 73 68 | 6f 75 6c 64 20 64 65 63 |/* We sh|ould dec|
|00000830| 6f 64 65 20 6e 65 78 74 | 20 66 69 65 6c 64 20 28 |ode next| field (|
|00000840| 6d 6f 64 65 29 20 66 69 | 72 73 74 2e 2e 2e 20 2a |mode) fi|rst... *|
|00000850| 2f 0d 09 09 09 2f 2a 20 | 45 6e 73 75 72 65 20 69 |/..../* |Ensure i|
|00000860| 6e 63 6f 6d 69 6e 67 20 | 6e 61 6d 65 73 20 61 72 |ncoming |names ar|
|00000870| 65 20 6e 75 6c 6c 20 74 | 65 72 6d 69 6e 61 74 65 |e null t|erminate|
|00000880| 64 2e 20 2a 2f 0d 09 09 | 09 68 65 61 64 2d 3e 68 |d. */...|.head->h|
|00000890| 65 61 64 65 72 2e 6e 61 | 6d 65 5b 4e 41 4d 53 49 |eader.na|me[NAMSI|
|000008a0| 5a 2d 31 5d 20 3d 20 27 | 5c 30 27 3b 0d 09 09 09 |Z-1] = '|\0';....|
|000008b0| 65 72 72 46 6f 75 6e 64 | 20 3d 20 28 2a 64 6f 53 |errFound| = (*doS|
|000008c0| 6f 6d 65 74 68 69 6e 67 | 29 28 29 3b 0d 09 09 09 |omething|)();....|
|000008d0| 63 6f 6e 74 69 6e 75 65 | 3b 0d 0d 09 09 09 2f 2a |continue|;...../*|
|000008e0| 0d 09 09 09 20 2a 20 49 | 66 20 74 68 65 20 70 72 |.... * I|f the pr|
|000008f0| 65 76 69 6f 75 73 20 68 | 65 61 64 65 72 20 77 61 |evious h|eader wa|
|00000900| 73 20 67 6f 6f 64 2c 20 | 74 65 6c 6c 20 74 68 65 |s good, |tell the|
|00000910| 6d 0d 09 09 09 20 2a 20 | 74 68 61 74 20 77 65 20 |m.... * |that we |
|00000920| 61 72 65 20 73 6b 69 70 | 70 69 6e 67 20 62 61 64 |are skip|ping bad|
|00000930| 20 6f 6e 65 73 2e 0d 09 | 09 09 20 2a 2f 0d 09 09 | ones...|.. */...|
|00000940| 63 61 73 65 20 30 3a 09 | 09 09 2f 2a 20 49 6e 76 |case 0:.|../* Inv|
|00000950| 61 6c 69 64 20 68 65 61 | 64 65 72 20 2a 2f 0d 09 |alid hea|der */..|
|00000960| 09 63 61 73 65 30 3a 0d | 09 09 09 55 73 65 52 65 |.case0:.|...UseRe|
|00000970| 63 28 68 65 61 64 29 3b | 0d 09 09 09 69 66 20 28 |c(head);|....if (|
|00000980| 70 72 65 76 53 74 61 74 | 75 73 20 3d 3d 20 31 29 |prevStat|us == 1)|
|00000990| 20 7b 0d 09 09 09 09 50 | 67 6d 41 6c 65 72 74 28 | {.....P|gmAlert(|
|000009a0| 22 5c 70 52 65 61 64 41 | 6e 64 22 2c 0d 09 09 09 |"\pReadA|nd",....|
|000009b0| 09 09 22 5c 70 53 6b 69 | 70 70 69 6e 67 20 74 6f |.."\pSki|pping to|
|000009c0| 20 6e 65 78 74 20 66 69 | 6c 65 20 68 65 61 64 65 | next fi|le heade|
|000009d0| 72 2e 2e 2e 22 2c 0d 09 | 09 09 09 09 6e 69 6c 29 |r...",..|....nil)|
|000009e0| 3b 0d 09 09 09 7d 0d 09 | 09 09 63 6f 6e 74 69 6e |;....}..|..contin|
|000009f0| 75 65 3b 0d 0d 09 09 63 | 61 73 65 20 32 3a 09 09 |ue;....c|ase 2:..|
|00000a00| 09 2f 2a 20 42 6c 6f 63 | 6b 20 6f 66 20 7a 65 72 |./* Bloc|k of zer|
|00000a10| 6f 65 73 20 2a 2f 0d 09 | 09 09 69 66 20 28 69 67 |oes */..|..if (ig|
|00000a20| 6e 6f 72 65 7a 29 09 0d | 09 09 09 09 67 6f 74 6f |norez)..|....goto|
|00000a30| 20 63 61 73 65 30 3b 09 | 2f 2a 20 4a 75 73 74 20 | case0;.|/* Just |
|00000a40| 73 6b 69 70 20 69 66 20 | 61 73 6b 65 64 20 2a 2f |skip if |asked */|
|00000a50| 0d 09 09 09 2f 2a 20 46 | 41 4c 4c 20 54 48 52 55 |..../* F|ALL THRU|
|00000a60| 20 2a 2f 0d 09 09 63 61 | 73 65 20 28 69 6e 74 29 | */...ca|se (int)|
|00000a70| 20 45 4f 46 3a 09 09 2f | 2a 20 45 6e 64 20 6f 66 | EOF:../|* End of|
|00000a80| 20 61 72 63 68 69 76 65 | 20 2a 2f 0d 09 09 09 62 | archive| */....b|
|00000a90| 72 65 61 6b 3b 0d 09 09 | 7d 0d 09 09 62 72 65 61 |reak;...|}...brea|
|00000aa0| 6b 3b 0d 09 7d 0d 0d 09 | 43 6c 6f 73 65 41 72 63 |k;..}...|CloseArc|
|00000ab0| 68 69 76 65 28 29 3b 0d | 09 53 65 74 43 75 72 73 |hive();.|.SetCurs|
|00000ac0| 6f 72 28 26 71 64 2e 61 | 72 72 6f 77 29 3b 0d 7d |or(&qd.a|rrow);.}|
|00000ad0| 09 09 0d 0d 0d 2f 2a 0d | 20 2a 20 50 72 69 6e 74 |...../*.| * Print|
|00000ae0| 20 61 20 68 65 61 64 65 | 72 20 72 65 63 6f 72 64 | a heade|r record|
|00000af0| 2c 20 62 61 73 65 64 20 | 6f 6e 20 74 61 72 20 6f |, based |on tar o|
|00000b00| 70 74 69 6f 6e 73 2e 0d | 20 2a 2f 0d 42 6f 6f 6c |ptions..| */.Bool|
|00000b10| 65 61 6e 0d 4c 69 73 74 | 41 72 63 68 69 76 65 28 |ean.List|Archive(|
|00000b20| 29 0d 7b 0d 09 6c 6f 6e | 67 20 74 3b 0d 0d 09 2f |).{..lon|g t;.../|
|00000b30| 2a 20 53 61 76 65 20 74 | 68 65 20 72 65 63 6f 72 |* Save t|he recor|
|00000b40| 64 20 2a 2f 0d 09 53 61 | 76 65 52 65 63 28 26 68 |d */..Sa|veRec(&h|
|00000b50| 65 61 64 29 3b 0d 0d 09 | 2f 2a 0d 09 20 2a 20 50 |ead);...|/*.. * P|
|00000b60| 72 69 6e 74 20 74 68 65 | 20 68 65 61 64 65 72 20 |rint the| header |
|00000b70| 72 65 63 6f 72 64 2e 0d | 09 20 2a 20 44 6f 6e 27 |record..|. * Don'|
|00000b80| 74 20 73 6c 69 6e 67 20 | 74 68 65 20 6e 61 6d 65 |t sling |the name|
|00000b90| 73 20 74 6f 6f 20 66 61 | 73 74 21 0d 09 20 2a 2f |s too fa|st!.. */|
|00000ba0| 0d 09 50 72 69 6e 74 48 | 65 61 64 65 72 28 29 3b |..PrintH|eader();|
|00000bb0| 0d 09 69 66 20 28 21 61 | 75 74 6f 50 61 67 65 29 |..if (!a|utoPage)|
|00000bc0| 0d 09 09 44 65 6c 61 79 | 28 36 30 4c 2c 20 26 74 |...Delay|(60L, &t|
|00000bd0| 29 3b 0d 0d 09 2f 2a 20 | 53 6b 69 70 20 70 61 73 |);.../* |Skip pas|
|00000be0| 74 20 69 74 20 69 6e 20 | 74 68 65 20 61 72 63 68 |t it in |the arch|
|00000bf0| 69 76 65 20 2a 2f 0d 09 | 53 61 76 65 52 65 63 28 |ive */..|SaveRec(|
|00000c00| 28 75 6e 69 6f 6e 20 72 | 65 63 6f 72 64 20 2a 2a |(union r|ecord **|
|00000c10| 29 20 30 29 3b 09 2f 2a | 20 55 6e 73 61 76 65 20 |) 0);./*| Unsave |
|00000c20| 69 74 20 2a 2f 0d 09 55 | 73 65 52 65 63 28 68 65 |it */..U|seRec(he|
|00000c30| 61 64 29 3b 0d 0d 09 2f | 2a 20 53 6b 69 70 20 74 |ad);.../|* Skip t|
|00000c40| 6f 20 74 68 65 20 6e 65 | 78 74 20 68 65 61 64 65 |o the ne|xt heade|
|00000c50| 72 20 6f 6e 20 74 68 65 | 20 61 72 63 68 69 76 65 |r on the| archive|
|00000c60| 20 2a 2f 0d 09 72 65 74 | 75 72 6e 28 53 6b 69 70 | */..ret|urn(Skip|
|00000c70| 46 69 6c 65 28 28 6c 6f | 6e 67 29 68 73 74 61 74 |File((lo|ng)hstat|
|00000c80| 2e 73 74 5f 73 69 7a 65 | 29 29 3b 0d 7d 0d 0d 0d |.st_size|));.}...|
|00000c90| 2f 2a 0d 20 2a 20 52 65 | 61 64 20 61 20 72 65 63 |/*. * Re|ad a rec|
|00000ca0| 6f 72 64 20 74 68 61 74 | 27 73 20 73 75 70 70 6f |ord that|'s suppo|
|00000cb0| 73 65 64 20 74 6f 20 62 | 65 20 61 20 68 65 61 64 |sed to b|e a head|
|00000cc0| 65 72 20 72 65 63 6f 72 | 64 2e 0d 20 2a 20 52 65 |er recor|d.. * Re|
|00000cd0| 74 75 72 6e 20 69 74 73 | 20 61 64 64 72 65 73 73 |turn its| address|
|00000ce0| 20 69 6e 20 22 68 65 61 | 64 22 2c 20 61 6e 64 20 | in "hea|d", and |
|00000cf0| 69 66 20 69 74 20 69 73 | 20 67 6f 6f 64 2c 20 74 |if it is| good, t|
|00000d00| 68 65 20 66 69 6c 65 27 | 73 0d 20 2a 20 73 69 7a |he file'|s. * siz|
|00000d10| 65 20 69 6e 20 68 73 74 | 61 74 2e 73 74 5f 73 69 |e in hst|at.st_si|
|00000d20| 7a 65 2e 0d 20 2a 0d 20 | 2a 20 52 65 74 75 72 6e |ze.. *. |* Return|
|00000d30| 20 31 20 66 6f 72 20 73 | 75 63 63 65 73 73 2c 20 | 1 for s|uccess, |
|00000d40| 30 20 69 66 20 74 68 65 | 20 63 68 65 63 6b 73 75 |0 if the| checksu|
|00000d50| 6d 20 69 73 20 62 61 64 | 2c 20 45 4f 46 20 6f 6e |m is bad|, EOF on|
|00000d60| 20 65 6f 66 2c 0d 20 2a | 20 32 20 66 6f 72 20 61 | eof,. *| 2 for a|
|00000d70| 20 62 6c 6f 63 6b 20 66 | 75 6c 6c 20 6f 66 20 7a | block f|ull of z|
|00000d80| 65 72 6f 73 20 28 45 4f | 46 20 6d 61 72 6b 65 72 |eros (EO|F marker|
|00000d90| 29 2e 0d 20 2a 0d 20 2a | 20 59 6f 75 20 6d 75 73 |).. *. *| You mus|
|00000da0| 74 20 61 6c 77 61 79 73 | 20 75 73 65 72 65 63 28 |t always| userec(|
|00000db0| 68 65 61 64 29 20 74 6f | 20 73 6b 69 70 20 70 61 |head) to| skip pa|
|00000dc0| 73 74 20 74 68 65 20 68 | 65 61 64 65 72 20 77 68 |st the h|eader wh|
|00000dd0| 69 63 68 20 74 68 69 73 | 0d 20 2a 20 72 6f 75 74 |ich this|. * rout|
|00000de0| 69 6e 65 20 72 65 61 64 | 73 2e 0d 20 2a 2f 0d 69 |ine read|s.. */.i|
|00000df0| 6e 74 0d 52 65 61 64 48 | 65 61 64 65 72 28 29 0d |nt.ReadH|eader().|
|00000e00| 7b 0d 09 72 65 67 69 73 | 74 65 72 20 69 6e 74 09 |{..regis|ter int.|
|00000e10| 69 3b 0d 09 72 65 67 69 | 73 74 65 72 20 6c 6f 6e |i;..regi|ster lon|
|00000e20| 67 09 73 75 6d 2c 20 72 | 65 63 73 75 6d 3b 0d 09 |g.sum, r|ecsum;..|
|00000e30| 72 65 67 69 73 74 65 72 | 20 63 68 61 72 09 2a 70 |register| char.*p|
|00000e40| 3b 0d 09 72 65 67 69 73 | 74 65 72 20 75 6e 69 6f |;..regis|ter unio|
|00000e50| 6e 20 72 65 63 6f 72 64 | 20 2a 68 65 61 64 65 72 |n record| *header|
|00000e60| 3b 0d 0d 09 68 65 61 64 | 65 72 20 3d 20 46 69 6e |;...head|er = Fin|
|00000e70| 64 52 65 63 28 29 3b 0d | 09 68 65 61 64 20 3d 20 |dRec();.|.head = |
|00000e80| 68 65 61 64 65 72 3b 09 | 09 2f 2a 20 54 68 69 73 |header;.|./* This|
|00000e90| 20 69 73 20 6f 75 72 20 | 63 75 72 72 65 6e 74 20 | is our |current |
|00000ea0| 68 65 61 64 65 72 20 2a | 2f 0d 09 69 66 20 28 68 |header *|/..if (h|
|00000eb0| 65 61 64 65 72 20 3d 3d | 20 6e 69 6c 29 0d 09 09 |eader ==| nil)...|
|00000ec0| 72 65 74 75 72 6e 28 45 | 4f 46 29 3b 0d 0d 09 72 |return(E|OF);...r|
|00000ed0| 65 63 73 75 6d 20 3d 20 | 46 72 6f 6d 4f 63 74 28 |ecsum = |FromOct(|
|00000ee0| 38 2c 20 20 68 65 61 64 | 65 72 2d 3e 68 65 61 64 |8, head|er->head|
|00000ef0| 65 72 2e 63 68 6b 73 75 | 6d 29 3b 0d 09 73 75 6d |er.chksu|m);..sum|
|00000f00| 20 3d 20 30 3b 0d 09 70 | 20 3d 20 68 65 61 64 65 | = 0;..p| = heade|
|00000f10| 72 2d 3e 63 68 61 72 70 | 74 72 3b 0d 09 66 6f 72 |r->charp|tr;..for|
|00000f20| 20 28 69 20 3d 20 73 69 | 7a 65 6f 66 28 2a 68 65 | (i = si|zeof(*he|
|00000f30| 61 64 65 72 29 3b 20 2d | 2d 69 20 3e 3d 20 30 3b |ader); -|-i >= 0;|
|00000f40| 29 20 7b 0d 09 09 2f 2a | 0d 09 09 20 2a 20 57 65 |) {.../*|... * We|
|00000f50| 20 63 61 6e 27 74 20 75 | 73 65 20 75 6e 73 69 67 | can't u|se unsig|
|00000f60| 6e 65 64 20 63 68 61 72 | 20 68 65 72 65 20 62 65 |ned char| here be|
|00000f70| 63 61 75 73 65 20 6f 66 | 20 6f 6c 64 20 63 6f 6d |cause of| old com|
|00000f80| 70 69 6c 65 72 73 2c 0d | 09 09 20 2a 20 65 2e 67 |pilers,.|.. * e.g|
|00000f90| 2e 20 56 37 2e 0d 09 09 | 20 2a 2f 0d 09 09 73 75 |. V7....| */...su|
|00000fa0| 6d 20 2b 3d 20 30 78 46 | 46 20 26 20 2a 70 2b 2b |m += 0xF|F & *p++|
|00000fb0| 3b 0d 09 7d 0d 0d 09 2f | 2a 20 41 64 6a 75 73 74 |;..}.../|* Adjust|
|00000fc0| 20 63 68 65 63 6b 73 75 | 6d 20 74 6f 20 63 6f 75 | checksu|m to cou|
|00000fd0| 6e 74 20 74 68 65 20 22 | 63 68 6b 73 75 6d 22 20 |nt the "|chksum" |
|00000fe0| 66 69 65 6c 64 20 61 73 | 20 62 6c 61 6e 6b 73 2e |field as| blanks.|
|00000ff0| 20 2a 2f 0d 09 66 6f 72 | 20 28 69 20 3d 20 73 69 | */..for| (i = si|
|00001000| 7a 65 6f 66 28 68 65 61 | 64 65 72 2d 3e 68 65 61 |zeof(hea|der->hea|
|00001010| 64 65 72 2e 63 68 6b 73 | 75 6d 29 3b 20 2d 2d 69 |der.chks|um); --i|
|00001020| 20 3e 3d 20 30 3b 29 0d | 09 09 73 75 6d 20 2d 3d | >= 0;).|..sum -=|
|00001030| 20 30 78 46 46 20 26 20 | 68 65 61 64 65 72 2d 3e | 0xFF & |header->|
|00001040| 68 65 61 64 65 72 2e 63 | 68 6b 73 75 6d 5b 69 5d |header.c|hksum[i]|
|00001050| 3b 0d 09 73 75 6d 20 2b | 3d 20 27 20 27 20 2a 20 |;..sum +|= ' ' * |
|00001060| 73 69 7a 65 6f 66 28 68 | 65 61 64 65 72 2d 3e 68 |sizeof(h|eader->h|
|00001070| 65 61 64 65 72 2e 63 68 | 6b 73 75 6d 29 3b 0d 0d |eader.ch|ksum);..|
|00001080| 09 69 66 20 28 73 75 6d | 20 3d 3d 20 72 65 63 73 |.if (sum| == recs|
|00001090| 75 6d 29 20 7b 0d 09 09 | 2f 2a 0d 09 09 20 2a 20 |um) {...|/*... * |
|000010a0| 47 6f 6f 64 20 72 65 63 | 6f 72 64 2e 20 20 44 65 |Good rec|ord. De|
|000010b0| 63 6f 64 65 20 66 69 6c | 65 20 73 69 7a 65 20 61 |code fil|e size a|
|000010c0| 6e 64 20 72 65 74 75 72 | 6e 2e 0d 09 09 20 2a 2f |nd retur|n.... */|
|000010d0| 0d 09 09 68 73 74 61 74 | 2e 73 74 5f 73 69 7a 65 |...hstat|.st_size|
|000010e0| 20 3d 20 46 72 6f 6d 4f | 63 74 28 31 2b 31 32 2c | = FromO|ct(1+12,|
|000010f0| 20 68 65 61 64 65 72 2d | 3e 68 65 61 64 65 72 2e | header-|>header.|
|00001100| 73 69 7a 65 29 3b 0d 09 | 09 72 65 74 75 72 6e 28 |size);..|.return(|
|00001110| 31 29 3b 0d 09 7d 0d 0d | 09 69 66 20 28 73 75 6d |1);..}..|.if (sum|
|00001120| 20 3d 3d 20 38 20 2a 20 | 27 20 27 29 20 7b 0d 09 | == 8 * |' ') {..|
|00001130| 09 2f 2a 0d 09 09 20 2a | 20 54 68 69 73 20 69 73 |./*... *| This is|
|00001140| 20 61 20 7a 65 72 6f 65 | 64 20 62 6c 6f 63 6b 2e | a zeroe|d block.|
|00001150| 2e 2e 77 68 6f 6c 65 20 | 62 6c 6f 63 6b 20 69 73 |..whole |block is|
|00001160| 20 30 27 73 20 65 78 63 | 65 70 74 0d 09 09 20 2a | 0's exc|ept... *|
|00001170| 20 66 6f 72 20 74 68 65 | 20 38 20 62 6c 61 6e 6b | for the| 8 blank|
|00001180| 73 20 77 65 20 66 61 6b | 65 64 20 66 6f 72 20 74 |s we fak|ed for t|
|00001190| 68 65 20 63 68 65 63 6b | 73 75 6d 20 66 69 65 6c |he check|sum fiel|
|000011a0| 64 2e 0d 09 09 20 2a 2f | 0d 09 09 72 65 74 75 72 |d.... */|...retur|
|000011b0| 6e 28 32 29 3b 0d 09 7d | 0d 0d 09 72 65 74 75 72 |n(2);..}|...retur|
|000011c0| 6e 28 30 29 3b 0d 7d 0d | 0d 2f 2a 20 0d 20 2a 20 |n(0);.}.|./* . * |
|000011d0| 44 65 63 6f 64 65 20 74 | 68 69 6e 67 73 20 66 72 |Decode t|hings fr|
|000011e0| 6f 6d 20 61 20 66 69 6c | 65 20 68 65 61 64 65 72 |om a fil|e header|
|000011f0| 20 72 65 63 6f 72 64 20 | 69 6e 74 6f 20 61 20 22 | record |into a "|
|00001200| 73 74 72 75 63 74 20 73 | 74 61 74 22 2e 0d 20 2a |struct s|tat".. *|
|00001210| 0d 20 2a 20 72 65 61 64 | 5f 68 65 61 64 65 72 28 |. * read|_header(|
|00001220| 29 20 68 61 73 20 61 6c | 72 65 61 64 79 20 64 65 |) has al|ready de|
|00001230| 63 6f 64 65 64 20 74 68 | 65 20 63 68 65 63 6b 73 |coded th|e checks|
|00001240| 75 6d 20 61 6e 64 20 6c | 65 6e 67 74 68 2c 20 73 |um and l|ength, s|
|00001250| 6f 20 77 65 20 64 6f 6e | 27 74 2e 0d 20 2a 0d 20 |o we don|'t.. *. |
|00001260| 2a 20 49 66 20 77 61 6e | 74 75 67 20 21 3d 20 30 |* If wan|tug != 0|
|00001270| 2c 20 77 65 20 77 61 6e | 74 20 74 68 65 20 75 69 |, we wan|t the ui|
|00001280| 64 2f 67 72 6f 75 70 20 | 69 6e 66 6f 20 64 65 63 |d/group |info dec|
|00001290| 6f 64 65 64 20 66 72 6f | 6d 20 55 6e 69 78 20 53 |oded fro|m Unix S|
|000012a0| 74 61 6e 64 61 72 64 0d | 20 2a 20 74 61 70 65 73 |tandard.| * tapes|
|000012b0| 20 28 66 6f 72 20 65 78 | 74 72 61 63 74 69 6f 6e | (for ex|traction|
|000012c0| 29 2e 20 20 49 66 20 3d | 3d 20 30 2c 20 77 65 20 |). If =|= 0, we |
|000012d0| 61 72 65 20 6a 75 73 74 | 20 70 72 69 6e 74 69 6e |are just| printin|
|000012e0| 67 20 61 6e 79 77 61 79 | 2c 20 73 6f 20 73 61 76 |g anyway|, so sav|
|000012f0| 65 20 74 69 6d 65 2e 0d | 20 2a 2f 0d 44 65 63 6f |e time..| */.Deco|
|00001300| 64 65 48 65 61 64 65 72 | 28 68 65 61 64 65 72 2c |deHeader|(header,|
|00001310| 20 73 74 2c 20 77 61 6e | 74 75 67 29 0d 72 65 67 | st, wan|tug).reg|
|00001320| 69 73 74 65 72 20 75 6e | 69 6f 6e 20 72 65 63 6f |ister un|ion reco|
|00001330| 72 64 09 2a 68 65 61 64 | 65 72 3b 0d 72 65 67 69 |rd.*head|er;.regi|
|00001340| 73 74 65 72 20 73 74 72 | 75 63 74 20 73 74 61 74 |ster str|uct stat|
|00001350| 09 2a 73 74 3b 0d 69 6e | 74 09 77 61 6e 74 75 67 |.*st;.in|t.wantug|
|00001360| 3b 0d 7b 0d 23 70 72 61 | 67 6d 61 20 75 6e 75 73 |;.{.#pra|gma unus|
|00001370| 65 64 28 77 61 6e 74 75 | 67 29 0d 0d 09 73 74 2d |ed(wantu|g)...st-|
|00001380| 3e 73 74 5f 6d 74 69 6d | 65 20 3d 20 46 72 6f 6d |>st_mtim|e = From|
|00001390| 4f 63 74 28 31 2b 31 32 | 2c 20 68 65 61 64 65 72 |Oct(1+12|, header|
|000013a0| 2d 3e 68 65 61 64 65 72 | 2e 6d 74 69 6d 65 29 3b |->header|.mtime);|
|000013b0| 0d 7d 0d 0d 2f 2a 0d 20 | 2a 20 51 75 69 63 6b 20 |.}../*. |* Quick |
|000013c0| 61 6e 64 20 64 69 72 74 | 79 20 6f 63 74 61 6c 20 |and dirt|y octal |
|000013d0| 63 6f 6e 76 65 72 73 69 | 6f 6e 2e 0d 20 2a 0d 20 |conversi|on.. *. |
|000013e0| 2a 20 52 65 73 75 6c 74 | 20 69 73 20 2d 31 20 69 |* Result| is -1 i|
|000013f0| 66 20 74 68 65 20 66 69 | 65 6c 64 20 69 73 20 69 |f the fi|eld is i|
|00001400| 6e 76 61 6c 69 64 20 28 | 61 6c 6c 20 62 6c 61 6e |nvalid (|all blan|
|00001410| 6b 2c 20 6f 72 20 6e 6f | 6e 6f 63 74 61 6c 29 2e |k, or no|noctal).|
|00001420| 0d 20 2a 2f 0d 6c 6f 6e | 67 0d 46 72 6f 6d 4f 63 |. */.lon|g.FromOc|
|00001430| 74 28 64 69 67 73 2c 20 | 77 68 65 72 65 29 0d 72 |t(digs, |where).r|
|00001440| 65 67 69 73 74 65 72 20 | 69 6e 74 09 64 69 67 73 |egister |int.digs|
|00001450| 3b 0d 72 65 67 69 73 74 | 65 72 20 63 68 61 72 09 |;.regist|er char.|
|00001460| 2a 77 68 65 72 65 3b 0d | 7b 0d 09 72 65 67 69 73 |*where;.|{..regis|
|00001470| 74 65 72 20 6c 6f 6e 67 | 09 76 61 6c 75 65 3b 0d |ter long|.value;.|
|00001480| 0d 09 77 68 69 6c 65 20 | 28 69 73 73 70 61 63 65 |..while |(isspace|
|00001490| 28 2a 77 68 65 72 65 29 | 29 20 7b 09 09 2f 2a 20 |(*where)|) {../* |
|000014a0| 53 6b 69 70 20 73 70 61 | 63 65 73 20 2a 2f 0d 09 |Skip spa|ces */..|
|000014b0| 09 77 68 65 72 65 2b 2b | 3b 0d 09 09 69 66 20 28 |.where++|;...if (|
|000014c0| 2d 2d 64 69 67 73 20 3c | 3d 20 30 29 0d 09 09 09 |--digs <|= 0)....|
|000014d0| 72 65 74 75 72 6e 28 2d | 31 29 3b 09 09 2f 2a 20 |return(-|1);../* |
|000014e0| 41 6c 6c 20 62 6c 61 6e | 6b 20 66 69 65 6c 64 20 |All blan|k field |
|000014f0| 2a 2f 0d 09 7d 0d 0d 09 | 76 61 6c 75 65 20 3d 20 |*/..}...|value = |
|00001500| 30 3b 0d 09 77 68 69 6c | 65 20 28 64 69 67 73 20 |0;..whil|e (digs |
|00001510| 3e 20 30 20 26 26 20 69 | 73 6f 64 69 67 69 74 28 |> 0 && i|sodigit(|
|00001520| 2a 77 68 65 72 65 29 29 | 20 7b 09 2f 2a 20 53 63 |*where))| {./* Sc|
|00001530| 61 6e 20 74 69 6c 20 6e | 6f 6e 6f 63 74 61 6c 20 |an til n|onoctal |
|00001540| 2a 2f 0d 09 09 76 61 6c | 75 65 20 3d 20 28 76 61 |*/...val|ue = (va|
|00001550| 6c 75 65 20 3c 3c 20 33 | 29 20 7c 20 28 2a 77 68 |lue << 3|) | (*wh|
|00001560| 65 72 65 2b 2b 20 2d 20 | 27 30 27 29 3b 0d 09 09 |ere++ - |'0');...|
|00001570| 2d 2d 64 69 67 73 3b 0d | 09 7d 0d 0d 09 69 66 20 |--digs;.|.}...if |
|00001580| 28 64 69 67 73 20 3e 20 | 30 20 26 26 20 2a 77 68 |(digs > |0 && *wh|
|00001590| 65 72 65 20 26 26 20 21 | 69 73 73 70 61 63 65 28 |ere && !|isspace(|
|000015a0| 2a 77 68 65 72 65 29 29 | 0d 09 09 72 65 74 75 72 |*where))|...retur|
|000015b0| 6e 28 2d 31 29 3b 09 09 | 09 2f 2a 20 45 6e 64 65 |n(-1);..|./* Ende|
|000015c0| 64 20 6f 6e 20 6e 6f 6e | 2d 73 70 61 63 65 2f 6e |d on non|-space/n|
|000015d0| 75 6c 20 2a 2f 0d 0d 09 | 72 65 74 75 72 6e 28 76 |ul */...|return(v|
|000015e0| 61 6c 75 65 29 3b 0d 7d | 0d 0d 2f 2a 0d 20 2a 20 |alue);.}|../*. * |
|000015f0| 41 63 74 75 61 6c 6c 79 | 20 70 72 69 6e 74 20 69 |Actually| print i|
|00001600| 74 2e 0d 20 2a 2f 0d 23 | 64 65 66 69 6e 65 09 55 |t.. */.#|define.U|
|00001610| 47 53 57 49 44 54 48 09 | 39 09 2f 2a 20 6d 69 6e |GSWIDTH.|9./* min|
|00001620| 20 77 69 64 74 68 20 6f | 66 20 55 73 65 72 2c 20 | width o|f User, |
|00001630| 67 72 6f 75 70 2c 20 73 | 69 7a 65 20 2a 2f 0d 23 |group, s|ize */.#|
|00001640| 64 65 66 69 6e 65 09 44 | 41 54 45 57 49 44 54 48 |define.D|ATEWIDTH|
|00001650| 09 31 39 09 2f 2a 20 4c | 61 73 74 20 6d 6f 64 20 |.19./* L|ast mod |
|00001660| 64 61 74 65 20 2a 2f 0d | 73 74 61 74 69 63 20 69 |date */.|static i|
|00001670| 6e 74 20 75 67 73 77 69 | 64 74 68 20 3d 20 55 47 |nt ugswi|dth = UG|
|00001680| 53 57 49 44 54 48 3b 09 | 2f 2a 20 4d 61 78 20 77 |SWIDTH;.|/* Max w|
|00001690| 69 64 74 68 20 65 6e 63 | 6f 75 6e 74 65 72 65 64 |idth enc|ountered|
|000016a0| 20 73 6f 20 66 61 72 20 | 2a 2f 0d 0d 76 6f 69 64 | so far |*/..void|
|000016b0| 0d 50 72 69 6e 74 48 65 | 61 64 65 72 28 29 0d 7b |.PrintHe|ader().{|
|000016c0| 0d 09 63 68 61 72 20 6d | 6f 64 65 3b 0d 09 63 68 |..char m|ode;..ch|
|000016d0| 61 72 20 2a 74 69 6d 65 | 73 74 61 6d 70 3b 0d 09 |ar *time|stamp;..|
|000016e0| 63 68 61 72 20 73 69 7a | 65 5b 31 32 5d 3b 09 09 |char siz|e[12];..|
|000016f0| 2f 2a 20 48 6f 6c 64 73 | 20 61 20 66 6f 72 6d 61 |/* Holds| a forma|
|00001700| 74 74 65 64 20 6c 6f 6e | 67 20 2a 2f 0d 09 6c 6f |tted lon|g */..lo|
|00001710| 6e 67 20 6c 6f 6e 67 69 | 65 3b 09 09 2f 2a 20 54 |ng longi|e;../* T|
|00001720| 6f 20 6d 61 6b 65 20 63 | 74 69 6d 65 28 29 20 63 |o make c|time() c|
|00001730| 61 6c 6c 20 70 6f 72 74 | 61 62 6c 65 20 2a 2f 0d |all port|able */.|
|00001740| 09 69 6e 74 09 70 61 64 | 3b 0d 0d 09 44 65 63 6f |.int.pad|;...Deco|
|00001750| 64 65 48 65 61 64 65 72 | 28 68 65 61 64 2c 20 26 |deHeader|(head, &|
|00001760| 68 73 74 61 74 2c 20 30 | 29 3b 0d 09 2f 2a 20 46 |hstat, 0|);../* F|
|00001770| 69 6c 65 20 74 79 70 65 | 20 61 6e 64 20 6d 6f 64 |ile type| and mod|
|00001780| 65 20 2a 2f 0d 09 6d 6f | 64 65 20 3d 20 27 3f 27 |e */..mo|de = '?'|
|00001790| 3b 0d 09 73 77 69 74 63 | 68 20 28 68 65 61 64 2d |;..switc|h (head-|
|000017a0| 3e 68 65 61 64 65 72 2e | 6c 69 6e 6b 66 6c 61 67 |>header.|linkflag|
|000017b0| 29 20 7b 0d 09 63 61 73 | 65 20 4c 46 5f 4e 4f 52 |) {..cas|e LF_NOR|
|000017c0| 4d 41 4c 3a 0d 09 63 61 | 73 65 20 4c 46 5f 4f 4c |MAL:..ca|se LF_OL|
|000017d0| 44 4e 4f 52 4d 41 4c 3a | 0d 09 09 6d 6f 64 65 20 |DNORMAL:|...mode |
|000017e0| 3d 20 27 46 27 3b 20 0d | 09 09 69 66 20 28 27 2f |= 'F'; .|..if ('/|
|000017f0| 27 20 3d 3d 20 68 65 61 | 64 2d 3e 68 65 61 64 65 |' == hea|d->heade|
|00001800| 72 2e 6e 61 6d 65 5b 73 | 74 72 6c 65 6e 28 68 65 |r.name[s|trlen(he|
|00001810| 61 64 2d 3e 68 65 61 64 | 65 72 2e 6e 61 6d 65 29 |ad->head|er.name)|
|00001820| 2d 31 5d 29 0d 09 09 09 | 6d 6f 64 65 20 3d 20 27 |-1])....|mode = '|
|00001830| 44 27 3b 0d 09 09 62 72 | 65 61 6b 3b 0d 0d 09 63 |D';...br|eak;...c|
|00001840| 61 73 65 20 4c 46 5f 44 | 49 52 3a 0d 09 09 6d 6f |ase LF_D|IR:...mo|
|00001850| 64 65 20 3d 20 27 44 27 | 3b 0d 09 09 62 72 65 61 |de = 'D'|;...brea|
|00001860| 6b 3b 0d 09 7d 0d 0d 09 | 2f 2a 20 0d 09 20 2a 20 |k;..}...|/* .. * |
|00001870| 43 6f 6e 76 65 72 74 20 | 74 6f 20 4d 61 63 20 62 |Convert |to Mac b|
|00001880| 61 73 65 64 20 74 69 6d | 65 20 66 72 6f 6d 20 55 |ased tim|e from U|
|00001890| 6e 69 78 20 62 61 73 65 | 64 20 74 69 6d 65 2e 0d |nix base|d time..|
|000018a0| 09 20 2a 2f 0d 09 6c 6f | 6e 67 69 65 20 3d 20 68 |. */..lo|ngie = h|
|000018b0| 73 74 61 74 2e 73 74 5f | 6d 74 69 6d 65 20 2b 20 |stat.st_|mtime + |
|000018c0| 54 49 4d 45 44 49 46 46 | 3b 0d 0d 09 74 69 6d 65 |TIMEDIFF|;...time|
|000018d0| 73 74 61 6d 70 20 3d 20 | 63 74 69 6d 65 28 26 6c |stamp = |ctime(&l|
|000018e0| 6f 6e 67 69 65 29 3b 0d | 09 74 69 6d 65 73 74 61 |ongie);.|.timesta|
|000018f0| 6d 70 5b 31 36 5d 20 3d | 20 27 5c 30 27 3b 0d 09 |mp[16] =| '\0';..|
|00001900| 74 69 6d 65 73 74 61 6d | 70 5b 32 34 5d 20 3d 20 |timestam|p[24] = |
|00001910| 27 5c 30 27 3b 0d 0d 09 | 2f 2a 20 46 6f 72 6d 61 |'\0';...|/* Forma|
|00001920| 74 20 74 68 65 20 66 69 | 6c 65 20 73 69 7a 65 20 |t the fi|le size |
|00001930| 6f 72 20 6d 61 6a 6f 72 | 2f 6d 69 6e 6f 72 20 64 |or major|/minor d|
|00001940| 65 76 69 63 65 20 6e 75 | 6d 62 65 72 73 20 2a 2f |evice nu|mbers */|
|00001950| 0d 09 73 77 69 74 63 68 | 20 28 68 65 61 64 2d 3e |..switch| (head->|
|00001960| 68 65 61 64 65 72 2e 6c | 69 6e 6b 66 6c 61 67 29 |header.l|inkflag)|
|00001970| 20 7b 0d 09 64 65 66 61 | 75 6c 74 3a 0d 09 09 28 | {..defa|ult:...(|
|00001980| 76 6f 69 64 29 20 73 70 | 72 69 6e 74 66 28 73 69 |void) sp|rintf(si|
|00001990| 7a 65 2c 20 22 3f 3f 3f | 3f 3f 22 29 3b 0d 09 09 |ze, "???|??");...|
|000019a0| 62 72 65 61 6b 3b 0d 0d | 09 63 61 73 65 20 4c 46 |break;..|.case LF|
|000019b0| 5f 44 49 52 3a 0d 09 09 | 28 76 6f 69 64 29 20 73 |_DIR:...|(void) s|
|000019c0| 70 72 69 6e 74 66 28 73 | 69 7a 65 2c 20 22 25 2e |printf(s|ize, "%.|
|000019d0| 2a 73 22 2c 20 55 47 53 | 57 49 44 54 48 2c 20 22 |*s", UGS|WIDTH, "|
|000019e0| 22 29 3b 0d 09 09 62 72 | 65 61 6b 3b 0d 0d 09 63 |");...br|eak;...c|
|000019f0| 61 73 65 20 4c 46 5f 4f | 4c 44 4e 4f 52 4d 41 4c |ase LF_O|LDNORMAL|
|00001a00| 3a 0d 09 63 61 73 65 20 | 4c 46 5f 4e 4f 52 4d 41 |:..case |LF_NORMA|
|00001a10| 4c 3a 0d 09 09 28 76 6f | 69 64 29 20 73 70 72 69 |L:...(vo|id) spri|
|00001a20| 6e 74 66 28 73 69 7a 65 | 2c 20 22 25 6c 64 22 2c |ntf(size|, "%ld",|
|00001a30| 20 68 73 74 61 74 2e 73 | 74 5f 73 69 7a 65 29 3b | hstat.s|t_size);|
|00001a40| 0d 09 09 62 72 65 61 6b | 3b 0d 09 7d 0d 0d 0d 09 |...break|;..}....|
|00001a50| 2f 2a 20 46 69 67 75 72 | 65 20 6f 75 74 20 70 61 |/* Figur|e out pa|
|00001a60| 64 64 69 6e 67 20 61 6e | 64 20 70 72 69 6e 74 20 |dding an|d print |
|00001a70| 74 68 65 20 77 68 6f 6c | 65 20 6c 69 6e 65 2e 20 |the whol|e line. |
|00001a80| 2a 2f 0d 09 70 61 64 20 | 3d 20 73 74 72 6c 65 6e |*/..pad |= strlen|
|00001a90| 28 73 69 7a 65 29 20 2b | 20 31 3b 0d 09 69 66 20 |(size) +| 1;..if |
|00001aa0| 28 70 61 64 20 3e 20 75 | 67 73 77 69 64 74 68 29 |(pad > u|gswidth)|
|00001ab0| 0d 09 09 75 67 73 77 69 | 64 74 68 20 3d 20 70 61 |...ugswi|dth = pa|
|00001ac0| 64 3b 0d 0d 09 57 50 72 | 69 6e 74 66 28 22 25 63 |d;...WPr|intf("%c|
|00001ad0| 20 25 2a 73 25 73 20 25 | 73 20 25 73 20 25 2e 2a | %*s%s %|s %s %.*|
|00001ae0| 73 22 2c 20 6d 6f 64 65 | 2c 20 75 67 73 77 69 64 |s", mode|, ugswid|
|00001af0| 74 68 20 2d 20 70 61 64 | 2c 20 22 22 2c 20 73 69 |th - pad|, "", si|
|00001b00| 7a 65 2c 0d 09 09 74 69 | 6d 65 73 74 61 6d 70 2b |ze,...ti|mestamp+|
|00001b10| 34 2c 20 74 69 6d 65 73 | 74 61 6d 70 2b 32 30 2c |4, times|tamp+20,|
|00001b20| 20 73 69 7a 65 6f 66 28 | 68 65 61 64 2d 3e 68 65 | sizeof(|head->he|
|00001b30| 61 64 65 72 2e 6e 61 6d | 65 29 2c 0d 09 09 09 20 |ader.nam|e),.... |
|00001b40| 20 20 20 20 20 68 65 61 | 64 2d 3e 68 65 61 64 65 | hea|d->heade|
|00001b50| 72 2e 6e 61 6d 65 29 3b | 0d 7d 0d 0d 2f 2a 0d 20 |r.name);|.}../*. |
|00001b60| 2a 20 53 6b 69 70 20 6f | 76 65 72 20 3c 73 69 7a |* Skip o|ver <siz|
|00001b70| 65 3e 20 62 79 74 65 73 | 20 6f 66 20 64 61 74 61 |e> bytes| of data|
|00001b80| 20 69 6e 20 72 65 63 6f | 72 64 73 20 69 6e 20 74 | in reco|rds in t|
|00001b90| 68 65 20 61 72 63 68 69 | 76 65 2e 0d 20 2a 2f 0d |he archi|ve.. */.|
|00001ba0| 42 6f 6f 6c 65 61 6e 0d | 53 6b 69 70 46 69 6c 65 |Boolean.|SkipFile|
|00001bb0| 28 73 69 7a 65 29 0d 72 | 65 67 69 73 74 65 72 20 |(size).r|egister |
|00001bc0| 6c 6f 6e 67 20 73 69 7a | 65 3b 0d 7b 0d 09 75 6e |long siz|e;.{..un|
|00001bd0| 69 6f 6e 20 72 65 63 6f | 72 64 20 2a 78 3b 0d 0d |ion reco|rd *x;..|
|00001be0| 09 77 68 69 6c 65 20 28 | 73 69 7a 65 20 3e 20 30 |.while (|size > 0|
|00001bf0| 29 20 7b 0d 09 09 78 20 | 3d 20 46 69 6e 64 52 65 |) {...x |= FindRe|
|00001c00| 63 28 29 3b 0d 09 09 69 | 66 20 28 78 20 3d 3d 20 |c();...i|f (x == |
|00001c10| 6e 69 6c 29 20 7b 09 2f | 2a 20 43 68 65 63 6b 20 |nil) {./|* Check |
|00001c20| 69 74 2e 2e 2e 20 2a 2f | 0d 09 09 09 50 67 6d 41 |it... */|....PgmA|
|00001c30| 6c 65 72 74 28 22 5c 70 | 53 6b 69 70 46 69 6c 65 |lert("\p|SkipFile|
|00001c40| 22 2c 0d 09 09 09 09 22 | 5c 70 55 6e 65 78 70 65 |",....."|\pUnexpe|
|00001c50| 63 74 65 64 20 45 4f 46 | 20 6f 6e 20 61 72 63 68 |cted EOF| on arch|
|00001c60| 69 76 65 20 66 69 6c 65 | 22 2c 0d 09 09 09 09 6e |ive file|",.....n|
|00001c70| 69 6c 29 3b 0d 09 09 09 | 72 65 74 75 72 6e 28 74 |il);....|return(t|
|00001c80| 72 75 65 29 3b 0d 09 09 | 7d 0d 09 09 0d 09 09 55 |rue);...|}......U|
|00001c90| 73 65 52 65 63 28 78 29 | 3b 0d 09 09 73 69 7a 65 |seRec(x)|;...size|
|00001ca0| 20 2d 3d 20 52 45 43 4f | 52 44 53 49 5a 45 3b 0d | -= RECO|RDSIZE;.|
|00001cb0| 09 7d 0d 09 0d 09 72 65 | 74 75 72 6e 28 66 61 6c |.}....re|turn(fal|
|00001cc0| 73 65 29 3b 0d 7d 0d 00 | 00 00 00 00 00 00 00 00 |se);.}..|........|
|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 01 00 00 00 01 4c | 00 00 00 4c 00 00 00 32 |.......L|...L...2|
|00001d10| 54 61 72 0d 20 2a 0d 20 | 2a 20 4d 6f 64 69 66 69 |Tar. *. |* Modifi|
|00001d20| 65 64 20 62 79 20 43 72 | 61 69 67 20 52 75 66 66 |ed by Cr|aig Ruff|
|00001d30| 06 6c 69 73 74 2e 63 2e | 02 00 00 00 00 00 00 00 |.list.c.|........|
|00001d40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 10 38 |........|.......8|
|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 a0 cb 8f a8 00 00 | 00 00 00 00 01 7e 75 70 |........|.....~up|
|00001d80| 70 6f 72 74 20 72 6f 75 | 74 69 6e 65 73 20 66 6f |port rou|tines fo|
|00001d90| 72 20 72 65 61 64 69 6e | 67 20 61 20 74 61 72 20 |r readin|g a tar |
|00001da0| 61 72 63 68 69 76 65 2e | 0d 20 2a 0d 20 2a 20 50 |archive.|. *. * P|
|00001db0| 75 62 69 63 20 44 6f 6d | 61 69 6e 20 76 65 72 73 |ubic Dom|ain vers|
|00001dc0| 69 6f 6e 20 77 72 69 74 | 74 65 6e 20 32 36 20 41 |ion writ|ten 26 A|
|00001dd0| 75 67 20 31 39 38 35 20 | 62 79 20 4a 6f 68 6e 20 |ug 1985 |by John |
|00001de0| 47 69 6c 6d 6f 72 65 20 | 28 69 68 6e 70 34 21 68 |Gilmore |(ihnp4!h|
|00001df0| 6f 70 74 6f 61 64 21 67 | 6e 75 29 2e 0d 20 2a 0d |optoad!g|nu).. *.|
|00001e00| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 75 73 65 |...H..Mo|naco.use|
|00001e10| 20 6f 6e 20 74 68 65 20 | 4d 61 63 69 6e 74 6f 73 | on the |Macintos|
|00001e20| 68 2e 0d 20 2a 2f 00 06 | 00 08 00 2a 00 03 01 53 |h.. */..|...*...S|
|00001e30| 01 fd 00 3c 00 24 01 53 | 01 bd a0 a6 f9 68 00 00 |...<.$.S|.....h..|
|00001e40| 05 5e 00 00 05 5e 00 00 | 05 14 01 00 00 00 01 00 |.^...^..|........|
|00001e50| 00 00 01 4c 00 00 00 4c | 00 00 00 32 00 1a 66 0e |...L...L|...2..f.|
|00001e60| 06 fc 00 00 00 1c 00 32 | 00 00 4d 50 53 52 00 00 |.......2|..MPSR..|
|00001e70| 00 0a 03 ed ff ff 00 00 | 00 00 00 1b 9f a8 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+