home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / source / luschsrc.sit / document.c.bin < prev    next >
MacBinary  |  1990-05-23  |  12.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: document.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, Sat Jan 6 15:06:17 1990, modified Fri Jan 26 14:29:09 1990, creator Think C, type ASCII, 12718 bytes "document.c" 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[KAHL]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0a 64 6f 63 75 6d 65 | 6e 74 2e 63 00 00 00 00 |..docume|nt.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 00 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 31 ae 00 | 00 00 00 a1 cc 00 39 a1 |.....1..|......9.|
|00000060| e6 55 85 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.U......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000080| 2f 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |/*******|********|
|00000090| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000000a0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000000b0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000000c0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000000d0| 2a 0d 20 2a 09 64 6f 63 | 75 6d 65 6e 74 2e 63 0d |*. *.doc|ument.c.|
|000000e0| 20 2a 0d 20 2a 09 46 69 | 6c 65 20 4d 61 6e 61 67 | *. *.Fi|le Manag|
|000000f0| 65 6d 65 6e 74 20 50 61 | 63 6b 61 67 65 0d 20 2a |ement Pa|ckage. *|
|00000100| 0d 20 2a 09 57 72 69 74 | 74 65 6e 20 62 79 20 50 |. *.Writ|ten by P|
|00000110| 61 63 6f 20 58 61 6e 64 | 65 72 20 4e 61 74 68 61 |aco Xand|er Natha|
|00000120| 6e 0d 20 2a 09 a9 31 39 | 39 30 2c 20 4d 6f 74 6f |n. *..19|90, Moto|
|00000130| 72 6f 6c 61 20 49 6e 63 | 2e 20 20 50 75 62 6c 69 |rola Inc|. Publi|
|00000140| 63 20 64 6f 6d 61 69 6e | 20 73 6f 75 72 63 65 20 |c domain| source |
|00000150| 63 6f 64 65 2e 0d 20 2a | 2a 2a 2a 2a 2a 2a 2a 2a |code.. *|********|
|00000160| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000170| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000180| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000190| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000001a0| 2a 2a 2a 2a 2a 2a 2a 2f | 0d 0d 23 69 6e 63 6c 75 |*******/|..#inclu|
|000001b0| 64 65 20 22 61 70 70 6c | 69 63 2e 68 22 0d 23 69 |de "appl|ic.h".#i|
|000001c0| 6e 63 6c 75 64 65 20 22 | 77 69 6e 64 6f 77 2e 68 |nclude "|window.h|
|000001d0| 22 0d 23 69 6e 63 6c 75 | 64 65 20 22 64 69 61 6c |".#inclu|de "dial|
|000001e0| 6f 67 2e 68 22 0d 23 69 | 6e 63 6c 75 64 65 20 22 |og.h".#i|nclude "|
|000001f0| 63 6f 6e 74 65 78 74 2e | 68 22 0d 23 69 6e 63 6c |context.|h".#incl|
|00000200| 75 64 65 20 22 74 65 78 | 74 2e 68 22 0d 23 69 6e |ude "tex|t.h".#in|
|00000210| 63 6c 75 64 65 20 22 6c | 69 73 74 2e 68 22 0d 23 |clude "l|ist.h".#|
|00000220| 69 6e 63 6c 75 64 65 20 | 22 65 72 72 6f 72 2e 68 |include |"error.h|
|00000230| 22 0d 23 69 6e 63 6c 75 | 64 65 20 22 73 74 72 69 |".#inclu|de "stri|
|00000240| 6e 67 2e 68 22 0d 23 69 | 6e 63 6c 75 64 65 20 22 |ng.h".#i|nclude "|
|00000250| 61 73 63 69 69 2e 68 22 | 0d 23 69 6e 63 6c 75 64 |ascii.h"|.#includ|
|00000260| 65 20 22 64 6f 63 75 6d | 65 6e 74 2e 68 22 0d 23 |e "docum|ent.h".#|
|00000270| 69 6e 63 6c 75 64 65 20 | 22 70 72 69 6e 74 2e 68 |include |"print.h|
|00000280| 22 0d 23 69 6e 63 6c 75 | 64 65 20 22 67 6e 6f 73 |".#inclu|de "gnos|
|00000290| 69 73 2e 68 22 0d 0d 0d | 2f 2a 20 4c 6f 63 61 6c |is.h"...|/* Local|
|000002a0| 20 46 75 6e 63 74 69 6f | 6e 20 50 72 6f 74 6f 74 | Functio|n Protot|
|000002b0| 79 70 65 73 0d 20 2a 2f | 0d 23 69 66 64 65 66 20 |ypes. */|.#ifdef |
|000002c0| 50 52 4f 54 4f 54 59 50 | 45 53 0d 76 6f 69 64 20 |PROTOTYP|ES.void |
|000002d0| 44 6f 63 52 65 61 64 4c | 69 6e 65 20 28 57 4f 52 |DocReadL|ine (WOR|
|000002e0| 44 20 72 65 66 4e 75 6d | 2c 20 4c 4f 4e 47 20 63 |D refNum|, LONG c|
|000002f0| 6f 75 6e 74 2c 20 42 59 | 54 45 20 2a 64 61 74 61 |ount, BY|TE *data|
|00000300| 29 3b 0d 76 6f 69 64 20 | 44 6f 63 57 72 69 74 65 |);.void |DocWrite|
|00000310| 4c 69 6e 65 20 28 57 4f | 52 44 20 72 65 66 4e 75 |Line (WO|RD refNu|
|00000320| 6d 2c 20 4c 4f 4e 47 20 | 63 6f 75 6e 74 2c 20 42 |m, LONG |count, B|
|00000330| 59 54 45 20 2a 64 61 74 | 61 29 3b 0d 0d 76 6f 69 |YTE *dat|a);..voi|
|00000340| 64 20 44 6f 63 52 65 61 | 64 4e 75 6d 20 28 57 4f |d DocRea|dNum (WO|
|00000350| 52 44 20 72 65 66 4e 75 | 6d 2c 20 57 4f 52 44 20 |RD refNu|m, WORD |
|00000360| 2a 74 68 65 4e 75 6d 29 | 3b 0d 76 6f 69 64 20 44 |*theNum)|;.void D|
|00000370| 6f 63 57 72 69 74 65 4e | 75 6d 20 28 57 4f 52 44 |ocWriteN|um (WORD|
|00000380| 20 72 65 66 4e 75 6d 2c | 20 57 4f 52 44 20 74 68 | refNum,| WORD th|
|00000390| 65 4e 75 6d 29 3b 0d 0d | 76 6f 69 64 20 44 6f 63 |eNum);..|void Doc|
|000003a0| 52 65 61 64 54 65 78 74 | 20 28 57 4f 52 44 20 72 |ReadText| (WORD r|
|000003b0| 65 66 4e 75 6d 2c 20 48 | 61 6e 64 6c 65 20 74 65 |efNum, H|andle te|
|000003c0| 78 74 48 64 6c 29 3b 0d | 76 6f 69 64 20 44 6f 63 |xtHdl);.|void Doc|
|000003d0| 57 72 69 74 65 54 65 78 | 74 20 28 57 4f 52 44 20 |WriteTex|t (WORD |
|000003e0| 72 65 66 4e 75 6d 2c 20 | 48 61 6e 64 6c 65 20 74 |refNum, |Handle t|
|000003f0| 65 78 74 48 64 6c 29 3b | 0d 0d 76 6f 69 64 20 44 |extHdl);|..void D|
|00000400| 6f 63 52 65 61 64 47 6e | 6f 73 20 28 57 4f 52 44 |ocReadGn|os (WORD|
|00000410| 20 72 65 66 4e 75 6d 2c | 20 47 6e 6f 73 50 74 72 | refNum,| GnosPtr|
|00000420| 20 67 6e 6f 73 50 74 72 | 29 3b 0d 76 6f 69 64 20 | gnosPtr|);.void |
|00000430| 44 6f 63 57 72 69 74 65 | 47 6e 6f 73 20 28 57 4f |DocWrite|Gnos (WO|
|00000440| 52 44 20 72 65 66 4e 75 | 6d 2c 20 47 6e 6f 73 50 |RD refNu|m, GnosP|
|00000450| 74 72 20 67 6e 6f 73 50 | 74 72 29 3b 0d 76 6f 69 |tr gnosP|tr);.voi|
|00000460| 64 20 44 6f 63 52 65 63 | 75 72 47 6e 6f 73 20 28 |d DocRec|urGnos (|
|00000470| 57 4f 52 44 20 72 65 66 | 4e 75 6d 2c 20 47 6e 6f |WORD ref|Num, Gno|
|00000480| 73 50 74 72 20 67 6e 6f | 73 50 74 72 29 3b 0d 23 |sPtr gno|sPtr);.#|
|00000490| 65 6e 64 69 66 0d 0d 0d | 76 6f 69 64 0d 44 6f 63 |endif...|void.Doc|
|000004a0| 52 65 61 64 4c 69 6e 65 | 20 28 72 65 66 4e 75 6d |ReadLine| (refNum|
|000004b0| 2c 20 63 6f 75 6e 74 2c | 20 64 61 74 61 29 0d 09 |, count,| data)..|
|000004c0| 72 65 67 69 73 74 65 72 | 20 57 4f 52 44 20 72 65 |register| WORD re|
|000004d0| 66 4e 75 6d 3b 0d 09 4c | 4f 4e 47 20 63 6f 75 6e |fNum;..L|ONG coun|
|000004e0| 74 3b 0d 09 72 65 67 69 | 73 74 65 72 20 42 59 54 |t;..regi|ster BYT|
|000004f0| 45 20 2a 64 61 74 61 3b | 0d 7b 0d 09 4c 4f 4e 47 |E *data;|.{..LONG|
|00000500| 20 62 75 66 4c 65 6e 20 | 3d 20 63 6f 75 6e 74 20 | bufLen |= count |
|00000510| 2b 20 31 3b 0d 09 42 59 | 54 45 20 74 68 65 42 75 |+ 1;..BY|TE theBu|
|00000520| 66 5b 31 30 30 5d 3b 0d | 0d 09 46 53 52 65 61 64 |f[100];.|..FSRead|
|00000530| 28 72 65 66 4e 75 6d 2c | 20 26 62 75 66 4c 65 6e |(refNum,| &bufLen|
|00000540| 2c 20 74 68 65 42 75 66 | 29 3b 0d 09 42 6c 6f 63 |, theBuf|);..Bloc|
|00000550| 6b 4d 6f 76 65 28 74 68 | 65 42 75 66 2c 20 64 61 |kMove(th|eBuf, da|
|00000560| 74 61 2c 20 63 6f 75 6e | 74 29 3b 0d 7d 0d 0d 0d |ta, coun|t);.}...|
|00000570| 76 6f 69 64 0d 44 6f 63 | 57 72 69 74 65 4c 69 6e |void.Doc|WriteLin|
|00000580| 65 20 28 72 65 66 4e 75 | 6d 2c 20 63 6f 75 6e 74 |e (refNu|m, count|
|00000590| 2c 20 64 61 74 61 29 0d | 09 72 65 67 69 73 74 65 |, data).|.registe|
|000005a0| 72 20 57 4f 52 44 20 72 | 65 66 4e 75 6d 3b 0d 09 |r WORD r|efNum;..|
|000005b0| 4c 4f 4e 47 20 63 6f 75 | 6e 74 3b 0d 09 72 65 67 |LONG cou|nt;..reg|
|000005c0| 69 73 74 65 72 20 42 59 | 54 45 20 2a 64 61 74 61 |ister BY|TE *data|
|000005d0| 3b 0d 7b 0d 09 42 59 54 | 45 20 74 68 65 45 6e 64 |;.{..BYT|E theEnd|
|000005e0| 20 3d 20 61 73 63 69 69 | 52 65 74 75 72 6e 3b 0d | = ascii|Return;.|
|000005f0| 0d 09 46 53 57 72 69 74 | 65 28 72 65 66 4e 75 6d |..FSWrit|e(refNum|
|00000600| 2c 20 26 63 6f 75 6e 74 | 2c 20 64 61 74 61 29 3b |, &count|, data);|
|00000610| 0d 09 0d 09 63 6f 75 6e | 74 20 3d 20 31 4c 3b 0d |....coun|t = 1L;.|
|00000620| 09 46 53 57 72 69 74 65 | 28 72 65 66 4e 75 6d 2c |.FSWrite|(refNum,|
|00000630| 20 26 63 6f 75 6e 74 2c | 20 26 74 68 65 45 6e 64 | &count,| &theEnd|
|00000640| 29 3b 0d 7d 0d 0d 0d 76 | 6f 69 64 0d 44 6f 63 52 |);.}...v|oid.DocR|
|00000650| 65 61 64 4e 75 6d 20 28 | 72 65 66 4e 75 6d 2c 20 |eadNum (|refNum, |
|00000660| 74 68 65 4e 75 6d 29 0d | 09 72 65 67 69 73 74 65 |theNum).|.registe|
|00000670| 72 20 57 4f 52 44 20 72 | 65 66 4e 75 6d 3b 0d 09 |r WORD r|efNum;..|
|00000680| 72 65 67 69 73 74 65 72 | 20 57 4f 52 44 20 2a 74 |register| WORD *t|
|00000690| 68 65 4e 75 6d 3b 0d 7b | 0d 09 42 59 54 45 20 6c |heNum;.{|..BYTE l|
|000006a0| 69 6e 65 42 75 66 5b 31 | 30 30 5d 3b 0d 09 42 59 |ineBuf[1|00];..BY|
|000006b0| 54 45 20 2a 74 68 65 4c | 69 6e 65 20 3d 20 6c 69 |TE *theL|ine = li|
|000006c0| 6e 65 42 75 66 3b 0d 09 | 4c 4f 4e 47 20 63 6f 75 |neBuf;..|LONG cou|
|000006d0| 6e 74 20 3d 20 31 4c 3b | 0d 0d 09 2f 2a 20 47 65 |nt = 1L;|.../* Ge|
|000006e0| 74 20 74 68 65 20 6c 65 | 6e 67 74 68 20 77 6f 72 |t the le|ngth wor|
|000006f0| 64 0d 09 20 2a 2f 0d 09 | 77 68 69 6c 65 20 28 28 |d.. */..|while ((|
|00000700| 46 53 52 65 61 64 28 72 | 65 66 4e 75 6d 2c 20 26 |FSRead(r|efNum, &|
|00000710| 63 6f 75 6e 74 2c 20 74 | 68 65 4c 69 6e 65 29 20 |count, t|heLine) |
|00000720| 3d 3d 20 6e 6f 45 72 72 | 29 20 26 26 20 28 2a 74 |== noErr|) && (*t|
|00000730| 68 65 4c 69 6e 65 2b 2b | 20 21 3d 20 61 73 63 69 |heLine++| != asci|
|00000740| 69 52 65 74 75 72 6e 29 | 29 0d 09 09 3b 0d 09 0d |iReturn)|)...;...|
|00000750| 09 2f 2a 20 50 61 72 73 | 65 20 74 68 65 20 6c 65 |./* Pars|e the le|
|00000760| 6e 67 74 68 20 77 6f 72 | 64 0d 09 20 2a 2f 0d 09 |ngth wor|d.. */..|
|00000770| 2a 2d 2d 74 68 65 4c 69 | 6e 65 20 3d 20 27 5c 30 |*--theLi|ne = '\0|
|00000780| 27 3b 0d 09 73 73 63 61 | 6e 66 28 6c 69 6e 65 42 |';..ssca|nf(lineB|
|00000790| 75 66 2c 20 22 25 64 22 | 2c 20 74 68 65 4e 75 6d |uf, "%d"|, theNum|
|000007a0| 29 3b 0d 7d 0d 0d 0d 76 | 6f 69 64 0d 44 6f 63 57 |);.}...v|oid.DocW|
|000007b0| 72 69 74 65 4e 75 6d 20 | 28 72 65 66 4e 75 6d 2c |riteNum |(refNum,|
|000007c0| 20 74 68 65 4e 75 6d 29 | 0d 09 72 65 67 69 73 74 | theNum)|..regist|
|000007d0| 65 72 20 57 4f 52 44 20 | 72 65 66 4e 75 6d 3b 0d |er WORD |refNum;.|
|000007e0| 09 72 65 67 69 73 74 65 | 72 20 57 4f 52 44 20 74 |.registe|r WORD t|
|000007f0| 68 65 4e 75 6d 3b 0d 7b | 0d 09 42 59 54 45 20 74 |heNum;.{|..BYTE t|
|00000800| 68 65 45 6e 64 20 3d 20 | 61 73 63 69 69 52 65 74 |heEnd = |asciiRet|
|00000810| 75 72 6e 3b 0d 09 42 59 | 54 45 20 6c 69 6e 65 42 |urn;..BY|TE lineB|
|00000820| 75 66 5b 31 30 30 5d 3b | 0d 09 4c 4f 4e 47 20 74 |uf[100];|..LONG t|
|00000830| 68 65 4c 65 6e 3b 0d 0d | 09 74 68 65 4c 65 6e 20 |heLen;..|.theLen |
|00000840| 3d 20 73 70 72 69 6e 74 | 66 28 6c 69 6e 65 42 75 |= sprint|f(lineBu|
|00000850| 66 2c 20 22 25 64 22 2c | 20 74 68 65 4e 75 6d 29 |f, "%d",| theNum)|
|00000860| 3b 0d 09 46 53 57 72 69 | 74 65 28 72 65 66 4e 75 |;..FSWri|te(refNu|
|00000870| 6d 2c 20 26 74 68 65 4c | 65 6e 2c 20 6c 69 6e 65 |m, &theL|en, line|
|00000880| 42 75 66 29 3b 0d 09 0d | 09 2f 2a 20 57 72 69 74 |Buf);...|./* Writ|
|00000890| 65 20 61 20 73 65 70 61 | 72 61 74 6f 72 0d 09 20 |e a sepa|rator.. |
|000008a0| 2a 2f 0d 09 74 68 65 4c | 65 6e 20 3d 20 31 4c 3b |*/..theL|en = 1L;|
|000008b0| 0d 09 46 53 57 72 69 74 | 65 28 72 65 66 4e 75 6d |..FSWrit|e(refNum|
|000008c0| 2c 20 26 74 68 65 4c 65 | 6e 2c 20 26 74 68 65 45 |, &theLe|n, &theE|
|000008d0| 6e 64 29 3b 0d 7d 0d 0d | 0d 76 6f 69 64 0d 44 6f |nd);.}..|.void.Do|
|000008e0| 63 52 65 61 64 54 65 78 | 74 20 28 72 65 66 4e 75 |cReadTex|t (refNu|
|000008f0| 6d 2c 20 74 65 78 74 48 | 64 6c 29 0d 09 72 65 67 |m, textH|dl)..reg|
|00000900| 69 73 74 65 72 20 57 4f | 52 44 20 72 65 66 4e 75 |ister WO|RD refNu|
|00000910| 6d 3b 0d 09 72 65 67 69 | 73 74 65 72 20 48 61 6e |m;..regi|ster Han|
|00000920| 64 6c 65 20 74 65 78 74 | 48 64 6c 3b 0d 7b 0d 09 |dle text|Hdl;.{..|
|00000930| 57 4f 52 44 20 74 65 78 | 74 4c 65 6e 3b 0d 09 4c |WORD tex|tLen;..L|
|00000940| 4f 4e 47 20 63 6f 75 6e | 74 3b 0d 09 42 59 54 45 |ONG coun|t;..BYTE|
|00000950| 20 74 68 65 45 6e 64 3b | 0d 0d 09 2f 2a 20 47 65 | theEnd;|.../* Ge|
|00000960| 74 20 74 68 65 20 6c 65 | 6e 67 74 68 20 77 6f 72 |t the le|ngth wor|
|00000970| 64 2c 20 61 6c 6c 6f 63 | 61 74 65 20 61 20 68 61 |d, alloc|ate a ha|
|00000980| 6e 64 6c 65 0d 09 20 2a | 2f 0d 09 44 6f 63 52 65 |ndle.. *|/..DocRe|
|00000990| 61 64 4e 75 6d 28 72 65 | 66 4e 75 6d 2c 20 26 74 |adNum(re|fNum, &t|
|000009a0| 65 78 74 4c 65 6e 29 3b | 0d 09 63 6f 75 6e 74 20 |extLen);|..count |
|000009b0| 3d 20 74 65 78 74 4c 65 | 6e 3b 0d 09 53 65 74 48 |= textLe|n;..SetH|
|000009c0| 61 6e 64 6c 65 53 69 7a | 65 28 74 65 78 74 48 64 |andleSiz|e(textHd|
|000009d0| 6c 2c 20 63 6f 75 6e 74 | 29 3b 0d 09 0d 09 2f 2a |l, count|);..../*|
|000009e0| 20 52 65 61 64 20 74 68 | 65 20 74 65 78 74 0d 09 | Read th|e text..|
|000009f0| 20 2a 2f 0d 09 48 4c 6f | 63 6b 28 74 65 78 74 48 | */..HLo|ck(textH|
|00000a00| 64 6c 29 3b 0d 09 46 53 | 52 65 61 64 28 72 65 66 |dl);..FS|Read(ref|
|00000a10| 4e 75 6d 2c 20 26 63 6f | 75 6e 74 2c 20 2a 74 65 |Num, &co|unt, *te|
|00000a20| 78 74 48 64 6c 29 3b 0d | 09 48 55 6e 6c 6f 63 6b |xtHdl);.|.HUnlock|
|00000a30| 28 74 65 78 74 48 64 6c | 29 3b 0d 0d 09 2f 2a 20 |(textHdl|);.../* |
|00000a40| 52 65 61 64 20 61 20 73 | 65 70 61 72 61 74 6f 72 |Read a s|eparator|
|00000a50| 0d 09 20 2a 2f 0d 09 63 | 6f 75 6e 74 20 3d 20 31 |.. */..c|ount = 1|
|00000a60| 4c 3b 0d 09 46 53 52 65 | 61 64 28 72 65 66 4e 75 |L;..FSRe|ad(refNu|
|00000a70| 6d 2c 20 26 63 6f 75 6e | 74 2c 20 26 74 68 65 45 |m, &coun|t, &theE|
|00000a80| 6e 64 29 3b 0d 7d 0d 0d | 0d 76 6f 69 64 0d 44 6f |nd);.}..|.void.Do|
|00000a90| 63 57 72 69 74 65 54 65 | 78 74 20 28 72 65 66 4e |cWriteTe|xt (refN|
|00000aa0| 75 6d 2c 20 74 65 78 74 | 48 64 6c 29 0d 09 72 65 |um, text|Hdl)..re|
|00000ab0| 67 69 73 74 65 72 20 57 | 4f 52 44 20 72 65 66 4e |gister W|ORD refN|
|00000ac0| 75 6d 3b 0d 09 72 65 67 | 69 73 74 65 72 20 48 61 |um;..reg|ister Ha|
|00000ad0| 6e 64 6c 65 20 74 65 78 | 74 48 64 6c 3b 0d 7b 0d |ndle tex|tHdl;.{.|
|00000ae0| 09 42 59 54 45 20 74 68 | 65 45 6e 64 20 3d 20 61 |.BYTE th|eEnd = a|
|00000af0| 73 63 69 69 52 65 74 75 | 72 6e 3b 0d 09 4c 4f 4e |sciiRetu|rn;..LON|
|00000b00| 47 20 63 6f 75 6e 74 3b | 0d 0d 09 2f 2a 20 57 72 |G count;|.../* Wr|
|00000b10| 69 74 65 20 74 68 65 20 | 6c 65 6e 67 74 68 20 77 |ite the |length w|
|00000b20| 6f 72 64 0d 09 20 2a 2f | 0d 09 63 6f 75 6e 74 20 |ord.. */|..count |
|00000b30| 3d 20 47 65 74 48 61 6e | 64 6c 65 53 69 7a 65 28 |= GetHan|dleSize(|
|00000b40| 74 65 78 74 48 64 6c 29 | 3b 0d 09 44 6f 63 57 72 |textHdl)|;..DocWr|
|00000b50| 69 74 65 4e 75 6d 28 72 | 65 66 4e 75 6d 2c 20 28 |iteNum(r|efNum, (|
|00000b60| 57 4f 52 44 29 20 63 6f | 75 6e 74 29 3b 0d 09 0d |WORD) co|unt);...|
|00000b70| 09 2f 2a 20 57 72 69 74 | 65 20 74 68 65 20 74 65 |./* Writ|e the te|
|00000b80| 78 74 0d 09 20 2a 2f 0d | 09 48 4c 6f 63 6b 28 74 |xt.. */.|.HLock(t|
|00000b90| 65 78 74 48 64 6c 29 3b | 0d 09 46 53 57 72 69 74 |extHdl);|..FSWrit|
|00000ba0| 65 28 72 65 66 4e 75 6d | 2c 20 26 63 6f 75 6e 74 |e(refNum|, &count|
|00000bb0| 2c 20 2a 74 65 78 74 48 | 64 6c 29 3b 0d 09 48 55 |, *textH|dl);..HU|
|00000bc0| 6e 6c 6f 63 6b 28 74 65 | 78 74 48 64 6c 29 3b 0d |nlock(te|xtHdl);.|
|00000bd0| 09 0d 09 2f 2a 20 57 72 | 69 74 65 20 61 20 73 65 |.../* Wr|ite a se|
|00000be0| 70 61 72 61 74 6f 72 0d | 09 20 2a 2f 0d 09 63 6f |parator.|. */..co|
|00000bf0| 75 6e 74 20 3d 20 31 4c | 3b 0d 09 46 53 57 72 69 |unt = 1L|;..FSWri|
|00000c00| 74 65 28 72 65 66 4e 75 | 6d 2c 20 26 63 6f 75 6e |te(refNu|m, &coun|
|00000c10| 74 2c 20 26 74 68 65 45 | 6e 64 29 3b 0d 7d 0d 0d |t, &theE|nd);.}..|
|00000c20| 0d 76 6f 69 64 0d 44 6f | 63 52 65 61 64 47 6e 6f |.void.Do|cReadGno|
|00000c30| 73 20 28 72 65 66 4e 75 | 6d 2c 20 67 6e 6f 73 50 |s (refNu|m, gnosP|
|00000c40| 74 72 29 0d 09 72 65 67 | 69 73 74 65 72 20 57 4f |tr)..reg|ister WO|
|00000c50| 52 44 20 72 65 66 4e 75 | 6d 3b 0d 09 72 65 67 69 |RD refNu|m;..regi|
|00000c60| 73 74 65 72 20 47 6e 6f | 73 50 74 72 20 67 6e 6f |ster Gno|sPtr gno|
|00000c70| 73 50 74 72 3b 0d 7b 0d | 09 57 4f 52 44 20 74 69 |sPtr;.{.|.WORD ti|
|00000c80| 74 6c 65 4c 65 6e 3b 0d | 0d 09 44 6f 63 52 65 61 |tleLen;.|..DocRea|
|00000c90| 64 4c 69 6e 65 28 72 65 | 66 4e 75 6d 2c 20 4d 41 |dLine(re|fNum, MA|
|00000ca0| 58 50 41 44 20 2a 20 32 | 2c 20 28 42 59 54 45 20 |XPAD * 2|, (BYTE |
|00000cb0| 2a 29 20 67 6e 6f 73 50 | 74 72 2d 3e 63 6f 6c 6f |*) gnosP|tr->colo|
|00000cc0| 72 29 3b 0d 09 44 6f 63 | 52 65 61 64 4c 69 6e 65 |r);..Doc|ReadLine|
|00000cd0| 28 72 65 66 4e 75 6d 2c | 20 4d 41 58 50 41 44 20 |(refNum,| MAXPAD |
|00000ce0| 2a 20 32 2c 20 28 42 59 | 54 45 20 2a 29 20 67 6e |* 2, (BY|TE *) gn|
|00000cf0| 6f 73 50 74 72 2d 3e 70 | 61 69 72 29 3b 0d 09 44 |osPtr->p|air);..D|
|00000d00| 6f 63 52 65 61 64 4c 69 | 6e 65 28 72 65 66 4e 75 |ocReadLi|ne(refNu|
|00000d10| 6d 2c 20 4d 41 58 50 41 | 44 20 2a 20 32 2c 20 28 |m, MAXPA|D * 2, (|
|00000d20| 42 59 54 45 20 2a 29 20 | 67 6e 6f 73 50 74 72 2d |BYTE *) |gnosPtr-|
|00000d30| 3e 6d 61 72 6b 29 3b 0d | 09 44 6f 63 52 65 61 64 |>mark);.|.DocRead|
|00000d40| 4c 69 6e 65 28 72 65 66 | 4e 75 6d 2c 20 4d 41 58 |Line(ref|Num, MAX|
|00000d50| 50 41 44 20 2a 20 32 2c | 20 28 42 59 54 45 20 2a |PAD * 2,| (BYTE *|
|00000d60| 29 20 67 6e 6f 73 50 74 | 72 2d 3e 61 6e 78 69 65 |) gnosPt|r->anxie|
|00000d70| 74 79 29 3b 0d 09 44 6f | 63 52 65 61 64 4c 69 6e |ty);..Do|cReadLin|
|00000d80| 65 28 72 65 66 4e 75 6d | 2c 20 4d 41 58 50 41 44 |e(refNum|, MAXPAD|
|00000d90| 20 2a 20 32 2c 20 28 42 | 59 54 45 20 2a 29 20 67 | * 2, (B|YTE *) g|
|00000da0| 6e 6f 73 50 74 72 2d 3e | 73 74 72 65 73 73 29 3b |nosPtr->|stress);|
|00000db0| 0d 0d 09 44 6f 63 52 65 | 61 64 4e 75 6d 28 72 65 |...DocRe|adNum(re|
|00000dc0| 66 4e 75 6d 2c 20 26 28 | 67 6e 6f 73 50 74 72 2d |fNum, &(|gnosPtr-|
|00000dd0| 3e 74 6f 74 61 6c 5b 30 | 5d 29 29 3b 0d 09 44 6f |>total[0|]));..Do|
|00000de0| 63 52 65 61 64 4e 75 6d | 28 72 65 66 4e 75 6d 2c |cReadNum|(refNum,|
|00000df0| 20 26 28 67 6e 6f 73 50 | 74 72 2d 3e 74 6f 74 61 | &(gnosP|tr->tota|
|00000e00| 6c 5b 31 5d 29 29 3b 0d | 0d 09 44 6f 63 52 65 61 |l[1]));.|..DocRea|
|00000e10| 64 4e 75 6d 28 72 65 66 | 4e 75 6d 2c 20 26 74 69 |dNum(ref|Num, &ti|
|00000e20| 74 6c 65 4c 65 6e 29 3b | 0d 09 44 6f 63 52 65 61 |tleLen);|..DocRea|
|00000e30| 64 4c 69 6e 65 28 72 65 | 66 4e 75 6d 2c 20 74 69 |dLine(re|fNum, ti|
|00000e40| 74 6c 65 4c 65 6e 2c 20 | 28 42 59 54 45 20 2a 29 |tleLen, |(BYTE *)|
|00000e50| 20 28 67 6e 6f 73 50 74 | 72 2d 3e 74 69 74 6c 65 | (gnosPt|r->title|
|00000e60| 20 2b 20 31 29 29 3b 0d | 09 67 6e 6f 73 50 74 72 | + 1));.|.gnosPtr|
|00000e70| 2d 3e 74 69 74 6c 65 5b | 30 5d 20 3d 20 74 69 74 |->title[|0] = tit|
|00000e80| 6c 65 4c 65 6e 3b 0d 0d | 09 44 6f 63 52 65 61 64 |leLen;..|.DocRead|
|00000e90| 54 65 78 74 28 72 65 66 | 4e 75 6d 2c 20 67 6e 6f |Text(ref|Num, gno|
|00000ea0| 73 50 74 72 2d 3e 74 65 | 78 74 48 64 6c 29 3b 0d |sPtr->te|xtHdl);.|
|00000eb0| 7d 0d 0d 0d 76 6f 69 64 | 0d 44 6f 63 57 72 69 74 |}...void|.DocWrit|
|00000ec0| 65 47 6e 6f 73 20 28 72 | 65 66 4e 75 6d 2c 20 67 |eGnos (r|efNum, g|
|00000ed0| 6e 6f 73 50 74 72 29 0d | 09 72 65 67 69 73 74 65 |nosPtr).|.registe|
|00000ee0| 72 20 57 4f 52 44 20 72 | 65 66 4e 75 6d 3b 0d 09 |r WORD r|efNum;..|
|00000ef0| 72 65 67 69 73 74 65 72 | 20 47 6e 6f 73 50 74 72 |register| GnosPtr|
|00000f00| 20 67 6e 6f 73 50 74 72 | 3b 0d 7b 0d 09 57 4f 52 | gnosPtr|;.{..WOR|
|00000f10| 44 20 74 69 74 6c 65 4c | 65 6e 3b 0d 0d 09 44 6f |D titleL|en;...Do|
|00000f20| 63 57 72 69 74 65 4c 69 | 6e 65 28 72 65 66 4e 75 |cWriteLi|ne(refNu|
|00000f30| 6d 2c 20 4d 41 58 50 41 | 44 20 2a 20 32 2c 20 28 |m, MAXPA|D * 2, (|
|00000f40| 42 59 54 45 20 2a 29 20 | 67 6e 6f 73 50 74 72 2d |BYTE *) |gnosPtr-|
|00000f50| 3e 63 6f 6c 6f 72 29 3b | 0d 09 44 6f 63 57 72 69 |>color);|..DocWri|
|00000f60| 74 65 4c 69 6e 65 28 72 | 65 66 4e 75 6d 2c 20 4d |teLine(r|efNum, M|
|00000f70| 41 58 50 41 44 20 2a 20 | 32 2c 20 28 42 59 54 45 |AXPAD * |2, (BYTE|
|00000f80| 20 2a 29 20 67 6e 6f 73 | 50 74 72 2d 3e 70 61 69 | *) gnos|Ptr->pai|
|00000f90| 72 29 3b 0d 09 44 6f 63 | 57 72 69 74 65 4c 69 6e |r);..Doc|WriteLin|
|00000fa0| 65 28 72 65 66 4e 75 6d | 2c 20 4d 41 58 50 41 44 |e(refNum|, MAXPAD|
|00000fb0| 20 2a 20 32 2c 20 28 42 | 59 54 45 20 2a 29 20 67 | * 2, (B|YTE *) g|
|00000fc0| 6e 6f 73 50 74 72 2d 3e | 6d 61 72 6b 29 3b 0d 09 |nosPtr->|mark);..|
|00000fd0| 44 6f 63 57 72 69 74 65 | 4c 69 6e 65 28 72 65 66 |DocWrite|Line(ref|
|00000fe0| 4e 75 6d 2c 20 4d 41 58 | 50 41 44 20 2a 20 32 2c |Num, MAX|PAD * 2,|
|00000ff0| 20 28 42 59 54 45 20 2a | 29 20 67 6e 6f 73 50 74 | (BYTE *|) gnosPt|
|00001000| 72 2d 3e 61 6e 78 69 65 | 74 79 29 3b 0d 09 44 6f |r->anxie|ty);..Do|
|00001010| 63 57 72 69 74 65 4c 69 | 6e 65 28 72 65 66 4e 75 |cWriteLi|ne(refNu|
|00001020| 6d 2c 20 4d 41 58 50 41 | 44 20 2a 20 32 2c 20 28 |m, MAXPA|D * 2, (|
|00001030| 42 59 54 45 20 2a 29 20 | 67 6e 6f 73 50 74 72 2d |BYTE *) |gnosPtr-|
|00001040| 3e 73 74 72 65 73 73 29 | 3b 0d 0d 09 44 6f 63 57 |>stress)|;...DocW|
|00001050| 72 69 74 65 4e 75 6d 28 | 72 65 66 4e 75 6d 2c 20 |riteNum(|refNum, |
|00001060| 67 6e 6f 73 50 74 72 2d | 3e 74 6f 74 61 6c 5b 30 |gnosPtr-|>total[0|
|00001070| 5d 29 3b 0d 09 44 6f 63 | 57 72 69 74 65 4e 75 6d |]);..Doc|WriteNum|
|00001080| 28 72 65 66 4e 75 6d 2c | 20 67 6e 6f 73 50 74 72 |(refNum,| gnosPtr|
|00001090| 2d 3e 74 6f 74 61 6c 5b | 31 5d 29 3b 0d 0d 09 74 |->total[|1]);...t|
|000010a0| 69 74 6c 65 4c 65 6e 20 | 3d 20 67 6e 6f 73 50 74 |itleLen |= gnosPt|
|000010b0| 72 2d 3e 74 69 74 6c 65 | 5b 30 5d 3b 0d 09 44 6f |r->title|[0];..Do|
|000010c0| 63 57 72 69 74 65 4e 75 | 6d 28 72 65 66 4e 75 6d |cWriteNu|m(refNum|
|000010d0| 2c 20 74 69 74 6c 65 4c | 65 6e 29 3b 0d 09 44 6f |, titleL|en);..Do|
|000010e0| 63 57 72 69 74 65 4c 69 | 6e 65 28 72 65 66 4e 75 |cWriteLi|ne(refNu|
|000010f0| 6d 2c 20 74 69 74 6c 65 | 4c 65 6e 2c 20 28 42 59 |m, title|Len, (BY|
|00001100| 54 45 20 2a 29 20 28 67 | 6e 6f 73 50 74 72 2d 3e |TE *) (g|nosPtr->|
|00001110| 74 69 74 6c 65 20 2b 20 | 31 29 29 3b 0d 0d 09 44 |title + |1));...D|
|00001120| 6f 63 57 72 69 74 65 54 | 65 78 74 28 72 65 66 4e |ocWriteT|ext(refN|
|00001130| 75 6d 2c 20 67 6e 6f 73 | 50 74 72 2d 3e 74 65 78 |um, gnos|Ptr->tex|
|00001140| 74 48 64 6c 29 3b 0d 7d | 0d 0d 0d 2f 2a 20 52 65 |tHdl);.}|.../* Re|
|00001150| 63 75 72 73 69 76 65 6c | 79 20 6f 75 74 70 75 74 |cursivel|y output|
|00001160| 20 74 68 65 20 70 72 6f | 67 6e 6f 73 69 73 20 6c | the pro|gnosis l|
|00001170| 69 73 74 20 69 6e 20 72 | 65 76 65 72 73 65 20 74 |ist in r|everse t|
|00001180| 6f 20 70 72 65 73 65 72 | 76 65 20 6f 72 64 65 72 |o preser|ve order|
|00001190| 0d 20 2a 20 6e 65 78 74 | 20 74 69 6d 65 20 74 68 |. * next| time th|
|000011a0| 69 73 20 64 6f 63 75 6d | 65 6e 74 20 69 73 20 72 |is docum|ent is r|
|000011b0| 65 61 64 0d 20 2a 2f 0d | 76 6f 69 64 0d 44 6f 63 |ead. */.|void.Doc|
|000011c0| 52 65 63 75 72 47 6e 6f | 73 20 28 72 65 66 4e 75 |RecurGno|s (refNu|
|000011d0| 6d 2c 20 67 6e 6f 73 50 | 74 72 29 0d 09 72 65 67 |m, gnosP|tr)..reg|
|000011e0| 69 73 74 65 72 20 57 4f | 52 44 20 72 65 66 4e 75 |ister WO|RD refNu|
|000011f0| 6d 3b 0d 09 72 65 67 69 | 73 74 65 72 20 47 6e 6f |m;..regi|ster Gno|
|00001200| 73 50 74 72 20 67 6e 6f | 73 50 74 72 3b 0d 7b 0d |sPtr gno|sPtr;.{.|
|00001210| 09 69 66 20 28 67 6e 6f | 73 50 74 72 29 20 7b 0d |.if (gno|sPtr) {.|
|00001220| 09 09 41 70 70 6c 53 70 | 69 6e 43 75 72 73 28 46 |..ApplSp|inCurs(F|
|00001230| 41 4c 53 45 29 3b 0d 09 | 09 44 6f 63 52 65 63 75 |ALSE);..|.DocRecu|
|00001240| 72 47 6e 6f 73 28 72 65 | 66 4e 75 6d 2c 20 67 6e |rGnos(re|fNum, gn|
|00001250| 6f 73 50 74 72 2d 3e 6e | 65 78 74 29 3b 0d 09 09 |osPtr->n|ext);...|
|00001260| 44 6f 63 57 72 69 74 65 | 47 6e 6f 73 28 72 65 66 |DocWrite|Gnos(ref|
|00001270| 4e 75 6d 2c 20 67 6e 6f | 73 50 74 72 29 3b 0d 09 |Num, gno|sPtr);..|
|00001280| 7d 0d 7d 0d 0d 0d 2f 2a | 20 52 65 61 64 20 74 68 |}.}.../*| Read th|
|00001290| 65 20 6e 61 6d 65 64 20 | 66 69 6c 65 0d 20 2a 2f |e named |file. */|
|000012a0| 0d 42 6f 6f 6c 65 61 6e | 0d 44 6f 63 52 65 61 64 |.Boolean|.DocRead|
|000012b0| 46 69 6c 65 20 28 66 69 | 6c 65 4e 61 6d 65 2c 20 |File (fi|leName, |
|000012c0| 76 52 65 66 4e 75 6d 29 | 0d 09 72 65 67 69 73 74 |vRefNum)|..regist|
|000012d0| 65 72 20 53 74 72 69 6e | 67 50 74 72 20 66 69 6c |er Strin|gPtr fil|
|000012e0| 65 4e 61 6d 65 3b 0d 09 | 72 65 67 69 73 74 65 72 |eName;..|register|
|000012f0| 20 57 4f 52 44 20 76 52 | 65 66 4e 75 6d 3b 0d 7b | WORD vR|efNum;.{|
|00001300| 0d 09 72 65 67 69 73 74 | 65 72 20 42 6f 6f 6c 65 |..regist|er Boole|
|00001310| 61 6e 20 72 65 73 75 6c | 74 20 3d 20 54 52 55 45 |an resul|t = TRUE|
|00001320| 3b 0d 09 72 65 67 69 73 | 74 65 72 20 4f 53 45 72 |;..regis|ter OSEr|
|00001330| 72 20 49 4f 52 65 73 75 | 6c 74 3b 0d 09 57 4f 52 |r IOResu|lt;..WOR|
|00001340| 44 20 67 6e 6f 73 43 6f | 75 6e 74 3b 0d 09 69 6f |D gnosCo|unt;..io|
|00001350| 50 61 72 61 6d 20 70 62 | 3b 0d 0d 09 2f 2a 20 53 |Param pb|;.../* S|
|00001360| 65 74 20 75 70 20 74 68 | 65 20 70 62 2e 20 20 4e |et up th|e pb. N|
|00001370| 6f 74 65 20 74 68 61 74 | 20 69 74 27 73 20 73 65 |ote that| it's se|
|00001380| 74 20 75 70 20 61 73 20 | 72 65 61 64 2d 6f 6e 6c |t up as |read-onl|
|00001390| 79 0d 09 20 2a 2f 0d 09 | 70 62 2e 69 6f 43 6f 6d |y.. */..|pb.ioCom|
|000013a0| 70 6c 65 74 69 6f 6e 20 | 3d 20 4e 55 4c 4c 3b 0d |pletion |= NULL;.|
|000013b0| 09 70 62 2e 69 6f 4e 61 | 6d 65 50 74 72 20 3d 20 |.pb.ioNa|mePtr = |
|000013c0| 66 69 6c 65 4e 61 6d 65 | 3b 0d 09 70 62 2e 69 6f |fileName|;..pb.io|
|000013d0| 56 52 65 66 4e 75 6d 20 | 3d 20 76 52 65 66 4e 75 |VRefNum |= vRefNu|
|000013e0| 6d 3b 0d 09 70 62 2e 69 | 6f 56 65 72 73 4e 75 6d |m;..pb.i|oVersNum|
|000013f0| 20 3d 20 30 3b 0d 09 70 | 62 2e 69 6f 50 65 72 6d | = 0;..p|b.ioPerm|
|00001400| 73 73 6e 20 3d 20 66 73 | 52 64 50 65 72 6d 3b 0d |ssn = fs|RdPerm;.|
|00001410| 09 70 62 2e 69 6f 4d 69 | 73 63 20 3d 20 4e 55 4c |.pb.ioMi|sc = NUL|
|00001420| 4c 3b 0d 0d 09 2f 2a 20 | 49 66 20 77 65 20 63 61 |L;.../* |If we ca|
|00001430| 6e 27 74 20 6f 70 65 6e | 20 69 74 20 66 6f 72 20 |n't open| it for |
|00001440| 73 6f 6d 65 20 72 65 61 | 73 6f 6e 2c 20 73 69 67 |some rea|son, sig|
|00001450| 6e 61 6c 20 61 6e 20 65 | 72 72 6f 72 20 61 6e 64 |nal an e|rror and|
|00001460| 20 72 65 74 75 72 6e 0d | 09 20 2a 2f 0d 09 41 70 | return.|. */..Ap|
|00001470| 70 6c 53 70 69 6e 43 75 | 72 73 28 46 41 4c 53 45 |plSpinCu|rs(FALSE|
|00001480| 29 3b 0d 09 0d 09 69 66 | 20 28 21 28 72 65 73 75 |);....if| (!(resu|
|00001490| 6c 74 20 3d 20 21 50 42 | 4f 70 65 6e 28 26 70 62 |lt = !PB|Open(&pb|
|000014a0| 2c 20 46 41 4c 53 45 29 | 29 29 20 7b 0d 09 09 45 |, FALSE)|)) {...E|
|000014b0| 72 72 46 69 6c 65 4d 67 | 72 28 70 62 2e 69 6f 52 |rrFileMg|r(pb.ioR|
|000014c0| 65 73 75 6c 74 2c 20 66 | 69 6c 65 4e 61 6d 65 29 |esult, f|ileName)|
|000014d0| 3b 0d 09 09 72 65 74 75 | 72 6e 20 46 41 4c 53 45 |;...retu|rn FALSE|
|000014e0| 3b 0d 09 7d 0d 0d 09 2f | 2a 20 52 65 61 64 20 66 |;..}.../|* Read f|
|000014f0| 69 6c 65 20 69 6e 74 6f | 20 68 61 6e 64 6c 65 20 |ile into| handle |
|00001500| 61 6e 64 20 73 65 74 20 | 74 68 65 20 6e 65 77 20 |and set |the new |
|00001510| 74 65 78 74 0d 09 20 2a | 2f 0d 09 41 70 70 6c 53 |text.. *|/..ApplS|
|00001520| 70 69 6e 43 75 72 73 28 | 46 41 4c 53 45 29 3b 0d |pinCurs(|FALSE);.|
|00001530| 09 44 6f 63 52 65 61 64 | 4e 75 6d 28 70 62 2e 69 |.DocRead|Num(pb.i|
|00001540| 6f 52 65 66 4e 75 6d 2c | 20 26 67 6e 6f 73 43 6f |oRefNum,| &gnosCo|
|00001550| 75 6e 74 29 3b 0d 0d 09 | 66 6f 72 20 28 3b 20 67 |unt);...|for (; g|
|00001560| 6e 6f 73 43 6f 75 6e 74 | 2d 2d 3b 20 29 20 7b 0d |nosCount|--; ) {.|
|00001570| 09 09 41 70 70 6c 53 70 | 69 6e 43 75 72 73 28 46 |..ApplSp|inCurs(F|
|00001580| 41 4c 53 45 29 3b 0d 09 | 09 44 6f 63 52 65 61 64 |ALSE);..|.DocRead|
|00001590| 47 6e 6f 73 28 70 62 2e | 69 6f 52 65 66 4e 75 6d |Gnos(pb.|ioRefNum|
|000015a0| 2c 20 47 6e 6f 73 4e 65 | 77 28 29 29 3b 0d 09 7d |, GnosNe|w());..}|
|000015b0| 0d 0d 09 2f 2a 20 43 6c | 6f 73 65 20 66 69 6c 65 |.../* Cl|ose file|
|000015c0| 20 62 65 66 6f 72 65 20 | 72 65 74 75 72 6e 69 6e | before |returnin|
|000015d0| 67 0d 09 20 2a 2f 0d 09 | 46 53 43 6c 6f 73 65 28 |g.. */..|FSClose(|
|000015e0| 70 62 2e 69 6f 52 65 66 | 4e 75 6d 29 3b 0d 09 72 |pb.ioRef|Num);..r|
|000015f0| 65 74 75 72 6e 20 72 65 | 73 75 6c 74 3b 0d 7d 0d |eturn re|sult;.}.|
|00001600| 0d 0d 2f 2a 20 57 72 69 | 74 65 20 74 68 65 20 6e |../* Wri|te the n|
|00001610| 61 6d 65 64 20 66 69 6c | 65 0d 20 2a 2f 0d 42 6f |amed fil|e. */.Bo|
|00001620| 6f 6c 65 61 6e 0d 44 6f | 63 57 72 69 74 65 46 69 |olean.Do|cWriteFi|
|00001630| 6c 65 20 28 66 69 6c 65 | 4e 61 6d 65 2c 20 76 52 |le (file|Name, vR|
|00001640| 65 66 4e 75 6d 29 0d 09 | 72 65 67 69 73 74 65 72 |efNum)..|register|
|00001650| 20 53 74 72 69 6e 67 50 | 74 72 20 66 69 6c 65 4e | StringP|tr fileN|
|00001660| 61 6d 65 3b 0d 09 72 65 | 67 69 73 74 65 72 20 57 |ame;..re|gister W|
|00001670| 4f 52 44 20 76 52 65 66 | 4e 75 6d 3b 0d 7b 0d 09 |ORD vRef|Num;.{..|
|00001680| 72 65 67 69 73 74 65 72 | 20 4f 53 45 72 72 20 49 |register| OSErr I|
|00001690| 4f 52 65 73 75 6c 74 20 | 3d 20 6e 6f 45 72 72 3b |OResult |= noErr;|
|000016a0| 0d 09 72 65 67 69 73 74 | 65 72 20 42 6f 6f 6c 65 |..regist|er Boole|
|000016b0| 61 6e 20 72 65 73 75 6c | 74 20 3d 20 54 52 55 45 |an resul|t = TRUE|
|000016c0| 3b 0d 09 57 4f 52 44 20 | 72 65 66 4e 75 6d 3b 0d |;..WORD |refNum;.|
|000016d0| 09 4c 4f 4e 47 20 6c 6f | 67 45 4f 46 3b 0d 09 46 |.LONG lo|gEOF;..F|
|000016e0| 49 6e 66 6f 20 74 68 65 | 46 49 6e 66 6f 3b 0d 0d |Info the|FInfo;..|
|000016f0| 09 2f 2a 20 54 72 79 20 | 74 68 65 20 6f 70 65 6e |./* Try |the open|
|00001700| 20 74 68 65 20 73 70 65 | 63 69 66 69 65 64 20 66 | the spe|cified f|
|00001710| 69 6c 65 0d 09 20 2a 2f | 0d 09 69 66 20 28 49 4f |ile.. */|..if (IO|
|00001720| 52 65 73 75 6c 74 20 3d | 20 46 53 4f 70 65 6e 28 |Result =| FSOpen(|
|00001730| 66 69 6c 65 4e 61 6d 65 | 2c 20 76 52 65 66 4e 75 |fileName|, vRefNu|
|00001740| 6d 2c 20 26 72 65 66 4e | 75 6d 29 29 20 7b 0d 09 |m, &refN|um)) {..|
|00001750| 09 45 72 72 46 69 6c 65 | 4d 67 72 28 49 4f 52 65 |.ErrFile|Mgr(IORe|
|00001760| 73 75 6c 74 2c 20 66 69 | 6c 65 4e 61 6d 65 29 3b |sult, fi|leName);|
|00001770| 0d 09 09 72 65 73 75 6c | 74 20 3d 20 46 41 4c 53 |...resul|t = FALS|
|00001780| 45 3b 0d 09 7d 0d 0d 09 | 2f 2a 20 54 72 79 20 74 |E;..}...|/* Try t|
|00001790| 6f 20 6d 61 6b 65 20 74 | 68 65 20 66 69 6c 65 20 |o make t|he file |
|000017a0| 65 6d 70 74 79 2c 20 61 | 73 20 61 20 74 65 73 74 |empty, a|s a test|
|000017b0| 0d 09 20 2a 2f 0d 09 41 | 70 70 6c 53 70 69 6e 43 |.. */..A|pplSpinC|
|000017c0| 75 72 73 28 46 41 4c 53 | 45 29 3b 0d 09 6c 6f 67 |urs(FALS|E);..log|
|000017d0| 45 4f 46 20 3d 20 30 4c | 3b 0d 0d 09 69 66 20 28 |EOF = 0L|;...if (|
|000017e0| 72 65 73 75 6c 74 20 26 | 26 20 28 49 4f 52 65 73 |result &|& (IORes|
|000017f0| 75 6c 74 20 3d 20 53 65 | 74 45 4f 46 28 72 65 66 |ult = Se|tEOF(ref|
|00001800| 4e 75 6d 2c 20 6c 6f 67 | 45 4f 46 29 29 29 20 7b |Num, log|EOF))) {|
|00001810| 0d 09 09 2f 2a 20 44 6f | 6e 27 74 20 66 6f 72 67 |.../* Do|n't forg|
|00001820| 65 74 20 74 6f 20 63 6c | 6f 73 65 20 69 74 21 20 |et to cl|ose it! |
|00001830| 20 4f 74 68 65 72 77 69 | 73 65 20 69 74 20 77 69 | Otherwi|se it wi|
|00001840| 6c 6c 20 72 65 6d 61 69 | 6e 0d 09 09 20 2a 20 6f |ll remai|n... * o|
|00001850| 70 65 6e 20 75 6e 74 69 | 6c 20 79 6f 75 20 72 65 |pen unti|l you re|
|00001860| 62 6f 6f 74 20 74 68 65 | 20 6d 61 63 68 69 6e 65 |boot the| machine|
|00001870| 0d 09 09 20 2a 2f 0d 09 | 09 46 53 43 6c 6f 73 65 |... */..|.FSClose|
|00001880| 28 72 65 66 4e 75 6d 29 | 3b 0d 09 09 45 72 72 46 |(refNum)|;...ErrF|
|00001890| 69 6c 65 4d 67 72 28 49 | 4f 52 65 73 75 6c 74 2c |ileMgr(I|OResult,|
|000018a0| 20 66 69 6c 65 4e 61 6d | 65 29 3b 0d 09 09 72 65 | fileNam|e);...re|
|000018b0| 73 75 6c 74 20 3d 20 46 | 41 4c 53 45 3b 0d 09 7d |sult = F|ALSE;..}|
|000018c0| 0d 0d 09 2f 2a 20 57 72 | 69 74 65 20 6f 75 74 20 |.../* Wr|ite out |
|000018d0| 74 68 65 20 6c 69 73 74 | 20 6f 66 20 64 61 74 61 |the list| of data|
|000018e0| 0d 09 20 2a 2f 0d 09 41 | 70 70 6c 53 70 69 6e 43 |.. */..A|pplSpinC|
|000018f0| 75 72 73 28 46 41 4c 53 | 45 29 3b 0d 0d 09 69 66 |urs(FALS|E);...if|
|00001900| 20 28 72 65 73 75 6c 74 | 29 20 7b 0d 09 09 44 6f | (result|) {...Do|
|00001910| 63 57 72 69 74 65 4e 75 | 6d 28 72 65 66 4e 75 6d |cWriteNu|m(refNum|
|00001920| 2c 20 67 6e 6f 73 4c 69 | 73 74 2e 63 6f 75 6e 74 |, gnosLi|st.count|
|00001930| 29 3b 0d 09 09 44 6f 63 | 52 65 63 75 72 47 6e 6f |);...Doc|RecurGno|
|00001940| 73 28 72 65 66 4e 75 6d | 2c 20 67 6e 6f 73 4c 69 |s(refNum|, gnosLi|
|00001950| 73 74 2e 68 65 61 64 29 | 3b 0d 09 7d 0d 0d 09 2f |st.head)|;..}.../|
|00001960| 2a 20 43 6c 6f 73 65 20 | 74 68 65 20 66 69 6c 65 |* Close |the file|
|00001970| 20 61 6e 64 20 66 6c 75 | 73 68 20 74 68 65 20 76 | and flu|sh the v|
|00001980| 6f 6c 75 6d 65 2c 20 74 | 6f 20 6d 61 6b 65 20 73 |olume, t|o make s|
|00001990| 75 72 65 20 64 69 73 6b | 20 69 73 20 63 6f 72 72 |ure disk| is corr|
|000019a0| 65 63 74 0d 09 20 2a 2f | 0d 09 69 66 20 28 72 65 |ect.. */|..if (re|
|000019b0| 73 75 6c 74 29 20 7b 0d | 09 09 46 53 43 6c 6f 73 |sult) {.|..FSClos|
|000019c0| 65 28 72 65 66 4e 75 6d | 29 3b 0d 09 09 46 6c 75 |e(refNum|);...Flu|
|000019d0| 73 68 56 6f 6c 28 4e 55 | 4c 4c 2c 20 76 52 65 66 |shVol(NU|LL, vRef|
|000019e0| 4e 75 6d 29 3b 0d 0d 09 | 09 2f 2a 20 55 70 64 61 |Num);...|./* Upda|
|000019f0| 74 65 20 74 68 65 20 63 | 72 65 61 74 72 69 78 20 |te the c|reatrix |
|00001a00| 73 6f 20 74 68 61 74 20 | 74 68 65 20 69 63 6f 6e |so that |the icon|
|00001a10| 20 77 69 6c 6c 20 62 65 | 20 63 6f 72 72 65 63 74 | will be| correct|
|00001a20| 20 61 6e 64 20 74 68 65 | 20 66 69 6c 65 0d 09 09 | and the| file...|
|00001a30| 20 2a 20 77 69 6c 6c 20 | 6c 61 75 6e 63 68 20 6f | * will |launch o|
|00001a40| 75 72 20 61 70 70 6c 69 | 63 61 74 69 6f 6e 0d 09 |ur appli|cation..|
|00001a50| 09 20 2a 2f 0d 09 09 69 | 66 20 28 21 47 65 74 46 |. */...i|f (!GetF|
|00001a60| 49 6e 66 6f 28 66 69 6c | 65 4e 61 6d 65 2c 20 76 |Info(fil|eName, v|
|00001a70| 52 65 66 4e 75 6d 2c 20 | 26 74 68 65 46 49 6e 66 |RefNum, |&theFInf|
|00001a80| 6f 29 29 20 7b 0d 09 09 | 09 74 68 65 46 49 6e 66 |o)) {...|.theFInf|
|00001a90| 6f 2e 66 64 43 72 65 61 | 74 6f 72 20 3d 20 4c 55 |o.fdCrea|tor = LU|
|00001aa0| 43 48 5f 54 41 47 3b 0d | 09 09 09 53 65 74 46 49 |CH_TAG;.|...SetFI|
|00001ab0| 6e 66 6f 28 66 69 6c 65 | 4e 61 6d 65 2c 20 76 52 |nfo(file|Name, vR|
|00001ac0| 65 66 4e 75 6d 2c 20 26 | 74 68 65 46 49 6e 66 6f |efNum, &|theFInfo|
|00001ad0| 29 3b 0d 09 09 7d 0d 09 | 7d 0d 0d 09 41 70 70 6c |);...}..|}...Appl|
|00001ae0| 53 70 69 6e 43 75 72 73 | 28 46 41 4c 53 45 29 3b |SpinCurs|(FALSE);|
|00001af0| 0d 09 72 65 74 75 72 6e | 20 72 65 73 75 6c 74 3b |..return| result;|
|00001b00| 0d 7d 0d 0d 0d 2f 2a 20 | 4f 70 65 6e 20 74 68 65 |.}.../* |Open the|
|00001b10| 20 6e 61 6d 65 64 20 66 | 69 6c 65 20 69 6e 74 6f | named f|ile into|
|00001b20| 20 74 68 65 20 73 70 65 | 63 69 66 69 65 64 20 77 | the spe|cified w|
|00001b30| 69 6e 64 6f 77 0d 20 2a | 2f 0d 42 6f 6f 6c 65 61 |indow. *|/.Boolea|
|00001b40| 6e 0d 44 6f 63 4f 70 65 | 6e 46 69 6c 65 20 28 74 |n.DocOpe|nFile (t|
|00001b50| 68 65 57 69 6e 64 6f 77 | 2c 20 66 69 6c 65 4e 61 |heWindow|, fileNa|
|00001b60| 6d 65 2c 20 76 52 65 66 | 4e 75 6d 29 0d 09 72 65 |me, vRef|Num)..re|
|00001b70| 67 69 73 74 65 72 20 57 | 69 6e 64 6f 77 50 74 72 |gister W|indowPtr|
|00001b80| 20 74 68 65 57 69 6e 64 | 6f 77 3b 0d 09 72 65 67 | theWind|ow;..reg|
|00001b90| 69 73 74 65 72 20 53 74 | 72 69 6e 67 50 74 72 20 |ister St|ringPtr |
|00001ba0| 66 69 6c 65 4e 61 6d 65 | 3b 0d 09 72 65 67 69 73 |fileName|;..regis|
|00001bb0| 74 65 72 20 57 4f 52 44 | 20 76 52 65 66 4e 75 6d |ter WORD| vRefNum|
|00001bc0| 3b 0d 7b 0d 09 72 65 67 | 69 73 74 65 72 20 49 6e |;.{..reg|ister In|
|00001bd0| 66 6f 50 74 72 20 69 6e | 66 6f 50 74 72 20 3d 20 |foPtr in|foPtr = |
|00001be0| 28 49 6e 66 6f 50 74 72 | 29 20 47 65 74 57 52 65 |(InfoPtr|) GetWRe|
|00001bf0| 66 43 6f 6e 28 74 68 65 | 57 69 6e 64 6f 77 29 3b |fCon(the|Window);|
|00001c00| 0d 09 72 65 67 69 73 74 | 65 72 20 42 6f 6f 6c 65 |..regist|er Boole|
|00001c10| 61 6e 20 72 65 73 75 6c | 74 3b 0d 09 47 72 61 66 |an resul|t;..Graf|
|00001c20| 50 74 72 20 73 61 76 65 | 50 6f 72 74 3b 0d 0d 09 |Ptr save|Port;...|
|00001c30| 47 65 74 50 6f 72 74 28 | 26 73 61 76 65 50 6f 72 |GetPort(|&savePor|
|00001c40| 74 29 3b 0d 09 53 65 74 | 50 6f 72 74 28 74 68 65 |t);..Set|Port(the|
|00001c50| 57 69 6e 64 6f 77 29 3b | 0d 0d 09 2f 2a 20 4f 70 |Window);|.../* Op|
|00001c60| 65 6e 20 74 68 65 20 66 | 69 6c 65 0d 09 20 2a 2f |en the f|ile.. */|
|00001c70| 0d 09 41 70 70 6c 53 70 | 69 6e 43 75 72 73 28 46 |..ApplSp|inCurs(F|
|00001c80| 41 4c 53 45 29 3b 0d 09 | 0d 09 69 66 20 28 72 65 |ALSE);..|..if (re|
|00001c90| 73 75 6c 74 20 3d 20 44 | 6f 63 52 65 61 64 46 69 |sult = D|ocReadFi|
|00001ca0| 6c 65 28 66 69 6c 65 4e | 61 6d 65 2c 20 76 52 65 |le(fileN|ame, vRe|
|00001cb0| 66 4e 75 6d 29 29 20 7b | 0d 09 09 69 6e 66 6f 50 |fNum)) {|...infoP|
|00001cc0| 74 72 2d 3e 6e 61 6d 65 | 64 20 3d 20 54 52 55 45 |tr->name|d = TRUE|
|00001cd0| 3b 0d 0d 09 09 53 74 72 | 50 43 70 79 28 69 6e 66 |;....Str|PCpy(inf|
|00001ce0| 6f 50 74 72 2d 3e 66 69 | 6c 65 4e 61 6d 65 2c 20 |oPtr->fi|leName, |
|00001cf0| 66 69 6c 65 4e 61 6d 65 | 29 3b 0d 09 09 53 65 74 |fileName|);...Set|
|00001d00| 57 54 69 74 6c 65 28 74 | 68 65 57 69 6e 64 6f 77 |WTitle(t|heWindow|
|00001d10| 2c 20 66 69 6c 65 4e 61 | 6d 65 29 3b 0d 09 09 69 |, fileNa|me);...i|
|00001d20| 6e 66 6f 50 74 72 2d 3e | 76 52 65 66 4e 75 6d 20 |nfoPtr->|vRefNum |
|00001d30| 3d 20 76 52 65 66 4e 75 | 6d 3b 0d 0d 09 09 57 69 |= vRefNu|m;....Wi|
|00001d40| 6e 64 53 77 69 74 63 68 | 28 74 68 65 57 69 6e 64 |ndSwitch|(theWind|
|00001d50| 6f 77 2c 20 54 52 55 45 | 29 3b 0d 09 09 47 6e 6f |ow, TRUE|);...Gno|
|00001d60| 73 52 65 66 72 65 73 68 | 28 29 3b 0d 09 09 47 6e |sRefresh|();...Gn|
|00001d70| 6f 73 4c 65 61 72 6e 28 | 29 3b 0d 09 7d 0d 0d 09 |osLearn(|);..}...|
|00001d80| 53 65 74 50 6f 72 74 28 | 73 61 76 65 50 6f 72 74 |SetPort(|savePort|
|00001d90| 29 3b 0d 09 72 65 74 75 | 72 6e 20 72 65 73 75 6c |);..retu|rn resul|
|00001da0| 74 3b 0d 7d 0d 0d 0d 2f | 2a 20 53 61 76 65 20 74 |t;.}.../|* Save t|
|00001db0| 68 65 20 63 6f 6e 74 65 | 6e 74 73 20 6f 66 20 74 |he conte|nts of t|
|00001dc0| 68 65 20 77 69 6e 64 6f | 77 20 69 6e 74 6f 20 74 |he windo|w into t|
|00001dd0| 68 65 20 64 65 73 69 67 | 6e 61 74 65 64 20 66 69 |he desig|nated fi|
|00001de0| 6c 65 0d 20 2a 2f 0d 42 | 6f 6f 6c 65 61 6e 0d 44 |le. */.B|oolean.D|
|00001df0| 6f 63 53 61 76 65 46 69 | 6c 65 20 28 74 68 65 57 |ocSaveFi|le (theW|
|00001e00| 69 6e 64 6f 77 2c 20 66 | 69 6c 65 4e 61 6d 65 2c |indow, f|ileName,|
|00001e10| 20 76 52 65 66 4e 75 6d | 29 0d 09 72 65 67 69 73 | vRefNum|)..regis|
|00001e20| 74 65 72 20 57 69 6e 64 | 6f 77 50 74 72 20 74 68 |ter Wind|owPtr th|
|00001e30| 65 57 69 6e 64 6f 77 3b | 0d 09 72 65 67 69 73 74 |eWindow;|..regist|
|00001e40| 65 72 20 53 74 72 69 6e | 67 50 74 72 20 66 69 6c |er Strin|gPtr fil|
|00001e50| 65 4e 61 6d 65 3b 0d 09 | 72 65 67 69 73 74 65 72 |eName;..|register|
|00001e60| 20 57 4f 52 44 20 76 52 | 65 66 4e 75 6d 3b 0d 7b | WORD vR|efNum;.{|
|00001e70| 0d 09 72 65 67 69 73 74 | 65 72 20 49 6e 66 6f 50 |..regist|er InfoP|
|00001e80| 74 72 20 69 6e 66 6f 50 | 74 72 20 3d 20 28 49 6e |tr infoP|tr = (In|
|00001e90| 66 6f 50 74 72 29 20 47 | 65 74 57 52 65 66 43 6f |foPtr) G|etWRefCo|
|00001ea0| 6e 28 74 68 65 57 69 6e | 64 6f 77 29 3b 0d 09 72 |n(theWin|dow);..r|
|00001eb0| 65 67 69 73 74 65 72 20 | 42 6f 6f 6c 65 61 6e 20 |egister |Boolean |
|00001ec0| 72 65 73 75 6c 74 20 3d | 20 54 52 55 45 3b 0d 09 |result =| TRUE;..|
|00001ed0| 72 65 67 69 73 74 65 72 | 20 4f 53 45 72 72 20 49 |register| OSErr I|
|00001ee0| 4f 52 65 73 75 6c 74 3b | 0d 09 47 72 61 66 50 74 |OResult;|..GrafPt|
|00001ef0| 72 20 73 61 76 65 50 6f | 72 74 3b 0d 0d 09 47 65 |r savePo|rt;...Ge|
|00001f00| 74 50 6f 72 74 28 26 73 | 61 76 65 50 6f 72 74 29 |tPort(&s|avePort)|
|00001f10| 3b 0d 09 53 65 74 50 6f | 72 74 28 74 68 65 57 69 |;..SetPo|rt(theWi|
|00001f20| 6e 64 6f 77 29 3b 0d 0d | 09 2f 2a 20 44 65 6c 65 |ndow);..|./* Dele|
|00001f30| 74 65 20 74 68 65 20 66 | 6f 72 6d 65 72 20 63 6f |te the f|ormer co|
|00001f40| 6e 74 65 6e 74 73 20 6f | 66 20 74 68 65 20 66 69 |ntents o|f the fi|
|00001f50| 6c 65 2c 20 77 69 74 68 | 6f 75 74 20 63 68 61 6e |le, with|out chan|
|00001f60| 67 69 6e 67 0d 09 20 2a | 2f 0d 09 46 53 44 65 6c |ging.. *|/..FSDel|
|00001f70| 65 74 65 28 66 69 6c 65 | 4e 61 6d 65 2c 20 76 52 |ete(file|Name, vR|
|00001f80| 65 66 4e 75 6d 29 3b 0d | 0d 09 2f 2a 20 4e 6f 77 |efNum);.|../* Now|
|00001f90| 20 74 72 79 20 74 6f 20 | 63 72 65 61 74 65 20 69 | try to |create i|
|00001fa0| 74 20 61 67 61 69 6e 0d | 09 20 2a 2f 0d 09 69 66 |t again.|. */..if|
|00001fb0| 20 28 49 4f 52 65 73 75 | 6c 74 20 3d 20 43 72 65 | (IOResu|lt = Cre|
|00001fc0| 61 74 65 28 66 69 6c 65 | 4e 61 6d 65 2c 20 76 52 |ate(file|Name, vR|
|00001fd0| 65 66 4e 75 6d 2c 20 4c | 55 43 48 5f 54 41 47 2c |efNum, L|UCH_TAG,|
|00001fe0| 20 4c 55 43 48 5f 54 41 | 47 29 29 20 7b 0d 09 09 | LUCH_TA|G)) {...|
|00001ff0| 45 72 72 46 69 6c 65 4d | 67 72 28 49 4f 52 65 73 |ErrFileM|gr(IORes|
|00002000| 75 6c 74 2c 20 66 69 6c | 65 4e 61 6d 65 29 3b 0d |ult, fil|eName);.|
|00002010| 09 09 72 65 73 75 6c 74 | 20 3d 20 46 41 4c 53 45 |..result| = FALSE|
|00002020| 3b 0d 09 7d 0d 0d 09 2f | 2a 20 54 72 79 20 74 6f |;..}.../|* Try to|
|00002030| 20 77 72 69 74 65 2c 20 | 74 68 65 6e 20 75 70 64 | write, |then upd|
|00002040| 61 74 65 20 74 68 65 20 | 6e 61 6d 65 20 61 6e 64 |ate the |name and|
|00002050| 20 76 6f 6c 75 6d 65 20 | 72 65 66 0d 09 20 2a 2f | volume |ref.. */|
|00002060| 0d 09 69 66 20 28 72 65 | 73 75 6c 74 20 26 26 20 |..if (re|sult && |
|00002070| 28 72 65 73 75 6c 74 20 | 3d 20 44 6f 63 57 72 69 |(result |= DocWri|
|00002080| 74 65 46 69 6c 65 28 66 | 69 6c 65 4e 61 6d 65 2c |teFile(f|ileName,|
|00002090| 20 76 52 65 66 4e 75 6d | 29 29 29 20 7b 0d 09 09 | vRefNum|))) {...|
|000020a0| 53 74 72 50 43 70 79 28 | 69 6e 66 6f 50 74 72 2d |StrPCpy(|infoPtr-|
|000020b0| 3e 66 69 6c 65 4e 61 6d | 65 2c 20 66 69 6c 65 4e |>fileNam|e, fileN|
|000020c0| 61 6d 65 29 3b 0d 09 09 | 53 65 74 57 54 69 74 6c |ame);...|SetWTitl|
|000020d0| 65 28 74 68 65 57 69 6e | 64 6f 77 2c 20 66 69 6c |e(theWin|dow, fil|
|000020e0| 65 4e 61 6d 65 29 3b 0d | 09 09 41 70 70 6c 53 70 |eName);.|..ApplSp|
|000020f0| 69 6e 43 75 72 73 28 46 | 41 4c 53 45 29 3b 0d 0d |inCurs(F|ALSE);..|
|00002100| 09 09 69 6e 66 6f 50 74 | 72 2d 3e 76 52 65 66 4e |..infoPt|r->vRefN|
|00002110| 75 6d 20 3d 20 76 52 65 | 66 4e 75 6d 3b 0d 09 09 |um = vRe|fNum;...|
|00002120| 69 6e 66 6f 50 74 72 2d | 3e 64 69 72 74 79 20 3d |infoPtr-|>dirty =|
|00002130| 20 46 41 4c 53 45 3b 0d | 09 09 69 6e 66 6f 50 74 | FALSE;.|..infoPt|
|00002140| 72 2d 3e 6e 61 6d 65 64 | 20 3d 20 54 52 55 45 3b |r->named| = TRUE;|
|00002150| 0d 09 7d 0d 09 0d 09 53 | 65 74 50 6f 72 74 28 73 |..}....S|etPort(s|
|00002160| 61 76 65 50 6f 72 74 29 | 3b 0d 09 72 65 74 75 72 |avePort)|;..retur|
|00002170| 6e 20 72 65 73 75 6c 74 | 3b 0d 7d 0d 0d 0d 2f 2a |n result|;.}.../*|
|00002180| 20 4f 70 65 6e 20 61 20 | 6e 65 77 20 64 6f 63 75 | Open a |new docu|
|00002190| 6d 65 6e 74 0d 20 2a 2f | 0d 76 6f 69 64 0d 44 6f |ment. */|.void.Do|
|000021a0| 63 4e 65 77 20 28 74 68 | 65 57 69 6e 64 6f 77 29 |cNew (th|eWindow)|
|000021b0| 0d 09 72 65 67 69 73 74 | 65 72 20 57 69 6e 64 6f |..regist|er Windo|
|000021c0| 77 50 74 72 20 74 68 65 | 57 69 6e 64 6f 77 3b 0d |wPtr the|Window;.|
|000021d0| 7b 0d 09 72 65 67 69 73 | 74 65 72 20 49 6e 66 6f |{..regis|ter Info|
|000021e0| 50 74 72 20 69 6e 66 6f | 50 74 72 20 3d 20 28 49 |Ptr info|Ptr = (I|
|000021f0| 6e 66 6f 50 74 72 29 20 | 47 65 74 57 52 65 66 43 |nfoPtr) |GetWRefC|
|00002200| 6f 6e 28 74 68 65 57 69 | 6e 64 6f 77 29 3b 0d 09 |on(theWi|ndow);..|
|00002210| 47 72 61 66 50 74 72 20 | 73 61 76 65 50 6f 72 74 |GrafPtr |savePort|
|00002220| 3b 0d 0d 09 47 65 74 50 | 6f 72 74 28 26 73 61 76 |;...GetP|ort(&sav|
|00002230| 65 50 6f 72 74 29 3b 0d | 09 53 65 74 50 6f 72 74 |ePort);.|.SetPort|
|00002240| 28 74 68 65 57 69 6e 64 | 6f 77 29 3b 0d 0d 09 47 |(theWind|ow);...G|
|00002250| 65 74 49 6e 64 53 74 72 | 69 6e 67 28 69 6e 66 6f |etIndStr|ing(info|
|00002260| 50 74 72 2d 3e 66 69 6c | 65 4e 61 6d 65 2c 20 52 |Ptr->fil|eName, R|
|00002270| 53 52 43 42 41 53 45 2c | 20 73 74 72 55 6e 74 69 |SRCBASE,| strUnti|
|00002280| 74 6c 65 64 29 3b 0d 09 | 53 65 74 57 54 69 74 6c |tled);..|SetWTitl|
|00002290| 65 28 74 68 65 57 69 6e | 64 6f 77 2c 20 69 6e 66 |e(theWin|dow, inf|
|000022a0| 6f 50 74 72 2d 3e 66 69 | 6c 65 4e 61 6d 65 29 3b |oPtr->fi|leName);|
|000022b0| 0d 09 41 70 70 6c 53 70 | 69 6e 43 75 72 73 28 46 |..ApplSp|inCurs(F|
|000022c0| 41 4c 53 45 29 3b 0d 0d | 09 69 6e 66 6f 50 74 72 |ALSE);..|.infoPtr|
|000022d0| 2d 3e 64 69 72 74 79 20 | 3d 20 46 41 4c 53 45 3b |->dirty |= FALSE;|
|000022e0| 0d 09 69 6e 66 6f 50 74 | 72 2d 3e 6e 61 6d 65 64 |..infoPt|r->named|
|000022f0| 20 3d 20 46 41 4c 53 45 | 3b 0d 0d 09 2f 2a 20 53 | = FALSE|;.../* S|
|00002300| 77 69 74 63 68 20 74 6f | 20 74 68 65 20 77 69 6e |witch to| the win|
|00002310| 64 6f 77 20 61 6e 64 20 | 72 65 64 72 61 77 20 69 |dow and |redraw i|
|00002320| 74 0d 09 20 2a 2f 0d 09 | 57 69 6e 64 53 77 69 74 |t.. */..|WindSwit|
|00002330| 63 68 28 74 68 65 57 69 | 6e 64 6f 77 2c 20 54 52 |ch(theWi|ndow, TR|
|00002340| 55 45 29 3b 0d 09 53 65 | 74 50 6f 72 74 28 73 61 |UE);..Se|tPort(sa|
|00002350| 76 65 50 6f 72 74 29 3b | 0d 7d 0d 0d 0d 2f 2a 20 |vePort);|.}.../* |
|00002360| 50 72 6f 6d 70 74 20 66 | 6f 72 20 61 6e 20 65 78 |Prompt f|or an ex|
|00002370| 69 73 74 69 6e 67 20 64 | 6f 63 75 6d 65 6e 74 20 |isting d|ocument |
|00002380| 66 69 6c 65 0d 20 2a 2f | 0d 76 6f 69 64 0d 44 6f |file. */|.void.Do|
|00002390| 63 4f 70 65 6e 20 28 74 | 68 65 57 69 6e 64 6f 77 |cOpen (t|heWindow|
|000023a0| 29 0d 09 72 65 67 69 73 | 74 65 72 20 57 69 6e 64 |)..regis|ter Wind|
|000023b0| 6f 77 50 74 72 20 74 68 | 65 57 69 6e 64 6f 77 3b |owPtr th|eWindow;|
|000023c0| 0d 7b 0d 09 73 74 61 74 | 69 63 20 53 46 54 79 70 |.{..stat|ic SFTyp|
|000023d0| 65 4c 69 73 74 20 6d 79 | 54 79 70 65 73 20 3d 20 |eList my|Types = |
|000023e0| 7b 20 4c 55 43 48 5f 54 | 41 47 20 7d 3b 0d 09 73 |{ LUCH_T|AG };..s|
|000023f0| 74 61 74 69 63 20 50 6f | 69 6e 74 20 53 46 47 77 |tatic Po|int SFGw|
|00002400| 68 65 72 65 20 3d 20 7b | 20 38 30 2c 20 37 32 20 |here = {| 80, 72 |
|00002410| 7d 3b 0d 09 53 46 52 65 | 70 6c 79 20 74 68 65 52 |};..SFRe|ply theR|
|00002420| 65 70 6c 79 3b 0d 09 47 | 72 61 66 50 74 72 20 73 |eply;..G|rafPtr s|
|00002430| 61 76 65 50 6f 72 74 3b | 0d 0d 09 47 65 74 50 6f |avePort;|...GetPo|
|00002440| 72 74 28 26 73 61 76 65 | 50 6f 72 74 29 3b 0d 09 |rt(&save|Port);..|
|00002450| 53 65 74 50 6f 72 74 28 | 74 68 65 57 69 6e 64 6f |SetPort(|theWindo|
|00002460| 77 29 3b 0d 0d 09 2f 2a | 20 53 65 6c 65 63 74 20 |w);.../*| Select |
|00002470| 6f 6e 20 69 6e 70 75 74 | 0d 09 20 2a 2f 0d 09 44 |on input|.. */..D|
|00002480| 6c 6f 67 4f 72 69 67 69 | 6e 28 67 65 74 44 6c 67 |logOrigi|n(getDlg|
|00002490| 49 44 2c 20 26 53 46 47 | 77 68 65 72 65 29 3b 0d |ID, &SFG|where);.|
|000024a0| 09 53 46 50 47 65 74 46 | 69 6c 65 28 53 46 47 77 |.SFPGetF|ile(SFGw|
|000024b0| 68 65 72 65 2c 20 4e 55 | 4c 4c 2c 20 4e 55 4c 4c |here, NU|LL, NULL|
|000024c0| 2c 20 31 2c 20 6d 79 54 | 79 70 65 73 2c 20 4e 55 |, 1, myT|ypes, NU|
|000024d0| 4c 4c 2c 20 26 74 68 65 | 52 65 70 6c 79 2c 20 67 |LL, &the|Reply, g|
|000024e0| 65 74 44 6c 67 49 44 2c | 20 28 50 74 72 29 20 44 |etDlgID,| (Ptr) D|
|000024f0| 6c 6f 67 4d 6f 64 61 6c | 45 76 65 6e 74 29 3b 0d |logModal|Event);.|
|00002500| 09 41 70 70 6c 53 70 69 | 6e 43 75 72 73 28 54 52 |.ApplSpi|nCurs(TR|
|00002510| 55 45 29 3b 0d 0d 09 69 | 66 20 28 74 68 65 52 65 |UE);...i|f (theRe|
|00002520| 70 6c 79 2e 67 6f 6f 64 | 29 0d 09 09 44 6f 63 4f |ply.good|)...DocO|
|00002530| 70 65 6e 46 69 6c 65 28 | 74 68 65 57 69 6e 64 6f |penFile(|theWindo|
|00002540| 77 2c 20 74 68 65 52 65 | 70 6c 79 2e 66 4e 61 6d |w, theRe|ply.fNam|
|00002550| 65 2c 20 74 68 65 52 65 | 70 6c 79 2e 76 52 65 66 |e, theRe|ply.vRef|
|00002560| 4e 75 6d 29 3b 0d 0d 09 | 53 65 74 50 6f 72 74 28 |Num);...|SetPort(|
|00002570| 73 61 76 65 50 6f 72 74 | 29 3b 0d 7d 0d 0d 0d 2f |savePort|);.}.../|
|00002580| 2a 20 43 6c 6f 73 65 20 | 74 68 65 20 64 6f 63 75 |* Close |the docu|
|00002590| 6d 65 6e 74 2c 20 73 61 | 76 69 6e 67 20 69 66 20 |ment, sa|ving if |
|000025a0| 6e 65 65 64 65 64 20 61 | 6e 64 20 74 68 65 20 75 |needed a|nd the u|
|000025b0| 73 65 72 20 61 67 72 65 | 65 73 0d 20 2a 2f 0d 42 |ser agre|es. */.B|
|000025c0| 6f 6f 6c 65 61 6e 0d 44 | 6f 63 43 6c 6f 73 65 20 |oolean.D|ocClose |
|000025d0| 28 74 68 65 57 69 6e 64 | 6f 77 29 0d 09 72 65 67 |(theWind|ow)..reg|
|000025e0| 69 73 74 65 72 20 57 69 | 6e 64 6f 77 50 74 72 20 |ister Wi|ndowPtr |
|000025f0| 74 68 65 57 69 6e 64 6f | 77 3b 0d 7b 0d 09 72 65 |theWindo|w;.{..re|
|00002600| 67 69 73 74 65 72 20 49 | 6e 66 6f 50 74 72 20 69 |gister I|nfoPtr i|
|00002610| 6e 66 6f 50 74 72 20 3d | 20 28 49 6e 66 6f 50 74 |nfoPtr =| (InfoPt|
|00002620| 72 29 20 47 65 74 57 52 | 65 66 43 6f 6e 28 74 68 |r) GetWR|efCon(th|
|00002630| 65 57 69 6e 64 6f 77 29 | 3b 0d 09 72 65 67 69 73 |eWindow)|;..regis|
|00002640| 74 65 72 20 42 6f 6f 6c | 65 61 6e 20 72 65 73 75 |ter Bool|ean resu|
|00002650| 6c 74 20 3d 20 54 52 55 | 45 3b 0d 09 72 65 67 69 |lt = TRU|E;..regi|
|00002660| 73 74 65 72 20 57 4f 52 | 44 20 70 72 6f 6d 70 74 |ster WOR|D prompt|
|00002670| 3b 0d 09 53 74 72 32 35 | 35 20 70 61 72 61 6d 31 |;..Str25|5 param1|
|00002680| 2c 20 70 61 72 61 6d 32 | 3b 0d 0d 09 2f 2a 20 50 |, param2|;.../* P|
|00002690| 72 6f 6d 70 74 20 74 68 | 65 20 75 73 65 72 20 77 |rompt th|e user w|
|000026a0| 68 65 74 68 65 72 20 6f | 72 20 6e 6f 74 20 74 6f |hether o|r not to|
|000026b0| 20 73 61 76 65 20 62 65 | 66 6f 72 65 20 63 6c 6f | save be|fore clo|
|000026c0| 73 69 6e 67 0d 09 20 2a | 2f 0d 09 69 66 20 28 69 |sing.. *|/..if (i|
|000026d0| 6e 66 6f 50 74 72 2d 3e | 64 69 72 74 79 29 20 7b |nfoPtr->|dirty) {|
|000026e0| 0d 09 09 47 65 74 49 6e | 64 53 74 72 69 6e 67 28 |...GetIn|dString(|
|000026f0| 70 61 72 61 6d 31 2c 20 | 52 53 52 43 42 41 53 45 |param1, |RSRCBASE|
|00002700| 2c 20 73 74 72 44 6f 63 | 4d 6f 64 29 3b 0d 09 09 |, strDoc|Mod);...|
|00002710| 47 65 74 49 6e 64 53 74 | 72 69 6e 67 28 70 61 72 |GetIndSt|ring(par|
|00002720| 61 6d 32 2c 20 52 53 52 | 43 42 41 53 45 2c 20 73 |am2, RSR|CBASE, s|
|00002730| 74 72 44 6f 63 53 61 76 | 65 29 3b 0d 09 09 0d 09 |trDocSav|e);.....|
|00002740| 09 70 72 6f 6d 70 74 20 | 3d 20 45 72 72 57 61 72 |.prompt |= ErrWar|
|00002750| 6e 69 6e 67 28 77 61 72 | 6e 43 61 6e 63 65 6c 2c |ning(war|nCancel,|
|00002760| 20 46 41 4c 53 45 2c 20 | 69 6e 66 6f 50 74 72 2d | FALSE, |infoPtr-|
|00002770| 3e 66 69 6c 65 4e 61 6d | 65 2c 20 70 61 72 61 6d |>fileNam|e, param|
|00002780| 31 2c 20 70 61 72 61 6d | 32 2c 20 4e 75 6c 6c 53 |1, param|2, NullS|
|00002790| 74 72 29 3b 0d 09 09 0d | 09 09 69 66 20 28 70 72 |tr);....|..if (pr|
|000027a0| 6f 6d 70 74 20 3d 3d 20 | 77 61 72 6e 59 65 73 29 |ompt == |warnYes)|
|000027b0| 0d 09 09 09 72 65 73 75 | 6c 74 20 3d 20 44 6f 63 |....resu|lt = Doc|
|000027c0| 53 61 76 65 28 74 68 65 | 57 69 6e 64 6f 77 29 3b |Save(the|Window);|
|000027d0| 0d 09 09 65 6c 73 65 20 | 69 66 20 28 70 72 6f 6d |...else |if (prom|
|000027e0| 70 74 20 3d 3d 20 77 61 | 72 6e 43 61 6e 63 65 6c |pt == wa|rnCancel|
|000027f0| 29 0d 09 09 09 72 65 73 | 75 6c 74 20 3d 20 46 41 |)....res|ult = FA|
|00002800| 4c 53 45 3b 0d 09 7d 0d | 0d 09 2f 2a 20 42 61 63 |LSE;..}.|../* Bac|
|00002810| 6b 20 74 6f 20 74 68 65 | 20 62 75 73 69 6e 65 73 |k to the| busines|
|00002820| 73 20 6f 66 20 63 6c 6f | 73 69 6e 67 20 73 68 6f |s of clo|sing sho|
|00002830| 70 0d 09 20 2a 2f 0d 09 | 69 66 20 28 72 65 73 75 |p.. */..|if (resu|
|00002840| 6c 74 29 20 7b 0d 09 09 | 47 6e 6f 73 43 6c 6f 73 |lt) {...|GnosClos|
|00002850| 65 28 29 3b 0d 09 09 0d | 09 09 69 6e 66 6f 50 74 |e();....|..infoPt|
|00002860| 72 2d 3e 64 69 72 74 79 | 20 3d 20 46 41 4c 53 45 |r->dirty| = FALSE|
|00002870| 3b 0d 09 09 69 6e 66 6f | 50 74 72 2d 3e 6e 61 6d |;...info|Ptr->nam|
|00002880| 65 64 20 3d 20 46 41 4c | 53 45 3b 0d 09 7d 0d 09 |ed = FAL|SE;..}..|
|00002890| 0d 09 72 65 74 75 72 6e | 20 72 65 73 75 6c 74 3b |..return| result;|
|000028a0| 0d 7d 0d 0d 0d 2f 2a 20 | 53 61 76 65 20 74 68 65 |.}.../* |Save the|
|000028b0| 20 64 6f 63 75 6d 65 6e | 74 20 74 6f 20 64 69 73 | documen|t to dis|
|000028c0| 6b 3b 20 72 65 74 75 72 | 6e 20 46 41 4c 53 45 20 |k; retur|n FALSE |
|000028d0| 69 73 20 74 68 65 20 75 | 73 65 72 20 64 65 63 69 |is the u|ser deci|
|000028e0| 64 65 73 20 74 6f 20 63 | 61 6e 63 65 6c 2e 2e 2e |des to c|ancel...|
|000028f0| 0d 20 2a 2f 0d 42 6f 6f | 6c 65 61 6e 20 0d 44 6f |. */.Boo|lean .Do|
|00002900| 63 53 61 76 65 20 28 74 | 68 65 57 69 6e 64 6f 77 |cSave (t|heWindow|
|00002910| 29 0d 09 72 65 67 69 73 | 74 65 72 20 57 69 6e 64 |)..regis|ter Wind|
|00002920| 6f 77 50 74 72 20 74 68 | 65 57 69 6e 64 6f 77 3b |owPtr th|eWindow;|
|00002930| 0d 7b 0d 09 72 65 67 69 | 73 74 65 72 20 49 6e 66 |.{..regi|ster Inf|
|00002940| 6f 50 74 72 20 69 6e 66 | 6f 50 74 72 20 3d 20 28 |oPtr inf|oPtr = (|
|00002950| 49 6e 66 6f 50 74 72 29 | 20 47 65 74 57 52 65 66 |InfoPtr)| GetWRef|
|00002960| 43 6f 6e 28 74 68 65 57 | 69 6e 64 6f 77 29 3b 0d |Con(theW|indow);.|
|00002970| 09 72 65 67 69 73 74 65 | 72 20 42 6f 6f 6c 65 61 |.registe|r Boolea|
|00002980| 6e 20 72 65 73 75 6c 74 | 3b 0d 0d 09 2f 2a 20 47 |n result|;.../* G|
|00002990| 69 76 65 20 74 68 65 20 | 75 73 65 72 20 61 20 63 |ive the |user a c|
|000029a0| 68 61 6e 63 65 20 74 6f | 20 6e 61 6d 65 20 6f 72 |hance to| name or|
|000029b0| 20 63 61 6e 63 65 6c 20 | 61 6e 20 75 6e 6e 61 6d | cancel |an unnam|
|000029c0| 65 64 20 62 75 66 66 65 | 72 0d 09 20 2a 2f 0d 09 |ed buffe|r.. */..|
|000029d0| 69 66 20 28 21 69 6e 66 | 6f 50 74 72 2d 3e 6e 61 |if (!inf|oPtr->na|
|000029e0| 6d 65 64 29 0d 09 09 72 | 65 73 75 6c 74 20 3d 20 |med)...r|esult = |
|000029f0| 44 6f 63 53 61 76 65 41 | 73 28 74 68 65 57 69 6e |DocSaveA|s(theWin|
|00002a00| 64 6f 77 29 3b 0d 09 65 | 6c 73 65 20 0d 09 09 72 |dow);..e|lse ...r|
|00002a10| 65 73 75 6c 74 20 3d 20 | 44 6f 63 53 61 76 65 46 |esult = |DocSaveF|
|00002a20| 69 6c 65 28 74 68 65 57 | 69 6e 64 6f 77 2c 20 69 |ile(theW|indow, i|
|00002a30| 6e 66 6f 50 74 72 2d 3e | 66 69 6c 65 4e 61 6d 65 |nfoPtr->|fileName|
|00002a40| 2c 20 69 6e 66 6f 50 74 | 72 2d 3e 76 52 65 66 4e |, infoPt|r->vRefN|
|00002a50| 75 6d 29 3b 0d 0d 09 72 | 65 74 75 72 6e 20 72 65 |um);...r|eturn re|
|00002a60| 73 75 6c 74 3b 0d 7d 0d | 0d 0d 2f 2a 20 53 61 76 |sult;.}.|../* Sav|
|00002a70| 65 20 74 68 65 20 64 6f | 63 75 6d 65 6e 74 20 69 |e the do|cument i|
|00002a80| 6e 74 6f 20 61 20 66 69 | 6c 65 3b 20 72 65 74 75 |nto a fi|le; retu|
|00002a90| 72 6e 20 46 41 4c 53 45 | 20 69 66 20 63 61 6e 63 |rn FALSE| if canc|
|00002aa0| 65 6c 6c 65 64 0d 20 2a | 2f 0d 42 6f 6f 6c 65 61 |elled. *|/.Boolea|
|00002ab0| 6e 20 0d 44 6f 63 53 61 | 76 65 41 73 20 28 74 68 |n .DocSa|veAs (th|
|00002ac0| 65 57 69 6e 64 6f 77 29 | 0d 09 72 65 67 69 73 74 |eWindow)|..regist|
|00002ad0| 65 72 20 57 69 6e 64 6f | 77 50 74 72 20 74 68 65 |er Windo|wPtr the|
|00002ae0| 57 69 6e 64 6f 77 3b 0d | 7b 0d 09 72 65 67 69 73 |Window;.|{..regis|
|00002af0| 74 65 72 20 49 6e 66 6f | 50 74 72 20 69 6e 66 6f |ter Info|Ptr info|
|00002b00| 50 74 72 20 3d 20 28 49 | 6e 66 6f 50 74 72 29 20 |Ptr = (I|nfoPtr) |
|00002b10| 47 65 74 57 52 65 66 43 | 6f 6e 28 74 68 65 57 69 |GetWRefC|on(theWi|
|00002b20| 6e 64 6f 77 29 3b 0d 09 | 72 65 67 69 73 74 65 72 |ndow);..|register|
|00002b30| 20 42 6f 6f 6c 65 61 6e | 20 72 65 73 75 6c 74 20 | Boolean| result |
|00002b40| 3d 20 46 41 4c 53 45 3b | 0d 09 73 74 61 74 69 63 |= FALSE;|..static|
|00002b50| 20 50 6f 69 6e 74 20 53 | 46 50 77 68 65 72 65 20 | Point S|FPwhere |
|00002b60| 3d 20 7b 20 38 30 2c 20 | 37 32 20 7d 3b 0d 09 53 |= { 80, |72 };..S|
|00002b70| 46 52 65 70 6c 79 20 74 | 68 65 52 65 70 6c 79 3b |FReply t|heReply;|
|00002b80| 0d 09 53 74 72 32 35 35 | 20 70 61 72 61 6d 31 3b |..Str255| param1;|
|00002b90| 0d 0d 09 2f 2a 20 50 72 | 6f 6d 70 74 20 66 6f 72 |.../* Pr|ompt for|
|00002ba0| 20 74 68 65 20 6e 65 77 | 20 66 69 6c 65 20 6e 61 | the new| file na|
|00002bb0| 6d 65 2e 2e 2e 20 20 49 | 66 20 63 61 6e 63 65 6c |me... I|f cancel|
|00002bc0| 6c 65 64 2c 20 64 6f 6e | 27 74 20 63 68 61 6e 67 |led, don|'t chang|
|00002bd0| 65 20 61 6e 79 74 68 69 | 6e 67 0d 09 20 2a 2f 0d |e anythi|ng.. */.|
|00002be0| 09 44 6c 6f 67 4f 72 69 | 67 69 6e 28 70 75 74 44 |.DlogOri|gin(putD|
|00002bf0| 6c 67 49 44 2c 20 26 53 | 46 50 77 68 65 72 65 29 |lgID, &S|FPwhere)|
|00002c00| 3b 0d 09 47 65 74 49 6e | 64 53 74 72 69 6e 67 28 |;..GetIn|dString(|
|00002c10| 70 61 72 61 6d 31 2c 20 | 52 53 52 43 42 41 53 45 |param1, |RSRCBASE|
|00002c20| 2c 20 73 74 72 53 61 76 | 65 41 73 29 3b 0d 09 53 |, strSav|eAs);..S|
|00002c30| 46 50 50 75 74 46 69 6c | 65 28 53 46 50 77 68 65 |FPPutFil|e(SFPwhe|
|00002c40| 72 65 2c 20 70 61 72 61 | 6d 31 2c 20 69 6e 66 6f |re, para|m1, info|
|00002c50| 50 74 72 2d 3e 66 69 6c | 65 4e 61 6d 65 2c 20 4e |Ptr->fil|eName, N|
|00002c60| 55 4c 4c 2c 20 26 74 68 | 65 52 65 70 6c 79 2c 20 |ULL, &th|eReply, |
|00002c70| 70 75 74 44 6c 67 49 44 | 2c 20 28 50 74 72 29 20 |putDlgID|, (Ptr) |
|00002c80| 44 6c 6f 67 4d 6f 64 61 | 6c 45 76 65 6e 74 29 3b |DlogModa|lEvent);|
|00002c90| 0d 09 41 70 70 6c 53 70 | 69 6e 43 75 72 73 28 54 |..ApplSp|inCurs(T|
|00002ca0| 52 55 45 29 3b 0d 09 0d | 09 69 66 20 28 74 68 65 |RUE);...|.if (the|
|00002cb0| 52 65 70 6c 79 2e 67 6f | 6f 64 20 26 26 20 44 6f |Reply.go|od && Do|
|00002cc0| 63 53 61 76 65 46 69 6c | 65 28 74 68 65 57 69 6e |cSaveFil|e(theWin|
|00002cd0| 64 6f 77 2c 20 74 68 65 | 52 65 70 6c 79 2e 66 4e |dow, the|Reply.fN|
|00002ce0| 61 6d 65 2c 20 74 68 65 | 52 65 70 6c 79 2e 76 52 |ame, the|Reply.vR|
|00002cf0| 65 66 4e 75 6d 29 29 0d | 09 09 72 65 73 75 6c 74 |efNum)).|..result|
|00002d00| 20 3d 20 54 52 55 45 3b | 0d 0d 09 72 65 74 75 72 | = TRUE;|...retur|
|00002d10| 6e 20 72 65 73 75 6c 74 | 3b 0d 7d 0d 0d 0d 2f 2a |n result|;.}.../*|
|00002d20| 20 52 65 6c 6f 61 64 20 | 61 20 70 72 65 76 69 6f | Reload |a previo|
|00002d30| 75 73 20 76 65 72 73 69 | 6f 6e 20 6f 66 20 74 68 |us versi|on of th|
|00002d40| 65 20 66 69 6c 65 0d 20 | 2a 2f 0d 76 6f 69 64 0d |e file. |*/.void.|
|00002d50| 44 6f 63 52 65 76 65 72 | 74 20 28 74 68 65 57 69 |DocRever|t (theWi|
|00002d60| 6e 64 6f 77 29 0d 09 72 | 65 67 69 73 74 65 72 20 |ndow)..r|egister |
|00002d70| 57 69 6e 64 6f 77 50 74 | 72 20 74 68 65 57 69 6e |WindowPt|r theWin|
|00002d80| 64 6f 77 3b 0d 7b 0d 09 | 72 65 67 69 73 74 65 72 |dow;.{..|register|
|00002d90| 20 49 6e 66 6f 50 74 72 | 20 69 6e 66 6f 50 74 72 | InfoPtr| infoPtr|
|00002da0| 20 3d 20 28 49 6e 66 6f | 50 74 72 29 20 47 65 74 | = (Info|Ptr) Get|
|00002db0| 57 52 65 66 43 6f 6e 28 | 74 68 65 57 69 6e 64 6f |WRefCon(|theWindo|
|00002dc0| 77 29 3b 0d 09 72 65 67 | 69 73 74 65 72 20 57 4f |w);..reg|ister WO|
|00002dd0| 52 44 20 70 72 6f 6d 70 | 74 3b 0d 09 53 74 72 32 |RD promp|t;..Str2|
|00002de0| 35 35 20 70 61 72 61 6d | 31 2c 20 70 61 72 61 6d |55 param|1, param|
|00002df0| 32 3b 0d 0d 09 2f 2a 20 | 50 72 6f 6d 70 74 20 66 |2;.../* |Prompt f|
|00002e00| 6f 72 20 72 65 76 65 72 | 74 69 6e 67 0d 09 20 2a |or rever|ting.. *|
|00002e10| 2f 0d 09 47 65 74 49 6e | 64 53 74 72 69 6e 67 28 |/..GetIn|dString(|
|00002e20| 70 61 72 61 6d 31 2c 20 | 52 53 52 43 42 41 53 45 |param1, |RSRCBASE|
|00002e30| 2c 20 73 74 72 52 65 76 | 65 72 74 29 3b 0d 09 47 |, strRev|ert);..G|
|00002e40| 65 74 49 6e 64 53 74 72 | 69 6e 67 28 70 61 72 61 |etIndStr|ing(para|
|00002e50| 6d 32 2c 20 52 53 52 43 | 42 41 53 45 2c 20 73 74 |m2, RSRC|BASE, st|
|00002e60| 72 51 75 65 73 74 69 6f | 6e 29 3b 0d 09 70 72 6f |rQuestio|n);..pro|
|00002e70| 6d 70 74 20 3d 20 45 72 | 72 57 61 72 6e 69 6e 67 |mpt = Er|rWarning|
|00002e80| 28 77 61 72 6e 4e 6f 2c | 20 46 41 4c 53 45 2c 20 |(warnNo,| FALSE, |
|00002e90| 70 61 72 61 6d 31 2c 20 | 69 6e 66 6f 50 74 72 2d |param1, |infoPtr-|
|00002ea0| 3e 66 69 6c 65 4e 61 6d | 65 2c 20 70 61 72 61 6d |>fileNam|e, param|
|00002eb0| 32 2c 20 4e 75 6c 6c 53 | 74 72 29 3b 0d 0d 09 2f |2, NullS|tr);.../|
|00002ec0| 2a 20 52 65 61 64 20 69 | 6e 20 74 68 65 20 64 6f |* Read i|n the do|
|00002ed0| 63 75 6d 65 6e 74 20 61 | 67 61 69 6e 20 69 66 20 |cument a|gain if |
|00002ee0| 74 68 65 20 75 73 65 72 | 20 73 6f 20 77 69 73 68 |the user| so wish|
|00002ef0| 65 73 0d 09 20 2a 2f 0d | 09 69 66 20 28 70 72 6f |es.. */.|.if (pro|
|00002f00| 6d 70 74 20 3d 3d 20 77 | 61 72 6e 59 65 73 29 20 |mpt == w|arnYes) |
|00002f10| 7b 0d 09 09 41 70 70 6c | 53 70 69 6e 43 75 72 73 |{...Appl|SpinCurs|
|00002f20| 28 54 52 55 45 29 3b 0d | 09 09 69 6e 66 6f 50 74 |(TRUE);.|..infoPt|
|00002f30| 72 2d 3e 64 69 72 74 79 | 20 3d 20 46 41 4c 53 45 |r->dirty| = FALSE|
|00002f40| 3b 0d 0d 09 09 69 66 20 | 28 44 6f 63 43 6c 6f 73 |;....if |(DocClos|
|00002f50| 65 28 74 68 65 57 69 6e | 64 6f 77 29 29 0d 09 09 |e(theWin|dow))...|
|00002f60| 09 44 6f 63 4f 70 65 6e | 46 69 6c 65 28 74 68 65 |.DocOpen|File(the|
|00002f70| 57 69 6e 64 6f 77 2c 20 | 69 6e 66 6f 50 74 72 2d |Window, |infoPtr-|
|00002f80| 3e 66 69 6c 65 4e 61 6d | 65 2c 20 69 6e 66 6f 50 |>fileNam|e, infoP|
|00002f90| 74 72 2d 3e 76 52 65 66 | 4e 75 6d 29 3b 0d 09 09 |tr->vRef|Num);...|
|00002fa0| 65 6c 73 65 0d 09 09 09 | 69 6e 66 6f 50 74 72 2d |else....|infoPtr-|
|00002fb0| 3e 64 69 72 74 79 20 3d | 20 54 52 55 45 3b 0d 09 |>dirty =| TRUE;..|
|00002fc0| 7d 0d 7d 0d 0d 0d 2f 2a | 20 45 78 65 63 75 74 65 |}.}.../*| Execute|
|00002fd0| 20 66 69 6c 65 20 6d 65 | 6e 75 20 73 65 6c 65 63 | file me|nu selec|
|00002fe0| 74 69 6f 6e 0d 20 2a 2f | 0d 76 6f 69 64 0d 44 6f |tion. */|.void.Do|
|00002ff0| 63 4d 65 6e 75 20 28 74 | 68 65 49 74 65 6d 29 0d |cMenu (t|heItem).|
|00003000| 09 72 65 67 69 73 74 65 | 72 20 57 4f 52 44 20 74 |.registe|r WORD t|
|00003010| 68 65 49 74 65 6d 3b 0d | 7b 0d 09 73 77 69 74 63 |heItem;.|{..switc|
|00003020| 68 20 28 74 68 65 49 74 | 65 6d 29 20 7b 0d 09 63 |h (theIt|em) {..c|
|00003030| 61 73 65 20 66 6d 4e 65 | 77 3a 20 0d 09 09 44 6f |ase fmNe|w: ...Do|
|00003040| 63 4e 65 77 28 77 50 74 | 72 47 6e 6f 73 29 3b 0d |cNew(wPt|rGnos);.|
|00003050| 09 09 62 72 65 61 6b 3b | 0d 0d 09 63 61 73 65 20 |..break;|...case |
|00003060| 66 6d 4f 70 65 6e 3a 0d | 09 09 44 6f 63 4f 70 65 |fmOpen:.|..DocOpe|
|00003070| 6e 28 77 50 74 72 47 6e | 6f 73 29 3b 0d 09 09 62 |n(wPtrGn|os);...b|
|00003080| 72 65 61 6b 3b 0d 0d 09 | 63 61 73 65 20 66 6d 43 |reak;...|case fmC|
|00003090| 6c 6f 73 65 3a 0d 09 09 | 44 6f 63 43 6c 6f 73 65 |lose:...|DocClose|
|000030a0| 28 77 50 74 72 47 6e 6f | 73 29 3b 0d 09 09 62 72 |(wPtrGno|s);...br|
|000030b0| 65 61 6b 3b 0d 09 0d 09 | 63 61 73 65 20 66 6d 53 |eak;....|case fmS|
|000030c0| 61 76 65 3a 0d 09 09 44 | 6f 63 53 61 76 65 28 77 |ave:...D|ocSave(w|
|000030d0| 50 74 72 47 6e 6f 73 29 | 3b 0d 09 09 62 72 65 61 |PtrGnos)|;...brea|
|000030e0| 6b 3b 0d 0d 09 63 61 73 | 65 20 66 6d 53 61 76 65 |k;...cas|e fmSave|
|000030f0| 41 73 3a 0d 09 09 44 6f | 63 53 61 76 65 41 73 28 |As:...Do|cSaveAs(|
|00003100| 77 50 74 72 47 6e 6f 73 | 29 3b 0d 09 09 62 72 65 |wPtrGnos|);...bre|
|00003110| 61 6b 3b 0d 0d 09 63 61 | 73 65 20 66 6d 52 65 76 |ak;...ca|se fmRev|
|00003120| 65 72 74 3a 0d 09 09 44 | 6f 63 52 65 76 65 72 74 |ert:...D|ocRevert|
|00003130| 28 77 50 74 72 47 6e 6f | 73 29 3b 0d 09 09 62 72 |(wPtrGno|s);...br|
|00003140| 65 61 6b 3b 0d 09 09 0d | 09 63 61 73 65 20 66 6d |eak;....|.case fm|
|00003150| 53 65 74 55 70 3a 0d 09 | 09 50 72 69 6e 74 44 6f |SetUp:..|.PrintDo|
|00003160| 63 75 6d 65 6e 74 28 4e | 55 4c 4c 29 3b 0d 09 09 |cument(N|ULL);...|
|00003170| 55 6e 6c 6f 61 64 53 65 | 67 28 28 50 74 72 29 20 |UnloadSe|g((Ptr) |
|00003180| 50 72 69 6e 74 44 6f 63 | 75 6d 65 6e 74 29 3b 0d |PrintDoc|ument);.|
|00003190| 09 09 62 72 65 61 6b 3b | 0d 0d 09 63 61 73 65 20 |..break;|...case |
|000031a0| 66 6d 50 72 69 6e 74 3a | 0d 09 09 50 72 69 6e 74 |fmPrint:|...Print|
|000031b0| 44 6f 63 75 6d 65 6e 74 | 28 77 50 74 72 47 6e 6f |Document|(wPtrGno|
|000031c0| 73 29 3b 0d 09 09 55 6e | 6c 6f 61 64 53 65 67 28 |s);...Un|loadSeg(|
|000031d0| 28 50 74 72 29 20 50 72 | 69 6e 74 44 6f 63 75 6d |(Ptr) Pr|intDocum|
|000031e0| 65 6e 74 29 3b 0d 09 09 | 62 72 65 61 6b 3b 0d 0d |ent);...|break;..|
|000031f0| 09 63 61 73 65 20 66 6d | 51 75 69 74 3a 0d 09 09 |.case fm|Quit:...|
|00003200| 41 70 70 6c 51 75 69 74 | 28 29 3b 0d 09 09 62 72 |ApplQuit|();...br|
|00003210| 65 61 6b 3b 0d 0d 09 64 | 65 66 61 75 6c 74 3a 0d |eak;...d|efault:.|
|00003220| 09 09 62 72 65 61 6b 3b | 0d 09 7d 0d 7d 0d 00 00 |..break;|..}.}...|
|00003230| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003260| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003270| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+