home *** CD-ROM | disk | FTP | other *** search
/ Internet File Formats / InternetFileFormatsCD.bin / text / latex / mac / alpha.6.0.sit / Help / XTCLs < prev   
MacBinary  |  1995-07-08  |  8.3 KB  |  [TEXT/ALFA]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
10% dexvert Jesper Olsen Module (music/jesperOlsen) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Sat Jul 8 23:49:42 1995, modified Sat Jul 8 23:49:42 1995, creator Alpha editor, type ASCII, 7775 bytes "XTCLs" , at 0x1edf 495 bytes resource default (weak)
99% file data default
49% TrID Macintosh plain text (MacBinary) default
33% TrID TTComp archive compressed (bin-2K) default (weak)
16% TrID MacBinary 2 default (weak)
0% TrID Sybase iAnywhere database files default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[ALFA]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 05 58 54 43 4c 73 00 | 00 00 00 00 00 00 00 00 |..XTCLs.|........|
|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 41 4c 46 | 41 01 00 00 00 00 00 00 |.TEXTALF|A.......|
|00000050| 00 00 00 00 00 1e 5f 00 | 00 01 ef ac 25 02 56 ac |......_.|....%.V.|
|00000060| 25 02 56 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |%.V.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 bc 29 00 00 |........|.....)..|
|00000080| 0d 09 4e 4f 54 45 3a 20 | 54 68 69 73 20 69 73 20 |..NOTE: |This is |
|00000090| 67 6f 69 6e 67 20 61 77 | 61 79 2e 2e 2e 2e 0d 0d |going aw|ay......|
|000000a0| 0d 09 58 54 43 4c 73 20 | 28 43 6f 70 79 52 69 67 |..XTCLs |(CopyRig|
|000000b0| 68 74 20 31 39 39 32 20 | 62 79 20 54 69 6d 20 45 |ht 1992 |by Tim E|
|000000c0| 6e 64 72 65 73 2c 20 6d | 6f 64 69 66 69 65 64 20 |ndres, m|odified |
|000000d0| 62 79 20 50 65 74 65 20 | 4b 65 6c 65 68 65 72 29 |by Pete |Keleher)|
|000000e0| 0d 0d 54 68 65 20 74 63 | 6c 20 65 78 74 65 72 6e |..The tc|l extern|
|000000f0| 61 6c 20 63 6f 6d 6d 61 | 6e 64 20 69 6e 74 65 72 |al comma|nd inter|
|00000100| 66 61 63 65 20 69 73 20 | 73 69 6d 69 6c 61 72 20 |face is |similar |
|00000110| 74 6f 20 74 68 65 20 48 | 79 70 65 72 43 61 72 64 |to the H|yperCard|
|00000120| 20 65 78 74 65 72 6e 61 | 6c 20 0d 63 6f 6d 6d 61 | externa|l .comma|
|00000130| 6e 64 20 69 6e 74 65 72 | 66 61 63 65 2e 20 59 6f |nd inter|face. Yo|
|00000140| 75 72 20 63 6f 64 65 20 | 69 73 20 61 20 73 74 61 |ur code |is a sta|
|00000150| 6e 64 20 61 6c 6f 6e 65 | 20 6d 6f 64 75 6c 65 20 |nd alone| module |
|00000160| 74 68 61 74 20 65 78 69 | 73 74 73 20 61 73 20 61 |that exi|sts as a|
|00000170| 20 0d 72 65 73 6f 75 72 | 63 65 20 69 6e 20 74 68 | .resour|ce in th|
|00000180| 65 20 63 6f 6d 6d 6f 6e | 20 58 54 43 4c 20 46 69 |e common| XTCL Fi|
|00000190| 6c 65 20 6f 72 20 69 6e | 20 61 20 66 69 6c 65 20 |le or in| a file |
|000001a0| 62 79 20 69 74 73 65 6c | 66 2e 0d 0d 54 68 65 20 |by itsel|f...The |
|000001b0| 61 64 76 61 6e 74 61 67 | 65 20 6f 66 20 68 61 76 |advantag|e of hav|
|000001c0| 69 6e 67 20 79 6f 75 72 | 20 58 54 43 4c 20 69 6e |ing your| XTCL in|
|000001d0| 20 61 20 73 65 70 61 72 | 61 74 65 20 66 69 6c 65 | a separ|ate file|
|000001e0| 20 69 73 20 74 68 65 20 | 61 62 69 6c 69 74 79 20 | is the |ability |
|000001f0| 74 6f 20 68 61 76 65 20 | 0d 61 63 63 65 73 73 20 |to have |.access |
|00000200| 74 6f 20 79 6f 75 72 20 | 6f 77 6e 20 73 65 74 20 |to your |own set |
|00000210| 6f 66 20 72 65 73 6f 75 | 72 63 65 73 20 74 68 61 |of resou|rces tha|
|00000220| 74 20 61 72 65 20 61 6c | 77 61 79 73 20 63 61 72 |t are al|ways car|
|00000230| 72 69 65 64 20 61 72 6f | 75 6e 64 20 77 69 74 68 |ried aro|und with|
|00000240| 20 74 68 65 20 0d 58 54 | 43 4c 2e 20 54 68 65 20 | the .XT|CL. The |
|00000250| 64 69 73 61 64 76 61 6e | 74 61 67 65 20 69 73 20 |disadvan|tage is |
|00000260| 74 68 65 20 63 6f 73 74 | 20 6f 66 20 6f 70 65 6e |the cost| of open|
|00000270| 69 6e 67 20 61 6e 64 20 | 63 6c 6f 73 65 20 74 68 |ing and |close th|
|00000280| 65 20 58 54 43 4c 27 73 | 20 66 69 6c 65 20 0d 65 |e XTCL's| file .e|
|00000290| 76 65 72 79 20 74 69 6d | 65 20 69 74 20 69 73 20 |very tim|e it is |
|000002a0| 65 78 65 63 75 74 65 64 | 2e 20 0d 0d 57 68 65 6e |executed|. ..When|
|000002b0| 20 41 6c 70 68 61 20 69 | 73 20 61 73 6b 65 64 20 | Alpha i|s asked |
|000002c0| 74 6f 20 65 78 65 63 75 | 74 65 20 74 68 65 20 65 |to execu|te the e|
|000002d0| 78 74 65 72 6e 61 6c 20 | 63 6f 6d 6d 61 6e 64 2c |xternal |command,|
|000002e0| 20 69 74 20 6c 6f 61 64 | 73 20 74 68 65 20 72 65 | it load|s the re|
|000002f0| 73 6f 75 72 63 65 20 0d | 66 72 6f 6d 20 74 68 65 |source .|from the|
|00000300| 20 28 31 29 20 61 70 70 | 6c 69 63 61 74 69 6f 6e | (1) app|lication|
|00000310| 20 72 65 73 6f 75 72 63 | 65 20 66 6f 72 6b 2c 20 | resourc|e fork, |
|00000320| 28 32 29 20 74 68 65 20 | 58 54 43 4c 20 46 69 6c |(2) the |XTCL Fil|
|00000330| 65 20 72 65 73 6f 75 72 | 63 65 20 66 6f 72 6b 2c |e resour|ce fork,|
|00000340| 20 6f 72 20 28 33 29 20 | 0d 74 68 65 20 72 65 73 | or (3) |.the res|
|00000350| 6f 75 72 63 65 20 66 6f | 72 6b 20 6f 66 20 74 68 |ource fo|rk of th|
|00000360| 65 20 6f 70 74 69 6f 6e | 61 6c 20 66 69 6c 65 20 |e option|al file |
|00000370| 70 61 72 61 6d 65 74 65 | 72 2e 20 54 68 65 20 72 |paramete|r. The r|
|00000380| 65 73 6f 75 72 63 65 20 | 69 73 20 6c 6f 63 6b 65 |esource |is locke|
|00000390| 64 20 0d 64 6f 77 6e 20 | 69 6e 20 6d 65 6d 6f 72 |d .down |in memor|
|000003a0| 79 2c 20 61 6e 64 20 63 | 61 6c 6c 65 64 20 61 73 |y, and c|alled as|
|000003b0| 20 61 20 43 20 66 75 6e | 63 74 69 6f 6e 2e 20 54 | a C fun|ction. T|
|000003c0| 68 65 20 65 78 74 65 72 | 6e 61 6c 20 63 6f 6d 6d |he exter|nal comm|
|000003d0| 61 6e 64 27 73 20 43 20 | 0d 63 6f 64 65 20 73 68 |and's C |.code sh|
|000003e0| 6f 75 6c 64 20 62 65 67 | 69 6e 20 61 73 3a 0d 0d |ould beg|in as:..|
|000003f0| 76 6f 69 64 0d 58 54 43 | 4c 45 6e 74 72 79 28 61 |void.XTC|LEntry(a|
|00000400| 72 67 63 2c 20 61 72 67 | 76 2c 20 78 70 62 29 0d |rgc, arg|v, xpb).|
|00000410| 6c 6f 6e 67 09 09 09 61 | 72 67 63 3b 0d 63 68 61 |long...a|rgc;.cha|
|00000420| 72 09 09 09 2a 2a 61 72 | 67 76 3b 0d 58 54 43 4c |r...**ar|gv;.XTCL|
|00000430| 50 61 72 6d 42 6c 6b 09 | 09 2a 78 70 62 3b 0d 0d |ParmBlk.|.*xpb;..|
|00000440| 54 68 65 20 70 61 72 61 | 6d 65 74 65 72 73 20 61 |The para|meters a|
|00000450| 72 65 20 73 69 6d 69 6c | 61 72 20 74 6f 20 77 68 |re simil|ar to wh|
|00000460| 61 74 20 79 6f 75 20 77 | 6f 75 6c 64 20 65 78 70 |at you w|ould exp|
|00000470| 65 63 74 20 61 6e 79 20 | 43 20 74 79 70 65 20 70 |ect any |C type p|
|00000480| 72 6f 67 72 61 6d 20 0d | 74 6f 20 74 61 6b 65 2c |rogram .|to take,|
|00000490| 20 65 78 63 65 70 74 20 | 66 6f 72 20 74 68 65 20 | except |for the |
|000004a0| 78 70 62 20 70 61 72 61 | 6d 65 74 65 72 20 62 6c |xpb para|meter bl|
|000004b0| 6f 63 6b 2e 20 54 68 69 | 73 20 70 61 72 61 6d 65 |ock. Thi|s parame|
|000004c0| 74 65 72 20 62 6c 6f 63 | 6b 20 69 73 20 79 6f 75 |ter bloc|k is you|
|000004d0| 72 20 0d 6c 69 6e 6b 20 | 62 61 63 6b 20 69 6e 74 |r .link |back int|
|000004e0| 6f 20 41 6c 70 68 61 2e | 20 48 65 72 65 20 69 73 |o Alpha.| Here is|
|000004f0| 20 74 68 65 20 73 74 72 | 75 63 74 75 72 65 3a 0d | the str|ucture:.|
|00000500| 0d 74 79 70 65 64 65 66 | 20 73 74 72 75 63 74 20 |.typedef| struct |
|00000510| 7b 0d 20 2d 3e 09 6c 6f | 6e 67 09 76 65 72 73 69 |{. ->.lo|ng.versi|
|00000520| 6f 6e 3b 0d 3c 2d 3e 09 | 6c 6f 6e 67 09 72 65 73 |on;.<->.|long.res|
|00000530| 75 6c 74 3b 0d 3c 2d 3e | 09 48 61 6e 64 6c 65 09 |ult;.<->|.Handle.|
|00000540| 72 65 73 75 6c 74 48 3b | 0d 20 2d 3e 09 73 68 6f |resultH;|. ->.sho|
|00000550| 72 74 09 63 6d 64 52 65 | 66 4e 75 6d 3b 0d 20 2d |rt.cmdRe|fNum;. -|
|00000560| 3e 09 48 61 6e 64 6c 65 | 09 63 6d 64 48 61 6e 64 |>.Handle|.cmdHand|
|00000570| 6c 65 3b 0d 20 2d 3e 09 | 54 63 6c 5f 49 6e 74 65 |le;. ->.|Tcl_Inte|
|00000580| 72 70 09 2a 69 6e 74 65 | 72 70 3b 0d 20 2d 3e 09 |rp.*inte|rp;. ->.|
|00000590| 69 6e 74 09 28 2a 65 76 | 61 6c 29 28 29 3b 0d 20 |int.(*ev|al)();. |
|000005a0| 2d 3e 09 4d 6f 64 61 6c | 46 69 6c 74 65 72 50 72 |->.Modal|FilterPr|
|000005b0| 6f 63 50 74 72 09 6d 6f | 64 61 6c 70 72 6f 63 3b |ocPtr.mo|dalproc;|
|000005c0| 0d 20 2d 09 6c 6f 6e 67 | 09 72 65 73 65 72 76 65 |. -.long|.reserve|
|000005d0| 64 3b 0d 09 7d 20 58 54 | 43 4c 50 61 72 6d 42 6c |d;..} XT|CLParmBl|
|000005e0| 6b 2c 20 2a 58 54 43 4c | 50 42 50 74 72 3b 0d 0d |k, *XTCL|PBPtr;..|
|000005f0| 54 68 65 20 76 65 72 73 | 69 6f 6e 20 66 69 65 6c |The vers|ion fiel|
|00000600| 64 20 69 73 20 70 61 73 | 73 65 64 20 69 6e 20 74 |d is pas|sed in t|
|00000610| 6f 20 69 6e 64 69 63 61 | 74 65 20 74 6f 20 74 68 |o indica|te to th|
|00000620| 65 20 63 6f 6d 6d 61 6e | 64 20 77 68 61 74 20 6c |e comman|d what l|
|00000630| 65 76 65 6c 20 6f 66 20 | 0d 66 75 6e 63 74 69 6f |evel of |.functio|
|00000640| 6e 61 6c 69 74 79 20 74 | 68 65 20 74 63 6c 20 63 |nality t|he tcl c|
|00000650| 61 6c 6c 62 61 63 6b 20 | 66 75 6e 63 74 69 6f 6e |allback |function|
|00000660| 20 73 75 70 70 6f 72 74 | 73 2c 20 61 73 20 77 65 | support|s, as we|
|00000670| 6c 6c 20 61 73 20 69 6e | 64 69 63 61 74 65 20 74 |ll as in|dicate t|
|00000680| 68 65 20 0d 76 65 72 73 | 69 6f 6e 20 6f 66 20 74 |he .vers|ion of t|
|00000690| 68 65 20 70 61 72 61 6d | 65 74 65 72 20 62 6c 6f |he param|eter blo|
|000006a0| 63 6b 20 64 61 74 61 20 | 73 74 72 75 63 74 75 72 |ck data |structur|
|000006b0| 65 2e 20 54 68 65 20 63 | 75 72 72 65 6e 74 20 76 |e. The c|urrent v|
|000006c0| 65 72 73 69 6f 6e 20 6e | 75 6d 62 65 72 20 0d 6f |ersion n|umber .o|
|000006d0| 66 20 64 65 66 69 6e 65 | 64 20 62 79 20 58 54 43 |f define|d by XTC|
|000006e0| 4c 5f 43 42 5f 56 45 52 | 53 49 4f 4e 20 69 6e 20 |L_CB_VER|SION in |
|000006f0| 74 68 65 20 68 65 61 64 | 65 72 20 66 69 6c 65 20 |the head|er file |
|00000700| 58 54 43 4c 2e 68 20 61 | 6e 64 20 69 73 20 63 75 |XTCL.h a|nd is cu|
|00000710| 72 72 65 6e 74 6c 79 20 | 0d 30 78 30 30 30 31 30 |rrently |.0x00010|
|00000720| 30 30 31 2e 0d 0d 54 68 | 65 20 72 65 73 75 6c 74 |001...Th|e result|
|00000730| 20 66 69 65 6c 64 20 69 | 73 20 72 65 74 75 72 6e | field i|s return|
|00000740| 65 64 20 62 79 20 74 68 | 65 20 65 78 74 65 72 6e |ed by th|e extern|
|00000750| 61 6c 20 63 6f 6d 6d 61 | 6e 64 20 61 6e 64 20 69 |al comma|nd and i|
|00000760| 73 20 74 6f 20 62 65 20 | 6f 6e 65 20 6f 66 20 0d |s to be |one of .|
|00000770| 74 68 65 20 70 72 65 64 | 65 66 69 6e 65 64 20 63 |the pred|efined c|
|00000780| 6f 6e 73 74 61 6e 74 73 | 20 69 6e 20 58 54 43 4c |onstants| in XTCL|
|00000790| 2e 68 2e 20 54 68 65 20 | 72 65 73 75 6c 74 48 20 |.h. The |resultH |
|000007a0| 66 69 65 6c 64 20 63 6f | 6e 74 61 69 6e 73 20 61 |field co|ntains a|
|000007b0| 20 68 61 6e 64 6c 65 20 | 0d 74 68 61 74 20 69 73 | handle |.that is|
|000007c0| 20 61 6c 6c 6f 63 61 74 | 65 64 20 62 79 20 41 6c | allocat|ed by Al|
|000007d0| 70 68 61 2c 20 77 69 74 | 68 20 61 20 6c 65 6e 67 |pha, wit|h a leng|
|000007e0| 74 68 20 6f 66 20 7a 65 | 72 6f 2c 20 61 6e 64 20 |th of ze|ro, and |
|000007f0| 70 61 73 73 65 64 20 74 | 6f 20 74 68 65 20 65 78 |passed t|o the ex|
|00000800| 74 65 72 6e 61 6c 20 0d | 63 6f 6d 6d 61 6e 64 20 |ternal .|command |
|00000810| 74 6f 20 63 6f 6e 74 61 | 69 6e 20 74 68 65 20 72 |to conta|in the r|
|00000820| 65 73 75 6c 74 73 20 6f | 66 20 74 68 65 20 63 6f |esults o|f the co|
|00000830| 6d 6d 61 6e 64 2e 20 54 | 68 65 20 63 6f 6d 6d 61 |mmand. T|he comma|
|00000840| 6e 64 20 77 69 6c 6c 20 | 72 65 73 69 7a 65 20 0d |nd will |resize .|
|00000850| 74 68 65 20 68 61 6e 64 | 6c 65 20 74 6f 20 68 6f |the hand|le to ho|
|00000860| 6c 64 20 69 74 73 20 72 | 65 73 75 6c 74 2c 20 61 |ld its r|esult, a|
|00000870| 6e 64 20 63 6f 70 79 20 | 74 68 65 20 72 65 73 75 |nd copy |the resu|
|00000880| 6c 74 73 20 69 6e 74 6f | 20 74 68 65 20 68 61 6e |lts into| the han|
|00000890| 64 6c 65 27 73 20 6d 65 | 6d 6f 72 79 20 0d 62 65 |dle's me|mory .be|
|000008a0| 66 6f 72 65 20 72 65 74 | 75 72 6e 69 6e 67 2e 20 |fore ret|urning. |
|000008b0| 54 68 65 20 65 78 74 65 | 72 6e 61 6c 20 63 6f 6d |The exte|rnal com|
|000008c0| 6d 61 6e 64 20 73 68 6f | 75 6c 64 20 6e 65 76 65 |mand sho|uld neve|
|000008d0| 72 20 64 69 73 70 6f 73 | 65 20 6f 66 20 74 68 65 |r dispos|e of the|
|000008e0| 20 0d 68 61 6e 64 6c 65 | 20 70 61 73 73 65 64 20 | .handle| passed |
|000008f0| 69 6e 20 72 65 73 75 6c | 74 48 2e 0d 0d 54 68 65 |in resul|tH...The|
|00000900| 20 63 6d 64 52 65 66 4e | 75 6d 20 66 69 65 6c 64 | cmdRefN|um field|
|00000910| 20 69 73 20 74 68 65 20 | 66 69 6c 65 20 73 79 73 | is the |file sys|
|00000920| 74 65 6d 20 72 65 66 65 | 72 65 6e 63 65 20 6e 75 |tem refe|rence nu|
|00000930| 6d 62 65 72 20 6f 66 20 | 74 68 65 20 66 69 6c 65 |mber of |the file|
|00000940| 20 0d 63 6f 6e 74 61 69 | 6e 69 6e 67 20 74 68 65 | .contai|ning the|
|00000950| 20 58 54 43 4c 20 63 6f | 6d 6d 61 6e 64 2e 20 52 | XTCL co|mmand. R|
|00000960| 65 6d 65 6d 62 65 72 2c | 20 74 68 69 73 20 72 65 |emember,| this re|
|00000970| 66 65 72 65 6e 63 65 20 | 6e 75 6d 62 65 72 20 6d |ference |number m|
|00000980| 61 79 20 62 65 20 0d 74 | 68 65 20 61 70 70 6c 69 |ay be .t|he appli|
|00000990| 63 61 74 69 6f 6e 27 73 | 20 72 65 66 65 72 65 6e |cation's| referen|
|000009a0| 63 65 20 6e 75 6d 62 65 | 72 20 6f 72 20 74 68 65 |ce numbe|r or the|
|000009b0| 20 6e 75 6d 62 65 72 20 | 6f 66 20 74 68 65 20 58 | number |of the X|
|000009c0| 54 43 4c 20 46 69 6c 65 | 2c 20 69 66 20 74 68 65 |TCL File|, if the|
|000009d0| 20 0d 63 6f 6d 6d 61 6e | 64 20 77 61 73 20 66 6f | .comman|d was fo|
|000009e0| 75 6e 64 20 69 6e 20 65 | 69 74 68 65 72 20 6f 66 |und in e|ither of|
|000009f0| 20 74 68 65 73 65 20 6c | 6f 63 61 74 69 6f 6e 73 | these l|ocations|
|00000a00| 2e 20 54 68 65 20 65 78 | 74 65 72 6e 61 6c 20 63 |. The ex|ternal c|
|00000a10| 6f 6d 6d 61 6e 64 20 0d | 6d 75 73 74 20 6e 65 76 |ommand .|must nev|
|00000a20| 65 72 20 63 6c 6f 73 65 | 20 74 68 69 73 20 66 69 |er close| this fi|
|00000a30| 6c 65 2e 0d 0d 54 68 65 | 20 63 6d 64 48 61 6e 64 |le...The| cmdHand|
|00000a40| 6c 65 20 66 69 65 6c 64 | 20 69 73 20 74 68 65 20 |le field| is the |
|00000a50| 68 61 6e 64 6c 65 20 74 | 6f 20 74 68 65 20 63 6f |handle t|o the co|
|00000a60| 64 65 20 72 65 73 6f 75 | 72 63 65 20 74 68 61 74 |de resou|rce that|
|00000a70| 20 63 6f 6e 74 61 69 6e | 73 20 74 68 65 20 0d 65 | contain|s the .e|
|00000a80| 78 74 65 72 6e 61 6c 20 | 63 6f 6d 6d 61 6e 64 20 |xternal |command |
|00000a90| 69 74 73 65 6c 66 2e 20 | 49 74 20 77 69 6c 6c 20 |itself. |It will |
|00000aa0| 62 65 20 6c 6f 63 6b 65 | 64 2e 20 44 6f 20 6e 6f |be locke|d. Do no|
|00000ab0| 74 20 75 6e 6c 6f 63 6b | 2c 20 6d 6f 76 65 2c 20 |t unlock|, move, |
|00000ac0| 6d 6f 64 69 66 79 2c 20 | 6f 72 20 0d 6f 74 68 65 |modify, |or .othe|
|00000ad0| 72 77 69 73 65 20 6d 75 | 74 69 6c 61 74 65 20 74 |rwise mu|tilate t|
|00000ae0| 68 69 73 20 6d 65 6d 6f | 72 79 21 21 21 21 20 43 |his memo|ry!!!! C|
|00000af0| 6f 6e 73 69 64 65 72 20 | 74 68 65 20 68 61 6e 64 |onsider |the hand|
|00000b00| 6c 65 20 61 6e 64 20 64 | 61 74 61 20 52 45 41 44 |le and d|ata READ|
|00000b10| 20 0d 4f 4e 4c 59 2e 0d | 0d 54 68 65 20 69 6e 74 | .ONLY..|.The int|
|00000b20| 65 72 70 20 66 69 65 6c | 64 20 69 73 20 61 20 74 |erp fiel|d is a t|
|00000b30| 63 6c 20 69 6e 74 65 72 | 70 72 65 74 65 72 20 70 |cl inter|preter p|
|00000b40| 6f 69 6e 74 65 72 20 74 | 6f 20 74 68 65 20 69 6e |ointer t|o the in|
|00000b50| 74 65 72 70 72 65 74 65 | 72 20 74 68 61 74 20 63 |terprete|r that c|
|00000b60| 61 6c 6c 65 64 20 74 68 | 65 20 0d 65 78 74 65 72 |alled th|e .exter|
|00000b70| 6e 61 6c 20 63 6f 6d 6d | 61 6e 64 2e 20 0d 0d 54 |nal comm|and. ..T|
|00000b80| 68 65 20 65 76 61 6c 20 | 66 69 65 6c 64 20 69 73 |he eval |field is|
|00000b90| 20 61 20 43 20 70 72 6f | 63 65 64 75 72 65 20 70 | a C pro|cedure p|
|00000ba0| 6f 69 6e 74 65 72 20 74 | 6f 20 74 68 65 20 63 61 |ointer t|o the ca|
|00000bb0| 6c 6c 62 61 63 6b 20 72 | 6f 75 74 69 6e 65 20 74 |llback r|outine t|
|00000bc0| 6f 20 65 76 61 6c 75 61 | 74 65 20 61 20 0d 74 63 |o evalua|te a .tc|
|00000bd0| 6c 20 73 74 61 74 65 6d | 65 6e 74 2e 20 49 74 20 |l statem|ent. It |
|00000be0| 69 73 20 65 71 75 69 76 | 61 6c 65 6e 74 20 74 6f |is equiv|alent to|
|00000bf0| 20 75 73 69 6e 67 20 74 | 68 65 20 65 76 61 6c 20 | using t|he eval |
|00000c00| 74 63 6c 20 63 6f 6d 6d | 61 6e 64 2e 20 54 68 65 |tcl comm|and. The|
|00000c10| 20 63 61 6c 6c 62 61 63 | 6b 20 69 73 20 0d 75 73 | callbac|k is .us|
|00000c20| 65 64 20 61 73 20 66 6f | 6c 6c 6f 77 73 3a 0d 0d |ed as fo|llows:..|
|00000c30| 20 20 20 72 65 73 75 6c | 74 20 3d 20 28 2a 20 78 | resul|t = (* x|
|00000c40| 70 62 2d 3e 65 76 61 6c | 29 28 78 70 62 2c 20 73 |pb->eval|)(xpb, s|
|00000c50| 48 61 6e 64 6c 65 2c 20 | 72 48 61 6e 64 6c 65 2c |Handle, |rHandle,|
|00000c60| 20 73 74 64 6f 75 74 48 | 61 6e 64 6c 65 29 3b 0d | stdoutH|andle);.|
|00000c70| 0d 57 68 65 72 65 3a 0d | 27 78 70 62 27 20 69 73 |.Where:.|'xpb' is|
|00000c80| 20 74 68 65 20 70 61 72 | 61 6d 65 74 65 72 20 62 | the par|ameter b|
|00000c90| 6c 6f 63 6b 20 70 6f 69 | 6e 74 65 72 20 70 61 73 |lock poi|nter pas|
|00000ca0| 73 65 64 20 74 6f 20 74 | 68 65 20 65 78 74 65 72 |sed to t|he exter|
|00000cb0| 6e 61 6c 20 63 6f 6d 6d | 61 6e 64 2e 0d 27 73 48 |nal comm|and..'sH|
|00000cc0| 61 6e 64 6c 65 27 20 69 | 73 20 61 20 68 61 6e 64 |andle' i|s a hand|
|00000cd0| 6c 65 20 63 6f 6e 74 61 | 69 6e 69 6e 67 20 61 20 |le conta|ining a |
|00000ce0| 6e 75 6c 6c 20 74 65 72 | 6d 69 6e 61 74 65 64 20 |null ter|minated |
|00000cf0| 73 74 72 69 6e 67 20 74 | 6f 20 62 65 20 65 76 61 |string t|o be eva|
|00000d00| 6c 75 61 74 65 64 20 62 | 79 20 74 68 65 20 74 63 |luated b|y the tc|
|00000d10| 6c 20 0d 20 20 69 6e 74 | 65 72 70 72 65 74 65 72 |l . int|erpreter|
|00000d20| 2e 0d 27 72 48 61 6e 64 | 6c 65 27 20 69 73 20 61 |..'rHand|le' is a|
|00000d30| 20 68 61 6e 64 6c 65 20 | 66 6f 72 20 74 68 65 20 | handle |for the |
|00000d40| 72 65 73 75 6c 74 20 6f | 66 20 74 68 65 20 63 6f |result o|f the co|
|00000d50| 6d 6d 61 6e 64 2e 20 49 | 74 20 6d 61 79 20 62 65 |mmand. I|t may be|
|00000d60| 20 7a 65 72 6f 20 6c 65 | 6e 67 74 68 2c 20 62 75 | zero le|ngth, bu|
|00000d70| 74 20 69 66 20 69 74 20 | 69 73 20 0d 20 20 6e 6f |t if it |is . no|
|00000d80| 74 20 74 68 65 20 72 65 | 73 75 6c 74 73 20 77 69 |t the re|sults wi|
|00000d90| 6c 6c 20 62 65 20 70 6c | 61 63 65 64 20 61 66 74 |ll be pl|aced aft|
|00000da0| 65 72 20 74 68 65 20 64 | 61 74 61 20 61 6c 72 65 |er the d|ata alre|
|00000db0| 61 64 79 20 69 6e 20 74 | 68 65 20 68 61 6e 64 6c |ady in t|he handl|
|00000dc0| 65 20 28 61 73 20 64 65 | 74 65 72 6d 69 6e 65 64 |e (as de|termined|
|00000dd0| 20 62 79 20 0d 20 20 47 | 65 74 48 61 6e 64 6c 65 | by . G|etHandle|
|00000de0| 53 69 7a 65 29 2e 20 54 | 68 65 20 72 65 73 75 6c |Size). T|he resul|
|00000df0| 74 20 77 69 6c 6c 20 6e | 6f 74 20 62 65 20 6e 75 |t will n|ot be nu|
|00000e00| 6c 6c 20 74 65 72 6d 69 | 6e 61 74 65 64 2c 20 74 |ll termi|nated, t|
|00000e10| 68 75 73 2c 20 47 65 74 | 48 61 6e 64 6c 65 53 69 |hus, Get|HandleSi|
|00000e20| 7a 65 20 6d 75 73 74 20 | 0d 20 20 62 65 20 75 73 |ze must |. be us|
|00000e30| 65 64 20 74 6f 20 64 65 | 74 65 72 6d 69 6e 65 20 |ed to de|termine |
|00000e40| 74 68 65 20 6c 65 6e 67 | 74 68 20 6f 66 20 74 68 |the leng|th of th|
|00000e50| 65 20 72 65 73 75 6c 74 | 2e 20 54 68 69 73 20 66 |e result|. This f|
|00000e60| 69 65 6c 64 20 6d 61 79 | 20 62 65 20 4e 55 4c 4c |ield may| be NULL|
|00000e70| 2e 0d 27 73 74 64 6f 75 | 74 48 61 6e 64 6c 65 27 |..'stdou|tHandle'|
|00000e80| 20 69 73 20 61 20 68 61 | 6e 64 6c 65 20 66 6f 72 | is a ha|ndle for|
|00000e90| 20 74 68 65 20 73 74 61 | 6e 64 61 72 64 20 6f 75 | the sta|ndard ou|
|00000ea0| 74 70 75 74 20 6f 66 20 | 74 68 65 20 63 6f 6d 6d |tput of |the comm|
|00000eb0| 61 6e 64 2e 20 54 68 69 | 73 20 69 73 20 74 68 65 |and. Thi|s is the|
|00000ec0| 20 0d 20 20 6f 75 74 70 | 75 74 20 67 65 6e 65 72 | . outp|ut gener|
|00000ed0| 61 74 65 64 20 62 79 20 | 74 68 65 20 70 72 69 6e |ated by |the prin|
|00000ee0| 74 20 63 6f 6d 6d 61 6e | 64 20 61 6e 64 20 65 72 |t comman|d and er|
|00000ef0| 72 6f 72 20 72 65 70 6f | 72 74 69 6e 67 2e 20 49 |ror repo|rting. I|
|00000f00| 74 20 6d 61 79 20 62 65 | 20 7a 65 72 6f 20 6c 65 |t may be| zero le|
|00000f10| 6e 67 74 68 2c 20 0d 20 | 20 62 75 74 20 69 66 20 |ngth, . | but if |
|00000f20| 69 74 20 69 73 20 6e 6f | 74 20 74 68 65 20 72 65 |it is no|t the re|
|00000f30| 73 75 6c 74 73 20 77 69 | 6c 6c 20 62 65 20 70 6c |sults wi|ll be pl|
|00000f40| 61 63 65 64 20 61 66 74 | 65 72 20 74 68 65 20 64 |aced aft|er the d|
|00000f50| 61 74 61 20 61 6c 72 65 | 61 64 79 20 69 6e 20 74 |ata alre|ady in t|
|00000f60| 68 65 20 68 61 6e 64 6c | 65 20 28 61 73 20 0d 20 |he handl|e (as . |
|00000f70| 20 64 65 74 65 72 6d 69 | 6e 65 64 20 62 79 20 47 | determi|ned by G|
|00000f80| 65 74 48 61 6e 64 6c 65 | 53 69 7a 65 29 2e 20 54 |etHandle|Size). T|
|00000f90| 68 65 20 72 65 73 75 6c | 74 73 20 77 69 6c 6c 20 |he resul|ts will |
|00000fa0| 6e 6f 74 20 62 65 20 6e | 75 6c 6c 20 74 65 72 6d |not be n|ull term|
|00000fb0| 69 6e 61 74 65 64 2c 20 | 74 68 75 73 2c 20 0d 20 |inated, |thus, . |
|00000fc0| 20 47 65 74 48 61 6e 64 | 6c 65 53 69 7a 65 20 6d | GetHand|leSize m|
|00000fd0| 75 73 74 20 62 65 20 75 | 73 65 64 20 74 6f 20 64 |ust be u|sed to d|
|00000fe0| 65 74 65 72 6d 69 6e 65 | 20 74 68 65 20 6c 65 6e |etermine| the len|
|00000ff0| 67 74 68 20 6f 66 20 74 | 68 65 20 72 65 73 75 6c |gth of t|he resul|
|00001000| 74 2e 20 54 68 69 73 20 | 0d 20 20 66 69 65 6c 64 |t. This |. field|
|00001010| 20 6d 61 79 20 62 65 20 | 4e 55 4c 4c 2e 0d 0d 54 | may be |NULL...T|
|00001020| 68 65 20 6d 6f 64 61 6c | 70 72 6f 63 20 66 69 65 |he modal|proc fie|
|00001030| 6c 64 20 69 73 20 61 20 | 70 72 6f 63 65 64 75 72 |ld is a |procedur|
|00001040| 65 20 70 6f 69 6e 74 65 | 72 20 74 6f 20 75 73 65 |e pointe|r to use|
|00001050| 20 69 6e 20 74 68 65 20 | 0d 4d 6f 64 61 6c 46 69 | in the |.ModalFi|
|00001060| 6c 74 65 72 50 72 6f 63 | 50 6f 69 6e 74 65 72 20 |lterProc|Pointer |
|00001070| 66 69 65 6c 64 20 6f 66 | 20 4d 6f 64 61 6c 44 69 |field of| ModalDi|
|00001080| 61 6c 6f 67 20 61 6e 64 | 20 74 68 65 20 6c 69 6b |alog and| the lik|
|00001090| 65 2e 20 0d 0d 54 68 65 | 20 72 65 73 65 72 76 65 |e. ..The| reserve|
|000010a0| 64 20 66 69 65 6c 64 20 | 69 73 20 72 65 73 65 72 |d field |is reser|
|000010b0| 76 65 64 2e 20 0d 0d 0d | 54 77 6f 20 65 78 61 6d |ved. ...|Two exam|
|000010c0| 70 6c 65 20 58 54 43 4c | 73 20 63 72 65 61 74 65 |ple XTCL|s create|
|000010d0| 64 20 69 6e 20 54 68 69 | 6e 6b 20 43 20 35 2e 30 |d in Thi|nk C 5.0|
|000010e0| 34 20 61 72 65 20 69 6e | 20 74 68 65 20 27 78 74 |4 are in| the 'xt|
|000010f0| 63 6c 73 27 20 64 69 72 | 65 63 74 6f 72 79 2e 20 |cls' dir|ectory. |
|00001100| 0d 54 68 65 20 66 69 72 | 73 74 20 6d 65 72 65 6c |.The fir|st merel|
|00001110| 79 20 72 65 74 75 72 6e | 73 20 61 20 72 65 73 75 |y return|s a resu|
|00001120| 6c 74 20 62 61 73 65 64 | 20 6f 6e 20 69 74 73 20 |lt based| on its |
|00001130| 61 72 67 75 6d 65 6e 74 | 73 2e 20 54 68 65 20 73 |argument|s. The s|
|00001140| 65 63 6f 6e 64 20 75 73 | 65 73 20 0d 74 68 65 20 |econd us|es .the |
|00001150| 27 65 76 61 6c 27 20 66 | 69 65 6c 64 20 6f 66 20 |'eval' f|ield of |
|00001160| 74 68 65 20 58 54 43 4c | 50 61 72 6d 42 6c 6b 20 |the XTCL|ParmBlk |
|00001170| 74 6f 20 68 61 76 65 20 | 41 6c 70 68 61 20 65 76 |to have |Alpha ev|
|00001180| 61 6c 75 61 74 65 20 61 | 20 73 63 72 69 70 74 20 |aluate a| script |
|00001190| 77 68 69 63 68 20 0d 61 | 64 64 73 20 61 20 6d 65 |which .a|dds a me|
|000011a0| 6e 75 20 6f 66 20 61 6c | 6c 20 61 76 61 69 6c 61 |nu of al|l availa|
|000011b0| 62 6c 65 20 73 6f 75 6e | 64 73 20 74 6f 20 41 6c |ble soun|ds to Al|
|000011c0| 70 68 61 27 73 20 6d 65 | 6e 75 62 61 72 2e 20 53 |pha's me|nubar. S|
|000011d0| 65 6c 65 63 74 69 6e 67 | 20 6f 6e 65 20 6f 66 20 |electing| one of |
|000011e0| 0d 74 68 65 20 6d 65 6e | 75 20 69 74 65 6d 73 20 |.the men|u items |
|000011f0| 63 61 6c 6c 73 20 62 61 | 63 6b 20 69 6e 74 6f 20 |calls ba|ck into |
|00001200| 74 68 65 20 58 54 43 4c | 20 61 6e 64 20 70 6c 61 |the XTCL| and pla|
|00001210| 79 73 20 74 68 65 20 73 | 6f 75 6e 64 2e 20 41 20 |ys the s|ound. A |
|00001220| 63 6f 6d 70 69 6c 65 64 | 20 0d 76 65 72 73 69 6f |compiled| .versio|
|00001230| 6e 20 6f 66 20 74 68 69 | 73 20 58 54 43 4c 20 69 |n of thi|s XTCL i|
|00001240| 73 20 6c 6f 61 64 65 64 | 20 69 6e 74 6f 20 74 68 |s loaded| into th|
|00001250| 65 20 41 6c 70 68 61 20 | 62 69 6e 61 72 79 2e 20 |e Alpha |binary. |
|00001260| 55 73 65 20 69 74 20 62 | 79 20 67 6f 69 6e 67 20 |Use it b|y going |
|00001270| 74 6f 20 0d 74 68 65 20 | 68 6f 6d 65 20 64 69 72 |to .the |home dir|
|00001280| 65 63 74 6f 72 79 20 69 | 6e 20 74 68 65 20 54 63 |ectory i|n the Tc|
|00001290| 6c 20 73 68 65 6c 6c 20 | 28 63 64 20 3c 63 72 3e |l shell |(cd <cr>|
|000012a0| 29 2c 20 61 6e 64 20 74 | 68 65 6e 20 74 79 70 69 |), and t|hen typi|
|000012b0| 6e 67 20 22 78 74 63 6c | 63 6d 64 20 0d 73 6f 75 |ng "xtcl|cmd .sou|
|000012c0| 6e 64 73 20 69 6e 69 74 | 22 2e 0d 0d 57 68 65 6e |nds init|"...When|
|000012d0| 20 63 72 65 61 74 69 6e | 67 20 58 54 43 4c 73 20 | creatin|g XTCLs |
|000012e0| 69 6e 20 54 68 69 6e 6b | 43 3a 0d 31 29 20 47 6c |in Think|C:.1) Gl|
|000012f0| 6f 62 61 6c 20 64 61 74 | 61 20 69 73 20 66 69 6e |obal dat|a is fin|
|00001300| 65 2c 20 62 75 74 20 73 | 74 61 74 69 63 20 69 6e |e, but s|tatic in|
|00001310| 69 74 69 61 6c 69 7a 61 | 74 69 6f 6e 20 6f 66 20 |itializa|tion of |
|00001320| 70 6f 69 6e 74 65 72 73 | 20 74 6f 20 74 68 65 20 |pointers| to the |
|00001330| 0d 20 20 20 61 64 64 72 | 65 73 73 65 73 20 6f 66 |. addr|esses of|
|00001340| 20 67 6c 6f 62 61 6c 20 | 64 61 74 61 20 69 73 20 | global |data is |
|00001350| 6e 6f 74 2e 0d 32 29 20 | 45 78 63 65 70 74 20 66 |not..2) |Except f|
|00001360| 6f 72 20 74 68 65 20 4d | 61 63 54 72 61 70 73 20 |or the M|acTraps |
|00001370| 6c 69 62 72 61 72 79 2c | 20 61 6c 6c 20 74 68 65 |library,| all the|
|00001380| 20 6c 69 62 72 61 72 69 | 65 73 20 75 73 65 20 67 | librari|es use g|
|00001390| 6c 6f 62 61 6c 20 64 61 | 74 61 2e 20 49 6e 20 0d |lobal da|ta. In .|
|000013a0| 20 20 20 6f 72 64 65 72 | 20 74 6f 20 75 73 65 20 | order| to use |
|000013b0| 74 68 65 6d 20 69 6e 20 | 79 6f 75 72 20 63 6f 64 |them in |your cod|
|000013c0| 65 20 72 65 73 6f 75 72 | 63 65 2c 20 79 6f 75 20 |e resour|ce, you |
|000013d0| 6d 75 73 74 20 6d 61 6b | 65 20 61 20 63 6f 70 79 |must mak|e a copy|
|000013e0| 20 74 68 61 74 20 0d 20 | 20 20 75 73 65 73 20 72 | that . | uses r|
|000013f0| 65 67 69 73 74 65 72 20 | 61 34 20 69 6e 73 74 65 |egister |a4 inste|
|00001400| 61 64 20 6f 66 20 61 35 | 20 74 6f 20 72 65 66 65 |ad of a5| to refe|
|00001410| 72 65 6e 63 65 20 67 6c | 6f 62 61 6c 20 64 61 74 |rence gl|obal dat|
|00001420| 61 2e 20 4d 61 6b 65 20 | 61 20 63 6f 70 79 20 0d |a. Make |a copy .|
|00001430| 20 20 20 6f 66 20 74 68 | 65 20 6c 69 62 72 61 72 | of th|e librar|
|00001440| 79 20 79 6f 75 20 6e 65 | 65 64 2c 20 61 6e 64 20 |y you ne|ed, and |
|00001450| 63 68 61 6e 67 65 20 74 | 68 65 20 70 72 6f 6a 65 |change t|he proje|
|00001460| 63 74 20 74 79 70 65 20 | 74 6f 20 27 43 6f 64 65 |ct type |to 'Code|
|00001470| 20 0d 20 20 20 52 65 73 | 6f 75 72 63 65 27 2e 20 | . Res|ource'. |
|00001480| 0d 33 29 20 52 65 6d 65 | 6d 62 65 72 20 74 68 61 |.3) Reme|mber tha|
|00001490| 74 20 27 61 72 67 63 27 | 20 69 73 20 70 61 73 73 |t 'argc'| is pass|
|000014a0| 65 64 20 61 73 20 61 20 | 6c 6f 6e 67 2e 0d 0d 0d |ed as a |long....|
|000014b0| 41 6e 20 65 78 74 65 72 | 6e 61 6c 20 63 6f 6d 6d |An exter|nal comm|
|000014c0| 61 6e 64 20 69 6e 20 4d | 50 57 20 43 20 73 68 6f |and in M|PW C sho|
|000014d0| 75 6c 64 20 6c 6f 6f 6b | 20 6c 69 6b 65 3a 0d 0d |uld look| like:..|
|000014e0| 23 69 6e 63 6c 75 64 65 | 20 22 78 74 63 6c 2e 68 |#include| "xtcl.h|
|000014f0| 22 0d 0d 76 6f 69 64 0d | 58 54 43 4c 45 6e 74 72 |"..void.|XTCLEntr|
|00001500| 79 28 61 72 67 63 2c 20 | 61 72 67 76 2c 20 78 70 |y(argc, |argv, xp|
|00001510| 62 29 0d 69 6e 74 09 09 | 09 61 72 67 63 3b 0d 63 |b).int..|.argc;.c|
|00001520| 68 61 72 09 09 2a 2a 61 | 72 67 76 3b 0d 58 54 43 |har..**a|rgv;.XTC|
|00001530| 4c 50 61 72 6d 42 6c 6b | 09 2a 78 70 62 3b 0d 7b |LParmBlk|.*xpb;.{|
|00001540| 0d 63 68 61 72 09 2a 70 | 74 72 2c 20 73 74 61 74 |.char.*p|tr, stat|
|00001550| 65 3b 0d 69 6e 74 09 09 | 69 2c 20 6c 65 6e 67 74 |e;.int..|i, lengt|
|00001560| 68 2c 20 73 6c 65 6e 3b | 0d 0d 09 78 70 62 2d 3e |h, slen;|...xpb->|
|00001570| 72 65 73 75 6c 74 20 3d | 20 54 43 4c 5f 4f 4b 3b |result =| TCL_OK;|
|00001580| 0d 09 0d 09 6c 65 6e 67 | 74 68 20 3d 20 47 65 74 |....leng|th = Get|
|00001590| 48 61 6e 64 6c 65 53 69 | 7a 65 28 78 70 62 2d 3e |HandleSi|ze(xpb->|
|000015a0| 72 65 73 75 6c 74 48 29 | 3b 0d 09 0d 09 66 6f 72 |resultH)|;....for|
|000015b0| 20 28 69 3d 31 3b 20 69 | 20 3c 20 61 72 67 63 3b | (i=1; i| < argc;|
|000015c0| 20 69 2b 2b 29 0d 09 09 | 73 6c 65 6e 20 2b 3d 20 | i++)...|slen += |
|000015d0| 73 74 72 6c 65 6e 28 61 | 72 67 76 5b 69 5d 29 20 |strlen(a|rgv[i]) |
|000015e0| 2b 20 31 3b 0d 0d 09 53 | 65 74 48 61 6e 64 6c 65 |+ 1;...S|etHandle|
|000015f0| 53 69 7a 65 28 78 70 62 | 2d 3e 72 65 73 75 6c 74 |Size(xpb|->result|
|00001600| 48 2c 20 73 6c 65 6e 2b | 31 29 3b 0d 09 0d 09 73 |H, slen+|1);....s|
|00001610| 74 61 74 65 20 3d 20 48 | 47 65 74 53 74 61 74 65 |tate = H|GetState|
|00001620| 28 78 70 62 2d 3e 72 65 | 73 75 6c 74 48 29 3b 0d |(xpb->re|sultH);.|
|00001630| 09 48 4c 6f 63 6b 28 78 | 70 62 2d 3e 72 65 73 75 |.HLock(x|pb->resu|
|00001640| 6c 74 48 29 3b 0d 09 0d | 09 66 6f 72 20 28 70 74 |ltH);...|.for (pt|
|00001650| 72 3d 2a 78 70 62 2d 3e | 72 65 73 75 6c 74 48 2c |r=*xpb->|resultH,|
|00001660| 20 69 3d 31 3b 20 69 20 | 3c 20 61 72 67 63 3b 20 | i=1; i |< argc; |
|00001670| 69 2b 2b 29 20 7b 0d 09 | 09 73 74 72 63 61 74 28 |i++) {..|.strcat(|
|00001680| 70 74 72 2c 20 61 72 67 | 76 5b 69 5d 29 3b 0d 09 |ptr, arg|v[i]);..|
|00001690| 09 73 74 72 63 61 74 28 | 70 74 72 2c 20 22 20 22 |.strcat(|ptr, " "|
|000016a0| 29 3b 0d 09 09 70 74 72 | 20 2b 3d 20 73 74 72 6c |);...ptr| += strl|
|000016b0| 65 6e 28 70 74 72 29 3b | 0d 09 09 7d 0d 0d 09 48 |en(ptr);|...}...H|
|000016c0| 53 65 74 53 74 61 74 65 | 28 78 70 62 2d 3e 72 65 |SetState|(xpb->re|
|000016d0| 73 75 6c 74 48 2c 20 73 | 74 61 74 65 29 3b 0d 09 |sultH, s|tate);..|
|000016e0| 7d 0d 0d 41 6e 64 20 77 | 6f 75 6c 64 20 62 65 20 |}..And w|ould be |
|000016f0| 6c 69 6e 6b 65 64 20 74 | 6f 67 65 74 68 65 72 20 |linked t|ogether |
|00001700| 77 69 74 68 3a 0d 0d 58 | 54 43 4c 5f 65 63 68 6f |with:..X|TCL_echo|
|00001710| 20 c4 09 09 09 09 b6 0d | 09 09 58 54 43 4c 5f 65 | .......|..XTCL_e|
|00001720| 63 68 6f 2e 63 2e 6f 0d | 09 45 63 68 6f 20 27 23 |cho.c.o.|.Echo '#|
|00001730| 27 20 4c 69 6e 6b 69 6e | 67 20 58 54 43 4c 5f 65 |' Linkin|g XTCL_e|
|00001740| 63 68 6f 0d 09 4c 69 6e | 6b 20 2d 74 20 22 58 54 |cho..Lin|k -t "XT|
|00001750| 43 4c 22 20 2d 63 20 22 | 4d 50 53 20 22 09 09 b6 |CL" -c "|MPS "...|
|00001760| 0d 09 09 2d 72 74 20 22 | 58 54 43 4c 3d 32 30 32 |...-rt "|XTCL=202|
|00001770| 30 22 09 09 b6 0d 09 09 | 2d 73 67 20 22 65 63 68 |0"......|-sg "ech|
|00001780| 6f 22 09 09 09 b6 0d 09 | 09 2d 6d 20 58 54 43 4c |o"......|.-m XTCL|
|00001790| 45 6e 74 72 79 09 09 09 | b6 0d 09 09 2d 6f 20 58 |Entry...|....-o X|
|000017a0| 54 43 4c 5f 65 63 68 6f | 09 09 09 b6 0d 09 09 58 |TCL_echo|.......X|
|000017b0| 54 43 4c 5f 65 63 68 6f | 2e 63 2e 6f 09 09 09 b6 |TCL_echo|.c.o....|
|000017c0| 0d 09 09 7b 43 4c 69 62 | 72 61 72 69 65 73 7d 53 |...{CLib|raries}S|
|000017d0| 74 64 43 4c 69 62 2e 6f | 09 b6 0d 09 09 7b 4c 69 |tdCLib.o|.....{Li|
|000017e0| 62 72 61 72 69 65 73 7d | 49 6e 74 65 72 66 61 63 |braries}|Interfac|
|000017f0| 65 2e 6f 0d 0d 4e 4f 54 | 45 3a 20 54 68 65 20 2d |e.o..NOT|E: The -|
|00001800| 73 67 20 22 65 63 68 6f | 22 20 6f 70 74 69 6f 6e |sg "echo|" option|
|00001810| 20 69 6e 20 74 68 65 20 | 4c 69 6e 6b 20 63 6f 6d | in the |Link com|
|00001820| 6d 61 6e 64 20 77 69 6c | 6c 20 64 65 74 65 72 6d |mand wil|l determ|
|00001830| 69 6e 65 64 20 74 68 65 | 20 0d 6e 61 6d 65 20 6f |ined the| .name o|
|00001840| 66 20 74 68 65 20 63 6f | 64 65 20 72 65 73 6f 75 |f the co|de resou|
|00001850| 72 63 65 20 74 68 61 74 | 20 69 73 20 70 72 6f 64 |rce that| is prod|
|00001860| 75 63 65 64 2c 20 61 6e | 64 20 74 68 75 73 20 74 |uced, an|d thus t|
|00001870| 68 65 20 6e 61 6d 65 20 | 6f 66 20 74 68 65 20 0d |he name |of the .|
|00001880| 65 78 74 65 72 6e 61 6c | 20 63 6f 6d 6d 61 6e 64 |external| command|
|00001890| 2e 20 54 68 65 20 2d 72 | 74 20 22 58 54 43 4c 3d |. The -r|t "XTCL=|
|000018a0| 32 30 32 30 22 20 6f 70 | 74 69 6f 6e 20 69 6e 20 |2020" op|tion in |
|000018b0| 74 68 65 20 4c 69 6e 6b | 20 63 6f 6d 6d 61 6e 64 |the Link| command|
|000018c0| 20 0d 64 65 74 65 72 6d | 69 6e 65 73 20 74 68 65 | .determ|ines the|
|000018d0| 20 72 65 73 6f 75 72 63 | 65 20 74 79 70 65 20 6f | resourc|e type o|
|000018e0| 66 20 74 68 65 20 63 6f | 64 65 20 67 65 6e 65 72 |f the co|de gener|
|000018f0| 61 74 65 64 2c 20 61 6e | 64 20 69 74 73 20 72 65 |ated, an|d its re|
|00001900| 73 6f 75 72 63 65 20 69 | 64 2e 20 0d 54 68 65 20 |source i|d. .The |
|00001910| 72 65 73 6f 75 72 63 65 | 20 74 79 70 65 20 6d 75 |resource| type mu|
|00001920| 73 74 20 62 65 20 58 54 | 43 4c 2c 20 61 6e 64 20 |st be XT|CL, and |
|00001930| 74 68 65 20 72 65 73 6f | 75 72 63 65 20 49 44 20 |the reso|urce ID |
|00001940| 73 68 6f 75 6c 64 20 74 | 72 79 20 74 6f 20 62 65 |should t|ry to be|
|00001950| 20 0d 75 6e 69 71 75 65 | 2c 20 62 75 74 20 69 73 | .unique|, but is|
|00001960| 20 6e 6f 74 20 63 72 69 | 74 69 63 61 6c 2e 0d 0d | not cri|tical...|
|00001970| 41 6c 73 6f 20 72 65 6d | 65 6d 62 65 72 20 74 68 |Also rem|ember th|
|00001980| 61 74 20 73 74 61 6e 64 | 20 61 6c 6f 6e 65 20 43 |at stand| alone C|
|00001990| 20 63 6f 64 65 20 6d 75 | 73 74 20 6e 6f 74 20 75 | code mu|st not u|
|000019a0| 73 65 20 67 6c 6f 62 61 | 6c 20 76 61 72 69 61 62 |se globa|l variab|
|000019b0| 6c 65 73 2c 20 61 6e 64 | 20 0d 6d 75 73 74 20 75 |les, and| .must u|
|000019c0| 73 65 20 74 68 65 20 2d | 62 20 6f 70 74 69 6f 6e |se the -|b option|
|000019d0| 20 77 68 65 6e 20 63 61 | 6c 6c 69 6e 67 20 74 68 | when ca|lling th|
|000019e0| 65 20 43 20 63 6f 6d 70 | 69 6c 65 72 20 74 6f 20 |e C comp|iler to |
|000019f0| 75 73 65 20 73 74 72 69 | 6e 67 20 63 6f 6e 73 74 |use stri|ng const|
|00001a00| 61 6e 74 73 2e 0d 0d 46 | 69 6e 61 6c 6c 79 2c 20 |ants...F|inally, |
|00001a10| 74 68 65 20 66 6f 6c 6c | 6f 77 69 6e 67 20 63 6f |the foll|owing co|
|00001a20| 64 65 20 66 72 61 67 6d | 65 6e 74 20 69 73 20 61 |de fragm|ent is a|
|00001a30| 6e 20 65 78 61 6d 70 6c | 65 20 6f 66 20 61 6e 20 |n exampl|e of an |
|00001a40| 58 54 43 4c 20 74 68 61 | 74 20 73 69 6d 70 6c 79 |XTCL tha|t simply|
|00001a50| 20 0d 63 61 6c 6c 73 20 | 74 68 65 20 65 76 61 6c | .calls |the eval|
|00001a60| 20 63 61 6c 6c 62 61 63 | 6b 20 72 6f 75 74 69 6e | callbac|k routin|
|00001a70| 65 20 77 69 74 68 20 69 | 74 73 20 66 69 72 73 74 |e with i|ts first|
|00001a80| 20 61 72 67 75 6d 65 6e | 74 20 74 6f 20 62 65 20 | argumen|t to be |
|00001a90| 65 76 61 6c 75 61 74 65 | 64 2e 0d 0d 23 69 6e 63 |evaluate|d...#inc|
|00001aa0| 6c 75 64 65 20 22 78 74 | 63 6c 2e 68 22 0d 0d 76 |lude "xt|cl.h"..v|
|00001ab0| 6f 69 64 0d 58 54 43 4c | 45 6e 74 72 79 28 61 72 |oid.XTCL|Entry(ar|
|00001ac0| 67 63 2c 20 61 72 67 76 | 2c 20 78 70 62 29 0d 69 |gc, argv|, xpb).i|
|00001ad0| 6e 74 09 09 61 72 67 63 | 3b 0d 63 68 61 72 09 09 |nt..argc|;.char..|
|00001ae0| 2a 2a 61 72 67 76 3b 0d | 58 54 43 4c 50 61 72 6d |**argv;.|XTCLParm|
|00001af0| 42 6c 6b 09 2a 78 70 62 | 3b 0d 09 7b 0d 09 6c 6f |Blk.*xpb|;..{..lo|
|00001b00| 6e 67 09 09 6c 65 6e 67 | 74 68 3b 0d 09 69 6e 74 |ng..leng|th;..int|
|00001b10| 09 09 72 65 73 75 6c 74 | 3b 0d 09 48 61 6e 64 6c |..result|;..Handl|
|00001b20| 65 09 09 72 48 61 6e 64 | 6c 65 2c 20 73 48 61 6e |e..rHand|le, sHan|
|00001b30| 64 6c 65 3b 0d 09 63 68 | 61 72 09 09 2a 73 63 72 |dle;..ch|ar..*scr|
|00001b40| 69 70 74 20 3d 20 61 72 | 67 76 5b 31 5d 3b 0d 0d |ipt = ar|gv[1];..|
|00001b50| 09 78 70 62 2d 3e 72 65 | 73 75 6c 74 20 3d 20 54 |.xpb->re|sult = T|
|00001b60| 43 4c 5f 4f 4b 3b 0d 09 | 0d 09 6c 65 6e 67 74 68 |CL_OK;..|..length|
|00001b70| 20 3d 20 73 74 72 6c 65 | 6e 28 73 63 72 69 70 74 | = strle|n(script|
|00001b80| 29 3b 0d 09 73 48 61 6e | 64 6c 65 20 3d 20 4e 65 |);..sHan|dle = Ne|
|00001b90| 77 48 61 6e 64 6c 65 28 | 6c 65 6e 67 74 68 2b 31 |wHandle(|length+1|
|00001ba0| 29 3b 0d 09 72 48 61 6e | 64 6c 65 20 3d 20 4e 65 |);..rHan|dle = Ne|
|00001bb0| 77 48 61 6e 64 6c 65 28 | 30 29 3b 0d 09 0d 09 69 |wHandle(|0);....i|
|00001bc0| 66 20 28 73 48 61 6e 64 | 6c 65 20 21 3d 20 4e 55 |f (sHand|le != NU|
|00001bd0| 4c 4c 20 26 26 20 72 48 | 61 6e 64 6c 65 20 21 3d |LL && rH|andle !=|
|00001be0| 20 4e 55 4c 4c 29 0d 09 | 09 7b 0d 09 09 73 74 72 | NULL)..|.{...str|
|00001bf0| 63 70 79 28 2a 73 48 61 | 6e 64 6c 65 2c 20 73 63 |cpy(*sHa|ndle, sc|
|00001c00| 72 69 70 74 29 3b 0d 09 | 09 0d 09 09 72 65 73 75 |ript);..|....resu|
|00001c10| 6c 74 20 3d 20 28 2a 20 | 78 70 62 2d 3e 65 76 61 |lt = (* |xpb->eva|
|00001c20| 6c 29 28 78 70 62 2c 20 | 73 48 61 6e 64 6c 65 2c |l)(xpb, |sHandle,|
|00001c30| 20 72 48 61 6e 64 6c 65 | 2c 20 4e 55 4c 4c 29 3b | rHandle|, NULL);|
|00001c40| 0d 09 09 0d 09 09 6c 65 | 6e 67 74 68 20 3d 20 47 |......le|ngth = G|
|00001c50| 65 74 48 61 6e 64 6c 65 | 53 69 7a 65 28 72 48 61 |etHandle|Size(rHa|
|00001c60| 6e 64 6c 65 29 3b 0d 09 | 09 53 65 74 48 61 6e 64 |ndle);..|.SetHand|
|00001c70| 6c 65 53 69 7a 65 28 78 | 70 62 2d 3e 72 65 73 75 |leSize(x|pb->resu|
|00001c80| 6c 74 48 2c 20 6c 65 6e | 67 74 68 20 2b 20 31 29 |ltH, len|gth + 1)|
|00001c90| 3b 0d 09 09 69 66 20 28 | 4d 65 6d 45 72 72 6f 72 |;...if (|MemError|
|00001ca0| 28 29 20 3d 3d 20 6e 6f | 45 72 72 29 20 7b 0d 09 |() == no|Err) {..|
|00001cb0| 09 09 6d 65 6d 63 70 79 | 28 2a 78 70 62 2d 3e 72 |..memcpy|(*xpb->r|
|00001cc0| 65 73 75 6c 74 48 2c 20 | 2a 72 48 61 6e 64 6c 65 |esultH, |*rHandle|
|00001cd0| 2c 20 47 65 74 48 61 6e | 64 6c 65 53 69 7a 65 28 |, GetHan|dleSize(|
|00001ce0| 72 48 61 6e 64 6c 65 29 | 29 3b 0d 09 09 09 2a 20 |rHandle)|);....* |
|00001cf0| 28 2a 78 70 62 2d 3e 72 | 65 73 75 6c 74 48 20 2b |(*xpb->r|esultH +|
|00001d00| 20 6c 65 6e 67 74 68 29 | 20 3d 20 27 5c 30 27 3b | length)| = '\0';|
|00001d10| 0d 09 09 09 7d 0d 09 09 | 65 6c 73 65 0d 09 09 09 |....}...|else....|
|00001d20| 72 65 73 75 6c 74 20 3d | 20 54 43 4c 5f 45 52 52 |result =| TCL_ERR|
|00001d30| 4f 52 3b 0d 09 09 0d 09 | 09 78 70 62 2d 3e 72 65 |OR;.....|.xpb->re|
|00001d40| 73 75 6c 74 20 3d 20 72 | 65 73 75 6c 74 3b 0d 09 |sult = r|esult;..|
|00001d50| 09 7d 0d 09 0d 09 69 66 | 20 28 73 48 61 6e 64 6c |.}....if| (sHandl|
|00001d60| 65 20 21 3d 20 4e 55 4c | 4c 29 0d 09 09 44 69 73 |e != NUL|L)...Dis|
|00001d70| 70 6f 73 48 61 6e 64 6c | 65 28 73 48 61 6e 64 6c |posHandl|e(sHandl|
|00001d80| 65 29 3b 0d 09 69 66 20 | 28 72 48 61 6e 64 6c 65 |e);..if |(rHandle|
|00001d90| 20 21 3d 20 4e 55 4c 4c | 29 0d 09 09 44 69 73 70 | != NULL|)...Disp|
|00001da0| 6f 73 48 61 6e 64 6c 65 | 28 72 48 61 6e 64 6c 65 |osHandle|(rHandle|
|00001db0| 29 3b 0d 09 7d 0d 0d 0d | 0d 4e 4f 54 45 3a 20 50 |);..}...|.NOTE: P|
|00001dc0| 61 73 63 61 6c 20 70 72 | 6f 67 72 61 6d 6d 65 72 |ascal pr|ogrammer|
|00001dd0| 73 20 77 69 6c 6c 20 6e | 65 65 64 20 74 6f 20 6c |s will n|eed to l|
|00001de0| 69 6e 6b 20 77 69 74 68 | 20 74 68 65 20 50 61 73 |ink with| the Pas|
|00001df0| 63 61 6c 20 67 6c 75 65 | 20 63 6f 64 65 20 74 6f |cal glue| code to|
|00001e00| 20 0d 77 6f 72 6b 2e 20 | 54 68 65 20 67 6c 75 65 | .work. |The glue|
|00001e10| 20 63 6f 64 65 20 70 72 | 6f 76 69 64 65 73 20 61 | code pr|ovides a|
|00001e20| 20 43 20 65 6e 74 72 79 | 20 74 68 61 74 20 77 69 | C entry| that wi|
|00001e30| 6c 6c 20 63 61 6c 6c 20 | 79 6f 75 72 20 50 61 73 |ll call |your Pas|
|00001e40| 63 61 6c 20 72 6f 75 74 | 69 6e 65 20 66 6f 72 20 |cal rout|ine for |
|00001e50| 0d 74 68 65 20 58 54 43 | 4c 2e 20 49 74 20 61 6c |.the XTC|L. It al|
|00001e60| 73 6f 20 70 72 6f 76 69 | 64 65 73 20 67 6c 75 65 |so provi|des glue|
|00001e70| 20 74 6f 20 63 61 6c 6c | 62 61 63 6b 20 74 68 65 | to call|back the|
|00001e80| 20 69 6e 74 65 72 70 72 | 65 74 65 72 20 66 6f 72 | interpr|eter for|
|00001e90| 20 65 76 61 6c 75 61 74 | 69 6f 6e 2e 20 0d 50 6c | evaluat|ion. .Pl|
|00001ea0| 65 61 73 65 20 73 65 65 | 20 74 68 65 20 65 78 61 |ease see| the exa|
|00001eb0| 6d 70 6c 65 20 73 6f 75 | 72 63 65 73 20 61 6e 64 |mple sou|rces and|
|00001ec0| 20 6d 61 6b 65 66 69 6c | 65 20 66 6f 72 20 66 75 | makefil|e for fu|
|00001ed0| 72 74 68 65 72 20 64 65 | 74 61 69 6c 73 2e 0d 00 |rther de|tails...|
|00001ee0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ef0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f00| 00 00 01 00 00 00 01 9a | 00 00 00 9a 00 00 00 55 |........|.......U|
|00001f10| 70 13 53 74 75 66 66 49 | 74 20 4c 69 74 65 aa 20 |p.StuffI|t Lite. |
|00001f20| 33 2e 30 2e 31 1c 53 74 | 75 66 66 49 74 20 4c 69 |3.0.1.St|uffIt Li|
|00001f30| 05 58 54 43 4c 73 02 00 | 02 00 54 45 58 54 41 4c |.XTCLs..|..TEXTAL|
|00001f40| 46 41 01 00 01 04 01 00 | 00 00 00 00 74 04 00 00 |FA......|....t...|
|00001f50| 02 00 54 45 58 54 41 4c | 46 41 01 00 01 04 01 00 |..TEXTAL|FA......|
|00001f60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f70| 00 00 a9 a2 6a a7 00 00 | 1e 5f 00 00 01 ef 6c 07 |....j...|._....l.|
|00001f80| 54 63 6c 20 36 2e 32 09 | 74 63 6c 47 6c 6f 62 2e |Tcl 6.2.|tclGlob.|
|00001f90| 63 08 74 63 6c 4d 61 63 | 2e 63 0c 74 63 6c 4d 61 |c.tclMac|.c.tclMa|
|00001fa0| 63 55 74 69 6c 2e 63 09 | 54 65 61 63 68 54 65 78 |cUtil.c.|TeachTex|
|00001fb0| 74 06 74 65 6c 6e 65 74 | 04 74 65 6d 70 0a 74 65 |t.telnet|.temp.te|
|00001fc0| 73 74 61 34 2e 74 65 78 | 0c 74 65 73 74 70 61 67 |sta4.tex|.testpag|
|00001fd0| 65 2e 74 65 78 09 54 65 | 58 2d 46 6f 6e 74 73 0a |e.tex.Te|X-Fonts.|
|00001fe0| 54 65 58 2d 49 6e 70 75 | 74 73 0b 54 65 58 2d 4f |TeX-Inpu|ts.TeX-O|
|00001ff0| 75 74 70 75 74 73 0b 54 | 65 58 2d 53 63 72 69 70 |utputs.T|eX-Scrip|
|00002000| 00 00 00 28 01 00 56 3e | 00 00 00 02 00 00 00 64 |...(..V>|.......d|
|00002010| 00 00 00 00 00 00 00 02 | 00 00 00 05 00 00 00 00 |........|........|
|00002020| 00 00 00 1e 00 00 00 00 | 00 00 00 00 00 00 00 1e |........|........|
|00002030| 00 02 00 00 10 38 00 00 | 10 38 07 54 68 69 6e 6b |.....8..|.8.Think|
|00002040| 20 43 00 00 14 30 00 00 | 14 30 03 4d 50 57 00 00 | C...0..|.0.MPW..|
|00002050| 00 48 00 09 4d 6f 6e 61 | 63 6f 00 ff 87 b0 00 00 |.H..Mona|co......|
|00002060| 17 82 00 f8 10 ec 01 16 | b6 20 24 00 04 44 01 60 |........|. $..D.`|
|00002070| ad 00 ff fc 00 04 00 04 | 00 28 00 02 01 ca 02 00 |........|.(......|
|00002080| 00 28 00 02 01 ca 02 00 | ac 24 ca 19 00 00 00 00 |.(......|.$......|
|00002090| 00 00 00 00 00 00 00 00 | 01 00 00 00 01 00 00 00 |........|........|
|000020a0| 01 9a 00 00 00 9a 00 00 | 00 55 00 f6 86 48 17 82 |........|.U...H..|
|000020b0| 00 00 00 1c 00 4a 00 00 | 4d 50 53 52 00 02 00 0a |.....J..|MPSR....|
|000020c0| 03 f4 00 00 00 00 00 00 | 00 00 00 00 03 ef 00 07 |........|........|
|000020d0| 00 00 00 2c 00 00 00 00 | 03 ed ff ff 00 00 00 4e |...,....|.......N|
|000020e0| 00 f8 25 cc 06 63 6f 6c | 6f 72 73 03 74 61 62 00 |..%..col|ors.tab.|
|000020f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+