0000: 2f 2a 20 0a 20 2a 20 74 63 6c 41 70 70 49 6e 69 /* . * tclAppIni
0010: 74 2e 63 20 2d 2d 0a 20 2a 0a 20 2a 20 20 50 72 t.c --. *. * Pr
0020: 6f 76 69 64 65 73 20 61 20 64 65 66 61 75 6c 74 ovides a default
0030: 20 76 65 72 73 69 6f 6e 20 6f 66 20 74 68 65 20 version of the
0040: 6d 61 69 6e 20 70 72 6f 67 72 61 6d 20 61 6e 64 main program and
0050: 20 54 63 6c 5f 41 70 70 49 6e 69 74 0a 20 2a 20 Tcl_AppInit. *
0060: 20 70 72 6f 63 65 64 75 72 65 20 66 6f 72 20 54 procedure for T
0070: 63 6c 20 61 70 70 6c 69 63 61 74 69 6f 6e 73 20 cl applications
0080: 28 77 69 74 68 6f 75 74 20 54 6b 29 2e 20 20 4e (without Tk). N
0090: 6f 74 65 20 74 68 61 74 20 74 68 69 73 0a 20 2a ote that this. *
00a0: 20 20 70 72 6f 67 72 61 6d 20 6d 75 73 74 20 62 program must b
00b0: 65 20 62 75 69 6c 74 20 69 6e 20 57 69 6e 33 32 e built in Win32
00c0: 20 63 6f 6e 73 6f 6c 65 20 6d 6f 64 65 20 74 6f console mode to
00d0: 20 77 6f 72 6b 20 70 72 6f 70 65 72 6c 79 2e 0a work properly..
00e0: 20 2a 0a 20 2a 20 43 6f 70 79 72 69 67 68 74 20 *. * Copyright
00f0: 28 63 29 20 31 39 39 36 2d 31 39 39 37 20 62 79 (c) 1996-1997 by
0100: 20 53 75 6e 20 4d 69 63 72 6f 73 79 73 74 65 6d Sun Microsystem
0110: 73 2c 20 49 6e 63 2e 0a 20 2a 20 43 6f 70 79 72 s, Inc.. * Copyr
0120: 69 67 68 74 20 28 63 29 20 31 39 39 38 2d 31 39 ight (c) 1998-19
0130: 39 39 20 62 79 20 53 63 72 69 70 74 69 63 73 20 99 by Scriptics
0140: 43 6f 72 70 6f 72 61 74 69 6f 6e 2e 0a 20 2a 20 Corporation.. *
0150: 43 6f 70 79 72 69 67 68 74 20 28 63 29 20 32 30 Copyright (c) 20
0160: 30 30 2d 32 30 30 32 20 4a 65 61 6e 2d 43 6c 61 00-2002 Jean-Cla
0170: 75 64 65 20 57 69 70 70 6c 65 72 20 3c 6a 63 77 ude Wippler <jcw
0180: 40 65 71 75 69 34 2e 63 6f 6d 3e 0a 20 2a 0a 20 @equi4.com>. *.
0190: 2a 20 53 65 65 20 74 68 65 20 66 69 6c 65 20 22 * See the file "
01a0: 6c 69 63 65 6e 73 65 2e 74 65 72 6d 73 22 20 66 license.terms" f
01b0: 6f 72 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 6f or information o
01c0: 6e 20 75 73 61 67 65 20 61 6e 64 20 72 65 64 69 n usage and redi
01d0: 73 74 72 69 62 75 74 69 6f 6e 0a 20 2a 20 6f 66 stribution. * of
01e0: 20 74 68 69 73 20 66 69 6c 65 2c 20 61 6e 64 20 this file, and
01f0: 66 6f 72 20 61 20 44 49 53 43 4c 41 49 4d 45 52 for a DISCLAIMER
0200: 20 4f 46 20 41 4c 4c 20 57 41 52 52 41 4e 54 49 OF ALL WARRANTI
0210: 45 53 2e 0a 20 2a 0a 20 2a 20 52 43 53 3a 20 40 ES.. *. * RCS: @
0220: 28 23 29 20 24 49 64 24 0a 20 2a 2f 0a 0a 23 69 (#) $Id$. */..#i
0230: 66 64 65 66 20 4b 49 54 5f 49 4e 43 4c 55 44 45 fdef KIT_INCLUDE
0240: 53 5f 54 4b 0a 23 20 20 69 6e 63 6c 75 64 65 20 S_TK.# include
0250: 3c 74 6b 2e 68 3e 0a 23 65 6c 73 65 0a 23 20 20 <tk.h>.#else.#
0260: 69 6e 63 6c 75 64 65 20 3c 74 63 6c 2e 68 3e 0a include <tcl.h>.
0270: 23 65 6e 64 69 66 20 2f 2a 20 4b 49 54 5f 49 4e #endif /* KIT_IN
0280: 43 4c 55 44 45 53 5f 54 4b 20 2a 2f 0a 0a 23 69 CLUDES_TK */..#i
0290: 66 64 65 66 20 5f 57 49 4e 33 32 0a 23 20 20 64 fdef _WIN32.# d
02a0: 65 66 69 6e 65 20 57 49 4e 33 32 5f 4c 45 41 4e efine WIN32_LEAN
02b0: 5f 41 4e 44 5f 4d 45 41 4e 0a 23 20 20 69 6e 63 _AND_MEAN.# inc
02c0: 6c 75 64 65 20 3c 77 69 6e 64 6f 77 73 2e 68 3e lude <windows.h>
02d0: 0a 23 20 20 75 6e 64 65 66 20 57 49 4e 33 32 5f .# undef WIN32_
02e0: 4c 45 41 4e 5f 41 4e 44 5f 4d 45 41 4e 0a 23 65 LEAN_AND_MEAN.#e
02f0: 6e 64 69 66 20 2f 2a 20 5f 57 49 4e 33 32 20 2a ndif /* _WIN32 *
0300: 2f 0a 0a 23 69 66 6e 64 65 66 20 4d 42 5f 54 41 /..#ifndef MB_TA
0310: 53 4b 4d 4f 44 41 4c 0a 23 20 20 64 65 66 69 6e SKMODAL.# defin
0320: 65 20 4d 42 5f 54 41 53 4b 4d 4f 44 41 4c 20 30 e MB_TASKMODAL 0
0330: 0a 23 65 6e 64 69 66 20 2f 2a 20 4d 42 5f 54 41 .#endif /* MB_TA
0340: 53 4b 4d 4f 44 41 4c 20 2a 2f 0a 0a 23 69 6e 63 SKMODAL */..#inc
0350: 6c 75 64 65 20 22 74 63 6c 49 6e 74 2e 68 22 0a lude "tclInt.h".
0360: 0a 23 69 66 64 65 66 20 4b 49 54 5f 49 4e 43 4c .#ifdef KIT_INCL
0370: 55 44 45 53 5f 49 54 43 4c 0a 54 63 6c 5f 41 70 UDES_ITCL.Tcl_Ap
0380: 70 49 6e 69 74 50 72 6f 63 09 49 74 63 6c 5f 49 pInitProc.Itcl_I
0390: 6e 69 74 3b 0a 23 65 6e 64 69 66 0a 23 69 66 64 nit;.#endif.#ifd
03a0: 65 66 20 4b 49 54 5f 49 4e 43 4c 55 44 45 53 5f ef KIT_INCLUDES_
03b0: 4d 4b 34 54 43 4c 0a 54 63 6c 5f 41 70 70 49 6e MK4TCL.Tcl_AppIn
03c0: 69 74 50 72 6f 63 09 4d 6b 34 74 63 6c 5f 49 6e itProc.Mk4tcl_In
03d0: 69 74 3b 0a 23 65 6e 64 69 66 0a 54 63 6c 5f 41 it;.#endif.Tcl_A
03e0: 70 70 49 6e 69 74 50 72 6f 63 20 56 66 73 5f 49 ppInitProc Vfs_I
03f0: 6e 69 74 2c 20 52 65 63 68 61 6e 5f 49 6e 69 74 nit, Rechan_Init
0400: 2c 20 5a 6c 69 62 5f 49 6e 69 74 3b 0a 23 69 66 , Zlib_Init;.#if
0410: 20 31 30 20 2a 20 54 43 4c 5f 4d 41 4a 4f 52 5f 10 * TCL_MAJOR_
0420: 56 45 52 53 49 4f 4e 20 2b 20 54 43 4c 5f 4d 49 VERSION + TCL_MI
0430: 4e 4f 52 5f 56 45 52 53 49 4f 4e 20 3c 20 38 35 NOR_VERSION < 85
0440: 0a 54 63 6c 5f 41 70 70 49 6e 69 74 50 72 6f 63 .Tcl_AppInitProc
0450: 09 50 77 62 5f 49 6e 69 74 3b 0a 23 65 6e 64 69 .Pwb_Init;.#endi
0460: 66 0a 23 69 66 64 65 66 20 54 43 4c 5f 54 48 52 f.#ifdef TCL_THR
0470: 45 41 44 53 0a 54 63 6c 5f 41 70 70 49 6e 69 74 EADS.Tcl_AppInit
0480: 50 72 6f 63 09 54 68 72 65 61 64 5f 49 6e 69 74 Proc.Thread_Init
0490: 3b 0a 23 65 6e 64 69 66 0a 23 69 66 64 65 66 20 ;.#endif.#ifdef
04a0: 5f 57 49 4e 33 32 0a 54 63 6c 5f 41 70 70 49 6e _WIN32.Tcl_AppIn
04b0: 69 74 50 72 6f 63 09 44 64 65 5f 49 6e 69 74 2c itProc.Dde_Init,
04c0: 20 52 65 67 69 73 74 72 79 5f 49 6e 69 74 3b 0a Registry_Init;.
04d0: 23 65 6e 64 69 66 0a 0a 2f 2a 20 44 65 74 65 72 #endif../* Deter
04e0: 6d 69 6e 65 20 77 68 69 63 68 20 74 79 70 65 20 mine which type
04f0: 6f 66 20 73 74 6f 72 61 67 65 20 74 6f 20 75 73 of storage to us
0500: 65 20 2d 2d 20 4d 4b 34 20 6f 72 20 5a 49 50 20 e -- MK4 or ZIP
0510: 2a 2f 0a 23 69 66 20 64 65 66 69 6e 65 64 28 4b */.#if defined(K
0520: 49 54 5f 53 54 4f 52 41 47 45 5f 4d 4b 34 29 20 IT_STORAGE_MK4)
0530: 26 26 20 64 65 66 69 6e 65 64 28 4b 49 54 5f 53 && defined(KIT_S
0540: 54 4f 52 41 47 45 5f 5a 49 50 29 0a 23 20 20 75 TORAGE_ZIP).# u
0550: 6e 64 65 66 20 4b 49 54 5f 53 54 4f 52 41 47 45 ndef KIT_STORAGE
0560: 5f 5a 49 50 0a 23 65 6e 64 69 66 0a 23 69 66 20 _ZIP.#endif.#if
0570: 21 64 65 66 69 6e 65 64 28 4b 49 54 5f 53 54 4f !defined(KIT_STO
0580: 52 41 47 45 5f 4d 4b 34 29 20 26 26 20 21 64 65 RAGE_MK4) && !de
0590: 66 69 6e 65 64 28 4b 49 54 5f 53 54 4f 52 41 47 fined(KIT_STORAG
05a0: 45 5f 5a 49 50 29 0a 23 20 20 69 66 64 65 66 20 E_ZIP).# ifdef
05b0: 4b 49 54 5f 49 4e 43 4c 55 44 45 53 5f 4d 4b 34 KIT_INCLUDES_MK4
05c0: 54 43 4c 0a 23 20 20 20 20 64 65 66 69 6e 65 20 TCL.# define
05d0: 4b 49 54 5f 53 54 4f 52 41 47 45 5f 4d 4b 34 20 KIT_STORAGE_MK4
05e0: 31 0a 23 20 20 65 6c 73 65 0a 23 20 20 20 20 64 1.# else.# d
05f0: 65 66 69 6e 65 20 4b 49 54 5f 53 54 4f 52 41 47 efine KIT_STORAG
0600: 45 5f 5a 49 50 20 31 0a 23 20 20 65 6e 64 69 66 E_ZIP 1.# endif
0610: 0a 23 65 6e 64 69 66 0a 0a 63 68 61 72 20 2a 74 .#endif..char *t
0620: 63 6c 45 78 65 63 75 74 61 62 6c 65 4e 61 6d 65 clExecutableName
0630: 3b 0a 0a 20 20 20 20 2f 2a 0a 20 20 20 20 20 2a ;.. /*. *
0640: 20 20 41 74 74 65 6d 70 74 20 74 6f 20 6c 6f 61 Attempt to loa
0650: 64 20 61 20 22 62 6f 6f 74 2e 74 63 6c 22 20 65 d a "boot.tcl" e
0660: 6e 74 72 79 20 66 72 6f 6d 20 74 68 65 20 65 6d ntry from the em
0670: 62 65 64 64 65 64 20 4d 65 74 61 4b 69 74 20 66 bedded MetaKit f
0680: 69 6c 65 2e 0a 20 20 20 20 20 2a 20 20 49 66 20 ile.. * If
0690: 74 68 65 72 65 20 69 73 6e 27 74 20 6f 6e 65 2c there isn't one,
06a0: 20 74 72 79 20 74 6f 20 6f 70 65 6e 20 61 20 72 try to open a r
06b0: 65 67 75 6c 61 72 20 22 73 65 74 75 70 2e 74 63 egular "setup.tc
06c0: 6c 22 20 66 69 6c 65 20 69 6e 73 74 65 61 64 2e l" file instead.
06d0: 0a 20 20 20 20 20 2a 20 20 49 66 20 74 68 61 74 . * If that
06e0: 20 66 61 69 6c 73 2c 20 74 68 69 73 20 63 6f 64 fails, this cod
06f0: 65 20 77 69 6c 6c 20 74 68 72 6f 77 20 61 6e 20 e will throw an
0700: 65 72 72 6f 72 2c 20 75 73 69 6e 67 20 61 20 6d error, using a m
0710: 65 73 73 61 67 65 20 62 6f 78 2e 0a 20 20 20 20 essage box..
0720: 20 2a 2f 0a 0a 73 74 61 74 69 63 20 63 68 61 72 */..static char
0730: 20 2a 70 72 65 49 6e 69 74 43 6d 64 20 3d 20 0a *preInitCmd = .
0740: 23 69 66 64 65 66 20 5f 57 49 4e 33 32 5f 57 43 #ifdef _WIN32_WC
0750: 45 0a 2f 2a 20 73 69 6c 6c 79 20 68 61 63 6b 20 E./* silly hack
0760: 74 6f 20 67 65 74 20 77 69 6e 63 65 20 70 6f 72 to get wince por
0770: 74 20 74 6f 20 6c 61 75 6e 63 68 2c 20 73 6f 6d t to launch, som
0780: 65 20 73 6f 72 74 20 6f 66 20 73 74 64 7b 69 6e e sort of std{in
0790: 2c 6f 75 74 2c 65 72 72 7d 20 70 72 6f 62 6c 65 ,out,err} proble
07a0: 6d 20 2a 2f 0a 22 6f 70 65 6e 20 2f 6b 69 74 6f m */."open /kito
07b0: 75 74 2e 74 78 74 20 61 3b 20 6f 70 65 6e 20 2f ut.txt a; open /
07c0: 6b 69 74 6f 75 74 2e 74 78 74 20 61 3b 20 6f 70 kitout.txt a; op
07d0: 65 6e 20 2f 6b 69 74 6f 75 74 2e 74 78 74 20 61 en /kitout.txt a
07e0: 5c 6e 22 0a 2f 2a 20 74 68 69 73 20 74 6f 6f 20 \n"./* this too
07f0: 73 65 65 6d 73 20 74 6f 20 62 65 20 6e 65 65 64 seems to be need
0800: 65 64 20 6f 6e 20 77 69 6e 63 65 20 2d 20 69 74 ed on wince - it
0810: 20 61 70 70 65 61 72 73 20 74 6f 20 62 65 20 72 appears to be r
0820: 65 6c 61 74 65 64 20 74 6f 20 74 68 65 20 61 62 elated to the ab
0830: 6f 76 65 20 2a 2f 0a 22 63 61 74 63 68 20 7b 72 ove */."catch {r
0840: 65 6e 61 6d 65 20 73 6f 75 72 63 65 20 3a 3a 74 ename source ::t
0850: 63 6c 3a 3a 73 6f 75 72 63 65 7d 5c 6e 22 0a 22 cl::source}\n"."
0860: 70 72 6f 63 20 73 6f 75 72 63 65 20 66 69 6c 65 proc source file
0870: 20 7b 5c 6e 22 0a 09 22 73 65 74 20 6f 6c 64 20 {\n".."set old
0880: 5b 69 6e 66 6f 20 73 63 72 69 70 74 5d 5c 6e 22 [info script]\n"
0890: 0a 09 22 69 6e 66 6f 20 73 63 72 69 70 74 20 24 .."info script $
08a0: 66 69 6c 65 5c 6e 22 0a 09 22 73 65 74 20 66 69 file\n".."set fi
08b0: 64 20 5b 6f 70 65 6e 20 24 66 69 6c 65 5d 5c 6e d [open $file]\n
08c0: 22 0a 09 22 73 65 74 20 64 61 74 61 20 5b 72 65 ".."set data [re
08d0: 61 64 20 24 66 69 64 5d 5c 6e 22 0a 09 22 63 6c ad $fid]\n".."cl
08e0: 6f 73 65 20 24 66 69 64 5c 6e 22 0a 09 22 73 65 ose $fid\n".."se
08f0: 74 20 63 6f 64 65 20 5b 63 61 74 63 68 20 7b 75 t code [catch {u
0900: 70 6c 65 76 65 6c 20 31 20 24 64 61 74 61 7d 20 plevel 1 $data}
0910: 72 65 73 5d 5c 6e 22 0a 09 22 69 6e 66 6f 20 73 res]\n".."info s
0920: 63 72 69 70 74 20 24 6f 6c 64 5c 6e 22 0a 09 22 cript $old\n".."
0930: 69 66 20 7b 24 63 6f 64 65 20 3d 3d 20 32 7d 20 if {$code == 2}
0940: 7b 20 73 65 74 20 63 6f 64 65 20 30 20 7d 5c 6e { set code 0 }\n
0950: 22 0a 09 22 72 65 74 75 72 6e 20 2d 63 6f 64 65 ".."return -code
0960: 20 24 63 6f 64 65 20 24 72 65 73 5c 6e 22 0a 22 $code $res\n"."
0970: 7d 5c 6e 22 0a 23 65 6e 64 69 66 20 2f 2a 20 5f }\n".#endif /* _
0980: 57 49 4e 33 32 5f 57 43 45 20 2a 2f 0a 22 70 72 WIN32_WCE */."pr
0990: 6f 63 20 74 63 6c 4b 69 74 49 6e 69 74 20 7b 7d oc tclKitInit {}
09a0: 20 7b 5c 6e 22 0a 09 22 72 65 6e 61 6d 65 20 74 {\n".."rename t
09b0: 63 6c 4b 69 74 49 6e 69 74 20 7b 7d 5c 6e 22 0a clKitInit {}\n".
09c0: 23 69 66 64 65 66 20 4b 49 54 5f 53 54 4f 52 41 #ifdef KIT_STORA
09d0: 47 45 5f 4d 4b 34 0a 09 22 73 65 74 20 3a 3a 74 GE_MK4.."set ::t
09e0: 63 6c 4b 69 74 53 74 6f 72 61 67 65 20 5c 22 6d clKitStorage \"m
09f0: 6b 34 5c 22 5c 6e 22 0a 09 22 63 61 74 63 68 20 k4\"\n".."catch
0a00: 7b 20 6c 6f 61 64 20 7b 7d 20 4d 6b 34 74 63 6c { load {} Mk4tcl
0a10: 20 7d 5c 6e 22 0a 09 22 6d 6b 3a 3a 66 69 6c 65 }\n".."mk::file
0a20: 20 6f 70 65 6e 20 65 78 65 20 5b 69 6e 66 6f 20 open exe [info
0a30: 6e 61 6d 65 6f 66 65 78 65 63 75 74 61 62 6c 65 nameofexecutable
0a40: 5d 20 2d 72 65 61 64 6f 6e 6c 79 5c 6e 22 0a 09 ] -readonly\n"..
0a50: 22 73 65 74 20 6e 20 5b 6d 6b 3a 3a 73 65 6c 65 "set n [mk::sele
0a60: 63 74 20 65 78 65 2e 64 69 72 73 21 30 2e 66 69 ct exe.dirs!0.fi
0a70: 6c 65 73 20 6e 61 6d 65 20 62 6f 6f 74 2e 74 63 les name boot.tc
0a80: 6c 5d 5c 6e 22 0a 09 22 69 66 20 7b 24 6e 20 21 l]\n".."if {$n !
0a90: 3d 20 5c 22 5c 22 7d 20 7b 5c 6e 22 0a 09 09 22 = \"\"} {\n"..."
0aa0: 73 65 74 20 73 20 5b 6d 6b 3a 3a 67 65 74 20 65 set s [mk::get e
0ab0: 78 65 2e 64 69 72 73 21 30 2e 66 69 6c 65 73 21 xe.dirs!0.files!
0ac0: 24 6e 20 63 6f 6e 74 65 6e 74 73 5d 5c 6e 22 0a $n contents]\n".
0ad0: 09 09 22 69 66 20 7b 21 5b 73 74 72 69 6e 67 20 .."if {![string
0ae0: 6c 65 6e 67 74 68 20 24 73 5d 7d 20 7b 20 65 72 length $s]} { er
0af0: 72 6f 72 20 5c 22 65 6d 70 74 79 20 62 6f 6f 74 ror \"empty boot
0b00: 2e 74 63 6c 5c 22 20 7d 5c 6e 22 0a 09 09 22 63 .tcl\" }\n"..."c
0b10: 61 74 63 68 20 7b 6c 6f 61 64 20 7b 7d 20 7a 6c atch {load {} zl
0b20: 69 62 7d 5c 6e 22 0a 09 09 22 69 66 20 7b 5b 6d ib}\n"..."if {[m
0b30: 6b 3a 3a 67 65 74 20 65 78 65 2e 64 69 72 73 21 k::get exe.dirs!
0b40: 30 2e 66 69 6c 65 73 21 24 6e 20 73 69 7a 65 5d 0.files!$n size]
0b50: 20 21 3d 20 5b 73 74 72 69 6e 67 20 6c 65 6e 67 != [string leng
0b60: 74 68 20 24 73 5d 7d 20 7b 5c 6e 22 0a 09 09 09 th $s]} {\n"....
0b70: 22 73 65 74 20 73 20 5b 7a 6c 69 62 20 64 65 63 "set s [zlib dec
0b80: 6f 6d 70 72 65 73 73 20 24 73 5d 5c 6e 22 0a 09 ompress $s]\n"..
0b90: 09 22 7d 5c 6e 22 0a 09 22 7d 5c 6e 22 0a 23 65 ."}\n".."}\n".#e
0ba0: 6e 64 69 66 20 2f 2a 20 4b 49 54 5f 53 54 4f 52 ndif /* KIT_STOR
0bb0: 41 47 45 5f 4d 4b 34 20 2a 2f 0a 23 69 66 64 65 AGE_MK4 */.#ifde
0bc0: 66 20 4b 49 54 5f 53 54 4f 52 41 47 45 5f 5a 49 f KIT_STORAGE_ZI
0bd0: 50 0a 09 22 73 65 74 20 3a 3a 74 63 6c 4b 69 74 P.."set ::tclKit
0be0: 53 74 6f 72 61 67 65 20 5c 22 7a 69 70 5c 22 5c Storage \"zip\"\
0bf0: 6e 22 0a 09 22 63 61 74 63 68 20 7b 20 6c 6f 61 n".."catch { loa
0c00: 64 20 7b 7d 20 76 66 73 20 7d 5c 6e 22 0a 23 20 d {} vfs }\n".#
0c10: 20 69 6e 63 6c 75 64 65 20 22 7a 69 70 76 66 73 include "zipvfs
0c20: 2e 74 63 6c 2e 68 22 0a 09 22 73 65 74 20 3a 3a .tcl.h".."set ::
0c30: 74 63 6c 4b 69 74 53 74 6f 72 61 67 65 5f 66 64 tclKitStorage_fd
0c40: 20 5b 7a 69 70 3a 3a 6f 70 65 6e 20 5b 69 6e 66 [zip::open [inf
0c50: 6f 20 6e 61 6d 65 6f 66 65 78 65 63 75 74 61 62 o nameofexecutab
0c60: 6c 65 5d 5d 5c 6e 22 0a 09 22 69 66 20 7b 21 5b le]]\n".."if {![
0c70: 63 61 74 63 68 20 7b 20 3a 3a 7a 69 70 3a 3a 73 catch { ::zip::s
0c80: 74 61 74 20 24 3a 3a 74 63 6c 4b 69 74 53 74 6f tat $::tclKitSto
0c90: 72 61 67 65 5f 66 64 20 62 6f 6f 74 2e 74 63 6c rage_fd boot.tcl
0ca0: 20 73 62 20 7d 5d 7d 20 7b 5c 6e 22 0a 09 09 22 sb }]} {\n"..."
0cb0: 73 65 65 6b 20 24 3a 3a 74 63 6c 4b 69 74 53 74 seek $::tclKitSt
0cc0: 6f 72 61 67 65 5f 66 64 20 24 73 62 28 69 6e 6f orage_fd $sb(ino
0cd0: 29 5c 6e 22 0a 09 09 22 7a 69 70 3a 3a 44 61 74 )\n"..."zip::Dat
0ce0: 61 20 24 3a 3a 74 63 6c 4b 69 74 53 74 6f 72 61 a $::tclKitStora
0cf0: 67 65 5f 66 64 20 73 62 20 73 5c 6e 22 0a 09 22 ge_fd sb s\n".."
0d00: 7d 5c 6e 22 0a 23 65 6e 64 69 66 20 2f 2a 20 4b }\n".#endif /* K
0d10: 49 54 5f 53 54 4f 52 41 47 45 5f 5a 49 50 20 2a IT_STORAGE_ZIP *
0d20: 2f 0a 09 22 69 66 20 7b 21 5b 69 6e 66 6f 20 65 /.."if {![info e
0d30: 78 69 73 74 73 20 73 5d 7d 20 7b 5c 6e 22 0a 09 xists s]} {\n"..
0d40: 09 22 73 65 74 20 66 20 5b 6f 70 65 6e 20 73 65 ."set f [open se
0d50: 74 75 70 2e 74 63 6c 5d 5c 6e 22 0a 09 09 22 73 tup.tcl]\n"..."s
0d60: 65 74 20 73 20 5b 72 65 61 64 20 24 66 5d 5c 6e et s [read $f]\n
0d70: 22 0a 09 09 22 63 6c 6f 73 65 20 24 66 5c 6e 22 "..."close $f\n"
0d80: 0a 09 22 7d 5c 6e 22 0a 09 22 75 70 6c 65 76 65 .."}\n".."upleve
0d90: 6c 20 23 30 20 24 73 5c 6e 22 0a 23 69 66 64 65 l #0 $s\n".#ifde
0da0: 66 20 5f 57 49 4e 33 32 0a 09 22 63 61 74 63 68 f _WIN32.."catch
0db0: 20 7b 6c 6f 61 64 20 7b 7d 20 64 64 65 7d 5c 6e {load {} dde}\n
0dc0: 22 0a 09 22 63 61 74 63 68 20 7b 6c 6f 61 64 20 ".."catch {load
0dd0: 7b 7d 20 72 65 67 69 73 74 72 79 7d 5c 6e 22 0a {} registry}\n".
0de0: 23 65 6e 64 69 66 20 2f 2a 20 5f 57 49 4e 33 32 #endif /* _WIN32
0df0: 20 2a 2f 0a 09 22 72 65 74 75 72 6e 20 30 5c 6e */.."return 0\n
0e00: 22 0a 22 7d 5c 6e 22 0a 22 74 63 6c 4b 69 74 49 "."}\n"."tclKitI
0e10: 6e 69 74 22 3b 0a 0a 73 74 61 74 69 63 20 63 6f nit";..static co
0e20: 6e 73 74 20 63 68 61 72 20 69 6e 69 74 53 63 72 nst char initScr
0e30: 69 70 74 5b 5d 20 3d 0a 22 69 66 20 7b 5b 66 69 ipt[] =."if {[fi
0e40: 6c 65 20 69 73 66 69 6c 65 20 5b 66 69 6c 65 20 le isfile [file
0e50: 6a 6f 69 6e 20 5b 69 6e 66 6f 20 6e 61 6d 65 6f join [info nameo
0e60: 66 65 78 65 5d 20 6d 61 69 6e 2e 74 63 6c 5d 5d fexe] main.tcl]]
0e70: 7d 20 7b 5c 6e 22 0a 09 22 69 66 20 7b 5b 69 6e } {\n".."if {[in
0e80: 66 6f 20 63 6f 6d 6d 61 6e 64 73 20 63 6f 6e 73 fo commands cons
0e90: 6f 6c 65 5d 20 21 3d 20 7b 7d 7d 20 7b 20 63 6f ole] != {}} { co
0ea0: 6e 73 6f 6c 65 20 68 69 64 65 20 7d 5c 6e 22 0a nsole hide }\n".
0eb0: 09 22 73 65 74 20 74 63 6c 5f 69 6e 74 65 72 61 ."set tcl_intera
0ec0: 63 74 69 76 65 20 30 5c 6e 22 0a 09 22 69 6e 63 ctive 0\n".."inc
0ed0: 72 20 61 72 67 63 5c 6e 22 0a 09 22 73 65 74 20 r argc\n".."set
0ee0: 61 72 67 76 20 5b 6c 69 6e 73 65 72 74 20 24 61 argv [linsert $a
0ef0: 72 67 76 20 30 20 24 61 72 67 76 30 5d 5c 6e 22 rgv 0 $argv0]\n"
0f00: 0a 09 22 73 65 74 20 61 72 67 76 30 20 5b 66 69 .."set argv0 [fi
0f10: 6c 65 20 6a 6f 69 6e 20 5b 69 6e 66 6f 20 6e 61 le join [info na
0f20: 6d 65 6f 66 65 78 65 5d 20 6d 61 69 6e 2e 74 63 meofexe] main.tc
0f30: 6c 5d 5c 6e 22 0a 22 7d 20 65 6c 73 65 20 63 6f l]\n"."} else co
0f40: 6e 74 69 6e 75 65 5c 6e 22 3b 0a 0a 2f 2a 20 53 ntinue\n";../* S
0f50: 65 74 45 78 65 63 4e 61 6d 65 20 2d 2d 0a 0a 20 etExecName --..
0f60: 20 20 48 61 63 6b 20 74 6f 20 67 65 74 20 61 72 Hack to get ar
0f70: 6f 75 6e 64 20 54 63 6c 20 62 75 67 20 31 32 32 ound Tcl bug 122
0f80: 34 38 38 38 2e 0a 2a 2f 0a 76 6f 69 64 20 53 65 4888..*/.void Se
0f90: 74 45 78 65 63 4e 61 6d 65 28 54 63 6c 5f 49 6e tExecName(Tcl_In
0fa0: 74 65 72 70 20 2a 69 6e 74 65 72 70 29 20 7b 0a terp *interp) {.
0fb0: 09 69 66 20 28 74 63 6c 45 78 65 63 75 74 61 62 .if (tclExecutab
0fc0: 6c 65 4e 61 6d 65 20 3d 3d 20 4e 55 4c 4c 29 20 leName == NULL)
0fd0: 7b 0a 09 09 69 6e 74 20 6c 65 6e 20 3d 20 30 3b {...int len = 0;
0fe0: 0a 09 09 54 63 6c 5f 4f 62 6a 20 2a 65 78 65 63 ...Tcl_Obj *exec
0ff0: 4e 61 6d 65 4f 62 6a 3b 0a 09 09 54 63 6c 5f 4f NameObj;...Tcl_O
1000: 62 6a 20 2a 6c 6f 62 6a 76 5b 31 5d 3b 0a 0a 09 bj *lobjv[1];...
1010: 09 6c 6f 62 6a 76 5b 30 5d 20 3d 20 54 63 6c 5f .lobjv[0] = Tcl_
1020: 47 65 74 56 61 72 32 45 78 28 69 6e 74 65 72 70 GetVar2Ex(interp
1030: 2c 20 22 61 72 67 76 30 22 2c 20 4e 55 4c 4c 2c , "argv0", NULL,
1040: 20 54 43 4c 5f 47 4c 4f 42 41 4c 5f 4f 4e 4c 59 TCL_GLOBAL_ONLY
1050: 29 3b 0a 09 09 65 78 65 63 4e 61 6d 65 4f 62 6a );...execNameObj
1060: 20 3d 20 54 63 6c 5f 46 53 4a 6f 69 6e 54 6f 50 = Tcl_FSJoinToP
1070: 61 74 68 28 54 63 6c 5f 46 53 47 65 74 43 77 64 ath(Tcl_FSGetCwd
1080: 28 69 6e 74 65 72 70 29 2c 20 31 2c 20 6c 6f 62 (interp), 1, lob
1090: 6a 76 29 3b 0a 0a 09 09 74 63 6c 45 78 65 63 75 jv);....tclExecu
10a0: 74 61 62 6c 65 4e 61 6d 65 20 3d 20 73 74 72 64 tableName = strd
10b0: 75 70 28 54 63 6c 5f 47 65 74 53 74 72 69 6e 67 up(Tcl_GetString
10c0: 46 72 6f 6d 4f 62 6a 28 65 78 65 63 4e 61 6d 65 FromObj(execName
10d0: 4f 62 6a 2c 20 26 6c 65 6e 29 29 3b 0a 09 7d 0a Obj, &len));..}.
10e0: 7d 0a 0a 69 6e 74 20 54 63 6c 4b 69 74 5f 41 70 }..int TclKit_Ap
10f0: 70 49 6e 69 74 28 54 63 6c 5f 49 6e 74 65 72 70 pInit(Tcl_Interp
1100: 20 2a 69 6e 74 65 72 70 29 20 7b 0a 23 69 66 64 *interp) {.#ifd
1110: 65 66 20 4b 49 54 5f 49 4e 43 4c 55 44 45 53 5f ef KIT_INCLUDES_
1120: 49 54 43 4c 0a 09 54 63 6c 5f 53 74 61 74 69 63 ITCL..Tcl_Static
1130: 50 61 63 6b 61 67 65 28 30 2c 20 22 49 74 63 6c Package(0, "Itcl
1140: 22 2c 20 49 74 63 6c 5f 49 6e 69 74 2c 20 4e 55 ", Itcl_Init, NU
1150: 4c 4c 29 3b 0a 23 65 6e 64 69 66 20 0a 23 69 66 LL);.#endif .#if
1160: 64 65 66 20 4b 49 54 5f 49 4e 43 4c 55 44 45 53 def KIT_INCLUDES
1170: 5f 4d 4b 34 54 43 4c 0a 09 54 63 6c 5f 53 74 61 _MK4TCL..Tcl_Sta
1180: 74 69 63 50 61 63 6b 61 67 65 28 30 2c 20 22 4d ticPackage(0, "M
1190: 6b 34 74 63 6c 22 2c 20 4d 6b 34 74 63 6c 5f 49 k4tcl", Mk4tcl_I
11a0: 6e 69 74 2c 20 4e 55 4c 4c 29 3b 0a 23 65 6e 64 nit, NULL);.#end
11b0: 69 66 0a 23 69 66 20 31 30 20 2a 20 54 43 4c 5f if.#if 10 * TCL_
11c0: 4d 41 4a 4f 52 5f 56 45 52 53 49 4f 4e 20 2b 20 MAJOR_VERSION +
11d0: 54 43 4c 5f 4d 49 4e 4f 52 5f 56 45 52 53 49 4f TCL_MINOR_VERSIO
11e0: 4e 20 3c 20 38 35 0a 09 54 63 6c 5f 53 74 61 74 N < 85..Tcl_Stat
11f0: 69 63 50 61 63 6b 61 67 65 28 30 2c 20 22 70 77 icPackage(0, "pw
1200: 62 22 2c 20 50 77 62 5f 49 6e 69 74 2c 20 4e 55 b", Pwb_Init, NU
1210: 4c 4c 29 3b 0a 23 65 6e 64 69 66 20 0a 09 54 63 LL);.#endif ..Tc
1220: 6c 5f 53 74 61 74 69 63 50 61 63 6b 61 67 65 28 l_StaticPackage(
1230: 30 2c 20 22 72 65 63 68 61 6e 22 2c 20 52 65 63 0, "rechan", Rec
1240: 68 61 6e 5f 49 6e 69 74 2c 20 4e 55 4c 4c 29 3b han_Init, NULL);
1250: 0a 09 54 63 6c 5f 53 74 61 74 69 63 50 61 63 6b ..Tcl_StaticPack
1260: 61 67 65 28 30 2c 20 22 76 66 73 22 2c 20 56 66 age(0, "vfs", Vf
1270: 73 5f 49 6e 69 74 2c 20 4e 55 4c 4c 29 3b 0a 09 s_Init, NULL);..
1280: 54 63 6c 5f 53 74 61 74 69 63 50 61 63 6b 61 67 Tcl_StaticPackag
1290: 65 28 30 2c 20 22 7a 6c 69 62 22 2c 20 5a 6c 69 e(0, "zlib", Zli
12a0: 62 5f 49 6e 69 74 2c 20 4e 55 4c 4c 29 3b 0a 23 b_Init, NULL);.#
12b0: 69 66 64 65 66 20 54 43 4c 5f 54 48 52 45 41 44 ifdef TCL_THREAD
12c0: 53 0a 09 54 63 6c 5f 53 74 61 74 69 63 50 61 63 S..Tcl_StaticPac
12d0: 6b 61 67 65 28 30 2c 20 22 54 68 72 65 61 64 22 kage(0, "Thread"
12e0: 2c 20 54 68 72 65 61 64 5f 49 6e 69 74 2c 20 4e , Thread_Init, N
12f0: 55 4c 4c 29 3b 0a 23 65 6e 64 69 66 0a 23 69 66 ULL);.#endif.#if
1300: 64 65 66 20 5f 57 49 4e 33 32 0a 09 54 63 6c 5f def _WIN32..Tcl_
1310: 53 74 61 74 69 63 50 61 63 6b 61 67 65 28 30 2c StaticPackage(0,
1320: 20 22 64 64 65 22 2c 20 44 64 65 5f 49 6e 69 74 "dde", Dde_Init
1330: 2c 20 4e 55 4c 4c 29 3b 0a 09 54 63 6c 5f 53 74 , NULL);..Tcl_St
1340: 61 74 69 63 50 61 63 6b 61 67 65 28 30 2c 20 22 aticPackage(0, "
1350: 72 65 67 69 73 74 72 79 22 2c 20 52 65 67 69 73 registry", Regis
1360: 74 72 79 5f 49 6e 69 74 2c 20 4e 55 4c 4c 29 3b try_Init, NULL);
1370: 0a 23 65 6e 64 69 66 0a 23 69 66 64 65 66 20 4b .#endif.#ifdef K
1380: 49 54 5f 49 4e 43 4c 55 44 45 53 5f 54 4b 0a 09 IT_INCLUDES_TK..
1390: 54 63 6c 5f 53 74 61 74 69 63 50 61 63 6b 61 67 Tcl_StaticPackag
13a0: 65 28 30 2c 20 22 54 6b 22 2c 20 54 6b 5f 49 6e e(0, "Tk", Tk_In
13b0: 69 74 2c 20 54 6b 5f 53 61 66 65 49 6e 69 74 29 it, Tk_SafeInit)
13c0: 3b 0a 23 65 6e 64 69 66 0a 0a 09 2f 2a 20 74 68 ;.#endif.../* th
13d0: 65 20 74 63 6c 5f 72 63 46 69 6c 65 4e 61 6d 65 e tcl_rcFileName
13e0: 20 76 61 72 69 61 62 6c 65 20 6f 6e 6c 79 20 65 variable only e
13f0: 78 69 73 74 73 20 69 6e 20 74 68 65 20 69 6e 69 xists in the ini
1400: 74 69 61 6c 20 69 6e 74 65 72 70 72 65 74 65 72 tial interpreter
1410: 20 2a 2f 0a 23 69 66 64 65 66 20 5f 57 49 4e 33 */.#ifdef _WIN3
1420: 32 0a 09 54 63 6c 5f 53 65 74 56 61 72 28 69 6e 2..Tcl_SetVar(in
1430: 74 65 72 70 2c 20 22 74 63 6c 5f 72 63 46 69 6c terp, "tcl_rcFil
1440: 65 4e 61 6d 65 22 2c 20 22 7e 2f 74 63 6c 6b 69 eName", "~/tclki
1450: 74 72 63 2e 74 63 6c 22 2c 20 54 43 4c 5f 47 4c trc.tcl", TCL_GL
1460: 4f 42 41 4c 5f 4f 4e 4c 59 29 3b 0a 23 65 6c 73 OBAL_ONLY);.#els
1470: 65 0a 09 54 63 6c 5f 53 65 74 56 61 72 28 69 6e e..Tcl_SetVar(in
1480: 74 65 72 70 2c 20 22 74 63 6c 5f 72 63 46 69 6c terp, "tcl_rcFil
1490: 65 4e 61 6d 65 22 2c 20 22 7e 2f 2e 74 63 6c 6b eName", "~/.tclk
14a0: 69 74 72 63 22 2c 20 54 43 4c 5f 47 4c 4f 42 41 itrc", TCL_GLOBA
14b0: 4c 5f 4f 4e 4c 59 29 3b 0a 23 65 6e 64 69 66 0a L_ONLY);.#endif.
14c0: 0a 09 2f 2a 20 48 61 63 6b 20 74 6f 20 67 65 74 ../* Hack to get
14d0: 20 61 72 6f 75 6e 64 20 54 63 6c 20 62 75 67 20 around Tcl bug
14e0: 31 32 32 34 38 38 38 2e 20 20 54 68 69 73 20 6d 1224888. This m
14f0: 75 73 74 20 62 65 20 72 75 6e 20 68 65 72 65 20 ust be run here
1500: 61 6e 64 0a 09 20 2a 20 69 6e 20 4c 69 62 72 61 and.. * in Libra
1510: 72 79 50 61 74 68 4f 62 6a 43 6d 64 20 62 65 63 ryPathObjCmd bec
1520: 61 75 73 65 20 74 68 69 73 20 69 6e 66 6f 72 6d ause this inform
1530: 61 74 69 6f 6e 20 69 73 20 6e 65 65 64 65 64 20 ation is needed
1540: 62 6f 74 68 0a 09 20 2a 20 62 65 66 6f 72 65 20 both.. * before
1550: 61 6e 64 20 61 66 74 65 72 20 74 68 61 74 20 63 and after that c
1560: 6f 6d 6d 61 6e 64 20 69 73 20 72 75 6e 2e 20 2a ommand is run. *
1570: 2f 0a 09 53 65 74 45 78 65 63 4e 61 6d 65 28 69 /..SetExecName(i
1580: 6e 74 65 72 70 29 3b 0a 0a 09 54 63 6c 53 65 74 nterp);...TclSet
1590: 50 72 65 49 6e 69 74 53 63 72 69 70 74 28 70 72 PreInitScript(pr
15a0: 65 49 6e 69 74 43 6d 64 29 3b 0a 09 69 66 20 28 eInitCmd);..if (
15b0: 54 63 6c 5f 49 6e 69 74 28 69 6e 74 65 72 70 29 Tcl_Init(interp)
15c0: 20 3d 3d 20 54 43 4c 5f 45 52 52 4f 52 29 20 7b == TCL_ERROR) {
15d0: 0a 09 09 67 6f 74 6f 20 65 72 72 6f 72 3b 0a 09 ...goto error;..
15e0: 7d 0a 0a 23 69 66 64 65 66 20 4b 49 54 5f 49 4e }..#ifdef KIT_IN
15f0: 43 4c 55 44 45 53 5f 54 4b 0a 23 20 20 69 66 64 CLUDES_TK.# ifd
1600: 65 66 20 5f 57 49 4e 33 32 0a 09 69 66 20 28 54 ef _WIN32..if (T
1610: 6b 5f 49 6e 69 74 28 69 6e 74 65 72 70 29 20 3d k_Init(interp) =
1620: 3d 20 54 43 4c 5f 45 52 52 4f 52 29 20 7b 0a 09 = TCL_ERROR) {..
1630: 09 67 6f 74 6f 20 65 72 72 6f 72 3b 0a 09 7d 0a .goto error;..}.
1640: 09 69 66 20 28 54 6b 5f 43 72 65 61 74 65 43 6f .if (Tk_CreateCo
1650: 6e 73 6f 6c 65 57 69 6e 64 6f 77 28 69 6e 74 65 nsoleWindow(inte
1660: 72 70 29 20 3d 3d 20 54 43 4c 5f 45 52 52 4f 52 rp) == TCL_ERROR
1670: 29 20 7b 0a 09 09 67 6f 74 6f 20 65 72 72 6f 72 ) {...goto error
1680: 3b 0a 09 7d 0a 23 20 20 65 6e 64 69 66 20 2f 2a ;..}.# endif /*
1690: 20 5f 57 49 4e 33 32 20 2a 2f 0a 23 65 6e 64 69 _WIN32 */.#endi
16a0: 66 20 2f 2a 20 4b 49 54 5f 49 4e 43 4c 55 44 45 f /* KIT_INCLUDE
16b0: 53 5f 54 4b 20 2a 2f 0a 0a 09 2f 2a 20 6d 65 73 S_TK */.../* mes
16c0: 73 79 20 62 65 63 61 75 73 65 20 54 63 6c 53 65 sy because TclSe
16d0: 74 53 74 61 72 74 75 70 53 63 72 69 70 74 50 61 tStartupScriptPa
16e0: 74 68 20 69 73 20 63 61 6c 6c 65 64 20 73 6c 69 th is called sli
16f0: 67 68 74 6c 79 20 74 6f 6f 20 6c 61 74 65 20 2a ghtly too late *
1700: 2f 0a 09 69 66 20 28 54 63 6c 5f 45 76 61 6c 28 /..if (Tcl_Eval(
1710: 69 6e 74 65 72 70 2c 20 69 6e 69 74 53 63 72 69 interp, initScri
1720: 70 74 29 20 3d 3d 20 54 43 4c 5f 4f 4b 29 20 7b pt) == TCL_OK) {
1730: 0a 09 09 54 63 6c 5f 4f 62 6a 2a 20 70 61 74 68 ...Tcl_Obj* path
1740: 3b 0a 23 69 66 64 65 66 20 48 41 56 45 5f 54 43 ;.#ifdef HAVE_TC
1750: 4c 53 45 54 53 54 41 52 54 55 50 53 43 52 49 50 LSETSTARTUPSCRIP
1760: 54 50 41 54 48 0a 09 09 70 61 74 68 20 3d 20 54 TPATH...path = T
1770: 63 6c 47 65 74 53 74 61 72 74 75 70 53 63 72 69 clGetStartupScri
1780: 70 74 50 61 74 68 28 29 3b 0a 09 09 54 63 6c 53 ptPath();...TclS
1790: 65 74 53 74 61 72 74 75 70 53 63 72 69 70 74 50 etStartupScriptP
17a0: 61 74 68 28 54 63 6c 5f 47 65 74 4f 62 6a 52 65 ath(Tcl_GetObjRe
17b0: 73 75 6c 74 28 69 6e 74 65 72 70 29 29 3b 0a 23 sult(interp));.#
17c0: 65 6c 69 66 20 64 65 66 69 6e 65 64 28 48 41 56 elif defined(HAV
17d0: 45 5f 54 43 4c 5f 53 45 54 53 54 41 52 54 55 50 E_TCL_SETSTARTUP
17e0: 53 43 52 49 50 54 29 0a 09 09 70 61 74 68 20 3d SCRIPT)...path =
17f0: 20 54 63 6c 5f 47 65 74 53 74 61 72 74 75 70 53 Tcl_GetStartupS
1800: 63 72 69 70 74 28 4e 55 4c 4c 29 3b 0a 09 09 54 cript(NULL);...T
1810: 63 6c 5f 53 65 74 53 74 61 72 74 75 70 53 63 72 cl_SetStartupScr
1820: 69 70 74 28 54 63 6c 5f 47 65 74 4f 62 6a 52 65 ipt(Tcl_GetObjRe
1830: 73 75 6c 74 28 69 6e 74 65 72 70 29 2c 20 4e 55 sult(interp), NU
1840: 4c 4c 29 3b 0a 23 65 6e 64 69 66 0a 09 09 69 66 LL);.#endif...if
1850: 20 28 70 61 74 68 20 3d 3d 20 4e 55 4c 4c 29 20 (path == NULL)
1860: 7b 0a 09 09 09 54 63 6c 5f 45 76 61 6c 28 69 6e {....Tcl_Eval(in
1870: 74 65 72 70 2c 20 22 69 6e 63 72 20 61 72 67 63 terp, "incr argc
1880: 20 2d 31 3b 20 73 65 74 20 61 72 67 76 20 5b 6c -1; set argv [l
1890: 72 61 6e 67 65 20 24 61 72 67 76 20 31 20 65 6e range $argv 1 en
18a0: 64 5d 22 29 3b 0a 09 09 7d 0a 09 7d 0a 0a 09 54 d]");...}..}...T
18b0: 63 6c 5f 53 65 74 56 61 72 28 69 6e 74 65 72 70 cl_SetVar(interp
18c0: 2c 20 22 65 72 72 6f 72 49 6e 66 6f 22 2c 20 22 , "errorInfo", "
18d0: 22 2c 20 54 43 4c 5f 47 4c 4f 42 41 4c 5f 4f 4e ", TCL_GLOBAL_ON
18e0: 4c 59 29 3b 0a 09 54 63 6c 5f 52 65 73 65 74 52 LY);..Tcl_ResetR
18f0: 65 73 75 6c 74 28 69 6e 74 65 72 70 29 3b 0a 0a esult(interp);..
1900: 09 72 65 74 75 72 6e 20 54 43 4c 5f 4f 4b 3b 0a .return TCL_OK;.
1910: 0a 65 72 72 6f 72 3a 0a 23 69 66 64 65 66 20 4b .error:.#ifdef K
1920: 49 54 5f 49 4e 43 4c 55 44 45 53 5f 54 4b 0a 23 IT_INCLUDES_TK.#
1930: 20 20 69 66 64 65 66 20 5f 57 49 4e 33 32 0a 09 ifdef _WIN32..
1940: 4d 65 73 73 61 67 65 42 65 65 70 28 4d 42 5f 49 MessageBeep(MB_I
1950: 43 4f 4e 45 58 43 4c 41 4d 41 54 49 4f 4e 29 3b CONEXCLAMATION);
1960: 0a 23 20 20 20 20 69 66 6e 64 65 66 20 5f 57 49 .# ifndef _WI
1970: 4e 33 32 5f 57 43 45 0a 09 4d 65 73 73 61 67 65 N32_WCE..Message
1980: 42 6f 78 28 4e 55 4c 4c 2c 20 54 63 6c 5f 47 65 Box(NULL, Tcl_Ge
1990: 74 53 74 72 69 6e 67 52 65 73 75 6c 74 28 69 6e tStringResult(in
19a0: 74 65 72 70 29 2c 20 22 45 72 72 6f 72 20 69 6e terp), "Error in
19b0: 20 54 63 6c 4b 69 74 22 2c 0a 09 20 20 20 20 20 TclKit",..
19c0: 20 20 20 20 20 20 4d 42 5f 49 43 4f 4e 53 54 4f MB_ICONSTO
19d0: 50 20 7c 20 4d 42 5f 4f 4b 20 7c 20 4d 42 5f 54 P | MB_OK | MB_T
19e0: 41 53 4b 4d 4f 44 41 4c 20 7c 20 4d 42 5f 53 45 ASKMODAL | MB_SE
19f0: 54 46 4f 52 45 47 52 4f 55 4e 44 29 3b 0a 0a 09 TFOREGROUND);...
1a00: 45 78 69 74 50 72 6f 63 65 73 73 28 31 29 3b 0a ExitProcess(1);.
1a10: 23 20 20 20 20 65 6e 64 69 66 20 2f 2a 20 21 5f # endif /* !_
1a20: 57 49 4e 33 32 5f 57 43 45 20 2a 2f 0a 20 20 20 WIN32_WCE */.
1a30: 20 2f 2a 20 77 65 20 77 6f 6e 27 74 20 72 65 61 /* we won't rea
1a40: 63 68 20 74 68 69 73 2c 20 62 75 74 20 77 65 20 ch this, but we
1a50: 6e 65 65 64 20 74 68 65 20 72 65 74 75 72 6e 20 need the return
1a60: 2a 2f 0a 23 20 20 65 6e 64 69 66 20 2f 2a 20 5f */.# endif /* _
1a70: 57 49 4e 33 32 20 2a 2f 0a 23 65 6e 64 69 66 20 WIN32 */.#endif
1a80: 2f 2a 20 4b 49 54 5f 49 4e 43 4c 55 44 45 53 5f /* KIT_INCLUDES_
1a90: 54 4b 20 2a 2f 0a 0a 09 72 65 74 75 72 6e 20 54 TK */...return T
1aa0: 43 4c 5f 45 52 52 4f 52 3b 0a 7d 0a CL_ERROR;.}.