home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / source / clintsrc.sit / TCPNameToAddr.c < prev    next >
MacBinary  |  1990-01-29  |  6.9 KB  |  [TEXT/MPS ]

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

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Mon Jan 29 13:52:19 1990, modified Mon Jan 29 13:52:19 1990, creator 'MPS ', type ASCII, 6484 bytes "TCPNameToAddr.c" , at 0x19d4 382 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MPS ]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0f 54 43 50 4e 61 6d | 65 54 6f 41 64 64 72 2e |..TCPNam|eToAddr.|
|00000010| 63 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |c.......|........|
|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 4d 50 53 | 20 01 00 00 00 00 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 00 19 54 00 | 00 01 7e a1 ea 41 63 a1 |......T.|..~..Ac.|
|00000060| ea 41 63 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.Ac.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 aa b7 00 00 |........|........|
|00000080| 2f 2a 0d 09 54 43 50 4e | 61 6d 65 54 6f 41 64 64 |/*..TCPN|ameToAdd|
|00000090| 72 28 68 6f 73 74 4e 61 | 6d 65 2c 74 69 6d 65 4f |r(hostNa|me,timeO|
|000000a0| 75 74 2c 68 6f 73 74 46 | 69 6c 65 29 20 2d 2d 20 |ut,hostF|ile) -- |
|000000b0| 52 65 74 75 72 6e 20 61 | 20 6c 69 73 74 20 6f 66 |Return a| list of|
|000000c0| 20 61 6c 74 65 72 6e 61 | 74 69 76 65 20 61 64 64 | alterna|tive add|
|000000d0| 72 65 73 73 65 73 20 66 | 6f 72 20 74 68 65 20 68 |resses f|or the h|
|000000e0| 6f 73 74 0d 09 09 6e 61 | 6d 65 20 73 70 65 63 69 |ost...na|me speci|
|000000f0| 66 69 65 64 2e 20 49 66 | 20 74 68 65 20 6e 61 6d |fied. If| the nam|
|00000100| 65 20 63 61 6e 27 74 20 | 62 65 20 72 65 73 6f 6c |e can't |be resol|
|00000110| 76 65 64 20 6c 6f 63 61 | 6c 6c 79 2c 20 67 6f 20 |ved loca|lly, go |
|00000120| 61 73 6b 20 61 20 6e 61 | 6d 65 20 73 65 72 76 65 |ask a na|me serve|
|00000130| 72 2e 20 49 66 20 69 74 | 20 63 61 6e 27 74 20 62 |r. If it| can't b|
|00000140| 65 20 72 65 73 6f 6c 76 | 65 64 0d 09 09 77 69 74 |e resolv|ed...wit|
|00000150| 68 69 6e 20 74 69 6d 65 | 4f 75 74 20 74 69 63 6b |hin time|Out tick|
|00000160| 73 2c 20 67 69 76 65 20 | 75 70 2e 20 54 68 65 20 |s, give |up. The |
|00000170| 68 6f 73 74 46 69 6c 65 | 20 70 61 72 61 6d 65 74 |hostFile| paramet|
|00000180| 65 72 20 67 69 76 65 73 | 20 74 68 65 20 66 69 6c |er gives| the fil|
|00000190| 65 20 6e 61 6d 65 20 6f | 66 20 61 20 6c 6f 63 61 |e name o|f a loca|
|000001a0| 6c 20 6e 61 6d 65 20 74 | 61 62 6c 65 0d 09 09 66 |l name t|able...f|
|000001b0| 69 6c 65 2e 20 54 68 65 | 20 6c 61 73 74 20 74 77 |ile. The| last tw|
|000001c0| 6f 20 70 61 72 61 6d 65 | 74 65 72 73 20 61 72 65 |o parame|ters are|
|000001d0| 20 6f 70 74 69 6f 6e 61 | 6c 2e 20 74 69 6d 65 4f | optiona|l. timeO|
|000001e0| 75 74 20 64 65 66 61 75 | 6c 74 73 20 74 6f 20 31 |ut defau|lts to 1|
|000001f0| 38 30 30 2e 20 68 6f 73 | 74 46 69 6c 65 20 64 65 |800. hos|tFile de|
|00000200| 66 61 75 6c 74 73 20 74 | 6f 20 6e 6f 6e 65 2e 0d |faults t|o none..|
|00000210| 0d 09 54 6f 20 63 6f 6d | 70 69 6c 65 20 61 6e 64 |..To com|pile and|
|00000220| 20 6c 69 6e 6b 20 74 68 | 69 73 20 66 69 6c 65 20 | link th|is file |
|00000230| 75 73 69 6e 67 20 4d 61 | 63 69 6e 74 6f 73 68 20 |using Ma|cintosh |
|00000240| 50 72 6f 67 72 61 6d 6d | 65 72 27 73 20 57 6f 72 |Programm|er's Wor|
|00000250| 6b 73 68 6f 70 2c 0d 0d | 09 09 63 20 2d 62 20 54 |kshop,..|..c -b T|
|00000260| 43 50 4e 61 6d 65 54 6f | 41 64 64 72 2e 70 0d 09 |CPNameTo|Addr.p..|
|00000270| 09 6c 69 6e 6b 20 2d 6d | 20 45 4e 54 52 59 50 4f |.link -m| ENTRYPO|
|00000280| 49 4e 54 20 2d 6f 20 22 | 54 43 50 20 58 43 4d 44 |INT -o "|TCP XCMD|
|00000290| 20 45 78 61 6d 70 6c 65 | 22 20 2d 72 74 20 58 46 | Example|" -rt XF|
|000002a0| 43 4e 3d 37 38 37 30 20 | 2d 73 6e 20 4d 61 69 6e |CN=7870 |-sn Main|
|000002b0| 3d 54 43 50 4e 61 6d 65 | 54 6f 41 64 64 72 20 b6 |=TCPName|ToAddr .|
|000002c0| 0d 09 09 09 54 43 50 4e | 61 6d 65 54 6f 41 64 64 |....TCPN|ameToAdd|
|000002d0| 72 2e 63 2e 6f 20 22 7b | 4c 69 62 72 61 72 69 65 |r.c.o "{|Librarie|
|000002e0| 73 7d 48 79 70 65 72 58 | 4c 69 62 2e 6f 22 20 22 |s}HyperX|Lib.o" "|
|000002f0| 7b 4c 69 62 72 61 72 69 | 65 73 7d 49 6e 74 65 72 |{Librari|es}Inter|
|00000300| 66 61 63 65 2e 6f 22 20 | 22 7b 43 4c 69 62 72 61 |face.o" |"{CLibra|
|00000310| 72 69 65 73 7d 43 49 6e | 74 65 72 66 61 63 65 2e |ries}CIn|terface.|
|00000320| 6f 22 20 b6 0d 09 09 09 | 22 7b 43 4c 69 62 72 61 |o" .....|"{CLibra|
|00000330| 72 69 65 73 7d 53 74 64 | 43 4c 69 62 2e 6f 22 0d |ries}Std|CLib.o".|
|00000340| 0d 09 a9 20 43 6f 70 79 | 72 69 67 68 74 20 31 39 |... Copy|right 19|
|00000350| 38 39 20 62 79 20 41 70 | 70 6c 65 20 43 6f 6d 70 |89 by Ap|ple Comp|
|00000360| 75 74 65 72 2c 20 49 6e | 63 2e 0d 0d 09 49 6e 69 |uter, In|c....Ini|
|00000370| 74 69 61 6c 20 63 6f 64 | 69 6e 67 20 33 2f 38 39 |tial cod|ing 3/89|
|00000380| 20 62 79 20 48 61 72 72 | 79 20 52 2e 20 43 68 65 | by Harr|y R. Che|
|00000390| 73 6c 65 79 2e 0d 09 0d | 09 55 6e 2d 58 43 4d 44 |sley....|.Un-XCMD|
|000003a0| 27 65 64 20 31 30 2f 38 | 39 20 62 79 20 47 72 65 |'ed 10/8|9 by Gre|
|000003b0| 67 20 41 6e 64 65 72 73 | 6f 6e 0d 2a 2f 0d 0d 23 |g Anders|on.*/..#|
|000003c0| 69 6e 63 6c 75 64 65 20 | 3c 4f 53 55 74 69 6c 73 |include |<OSUtils|
|000003d0| 2e 68 3e 0d 23 69 6e 63 | 6c 75 64 65 20 3c 45 72 |.h>.#inc|lude <Er|
|000003e0| 72 6f 72 73 2e 68 3e 0d | 23 69 6e 63 6c 75 64 65 |rors.h>.|#include|
|000003f0| 20 3c 46 69 6c 65 73 2e | 68 3e 0d 23 69 6e 63 6c | <Files.|h>.#incl|
|00000400| 75 64 65 20 3c 52 65 73 | 6f 75 72 63 65 73 2e 68 |ude <Res|ources.h|
|00000410| 3e 0d 23 69 6e 63 6c 75 | 64 65 20 3c 4d 65 6d 6f |>.#inclu|de <Memo|
|00000420| 72 79 2e 68 3e 0d 23 69 | 6e 63 6c 75 64 65 20 3c |ry.h>.#i|nclude <|
|00000430| 45 76 65 6e 74 73 2e 68 | 3e 0d 23 69 6e 63 6c 75 |Events.h|>.#inclu|
|00000440| 64 65 20 3c 48 79 70 65 | 72 58 43 6d 64 2e 68 3e |de <Hype|rXCmd.h>|
|00000450| 0d 23 69 6e 63 6c 75 64 | 65 20 3c 53 74 72 69 6e |.#includ|e <Strin|
|00000460| 67 2e 68 3e 0d 23 69 6e | 63 6c 75 64 65 20 22 4d |g.h>.#in|clude "M|
|00000470| 61 63 54 43 50 43 6f 6d | 6d 6f 6e 54 79 70 65 73 |acTCPCom|monTypes|
|00000480| 2e 68 22 0d 0d 2f 2a 20 | 44 4e 52 20 72 65 73 6f |.h"../* |DNR reso|
|00000490| 75 72 63 65 20 66 75 6e | 63 74 69 6f 6e 20 49 44 |urce fun|ction ID|
|000004a0| 73 2e 20 2a 2f 0d 23 64 | 65 66 69 6e 65 20 4f 50 |s. */.#d|efine OP|
|000004b0| 45 4e 52 45 53 4f 4c 56 | 45 52 20 31 0d 23 64 65 |ENRESOLV|ER 1.#de|
|000004c0| 66 69 6e 65 20 43 4c 4f | 53 45 52 45 53 4f 4c 56 |fine CLO|SERESOLV|
|000004d0| 45 52 20 32 0d 23 64 65 | 66 69 6e 65 20 53 54 52 |ER 2.#de|fine STR|
|000004e0| 54 4f 41 44 44 52 20 33 | 0d 23 64 65 66 69 6e 65 |TOADDR 3|.#define|
|000004f0| 09 41 44 44 52 54 4f 53 | 54 52 20 34 0d 23 64 65 |.ADDRTOS|TR 4.#de|
|00000500| 66 69 6e 65 09 45 4e 55 | 4d 43 41 43 48 45 20 35 |fine.ENU|MCACHE 5|
|00000510| 0d 23 64 65 66 69 6e 65 | 20 41 44 44 52 54 4f 4e |.#define| ADDRTON|
|00000520| 41 4d 45 20 36 0d 0d 2f | 2a 20 44 65 66 61 75 6c |AME 6../|* Defaul|
|00000530| 74 20 74 69 6d 65 2d 6f | 75 74 2e 20 2a 2f 0d 23 |t time-o|ut. */.#|
|00000540| 64 65 66 69 6e 65 20 44 | 45 46 41 55 4c 54 54 49 |define D|EFAULTTI|
|00000550| 43 4b 20 33 36 30 30 0d | 2f 2a 20 4d 69 6e 69 6d |CK 3600.|/* Minim|
|00000560| 75 6d 20 74 69 6d 65 2d | 6f 75 74 20 28 74 6f 20 |um time-|out (to |
|00000570| 66 69 78 20 62 75 67 20 | 69 6e 20 4d 61 63 54 43 |fix bug |in MacTC|
|00000580| 50 29 2e 20 2a 2f 0d 23 | 64 65 66 69 6e 65 20 4d |P). */.#|define M|
|00000590| 49 4e 54 49 43 4b 20 32 | 34 30 30 0d 0d 2f 2a 20 |INTICK 2|400../* |
|000005a0| 4e 75 6d 62 65 72 20 6f | 66 20 61 64 64 72 65 73 |Number o|f addres|
|000005b0| 73 65 73 20 72 65 74 75 | 72 6e 65 64 20 62 79 20 |ses retu|rned by |
|000005c0| 44 4e 52 2e 20 2a 2f 0d | 23 64 65 66 69 6e 65 20 |DNR. */.|#define |
|000005d0| 4e 55 4d 5f 41 4c 54 5f | 41 44 44 52 53 09 34 0d |NUM_ALT_|ADDRS.4.|
|000005e0| 0d 2f 2a 20 44 4e 52 20 | 72 65 74 75 72 6e 20 73 |./* DNR |return s|
|000005f0| 74 72 75 63 74 75 72 65 | 2e 20 2a 2f 0d 74 79 70 |tructure|. */.typ|
|00000600| 65 64 65 66 20 73 74 72 | 75 63 74 20 68 6f 73 74 |edef str|uct host|
|00000610| 49 6e 66 6f 20 7b 0d 09 | 69 6e 74 09 72 74 6e 43 |Info {..|int.rtnC|
|00000620| 6f 64 65 3b 09 09 09 09 | 09 09 09 09 09 09 09 2f |ode;....|......./|
|00000630| 2a 20 52 65 73 75 6c 74 | 20 63 6f 64 65 2e 20 2a |* Result| code. *|
|00000640| 2f 0d 09 63 68 61 72 20 | 63 6e 61 6d 65 5b 32 35 |/..char |cname[25|
|00000650| 35 5d 3b 09 09 09 09 09 | 09 09 09 09 09 2f 2a 20 |5];.....|...../* |
|00000660| 53 74 61 6e 64 61 72 64 | 20 6e 61 6d 65 2e 20 2a |Standard| name. *|
|00000670| 2f 0d 09 75 6e 73 69 67 | 6e 65 64 20 6c 6f 6e 67 |/..unsig|ned long|
|00000680| 20 61 64 64 72 5b 4e 55 | 4d 5f 41 4c 54 5f 41 44 | addr[NU|M_ALT_AD|
|00000690| 44 52 53 5d 3b 09 09 2f | 2a 20 41 64 64 72 65 73 |DRS];../|* Addres|
|000006a0| 73 65 73 2e 20 2a 2f 0d | 7d 3b 0d 0d 74 79 70 65 |ses. */.|};..type|
|000006b0| 64 65 66 20 4f 53 45 72 | 72 20 28 2a 4f 53 45 72 |def OSEr|r (*OSEr|
|000006c0| 72 50 72 6f 63 50 74 72 | 29 28 29 3b 0d 0d 73 68 |rProcPtr|)();..sh|
|000006d0| 6f 72 74 20 4e 61 6d 65 | 54 6f 41 64 64 72 28 68 |ort Name|ToAddr(h|
|000006e0| 6f 73 74 5f 6e 61 6d 65 | 2c 69 6e 65 74 5f 61 64 |ost_name|,inet_ad|
|000006f0| 64 72 2c 74 69 6d 65 6f | 75 74 29 0d 09 63 68 61 |dr,timeo|ut)..cha|
|00000700| 72 09 09 2a 68 6f 73 74 | 5f 6e 61 6d 65 3b 0d 09 |r..*host|_name;..|
|00000710| 6c 6f 6e 67 09 09 2a 69 | 6e 65 74 5f 61 64 64 72 |long..*i|net_addr|
|00000720| 2c 0d 09 09 09 09 74 69 | 6d 65 6f 75 74 3b 0d 7b |,.....ti|meout;.{|
|00000730| 0d 09 48 61 6e 64 6c 65 | 20 63 6f 64 65 48 6e 64 |..Handle| codeHnd|
|00000740| 6c 3b 09 09 09 09 2f 2a | 20 44 4e 52 20 63 6f 64 |l;..../*| DNR cod|
|00000750| 65 20 72 65 73 6f 75 72 | 63 65 20 68 61 6e 64 6c |e resour|ce handl|
|00000760| 65 2e 20 2a 2f 0d 09 4f | 53 45 72 72 50 72 6f 63 |e. */..O|SErrProc|
|00000770| 50 74 72 20 64 6e 72 3b | 09 09 09 09 2f 2a 20 50 |Ptr dnr;|..../* P|
|00000780| 6f 69 6e 74 65 72 20 74 | 6f 20 63 6f 64 65 20 72 |ointer t|o code r|
|00000790| 65 73 6f 75 72 63 65 2e | 20 2a 2f 0d 09 53 79 73 |esource.| */..Sys|
|000007a0| 45 6e 76 52 65 63 20 69 | 6e 66 6f 3b 09 09 09 09 |EnvRec i|nfo;....|
|000007b0| 09 2f 2a 20 53 79 73 74 | 65 6d 20 69 6e 66 6f 20 |./* Syst|em info |
|000007c0| 72 65 63 6f 72 64 20 28 | 74 6f 20 66 69 6e 64 20 |record (|to find |
|000007d0| 74 68 65 20 73 79 73 74 | 65 6d 20 76 6f 6c 75 6d |the syst|em volum|
|000007e0| 65 29 2e 20 2a 2f 0d 09 | 48 50 61 72 61 6d 42 6c |e). */..|HParamBl|
|000007f0| 6f 63 6b 52 65 63 20 66 | 69 3b 09 09 09 09 2f 2a |ockRec f|i;..../*|
|00000800| 20 50 61 72 61 6d 65 74 | 65 72 20 62 6c 6f 63 6b | Paramet|er block|
|00000810| 20 28 74 6f 20 66 69 6e | 64 20 74 68 65 20 4d 61 | (to fin|d the Ma|
|00000820| 63 54 43 50 20 66 69 6c | 65 29 2e 20 2a 2f 0d 09 |cTCP fil|e). */..|
|00000830| 53 74 72 32 35 35 20 66 | 69 6c 65 6e 61 6d 65 3b |Str255 f|ilename;|
|00000840| 09 09 09 09 2f 2a 20 46 | 69 6c 65 20 6e 61 6d 65 |..../* F|ile name|
|00000850| 20 28 66 6f 72 20 4d 61 | 63 54 43 50 20 66 69 6c | (for Ma|cTCP fil|
|00000860| 65 20 73 65 61 72 63 68 | 29 2e 20 2a 2f 0d 09 63 |e search|). */..c|
|00000870| 68 61 72 20 73 74 72 5b | 32 35 36 5d 3b 09 09 09 |har str[|256];...|
|00000880| 09 09 2f 2a 20 53 63 72 | 61 74 63 68 20 73 74 72 |../* Scr|atch str|
|00000890| 69 6e 67 2e 20 2a 2f 0d | 09 73 68 6f 72 74 20 72 |ing. */.|.short r|
|000008a0| 65 66 6e 75 6d 3b 09 09 | 09 09 09 2f 2a 20 52 65 |efnum;..|.../* Re|
|000008b0| 73 6f 75 72 63 65 20 66 | 69 6c 65 20 72 65 66 6e |source f|ile refn|
|000008c0| 75 6d 2e 20 2a 2f 0d 09 | 4f 53 45 72 72 20 72 63 |um. */..|OSErr rc|
|000008d0| 3b 09 09 09 09 09 09 2f | 2a 20 52 65 73 75 6c 74 |;....../|* Result|
|000008e0| 20 63 6f 64 65 20 72 65 | 74 75 72 6e 2e 20 2a 2f | code re|turn. */|
|000008f0| 0d 09 73 74 72 75 63 74 | 20 68 6f 73 74 49 6e 66 |..struct| hostInf|
|00000900| 6f 20 72 74 6e 53 74 72 | 75 63 74 3b 09 09 2f 2a |o rtnStr|uct;../*|
|00000910| 20 41 6e 73 77 65 72 20 | 66 72 6f 6d 20 44 4e 52 | Answer |from DNR|
|00000920| 2e 20 2a 2f 0d 09 73 74 | 72 75 63 74 20 68 6f 73 |. */..st|ruct hos|
|00000930| 74 49 6e 66 6f 20 63 61 | 63 68 65 46 6c 74 52 74 |tInfo ca|cheFltRt|
|00000940| 6e 3b 09 2f 2a 20 50 6c | 61 63 65 20 74 6f 20 72 |n;./* Pl|ace to r|
|00000950| 65 74 75 72 6e 20 74 68 | 65 20 61 6e 73 77 65 72 |eturn th|e answer|
|00000960| 20 69 66 20 74 68 65 72 | 65 27 73 20 61 20 63 61 | if ther|e's a ca|
|00000970| 63 68 65 20 66 61 75 6c | 74 2e 20 2a 2f 0d 09 6c |che faul|t. */..l|
|00000980| 6f 6e 67 20 6c 61 73 74 | 54 69 63 6b 3b 09 09 09 |ong last|Tick;...|
|00000990| 09 09 2f 2a 20 57 68 65 | 6e 20 74 6f 20 74 69 6d |../* Whe|n to tim|
|000009a0| 65 2d 6f 75 74 2e 20 2a | 2f 0d 09 70 61 73 63 61 |e-out. *|/..pasca|
|000009b0| 6c 20 76 6f 69 64 20 72 | 65 73 75 6c 74 50 72 6f |l void r|esultPro|
|000009c0| 63 28 29 3b 0d 0d 09 73 | 68 6f 72 74 20 6e 74 61 |c();...s|hort nta|
|000009d0| 45 72 72 20 3d 20 30 3b | 09 09 09 09 2f 2a 20 47 |Err = 0;|..../* G|
|000009e0| 41 20 20 4e 61 6d 65 54 | 6f 41 64 72 20 65 72 72 |A NameT|oAdr err|
|000009f0| 6f 72 20 2a 2f 0d 09 0d | 09 2a 69 6e 65 74 5f 61 |or */...|.*inet_a|
|00000a00| 64 64 72 20 3d 20 30 3b | 09 2f 2a 20 47 41 20 2a |ddr = 0;|./* GA *|
|00000a10| 2f 0d 09 2a 66 69 6c 65 | 6e 61 6d 65 20 3d 20 30 |/..*file|name = 0|
|00000a20| 3b 20 2f 2a 20 47 41 20 | 2a 2f 0d 09 0d 09 2f 2a |; /* GA |*/..../*|
|00000a30| 20 47 65 74 20 74 68 65 | 20 73 79 73 74 65 6d 20 | Get the| system |
|00000a40| 76 6f 6c 75 6d 65 2e 20 | 2a 2f 0d 09 53 79 73 45 |volume. |*/..SysE|
|00000a50| 6e 76 69 72 6f 6e 73 28 | 31 2c 20 26 69 6e 66 6f |nvirons(|1, &info|
|00000a60| 29 3b 0d 0d 09 2f 2a 20 | 50 72 65 70 61 72 65 20 |);.../* |Prepare |
|00000a70| 74 6f 20 73 63 61 6e 20 | 66 6f 72 20 74 68 65 20 |to scan |for the |
|00000a80| 4d 61 63 54 43 50 20 66 | 69 6c 65 20 28 77 68 65 |MacTCP f|ile (whe|
|00000a90| 72 65 20 77 65 27 6c 6c | 20 66 69 6e 64 20 74 68 |re we'll| find th|
|00000aa0| 65 20 44 4e 52 20 63 6f | 64 65 20 72 65 73 6f 75 |e DNR co|de resou|
|00000ab0| 72 63 65 29 2e 20 2a 2f | 0d 09 66 69 2e 66 69 6c |rce). */|..fi.fil|
|00000ac0| 65 50 61 72 61 6d 2e 69 | 6f 43 6f 6d 70 6c 65 74 |eParam.i|oComplet|
|00000ad0| 69 6f 6e 20 3d 20 6e 69 | 6c 3b 0d 09 66 69 2e 66 |ion = ni|l;..fi.f|
|00000ae0| 69 6c 65 50 61 72 61 6d | 2e 69 6f 4e 61 6d 65 50 |ileParam|.ioNameP|
|00000af0| 74 72 20 3d 20 26 66 69 | 6c 65 6e 61 6d 65 3b 0d |tr = &fi|lename;.|
|00000b00| 09 66 69 2e 66 69 6c 65 | 50 61 72 61 6d 2e 69 6f |.fi.file|Param.io|
|00000b10| 56 52 65 66 4e 75 6d 20 | 3d 20 69 6e 66 6f 2e 73 |VRefNum |= info.s|
|00000b20| 79 73 56 52 65 66 4e 75 | 6d 3b 0d 09 66 69 2e 66 |ysVRefNu|m;..fi.f|
|00000b30| 69 6c 65 50 61 72 61 6d | 2e 69 6f 44 69 72 49 44 |ileParam|.ioDirID|
|00000b40| 20 3d 20 30 3b 0d 09 66 | 69 2e 66 69 6c 65 50 61 | = 0;..f|i.filePa|
|00000b50| 72 61 6d 2e 69 6f 46 44 | 69 72 49 6e 64 65 78 20 |ram.ioFD|irIndex |
|00000b60| 3d 20 31 3b 0d 09 72 65 | 66 6e 75 6d 20 3d 20 2d |= 1;..re|fnum = -|
|00000b70| 31 3b 0d 09 2f 2a 20 53 | 63 61 6e 20 66 6f 72 20 |1;../* S|can for |
|00000b80| 4d 61 63 54 43 50 20 66 | 69 6c 65 2e 20 2a 2f 0d |MacTCP f|ile. */.|
|00000b90| 09 77 68 69 6c 65 20 28 | 50 42 48 47 65 74 46 49 |.while (|PBHGetFI|
|00000ba0| 6e 66 6f 28 26 66 69 2c | 20 66 61 6c 73 65 29 20 |nfo(&fi,| false) |
|00000bb0| 3d 3d 20 6e 6f 45 72 72 | 29 20 7b 0d 09 09 2f 2a |== noErr|) {.../*|
|00000bc0| 20 73 63 61 6e 20 73 79 | 73 74 65 6d 20 66 6f 6c | scan sy|stem fol|
|00000bd0| 64 65 72 20 66 6f 72 20 | 64 72 69 76 65 72 20 72 |der for |driver r|
|00000be0| 65 73 6f 75 72 63 65 20 | 66 69 6c 65 73 20 6f 66 |esource |files of|
|00000bf0| 20 73 70 65 63 69 66 69 | 63 20 74 79 70 65 20 26 | specifi|c type &|
|00000c00| 20 63 72 65 61 74 6f 72 | 20 2a 2f 0d 09 09 69 66 | creator| */...if|
|00000c10| 20 28 66 69 2e 66 69 6c | 65 50 61 72 61 6d 2e 69 | (fi.fil|eParam.i|
|00000c20| 6f 46 6c 46 6e 64 72 49 | 6e 66 6f 2e 66 64 54 79 |oFlFndrI|nfo.fdTy|
|00000c30| 70 65 20 3d 3d 20 27 63 | 64 65 76 27 20 26 26 0d |pe == 'c|dev' &&.|
|00000c40| 09 09 09 66 69 2e 66 69 | 6c 65 50 61 72 61 6d 2e |...fi.fi|leParam.|
|00000c50| 69 6f 46 6c 46 6e 64 72 | 49 6e 66 6f 2e 66 64 43 |ioFlFndr|Info.fdC|
|00000c60| 72 65 61 74 6f 72 20 3d | 3d 20 27 6d 74 63 70 27 |reator =|= 'mtcp'|
|00000c70| 29 20 7b 0d 09 09 09 2f | 2a 20 46 6f 75 6e 64 20 |) {..../|* Found |
|00000c80| 74 68 65 20 4d 61 63 54 | 43 50 20 64 72 69 76 65 |the MacT|CP drive|
|00000c90| 72 20 66 69 6c 65 2e 20 | 2a 2f 0d 09 09 09 53 65 |r file. |*/....Se|
|00000ca0| 74 56 6f 6c 28 6e 69 6c | 2c 66 69 2e 66 69 6c 65 |tVol(nil|,fi.file|
|00000cb0| 50 61 72 61 6d 2e 69 6f | 56 52 65 66 4e 75 6d 29 |Param.io|VRefNum)|
|00000cc0| 3b 0d 09 09 09 72 65 66 | 6e 75 6d 20 3d 20 4f 70 |;....ref|num = Op|
|00000cd0| 65 6e 52 65 73 46 69 6c | 65 28 26 66 69 6c 65 6e |enResFil|e(&filen|
|00000ce0| 61 6d 65 29 3b 0d 09 09 | 09 62 72 65 61 6b 3b 0d |ame);...|.break;.|
|00000cf0| 09 09 7d 3b 0d 09 09 2f | 2a 20 43 68 65 63 6b 20 |..};.../|* Check |
|00000d00| 6e 65 78 74 20 66 69 6c | 65 20 69 6e 20 73 79 73 |next fil|e in sys|
|00000d10| 74 65 6d 20 66 6f 6c 64 | 65 72 2e 20 2a 2f 0d 09 |tem fold|er. */..|
|00000d20| 09 66 69 2e 66 69 6c 65 | 50 61 72 61 6d 2e 69 6f |.fi.file|Param.io|
|00000d30| 46 44 69 72 49 6e 64 65 | 78 2b 2b 3b 0d 09 09 66 |FDirInde|x++;...f|
|00000d40| 69 2e 66 69 6c 65 50 61 | 72 61 6d 2e 69 6f 44 69 |i.filePa|ram.ioDi|
|00000d50| 72 49 44 20 3d 20 30 3b | 0d 09 7d 3b 0d 09 0d 09 |rID = 0;|..};....|
|00000d60| 2f 2a 20 49 67 6e 6f 72 | 65 20 66 61 69 6c 75 72 |/* Ignor|e failur|
|00000d70| 65 73 20 73 69 6e 63 65 | 20 74 68 65 20 72 65 73 |es since| the res|
|00000d80| 6f 75 72 63 65 20 6d 61 | 79 20 68 61 76 65 20 62 |ource ma|y have b|
|00000d90| 65 65 6e 20 69 6e 73 74 | 61 6c 6c 65 64 20 69 6e |een inst|alled in|
|00000da0| 20 74 68 65 20 0d 09 20 | 20 20 53 79 73 74 65 6d | the .. | System|
|00000db0| 20 66 69 6c 65 20 69 66 | 20 72 75 6e 6e 69 6e 67 | file if| running|
|00000dc0| 20 6f 6e 20 61 20 4d 61 | 63 20 35 31 32 4b 65 2e | on a Ma|c 512Ke.|
|00000dd0| 20 2a 2f 0d 09 20 20 20 | 0d 09 2f 2a 20 4c 6f 61 | */.. |../* Loa|
|00000de0| 64 20 69 6e 20 74 68 65 | 20 44 4e 52 20 72 65 73 |d in the| DNR res|
|00000df0| 6f 75 72 63 65 20 70 61 | 63 6b 61 67 65 2e 20 2a |ource pa|ckage. *|
|00000e00| 2f 0d 09 63 6f 64 65 48 | 6e 64 6c 20 3d 20 47 65 |/..codeH|ndl = Ge|
|00000e10| 74 49 6e 64 52 65 73 6f | 75 72 63 65 28 27 64 6e |tIndReso|urce('dn|
|00000e20| 72 70 27 2c 20 31 29 3b | 0d 09 69 66 20 28 63 6f |rp', 1);|..if (co|
|00000e30| 64 65 48 6e 64 6c 20 3d | 3d 20 6e 69 6c 29 20 7b |deHndl =|= nil) {|
|00000e40| 0d 09 09 69 66 20 28 72 | 65 66 6e 75 6d 20 21 3d |...if (r|efnum !=|
|00000e50| 20 2d 31 29 20 43 6c 6f | 73 65 52 65 73 46 69 6c | -1) Clo|seResFil|
|00000e60| 65 28 72 65 66 6e 75 6d | 29 3b 0d 09 09 2f 2a 20 |e(refnum|);.../* |
|00000e70| 65 72 72 41 62 6f 72 74 | 28 70 61 72 61 6d 50 74 |errAbort|(paramPt|
|00000e80| 72 2c 22 a4 a4 a4 20 63 | 6f 75 6c 64 6e 27 74 20 |r,"... c|ouldn't |
|00000e90| 6f 70 65 6e 20 72 65 73 | 6f 75 72 63 65 20 a4 a4 |open res|ource ..|
|00000ea0| a4 22 29 3b 20 2a 2f 0d | 09 09 72 65 74 75 72 6e |."); */.|..return|
|00000eb0| 28 2d 31 29 3b 0d 09 7d | 3b 0d 09 44 65 74 61 63 |(-1);..}|;..Detac|
|00000ec0| 68 52 65 73 6f 75 72 63 | 65 28 63 6f 64 65 48 6e |hResourc|e(codeHn|
|00000ed0| 64 6c 29 3b 0d 09 69 66 | 20 28 72 65 66 6e 75 6d |dl);..if| (refnum|
|00000ee0| 20 21 3d 20 2d 31 29 20 | 43 6c 6f 73 65 52 65 73 | != -1) |CloseRes|
|00000ef0| 46 69 6c 65 28 72 65 66 | 6e 75 6d 29 3b 0d 09 09 |File(ref|num);...|
|00000f00| 0d 09 2f 2a 20 4c 6f 63 | 6b 20 74 68 65 20 44 4e |../* Loc|k the DN|
|00000f10| 52 20 72 65 73 6f 75 72 | 63 65 20 73 6f 20 69 74 |R resour|ce so it|
|00000f20| 20 63 61 6e 6e 6f 74 20 | 62 65 20 72 65 6c 6f 63 | cannot |be reloc|
|00000f30| 61 74 65 64 20 77 68 69 | 6c 65 20 6f 70 65 6e 65 |ated whi|le opene|
|00000f40| 64 2e 20 2a 2f 0d 09 48 | 4c 6f 63 6b 28 63 6f 64 |d. */..H|Lock(cod|
|00000f50| 65 48 6e 64 6c 29 3b 0d | 09 64 6e 72 20 3d 20 28 |eHndl);.|.dnr = (|
|00000f60| 4f 53 45 72 72 50 72 6f | 63 50 74 72 29 20 2a 63 |OSErrPro|cPtr) *c|
|00000f70| 6f 64 65 48 6e 64 6c 3b | 0d 09 69 66 28 20 21 64 |odeHndl;|..if( !d|
|00000f80| 6e 72 20 29 20 72 65 74 | 75 72 6e 28 20 2d 32 20 |nr ) ret|urn( -2 |
|00000f90| 29 3b 09 09 09 2f 2a 20 | 47 41 20 2d 2d 20 6a 75 |);.../* |GA -- ju|
|00000fa0| 73 74 20 63 68 65 63 6b | 69 6e 67 20 2a 2f 0d 09 |st check|ing */..|
|00000fb0| 0d 09 2f 2a 20 43 61 6c | 6c 20 6f 70 65 6e 20 72 |../* Cal|l open r|
|00000fc0| 65 73 6f 6c 76 65 72 2e | 20 2a 2f 0d 09 2a 73 74 |esolver.| */..*st|
|00000fd0| 72 20 3d 20 30 3b 09 2f | 2a 20 46 69 6c 6c 20 69 |r = 0;./|* Fill i|
|00000fe0| 6e 20 70 61 74 68 2f 66 | 69 6c 65 6e 61 6d 65 20 |n path/f|ilename |
|00000ff0| 6f 66 20 48 4f 53 54 20 | 66 69 6c 65 20 68 65 72 |of HOST |file her|
|00001000| 65 20 2a 2f 0d 09 0d 09 | 2f 2a 2a 2a 0d 09 20 2a |e */....|/***.. *|
|00001010| 2a 2a 20 20 20 54 48 49 | 53 20 43 41 4c 4c 20 4f |** THI|S CALL O|
|00001020| 46 54 45 4e 20 44 49 45 | 53 20 55 4e 44 45 52 20 |FTEN DIE|S UNDER |
|00001030| 4d 55 4c 54 49 46 49 4e | 44 45 52 21 21 21 20 20 |MULTIFIN|DER!!! |
|00001040| 4f 75 74 20 6f 66 20 4d | 72 2e 20 4d 65 6d 6f 72 |Out of M|r. Memor|
|00001050| 79 20 65 72 72 6f 72 2e | 0d 09 20 2a 2a 2a 2f 0d |y error.|.. ***/.|
|00001060| 09 72 63 20 3d 20 28 2a | 64 6e 72 29 28 4f 50 45 |.rc = (*|dnr)(OPE|
|00001070| 4e 52 45 53 4f 4c 56 45 | 52 2c 20 73 74 72 29 3b |NRESOLVE|R, str);|
|00001080| 0d 09 2f 2a 2a 2a 2f 0d | 09 0d 09 69 66 20 28 72 |../***/.|...if (r|
|00001090| 63 20 21 3d 20 6e 6f 45 | 72 72 29 20 7b 0d 09 09 |c != noE|rr) {...|
|000010a0| 2f 2a 20 50 72 6f 62 6c | 65 6d 20 77 69 74 68 20 |/* Probl|em with |
|000010b0| 6f 70 65 6e 20 72 65 73 | 6f 6c 76 65 72 2c 20 66 |open res|olver, f|
|000010c0| 6c 75 73 68 20 69 74 2e | 20 2a 2f 0d 09 09 48 55 |lush it.| */...HU|
|000010d0| 6e 6c 6f 63 6b 28 63 6f | 64 65 48 6e 64 6c 29 3b |nlock(co|deHndl);|
|000010e0| 0d 09 09 44 69 73 70 6f | 73 48 61 6e 64 6c 65 28 |...Dispo|sHandle(|
|000010f0| 63 6f 64 65 48 6e 64 6c | 29 3b 0d 09 09 2f 2a 20 |codeHndl|);.../* |
|00001100| 65 72 72 41 62 6f 72 74 | 28 70 61 72 61 6d 50 74 |errAbort|(paramPt|
|00001110| 72 2c 22 a4 a4 a4 20 64 | 6f 6d 61 69 6e 20 6e 61 |r,"... d|omain na|
|00001120| 6d 65 20 72 65 73 6f 6c | 76 65 72 20 66 61 69 6c |me resol|ver fail|
|00001130| 65 64 20 a4 a4 a4 22 29 | 3b 20 2a 2f 0d 09 09 72 |ed ...")|; */...r|
|00001140| 65 74 75 72 6e 28 2d 32 | 29 3b 0d 09 7d 3b 0d 0d |eturn(-2|);..};..|
|00001150| 09 2f 2a 20 47 65 74 20 | 74 68 65 20 61 64 64 72 |./* Get |the addr|
|00001160| 65 73 73 2e 20 2a 2f 0d | 09 73 74 72 63 70 79 28 |ess. */.|.strcpy(|
|00001170| 73 74 72 2c 68 6f 73 74 | 5f 6e 61 6d 65 29 3b 20 |str,host|_name); |
|00001180| 0d 09 63 61 63 68 65 46 | 6c 74 52 74 6e 2e 72 74 |..cacheF|ltRtn.rt|
|00001190| 6e 43 6f 64 65 20 3d 20 | 31 3b 0d 09 72 63 20 3d |nCode = |1;..rc =|
|000011a0| 20 28 2a 64 6e 72 29 28 | 53 54 52 54 4f 41 44 44 | (*dnr)(|STRTOADD|
|000011b0| 52 2c 20 73 74 72 2c 20 | 26 72 74 6e 53 74 72 75 |R, str, |&rtnStru|
|000011c0| 63 74 2c 20 72 65 73 75 | 6c 74 50 72 6f 63 2c 20 |ct, resu|ltProc, |
|000011d0| 26 63 61 63 68 65 46 6c | 74 52 74 6e 29 3b 0d 0d |&cacheFl|tRtn);..|
|000011e0| 09 2f 2a 20 49 66 20 77 | 65 20 63 6f 75 6c 64 6e |./* If w|e couldn|
|000011f0| 27 74 20 67 65 74 20 69 | 74 20 72 69 67 68 74 20 |'t get i|t right |
|00001200| 61 77 61 79 2c 20 77 61 | 69 74 20 66 6f 72 20 69 |away, wa|it for i|
|00001210| 74 2e 20 2a 2f 0d 09 69 | 66 20 28 72 63 20 3d 3d |t. */..i|f (rc ==|
|00001220| 20 63 61 63 68 65 46 61 | 75 6c 74 29 0d 09 7b 0d | cacheFa|ult)..{.|
|00001230| 09 09 2f 2a 20 47 41 20 | 2a 2f 0d 09 09 69 66 28 |../* GA |*/...if(|
|00001240| 20 74 69 6d 65 6f 75 74 | 20 3d 3d 20 30 20 29 20 | timeout| == 0 ) |
|00001250| 74 69 6d 65 6f 75 74 20 | 3d 20 44 45 46 41 55 4c |timeout |= DEFAUL|
|00001260| 54 54 49 43 4b 3b 0d 09 | 09 69 66 28 20 74 69 6d |TTICK;..|.if( tim|
|00001270| 65 6f 75 74 20 3c 20 4d | 49 4e 54 49 43 4b 20 29 |eout < M|INTICK )|
|00001280| 20 74 69 6d 65 6f 75 74 | 20 3d 20 4d 49 4e 54 49 | timeout| = MINTI|
|00001290| 43 4b 3b 0d 09 09 6c 61 | 73 74 54 69 63 6b 20 3d |CK;...la|stTick =|
|000012a0| 20 54 69 63 6b 43 6f 75 | 6e 74 28 29 20 2b 20 74 | TickCou|nt() + t|
|000012b0| 69 6d 65 6f 75 74 3b 0d | 09 09 0d 09 09 2f 2a 2a |imeout;.|...../**|
|000012c0| 2a 2a 20 58 43 4d 44 20 | 76 65 72 73 69 6f 6e 3a |** XCMD |version:|
|000012d0| 0d 09 09 69 66 20 28 28 | 70 61 72 61 6d 50 74 72 |...if ((|paramPtr|
|000012e0| 2d 3e 70 61 72 61 6d 43 | 6f 75 6e 74 20 3c 20 32 |->paramC|ount < 2|
|000012f0| 29 20 7c 7c 20 28 70 61 | 72 61 6d 50 74 72 2d 3e |) || (pa|ramPtr->|
|00001300| 70 61 72 61 6d 73 5b 31 | 5d 20 3d 3d 20 6e 69 6c |params[1|] == nil|
|00001310| 29 29 20 6c 61 73 74 54 | 69 63 6b 20 3d 20 54 69 |)) lastT|ick = Ti|
|00001320| 63 6b 43 6f 75 6e 74 28 | 29 20 2b 20 44 45 46 41 |ckCount(|) + DEFA|
|00001330| 55 4c 54 54 49 43 4b 3b | 0d 09 09 65 6c 73 65 20 |ULTTICK;|...else |
|00001340| 69 66 20 28 2a 2a 70 61 | 72 61 6d 50 74 72 2d 3e |if (**pa|ramPtr->|
|00001350| 70 61 72 61 6d 73 5b 31 | 5d 20 3d 3d 20 30 29 20 |params[1|] == 0) |
|00001360| 6c 61 73 74 54 69 63 6b | 20 3d 20 54 69 63 6b 43 |lastTick| = TickC|
|00001370| 6f 75 6e 74 28 29 20 2b | 20 44 45 46 41 55 4c 54 |ount() +| DEFAULT|
|00001380| 54 49 43 4b 3b 0d 09 09 | 65 6c 73 65 20 7b 0d 09 |TICK;...|else {..|
|00001390| 09 09 5a 65 72 6f 54 6f | 50 61 73 28 70 61 72 61 |..ZeroTo|Pas(para|
|000013a0| 6d 50 74 72 2c 2a 28 70 | 61 72 61 6d 50 74 72 2d |mPtr,*(p|aramPtr-|
|000013b0| 3e 70 61 72 61 6d 73 5b | 31 5d 29 2c 73 74 72 29 |>params[|1]),str)|
|000013c0| 3b 0d 09 09 09 69 66 20 | 28 28 6c 61 73 74 54 69 |;....if |((lastTi|
|000013d0| 63 6b 20 3d 20 53 74 72 | 54 6f 4e 75 6d 28 70 61 |ck = Str|ToNum(pa|
|000013e0| 72 61 6d 50 74 72 2c 73 | 74 72 29 29 20 3e 20 4d |ramPtr,s|tr)) > M|
|000013f0| 49 4e 54 49 43 4b 29 20 | 6c 61 73 74 54 69 63 6b |INTICK) |lastTick|
|00001400| 20 3d 20 4d 49 4e 54 49 | 43 4b 3b 0d 09 09 09 6c | = MINTI|CK;....l|
|00001410| 61 73 74 54 69 63 6b 20 | 3d 20 6c 61 73 74 54 69 |astTick |= lastTi|
|00001420| 63 6b 20 2b 20 54 69 63 | 6b 43 6f 75 6e 74 28 29 |ck + Tic|kCount()|
|00001430| 3b 0d 09 09 7d 3b 0d 09 | 09 2a 2a 2a 2a 2a 2a 2f |;...};..|.******/|
|00001440| 0d 09 09 77 68 69 6c 65 | 20 28 28 54 69 63 6b 43 |...while| ((TickC|
|00001450| 6f 75 6e 74 28 29 20 3c | 20 6c 61 73 74 54 69 63 |ount() <| lastTic|
|00001460| 6b 29 20 26 26 20 28 63 | 61 63 68 65 46 6c 74 52 |k) && (c|acheFltR|
|00001470| 74 6e 2e 72 74 6e 43 6f | 64 65 20 3e 20 30 29 29 |tn.rtnCo|de > 0))|
|00001480| 3b 0d 09 09 72 74 6e 53 | 74 72 75 63 74 20 3d 20 |;...rtnS|truct = |
|00001490| 63 61 63 68 65 46 6c 74 | 52 74 6e 3b 0d 09 7d 20 |cacheFlt|Rtn;..} |
|000014a0| 65 6c 73 65 20 72 74 6e | 53 74 72 75 63 74 2e 72 |else rtn|Struct.r|
|000014b0| 74 6e 43 6f 64 65 20 3d | 20 72 63 3b 0d 0d 09 2f |tnCode =| rc;.../|
|000014c0| 2a 20 43 68 65 63 6b 20 | 69 66 20 77 65 20 67 6f |* Check |if we go|
|000014d0| 74 20 69 74 20 4f 4b 20 | 6f 72 20 6e 6f 74 2e 20 |t it OK |or not. |
|000014e0| 2a 2f 0d 09 69 66 20 28 | 72 74 6e 53 74 72 75 63 |*/..if (|rtnStruc|
|000014f0| 74 2e 72 74 6e 43 6f 64 | 65 20 3d 3d 20 6e 6f 45 |t.rtnCod|e == noE|
|00001500| 72 72 29 0d 09 7b 0d 09 | 09 2a 69 6e 65 74 5f 61 |rr)..{..|.*inet_a|
|00001510| 64 64 72 20 3d 20 72 74 | 6e 53 74 72 75 63 74 2e |ddr = rt|nStruct.|
|00001520| 61 64 64 72 5b 30 5d 3b | 09 2f 2a 20 47 41 20 2a |addr[0];|./* GA *|
|00001530| 2f 0d 09 09 0d 09 09 2f | 2a 20 57 65 20 64 69 64 |/....../|* We did|
|00001540| 2c 20 73 6f 20 62 75 69 | 6c 64 20 74 68 65 20 72 |, so bui|ld the r|
|00001550| 65 73 75 6c 74 20 73 74 | 72 69 6e 67 2e 20 2a 2f |esult st|ring. */|
|00001560| 0d 09 09 2f 2a 2a 2a 2a | 20 44 6f 6e 27 74 20 72 |.../****| Don't r|
|00001570| 65 74 75 72 6e 20 61 20 | 73 74 72 69 6e 67 0d 09 |eturn a |string..|
|00001580| 09 66 6f 72 20 28 69 20 | 3d 20 30 3b 20 69 20 3c |.for (i |= 0; i <|
|00001590| 20 4e 55 4d 5f 41 4c 54 | 5f 41 44 44 52 53 3b 20 | NUM_ALT|_ADDRS; |
|000015a0| 69 2b 2b 29 20 7b 0d 09 | 09 09 69 66 20 28 72 74 |i++) {..|..if (rt|
|000015b0| 6e 53 74 72 75 63 74 2e | 61 64 64 72 5b 69 5d 20 |nStruct.|addr[i] |
|000015c0| 3d 3d 20 30 29 20 62 72 | 65 61 6b 3b 0d 09 09 09 |== 0) br|eak;....|
|000015d0| 69 66 20 28 69 20 3e 20 | 30 29 20 73 74 72 63 61 |if (i > |0) strca|
|000015e0| 74 28 72 65 73 75 6c 74 | 53 74 72 2c 22 2c 22 29 |t(result|Str,",")|
|000015f0| 3b 0d 09 09 09 4e 75 6d | 54 6f 53 74 72 28 70 61 |;....Num|ToStr(pa|
|00001600| 72 61 6d 50 74 72 2c 72 | 74 6e 53 74 72 75 63 74 |ramPtr,r|tnStruct|
|00001610| 2e 61 64 64 72 5b 69 5d | 2c 73 74 72 29 3b 0d 09 |.addr[i]|,str);..|
|00001620| 09 09 70 32 63 73 74 72 | 28 73 74 72 29 3b 0d 09 |..p2cstr|(str);..|
|00001630| 09 09 73 74 72 63 61 74 | 28 72 65 73 75 6c 74 53 |..strcat|(resultS|
|00001640| 74 72 2c 73 74 72 29 3b | 0d 09 09 7d 3b 0d 09 09 |tr,str);|...};...|
|00001650| 2a 2a 2a 2a 2a 2f 0d 09 | 09 2f 2a 20 4d 61 6b 65 |*****/..|./* Make|
|00001660| 20 74 68 65 20 68 61 6e | 64 6c 65 20 74 6f 20 72 | the han|dle to r|
|00001670| 65 74 75 72 6e 2e 20 2a | 2f 0d 09 09 2f 2a 2a 2a |eturn. *|/.../***|
|00001680| 2a 2a 2a 20 4f 6e 6c 79 | 20 6e 65 65 64 65 64 20 |*** Only| needed |
|00001690| 69 6e 20 58 43 4d 44 0d | 09 09 72 65 73 75 6c 74 |in XCMD.|..result|
|000016a0| 48 61 6e 64 20 3d 20 4e | 65 77 48 61 6e 64 6c 65 |Hand = N|ewHandle|
|000016b0| 28 28 6c 6f 6e 67 29 20 | 73 74 72 6c 65 6e 28 72 |((long) |strlen(r|
|000016c0| 65 73 75 6c 74 53 74 72 | 29 2b 31 29 3b 0d 09 09 |esultStr|)+1);...|
|000016d0| 69 66 20 28 72 65 73 75 | 6c 74 48 61 6e 64 20 21 |if (resu|ltHand !|
|000016e0| 3d 20 6e 69 6c 29 20 7b | 0d 09 09 09 73 74 72 63 |= nil) {|....strc|
|000016f0| 70 79 28 2a 72 65 73 75 | 6c 74 48 61 6e 64 2c 72 |py(*resu|ltHand,r|
|00001700| 65 73 75 6c 74 53 74 72 | 29 3b 0d 09 09 09 70 61 |esultStr|);....pa|
|00001710| 72 61 6d 50 74 72 2d 3e | 72 65 74 75 72 6e 56 61 |ramPtr->|returnVa|
|00001720| 6c 75 65 20 3d 20 72 65 | 73 75 6c 74 48 61 6e 64 |lue = re|sultHand|
|00001730| 3b 0d 09 09 7d 20 65 6c | 73 65 20 65 72 72 41 62 |;...} el|se errAb|
|00001740| 6f 72 74 28 70 61 72 61 | 6d 50 74 72 2c 22 a4 a4 |ort(para|mPtr,"..|
|00001750| a4 20 63 6f 75 6c 64 6e | 27 74 20 6d 61 6b 65 20 |. couldn|'t make |
|00001760| 72 65 73 75 6c 74 20 73 | 74 72 69 6e 67 20 a4 a4 |result s|tring ..|
|00001770| a4 22 29 3b 0d 09 09 2a | 2a 2a 2a 2a 2a 2a 2f 0d |.");...*|******/.|
|00001780| 09 7d 0d 09 65 6c 73 65 | 20 69 66 20 28 72 74 6e |.}..else| if (rtn|
|00001790| 53 74 72 75 63 74 2e 72 | 74 6e 43 6f 64 65 20 3d |Struct.r|tnCode =|
|000017a0| 3d 20 31 29 0d 09 7b 0d | 09 09 2f 2a 20 65 72 72 |= 1)..{.|../* err|
|000017b0| 41 62 6f 72 74 28 22 a4 | a4 a4 20 74 69 6d 65 2d |Abort(".|.. time-|
|000017c0| 6f 75 74 20 a4 a4 a4 22 | 29 3b 20 2a 2f 0d 09 09 |out ..."|); */...|
|000017d0| 6e 74 61 45 72 72 20 3d | 20 2d 33 3b 0d 09 7d 0d |ntaErr =| -3;..}.|
|000017e0| 09 65 6c 73 65 0d 09 7b | 0d 09 09 2f 2a 20 65 72 |.else..{|.../* er|
|000017f0| 72 41 62 6f 72 74 28 70 | 61 72 61 6d 50 74 72 2c |rAbort(p|aramPtr,|
|00001800| 22 a4 a4 a4 20 63 6f 75 | 6c 64 6e 27 74 20 67 65 |"... cou|ldn't ge|
|00001810| 74 20 61 64 64 72 65 73 | 73 20 a4 a4 a4 22 29 3b |t addres|s ...");|
|00001820| 20 2a 2f 0d 09 09 6e 74 | 61 45 72 72 20 3d 20 2d | */...nt|aErr = -|
|00001830| 34 3b 0d 09 7d 0d 0d 09 | 2f 2a 20 43 61 6c 6c 20 |4;..}...|/* Call |
|00001840| 63 6c 6f 73 65 20 72 65 | 73 6f 6c 76 65 72 2e 20 |close re|solver. |
|00001850| 2a 2f 0d 09 28 76 6f 69 | 64 29 20 28 2a 64 6e 72 |*/..(voi|d) (*dnr|
|00001860| 29 28 43 4c 4f 53 45 52 | 45 53 4f 4c 56 45 52 29 |)(CLOSER|ESOLVER)|
|00001870| 3b 0d 0d 09 2f 2a 20 52 | 65 6c 65 61 73 65 20 74 |;.../* R|elease t|
|00001880| 68 65 20 44 4e 52 20 72 | 65 73 6f 75 72 63 65 20 |he DNR r|esource |
|00001890| 70 61 63 6b 61 67 65 2e | 20 2a 2f 0d 09 48 55 6e |package.| */..HUn|
|000018a0| 6c 6f 63 6b 28 63 6f 64 | 65 48 6e 64 6c 29 3b 0d |lock(cod|eHndl);.|
|000018b0| 09 44 69 73 70 6f 73 48 | 61 6e 64 6c 65 28 63 6f |.DisposH|andle(co|
|000018c0| 64 65 48 6e 64 6c 29 3b | 0d 09 0d 09 72 65 74 75 |deHndl);|....retu|
|000018d0| 72 6e 28 20 6e 74 61 45 | 72 72 20 29 3b 0d 7d 0d |rn( ntaE|rr );.}.|
|000018e0| 0d 2f 2a 20 41 73 79 6e | 63 20 72 6f 75 74 69 6e |./* Asyn|c routin|
|000018f0| 65 20 63 61 6c 6c 65 64 | 20 77 68 65 6e 20 6e 61 |e called| when na|
|00001900| 6d 65 20 69 73 20 66 6f | 75 6e 64 20 66 72 6f 6d |me is fo|und from|
|00001910| 20 6e 61 6d 65 20 73 65 | 72 76 65 72 2e 20 57 65 | name se|rver. We|
|00001920| 20 6a 75 73 74 20 63 6f | 70 79 20 74 68 65 20 72 | just co|py the r|
|00001930| 65 73 75 6c 74 0d 09 61 | 6e 64 20 6c 65 74 20 74 |esult..a|nd let t|
|00001940| 68 65 20 6d 61 69 6e 20 | 6c 6f 6f 70 20 70 72 6f |he main |loop pro|
|00001950| 63 65 73 73 20 69 74 2e | 20 2a 2f 0d 09 0d 70 61 |cess it.| */...pa|
|00001960| 73 63 61 6c 20 76 6f 69 | 64 20 72 65 73 75 6c 74 |scal voi|d result|
|00001970| 50 72 6f 63 28 73 74 72 | 75 63 74 20 68 6f 73 74 |Proc(str|uct host|
|00001980| 49 6e 66 6f 20 2a 68 6f | 73 74 49 6e 66 6f 50 74 |Info *ho|stInfoPt|
|00001990| 72 2c 20 73 74 72 75 63 | 74 20 68 6f 73 74 49 6e |r, struc|t hostIn|
|000019a0| 66 6f 20 2a 75 73 65 72 | 44 61 74 61 50 74 72 29 |fo *user|DataPtr)|
|000019b0| 0d 0d 7b 0d 09 2a 75 73 | 65 72 44 61 74 61 50 74 |..{..*us|erDataPt|
|000019c0| 72 20 3d 20 2a 68 6f 73 | 74 49 6e 66 6f 50 74 72 |r = *hos|tInfoPtr|
|000019d0| 3b 0d 7d 0d 00 00 00 00 | 00 00 00 00 00 00 00 00 |;.}.....|........|
|000019e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000019f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001a00| 00 00 01 00 00 00 01 4c | 00 00 00 4c 00 00 00 32 |.......L|...L...2|
|00001a10| 01 20 04 06 43 61 6e 63 | 65 6c 00 00 00 00 00 88 |. ..Canc|el......|
|00001a20| 00 0e 00 98 00 c5 88 08 | 53 61 76 65 20 61 73 3a |........|Save as:|
|00001a30| 0f 54 43 50 4e 61 6d 65 | 54 6f 41 64 64 72 2e 63 |.TCPName|ToAddr.c|
|00001a40| 02 00 00 00 54 45 58 54 | 4d 50 53 20 01 00 00 c0 |....TEXT|MPS ....|
|00001a50| 00 00 54 45 58 54 4d 50 | 53 20 01 00 00 c0 00 02 |..TEXTMP|S ......|
|00001a60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001a70| 00 00 a0 aa d5 c0 00 00 | 19 54 00 00 01 7e 00 c5 |........|.T...~..|
|00001a80| 80 00 00 00 00 aa 00 09 | 00 00 00 00 00 8a 01 00 |........|........|
|00001a90| 00 9c 01 50 04 04 4f 70 | 65 6e 00 00 00 00 04 80 |...P..Op|en......|
|00001aa0| 00 3b 04 d0 00 4d 04 06 | 48 69 64 64 65 6e 00 00 |.;...M..|Hidden..|
|00001ab0| 00 00 00 a3 01 00 00 b5 | 01 50 04 06 43 61 6e 63 |........|.P..Canc|
|00001ac0| 65 6c 00 00 00 00 00 27 | 00 e8 00 3b 01 5b 80 00 |el.....'|...;.[..|
|00001ad0| 00 00 00 00 00 44 01 00 | 00 56 01 50 04 05 45 6a |.....D..|.V.P..Ej|
|00001ae0| 65 63 74 00 00 00 00 00 | 00 5d 01 00 00 6f 01 50 |ect.....|.]...o.P|
|00001af0| 04 05 44 72 69 76 65 00 | 00 00 00 00 00 27 00 0c |..Drive.|.....'..|
|00001b00| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 00 00 00 |...H..Mo|naco....|
|00001b10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b20| 00 00 00 00 00 00 00 06 | 00 04 00 78 00 18 01 dd |........|...x....|
|00001b30| 02 3d 00 78 00 18 01 dd | 02 3d a1 ea 09 23 00 00 |.=.x....|.=...#..|
|00001b40| 19 54 00 00 19 54 00 00 | 17 60 01 00 00 00 01 00 |.T...T..|.`......|
|00001b50| 00 00 01 4c 00 00 00 4c | 00 00 00 32 00 29 c1 98 |...L...L|...2.)..|
|00001b60| 04 0c 00 00 00 1c 00 32 | 00 00 4d 50 53 52 00 00 |.......2|..MPSR..|
|00001b70| 00 0a 03 ed ff ff 00 00 | 00 00 00 2a fb 00 00 00 |........|...*....|
+--------+-------------------------+-------------------------+--------+--------+