home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 11 / AMUG BBS in a Box Volume XI (April 1994) (MacWizards).iso / Files / System7 tools / Frontier / Frontier SDK 2.1.sit / Frontier SDK 2.1 / Toolkits / Applet Toolkit / appletmemory.c < prev    next >
MacBinary  |  1992-10-11  |  8.0 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: appletmemory.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, Sun Oct 11 14:30:00 1992, modified Sun Oct 11 14:30:00 1992, creator Think C, type ASCII, 7568 bytes "appletmemory.c" , at 0x1e10 340 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 0e 61 70 70 6c 65 74 | 6d 65 6d 6f 72 79 2e 63 |..applet|memory.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 1d 90 00 | 00 01 54 a6 fe 23 28 a6 |........|..T..#(.|
|00000060| fe 23 28 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.#(.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 be b8 00 00 |........|........|
|00000080| 0d 2f 2a a9 20 43 6f 70 | 79 72 69 67 68 74 20 31 |./*. Cop|yright 1|
|00000090| 39 38 38 2d 31 39 39 32 | 20 55 73 65 72 4c 61 6e |988-1992| UserLan|
|000000a0| 64 20 53 6f 66 74 77 61 | 72 65 2c 20 49 6e 63 2e |d Softwa|re, Inc.|
|000000b0| 20 20 41 6c 6c 20 52 69 | 67 68 74 73 20 52 65 73 | All Ri|ghts Res|
|000000c0| 65 72 76 65 64 2e 2a 2f | 0d 0d 0d 23 69 6e 63 6c |erved.*/|...#incl|
|000000d0| 75 64 65 20 22 61 70 70 | 6c 65 74 73 74 72 69 6e |ude "app|letstrin|
|000000e0| 67 73 2e 68 22 0d 23 69 | 6e 63 6c 75 64 65 20 22 |gs.h".#i|nclude "|
|000000f0| 61 70 70 6c 65 74 6d 65 | 6d 6f 72 79 2e 68 22 0d |appletme|mory.h".|
|00000100| 0d 0d 76 6f 69 64 20 6d | 6f 76 65 6c 65 66 74 20 |..void m|oveleft |
|00000110| 28 70 73 6f 75 72 63 65 | 2c 20 70 64 65 73 74 2c |(psource|, pdest,|
|00000120| 20 6c 65 6e 67 74 68 29 | 20 76 6f 69 64 20 2a 70 | length)| void *p|
|00000130| 73 6f 75 72 63 65 2c 20 | 2a 70 64 65 73 74 3b 20 |source, |*pdest; |
|00000140| 6c 6f 6e 67 20 6c 65 6e | 67 74 68 3b 20 7b 0d 09 |long len|gth; {..|
|00000150| 0d 09 2f 2a 0d 09 64 6f | 20 61 20 6d 61 73 73 20 |../*..do| a mass |
|00000160| 6d 65 6d 6f 72 79 20 6d | 6f 76 65 20 77 69 74 68 |memory m|ove with|
|00000170| 20 74 68 65 20 6c 65 66 | 74 20 65 64 67 65 20 6c | the lef|t edge l|
|00000180| 65 61 64 69 6e 67 2e 20 | 20 67 6f 6f 64 20 66 6f |eading. | good fo|
|00000190| 72 20 63 6c 6f 73 69 6e | 67 0d 09 75 70 20 61 20 |r closin|g..up a |
|000001a0| 67 61 70 20 69 6e 20 61 | 20 62 75 66 66 65 72 2c |gap in a| buffer,|
|000001b0| 20 61 6d 6f 6e 67 20 6f | 74 68 65 72 20 74 68 69 | among o|ther thi|
|000001c0| 6e 67 73 c9 0d 09 2a 2f | 0d 09 0d 09 72 65 67 69 |ngs...*/|....regi|
|000001d0| 73 74 65 72 20 63 68 61 | 72 20 2a 70 73 2c 20 2a |ster cha|r *ps, *|
|000001e0| 70 64 3b 0d 09 72 65 67 | 69 73 74 65 72 20 6c 6f |pd;..reg|ister lo|
|000001f0| 6e 67 20 63 74 6c 6f 6f | 70 73 3b 0d 09 0d 09 63 |ng ctloo|ps;....c|
|00000200| 74 6c 6f 6f 70 73 20 3d | 20 6c 65 6e 67 74 68 3b |tloops =| length;|
|00000210| 0d 09 0d 09 69 66 20 28 | 63 74 6c 6f 6f 70 73 20 |....if (|ctloops |
|00000220| 3e 20 30 29 20 7b 0d 09 | 0d 09 09 70 73 20 3d 20 |> 0) {..|...ps = |
|00000230| 70 73 6f 75 72 63 65 3b | 20 2f 2a 63 6f 70 79 20 |psource;| /*copy |
|00000240| 69 6e 74 6f 20 61 20 72 | 65 67 69 73 74 65 72 2a |into a r|egister*|
|00000250| 2f 0d 09 0d 09 09 70 64 | 20 3d 20 70 64 65 73 74 |/.....pd| = pdest|
|00000260| 3b 20 2f 2a 63 6f 70 79 | 20 69 6e 74 6f 20 61 20 |; /*copy| into a |
|00000270| 72 65 67 69 73 74 65 72 | 2a 2f 0d 09 0d 09 09 77 |register|*/.....w|
|00000280| 68 69 6c 65 20 28 63 74 | 6c 6f 6f 70 73 2d 2d 29 |hile (ct|loops--)|
|00000290| 20 2a 70 64 2b 2b 20 3d | 20 2a 70 73 2b 2b 3b 0d | *pd++ =| *ps++;.|
|000002a0| 09 09 7d 0d 09 7d 20 2f | 2a 6d 6f 76 65 6c 65 66 |..}..} /|*movelef|
|000002b0| 74 2a 2f 0d 09 0d 09 0d | 76 6f 69 64 20 6d 6f 76 |t*/.....|void mov|
|000002c0| 65 72 69 67 68 74 20 28 | 70 73 6f 75 72 63 65 2c |eright (|psource,|
|000002d0| 20 70 64 65 73 74 2c 20 | 6c 65 6e 67 74 68 29 20 | pdest, |length) |
|000002e0| 76 6f 69 64 20 2a 70 73 | 6f 75 72 63 65 2c 20 2a |void *ps|ource, *|
|000002f0| 70 64 65 73 74 3b 20 6c | 6f 6e 67 20 6c 65 6e 67 |pdest; l|ong leng|
|00000300| 74 68 3b 20 7b 0d 09 0d | 09 2f 2a 0d 09 64 6f 20 |th; {...|./*..do |
|00000310| 61 20 6d 61 73 73 20 6d | 65 6d 6f 72 79 20 6d 6f |a mass m|emory mo|
|00000320| 76 65 20 77 69 74 68 20 | 74 68 65 20 72 69 67 68 |ve with |the righ|
|00000330| 74 20 65 64 67 65 20 6c | 65 61 64 69 6e 67 2e 20 |t edge l|eading. |
|00000340| 20 67 6f 6f 64 20 66 6f | 72 20 6f 70 65 6e 69 6e | good fo|r openin|
|00000350| 67 0d 09 75 70 20 61 20 | 67 61 70 20 69 6e 20 61 |g..up a |gap in a|
|00000360| 20 62 75 66 66 65 72 2c | 20 61 6d 6f 6e 67 20 6f | buffer,| among o|
|00000370| 74 68 65 72 20 74 68 69 | 6e 67 73 c9 0d 09 2a 2f |ther thi|ngs...*/|
|00000380| 0d 09 0d 09 72 65 67 69 | 73 74 65 72 20 63 68 61 |....regi|ster cha|
|00000390| 72 20 2a 70 73 2c 20 2a | 70 64 3b 0d 09 72 65 67 |r *ps, *|pd;..reg|
|000003a0| 69 73 74 65 72 20 6c 6f | 6e 67 20 63 74 6c 6f 6f |ister lo|ng ctloo|
|000003b0| 70 73 3b 0d 09 0d 09 63 | 74 6c 6f 6f 70 73 20 3d |ps;....c|tloops =|
|000003c0| 20 6c 65 6e 67 74 68 3b | 0d 09 0d 09 69 66 20 28 | length;|....if (|
|000003d0| 63 74 6c 6f 6f 70 73 20 | 3e 20 30 29 20 7b 0d 09 |ctloops |> 0) {..|
|000003e0| 0d 09 09 70 73 20 3d 20 | 28 63 68 61 72 20 2a 29 |...ps = |(char *)|
|000003f0| 20 70 73 6f 75 72 63 65 | 20 2b 20 6c 65 6e 67 74 | psource| + lengt|
|00000400| 68 20 2d 20 31 3b 20 2f | 2a 72 69 67 68 74 20 65 |h - 1; /|*right e|
|00000410| 64 67 65 20 6f 66 20 73 | 6f 75 72 63 65 2a 2f 0d |dge of s|ource*/.|
|00000420| 09 0d 09 09 70 64 20 3d | 20 28 63 68 61 72 20 2a |....pd =| (char *|
|00000430| 29 20 70 64 65 73 74 20 | 2b 20 6c 65 6e 67 74 68 |) pdest |+ length|
|00000440| 20 2d 20 31 3b 20 2f 2a | 72 69 67 68 74 20 65 64 | - 1; /*|right ed|
|00000450| 67 65 20 6f 66 20 64 65 | 73 74 69 6e 61 74 69 6f |ge of de|stinatio|
|00000460| 6e 2a 2f 0d 09 0d 09 09 | 77 68 69 6c 65 20 28 63 |n*/.....|while (c|
|00000470| 74 6c 6f 6f 70 73 2d 2d | 29 20 2a 70 64 2d 2d 20 |tloops--|) *pd-- |
|00000480| 3d 20 2a 70 73 2d 2d 3b | 0d 09 09 7d 0d 09 7d 20 |= *ps--;|...}..} |
|00000490| 2f 2a 6d 6f 76 65 72 69 | 67 68 74 2a 2f 0d 09 0d |/*moveri|ght*/...|
|000004a0| 09 0d 76 6f 69 64 20 66 | 69 6c 6c 63 68 61 72 20 |..void f|illchar |
|000004b0| 28 70 66 69 6c 6c 2c 20 | 63 74 66 69 6c 6c 2c 20 |(pfill, |ctfill, |
|000004c0| 63 68 66 69 6c 6c 29 20 | 76 6f 69 64 20 2a 70 66 |chfill) |void *pf|
|000004d0| 69 6c 6c 3b 20 6c 6f 6e | 67 20 63 74 66 69 6c 6c |ill; lon|g ctfill|
|000004e0| 3b 20 63 68 61 72 20 63 | 68 66 69 6c 6c 3b 20 7b |; char c|hfill; {|
|000004f0| 0d 09 0d 09 2f 2a 0d 09 | 64 6f 20 61 20 6d 61 73 |..../*..|do a mas|
|00000500| 73 20 6d 65 6d 6f 72 79 | 20 66 69 6c 6c 20 2d 2d |s memory| fill --|
|00000510| 20 63 6f 70 79 20 63 74 | 66 69 6c 6c 20 63 68 66 | copy ct|fill chf|
|00000520| 69 6c 6c 73 20 61 74 20 | 70 66 69 6c 6c 2e 0d 09 |ills at |pfill...|
|00000530| 2a 2f 0d 09 0d 09 72 65 | 67 69 73 74 65 72 20 63 |*/....re|gister c|
|00000540| 68 61 72 20 2a 70 20 3d | 20 70 66 69 6c 6c 3b 0d |har *p =| pfill;.|
|00000550| 09 72 65 67 69 73 74 65 | 72 20 6c 6f 6e 67 20 63 |.registe|r long c|
|00000560| 74 20 3d 20 63 74 66 69 | 6c 6c 3b 0d 09 72 65 67 |t = ctfi|ll;..reg|
|00000570| 69 73 74 65 72 20 63 68 | 61 72 20 63 68 20 3d 20 |ister ch|ar ch = |
|00000580| 63 68 66 69 6c 6c 3b 0d | 09 0d 09 77 68 69 6c 65 |chfill;.|...while|
|00000590| 20 28 63 74 2d 2d 29 20 | 2a 70 2b 2b 20 3d 20 28 | (ct--) |*p++ = (|
|000005a0| 63 68 61 72 29 20 63 68 | 3b 20 2f 2a 74 69 67 68 |char) ch|; /*tigh|
|000005b0| 74 20 6c 6f 6f 70 2a 2f | 0d 09 7d 20 2f 2a 66 69 |t loop*/|..} /*fi|
|000005c0| 6c 6c 63 68 61 72 2a 2f | 0d 09 0d 0d 76 6f 69 64 |llchar*/|....void|
|000005d0| 20 63 6c 65 61 72 62 79 | 74 65 73 20 28 70 63 6c | clearby|tes (pcl|
|000005e0| 65 61 72 2c 20 63 74 63 | 6c 65 61 72 29 20 76 6f |ear, ctc|lear) vo|
|000005f0| 69 64 20 2a 70 63 6c 65 | 61 72 3b 20 6c 6f 6e 67 |id *pcle|ar; long|
|00000600| 20 63 74 63 6c 65 61 72 | 3b 20 7b 0d 09 0d 09 2f | ctclear|; {..../|
|00000610| 2a 0d 09 66 69 6c 6c 20 | 6d 65 6d 6f 72 79 20 77 |*..fill |memory w|
|00000620| 69 74 68 20 30 27 73 2e | 0d 09 2a 2f 0d 09 0d 09 |ith 0's.|..*/....|
|00000630| 66 69 6c 6c 63 68 61 72 | 20 28 70 63 6c 65 61 72 |fillchar| (pclear|
|00000640| 2c 20 63 74 63 6c 65 61 | 72 2c 20 28 63 68 61 72 |, ctclea|r, (char|
|00000650| 29 20 30 29 3b 0d 09 7d | 20 2f 2a 63 6c 65 61 72 |) 0);..}| /*clear|
|00000660| 62 79 74 65 73 2a 2f 0d | 09 0d 0d 76 6f 69 64 20 |bytes*/.|...void |
|00000670| 64 69 73 70 6f 73 65 68 | 61 6e 64 6c 65 20 28 68 |disposeh|andle (h|
|00000680| 29 20 48 61 6e 64 6c 65 | 20 68 3b 20 7b 0d 09 0d |) Handle| h; {...|
|00000690| 09 2f 2a 0d 09 6f 75 72 | 20 6f 77 6e 20 62 6f 74 |./*..our| own bot|
|000006a0| 74 6c 65 6e 65 63 6b 20 | 66 6f 72 20 74 68 69 73 |tleneck |for this|
|000006b0| 20 62 75 69 6c 74 2d 69 | 6e 2e 20 20 77 65 20 64 | built-i|n. we d|
|000006c0| 6f 6e 27 74 20 72 65 71 | 75 69 72 65 20 74 79 70 |on't req|uire typ|
|000006d0| 65 20 63 6f 65 72 63 69 | 6f 6e 0d 09 61 6e 64 20 |e coerci|on..and |
|000006e0| 77 65 20 63 68 65 63 6b | 20 69 66 20 69 74 73 20 |we check| if its |
|000006f0| 6e 69 6c 2e 0d 09 2a 2f | 0d 09 0d 09 69 66 20 28 |nil...*/|....if (|
|00000700| 68 20 21 3d 20 6e 69 6c | 29 0d 09 09 44 69 73 70 |h != nil|)...Disp|
|00000710| 6f 73 48 61 6e 64 6c 65 | 20 28 68 29 3b 0d 09 7d |osHandle| (h);..}|
|00000720| 20 2f 2a 64 69 73 70 6f | 73 65 68 61 6e 64 6c 65 | /*dispo|sehandle|
|00000730| 2a 2f 0d 09 0d 09 0d 6c | 6f 6e 67 20 67 65 74 68 |*/.....l|ong geth|
|00000740| 61 6e 64 6c 65 73 69 7a | 65 20 28 48 61 6e 64 6c |andlesiz|e (Handl|
|00000750| 65 20 68 29 20 7b 0d 09 | 0d 09 72 65 74 75 72 6e |e h) {..|..return|
|00000760| 20 28 47 65 74 48 61 6e | 64 6c 65 53 69 7a 65 20 | (GetHan|dleSize |
|00000770| 28 68 29 29 3b 0d 09 7d | 20 2f 2a 67 65 74 68 61 |(h));..}| /*getha|
|00000780| 6e 64 6c 65 73 69 7a 65 | 2a 2f 0d 09 0d 09 0d 62 |ndlesize|*/.....b|
|00000790| 6f 6f 6c 65 61 6e 20 73 | 65 74 68 61 6e 64 6c 65 |oolean s|ethandle|
|000007a0| 73 69 7a 65 20 28 48 61 | 6e 64 6c 65 20 68 2c 20 |size (Ha|ndle h, |
|000007b0| 6c 6f 6e 67 20 73 69 7a | 65 29 20 7b 0d 09 0d 09 |long siz|e) {....|
|000007c0| 53 65 74 48 61 6e 64 6c | 65 53 69 7a 65 20 28 68 |SetHandl|eSize (h|
|000007d0| 2c 20 73 69 7a 65 29 3b | 0d 09 0d 09 72 65 74 75 |, size);|....retu|
|000007e0| 72 6e 20 28 4d 65 6d 45 | 72 72 6f 72 20 28 29 20 |rn (MemE|rror () |
|000007f0| 3d 3d 20 6e 6f 45 72 72 | 29 3b 0d 09 7d 20 2f 2a |== noErr|);..} /*|
|00000800| 67 65 74 68 61 6e 64 6c | 65 73 69 7a 65 2a 2f 0d |gethandl|esize*/.|
|00000810| 09 0d 09 0d 62 6f 6f 6c | 65 61 6e 20 63 6f 70 79 |....bool|ean copy|
|00000820| 68 61 6e 64 6c 65 20 28 | 68 6f 72 69 67 2c 20 68 |handle (|horig, h|
|00000830| 63 6f 70 79 29 20 48 61 | 6e 64 6c 65 20 68 6f 72 |copy) Ha|ndle hor|
|00000840| 69 67 2c 20 2a 68 63 6f | 70 79 3b 20 7b 0d 09 0d |ig, *hco|py; {...|
|00000850| 09 72 65 67 69 73 74 65 | 72 20 48 61 6e 64 6c 65 |.registe|r Handle|
|00000860| 20 68 3b 0d 09 72 65 67 | 69 73 74 65 72 20 6c 6f | h;..reg|ister lo|
|00000870| 6e 67 20 63 74 3b 0d 09 | 0d 09 69 66 20 28 68 6f |ng ct;..|..if (ho|
|00000880| 72 69 67 20 3d 3d 20 6e | 69 6c 29 20 7b 20 2f 2a |rig == n|il) { /*|
|00000890| 36 2f 31 38 2f 39 32 20 | 44 57 20 2d 2d 20 63 6f |6/18/92 |DW -- co|
|000008a0| 70 79 69 6e 67 20 61 20 | 6e 69 6c 20 68 61 6e 64 |pying a |nil hand|
|000008b0| 6c 65 20 62 65 67 65 74 | 73 20 61 20 6e 69 6c 20 |le beget|s a nil |
|000008c0| 68 61 6e 64 6c 65 2c 20 | 72 65 74 75 72 6e 73 20 |handle, |returns |
|000008d0| 74 72 75 65 2a 2f 0d 09 | 09 0d 09 09 2a 68 63 6f |true*/..|....*hco|
|000008e0| 70 79 20 3d 20 6e 69 6c | 3b 0d 09 09 0d 09 09 72 |py = nil|;......r|
|000008f0| 65 74 75 72 6e 20 28 74 | 72 75 65 29 3b 0d 09 09 |eturn (t|rue);...|
|00000900| 7d 0d 09 0d 09 68 20 3d | 20 4e 65 77 48 61 6e 64 |}....h =| NewHand|
|00000910| 6c 65 20 28 63 74 20 3d | 20 67 65 74 68 61 6e 64 |le (ct =| gethand|
|00000920| 6c 65 73 69 7a 65 20 28 | 68 6f 72 69 67 29 29 3b |lesize (|horig));|
|00000930| 0d 09 0d 09 69 66 20 28 | 68 20 3d 3d 20 6e 69 6c |....if (|h == nil|
|00000940| 29 0d 09 09 72 65 74 75 | 72 6e 20 28 66 61 6c 73 |)...retu|rn (fals|
|00000950| 65 29 3b 0d 09 09 0d 09 | 6d 6f 76 65 6c 65 66 74 |e);.....|moveleft|
|00000960| 20 28 2a 68 6f 72 69 67 | 2c 20 2a 68 2c 20 63 74 | (*horig|, *h, ct|
|00000970| 29 3b 0d 09 0d 09 2a 68 | 63 6f 70 79 20 3d 20 68 |);....*h|copy = h|
|00000980| 3b 0d 09 0d 09 72 65 74 | 75 72 6e 20 28 74 72 75 |;....ret|urn (tru|
|00000990| 65 29 3b 0d 09 7d 20 2f | 2a 63 6f 70 79 68 61 6e |e);..} /|*copyhan|
|000009a0| 64 6c 65 2a 2f 0d 09 0d | 0d 62 6f 6f 6c 65 61 6e |dle*/...|.boolean|
|000009b0| 20 65 6e 6c 61 72 67 65 | 68 61 6e 64 6c 65 20 28 | enlarge|handle (|
|000009c0| 48 61 6e 64 6c 65 20 68 | 67 72 6f 77 2c 20 6c 6f |Handle h|grow, lo|
|000009d0| 6e 67 20 63 74 67 72 6f | 77 2c 20 70 74 72 63 68 |ng ctgro|w, ptrch|
|000009e0| 61 72 20 6e 65 77 64 61 | 74 61 29 20 7b 0d 09 0d |ar newda|ta) {...|
|000009f0| 09 2f 2a 0d 09 6d 61 6b | 65 20 74 68 65 20 68 61 |./*..mak|e the ha|
|00000a00| 6e 64 6c 65 20 62 69 67 | 20 65 6e 6f 75 67 68 20 |ndle big| enough |
|00000a10| 74 6f 20 68 6f 6c 64 20 | 74 68 65 20 6e 65 77 20 |to hold |the new |
|00000a20| 64 61 74 61 2c 20 61 6e | 64 20 6d 6f 76 65 20 74 |data, an|d move t|
|00000a30| 68 65 20 6e 65 77 20 64 | 61 74 61 20 69 6e 0d 09 |he new d|ata in..|
|00000a40| 61 74 20 74 68 65 20 65 | 6e 64 20 6f 66 20 74 68 |at the e|nd of th|
|00000a50| 65 20 6e 65 77 6c 79 20 | 65 6e 6c 61 72 67 65 64 |e newly |enlarged|
|00000a60| 20 68 61 6e 64 6c 65 2e | 0d 09 2a 2f 0d 09 0d 09 | handle.|..*/....|
|00000a70| 72 65 67 69 73 74 65 72 | 20 48 61 6e 64 6c 65 20 |register| Handle |
|00000a80| 68 20 3d 20 68 67 72 6f | 77 3b 0d 09 72 65 67 69 |h = hgro|w;..regi|
|00000a90| 73 74 65 72 20 6c 6f 6e | 67 20 63 74 20 3d 20 63 |ster lon|g ct = c|
|00000aa0| 74 67 72 6f 77 3b 0d 09 | 72 65 67 69 73 74 65 72 |tgrow;..|register|
|00000ab0| 20 70 74 72 63 68 61 72 | 20 70 20 3d 20 6e 65 77 | ptrchar| p = new|
|00000ac0| 64 61 74 61 3b 0d 09 72 | 65 67 69 73 74 65 72 20 |data;..r|egister |
|00000ad0| 6c 6f 6e 67 20 6f 72 69 | 67 73 69 7a 65 3b 0d 09 |long ori|gsize;..|
|00000ae0| 0d 09 6f 72 69 67 73 69 | 7a 65 20 3d 20 67 65 74 |..origsi|ze = get|
|00000af0| 68 61 6e 64 6c 65 73 69 | 7a 65 20 28 68 29 3b 0d |handlesi|ze (h);.|
|00000b00| 09 0d 09 73 65 74 68 61 | 6e 64 6c 65 73 69 7a 65 |...setha|ndlesize|
|00000b10| 20 28 68 2c 20 6f 72 69 | 67 73 69 7a 65 20 2b 20 | (h, ori|gsize + |
|00000b20| 63 74 29 3b 0d 09 09 0d | 09 69 66 20 28 4d 65 6d |ct);....|.if (Mem|
|00000b30| 45 72 72 6f 72 20 28 29 | 20 21 3d 20 6e 6f 45 72 |Error ()| != noEr|
|00000b40| 72 29 0d 09 09 72 65 74 | 75 72 6e 20 28 66 61 6c |r)...ret|urn (fal|
|00000b50| 73 65 29 3b 0d 09 09 0d | 09 6d 6f 76 65 6c 65 66 |se);....|.movelef|
|00000b60| 74 20 28 70 2c 20 2a 68 | 20 2b 20 6f 72 69 67 73 |t (p, *h| + origs|
|00000b70| 69 7a 65 2c 20 63 74 29 | 3b 0d 09 0d 09 72 65 74 |ize, ct)|;....ret|
|00000b80| 75 72 6e 20 28 74 72 75 | 65 29 3b 0d 09 7d 20 2f |urn (tru|e);..} /|
|00000b90| 2a 65 6e 6c 61 72 67 65 | 68 61 6e 64 6c 65 2a 2f |*enlarge|handle*/|
|00000ba0| 20 0d 09 0d 09 0d 62 6f | 6f 6c 65 61 6e 20 6c 6f | .....bo|olean lo|
|00000bb0| 61 64 66 72 6f 6d 68 61 | 6e 64 6c 65 20 28 68 6c |adfromha|ndle (hl|
|00000bc0| 6f 61 64 2c 20 69 78 6c | 6f 61 64 2c 20 63 74 6c |oad, ixl|oad, ctl|
|00000bd0| 6f 61 64 2c 20 70 64 61 | 74 61 29 20 48 61 6e 64 |oad, pda|ta) Hand|
|00000be0| 6c 65 20 68 6c 6f 61 64 | 3b 20 6c 6f 6e 67 20 2a |le hload|; long *|
|00000bf0| 69 78 6c 6f 61 64 2c 20 | 63 74 6c 6f 61 64 3b 20 |ixload, |ctload; |
|00000c00| 70 74 72 63 68 61 72 20 | 70 64 61 74 61 3b 20 7b |ptrchar |pdata; {|
|00000c10| 0d 09 0d 09 2f 2a 0d 09 | 63 6f 70 79 20 74 68 65 |..../*..|copy the|
|00000c20| 20 6e 65 78 74 20 63 74 | 6c 6f 61 64 20 62 79 74 | next ct|load byt|
|00000c30| 65 73 20 66 72 6f 6d 20 | 68 6c 6f 61 64 20 69 6e |es from |hload in|
|00000c40| 74 6f 20 70 64 61 74 61 | 20 61 6e 64 20 69 6e 63 |to pdata| and inc|
|00000c50| 72 65 6d 65 6e 74 20 74 | 68 65 20 69 6e 64 65 78 |rement t|he index|
|00000c60| 2e 0d 09 0d 09 72 65 74 | 75 72 6e 20 66 61 6c 73 |.....ret|urn fals|
|00000c70| 65 20 69 66 20 74 68 65 | 72 65 20 61 72 65 6e 27 |e if the|re aren'|
|00000c80| 74 20 65 6e 6f 75 67 68 | 20 62 79 74 65 73 2e 0d |t enough| bytes..|
|00000c90| 09 0d 09 73 74 61 72 74 | 20 69 78 6c 6f 61 64 20 |...start| ixload |
|00000ca0| 61 74 20 30 2e 0d 09 2a | 2f 0d 09 0d 09 72 65 67 |at 0...*|/....reg|
|00000cb0| 69 73 74 65 72 20 48 61 | 6e 64 6c 65 20 68 20 3d |ister Ha|ndle h =|
|00000cc0| 20 68 6c 6f 61 64 3b 0d | 09 72 65 67 69 73 74 65 | hload;.|.registe|
|00000cd0| 72 20 70 74 72 63 68 61 | 72 20 70 20 3d 20 70 64 |r ptrcha|r p = pd|
|00000ce0| 61 74 61 3b 0d 09 72 65 | 67 69 73 74 65 72 20 6c |ata;..re|gister l|
|00000cf0| 6f 6e 67 20 63 74 20 3d | 20 63 74 6c 6f 61 64 3b |ong ct =| ctload;|
|00000d00| 0d 09 72 65 67 69 73 74 | 65 72 20 6c 6f 6e 67 20 |..regist|er long |
|00000d10| 69 78 20 3d 20 2a 69 78 | 6c 6f 61 64 3b 0d 09 72 |ix = *ix|load;..r|
|00000d20| 65 67 69 73 74 65 72 20 | 6c 6f 6e 67 20 73 69 7a |egister |long siz|
|00000d30| 65 3b 0d 09 0d 09 73 69 | 7a 65 20 3d 20 67 65 74 |e;....si|ze = get|
|00000d40| 68 61 6e 64 6c 65 73 69 | 7a 65 20 28 68 29 3b 0d |handlesi|ze (h);.|
|00000d50| 09 0d 09 69 66 20 28 28 | 69 78 20 2b 20 63 74 29 |...if ((|ix + ct)|
|00000d60| 20 3e 20 73 69 7a 65 29 | 20 2f 2a 61 73 6b 65 64 | > size)| /*asked|
|00000d70| 20 66 6f 72 20 6d 6f 72 | 65 20 62 79 74 65 73 20 | for mor|e bytes |
|00000d80| 74 68 61 6e 20 74 68 65 | 72 65 20 61 72 65 2a 2f |than the|re are*/|
|00000d90| 0d 09 09 72 65 74 75 72 | 6e 20 28 66 61 6c 73 65 |...retur|n (false|
|00000da0| 29 3b 20 0d 09 09 0d 09 | 6d 6f 76 65 6c 65 66 74 |); .....|moveleft|
|00000db0| 20 28 2a 68 20 2b 20 69 | 78 2c 20 70 2c 20 63 74 | (*h + i|x, p, ct|
|00000dc0| 29 3b 20 2f 2a 63 6f 70 | 79 20 6f 75 74 20 6f 66 |); /*cop|y out of|
|00000dd0| 20 74 68 65 20 68 61 6e | 64 6c 65 2a 2f 0d 09 0d | the han|dle*/...|
|00000de0| 09 2a 69 78 6c 6f 61 64 | 20 3d 20 69 78 20 2b 20 |.*ixload| = ix + |
|00000df0| 63 74 3b 20 2f 2a 69 6e | 63 72 65 6d 65 6e 74 20 |ct; /*in|crement |
|00000e00| 74 68 65 20 69 6e 64 65 | 78 20 69 6e 74 6f 20 74 |the inde|x into t|
|00000e10| 68 65 20 68 61 6e 64 6c | 65 2a 2f 0d 09 0d 09 72 |he handl|e*/....r|
|00000e20| 65 74 75 72 6e 20 28 74 | 72 75 65 29 3b 0d 09 7d |eturn (t|rue);..}|
|00000e30| 20 2f 2a 6c 6f 61 64 66 | 72 6f 6d 68 61 6e 64 6c | /*loadf|romhandl|
|00000e40| 65 2a 2f 0d 09 0d 0d 62 | 6f 6f 6c 65 61 6e 20 6e |e*/....b|oolean n|
|00000e50| 65 77 74 65 78 74 68 61 | 6e 64 6c 65 20 28 62 73 |ewtextha|ndle (bs|
|00000e60| 2c 20 68 74 65 78 74 29 | 20 62 69 67 73 74 72 69 |, htext)| bigstri|
|00000e70| 6e 67 20 62 73 3b 20 48 | 61 6e 64 6c 65 20 2a 68 |ng bs; H|andle *h|
|00000e80| 74 65 78 74 3b 20 7b 0d | 09 0d 09 2f 2a 0d 09 63 |text; {.|.../*..c|
|00000e90| 72 65 61 74 65 20 61 20 | 6e 65 77 20 68 61 6e 64 |reate a |new hand|
|00000ea0| 6c 65 20 74 6f 20 68 6f | 6c 64 20 74 68 65 20 74 |le to ho|ld the t|
|00000eb0| 65 78 74 20 6f 66 20 74 | 68 65 20 73 74 72 69 6e |ext of t|he strin|
|00000ec0| 67 2e 0d 09 0d 09 69 66 | 20 74 68 65 20 73 74 72 |g.....if| the str|
|00000ed0| 69 6e 67 20 69 73 20 22 | 5c 70 41 42 43 22 20 2d |ing is "|\pABC" -|
|00000ee0| 2d 20 79 6f 75 20 67 65 | 74 20 61 20 68 61 6e 64 |- you ge|t a hand|
|00000ef0| 6c 65 20 6f 66 20 73 69 | 7a 65 20 33 2e 0d 09 2a |le of si|ze 3...*|
|00000f00| 2f 0d 09 0d 09 72 65 67 | 69 73 74 65 72 20 6c 6f |/....reg|ister lo|
|00000f10| 6e 67 20 6c 65 6e 3b 0d | 09 72 65 67 69 73 74 65 |ng len;.|.registe|
|00000f20| 72 20 48 61 6e 64 6c 65 | 20 68 3b 0d 09 0d 09 68 |r Handle| h;....h|
|00000f30| 20 3d 20 4e 65 77 48 61 | 6e 64 6c 65 20 28 6c 65 | = NewHa|ndle (le|
|00000f40| 6e 20 3d 20 73 74 72 69 | 6e 67 6c 65 6e 67 74 68 |n = stri|nglength|
|00000f50| 20 28 62 73 29 29 3b 0d | 09 0d 09 69 66 20 28 68 | (bs));.|...if (h|
|00000f60| 20 3d 3d 20 6e 69 6c 29 | 0d 09 09 72 65 74 75 72 | == nil)|...retur|
|00000f70| 6e 20 28 66 61 6c 73 65 | 29 3b 0d 09 0d 09 69 66 |n (false|);....if|
|00000f80| 20 28 6c 65 6e 20 3e 20 | 30 29 0d 09 09 6d 6f 76 | (len > |0)...mov|
|00000f90| 65 6c 65 66 74 20 28 26 | 62 73 20 5b 31 5d 2c 20 |eleft (&|bs [1], |
|00000fa0| 2a 68 2c 20 6c 65 6e 29 | 3b 0d 09 0d 09 2a 68 74 |*h, len)|;....*ht|
|00000fb0| 65 78 74 20 3d 20 68 3b | 20 2f 2a 70 61 73 73 20 |ext = h;| /*pass |
|00000fc0| 68 61 6e 64 6c 65 20 62 | 61 63 6b 20 74 6f 20 63 |handle b|ack to c|
|00000fd0| 61 6c 6c 65 72 2a 2f 0d | 09 0d 09 72 65 74 75 72 |aller*/.|...retur|
|00000fe0| 6e 20 28 74 72 75 65 29 | 3b 0d 09 7d 20 2f 2a 6e |n (true)|;..} /*n|
|00000ff0| 65 77 74 65 78 74 68 61 | 6e 64 6c 65 2a 2f 0d 0d |ewtextha|ndle*/..|
|00001000| 0d 62 6f 6f 6c 65 61 6e | 20 70 75 73 68 74 65 78 |.boolean| pushtex|
|00001010| 74 68 61 6e 64 6c 65 20 | 28 62 73 2c 20 68 74 65 |thandle |(bs, hte|
|00001020| 78 74 29 20 62 69 67 73 | 74 72 69 6e 67 20 62 73 |xt) bigs|tring bs|
|00001030| 3b 20 48 61 6e 64 6c 65 | 20 68 74 65 78 74 3b 20 |; Handle| htext; |
|00001040| 7b 0d 09 0d 09 2f 2a 0d | 09 68 74 65 78 74 20 69 |{..../*.|.htext i|
|00001050| 73 20 61 20 68 61 6e 64 | 6c 65 20 63 72 65 61 74 |s a hand|le creat|
|00001060| 65 64 20 77 69 74 68 20 | 6e 65 77 74 65 78 74 68 |ed with |newtexth|
|00001070| 61 6e 64 6c 65 2e 0d 09 | 0d 09 69 6e 63 72 65 61 |andle...|..increa|
|00001080| 73 65 20 74 68 65 20 73 | 69 7a 65 20 6f 66 20 74 |se the s|ize of t|
|00001090| 68 65 20 68 61 6e 64 6c | 65 20 73 6f 20 77 65 20 |he handl|e so we |
|000010a0| 63 61 6e 20 70 75 73 68 | 20 74 68 65 20 74 65 78 |can push| the tex|
|000010b0| 74 20 6f 66 20 62 73 20 | 61 74 20 0d 09 74 68 65 |t of bs |at ..the|
|000010c0| 20 65 6e 64 20 6f 66 20 | 74 68 65 20 68 61 6e 64 | end of |the hand|
|000010d0| 6c 65 20 28 6e 6f 74 20 | 69 6e 63 6c 75 64 69 6e |le (not |includin|
|000010e0| 67 20 6c 65 6e 67 74 68 | 20 62 79 74 65 29 2e 0d |g length| byte)..|
|000010f0| 09 2a 2f 0d 09 0d 09 72 | 65 74 75 72 6e 20 28 65 |.*/....r|eturn (e|
|00001100| 6e 6c 61 72 67 65 68 61 | 6e 64 6c 65 20 28 68 74 |nlargeha|ndle (ht|
|00001110| 65 78 74 2c 20 28 6c 6f | 6e 67 29 20 73 74 72 69 |ext, (lo|ng) stri|
|00001120| 6e 67 6c 65 6e 67 74 68 | 20 28 62 73 29 2c 20 28 |nglength| (bs), (|
|00001130| 70 74 72 63 68 61 72 29 | 20 62 73 20 2b 20 31 29 |ptrchar)| bs + 1)|
|00001140| 29 3b 0d 09 7d 20 2f 2a | 70 75 73 68 74 65 78 74 |);..} /*|pushtext|
|00001150| 68 61 6e 64 6c 65 2a 2f | 0d 0d 0d 62 6f 6f 6c 65 |handle*/|...boole|
|00001160| 61 6e 20 70 75 73 68 68 | 61 6e 64 6c 65 6f 6e 68 |an pushh|andleonh|
|00001170| 61 6e 64 6c 65 20 28 48 | 61 6e 64 6c 65 20 68 73 |andle (H|andle hs|
|00001180| 6f 75 72 63 65 2c 20 48 | 61 6e 64 6c 65 20 68 64 |ource, H|andle hd|
|00001190| 65 73 74 29 20 7b 0d 09 | 0d 09 62 6f 6f 6c 65 61 |est) {..|..boolea|
|000011a0| 6e 20 66 6c 3b 0d 09 0d | 09 69 66 20 28 68 73 6f |n fl;...|.if (hso|
|000011b0| 75 72 63 65 20 3d 3d 20 | 6e 69 6c 29 0d 09 09 72 |urce == |nil)...r|
|000011c0| 65 74 75 72 6e 20 28 74 | 72 75 65 29 3b 0d 09 0d |eturn (t|rue);...|
|000011d0| 09 6c 6f 63 6b 68 61 6e | 64 6c 65 20 28 68 73 6f |.lockhan|dle (hso|
|000011e0| 75 72 63 65 29 3b 0d 09 | 0d 09 66 6c 20 3d 20 65 |urce);..|..fl = e|
|000011f0| 6e 6c 61 72 67 65 68 61 | 6e 64 6c 65 20 28 68 64 |nlargeha|ndle (hd|
|00001200| 65 73 74 2c 20 67 65 74 | 68 61 6e 64 6c 65 73 69 |est, get|handlesi|
|00001210| 7a 65 20 28 68 73 6f 75 | 72 63 65 29 2c 20 2a 68 |ze (hsou|rce), *h|
|00001220| 73 6f 75 72 63 65 29 3b | 0d 09 0d 09 75 6e 6c 6f |source);|....unlo|
|00001230| 63 6b 68 61 6e 64 6c 65 | 20 28 68 73 6f 75 72 63 |ckhandle| (hsourc|
|00001240| 65 29 3b 0d 09 0d 09 72 | 65 74 75 72 6e 20 28 66 |e);....r|eturn (f|
|00001250| 6c 29 3b 0d 09 7d 20 2f | 2a 70 75 73 68 74 65 78 |l);..} /|*pushtex|
|00001260| 74 68 61 6e 64 6c 65 2a | 2f 0d 0d 0d 76 6f 69 64 |thandle*|/...void|
|00001270| 20 74 65 78 74 68 61 6e | 64 6c 65 74 6f 73 74 72 | texthan|dletostr|
|00001280| 69 6e 67 20 28 48 61 6e | 64 6c 65 20 68 74 65 78 |ing (Han|dle htex|
|00001290| 74 2c 20 62 69 67 73 74 | 72 69 6e 67 20 62 73 29 |t, bigst|ring bs)|
|000012a0| 20 7b 0d 09 0d 09 6c 6f | 6e 67 20 6c 65 6e 3b 0d | {....lo|ng len;.|
|000012b0| 09 0d 09 69 66 20 28 68 | 74 65 78 74 20 3d 3d 20 |...if (h|text == |
|000012c0| 6e 69 6c 29 20 7b 0d 09 | 09 0d 09 09 73 65 74 73 |nil) {..|....sets|
|000012d0| 74 72 69 6e 67 6c 65 6e | 67 74 68 20 28 62 73 2c |tringlen|gth (bs,|
|000012e0| 20 30 29 3b 0d 09 09 0d | 09 09 72 65 74 75 72 6e | 0);....|..return|
|000012f0| 3b 0d 09 09 7d 0d 09 0d | 09 6c 65 6e 20 3d 20 67 |;...}...|.len = g|
|00001300| 65 74 68 61 6e 64 6c 65 | 73 69 7a 65 20 28 68 74 |ethandle|size (ht|
|00001310| 65 78 74 29 3b 0d 09 0d | 09 69 66 20 28 6c 65 6e |ext);...|.if (len|
|00001320| 20 3e 20 6c 65 6e 62 69 | 67 73 74 72 69 6e 67 29 | > lenbi|gstring)|
|00001330| 0d 09 09 6c 65 6e 20 3d | 20 6c 65 6e 62 69 67 73 |...len =| lenbigs|
|00001340| 74 72 69 6e 67 3b 0d 09 | 0d 09 73 65 74 73 74 72 |tring;..|..setstr|
|00001350| 69 6e 67 6c 65 6e 67 74 | 68 20 28 62 73 2c 20 6c |inglengt|h (bs, l|
|00001360| 65 6e 29 3b 0d 09 0d 09 | 6d 6f 76 65 6c 65 66 74 |en);....|moveleft|
|00001370| 20 28 2a 68 74 65 78 74 | 2c 20 26 62 73 20 5b 31 | (*htext|, &bs [1|
|00001380| 5d 2c 20 6c 65 6e 29 3b | 0d 09 7d 20 2f 2a 74 65 |], len);|..} /*te|
|00001390| 78 74 68 61 6e 64 6c 65 | 74 6f 73 74 72 69 6e 67 |xthandle|tostring|
|000013a0| 2a 2f 0d 09 0d 09 0d 76 | 6f 69 64 20 6c 6f 63 6b |*/.....v|oid lock|
|000013b0| 68 61 6e 64 6c 65 20 28 | 68 29 20 48 61 6e 64 6c |handle (|h) Handl|
|000013c0| 65 20 68 3b 20 7b 0d 09 | 0d 09 69 66 20 28 68 20 |e h; {..|..if (h |
|000013d0| 21 3d 20 6e 69 6c 29 0d | 09 09 48 4c 6f 63 6b 20 |!= nil).|..HLock |
|000013e0| 28 68 29 3b 0d 09 7d 20 | 2f 2a 6c 6f 63 6b 68 61 |(h);..} |/*lockha|
|000013f0| 6e 64 6c 65 2a 2f 0d 09 | 0d 09 0d 76 6f 69 64 20 |ndle*/..|...void |
|00001400| 75 6e 6c 6f 63 6b 68 61 | 6e 64 6c 65 20 28 68 29 |unlockha|ndle (h)|
|00001410| 20 48 61 6e 64 6c 65 20 | 68 3b 20 7b 0d 09 0d 09 | Handle |h; {....|
|00001420| 69 66 20 28 68 20 21 3d | 20 6e 69 6c 29 0d 09 09 |if (h !=| nil)...|
|00001430| 48 55 6e 6c 6f 63 6b 20 | 28 68 29 3b 0d 09 7d 20 |HUnlock |(h);..} |
|00001440| 2f 2a 75 6e 6c 6f 63 6b | 68 61 6e 64 6c 65 2a 2f |/*unlock|handle*/|
|00001450| 0d 09 0d 09 0d 62 6f 6f | 6c 65 61 6e 20 6e 65 77 |.....boo|lean new|
|00001460| 63 6c 65 61 72 68 61 6e | 64 6c 65 20 28 63 74 62 |clearhan|dle (ctb|
|00001470| 79 74 65 73 2c 20 68 72 | 65 74 75 72 6e 65 64 29 |ytes, hr|eturned)|
|00001480| 20 6c 6f 6e 67 20 63 74 | 62 79 74 65 73 3b 20 48 | long ct|bytes; H|
|00001490| 61 6e 64 6c 65 20 2a 68 | 72 65 74 75 72 6e 65 64 |andle *h|returned|
|000014a0| 3b 20 7b 0d 09 0d 09 72 | 65 67 69 73 74 65 72 20 |; {....r|egister |
|000014b0| 6c 6f 6e 67 20 63 74 20 | 3d 20 63 74 62 79 74 65 |long ct |= ctbyte|
|000014c0| 73 3b 0d 09 72 65 67 69 | 73 74 65 72 20 48 61 6e |s;..regi|ster Han|
|000014d0| 64 6c 65 20 68 3b 0d 09 | 0d 09 2a 68 72 65 74 75 |dle h;..|..*hretu|
|000014e0| 72 6e 65 64 20 3d 20 68 | 20 3d 20 4e 65 77 48 61 |rned = h| = NewHa|
|000014f0| 6e 64 6c 65 20 28 63 74 | 29 3b 0d 09 0d 09 69 66 |ndle (ct|);....if|
|00001500| 20 28 68 20 3d 3d 20 6e | 69 6c 29 20 0d 09 09 72 | (h == n|il) ...r|
|00001510| 65 74 75 72 6e 20 28 66 | 61 6c 73 65 29 3b 0d 09 |eturn (f|alse);..|
|00001520| 09 0d 09 63 6c 65 61 72 | 62 79 74 65 73 20 28 2a |...clear|bytes (*|
|00001530| 68 2c 20 63 74 29 3b 0d | 09 0d 09 2a 68 72 65 74 |h, ct);.|...*hret|
|00001540| 75 72 6e 65 64 20 3d 20 | 68 3b 0d 09 0d 09 72 65 |urned = |h;....re|
|00001550| 74 75 72 6e 20 28 74 72 | 75 65 29 3b 0d 09 7d 20 |turn (tr|ue);..} |
|00001560| 2f 2a 6e 65 77 63 6c 65 | 61 72 68 61 6e 64 6c 65 |/*newcle|arhandle|
|00001570| 2a 2f 0d 09 0d 09 0d 62 | 6f 6f 6c 65 61 6e 20 6e |*/.....b|oolean n|
|00001580| 65 77 66 69 6c 6c 65 64 | 68 61 6e 64 6c 65 20 28 |ewfilled|handle (|
|00001590| 70 74 72 76 6f 69 64 20 | 70 64 61 74 61 2c 20 6c |ptrvoid |pdata, l|
|000015a0| 6f 6e 67 20 73 69 7a 65 | 2c 20 48 61 6e 64 6c 65 |ong size|, Handle|
|000015b0| 20 2a 68 72 65 74 75 72 | 6e 65 64 29 20 7b 0d 09 | *hretur|ned) {..|
|000015c0| 0d 09 72 65 67 69 73 74 | 65 72 20 48 61 6e 64 6c |..regist|er Handl|
|000015d0| 65 20 68 3b 0d 09 72 65 | 67 69 73 74 65 72 20 6c |e h;..re|gister l|
|000015e0| 6f 6e 67 20 63 74 62 79 | 74 65 73 3b 0d 09 0d 09 |ong ctby|tes;....|
|000015f0| 63 74 62 79 74 65 73 20 | 3d 20 73 69 7a 65 3b 20 |ctbytes |= size; |
|00001600| 0d 09 0d 09 68 20 3d 20 | 4e 65 77 48 61 6e 64 6c |....h = |NewHandl|
|00001610| 65 20 28 63 74 62 79 74 | 65 73 29 3b 0d 09 0d 09 |e (ctbyt|es);....|
|00001620| 69 66 20 28 68 20 3d 3d | 20 6e 69 6c 29 20 7b 0d |if (h ==| nil) {.|
|00001630| 09 09 0d 09 09 2a 68 72 | 65 74 75 72 6e 65 64 20 |.....*hr|eturned |
|00001640| 3d 20 6e 69 6c 3b 0d 09 | 09 0d 09 09 72 65 74 75 |= nil;..|....retu|
|00001650| 72 6e 20 28 66 61 6c 73 | 65 29 3b 0d 09 09 7d 0d |rn (fals|e);...}.|
|00001660| 09 0d 09 6d 6f 76 65 6c | 65 66 74 20 28 70 64 61 |...movel|eft (pda|
|00001670| 74 61 2c 20 2a 68 2c 20 | 63 74 62 79 74 65 73 29 |ta, *h, |ctbytes)|
|00001680| 3b 0d 09 09 0d 09 2a 68 | 72 65 74 75 72 6e 65 64 |;.....*h|returned|
|00001690| 20 3d 20 68 3b 0d 09 0d | 09 72 65 74 75 72 6e 20 | = h;...|.return |
|000016a0| 28 74 72 75 65 29 3b 0d | 09 7d 20 2f 2a 6e 65 77 |(true);.|.} /*new|
|000016b0| 66 69 6c 6c 65 64 68 61 | 6e 64 6c 65 2a 2f 0d 09 |filledha|ndle*/..|
|000016c0| 0d 09 0d 62 6f 6f 6c 65 | 61 6e 20 6e 65 77 68 65 |...boole|an newhe|
|000016d0| 61 70 73 74 72 69 6e 67 | 20 28 62 69 67 73 74 72 |apstring| (bigstr|
|000016e0| 69 6e 67 20 62 73 2c 20 | 68 64 6c 73 74 72 69 6e |ing bs, |hdlstrin|
|000016f0| 67 20 2a 68 73 74 72 69 | 6e 67 29 20 7b 0d 0d 09 |g *hstri|ng) {...|
|00001700| 72 65 74 75 72 6e 20 28 | 6e 65 77 66 69 6c 6c 65 |return (|newfille|
|00001710| 64 68 61 6e 64 6c 65 20 | 28 62 73 2c 20 28 6c 6f |dhandle |(bs, (lo|
|00001720| 6e 67 29 20 73 74 72 69 | 6e 67 6c 65 6e 67 74 68 |ng) stri|nglength|
|00001730| 20 28 62 73 29 20 2b 20 | 31 2c 20 28 48 61 6e 64 | (bs) + |1, (Hand|
|00001740| 6c 65 20 2a 29 20 68 73 | 74 72 69 6e 67 29 29 3b |le *) hs|tring));|
|00001750| 0d 09 7d 20 2f 2a 6e 65 | 77 68 65 61 70 73 74 72 |..} /*ne|wheapstr|
|00001760| 69 6e 67 2a 2f 0d 09 0d | 09 0d 76 6f 69 64 20 63 |ing*/...|..void c|
|00001770| 6f 70 79 68 65 61 70 73 | 74 72 69 6e 67 20 28 68 |opyheaps|tring (h|
|00001780| 64 6c 73 74 72 69 6e 67 | 20 68 73 74 72 69 6e 67 |dlstring| hstring|
|00001790| 2c 20 62 69 67 73 74 72 | 69 6e 67 20 62 73 29 20 |, bigstr|ing bs) |
|000017a0| 7b 0d 09 0d 09 69 66 20 | 28 68 73 74 72 69 6e 67 |{....if |(hstring|
|000017b0| 20 3d 3d 20 6e 69 6c 29 | 20 7b 0d 09 09 0d 09 09 | == nil)| {......|
|000017c0| 73 65 74 73 74 72 69 6e | 67 6c 65 6e 67 74 68 20 |setstrin|glength |
|000017d0| 28 62 73 2c 20 30 29 3b | 0d 09 09 0d 09 09 72 65 |(bs, 0);|......re|
|000017e0| 74 75 72 6e 3b 0d 09 09 | 7d 0d 09 0d 09 6c 6f 63 |turn;...|}....loc|
|000017f0| 6b 68 61 6e 64 6c 65 20 | 28 28 48 61 6e 64 6c 65 |khandle |((Handle|
|00001800| 29 20 68 73 74 72 69 6e | 67 29 3b 0d 09 0d 09 63 |) hstrin|g);....c|
|00001810| 6f 70 79 73 74 72 69 6e | 67 20 28 2a 68 73 74 72 |opystrin|g (*hstr|
|00001820| 69 6e 67 2c 20 62 73 29 | 3b 0d 09 0d 09 75 6e 6c |ing, bs)|;....unl|
|00001830| 6f 63 6b 68 61 6e 64 6c | 65 20 28 28 48 61 6e 64 |ockhandl|e ((Hand|
|00001840| 6c 65 29 20 68 73 74 72 | 69 6e 67 29 3b 0d 09 7d |le) hstr|ing);..}|
|00001850| 20 2f 2a 63 6f 70 79 68 | 65 61 70 73 74 72 69 6e | /*copyh|eapstrin|
|00001860| 67 2a 2f 0d 09 0d 0d 62 | 6f 6f 6c 65 61 6e 20 73 |g*/....b|oolean s|
|00001870| 65 74 68 61 6e 64 6c 65 | 63 6f 6e 74 65 6e 74 73 |ethandle|contents|
|00001880| 20 28 76 6f 69 64 20 2a | 70 2c 20 6c 6f 6e 67 20 | (void *|p, long |
|00001890| 63 74 2c 20 48 61 6e 64 | 6c 65 20 68 29 20 7b 0d |ct, Hand|le h) {.|
|000018a0| 0d 09 73 65 74 68 61 6e | 64 6c 65 73 69 7a 65 20 |..sethan|dlesize |
|000018b0| 28 68 2c 20 63 74 29 3b | 0d 09 0d 09 69 66 20 28 |(h, ct);|....if (|
|000018c0| 4d 65 6d 45 72 72 6f 72 | 20 28 29 20 21 3d 20 6e |MemError| () != n|
|000018d0| 6f 45 72 72 29 0d 09 09 | 72 65 74 75 72 6e 20 28 |oErr)...|return (|
|000018e0| 66 61 6c 73 65 29 3b 0d | 09 0d 09 6d 6f 76 65 6c |false);.|...movel|
|000018f0| 65 66 74 20 28 70 2c 20 | 2a 68 2c 20 63 74 29 3b |eft (p, |*h, ct);|
|00001900| 0d 09 0d 09 72 65 74 75 | 72 6e 20 28 74 72 75 65 |....retu|rn (true|
|00001910| 29 3b 0d 09 7d 20 2f 2a | 73 65 74 68 61 6e 64 6c |);..} /*|sethandl|
|00001920| 65 63 6f 6e 74 65 6e 74 | 73 2a 2f 0d 0d 0d 62 6f |econtent|s*/...bo|
|00001930| 6f 6c 65 61 6e 20 6d 69 | 6e 68 61 6e 64 6c 65 73 |olean mi|nhandles|
|00001940| 69 7a 65 20 28 48 61 6e | 64 6c 65 20 68 2c 20 6c |ize (Han|dle h, l|
|00001950| 6f 6e 67 20 73 69 7a 65 | 29 20 7b 0d 09 0d 09 69 |ong size|) {....i|
|00001960| 66 20 28 67 65 74 68 61 | 6e 64 6c 65 73 69 7a 65 |f (getha|ndlesize|
|00001970| 20 28 68 29 20 3e 3d 20 | 73 69 7a 65 29 20 2f 2a | (h) >= |size) /*|
|00001980| 61 6c 72 65 61 64 79 20 | 62 69 67 20 65 6e 6f 75 |already |big enou|
|00001990| 67 68 2a 2f 0d 09 09 72 | 65 74 75 72 6e 20 28 74 |gh*/...r|eturn (t|
|000019a0| 72 75 65 29 3b 0d 09 09 | 0d 09 73 65 74 68 61 6e |rue);...|..sethan|
|000019b0| 64 6c 65 73 69 7a 65 20 | 28 68 2c 20 73 69 7a 65 |dlesize |(h, size|
|000019c0| 29 3b 20 2f 2a 74 72 79 | 20 74 6f 20 6d 61 6b 65 |); /*try| to make|
|000019d0| 20 69 74 20 6c 61 72 67 | 65 72 2a 2f 0d 09 0d 09 | it larg|er*/....|
|000019e0| 72 65 74 75 72 6e 20 28 | 4d 65 6d 45 72 72 6f 72 |return (|MemError|
|000019f0| 20 28 29 20 3d 3d 20 6e | 6f 45 72 72 29 3b 0d 09 | () == n|oErr);..|
|00001a00| 7d 20 2f 2a 6d 69 6e 68 | 61 6e 64 6c 65 73 69 7a |} /*minh|andlesiz|
|00001a10| 65 2a 2f 0d 09 0d 09 0d | 62 6f 6f 6c 65 61 6e 20 |e*/.....|boolean |
|00001a20| 6e 65 77 69 6e 74 61 72 | 72 61 79 20 28 73 68 6f |newintar|ray (sho|
|00001a30| 72 74 20 63 74 2c 20 68 | 64 6c 69 6e 74 61 72 72 |rt ct, h|dlintarr|
|00001a40| 61 79 20 2a 68 61 72 72 | 61 79 29 20 7b 0d 09 0d |ay *harr|ay) {...|
|00001a50| 09 48 61 6e 64 6c 65 20 | 68 3b 0d 09 0d 09 69 66 |.Handle |h;....if|
|00001a60| 20 28 21 6e 65 77 63 6c | 65 61 72 68 61 6e 64 6c | (!newcl|earhandl|
|00001a70| 65 20 28 6c 6f 6e 67 73 | 69 7a 65 6f 66 20 28 73 |e (longs|izeof (s|
|00001a80| 68 6f 72 74 29 20 2a 20 | 63 74 2c 20 26 68 29 29 |hort) * |ct, &h))|
|00001a90| 0d 09 09 72 65 74 75 72 | 6e 20 28 66 61 6c 73 65 |...retur|n (false|
|00001aa0| 29 3b 0d 09 09 0d 09 2a | 68 61 72 72 61 79 20 3d |);.....*|harray =|
|00001ab0| 20 28 68 64 6c 69 6e 74 | 61 72 72 61 79 29 20 68 | (hdlint|array) h|
|00001ac0| 3b 0d 09 0d 09 72 65 74 | 75 72 6e 20 28 74 72 75 |;....ret|urn (tru|
|00001ad0| 65 29 3b 0d 09 7d 20 2f | 2a 6e 65 77 69 6e 74 61 |e);..} /|*newinta|
|00001ae0| 72 72 61 79 2a 2f 0d 09 | 0d 0d 62 6f 6f 6c 65 61 |rray*/..|..boolea|
|00001af0| 6e 20 73 65 74 69 6e 74 | 61 72 72 61 79 20 28 68 |n setint|array (h|
|00001b00| 64 6c 69 6e 74 61 72 72 | 61 79 20 68 61 72 72 61 |dlintarr|ay harra|
|00001b10| 79 2c 20 73 68 6f 72 74 | 20 69 78 2c 20 73 68 6f |y, short| ix, sho|
|00001b20| 72 74 20 76 61 6c 29 20 | 7b 0d 09 0d 09 2f 2a 0d |rt val) |{..../*.|
|00001b30| 09 61 73 73 69 67 6e 20 | 69 6e 74 6f 20 61 20 63 |.assign |into a c|
|00001b40| 65 6c 6c 20 69 6e 20 61 | 20 76 61 72 69 61 62 6c |ell in a| variabl|
|00001b50| 65 2d 73 69 7a 65 20 61 | 72 72 61 79 20 6f 66 20 |e-size a|rray of |
|00001b60| 69 6e 74 65 67 65 72 73 | 2c 20 30 2d 62 61 73 65 |integers|, 0-base|
|00001b70| 64 20 69 6e 64 65 78 2e | 0d 09 0d 09 72 65 74 75 |d index.|....retu|
|00001b80| 72 6e 20 66 61 6c 73 65 | 20 69 66 20 74 68 65 20 |rn false| if the |
|00001b90| 61 72 72 61 79 20 6e 65 | 65 64 65 64 20 74 6f 20 |array ne|eded to |
|00001ba0| 62 65 20 65 78 74 65 6e | 64 65 64 20 62 75 74 20 |be exten|ded but |
|00001bb0| 74 68 65 72 65 20 69 73 | 6e 27 74 20 65 6e 6f 75 |there is|n't enou|
|00001bc0| 67 68 0d 09 6d 65 6d 6f | 72 79 20 74 6f 20 64 6f |gh..memo|ry to do|
|00001bd0| 20 69 74 2e 0d 09 2a 2f | 0d 09 0d 09 72 65 67 69 | it...*/|....regi|
|00001be0| 73 74 65 72 20 68 64 6c | 69 6e 74 61 72 72 61 79 |ster hdl|intarray|
|00001bf0| 20 68 20 3d 20 68 61 72 | 72 61 79 3b 0d 0d 09 69 | h = har|ray;...i|
|00001c00| 66 20 28 21 6d 69 6e 68 | 61 6e 64 6c 65 73 69 7a |f (!minh|andlesiz|
|00001c10| 65 20 28 28 48 61 6e 64 | 6c 65 29 20 68 2c 20 28 |e ((Hand|le) h, (|
|00001c20| 69 78 20 2b 20 31 29 20 | 2a 20 6c 6f 6e 67 73 69 |ix + 1) |* longsi|
|00001c30| 7a 65 6f 66 20 28 73 68 | 6f 72 74 29 29 29 0d 09 |zeof (sh|ort)))..|
|00001c40| 09 72 65 74 75 72 6e 20 | 28 66 61 6c 73 65 29 3b |.return |(false);|
|00001c50| 0d 09 0d 09 28 2a 68 61 | 72 72 61 79 29 20 5b 69 |....(*ha|rray) [i|
|00001c60| 78 5d 20 3d 20 76 61 6c | 3b 0d 09 0d 09 72 65 74 |x] = val|;....ret|
|00001c70| 75 72 6e 20 28 74 72 75 | 65 29 3b 0d 09 7d 20 2f |urn (tru|e);..} /|
|00001c80| 2a 73 65 74 69 6e 74 61 | 72 72 61 79 2a 2f 0d 09 |*setinta|rray*/..|
|00001c90| 0d 09 0d 62 6f 6f 6c 65 | 61 6e 20 67 65 74 69 6e |...boole|an getin|
|00001ca0| 74 61 72 72 61 79 20 28 | 68 64 6c 69 6e 74 61 72 |tarray (|hdlintar|
|00001cb0| 72 61 79 20 68 61 72 72 | 61 79 2c 20 73 68 6f 72 |ray harr|ay, shor|
|00001cc0| 74 20 69 78 2c 20 73 68 | 6f 72 74 20 2a 76 61 6c |t ix, sh|ort *val|
|00001cd0| 29 20 7b 0d 09 0d 09 2a | 76 61 6c 20 3d 20 28 2a |) {....*|val = (*|
|00001ce0| 68 61 72 72 61 79 29 20 | 5b 69 78 5d 3b 0d 09 0d |harray) |[ix];...|
|00001cf0| 09 72 65 74 75 72 6e 20 | 28 74 72 75 65 29 3b 0d |.return |(true);.|
|00001d00| 09 7d 20 2f 2a 67 65 74 | 69 6e 74 61 72 72 61 79 |.} /*get|intarray|
|00001d10| 2a 2f 0d 09 0d 09 0d 76 | 6f 69 64 20 66 69 6c 6c |*/.....v|oid fill|
|00001d20| 69 6e 74 61 72 72 61 79 | 20 28 68 64 6c 69 6e 74 |intarray| (hdlint|
|00001d30| 61 72 72 61 79 20 68 61 | 72 72 61 79 2c 20 73 68 |array ha|rray, sh|
|00001d40| 6f 72 74 20 76 61 6c 29 | 20 7b 0d 09 0d 09 72 65 |ort val)| {....re|
|00001d50| 67 69 73 74 65 72 20 68 | 64 6c 69 6e 74 61 72 72 |gister h|dlintarr|
|00001d60| 61 79 20 68 20 3d 20 68 | 61 72 72 61 79 3b 0d 09 |ay h = h|array;..|
|00001d70| 72 65 67 69 73 74 65 72 | 20 73 68 6f 72 74 20 78 |register| short x|
|00001d80| 20 3d 20 76 61 6c 3b 0d | 09 72 65 67 69 73 74 65 | = val;.|.registe|
|00001d90| 72 20 73 68 6f 72 74 20 | 63 74 3b 0d 09 0d 09 63 |r short |ct;....c|
|00001da0| 74 20 3d 20 67 65 74 68 | 61 6e 64 6c 65 73 69 7a |t = geth|andlesiz|
|00001db0| 65 20 28 28 48 61 6e 64 | 6c 65 29 20 68 29 20 2f |e ((Hand|le) h) /|
|00001dc0| 20 6c 6f 6e 67 73 69 7a | 65 6f 66 20 28 73 68 6f | longsiz|eof (sho|
|00001dd0| 72 74 29 3b 0d 0d 09 77 | 68 69 6c 65 20 28 2d 2d |rt);...w|hile (--|
|00001de0| 63 74 09 3e 3d 20 30 29 | 0d 09 09 28 2a 68 29 20 |ct.>= 0)|...(*h) |
|00001df0| 5b 63 74 5d 20 3d 20 78 | 3b 0d 09 7d 20 2f 2a 66 |[ct] = x|;..} /*f|
|00001e00| 69 6c 6c 69 6e 74 61 72 | 72 61 79 2a 2f 0d 0d 0d |illintar|ray*/...|
|00001e10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001e20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001e30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001e40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001e50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001e60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001e70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001e80| 00 00 01 00 00 00 01 36 | 00 00 00 36 00 00 00 1e |.......6|...6....|
|00001e90| 00 00 3f 15 08 74 65 6d | 70 6c 61 74 65 2e 00 00 |..?..tem|plate...|
|00001ea0| 3f 18 08 74 65 6d 70 6c | 61 74 65 00 06 00 00 00 |?..templ|ate.....|
|00001eb0| 0e 61 70 70 6c 65 74 6d | 65 6d 6f 72 79 2e 63 61 |.appletm|emory.ca|
|00001ec0| 02 00 00 00 50 61 72 74 | 53 49 54 78 00 00 00 00 |....Part|SITx....|
|00001ed0| 00 00 50 61 72 74 53 49 | 54 78 00 00 00 00 00 00 |..PartSI|Tx......|
|00001ee0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ef0| 00 00 a9 81 44 ca 00 00 | 00 00 00 00 01 54 3f 34 |....D...|.....T?4|
|00001f00| 00 4f 05 4f 53 41 2e 68 | 00 00 00 00 00 00 00 00 |.O.OSA.h|........|
|00001f10| ff ff ff ff ff ff ff ff | 06 00 00 00 3f 41 00 72 |........|....?A.r|
|00001f20| 06 72 65 61 64 6d 65 00 | 00 00 00 00 00 00 ff ff |.readme.|........|
|00001f30| ff ff ff ff ff ff 06 00 | 00 00 3f 45 00 21 0c 21 |........|..?E.!.!|
|00001f40| 4d 6f 76 65 26 52 65 2e | 6e 61 6d 00 ff ff ff ff |Move&Re.|nam.....|
|00001f50| ff ff ff ff 00 00 00 01 | 00 00 00 00 00 00 00 00 |........|........|
|00001f60| 0b 00 00 00 3f 50 05 69 | 61 63 2e 63 00 00 3f 51 |....?P.i|ac.c..?Q|
|00001f70| 05 69 61 63 2e 63 0b 00 | 00 00 3f 50 05 69 61 63 |.iac.c..|..?P.iac|
|00001f80| 00 00 00 2f 02 00 80 00 | 00 00 06 32 2e 30 72 63 |.../....|...2.0rc|
|00001f90| 31 21 32 2e 30 72 63 31 | 3b 20 a9 20 31 39 39 32 |1!2.0rc1|; . 1992|
|00001fa0| 2c 20 55 73 65 72 4c 61 | 6e 64 20 53 6f 66 74 77 |, UserLa|nd Softw|
|00001fb0| 61 72 65 65 72 65 00 00 | 01 00 00 00 01 36 00 00 |areere..|.....6..|
|00001fc0| 00 36 00 00 00 1e 00 ed | cb 18 0d 98 00 00 00 1c |.6......|........|
|00001fd0| 00 1e ff ff 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001fe0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ff0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+