home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / source / tarsrc.sit / create.c.bin < prev    next >
MacBinary  |  1989-09-14  |  11.4 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: create.c.bin

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert AMOS Picture Packer (image/amosPicturePacker) ext 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, Wed Jan 18 17:06:20 1989, modified Tue May 30 16:11:40 1989, creator '????', type ASCII, 11017 bytes "create.c" , at 0x2b89 382 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 1 default (weak)
100% lsar MacBinary default
100% gt2 MAC Bilddatei default (weak)


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[????]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 08 63 72 65 61 74 65 | 2e 63 00 00 00 00 00 00 |..create|.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 2b 09 00 | 00 01 7e 9f fa ba dc a0 |.....+..|..~.....|
|00000060| a8 a5 fc 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|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 65 |Tar. *. |* Modife|
|000000a0| 64 20 62 79 20 43 72 61 | 69 67 20 52 75 66 66 20 |d by Cra|ig Ruff |
|000000b0| 66 6f 72 20 75 73 65 20 | 6f 6e 20 74 68 65 20 4d |for use |on the M|
|000000c0| 61 63 69 6e 74 6f 73 68 | 2e 0d 20 2a 2f 0d 2f 2a |acintosh|.. */./*|
|000000d0| 0d 20 2a 20 43 72 65 61 | 74 65 20 61 20 74 61 72 |. * Crea|te a tar|
|000000e0| 20 61 72 63 68 69 76 65 | 2e 0d 20 2a 0d 20 2a 20 | archive|.. *. * |
|000000f0| 57 72 69 74 74 65 6e 20 | 32 35 20 41 75 67 20 31 |Written |25 Aug 1|
|00000100| 39 38 35 20 62 79 20 4a | 6f 68 6e 20 47 69 6c 6d |985 by J|ohn Gilm|
|00000110| 6f 72 65 2c 20 69 68 6e | 70 34 21 68 6f 70 74 6f |ore, ihn|p4!hopto|
|00000120| 61 64 21 67 6e 75 2e 0d | 20 2a 0d 20 2a 20 40 28 |ad!gnu..| *. * @(|
|00000130| 23 29 63 72 65 61 74 65 | 2e 63 20 31 2e 31 39 20 |#)create|.c 1.19 |
|00000140| 39 2f 39 2f 38 36 20 50 | 75 62 6c 69 63 20 44 6f |9/9/86 P|ublic Do|
|00000150| 6d 61 69 6e 20 2d 20 67 | 6e 75 0d 20 2a 2f 0d 0d |main - g|nu. */..|
|00000160| 23 69 6e 63 6c 75 64 65 | 20 22 74 61 72 2e 68 22 |#include| "tar.h"|
|00000170| 0d 0d 75 6e 69 6f 6e 20 | 72 65 63 6f 72 64 09 09 |..union |record..|
|00000180| 2a 53 74 61 72 74 48 65 | 61 64 65 72 28 29 3b 0d |*StartHe|ader();.|
|00000190| 65 78 74 65 72 6e 20 75 | 6e 69 6f 6e 20 72 65 63 |extern u|nion rec|
|000001a0| 6f 72 64 09 2a 68 65 61 | 64 3b 0d 0d 2f 2a 0d 20 |ord.*hea|d;../*. |
|000001b0| 2a 20 46 61 6b 65 20 73 | 74 61 74 20 73 74 72 75 |* Fake s|tat stru|
|000001c0| 63 74 20 66 6f 72 20 75 | 73 65 20 77 69 74 68 20 |ct for u|se with |
|000001d0| 65 78 69 73 74 69 6e 67 | 20 63 6f 64 65 0d 20 2a |existing| code. *|
|000001e0| 2f 0d 65 78 74 65 72 6e | 20 73 74 72 75 63 74 20 |/.extern| struct |
|000001f0| 73 74 61 74 20 7b 0d 09 | 6c 6f 6e 67 09 73 74 5f |stat {..|long.st_|
|00000200| 73 69 7a 65 3b 0d 09 6c | 6f 6e 67 09 73 74 5f 6d |size;..l|ong.st_m|
|00000210| 74 69 6d 65 3b 0d 7d 20 | 68 73 74 61 74 3b 0d 0d |time;.} |hstat;..|
|00000220| 76 6f 69 64 09 46 69 6e | 69 73 68 48 65 61 64 65 |void.Fin|ishHeade|
|00000230| 72 28 29 3b 0d 76 6f 69 | 64 09 54 6f 4f 63 74 28 |r();.voi|d.ToOct(|
|00000240| 29 3b 0d 42 6f 6f 6c 65 | 61 6e 09 44 75 6d 70 44 |);.Boole|an.DumpD|
|00000250| 69 72 28 29 2c 20 44 75 | 6d 70 46 69 6c 65 28 29 |ir(), Du|mpFile()|
|00000260| 2c 20 46 69 6c 6c 4e 61 | 6d 65 28 29 2c 20 57 72 |, FillNa|me(), Wr|
|00000270| 69 74 65 45 6f 74 28 29 | 3b 0d 0d 2f 2a 0d 20 2a |iteEot()|;../*. *|
|00000280| 20 55 73 65 64 20 74 6f | 20 73 61 76 65 20 70 61 | Used to| save pa|
|00000290| 74 68 6e 61 6d 65 20 69 | 6e 66 6f 20 77 68 69 6c |thname i|nfo whil|
|000002a0| 65 20 64 65 73 63 65 6e | 64 69 6e 67 20 74 68 65 |e descen|ding the|
|000002b0| 20 64 69 72 65 63 74 6f | 72 79 20 68 69 65 72 61 | directo|ry hiera|
|000002c0| 72 63 68 79 2e 0d 20 2a | 2f 0d 73 74 72 75 63 74 |rchy.. *|/.struct|
|000002d0| 20 50 61 74 68 49 6e 66 | 6f 20 7b 0d 09 73 74 72 | PathInf|o {..str|
|000002e0| 75 63 74 20 50 61 74 68 | 49 6e 66 6f 09 2a 6e 65 |uct Path|Info.*ne|
|000002f0| 78 74 3b 0d 09 63 68 61 | 72 09 09 6e 61 6d 65 5b |xt;..cha|r..name[|
|00000300| 33 32 5d 3b 0d 7d 3b 0d | 74 79 70 65 64 65 66 20 |32];.};.|typedef |
|00000310| 73 74 72 75 63 74 20 50 | 61 74 68 49 6e 66 6f 20 |struct P|athInfo |
|00000320| 50 61 74 68 49 6e 66 6f | 3b 0d 50 61 74 68 49 6e |PathInfo|;.PathIn|
|00000330| 66 6f 09 70 61 74 68 48 | 65 61 64 3b 0d 0d 2f 2a |fo.pathH|ead;../*|
|00000340| 0d 20 2a 20 41 72 43 72 | 65 61 74 65 20 2d 20 6d |. * ArCr|eate - m|
|00000350| 61 6e 61 67 65 20 74 68 | 65 20 63 72 65 61 74 69 |anage th|e creati|
|00000360| 6f 6e 20 6f 66 20 61 6e | 20 61 72 63 68 69 76 65 |on of an| archive|
|00000370| 0d 20 2a 0d 20 2a 09 41 | 73 6b 73 20 66 6f 72 20 |. *. *.A|sks for |
|00000380| 74 68 65 20 61 72 63 68 | 69 76 65 20 6e 61 6d 65 |the arch|ive name|
|00000390| 2c 20 63 72 65 61 74 65 | 73 20 74 68 65 20 61 72 |, create|s the ar|
|000003a0| 63 68 69 76 65 20 61 6e | 64 20 74 68 65 6e 0d 20 |chive an|d then. |
|000003b0| 2a 09 6c 6f 6f 70 73 20 | 61 73 6b 69 6e 67 20 66 |*.loops |asking f|
|000003c0| 6f 72 20 64 69 72 65 63 | 74 6f 72 69 65 73 20 74 |or direc|tories t|
|000003d0| 6f 20 61 64 64 20 74 6f | 20 74 68 65 20 61 72 63 |o add to| the arc|
|000003e0| 68 69 76 65 2e 0d 20 2a | 2f 0d 41 72 43 72 65 61 |hive.. *|/.ArCrea|
|000003f0| 74 65 28 29 20 7b 0d 09 | 42 6f 6f 6c 65 61 6e 09 |te() {..|Boolean.|
|00000400| 09 65 72 72 46 6f 75 6e | 64 20 3d 20 66 61 6c 73 |.errFoun|d = fals|
|00000410| 65 3b 0d 09 50 6f 69 6e | 74 09 09 77 68 65 72 65 |e;..Poin|t..where|
|00000420| 3b 0d 09 53 46 52 65 70 | 6c 79 09 09 72 65 70 6c |;..SFRep|ly..repl|
|00000430| 79 3b 0d 09 43 49 6e 66 | 6f 50 42 52 65 63 09 70 |y;..CInf|oPBRec.p|
|00000440| 62 3b 0d 09 43 75 72 73 | 48 61 6e 64 6c 65 09 63 |b;..Curs|Handle.c|
|00000450| 75 72 73 6f 72 3b 0d 09 | 53 74 72 32 35 35 09 09 |ursor;..|Str255..|
|00000460| 6e 61 6d 65 3b 0d 0d 09 | 2f 2a 0d 09 20 2a 20 50 |name;...|/*.. * P|
|00000470| 75 74 20 75 70 20 61 20 | 73 74 61 6e 64 61 72 64 |ut up a |standard|
|00000480| 20 66 69 6c 65 20 64 69 | 61 6c 6f 67 20 61 73 6b | file di|alog ask|
|00000490| 69 6e 67 20 66 6f 72 20 | 74 68 65 20 61 72 63 68 |ing for |the arch|
|000004a0| 69 76 65 20 66 69 6c 65 | 20 6e 61 6d 65 2e 0d 09 |ive file| name...|
|000004b0| 20 2a 2f 0d 09 77 68 65 | 72 65 2e 68 20 3d 20 77 | */..whe|re.h = w|
|000004c0| 68 65 72 65 2e 76 20 3d | 20 37 35 3b 0d 09 6e 61 |here.v =| 75;..na|
|000004d0| 6d 65 5b 30 5d 20 3d 20 | 30 3b 0d 09 53 46 50 75 |me[0] = |0;..SFPu|
|000004e0| 74 46 69 6c 65 28 77 68 | 65 72 65 2c 20 22 5c 70 |tFile(wh|ere, "\p|
|000004f0| 54 61 72 20 41 72 63 68 | 69 76 65 3a 22 2c 20 6e |Tar Arch|ive:", n|
|00000500| 61 6d 65 2c 20 6e 69 6c | 2c 20 26 72 65 70 6c 79 |ame, nil|, &reply|
|00000510| 29 3b 0d 09 69 66 20 28 | 21 72 65 70 6c 79 2e 67 |);..if (|!reply.g|
|00000520| 6f 6f 64 29 0d 09 09 72 | 65 74 75 72 6e 3b 0d 0d |ood)...r|eturn;..|
|00000530| 09 61 72 56 52 65 66 4e | 75 6d 20 3d 20 72 65 70 |.arVRefN|um = rep|
|00000540| 6c 79 2e 76 52 65 66 4e | 75 6d 3b 0d 09 61 72 4e |ly.vRefN|um;..arN|
|00000550| 61 6d 65 20 3d 20 72 65 | 70 6c 79 2e 66 4e 61 6d |ame = re|ply.fNam|
|00000560| 65 3b 0d 09 69 66 20 28 | 4f 70 65 6e 41 72 63 68 |e;..if (|OpenArch|
|00000570| 69 76 65 28 30 29 29 09 | 2f 2a 20 4f 70 65 6e 20 |ive(0)).|/* Open |
|00000580| 66 6f 72 20 77 72 69 74 | 69 6e 67 20 2a 2f 0d 09 |for writ|ing */..|
|00000590| 09 72 65 74 75 72 6e 3b | 0d 0d 09 2f 2a 0d 09 20 |.return;|.../*.. |
|000005a0| 2a 20 41 73 6b 20 66 6f | 72 20 64 69 72 65 63 74 |* Ask fo|r direct|
|000005b0| 6f 72 69 65 73 20 74 6f | 20 61 64 64 20 74 6f 20 |ories to| add to |
|000005c0| 74 68 65 20 61 72 63 68 | 69 76 65 2e 0d 09 20 2a |the arch|ive... *|
|000005d0| 20 4e 6f 74 65 20 74 68 | 61 74 20 74 68 69 73 20 | Note th|at this |
|000005e0| 69 73 20 57 48 4f 4c 45 | 20 64 69 72 65 63 74 6f |is WHOLE| directo|
|000005f0| 72 69 65 73 2e 0d 09 20 | 2a 2f 0d 09 77 68 69 6c |ries... |*/..whil|
|00000600| 65 20 28 21 65 72 72 46 | 6f 75 6e 64 20 26 26 20 |e (!errF|ound && |
|00000610| 47 65 74 44 69 72 28 22 | 5c 70 44 69 72 65 63 74 |GetDir("|\pDirect|
|00000620| 6f 72 79 20 74 6f 20 41 | 72 63 68 69 76 65 3a 22 |ory to A|rchive:"|
|00000630| 2c 20 66 61 6c 73 65 29 | 29 20 7b 0d 09 09 2f 2a |, false)|) {.../*|
|00000640| 0d 09 09 20 2a 20 47 65 | 74 20 74 68 65 20 63 61 |... * Ge|t the ca|
|00000650| 74 61 6c 6f 67 20 69 6e | 66 6f 20 66 6f 72 20 74 |talog in|fo for t|
|00000660| 68 65 20 73 65 6c 65 63 | 74 65 64 20 64 69 72 65 |he selec|ted dire|
|00000670| 63 74 6f 72 79 2e 0d 09 | 09 20 2a 2f 0d 09 09 70 |ctory...|. */...p|
|00000680| 61 74 68 48 65 61 64 2e | 6e 65 78 74 20 3d 20 6e |athHead.|next = n|
|00000690| 69 6c 3b 0d 09 09 70 62 | 2e 68 66 69 6c 65 49 6e |il;...pb|.hfileIn|
|000006a0| 66 6f 2e 69 6f 43 6f 6d | 70 6c 65 74 69 6f 6e 20 |fo.ioCom|pletion |
|000006b0| 3d 20 6e 69 6c 3b 0d 09 | 09 70 62 2e 68 66 69 6c |= nil;..|.pb.hfil|
|000006c0| 65 49 6e 66 6f 2e 69 6f | 4e 61 6d 65 50 74 72 20 |eInfo.io|NamePtr |
|000006d0| 3d 20 70 61 74 68 48 65 | 61 64 2e 6e 61 6d 65 3b |= pathHe|ad.name;|
|000006e0| 0d 09 09 70 62 2e 68 66 | 69 6c 65 49 6e 66 6f 2e |...pb.hf|ileInfo.|
|000006f0| 69 6f 56 52 65 66 4e 75 | 6d 20 3d 20 64 69 72 56 |ioVRefNu|m = dirV|
|00000700| 52 65 66 4e 75 6d 3b 0d | 09 09 70 62 2e 68 66 69 |RefNum;.|..pb.hfi|
|00000710| 6c 65 49 6e 66 6f 2e 69 | 6f 44 69 72 49 44 20 3d |leInfo.i|oDirID =|
|00000720| 20 64 69 72 44 69 72 49 | 44 3b 0d 09 09 70 62 2e | dirDirI|D;...pb.|
|00000730| 68 66 69 6c 65 49 6e 66 | 6f 2e 69 6f 46 44 69 72 |hfileInf|o.ioFDir|
|00000740| 49 6e 64 65 78 20 3d 20 | 2d 31 3b 0d 09 09 69 66 |Index = |-1;...if|
|00000750| 20 28 50 42 47 65 74 43 | 61 74 49 6e 66 6f 28 26 | (PBGetC|atInfo(&|
|00000760| 70 62 2c 20 66 61 6c 73 | 65 29 20 21 3d 20 6e 6f |pb, fals|e) != no|
|00000770| 45 72 72 29 20 7b 0d 09 | 09 09 4f 53 41 6c 65 72 |Err) {..|..OSAler|
|00000780| 74 28 22 5c 70 41 72 43 | 72 65 61 74 65 22 2c 20 |t("\pArC|reate", |
|00000790| 22 5c 70 50 42 47 65 74 | 43 61 74 49 6e 66 6f 22 |"\pPBGet|CatInfo"|
|000007a0| 2c 20 70 61 74 68 48 65 | 61 64 2e 6e 61 6d 65 2c |, pathHe|ad.name,|
|000007b0| 0d 09 09 09 09 09 70 62 | 2e 68 66 69 6c 65 49 6e |......pb|.hfileIn|
|000007c0| 66 6f 2e 69 6f 52 65 73 | 75 6c 74 29 3b 0d 09 09 |fo.ioRes|ult);...|
|000007d0| 09 62 72 65 61 6b 3b 0d | 0d 09 09 7d 20 65 6c 73 |.break;.|...} els|
|000007e0| 65 20 7b 0d 09 09 09 2f | 2a 0d 09 09 09 20 2a 20 |e {..../|*.... * |
|000007f0| 41 64 64 20 74 68 65 20 | 64 69 72 65 63 74 6f 72 |Add the |director|
|00000800| 79 20 74 6f 20 74 68 65 | 20 61 72 63 68 69 76 65 |y to the| archive|
|00000810| 2c 0d 09 09 09 20 2a 20 | 77 68 69 6c 65 20 70 72 |,.... * |while pr|
|00000820| 69 6e 74 69 6e 67 20 74 | 68 65 20 66 69 6c 65 73 |inting t|he files|
|00000830| 20 62 65 69 6e 67 20 61 | 64 64 65 64 2e 0d 09 09 | being a|dded....|
|00000840| 09 20 2a 2f 0d 09 09 09 | 69 66 20 28 57 69 6e 64 |. */....|if (Wind|
|00000850| 49 6e 69 74 28 29 29 0d | 09 09 09 09 67 6f 74 6f |Init()).|....goto|
|00000860| 20 64 6f 6e 65 3b 0d 0d | 09 09 09 54 65 78 74 46 | done;..|...TextF|
|00000870| 61 63 65 28 75 6e 64 65 | 72 6c 69 6e 65 29 3b 0d |ace(unde|rline);.|
|00000880| 09 09 09 57 50 72 69 6e | 74 66 28 68 65 61 64 65 |...WPrin|tf(heade|
|00000890| 72 29 3b 0d 09 09 09 54 | 65 78 74 46 61 63 65 28 |r);....T|extFace(|
|000008a0| 30 29 3b 0d 09 09 09 69 | 66 20 28 28 63 75 72 73 |0);....i|f ((curs|
|000008b0| 6f 72 20 3d 20 47 65 74 | 43 75 72 73 6f 72 28 77 |or = Get|Cursor(w|
|000008c0| 61 74 63 68 43 75 72 73 | 6f 72 29 29 20 21 3d 20 |atchCurs|or)) != |
|000008d0| 6e 69 6c 29 0d 09 09 09 | 09 53 65 74 43 75 72 73 |nil)....|.SetCurs|
|000008e0| 6f 72 28 2a 63 75 72 73 | 6f 72 29 3b 0d 0d 09 09 |or(*curs|or);....|
|000008f0| 09 65 72 72 46 6f 75 6e | 64 20 3d 20 44 75 6d 70 |.errFoun|d = Dump|
|00000900| 44 69 72 28 26 70 62 2c | 20 26 70 61 74 68 48 65 |Dir(&pb,| &pathHe|
|00000910| 61 64 29 3b 0d 09 09 09 | 53 65 74 43 75 72 73 6f |ad);....|SetCurso|
|00000920| 72 28 26 71 64 2e 61 72 | 72 6f 77 29 3b 0d 09 09 |r(&qd.ar|row);...|
|00000930| 09 57 69 6e 64 45 6e 64 | 28 61 75 74 6f 50 61 67 |.WindEnd|(autoPag|
|00000940| 65 29 3b 0d 09 09 09 46 | 6c 75 73 68 45 76 65 6e |e);....F|lushEven|
|00000950| 74 73 28 65 76 65 72 79 | 45 76 65 6e 74 2c 20 30 |ts(every|Event, 0|
|00000960| 29 3b 0d 09 09 7d 0d 09 | 7d 0d 0d 09 57 72 69 74 |);...}..|}...Writ|
|00000970| 65 45 6f 74 28 29 3b 0d | 64 6f 6e 65 3a 0d 09 43 |eEot();.|done:..C|
|00000980| 6c 6f 73 65 41 72 63 68 | 69 76 65 28 29 3b 0d 7d |loseArch|ive();.}|
|00000990| 0d 0d 2f 2a 0d 20 2a 20 | 44 75 6d 70 44 69 72 20 |../*. * |DumpDir |
|000009a0| 2d 20 61 64 64 20 61 20 | 64 69 72 65 63 74 6f 72 |- add a |director|
|000009b0| 79 20 28 70 6f 73 73 69 | 62 6c 79 20 72 65 63 75 |y (possi|bly recu|
|000009c0| 72 73 69 76 65 6c 79 29 | 20 74 6f 20 74 68 65 20 |rsively)| to the |
|000009d0| 61 72 63 68 69 76 65 0d | 20 2a 0d 20 2a 09 45 78 |archive.| *. *.Ex|
|000009e0| 69 74 73 20 76 69 61 20 | 61 20 6c 6f 6e 67 6a 6d |its via |a longjm|
|000009f0| 70 20 6f 6e 20 75 6e 72 | 65 63 6f 76 65 72 61 62 |p on unr|ecoverab|
|00000a00| 6c 65 20 65 72 72 6f 72 | 0d 20 2a 09 52 65 74 75 |le error|. *.Retu|
|00000a10| 72 6e 73 20 6e 6f 72 6d | 61 6c 6c 79 20 6f 74 68 |rns norm|ally oth|
|00000a20| 65 72 77 69 73 65 0d 20 | 2a 2f 0d 42 6f 6f 6c 65 |erwise. |*/.Boole|
|00000a30| 61 6e 0d 44 75 6d 70 44 | 69 72 28 64 69 72 2c 20 |an.DumpD|ir(dir, |
|00000a40| 70 61 74 68 29 0d 43 49 | 6e 66 6f 50 42 52 65 63 |path).CI|nfoPBRec|
|00000a50| 09 2a 64 69 72 3b 0d 50 | 61 74 68 49 6e 66 6f 09 |.*dir;.P|athInfo.|
|00000a60| 2a 70 61 74 68 3b 0d 7b | 0d 09 75 6e 69 6f 6e 20 |*path;.{|..union |
|00000a70| 72 65 63 6f 72 64 09 2a | 68 65 61 64 65 72 3b 0d |record.*|header;.|
|00000a80| 09 69 6e 74 09 09 69 3b | 0d 09 42 6f 6f 6c 65 61 |.int..i;|..Boolea|
|00000a90| 6e 09 09 65 72 72 46 6f | 75 6e 64 20 3d 20 66 61 |n..errFo|und = fa|
|00000aa0| 6c 73 65 3b 0d 09 43 49 | 6e 66 6f 50 42 52 65 63 |lse;..CI|nfoPBRec|
|00000ab0| 09 70 62 3b 0d 09 50 61 | 74 68 49 6e 66 6f 09 66 |.pb;..Pa|thInfo.f|
|00000ac0| 69 6c 65 3b 0d 09 63 68 | 61 72 09 09 2a 72 6f 75 |ile;..ch|ar..*rou|
|00000ad0| 74 69 6e 65 20 3d 20 22 | 5c 70 44 75 6d 70 44 69 |tine = "|\pDumpDi|
|00000ae0| 72 22 3b 0d 09 45 76 65 | 6e 74 52 65 63 6f 72 64 |r";..Eve|ntRecord|
|00000af0| 09 65 3b 0d 0d 09 2f 2a | 0d 09 20 2a 20 4f 75 74 |.e;.../*|.. * Out|
|00000b00| 70 75 74 20 64 69 72 65 | 63 74 6f 72 79 20 68 65 |put dire|ctory he|
|00000b10| 61 64 65 72 20 72 65 63 | 6f 72 64 20 77 69 74 68 |ader rec|ord with|
|00000b20| 20 70 65 72 6d 69 73 73 | 69 6f 6e 73 0d 09 20 2a | permiss|ions.. *|
|00000b30| 20 46 49 58 4d 45 2c 20 | 64 6f 20 74 68 69 73 20 | FIXME, |do this |
|00000b40| 41 46 54 45 52 20 66 69 | 6c 65 73 2c 20 74 6f 20 |AFTER fi|les, to |
|00000b50| 61 76 6f 69 64 20 52 2f | 4f 20 64 69 72 20 70 72 |avoid R/|O dir pr|
|00000b60| 6f 62 6c 65 6d 73 3f 0d | 09 20 2a 20 49 66 20 55 |oblems?.|. * If U|
|00000b70| 6e 69 78 20 53 74 64 20 | 66 6f 72 6d 61 74 2c 20 |nix Std |format, |
|00000b80| 64 6f 6e 27 74 20 70 75 | 74 20 2f 20 6f 6e 20 65 |don't pu|t / on e|
|00000b90| 6e 64 20 6f 66 20 64 69 | 72 20 6e 61 6d 65 0d 09 |nd of di|r name..|
|00000ba0| 20 2a 20 49 66 20 6f 6c | 64 20 61 72 63 68 69 76 | * If ol|d archiv|
|00000bb0| 65 20 66 6f 72 6d 61 74 | 2c 20 64 6f 6e 27 74 20 |e format|, don't |
|00000bc0| 77 72 69 74 65 20 72 65 | 63 6f 72 64 20 61 74 20 |write re|cord at |
|00000bd0| 61 6c 6c 2e 0d 09 20 2a | 2f 0d 09 69 66 20 28 21 |all... *|/..if (!|
|00000be0| 6f 6c 64 41 72 63 68 29 | 20 7b 0d 09 09 2f 2a 0d |oldArch)| {.../*.|
|00000bf0| 09 09 20 2a 20 49 66 20 | 70 65 6f 70 6c 65 20 63 |.. * If |people c|
|00000c00| 6f 75 6c 64 20 72 65 61 | 6c 6c 79 20 72 65 61 64 |ould rea|lly read|
|00000c10| 20 73 74 61 6e 64 61 72 | 64 20 61 72 63 68 69 76 | standar|d archiv|
|00000c20| 65 73 2c 0d 09 09 20 2a | 20 74 68 69 73 20 73 68 |es,... *| this sh|
|00000c30| 6f 75 6c 64 20 62 65 3a | 09 09 28 46 49 58 4d 45 |ould be:|..(FIXME|
|00000c40| 29 0d 09 09 20 2a 20 68 | 65 61 64 65 72 20 3d 20 |)... * h|eader = |
|00000c50| 73 74 61 72 74 5f 68 65 | 61 64 65 72 28 66 5f 73 |start_he|ader(f_s|
|00000c60| 74 61 6e 64 61 72 64 3f | 20 70 3a 20 6e 61 6d 65 |tandard?| p: name|
|00000c70| 62 75 66 2c 20 73 74 61 | 74 62 75 66 29 3b 0d 09 |buf, sta|tbuf);..|
|00000c80| 09 20 2a 20 62 75 74 20 | 73 69 6e 63 65 20 74 68 |. * but |since th|
|00000c90| 65 79 27 64 20 69 6e 74 | 65 72 70 72 65 74 20 4c |ey'd int|erpret L|
|00000ca0| 46 5f 44 49 52 20 72 65 | 63 6f 72 64 73 20 61 73 |F_DIR re|cords as|
|00000cb0| 0d 09 09 20 2a 20 72 65 | 67 75 6c 61 72 20 66 69 |... * re|gular fi|
|00000cc0| 6c 65 73 2c 20 77 65 27 | 64 20 62 65 74 74 65 72 |les, we'|d better|
|00000cd0| 20 70 75 74 20 74 68 65 | 20 2f 20 6f 6e 20 74 68 | put the| / on th|
|00000ce0| 65 20 6e 61 6d 65 2e 0d | 09 09 20 2a 2f 0d 09 09 |e name..|.. */...|
|00000cf0| 69 66 20 28 28 68 65 61 | 64 65 72 20 3d 20 53 74 |if ((hea|der = St|
|00000d00| 61 72 74 48 65 61 64 65 | 72 28 64 69 72 29 29 20 |artHeade|r(dir)) |
|00000d10| 3d 3d 20 6e 69 6c 29 0d | 09 09 09 72 65 74 75 72 |== nil).|...retur|
|00000d20| 6e 28 74 72 75 65 29 3b | 0d 0d 09 09 69 66 20 28 |n(true);|....if (|
|00000d30| 73 74 61 6e 64 61 72 64 | 29 0d 09 09 09 68 65 61 |standard|)....hea|
|00000d40| 64 65 72 2d 3e 68 65 61 | 64 65 72 2e 6c 69 6e 6b |der->hea|der.link|
|00000d50| 66 6c 61 67 20 3d 20 4c | 46 5f 44 49 52 3b 0d 09 |flag = L|F_DIR;..|
|00000d60| 09 09 0d 09 09 46 69 6e | 69 73 68 48 65 61 64 65 |.....Fin|ishHeade|
|00000d70| 72 28 68 65 61 64 65 72 | 29 3b 09 2f 2a 20 44 6f |r(header|);./* Do|
|00000d80| 6e 65 20 77 69 74 68 20 | 64 69 72 65 63 74 6f 72 |ne with |director|
|00000d90| 79 20 68 65 61 64 65 72 | 20 2a 2f 0d 09 09 68 65 |y header| */...he|
|00000da0| 61 64 20 3d 20 68 65 61 | 64 65 72 3b 0d 09 09 50 |ad = hea|der;...P|
|00000db0| 72 69 6e 74 48 65 61 64 | 65 72 28 29 3b 0d 09 7d |rintHead|er();..}|
|00000dc0| 0d 0d 09 66 69 6c 65 2e | 6e 65 78 74 20 3d 20 6e |...file.|next = n|
|00000dd0| 69 6c 3b 0d 09 70 61 74 | 68 2d 3e 6e 65 78 74 20 |il;..pat|h->next |
|00000de0| 3d 20 26 66 69 6c 65 3b | 0d 09 0d 09 2f 2a 0d 09 |= &file;|..../*..|
|00000df0| 20 2a 20 43 68 65 63 6b | 20 61 6c 6c 20 65 6e 74 | * Check| all ent|
|00000e00| 72 69 65 73 20 69 6e 20 | 74 68 65 20 64 69 72 65 |ries in |the dire|
|00000e10| 63 74 6f 72 79 2e 0d 09 | 20 2a 20 41 64 64 20 72 |ctory...| * Add r|
|00000e20| 65 67 75 6c 61 72 20 66 | 69 6c 65 73 2c 20 72 65 |egular f|iles, re|
|00000e30| 63 75 72 73 65 20 6f 6e | 20 73 75 62 64 69 72 65 |curse on| subdire|
|00000e40| 63 74 6f 72 69 65 73 2e | 0d 09 20 2a 2f 0d 09 70 |ctories.|.. */..p|
|00000e50| 62 2e 68 66 69 6c 65 49 | 6e 66 6f 2e 69 6f 43 6f |b.hfileI|nfo.ioCo|
|00000e60| 6d 70 6c 65 74 69 6f 6e | 20 3d 20 6e 69 6c 3b 0d |mpletion| = nil;.|
|00000e70| 09 70 62 2e 68 66 69 6c | 65 49 6e 66 6f 2e 69 6f |.pb.hfil|eInfo.io|
|00000e80| 4e 61 6d 65 50 74 72 20 | 3d 20 66 69 6c 65 2e 6e |NamePtr |= file.n|
|00000e90| 61 6d 65 3b 0d 09 70 62 | 2e 68 66 69 6c 65 49 6e |ame;..pb|.hfileIn|
|00000ea0| 66 6f 2e 69 6f 56 52 65 | 66 4e 75 6d 20 3d 20 64 |fo.ioVRe|fNum = d|
|00000eb0| 69 72 2d 3e 64 69 72 49 | 6e 66 6f 2e 69 6f 56 52 |ir->dirI|nfo.ioVR|
|00000ec0| 65 66 4e 75 6d 3b 0d 09 | 66 6f 72 20 28 69 20 3d |efNum;..|for (i =|
|00000ed0| 20 31 3b 20 21 65 72 72 | 46 6f 75 6e 64 3b 20 69 | 1; !err|Found; i|
|00000ee0| 2b 2b 29 20 7b 0d 09 09 | 53 79 73 74 65 6d 54 61 |++) {...|SystemTa|
|00000ef0| 73 6b 28 29 3b 0d 09 09 | 69 66 20 28 45 76 65 6e |sk();...|if (Even|
|00000f00| 74 41 76 61 69 6c 28 6b | 65 79 44 6f 77 6e 4d 61 |tAvail(k|eyDownMa|
|00000f10| 73 6b 2c 20 26 65 29 20 | 26 26 20 28 65 2e 77 68 |sk, &e) |&& (e.wh|
|00000f20| 61 74 20 21 3d 20 6e 75 | 6c 6c 45 76 65 6e 74 29 |at != nu|llEvent)|
|00000f30| 29 20 7b 0d 09 09 09 69 | 66 20 28 0d 09 09 09 09 |) {....i|f (.....|
|00000f40| 28 65 2e 6d 6f 64 69 66 | 69 65 72 73 20 26 20 63 |(e.modif|iers & c|
|00000f50| 6d 64 4b 65 79 29 20 26 | 26 0d 09 09 09 09 28 28 |mdKey) &|&.....((|
|00000f60| 65 2e 6d 65 73 73 61 67 | 65 20 26 20 63 68 61 72 |e.messag|e & char|
|00000f70| 43 6f 64 65 4d 61 73 6b | 29 20 3d 3d 20 27 2e 27 |CodeMask|) == '.'|
|00000f80| 29 0d 09 09 09 29 20 7b | 0d 09 09 09 09 47 65 74 |)....) {|.....Get|
|00000f90| 4e 65 78 74 45 76 65 6e | 74 28 6b 65 79 44 6f 77 |NextEven|t(keyDow|
|00000fa0| 6e 4d 61 73 6b 2c 20 26 | 65 29 3b 0d 09 09 09 09 |nMask, &|e);.....|
|00000fb0| 62 72 65 61 6b 3b 0d 09 | 09 09 7d 0d 09 09 7d 0d |break;..|..}...}.|
|00000fc0| 0d 09 09 70 62 2e 68 66 | 69 6c 65 49 6e 66 6f 2e |...pb.hf|ileInfo.|
|00000fd0| 69 6f 44 69 72 49 44 20 | 3d 20 64 69 72 2d 3e 64 |ioDirID |= dir->d|
|00000fe0| 69 72 49 6e 66 6f 2e 69 | 6f 44 72 44 69 72 49 44 |irInfo.i|oDrDirID|
|00000ff0| 3b 0d 09 09 70 62 2e 68 | 66 69 6c 65 49 6e 66 6f |;...pb.h|fileInfo|
|00001000| 2e 69 6f 46 44 69 72 49 | 6e 64 65 78 20 3d 20 69 |.ioFDirI|ndex = i|
|00001010| 3b 0d 09 09 69 66 20 28 | 50 42 47 65 74 43 61 74 |;...if (|PBGetCat|
|00001020| 49 6e 66 6f 28 26 70 62 | 2c 20 66 61 6c 73 65 29 |Info(&pb|, false)|
|00001030| 20 21 3d 20 6e 6f 45 72 | 72 29 20 7b 0d 09 09 09 | != noEr|r) {....|
|00001040| 69 66 20 28 70 62 2e 68 | 66 69 6c 65 49 6e 66 6f |if (pb.h|fileInfo|
|00001050| 2e 69 6f 52 65 73 75 6c | 74 20 3d 3d 20 66 6e 66 |.ioResul|t == fnf|
|00001060| 45 72 72 29 0d 09 09 09 | 09 62 72 65 61 6b 3b 0d |Err)....|.break;.|
|00001070| 0d 09 09 09 4f 53 41 6c | 65 72 74 28 72 6f 75 74 |....OSAl|ert(rout|
|00001080| 69 6e 65 2c 20 22 5c 70 | 50 42 47 65 74 43 61 74 |ine, "\p|PBGetCat|
|00001090| 49 6e 66 6f 22 2c 20 22 | 5c 70 44 69 72 65 63 74 |Info", "|\pDirect|
|000010a0| 6f 72 79 20 73 65 61 72 | 63 68 22 2c 0d 09 09 09 |ory sear|ch",....|
|000010b0| 09 09 70 62 2e 68 66 69 | 6c 65 49 6e 66 6f 2e 69 |..pb.hfi|leInfo.i|
|000010c0| 6f 52 65 73 75 6c 74 29 | 3b 0d 09 09 09 72 65 74 |oResult)|;....ret|
|000010d0| 75 72 6e 28 74 72 75 65 | 29 3b 0d 09 09 7d 0d 0d |urn(true|);...}..|
|000010e0| 09 09 69 66 20 28 28 75 | 6e 73 69 67 6e 65 64 20 |..if ((u|nsigned |
|000010f0| 63 68 61 72 29 20 66 69 | 6c 65 2e 6e 61 6d 65 5b |char) fi|le.name[|
|00001100| 30 5d 20 3e 20 33 32 29 | 20 7b 0d 09 09 09 2f 2a |0] > 32)| {..../*|
|00001110| 0d 09 09 09 20 2a 20 53 | 61 6e 69 74 79 20 63 68 |.... * S|anity ch|
|00001120| 65 63 6b 2c 20 77 65 20 | 68 61 76 65 20 6f 76 65 |eck, we |have ove|
|00001130| 72 77 72 69 74 74 65 6e | 20 6f 75 72 20 73 74 61 |rwritten| our sta|
|00001140| 63 6b 21 0d 09 09 09 20 | 2a 2f 0d 09 09 09 50 67 |ck!.... |*/....Pg|
|00001150| 6d 41 6c 65 72 74 28 72 | 6f 75 74 69 6e 65 2c 20 |mAlert(r|outine, |
|00001160| 22 5c 70 4e 61 6d 65 20 | 74 6f 6f 20 6c 6f 6e 67 |"\pName |too long|
|00001170| 22 2c 20 66 69 6c 65 2e | 6e 61 6d 65 29 3b 0d 09 |", file.|name);..|
|00001180| 09 09 72 65 74 75 72 6e | 28 74 72 75 65 29 3b 0d |..return|(true);.|
|00001190| 09 09 7d 0d 0d 09 09 69 | 66 20 28 44 49 52 45 43 |..}....i|f (DIREC|
|000011a0| 54 4f 52 59 28 70 62 29 | 29 20 7b 0d 09 09 09 65 |TORY(pb)|) {....e|
|000011b0| 72 72 46 6f 75 6e 64 20 | 3d 20 44 75 6d 70 44 69 |rrFound |= DumpDi|
|000011c0| 72 28 26 70 62 2c 20 26 | 66 69 6c 65 29 3b 0d 0d |r(&pb, &|file);..|
|000011d0| 09 09 7d 20 65 6c 73 65 | 20 7b 0d 09 09 09 69 66 |..} else| {....if|
|000011e0| 20 28 70 62 2e 68 66 69 | 6c 65 49 6e 66 6f 2e 69 | (pb.hfi|leInfo.i|
|000011f0| 6f 46 52 65 66 4e 75 6d | 20 3d 3d 20 61 72 63 68 |oFRefNum| == arch|
|00001200| 69 76 65 29 20 7b 0d 09 | 09 09 09 2f 2a 0d 09 09 |ive) {..|.../*...|
|00001210| 09 09 20 2a 20 44 4f 20 | 4e 4f 54 20 61 64 64 20 |.. * DO |NOT add |
|00001220| 74 68 65 20 61 72 63 68 | 69 76 65 20 74 6f 20 69 |the arch|ive to i|
|00001230| 74 73 65 6c 66 21 0d 09 | 09 09 09 20 2a 2f 0d 09 |tself!..|... */..|
|00001240| 09 09 09 41 72 53 6b 69 | 70 41 6c 65 72 74 28 29 |...ArSki|pAlert()|
|00001250| 3b 0d 09 09 09 09 63 6f | 6e 74 69 6e 75 65 3b 0d |;.....co|ntinue;.|
|00001260| 09 09 09 7d 0d 0d 09 09 | 09 65 72 72 46 6f 75 6e |...}....|.errFoun|
|00001270| 64 20 3d 20 44 75 6d 70 | 46 69 6c 65 28 26 70 62 |d = Dump|File(&pb|
|00001280| 29 3b 0d 09 09 7d 0d 09 | 7d 0d 0d 09 2f 2a 0d 09 |);...}..|}.../*..|
|00001290| 20 2a 20 44 6f 6e 65 20 | 77 69 74 68 20 74 68 69 | * Done |with thi|
|000012a0| 73 20 64 69 72 65 63 74 | 6f 72 79 2c 20 6d 61 6b |s direct|ory, mak|
|000012b0| 65 20 73 75 72 65 20 77 | 65 20 64 6f 6e 27 74 20 |e sure w|e don't |
|000012c0| 72 75 6e 20 6f 75 74 0d | 09 20 2a 20 6f 66 20 77 |run out.|. * of w|
|000012d0| 6f 72 6b 69 6e 67 20 64 | 69 72 65 63 74 6f 72 69 |orking d|irectori|
|000012e0| 65 73 2e 0d 09 20 2a 2f | 0d 09 70 61 74 68 2d 3e |es... */|..path->|
|000012f0| 6e 65 78 74 20 3d 20 6e | 69 6c 3b 0d 09 72 65 74 |next = n|il;..ret|
|00001300| 75 72 6e 28 65 72 72 46 | 6f 75 6e 64 29 3b 0d 7d |urn(errF|ound);.}|
|00001310| 0d 0d 2f 2a 0d 20 2a 20 | 44 75 6d 70 46 69 6c 65 |../*. * |DumpFile|
|00001320| 20 2d 20 44 75 6d 70 20 | 61 20 73 69 6e 67 6c 65 | - Dump |a single|
|00001330| 20 66 69 6c 65 2e 0d 20 | 2a 0d 20 2a 09 45 78 69 | file.. |*. *.Exi|
|00001340| 74 73 20 76 69 61 20 6c | 6f 6e 67 6a 6d 70 20 6f |ts via l|ongjmp o|
|00001350| 6e 20 75 6e 72 65 63 6f | 76 65 72 61 62 6c 65 20 |n unreco|verable |
|00001360| 65 72 72 6f 72 2e 0d 20 | 2a 09 52 65 73 75 6c 74 |error.. |*.Result|
|00001370| 20 69 73 20 31 20 66 6f | 72 20 73 75 63 63 65 73 | is 1 fo|r succes|
|00001380| 73 2c 20 30 20 66 6f 72 | 20 66 61 69 6c 75 72 65 |s, 0 for| failure|
|00001390| 2e 0d 20 2a 2f 0d 42 6f | 6f 6c 65 61 6e 0d 44 75 |.. */.Bo|olean.Du|
|000013a0| 6d 70 46 69 6c 65 28 66 | 69 6c 65 29 0d 43 49 6e |mpFile(f|ile).CIn|
|000013b0| 66 6f 50 42 52 65 63 09 | 2a 66 69 6c 65 3b 0d 7b |foPBRec.|*file;.{|
|000013c0| 0d 09 75 6e 69 6f 6e 20 | 72 65 63 6f 72 64 09 2a |..union |record.*|
|000013d0| 68 65 61 64 65 72 3b 0d | 09 72 65 67 69 73 74 65 |header;.|.registe|
|000013e0| 72 20 63 68 61 72 09 2a | 70 3b 0d 09 63 68 61 72 |r char.*|p;..char|
|000013f0| 09 09 2a 62 75 66 3b 0d | 09 48 50 61 72 61 6d 42 |..*buf;.|.HParamB|
|00001400| 6c 6f 63 6b 52 65 63 09 | 66 70 62 3b 0d 09 6c 6f |lockRec.|fpb;..lo|
|00001410| 6e 67 09 09 62 75 66 73 | 69 7a 65 2c 20 63 6f 75 |ng..bufs|ize, cou|
|00001420| 6e 74 2c 20 69 3b 0d 09 | 72 65 67 69 73 74 65 72 |nt, i;..|register|
|00001430| 20 6c 6f 6e 67 09 73 69 | 7a 65 6c 65 66 74 3b 0d | long.si|zeleft;.|
|00001440| 09 72 65 67 69 73 74 65 | 72 20 75 6e 69 6f 6e 20 |.registe|r union |
|00001450| 72 65 63 6f 72 64 20 09 | 2a 73 74 61 72 74 3b 0d |record .|*start;.|
|00001460| 09 63 68 61 72 09 09 2a | 72 6f 75 74 69 6e 65 20 |.char..*|routine |
|00001470| 3d 20 22 5c 70 44 75 6d | 70 46 69 6c 65 22 3b 0d |= "\pDum|pFile";.|
|00001480| 0d 09 69 66 20 28 28 68 | 65 61 64 65 72 20 3d 20 |..if ((h|eader = |
|00001490| 53 74 61 72 74 48 65 61 | 64 65 72 28 66 69 6c 65 |StartHea|der(file|
|000014a0| 29 29 20 3d 3d 20 6e 69 | 6c 29 0d 09 09 72 65 74 |)) == ni|l)...ret|
|000014b0| 75 72 6e 28 74 72 75 65 | 29 3b 0d 0d 09 46 69 6e |urn(true|);...Fin|
|000014c0| 69 73 68 48 65 61 64 65 | 72 28 68 65 61 64 65 72 |ishHeade|r(header|
|000014d0| 29 3b 0d 09 2f 2a 0d 09 | 20 2a 20 47 65 74 20 74 |);../*..| * Get t|
|000014e0| 68 65 20 73 69 7a 65 20 | 6f 66 20 74 68 65 20 66 |he size |of the f|
|000014f0| 69 6c 65 2e 0d 09 20 2a | 20 44 6f 6e 27 74 20 62 |ile... *| Don't b|
|00001500| 6f 74 68 65 72 20 6f 70 | 65 6e 69 6e 67 20 69 74 |other op|ening it|
|00001510| 20 69 66 20 69 74 20 69 | 73 20 7a 65 72 6f 20 6c | if it i|s zero l|
|00001520| 65 6e 67 74 68 2e 0d 09 | 20 2a 2f 0d 09 68 65 61 |ength...| */..hea|
|00001530| 64 20 3d 20 68 65 61 64 | 65 72 3b 0d 09 68 73 74 |d = head|er;..hst|
|00001540| 61 74 2e 73 74 5f 73 69 | 7a 65 20 3d 20 66 69 6c |at.st_si|ze = fil|
|00001550| 65 2d 3e 68 66 69 6c 65 | 49 6e 66 6f 2e 69 6f 46 |e->hfile|Info.ioF|
|00001560| 6c 4c 67 4c 65 6e 3b 0d | 09 50 72 69 6e 74 48 65 |lLgLen;.|.PrintHe|
|00001570| 61 64 65 72 28 29 3b 0d | 09 69 66 20 28 28 73 69 |ader();.|.if ((si|
|00001580| 7a 65 6c 65 66 74 20 3d | 20 66 69 6c 65 2d 3e 68 |zeleft =| file->h|
|00001590| 66 69 6c 65 49 6e 66 6f | 2e 69 6f 46 6c 4c 67 4c |fileInfo|.ioFlLgL|
|000015a0| 65 6e 29 20 3d 3d 20 30 | 29 0d 09 09 72 65 74 75 |en) == 0|)...retu|
|000015b0| 72 6e 28 66 61 6c 73 65 | 29 3b 0d 0d 09 66 70 62 |rn(false|);...fpb|
|000015c0| 2e 66 69 6c 65 50 61 72 | 61 6d 2e 69 6f 43 6f 6d |.filePar|am.ioCom|
|000015d0| 70 6c 65 74 69 6f 6e 20 | 3d 20 6e 69 6c 3b 0d 09 |pletion |= nil;..|
|000015e0| 66 70 62 2e 66 69 6c 65 | 50 61 72 61 6d 2e 69 6f |fpb.file|Param.io|
|000015f0| 4e 61 6d 65 50 74 72 20 | 3d 20 66 69 6c 65 2d 3e |NamePtr |= file->|
|00001600| 68 66 69 6c 65 49 6e 66 | 6f 2e 69 6f 4e 61 6d 65 |hfileInf|o.ioName|
|00001610| 50 74 72 3b 0d 09 66 70 | 62 2e 66 69 6c 65 50 61 |Ptr;..fp|b.filePa|
|00001620| 72 61 6d 2e 69 6f 56 52 | 65 66 4e 75 6d 20 3d 20 |ram.ioVR|efNum = |
|00001630| 66 69 6c 65 2d 3e 68 66 | 69 6c 65 49 6e 66 6f 2e |file->hf|ileInfo.|
|00001640| 69 6f 56 52 65 66 4e 75 | 6d 3b 0d 09 66 70 62 2e |ioVRefNu|m;..fpb.|
|00001650| 66 69 6c 65 50 61 72 61 | 6d 2e 69 6f 46 56 65 72 |filePara|m.ioFVer|
|00001660| 73 4e 75 6d 20 3d 20 30 | 3b 0d 09 66 70 62 2e 66 |sNum = 0|;..fpb.f|
|00001670| 69 6c 65 50 61 72 61 6d | 2e 69 6f 44 69 72 49 44 |ileParam|.ioDirID|
|00001680| 20 3d 20 66 69 6c 65 2d | 3e 68 66 69 6c 65 49 6e | = file-|>hfileIn|
|00001690| 66 6f 2e 69 6f 46 6c 50 | 61 72 49 44 3b 0d 09 66 |fo.ioFlP|arID;..f|
|000016a0| 70 62 2e 69 6f 50 61 72 | 61 6d 2e 69 6f 50 65 72 |pb.ioPar|am.ioPer|
|000016b0| 6d 73 73 6e 20 3d 20 66 | 73 52 64 50 65 72 6d 3b |mssn = f|sRdPerm;|
|000016c0| 0d 09 66 70 62 2e 69 6f | 50 61 72 61 6d 2e 69 6f |..fpb.io|Param.io|
|000016d0| 4d 69 73 63 20 3d 20 6e | 69 6c 3b 0d 09 69 66 20 |Misc = n|il;..if |
|000016e0| 28 50 42 48 4f 70 65 6e | 28 26 66 70 62 2c 20 66 |(PBHOpen|(&fpb, f|
|000016f0| 61 6c 73 65 29 20 21 3d | 20 6e 6f 45 72 72 29 20 |alse) !=| noErr) |
|00001700| 7b 0d 09 09 4f 53 41 6c | 65 72 74 28 72 6f 75 74 |{...OSAl|ert(rout|
|00001710| 69 6e 65 2c 20 22 5c 70 | 50 42 48 4f 70 65 6e 22 |ine, "\p|PBHOpen"|
|00001720| 2c 20 66 69 6c 65 2d 3e | 68 66 69 6c 65 49 6e 66 |, file->|hfileInf|
|00001730| 6f 2e 69 6f 4e 61 6d 65 | 50 74 72 2c 0d 09 09 09 |o.ioName|Ptr,....|
|00001740| 09 66 70 62 2e 66 69 6c | 65 50 61 72 61 6d 2e 69 |.fpb.fil|eParam.i|
|00001750| 6f 52 65 73 75 6c 74 29 | 3b 0d 09 09 72 65 74 75 |oResult)|;...retu|
|00001760| 72 6e 28 74 72 75 65 29 | 3b 0d 09 7d 0d 0d 09 2f |rn(true)|;..}.../|
|00001770| 2a 0d 09 20 2a 20 44 75 | 6d 70 20 74 68 65 20 66 |*.. * Du|mp the f|
|00001780| 69 6c 65 20 74 6f 20 74 | 68 65 20 61 72 63 68 69 |ile to t|he archi|
|00001790| 76 65 2e 0d 09 20 2a 20 | 4e 6f 74 65 3a 20 74 68 |ve... * |Note: th|
|000017a0| 69 73 20 6f 6e 6c 79 20 | 64 75 6d 70 73 20 74 68 |is only |dumps th|
|000017b0| 65 20 64 61 74 61 20 66 | 6f 72 6b 21 0d 09 20 2a |e data f|ork!.. *|
|000017c0| 2f 0d 09 77 68 69 6c 65 | 20 28 73 69 7a 65 6c 65 |/..while| (sizele|
|000017d0| 66 74 20 3e 20 30 29 20 | 7b 0d 09 09 69 66 20 28 |ft > 0) |{...if (|
|000017e0| 28 73 74 61 72 74 20 3d | 20 46 69 6e 64 52 65 63 |(start =| FindRec|
|000017f0| 28 29 29 20 3d 3d 20 6e | 69 6c 29 0d 09 09 09 72 |()) == n|il)....r|
|00001800| 65 74 75 72 6e 28 74 72 | 75 65 29 3b 0d 09 09 09 |eturn(tr|ue);....|
|00001810| 0d 09 09 62 75 66 73 69 | 7a 65 20 3d 20 45 6e 64 |...bufsi|ze = End|
|00001820| 4f 66 52 65 63 73 28 29 | 2d 3e 63 68 61 72 70 74 |OfRecs()|->charpt|
|00001830| 72 20 2d 20 73 74 61 72 | 74 2d 3e 63 68 61 72 70 |r - star|t->charp|
|00001840| 74 72 3b 0d 09 09 62 75 | 66 20 3d 20 73 74 61 72 |tr;...bu|f = star|
|00001850| 74 2d 3e 63 68 61 72 70 | 74 72 3b 0d 09 61 67 61 |t->charp|tr;..aga|
|00001860| 69 6e 3a 0d 09 09 63 6f | 75 6e 74 20 3d 20 28 73 |in:...co|unt = (s|
|00001870| 69 7a 65 6c 65 66 74 20 | 3c 20 62 75 66 73 69 7a |izeleft |< bufsiz|
|00001880| 65 29 20 3f 20 73 69 7a | 65 6c 65 66 74 20 3a 20 |e) ? siz|eleft : |
|00001890| 62 75 66 73 69 7a 65 3b | 0d 09 09 66 70 62 2e 69 |bufsize;|...fpb.i|
|000018a0| 6f 50 61 72 61 6d 2e 69 | 6f 42 75 66 66 65 72 20 |oParam.i|oBuffer |
|000018b0| 3d 20 62 75 66 3b 0d 09 | 09 66 70 62 2e 69 6f 50 |= buf;..|.fpb.ioP|
|000018c0| 61 72 61 6d 2e 69 6f 52 | 65 71 43 6f 75 6e 74 20 |aram.ioR|eqCount |
|000018d0| 3d 20 63 6f 75 6e 74 3b | 0d 09 09 66 70 62 2e 69 |= count;|...fpb.i|
|000018e0| 6f 50 61 72 61 6d 2e 69 | 6f 50 6f 73 4d 6f 64 65 |oParam.i|oPosMode|
|000018f0| 20 3d 20 66 73 41 74 4d | 61 72 6b 3b 0d 09 09 66 | = fsAtM|ark;...f|
|00001900| 70 62 2e 69 6f 50 61 72 | 61 6d 2e 69 6f 50 6f 73 |pb.ioPar|am.ioPos|
|00001910| 4f 66 66 73 65 74 20 3d | 20 30 3b 0d 09 09 69 66 |Offset =| 0;...if|
|00001920| 20 28 50 42 52 65 61 64 | 28 28 50 61 72 6d 42 6c | (PBRead|((ParmBl|
|00001930| 6b 50 74 72 29 20 26 66 | 70 62 2c 20 66 61 6c 73 |kPtr) &f|pb, fals|
|00001940| 65 29 20 21 3d 20 6e 6f | 45 72 72 29 20 7b 0d 09 |e) != no|Err) {..|
|00001950| 09 09 4f 53 41 6c 65 72 | 74 28 72 6f 75 74 69 6e |..OSAler|t(routin|
|00001960| 65 2c 20 22 5c 70 50 42 | 52 65 61 64 22 2c 20 66 |e, "\pPB|Read", f|
|00001970| 69 6c 65 2d 3e 68 66 69 | 6c 65 49 6e 66 6f 2e 69 |ile->hfi|leInfo.i|
|00001980| 6f 4e 61 6d 65 50 74 72 | 2c 0d 09 09 09 09 09 66 |oNamePtr|,......f|
|00001990| 70 62 2e 69 6f 50 61 72 | 61 6d 2e 69 6f 52 65 73 |pb.ioPar|am.ioRes|
|000019a0| 75 6c 74 29 3b 0d 09 09 | 09 72 65 74 75 72 6e 28 |ult);...|.return(|
|000019b0| 74 72 75 65 29 3b 0d 09 | 09 7d 0d 0d 09 09 63 6f |true);..|.}....co|
|000019c0| 75 6e 74 20 3d 20 66 70 | 62 2e 69 6f 50 61 72 61 |unt = fp|b.ioPara|
|000019d0| 6d 2e 69 6f 41 63 74 43 | 6f 75 6e 74 3b 0d 09 09 |m.ioActC|ount;...|
|000019e0| 69 66 20 28 63 76 74 4e | 6c 29 20 7b 0d 09 09 09 |if (cvtN|l) {....|
|000019f0| 2f 2a 0d 09 09 09 20 2a | 20 43 6f 6e 76 65 72 74 |/*.... *| Convert|
|00001a00| 20 72 65 74 75 72 6e 73 | 20 74 6f 20 6e 65 77 6c | returns| to newl|
|00001a10| 69 6e 65 73 20 66 6f 72 | 20 55 6e 69 78 20 63 6f |ines for| Unix co|
|00001a20| 6d 70 61 74 2e 0d 09 09 | 09 20 2a 2f 0d 09 09 09 |mpat....|. */....|
|00001a30| 66 6f 72 20 28 69 20 3d | 20 63 6f 75 6e 74 2c 20 |for (i =| count, |
|00001a40| 70 20 3d 20 62 75 66 3b | 20 2d 2d 69 20 3e 3d 20 |p = buf;| --i >= |
|00001a50| 30 3b 20 70 2b 2b 29 0d | 09 09 09 09 69 66 20 28 |0; p++).|....if (|
|00001a60| 2a 70 20 3d 3d 20 52 45 | 54 55 52 4e 29 0d 09 09 |*p == RE|TURN)...|
|00001a70| 09 09 09 2a 70 20 3d 20 | 4c 46 3b 0d 09 09 7d 0d |...*p = |LF;...}.|
|00001a80| 0d 09 09 73 69 7a 65 6c | 65 66 74 20 2d 3d 20 63 |...sizel|eft -= c|
|00001a90| 6f 75 6e 74 3b 0d 09 09 | 55 73 65 52 65 63 28 73 |ount;...|UseRec(s|
|00001aa0| 74 61 72 74 20 2b 20 28 | 63 6f 75 6e 74 20 2d 20 |tart + (|count - |
|00001ab0| 31 29 20 2f 20 52 45 43 | 4f 52 44 53 49 5a 45 29 |1) / REC|ORDSIZE)|
|00001ac0| 3b 0d 09 7d 0d 09 0d 09 | 50 42 43 6c 6f 73 65 28 |;..}....|PBClose(|
|00001ad0| 28 50 61 72 6d 42 6c 6b | 50 74 72 29 20 26 66 70 |(ParmBlk|Ptr) &fp|
|00001ae0| 62 2c 20 66 61 6c 73 65 | 29 3b 0d 0d 09 2f 2a 20 |b, false|);.../* |
|00001af0| 43 6c 65 61 72 20 6c 61 | 73 74 20 62 6c 6f 63 6b |Clear la|st block|
|00001b00| 20 67 61 72 62 61 67 65 | 20 74 6f 20 7a 65 72 6f | garbage| to zero|
|00001b10| 73 2c 20 46 49 58 4d 45 | 20 2a 2f 0d 09 72 65 74 |s, FIXME| */..ret|
|00001b20| 75 72 6e 28 66 61 6c 73 | 65 29 3b 0d 7d 0d 0d 0d |urn(fals|e);.}...|
|00001b30| 2f 2a 0d 20 2a 20 4d 61 | 6b 65 20 61 20 68 65 61 |/*. * Ma|ke a hea|
|00001b40| 64 65 72 20 62 6c 6f 63 | 6b 20 66 6f 72 20 74 68 |der bloc|k for th|
|00001b50| 65 20 66 69 6c 65 20 20 | 6e 61 6d 65 20 20 77 68 |e file |name wh|
|00001b60| 6f 73 65 20 73 74 61 74 | 20 69 6e 66 6f 20 69 73 |ose stat| info is|
|00001b70| 20 20 73 74 20 2e 0d 20 | 2a 20 52 65 74 75 72 6e | st .. |* Return|
|00001b80| 20 68 65 61 64 65 72 20 | 70 6f 69 6e 74 65 72 20 | header |pointer |
|00001b90| 66 6f 72 20 73 75 63 63 | 65 73 73 2c 20 4e 55 4c |for succ|ess, NUL|
|00001ba0| 4c 20 69 66 20 74 68 65 | 20 6e 61 6d 65 20 69 73 |L if the| name is|
|00001bb0| 20 74 6f 6f 20 6c 6f 6e | 67 2e 0d 20 2a 2f 0d 75 | too lon|g.. */.u|
|00001bc0| 6e 69 6f 6e 20 72 65 63 | 6f 72 64 20 2a 0d 53 74 |nion rec|ord *.St|
|00001bd0| 61 72 74 48 65 61 64 65 | 72 28 70 62 29 0d 43 49 |artHeade|r(pb).CI|
|00001be0| 6e 66 6f 50 42 52 65 63 | 09 2a 70 62 3b 0d 7b 0d |nfoPBRec|.*pb;.{.|
|00001bf0| 09 72 65 67 69 73 74 65 | 72 20 75 6e 69 6f 6e 20 |.registe|r union |
|00001c00| 72 65 63 6f 72 64 20 2a | 68 65 61 64 65 72 3b 0d |record *|header;.|
|00001c10| 09 42 6f 6f 6c 65 61 6e | 09 64 69 72 65 63 74 6f |.Boolean|.directo|
|00001c20| 72 79 20 3d 20 44 49 52 | 45 43 54 4f 52 59 28 2a |ry = DIR|ECTORY(*|
|00001c30| 70 62 29 3b 0d 0d 09 69 | 66 20 28 28 68 65 61 64 |pb);...i|f ((head|
|00001c40| 65 72 20 3d 20 28 75 6e | 69 6f 6e 20 72 65 63 6f |er = (un|ion reco|
|00001c50| 72 64 20 2a 29 20 46 69 | 6e 64 52 65 63 28 29 29 |rd *) Fi|ndRec())|
|00001c60| 20 3d 3d 20 6e 69 6c 29 | 0d 09 09 72 65 74 75 72 | == nil)|...retur|
|00001c70| 6e 28 6e 69 6c 29 3b 0d | 09 09 0d 09 62 7a 65 72 |n(nil);.|....bzer|
|00001c80| 6f 28 68 65 61 64 65 72 | 2d 3e 63 68 61 72 70 74 |o(header|->charpt|
|00001c90| 72 2c 20 73 69 7a 65 6f | 66 28 75 6e 69 6f 6e 20 |r, sizeo|f(union |
|00001ca0| 72 65 63 6f 72 64 29 29 | 3b 20 2f 2a 20 58 58 58 |record))|; /* XXX|
|00001cb0| 20 73 70 65 65 64 20 75 | 70 20 2a 2f 0d 09 2f 2a | speed u|p */../*|
|00001cc0| 0d 09 20 2a 20 47 65 6e | 65 72 61 74 65 20 74 68 |.. * Gen|erate th|
|00001cd0| 65 20 70 61 74 68 6e 61 | 6d 65 2c 20 6d 61 6b 65 |e pathna|me, make|
|00001ce0| 20 73 75 72 65 20 77 65 | 20 64 6f 6e 27 74 20 6f | sure we| don't o|
|00001cf0| 76 65 72 66 6c 6f 77 0d | 09 20 2a 20 74 68 65 20 |verflow.|. * the |
|00001d00| 66 69 65 6c 64 20 69 6e | 20 74 68 65 20 74 61 72 |field in| the tar|
|00001d10| 20 68 65 61 64 65 72 2e | 0d 09 20 2a 2f 0d 09 69 | header.|.. */..i|
|00001d20| 66 20 28 46 69 6c 6c 4e | 61 6d 65 28 68 65 61 64 |f (FillN|ame(head|
|00001d30| 65 72 2c 20 64 69 72 65 | 63 74 6f 72 79 29 29 20 |er, dire|ctory)) |
|00001d40| 7b 0d 09 09 63 68 61 72 | 09 62 75 66 5b 4e 41 4d |{...char|.buf[NAM|
|00001d50| 53 49 5a 20 2b 20 31 5d | 3b 0d 0d 09 09 62 75 66 |SIZ + 1]|;....buf|
|00001d60| 5b 30 5d 20 3d 20 4e 41 | 4d 53 49 5a 3b 0d 09 09 |[0] = NA|MSIZ;...|
|00001d70| 62 63 6f 70 79 28 68 65 | 61 64 65 72 2d 3e 68 65 |bcopy(he|ader->he|
|00001d80| 61 64 65 72 2e 6e 61 6d | 65 2c 20 26 62 75 66 5b |ader.nam|e, &buf[|
|00001d90| 31 5d 2c 20 4e 41 4d 53 | 49 5a 29 3b 0d 09 09 50 |1], NAMS|IZ);...P|
|00001da0| 67 6d 41 6c 65 72 74 28 | 22 5c 70 53 74 61 72 74 |gmAlert(|"\pStart|
|00001db0| 48 65 61 64 65 72 22 2c | 20 22 5c 70 4e 61 6d 65 |Header",| "\pName|
|00001dc0| 20 74 6f 6f 20 6c 6f 6e | 67 22 2c 20 62 75 66 29 | too lon|g", buf)|
|00001dd0| 3b 0d 09 09 72 65 74 75 | 72 6e 28 6e 69 6c 29 3b |;...retu|rn(nil);|
|00001de0| 0d 09 7d 0d 0d 09 2f 2a | 0d 09 20 2a 20 46 61 6b |..}.../*|.. * Fak|
|00001df0| 65 20 74 68 65 20 66 69 | 6c 65 20 6d 6f 64 65 2c |e the fi|le mode,|
|00001e00| 20 75 69 64 2c 20 67 69 | 64 2e 0d 09 20 2a 20 43 | uid, gi|d... * C|
|00001e10| 6f 6e 76 65 72 74 20 66 | 72 6f 6d 20 4d 61 63 20 |onvert f|rom Mac |
|00001e20| 62 61 73 65 64 20 74 69 | 6d 65 20 74 6f 20 55 6e |based ti|me to Un|
|00001e30| 69 78 20 62 61 73 65 64 | 20 74 69 6d 65 2e 0d 09 |ix based| time...|
|00001e40| 20 2a 2f 0d 09 54 6f 4f | 63 74 28 28 64 69 72 65 | */..ToO|ct((dire|
|00001e50| 63 74 6f 72 79 29 20 3f | 20 30 37 35 35 4c 20 3a |ctory) ?| 0755L :|
|00001e60| 20 30 36 34 34 4c 2c 20 | 38 2c 20 20 68 65 61 64 | 0644L, |8, head|
|00001e70| 65 72 2d 3e 68 65 61 64 | 65 72 2e 6d 6f 64 65 29 |er->head|er.mode)|
|00001e80| 3b 0d 09 54 6f 4f 63 74 | 28 30 4c 2c 20 38 2c 20 |;..ToOct|(0L, 8, |
|00001e90| 20 68 65 61 64 65 72 2d | 3e 68 65 61 64 65 72 2e | header-|>header.|
|00001ea0| 75 69 64 29 3b 0d 09 54 | 6f 4f 63 74 28 30 4c 2c |uid);..T|oOct(0L,|
|00001eb0| 20 38 2c 20 20 68 65 61 | 64 65 72 2d 3e 68 65 61 | 8, hea|der->hea|
|00001ec0| 64 65 72 2e 67 69 64 29 | 3b 0d 09 54 6f 4f 63 74 |der.gid)|;..ToOct|
|00001ed0| 28 28 64 69 72 65 63 74 | 6f 72 79 29 20 3f 20 30 |((direct|ory) ? 0|
|00001ee0| 4c 20 3a 20 70 62 2d 3e | 68 66 69 6c 65 49 6e 66 |L : pb->|hfileInf|
|00001ef0| 6f 2e 69 6f 46 6c 4c 67 | 4c 65 6e 2c 20 31 2b 31 |o.ioFlLg|Len, 1+1|
|00001f00| 32 2c 0d 09 09 09 68 65 | 61 64 65 72 2d 3e 68 65 |2,....he|ader->he|
|00001f10| 61 64 65 72 2e 73 69 7a | 65 29 3b 0d 09 54 6f 4f |ader.siz|e);..ToO|
|00001f20| 63 74 28 28 64 69 72 65 | 63 74 6f 72 79 29 20 3f |ct((dire|ctory) ?|
|00001f30| 20 70 62 2d 3e 64 69 72 | 49 6e 66 6f 2e 69 6f 44 | pb->dir|Info.ioD|
|00001f40| 72 4d 64 44 61 74 20 2d | 20 54 49 4d 45 44 49 46 |rMdDat -| TIMEDIF|
|00001f50| 46 20 3a 0d 09 09 09 20 | 20 20 20 70 62 2d 3e 68 |F :.... | pb->h|
|00001f60| 66 69 6c 65 49 6e 66 6f | 2e 69 6f 46 6c 4d 64 44 |fileInfo|.ioFlMdD|
|00001f70| 61 74 20 2d 20 54 49 4d | 45 44 49 46 46 2c 0d 09 |at - TIM|EDIFF,..|
|00001f80| 09 09 31 2b 31 32 2c 20 | 68 65 61 64 65 72 2d 3e |..1+12, |header->|
|00001f90| 68 65 61 64 65 72 2e 6d | 74 69 6d 65 29 3b 0d 09 |header.m|time);..|
|00001fa0| 2f 2a 20 68 65 61 64 65 | 72 2d 3e 68 65 61 64 65 |/* heade|r->heade|
|00001fb0| 72 2e 6c 69 6e 6b 66 6c | 61 67 20 69 73 20 6c 65 |r.linkfl|ag is le|
|00001fc0| 66 74 20 61 73 20 6e 75 | 6c 6c 20 2a 2f 0d 09 72 |ft as nu|ll */..r|
|00001fd0| 65 74 75 72 6e 28 68 65 | 61 64 65 72 29 3b 0d 7d |eturn(he|ader);.}|
|00001fe0| 0d 0d 2f 2a 20 0d 20 2a | 20 46 69 6e 69 73 68 20 |../* . *| Finish |
|00001ff0| 6f 66 66 20 61 20 66 69 | 6c 6c 65 64 2d 69 6e 20 |off a fi|lled-in |
|00002000| 68 65 61 64 65 72 20 62 | 6c 6f 63 6b 20 61 6e 64 |header b|lock and|
|00002010| 20 77 72 69 74 65 20 69 | 74 20 6f 75 74 2e 0d 20 | write i|t out.. |
|00002020| 2a 2f 0d 76 6f 69 64 0d | 46 69 6e 69 73 68 48 65 |*/.void.|FinishHe|
|00002030| 61 64 65 72 28 68 65 61 | 64 65 72 29 0d 72 65 67 |ader(hea|der).reg|
|00002040| 69 73 74 65 72 20 75 6e | 69 6f 6e 20 72 65 63 6f |ister un|ion reco|
|00002050| 72 64 20 2a 68 65 61 64 | 65 72 3b 0d 7b 0d 09 72 |rd *head|er;.{..r|
|00002060| 65 67 69 73 74 65 72 20 | 69 6e 74 09 69 3b 0d 09 |egister |int.i;..|
|00002070| 72 65 67 69 73 74 65 72 | 20 6c 6f 6e 67 09 73 75 |register| long.su|
|00002080| 6d 3b 0d 09 72 65 67 69 | 73 74 65 72 20 63 68 61 |m;..regi|ster cha|
|00002090| 72 09 2a 70 3b 0d 0d 09 | 62 63 6f 70 79 28 43 48 |r.*p;...|bcopy(CH|
|000020a0| 4b 42 4c 41 4e 4b 53 2c | 20 68 65 61 64 65 72 2d |KBLANKS,| header-|
|000020b0| 3e 68 65 61 64 65 72 2e | 63 68 6b 73 75 6d 2c 20 |>header.|chksum, |
|000020c0| 73 69 7a 65 6f 66 28 68 | 65 61 64 65 72 2d 3e 68 |sizeof(h|eader->h|
|000020d0| 65 61 64 65 72 2e 63 68 | 6b 73 75 6d 29 29 3b 0d |eader.ch|ksum));.|
|000020e0| 0d 09 73 75 6d 20 3d 20 | 30 3b 0d 09 70 20 3d 20 |..sum = |0;..p = |
|000020f0| 68 65 61 64 65 72 2d 3e | 63 68 61 72 70 74 72 3b |header->|charptr;|
|00002100| 0d 09 66 6f 72 20 28 69 | 20 3d 20 73 69 7a 65 6f |..for (i| = sizeo|
|00002110| 66 28 75 6e 69 6f 6e 20 | 72 65 63 6f 72 64 29 3b |f(union |record);|
|00002120| 20 2d 2d 69 20 3e 3d 20 | 30 3b 20 29 20 7b 0d 09 | --i >= |0; ) {..|
|00002130| 09 2f 2a 0d 09 09 20 2a | 20 57 65 20 63 61 6e 27 |./*... *| We can'|
|00002140| 74 20 75 73 65 20 75 6e | 73 69 67 6e 65 64 20 63 |t use un|signed c|
|00002150| 68 61 72 20 68 65 72 65 | 20 62 65 63 61 75 73 65 |har here| because|
|00002160| 20 6f 66 20 6f 6c 64 20 | 63 6f 6d 70 69 6c 65 72 | of old |compiler|
|00002170| 73 2c 0d 09 09 20 2a 20 | 65 2e 67 2e 20 56 37 2e |s,... * |e.g. V7.|
|00002180| 0d 09 09 20 2a 2f 0d 09 | 09 73 75 6d 20 2b 3d 20 |... */..|.sum += |
|00002190| 30 78 46 46 20 26 20 2a | 70 2b 2b 3b 0d 09 7d 0d |0xFF & *|p++;..}.|
|000021a0| 0d 09 2f 2a 0d 09 20 2a | 20 46 69 6c 6c 20 69 6e |../*.. *| Fill in|
|000021b0| 20 74 68 65 20 63 68 65 | 63 6b 73 75 6d 20 66 69 | the che|cksum fi|
|000021c0| 65 6c 64 2e 20 20 49 74 | 27 73 20 66 6f 72 6d 61 |eld. It|'s forma|
|000021d0| 74 74 65 64 20 64 69 66 | 66 65 72 65 6e 74 6c 79 |tted dif|ferently|
|000021e0| 0d 09 20 2a 20 66 72 6f | 6d 20 74 68 65 20 6f 74 |.. * fro|m the ot|
|000021f0| 68 65 72 20 66 69 65 6c | 64 73 3a 20 20 69 74 20 |her fiel|ds: it |
|00002200| 68 61 73 20 5b 36 5d 20 | 64 69 67 69 74 73 2c 20 |has [6] |digits, |
|00002210| 61 20 6e 75 6c 6c 2c 20 | 74 68 65 6e 20 61 0d 09 |a null, |then a..|
|00002220| 20 2a 20 73 70 61 63 65 | 20 2d 2d 20 72 61 74 68 | * space| -- rath|
|00002230| 65 72 20 74 68 61 6e 20 | 64 69 67 69 74 73 2c 20 |er than |digits, |
|00002240| 61 20 73 70 61 63 65 2c | 20 74 68 65 6e 20 61 20 |a space,| then a |
|00002250| 6e 75 6c 6c 2e 0d 09 20 | 2a 20 57 65 20 75 73 65 |null... |* We use|
|00002260| 20 74 6f 5f 6f 63 74 20 | 74 68 65 6e 20 77 72 69 | to_oct |then wri|
|00002270| 74 65 20 74 68 65 20 6e | 75 6c 6c 20 69 6e 20 6f |te the n|ull in o|
|00002280| 76 65 72 20 74 6f 5f 6f | 63 74 27 73 20 73 70 61 |ver to_o|ct's spa|
|00002290| 63 65 2e 0d 09 20 2a 20 | 54 68 65 20 66 69 6e 61 |ce... * |The fina|
|000022a0| 6c 20 73 70 61 63 65 20 | 69 73 20 61 6c 72 65 61 |l space |is alrea|
|000022b0| 64 79 20 74 68 65 72 65 | 2c 20 66 72 6f 6d 20 63 |dy there|, from c|
|000022c0| 68 65 63 6b 73 75 6d 6d | 69 6e 67 2c 20 61 6e 64 |hecksumm|ing, and|
|000022d0| 0d 09 20 2a 20 74 6f 5f | 6f 63 74 20 64 6f 65 73 |.. * to_|oct does|
|000022e0| 6e 27 74 20 6d 6f 64 69 | 66 79 20 69 74 2e 0d 09 |n't modi|fy it...|
|000022f0| 20 2a 0d 09 20 2a 20 54 | 68 69 73 20 69 73 20 61 | *.. * T|his is a|
|00002300| 20 66 61 73 74 20 77 61 | 79 20 74 6f 20 64 6f 3a | fast wa|y to do:|
|00002310| 0d 09 20 2a 20 28 76 6f | 69 64 29 20 73 70 72 69 |.. * (vo|id) spri|
|00002320| 6e 74 66 28 68 65 61 64 | 65 72 2d 3e 68 65 61 64 |ntf(head|er->head|
|00002330| 65 72 2e 63 68 6b 73 75 | 6d 2c 20 22 25 36 6f 22 |er.chksu|m, "%6o"|
|00002340| 2c 20 73 75 6d 29 3b 0d | 09 20 2a 2f 0d 09 54 6f |, sum);.|. */..To|
|00002350| 4f 63 74 28 28 6c 6f 6e | 67 29 20 73 75 6d 2c 20 |Oct((lon|g) sum, |
|00002360| 38 2c 20 68 65 61 64 65 | 72 2d 3e 68 65 61 64 65 |8, heade|r->heade|
|00002370| 72 2e 63 68 6b 73 75 6d | 29 3b 0d 09 68 65 61 64 |r.chksum|);..head|
|00002380| 65 72 2d 3e 68 65 61 64 | 65 72 2e 63 68 6b 73 75 |er->head|er.chksu|
|00002390| 6d 5b 36 5d 20 3d 20 27 | 5c 30 27 3b 09 2f 2a 20 |m[6] = '|\0';./* |
|000023a0| 5a 61 70 20 74 68 65 20 | 73 70 61 63 65 20 2a 2f |Zap the |space */|
|000023b0| 0d 09 55 73 65 52 65 63 | 28 68 65 61 64 65 72 29 |..UseRec|(header)|
|000023c0| 3b 0d 09 72 65 74 75 72 | 6e 3b 0d 7d 0d 0d 0d 2f |;..retur|n;.}.../|
|000023d0| 2a 0d 20 2a 20 51 75 69 | 63 6b 20 61 6e 64 20 64 |*. * Qui|ck and d|
|000023e0| 69 72 74 79 20 6f 63 74 | 61 6c 20 63 6f 6e 76 65 |irty oct|al conve|
|000023f0| 72 73 69 6f 6e 2e 0d 20 | 2a 20 43 6f 6e 76 65 72 |rsion.. |* Conver|
|00002400| 74 73 20 6c 6f 6e 67 20 | 22 76 61 6c 75 65 22 20 |ts long |"value" |
|00002410| 69 6e 74 6f 20 61 20 22 | 64 69 67 73 22 2d 64 69 |into a "|digs"-di|
|00002420| 67 69 74 20 66 69 65 6c | 64 20 61 74 20 22 77 68 |git fiel|d at "wh|
|00002430| 65 72 65 22 2c 0d 20 2a | 20 69 6e 63 6c 75 64 69 |ere",. *| includi|
|00002440| 6e 67 20 61 20 74 72 61 | 69 6c 69 6e 67 20 73 70 |ng a tra|iling sp|
|00002450| 61 63 65 20 61 6e 64 20 | 72 6f 6f 6d 20 66 6f 72 |ace and |room for|
|00002460| 20 61 20 6e 75 6c 6c 2e | 20 20 22 64 69 67 73 22 | a null.| "digs"|
|00002470| 3d 3d 33 20 6d 65 61 6e | 73 0d 20 2a 20 31 20 64 |==3 mean|s. * 1 d|
|00002480| 69 67 69 74 2c 20 61 20 | 73 70 61 63 65 2c 20 61 |igit, a |space, a|
|00002490| 6e 64 20 72 6f 6f 6d 20 | 66 6f 72 20 61 20 6e 75 |nd room |for a nu|
|000024a0| 6c 6c 2e 0d 20 2a 0d 20 | 2a 20 57 65 20 61 73 73 |ll.. *. |* We ass|
|000024b0| 75 6d 65 20 74 68 65 20 | 74 72 61 69 6c 69 6e 67 |ume the |trailing|
|000024c0| 20 6e 75 6c 6c 20 69 73 | 20 61 6c 72 65 61 64 79 | null is| already|
|000024d0| 20 74 68 65 72 65 20 61 | 6e 64 20 64 6f 6e 27 74 | there a|nd don't|
|000024e0| 20 66 69 6c 6c 20 69 74 | 20 69 6e 2e 0d 20 2a 20 | fill it| in.. * |
|000024f0| 54 68 69 73 20 66 61 63 | 74 20 69 73 20 75 73 65 |This fac|t is use|
|00002500| 64 20 62 79 20 73 74 61 | 72 74 5f 68 65 61 64 65 |d by sta|rt_heade|
|00002510| 72 20 61 6e 64 20 66 69 | 6e 69 73 68 5f 68 65 61 |r and fi|nish_hea|
|00002520| 64 65 72 2c 20 73 6f 20 | 64 6f 6e 27 74 20 63 68 |der, so |don't ch|
|00002530| 61 6e 67 65 20 69 74 21 | 0d 20 2a 0d 20 2a 20 54 |ange it!|. *. * T|
|00002540| 68 69 73 20 73 68 6f 75 | 6c 64 20 62 65 20 65 71 |his shou|ld be eq|
|00002550| 75 69 76 61 6c 65 6e 74 | 20 74 6f 3a 0d 20 2a 09 |uivalent| to:. *.|
|00002560| 28 76 6f 69 64 29 20 73 | 70 72 69 6e 74 66 28 77 |(void) s|printf(w|
|00002570| 68 65 72 65 2c 20 22 25 | 2a 6c 6f 20 22 2c 20 64 |here, "%|*lo ", d|
|00002580| 69 67 73 2d 32 2c 20 76 | 61 6c 75 65 29 3b 0d 20 |igs-2, v|alue);. |
|00002590| 2a 20 65 78 63 65 70 74 | 20 74 68 61 74 20 73 70 |* except| that sp|
|000025a0| 72 69 6e 74 66 20 66 69 | 6c 6c 73 20 69 6e 20 74 |rintf fi|lls in t|
|000025b0| 68 65 20 74 72 61 69 6c | 69 6e 67 20 6e 75 6c 6c |he trail|ing null|
|000025c0| 20 61 6e 64 20 77 65 20 | 64 6f 6e 27 74 2e 0d 20 | and we |don't.. |
|000025d0| 2a 2f 0d 76 6f 69 64 0d | 54 6f 4f 63 74 28 76 61 |*/.void.|ToOct(va|
|000025e0| 6c 75 65 2c 20 64 69 67 | 73 2c 20 77 68 65 72 65 |lue, dig|s, where|
|000025f0| 29 0d 72 65 67 69 73 74 | 65 72 20 6c 6f 6e 67 09 |).regist|er long.|
|00002600| 76 61 6c 75 65 3b 0d 72 | 65 67 69 73 74 65 72 20 |value;.r|egister |
|00002610| 69 6e 74 09 64 69 67 73 | 3b 0d 72 65 67 69 73 74 |int.digs|;.regist|
|00002620| 65 72 20 63 68 61 72 09 | 2a 77 68 65 72 65 3b 0d |er char.|*where;.|
|00002630| 7b 0d 09 2d 2d 64 69 67 | 73 3b 09 09 09 09 2f 2a |{..--dig|s;..../*|
|00002640| 20 54 72 61 69 6c 69 6e | 67 20 6e 75 6c 6c 20 73 | Trailin|g null s|
|00002650| 6c 6f 74 20 69 73 20 6c | 65 66 74 20 61 6c 6f 6e |lot is l|eft alon|
|00002660| 65 20 2a 2f 0d 09 77 68 | 65 72 65 5b 2d 2d 64 69 |e */..wh|ere[--di|
|00002670| 67 73 5d 20 3d 20 27 20 | 27 3b 09 09 2f 2a 20 50 |gs] = ' |';../* P|
|00002680| 75 74 20 69 6e 20 74 68 | 65 20 73 70 61 63 65 2c |ut in th|e space,|
|00002690| 20 74 68 6f 75 67 68 20 | 2a 2f 0d 0d 09 2f 2a 20 | though |*/.../* |
|000026a0| 50 72 6f 64 75 63 65 20 | 74 68 65 20 64 69 67 69 |Produce |the digi|
|000026b0| 74 73 20 2d 2d 20 61 74 | 20 6c 65 61 73 74 20 6f |ts -- at| least o|
|000026c0| 6e 65 20 2a 2f 0d 09 64 | 6f 20 7b 0d 09 09 77 68 |ne */..d|o {...wh|
|000026d0| 65 72 65 5b 2d 2d 64 69 | 67 73 5d 20 3d 20 27 30 |ere[--di|gs] = '0|
|000026e0| 27 20 2b 20 28 76 61 6c | 75 65 20 26 20 37 29 3b |' + (val|ue & 7);|
|000026f0| 09 2f 2a 20 6f 6e 65 20 | 6f 63 74 61 6c 20 64 69 |./* one |octal di|
|00002700| 67 69 74 20 2a 2f 0d 09 | 09 76 61 6c 75 65 20 3e |git */..|.value >|
|00002710| 3e 3d 20 33 3b 0d 09 7d | 20 77 68 69 6c 65 20 28 |>= 3;..}| while (|
|00002720| 64 69 67 73 20 3e 20 30 | 20 26 26 20 76 61 6c 75 |digs > 0| && valu|
|00002730| 65 20 21 3d 20 30 29 3b | 0d 0d 09 2f 2a 20 4c 65 |e != 0);|.../* Le|
|00002740| 61 64 69 6e 67 20 73 70 | 61 63 65 73 2c 20 69 66 |ading sp|aces, if|
|00002750| 20 6e 65 63 65 73 73 61 | 72 79 20 2a 2f 0d 09 77 | necessa|ry */..w|
|00002760| 68 69 6c 65 20 28 64 69 | 67 73 20 3e 20 30 29 0d |hile (di|gs > 0).|
|00002770| 09 09 77 68 65 72 65 5b | 2d 2d 64 69 67 73 5d 20 |..where[|--digs] |
|00002780| 3d 20 27 20 27 3b 0d 0d | 7d 0d 0d 2f 2a 0d 20 2a |= ' ';..|}../*. *|
|00002790| 20 57 72 69 74 65 20 74 | 68 65 20 45 4f 54 20 62 | Write t|he EOT b|
|000027a0| 6c 6f 63 6b 28 73 29 2e | 0d 20 2a 2f 0d 42 6f 6f |lock(s).|. */.Boo|
|000027b0| 6c 65 61 6e 0d 57 72 69 | 74 65 45 6f 74 28 29 0d |lean.Wri|teEot().|
|000027c0| 7b 0d 09 75 6e 69 6f 6e | 20 72 65 63 6f 72 64 20 |{..union| record |
|000027d0| 2a 70 3b 0d 0d 09 69 66 | 20 28 28 70 20 3d 20 46 |*p;...if| ((p = F|
|000027e0| 69 6e 64 52 65 63 28 29 | 29 20 3d 3d 20 6e 69 6c |indRec()|) == nil|
|000027f0| 29 0d 09 09 72 65 74 75 | 72 6e 28 74 72 75 65 29 |)...retu|rn(true)|
|00002800| 3b 0d 09 09 0d 09 62 7a | 65 72 6f 28 70 2d 3e 63 |;.....bz|ero(p->c|
|00002810| 68 61 72 70 74 72 2c 20 | 52 45 43 4f 52 44 53 49 |harptr, |RECORDSI|
|00002820| 5a 45 29 3b 0d 09 55 73 | 65 52 65 63 28 70 29 3b |ZE);..Us|eRec(p);|
|00002830| 0d 09 2f 2a 20 46 49 58 | 4d 45 2c 20 6f 6e 6c 79 |../* FIX|ME, only|
|00002840| 20 6f 6e 65 20 45 4f 54 | 20 62 6c 6f 63 6b 20 73 | one EOT| block s|
|00002850| 68 6f 75 6c 64 20 62 65 | 20 6e 65 65 64 65 64 2e |hould be| needed.|
|00002860| 20 2a 2f 0d 09 69 66 20 | 28 28 70 20 3d 20 46 69 | */..if |((p = Fi|
|00002870| 6e 64 52 65 63 28 29 29 | 20 3d 3d 20 6e 69 6c 29 |ndRec())| == nil)|
|00002880| 0d 09 09 72 65 74 75 72 | 6e 28 74 72 75 65 29 3b |...retur|n(true);|
|00002890| 0d 09 09 0d 09 62 7a 65 | 72 6f 28 70 2d 3e 63 68 |.....bze|ro(p->ch|
|000028a0| 61 72 70 74 72 2c 20 52 | 45 43 4f 52 44 53 49 5a |arptr, R|ECORDSIZ|
|000028b0| 45 29 3b 0d 09 55 73 65 | 52 65 63 28 70 29 3b 0d |E);..Use|Rec(p);.|
|000028c0| 09 72 65 74 75 72 6e 28 | 66 61 6c 73 65 29 3b 0d |.return(|false);.|
|000028d0| 7d 0d 0d 2f 2a 0d 20 2a | 20 46 69 6c 6c 4e 61 6d |}../*. *| FillNam|
|000028e0| 65 20 2d 20 67 65 6e 65 | 72 61 74 65 20 74 68 65 |e - gene|rate the|
|000028f0| 20 66 69 6c 65 20 6f 72 | 20 64 69 72 65 63 74 6f | file or| directo|
|00002900| 72 79 20 70 61 74 68 6e | 61 6d 65 0d 20 2a 0d 20 |ry pathn|ame. *. |
|00002910| 2a 09 43 6f 6e 76 65 72 | 74 73 20 74 6f 20 55 6e |*.Conver|ts to Un|
|00002920| 69 78 20 73 74 79 6c 65 | 20 70 61 74 68 6e 61 6d |ix style| pathnam|
|00002930| 65 73 2e 0d 20 2a 09 41 | 70 70 65 6e 64 73 20 61 |es.. *.A|ppends a|
|00002940| 20 27 2f 27 20 66 6f 72 | 20 61 20 64 69 72 65 63 | '/' for| a direc|
|00002950| 74 6f 72 79 2e 0d 20 2a | 2f 0d 42 6f 6f 6c 65 61 |tory.. *|/.Boolea|
|00002960| 6e 0d 46 69 6c 6c 4e 61 | 6d 65 28 68 65 61 64 65 |n.FillNa|me(heade|
|00002970| 72 2c 20 64 69 72 65 63 | 74 6f 72 79 29 0d 72 65 |r, direc|tory).re|
|00002980| 67 69 73 74 65 72 20 75 | 6e 69 6f 6e 20 72 65 63 |gister u|nion rec|
|00002990| 6f 72 64 20 2a 68 65 61 | 64 65 72 3b 0d 42 6f 6f |ord *hea|der;.Boo|
|000029a0| 6c 65 61 6e 09 64 69 72 | 65 63 74 6f 72 79 3b 0d |lean.dir|ectory;.|
|000029b0| 7b 0d 09 72 65 67 69 73 | 74 65 72 20 50 61 74 68 |{..regis|ter Path|
|000029c0| 49 6e 66 6f 09 2a 70 3b | 0d 09 72 65 67 69 73 74 |Info.*p;|..regist|
|000029d0| 65 72 20 63 68 61 72 09 | 09 2a 64 2c 20 2a 73 3b |er char.|.*d, *s;|
|000029e0| 0d 09 63 68 61 72 09 09 | 09 63 3b 0d 09 69 6e 74 |..char..|.c;..int|
|000029f0| 09 09 09 69 3b 0d 0d 09 | 64 20 3d 20 68 65 61 64 |...i;...|d = head|
|00002a00| 65 72 2d 3e 68 65 61 64 | 65 72 2e 6e 61 6d 65 3b |er->head|er.name;|
|00002a10| 0d 09 66 6f 72 20 28 70 | 20 3d 20 26 70 61 74 68 |..for (p| = &path|
|00002a20| 48 65 61 64 3b 20 70 20 | 21 3d 20 6e 69 6c 3b 20 |Head; p |!= nil; |
|00002a30| 70 20 3d 20 70 2d 3e 6e | 65 78 74 29 20 7b 0d 09 |p = p->n|ext) {..|
|00002a40| 09 73 20 3d 20 26 70 2d | 3e 6e 61 6d 65 5b 31 5d |.s = &p-|>name[1]|
|00002a50| 3b 0d 09 09 66 6f 72 20 | 28 69 20 3d 20 70 2d 3e |;...for |(i = p->|
|00002a60| 6e 61 6d 65 5b 30 5d 3b | 20 69 20 3e 20 30 3b 20 |name[0];| i > 0; |
|00002a70| 69 2d 2d 29 20 7b 0d 09 | 09 09 63 20 3d 20 2a 73 |i--) {..|..c = *s|
|00002a80| 2b 2b 3b 0d 09 09 09 69 | 66 20 28 63 20 3d 3d 20 |++;....i|f (c == |
|00002a90| 27 2f 27 29 0d 09 09 09 | 09 2a 64 2b 2b 20 3d 20 |'/')....|.*d++ = |
|00002aa0| 27 3a 27 3b 0d 0d 09 09 | 09 65 6c 73 65 20 69 66 |':';....|.else if|
|00002ab0| 20 28 28 63 20 3c 3d 20 | 27 20 27 29 20 7c 7c 20 | ((c <= |' ') || |
|00002ac0| 28 63 20 3e 3d 20 30 78 | 37 66 29 29 0d 09 09 09 |(c >= 0x|7f))....|
|00002ad0| 09 2a 64 2b 2b 20 3d 20 | 27 5f 27 3b 0d 0d 09 09 |.*d++ = |'_';....|
|00002ae0| 09 65 6c 73 65 0d 09 09 | 09 09 2a 64 2b 2b 20 3d |.else...|..*d++ =|
|00002af0| 20 63 3b 0d 09 09 7d 0d | 0d 09 09 2a 64 2b 2b 20 | c;...}.|...*d++ |
|00002b00| 3d 20 28 70 2d 3e 6e 65 | 78 74 20 3d 3d 20 6e 69 |= (p->ne|xt == ni|
|00002b10| 6c 29 20 3f 20 27 5c 30 | 27 20 3a 20 27 2f 27 3b |l) ? '\0|' : '/';|
|00002b20| 0d 09 7d 0d 0d 09 69 66 | 20 28 64 69 72 65 63 74 |..}...if| (direct|
|00002b30| 6f 72 79 29 20 7b 0d 09 | 09 2a 28 64 20 2d 20 31 |ory) {..|.*(d - 1|
|00002b40| 29 20 3d 20 27 2f 27 3b | 0d 09 09 2a 64 20 3d 20 |) = '/';|...*d = |
|00002b50| 27 5c 30 27 3b 0d 09 7d | 0d 0d 09 72 65 74 75 72 |'\0';..}|...retur|
|00002b60| 6e 28 28 64 20 2d 20 68 | 65 61 64 65 72 2d 3e 68 |n((d - h|eader->h|
|00002b70| 65 61 64 65 72 2e 6e 61 | 6d 65 29 20 3e 20 4e 41 |eader.na|me) > NA|
|00002b80| 4d 53 49 5a 29 3b 0d 7d | 0d 00 00 00 00 00 00 00 |MSIZ);.}|........|
|00002b90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ba0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002bb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002bc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002bd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002be0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002bf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002c00| 00 00 01 00 00 00 01 4c | 00 00 00 4c 00 00 00 32 |.......L|...L...2|
|00002c10| 54 61 72 0d 20 2a 0d 20 | 2a 20 4d 6f 64 69 66 65 |Tar. *. |* Modife|
|00002c20| 64 20 62 79 20 43 72 61 | 69 67 20 52 75 66 66 20 |d by Cra|ig Ruff |
|00002c30| 08 63 72 65 61 74 65 2e | 63 2e 02 00 00 00 00 00 |.create.|c.......|
|00002c40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002c50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002c60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002c70| 00 00 a0 cb 8f 9a 00 00 | 00 00 00 00 01 7e 20 31 |........|.....~ 1|
|00002c80| 39 38 35 20 62 79 20 4a | 6f 68 6e 20 47 69 6c 6d |985 by J|ohn Gilm|
|00002c90| 6f 72 65 2c 20 69 68 6e | 70 34 21 68 6f 70 74 6f |ore, ihn|p4!hopto|
|00002ca0| 61 64 21 67 6e 75 2e 0d | 20 2a 0d 20 2a 20 40 28 |ad!gnu..| *. * @(|
|00002cb0| 23 29 63 72 65 61 74 65 | 2e 63 20 31 2e 31 39 20 |#)create|.c 1.19 |
|00002cc0| 39 2f 39 2f 38 36 20 50 | 75 62 6c 69 63 20 44 6f |9/9/86 P|ublic Do|
|00002cd0| 6d 61 69 6e 20 2d 20 67 | 6e 75 0d 20 2a 2f 0d 0d |main - g|nu. */..|
|00002ce0| 23 69 6e 63 6c 75 64 65 | 20 22 74 61 72 2e 68 22 |#include| "tar.h"|
|00002cf0| 0d 0d 75 6e 69 6f 6e 20 | 72 65 63 6f 72 64 09 09 |..union |record..|
|00002d00| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 73 65 20 |...H..Mo|naco.se |
|00002d10| 6f 6e 20 74 68 65 20 4d | 61 63 69 6e 74 6f 73 68 |on the M|acintosh|
|00002d20| 2e 0d 20 2a 2f 0d 00 06 | 00 08 00 2a 00 03 01 53 |.. */...|...*...S|
|00002d30| 01 fd 00 3c 00 24 01 53 | 01 bd a0 a8 a5 fc 00 00 |...<.$.S|........|
|00002d40| 19 ee 00 00 19 fc 00 00 | 00 00 01 00 00 00 01 00 |........|........|
|00002d50| 00 00 01 4c 00 00 00 4c | 00 00 00 32 00 1a 66 0e |...L...L|...2..f.|
|00002d60| 05 e2 00 00 00 1c 00 32 | 00 00 4d 50 53 52 00 00 |.......2|..MPSR..|
|00002d70| 00 0a 03 ed ff ff 00 00 | 00 00 00 1b 9f ec 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+