home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / unix / unshar.sit / unshar.c < prev    next >
MacBinary  |  1990-05-11  |  13.6 KB  |  [TEXT/KAHL]

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: unshar.c

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Thu May 10 23:14:23 1990, modified Thu May 10 23:14:23 1990, creator Think C, type ASCII, 13331 bytes "unshar.c" , at 0x3493 382 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[KAHL]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 08 75 6e 73 68 61 72 | 2e 63 00 00 00 00 00 00 |..unshar|.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 4b 41 48 | 4c 01 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 34 13 00 | 00 01 7e a2 6f de 8f a2 |.....4..|..~.o...|
|00000060| 6f de 8f 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |o.......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 fb 7b 00 00 |........|.....{..|
|00000080| 2f 2a 20 75 6e 73 68 61 | 72 20 66 6f 72 20 4d 50 |/* unsha|r for MP|
|00000090| 57 20 74 68 61 74 27 73 | 20 67 6f 6f 64 20 65 6e |W that's| good en|
|000000a0| 6f 75 67 68 20 66 6f 72 | 20 63 6f 6d 70 2e 73 6f |ough for| comp.so|
|000000b0| 75 72 63 65 73 2e 75 6e | 69 78 20 61 72 63 68 69 |urces.un|ix archi|
|000000c0| 76 65 73 20 2a 2f 0d 0d | 23 69 6e 63 6c 75 64 65 |ves */..|#include|
|000000d0| 20 3c 73 74 64 69 6f 2e | 68 3e 0d 23 69 6e 63 6c | <stdio.|h>.#incl|
|000000e0| 75 64 65 20 3c 73 74 72 | 69 6e 67 2e 68 3e 0d 2f |ude <str|ing.h>./|
|000000f0| 2a 23 69 6e 63 6c 75 64 | 65 20 3c 46 69 6c 65 73 |*#includ|e <Files|
|00000100| 2e 68 3e 0d 23 69 6e 63 | 6c 75 64 65 20 3c 45 72 |.h>.#inc|lude <Er|
|00000110| 72 6f 72 73 2e 68 3e 0d | 2a 2f 0d 23 69 6e 63 6c |rors.h>.|*/.#incl|
|00000120| 75 64 65 20 3c 65 72 72 | 6e 6f 2e 68 3e 0d 23 69 |ude <err|no.h>.#i|
|00000130| 66 6e 64 65 66 20 4e 49 | 4c 0d 23 64 65 66 69 6e |fndef NI|L.#defin|
|00000140| 65 20 4e 49 4c 09 28 30 | 4c 29 0d 23 65 6e 64 69 |e NIL.(0|L).#endi|
|00000150| 66 0d 0d 23 69 66 6e 64 | 65 66 20 45 4f 46 0d 23 |f..#ifnd|ef EOF.#|
|00000160| 64 65 66 69 6e 65 20 45 | 4f 46 09 28 2d 31 4c 29 |define E|OF.(-1L)|
|00000170| 0d 23 65 6e 64 69 66 0d | 0d 23 64 65 66 69 6e 65 |.#endif.|.#define|
|00000180| 20 44 49 52 45 43 54 4f | 52 59 28 70 62 29 09 28 | DIRECTO|RY(pb).(|
|00000190| 28 28 70 62 29 2e 64 69 | 72 49 6e 66 6f 2e 69 6f |((pb).di|rInfo.io|
|000001a0| 46 6c 41 74 74 72 69 62 | 20 26 20 30 78 31 30 29 |FlAttrib| & 0x10)|
|000001b0| 20 3d 3d 20 30 78 31 30 | 29 0d 23 64 65 66 69 6e | == 0x10|).#defin|
|000001c0| 65 09 67 65 74 44 69 72 | 09 31 31 09 2f 2a 20 62 |e.getDir|.11./* b|
|000001d0| 75 74 74 6f 6e 73 20 69 | 6e 20 74 68 65 20 64 69 |uttons i|n the di|
|000001e0| 61 6c 6f 67 75 65 20 62 | 6f 78 20 2a 2f 0d 23 64 |alogue b|ox */.#d|
|000001f0| 65 66 69 6e 65 09 67 65 | 74 43 75 72 44 69 72 09 |efine.ge|tCurDir.|
|00000200| 31 32 0d 23 64 65 66 69 | 6e 65 09 47 44 5f 50 52 |12.#defi|ne.GD_PR|
|00000210| 4f 4d 50 54 09 31 33 0d | 0d 74 79 70 65 64 65 66 |OMPT.13.|.typedef|
|00000220| 20 65 6e 75 6d 0d 7b 0d | 09 69 6e 66 6f 44 6c 67 | enum.{.|.infoDlg|
|00000230| 52 65 73 20 3d 20 31 30 | 30 30 2c 0d 09 61 62 6f |Res = 10|00,..abo|
|00000240| 75 74 41 6c 72 74 52 65 | 73 2c 09 2f 2a 20 41 62 |utAlrtRe|s,./* Ab|
|00000250| 6f 75 74 2e 2e 2e 20 61 | 6c 65 72 74 20 72 65 73 |out... a|lert res|
|00000260| 6f 75 72 63 65 20 6e 75 | 6d 62 65 72 20 2a 2f 0d |ource nu|mber */.|
|00000270| 09 61 62 6f 72 74 52 65 | 73 2c 0d 09 67 64 44 6c |.abortRe|s,..gdDl|
|00000280| 67 52 65 73 2c 0d 09 74 | 79 70 65 44 6c 67 52 65 |gRes,..t|ypeDlgRe|
|00000290| 73 2c 0d 09 65 72 72 6f | 72 41 6c 65 72 74 52 65 |s,..erro|rAlertRe|
|000002a0| 73 0d 7d 3b 0d 0d 0d 74 | 79 70 65 64 65 66 20 65 |s.};...t|ypedef e|
|000002b0| 6e 75 6d 09 09 09 09 2f | 2a 20 46 69 6c 65 20 6d |num..../|* File m|
|000002c0| 65 6e 75 20 69 74 65 6d | 20 6e 75 6d 62 65 72 73 |enu item| numbers|
|000002d0| 20 2a 2f 0d 7b 0d 09 65 | 78 74 72 61 63 74 20 3d | */.{..e|xtract =|
|000002e0| 20 31 2c 0d 09 63 6c 6f | 73 65 2c 0d 09 71 75 69 | 1,..clo|se,..qui|
|000002f0| 74 0d 7d 3b 0d 0d 0d 74 | 79 70 65 64 65 66 20 65 |t.};...t|ypedef e|
|00000300| 6e 75 6d 20 09 09 09 09 | 2f 2a 20 45 64 69 74 20 |num ....|/* Edit |
|00000310| 6d 65 6e 75 20 69 74 65 | 6d 20 6e 75 6d 62 65 72 |menu ite|m number|
|00000320| 73 20 2a 2f 0d 7b 0d 09 | 75 6e 64 6f 20 3d 20 31 |s */.{..|undo = 1|
|00000330| 2c 0d 09 2f 2a 20 2d 2d | 2d 20 2a 2f 0d 09 63 75 |,../* --|- */..cu|
|00000340| 74 20 3d 20 33 2c 0d 09 | 63 6f 70 79 2c 0d 09 70 |t = 3,..|copy,..p|
|00000350| 61 73 74 65 2c 0d 09 63 | 6c 65 61 72 0d 7d 3b 0d |aste,..c|lear.};.|
|00000360| 0d 74 79 70 65 64 65 66 | 20 65 6e 75 6d 09 09 09 |.typedef| enum...|
|00000370| 09 2f 2a 20 4f 70 74 69 | 6f 6e 20 6d 65 6e 75 20 |./* Opti|on menu |
|00000380| 69 74 65 6d 20 6e 75 6d | 62 65 72 73 20 2a 2f 0d |item num|bers */.|
|00000390| 7b 0d 09 66 6f 72 63 65 | 4f 70 74 20 3d 20 31 2c |{..force|Opt = 1,|
|000003a0| 0d 09 73 65 74 43 72 0d | 7d 3b 0d 0d 74 79 70 65 |..setCr.|};..type|
|000003b0| 64 65 66 20 65 6e 75 6d | 09 09 09 09 2f 2a 20 64 |def enum|..../* d|
|000003c0| 69 61 6c 6f 67 20 69 74 | 65 6d 20 6e 75 6d 62 65 |ialog it|em numbe|
|000003d0| 72 73 20 2a 2f 0d 7b 0d | 09 6f 6b 42 20 3d 20 31 |rs */.{.|.okB = 1|
|000003e0| 2c 0d 09 63 72 54 65 78 | 74 2c 0d 09 63 61 6e 63 |,..crTex|t,..canc|
|000003f0| 65 6c 42 0d 7d 3b 0d 0d | 74 79 70 65 64 65 66 20 |elB.};..|typedef |
|00000400| 65 6e 75 6d 0d 7b 0d 09 | 63 6f 6e 74 69 6e 75 65 |enum.{..|continue|
|00000410| 42 20 3d 20 31 2c 0d 09 | 71 75 69 74 42 2c 0d 09 |B = 1,..|quitB,..|
|00000420| 6d 65 73 73 61 67 65 49 | 74 65 6d 0d 7d 3b 0d 0d |messageI|tem.};..|
|00000430| 4f 53 45 72 72 20 4f 75 | 72 47 65 74 56 6f 6c 28 |OSErr Ou|rGetVol(|
|00000440| 63 68 61 72 20 2a 76 6f | 6c 4e 61 6d 65 2c 73 68 |char *vo|lName,sh|
|00000450| 6f 72 74 20 2a 76 52 65 | 66 4e 75 6d 2c 6c 6f 6e |ort *vRe|fNum,lon|
|00000460| 67 20 2a 64 69 72 49 44 | 29 3b 20 0d 4f 53 45 72 |g *dirID|); .OSEr|
|00000470| 72 20 4f 75 72 44 69 72 | 43 72 65 61 74 65 28 73 |r OurDir|Create(s|
|00000480| 68 6f 72 74 20 76 52 65 | 66 4e 75 6d 2c 6c 6f 6e |hort vRe|fNum,lon|
|00000490| 67 20 70 61 72 65 6e 74 | 44 69 72 49 44 2c 63 68 |g parent|DirID,ch|
|000004a0| 61 72 20 2a 64 69 72 65 | 63 74 6f 72 79 4e 61 6d |ar *dire|ctoryNam|
|000004b0| 65 2c 0d 20 20 20 20 6c | 6f 6e 67 20 2a 63 72 65 |e,. l|ong *cre|
|000004c0| 61 74 65 64 44 69 72 49 | 44 29 3b 20 0d 42 6f 6f |atedDirI|D); .Boo|
|000004d0| 6c 65 61 6e 20 66 6f 72 | 63 65 20 3d 20 46 41 4c |lean for|ce = FAL|
|000004e0| 53 45 3b 20 20 2f 2a 20 | 66 6f 72 63 65 20 6f 76 |SE; /* |force ov|
|000004f0| 65 72 77 72 69 74 69 6e | 67 20 65 78 69 73 74 69 |erwritin|g existi|
|00000500| 6e 67 20 66 69 6c 65 73 | 20 2a 2f 0d 4d 65 6e 75 |ng files| */.Menu|
|00000510| 48 61 6e 64 6c 65 09 66 | 69 6c 65 4d 2c 20 65 64 |Handle.f|ileM, ed|
|00000520| 69 74 4d 2c 20 6f 70 74 | 4d 3b 0d 73 68 6f 72 74 |itM, opt|M;.short|
|00000530| 20 64 69 72 56 52 65 66 | 4e 75 6d 20 3d 20 30 3b | dirVRef|Num = 0;|
|00000540| 0d 63 68 61 72 20 2a 70 | 72 6f 67 6e 61 6d 65 3b |.char *p|rogname;|
|00000550| 0d 4f 53 54 79 70 65 09 | 66 64 43 72 65 61 74 6f |.OSType.|fdCreato|
|00000560| 72 3d 27 50 45 44 54 27 | 3b 09 09 2f 2a 20 46 69 |r='PEDT'|;../* Fi|
|00000570| 6e 64 65 72 20 43 72 65 | 61 74 6f 72 20 2a 2f 0d |nder Cre|ator */.|
|00000580| 4f 53 54 79 70 65 09 66 | 64 54 79 70 65 3d 27 54 |OSType.f|dType='T|
|00000590| 45 58 54 27 3b 09 09 2f | 2a 20 46 69 6e 64 65 72 |EXT';../|* Finder|
|000005a0| 20 54 79 70 65 20 2a 2f | 0d 73 68 6f 72 74 09 61 | Type */|.short.a|
|000005b0| 70 70 46 69 6c 65 43 6f | 75 6e 74 2c 0d 09 09 77 |ppFileCo|unt,...w|
|000005c0| 68 61 74 54 6f 44 6f 3b | 0d 44 69 61 6c 6f 67 50 |hatToDo;|.DialogP|
|000005d0| 74 72 09 69 6e 66 6f 44 | 6c 67 50 74 72 2c 20 74 |tr.infoD|lgPtr, t|
|000005e0| 79 70 65 44 6c 67 50 74 | 72 3b 0d 0d 53 65 74 44 |ypeDlgPt|r;..SetD|
|000005f0| 54 65 78 74 20 28 64 6c | 6f 67 2c 20 69 74 65 6d |Text (dl|og, item|
|00000600| 2c 20 73 74 72 29 0d 44 | 69 61 6c 6f 67 50 74 72 |, str).D|ialogPtr|
|00000610| 09 64 6c 6f 67 3b 0d 69 | 6e 74 09 09 09 69 74 65 |.dlog;.i|nt...ite|
|00000620| 6d 3b 0d 53 74 72 32 35 | 35 09 09 73 74 72 3b 0d |m;.Str25|5..str;.|
|00000630| 7b 0d 48 61 6e 64 6c 65 | 09 69 74 65 6d 48 61 6e |{.Handle|.itemHan|
|00000640| 64 6c 65 3b 0d 69 6e 74 | 09 09 69 74 65 6d 54 79 |dle;.int|..itemTy|
|00000650| 70 65 3b 0d 52 65 63 74 | 09 69 74 65 6d 52 65 63 |pe;.Rect|.itemRec|
|00000660| 74 3b 0d 0d 09 47 65 74 | 44 49 74 65 6d 20 28 64 |t;...Get|DItem (d|
|00000670| 6c 6f 67 2c 20 69 74 65 | 6d 2c 20 26 69 74 65 6d |log, ite|m, &item|
|00000680| 54 79 70 65 2c 20 26 69 | 74 65 6d 48 61 6e 64 6c |Type, &i|temHandl|
|00000690| 65 2c 20 26 69 74 65 6d | 52 65 63 74 29 3b 0d 09 |e, &item|Rect);..|
|000006a0| 53 65 74 49 54 65 78 74 | 20 28 69 74 65 6d 48 61 |SetIText| (itemHa|
|000006b0| 6e 64 6c 65 2c 20 73 74 | 72 29 3b 0d 7d 0d 0d 2f |ndle, st|r);.}../|
|000006c0| 2a 20 44 69 61 6c 6f 67 | 20 68 61 6e 64 6c 65 72 |* Dialog| handler|
|000006d0| 20 2a 2f 0d 0d 47 65 74 | 44 54 65 78 74 20 28 64 | */..Get|DText (d|
|000006e0| 6c 6f 67 2c 20 69 74 65 | 6d 2c 20 73 74 72 29 0d |log, ite|m, str).|
|000006f0| 44 69 61 6c 6f 67 50 74 | 72 09 64 6c 6f 67 3b 0d |DialogPt|r.dlog;.|
|00000700| 69 6e 74 09 09 09 69 74 | 65 6d 3b 0d 53 74 72 69 |int...it|em;.Stri|
|00000710| 6e 67 50 74 72 09 73 74 | 72 3b 0d 7b 0d 48 61 6e |ngPtr.st|r;.{.Han|
|00000720| 64 6c 65 09 69 74 65 6d | 48 61 6e 64 6c 65 3b 0d |dle.item|Handle;.|
|00000730| 69 6e 74 09 09 69 74 65 | 6d 54 79 70 65 3b 0d 52 |int..ite|mType;.R|
|00000740| 65 63 74 09 69 74 65 6d | 52 65 63 74 3b 0d 0d 09 |ect.item|Rect;...|
|00000750| 47 65 74 44 49 74 65 6d | 20 28 64 6c 6f 67 2c 20 |GetDItem| (dlog, |
|00000760| 69 74 65 6d 2c 20 26 69 | 74 65 6d 54 79 70 65 2c |item, &i|temType,|
|00000770| 20 26 69 74 65 6d 48 61 | 6e 64 6c 65 2c 20 26 69 | &itemHa|ndle, &i|
|00000780| 74 65 6d 52 65 63 74 29 | 3b 0d 09 47 65 74 49 54 |temRect)|;..GetIT|
|00000790| 65 78 74 20 28 69 74 65 | 6d 48 61 6e 64 6c 65 2c |ext (ite|mHandle,|
|000007a0| 20 73 74 72 29 3b 0d 7d | 0d 0d 0d 47 65 74 43 72 | str);.}|...GetCr|
|000007b0| 65 61 74 6f 72 28 29 0d | 7b 0d 09 69 6e 74 09 09 |eator().|{..int..|
|000007c0| 69 74 65 6d 48 69 74 3b | 0d 09 63 68 61 72 09 63 |itemHit;|..char.c|
|000007d0| 72 65 61 74 6f 72 5b 35 | 5d 3b 0d 0d 09 74 79 70 |reator[5|];...typ|
|000007e0| 65 44 6c 67 50 74 72 20 | 3d 20 47 65 74 4e 65 77 |eDlgPtr |= GetNew|
|000007f0| 44 69 61 6c 6f 67 20 28 | 74 79 70 65 44 6c 67 52 |Dialog (|typeDlgR|
|00000800| 65 73 2c 20 4e 49 4c 2c | 20 28 57 69 6e 64 6f 77 |es, NIL,| (Window|
|00000810| 50 74 72 29 20 2d 31 4c | 29 3b 0d 09 42 6c 6f 63 |Ptr) -1L|);..Bloc|
|00000820| 6b 4d 6f 76 65 28 26 66 | 64 43 72 65 61 74 6f 72 |kMove(&f|dCreator|
|00000830| 2c 20 63 72 65 61 74 6f | 72 2b 31 2c 20 34 29 3b |, creato|r+1, 4);|
|00000840| 0d 09 63 72 65 61 74 6f | 72 5b 30 5d 20 3d 20 27 |..creato|r[0] = '|
|00000850| 5c 30 30 34 27 3b 0d 09 | 53 65 74 44 54 65 78 74 |\004';..|SetDText|
|00000860| 28 74 79 70 65 44 6c 67 | 50 74 72 2c 20 63 72 54 |(typeDlg|Ptr, crT|
|00000870| 65 78 74 2c 20 63 72 65 | 61 74 6f 72 29 3b 0d 09 |ext, cre|ator);..|
|00000880| 53 65 6c 65 63 74 57 69 | 6e 64 6f 77 28 74 79 70 |SelectWi|ndow(typ|
|00000890| 65 44 6c 67 50 74 72 29 | 3b 0d 09 53 68 6f 77 57 |eDlgPtr)|;..ShowW|
|000008a0| 69 6e 64 6f 77 28 74 79 | 70 65 44 6c 67 50 74 72 |indow(ty|peDlgPtr|
|000008b0| 29 3b 0d 09 44 72 61 77 | 44 69 61 6c 6f 67 28 74 |);..Draw|Dialog(t|
|000008c0| 79 70 65 44 6c 67 50 74 | 72 29 3b 0d 09 4d 6f 64 |ypeDlgPt|r);..Mod|
|000008d0| 61 6c 44 69 61 6c 6f 67 | 28 4e 49 4c 2c 20 26 69 |alDialog|(NIL, &i|
|000008e0| 74 65 6d 48 69 74 29 3b | 0d 09 69 66 20 28 69 74 |temHit);|..if (it|
|000008f0| 65 6d 48 69 74 20 3d 3d | 20 6f 6b 42 29 20 7b 0d |emHit ==| okB) {.|
|00000900| 09 09 47 65 74 44 54 65 | 78 74 20 28 74 79 70 65 |..GetDTe|xt (type|
|00000910| 44 6c 67 50 74 72 2c 20 | 63 72 54 65 78 74 2c 20 |DlgPtr, |crText, |
|00000920| 26 63 72 65 61 74 6f 72 | 29 3b 0d 09 09 42 6c 6f |&creator|);...Blo|
|00000930| 63 6b 4d 6f 76 65 28 63 | 72 65 61 74 6f 72 2b 31 |ckMove(c|reator+1|
|00000940| 2c 20 26 66 64 43 72 65 | 61 74 6f 72 2c 20 34 29 |, &fdCre|ator, 4)|
|00000950| 3b 0d 09 7d 0d 09 44 69 | 73 70 6f 73 44 69 61 6c |;..}..Di|sposDial|
|00000960| 6f 67 28 74 79 70 65 44 | 6c 67 50 74 72 29 3b 0d |og(typeD|lgPtr);.|
|00000970| 7d 0d 0d 0d 2f 2a 0d 09 | 46 69 6c 65 20 6d 65 6e |}.../*..|File men|
|00000980| 75 20 68 61 6e 64 6c 65 | 72 0d 2a 2f 0d 0d 44 6f |u handle|r.*/..Do|
|00000990| 46 69 6c 65 4d 65 6e 75 | 20 28 69 74 65 6d 29 0d |FileMenu| (item).|
|000009a0| 69 6e 74 09 09 69 74 65 | 6d 3b 0d 7b 0d 57 69 6e |int..ite|m;.{.Win|
|000009b0| 64 6f 77 50 65 65 6b 09 | 77 50 65 65 6b 3b 0d 0d |dowPeek.|wPeek;..|
|000009c0| 09 73 77 69 74 63 68 20 | 28 69 74 65 6d 29 0d 09 |.switch |(item)..|
|000009d0| 7b 0d 09 09 63 61 73 65 | 20 65 78 74 72 61 63 74 |{...case| extract|
|000009e0| 3a 0d 09 09 09 45 78 74 | 72 61 63 74 28 29 3b 0d |:....Ext|ract();.|
|000009f0| 09 09 09 62 72 65 61 6b | 3b 0d 09 09 63 61 73 65 |...break|;...case|
|00000a00| 20 63 6c 6f 73 65 3a 0d | 09 09 09 69 66 20 28 28 | close:.|...if ((|
|00000a10| 77 50 65 65 6b 20 3d 20 | 28 57 69 6e 64 6f 77 50 |wPeek = |(WindowP|
|00000a20| 65 65 6b 29 20 46 72 6f | 6e 74 57 69 6e 64 6f 77 |eek) Fro|ntWindow|
|00000a30| 20 28 29 29 20 21 3d 20 | 4e 49 4c 29 0d 09 09 09 | ()) != |NIL)....|
|00000a40| 7b 0d 09 09 09 09 69 66 | 20 28 77 50 65 65 6b 2d |{.....if| (wPeek-|
|00000a50| 3e 77 69 6e 64 6f 77 4b | 69 6e 64 20 3c 20 30 29 |>windowK|ind < 0)|
|00000a60| 0d 09 09 09 09 09 43 6c | 6f 73 65 44 65 73 6b 41 |......Cl|oseDeskA|
|00000a70| 63 63 20 28 77 50 65 65 | 6b 2d 3e 77 69 6e 64 6f |cc (wPee|k->windo|
|00000a80| 77 4b 69 6e 64 29 3b 0d | 09 09 09 7d 0d 09 09 09 |wKind);.|...}....|
|00000a90| 62 72 65 61 6b 3b 0d 09 | 09 63 61 73 65 20 71 75 |break;..|.case qu|
|00000aa0| 69 74 3a 0d 09 09 09 53 | 6b 65 6c 57 68 6f 61 20 |it:....S|kelWhoa |
|00000ab0| 28 29 3b 0d 09 09 09 62 | 72 65 61 6b 3b 0d 09 7d |();....b|reak;..}|
|00000ac0| 0d 7d 0d 0d 0d 44 6f 45 | 64 69 74 4d 65 6e 75 20 |.}...DoE|ditMenu |
|00000ad0| 28 69 74 65 6d 29 0d 69 | 6e 74 09 09 69 74 65 6d |(item).i|nt..item|
|00000ae0| 3b 0d 7b 0d 44 69 61 6c | 6f 67 50 74 72 09 74 68 |;.{.Dial|ogPtr.th|
|00000af0| 65 44 69 61 6c 6f 67 3b | 0d 0d 09 74 68 65 44 69 |eDialog;|...theDi|
|00000b00| 61 6c 6f 67 20 3d 20 28 | 44 69 61 6c 6f 67 50 74 |alog = (|DialogPt|
|00000b10| 72 29 20 46 72 6f 6e 74 | 57 69 6e 64 6f 77 20 28 |r) Front|Window (|
|00000b20| 29 3b 0d 09 69 66 20 28 | 28 28 57 69 6e 64 6f 77 |);..if (|((Window|
|00000b30| 50 65 65 6b 29 20 74 68 | 65 44 69 61 6c 6f 67 29 |Peek) th|eDialog)|
|00000b40| 2d 3e 77 69 6e 64 6f 77 | 4b 69 6e 64 20 21 3d 20 |->window|Kind != |
|00000b50| 64 69 61 6c 6f 67 4b 69 | 6e 64 29 0d 09 09 72 65 |dialogKi|nd)...re|
|00000b60| 74 75 72 6e 3b 0d 0d 09 | 73 77 69 74 63 68 20 28 |turn;...|switch (|
|00000b70| 69 74 65 6d 29 0d 09 7b | 0d 09 09 63 61 73 65 20 |item)..{|...case |
|00000b80| 63 75 74 3a 0d 09 09 7b | 0d 09 09 09 44 6c 67 43 |cut:...{|....DlgC|
|00000b90| 75 74 20 28 74 68 65 44 | 69 61 6c 6f 67 29 3b 0d |ut (theD|ialog);.|
|00000ba0| 09 09 09 28 76 6f 69 64 | 29 20 5a 65 72 6f 53 63 |...(void|) ZeroSc|
|00000bb0| 72 61 70 20 28 29 3b 0d | 09 09 09 28 76 6f 69 64 |rap ();.|...(void|
|00000bc0| 29 20 54 45 54 6f 53 63 | 72 61 70 20 28 29 3b 0d |) TEToSc|rap ();.|
|00000bd0| 09 09 09 62 72 65 61 6b | 3b 0d 09 09 7d 0d 0d 09 |...break|;...}...|
|00000be0| 09 63 61 73 65 20 63 6f | 70 79 3a 0d 09 09 7b 0d |.case co|py:...{.|
|00000bf0| 09 09 09 44 6c 67 43 6f | 70 79 20 28 74 68 65 44 |...DlgCo|py (theD|
|00000c00| 69 61 6c 6f 67 29 3b 0d | 09 09 09 28 76 6f 69 64 |ialog);.|...(void|
|00000c10| 29 20 5a 65 72 6f 53 63 | 72 61 70 20 28 29 3b 0d |) ZeroSc|rap ();.|
|00000c20| 09 09 09 28 76 6f 69 64 | 29 20 54 45 54 6f 53 63 |...(void|) TEToSc|
|00000c30| 72 61 70 20 28 29 3b 0d | 09 09 09 62 72 65 61 6b |rap ();.|...break|
|00000c40| 3b 0d 09 09 7d 0d 0d 09 | 09 63 61 73 65 20 70 61 |;...}...|.case pa|
|00000c50| 73 74 65 3a 0d 09 09 7b | 0d 09 09 09 28 76 6f 69 |ste:...{|....(voi|
|00000c60| 64 29 20 54 45 46 72 6f | 6d 53 63 72 61 70 20 28 |d) TEFro|mScrap (|
|00000c70| 29 3b 0d 09 09 09 44 6c | 67 50 61 73 74 65 20 28 |);....Dl|gPaste (|
|00000c80| 74 68 65 44 69 61 6c 6f | 67 29 3b 0d 09 09 09 62 |theDialo|g);....b|
|00000c90| 72 65 61 6b 3b 0d 09 09 | 7d 0d 0d 09 09 63 61 73 |reak;...|}....cas|
|00000ca0| 65 20 63 6c 65 61 72 3a | 0d 09 09 7b 0d 09 09 09 |e clear:|...{....|
|00000cb0| 44 6c 67 44 65 6c 65 74 | 65 20 28 74 68 65 44 69 |DlgDelet|e (theDi|
|00000cc0| 61 6c 6f 67 29 3b 0d 09 | 09 09 62 72 65 61 6b 3b |alog);..|..break;|
|00000cd0| 0d 09 09 7d 0d 09 7d 0d | 7d 0d 0d 44 6f 4f 70 74 |...}..}.|}..DoOpt|
|00000ce0| 4d 65 6e 75 28 69 74 65 | 6d 29 0d 69 6e 74 09 09 |Menu(ite|m).int..|
|00000cf0| 69 74 65 6d 3b 0d 7b 0d | 09 73 77 69 74 63 68 20 |item;.{.|.switch |
|00000d00| 28 69 74 65 6d 29 0d 09 | 7b 0d 09 09 63 61 73 65 |(item)..|{...case|
|00000d10| 20 66 6f 72 63 65 4f 70 | 74 3a 09 66 6f 72 63 65 | forceOp|t:.force|
|00000d20| 20 3d 20 21 66 6f 72 63 | 65 3b 0d 09 09 09 09 09 | = !forc|e;......|
|00000d30| 09 09 09 09 09 43 68 65 | 63 6b 49 74 65 6d 28 6f |.....Che|ckItem(o|
|00000d40| 70 74 4d 2c 20 66 6f 72 | 63 65 4f 70 74 2c 20 66 |ptM, for|ceOpt, f|
|00000d50| 6f 72 63 65 29 3b 0d 09 | 09 09 09 09 09 09 09 09 |orce);..|........|
|00000d60| 09 62 72 65 61 6b 3b 0d | 09 20 09 63 61 73 65 20 |.break;.|. .case |
|00000d70| 73 65 74 43 72 3a 09 09 | 47 65 74 43 72 65 61 74 |setCr:..|GetCreat|
|00000d80| 6f 72 28 29 3b 0d 09 20 | 09 09 09 09 09 09 09 09 |or();.. |........|
|00000d90| 62 72 65 61 6b 3b 0d 09 | 20 7d 0d 7d 0d 0d 2f 2a |break;..| }.}../*|
|00000da0| 0d 09 48 61 6e 64 6c 65 | 20 73 65 6c 65 63 74 69 |..Handle| selecti|
|00000db0| 6f 6e 20 6f 66 20 41 62 | 6f 75 74 c9 20 69 74 65 |on of Ab|out. ite|
|00000dc0| 6d 20 66 72 6f 6d 20 41 | 70 70 6c 65 20 6d 65 6e |m from A|pple men|
|00000dd0| 75 0d 2a 2f 0d 0d 44 6f | 41 62 6f 75 74 20 28 29 |u.*/..Do|About ()|
|00000de0| 0d 7b 0d 09 28 76 6f 69 | 64 29 20 41 6c 65 72 74 |.{..(voi|d) Alert|
|00000df0| 20 28 61 62 6f 75 74 41 | 6c 72 74 52 65 73 2c 20 | (aboutA|lrtRes, |
|00000e00| 4e 49 4c 29 3b 0d 7d 0d | 0d 42 6f 6f 6c 65 61 6e |NIL);.}.|.Boolean|
|00000e10| 09 09 75 73 65 43 75 72 | 44 69 72 3b 09 09 2f 2a |..useCur|Dir;../*|
|00000e20| 20 53 65 74 20 69 66 20 | 63 75 72 72 65 6e 74 20 | Set if |current |
|00000e30| 64 69 72 20 74 6f 20 62 | 65 20 75 73 65 64 20 2a |dir to b|e used *|
|00000e40| 2f 0d 0d 2f 2a 20 46 69 | 6c 74 65 72 20 70 72 6f |/../* Fi|lter pro|
|00000e50| 63 73 20 26 20 64 69 61 | 6c 6f 67 75 65 20 68 6f |cs & dia|logue ho|
|00000e60| 6f 6b 73 20 74 6f 20 73 | 65 6c 65 63 74 20 64 69 |oks to s|elect di|
|00000e70| 72 65 63 74 6f 72 69 65 | 73 20 6f 6e 6c 79 20 69 |rectorie|s only i|
|00000e80| 6e 20 53 46 47 65 74 20 | 66 69 6c 65 20 2a 2f 0d |n SFGet |file */.|
|00000e90| 70 61 73 63 61 6c 20 73 | 68 6f 72 74 0d 44 69 72 |pascal s|hort.Dir|
|00000ea0| 53 65 6c 48 6f 6f 6b 28 | 69 74 65 6d 2c 20 74 68 |SelHook(|item, th|
|00000eb0| 65 44 69 61 6c 6f 67 29 | 0d 73 68 6f 72 74 09 09 |eDialog)|.short..|
|00000ec0| 69 74 65 6d 3b 0d 44 69 | 61 6c 6f 67 50 74 72 09 |item;.Di|alogPtr.|
|00000ed0| 74 68 65 44 69 61 6c 6f | 67 3b 0d 7b 0d 09 69 66 |theDialo|g;.{..if|
|00000ee0| 20 28 69 74 65 6d 20 3d | 3d 20 67 65 74 44 69 72 | (item =|= getDir|
|00000ef0| 7c 7c 20 69 74 65 6d 20 | 3d 3d 20 67 65 74 43 75 ||| item |== getCu|
|00000f00| 72 44 69 72 29 20 7b 0d | 09 09 2f 2a 20 66 6f 6c |rDir) {.|../* fol|
|00000f10| 64 65 72 20 73 65 6c 65 | 63 74 65 64 20 2a 2f 0d |der sele|cted */.|
|00000f20| 09 09 75 73 65 43 75 72 | 44 69 72 20 3d 20 69 74 |..useCur|Dir = it|
|00000f30| 65 6d 20 3d 3d 20 67 65 | 74 43 75 72 44 69 72 3b |em == ge|tCurDir;|
|00000f40| 0d 09 09 69 74 65 6d 20 | 3d 20 67 65 74 4f 70 65 |...item |= getOpe|
|00000f50| 6e 3b 0d 09 7d 0d 09 72 | 65 74 75 72 6e 28 69 74 |n;..}..r|eturn(it|
|00000f60| 65 6d 29 3b 0d 7d 0d 0d | 70 61 73 63 61 6c 20 42 |em);.}..|pascal B|
|00000f70| 6f 6f 6c 65 61 6e 0d 44 | 69 72 46 69 6c 74 65 72 |oolean.D|irFilter|
|00000f80| 50 72 6f 63 28 70 62 29 | 0d 43 49 6e 66 6f 50 42 |Proc(pb)|.CInfoPB|
|00000f90| 50 74 72 09 70 62 3b 0d | 7b 0d 09 72 65 74 75 72 |Ptr.pb;.|{..retur|
|00000fa0| 6e 28 21 44 49 52 45 43 | 54 4f 52 59 28 2a 70 62 |n(!DIREC|TORY(*pb|
|00000fb0| 29 29 3b 09 2f 2a 20 61 | 20 64 69 72 65 63 74 6f |));./* a| directo|
|00000fc0| 72 79 20 69 66 20 62 69 | 74 20 34 20 69 73 20 73 |ry if bi|t 4 is s|
|00000fd0| 65 74 20 2a 2f 0d 7d 0d | 2f 2a 0d 20 2a 20 47 65 |et */.}.|/*. * Ge|
|00000fe0| 74 44 69 72 20 2d 20 6d | 61 6e 61 67 65 20 74 68 |tDir - m|anage th|
|00000ff0| 65 20 64 69 72 65 63 74 | 6f 72 79 20 73 65 6c 65 |e direct|ory sele|
|00001000| 63 74 69 6f 6e 20 64 69 | 61 6c 6f 67 0d 20 2a 2f |ction di|alog. */|
|00001010| 0d 6c 6f 6e 67 0d 47 65 | 74 44 69 72 28 74 65 78 |.long.Ge|tDir(tex|
|00001020| 74 29 0d 63 68 61 72 09 | 2a 74 65 78 74 3b 0d 7b |t).char.|*text;.{|
|00001030| 0d 09 63 68 61 72 09 09 | 2a 72 6f 75 74 69 6e 65 |..char..|*routine|
|00001040| 20 3d 20 22 5c 70 47 65 | 74 44 69 72 22 3b 0d 09 | = "\pGe|tDir";..|
|00001050| 50 6f 69 6e 74 09 77 68 | 65 72 65 3b 0d 09 73 68 |Point.wh|ere;..sh|
|00001060| 6f 72 74 09 68 74 2c 20 | 77 64 3b 0d 09 53 46 52 |ort.ht, |wd;..SFR|
|00001070| 65 70 6c 79 09 72 65 70 | 6c 79 3b 0d 09 43 49 6e |eply.rep|ly;..CIn|
|00001080| 66 6f 50 42 52 65 63 09 | 70 62 3b 0d 09 44 69 61 |foPBRec.|pb;..Dia|
|00001090| 6c 6f 67 50 74 72 09 64 | 6c 67 50 3b 0d 09 6c 6f |logPtr.d|lgP;..lo|
|000010a0| 6e 67 09 09 64 69 72 44 | 69 72 49 44 3d 30 3b 09 |ng..dirD|irID=0;.|
|000010b0| 09 2f 2a 20 53 65 6c 65 | 63 74 65 64 20 64 69 72 |./* Sele|cted dir|
|000010c0| 65 63 74 6f 72 79 20 44 | 69 72 49 44 20 2a 2f 0d |ectory D|irID */.|
|000010d0| 0d 09 69 66 20 28 28 64 | 6c 67 50 20 3d 20 47 65 |..if ((d|lgP = Ge|
|000010e0| 74 4e 65 77 44 69 61 6c | 6f 67 28 67 64 44 6c 67 |tNewDial|og(gdDlg|
|000010f0| 52 65 73 2c 20 4e 49 4c | 2c 28 57 69 6e 64 6f 77 |Res, NIL|,(Window|
|00001100| 50 74 72 29 20 2d 31 29 | 29 20 3d 3d 20 4e 49 4c |Ptr) -1)|) == NIL|
|00001110| 29 20 7b 0d 09 09 72 65 | 74 75 72 6e 28 54 52 55 |) {...re|turn(TRU|
|00001120| 45 29 3b 0d 09 7d 0d 09 | 77 64 20 3d 20 28 64 6c |E);..}..|wd = (dl|
|00001130| 67 50 2d 3e 70 6f 72 74 | 52 65 63 74 2e 72 69 67 |gP->port|Rect.rig|
|00001140| 68 74 29 2d 28 64 6c 67 | 50 2d 3e 70 6f 72 74 52 |ht)-(dlg|P->portR|
|00001150| 65 63 74 2e 6c 65 66 74 | 29 3b 0d 09 68 74 20 3d |ect.left|);..ht =|
|00001160| 20 28 64 6c 67 50 2d 3e | 70 6f 72 74 52 65 63 74 | (dlgP->|portRect|
|00001170| 2e 62 6f 74 74 6f 6d 29 | 2d 28 64 6c 67 50 2d 3e |.bottom)|-(dlgP->|
|00001180| 70 6f 72 74 52 65 63 74 | 2e 74 6f 70 29 3b 0d 09 |portRect|.top);..|
|00001190| 2f 2a 20 63 65 6e 74 72 | 65 20 74 68 65 20 64 69 |/* centr|e the di|
|000011a0| 61 6c 6f 67 75 65 20 62 | 6f 78 20 6f 6e 20 74 68 |alogue b|ox on th|
|000011b0| 65 20 73 63 72 65 65 6e | 0d 09 20 20 20 28 62 75 |e screen|.. (bu|
|000011c0| 74 20 68 6f 77 20 64 6f | 20 49 20 6b 6e 6f 77 20 |t how do| I know |
|000011d0| 77 68 69 63 68 20 73 63 | 72 65 65 6e 3f 29 0d 09 |which sc|reen?)..|
|000011e0| 2a 2f 0d 09 77 68 65 72 | 65 2e 68 20 3d 20 28 73 |*/..wher|e.h = (s|
|000011f0| 63 72 65 65 6e 42 69 74 | 73 2e 62 6f 75 6e 64 73 |creenBit|s.bounds|
|00001200| 2e 72 69 67 68 74 2d 73 | 63 72 65 65 6e 42 69 74 |.right-s|creenBit|
|00001210| 73 2e 62 6f 75 6e 64 73 | 2e 6c 65 66 74 2d 77 64 |s.bounds|.left-wd|
|00001220| 29 20 2f 20 32 3b 0d 09 | 77 68 65 72 65 2e 76 20 |) / 2;..|where.v |
|00001230| 3d 20 28 73 63 72 65 65 | 6e 42 69 74 73 2e 62 6f |= (scree|nBits.bo|
|00001240| 75 6e 64 73 2e 62 6f 74 | 74 6f 6d 2d 73 63 72 65 |unds.bot|tom-scre|
|00001250| 65 6e 42 69 74 73 2e 62 | 6f 75 6e 64 73 2e 74 6f |enBits.b|ounds.to|
|00001260| 70 2d 68 74 29 20 2f 20 | 32 3b 0d 09 50 61 72 61 |p-ht) / |2;..Para|
|00001270| 6d 54 65 78 74 28 28 53 | 74 72 69 6e 67 50 74 72 |mText((S|tringPtr|
|00001280| 29 74 65 78 74 2c 20 28 | 53 74 72 69 6e 67 50 74 |)text, (|StringPt|
|00001290| 72 29 22 5c 70 22 2c 20 | 28 53 74 72 69 6e 67 50 |r)"\p", |(StringP|
|000012a0| 74 72 29 22 5c 70 22 2c | 20 28 53 74 72 69 6e 67 |tr)"\p",| (String|
|000012b0| 50 74 72 29 22 5c 70 22 | 29 3b 0d 09 53 46 50 47 |Ptr)"\p"|);..SFPG|
|000012c0| 65 74 46 69 6c 65 20 28 | 77 68 65 72 65 2c 20 28 |etFile (|where, (|
|000012d0| 53 74 72 69 6e 67 50 74 | 72 29 74 65 78 74 2c 20 |StringPt|r)text, |
|000012e0| 28 46 69 6c 74 65 72 50 | 72 6f 63 29 44 69 72 46 |(FilterP|roc)DirF|
|000012f0| 69 6c 74 65 72 50 72 6f | 63 2c 20 2d 31 2c 20 4e |ilterPro|c, -1, N|
|00001300| 49 4c 2c 20 44 69 72 53 | 65 6c 48 6f 6f 6b 2c 20 |IL, DirS|elHook, |
|00001310| 26 72 65 70 6c 79 2c 0d | 09 09 09 09 67 64 44 6c |&reply,.|....gdDl|
|00001320| 67 52 65 73 2c 20 4e 49 | 4c 29 3b 0d 09 69 66 20 |gRes, NI|L);..if |
|00001330| 28 72 65 70 6c 79 2e 67 | 6f 6f 64 29 20 7b 0d 09 |(reply.g|ood) {..|
|00001340| 09 64 69 72 56 52 65 66 | 4e 75 6d 20 3d 20 72 65 |.dirVRef|Num = re|
|00001350| 70 6c 79 2e 76 52 65 66 | 4e 75 6d 3b 0d 09 09 69 |ply.vRef|Num;...i|
|00001360| 66 20 28 75 73 65 43 75 | 72 44 69 72 29 20 7b 0d |f (useCu|rDir) {.|
|00001370| 09 09 09 64 69 72 44 69 | 72 49 44 20 3d 20 43 75 |...dirDi|rID = Cu|
|00001380| 72 44 69 72 53 74 6f 72 | 65 3b 0d 09 09 7d 0d 09 |rDirStor|e;...}..|
|00001390| 09 65 6c 73 65 20 7b 0d | 09 09 09 64 69 72 44 69 |.else {.|...dirDi|
|000013a0| 72 49 44 20 3d 20 28 6c | 6f 6e 67 29 28 72 65 70 |rID = (l|ong)(rep|
|000013b0| 6c 79 2e 66 54 79 70 65 | 29 3b 0d 09 09 7d 0d 09 |ly.fType|);...}..|
|000013c0| 7d 0d 09 72 65 74 75 72 | 6e 28 64 69 72 44 69 72 |}..retur|n(dirDir|
|000013d0| 49 44 29 3b 0d 7d 0d 0d | 76 6f 69 64 20 47 65 74 |ID);.}..|void Get|
|000013e0| 4e 65 78 74 46 69 6c 65 | 28 66 49 6e 66 6f 50 74 |NextFile|(fInfoPt|
|000013f0| 72 29 0d 53 46 52 65 70 | 6c 79 09 2a 66 49 6e 66 |r).SFRep|ly.*fInf|
|00001400| 6f 50 74 72 3b 0d 7b 09 | 41 70 70 46 69 6c 65 09 |oPtr;.{.|AppFile.|
|00001410| 6e 65 78 74 46 69 6c 65 | 3b 0d 09 73 74 61 74 69 |nextFile|;..stati|
|00001420| 63 09 73 68 6f 72 74 09 | 69 64 78 3d 31 3b 0d 0d |c.short.|idx=1;..|
|00001430| 09 47 65 74 41 70 70 46 | 69 6c 65 73 28 69 64 78 |.GetAppF|iles(idx|
|00001440| 2b 2b 2c 20 26 6e 65 78 | 74 46 69 6c 65 29 3b 0d |++, &nex|tFile);.|
|00001450| 09 66 49 6e 66 6f 50 74 | 72 2d 3e 76 52 65 66 4e |.fInfoPt|r->vRefN|
|00001460| 75 6d 20 3d 20 6e 65 78 | 74 46 69 6c 65 2e 76 52 |um = nex|tFile.vR|
|00001470| 65 66 4e 75 6d 3b 0d 09 | 66 49 6e 66 6f 50 74 72 |efNum;..|fInfoPtr|
|00001480| 2d 3e 66 54 79 70 65 20 | 3d 20 6e 65 78 74 46 69 |->fType |= nextFi|
|00001490| 6c 65 2e 66 54 79 70 65 | 3b 0d 09 66 49 6e 66 6f |le.fType|;..fInfo|
|000014a0| 50 74 72 2d 3e 76 65 72 | 73 69 6f 6e 20 3d 20 6e |Ptr->ver|sion = n|
|000014b0| 65 78 74 46 69 6c 65 2e | 76 65 72 73 4e 75 6d 3b |extFile.|versNum;|
|000014c0| 0d 09 42 6c 6f 63 6b 4d | 6f 76 65 28 6e 65 78 74 |..BlockM|ove(next|
|000014d0| 46 69 6c 65 2e 66 4e 61 | 6d 65 2c 20 66 49 6e 66 |File.fNa|me, fInf|
|000014e0| 6f 50 74 72 2d 3e 66 4e | 61 6d 65 2c 20 28 69 6e |oPtr->fN|ame, (in|
|000014f0| 74 29 28 6e 65 78 74 46 | 69 6c 65 2e 66 4e 61 6d |t)(nextF|ile.fNam|
|00001500| 65 5b 30 5d 2b 31 29 29 | 3b 0d 09 61 70 70 46 69 |e[0]+1))|;..appFi|
|00001510| 6c 65 43 6f 75 6e 74 2d | 2d 3b 0d 7d 0d 0d 0d 45 |leCount-|-;.}...E|
|00001520| 78 74 72 61 63 74 28 29 | 20 7b 0d 09 50 6f 69 6e |xtract()| {..Poin|
|00001530| 74 09 09 77 68 65 72 65 | 3b 0d 09 53 46 52 65 70 |t..where|;..SFRep|
|00001540| 6c 79 09 09 72 65 70 6c | 79 3b 0d 0d 09 77 68 69 |ly..repl|y;...whi|
|00001550| 6c 65 20 28 31 29 7b 0d | 09 09 69 66 20 28 61 70 |le (1){.|..if (ap|
|00001560| 70 46 69 6c 65 43 6f 75 | 6e 74 20 3e 20 30 29 20 |pFileCou|nt > 0) |
|00001570| 47 65 74 4e 65 78 74 46 | 69 6c 65 28 26 72 65 70 |GetNextF|ile(&rep|
|00001580| 6c 79 29 3b 0d 09 09 65 | 6c 73 65 20 7b 0d 09 09 |ly);...e|lse {...|
|00001590| 09 2f 2a 0d 09 09 09 20 | 2a 20 55 73 65 20 74 68 |./*.... |* Use th|
|000015a0| 65 20 73 74 61 6e 64 61 | 72 64 20 66 69 6c 65 20 |e standa|rd file |
|000015b0| 64 69 61 6c 6f 67 20 74 | 6f 20 73 65 6c 65 63 74 |dialog t|o select|
|000015c0| 20 74 68 65 20 61 72 63 | 68 69 76 65 2e 0d 09 09 | the arc|hive....|
|000015d0| 09 20 2a 2f 0d 09 09 09 | 77 68 65 72 65 2e 68 20 |. */....|where.h |
|000015e0| 3d 20 77 68 65 72 65 2e | 76 20 3d 20 37 35 3b 0d |= where.|v = 75;.|
|000015f0| 09 09 09 53 46 47 65 74 | 46 69 6c 65 28 77 68 65 |...SFGet|File(whe|
|00001600| 72 65 2c 20 28 53 74 72 | 69 6e 67 50 74 72 29 22 |re, (Str|ingPtr)"|
|00001610| 5c 70 53 65 6c 65 63 74 | 20 73 68 61 72 20 66 69 |\pSelect| shar fi|
|00001620| 6c 65 22 2c 20 4e 49 4c | 2c 20 30 2c 20 4e 49 4c |le", NIL|, 0, NIL|
|00001630| 2c 20 4e 49 4c 2c 20 26 | 72 65 70 6c 79 29 3b 0d |, NIL, &|reply);.|
|00001640| 09 09 09 69 66 20 28 21 | 72 65 70 6c 79 2e 67 6f |...if (!|reply.go|
|00001650| 6f 64 29 0d 09 09 09 09 | 72 65 74 75 72 6e 3b 0d |od).....|return;.|
|00001660| 09 09 7d 0d 09 0d 09 09 | 2f 2a 0d 09 09 20 2a 20 |..}.....|/*... * |
|00001670| 52 65 6d 65 6d 62 65 72 | 20 74 68 65 20 56 52 65 |Remember| the VRe|
|00001680| 66 4e 75 6d 20 61 6e 64 | 20 4e 61 6d 65 20 66 6f |fNum and| Name fo|
|00001690| 72 20 4f 70 65 6e 41 72 | 63 68 69 76 65 2e 0d 09 |r OpenAr|chive...|
|000016a0| 09 20 2a 20 46 69 6e 64 | 20 6f 75 74 20 77 68 65 |. * Find| out whe|
|000016b0| 72 65 20 74 6f 20 70 75 | 74 20 74 68 65 20 65 78 |re to pu|t the ex|
|000016c0| 74 72 61 63 74 65 64 20 | 66 69 6c 65 73 2e 0d 09 |tracted |files...|
|000016d0| 09 20 2a 2f 0d 09 09 28 | 76 6f 69 64 29 20 53 65 |. */...(|void) Se|
|000016e0| 74 56 6f 6c 28 4e 49 4c | 2c 20 72 65 70 6c 79 2e |tVol(NIL|, reply.|
|000016f0| 76 52 65 66 4e 75 6d 29 | 3b 0d 09 09 50 74 6f 43 |vRefNum)|;...PtoC|
|00001700| 73 74 72 28 28 63 68 61 | 72 20 2a 29 72 65 70 6c |str((cha|r *)repl|
|00001710| 79 2e 66 4e 61 6d 65 29 | 3b 0d 09 09 75 6e 73 68 |y.fName)|;...unsh|
|00001720| 61 72 28 72 65 70 6c 79 | 2e 66 4e 61 6d 65 29 3b |ar(reply|.fName);|
|00001730| 0d 09 09 28 76 6f 69 64 | 29 20 53 65 74 56 6f 6c |...(void|) SetVol|
|00001740| 28 4e 49 4c 2c 20 72 65 | 70 6c 79 2e 76 52 65 66 |(NIL, re|ply.vRef|
|00001750| 4e 75 6d 29 3b 0d 09 7d | 0d 7d 0d 0d 0d 6d 61 69 |Num);..}|.}...mai|
|00001760| 6e 28 61 72 67 63 2c 20 | 61 72 67 76 29 0d 69 6e |n(argc, |argv).in|
|00001770| 74 20 61 72 67 63 3b 0d | 63 68 61 72 20 2a 2a 61 |t argc;.|char **a|
|00001780| 72 67 76 3b 0d 7b 0d 09 | 48 61 6e 64 6c 65 09 09 |rgv;.{..|Handle..|
|00001790| 66 54 79 70 65 48 3b 0d | 09 44 69 61 6c 6f 67 54 |fTypeH;.|.DialogT|
|000017a0| 48 6e 64 6c 09 64 6c 67 | 48 3b 0d 20 20 50 6f 69 |Hndl.dlg|H;. Poi|
|000017b0| 6e 74 09 77 68 65 72 65 | 3b 0d 20 20 73 68 6f 72 |nt.where|;. shor|
|000017c0| 74 09 68 74 2c 20 77 64 | 3b 0d 09 09 0d 09 53 6b |t.ht, wd|;.....Sk|
|000017d0| 65 6c 49 6e 69 74 20 28 | 33 2c 20 4e 49 4c 29 3b |elInit (|3, NIL);|
|000017e0| 0d 09 53 6b 65 6c 41 70 | 70 6c 65 20 28 22 5c 70 |..SkelAp|ple ("\p|
|000017f0| 41 62 6f 75 74 20 55 6e | 73 68 61 72 c9 22 2c 20 |About Un|shar.", |
|00001800| 44 6f 41 62 6f 75 74 29 | 3b 0d 0d 09 66 69 6c 65 |DoAbout)|;...file|
|00001810| 4d 20 3d 20 4e 65 77 4d | 65 6e 75 20 28 31 30 30 |M = NewM|enu (100|
|00001820| 30 2c 20 28 53 74 72 69 | 6e 67 50 74 72 29 22 5c |0, (Stri|ngPtr)"\|
|00001830| 70 46 69 6c 65 22 29 3b | 0d 09 41 70 70 65 6e 64 |pFile");|..Append|
|00001840| 4d 65 6e 75 20 28 66 69 | 6c 65 4d 2c 20 28 53 74 |Menu (fi|leM, (St|
|00001850| 72 69 6e 67 50 74 72 29 | 22 5c 70 45 78 74 72 61 |ringPtr)|"\pExtra|
|00001860| 63 74 2f 4f 3b 43 6c 6f | 73 65 2f 4b 3b 51 75 69 |ct/O;Clo|se/K;Qui|
|00001870| 74 2f 51 22 29 3b 0d 09 | 53 6b 65 6c 4d 65 6e 75 |t/Q");..|SkelMenu|
|00001880| 20 28 66 69 6c 65 4d 2c | 20 44 6f 46 69 6c 65 4d | (fileM,| DoFileM|
|00001890| 65 6e 75 2c 20 4e 49 4c | 2c 20 46 41 4c 53 45 29 |enu, NIL|, FALSE)|
|000018a0| 3b 0d 0d 09 65 64 69 74 | 4d 20 3d 20 4e 65 77 4d |;...edit|M = NewM|
|000018b0| 65 6e 75 20 28 31 30 30 | 31 2c 20 28 53 74 72 69 |enu (100|1, (Stri|
|000018c0| 6e 67 50 74 72 29 22 5c | 70 45 64 69 74 22 29 3b |ngPtr)"\|pEdit");|
|000018d0| 0d 09 41 70 70 65 6e 64 | 4d 65 6e 75 20 28 65 64 |..Append|Menu (ed|
|000018e0| 69 74 4d 2c 20 28 53 74 | 72 69 6e 67 50 74 72 29 |itM, (St|ringPtr)|
|000018f0| 22 5c 70 28 55 6e 64 6f | 2f 5a 3b 28 2d 3b 43 75 |"\p(Undo|/Z;(-;Cu|
|00001900| 74 2f 58 3b 43 6f 70 79 | 2f 43 3b 50 61 73 74 65 |t/X;Copy|/C;Paste|
|00001910| 2f 56 3b 43 6c 65 61 72 | 22 29 3b 0d 09 53 6b 65 |/V;Clear|");..Ske|
|00001920| 6c 4d 65 6e 75 20 28 65 | 64 69 74 4d 2c 20 44 6f |lMenu (e|ditM, Do|
|00001930| 45 64 69 74 4d 65 6e 75 | 2c 20 4e 49 4c 2c 20 46 |EditMenu|, NIL, F|
|00001940| 41 4c 53 45 29 3b 0d 0d | 09 6f 70 74 4d 20 3d 20 |ALSE);..|.optM = |
|00001950| 4e 65 77 4d 65 6e 75 20 | 28 31 30 30 32 2c 20 28 |NewMenu |(1002, (|
|00001960| 53 74 72 69 6e 67 50 74 | 72 29 22 5c 70 4f 70 74 |StringPt|r)"\pOpt|
|00001970| 69 6f 6e 73 22 29 3b 0d | 09 41 70 70 65 6e 64 4d |ions");.|.AppendM|
|00001980| 65 6e 75 20 28 6f 70 74 | 4d 2c 20 28 53 74 72 69 |enu (opt|M, (Stri|
|00001990| 6e 67 50 74 72 29 22 5c | 70 4f 76 65 72 77 72 69 |ngPtr)"\|pOverwri|
|000019a0| 74 65 20 65 78 69 73 74 | 69 6e 67 20 66 69 6c 65 |te exist|ing file|
|000019b0| 73 3b 46 69 6c 65 20 74 | 79 70 65 2e 2e 2e 22 29 |s;File t|ype...")|
|000019c0| 3b 0d 09 53 6b 65 6c 4d | 65 6e 75 20 28 6f 70 74 |;..SkelM|enu (opt|
|000019d0| 4d 2c 20 44 6f 4f 70 74 | 4d 65 6e 75 2c 20 4e 49 |M, DoOpt|Menu, NI|
|000019e0| 4c 2c 20 54 52 55 45 29 | 3b 0d 09 0d 09 43 6f 75 |L, TRUE)|;....Cou|
|000019f0| 6e 74 41 70 70 46 69 6c | 65 73 20 28 26 77 68 61 |ntAppFil|es (&wha|
|00001a00| 74 54 6f 44 6f 2c 20 26 | 61 70 70 46 69 6c 65 43 |tToDo, &|appFileC|
|00001a10| 6f 75 6e 74 29 3b 0d 09 | 69 66 20 28 28 66 54 79 |ount);..|if ((fTy|
|00001a20| 70 65 48 20 3d 20 28 63 | 68 61 72 20 2a 2a 29 47 |peH = (c|har **)G|
|00001a30| 65 74 52 65 73 6f 75 72 | 63 65 28 27 66 74 79 70 |etResour|ce('ftyp|
|00001a40| 27 2c 20 30 29 29 20 3d | 3d 20 4e 49 4c 29 20 7b |', 0)) =|= NIL) {|
|00001a50| 0d 09 09 45 78 69 74 54 | 6f 53 68 65 6c 6c 28 29 |...ExitT|oShell()|
|00001a60| 3b 0d 09 7d 0d 09 42 6c | 6f 63 6b 4d 6f 76 65 28 |;..}..Bl|ockMove(|
|00001a70| 2a 66 54 79 70 65 48 2c | 20 26 66 64 43 72 65 61 |*fTypeH,| &fdCrea|
|00001a80| 74 6f 72 2c 20 34 29 3b | 0d 09 42 6c 6f 63 6b 4d |tor, 4);|..BlockM|
|00001a90| 6f 76 65 28 28 2a 66 54 | 79 70 65 48 29 2b 34 2c |ove((*fT|ypeH)+4,|
|00001aa0| 20 26 66 64 54 79 70 65 | 2c 20 34 29 3b 0d 09 52 | &fdType|, 4);..R|
|00001ab0| 65 6c 65 61 73 65 52 65 | 73 6f 75 72 63 65 28 66 |eleaseRe|source(f|
|00001ac0| 54 79 70 65 48 29 3b 0d | 09 0d 09 43 6f 75 6c 64 |TypeH);.|...Could|
|00001ad0| 44 69 61 6c 6f 67 28 74 | 79 70 65 44 6c 67 52 65 |Dialog(t|ypeDlgRe|
|00001ae0| 73 29 3b 0d 09 43 6f 75 | 6c 64 44 69 61 6c 6f 67 |s);..Cou|ldDialog|
|00001af0| 28 69 6e 66 6f 44 6c 67 | 52 65 73 29 3b 0d 09 64 |(infoDlg|Res);..d|
|00001b00| 6c 67 48 20 3d 20 28 44 | 69 61 6c 6f 67 54 48 6e |lgH = (D|ialogTHn|
|00001b10| 64 6c 29 47 65 74 52 65 | 73 6f 75 72 63 65 28 27 |dl)GetRe|source('|
|00001b20| 44 4c 4f 47 27 2c 20 74 | 79 70 65 44 6c 67 52 65 |DLOG', t|ypeDlgRe|
|00001b30| 73 29 3b 0d 09 77 64 20 | 3d 20 28 28 2a 20 64 6c |s);..wd |= ((* dl|
|00001b40| 67 48 29 2d 3e 62 6f 75 | 6e 64 73 52 65 63 74 2e |gH)->bou|ndsRect.|
|00001b50| 72 69 67 68 74 29 2d 28 | 28 2a 20 64 6c 67 48 29 |right)-(|(* dlgH)|
|00001b60| 2d 3e 62 6f 75 6e 64 73 | 52 65 63 74 2e 6c 65 66 |->bounds|Rect.lef|
|00001b70| 74 29 3b 0d 09 2f 2a 20 | 63 65 6e 74 72 65 20 74 |t);../* |centre t|
|00001b80| 68 65 20 64 69 61 6c 6f | 67 75 65 20 62 6f 78 20 |he dialo|gue box |
|00001b90| 6f 6e 20 74 68 65 20 73 | 63 72 65 65 6e 0d 09 20 |on the s|creen.. |
|00001ba0| 20 20 28 62 75 74 20 68 | 6f 77 20 64 6f 20 49 20 | (but h|ow do I |
|00001bb0| 6b 6e 6f 77 20 77 68 69 | 63 68 20 73 63 72 65 65 |know whi|ch scree|
|00001bc0| 6e 3f 29 0d 09 2a 2f 0d | 09 77 68 65 72 65 2e 68 |n?)..*/.|.where.h|
|00001bd0| 20 3d 20 28 73 63 72 65 | 65 6e 42 69 74 73 2e 62 | = (scre|enBits.b|
|00001be0| 6f 75 6e 64 73 2e 72 69 | 67 68 74 2d 73 63 72 65 |ounds.ri|ght-scre|
|00001bf0| 65 6e 42 69 74 73 2e 62 | 6f 75 6e 64 73 2e 6c 65 |enBits.b|ounds.le|
|00001c00| 66 74 2d 77 64 29 20 2f | 20 32 3b 0d 09 28 2a 20 |ft-wd) /| 2;..(* |
|00001c10| 64 6c 67 48 29 2d 3e 62 | 6f 75 6e 64 73 52 65 63 |dlgH)->b|oundsRec|
|00001c20| 74 2e 72 69 67 68 74 20 | 2b 3d 20 77 68 65 72 65 |t.right |+= where|
|00001c30| 2e 68 3b 0d 09 28 2a 20 | 64 6c 67 48 29 2d 3e 62 |.h;..(* |dlgH)->b|
|00001c40| 6f 75 6e 64 73 52 65 63 | 74 2e 6c 65 66 74 20 3d |oundsRec|t.left =|
|00001c50| 20 77 68 65 72 65 2e 68 | 3b 0d 09 0d 09 64 6c 67 | where.h|;....dlg|
|00001c60| 48 20 3d 20 28 44 69 61 | 6c 6f 67 54 48 6e 64 6c |H = (Dia|logTHndl|
|00001c70| 29 47 65 74 52 65 73 6f | 75 72 63 65 28 27 44 4c |)GetReso|urce('DL|
|00001c80| 4f 47 27 2c 20 69 6e 66 | 6f 44 6c 67 52 65 73 29 |OG', inf|oDlgRes)|
|00001c90| 3b 0d 09 77 64 20 3d 20 | 28 28 2a 20 64 6c 67 48 |;..wd = |((* dlgH|
|00001ca0| 29 2d 3e 62 6f 75 6e 64 | 73 52 65 63 74 2e 72 69 |)->bound|sRect.ri|
|00001cb0| 67 68 74 29 2d 28 28 2a | 20 64 6c 67 48 29 2d 3e |ght)-((*| dlgH)->|
|00001cc0| 62 6f 75 6e 64 73 52 65 | 63 74 2e 6c 65 66 74 29 |boundsRe|ct.left)|
|00001cd0| 3b 0d 09 2f 2a 20 63 65 | 6e 74 72 65 20 74 68 65 |;../* ce|ntre the|
|00001ce0| 20 64 69 61 6c 6f 67 75 | 65 20 62 6f 78 20 6f 6e | dialogu|e box on|
|00001cf0| 20 74 68 65 20 73 63 72 | 65 65 6e 0d 09 20 20 20 | the scr|een.. |
|00001d00| 28 62 75 74 20 68 6f 77 | 20 64 6f 20 49 20 6b 6e |(but how| do I kn|
|00001d10| 6f 77 20 77 68 69 63 68 | 20 73 63 72 65 65 6e 3f |ow which| screen?|
|00001d20| 29 0d 09 2a 2f 0d 09 77 | 68 65 72 65 2e 68 20 3d |)..*/..w|here.h =|
|00001d30| 20 28 73 63 72 65 65 6e | 42 69 74 73 2e 62 6f 75 | (screen|Bits.bou|
|00001d40| 6e 64 73 2e 72 69 67 68 | 74 2d 73 63 72 65 65 6e |nds.righ|t-screen|
|00001d50| 42 69 74 73 2e 62 6f 75 | 6e 64 73 2e 6c 65 66 74 |Bits.bou|nds.left|
|00001d60| 2d 77 64 29 20 2f 20 32 | 3b 0d 09 28 2a 20 64 6c |-wd) / 2|;..(* dl|
|00001d70| 67 48 29 2d 3e 62 6f 75 | 6e 64 73 52 65 63 74 2e |gH)->bou|ndsRect.|
|00001d80| 72 69 67 68 74 20 2b 3d | 20 77 68 65 72 65 2e 68 |right +=| where.h|
|00001d90| 3b 0d 09 28 2a 20 64 6c | 67 48 29 2d 3e 62 6f 75 |;..(* dl|gH)->bou|
|00001da0| 6e 64 73 52 65 63 74 2e | 6c 65 66 74 20 3d 20 77 |ndsRect.|left = w|
|00001db0| 68 65 72 65 2e 68 3b 0d | 0d 09 53 6b 65 6c 4d 61 |here.h;.|..SkelMa|
|00001dc0| 69 6e 20 28 29 3b 0d 09 | 53 6b 65 6c 43 6c 6f 62 |in ();..|SkelClob|
|00001dd0| 62 65 72 20 28 29 3b 0d | 09 46 72 65 65 44 69 61 |ber ();.|.FreeDia|
|00001de0| 6c 6f 67 28 74 79 70 65 | 44 6c 67 52 65 73 29 3b |log(type|DlgRes);|
|00001df0| 0d 09 46 72 65 65 44 69 | 61 6c 6f 67 28 69 6e 66 |..FreeDi|alog(inf|
|00001e00| 6f 44 6c 67 52 65 73 29 | 3b 0d 7d 0d 0d 75 6e 73 |oDlgRes)|;.}..uns|
|00001e10| 68 61 72 28 73 29 0d 63 | 68 61 72 09 2a 73 3b 0d |har(s).c|har.*s;.|
|00001e20| 7b 0d 20 20 63 68 61 72 | 20 62 75 66 66 65 72 5b |{. char| buffer[|
|00001e30| 42 55 46 53 49 5a 5d 3b | 0d 20 20 63 68 61 72 20 |BUFSIZ];|. char |
|00001e40| 2a 63 70 3b 0d 20 20 46 | 49 4c 45 20 2a 69 6e 66 |*cp;. F|ILE *inf|
|00001e50| 70 2c 20 2a 6f 75 74 66 | 70 3b 0d 20 20 63 68 61 |p, *outf|p;. cha|
|00001e60| 72 20 75 6e 69 78 66 69 | 6c 65 6e 61 6d 65 5b 36 |r unixfi|lename[6|
|00001e70| 34 5d 2c 20 6d 70 77 66 | 69 6c 65 6e 61 6d 65 5b |4], mpwf|ilename[|
|00001e80| 36 34 5d 3b 0d 20 20 69 | 6e 74 20 6c 69 6e 65 3b |64];. i|nt line;|
|00001e90| 0d 20 20 73 68 6f 72 74 | 20 76 3b 0d 20 20 6c 6f |. short| v;. lo|
|00001ea0| 6e 67 20 64 69 72 49 44 | 2c 20 64 49 44 3b 0d 20 |ng dirID|, dID;. |
|00001eb0| 20 57 44 50 42 52 65 63 | 09 09 77 64 70 62 3b 0d | WDPBRec|..wdpb;.|
|00001ec0| 20 20 63 68 61 72 09 6c | 69 6e 65 4e 6f 5b 31 30 | char.l|ineNo[10|
|00001ed0| 5d 3b 0d 0d 20 20 69 6e | 66 70 20 3d 20 66 6f 70 |];.. in|fp = fop|
|00001ee0| 65 6e 28 73 2c 20 22 72 | 22 29 3b 0d 20 20 43 74 |en(s, "r|");. Ct|
|00001ef0| 6f 50 73 74 72 28 73 29 | 3b 0d 20 20 69 66 20 28 |oPstr(s)|;. if (|
|00001f00| 21 69 6e 66 70 29 20 7b | 0d 20 20 20 20 50 61 72 |!infp) {|. Par|
|00001f10| 61 6d 54 65 78 74 28 28 | 53 74 72 69 6e 67 50 74 |amText((|StringPt|
|00001f20| 72 29 22 5c 70 43 6f 75 | 6c 64 20 6e 6f 74 20 6f |r)"\pCou|ld not o|
|00001f30| 70 65 6e 20 66 69 6c 65 | 20 22 2c 20 28 53 74 72 |pen file| ", (Str|
|00001f40| 69 6e 67 50 74 72 29 73 | 2c 0d 20 20 20 20 09 09 |ingPtr)s|,. ..|
|00001f50| 20 20 28 53 74 72 69 6e | 67 50 74 72 29 22 5c 70 | (Strin|gPtr)"\p|
|00001f60| 22 2c 20 28 53 74 72 69 | 6e 67 50 74 72 29 22 5c |", (Stri|ngPtr)"\|
|00001f70| 70 22 29 3b 0d 20 20 20 | 20 28 76 6f 69 64 29 53 |p");. | (void)S|
|00001f80| 74 6f 70 41 6c 65 72 74 | 28 65 72 72 6f 72 41 6c |topAlert|(errorAl|
|00001f90| 65 72 74 52 65 73 2c 20 | 4e 49 4c 29 3b 0d 20 20 |ertRes, |NIL);. |
|00001fa0| 20 20 72 65 74 75 72 6e | 3b 0d 20 20 7d 0d 0d 20 | return|;. }.. |
|00001fb0| 20 2f 2a 20 73 6b 69 70 | 20 6f 76 65 72 20 6e 65 | /* skip| over ne|
|00001fc0| 77 73 20 68 65 61 64 65 | 72 20 6c 69 6e 65 73 20 |ws heade|r lines |
|00001fd0| 65 74 63 2e 20 2a 2f 0d | 20 20 66 6f 72 20 28 6c |etc. */.| for (l|
|00001fe0| 69 6e 65 20 3d 20 31 3b | 20 63 70 20 3d 20 66 67 |ine = 1;| cp = fg|
|00001ff0| 65 74 73 28 62 75 66 66 | 65 72 2c 20 73 69 7a 65 |ets(buff|er, size|
|00002000| 6f 66 28 62 75 66 66 65 | 72 29 2c 20 69 6e 66 70 |of(buffe|r), infp|
|00002010| 29 3b 20 6c 69 6e 65 2b | 2b 29 0d 20 20 20 20 69 |); line+|+). i|
|00002020| 66 20 28 62 75 66 66 65 | 72 5b 30 5d 20 3d 3d 20 |f (buffe|r[0] == |
|00002030| 27 23 27 29 20 62 72 65 | 61 6b 3b 0d 20 20 69 66 |'#') bre|ak;. if|
|00002040| 20 28 21 63 70 29 20 7b | 0d 20 20 20 20 50 61 72 | (!cp) {|. Par|
|00002050| 61 6d 54 65 78 74 28 28 | 53 74 72 69 6e 67 50 74 |amText((|StringPt|
|00002060| 72 29 22 5c 70 43 6f 75 | 6c 64 20 6e 6f 74 20 6c |r)"\pCou|ld not l|
|00002070| 6f 63 61 74 65 20 73 74 | 61 72 74 20 6f 66 20 61 |ocate st|art of a|
|00002080| 72 63 68 69 76 65 20 69 | 6e 20 66 69 6c 65 22 2c |rchive i|n file",|
|00002090| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 28 |. | (|
|000020a0| 53 74 72 69 6e 67 50 74 | 72 29 73 2c 20 28 53 74 |StringPt|r)s, (St|
|000020b0| 72 69 6e 67 50 74 72 29 | 22 5c 70 22 2c 20 28 53 |ringPtr)|"\p", (S|
|000020c0| 74 72 69 6e 67 50 74 72 | 29 22 5c 70 22 29 3b 0d |tringPtr|)"\p");.|
|000020d0| 20 20 20 20 28 76 6f 69 | 64 29 53 74 6f 70 41 6c | (voi|d)StopAl|
|000020e0| 65 72 74 28 65 72 72 6f | 72 41 6c 65 72 74 52 65 |ert(erro|rAlertRe|
|000020f0| 73 2c 20 4e 49 4c 29 3b | 0d 20 20 20 20 72 65 74 |s, NIL);|. ret|
|00002100| 75 72 6e 3b 0d 20 20 7d | 0d 09 2f 2a 0d 09 20 2a |urn;. }|../*.. *|
|00002110| 20 4f 70 65 6e 20 74 68 | 65 20 74 61 72 67 65 74 | Open th|e target|
|00002120| 20 64 69 72 65 63 74 6f | 72 79 20 61 73 20 61 20 | directo|ry as a |
|00002130| 62 61 73 65 20 74 6f 20 | 70 75 74 20 65 76 65 72 |base to |put ever|
|00002140| 79 74 68 69 6e 67 2e 0d | 09 20 2a 2f 0d 09 69 66 |ything..|. */..if|
|00002150| 20 28 28 64 69 72 49 44 | 20 3d 20 47 65 74 44 69 | ((dirID| = GetDi|
|00002160| 72 28 22 5c 70 69 6e 20 | 77 68 69 63 68 20 74 6f |r("\pin |which to|
|00002170| 20 70 75 74 20 65 78 74 | 72 61 63 74 65 64 20 66 | put ext|racted f|
|00002180| 69 6c 65 73 22 29 29 20 | 3d 3d 20 30 4c 29 0d 09 |iles")) |== 0L)..|
|00002190| 09 72 65 74 75 72 6e 3b | 0d 09 0d 09 77 64 70 62 |.return;|....wdpb|
|000021a0| 2e 69 6f 43 6f 6d 70 6c | 65 74 69 6f 6e 20 3d 20 |.ioCompl|etion = |
|000021b0| 4e 49 4c 3b 0d 09 77 64 | 70 62 2e 69 6f 4e 61 6d |NIL;..wd|pb.ioNam|
|000021c0| 65 50 74 72 20 3d 20 4e | 49 4c 3b 0d 09 77 64 70 |ePtr = N|IL;..wdp|
|000021d0| 62 2e 69 6f 56 52 65 66 | 4e 75 6d 20 3d 20 64 69 |b.ioVRef|Num = di|
|000021e0| 72 56 52 65 66 4e 75 6d | 3b 0d 09 77 64 70 62 2e |rVRefNum|;..wdpb.|
|000021f0| 69 6f 57 44 50 72 6f 63 | 49 44 20 3d 20 27 53 68 |ioWDProc|ID = 'Sh|
|00002200| 61 72 27 3b 0d 09 77 64 | 70 62 2e 69 6f 57 44 44 |ar';..wd|pb.ioWDD|
|00002210| 69 72 49 44 20 3d 20 64 | 69 72 49 44 3b 0d 09 69 |irID = d|irID;..i|
|00002220| 66 20 28 50 42 4f 70 65 | 6e 57 44 28 26 77 64 70 |f (PBOpe|nWD(&wdp|
|00002230| 62 2c 20 46 41 4c 53 45 | 29 20 21 3d 20 6e 6f 45 |b, FALSE|) != noE|
|00002240| 72 72 29 20 7b 0d 09 09 | 72 65 74 75 72 6e 3b 0d |rr) {...|return;.|
|00002250| 09 7d 0d 09 0d 09 2f 2a | 0d 09 20 2a 20 45 78 74 |.}..../*|.. * Ext|
|00002260| 72 61 63 74 20 61 6e 64 | 20 70 72 69 6e 74 20 74 |ract and| print t|
|00002270| 68 65 20 66 69 6c 65 73 | 20 61 73 20 66 6f 75 6e |he files| as foun|
|00002280| 64 20 69 6e 20 74 68 65 | 20 61 72 63 68 69 76 65 |d in the| archive|
|00002290| 2e 0d 09 20 2a 2f 0d 09 | 64 49 44 20 3d 20 64 69 |... */..|dID = di|
|000022a0| 72 56 52 65 66 4e 75 6d | 20 3d 20 77 64 70 62 2e |rVRefNum| = wdpb.|
|000022b0| 69 6f 56 52 65 66 4e 75 | 6d 3b 0d 09 28 76 6f 69 |ioVRefNu|m;..(voi|
|000022c0| 64 29 53 65 74 56 6f 6c | 28 4e 49 4c 2c 20 64 49 |d)SetVol|(NIL, dI|
|000022d0| 44 29 3b 0d 0d 20 20 2f | 2a 20 6e 6f 77 20 77 65 |D);.. /|* now we|
|000022e0| 20 73 68 6f 75 6c 64 20 | 62 65 20 61 74 20 74 68 | should |be at th|
|000022f0| 65 20 73 74 61 72 74 20 | 6f 66 20 74 68 65 20 73 |e start |of the s|
|00002300| 68 61 72 20 61 72 63 68 | 69 76 65 20 69 74 73 65 |har arch|ive itse|
|00002310| 6c 66 20 2a 2f 0d 20 20 | 69 6e 66 6f 44 6c 67 50 |lf */. |infoDlgP|
|00002320| 74 72 20 3d 20 4e 49 4c | 3b 0d 20 20 69 6e 66 6f |tr = NIL|;. info|
|00002330| 44 6c 67 50 74 72 20 3d | 20 47 65 74 4e 65 77 44 |DlgPtr =| GetNewD|
|00002340| 69 61 6c 6f 67 20 28 69 | 6e 66 6f 44 6c 67 52 65 |ialog (i|nfoDlgRe|
|00002350| 73 2c 20 4e 49 4c 2c 20 | 28 57 69 6e 64 6f 77 50 |s, NIL, |(WindowP|
|00002360| 74 72 29 2d 31 4c 29 3b | 0d 20 20 77 68 69 6c 65 |tr)-1L);|. while|
|00002370| 20 28 63 70 20 3d 20 66 | 67 65 74 73 28 62 75 66 | (cp = f|gets(buf|
|00002380| 66 65 72 2c 20 73 69 7a | 65 6f 66 28 62 75 66 66 |fer, siz|eof(buff|
|00002390| 65 72 29 2c 20 69 6e 66 | 70 29 29 20 7b 0d 20 20 |er), inf|p)) {. |
|000023a0| 20 20 6c 69 6e 65 2b 2b | 3b 0d 20 20 20 20 69 66 | line++|;. if|
|000023b0| 20 28 62 75 66 66 65 72 | 5b 30 5d 20 3d 3d 20 27 | (buffer|[0] == '|
|000023c0| 23 27 29 20 63 6f 6e 74 | 69 6e 75 65 3b 20 20 20 |#') cont|inue; |
|000023d0| 20 2f 2a 20 63 6f 6d 6d | 65 6e 74 20 6c 69 6e 65 | /* comm|ent line|
|000023e0| 20 2a 2f 0d 20 20 20 20 | 69 66 20 28 62 75 66 66 | */. |if (buff|
|000023f0| 65 72 5b 30 5d 20 3d 3d | 20 27 65 27 29 20 7b 20 |er[0] ==| 'e') { |
|00002400| 2f 2a 66 63 6c 6f 73 65 | 28 69 6e 66 70 29 3b 20 |/*fclose|(infp); |
|00002410| 72 65 74 75 72 6e 3b 2a | 2f 20 62 72 65 61 6b 3b |return;*|/ break;|
|00002420| 20 7d 20 20 2f 2a 20 65 | 78 69 74 20 2a 2f 0d 20 | } /* e|xit */. |
|00002430| 20 20 20 69 66 20 28 62 | 75 66 66 65 72 5b 30 5d | if (b|uffer[0]|
|00002440| 20 3d 3d 20 27 69 27 29 | 20 7b 0d 20 20 20 20 20 | == 'i')| {. |
|00002450| 20 20 20 69 66 20 28 21 | 73 74 72 6e 63 6d 70 28 | if (!|strncmp(|
|00002460| 62 75 66 66 65 72 2c 20 | 22 69 66 20 74 65 73 74 |buffer, |"if test|
|00002470| 20 2d 66 22 2c 20 31 30 | 29 29 20 7b 0d 20 20 20 | -f", 10|)) {. |
|00002480| 20 20 20 20 20 2f 2a 20 | 74 65 73 74 69 6e 67 20 | /* |testing |
|00002490| 74 6f 20 73 65 65 20 69 | 66 20 61 20 66 69 6c 65 |to see i|f a file|
|000024a0| 20 69 73 20 74 68 65 72 | 65 20 2a 2f 0d 20 20 20 | is ther|e */. |
|000024b0| 20 20 20 20 20 69 66 20 | 28 73 73 63 61 6e 66 28 | if |(sscanf(|
|000024c0| 62 75 66 66 65 72 2c 20 | 22 69 66 20 74 65 73 74 |buffer, |"if test|
|000024d0| 20 2d 66 20 27 25 73 27 | 22 2c 20 75 6e 69 78 66 | -f '%s'|", unixf|
|000024e0| 69 6c 65 6e 61 6d 65 29 | 20 3d 3d 20 31 29 20 7b |ilename)| == 1) {|
|000024f0| 0d 20 20 20 20 20 20 20 | 20 20 20 2f 2a 20 6d 61 |. | /* ma|
|00002500| 6b 65 20 4d 61 63 20 72 | 65 6c 61 74 69 76 65 20 |ke Mac r|elative |
|00002510| 70 61 74 68 6e 61 6d 65 | 20 2a 2f 0d 20 20 20 20 |pathname| */. |
|00002520| 20 20 20 20 20 20 73 70 | 72 69 6e 74 66 28 6d 70 | sp|rintf(mp|
|00002530| 77 66 69 6c 65 6e 61 6d | 65 2c 20 22 25 73 22 2c |wfilenam|e, "%s",|
|00002540| 20 75 6e 69 78 66 69 6c | 65 6e 61 6d 65 29 3b 0d | unixfil|ename);.|
|00002550| 20 20 20 20 20 20 20 20 | 20 20 2f 2a 20 63 6f 6e | | /* con|
|00002560| 76 65 72 74 20 27 2f 27 | 20 74 6f 20 27 3a 27 20 |vert '/'| to ':' |
|00002570| 26 20 76 69 63 65 20 76 | 65 72 73 61 20 2a 2f 0d |& vice v|ersa */.|
|00002580| 20 20 20 20 20 20 20 20 | 20 20 66 6f 72 20 28 63 | | for (c|
|00002590| 70 20 3d 20 6d 70 77 66 | 69 6c 65 6e 61 6d 65 2b |p = mpwf|ilename+|
|000025a0| 31 3b 20 2a 63 70 3b 20 | 63 70 2b 2b 29 0d 20 20 |1; *cp; |cp++). |
|000025b0| 20 20 20 20 20 20 20 20 | 20 20 69 66 20 28 2a 63 | | if (*c|
|000025c0| 70 20 3d 3d 20 27 2f 27 | 29 0d 20 20 20 20 20 20 |p == '/'|). |
|000025d0| 20 20 20 20 20 20 20 20 | 2a 63 70 20 3d 20 27 3a | |*cp = ':|
|000025e0| 27 3b 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 65 |';. | e|
|000025f0| 6c 73 65 20 69 66 20 28 | 2a 63 70 20 3d 3d 20 27 |lse if (|*cp == '|
|00002600| 3a 27 29 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |:'). | |
|00002610| 20 20 2a 63 70 20 3d 20 | 27 2f 27 3b 0d 20 20 20 | *cp = |'/';. |
|00002620| 20 20 20 20 20 20 20 63 | 70 5b 2d 31 5d 20 3d 20 | c|p[-1] = |
|00002630| 30 3b 20 20 2f 2a 20 64 | 72 6f 70 20 74 72 61 69 |0; /* d|rop trai|
|00002640| 6c 69 6e 67 20 71 75 6f | 74 65 20 6d 61 72 6b 20 |ling quo|te mark |
|00002650| 2a 2f 0d 20 20 20 20 20 | 20 20 20 20 20 6f 75 74 |*/. | out|
|00002660| 66 70 20 3d 20 66 6f 70 | 65 6e 28 6d 70 77 66 69 |fp = fop|en(mpwfi|
|00002670| 6c 65 6e 61 6d 65 2c 20 | 22 72 22 29 3b 0d 20 20 |lename, |"r");. |
|00002680| 20 20 20 20 20 20 20 20 | 69 66 20 28 6f 75 74 66 | |if (outf|
|00002690| 70 20 26 26 20 21 66 6f | 72 63 65 29 20 7b 0d 20 |p && !fo|rce) {. |
|000026a0| 20 20 20 20 20 20 20 20 | 20 20 20 66 63 6c 6f 73 | | fclos|
|000026b0| 65 28 6f 75 74 66 70 29 | 3b 0d 20 20 20 20 20 20 |e(outfp)|;. |
|000026c0| 20 20 20 09 09 43 74 6f | 50 73 74 72 28 6d 70 77 | ..Cto|Pstr(mpw|
|000026d0| 66 69 6c 65 6e 61 6d 65 | 29 3b 0d 20 20 20 20 20 |filename|);. |
|000026e0| 20 20 20 20 20 20 20 50 | 61 72 61 6d 54 65 78 74 | P|aramText|
|000026f0| 28 28 53 74 72 69 6e 67 | 50 74 72 29 22 5c 70 57 |((String|Ptr)"\pW|
|00002700| 69 6c 6c 20 6e 6f 74 20 | 63 6c 6f 62 62 65 72 20 |ill not |clobber |
|00002710| 65 78 69 73 74 69 6e 67 | 20 66 69 6c 65 22 2c 0d |existing| file",.|
|00002720| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002730| 09 20 20 28 53 74 72 69 | 6e 67 50 74 72 29 6d 70 |. (Stri|ngPtr)mp|
|00002740| 77 66 69 6c 65 6e 61 6d | 65 2c 20 28 53 74 72 69 |wfilenam|e, (Stri|
|00002750| 6e 67 50 74 72 29 22 5c | 70 22 2c 20 28 53 74 72 |ngPtr)"\|p", (Str|
|00002760| 69 6e 67 50 74 72 29 22 | 5c 70 22 29 3b 0d 20 20 |ingPtr)"|\p");. |
|00002770| 20 20 20 20 20 20 20 20 | 20 20 69 66 20 28 4e 6f | | if (No|
|00002780| 74 65 41 6c 65 72 74 28 | 65 72 72 6f 72 41 6c 65 |teAlert(|errorAle|
|00002790| 72 74 52 65 73 2c 20 4e | 49 4c 29 20 3d 3d 20 71 |rtRes, N|IL) == q|
|000027a0| 75 69 74 42 29 20 62 72 | 65 61 6b 3b 0d 20 20 20 |uitB) br|eak;. |
|000027b0| 20 20 20 20 20 20 20 20 | 20 77 68 69 6c 65 20 28 | | while (|
|000027c0| 62 75 66 66 65 72 5b 30 | 5d 20 21 3d 20 27 66 27 |buffer[0|] != 'f'|
|000027d0| 29 20 7b 20 20 2f 2a 20 | 73 6b 69 70 20 74 6f 20 |) { /* |skip to |
|000027e0| 73 69 7a 65 20 22 66 69 | 22 20 2a 2f 0d 20 20 20 |size "fi|" */. |
|000027f0| 20 20 20 20 20 20 20 20 | 20 20 20 66 67 65 74 73 | | fgets|
|00002800| 28 62 75 66 66 65 72 2c | 20 73 69 7a 65 6f 66 28 |(buffer,| sizeof(|
|00002810| 62 75 66 66 65 72 29 2c | 20 69 6e 66 70 29 3b 0d |buffer),| infp);.|
|00002820| 20 20 20 20 20 20 20 20 | 20 20 20 20 7d 0d 20 20 | | }. |
|00002830| 20 20 20 20 20 20 20 20 | 20 20 66 67 65 74 73 28 | | fgets(|
|00002840| 62 75 66 66 65 72 2c 20 | 73 69 7a 65 6f 66 28 62 |buffer, |sizeof(b|
|00002850| 75 66 66 65 72 29 2c 20 | 69 6e 66 70 29 3b 20 20 |uffer), |infp); |
|00002860| 2f 2a 20 73 6b 69 70 20 | 6f 76 65 72 20 65 6e 64 |/* skip |over end|
|00002870| 69 6e 67 20 63 6f 6d 6d | 65 6e 74 20 2a 2f 0d 20 |ing comm|ent */. |
|00002880| 20 20 20 20 20 20 20 20 | 20 20 20 66 67 65 74 73 | | fgets|
|00002890| 28 62 75 66 66 65 72 2c | 20 73 69 7a 65 6f 66 28 |(buffer,| sizeof(|
|000028a0| 62 75 66 66 65 72 29 2c | 20 69 6e 66 70 29 3b 20 |buffer),| infp); |
|000028b0| 20 2f 2a 20 73 6b 69 70 | 20 6f 76 65 72 20 74 65 | /* skip| over te|
|000028c0| 73 74 20 22 66 69 22 20 | 2a 2f 0d 20 20 20 20 20 |st "fi" |*/. |
|000028d0| 20 20 20 20 20 7d 20 65 | 6c 73 65 20 7b 0d 20 20 | } e|lse {. |
|000028e0| 20 20 20 20 20 20 20 20 | 20 20 69 66 20 28 6f 75 | | if (ou|
|000028f0| 74 66 70 29 20 66 63 6c | 6f 73 65 28 6f 75 74 66 |tfp) fcl|ose(outf|
|00002900| 70 29 3b 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |p);. | |
|00002910| 43 74 6f 50 73 74 72 28 | 6d 70 77 66 69 6c 65 6e |CtoPstr(|mpwfilen|
|00002920| 61 6d 65 29 3b 0d 20 20 | 20 20 20 20 20 20 20 20 |ame);. | |
|00002930| 20 20 43 72 65 61 74 65 | 28 28 53 74 72 69 6e 67 | Create|((String|
|00002940| 50 74 72 29 6d 70 77 66 | 69 6c 65 6e 61 6d 65 2c |Ptr)mpwf|ilename,|
|00002950| 20 64 49 44 2c 20 66 64 | 43 72 65 61 74 6f 72 2c | dID, fd|Creator,|
|00002960| 20 66 64 54 79 70 65 29 | 3b 0d 20 20 20 20 20 20 | fdType)|;. |
|00002970| 20 20 20 20 20 20 50 61 | 72 61 6d 54 65 78 74 28 | Pa|ramText(|
|00002980| 28 53 74 72 69 6e 67 50 | 74 72 29 6d 70 77 66 69 |(StringP|tr)mpwfi|
|00002990| 6c 65 6e 61 6d 65 2c 0d | 20 20 20 20 20 20 20 20 |lename,.| |
|000029a0| 20 20 20 20 09 09 20 20 | 28 53 74 72 69 6e 67 50 | .. |(StringP|
|000029b0| 74 72 29 22 5c 70 22 2c | 20 28 53 74 72 69 6e 67 |tr)"\p",| (String|
|000029c0| 50 74 72 29 22 5c 70 22 | 2c 20 28 53 74 72 69 6e |Ptr)"\p"|, (Strin|
|000029d0| 67 50 74 72 29 22 5c 70 | 22 29 3b 0d 20 20 20 20 |gPtr)"\p|");. |
|000029e0| 20 20 20 20 20 20 20 20 | 53 65 6c 65 63 74 57 69 | |SelectWi|
|000029f0| 6e 64 6f 77 28 69 6e 66 | 6f 44 6c 67 50 74 72 29 |ndow(inf|oDlgPtr)|
|00002a00| 3b 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 53 68 |;. | Sh|
|00002a10| 6f 77 57 69 6e 64 6f 77 | 28 69 6e 66 6f 44 6c 67 |owWindow|(infoDlg|
|00002a20| 50 74 72 29 3b 0d 20 20 | 20 20 20 20 20 20 20 20 |Ptr);. | |
|00002a30| 20 20 44 72 61 77 44 69 | 61 6c 6f 67 28 69 6e 66 | DrawDi|alog(inf|
|00002a40| 6f 44 6c 67 50 74 72 29 | 3b 20 20 20 20 20 20 20 |oDlgPtr)|; |
|00002a50| 20 20 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 50 | . | P|
|00002a60| 74 6f 43 73 74 72 28 6d | 70 77 66 69 6c 65 6e 61 |toCstr(m|pwfilena|
|00002a70| 6d 65 29 3b 0d 20 20 20 | 20 20 20 20 20 20 20 20 |me);. | |
|00002a80| 20 6f 75 74 66 70 20 3d | 20 66 6f 70 65 6e 28 6d | outfp =| fopen(m|
|00002a90| 70 77 66 69 6c 65 6e 61 | 6d 65 2c 20 22 61 22 29 |pwfilena|me, "a")|
|00002aa0| 3b 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 77 68 |;. | wh|
|00002ab0| 69 6c 65 20 28 62 75 66 | 66 65 72 5b 30 5d 20 21 |ile (buf|fer[0] !|
|00002ac0| 3d 20 27 58 27 29 0d 20 | 20 20 20 20 20 20 20 20 |= 'X'). | |
|00002ad0| 20 20 20 20 20 66 67 65 | 74 73 28 62 75 66 66 65 | fge|ts(buffe|
|00002ae0| 72 2c 20 73 69 7a 65 6f | 66 28 62 75 66 66 65 72 |r, sizeo|f(buffer|
|00002af0| 29 2c 20 69 6e 66 70 29 | 3b 0d 20 20 20 20 20 20 |), infp)|;. |
|00002b00| 20 20 20 20 20 20 64 6f | 20 7b 0d 20 20 20 20 20 | do| {. |
|00002b10| 20 20 20 20 20 20 20 20 | 20 66 70 75 74 73 28 62 | | fputs(b|
|00002b20| 75 66 66 65 72 2b 31 2c | 20 6f 75 74 66 70 29 3b |uffer+1,| outfp);|
|00002b30| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 66 |. | f|
|00002b40| 67 65 74 73 28 62 75 66 | 66 65 72 2c 20 73 69 7a |gets(buf|fer, siz|
|00002b50| 65 6f 66 28 62 75 66 66 | 65 72 29 2c 20 69 6e 66 |eof(buff|er), inf|
|00002b60| 70 29 3b 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |p);. | |
|00002b70| 7d 20 77 68 69 6c 65 20 | 28 62 75 66 66 65 72 5b |} while |(buffer[|
|00002b80| 30 5d 20 3d 3d 20 27 58 | 27 29 3b 0d 20 20 20 20 |0] == 'X|');. |
|00002b90| 20 20 20 20 20 20 20 20 | 66 63 6c 6f 73 65 28 6f | |fclose(o|
|00002ba0| 75 74 66 70 29 3b 0d 20 | 20 20 20 20 20 20 20 20 |utfp);. | |
|00002bb0| 20 20 20 66 67 65 74 73 | 28 62 75 66 66 65 72 2c | fgets|(buffer,|
|00002bc0| 20 73 69 7a 65 6f 66 28 | 62 75 66 66 65 72 29 2c | sizeof(|buffer),|
|00002bd0| 20 69 6e 66 70 29 3b 20 | 20 2f 2a 20 73 6b 69 70 | infp); | /* skip|
|00002be0| 20 74 6f 20 6e 65 78 74 | 20 69 66 20 2a 2f 0d 20 | to next| if */. |
|00002bf0| 20 20 20 20 20 20 20 20 | 20 20 20 66 67 65 74 73 | | fgets|
|00002c00| 28 62 75 66 66 65 72 2c | 20 73 69 7a 65 6f 66 28 |(buffer,| sizeof(|
|00002c10| 62 75 66 66 65 72 29 2c | 20 69 6e 66 70 29 3b 0d |buffer),| infp);.|
|00002c20| 20 20 20 20 20 20 20 20 | 20 20 20 20 66 67 65 74 | | fget|
|00002c30| 73 28 62 75 66 66 65 72 | 2c 20 73 69 7a 65 6f 66 |s(buffer|, sizeof|
|00002c40| 28 62 75 66 66 65 72 29 | 2c 20 69 6e 66 70 29 3b |(buffer)|, infp);|
|00002c50| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 66 67 65 |. | fge|
|00002c60| 74 73 28 62 75 66 66 65 | 72 2c 20 73 69 7a 65 6f |ts(buffe|r, sizeo|
|00002c70| 66 28 62 75 66 66 65 72 | 29 2c 20 69 6e 66 70 29 |f(buffer|), infp)|
|00002c80| 3b 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 66 67 |;. | fg|
|00002c90| 65 74 73 28 62 75 66 66 | 65 72 2c 20 73 69 7a 65 |ets(buff|er, size|
|00002ca0| 6f 66 28 62 75 66 66 65 | 72 29 2c 20 69 6e 66 70 |of(buffe|r), infp|
|00002cb0| 29 3b 0d 20 20 20 20 20 | 20 20 20 20 20 7d 0d 20 |);. | }. |
|00002cc0| 20 20 20 20 20 20 20 7d | 20 65 6c 73 65 20 7b 0d | }| else {.|
|00002cd0| 20 20 20 20 20 20 20 20 | 20 20 4e 75 6d 54 6f 53 | | NumToS|
|00002ce0| 74 72 69 6e 67 28 28 6c | 6f 6e 67 29 6c 69 6e 65 |tring((l|ong)line|
|00002cf0| 2c 20 28 53 74 72 69 6e | 67 50 74 72 29 6c 69 6e |, (Strin|gPtr)lin|
|00002d00| 65 4e 6f 29 3b 0d 20 20 | 20 20 20 20 20 20 20 20 |eNo);. | |
|00002d10| 43 74 6f 50 73 74 72 28 | 62 75 66 66 65 72 29 3b |CtoPstr(|buffer);|
|00002d20| 0d 20 20 20 20 20 20 20 | 20 20 20 50 61 72 61 6d |. | Param|
|00002d30| 54 65 78 74 28 28 53 74 | 72 69 6e 67 50 74 72 29 |Text((St|ringPtr)|
|00002d40| 22 5c 70 43 61 6e 6e 6f | 74 20 75 6e 64 65 72 73 |"\pCanno|t unders|
|00002d50| 74 61 6e 64 20 27 69 66 | 27 20 73 74 61 74 65 6d |tand 'if|' statem|
|00002d60| 65 6e 74 2c 20 61 62 6f | 72 74 69 6e 67 22 2c 0d |ent, abo|rting",.|
|00002d70| 20 20 20 20 20 20 20 20 | 20 20 09 09 09 28 53 74 | | ...(St|
|00002d80| 72 69 6e 67 50 74 72 29 | 73 2c 20 28 53 74 72 69 |ringPtr)|s, (Stri|
|00002d90| 6e 67 50 74 72 29 6c 69 | 6e 65 4e 6f 2c 20 28 53 |ngPtr)li|neNo, (S|
|00002da0| 74 72 69 6e 67 50 74 72 | 29 22 5c 70 22 29 3b 0d |tringPtr|)"\p");.|
|00002db0| 20 20 20 20 20 20 20 20 | 20 20 28 76 6f 69 64 29 | | (void)|
|00002dc0| 20 53 74 6f 70 41 6c 65 | 72 74 28 61 62 6f 72 74 | StopAle|rt(abort|
|00002dd0| 52 65 73 2c 20 4e 49 4c | 29 3b 0d 20 20 20 20 20 |Res, NIL|);. |
|00002de0| 20 20 20 20 20 62 72 65 | 61 6b 3b 0d 20 20 20 20 | bre|ak;. |
|00002df0| 20 20 20 20 7d 0d 20 20 | 20 20 20 20 7d 20 65 6c | }. | } el|
|00002e00| 73 65 20 69 66 20 28 21 | 73 74 72 6e 63 6d 70 28 |se if (!|strncmp(|
|00002e10| 62 75 66 66 65 72 2c 20 | 22 69 66 20 74 65 73 74 |buffer, |"if test|
|00002e20| 20 21 20 2d 64 22 2c 20 | 31 32 29 29 20 7b 0d 20 | ! -d", |12)) {. |
|00002e30| 20 20 20 20 20 20 20 2f | 2a 20 74 65 73 74 69 6e | /|* testin|
|00002e40| 67 20 74 6f 20 73 65 65 | 20 69 66 20 61 20 64 69 |g to see| if a di|
|00002e50| 72 65 63 74 6f 72 79 20 | 69 73 20 74 68 65 72 65 |rectory |is there|
|00002e60| 20 2a 2f 0d 20 20 20 20 | 20 20 20 20 69 66 20 28 | */. | if (|
|00002e70| 73 73 63 61 6e 66 28 62 | 75 66 66 65 72 2c 20 22 |sscanf(b|uffer, "|
|00002e80| 69 66 20 74 65 73 74 20 | 21 20 2d 64 20 27 25 73 |if test |! -d '%s|
|00002e90| 27 22 2c 20 75 6e 69 78 | 66 69 6c 65 6e 61 6d 65 |'", unix|filename|
|00002ea0| 29 20 3d 3d 20 31 29 20 | 7b 0d 20 20 20 20 20 20 |) == 1) |{. |
|00002eb0| 20 20 20 20 2f 2a 20 6d | 61 6b 65 20 4d 61 63 20 | /* m|ake Mac |
|00002ec0| 72 65 6c 61 74 69 76 65 | 20 70 61 74 68 6e 61 6d |relative| pathnam|
|00002ed0| 65 20 2a 2f 0d 20 20 20 | 20 20 20 20 20 20 20 73 |e */. | s|
|00002ee0| 70 72 69 6e 74 66 28 6d | 70 77 66 69 6c 65 6e 61 |printf(m|pwfilena|
|00002ef0| 6d 65 2c 20 22 3a 25 73 | 22 2c 20 75 6e 69 78 66 |me, ":%s|", unixf|
|00002f00| 69 6c 65 6e 61 6d 65 29 | 3b 0d 20 20 20 20 20 20 |ilename)|;. |
|00002f10| 20 20 20 20 2f 2a 20 63 | 6f 6e 76 65 72 74 20 27 | /* c|onvert '|
|00002f20| 2f 27 20 74 6f 20 27 3a | 27 20 26 20 76 69 63 65 |/' to ':|' & vice|
|00002f30| 20 76 65 72 73 61 20 2a | 2f 0d 20 20 20 20 20 20 | versa *|/. |
|00002f40| 20 20 20 20 66 6f 72 20 | 28 63 70 20 3d 20 6d 70 | for |(cp = mp|
|00002f50| 77 66 69 6c 65 6e 61 6d | 65 2b 31 3b 20 2a 63 70 |wfilenam|e+1; *cp|
|00002f60| 3b 20 63 70 2b 2b 29 0d | 20 20 20 20 20 20 20 20 |; cp++).| |
|00002f70| 20 20 20 20 69 66 20 28 | 2a 63 70 20 3d 3d 20 27 | if (|*cp == '|
|00002f80| 2f 27 29 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |/'). | |
|00002f90| 20 20 2a 63 70 20 3d 20 | 27 3a 27 3b 0d 20 20 20 | *cp = |':';. |
|00002fa0| 20 20 20 20 20 20 20 20 | 20 65 6c 73 65 20 69 66 | | else if|
|00002fb0| 20 28 2a 63 70 20 3d 3d | 20 27 3a 27 29 0d 20 20 | (*cp ==| ':'). |
|00002fc0| 20 20 20 20 20 20 20 20 | 20 20 20 20 2a 63 70 20 | | *cp |
|00002fd0| 3d 20 27 2f 27 3b 0d 20 | 20 20 20 20 20 20 20 20 |= '/';. | |
|00002fe0| 20 63 70 5b 2d 31 5d 20 | 3d 20 30 3b 20 20 2f 2a | cp[-1] |= 0; /*|
|00002ff0| 20 64 72 6f 70 20 74 72 | 61 69 6c 69 6e 67 20 71 | drop tr|ailing q|
|00003000| 75 6f 74 65 20 6d 61 72 | 6b 20 2a 2f 0d 0d 20 20 |uote mar|k */.. |
|00003010| 20 20 20 20 20 20 20 20 | 2f 2a 20 49 20 77 69 73 | |/* I wis|
|00003020| 68 20 4d 50 57 20 43 20 | 68 61 64 20 6d 6b 64 69 |h MPW C |had mkdi|
|00003030| 72 28 29 2c 20 62 75 74 | 20 61 74 20 6c 65 61 73 |r(), but| at leas|
|00003040| 74 20 77 65 20 64 6f 6e | 27 74 20 68 61 76 65 20 |t we don|'t have |
|00003050| 74 6f 20 64 6f 20 70 61 | 72 61 6d 65 74 65 72 20 |to do pa|rameter |
|00003060| 62 6c 6f 63 6b 73 20 2a | 2f 0d 20 20 20 20 20 20 |blocks *|/. |
|00003070| 20 20 20 20 4f 75 72 47 | 65 74 56 6f 6c 28 75 6e | OurG|etVol(un|
|00003080| 69 78 66 69 6c 65 6e 61 | 6d 65 2c 20 26 76 2c 20 |ixfilena|me, &v, |
|00003090| 26 64 69 72 49 44 29 3b | 0d 20 20 20 20 20 20 20 |&dirID);|. |
|000030a0| 20 20 20 43 74 6f 50 73 | 74 72 28 6d 70 77 66 69 | CtoPs|tr(mpwfi|
|000030b0| 6c 65 6e 61 6d 65 29 3b | 0d 20 20 20 20 20 20 20 |lename);|. |
|000030c0| 20 20 20 4f 75 72 44 69 | 72 43 72 65 61 74 65 28 | OurDi|rCreate(|
|000030d0| 76 2c 20 64 69 72 49 44 | 2c 20 6d 70 77 66 69 6c |v, dirID|, mpwfil|
|000030e0| 65 6e 61 6d 65 2c 20 26 | 64 49 44 29 3b 0d 20 20 |ename, &|dID);. |
|000030f0| 20 20 20 20 20 20 20 20 | 66 67 65 74 73 28 62 75 | |fgets(bu|
|00003100| 66 66 65 72 2c 20 73 69 | 7a 65 6f 66 28 62 75 66 |ffer, si|zeof(buf|
|00003110| 66 65 72 29 2c 20 69 6e | 66 70 29 3b 0d 20 20 20 |fer), in|fp);. |
|00003120| 20 20 20 20 20 20 20 66 | 67 65 74 73 28 62 75 66 | f|gets(buf|
|00003130| 66 65 72 2c 20 73 69 7a | 65 6f 66 28 62 75 66 66 |fer, siz|eof(buff|
|00003140| 65 72 29 2c 20 69 6e 66 | 70 29 3b 0d 20 20 20 20 |er), inf|p);. |
|00003150| 20 20 20 20 20 20 66 67 | 65 74 73 28 62 75 66 66 | fg|ets(buff|
|00003160| 65 72 2c 20 73 69 7a 65 | 6f 66 28 62 75 66 66 65 |er, size|of(buffe|
|00003170| 72 29 2c 20 69 6e 66 70 | 29 3b 0d 20 20 20 20 20 |r), infp|);. |
|00003180| 20 20 20 7d 0d 20 20 20 | 20 20 20 7d 0d 20 20 20 | }. | }. |
|00003190| 20 7d 0d 20 20 7d 0d 20 | 20 69 66 20 28 69 6e 66 | }. }. | if (inf|
|000031a0| 6f 44 6c 67 50 74 72 20 | 21 3d 20 4e 49 4c 29 20 |oDlgPtr |!= NIL) |
|000031b0| 44 69 73 70 6f 73 44 69 | 61 6c 6f 67 28 69 6e 66 |DisposDi|alog(inf|
|000031c0| 6f 44 6c 67 50 74 72 29 | 3b 0d 20 20 69 6e 66 6f |oDlgPtr)|;. info|
|000031d0| 44 6c 67 50 74 72 20 3d | 20 4e 49 4c 3b 0d 20 20 |DlgPtr =| NIL;. |
|000031e0| 28 76 6f 69 64 29 20 50 | 42 43 6c 6f 73 65 57 44 |(void) P|BCloseWD|
|000031f0| 28 26 77 64 70 62 2c 20 | 46 41 4c 53 45 29 3b 0d |(&wdpb, |FALSE);.|
|00003200| 20 20 66 63 6c 6f 73 65 | 28 69 6e 66 70 29 3b 0d | fclose|(infp);.|
|00003210| 7d 0d 0d 4f 53 45 72 72 | 20 4f 75 72 47 65 74 56 |}..OSErr| OurGetV|
|00003220| 6f 6c 28 6e 61 6d 65 2c | 20 76 6f 6c 50 2c 20 64 |ol(name,| volP, d|
|00003230| 69 72 49 64 50 29 0d 63 | 68 61 72 09 2a 6e 61 6d |irIdP).c|har.*nam|
|00003240| 65 3b 0d 73 68 6f 72 74 | 09 2a 76 6f 6c 50 3b 0d |e;.short|.*volP;.|
|00003250| 6c 6f 6e 67 09 2a 64 69 | 72 49 64 50 3b 0d 7b 0d |long.*di|rIdP;.{.|
|00003260| 09 57 44 50 42 52 65 63 | 09 70 62 3b 0d 09 0d 09 |.WDPBRec|.pb;....|
|00003270| 70 62 2e 69 6f 43 6f 6d | 70 6c 65 74 69 6f 6e 20 |pb.ioCom|pletion |
|00003280| 3d 20 4e 55 4c 4c 3b 0d | 09 50 42 48 47 65 74 56 |= NULL;.|.PBHGetV|
|00003290| 6f 6c 20 28 26 70 62 2c | 20 46 41 4c 53 45 29 3b |ol (&pb,| FALSE);|
|000032a0| 0d 09 2a 76 6f 6c 50 20 | 3d 20 70 62 2e 69 6f 56 |..*volP |= pb.ioV|
|000032b0| 52 65 66 4e 75 6d 3b 0d | 09 2a 64 69 72 49 64 50 |RefNum;.|.*dirIdP|
|000032c0| 20 3d 20 70 62 2e 69 6f | 57 44 44 69 72 49 44 3b | = pb.io|WDDirID;|
|000032d0| 0d 09 42 6c 6f 63 6b 4d | 6f 76 65 28 70 62 2e 69 |..BlockM|ove(pb.i|
|000032e0| 6f 4e 61 6d 65 50 74 72 | 2c 20 6e 61 6d 65 2c 20 |oNamePtr|, name, |
|000032f0| 70 62 2e 69 6f 4e 61 6d | 65 50 74 72 5b 30 5d 2b |pb.ioNam|ePtr[0]+|
|00003300| 31 29 3b 0d 7d 0d 0d 4f | 53 45 72 72 20 4f 75 72 |1);.}..O|SErr Our|
|00003310| 44 69 72 43 72 65 61 74 | 65 28 76 52 65 66 4e 75 |DirCreat|e(vRefNu|
|00003320| 6d 2c 70 61 72 65 6e 74 | 44 69 72 49 44 2c 20 64 |m,parent|DirID, d|
|00003330| 69 72 65 63 74 6f 72 79 | 4e 61 6d 65 2c 0d 20 20 |irectory|Name,. |
|00003340| 20 20 63 72 65 61 74 65 | 64 44 69 72 49 44 29 0d | create|dDirID).|
|00003350| 73 68 6f 72 74 09 76 52 | 65 66 4e 75 6d 3b 0d 6c |short.vR|efNum;.l|
|00003360| 6f 6e 67 09 70 61 72 65 | 6e 74 44 69 72 49 44 3b |ong.pare|ntDirID;|
|00003370| 0d 63 68 61 72 09 2a 64 | 69 72 65 63 74 6f 72 79 |.char.*d|irectory|
|00003380| 4e 61 6d 65 3b 0d 6c 6f | 6e 67 09 2a 63 72 65 61 |Name;.lo|ng.*crea|
|00003390| 74 65 64 44 69 72 49 44 | 3b 0d 7b 0d 09 48 50 61 |tedDirID|;.{..HPa|
|000033a0| 72 61 6d 42 6c 6f 63 6b | 52 65 63 09 70 62 3b 0d |ramBlock|Rec.pb;.|
|000033b0| 09 70 62 2e 66 69 6c 65 | 50 61 72 61 6d 2e 69 6f |.pb.file|Param.io|
|000033c0| 4e 61 6d 65 50 74 72 20 | 3d 20 28 53 74 72 69 6e |NamePtr |= (Strin|
|000033d0| 67 50 74 72 29 64 69 72 | 65 63 74 6f 72 79 4e 61 |gPtr)dir|ectoryNa|
|000033e0| 6d 65 3b 0d 09 70 62 2e | 66 69 6c 65 50 61 72 61 |me;..pb.|filePara|
|000033f0| 6d 2e 69 6f 56 52 65 66 | 4e 75 6d 20 3d 20 76 52 |m.ioVRef|Num = vR|
|00003400| 65 66 4e 75 6d 3b 0d 09 | 70 62 2e 66 69 6c 65 50 |efNum;..|pb.fileP|
|00003410| 61 72 61 6d 2e 69 6f 44 | 69 72 49 44 20 3d 20 70 |aram.ioD|irID = p|
|00003420| 61 72 65 6e 74 44 69 72 | 49 44 3b 0d 09 70 62 2e |arentDir|ID;..pb.|
|00003430| 66 69 6c 65 50 61 72 61 | 6d 2e 69 6f 43 6f 6d 70 |filePara|m.ioComp|
|00003440| 6c 65 74 69 6f 6e 20 3d | 20 4e 55 4c 4c 3b 0d 09 |letion =| NULL;..|
|00003450| 50 42 44 69 72 43 72 65 | 61 74 65 28 26 70 62 2c |PBDirCre|ate(&pb,|
|00003460| 20 46 41 4c 53 45 29 3b | 0d 09 2a 63 72 65 61 74 | FALSE);|..*creat|
|00003470| 65 64 44 69 72 49 44 20 | 3d 20 70 62 2e 66 69 6c |edDirID |= pb.fil|
|00003480| 65 50 61 72 61 6d 2e 69 | 6f 44 69 72 49 44 3b 0d |eParam.i|oDirID;.|
|00003490| 7d 0d 0d 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |}.......|........|
|000034a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000034b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000034c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000034d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000034e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000034f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003500| 00 00 01 00 00 00 01 4c | 00 00 00 4c 00 00 00 32 |.......L|...L...2|
|00003510| 69 6f 6e d3 20 69 73 20 | 6e 6f 74 20 61 6c 6c 6f |ion. is |not allo|
|00003520| 77 65 64 00 00 00 2a 29 | d2 66 75 6e 63 74 69 6f |wed...*)|.functio|
|00003530| 08 75 6e 73 68 61 72 2e | 63 2e 02 00 00 00 00 00 |.unshar.|c.......|
|00003540| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003550| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003560| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003570| 00 00 a1 df f5 a0 00 00 | 00 00 00 00 01 7e 72 65 |........|.....~re|
|00003580| 71 75 69 72 65 64 20 61 | 72 72 61 79 20 62 6f 75 |quired a|rray bou|
|00003590| 6e 64 73 20 6d 69 73 73 | 69 6e 67 00 00 00 1c 1b |nds miss|ing.....|
|000035a0| 69 6e 76 61 6c 69 64 20 | 66 75 6e 63 74 69 6f 6e |invalid |function|
|000035b0| 20 64 65 66 69 6e 69 74 | 69 6f 6e 00 00 00 1e 1d | definit|ion.....|
|000035c0| 69 6e 76 61 6c 69 64 20 | 72 65 64 65 63 6c 61 72 |invalid |redeclar|
|000035d0| 61 74 69 6f 6e 20 6f 66 | 20 d4 5e 31 d5 00 00 00 |ation of| .^1....|
|000035e0| 1f 1e d2 61 72 72 61 79 | 20 6f 66 20 76 6f 69 64 |...array| of void|
|000035f0| d3 20 69 73 20 6e 6f 74 | 20 61 6c 6c 6f 77 65 64 |. is not| allowed|
|00003600| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 1e 00 00 |...H..Mo|naco....|
|00003610| 00 7c 01 55 00 24 01 55 | 01 fd 01 ff 01 54 01 fd |.|.U.$.U|.....T..|
|00003620| 01 54 01 fe 01 55 00 06 | 00 04 00 64 00 1c 01 53 |.T...U..|...d...S|
|00003630| 01 fd 00 64 00 1c 01 53 | 01 fd a1 4f 5e 49 00 00 |...d...S|...O^I..|
|00003640| 00 00 00 00 00 00 00 00 | 20 c9 01 00 00 00 01 00 |........| .......|
|00003650| 00 00 01 4c 00 00 00 4c | 00 00 00 32 00 02 db aa |...L...L|...2....|
|00003660| 07 5a 00 00 00 1c 00 32 | 00 00 4d 50 53 52 00 00 |.Z.....2|..MPSR..|
|00003670| 00 0a 03 ed ff ff 00 00 | 00 00 00 04 15 74 00 00 |........|.....t..|
+--------+-------------------------+-------------------------+--------+--------+