0000: 2f 2a 0a 20 2a 20 74 63 6c 2e 68 20 2d 2d 0a 20 /*. * tcl.h --.
0010: 2a 0a 20 2a 09 54 68 69 73 20 68 65 61 64 65 72 *. *.This header
0020: 20 66 69 6c 65 20 64 65 73 63 72 69 62 65 73 20 file describes
0030: 74 68 65 20 65 78 74 65 72 6e 61 6c 6c 79 2d 76 the externally-v
0040: 69 73 69 62 6c 65 20 66 61 63 69 6c 69 74 69 65 isible facilitie
0050: 73 20 6f 66 20 74 68 65 0a 20 2a 09 54 63 6c 20 s of the. *.Tcl
0060: 69 6e 74 65 72 70 72 65 74 65 72 2e 0a 20 2a 0a interpreter.. *.
0070: 20 2a 20 43 6f 70 79 72 69 67 68 74 20 28 63 29 * Copyright (c)
0080: 20 31 39 38 37 2d 31 39 39 34 20 54 68 65 20 52 1987-1994 The R
0090: 65 67 65 6e 74 73 20 6f 66 20 74 68 65 20 55 6e egents of the Un
00a0: 69 76 65 72 73 69 74 79 20 6f 66 20 43 61 6c 69 iversity of Cali
00b0: 66 6f 72 6e 69 61 2e 0a 20 2a 20 43 6f 70 79 72 fornia.. * Copyr
00c0: 69 67 68 74 20 28 63 29 20 31 39 39 33 2d 31 39 ight (c) 1993-19
00d0: 39 36 20 4c 75 63 65 6e 74 20 54 65 63 68 6e 6f 96 Lucent Techno
00e0: 6c 6f 67 69 65 73 2e 0a 20 2a 20 43 6f 70 79 72 logies.. * Copyr
00f0: 69 67 68 74 20 28 63 29 20 31 39 39 34 2d 31 39 ight (c) 1994-19
0100: 39 38 20 53 75 6e 20 4d 69 63 72 6f 73 79 73 74 98 Sun Microsyst
0110: 65 6d 73 2c 20 49 6e 63 2e 0a 20 2a 20 43 6f 70 ems, Inc.. * Cop
0120: 79 72 69 67 68 74 20 28 63 29 20 31 39 39 38 2d yright (c) 1998-
0130: 32 30 30 30 20 62 79 20 53 63 72 69 70 74 69 63 2000 by Scriptic
0140: 73 20 43 6f 72 70 6f 72 61 74 69 6f 6e 2e 0a 20 s Corporation..
0150: 2a 20 43 6f 70 79 72 69 67 68 74 20 28 63 29 20 * Copyright (c)
0160: 32 30 30 32 20 62 79 20 4b 65 76 69 6e 20 42 2e 2002 by Kevin B.
0170: 20 4b 65 6e 6e 79 2e 20 20 41 6c 6c 20 72 69 67 Kenny. All rig
0180: 68 74 73 20 72 65 73 65 72 76 65 64 2e 0a 20 2a hts reserved.. *
0190: 0a 20 2a 20 53 65 65 20 74 68 65 20 66 69 6c 65 . * See the file
01a0: 20 22 6c 69 63 65 6e 73 65 2e 74 65 72 6d 73 22 "license.terms"
01b0: 20 66 6f 72 20 69 6e 66 6f 72 6d 61 74 69 6f 6e for information
01c0: 20 6f 6e 20 75 73 61 67 65 20 61 6e 64 20 72 65 on usage and re
01d0: 64 69 73 74 72 69 62 75 74 69 6f 6e 20 6f 66 0a distribution of.
01e0: 20 2a 20 74 68 69 73 20 66 69 6c 65 2c 20 61 6e * this file, an
01f0: 64 20 66 6f 72 20 61 20 44 49 53 43 4c 41 49 4d d for a DISCLAIM
0200: 45 52 20 4f 46 20 41 4c 4c 20 57 41 52 52 41 4e ER OF ALL WARRAN
0210: 54 49 45 53 2e 0a 20 2a 2f 0a 0a 23 69 66 6e 64 TIES.. */..#ifnd
0220: 65 66 20 5f 54 43 4c 0a 23 64 65 66 69 6e 65 20 ef _TCL.#define
0230: 5f 54 43 4c 0a 0a 2f 2a 0a 20 2a 20 46 6f 72 20 _TCL../*. * For
0240: 43 2b 2b 20 63 6f 6d 70 69 6c 65 72 73 2c 20 75 C++ compilers, u
0250: 73 65 20 65 78 74 65 72 6e 20 22 43 22 0a 20 2a se extern "C". *
0260: 2f 0a 0a 23 69 66 64 65 66 20 5f 5f 63 70 6c 75 /..#ifdef __cplu
0270: 73 70 6c 75 73 0a 65 78 74 65 72 6e 20 22 43 22 splus.extern "C"
0280: 20 7b 0a 23 65 6e 64 69 66 0a 0a 2f 2a 0a 20 2a {.#endif../*. *
0290: 20 54 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 64 The following d
02a0: 65 66 69 6e 65 73 20 61 72 65 20 75 73 65 64 20 efines are used
02b0: 74 6f 20 69 6e 64 69 63 61 74 65 20 74 68 65 20 to indicate the
02c0: 76 61 72 69 6f 75 73 20 72 65 6c 65 61 73 65 20 various release
02d0: 6c 65 76 65 6c 73 2e 0a 20 2a 2f 0a 0a 23 64 65 levels.. */..#de
02e0: 66 69 6e 65 20 54 43 4c 5f 41 4c 50 48 41 5f 52 fine TCL_ALPHA_R
02f0: 45 4c 45 41 53 45 09 30 0a 23 64 65 66 69 6e 65 ELEASE.0.#define
0300: 20 54 43 4c 5f 42 45 54 41 5f 52 45 4c 45 41 53 TCL_BETA_RELEAS
0310: 45 09 31 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f E.1.#define TCL_
0320: 46 49 4e 41 4c 5f 52 45 4c 45 41 53 45 09 32 0a FINAL_RELEASE.2.
0330: 0a 2f 2a 0a 20 2a 20 57 68 65 6e 20 76 65 72 73 ./*. * When vers
0340: 69 6f 6e 20 6e 75 6d 62 65 72 73 20 63 68 61 6e ion numbers chan
0350: 67 65 20 68 65 72 65 2c 20 6d 75 73 74 20 61 6c ge here, must al
0360: 73 6f 20 67 6f 20 69 6e 74 6f 20 74 68 65 20 66 so go into the f
0370: 6f 6c 6c 6f 77 69 6e 67 20 66 69 6c 65 73 20 61 ollowing files a
0380: 6e 64 0a 20 2a 20 75 70 64 61 74 65 20 74 68 65 nd. * update the
0390: 20 76 65 72 73 69 6f 6e 20 6e 75 6d 62 65 72 73 version numbers
03a0: 3a 0a 20 2a 0a 20 2a 20 6c 69 62 72 61 72 79 2f :. *. * library/
03b0: 69 6e 69 74 2e 74 63 6c 09 28 31 20 4c 4f 43 20 init.tcl.(1 LOC
03c0: 70 61 74 63 68 29 0a 20 2a 20 75 6e 69 78 2f 63 patch). * unix/c
03d0: 6f 6e 66 69 67 75 72 65 2e 61 63 09 28 32 20 4c onfigure.ac.(2 L
03e0: 4f 43 20 4d 61 6a 6f 72 2c 20 32 20 4c 4f 43 20 OC Major, 2 LOC
03f0: 6d 69 6e 6f 72 2c 20 31 20 4c 4f 43 20 70 61 74 minor, 1 LOC pat
0400: 63 68 29 0a 20 2a 20 77 69 6e 2f 63 6f 6e 66 69 ch). * win/confi
0410: 67 75 72 65 2e 61 63 09 28 61 73 20 61 62 6f 76 gure.ac.(as abov
0420: 65 29 0a 20 2a 20 77 69 6e 2f 74 63 6c 2e 6d 34 e). * win/tcl.m4
0430: 09 09 28 6e 6f 74 20 70 61 74 63 68 6c 65 76 65 ..(not patchleve
0440: 6c 29 0a 20 2a 20 52 45 41 44 4d 45 09 09 28 73 l). * README..(s
0450: 65 63 74 69 6f 6e 73 20 30 20 61 6e 64 20 32 2c ections 0 and 2,
0460: 20 77 69 74 68 20 61 6e 64 20 77 69 74 68 6f 75 with and withou
0470: 74 20 73 65 70 61 72 61 74 6f 72 29 0a 20 2a 20 t separator). *
0480: 6d 61 63 6f 73 78 2f 54 63 6c 2d 43 6f 6d 6d 6f macosx/Tcl-Commo
0490: 6e 2e 78 63 63 6f 6e 66 69 67 20 28 6e 6f 74 20 n.xcconfig (not
04a0: 70 61 74 63 68 6c 65 76 65 6c 29 20 31 20 4c 4f patchlevel) 1 LO
04b0: 43 0a 20 2a 20 77 69 6e 2f 52 45 41 44 4d 45 09 C. * win/README.
04c0: 09 28 6e 6f 74 20 70 61 74 63 68 6c 65 76 65 6c .(not patchlevel
04d0: 29 20 28 73 65 63 74 69 6f 6e 73 20 30 20 61 6e ) (sections 0 an
04e0: 64 20 32 29 0a 20 2a 20 75 6e 69 78 2f 74 63 6c d 2). * unix/tcl
04f0: 2e 73 70 65 63 09 28 31 20 4c 4f 43 20 70 61 74 .spec.(1 LOC pat
0500: 63 68 29 0a 20 2a 20 74 6f 6f 6c 73 2f 74 63 6c ch). * tools/tcl
0510: 2e 68 70 6a 2e 69 6e 09 28 6e 6f 74 20 70 61 74 .hpj.in.(not pat
0520: 63 68 6c 65 76 65 6c 2c 20 66 6f 72 20 77 69 6e chlevel, for win
0530: 64 6f 77 73 20 69 6e 73 74 61 6c 6c 65 72 29 0a dows installer).
0540: 20 2a 2f 0a 0a 23 64 65 66 69 6e 65 20 54 43 4c */..#define TCL
0550: 5f 4d 41 4a 4f 52 5f 56 45 52 53 49 4f 4e 20 20 _MAJOR_VERSION
0560: 20 39 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 4d 9.#define TCL_M
0570: 49 4e 4f 52 5f 56 45 52 53 49 4f 4e 20 20 20 30 INOR_VERSION 0
0580: 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 52 45 4c .#define TCL_REL
0590: 45 41 53 45 5f 4c 45 56 45 4c 20 20 20 54 43 4c EASE_LEVEL TCL
05a0: 5f 41 4c 50 48 41 5f 52 45 4c 45 41 53 45 0a 23 _ALPHA_RELEASE.#
05b0: 64 65 66 69 6e 65 20 54 43 4c 5f 52 45 4c 45 41 define TCL_RELEA
05c0: 53 45 5f 53 45 52 49 41 4c 20 20 32 0a 0a 23 64 SE_SERIAL 2..#d
05d0: 65 66 69 6e 65 20 54 43 4c 5f 56 45 52 53 49 4f efine TCL_VERSIO
05e0: 4e 09 20 20 20 20 22 39 2e 30 22 0a 23 64 65 66 N. "9.0".#def
05f0: 69 6e 65 20 54 43 4c 5f 50 41 54 43 48 5f 4c 45 ine TCL_PATCH_LE
0600: 56 45 4c 09 20 20 20 20 22 39 2e 30 61 32 22 0a VEL. "9.0a2".
0610: 0c 0a 23 69 66 20 64 65 66 69 6e 65 64 28 52 43 ..#if defined(RC
0620: 5f 49 4e 56 4f 4b 45 44 29 0a 2f 2a 0a 20 2a 20 _INVOKED)./*. *
0630: 55 74 69 6c 69 74 79 20 6d 61 63 72 6f 73 3a 20 Utility macros:
0640: 53 54 52 49 4e 47 49 46 59 20 74 61 6b 65 73 20 STRINGIFY takes
0650: 61 6e 20 61 72 67 75 6d 65 6e 74 20 61 6e 64 20 an argument and
0660: 77 72 61 70 73 20 69 74 20 69 6e 20 22 22 20 28 wraps it in "" (
0670: 64 6f 75 62 6c 65 0a 20 2a 20 71 75 6f 74 61 74 double. * quotat
0680: 69 6f 6e 20 6d 61 72 6b 73 29 2c 20 4a 4f 49 4e ion marks), JOIN
0690: 20 6a 6f 69 6e 73 20 74 77 6f 20 61 72 67 75 6d joins two argum
06a0: 65 6e 74 73 2e 0a 20 2a 2f 0a 0a 23 69 66 6e 64 ents.. */..#ifnd
06b0: 65 66 20 53 54 52 49 4e 47 49 46 59 0a 23 20 20 ef STRINGIFY.#
06c0: 64 65 66 69 6e 65 20 53 54 52 49 4e 47 49 46 59 define STRINGIFY
06d0: 28 78 29 20 53 54 52 49 4e 47 49 46 59 31 28 78 (x) STRINGIFY1(x
06e0: 29 0a 23 20 20 64 65 66 69 6e 65 20 53 54 52 49 ).# define STRI
06f0: 4e 47 49 46 59 31 28 78 29 20 23 78 0a 23 65 6e NGIFY1(x) #x.#en
0700: 64 69 66 0a 23 69 66 6e 64 65 66 20 4a 4f 49 4e dif.#ifndef JOIN
0710: 0a 23 20 20 64 65 66 69 6e 65 20 4a 4f 49 4e 28 .# define JOIN(
0720: 61 2c 62 29 20 4a 4f 49 4e 31 28 61 2c 62 29 0a a,b) JOIN1(a,b).
0730: 23 20 20 64 65 66 69 6e 65 20 4a 4f 49 4e 31 28 # define JOIN1(
0740: 61 2c 62 29 20 61 23 23 62 0a 23 65 6e 64 69 66 a,b) a##b.#endif
0750: 0a 23 65 6e 64 69 66 20 2f 2a 20 52 43 5f 49 4e .#endif /* RC_IN
0760: 56 4f 4b 45 44 20 2a 2f 0a 0a 2f 2a 0a 20 2a 20 VOKED */../*. *
0770: 41 20 73 70 65 63 69 61 6c 20 64 65 66 69 6e 69 A special defini
0780: 74 69 6f 6e 20 75 73 65 64 20 74 6f 20 61 6c 6c tion used to all
0790: 6f 77 20 74 68 69 73 20 68 65 61 64 65 72 20 66 ow this header f
07a0: 69 6c 65 20 74 6f 20 62 65 20 69 6e 63 6c 75 64 ile to be includ
07b0: 65 64 20 66 72 6f 6d 0a 20 2a 20 77 69 6e 64 6f ed from. * windo
07c0: 77 73 20 72 65 73 6f 75 72 63 65 20 66 69 6c 65 ws resource file
07d0: 73 20 73 6f 20 74 68 61 74 20 74 68 65 79 20 63 s so that they c
07e0: 61 6e 20 6f 62 74 61 69 6e 20 76 65 72 73 69 6f an obtain versio
07f0: 6e 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 2e 0a 20 n information..
0800: 2a 20 52 43 5f 49 4e 56 4f 4b 45 44 20 69 73 20 * RC_INVOKED is
0810: 64 65 66 69 6e 65 64 20 62 79 20 64 65 66 61 75 defined by defau
0820: 6c 74 20 62 79 20 74 68 65 20 77 69 6e 64 6f 77 lt by the window
0830: 73 20 52 43 20 74 6f 6f 6c 2e 0a 20 2a 0a 20 2a s RC tool.. *. *
0840: 20 52 65 73 6f 75 72 63 65 20 63 6f 6d 70 69 6c Resource compil
0850: 65 72 73 20 64 6f 6e 27 74 20 6c 69 6b 65 20 61 ers don't like a
0860: 6c 6c 20 74 68 65 20 43 20 73 74 75 66 66 2c 20 ll the C stuff,
0870: 6c 69 6b 65 20 74 79 70 65 64 65 66 73 20 61 6e like typedefs an
0880: 64 20 66 75 6e 63 74 69 6f 6e 0a 20 2a 20 64 65 d function. * de
0890: 63 6c 61 72 61 74 69 6f 6e 73 2c 20 74 68 61 74 clarations, that
08a0: 20 6f 63 63 75 72 20 62 65 6c 6f 77 2c 20 73 6f occur below, so
08b0: 20 62 6c 6f 63 6b 20 74 68 65 6d 20 6f 75 74 2e block them out.
08c0: 0a 20 2a 2f 0a 0a 23 69 66 6e 64 65 66 20 52 43 . */..#ifndef RC
08d0: 5f 49 4e 56 4f 4b 45 44 0a 0a 2f 2a 0a 20 2a 20 _INVOKED../*. *
08e0: 53 70 65 63 69 61 6c 20 6d 61 63 72 6f 20 74 6f Special macro to
08f0: 20 64 65 66 69 6e 65 20 6d 75 74 65 78 65 73 2e define mutexes.
0900: 0a 20 2a 2f 0a 0a 23 64 65 66 69 6e 65 20 54 43 . */..#define TC
0910: 4c 5f 44 45 43 4c 41 52 45 5f 4d 55 54 45 58 28 L_DECLARE_MUTEX(
0920: 6e 61 6d 65 29 20 73 74 61 74 69 63 20 54 63 6c name) static Tcl
0930: 5f 4d 75 74 65 78 20 6e 61 6d 65 3b 0a 0a 2f 2a _Mutex name;../*
0940: 0a 20 2a 20 54 63 6c 27 73 20 70 75 62 6c 69 63 . * Tcl's public
0950: 20 72 6f 75 74 69 6e 65 20 54 63 6c 5f 46 53 53 routine Tcl_FSS
0960: 65 65 6b 28 29 20 75 73 65 73 20 74 68 65 20 76 eek() uses the v
0970: 61 6c 75 65 73 20 53 45 45 4b 5f 53 45 54 2c 20 alues SEEK_SET,
0980: 53 45 45 4b 5f 43 55 52 2c 20 61 6e 64 0a 20 2a SEEK_CUR, and. *
0990: 20 53 45 45 4b 5f 45 4e 44 2c 20 61 6c 6c 20 23 SEEK_END, all #
09a0: 64 65 66 69 6e 65 27 64 20 62 79 20 73 74 64 69 define'd by stdi
09b0: 6f 2e 68 20 2e 0a 20 2a 0a 20 2a 20 41 6c 73 6f o.h .. *. * Also
09c0: 2c 20 6d 61 6e 79 20 65 78 74 65 6e 73 69 6f 6e , many extension
09d0: 73 20 6e 65 65 64 20 73 74 64 69 6f 2e 68 2c 20 s need stdio.h,
09e0: 61 6e 64 20 74 68 65 79 27 76 65 20 67 72 6f 77 and they've grow
09f0: 6e 20 61 63 63 75 73 74 6f 6d 65 64 20 74 6f 20 n accustomed to
0a00: 74 63 6c 2e 68 0a 20 2a 20 70 72 6f 76 69 64 69 tcl.h. * providi
0a10: 6e 67 20 69 74 20 66 6f 72 20 74 68 65 6d 20 72 ng it for them r
0a20: 61 74 68 65 72 20 74 68 61 6e 20 23 69 6e 63 6c ather than #incl
0a30: 75 64 65 2d 69 6e 67 20 69 74 20 74 68 65 6d 73 ude-ing it thems
0a40: 65 6c 76 65 73 20 61 73 20 74 68 65 79 0a 20 2a elves as they. *
0a50: 20 73 68 6f 75 6c 64 2c 20 73 6f 20 61 6c 73 6f should, so also
0a60: 20 66 6f 72 20 74 68 65 69 72 20 73 61 6b 65 2c for their sake,
0a70: 20 77 65 20 6b 65 65 70 20 74 68 65 20 23 69 6e we keep the #in
0a80: 63 6c 75 64 65 20 74 6f 20 62 65 20 63 6f 6e 73 clude to be cons
0a90: 69 73 74 65 6e 74 20 77 69 74 68 0a 20 2a 20 70 istent with. * p
0aa0: 72 69 6f 72 20 54 63 6c 20 72 65 6c 65 61 73 65 rior Tcl release
0ab0: 73 2e 0a 20 2a 2f 0a 0a 23 69 6e 63 6c 75 64 65 s.. */..#include
0ac0: 20 3c 73 74 64 69 6f 2e 68 3e 0a 0a 23 69 66 20 <stdio.h>..#if
0ad0: 64 65 66 69 6e 65 64 28 5f 5f 47 4e 55 43 5f 5f defined(__GNUC__
0ae0: 29 20 26 26 20 28 5f 5f 47 4e 55 43 5f 5f 20 3e ) && (__GNUC__ >
0af0: 20 32 29 0a 23 20 20 20 64 65 66 69 6e 65 20 54 2).# define T
0b00: 43 4c 5f 46 4f 52 4d 41 54 5f 50 52 49 4e 54 46 CL_FORMAT_PRINTF
0b10: 28 61 2c 62 29 20 5f 5f 61 74 74 72 69 62 75 74 (a,b) __attribut
0b20: 65 5f 5f 20 28 28 5f 5f 66 6f 72 6d 61 74 5f 5f e__ ((__format__
0b30: 20 28 5f 5f 70 72 69 6e 74 66 5f 5f 2c 20 61 2c (__printf__, a,
0b40: 20 62 29 29 29 0a 23 20 20 20 64 65 66 69 6e 65 b))).# define
0b50: 20 54 43 4c 5f 4e 4f 52 45 54 55 52 4e 20 5f 5f TCL_NORETURN __
0b60: 61 74 74 72 69 62 75 74 65 5f 5f 20 28 28 6e 6f attribute__ ((no
0b70: 72 65 74 75 72 6e 29 29 0a 23 20 20 20 64 65 66 return)).# def
0b80: 69 6e 65 20 54 43 4c 5f 4e 4f 49 4e 4c 49 4e 45 ine TCL_NOINLINE
0b90: 20 5f 5f 61 74 74 72 69 62 75 74 65 5f 5f 20 28 __attribute__ (
0ba0: 28 6e 6f 69 6e 6c 69 6e 65 29 29 0a 23 20 20 20 (noinline)).#
0bb0: 64 65 66 69 6e 65 20 54 43 4c 5f 4e 4f 52 45 54 define TCL_NORET
0bc0: 55 52 4e 31 20 5f 5f 61 74 74 72 69 62 75 74 65 URN1 __attribute
0bd0: 5f 5f 20 28 28 6e 6f 72 65 74 75 72 6e 29 29 0a __ ((noreturn)).
0be0: 23 65 6c 73 65 0a 23 20 20 20 64 65 66 69 6e 65 #else.# define
0bf0: 20 54 43 4c 5f 46 4f 52 4d 41 54 5f 50 52 49 4e TCL_FORMAT_PRIN
0c00: 54 46 28 61 2c 62 29 0a 23 20 20 20 69 66 20 64 TF(a,b).# if d
0c10: 65 66 69 6e 65 64 28 5f 4d 53 43 5f 56 45 52 29 efined(_MSC_VER)
0c20: 20 26 26 20 28 5f 4d 53 43 5f 56 45 52 20 3e 3d && (_MSC_VER >=
0c30: 20 31 33 31 30 29 0a 23 09 64 65 66 69 6e 65 20 1310).#.define
0c40: 54 43 4c 5f 4e 4f 52 45 54 55 52 4e 20 5f 64 65 TCL_NORETURN _de
0c50: 63 6c 73 70 65 63 28 6e 6f 72 65 74 75 72 6e 29 clspec(noreturn)
0c60: 0a 23 09 64 65 66 69 6e 65 20 54 43 4c 5f 4e 4f .#.define TCL_NO
0c70: 49 4e 4c 49 4e 45 20 5f 5f 64 65 63 6c 73 70 65 INLINE __declspe
0c80: 63 28 6e 6f 69 6e 6c 69 6e 65 29 0a 23 20 20 20 c(noinline).#
0c90: 65 6c 73 65 0a 23 09 64 65 66 69 6e 65 20 54 43 else.#.define TC
0ca0: 4c 5f 4e 4f 52 45 54 55 52 4e 20 2f 2a 20 6e 6f L_NORETURN /* no
0cb0: 74 68 69 6e 67 20 2a 2f 0a 23 09 64 65 66 69 6e thing */.#.defin
0cc0: 65 20 54 43 4c 5f 4e 4f 49 4e 4c 49 4e 45 20 2f e TCL_NOINLINE /
0cd0: 2a 20 6e 6f 74 68 69 6e 67 20 2a 2f 0a 23 20 20 * nothing */.#
0ce0: 20 65 6e 64 69 66 0a 23 20 20 20 64 65 66 69 6e endif.# defin
0cf0: 65 20 54 43 4c 5f 4e 4f 52 45 54 55 52 4e 31 20 e TCL_NORETURN1
0d00: 2f 2a 20 6e 6f 74 68 69 6e 67 20 2a 2f 0a 23 65 /* nothing */.#e
0d10: 6e 64 69 66 0a 0a 2f 2a 0a 20 2a 20 41 6c 6c 6f ndif../*. * Allo
0d20: 77 20 61 20 70 61 72 74 20 6f 66 20 54 63 6c 27 w a part of Tcl'
0d30: 73 20 41 50 49 20 74 6f 20 62 65 20 65 78 70 6c s API to be expl
0d40: 69 63 69 74 6c 79 20 6d 61 72 6b 65 64 20 61 73 icitly marked as
0d50: 20 64 65 70 72 65 63 61 74 65 64 2e 0a 20 2a 0a deprecated.. *.
0d60: 20 2a 20 55 73 65 64 20 74 6f 20 6d 61 6b 65 20 * Used to make
0d70: 54 49 50 20 33 33 30 2f 33 33 36 20 67 65 6e 65 TIP 330/336 gene
0d80: 72 61 74 65 20 6d 6f 61 6e 73 20 65 76 65 6e 20 rate moans even
0d90: 69 66 20 70 65 6f 70 6c 65 20 75 73 65 20 74 68 if people use th
0da0: 65 0a 20 2a 20 63 6f 6d 70 61 74 69 62 69 6c 69 e. * compatibili
0db0: 74 79 20 6d 61 63 72 6f 73 2e 20 43 68 61 6e 67 ty macros. Chang
0dc0: 65 20 79 6f 75 72 20 63 6f 64 65 2c 20 67 75 79 e your code, guy
0dd0: 73 21 20 57 65 20 77 6f 6e 27 74 20 73 75 70 70 s! We won't supp
0de0: 6f 72 74 20 79 6f 75 20 66 6f 72 65 76 65 72 2e ort you forever.
0df0: 0a 20 2a 2f 0a 0a 23 69 66 20 64 65 66 69 6e 65 . */..#if define
0e00: 64 28 5f 5f 47 4e 55 43 5f 5f 29 20 26 26 20 28 d(__GNUC__) && (
0e10: 28 5f 5f 47 4e 55 43 5f 5f 20 3e 3d 20 34 29 20 (__GNUC__ >= 4)
0e20: 7c 7c 20 28 28 5f 5f 47 4e 55 43 5f 5f 20 3d 3d || ((__GNUC__ ==
0e30: 20 33 29 20 26 26 20 28 5f 5f 47 4e 55 43 5f 4d 3) && (__GNUC_M
0e40: 49 4e 4f 52 5f 5f 20 3e 3d 20 31 29 29 29 0a 23 INOR__ >= 1))).#
0e50: 20 20 20 69 66 20 28 5f 5f 47 4e 55 43 5f 5f 20 if (__GNUC__
0e60: 3e 20 34 29 20 7c 7c 20 28 28 5f 5f 47 4e 55 43 > 4) || ((__GNUC
0e70: 5f 5f 20 3d 3d 20 34 29 20 26 26 20 28 5f 5f 47 __ == 4) && (__G
0e80: 4e 55 43 5f 4d 49 4e 4f 52 5f 5f 20 3e 3d 20 35 NUC_MINOR__ >= 5
0e90: 29 29 0a 23 09 64 65 66 69 6e 65 20 54 43 4c 5f )).#.define TCL_
0ea0: 44 45 50 52 45 43 41 54 45 44 5f 41 50 49 28 6d DEPRECATED_API(m
0eb0: 73 67 29 09 5f 5f 61 74 74 72 69 62 75 74 65 5f sg).__attribute_
0ec0: 5f 20 28 28 5f 5f 64 65 70 72 65 63 61 74 65 64 _ ((__deprecated
0ed0: 5f 5f 20 28 6d 73 67 29 29 29 0a 23 20 20 20 65 __ (msg))).# e
0ee0: 6c 73 65 0a 23 09 64 65 66 69 6e 65 20 54 43 4c lse.#.define TCL
0ef0: 5f 44 45 50 52 45 43 41 54 45 44 5f 41 50 49 28 _DEPRECATED_API(
0f00: 6d 73 67 29 09 5f 5f 61 74 74 72 69 62 75 74 65 msg).__attribute
0f10: 5f 5f 20 28 28 5f 5f 64 65 70 72 65 63 61 74 65 __ ((__deprecate
0f20: 64 5f 5f 29 29 0a 23 20 20 20 65 6e 64 69 66 0a d__)).# endif.
0f30: 23 65 6c 73 65 0a 23 20 20 20 64 65 66 69 6e 65 #else.# define
0f40: 20 54 43 4c 5f 44 45 50 52 45 43 41 54 45 44 5f TCL_DEPRECATED_
0f50: 41 50 49 28 6d 73 67 29 09 2f 2a 20 6e 6f 74 68 API(msg)./* noth
0f60: 69 6e 67 20 70 6f 72 74 61 62 6c 65 20 2a 2f 0a ing portable */.
0f70: 23 65 6e 64 69 66 0a 0a 2f 2a 0a 20 2a 2d 2d 2d #endif../*. *---
0f80: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
0f90: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
0fa0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
0fb0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
0fc0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 2a 20 4d 61 63 ---------. * Mac
0fd0: 72 6f 73 20 75 73 65 64 20 74 6f 20 64 65 63 6c ros used to decl
0fe0: 61 72 65 20 61 20 66 75 6e 63 74 69 6f 6e 20 74 are a function t
0ff0: 6f 20 62 65 20 65 78 70 6f 72 74 65 64 20 62 79 o be exported by
1000: 20 61 20 44 4c 4c 2e 20 55 73 65 64 20 62 79 20 a DLL. Used by
1010: 57 69 6e 64 6f 77 73 2c 0a 20 2a 20 6d 61 70 73 Windows,. * maps
1020: 20 74 6f 20 6e 6f 2d 6f 70 20 64 65 63 6c 61 72 to no-op declar
1030: 61 74 69 6f 6e 73 20 6f 6e 20 6e 6f 6e 2d 57 69 ations on non-Wi
1040: 6e 64 6f 77 73 20 73 79 73 74 65 6d 73 2e 20 54 ndows systems. T
1050: 68 65 20 64 65 66 61 75 6c 74 20 62 75 69 6c 64 he default build
1060: 20 6f 6e 0a 20 2a 20 77 69 6e 64 6f 77 73 20 69 on. * windows i
1070: 73 20 66 6f 72 20 61 20 44 4c 4c 2c 20 77 68 69 s for a DLL, whi
1080: 63 68 20 63 61 75 73 65 73 20 74 68 65 20 44 4c ch causes the DL
1090: 4c 49 4d 50 4f 52 54 20 61 6e 64 20 44 4c 4c 45 LIMPORT and DLLE
10a0: 58 50 4f 52 54 20 6d 61 63 72 6f 73 20 74 6f 20 XPORT macros to
10b0: 62 65 0a 20 2a 20 6e 6f 6e 65 6d 70 74 79 2e 20 be. * nonempty.
10c0: 54 6f 20 62 75 69 6c 64 20 61 20 73 74 61 74 69 To build a stati
10d0: 63 20 6c 69 62 72 61 72 79 2c 20 74 68 65 20 6d c library, the m
10e0: 61 63 72 6f 20 53 54 41 54 49 43 5f 42 55 49 4c acro STATIC_BUIL
10f0: 44 20 73 68 6f 75 6c 64 20 62 65 0a 20 2a 20 64 D should be. * d
1100: 65 66 69 6e 65 64 2e 0a 20 2a 0a 20 2a 20 4e 6f efined.. *. * No
1110: 74 65 3a 20 77 68 65 6e 20 62 75 69 6c 64 69 6e te: when buildin
1120: 67 20 73 74 61 74 69 63 20 62 75 74 20 6c 69 6e g static but lin
1130: 6b 69 6e 67 20 64 79 6e 61 6d 69 63 61 6c 6c 79 king dynamically
1140: 20 74 6f 20 4d 53 56 43 52 54 20 77 65 20 6d 75 to MSVCRT we mu
1150: 73 74 20 73 74 69 6c 6c 0a 20 2a 20 20 20 20 20 st still. *
1160: 20 20 63 6f 72 72 65 63 74 6c 79 20 64 65 63 6f correctly deco
1170: 72 61 74 65 20 74 68 65 20 43 20 6c 69 62 72 61 rate the C libra
1180: 72 79 20 69 6d 70 6f 72 74 65 64 20 66 75 6e 63 ry imported func
1190: 74 69 6f 6e 2e 20 20 55 73 65 20 43 52 54 49 4d tion. Use CRTIM
11a0: 50 4f 52 54 0a 20 2a 20 20 20 20 20 20 20 66 6f PORT. * fo
11b0: 72 20 74 68 69 73 20 70 75 72 70 6f 73 65 2e 20 r this purpose.
11c0: 20 5f 44 4c 4c 20 69 73 20 64 65 66 69 6e 65 64 _DLL is defined
11d0: 20 62 79 20 74 68 65 20 63 6f 6d 70 69 6c 65 72 by the compiler
11e0: 20 77 68 65 6e 20 6c 69 6e 6b 69 6e 67 20 74 6f when linking to
11f0: 0a 20 2a 20 20 20 20 20 20 20 4d 53 56 43 52 54 . * MSVCRT
1200: 2e 0a 20 2a 2f 0a 0a 23 69 66 20 28 64 65 66 69 .. */..#if (defi
1210: 6e 65 64 28 5f 57 49 4e 33 32 29 20 26 26 20 28 ned(_WIN32) && (
1220: 64 65 66 69 6e 65 64 28 5f 4d 53 43 5f 56 45 52 defined(_MSC_VER
1230: 29 20 7c 7c 20 28 64 65 66 69 6e 65 64 28 5f 5f ) || (defined(__
1240: 42 4f 52 4c 41 4e 44 43 5f 5f 29 20 26 26 20 28 BORLANDC__) && (
1250: 5f 5f 42 4f 52 4c 41 4e 44 43 5f 5f 20 3e 3d 20 __BORLANDC__ >=
1260: 30 78 30 35 35 30 29 29 20 7c 7c 20 64 65 66 69 0x0550)) || defi
1270: 6e 65 64 28 5f 5f 4c 43 43 5f 5f 29 20 7c 7c 20 ned(__LCC__) ||
1280: 64 65 66 69 6e 65 64 28 5f 5f 57 41 54 43 4f 4d defined(__WATCOM
1290: 43 5f 5f 29 20 7c 7c 20 28 64 65 66 69 6e 65 64 C__) || (defined
12a0: 28 5f 5f 47 4e 55 43 5f 5f 29 20 26 26 20 64 65 (__GNUC__) && de
12b0: 66 69 6e 65 64 28 5f 5f 64 65 63 6c 73 70 65 63 fined(__declspec
12c0: 29 29 29 29 0a 23 20 20 20 64 65 66 69 6e 65 20 )))).# define
12d0: 48 41 56 45 5f 44 45 43 4c 53 50 45 43 20 31 0a HAVE_DECLSPEC 1.
12e0: 23 20 20 20 69 66 64 65 66 20 53 54 41 54 49 43 # ifdef STATIC
12f0: 5f 42 55 49 4c 44 0a 23 20 20 20 20 20 20 20 64 _BUILD.# d
1300: 65 66 69 6e 65 20 44 4c 4c 49 4d 50 4f 52 54 0a efine DLLIMPORT.
1310: 23 20 20 20 20 20 20 20 64 65 66 69 6e 65 20 44 # define D
1320: 4c 4c 45 58 50 4f 52 54 0a 23 20 20 20 20 20 20 LLEXPORT.#
1330: 20 69 66 64 65 66 20 5f 44 4c 4c 0a 23 20 20 20 ifdef _DLL.#
1340: 20 20 20 20 20 20 20 20 64 65 66 69 6e 65 20 43 define C
1350: 52 54 49 4d 50 4f 52 54 20 5f 5f 64 65 63 6c 73 RTIMPORT __decls
1360: 70 65 63 28 64 6c 6c 69 6d 70 6f 72 74 29 0a 23 pec(dllimport).#
1370: 20 20 20 20 20 20 20 65 6c 73 65 0a 23 20 20 20 else.#
1380: 20 20 20 20 20 20 20 20 64 65 66 69 6e 65 20 43 define C
1390: 52 54 49 4d 50 4f 52 54 0a 23 20 20 20 20 20 20 RTIMPORT.#
13a0: 20 65 6e 64 69 66 0a 23 20 20 20 65 6c 73 65 0a endif.# else.
13b0: 23 20 20 20 20 20 20 20 64 65 66 69 6e 65 20 44 # define D
13c0: 4c 4c 49 4d 50 4f 52 54 20 5f 5f 64 65 63 6c 73 LLIMPORT __decls
13d0: 70 65 63 28 64 6c 6c 69 6d 70 6f 72 74 29 0a 23 pec(dllimport).#
13e0: 20 20 20 20 20 20 20 64 65 66 69 6e 65 20 44 4c define DL
13f0: 4c 45 58 50 4f 52 54 20 5f 5f 64 65 63 6c 73 70 LEXPORT __declsp
1400: 65 63 28 64 6c 6c 65 78 70 6f 72 74 29 0a 23 20 ec(dllexport).#
1410: 20 20 20 20 20 20 64 65 66 69 6e 65 20 43 52 54 define CRT
1420: 49 4d 50 4f 52 54 20 5f 5f 64 65 63 6c 73 70 65 IMPORT __declspe
1430: 63 28 64 6c 6c 69 6d 70 6f 72 74 29 0a 23 20 20 c(dllimport).#
1440: 20 65 6e 64 69 66 0a 23 65 6c 73 65 0a 23 20 20 endif.#else.#
1450: 20 64 65 66 69 6e 65 20 44 4c 4c 49 4d 50 4f 52 define DLLIMPOR
1460: 54 0a 23 20 20 20 69 66 20 64 65 66 69 6e 65 64 T.# if defined
1470: 28 5f 5f 47 4e 55 43 5f 5f 29 20 26 26 20 5f 5f (__GNUC__) && __
1480: 47 4e 55 43 5f 5f 20 3e 20 33 0a 23 20 20 20 20 GNUC__ > 3.#
1490: 20 20 20 64 65 66 69 6e 65 20 44 4c 4c 45 58 50 define DLLEXP
14a0: 4f 52 54 20 5f 5f 61 74 74 72 69 62 75 74 65 5f ORT __attribute_
14b0: 5f 20 28 28 76 69 73 69 62 69 6c 69 74 79 28 22 _ ((visibility("
14c0: 64 65 66 61 75 6c 74 22 29 29 29 0a 23 20 20 20 default"))).#
14d0: 65 6c 73 65 0a 23 20 20 20 20 20 20 20 64 65 66 else.# def
14e0: 69 6e 65 20 44 4c 4c 45 58 50 4f 52 54 0a 23 20 ine DLLEXPORT.#
14f0: 20 20 65 6e 64 69 66 0a 23 20 20 20 64 65 66 69 endif.# defi
1500: 6e 65 20 43 52 54 49 4d 50 4f 52 54 0a 23 65 6e ne CRTIMPORT.#en
1510: 64 69 66 0a 0a 2f 2a 0a 20 2a 20 54 68 65 73 65 dif../*. * These
1520: 20 6d 61 63 72 6f 73 20 61 72 65 20 75 73 65 64 macros are used
1530: 20 74 6f 20 63 6f 6e 74 72 6f 6c 20 77 68 65 74 to control whet
1540: 68 65 72 20 66 75 6e 63 74 69 6f 6e 73 20 61 72 her functions ar
1550: 65 20 62 65 69 6e 67 20 64 65 63 6c 61 72 65 64 e being declared
1560: 20 66 6f 72 0a 20 2a 20 69 6d 70 6f 72 74 20 6f for. * import o
1570: 72 20 65 78 70 6f 72 74 2e 20 49 66 20 61 20 66 r export. If a f
1580: 75 6e 63 74 69 6f 6e 20 69 73 20 62 65 69 6e 67 unction is being
1590: 20 64 65 63 6c 61 72 65 64 20 77 68 69 6c 65 20 declared while
15a0: 69 74 20 69 73 20 62 65 69 6e 67 20 62 75 69 6c it is being buil
15b0: 74 0a 20 2a 20 74 6f 20 62 65 20 69 6e 63 6c 75 t. * to be inclu
15c0: 64 65 64 20 69 6e 20 61 20 73 68 61 72 65 64 20 ded in a shared
15d0: 6c 69 62 72 61 72 79 2c 20 74 68 65 6e 20 69 74 library, then it
15e0: 20 73 68 6f 75 6c 64 20 68 61 76 65 20 74 68 65 should have the
15f0: 20 44 4c 4c 45 58 50 4f 52 54 0a 20 2a 20 73 74 DLLEXPORT. * st
1600: 6f 72 61 67 65 20 63 6c 61 73 73 2e 20 49 66 20 orage class. If
1610: 69 73 20 62 65 69 6e 67 20 64 65 63 6c 61 72 65 is being declare
1620: 64 20 66 6f 72 20 75 73 65 20 62 79 20 61 20 6d d for use by a m
1630: 6f 64 75 6c 65 20 74 68 61 74 20 69 73 20 67 6f odule that is go
1640: 69 6e 67 20 74 6f 0a 20 2a 20 6c 69 6e 6b 20 61 ing to. * link a
1650: 67 61 69 6e 73 74 20 74 68 65 20 73 68 61 72 65 gainst the share
1660: 64 20 6c 69 62 72 61 72 79 2c 20 74 68 65 6e 20 d library, then
1670: 69 74 20 73 68 6f 75 6c 64 20 68 61 76 65 20 74 it should have t
1680: 68 65 20 44 4c 4c 49 4d 50 4f 52 54 20 73 74 6f he DLLIMPORT sto
1690: 72 61 67 65 0a 20 2a 20 63 6c 61 73 73 2e 20 49 rage. * class. I
16a0: 66 20 74 68 65 20 73 79 6d 62 6f 6c 20 69 73 20 f the symbol is
16b0: 62 65 69 6e 67 20 64 65 63 6c 61 72 65 64 20 66 being declared f
16c0: 6f 72 20 61 20 73 74 61 74 69 63 20 62 75 69 6c or a static buil
16d0: 64 20 6f 72 20 66 6f 72 20 75 73 65 20 66 72 6f d or for use fro
16e0: 6d 20 61 0a 20 2a 20 73 74 75 62 20 6c 69 62 72 m a. * stub libr
16f0: 61 72 79 2c 20 74 68 65 6e 20 74 68 65 20 73 74 ary, then the st
1700: 6f 72 61 67 65 20 63 6c 61 73 73 20 73 68 6f 75 orage class shou
1710: 6c 64 20 62 65 20 65 6d 70 74 79 2e 0a 20 2a 0a ld be empty.. *.
1720: 20 2a 20 54 68 65 20 63 6f 6e 76 65 6e 74 69 6f * The conventio
1730: 6e 20 69 73 20 74 68 61 74 20 61 20 6d 61 63 72 n is that a macr
1740: 6f 20 63 61 6c 6c 65 64 20 42 55 49 4c 44 5f 78 o called BUILD_x
1750: 78 78 78 2c 20 77 68 65 72 65 20 78 78 78 78 20 xxx, where xxxx
1760: 69 73 20 74 68 65 20 6e 61 6d 65 20 6f 66 0a 20 is the name of.
1770: 2a 20 61 20 6c 69 62 72 61 72 79 20 77 65 20 61 * a library we a
1780: 72 65 20 62 75 69 6c 64 69 6e 67 2c 20 69 73 20 re building, is
1790: 73 65 74 20 6f 6e 20 74 68 65 20 63 6f 6d 70 69 set on the compi
17a0: 6c 65 20 6c 69 6e 65 20 66 6f 72 20 73 6f 75 72 le line for sour
17b0: 63 65 73 20 74 68 61 74 20 61 72 65 0a 20 2a 20 ces that are. *
17c0: 74 6f 20 62 65 20 70 6c 61 63 65 64 20 69 6e 20 to be placed in
17d0: 74 68 65 20 6c 69 62 72 61 72 79 2e 20 57 68 65 the library. Whe
17e0: 6e 20 74 68 69 73 20 6d 61 63 72 6f 20 69 73 20 n this macro is
17f0: 73 65 74 2c 20 74 68 65 20 73 74 6f 72 61 67 65 set, the storage
1800: 20 63 6c 61 73 73 20 77 69 6c 6c 0a 20 2a 20 62 class will. * b
1810: 65 20 73 65 74 20 74 6f 20 44 4c 4c 45 58 50 4f e set to DLLEXPO
1820: 52 54 2e 20 41 74 20 74 68 65 20 65 6e 64 20 6f RT. At the end o
1830: 66 20 74 68 65 20 68 65 61 64 65 72 20 66 69 6c f the header fil
1840: 65 2c 20 74 68 65 20 73 74 6f 72 61 67 65 20 63 e, the storage c
1850: 6c 61 73 73 20 77 69 6c 6c 0a 20 2a 20 62 65 20 lass will. * be
1860: 72 65 73 65 74 20 74 6f 20 44 4c 4c 49 4d 50 4f reset to DLLIMPO
1870: 52 54 2e 0a 20 2a 2f 0a 0a 23 75 6e 64 65 66 20 RT.. */..#undef
1880: 54 43 4c 5f 53 54 4f 52 41 47 45 5f 43 4c 41 53 TCL_STORAGE_CLAS
1890: 53 0a 23 69 66 64 65 66 20 42 55 49 4c 44 5f 74 S.#ifdef BUILD_t
18a0: 63 6c 0a 23 20 20 20 64 65 66 69 6e 65 20 54 43 cl.# define TC
18b0: 4c 5f 53 54 4f 52 41 47 45 5f 43 4c 41 53 53 20 L_STORAGE_CLASS
18c0: 44 4c 4c 45 58 50 4f 52 54 0a 23 65 6c 73 65 0a DLLEXPORT.#else.
18d0: 23 20 20 20 69 66 64 65 66 20 55 53 45 5f 54 43 # ifdef USE_TC
18e0: 4c 5f 53 54 55 42 53 0a 23 20 20 20 20 20 20 64 L_STUBS.# d
18f0: 65 66 69 6e 65 20 54 43 4c 5f 53 54 4f 52 41 47 efine TCL_STORAG
1900: 45 5f 43 4c 41 53 53 0a 23 20 20 20 65 6c 73 65 E_CLASS.# else
1910: 0a 23 20 20 20 20 20 20 64 65 66 69 6e 65 20 54 .# define T
1920: 43 4c 5f 53 54 4f 52 41 47 45 5f 43 4c 41 53 53 CL_STORAGE_CLASS
1930: 20 44 4c 4c 49 4d 50 4f 52 54 0a 23 20 20 20 65 DLLIMPORT.# e
1940: 6e 64 69 66 0a 23 65 6e 64 69 66 0a 0a 23 69 66 ndif.#endif..#if
1950: 20 21 64 65 66 69 6e 65 64 28 43 4f 4e 53 54 38 !defined(CONST8
1960: 36 29 20 26 26 20 21 64 65 66 69 6e 65 64 28 54 6) && !defined(T
1970: 43 4c 5f 4e 4f 5f 44 45 50 52 45 43 41 54 45 44 CL_NO_DEPRECATED
1980: 29 0a 23 20 20 20 20 20 20 64 65 66 69 6e 65 20 ).# define
1990: 43 4f 4e 53 54 38 36 20 63 6f 6e 73 74 0a 23 65 CONST86 const.#e
19a0: 6e 64 69 66 0a 0a 2f 2a 0a 20 2a 20 4d 61 6b 65 ndif../*. * Make
19b0: 20 73 75 72 65 20 45 58 54 45 52 4e 20 69 73 6e sure EXTERN isn
19c0: 27 74 20 64 65 66 69 6e 65 64 20 65 6c 73 65 77 't defined elsew
19d0: 68 65 72 65 2e 0a 20 2a 2f 0a 0a 23 69 66 64 65 here.. */..#ifde
19e0: 66 20 45 58 54 45 52 4e 0a 23 20 20 20 75 6e 64 f EXTERN.# und
19f0: 65 66 20 45 58 54 45 52 4e 0a 23 65 6e 64 69 66 ef EXTERN.#endif
1a00: 20 2f 2a 20 45 58 54 45 52 4e 20 2a 2f 0a 0a 23 /* EXTERN */..#
1a10: 69 66 64 65 66 20 5f 5f 63 70 6c 75 73 70 6c 75 ifdef __cplusplu
1a20: 73 0a 23 20 20 20 64 65 66 69 6e 65 20 45 58 54 s.# define EXT
1a30: 45 52 4e 20 65 78 74 65 72 6e 20 22 43 22 20 54 ERN extern "C" T
1a40: 43 4c 5f 53 54 4f 52 41 47 45 5f 43 4c 41 53 53 CL_STORAGE_CLASS
1a50: 0a 23 65 6c 73 65 0a 23 20 20 20 64 65 66 69 6e .#else.# defin
1a60: 65 20 45 58 54 45 52 4e 20 65 78 74 65 72 6e 20 e EXTERN extern
1a70: 54 43 4c 5f 53 54 4f 52 41 47 45 5f 43 4c 41 53 TCL_STORAGE_CLAS
1a80: 53 0a 23 65 6e 64 69 66 0a 0a 2f 2a 0a 20 2a 20 S.#endif../*. *
1a90: 4d 69 73 63 65 6c 6c 61 6e 65 6f 75 73 20 64 65 Miscellaneous de
1aa0: 63 6c 61 72 61 74 69 6f 6e 73 2e 0a 20 2a 2f 0a clarations.. */.
1ab0: 0a 74 79 70 65 64 65 66 20 76 6f 69 64 20 2a 43 .typedef void *C
1ac0: 6c 69 65 6e 74 44 61 74 61 3b 0a 0a 2f 2a 0a 20 lientData;../*.
1ad0: 2a 20 44 61 72 77 69 6e 20 73 70 65 63 69 66 69 * Darwin specifi
1ae0: 63 20 63 6f 6e 66 69 67 75 72 65 20 6f 76 65 72 c configure over
1af0: 72 69 64 65 73 20 28 74 6f 20 73 75 70 70 6f 72 rides (to suppor
1b00: 74 20 66 61 74 20 63 6f 6d 70 69 6c 65 73 2c 20 t fat compiles,
1b10: 77 68 65 72 65 0a 20 2a 20 63 6f 6e 66 69 67 75 where. * configu
1b20: 72 65 20 72 75 6e 73 20 6f 6e 6c 79 20 6f 6e 63 re runs only onc
1b30: 65 20 66 6f 72 20 6d 75 6c 74 69 70 6c 65 20 61 e for multiple a
1b40: 72 63 68 69 74 65 63 74 75 72 65 73 29 3a 0a 20 rchitectures):.
1b50: 2a 2f 0a 0a 23 69 66 64 65 66 20 5f 5f 41 50 50 */..#ifdef __APP
1b60: 4c 45 5f 5f 0a 23 20 20 20 69 66 64 65 66 20 5f LE__.# ifdef _
1b70: 5f 4c 50 36 34 5f 5f 0a 23 09 75 6e 64 65 66 20 _LP64__.#.undef
1b80: 54 43 4c 5f 57 49 44 45 5f 49 4e 54 5f 54 59 50 TCL_WIDE_INT_TYP
1b90: 45 0a 23 09 64 65 66 69 6e 65 20 54 43 4c 5f 57 E.#.define TCL_W
1ba0: 49 44 45 5f 49 4e 54 5f 49 53 5f 4c 4f 4e 47 20 IDE_INT_IS_LONG
1bb0: 31 0a 23 09 64 65 66 69 6e 65 20 54 43 4c 5f 43 1.#.define TCL_C
1bc0: 46 47 5f 44 4f 36 34 42 49 54 20 31 0a 23 20 20 FG_DO64BIT 1.#
1bd0: 20 20 65 6c 73 65 20 2f 2a 20 21 5f 5f 4c 50 36 else /* !__LP6
1be0: 34 5f 5f 20 2a 2f 0a 23 09 64 65 66 69 6e 65 20 4__ */.#.define
1bf0: 54 43 4c 5f 57 49 44 45 5f 49 4e 54 5f 54 59 50 TCL_WIDE_INT_TYP
1c00: 45 20 6c 6f 6e 67 20 6c 6f 6e 67 0a 23 09 75 6e E long long.#.un
1c10: 64 65 66 20 54 43 4c 5f 57 49 44 45 5f 49 4e 54 def TCL_WIDE_INT
1c20: 5f 49 53 5f 4c 4f 4e 47 0a 23 09 75 6e 64 65 66 _IS_LONG.#.undef
1c30: 20 54 43 4c 5f 43 46 47 5f 44 4f 36 34 42 49 54 TCL_CFG_DO64BIT
1c40: 0a 23 20 20 20 20 65 6e 64 69 66 20 2f 2a 20 5f .# endif /* _
1c50: 5f 4c 50 36 34 5f 5f 20 2a 2f 0a 23 20 20 20 20 _LP64__ */.#
1c60: 75 6e 64 65 66 20 48 41 56 45 5f 53 54 52 55 43 undef HAVE_STRUC
1c70: 54 5f 53 54 41 54 36 34 0a 23 65 6e 64 69 66 20 T_STAT64.#endif
1c80: 2f 2a 20 5f 5f 41 50 50 4c 45 5f 5f 20 2a 2f 0a /* __APPLE__ */.
1c90: 0a 2f 2a 0a 20 2a 20 44 65 66 69 6e 65 20 54 63 ./*. * Define Tc
1ca0: 6c 5f 57 69 64 65 49 6e 74 20 74 6f 20 62 65 20 l_WideInt to be
1cb0: 61 20 74 79 70 65 20 74 68 61 74 20 69 73 20 28 a type that is (
1cc0: 61 74 20 6c 65 61 73 74 29 20 36 34 2d 62 69 74 at least) 64-bit
1cd0: 73 20 77 69 64 65 2c 20 61 6e 64 20 64 65 66 69 s wide, and defi
1ce0: 6e 65 0a 20 2a 20 54 63 6c 5f 57 69 64 65 55 49 ne. * Tcl_WideUI
1cf0: 6e 74 20 74 6f 20 62 65 20 74 68 65 20 75 6e 73 nt to be the uns
1d00: 69 67 6e 65 64 20 76 61 72 69 61 6e 74 20 6f 66 igned variant of
1d10: 20 74 68 61 74 20 74 79 70 65 20 28 61 73 73 75 that type (assu
1d20: 6d 69 6e 67 20 74 68 61 74 20 77 68 65 72 65 0a ming that where.
1d30: 20 2a 20 77 65 20 68 61 76 65 20 6f 6e 65 2c 20 * we have one,
1d40: 77 65 20 63 61 6e 20 68 61 76 65 20 74 68 65 20 we can have the
1d50: 6f 74 68 65 72 2e 29 0a 20 2a 0a 20 2a 20 41 6c other.). *. * Al
1d60: 73 6f 20 64 65 66 69 6e 65 73 20 74 68 65 20 66 so defines the f
1d70: 6f 6c 6c 6f 77 69 6e 67 20 6d 61 63 72 6f 73 3a ollowing macros:
1d80: 0a 20 2a 20 54 43 4c 5f 57 49 44 45 5f 49 4e 54 . * TCL_WIDE_INT
1d90: 5f 49 53 5f 4c 4f 4e 47 20 2d 20 69 66 20 77 69 _IS_LONG - if wi
1da0: 64 65 20 69 6e 74 73 20 61 72 65 20 72 65 61 6c de ints are real
1db0: 6c 79 20 6c 6f 6e 67 73 20 28 69 2e 65 2e 20 77 ly longs (i.e. w
1dc0: 65 27 72 65 20 6f 6e 20 61 0a 20 2a 09 4c 50 36 e're on a. *.LP6
1dd0: 34 20 73 79 73 74 65 6d 20 73 75 63 68 20 61 73 4 system such as
1de0: 20 6d 6f 64 65 72 6e 20 53 6f 6c 61 72 69 73 20 modern Solaris
1df0: 6f 72 20 4c 69 6e 75 78 20 2e 2e 2e 20 6e 6f 74 or Linux ... not
1e00: 20 69 6e 63 6c 75 64 69 6e 67 20 57 69 6e 36 34 including Win64
1e10: 29 0a 20 2a 20 54 63 6c 5f 57 69 64 65 41 73 4c ). * Tcl_WideAsL
1e20: 6f 6e 67 20 2d 20 66 6f 72 67 65 74 66 75 6c 20 ong - forgetful
1e30: 63 6f 6e 76 65 72 74 65 72 20 66 72 6f 6d 20 77 converter from w
1e40: 69 64 65 49 6e 74 20 74 6f 20 6c 6f 6e 67 2e 0a ideInt to long..
1e50: 20 2a 20 54 63 6c 5f 4c 6f 6e 67 41 73 57 69 64 * Tcl_LongAsWid
1e60: 65 20 2d 20 73 69 67 6e 2d 65 78 74 65 6e 64 69 e - sign-extendi
1e70: 6e 67 20 63 6f 6e 76 65 72 74 65 72 20 66 72 6f ng converter fro
1e80: 6d 20 6c 6f 6e 67 20 74 6f 20 77 69 64 65 49 6e m long to wideIn
1e90: 74 2e 0a 20 2a 20 54 63 6c 5f 57 69 64 65 41 73 t.. * Tcl_WideAs
1ea0: 44 6f 75 62 6c 65 20 2d 20 63 6f 6e 76 65 72 74 Double - convert
1eb0: 65 72 20 66 72 6f 6d 20 77 69 64 65 49 6e 74 20 er from wideInt
1ec0: 74 6f 20 64 6f 75 62 6c 65 2e 0a 20 2a 20 54 63 to double.. * Tc
1ed0: 6c 5f 44 6f 75 62 6c 65 41 73 57 69 64 65 20 2d l_DoubleAsWide -
1ee0: 20 63 6f 6e 76 65 72 74 65 72 20 66 72 6f 6d 20 converter from
1ef0: 64 6f 75 62 6c 65 20 74 6f 20 77 69 64 65 49 6e double to wideIn
1f00: 74 2e 0a 20 2a 0a 20 2a 20 54 68 65 20 66 6f 6c t.. *. * The fol
1f10: 6c 6f 77 69 6e 67 20 69 6e 76 61 72 69 61 6e 74 lowing invariant
1f20: 20 73 68 6f 75 6c 64 20 68 6f 6c 64 20 66 6f 72 should hold for
1f30: 20 61 6e 79 20 6c 6f 6e 67 20 76 61 6c 75 65 20 any long value
1f40: 27 6c 6f 6e 67 56 61 6c 27 3a 0a 20 2a 09 6c 6f 'longVal':. *.lo
1f50: 6e 67 56 61 6c 20 3d 3d 20 54 63 6c 5f 57 69 64 ngVal == Tcl_Wid
1f60: 65 41 73 4c 6f 6e 67 28 54 63 6c 5f 4c 6f 6e 67 eAsLong(Tcl_Long
1f70: 41 73 57 69 64 65 28 6c 6f 6e 67 56 61 6c 29 29 AsWide(longVal))
1f80: 0a 20 2a 0a 20 2a 20 4e 6f 74 65 20 6f 6e 20 63 . *. * Note on c
1f90: 6f 6e 76 65 72 74 69 6e 67 20 62 65 74 77 65 65 onverting betwee
1fa0: 6e 20 54 63 6c 5f 57 69 64 65 49 6e 74 20 61 6e n Tcl_WideInt an
1fb0: 64 20 73 74 72 69 6e 67 73 2e 20 54 68 69 73 20 d strings. This
1fc0: 69 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e 20 28 implementation (
1fd0: 69 6e 0a 20 2a 20 74 63 6c 4f 62 6a 2e 63 29 20 in. * tclObj.c)
1fe0: 64 65 70 65 6e 64 73 20 6f 6e 20 74 68 65 20 66 depends on the f
1ff0: 75 6e 63 74 69 6f 6e 0a 20 2a 20 73 70 72 69 6e unction. * sprin
2000: 74 66 28 2e 2e 2e 2c 22 25 22 20 54 43 4c 5f 4c tf(...,"%" TCL_L
2010: 4c 5f 4d 4f 44 49 46 49 45 52 20 22 64 22 2c 2e L_MODIFIER "d",.
2020: 2e 2e 29 2e 0a 20 2a 2f 0a 0a 23 69 66 20 21 64 ..).. */..#if !d
2030: 65 66 69 6e 65 64 28 54 43 4c 5f 57 49 44 45 5f efined(TCL_WIDE_
2040: 49 4e 54 5f 54 59 50 45 29 26 26 21 64 65 66 69 INT_TYPE)&&!defi
2050: 6e 65 64 28 54 43 4c 5f 57 49 44 45 5f 49 4e 54 ned(TCL_WIDE_INT
2060: 5f 49 53 5f 4c 4f 4e 47 29 0a 23 20 20 20 69 66 _IS_LONG).# if
2070: 20 64 65 66 69 6e 65 64 28 5f 57 49 4e 33 32 29 defined(_WIN32)
2080: 0a 23 20 20 20 20 20 20 64 65 66 69 6e 65 20 54 .# define T
2090: 43 4c 5f 57 49 44 45 5f 49 4e 54 5f 54 59 50 45 CL_WIDE_INT_TYPE
20a0: 20 5f 5f 69 6e 74 36 34 0a 23 20 20 20 20 20 20 __int64.#
20b0: 64 65 66 69 6e 65 20 54 43 4c 5f 4c 4c 5f 4d 4f define TCL_LL_MO
20c0: 44 49 46 49 45 52 09 22 49 36 34 22 0a 23 20 20 DIFIER."I64".#
20d0: 20 20 20 20 69 66 20 64 65 66 69 6e 65 64 28 5f if defined(_
20e0: 57 49 4e 36 34 29 0a 23 20 20 20 20 20 20 20 20 WIN64).#
20f0: 20 64 65 66 69 6e 65 20 54 43 4c 5f 5a 5f 4d 4f define TCL_Z_MO
2100: 44 49 46 49 45 52 09 22 49 22 0a 23 20 20 20 20 DIFIER."I".#
2110: 20 20 65 6e 64 69 66 0a 23 20 20 20 65 6c 69 66 endif.# elif
2120: 20 64 65 66 69 6e 65 64 28 5f 5f 47 4e 55 43 5f defined(__GNUC_
2130: 5f 29 0a 23 20 20 20 20 20 20 64 65 66 69 6e 65 _).# define
2140: 20 54 43 4c 5f 5a 5f 4d 4f 44 49 46 49 45 52 09 TCL_Z_MODIFIER.
2150: 22 7a 22 0a 23 20 20 20 65 6c 73 65 20 2f 2a 20 "z".# else /*
2160: 21 20 5f 57 49 4e 33 32 20 26 26 20 21 20 5f 5f ! _WIN32 && ! __
2170: 47 4e 55 43 5f 5f 20 2a 2f 0a 2f 2a 0a 20 2a 20 GNUC__ */./*. *
2180: 44 6f 6e 27 74 20 6b 6e 6f 77 20 77 68 61 74 20 Don't know what
2190: 70 6c 61 74 66 6f 72 6d 20 69 74 20 69 73 20 61 platform it is a
21a0: 6e 64 20 63 6f 6e 66 69 67 75 72 65 20 68 61 73 nd configure has
21b0: 6e 27 74 20 64 69 73 63 6f 76 65 72 65 64 20 77 n't discovered w
21c0: 68 61 74 20 69 73 0a 20 2a 20 67 6f 69 6e 67 20 hat is. * going
21d0: 6f 6e 20 66 6f 72 20 75 73 2e 20 54 72 79 20 74 on for us. Try t
21e0: 6f 20 67 75 65 73 73 2e 2e 2e 0a 20 2a 2f 0a 23 o guess.... */.#
21f0: 20 20 20 20 20 20 69 6e 63 6c 75 64 65 20 3c 6c include <l
2200: 69 6d 69 74 73 2e 68 3e 0a 23 20 20 20 20 20 20 imits.h>.#
2210: 69 66 20 64 65 66 69 6e 65 64 28 4c 4c 4f 4e 47 if defined(LLONG
2220: 5f 4d 41 58 29 20 26 26 20 28 4c 4c 4f 4e 47 5f _MAX) && (LLONG_
2230: 4d 41 58 20 3d 3d 20 4c 4f 4e 47 5f 4d 41 58 29 MAX == LONG_MAX)
2240: 0a 23 20 20 20 20 20 20 20 20 20 64 65 66 69 6e .# defin
2250: 65 20 54 43 4c 5f 57 49 44 45 5f 49 4e 54 5f 49 e TCL_WIDE_INT_I
2260: 53 5f 4c 4f 4e 47 09 31 0a 23 20 20 20 20 20 20 S_LONG.1.#
2270: 65 6e 64 69 66 0a 23 20 20 20 65 6e 64 69 66 20 endif.# endif
2280: 2f 2a 20 5f 57 49 4e 33 32 20 2a 2f 0a 23 65 6e /* _WIN32 */.#en
2290: 64 69 66 20 2f 2a 20 21 54 43 4c 5f 57 49 44 45 dif /* !TCL_WIDE
22a0: 5f 49 4e 54 5f 54 59 50 45 20 26 20 21 54 43 4c _INT_TYPE & !TCL
22b0: 5f 57 49 44 45 5f 49 4e 54 5f 49 53 5f 4c 4f 4e _WIDE_INT_IS_LON
22c0: 47 20 2a 2f 0a 0a 23 69 66 6e 64 65 66 20 54 43 G */..#ifndef TC
22d0: 4c 5f 57 49 44 45 5f 49 4e 54 5f 54 59 50 45 0a L_WIDE_INT_TYPE.
22e0: 23 20 20 20 64 65 66 69 6e 65 20 54 43 4c 5f 57 # define TCL_W
22f0: 49 44 45 5f 49 4e 54 5f 54 59 50 45 09 09 6c 6f IDE_INT_TYPE..lo
2300: 6e 67 20 6c 6f 6e 67 0a 23 65 6e 64 69 66 20 2f ng long.#endif /
2310: 2a 20 21 54 43 4c 5f 57 49 44 45 5f 49 4e 54 5f * !TCL_WIDE_INT_
2320: 54 59 50 45 20 2a 2f 0a 0a 74 79 70 65 64 65 66 TYPE */..typedef
2330: 20 54 43 4c 5f 57 49 44 45 5f 49 4e 54 5f 54 59 TCL_WIDE_INT_TY
2340: 50 45 09 09 54 63 6c 5f 57 69 64 65 49 6e 74 3b PE..Tcl_WideInt;
2350: 0a 74 79 70 65 64 65 66 20 75 6e 73 69 67 6e 65 .typedef unsigne
2360: 64 20 54 43 4c 5f 57 49 44 45 5f 49 4e 54 5f 54 d TCL_WIDE_INT_T
2370: 59 50 45 09 54 63 6c 5f 57 69 64 65 55 49 6e 74 YPE.Tcl_WideUInt
2380: 3b 0a 0a 23 69 66 6e 64 65 66 20 54 43 4c 5f 4c ;..#ifndef TCL_L
2390: 4c 5f 4d 4f 44 49 46 49 45 52 0a 23 20 20 20 64 L_MODIFIER.# d
23a0: 65 66 69 6e 65 20 54 43 4c 5f 4c 4c 5f 4d 4f 44 efine TCL_LL_MOD
23b0: 49 46 49 45 52 09 22 6c 6c 22 0a 23 65 6e 64 69 IFIER."ll".#endi
23c0: 66 20 2f 2a 20 21 54 43 4c 5f 4c 4c 5f 4d 4f 44 f /* !TCL_LL_MOD
23d0: 49 46 49 45 52 20 2a 2f 0a 23 69 66 6e 64 65 66 IFIER */.#ifndef
23e0: 20 54 43 4c 5f 5a 5f 4d 4f 44 49 46 49 45 52 0a TCL_Z_MODIFIER.
23f0: 23 20 20 20 69 66 20 64 65 66 69 6e 65 64 28 5f # if defined(_
2400: 5f 47 4e 55 43 5f 5f 29 20 26 26 20 21 64 65 66 _GNUC__) && !def
2410: 69 6e 65 64 28 5f 57 49 4e 33 32 29 0a 23 09 64 ined(_WIN32).#.d
2420: 65 66 69 6e 65 20 54 43 4c 5f 5a 5f 4d 4f 44 49 efine TCL_Z_MODI
2430: 46 49 45 52 09 22 7a 22 0a 23 20 20 20 65 6c 73 FIER."z".# els
2440: 65 0a 23 09 64 65 66 69 6e 65 20 54 43 4c 5f 5a e.#.define TCL_Z
2450: 5f 4d 4f 44 49 46 49 45 52 09 22 22 0a 23 20 20 _MODIFIER."".#
2460: 20 65 6e 64 69 66 0a 23 65 6e 64 69 66 20 2f 2a endif.#endif /*
2470: 20 21 54 43 4c 5f 5a 5f 4d 4f 44 49 46 49 45 52 !TCL_Z_MODIFIER
2480: 20 2a 2f 0a 23 64 65 66 69 6e 65 20 54 63 6c 5f */.#define Tcl_
2490: 57 69 64 65 41 73 4c 6f 6e 67 28 76 61 6c 29 09 WideAsLong(val).
24a0: 28 28 6c 6f 6e 67 29 28 28 54 63 6c 5f 57 69 64 ((long)((Tcl_Wid
24b0: 65 49 6e 74 29 28 76 61 6c 29 29 29 0a 23 64 65 eInt)(val))).#de
24c0: 66 69 6e 65 20 54 63 6c 5f 4c 6f 6e 67 41 73 57 fine Tcl_LongAsW
24d0: 69 64 65 28 76 61 6c 29 09 28 28 54 63 6c 5f 57 ide(val).((Tcl_W
24e0: 69 64 65 49 6e 74 29 28 28 6c 6f 6e 67 29 28 76 ideInt)((long)(v
24f0: 61 6c 29 29 29 0a 23 64 65 66 69 6e 65 20 54 63 al))).#define Tc
2500: 6c 5f 57 69 64 65 41 73 44 6f 75 62 6c 65 28 76 l_WideAsDouble(v
2510: 61 6c 29 09 28 28 64 6f 75 62 6c 65 29 28 28 54 al).((double)((T
2520: 63 6c 5f 57 69 64 65 49 6e 74 29 28 76 61 6c 29 cl_WideInt)(val)
2530: 29 29 0a 23 64 65 66 69 6e 65 20 54 63 6c 5f 44 )).#define Tcl_D
2540: 6f 75 62 6c 65 41 73 57 69 64 65 28 76 61 6c 29 oubleAsWide(val)
2550: 09 28 28 54 63 6c 5f 57 69 64 65 49 6e 74 29 28 .((Tcl_WideInt)(
2560: 28 64 6f 75 62 6c 65 29 28 76 61 6c 29 29 29 0a (double)(val))).
2570: 0a 23 69 66 20 64 65 66 69 6e 65 64 28 5f 57 49 .#if defined(_WI
2580: 4e 33 32 29 0a 20 20 20 20 74 79 70 65 64 65 66 N32). typedef
2590: 20 73 74 72 75 63 74 20 5f 5f 73 74 61 74 36 34 struct __stat64
25a0: 20 54 63 6c 5f 53 74 61 74 42 75 66 3b 0a 23 65 Tcl_StatBuf;.#e
25b0: 6c 69 66 20 64 65 66 69 6e 65 64 28 5f 5f 43 59 lif defined(__CY
25c0: 47 57 49 4e 5f 5f 29 0a 20 20 20 20 74 79 70 65 GWIN__). type
25d0: 64 65 66 20 73 74 72 75 63 74 20 7b 0a 09 64 65 def struct {..de
25e0: 76 5f 74 20 73 74 5f 64 65 76 3b 0a 09 75 6e 73 v_t st_dev;..uns
25f0: 69 67 6e 65 64 20 73 68 6f 72 74 20 73 74 5f 69 igned short st_i
2600: 6e 6f 3b 0a 09 75 6e 73 69 67 6e 65 64 20 73 68 no;..unsigned sh
2610: 6f 72 74 20 73 74 5f 6d 6f 64 65 3b 0a 09 73 68 ort st_mode;..sh
2620: 6f 72 74 20 73 74 5f 6e 6c 69 6e 6b 3b 0a 09 73 ort st_nlink;..s
2630: 68 6f 72 74 20 73 74 5f 75 69 64 3b 0a 09 73 68 hort st_uid;..sh
2640: 6f 72 74 20 73 74 5f 67 69 64 3b 0a 09 2f 2a 20 ort st_gid;../*
2650: 48 65 72 65 20 69 73 20 61 20 32 2d 62 79 74 65 Here is a 2-byte
2660: 20 67 61 70 20 2a 2f 0a 09 64 65 76 5f 74 20 73 gap */..dev_t s
2670: 74 5f 72 64 65 76 3b 0a 09 2f 2a 20 48 65 72 65 t_rdev;../* Here
2680: 20 69 73 20 61 20 34 2d 62 79 74 65 20 67 61 70 is a 4-byte gap
2690: 20 2a 2f 0a 09 6c 6f 6e 67 20 6c 6f 6e 67 20 73 */..long long s
26a0: 74 5f 73 69 7a 65 3b 0a 09 73 74 72 75 63 74 20 t_size;..struct
26b0: 7b 6c 6f 6e 67 20 6c 6f 6e 67 20 74 76 5f 73 65 {long long tv_se
26c0: 63 3b 7d 20 73 74 5f 61 74 69 6d 3b 0a 09 73 74 c;} st_atim;..st
26d0: 72 75 63 74 20 7b 6c 6f 6e 67 20 6c 6f 6e 67 20 ruct {long long
26e0: 74 76 5f 73 65 63 3b 7d 20 73 74 5f 6d 74 69 6d tv_sec;} st_mtim
26f0: 3b 0a 09 73 74 72 75 63 74 20 7b 6c 6f 6e 67 20 ;..struct {long
2700: 6c 6f 6e 67 20 74 76 5f 73 65 63 3b 7d 20 73 74 long tv_sec;} st
2710: 5f 63 74 69 6d 3b 0a 20 20 20 20 7d 20 54 63 6c _ctim;. } Tcl
2720: 5f 53 74 61 74 42 75 66 3b 0a 23 65 6c 73 65 0a _StatBuf;.#else.
2730: 20 20 20 20 74 79 70 65 64 65 66 20 73 74 72 75 typedef stru
2740: 63 74 20 73 74 61 74 20 54 63 6c 5f 53 74 61 74 ct stat Tcl_Stat
2750: 42 75 66 3b 0a 23 65 6e 64 69 66 0a 0c 0a 2f 2a Buf;.#endif.../*
2760: 0a 20 2a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d . *-------------
2770: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
2780: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
2790: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
27a0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a ---------------.
27b0: 20 2a 20 44 61 74 61 20 73 74 72 75 63 74 75 72 * Data structur
27c0: 65 73 20 64 65 66 69 6e 65 64 20 6f 70 61 71 75 es defined opaqu
27d0: 65 6c 79 20 69 6e 20 74 68 69 73 20 6d 6f 64 75 ely in this modu
27e0: 6c 65 2e 20 54 68 65 20 64 65 66 69 6e 69 74 69 le. The definiti
27f0: 6f 6e 73 20 62 65 6c 6f 77 20 6a 75 73 74 0a 20 ons below just.
2800: 2a 20 70 72 6f 76 69 64 65 20 64 75 6d 6d 79 20 * provide dummy
2810: 74 79 70 65 73 2e 20 41 20 66 65 77 20 66 69 65 types. A few fie
2820: 6c 64 73 20 61 72 65 20 6d 61 64 65 20 76 69 73 lds are made vis
2830: 69 62 6c 65 20 69 6e 20 54 63 6c 5f 49 6e 74 65 ible in Tcl_Inte
2840: 72 70 0a 20 2a 20 73 74 72 75 63 74 75 72 65 73 rp. * structures
2850: 2c 20 6e 61 6d 65 6c 79 20 74 68 6f 73 65 20 75 , namely those u
2860: 73 65 64 20 66 6f 72 20 72 65 74 75 72 6e 69 6e sed for returnin
2870: 67 20 61 20 73 74 72 69 6e 67 20 72 65 73 75 6c g a string resul
2880: 74 20 66 72 6f 6d 20 63 6f 6d 6d 61 6e 64 73 2e t from commands.
2890: 0a 20 2a 20 44 69 72 65 63 74 20 61 63 63 65 73 . * Direct acces
28a0: 73 20 74 6f 20 74 68 65 20 72 65 73 75 6c 74 20 s to the result
28b0: 66 69 65 6c 64 20 69 73 20 64 69 73 63 6f 75 72 field is discour
28c0: 61 67 65 64 20 69 6e 20 54 63 6c 20 38 2e 30 2e aged in Tcl 8.0.
28d0: 20 54 68 65 0a 20 2a 20 69 6e 74 65 72 70 72 65 The. * interpre
28e0: 74 65 72 20 72 65 73 75 6c 74 20 69 73 20 65 69 ter result is ei
28f0: 74 68 65 72 20 61 6e 20 6f 62 6a 65 63 74 20 6f ther an object o
2900: 72 20 61 20 73 74 72 69 6e 67 2c 20 61 6e 64 20 r a string, and
2910: 74 68 65 20 74 77 6f 20 76 61 6c 75 65 73 20 61 the two values a
2920: 72 65 0a 20 2a 20 6b 65 70 74 20 63 6f 6e 73 69 re. * kept consi
2930: 73 74 65 6e 74 20 75 6e 6c 65 73 73 20 73 6f 6d stent unless som
2940: 65 20 43 20 63 6f 64 65 20 73 65 74 73 20 69 6e e C code sets in
2950: 74 65 72 70 2d 3e 72 65 73 75 6c 74 20 64 69 72 terp->result dir
2960: 65 63 74 6c 79 2e 0a 20 2a 20 50 72 6f 67 72 61 ectly.. * Progra
2970: 6d 6d 65 72 73 20 73 68 6f 75 6c 64 20 75 73 65 mmers should use
2980: 20 65 69 74 68 65 72 20 74 68 65 20 66 75 6e 63 either the func
2990: 74 69 6f 6e 20 54 63 6c 5f 47 65 74 4f 62 6a 52 tion Tcl_GetObjR
29a0: 65 73 75 6c 74 28 29 20 6f 72 0a 20 2a 20 54 63 esult() or. * Tc
29b0: 6c 5f 47 65 74 53 74 72 69 6e 67 52 65 73 75 6c l_GetStringResul
29c0: 74 28 29 20 74 6f 20 72 65 61 64 20 74 68 65 20 t() to read the
29d0: 69 6e 74 65 72 70 72 65 74 65 72 27 73 20 72 65 interpreter's re
29e0: 73 75 6c 74 2e 20 53 65 65 20 74 68 65 20 53 65 sult. See the Se
29f0: 74 52 65 73 75 6c 74 0a 20 2a 20 6d 61 6e 20 70 tResult. * man p
2a00: 61 67 65 20 66 6f 72 20 64 65 74 61 69 6c 73 2e age for details.
2a10: 0a 20 2a 0a 20 2a 20 4e 6f 74 65 3a 20 61 6e 79 . *. * Note: any
2a20: 20 63 68 61 6e 67 65 20 74 6f 20 74 68 65 20 54 change to the T
2a30: 63 6c 5f 49 6e 74 65 72 70 20 64 65 66 69 6e 69 cl_Interp defini
2a40: 74 69 6f 6e 20 62 65 6c 6f 77 20 6d 75 73 74 20 tion below must
2a50: 62 65 20 6d 69 72 72 6f 72 65 64 20 69 6e 20 74 be mirrored in t
2a60: 68 65 0a 20 2a 20 22 72 65 61 6c 22 20 64 65 66 he. * "real" def
2a70: 69 6e 69 74 69 6f 6e 20 69 6e 20 74 63 6c 49 6e inition in tclIn
2a80: 74 2e 68 2e 0a 20 2a 0a 20 2a 20 4e 6f 74 65 3a t.h.. *. * Note:
2a90: 20 54 63 6c 5f 4f 62 6a 43 6d 64 50 72 6f 63 20 Tcl_ObjCmdProc
2aa0: 66 75 6e 63 74 69 6f 6e 73 20 64 6f 20 6e 6f 74 functions do not
2ab0: 20 64 69 72 65 63 74 6c 79 20 73 65 74 20 72 65 directly set re
2ac0: 73 75 6c 74 20 61 6e 64 20 66 72 65 65 50 72 6f sult and freePro
2ad0: 63 2e 0a 20 2a 20 49 6e 73 74 65 61 64 2c 20 74 c.. * Instead, t
2ae0: 68 65 79 20 73 65 74 20 61 20 54 63 6c 5f 4f 62 hey set a Tcl_Ob
2af0: 6a 20 6d 65 6d 62 65 72 20 69 6e 20 74 68 65 20 j member in the
2b00: 22 72 65 61 6c 22 20 73 74 72 75 63 74 75 72 65 "real" structure
2b10: 20 74 68 61 74 20 63 61 6e 20 62 65 0a 20 2a 20 that can be. *
2b20: 61 63 63 65 73 73 65 64 20 77 69 74 68 20 54 63 accessed with Tc
2b30: 6c 5f 47 65 74 4f 62 6a 52 65 73 75 6c 74 28 29 l_GetObjResult()
2b40: 20 61 6e 64 20 54 63 6c 5f 53 65 74 4f 62 6a 52 and Tcl_SetObjR
2b50: 65 73 75 6c 74 28 29 2e 0a 20 2a 2f 0a 0a 74 79 esult().. */..ty
2b60: 70 65 64 65 66 20 73 74 72 75 63 74 20 54 63 6c pedef struct Tcl
2b70: 5f 49 6e 74 65 72 70 20 54 63 6c 5f 49 6e 74 65 _Interp Tcl_Inte
2b80: 72 70 3b 0a 0a 74 79 70 65 64 65 66 20 73 74 72 rp;..typedef str
2b90: 75 63 74 20 54 63 6c 5f 41 73 79 6e 63 48 61 6e uct Tcl_AsyncHan
2ba0: 64 6c 65 72 5f 20 2a 54 63 6c 5f 41 73 79 6e 63 dler_ *Tcl_Async
2bb0: 48 61 6e 64 6c 65 72 3b 0a 74 79 70 65 64 65 66 Handler;.typedef
2bc0: 20 73 74 72 75 63 74 20 54 63 6c 5f 43 68 61 6e struct Tcl_Chan
2bd0: 6e 65 6c 5f 20 2a 54 63 6c 5f 43 68 61 6e 6e 65 nel_ *Tcl_Channe
2be0: 6c 3b 0a 74 79 70 65 64 65 66 20 73 74 72 75 63 l;.typedef struc
2bf0: 74 20 54 63 6c 5f 43 68 61 6e 6e 65 6c 54 79 70 t Tcl_ChannelTyp
2c00: 65 56 65 72 73 69 6f 6e 5f 20 2a 54 63 6c 5f 43 eVersion_ *Tcl_C
2c10: 68 61 6e 6e 65 6c 54 79 70 65 56 65 72 73 69 6f hannelTypeVersio
2c20: 6e 3b 0a 74 79 70 65 64 65 66 20 73 74 72 75 63 n;.typedef struc
2c30: 74 20 54 63 6c 5f 43 6f 6d 6d 61 6e 64 5f 20 2a t Tcl_Command_ *
2c40: 54 63 6c 5f 43 6f 6d 6d 61 6e 64 3b 0a 74 79 70 Tcl_Command;.typ
2c50: 65 64 65 66 20 73 74 72 75 63 74 20 54 63 6c 5f edef struct Tcl_
2c60: 43 6f 6e 64 69 74 69 6f 6e 5f 20 2a 54 63 6c 5f Condition_ *Tcl_
2c70: 43 6f 6e 64 69 74 69 6f 6e 3b 0a 74 79 70 65 64 Condition;.typed
2c80: 65 66 20 73 74 72 75 63 74 20 54 63 6c 5f 44 69 ef struct Tcl_Di
2c90: 63 74 5f 20 2a 54 63 6c 5f 44 69 63 74 3b 0a 74 ct_ *Tcl_Dict;.t
2ca0: 79 70 65 64 65 66 20 73 74 72 75 63 74 20 54 63 ypedef struct Tc
2cb0: 6c 5f 45 6e 63 6f 64 69 6e 67 53 74 61 74 65 5f l_EncodingState_
2cc0: 20 2a 54 63 6c 5f 45 6e 63 6f 64 69 6e 67 53 74 *Tcl_EncodingSt
2cd0: 61 74 65 3b 0a 74 79 70 65 64 65 66 20 73 74 72 ate;.typedef str
2ce0: 75 63 74 20 54 63 6c 5f 45 6e 63 6f 64 69 6e 67 uct Tcl_Encoding
2cf0: 5f 20 2a 54 63 6c 5f 45 6e 63 6f 64 69 6e 67 3b _ *Tcl_Encoding;
2d00: 0a 74 79 70 65 64 65 66 20 73 74 72 75 63 74 20 .typedef struct
2d10: 54 63 6c 5f 45 76 65 6e 74 20 54 63 6c 5f 45 76 Tcl_Event Tcl_Ev
2d20: 65 6e 74 3b 0a 74 79 70 65 64 65 66 20 73 74 72 ent;.typedef str
2d30: 75 63 74 20 54 63 6c 5f 49 6e 74 65 72 70 53 74 uct Tcl_InterpSt
2d40: 61 74 65 5f 20 2a 54 63 6c 5f 49 6e 74 65 72 70 ate_ *Tcl_Interp
2d50: 53 74 61 74 65 3b 0a 74 79 70 65 64 65 66 20 73 State;.typedef s
2d60: 74 72 75 63 74 20 54 63 6c 5f 4c 6f 61 64 48 61 truct Tcl_LoadHa
2d70: 6e 64 6c 65 5f 20 2a 54 63 6c 5f 4c 6f 61 64 48 ndle_ *Tcl_LoadH
2d80: 61 6e 64 6c 65 3b 0a 74 79 70 65 64 65 66 20 73 andle;.typedef s
2d90: 74 72 75 63 74 20 54 63 6c 5f 4d 75 74 65 78 5f truct Tcl_Mutex_
2da0: 20 2a 54 63 6c 5f 4d 75 74 65 78 3b 0a 74 79 70 *Tcl_Mutex;.typ
2db0: 65 64 65 66 20 73 74 72 75 63 74 20 54 63 6c 5f edef struct Tcl_
2dc0: 50 69 64 5f 20 2a 54 63 6c 5f 50 69 64 3b 0a 74 Pid_ *Tcl_Pid;.t
2dd0: 79 70 65 64 65 66 20 73 74 72 75 63 74 20 54 63 ypedef struct Tc
2de0: 6c 5f 52 65 67 45 78 70 5f 20 2a 54 63 6c 5f 52 l_RegExp_ *Tcl_R
2df0: 65 67 45 78 70 3b 0a 74 79 70 65 64 65 66 20 73 egExp;.typedef s
2e00: 74 72 75 63 74 20 54 63 6c 5f 54 68 72 65 61 64 truct Tcl_Thread
2e10: 44 61 74 61 4b 65 79 5f 20 2a 54 63 6c 5f 54 68 DataKey_ *Tcl_Th
2e20: 72 65 61 64 44 61 74 61 4b 65 79 3b 0a 74 79 70 readDataKey;.typ
2e30: 65 64 65 66 20 73 74 72 75 63 74 20 54 63 6c 5f edef struct Tcl_
2e40: 54 68 72 65 61 64 49 64 5f 20 2a 54 63 6c 5f 54 ThreadId_ *Tcl_T
2e50: 68 72 65 61 64 49 64 3b 0a 74 79 70 65 64 65 66 hreadId;.typedef
2e60: 20 73 74 72 75 63 74 20 54 63 6c 5f 54 69 6d 65 struct Tcl_Time
2e70: 72 54 6f 6b 65 6e 5f 20 2a 54 63 6c 5f 54 69 6d rToken_ *Tcl_Tim
2e80: 65 72 54 6f 6b 65 6e 3b 0a 74 79 70 65 64 65 66 erToken;.typedef
2e90: 20 73 74 72 75 63 74 20 54 63 6c 5f 54 72 61 63 struct Tcl_Trac
2ea0: 65 5f 20 2a 54 63 6c 5f 54 72 61 63 65 3b 0a 74 e_ *Tcl_Trace;.t
2eb0: 79 70 65 64 65 66 20 73 74 72 75 63 74 20 54 63 ypedef struct Tc
2ec0: 6c 5f 56 61 72 5f 20 2a 54 63 6c 5f 56 61 72 3b l_Var_ *Tcl_Var;
2ed0: 0a 74 79 70 65 64 65 66 20 73 74 72 75 63 74 20 .typedef struct
2ee0: 54 63 6c 5f 5a 4c 69 62 53 74 72 65 61 6d 5f 20 Tcl_ZLibStream_
2ef0: 2a 54 63 6c 5f 5a 6c 69 62 53 74 72 65 61 6d 3b *Tcl_ZlibStream;
2f00: 0a 0a 2f 2a 0a 20 2a 2d 2d 2d 2d 2d 2d 2d 2d 2d ../*. *---------
2f10: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
2f20: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
2f30: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
2f40: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
2f50: 2d 2d 2d 0a 20 2a 20 44 65 66 69 6e 69 74 69 6f ---. * Definitio
2f60: 6e 20 6f 66 20 74 68 65 20 69 6e 74 65 72 66 61 n of the interfa
2f70: 63 65 20 74 6f 20 66 75 6e 63 74 69 6f 6e 73 20 ce to functions
2f80: 69 6d 70 6c 65 6d 65 6e 74 69 6e 67 20 74 68 72 implementing thr
2f90: 65 61 64 73 2e 20 41 20 66 75 6e 63 74 69 6f 6e eads. A function
2fa0: 0a 20 2a 20 66 6f 6c 6c 6f 77 69 6e 67 20 74 68 . * following th
2fb0: 69 73 20 64 65 66 69 6e 69 74 69 6f 6e 20 69 73 is definition is
2fc0: 20 67 69 76 65 6e 20 74 6f 20 65 61 63 68 20 63 given to each c
2fd0: 61 6c 6c 20 6f 66 20 27 54 63 6c 5f 43 72 65 61 all of 'Tcl_Crea
2fe0: 74 65 54 68 72 65 61 64 27 20 61 6e 64 0a 20 2a teThread' and. *
2ff0: 20 77 69 6c 6c 20 62 65 20 63 61 6c 6c 65 64 20 will be called
3000: 61 73 20 74 68 65 20 6d 61 69 6e 20 66 75 63 74 as the main fuct
3010: 69 6f 6e 20 6f 66 20 74 68 65 20 6e 65 77 20 74 ion of the new t
3020: 68 72 65 61 64 20 63 72 65 61 74 65 64 20 62 79 hread created by
3030: 20 74 68 61 74 20 63 61 6c 6c 2e 0a 20 2a 2f 0a that call.. */.
3040: 0a 23 69 66 20 64 65 66 69 6e 65 64 20 5f 57 49 .#if defined _WI
3050: 4e 33 32 0a 74 79 70 65 64 65 66 20 75 6e 73 69 N32.typedef unsi
3060: 67 6e 65 64 20 28 5f 5f 73 74 64 63 61 6c 6c 20 gned (__stdcall
3070: 54 63 6c 5f 54 68 72 65 61 64 43 72 65 61 74 65 Tcl_ThreadCreate
3080: 50 72 6f 63 29 20 28 76 6f 69 64 20 2a 63 6c 69 Proc) (void *cli
3090: 65 6e 74 44 61 74 61 29 3b 0a 23 65 6c 73 65 0a entData);.#else.
30a0: 74 79 70 65 64 65 66 20 76 6f 69 64 20 28 54 63 typedef void (Tc
30b0: 6c 5f 54 68 72 65 61 64 43 72 65 61 74 65 50 72 l_ThreadCreatePr
30c0: 6f 63 29 20 28 76 6f 69 64 20 2a 63 6c 69 65 6e oc) (void *clien
30d0: 74 44 61 74 61 29 3b 0a 23 65 6e 64 69 66 0a 0a tData);.#endif..
30e0: 2f 2a 0a 20 2a 20 54 68 72 65 61 64 69 6e 67 20 /*. * Threading
30f0: 66 75 6e 63 74 69 6f 6e 20 72 65 74 75 72 6e 20 function return
3100: 74 79 70 65 73 20 75 73 65 64 20 66 6f 72 20 61 types used for a
3110: 62 73 74 72 61 63 74 69 6e 67 20 61 77 61 79 20 bstracting away
3120: 70 6c 61 74 66 6f 72 6d 0a 20 2a 20 64 69 66 66 platform. * diff
3130: 65 72 65 6e 63 65 73 20 77 68 65 6e 20 77 72 69 erences when wri
3140: 74 69 6e 67 20 61 20 54 63 6c 5f 54 68 72 65 61 ting a Tcl_Threa
3150: 64 43 72 65 61 74 65 50 72 6f 63 2e 20 53 65 65 dCreateProc. See
3160: 20 74 68 65 20 4e 65 77 54 68 72 65 61 64 20 66 the NewThread f
3170: 75 6e 63 74 69 6f 6e 0a 20 2a 20 69 6e 20 67 65 unction. * in ge
3180: 6e 65 72 69 63 2f 74 63 6c 54 68 72 65 61 64 54 neric/tclThreadT
3190: 65 73 74 2e 63 20 66 6f 72 20 69 74 27 73 20 75 est.c for it's u
31a0: 73 61 67 65 2e 0a 20 2a 2f 0a 0a 23 69 66 20 64 sage.. */..#if d
31b0: 65 66 69 6e 65 64 20 5f 57 49 4e 33 32 0a 23 20 efined _WIN32.#
31c0: 20 20 64 65 66 69 6e 65 20 54 63 6c 5f 54 68 72 define Tcl_Thr
31d0: 65 61 64 43 72 65 61 74 65 54 79 70 65 09 09 75 eadCreateType..u
31e0: 6e 73 69 67 6e 65 64 20 5f 5f 73 74 64 63 61 6c nsigned __stdcal
31f0: 6c 0a 23 20 20 20 64 65 66 69 6e 65 20 54 43 4c l.# define TCL
3200: 5f 54 48 52 45 41 44 5f 43 52 45 41 54 45 5f 52 _THREAD_CREATE_R
3210: 45 54 55 52 4e 09 72 65 74 75 72 6e 20 30 0a 23 ETURN.return 0.#
3220: 65 6c 73 65 0a 23 20 20 20 64 65 66 69 6e 65 20 else.# define
3230: 54 63 6c 5f 54 68 72 65 61 64 43 72 65 61 74 65 Tcl_ThreadCreate
3240: 54 79 70 65 09 09 76 6f 69 64 0a 23 20 20 20 64 Type..void.# d
3250: 65 66 69 6e 65 20 54 43 4c 5f 54 48 52 45 41 44 efine TCL_THREAD
3260: 5f 43 52 45 41 54 45 5f 52 45 54 55 52 4e 0a 23 _CREATE_RETURN.#
3270: 65 6e 64 69 66 0a 0a 2f 2a 0a 20 2a 20 44 65 66 endif../*. * Def
3280: 69 6e 69 74 69 6f 6e 20 6f 66 20 76 61 6c 75 65 inition of value
3290: 73 20 66 6f 72 20 64 65 66 61 75 6c 74 20 73 74 s for default st
32a0: 61 63 6b 73 69 7a 65 20 61 6e 64 20 74 68 65 20 acksize and the
32b0: 70 6f 73 73 69 62 6c 65 20 66 6c 61 67 73 20 74 possible flags t
32c0: 6f 20 62 65 0a 20 2a 20 67 69 76 65 6e 20 74 6f o be. * given to
32d0: 20 54 63 6c 5f 43 72 65 61 74 65 54 68 72 65 61 Tcl_CreateThrea
32e0: 64 2e 0a 20 2a 2f 0a 0a 23 64 65 66 69 6e 65 20 d.. */..#define
32f0: 54 43 4c 5f 54 48 52 45 41 44 5f 53 54 41 43 4b TCL_THREAD_STACK
3300: 5f 44 45 46 41 55 4c 54 20 28 30 29 20 20 20 20 _DEFAULT (0)
3310: 2f 2a 20 55 73 65 20 64 65 66 61 75 6c 74 20 73 /* Use default s
3320: 69 7a 65 20 66 6f 72 20 73 74 61 63 6b 2e 20 2a ize for stack. *
3330: 2f 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 54 48 /.#define TCL_TH
3340: 52 45 41 44 5f 4e 4f 46 4c 41 47 53 09 20 28 30 READ_NOFLAGS. (0
3350: 30 30 30 29 20 2f 2a 20 53 74 61 6e 64 61 72 64 000) /* Standard
3360: 20 66 6c 61 67 73 2c 20 64 65 66 61 75 6c 74 0a flags, default.
3370: 09 09 09 09 09 20 2a 20 62 65 68 61 76 69 6f 75 ..... * behaviou
3380: 72 2e 20 2a 2f 0a 23 64 65 66 69 6e 65 20 54 43 r. */.#define TC
3390: 4c 5f 54 48 52 45 41 44 5f 4a 4f 49 4e 41 42 4c L_THREAD_JOINABL
33a0: 45 09 20 28 30 30 30 31 29 20 2f 2a 20 4d 61 72 E. (0001) /* Mar
33b0: 6b 20 74 68 65 20 74 68 72 65 61 64 20 61 73 20 k the thread as
33c0: 6a 6f 69 6e 61 62 6c 65 2e 20 2a 2f 0a 0a 2f 2a joinable. */../*
33d0: 0a 20 2a 20 46 6c 61 67 20 76 61 6c 75 65 73 20 . * Flag values
33e0: 70 61 73 73 65 64 20 74 6f 20 54 63 6c 5f 53 74 passed to Tcl_St
33f0: 72 69 6e 67 43 61 73 65 4d 61 74 63 68 2e 0a 20 ringCaseMatch..
3400: 2a 2f 0a 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f */..#define TCL_
3410: 4d 41 54 43 48 5f 4e 4f 43 41 53 45 09 28 31 3c MATCH_NOCASE.(1<
3420: 3c 30 29 0a 0a 2f 2a 0a 20 2a 20 46 6c 61 67 20 <0)../*. * Flag
3430: 76 61 6c 75 65 73 20 70 61 73 73 65 64 20 74 6f values passed to
3440: 20 54 63 6c 5f 47 65 74 52 65 67 45 78 70 46 72 Tcl_GetRegExpFr
3450: 6f 6d 4f 62 6a 2e 0a 20 2a 2f 0a 0a 23 64 65 66 omObj.. */..#def
3460: 69 6e 65 09 54 43 4c 5f 52 45 47 5f 42 41 53 49 ine.TCL_REG_BASI
3470: 43 09 09 30 30 30 30 30 30 09 2f 2a 20 42 52 45 C..000000./* BRE
3480: 73 20 28 63 6f 6e 76 65 6e 69 65 6e 63 65 29 2e s (convenience).
3490: 20 2a 2f 0a 23 64 65 66 69 6e 65 09 54 43 4c 5f */.#define.TCL_
34a0: 52 45 47 5f 45 58 54 45 4e 44 45 44 09 30 30 30 REG_EXTENDED.000
34b0: 30 30 31 09 2f 2a 20 45 52 45 73 2e 20 2a 2f 0a 001./* EREs. */.
34c0: 23 64 65 66 69 6e 65 09 54 43 4c 5f 52 45 47 5f #define.TCL_REG_
34d0: 41 44 56 46 09 09 30 30 30 30 30 32 09 2f 2a 20 ADVF..000002./*
34e0: 41 64 76 61 6e 63 65 64 20 66 65 61 74 75 72 65 Advanced feature
34f0: 73 20 69 6e 20 45 52 45 73 2e 20 2a 2f 0a 23 64 s in EREs. */.#d
3500: 65 66 69 6e 65 09 54 43 4c 5f 52 45 47 5f 41 44 efine.TCL_REG_AD
3510: 56 41 4e 43 45 44 09 30 30 30 30 30 33 09 2f 2a VANCED.000003./*
3520: 20 41 52 45 73 20 28 77 68 69 63 68 20 61 72 65 AREs (which are
3530: 20 61 6c 73 6f 20 45 52 45 73 29 2e 20 2a 2f 0a also EREs). */.
3540: 23 64 65 66 69 6e 65 09 54 43 4c 5f 52 45 47 5f #define.TCL_REG_
3550: 51 55 4f 54 45 09 09 30 30 30 30 30 34 09 2f 2a QUOTE..000004./*
3560: 20 4e 6f 20 73 70 65 63 69 61 6c 20 63 68 61 72 No special char
3570: 61 63 74 65 72 73 2c 20 6e 6f 6e 65 2e 20 2a 2f acters, none. */
3580: 0a 23 64 65 66 69 6e 65 09 54 43 4c 5f 52 45 47 .#define.TCL_REG
3590: 5f 4e 4f 43 41 53 45 09 09 30 30 30 30 31 30 09 _NOCASE..000010.
35a0: 2f 2a 20 49 67 6e 6f 72 65 20 63 61 73 65 2e 20 /* Ignore case.
35b0: 2a 2f 0a 23 64 65 66 69 6e 65 09 54 43 4c 5f 52 */.#define.TCL_R
35c0: 45 47 5f 4e 4f 53 55 42 09 09 30 30 30 30 32 30 EG_NOSUB..000020
35d0: 09 2f 2a 20 44 6f 6e 27 74 20 63 61 72 65 20 61 ./* Don't care a
35e0: 62 6f 75 74 20 73 75 62 65 78 70 72 65 73 73 69 bout subexpressi
35f0: 6f 6e 73 2e 20 2a 2f 0a 23 64 65 66 69 6e 65 09 ons. */.#define.
3600: 54 43 4c 5f 52 45 47 5f 45 58 50 41 4e 44 45 44 TCL_REG_EXPANDED
3610: 09 30 30 30 30 34 30 09 2f 2a 20 45 78 70 61 6e .000040./* Expan
3620: 64 65 64 20 66 6f 72 6d 61 74 2c 20 77 68 69 74 ded format, whit
3630: 65 20 73 70 61 63 65 20 26 0a 09 09 09 09 09 20 e space &......
3640: 2a 20 63 6f 6d 6d 65 6e 74 73 2e 20 2a 2f 0a 23 * comments. */.#
3650: 64 65 66 69 6e 65 09 54 43 4c 5f 52 45 47 5f 4e define.TCL_REG_N
3660: 4c 53 54 4f 50 09 09 30 30 30 31 30 30 20 20 2f LSTOP..000100 /
3670: 2a 20 5c 6e 20 64 6f 65 73 6e 27 74 20 6d 61 74 * \n doesn't mat
3680: 63 68 20 2e 20 6f 72 20 5b 5e 20 5d 20 2a 2f 0a ch . or [^ ] */.
3690: 23 64 65 66 69 6e 65 09 54 43 4c 5f 52 45 47 5f #define.TCL_REG_
36a0: 4e 4c 41 4e 43 48 09 09 30 30 30 32 30 30 20 20 NLANCH..000200
36b0: 2f 2a 20 5e 20 6d 61 74 63 68 65 73 20 61 66 74 /* ^ matches aft
36c0: 65 72 20 5c 6e 2c 20 24 20 62 65 66 6f 72 65 2e er \n, $ before.
36d0: 20 2a 2f 0a 23 64 65 66 69 6e 65 09 54 43 4c 5f */.#define.TCL_
36e0: 52 45 47 5f 4e 45 57 4c 49 4e 45 09 09 30 30 30 REG_NEWLINE..000
36f0: 33 30 30 20 20 2f 2a 20 4e 65 77 6c 69 6e 65 73 300 /* Newlines
3700: 20 61 72 65 20 6c 69 6e 65 20 74 65 72 6d 69 6e are line termin
3710: 61 74 6f 72 73 2e 20 2a 2f 0a 23 64 65 66 69 6e ators. */.#defin
3720: 65 09 54 43 4c 5f 52 45 47 5f 43 41 4e 4d 41 54 e.TCL_REG_CANMAT
3730: 43 48 09 30 30 31 30 30 30 20 20 2f 2a 20 52 65 CH.001000 /* Re
3740: 70 6f 72 74 20 64 65 74 61 69 6c 73 20 6f 6e 20 port details on
3750: 70 61 72 74 69 61 6c 2f 6c 69 6d 69 74 65 64 0a partial/limited.
3760: 09 09 09 09 09 20 2a 20 6d 61 74 63 68 65 73 2e ..... * matches.
3770: 20 2a 2f 0a 0a 2f 2a 0a 20 2a 20 46 6c 61 67 73 */../*. * Flags
3780: 20 76 61 6c 75 65 73 20 70 61 73 73 65 64 20 74 values passed t
3790: 6f 20 54 63 6c 5f 52 65 67 45 78 70 45 78 65 63 o Tcl_RegExpExec
37a0: 4f 62 6a 2e 0a 20 2a 2f 0a 0a 23 64 65 66 69 6e Obj.. */..#defin
37b0: 65 09 54 43 4c 5f 52 45 47 5f 4e 4f 54 42 4f 4c e.TCL_REG_NOTBOL
37c0: 09 30 30 30 31 09 2f 2a 20 42 65 67 69 6e 6e 69 .0001./* Beginni
37d0: 6e 67 20 6f 66 20 73 74 72 69 6e 67 20 64 6f 65 ng of string doe
37e0: 73 20 6e 6f 74 20 6d 61 74 63 68 20 5e 2e 20 20 s not match ^.
37f0: 2a 2f 0a 23 64 65 66 69 6e 65 09 54 43 4c 5f 52 */.#define.TCL_R
3800: 45 47 5f 4e 4f 54 45 4f 4c 09 30 30 30 32 09 2f EG_NOTEOL.0002./
3810: 2a 20 45 6e 64 20 6f 66 20 73 74 72 69 6e 67 20 * End of string
3820: 64 6f 65 73 20 6e 6f 74 20 6d 61 74 63 68 20 24 does not match $
3830: 2e 20 2a 2f 0a 0a 2f 2a 0a 20 2a 20 53 74 72 75 . */../*. * Stru
3840: 63 74 75 72 65 73 20 66 69 6c 6c 65 64 20 69 6e ctures filled in
3850: 20 62 79 20 54 63 6c 5f 52 65 67 45 78 70 49 6e by Tcl_RegExpIn
3860: 66 6f 2e 20 4e 6f 74 65 20 74 68 61 74 20 61 6c fo. Note that al
3870: 6c 20 6f 66 66 73 65 74 20 76 61 6c 75 65 73 20 l offset values
3880: 61 72 65 0a 20 2a 20 72 65 6c 61 74 69 76 65 20 are. * relative
3890: 74 6f 20 74 68 65 20 73 74 61 72 74 20 6f 66 20 to the start of
38a0: 74 68 65 20 6d 61 74 63 68 20 73 74 72 69 6e 67 the match string
38b0: 2c 20 6e 6f 74 20 74 68 65 20 62 65 67 69 6e 6e , not the beginn
38c0: 69 6e 67 20 6f 66 20 74 68 65 20 65 6e 74 69 72 ing of the entir
38d0: 65 0a 20 2a 20 73 74 72 69 6e 67 2e 0a 20 2a 2f e. * string.. */
38e0: 0a 0a 74 79 70 65 64 65 66 20 73 74 72 75 63 74 ..typedef struct
38f0: 20 54 63 6c 5f 52 65 67 45 78 70 49 6e 64 69 63 Tcl_RegExpIndic
3900: 65 73 20 7b 0a 20 20 20 20 73 69 7a 65 5f 74 20 es {. size_t
3910: 73 74 61 72 74 3b 09 09 09 2f 2a 20 43 68 61 72 start;.../* Char
3920: 61 63 74 65 72 20 6f 66 66 73 65 74 20 6f 66 20 acter offset of
3930: 66 69 72 73 74 20 63 68 61 72 61 63 74 65 72 20 first character
3940: 69 6e 0a 09 09 09 09 20 2a 20 6d 61 74 63 68 2e in..... * match.
3950: 20 2a 2f 0a 20 20 20 20 73 69 7a 65 5f 74 20 65 */. size_t e
3960: 6e 64 3b 09 09 09 2f 2a 20 43 68 61 72 61 63 74 nd;.../* Charact
3970: 65 72 20 6f 66 66 73 65 74 20 6f 66 20 66 69 72 er offset of fir
3980: 73 74 20 63 68 61 72 61 63 74 65 72 20 61 66 74 st character aft
3990: 65 72 0a 09 09 09 09 20 2a 20 74 68 65 20 6d 61 er..... * the ma
39a0: 74 63 68 2e 20 2a 2f 0a 7d 20 54 63 6c 5f 52 65 tch. */.} Tcl_Re
39b0: 67 45 78 70 49 6e 64 69 63 65 73 3b 0a 0a 74 79 gExpIndices;..ty
39c0: 70 65 64 65 66 20 73 74 72 75 63 74 20 54 63 6c pedef struct Tcl
39d0: 5f 52 65 67 45 78 70 49 6e 66 6f 20 7b 0a 20 20 _RegExpInfo {.
39e0: 20 20 73 69 7a 65 5f 74 20 6e 73 75 62 73 3b 09 size_t nsubs;.
39f0: 09 09 2f 2a 20 4e 75 6d 62 65 72 20 6f 66 20 73 ../* Number of s
3a00: 75 62 65 78 70 72 65 73 73 69 6f 6e 73 20 69 6e ubexpressions in
3a10: 20 74 68 65 20 63 6f 6d 70 69 6c 65 64 0a 09 09 the compiled...
3a20: 09 09 20 2a 20 65 78 70 72 65 73 73 69 6f 6e 2e .. * expression.
3a30: 20 2a 2f 0a 20 20 20 20 54 63 6c 5f 52 65 67 45 */. Tcl_RegE
3a40: 78 70 49 6e 64 69 63 65 73 20 2a 6d 61 74 63 68 xpIndices *match
3a50: 65 73 3b 09 2f 2a 20 41 72 72 61 79 20 6f 66 20 es;./* Array of
3a60: 6e 73 75 62 73 20 6d 61 74 63 68 20 6f 66 66 73 nsubs match offs
3a70: 65 74 20 70 61 69 72 73 2e 20 2a 2f 0a 20 20 20 et pairs. */.
3a80: 20 73 69 7a 65 5f 74 20 65 78 74 65 6e 64 53 74 size_t extendSt
3a90: 61 72 74 3b 09 09 2f 2a 20 54 68 65 20 6f 66 66 art;../* The off
3aa0: 73 65 74 20 61 74 20 77 68 69 63 68 20 61 20 73 set at which a s
3ab0: 75 62 73 65 71 75 65 6e 74 20 6d 61 74 63 68 0a ubsequent match.
3ac0: 09 09 09 09 20 2a 20 6d 69 67 68 74 20 62 65 67 .... * might beg
3ad0: 69 6e 2e 20 2a 2f 0a 7d 20 54 63 6c 5f 52 65 67 in. */.} Tcl_Reg
3ae0: 45 78 70 49 6e 66 6f 3b 0a 0a 2f 2a 0a 20 2a 20 ExpInfo;../*. *
3af0: 50 69 63 6b 79 20 63 6f 6d 70 69 6c 65 72 73 20 Picky compilers
3b00: 63 6f 6d 70 6c 61 69 6e 20 69 66 20 74 68 69 73 complain if this
3b10: 20 74 79 70 64 65 66 20 64 6f 65 73 6e 27 74 20 typdef doesn't
3b20: 61 70 70 65 61 72 20 62 65 66 6f 72 65 20 74 68 appear before th
3b30: 65 20 73 74 72 75 63 74 27 73 0a 20 2a 20 72 65 e struct's. * re
3b40: 66 65 72 65 6e 63 65 20 69 6e 20 74 63 6c 44 65 ference in tclDe
3b50: 63 6c 73 2e 68 2e 0a 20 2a 2f 0a 0a 74 79 70 65 cls.h.. */..type
3b60: 64 65 66 20 54 63 6c 5f 53 74 61 74 42 75 66 20 def Tcl_StatBuf
3b70: 2a 54 63 6c 5f 53 74 61 74 5f 3b 0a 74 79 70 65 *Tcl_Stat_;.type
3b80: 64 65 66 20 73 74 72 75 63 74 20 73 74 61 74 20 def struct stat
3b90: 2a 54 63 6c 5f 4f 6c 64 53 74 61 74 5f 3b 0a 0a *Tcl_OldStat_;..
3ba0: 2f 2a 0a 20 2a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d /*. *-----------
3bb0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
3bc0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
3bd0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
3be0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
3bf0: 2d 0a 20 2a 20 57 68 65 6e 20 61 20 54 43 4c 20 -. * When a TCL
3c00: 63 6f 6d 6d 61 6e 64 20 72 65 74 75 72 6e 73 2c command returns,
3c10: 20 74 68 65 20 69 6e 74 65 72 70 72 65 74 65 72 the interpreter
3c20: 20 63 6f 6e 74 61 69 6e 73 20 61 20 72 65 73 75 contains a resu
3c30: 6c 74 20 66 72 6f 6d 20 74 68 65 0a 20 2a 20 63 lt from the. * c
3c40: 6f 6d 6d 61 6e 64 2e 20 50 72 6f 67 72 61 6d 6d ommand. Programm
3c50: 65 72 73 20 61 72 65 20 73 74 72 6f 6e 67 6c 79 ers are strongly
3c60: 20 65 6e 63 6f 75 72 61 67 65 64 20 74 6f 20 75 encouraged to u
3c70: 73 65 20 6f 6e 65 20 6f 66 20 74 68 65 20 66 75 se one of the fu
3c80: 6e 63 74 69 6f 6e 73 0a 20 2a 20 54 63 6c 5f 47 nctions. * Tcl_G
3c90: 65 74 4f 62 6a 52 65 73 75 6c 74 28 29 20 6f 72 etObjResult() or
3ca0: 20 54 63 6c 5f 47 65 74 53 74 72 69 6e 67 52 65 Tcl_GetStringRe
3cb0: 73 75 6c 74 28 29 20 74 6f 20 72 65 61 64 20 74 sult() to read t
3cc0: 68 65 20 69 6e 74 65 72 70 72 65 74 65 72 27 73 he interpreter's
3cd0: 0a 20 2a 20 72 65 73 75 6c 74 2e 20 53 65 65 20 . * result. See
3ce0: 74 68 65 20 53 65 74 52 65 73 75 6c 74 20 6d 61 the SetResult ma
3cf0: 6e 20 70 61 67 65 20 66 6f 72 20 64 65 74 61 69 n page for detai
3d00: 6c 73 2e 20 42 65 73 69 64 65 73 20 74 68 69 73 ls. Besides this
3d10: 20 72 65 73 75 6c 74 2c 20 74 68 65 0a 20 2a 20 result, the. *
3d20: 63 6f 6d 6d 61 6e 64 20 66 75 6e 63 74 69 6f 6e command function
3d30: 20 72 65 74 75 72 6e 73 20 61 6e 20 69 6e 74 65 returns an inte
3d40: 67 65 72 20 63 6f 64 65 2c 20 77 68 69 63 68 20 ger code, which
3d50: 69 73 20 6f 6e 65 20 6f 66 20 74 68 65 20 66 6f is one of the fo
3d60: 6c 6c 6f 77 69 6e 67 3a 0a 20 2a 0a 20 2a 20 54 llowing:. *. * T
3d70: 43 4c 5f 4f 4b 09 09 43 6f 6d 6d 61 6e 64 20 63 CL_OK..Command c
3d80: 6f 6d 70 6c 65 74 65 64 20 6e 6f 72 6d 61 6c 6c ompleted normall
3d90: 79 3b 20 74 68 65 20 69 6e 74 65 72 70 72 65 74 y; the interpret
3da0: 65 72 27 73 20 72 65 73 75 6c 74 0a 20 2a 09 09 er's result. *..
3db0: 09 63 6f 6e 74 61 69 6e 73 20 74 68 65 20 63 6f .contains the co
3dc0: 6d 6d 61 6e 64 27 73 20 72 65 73 75 6c 74 2e 0a mmand's result..
3dd0: 20 2a 20 54 43 4c 5f 45 52 52 4f 52 09 09 54 68 * TCL_ERROR..Th
3de0: 65 20 63 6f 6d 6d 61 6e 64 20 63 6f 75 6c 64 6e e command couldn
3df0: 27 74 20 62 65 20 63 6f 6d 70 6c 65 74 65 64 20 't be completed
3e00: 73 75 63 63 65 73 73 66 75 6c 6c 79 3b 20 74 68 successfully; th
3e10: 65 0a 20 2a 09 09 09 69 6e 74 65 72 70 72 65 74 e. *...interpret
3e20: 65 72 27 73 20 72 65 73 75 6c 74 20 64 65 73 63 er's result desc
3e30: 72 69 62 65 73 20 77 68 61 74 20 77 65 6e 74 20 ribes what went
3e40: 77 72 6f 6e 67 2e 0a 20 2a 20 54 43 4c 5f 52 45 wrong.. * TCL_RE
3e50: 54 55 52 4e 09 09 54 68 65 20 63 6f 6d 6d 61 6e TURN..The comman
3e60: 64 20 72 65 71 75 65 73 74 73 20 74 68 61 74 20 d requests that
3e70: 74 68 65 20 63 75 72 72 65 6e 74 20 66 75 6e 63 the current func
3e80: 74 69 6f 6e 20 72 65 74 75 72 6e 3b 0a 20 2a 09 tion return;. *.
3e90: 09 09 74 68 65 20 69 6e 74 65 72 70 72 65 74 65 ..the interprete
3ea0: 72 27 73 20 72 65 73 75 6c 74 20 63 6f 6e 74 61 r's result conta
3eb0: 69 6e 73 20 74 68 65 20 66 75 6e 63 74 69 6f 6e ins the function
3ec0: 27 73 0a 20 2a 09 09 09 72 65 74 75 72 6e 20 76 's. *...return v
3ed0: 61 6c 75 65 2e 0a 20 2a 20 54 43 4c 5f 42 52 45 alue.. * TCL_BRE
3ee0: 41 4b 09 09 54 68 65 20 63 6f 6d 6d 61 6e 64 20 AK..The command
3ef0: 72 65 71 75 65 73 74 73 20 74 68 61 74 20 74 68 requests that th
3f00: 65 20 69 6e 6e 65 72 6d 6f 73 74 20 6c 6f 6f 70 e innermost loop
3f10: 20 62 65 0a 20 2a 09 09 09 65 78 69 74 65 64 3b be. *...exited;
3f20: 20 74 68 65 20 69 6e 74 65 72 70 72 65 74 65 72 the interpreter
3f30: 27 73 20 72 65 73 75 6c 74 20 69 73 20 6d 65 61 's result is mea
3f40: 6e 69 6e 67 6c 65 73 73 2e 0a 20 2a 20 54 43 4c ningless.. * TCL
3f50: 5f 43 4f 4e 54 49 4e 55 45 09 09 47 6f 20 6f 6e _CONTINUE..Go on
3f60: 20 74 6f 20 74 68 65 20 6e 65 78 74 20 69 74 65 to the next ite
3f70: 72 61 74 69 6f 6e 20 6f 66 20 74 68 65 20 63 75 ration of the cu
3f80: 72 72 65 6e 74 20 6c 6f 6f 70 3b 20 74 68 65 0a rrent loop; the.
3f90: 20 2a 09 09 09 69 6e 74 65 72 70 72 65 74 65 72 *...interpreter
3fa0: 27 73 20 72 65 73 75 6c 74 20 69 73 20 6d 65 61 's result is mea
3fb0: 6e 69 6e 67 6c 65 73 73 2e 0a 20 2a 2f 0a 0a 23 ningless.. */..#
3fc0: 64 65 66 69 6e 65 20 54 43 4c 5f 4f 4b 09 09 09 define TCL_OK...
3fd0: 30 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 45 52 0.#define TCL_ER
3fe0: 52 4f 52 09 09 31 0a 23 64 65 66 69 6e 65 20 54 ROR..1.#define T
3ff0: 43 4c 5f 52 45 54 55 52 4e 09 09 32 0a 23 64 65 CL_RETURN..2.#de
4000: 66 69 6e 65 20 54 43 4c 5f 42 52 45 41 4b 09 09 fine TCL_BREAK..
4010: 33 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 43 4f 3.#define TCL_CO
4020: 4e 54 49 4e 55 45 09 09 34 0a 0a 2f 2a 0a 20 2a NTINUE..4../*. *
4030: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
4040: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
4050: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
4060: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
4070: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 2a 20 ------------. *
4080: 46 6c 61 67 73 20 74 6f 20 63 6f 6e 74 72 6f 6c Flags to control
4090: 20 77 68 61 74 20 73 75 62 73 74 69 74 75 74 69 what substituti
40a0: 6f 6e 73 20 61 72 65 20 70 65 72 66 6f 72 6d 65 ons are performe
40b0: 64 20 62 79 20 54 63 6c 5f 53 75 62 73 74 4f 62 d by Tcl_SubstOb
40c0: 6a 28 29 3a 0a 20 2a 2f 0a 0a 23 64 65 66 69 6e j():. */..#defin
40d0: 65 20 54 43 4c 5f 53 55 42 53 54 5f 43 4f 4d 4d e TCL_SUBST_COMM
40e0: 41 4e 44 53 09 30 30 31 0a 23 64 65 66 69 6e 65 ANDS.001.#define
40f0: 20 54 43 4c 5f 53 55 42 53 54 5f 56 41 52 49 41 TCL_SUBST_VARIA
4100: 42 4c 45 53 09 30 30 32 0a 23 64 65 66 69 6e 65 BLES.002.#define
4110: 20 54 43 4c 5f 53 55 42 53 54 5f 42 41 43 4b 53 TCL_SUBST_BACKS
4120: 4c 41 53 48 45 53 09 30 30 34 0a 23 64 65 66 69 LASHES.004.#defi
4130: 6e 65 20 54 43 4c 5f 53 55 42 53 54 5f 41 4c 4c ne TCL_SUBST_ALL
4140: 09 09 30 30 37 0a 0a 2f 2a 0a 20 2a 20 46 6f 72 ..007../*. * For
4150: 77 61 72 64 20 64 65 63 6c 61 72 61 74 69 6f 6e ward declaration
4160: 20 6f 66 20 54 63 6c 5f 4f 62 6a 20 74 6f 20 70 of Tcl_Obj to p
4170: 72 65 76 65 6e 74 20 61 6e 20 65 72 72 6f 72 20 revent an error
4180: 77 68 65 6e 20 74 68 65 20 66 6f 72 77 61 72 64 when the forward
4190: 0a 20 2a 20 72 65 66 65 72 65 6e 63 65 20 74 6f . * reference to
41a0: 20 54 63 6c 5f 4f 62 6a 20 69 73 20 65 6e 63 6f Tcl_Obj is enco
41b0: 75 6e 74 65 72 65 64 20 69 6e 20 74 68 65 20 66 untered in the f
41c0: 75 6e 63 74 69 6f 6e 20 74 79 70 65 73 20 64 65 unction types de
41d0: 63 6c 61 72 65 64 20 62 65 6c 6f 77 2e 0a 20 2a clared below.. *
41e0: 2f 0a 0a 73 74 72 75 63 74 20 54 63 6c 5f 4f 62 /..struct Tcl_Ob
41f0: 6a 3b 0a 0a 2f 2a 0a 20 2a 2d 2d 2d 2d 2d 2d 2d j;../*. *-------
4200: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
4210: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
4220: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
4230: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
4240: 2d 2d 2d 2d 2d 0a 20 2a 20 46 75 6e 63 74 69 6f -----. * Functio
4250: 6e 20 74 79 70 65 73 20 64 65 66 69 6e 65 64 20 n types defined
4260: 62 79 20 54 63 6c 3a 0a 20 2a 2f 0a 0a 74 79 70 by Tcl:. */..typ
4270: 65 64 65 66 20 69 6e 74 20 28 54 63 6c 5f 41 70 edef int (Tcl_Ap
4280: 70 49 6e 69 74 50 72 6f 63 29 20 28 54 63 6c 5f pInitProc) (Tcl_
4290: 49 6e 74 65 72 70 20 2a 69 6e 74 65 72 70 29 3b Interp *interp);
42a0: 0a 74 79 70 65 64 65 66 20 69 6e 74 20 28 54 63 .typedef int (Tc
42b0: 6c 5f 41 73 79 6e 63 50 72 6f 63 29 20 28 76 6f l_AsyncProc) (vo
42c0: 69 64 20 2a 63 6c 69 65 6e 74 44 61 74 61 2c 20 id *clientData,
42d0: 54 63 6c 5f 49 6e 74 65 72 70 20 2a 69 6e 74 65 Tcl_Interp *inte
42e0: 72 70 2c 0a 09 69 6e 74 20 63 6f 64 65 29 3b 0a rp,..int code);.
42f0: 74 79 70 65 64 65 66 20 76 6f 69 64 20 28 54 63 typedef void (Tc
4300: 6c 5f 43 68 61 6e 6e 65 6c 50 72 6f 63 29 20 28 l_ChannelProc) (
4310: 76 6f 69 64 20 2a 63 6c 69 65 6e 74 44 61 74 61 void *clientData
4320: 2c 20 69 6e 74 20 6d 61 73 6b 29 3b 0a 74 79 70 , int mask);.typ
4330: 65 64 65 66 20 76 6f 69 64 20 28 54 63 6c 5f 43 edef void (Tcl_C
4340: 6c 6f 73 65 50 72 6f 63 29 20 28 76 6f 69 64 20 loseProc) (void
4350: 2a 64 61 74 61 29 3b 0a 74 79 70 65 64 65 66 20 *data);.typedef
4360: 76 6f 69 64 20 28 54 63 6c 5f 43 6d 64 44 65 6c void (Tcl_CmdDel
4370: 65 74 65 50 72 6f 63 29 20 28 76 6f 69 64 20 2a eteProc) (void *
4380: 63 6c 69 65 6e 74 44 61 74 61 29 3b 0a 74 79 70 clientData);.typ
4390: 65 64 65 66 20 69 6e 74 20 28 54 63 6c 5f 43 6d edef int (Tcl_Cm
43a0: 64 50 72 6f 63 29 20 28 76 6f 69 64 20 2a 63 6c dProc) (void *cl
43b0: 69 65 6e 74 44 61 74 61 2c 20 54 63 6c 5f 49 6e ientData, Tcl_In
43c0: 74 65 72 70 20 2a 69 6e 74 65 72 70 2c 0a 09 69 terp *interp,..i
43d0: 6e 74 20 61 72 67 63 2c 20 63 6f 6e 73 74 20 63 nt argc, const c
43e0: 68 61 72 20 2a 61 72 67 76 5b 5d 29 3b 0a 74 79 har *argv[]);.ty
43f0: 70 65 64 65 66 20 76 6f 69 64 20 28 54 63 6c 5f pedef void (Tcl_
4400: 43 6d 64 54 72 61 63 65 50 72 6f 63 29 20 28 76 CmdTraceProc) (v
4410: 6f 69 64 20 2a 63 6c 69 65 6e 74 44 61 74 61 2c oid *clientData,
4420: 20 54 63 6c 5f 49 6e 74 65 72 70 20 2a 69 6e 74 Tcl_Interp *int
4430: 65 72 70 2c 0a 09 69 6e 74 20 6c 65 76 65 6c 2c erp,..int level,
4440: 20 63 68 61 72 20 2a 63 6f 6d 6d 61 6e 64 2c 20 char *command,
4450: 54 63 6c 5f 43 6d 64 50 72 6f 63 20 2a 70 72 6f Tcl_CmdProc *pro
4460: 63 2c 0a 09 76 6f 69 64 20 2a 63 6d 64 43 6c 69 c,..void *cmdCli
4470: 65 6e 74 44 61 74 61 2c 20 69 6e 74 20 61 72 67 entData, int arg
4480: 63 2c 20 63 6f 6e 73 74 20 63 68 61 72 20 2a 61 c, const char *a
4490: 72 67 76 5b 5d 29 3b 0a 74 79 70 65 64 65 66 20 rgv[]);.typedef
44a0: 69 6e 74 20 28 54 63 6c 5f 43 6d 64 4f 62 6a 54 int (Tcl_CmdObjT
44b0: 72 61 63 65 50 72 6f 63 29 20 28 76 6f 69 64 20 raceProc) (void
44c0: 2a 63 6c 69 65 6e 74 44 61 74 61 2c 20 54 63 6c *clientData, Tcl
44d0: 5f 49 6e 74 65 72 70 20 2a 69 6e 74 65 72 70 2c _Interp *interp,
44e0: 0a 09 69 6e 74 20 6c 65 76 65 6c 2c 20 63 6f 6e ..int level, con
44f0: 73 74 20 63 68 61 72 20 2a 63 6f 6d 6d 61 6e 64 st char *command
4500: 2c 20 54 63 6c 5f 43 6f 6d 6d 61 6e 64 20 63 6f , Tcl_Command co
4510: 6d 6d 61 6e 64 49 6e 66 6f 2c 20 69 6e 74 20 6f mmandInfo, int o
4520: 62 6a 63 2c 0a 09 73 74 72 75 63 74 20 54 63 6c bjc,..struct Tcl
4530: 5f 4f 62 6a 20 2a 63 6f 6e 73 74 20 2a 6f 62 6a _Obj *const *obj
4540: 76 29 3b 0a 74 79 70 65 64 65 66 20 76 6f 69 64 v);.typedef void
4550: 20 28 54 63 6c 5f 43 6d 64 4f 62 6a 54 72 61 63 (Tcl_CmdObjTrac
4560: 65 44 65 6c 65 74 65 50 72 6f 63 29 20 28 76 6f eDeleteProc) (vo
4570: 69 64 20 2a 63 6c 69 65 6e 74 44 61 74 61 29 3b id *clientData);
4580: 0a 74 79 70 65 64 65 66 20 76 6f 69 64 20 28 54 .typedef void (T
4590: 63 6c 5f 44 75 70 49 6e 74 65 72 6e 61 6c 52 65 cl_DupInternalRe
45a0: 70 50 72 6f 63 29 20 28 73 74 72 75 63 74 20 54 pProc) (struct T
45b0: 63 6c 5f 4f 62 6a 20 2a 73 72 63 50 74 72 2c 0a cl_Obj *srcPtr,.
45c0: 09 73 74 72 75 63 74 20 54 63 6c 5f 4f 62 6a 20 .struct Tcl_Obj
45d0: 2a 64 75 70 50 74 72 29 3b 0a 74 79 70 65 64 65 *dupPtr);.typede
45e0: 66 20 69 6e 74 20 28 54 63 6c 5f 45 6e 63 6f 64 f int (Tcl_Encod
45f0: 69 6e 67 43 6f 6e 76 65 72 74 50 72 6f 63 29 20 ingConvertProc)
4600: 28 76 6f 69 64 20 2a 63 6c 69 65 6e 74 44 61 74 (void *clientDat
4610: 61 2c 20 63 6f 6e 73 74 20 63 68 61 72 20 2a 73 a, const char *s
4620: 72 63 2c 0a 09 69 6e 74 20 73 72 63 4c 65 6e 2c rc,..int srcLen,
4630: 20 69 6e 74 20 66 6c 61 67 73 2c 20 54 63 6c 5f int flags, Tcl_
4640: 45 6e 63 6f 64 69 6e 67 53 74 61 74 65 20 2a 73 EncodingState *s
4650: 74 61 74 65 50 74 72 2c 20 63 68 61 72 20 2a 64 tatePtr, char *d
4660: 73 74 2c 0a 09 69 6e 74 20 64 73 74 4c 65 6e 2c st,..int dstLen,
4670: 20 69 6e 74 20 2a 73 72 63 52 65 61 64 50 74 72 int *srcReadPtr
4680: 2c 20 69 6e 74 20 2a 64 73 74 57 72 6f 74 65 50 , int *dstWroteP
4690: 74 72 2c 20 69 6e 74 20 2a 64 73 74 43 68 61 72 tr, int *dstChar
46a0: 73 50 74 72 29 3b 0a 23 64 65 66 69 6e 65 20 54 sPtr);.#define T
46b0: 63 6c 5f 45 6e 63 6f 64 69 6e 67 46 72 65 65 50 cl_EncodingFreeP
46c0: 72 6f 63 20 54 63 6c 5f 46 72 65 65 50 72 6f 63 roc Tcl_FreeProc
46d0: 0a 74 79 70 65 64 65 66 20 69 6e 74 20 28 54 63 .typedef int (Tc
46e0: 6c 5f 45 76 65 6e 74 50 72 6f 63 29 20 28 54 63 l_EventProc) (Tc
46f0: 6c 5f 45 76 65 6e 74 20 2a 65 76 50 74 72 2c 20 l_Event *evPtr,
4700: 69 6e 74 20 66 6c 61 67 73 29 3b 0a 74 79 70 65 int flags);.type
4710: 64 65 66 20 76 6f 69 64 20 28 54 63 6c 5f 45 76 def void (Tcl_Ev
4720: 65 6e 74 43 68 65 63 6b 50 72 6f 63 29 20 28 76 entCheckProc) (v
4730: 6f 69 64 20 2a 63 6c 69 65 6e 74 44 61 74 61 2c oid *clientData,
4740: 20 69 6e 74 20 66 6c 61 67 73 29 3b 0a 74 79 70 int flags);.typ
4750: 65 64 65 66 20 69 6e 74 20 28 54 63 6c 5f 45 76 edef int (Tcl_Ev
4760: 65 6e 74 44 65 6c 65 74 65 50 72 6f 63 29 20 28 entDeleteProc) (
4770: 54 63 6c 5f 45 76 65 6e 74 20 2a 65 76 50 74 72 Tcl_Event *evPtr
4780: 2c 20 76 6f 69 64 20 2a 63 6c 69 65 6e 74 44 61 , void *clientDa
4790: 74 61 29 3b 0a 74 79 70 65 64 65 66 20 76 6f 69 ta);.typedef voi
47a0: 64 20 28 54 63 6c 5f 45 76 65 6e 74 53 65 74 75 d (Tcl_EventSetu
47b0: 70 50 72 6f 63 29 20 28 76 6f 69 64 20 2a 63 6c pProc) (void *cl
47c0: 69 65 6e 74 44 61 74 61 2c 20 69 6e 74 20 66 6c ientData, int fl
47d0: 61 67 73 29 3b 0a 23 64 65 66 69 6e 65 20 54 63 ags);.#define Tc
47e0: 6c 5f 45 78 69 74 50 72 6f 63 20 54 63 6c 5f 46 l_ExitProc Tcl_F
47f0: 72 65 65 50 72 6f 63 0a 74 79 70 65 64 65 66 20 reeProc.typedef
4800: 76 6f 69 64 20 28 54 63 6c 5f 46 69 6c 65 50 72 void (Tcl_FilePr
4810: 6f 63 29 20 28 76 6f 69 64 20 2a 63 6c 69 65 6e oc) (void *clien
4820: 74 44 61 74 61 2c 20 69 6e 74 20 6d 61 73 6b 29 tData, int mask)
4830: 3b 0a 23 64 65 66 69 6e 65 20 54 63 6c 5f 46 69 ;.#define Tcl_Fi
4840: 6c 65 46 72 65 65 50 72 6f 63 20 54 63 6c 5f 46 leFreeProc Tcl_F
4850: 72 65 65 50 72 6f 63 0a 74 79 70 65 64 65 66 20 reeProc.typedef
4860: 76 6f 69 64 20 28 54 63 6c 5f 46 72 65 65 49 6e void (Tcl_FreeIn
4870: 74 65 72 6e 61 6c 52 65 70 50 72 6f 63 29 20 28 ternalRepProc) (
4880: 73 74 72 75 63 74 20 54 63 6c 5f 4f 62 6a 20 2a struct Tcl_Obj *
4890: 6f 62 6a 50 74 72 29 3b 0a 74 79 70 65 64 65 66 objPtr);.typedef
48a0: 20 76 6f 69 64 20 28 54 63 6c 5f 46 72 65 65 50 void (Tcl_FreeP
48b0: 72 6f 63 29 20 28 76 6f 69 64 20 2a 62 6c 6f 63 roc) (void *bloc
48c0: 6b 50 74 72 29 3b 0a 74 79 70 65 64 65 66 20 76 kPtr);.typedef v
48d0: 6f 69 64 20 28 54 63 6c 5f 49 64 6c 65 50 72 6f oid (Tcl_IdlePro
48e0: 63 29 20 28 76 6f 69 64 20 2a 63 6c 69 65 6e 74 c) (void *client
48f0: 44 61 74 61 29 3b 0a 74 79 70 65 64 65 66 20 76 Data);.typedef v
4900: 6f 69 64 20 28 54 63 6c 5f 49 6e 74 65 72 70 44 oid (Tcl_InterpD
4910: 65 6c 65 74 65 50 72 6f 63 29 20 28 76 6f 69 64 eleteProc) (void
4920: 20 2a 63 6c 69 65 6e 74 44 61 74 61 2c 0a 09 54 *clientData,..T
4930: 63 6c 5f 49 6e 74 65 72 70 20 2a 69 6e 74 65 72 cl_Interp *inter
4940: 70 29 3b 0a 74 79 70 65 64 65 66 20 76 6f 69 64 p);.typedef void
4950: 20 28 54 63 6c 5f 4e 61 6d 65 73 70 61 63 65 44 (Tcl_NamespaceD
4960: 65 6c 65 74 65 50 72 6f 63 29 20 28 76 6f 69 64 eleteProc) (void
4970: 20 2a 63 6c 69 65 6e 74 44 61 74 61 29 3b 0a 74 *clientData);.t
4980: 79 70 65 64 65 66 20 69 6e 74 20 28 54 63 6c 5f ypedef int (Tcl_
4990: 4f 62 6a 43 6d 64 50 72 6f 63 29 20 28 76 6f 69 ObjCmdProc) (voi
49a0: 64 20 2a 63 6c 69 65 6e 74 44 61 74 61 2c 20 54 d *clientData, T
49b0: 63 6c 5f 49 6e 74 65 72 70 20 2a 69 6e 74 65 72 cl_Interp *inter
49c0: 70 2c 0a 09 69 6e 74 20 6f 62 6a 63 2c 20 73 74 p,..int objc, st
49d0: 72 75 63 74 20 54 63 6c 5f 4f 62 6a 20 2a 63 6f ruct Tcl_Obj *co
49e0: 6e 73 74 20 2a 6f 62 6a 76 29 3b 0a 74 79 70 65 nst *objv);.type
49f0: 64 65 66 20 69 6e 74 20 28 54 63 6c 5f 50 61 63 def int (Tcl_Pac
4a00: 6b 61 67 65 49 6e 69 74 50 72 6f 63 29 20 28 54 kageInitProc) (T
4a10: 63 6c 5f 49 6e 74 65 72 70 20 2a 69 6e 74 65 72 cl_Interp *inter
4a20: 70 29 3b 0a 74 79 70 65 64 65 66 20 69 6e 74 20 p);.typedef int
4a30: 28 54 63 6c 5f 50 61 63 6b 61 67 65 55 6e 6c 6f (Tcl_PackageUnlo
4a40: 61 64 50 72 6f 63 29 20 28 54 63 6c 5f 49 6e 74 adProc) (Tcl_Int
4a50: 65 72 70 20 2a 69 6e 74 65 72 70 2c 20 69 6e 74 erp *interp, int
4a60: 20 66 6c 61 67 73 29 3b 0a 74 79 70 65 64 65 66 flags);.typedef
4a70: 20 76 6f 69 64 20 28 54 63 6c 5f 50 61 6e 69 63 void (Tcl_Panic
4a80: 50 72 6f 63 29 20 28 63 6f 6e 73 74 20 63 68 61 Proc) (const cha
4a90: 72 20 2a 66 6f 72 6d 61 74 2c 20 2e 2e 2e 29 3b r *format, ...);
4aa0: 0a 74 79 70 65 64 65 66 20 76 6f 69 64 20 28 54 .typedef void (T
4ab0: 63 6c 5f 54 63 70 41 63 63 65 70 74 50 72 6f 63 cl_TcpAcceptProc
4ac0: 29 20 28 76 6f 69 64 20 2a 63 61 6c 6c 62 61 63 ) (void *callbac
4ad0: 6b 44 61 74 61 2c 20 54 63 6c 5f 43 68 61 6e 6e kData, Tcl_Chann
4ae0: 65 6c 20 63 68 61 6e 2c 0a 09 63 68 61 72 20 2a el chan,..char *
4af0: 61 64 64 72 65 73 73 2c 20 69 6e 74 20 70 6f 72 address, int por
4b00: 74 29 3b 0a 74 79 70 65 64 65 66 20 76 6f 69 64 t);.typedef void
4b10: 20 28 54 63 6c 5f 54 69 6d 65 72 50 72 6f 63 29 (Tcl_TimerProc)
4b20: 20 28 76 6f 69 64 20 2a 63 6c 69 65 6e 74 44 61 (void *clientDa
4b30: 74 61 29 3b 0a 74 79 70 65 64 65 66 20 69 6e 74 ta);.typedef int
4b40: 20 28 54 63 6c 5f 53 65 74 46 72 6f 6d 41 6e 79 (Tcl_SetFromAny
4b50: 50 72 6f 63 29 20 28 54 63 6c 5f 49 6e 74 65 72 Proc) (Tcl_Inter
4b60: 70 20 2a 69 6e 74 65 72 70 2c 20 73 74 72 75 63 p *interp, struc
4b70: 74 20 54 63 6c 5f 4f 62 6a 20 2a 6f 62 6a 50 74 t Tcl_Obj *objPt
4b80: 72 29 3b 0a 74 79 70 65 64 65 66 20 76 6f 69 64 r);.typedef void
4b90: 20 28 54 63 6c 5f 55 70 64 61 74 65 53 74 72 69 (Tcl_UpdateStri
4ba0: 6e 67 50 72 6f 63 29 20 28 73 74 72 75 63 74 20 ngProc) (struct
4bb0: 54 63 6c 5f 4f 62 6a 20 2a 6f 62 6a 50 74 72 29 Tcl_Obj *objPtr)
4bc0: 3b 0a 74 79 70 65 64 65 66 20 63 68 61 72 20 2a ;.typedef char *
4bd0: 20 28 54 63 6c 5f 56 61 72 54 72 61 63 65 50 72 (Tcl_VarTracePr
4be0: 6f 63 29 20 28 76 6f 69 64 20 2a 63 6c 69 65 6e oc) (void *clien
4bf0: 74 44 61 74 61 2c 20 54 63 6c 5f 49 6e 74 65 72 tData, Tcl_Inter
4c00: 70 20 2a 69 6e 74 65 72 70 2c 0a 09 63 6f 6e 73 p *interp,..cons
4c10: 74 20 63 68 61 72 20 2a 70 61 72 74 31 2c 20 63 t char *part1, c
4c20: 6f 6e 73 74 20 63 68 61 72 20 2a 70 61 72 74 32 onst char *part2
4c30: 2c 20 69 6e 74 20 66 6c 61 67 73 29 3b 0a 74 79 , int flags);.ty
4c40: 70 65 64 65 66 20 76 6f 69 64 20 28 54 63 6c 5f pedef void (Tcl_
4c50: 43 6f 6d 6d 61 6e 64 54 72 61 63 65 50 72 6f 63 CommandTraceProc
4c60: 29 20 28 76 6f 69 64 20 2a 63 6c 69 65 6e 74 44 ) (void *clientD
4c70: 61 74 61 2c 20 54 63 6c 5f 49 6e 74 65 72 70 20 ata, Tcl_Interp
4c80: 2a 69 6e 74 65 72 70 2c 0a 09 63 6f 6e 73 74 20 *interp,..const
4c90: 63 68 61 72 20 2a 6f 6c 64 4e 61 6d 65 2c 20 63 char *oldName, c
4ca0: 6f 6e 73 74 20 63 68 61 72 20 2a 6e 65 77 4e 61 onst char *newNa
4cb0: 6d 65 2c 20 69 6e 74 20 66 6c 61 67 73 29 3b 0a me, int flags);.
4cc0: 74 79 70 65 64 65 66 20 76 6f 69 64 20 28 54 63 typedef void (Tc
4cd0: 6c 5f 43 72 65 61 74 65 46 69 6c 65 48 61 6e 64 l_CreateFileHand
4ce0: 6c 65 72 50 72 6f 63 29 20 28 69 6e 74 20 66 64 lerProc) (int fd
4cf0: 2c 20 69 6e 74 20 6d 61 73 6b 2c 20 54 63 6c 5f , int mask, Tcl_
4d00: 46 69 6c 65 50 72 6f 63 20 2a 70 72 6f 63 2c 0a FileProc *proc,.
4d10: 09 76 6f 69 64 20 2a 63 6c 69 65 6e 74 44 61 74 .void *clientDat
4d20: 61 29 3b 0a 74 79 70 65 64 65 66 20 76 6f 69 64 a);.typedef void
4d30: 20 28 54 63 6c 5f 44 65 6c 65 74 65 46 69 6c 65 (Tcl_DeleteFile
4d40: 48 61 6e 64 6c 65 72 50 72 6f 63 29 20 28 69 6e HandlerProc) (in
4d50: 74 20 66 64 29 3b 0a 74 79 70 65 64 65 66 20 76 t fd);.typedef v
4d60: 6f 69 64 20 28 54 63 6c 5f 41 6c 65 72 74 4e 6f oid (Tcl_AlertNo
4d70: 74 69 66 69 65 72 50 72 6f 63 29 20 28 76 6f 69 tifierProc) (voi
4d80: 64 20 2a 63 6c 69 65 6e 74 44 61 74 61 29 3b 0a d *clientData);.
4d90: 74 79 70 65 64 65 66 20 76 6f 69 64 20 28 54 63 typedef void (Tc
4da0: 6c 5f 53 65 72 76 69 63 65 4d 6f 64 65 48 6f 6f l_ServiceModeHoo
4db0: 6b 50 72 6f 63 29 20 28 69 6e 74 20 6d 6f 64 65 kProc) (int mode
4dc0: 29 3b 0a 74 79 70 65 64 65 66 20 76 6f 69 64 20 );.typedef void
4dd0: 2a 28 54 63 6c 5f 49 6e 69 74 4e 6f 74 69 66 69 *(Tcl_InitNotifi
4de0: 65 72 50 72 6f 63 29 20 28 76 6f 69 64 29 3b 0a erProc) (void);.
4df0: 74 79 70 65 64 65 66 20 76 6f 69 64 20 28 54 63 typedef void (Tc
4e00: 6c 5f 46 69 6e 61 6c 69 7a 65 4e 6f 74 69 66 69 l_FinalizeNotifi
4e10: 65 72 50 72 6f 63 29 20 28 76 6f 69 64 20 2a 63 erProc) (void *c
4e20: 6c 69 65 6e 74 44 61 74 61 29 3b 0a 74 79 70 65 lientData);.type
4e30: 64 65 66 20 76 6f 69 64 20 28 54 63 6c 5f 4d 61 def void (Tcl_Ma
4e40: 69 6e 4c 6f 6f 70 50 72 6f 63 29 20 28 76 6f 69 inLoopProc) (voi
4e50: 64 29 3b 0a 0c 0a 2f 2a 0a 20 2a 2d 2d 2d 2d 2d d);.../*. *-----
4e60: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
4e70: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
4e80: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
4e90: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
4ea0: 2d 2d 2d 2d 2d 2d 2d 0a 20 2a 20 54 68 65 20 66 -------. * The f
4eb0: 6f 6c 6c 6f 77 69 6e 67 20 73 74 72 75 63 74 75 ollowing structu
4ec0: 72 65 20 72 65 70 72 65 73 65 6e 74 73 20 61 20 re represents a
4ed0: 74 79 70 65 20 6f 66 20 6f 62 6a 65 63 74 2c 20 type of object,
4ee0: 77 68 69 63 68 20 69 73 20 61 20 70 61 72 74 69 which is a parti
4ef0: 63 75 6c 61 72 0a 20 2a 20 69 6e 74 65 72 6e 61 cular. * interna
4f00: 6c 20 72 65 70 72 65 73 65 6e 74 61 74 69 6f 6e l representation
4f10: 20 66 6f 72 20 61 6e 20 6f 62 6a 65 63 74 20 70 for an object p
4f20: 6c 75 73 20 61 20 73 65 74 20 6f 66 20 66 75 6e lus a set of fun
4f30: 63 74 69 6f 6e 73 20 74 68 61 74 20 70 72 6f 76 ctions that prov
4f40: 69 64 65 0a 20 2a 20 73 74 61 6e 64 61 72 64 20 ide. * standard
4f50: 6f 70 65 72 61 74 69 6f 6e 73 20 6f 6e 20 6f 62 operations on ob
4f60: 6a 65 63 74 73 20 6f 66 20 74 68 61 74 20 74 79 jects of that ty
4f70: 70 65 2e 0a 20 2a 2f 0a 0a 74 79 70 65 64 65 66 pe.. */..typedef
4f80: 20 73 74 72 75 63 74 20 54 63 6c 5f 4f 62 6a 54 struct Tcl_ObjT
4f90: 79 70 65 20 7b 0a 20 20 20 20 63 6f 6e 73 74 20 ype {. const
4fa0: 63 68 61 72 20 2a 6e 61 6d 65 3b 09 09 2f 2a 20 char *name;../*
4fb0: 4e 61 6d 65 20 6f 66 20 74 68 65 20 74 79 70 65 Name of the type
4fc0: 2c 20 65 2e 67 2e 20 22 69 6e 74 22 2e 20 2a 2f , e.g. "int". */
4fd0: 0a 20 20 20 20 54 63 6c 5f 46 72 65 65 49 6e 74 . Tcl_FreeInt
4fe0: 65 72 6e 61 6c 52 65 70 50 72 6f 63 20 2a 66 72 ernalRepProc *fr
4ff0: 65 65 49 6e 74 52 65 70 50 72 6f 63 3b 0a 09 09 eeIntRepProc;...
5000: 09 09 2f 2a 20 43 61 6c 6c 65 64 20 74 6f 20 66 ../* Called to f
5010: 72 65 65 20 61 6e 79 20 73 74 6f 72 61 67 65 20 ree any storage
5020: 66 6f 72 20 74 68 65 20 74 79 70 65 27 73 0a 09 for the type's..
5030: 09 09 09 20 2a 20 69 6e 74 65 72 6e 61 6c 20 72 ... * internal r
5040: 65 70 2e 20 4e 55 4c 4c 20 69 66 20 74 68 65 20 ep. NULL if the
5050: 69 6e 74 65 72 6e 61 6c 20 72 65 70 20 64 6f 65 internal rep doe
5060: 73 0a 09 09 09 09 20 2a 20 6e 6f 74 20 6e 65 65 s..... * not nee
5070: 64 20 66 72 65 65 69 6e 67 2e 20 2a 2f 0a 20 20 d freeing. */.
5080: 20 20 54 63 6c 5f 44 75 70 49 6e 74 65 72 6e 61 Tcl_DupInterna
5090: 6c 52 65 70 50 72 6f 63 20 2a 64 75 70 49 6e 74 lRepProc *dupInt
50a0: 52 65 70 50 72 6f 63 3b 0a 09 09 09 09 2f 2a 20 RepProc;...../*
50b0: 43 61 6c 6c 65 64 20 74 6f 20 63 72 65 61 74 65 Called to create
50c0: 20 61 20 6e 65 77 20 6f 62 6a 65 63 74 20 61 73 a new object as
50d0: 20 61 20 63 6f 70 79 20 6f 66 0a 09 09 09 09 20 a copy of.....
50e0: 2a 20 61 6e 20 65 78 69 73 74 69 6e 67 20 6f 62 * an existing ob
50f0: 6a 65 63 74 2e 20 2a 2f 0a 20 20 20 20 54 63 6c ject. */. Tcl
5100: 5f 55 70 64 61 74 65 53 74 72 69 6e 67 50 72 6f _UpdateStringPro
5110: 63 20 2a 75 70 64 61 74 65 53 74 72 69 6e 67 50 c *updateStringP
5120: 72 6f 63 3b 0a 09 09 09 09 2f 2a 20 43 61 6c 6c roc;...../* Call
5130: 65 64 20 74 6f 20 75 70 64 61 74 65 20 74 68 65 ed to update the
5140: 20 73 74 72 69 6e 67 20 72 65 70 20 66 72 6f 6d string rep from
5150: 20 74 68 65 0a 09 09 09 09 20 2a 20 74 79 70 65 the..... * type
5160: 27 73 20 69 6e 74 65 72 6e 61 6c 20 72 65 70 72 's internal repr
5170: 65 73 65 6e 74 61 74 69 6f 6e 2e 20 2a 2f 0a 20 esentation. */.
5180: 20 20 20 54 63 6c 5f 53 65 74 46 72 6f 6d 41 6e Tcl_SetFromAn
5190: 79 50 72 6f 63 20 2a 73 65 74 46 72 6f 6d 41 6e yProc *setFromAn
51a0: 79 50 72 6f 63 3b 0a 09 09 09 09 2f 2a 20 43 61 yProc;...../* Ca
51b0: 6c 6c 65 64 20 74 6f 20 63 6f 6e 76 65 72 74 20 lled to convert
51c0: 74 68 65 20 6f 62 6a 65 63 74 27 73 20 69 6e 74 the object's int
51d0: 65 72 6e 61 6c 20 72 65 70 0a 09 09 09 09 20 2a ernal rep..... *
51e0: 20 74 6f 20 74 68 69 73 20 74 79 70 65 2e 20 46 to this type. F
51f0: 72 65 65 73 20 74 68 65 20 69 6e 74 65 72 6e 61 rees the interna
5200: 6c 20 72 65 70 20 6f 66 20 74 68 65 0a 09 09 09 l rep of the....
5210: 09 20 2a 20 6f 6c 64 20 74 79 70 65 2e 20 52 65 . * old type. Re
5220: 74 75 72 6e 73 20 54 43 4c 5f 45 52 52 4f 52 20 turns TCL_ERROR
5230: 6f 6e 20 66 61 69 6c 75 72 65 2e 20 2a 2f 0a 7d on failure. */.}
5240: 20 54 63 6c 5f 4f 62 6a 54 79 70 65 3b 0a 0a 2f Tcl_ObjType;../
5250: 2a 0a 20 2a 20 54 68 65 20 66 6f 6c 6c 6f 77 69 *. * The followi
5260: 6e 67 20 73 74 72 75 63 74 75 72 65 20 73 74 6f ng structure sto
5270: 72 65 73 20 61 6e 20 69 6e 74 65 72 6e 61 6c 20 res an internal
5280: 72 65 70 72 65 73 65 6e 74 61 74 69 6f 6e 20 28 representation (
5290: 69 6e 74 72 65 70 29 20 66 6f 72 0a 20 2a 20 61 intrep) for. * a
52a0: 20 54 63 6c 20 76 61 6c 75 65 2e 20 41 6e 20 69 Tcl value. An i
52b0: 6e 74 72 65 70 20 69 73 20 61 73 73 6f 63 69 61 ntrep is associa
52c0: 74 65 64 20 77 69 74 68 20 61 6e 20 54 63 6c 5f ted with an Tcl_
52d0: 4f 62 6a 54 79 70 65 20 77 68 65 6e 20 62 6f 74 ObjType when bot
52e0: 68 0a 20 2a 20 61 72 65 20 73 74 6f 72 65 64 20 h. * are stored
52f0: 69 6e 20 74 68 65 20 73 61 6d 65 20 54 63 6c 5f in the same Tcl_
5300: 4f 62 6a 2e 20 20 54 68 65 20 72 6f 75 74 69 6e Obj. The routin
5310: 65 73 20 6f 66 20 74 68 65 20 54 63 6c 5f 4f 62 es of the Tcl_Ob
5320: 6a 54 79 70 65 20 67 6f 76 65 72 6e 0a 20 2a 20 jType govern. *
5330: 74 68 65 20 68 61 6e 64 6c 69 6e 67 20 6f 66 20 the handling of
5340: 74 68 65 20 69 6e 74 72 65 70 2e 0a 20 2a 2f 0a the intrep.. */.
5350: 0a 74 79 70 65 64 65 66 20 75 6e 69 6f 6e 20 54 .typedef union T
5360: 63 6c 5f 4f 62 6a 49 6e 74 52 65 70 20 7b 09 2f cl_ObjIntRep {./
5370: 2a 20 54 68 65 20 69 6e 74 65 72 6e 61 6c 20 72 * The internal r
5380: 65 70 72 65 73 65 6e 74 61 74 69 6f 6e 3a 20 2a epresentation: *
5390: 2f 0a 20 20 20 20 6c 6f 6e 67 20 6c 6f 6e 67 56 /. long longV
53a0: 61 6c 75 65 3b 09 09 2f 2a 20 20 20 2d 20 61 6e alue;../* - an
53b0: 20 6c 6f 6e 67 20 69 6e 74 65 67 65 72 20 76 61 long integer va
53c0: 6c 75 65 2e 20 2a 2f 0a 20 20 20 20 64 6f 75 62 lue. */. doub
53d0: 6c 65 20 64 6f 75 62 6c 65 56 61 6c 75 65 3b 09 le doubleValue;.
53e0: 09 2f 2a 20 20 20 2d 20 61 20 64 6f 75 62 6c 65 ./* - a double
53f0: 2d 70 72 65 63 69 73 69 6f 6e 20 66 6c 6f 61 74 -precision float
5400: 69 6e 67 20 76 61 6c 75 65 2e 20 2a 2f 0a 20 20 ing value. */.
5410: 20 20 76 6f 69 64 20 2a 6f 74 68 65 72 56 61 6c void *otherVal
5420: 75 65 50 74 72 3b 09 2f 2a 20 20 20 2d 20 61 6e uePtr;./* - an
5430: 6f 74 68 65 72 2c 20 74 79 70 65 2d 73 70 65 63 other, type-spec
5440: 69 66 69 63 20 76 61 6c 75 65 2c 20 2a 2f 0a 09 ific value, */..
5450: 09 09 09 2f 2a 20 20 20 20 20 6e 6f 74 20 75 73 .../* not us
5460: 65 64 20 69 6e 74 65 72 6e 61 6c 6c 79 20 61 6e ed internally an
5470: 79 20 6d 6f 72 65 2e 20 2a 2f 0a 20 20 20 20 54 y more. */. T
5480: 63 6c 5f 57 69 64 65 49 6e 74 20 77 69 64 65 56 cl_WideInt wideV
5490: 61 6c 75 65 3b 09 2f 2a 20 20 20 2d 20 61 6e 20 alue;./* - an
54a0: 69 6e 74 65 67 65 72 20 76 61 6c 75 65 20 3e 3d integer value >=
54b0: 20 36 34 62 69 74 73 20 2a 2f 0a 20 20 20 20 73 64bits */. s
54c0: 74 72 75 63 74 20 7b 09 09 09 2f 2a 20 20 20 2d truct {.../* -
54d0: 20 69 6e 74 65 72 6e 61 6c 20 72 65 70 20 61 73 internal rep as
54e0: 20 74 77 6f 20 70 6f 69 6e 74 65 72 73 2e 20 2a two pointers. *
54f0: 2f 0a 09 76 6f 69 64 20 2a 70 74 72 31 3b 0a 09 /..void *ptr1;..
5500: 76 6f 69 64 20 2a 70 74 72 32 3b 0a 20 20 20 20 void *ptr2;.
5510: 7d 20 74 77 6f 50 74 72 56 61 6c 75 65 3b 0a 20 } twoPtrValue;.
5520: 20 20 20 73 74 72 75 63 74 20 7b 09 09 09 2f 2a struct {.../*
5530: 20 20 20 2d 20 69 6e 74 65 72 6e 61 6c 20 72 65 - internal re
5540: 70 20 61 73 20 61 20 70 6f 69 6e 74 65 72 20 61 p as a pointer a
5550: 6e 64 20 61 20 6c 6f 6e 67 2c 20 2a 2f 0a 09 76 nd a long, */..v
5560: 6f 69 64 20 2a 70 74 72 3b 09 09 2f 2a 20 20 20 oid *ptr;../*
5570: 20 20 6e 6f 74 20 75 73 65 64 20 69 6e 74 65 72 not used inter
5580: 6e 61 6c 6c 79 20 61 6e 79 20 6d 6f 72 65 2e 20 nally any more.
5590: 2a 2f 0a 09 75 6e 73 69 67 6e 65 64 20 6c 6f 6e */..unsigned lon
55a0: 67 20 76 61 6c 75 65 3b 0a 20 20 20 20 7d 20 70 g value;. } p
55b0: 74 72 41 6e 64 4c 6f 6e 67 52 65 70 3b 0a 7d 20 trAndLongRep;.}
55c0: 54 63 6c 5f 4f 62 6a 49 6e 74 52 65 70 3b 0a 0a Tcl_ObjIntRep;..
55d0: 2f 2a 0a 20 2a 20 4f 6e 65 20 6f 66 20 74 68 65 /*. * One of the
55e0: 20 66 6f 6c 6c 6f 77 69 6e 67 20 73 74 72 75 63 following struc
55f0: 74 75 72 65 73 20 65 78 69 73 74 73 20 66 6f 72 tures exists for
5600: 20 65 61 63 68 20 6f 62 6a 65 63 74 20 69 6e 20 each object in
5610: 74 68 65 20 54 63 6c 20 73 79 73 74 65 6d 2e 0a the Tcl system..
5620: 20 2a 20 41 6e 20 6f 62 6a 65 63 74 20 73 74 6f * An object sto
5630: 72 65 73 20 61 20 76 61 6c 75 65 20 61 73 20 65 res a value as e
5640: 69 74 68 65 72 20 61 20 73 74 72 69 6e 67 2c 20 ither a string,
5650: 73 6f 6d 65 20 69 6e 74 65 72 6e 61 6c 20 72 65 some internal re
5660: 70 72 65 73 65 6e 74 61 74 69 6f 6e 2c 0a 20 2a presentation,. *
5670: 20 6f 72 20 62 6f 74 68 2e 0a 20 2a 2f 0a 0a 74 or both.. */..t
5680: 79 70 65 64 65 66 20 73 74 72 75 63 74 20 54 63 ypedef struct Tc
5690: 6c 5f 4f 62 6a 20 7b 0a 20 20 20 20 73 69 7a 65 l_Obj {. size
56a0: 5f 74 20 72 65 66 43 6f 75 6e 74 3b 09 09 2f 2a _t refCount;../*
56b0: 20 57 68 65 6e 20 30 20 74 68 65 20 6f 62 6a 65 When 0 the obje
56c0: 63 74 20 77 69 6c 6c 20 62 65 20 66 72 65 65 64 ct will be freed
56d0: 2e 20 2a 2f 0a 20 20 20 20 63 68 61 72 20 2a 62 . */. char *b
56e0: 79 74 65 73 3b 09 09 2f 2a 20 54 68 69 73 20 70 ytes;../* This p
56f0: 6f 69 6e 74 73 20 74 6f 20 74 68 65 20 66 69 72 oints to the fir
5700: 73 74 20 62 79 74 65 20 6f 66 20 74 68 65 0a 09 st byte of the..
5710: 09 09 09 20 2a 20 6f 62 6a 65 63 74 27 73 20 73 ... * object's s
5720: 74 72 69 6e 67 20 72 65 70 72 65 73 65 6e 74 61 tring representa
5730: 74 69 6f 6e 2e 20 54 68 65 20 61 72 72 61 79 0a tion. The array.
5740: 09 09 09 09 20 2a 20 6d 75 73 74 20 62 65 20 66 .... * must be f
5750: 6f 6c 6c 6f 77 65 64 20 62 79 20 61 20 6e 75 6c ollowed by a nul
5760: 6c 20 62 79 74 65 20 28 69 2e 65 2e 2c 20 61 74 l byte (i.e., at
5770: 0a 09 09 09 09 20 2a 20 6f 66 66 73 65 74 20 6c ..... * offset l
5780: 65 6e 67 74 68 29 20 62 75 74 20 6d 61 79 20 61 ength) but may a
5790: 6c 73 6f 20 63 6f 6e 74 61 69 6e 0a 09 09 09 09 lso contain.....
57a0: 20 2a 20 65 6d 62 65 64 64 65 64 20 6e 75 6c 6c * embedded null
57b0: 20 63 68 61 72 61 63 74 65 72 73 2e 20 54 68 65 characters. The
57c0: 20 61 72 72 61 79 27 73 0a 09 09 09 09 20 2a 20 array's..... *
57d0: 73 74 6f 72 61 67 65 20 69 73 20 61 6c 6c 6f 63 storage is alloc
57e0: 61 74 65 64 20 62 79 20 54 63 6c 5f 41 6c 6c 6f ated by Tcl_Allo
57f0: 63 2e 20 4e 55 4c 4c 20 6d 65 61 6e 73 0a 09 09 c. NULL means...
5800: 09 09 20 2a 20 74 68 65 20 73 74 72 69 6e 67 20 .. * the string
5810: 72 65 70 20 69 73 20 69 6e 76 61 6c 69 64 20 61 rep is invalid a
5820: 6e 64 20 6d 75 73 74 20 62 65 0a 09 09 09 09 20 nd must be.....
5830: 2a 20 72 65 67 65 6e 65 72 61 74 65 64 20 66 72 * regenerated fr
5840: 6f 6d 20 74 68 65 20 69 6e 74 65 72 6e 61 6c 20 om the internal
5850: 72 65 70 2e 20 20 43 6c 69 65 6e 74 73 0a 09 09 rep. Clients...
5860: 09 09 20 2a 20 73 68 6f 75 6c 64 20 75 73 65 20 .. * should use
5870: 54 63 6c 5f 47 65 74 53 74 72 69 6e 67 46 72 6f Tcl_GetStringFro
5880: 6d 4f 62 6a 20 6f 72 0a 09 09 09 09 20 2a 20 54 mObj or..... * T
5890: 63 6c 5f 47 65 74 53 74 72 69 6e 67 20 74 6f 20 cl_GetString to
58a0: 67 65 74 20 61 20 70 6f 69 6e 74 65 72 20 74 6f get a pointer to
58b0: 20 74 68 65 20 62 79 74 65 0a 09 09 09 09 20 2a the byte..... *
58c0: 20 61 72 72 61 79 20 61 73 20 61 20 72 65 61 64 array as a read
58d0: 6f 6e 6c 79 20 76 61 6c 75 65 2e 20 2a 2f 0a 20 only value. */.
58e0: 20 20 20 73 69 7a 65 5f 74 20 6c 65 6e 67 74 68 size_t length
58f0: 3b 09 09 2f 2a 20 54 68 65 20 6e 75 6d 62 65 72 ;../* The number
5900: 20 6f 66 20 62 79 74 65 73 20 61 74 20 2a 62 79 of bytes at *by
5910: 74 65 73 2c 20 6e 6f 74 0a 09 09 09 09 20 2a 20 tes, not..... *
5920: 69 6e 63 6c 75 64 69 6e 67 20 74 68 65 20 74 65 including the te
5930: 72 6d 69 6e 61 74 69 6e 67 20 6e 75 6c 6c 2e 20 rminating null.
5940: 2a 2f 0a 20 20 20 20 63 6f 6e 73 74 20 54 63 6c */. const Tcl
5950: 5f 4f 62 6a 54 79 70 65 20 2a 74 79 70 65 50 74 _ObjType *typePt
5960: 72 3b 09 2f 2a 20 44 65 6e 6f 74 65 73 20 74 68 r;./* Denotes th
5970: 65 20 6f 62 6a 65 63 74 27 73 20 74 79 70 65 2e e object's type.
5980: 20 41 6c 77 61 79 73 0a 09 09 09 09 20 2a 20 63 Always..... * c
5990: 6f 72 72 65 73 70 6f 6e 64 73 20 74 6f 20 74 68 orresponds to th
59a0: 65 20 74 79 70 65 20 6f 66 20 74 68 65 20 6f 62 e type of the ob
59b0: 6a 65 63 74 27 73 0a 09 09 09 09 20 2a 20 69 6e ject's..... * in
59c0: 74 65 72 6e 61 6c 20 72 65 70 2e 20 4e 55 4c 4c ternal rep. NULL
59d0: 20 69 6e 64 69 63 61 74 65 73 20 74 68 65 20 6f indicates the o
59e0: 62 6a 65 63 74 20 68 61 73 0a 09 09 09 09 20 2a bject has..... *
59f0: 20 6e 6f 20 69 6e 74 65 72 6e 61 6c 20 72 65 70 no internal rep
5a00: 20 28 68 61 73 20 6e 6f 20 74 79 70 65 29 2e 20 (has no type).
5a10: 2a 2f 0a 20 20 20 20 54 63 6c 5f 4f 62 6a 49 6e */. Tcl_ObjIn
5a20: 74 52 65 70 20 69 6e 74 65 72 6e 61 6c 52 65 70 tRep internalRep
5a30: 3b 09 2f 2a 20 54 68 65 20 69 6e 74 65 72 6e 61 ;./* The interna
5a40: 6c 20 72 65 70 72 65 73 65 6e 74 61 74 69 6f 6e l representation
5a50: 3a 20 2a 2f 0a 7d 20 54 63 6c 5f 4f 62 6a 3b 0a : */.} Tcl_Obj;.
5a60: 0a 0c 0a 2f 2a 0a 20 2a 2d 2d 2d 2d 2d 2d 2d 2d .../*. *--------
5a70: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
5a80: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
5a90: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
5aa0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
5ab0: 2d 2d 2d 2d 0a 20 2a 20 54 68 65 20 66 6f 6c 6c ----. * The foll
5ac0: 6f 77 69 6e 67 20 74 79 70 65 20 63 6f 6e 74 61 owing type conta
5ad0: 69 6e 73 20 74 68 65 20 73 74 61 74 65 20 6e 65 ins the state ne
5ae0: 65 64 65 64 20 62 79 20 54 63 6c 5f 53 61 76 65 eded by Tcl_Save
5af0: 52 65 73 75 6c 74 2e 20 49 74 0a 20 2a 20 69 73 Result. It. * is
5b00: 20 74 79 70 69 63 61 6c 6c 79 20 61 6c 6c 6f 63 typically alloc
5b10: 61 74 65 64 20 6f 6e 20 74 68 65 20 73 74 61 63 ated on the stac
5b20: 6b 2e 0a 20 2a 2f 0a 0a 74 79 70 65 64 65 66 20 k.. */..typedef
5b30: 54 63 6c 5f 4f 62 6a 20 2a 54 63 6c 5f 53 61 76 Tcl_Obj *Tcl_Sav
5b40: 65 64 52 65 73 75 6c 74 3b 0a 0a 2f 2a 0a 20 2a edResult;../*. *
5b50: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
5b60: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
5b70: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
5b80: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
5b90: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 2a 20 ------------. *
5ba0: 54 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 64 65 The following de
5bb0: 66 69 6e 69 74 69 6f 6e 73 20 73 75 70 70 6f 72 finitions suppor
5bc0: 74 20 54 63 6c 27 73 20 6e 61 6d 65 73 70 61 63 t Tcl's namespac
5bd0: 65 20 66 61 63 69 6c 69 74 79 2e 20 4e 6f 74 65 e facility. Note
5be0: 3a 20 74 68 65 20 66 69 72 73 74 0a 20 2a 20 66 : the first. * f
5bf0: 69 76 65 20 66 69 65 6c 64 73 20 6d 75 73 74 20 ive fields must
5c00: 6d 61 74 63 68 20 65 78 61 63 74 6c 79 20 74 68 match exactly th
5c10: 65 20 66 69 65 6c 64 73 20 69 6e 20 61 20 4e 61 e fields in a Na
5c20: 6d 65 73 70 61 63 65 20 73 74 72 75 63 74 75 72 mespace structur
5c30: 65 20 28 73 65 65 0a 20 2a 20 74 63 6c 49 6e 74 e (see. * tclInt
5c40: 2e 68 29 2e 0a 20 2a 2f 0a 0a 74 79 70 65 64 65 .h).. */..typede
5c50: 66 20 73 74 72 75 63 74 20 54 63 6c 5f 4e 61 6d f struct Tcl_Nam
5c60: 65 73 70 61 63 65 20 7b 0a 20 20 20 20 63 68 61 espace {. cha
5c70: 72 20 2a 6e 61 6d 65 3b 09 09 09 2f 2a 20 54 68 r *name;.../* Th
5c80: 65 20 6e 61 6d 65 73 70 61 63 65 27 73 20 6e 61 e namespace's na
5c90: 6d 65 20 77 69 74 68 69 6e 20 69 74 73 20 70 61 me within its pa
5ca0: 72 65 6e 74 0a 09 09 09 09 20 2a 20 6e 61 6d 65 rent..... * name
5cb0: 73 70 61 63 65 2e 20 54 68 69 73 20 63 6f 6e 74 space. This cont
5cc0: 61 69 6e 73 20 6e 6f 20 3a 3a 27 73 2e 20 54 68 ains no ::'s. Th
5cd0: 65 20 6e 61 6d 65 0a 09 09 09 09 20 2a 20 6f 66 e name..... * of
5ce0: 20 74 68 65 20 67 6c 6f 62 61 6c 20 6e 61 6d 65 the global name
5cf0: 73 70 61 63 65 20 69 73 20 22 22 20 61 6c 74 68 space is "" alth
5d00: 6f 75 67 68 20 22 3a 3a 22 0a 09 09 09 09 20 2a ough "::"..... *
5d10: 20 69 73 20 61 6e 20 73 79 6e 6f 6e 79 6d 2e 20 is an synonym.
5d20: 2a 2f 0a 20 20 20 20 63 68 61 72 20 2a 66 75 6c */. char *ful
5d30: 6c 4e 61 6d 65 3b 09 09 2f 2a 20 54 68 65 20 6e lName;../* The n
5d40: 61 6d 65 73 70 61 63 65 27 73 20 66 75 6c 6c 79 amespace's fully
5d50: 20 71 75 61 6c 69 66 69 65 64 20 6e 61 6d 65 2e qualified name.
5d60: 20 54 68 69 73 0a 09 09 09 09 20 2a 20 73 74 61 This..... * sta
5d70: 72 74 73 20 77 69 74 68 20 3a 3a 2e 20 2a 2f 0a rts with ::. */.
5d80: 20 20 20 20 76 6f 69 64 20 2a 63 6c 69 65 6e 74 void *client
5d90: 44 61 74 61 3b 09 2f 2a 20 41 72 62 69 74 72 61 Data;./* Arbitra
5da0: 72 79 20 76 61 6c 75 65 20 61 73 73 6f 63 69 61 ry value associa
5db0: 74 65 64 20 77 69 74 68 20 74 68 69 73 0a 09 09 ted with this...
5dc0: 09 09 20 2a 20 6e 61 6d 65 73 70 61 63 65 2e 20 .. * namespace.
5dd0: 2a 2f 0a 20 20 20 20 54 63 6c 5f 4e 61 6d 65 73 */. Tcl_Names
5de0: 70 61 63 65 44 65 6c 65 74 65 50 72 6f 63 20 2a paceDeleteProc *
5df0: 64 65 6c 65 74 65 50 72 6f 63 3b 0a 09 09 09 09 deleteProc;.....
5e00: 2f 2a 20 46 75 6e 63 74 69 6f 6e 20 69 6e 76 6f /* Function invo
5e10: 6b 65 64 20 77 68 65 6e 20 64 65 6c 65 74 69 6e ked when deletin
5e20: 67 20 74 68 65 0a 09 09 09 09 20 2a 20 6e 61 6d g the..... * nam
5e30: 65 73 70 61 63 65 20 74 6f 2c 20 65 2e 67 2e 2c espace to, e.g.,
5e40: 20 66 72 65 65 20 63 6c 69 65 6e 74 44 61 74 61 free clientData
5e50: 2e 20 2a 2f 0a 20 20 20 20 73 74 72 75 63 74 20 . */. struct
5e60: 54 63 6c 5f 4e 61 6d 65 73 70 61 63 65 20 2a 70 Tcl_Namespace *p
5e70: 61 72 65 6e 74 50 74 72 3b 0a 09 09 09 09 2f 2a arentPtr;...../*
5e80: 20 50 6f 69 6e 74 73 20 74 6f 20 74 68 65 20 6e Points to the n
5e90: 61 6d 65 73 70 61 63 65 20 74 68 61 74 20 63 6f amespace that co
5ea0: 6e 74 61 69 6e 73 20 74 68 69 73 0a 09 09 09 09 ntains this.....
5eb0: 20 2a 20 6f 6e 65 2e 20 4e 55 4c 4c 20 69 66 20 * one. NULL if
5ec0: 74 68 69 73 20 69 73 20 74 68 65 20 67 6c 6f 62 this is the glob
5ed0: 61 6c 0a 09 09 09 09 20 2a 20 6e 61 6d 65 73 70 al..... * namesp
5ee0: 61 63 65 2e 20 2a 2f 0a 7d 20 54 63 6c 5f 4e 61 ace. */.} Tcl_Na
5ef0: 6d 65 73 70 61 63 65 3b 0a 0a 2f 2a 0a 20 2a 2d mespace;../*. *-
5f00: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
5f10: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
5f20: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
5f30: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
5f40: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 2a 20 54 -----------. * T
5f50: 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 73 74 72 he following str
5f60: 75 63 74 75 72 65 20 72 65 70 72 65 73 65 6e 74 ucture represent
5f70: 73 20 61 20 63 61 6c 6c 20 66 72 61 6d 65 2c 20 s a call frame,
5f80: 6f 72 20 61 63 74 69 76 61 74 69 6f 6e 20 72 65 or activation re
5f90: 63 6f 72 64 2e 20 41 0a 20 2a 20 63 61 6c 6c 20 cord. A. * call
5fa0: 66 72 61 6d 65 20 64 65 66 69 6e 65 73 20 61 20 frame defines a
5fb0: 6e 61 6d 69 6e 67 20 63 6f 6e 74 65 78 74 20 66 naming context f
5fc0: 6f 72 20 61 20 70 72 6f 63 65 64 75 72 65 20 63 or a procedure c
5fd0: 61 6c 6c 3a 20 69 74 73 20 6c 6f 63 61 6c 20 73 all: its local s
5fe0: 63 6f 70 65 0a 20 2a 20 28 66 6f 72 20 6c 6f 63 cope. * (for loc
5ff0: 61 6c 20 76 61 72 69 61 62 6c 65 73 29 20 61 6e al variables) an
6000: 64 20 69 74 73 20 6e 61 6d 65 73 70 61 63 65 20 d its namespace
6010: 73 63 6f 70 65 20 28 75 73 65 64 20 66 6f 72 20 scope (used for
6020: 6e 6f 6e 2d 6c 6f 63 61 6c 0a 20 2a 20 76 61 72 non-local. * var
6030: 69 61 62 6c 65 73 3b 20 6f 66 74 65 6e 20 74 68 iables; often th
6040: 65 20 67 6c 6f 62 61 6c 20 3a 3a 20 6e 61 6d 65 e global :: name
6050: 73 70 61 63 65 29 2e 20 41 20 63 61 6c 6c 20 66 space). A call f
6060: 72 61 6d 65 20 63 61 6e 20 61 6c 73 6f 20 64 65 rame can also de
6070: 66 69 6e 65 20 74 68 65 0a 20 2a 20 6e 61 6d 69 fine the. * nami
6080: 6e 67 20 63 6f 6e 74 65 78 74 20 66 6f 72 20 61 ng context for a
6090: 20 6e 61 6d 65 73 70 61 63 65 20 65 76 61 6c 20 namespace eval
60a0: 6f 72 20 6e 61 6d 65 73 70 61 63 65 20 69 6e 73 or namespace ins
60b0: 63 6f 70 65 20 63 6f 6d 6d 61 6e 64 3a 20 74 68 cope command: th
60c0: 65 0a 20 2a 20 6e 61 6d 65 73 70 61 63 65 20 69 e. * namespace i
60d0: 6e 20 77 68 69 63 68 20 74 68 65 20 63 6f 6d 6d n which the comm
60e0: 61 6e 64 27 73 20 63 6f 64 65 20 73 68 6f 75 6c and's code shoul
60f0: 64 20 65 78 65 63 75 74 65 2e 20 54 68 65 20 54 d execute. The T
6100: 63 6c 5f 43 61 6c 6c 46 72 61 6d 65 0a 20 2a 20 cl_CallFrame. *
6110: 73 74 72 75 63 74 75 72 65 73 20 65 78 69 73 74 structures exist
6120: 20 6f 6e 6c 79 20 77 68 69 6c 65 20 70 72 6f 63 only while proc
6130: 65 64 75 72 65 73 20 6f 72 20 6e 61 6d 65 73 70 edures or namesp
6140: 61 63 65 20 65 76 61 6c 2f 69 6e 73 63 6f 70 65 ace eval/inscope
6150: 27 73 20 61 72 65 0a 20 2a 20 62 65 69 6e 67 20 's are. * being
6160: 65 78 65 63 75 74 65 64 2c 20 61 6e 64 20 70 72 executed, and pr
6170: 6f 76 69 64 65 20 61 20 54 63 6c 20 63 61 6c 6c ovide a Tcl call
6180: 20 73 74 61 63 6b 2e 0a 20 2a 0a 20 2a 20 41 20 stack.. *. * A
6190: 63 61 6c 6c 20 66 72 61 6d 65 20 69 73 20 69 6e call frame is in
61a0: 69 74 69 61 6c 69 7a 65 64 20 61 6e 64 20 70 75 itialized and pu
61b0: 73 68 65 64 20 75 73 69 6e 67 20 54 63 6c 5f 50 shed using Tcl_P
61c0: 75 73 68 43 61 6c 6c 46 72 61 6d 65 20 61 6e 64 ushCallFrame and
61d0: 20 70 6f 70 70 65 64 0a 20 2a 20 75 73 69 6e 67 popped. * using
61e0: 20 54 63 6c 5f 50 6f 70 43 61 6c 6c 46 72 61 6d Tcl_PopCallFram
61f0: 65 2e 20 53 74 6f 72 61 67 65 20 66 6f 72 20 61 e. Storage for a
6200: 20 54 63 6c 5f 43 61 6c 6c 46 72 61 6d 65 20 6d Tcl_CallFrame m
6210: 75 73 74 20 62 65 20 70 72 6f 76 69 64 65 64 20 ust be provided
6220: 62 79 20 74 68 65 0a 20 2a 20 54 63 6c 5f 50 75 by the. * Tcl_Pu
6230: 73 68 43 61 6c 6c 46 72 61 6d 65 20 63 61 6c 6c shCallFrame call
6240: 65 72 2c 20 61 6e 64 20 63 61 6c 6c 65 72 73 20 er, and callers
6250: 74 79 70 69 63 61 6c 6c 79 20 61 6c 6c 6f 63 61 typically alloca
6260: 74 65 20 74 68 65 6d 20 6f 6e 20 74 68 65 20 43 te them on the C
6270: 20 63 61 6c 6c 0a 20 2a 20 73 74 61 63 6b 20 66 call. * stack f
6280: 6f 72 20 65 66 66 69 63 69 65 6e 63 79 2e 20 46 or efficiency. F
6290: 6f 72 20 74 68 69 73 20 72 65 61 73 6f 6e 2c 20 or this reason,
62a0: 54 63 6c 5f 43 61 6c 6c 46 72 61 6d 65 20 69 73 Tcl_CallFrame is
62b0: 20 64 65 66 69 6e 65 64 20 61 73 20 61 0a 20 2a defined as a. *
62c0: 20 73 74 72 75 63 74 75 72 65 20 61 6e 64 20 6e structure and n
62d0: 6f 74 20 61 73 20 61 6e 20 6f 70 61 71 75 65 20 ot as an opaque
62e0: 74 6f 6b 65 6e 2e 20 48 6f 77 65 76 65 72 2c 20 token. However,
62f0: 6d 6f 73 74 20 54 63 6c 5f 43 61 6c 6c 46 72 61 most Tcl_CallFra
6300: 6d 65 20 66 69 65 6c 64 73 0a 20 2a 20 61 72 65 me fields. * are
6310: 20 68 69 64 64 65 6e 20 73 69 6e 63 65 20 61 70 hidden since ap
6320: 70 6c 69 63 61 74 69 6f 6e 73 20 73 68 6f 75 6c plications shoul
6330: 64 20 6e 6f 74 20 61 63 63 65 73 73 20 74 68 65 d not access the
6340: 6d 20 64 69 72 65 63 74 6c 79 3b 20 6f 74 68 65 m directly; othe
6350: 72 73 20 61 72 65 0a 20 2a 20 64 65 63 6c 61 72 rs are. * declar
6360: 65 64 20 61 73 20 22 64 75 6d 6d 79 58 22 2e 0a ed as "dummyX"..
6370: 20 2a 0a 20 2a 20 57 41 52 4e 49 4e 47 21 21 20 *. * WARNING!!
6380: 54 68 65 20 73 74 72 75 63 74 75 72 65 20 64 65 The structure de
6390: 66 69 6e 69 74 69 6f 6e 20 6d 75 73 74 20 62 65 finition must be
63a0: 20 6b 65 70 74 20 63 6f 6e 73 69 73 74 65 6e 74 kept consistent
63b0: 20 77 69 74 68 20 74 68 65 0a 20 2a 20 43 61 6c with the. * Cal
63c0: 6c 46 72 61 6d 65 20 73 74 72 75 63 74 75 72 65 lFrame structure
63d0: 20 69 6e 20 74 63 6c 49 6e 74 2e 68 2e 20 49 66 in tclInt.h. If
63e0: 20 79 6f 75 20 63 68 61 6e 67 65 20 6f 6e 65 2c you change one,
63f0: 20 63 68 61 6e 67 65 20 74 68 65 20 6f 74 68 65 change the othe
6400: 72 2e 0a 20 2a 2f 0a 0a 74 79 70 65 64 65 66 20 r.. */..typedef
6410: 73 74 72 75 63 74 20 54 63 6c 5f 43 61 6c 6c 46 struct Tcl_CallF
6420: 72 61 6d 65 20 7b 0a 20 20 20 20 54 63 6c 5f 4e rame {. Tcl_N
6430: 61 6d 65 73 70 61 63 65 20 2a 6e 73 50 74 72 3b amespace *nsPtr;
6440: 0a 20 20 20 20 69 6e 74 20 64 75 6d 6d 79 31 3b . int dummy1;
6450: 0a 20 20 20 20 69 6e 74 20 64 75 6d 6d 79 32 3b . int dummy2;
6460: 0a 20 20 20 20 76 6f 69 64 20 2a 64 75 6d 6d 79 . void *dummy
6470: 33 3b 0a 20 20 20 20 76 6f 69 64 20 2a 64 75 6d 3;. void *dum
6480: 6d 79 34 3b 0a 20 20 20 20 76 6f 69 64 20 2a 64 my4;. void *d
6490: 75 6d 6d 79 35 3b 0a 20 20 20 20 69 6e 74 20 64 ummy5;. int d
64a0: 75 6d 6d 79 36 3b 0a 20 20 20 20 76 6f 69 64 20 ummy6;. void
64b0: 2a 64 75 6d 6d 79 37 3b 0a 20 20 20 20 76 6f 69 *dummy7;. voi
64c0: 64 20 2a 64 75 6d 6d 79 38 3b 0a 20 20 20 20 69 d *dummy8;. i
64d0: 6e 74 20 64 75 6d 6d 79 39 3b 0a 20 20 20 20 76 nt dummy9;. v
64e0: 6f 69 64 20 2a 64 75 6d 6d 79 31 30 3b 0a 20 20 oid *dummy10;.
64f0: 20 20 76 6f 69 64 20 2a 64 75 6d 6d 79 31 31 3b void *dummy11;
6500: 0a 20 20 20 20 76 6f 69 64 20 2a 64 75 6d 6d 79 . void *dummy
6510: 31 32 3b 0a 20 20 20 20 76 6f 69 64 20 2a 64 75 12;. void *du
6520: 6d 6d 79 31 33 3b 0a 7d 20 54 63 6c 5f 43 61 6c mmy13;.} Tcl_Cal
6530: 6c 46 72 61 6d 65 3b 0a 0a 2f 2a 0a 20 2a 2d 2d lFrame;../*. *--
6540: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
6550: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
6560: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
6570: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
6580: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 2a 20 49 6e ----------. * In
6590: 66 6f 72 6d 61 74 69 6f 6e 20 61 62 6f 75 74 20 formation about
65a0: 63 6f 6d 6d 61 6e 64 73 20 74 68 61 74 20 69 73 commands that is
65b0: 20 72 65 74 75 72 6e 65 64 20 62 79 20 54 63 6c returned by Tcl
65c0: 5f 47 65 74 43 6f 6d 6d 61 6e 64 49 6e 66 6f 20 _GetCommandInfo
65d0: 61 6e 64 0a 20 2a 20 70 61 73 73 65 64 20 74 6f and. * passed to
65e0: 20 54 63 6c 5f 53 65 74 43 6f 6d 6d 61 6e 64 49 Tcl_SetCommandI
65f0: 6e 66 6f 2e 20 6f 62 6a 50 72 6f 63 20 69 73 20 nfo. objProc is
6600: 61 6e 20 6f 62 6a 63 2f 6f 62 6a 76 20 6f 62 6a an objc/objv obj
6610: 65 63 74 2d 62 61 73 65 64 20 63 6f 6d 6d 61 6e ect-based comman
6620: 64 0a 20 2a 20 66 75 6e 63 74 69 6f 6e 20 77 68 d. * function wh
6630: 69 6c 65 20 70 72 6f 63 20 69 73 20 61 20 74 72 ile proc is a tr
6640: 61 64 69 74 69 6f 6e 61 6c 20 54 63 6c 20 61 72 aditional Tcl ar
6650: 67 63 2f 61 72 67 76 20 73 74 72 69 6e 67 2d 62 gc/argv string-b
6660: 61 73 65 64 20 66 75 6e 63 74 69 6f 6e 2e 0a 20 ased function..
6670: 2a 20 54 63 6c 5f 43 72 65 61 74 65 4f 62 6a 43 * Tcl_CreateObjC
6680: 6f 6d 6d 61 6e 64 20 61 6e 64 20 54 63 6c 5f 43 ommand and Tcl_C
6690: 72 65 61 74 65 43 6f 6d 6d 61 6e 64 20 65 6e 73 reateCommand ens
66a0: 75 72 65 20 74 68 61 74 20 62 6f 74 68 20 6f 62 ure that both ob
66b0: 6a 50 72 6f 63 20 61 6e 64 0a 20 2a 20 70 72 6f jProc and. * pro
66c0: 63 20 61 72 65 20 6e 6f 6e 2d 4e 55 4c 4c 20 61 c are non-NULL a
66d0: 6e 64 20 63 61 6e 20 62 65 20 63 61 6c 6c 65 64 nd can be called
66e0: 20 74 6f 20 65 78 65 63 75 74 65 20 74 68 65 20 to execute the
66f0: 63 6f 6d 6d 61 6e 64 2e 20 48 6f 77 65 76 65 72 command. However
6700: 2c 20 69 74 20 6d 61 79 0a 20 2a 20 62 65 20 66 , it may. * be f
6710: 61 73 74 65 72 20 74 6f 20 63 61 6c 6c 20 6f 6e aster to call on
6720: 65 20 69 6e 73 74 65 61 64 20 6f 66 20 74 68 65 e instead of the
6730: 20 6f 74 68 65 72 2e 20 54 68 65 20 6d 65 6d 62 other. The memb
6740: 65 72 20 69 73 4e 61 74 69 76 65 4f 62 6a 65 63 er isNativeObjec
6750: 74 50 72 6f 63 0a 20 2a 20 69 73 20 73 65 74 20 tProc. * is set
6760: 74 6f 20 31 20 69 66 20 61 6e 20 6f 62 6a 65 63 to 1 if an objec
6770: 74 2d 62 61 73 65 64 20 66 75 6e 63 74 69 6f 6e t-based function
6780: 20 77 61 73 20 72 65 67 69 73 74 65 72 65 64 20 was registered
6790: 62 79 0a 20 2a 20 54 63 6c 5f 43 72 65 61 74 65 by. * Tcl_Create
67a0: 4f 62 6a 43 6f 6d 6d 61 6e 64 2c 20 61 6e 64 20 ObjCommand, and
67b0: 74 6f 20 30 20 69 66 20 61 20 73 74 72 69 6e 67 to 0 if a string
67c0: 2d 62 61 73 65 64 20 66 75 6e 63 74 69 6f 6e 20 -based function
67d0: 77 61 73 20 72 65 67 69 73 74 65 72 65 64 20 62 was registered b
67e0: 79 0a 20 2a 20 54 63 6c 5f 43 72 65 61 74 65 43 y. * Tcl_CreateC
67f0: 6f 6d 6d 61 6e 64 2e 20 54 68 65 20 6f 74 68 65 ommand. The othe
6800: 72 20 66 75 6e 63 74 69 6f 6e 20 69 73 20 74 79 r function is ty
6810: 70 69 63 61 6c 6c 79 20 73 65 74 20 74 6f 20 61 pically set to a
6820: 20 63 6f 6d 70 61 74 69 62 69 6c 69 74 79 0a 20 compatibility.
6830: 2a 20 77 72 61 70 70 65 72 20 74 68 61 74 20 64 * wrapper that d
6840: 6f 65 73 20 73 74 72 69 6e 67 2d 74 6f 2d 6f 62 oes string-to-ob
6850: 6a 65 63 74 20 6f 72 20 6f 62 6a 65 63 74 2d 74 ject or object-t
6860: 6f 2d 73 74 72 69 6e 67 20 61 72 67 75 6d 65 6e o-string argumen
6870: 74 20 63 6f 6e 76 65 72 73 69 6f 6e 73 0a 20 2a t conversions. *
6880: 20 74 68 65 6e 20 63 61 6c 6c 73 20 74 68 65 20 then calls the
6890: 6f 74 68 65 72 20 66 75 6e 63 74 69 6f 6e 2e 0a other function..
68a0: 20 2a 2f 0a 0a 74 79 70 65 64 65 66 20 73 74 72 */..typedef str
68b0: 75 63 74 20 54 63 6c 5f 43 6d 64 49 6e 66 6f 20 uct Tcl_CmdInfo
68c0: 7b 0a 20 20 20 20 69 6e 74 20 69 73 4e 61 74 69 {. int isNati
68d0: 76 65 4f 62 6a 65 63 74 50 72 6f 63 3b 09 2f 2a veObjectProc;./*
68e0: 20 31 20 69 66 20 6f 62 6a 50 72 6f 63 20 77 61 1 if objProc wa
68f0: 73 20 72 65 67 69 73 74 65 72 65 64 20 62 79 20 s registered by
6900: 61 20 63 61 6c 6c 20 74 6f 0a 09 09 09 09 20 2a a call to..... *
6910: 20 54 63 6c 5f 43 72 65 61 74 65 4f 62 6a 43 6f Tcl_CreateObjCo
6920: 6d 6d 61 6e 64 3b 20 30 20 6f 74 68 65 72 77 69 mmand; 0 otherwi
6930: 73 65 2e 0a 09 09 09 09 20 2a 20 54 63 6c 5f 53 se...... * Tcl_S
6940: 65 74 43 6d 64 49 6e 66 6f 20 64 6f 65 73 20 6e etCmdInfo does n
6950: 6f 74 20 6d 6f 64 69 66 79 20 74 68 69 73 0a 09 ot modify this..
6960: 09 09 09 20 2a 20 66 69 65 6c 64 2e 20 2a 2f 0a ... * field. */.
6970: 20 20 20 20 54 63 6c 5f 4f 62 6a 43 6d 64 50 72 Tcl_ObjCmdPr
6980: 6f 63 20 2a 6f 62 6a 50 72 6f 63 3b 09 2f 2a 20 oc *objProc;./*
6990: 43 6f 6d 6d 61 6e 64 27 73 20 6f 62 6a 65 63 74 Command's object
69a0: 2d 62 61 73 65 64 20 66 75 6e 63 74 69 6f 6e 2e -based function.
69b0: 20 2a 2f 0a 20 20 20 20 76 6f 69 64 20 2a 6f 62 */. void *ob
69c0: 6a 43 6c 69 65 6e 74 44 61 74 61 3b 09 2f 2a 20 jClientData;./*
69d0: 43 6c 69 65 6e 74 44 61 74 61 20 66 6f 72 20 6f ClientData for o
69e0: 62 6a 65 63 74 20 70 72 6f 63 2e 20 2a 2f 0a 20 bject proc. */.
69f0: 20 20 20 54 63 6c 5f 43 6d 64 50 72 6f 63 20 2a Tcl_CmdProc *
6a00: 70 72 6f 63 3b 09 09 2f 2a 20 43 6f 6d 6d 61 6e proc;../* Comman
6a10: 64 27 73 20 73 74 72 69 6e 67 2d 62 61 73 65 64 d's string-based
6a20: 20 66 75 6e 63 74 69 6f 6e 2e 20 2a 2f 0a 20 20 function. */.
6a30: 20 20 76 6f 69 64 20 2a 63 6c 69 65 6e 74 44 61 void *clientDa
6a40: 74 61 3b 09 2f 2a 20 43 6c 69 65 6e 74 44 61 74 ta;./* ClientDat
6a50: 61 20 66 6f 72 20 73 74 72 69 6e 67 20 70 72 6f a for string pro
6a60: 63 2e 20 2a 2f 0a 20 20 20 20 54 63 6c 5f 43 6d c. */. Tcl_Cm
6a70: 64 44 65 6c 65 74 65 50 72 6f 63 20 2a 64 65 6c dDeleteProc *del
6a80: 65 74 65 50 72 6f 63 3b 0a 09 09 09 09 2f 2a 20 eteProc;...../*
6a90: 46 75 6e 63 74 69 6f 6e 20 74 6f 20 63 61 6c 6c Function to call
6aa0: 20 77 68 65 6e 20 63 6f 6d 6d 61 6e 64 20 69 73 when command is
6ab0: 0a 09 09 09 09 20 2a 20 64 65 6c 65 74 65 64 2e ..... * deleted.
6ac0: 20 2a 2f 0a 20 20 20 20 76 6f 69 64 20 2a 64 65 */. void *de
6ad0: 6c 65 74 65 44 61 74 61 3b 09 2f 2a 20 56 61 6c leteData;./* Val
6ae0: 75 65 20 74 6f 20 70 61 73 73 20 74 6f 20 64 65 ue to pass to de
6af0: 6c 65 74 65 50 72 6f 63 20 28 75 73 75 61 6c 6c leteProc (usuall
6b00: 79 20 74 68 65 0a 09 09 09 09 20 2a 20 73 61 6d y the..... * sam
6b10: 65 20 61 73 20 63 6c 69 65 6e 74 44 61 74 61 29 e as clientData)
6b20: 2e 20 2a 2f 0a 20 20 20 20 54 63 6c 5f 4e 61 6d . */. Tcl_Nam
6b30: 65 73 70 61 63 65 20 2a 6e 61 6d 65 73 70 61 63 espace *namespac
6b40: 65 50 74 72 3b 2f 2a 20 50 6f 69 6e 74 73 20 74 ePtr;/* Points t
6b50: 6f 20 74 68 65 20 6e 61 6d 65 73 70 61 63 65 20 o the namespace
6b60: 74 68 61 74 20 63 6f 6e 74 61 69 6e 73 20 74 68 that contains th
6b70: 69 73 0a 09 09 09 09 20 2a 20 63 6f 6d 6d 61 6e is..... * comman
6b80: 64 2e 20 4e 6f 74 65 20 74 68 61 74 20 54 63 6c d. Note that Tcl
6b90: 5f 53 65 74 43 6d 64 49 6e 66 6f 20 77 69 6c 6c _SetCmdInfo will
6ba0: 20 6e 6f 74 0a 09 09 09 09 20 2a 20 63 68 61 6e not..... * chan
6bb0: 67 65 20 61 20 63 6f 6d 6d 61 6e 64 27 73 20 6e ge a command's n
6bc0: 61 6d 65 73 70 61 63 65 3b 20 75 73 65 0a 09 09 amespace; use...
6bd0: 09 09 20 2a 20 54 63 6c 52 65 6e 61 6d 65 43 6f .. * TclRenameCo
6be0: 6d 6d 61 6e 64 20 6f 72 20 54 63 6c 5f 45 76 61 mmand or Tcl_Eva
6bf0: 6c 20 28 6f 66 20 27 72 65 6e 61 6d 65 27 29 0a l (of 'rename').
6c00: 09 09 09 09 20 2a 20 74 6f 20 64 6f 20 74 68 61 .... * to do tha
6c10: 74 2e 20 2a 2f 0a 7d 20 54 63 6c 5f 43 6d 64 49 t. */.} Tcl_CmdI
6c20: 6e 66 6f 3b 0a 0a 2f 2a 0a 20 2a 2d 2d 2d 2d 2d nfo;../*. *-----
6c30: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
6c40: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
6c50: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
6c60: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
6c70: 2d 2d 2d 2d 2d 2d 2d 0a 20 2a 20 54 68 65 20 73 -------. * The s
6c80: 74 72 75 63 74 75 72 65 20 64 65 66 69 6e 65 64 tructure defined
6c90: 20 62 65 6c 6f 77 20 69 73 20 75 73 65 64 20 74 below is used t
6ca0: 6f 20 68 6f 6c 64 20 64 79 6e 61 6d 69 63 20 73 o hold dynamic s
6cb0: 74 72 69 6e 67 73 2e 20 54 68 65 20 6f 6e 6c 79 trings. The only
6cc0: 0a 20 2a 20 66 69 65 6c 64 73 20 74 68 61 74 20 . * fields that
6cd0: 63 6c 69 65 6e 74 73 20 73 68 6f 75 6c 64 20 75 clients should u
6ce0: 73 65 20 61 72 65 20 73 74 72 69 6e 67 20 61 6e se are string an
6cf0: 64 20 6c 65 6e 67 74 68 2c 20 61 63 63 65 73 73 d length, access
6d00: 69 62 6c 65 20 76 69 61 20 74 68 65 0a 20 2a 20 ible via the. *
6d10: 6d 61 63 72 6f 73 20 54 63 6c 5f 44 53 74 72 69 macros Tcl_DStri
6d20: 6e 67 56 61 6c 75 65 20 61 6e 64 20 54 63 6c 5f ngValue and Tcl_
6d30: 44 53 74 72 69 6e 67 4c 65 6e 67 74 68 2e 0a 20 DStringLength..
6d40: 2a 2f 0a 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f */..#define TCL_
6d50: 44 53 54 52 49 4e 47 5f 53 54 41 54 49 43 5f 53 DSTRING_STATIC_S
6d60: 49 5a 45 20 32 30 30 0a 74 79 70 65 64 65 66 20 IZE 200.typedef
6d70: 73 74 72 75 63 74 20 54 63 6c 5f 44 53 74 72 69 struct Tcl_DStri
6d80: 6e 67 20 7b 0a 20 20 20 20 63 68 61 72 20 2a 73 ng {. char *s
6d90: 74 72 69 6e 67 3b 09 09 2f 2a 20 50 6f 69 6e 74 tring;../* Point
6da0: 73 20 74 6f 20 62 65 67 69 6e 6e 69 6e 67 20 6f s to beginning o
6db0: 66 20 73 74 72 69 6e 67 3a 20 65 69 74 68 65 72 f string: either
6dc0: 0a 09 09 09 09 20 2a 20 73 74 61 74 69 63 53 70 ..... * staticSp
6dd0: 61 63 65 20 62 65 6c 6f 77 20 6f 72 20 61 20 6d ace below or a m
6de0: 61 6c 6c 6f 63 65 64 20 61 72 72 61 79 2e 20 2a alloced array. *
6df0: 2f 0a 20 20 20 20 73 69 7a 65 5f 74 20 6c 65 6e /. size_t len
6e00: 67 74 68 3b 09 09 2f 2a 20 4e 75 6d 62 65 72 20 gth;../* Number
6e10: 6f 66 20 6e 6f 6e 2d 4e 55 4c 4c 20 63 68 61 72 of non-NULL char
6e20: 61 63 74 65 72 73 20 69 6e 20 74 68 65 0a 09 09 acters in the...
6e30: 09 09 20 2a 20 73 74 72 69 6e 67 2e 20 2a 2f 0a .. * string. */.
6e40: 20 20 20 20 73 69 7a 65 5f 74 20 73 70 61 63 65 size_t space
6e50: 41 76 6c 3b 09 09 2f 2a 20 54 6f 74 61 6c 20 6e Avl;../* Total n
6e60: 75 6d 62 65 72 20 6f 66 20 62 79 74 65 73 20 61 umber of bytes a
6e70: 76 61 69 6c 61 62 6c 65 20 66 6f 72 20 74 68 65 vailable for the
6e80: 0a 09 09 09 09 20 2a 20 73 74 72 69 6e 67 20 61 ..... * string a
6e90: 6e 64 20 69 74 73 20 74 65 72 6d 69 6e 61 74 69 nd its terminati
6ea0: 6e 67 20 4e 55 4c 4c 20 63 68 61 72 2e 20 2a 2f ng NULL char. */
6eb0: 0a 20 20 20 20 63 68 61 72 20 73 74 61 74 69 63 . char static
6ec0: 53 70 61 63 65 5b 54 43 4c 5f 44 53 54 52 49 4e Space[TCL_DSTRIN
6ed0: 47 5f 53 54 41 54 49 43 5f 53 49 5a 45 5d 3b 0a G_STATIC_SIZE];.
6ee0: 09 09 09 09 2f 2a 20 53 70 61 63 65 20 74 6f 20 ..../* Space to
6ef0: 75 73 65 20 69 6e 20 63 6f 6d 6d 6f 6e 20 63 61 use in common ca
6f00: 73 65 20 77 68 65 72 65 20 73 74 72 69 6e 67 20 se where string
6f10: 69 73 0a 09 09 09 09 20 2a 20 73 6d 61 6c 6c 2e is..... * small.
6f20: 20 2a 2f 0a 7d 20 54 63 6c 5f 44 53 74 72 69 6e */.} Tcl_DStrin
6f30: 67 3b 0a 0a 23 64 65 66 69 6e 65 20 54 63 6c 5f g;..#define Tcl_
6f40: 44 53 74 72 69 6e 67 4c 65 6e 67 74 68 28 64 73 DStringLength(ds
6f50: 50 74 72 29 20 28 28 64 73 50 74 72 29 2d 3e 6c Ptr) ((dsPtr)->l
6f60: 65 6e 67 74 68 29 0a 23 64 65 66 69 6e 65 20 54 ength).#define T
6f70: 63 6c 5f 44 53 74 72 69 6e 67 56 61 6c 75 65 28 cl_DStringValue(
6f80: 64 73 50 74 72 29 20 28 28 64 73 50 74 72 29 2d dsPtr) ((dsPtr)-
6f90: 3e 73 74 72 69 6e 67 29 0a 0a 2f 2a 0a 20 2a 20 >string)../*. *
6fa0: 44 65 66 69 6e 69 74 69 6f 6e 73 20 66 6f 72 20 Definitions for
6fb0: 74 68 65 20 6d 61 78 69 6d 75 6d 20 6e 75 6d 62 the maximum numb
6fc0: 65 72 20 6f 66 20 64 69 67 69 74 73 20 6f 66 20 er of digits of
6fd0: 70 72 65 63 69 73 69 6f 6e 20 74 68 61 74 20 6d precision that m
6fe0: 61 79 20 62 65 0a 20 2a 20 70 72 6f 64 75 63 65 ay be. * produce
6ff0: 64 20 62 79 20 54 63 6c 5f 50 72 69 6e 74 44 6f d by Tcl_PrintDo
7000: 75 62 6c 65 2c 20 61 6e 64 20 74 68 65 20 6e 75 uble, and the nu
7010: 6d 62 65 72 20 6f 66 20 62 79 74 65 73 20 6f 66 mber of bytes of
7020: 20 62 75 66 66 65 72 20 73 70 61 63 65 0a 20 2a buffer space. *
7030: 20 72 65 71 75 69 72 65 64 20 62 79 20 54 63 6c required by Tcl
7040: 5f 50 72 69 6e 74 44 6f 75 62 6c 65 2e 0a 20 2a _PrintDouble.. *
7050: 2f 0a 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 4d /..#define TCL_M
7060: 41 58 5f 50 52 45 43 09 09 31 37 0a 23 64 65 66 AX_PREC..17.#def
7070: 69 6e 65 20 54 43 4c 5f 44 4f 55 42 4c 45 5f 53 ine TCL_DOUBLE_S
7080: 50 41 43 45 09 28 54 43 4c 5f 4d 41 58 5f 50 52 PACE.(TCL_MAX_PR
7090: 45 43 2b 31 30 29 0a 0a 2f 2a 0a 20 2a 20 44 65 EC+10)../*. * De
70a0: 66 69 6e 69 74 69 6f 6e 20 66 6f 72 20 61 20 6e finition for a n
70b0: 75 6d 62 65 72 20 6f 66 20 62 79 74 65 73 20 6f umber of bytes o
70c0: 66 20 62 75 66 66 65 72 20 73 70 61 63 65 20 73 f buffer space s
70d0: 75 66 66 69 63 69 65 6e 74 20 74 6f 20 68 6f 6c ufficient to hol
70e0: 64 20 74 68 65 0a 20 2a 20 73 74 72 69 6e 67 20 d the. * string
70f0: 72 65 70 72 65 73 65 6e 74 61 74 69 6f 6e 20 6f representation o
7100: 66 20 61 6e 20 69 6e 74 65 67 65 72 20 69 6e 20 f an integer in
7110: 62 61 73 65 20 31 30 20 28 61 73 73 75 6d 69 6e base 10 (assumin
7120: 67 20 74 68 65 20 65 78 69 73 74 65 6e 63 65 20 g the existence
7130: 6f 66 0a 20 2a 20 36 34 2d 62 69 74 20 69 6e 74 of. * 64-bit int
7140: 65 67 65 72 73 29 2e 0a 20 2a 2f 0a 0a 23 64 65 egers).. */..#de
7150: 66 69 6e 65 20 54 43 4c 5f 49 4e 54 45 47 45 52 fine TCL_INTEGER
7160: 5f 53 50 41 43 45 09 32 34 0a 0a 2f 2a 0a 20 2a _SPACE.24../*. *
7170: 20 46 6c 61 67 20 76 61 6c 75 65 73 20 70 61 73 Flag values pas
7180: 73 65 64 20 74 6f 20 54 63 6c 5f 43 6f 6e 76 65 sed to Tcl_Conve
7190: 72 74 45 6c 65 6d 65 6e 74 2e 0a 20 2a 20 54 43 rtElement.. * TC
71a0: 4c 5f 44 4f 4e 54 5f 55 53 45 5f 42 52 41 43 45 L_DONT_USE_BRACE
71b0: 53 20 66 6f 72 63 65 73 20 69 74 20 6e 6f 74 20 S forces it not
71c0: 74 6f 20 65 6e 63 6c 6f 73 65 20 74 68 65 20 65 to enclose the e
71d0: 6c 65 6d 65 6e 74 20 69 6e 20 62 72 61 63 65 73 lement in braces
71e0: 2c 20 62 75 74 20 74 6f 0a 20 2a 09 75 73 65 20 , but to. *.use
71f0: 62 61 63 6b 73 6c 61 73 68 20 71 75 6f 74 69 6e backslash quotin
7200: 67 20 69 6e 73 74 65 61 64 2e 0a 20 2a 20 54 43 g instead.. * TC
7210: 4c 5f 44 4f 4e 54 5f 51 55 4f 54 45 5f 48 41 53 L_DONT_QUOTE_HAS
7220: 48 20 64 69 73 61 62 6c 65 73 20 74 68 65 20 64 H disables the d
7230: 65 66 61 75 6c 74 20 71 75 6f 74 69 6e 67 20 6f efault quoting o
7240: 66 20 74 68 65 20 27 23 27 20 63 68 61 72 61 63 f the '#' charac
7250: 74 65 72 2e 20 49 74 0a 20 2a 09 69 73 20 73 61 ter. It. *.is sa
7260: 66 65 20 74 6f 20 6c 65 61 76 65 20 74 68 65 20 fe to leave the
7270: 68 61 73 68 20 75 6e 71 75 6f 74 65 64 20 77 68 hash unquoted wh
7280: 65 6e 20 74 68 65 20 65 6c 65 6d 65 6e 74 20 69 en the element i
7290: 73 20 6e 6f 74 20 74 68 65 20 66 69 72 73 74 0a s not the first.
72a0: 20 2a 09 65 6c 65 6d 65 6e 74 20 6f 66 20 61 20 *.element of a
72b0: 6c 69 73 74 2c 20 61 6e 64 20 74 68 69 73 20 66 list, and this f
72c0: 6c 61 67 20 63 61 6e 20 62 65 20 75 73 65 64 20 lag can be used
72d0: 62 79 20 74 68 65 20 63 61 6c 6c 65 72 20 74 6f by the caller to
72e0: 20 69 6e 64 69 63 61 74 65 0a 20 2a 09 74 68 61 indicate. *.tha
72f0: 74 20 63 6f 6e 64 69 74 69 6f 6e 2e 0a 20 2a 2f t condition.. */
7300: 0a 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 44 4f ..#define TCL_DO
7310: 4e 54 5f 55 53 45 5f 42 52 41 43 45 53 09 31 0a NT_USE_BRACES.1.
7320: 23 64 65 66 69 6e 65 20 54 43 4c 5f 44 4f 4e 54 #define TCL_DONT
7330: 5f 51 55 4f 54 45 5f 48 41 53 48 09 38 0a 0a 2f _QUOTE_HASH.8../
7340: 2a 0a 20 2a 20 46 6c 61 67 20 74 68 61 74 20 6d *. * Flag that m
7350: 61 79 20 62 65 20 70 61 73 73 65 64 20 74 6f 20 ay be passed to
7360: 54 63 6c 5f 47 65 74 49 6e 64 65 78 46 72 6f 6d Tcl_GetIndexFrom
7370: 4f 62 6a 20 74 6f 20 66 6f 72 63 65 20 69 74 20 Obj to force it
7380: 74 6f 20 64 69 73 61 6c 6c 6f 77 0a 20 2a 20 61 to disallow. * a
7390: 62 62 72 65 76 69 61 74 65 64 20 73 74 72 69 6e bbreviated strin
73a0: 67 73 2e 0a 20 2a 2f 0a 0a 23 64 65 66 69 6e 65 gs.. */..#define
73b0: 20 54 43 4c 5f 45 58 41 43 54 09 31 0a 0a 2f 2a TCL_EXACT.1../*
73c0: 0a 20 2a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d . *-------------
73d0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
73e0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
73f0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
7400: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a ---------------.
7410: 20 2a 20 46 6c 61 67 20 76 61 6c 75 65 73 20 70 * Flag values p
7420: 61 73 73 65 64 20 74 6f 20 54 63 6c 5f 52 65 63 assed to Tcl_Rec
7430: 6f 72 64 41 6e 64 45 76 61 6c 2c 20 54 63 6c 5f ordAndEval, Tcl_
7440: 45 76 61 6c 4f 62 6a 2c 20 54 63 6c 5f 45 76 61 EvalObj, Tcl_Eva
7450: 6c 4f 62 6a 76 2e 0a 20 2a 20 57 41 52 4e 49 4e lObjv.. * WARNIN
7460: 47 3a 20 74 68 65 73 65 20 62 69 74 20 63 68 6f G: these bit cho
7470: 69 63 65 73 20 6d 75 73 74 20 6e 6f 74 20 63 6f ices must not co
7480: 6e 66 6c 69 63 74 20 77 69 74 68 20 74 68 65 20 nflict with the
7490: 62 69 74 20 63 68 6f 69 63 65 73 20 66 6f 72 0a bit choices for.
74a0: 20 2a 20 65 76 61 6c 46 6c 61 67 20 62 69 74 73 * evalFlag bits
74b0: 20 69 6e 20 74 63 6c 49 6e 74 2e 68 21 0a 20 2a in tclInt.h!. *
74c0: 0a 20 2a 20 4d 65 61 6e 69 6e 67 73 3a 0a 20 2a . * Meanings:. *
74d0: 09 54 43 4c 5f 4e 4f 5f 45 56 41 4c 3a 09 09 4a .TCL_NO_EVAL:..J
74e0: 75 73 74 20 72 65 63 6f 72 64 20 74 68 69 73 20 ust record this
74f0: 63 6f 6d 6d 61 6e 64 0a 20 2a 09 54 43 4c 5f 45 command. *.TCL_E
7500: 56 41 4c 5f 47 4c 4f 42 41 4c 3a 09 45 78 65 63 VAL_GLOBAL:.Exec
7510: 75 74 65 20 73 63 72 69 70 74 20 69 6e 20 67 6c ute script in gl
7520: 6f 62 61 6c 20 6e 61 6d 65 73 70 61 63 65 0a 20 obal namespace.
7530: 2a 09 54 43 4c 5f 45 56 41 4c 5f 44 49 52 45 43 *.TCL_EVAL_DIREC
7540: 54 3a 09 44 6f 20 6e 6f 74 20 63 6f 6d 70 69 6c T:.Do not compil
7550: 65 20 74 68 69 73 20 73 63 72 69 70 74 0a 20 2a e this script. *
7560: 09 54 43 4c 5f 45 56 41 4c 5f 49 4e 56 4f 4b 45 .TCL_EVAL_INVOKE
7570: 3a 09 4d 61 67 69 63 61 6c 20 54 63 6c 5f 45 76 :.Magical Tcl_Ev
7580: 61 6c 4f 62 6a 76 20 6d 6f 64 65 20 66 6f 72 20 alObjv mode for
7590: 61 6c 69 61 73 65 73 2f 65 6e 73 65 6d 62 6c 65 aliases/ensemble
75a0: 73 0a 20 2a 09 09 09 09 6f 20 52 75 6e 20 69 6e s. *....o Run in
75b0: 20 69 50 74 72 2d 3e 6c 6f 6f 6b 75 70 4e 73 50 iPtr->lookupNsP
75c0: 74 72 20 6f 72 20 67 6c 6f 62 61 6c 20 6e 61 6d tr or global nam
75d0: 65 73 70 61 63 65 0a 20 2a 09 09 09 09 6f 20 43 espace. *....o C
75e0: 75 74 20 6f 75 74 20 6f 66 20 65 72 72 6f 72 20 ut out of error
75f0: 74 72 61 63 65 73 0a 20 2a 09 09 09 09 6f 20 44 traces. *....o D
7600: 6f 6e 27 74 20 72 65 73 65 74 20 74 68 65 20 66 on't reset the f
7610: 6c 61 67 73 20 63 6f 6e 74 72 6f 6c 6c 69 6e 67 lags controlling
7620: 20 65 6e 73 65 6d 62 6c 65 0a 20 2a 09 09 09 09 ensemble. *....
7630: 20 20 65 72 72 6f 72 20 6d 65 73 73 61 67 65 20 error message
7640: 72 65 77 72 69 74 69 6e 67 2e 0a 20 2a 09 54 43 rewriting.. *.TC
7650: 4c 5f 43 41 4e 43 45 4c 5f 55 4e 57 49 4e 44 3a L_CANCEL_UNWIND:
7660: 09 4d 61 67 69 63 61 6c 20 54 63 6c 5f 43 61 6e .Magical Tcl_Can
7670: 63 65 6c 45 76 61 6c 20 6d 6f 64 65 20 74 68 61 celEval mode tha
7680: 74 20 63 61 75 73 65 73 20 74 68 65 0a 20 2a 09 t causes the. *.
7690: 09 09 09 73 74 61 63 6b 20 66 6f 72 20 74 68 65 ...stack for the
76a0: 20 73 63 72 69 70 74 20 69 6e 20 70 72 6f 67 72 script in progr
76b0: 65 73 73 20 74 6f 20 62 65 0a 20 2a 09 09 09 09 ess to be. *....
76c0: 63 6f 6d 70 6c 65 74 65 6c 79 20 75 6e 77 6f 75 completely unwou
76d0: 6e 64 2e 0a 20 2a 09 54 43 4c 5f 45 56 41 4c 5f nd.. *.TCL_EVAL_
76e0: 4e 4f 45 52 52 3a 09 44 6f 20 6e 6f 20 65 78 63 NOERR:.Do no exc
76f0: 65 70 74 69 6f 6e 20 72 65 70 6f 72 74 69 6e 67 eption reporting
7700: 20 61 74 20 61 6c 6c 2c 20 6a 75 73 74 20 72 65 at all, just re
7710: 74 75 72 6e 0a 20 2a 09 09 09 09 61 73 20 74 68 turn. *....as th
7720: 65 20 63 61 6c 6c 65 72 20 77 69 6c 6c 20 72 65 e caller will re
7730: 70 6f 72 74 2e 0a 20 2a 2f 0a 0a 23 64 65 66 69 port.. */..#defi
7740: 6e 65 20 54 43 4c 5f 4e 4f 5f 45 56 41 4c 09 09 ne TCL_NO_EVAL..
7750: 30 78 30 31 30 30 30 30 0a 23 64 65 66 69 6e 65 0x010000.#define
7760: 20 54 43 4c 5f 45 56 41 4c 5f 47 4c 4f 42 41 4c TCL_EVAL_GLOBAL
7770: 09 09 30 78 30 32 30 30 30 30 0a 23 64 65 66 69 ..0x020000.#defi
7780: 6e 65 20 54 43 4c 5f 45 56 41 4c 5f 44 49 52 45 ne TCL_EVAL_DIRE
7790: 43 54 09 09 30 78 30 34 30 30 30 30 0a 23 64 65 CT..0x040000.#de
77a0: 66 69 6e 65 20 54 43 4c 5f 45 56 41 4c 5f 49 4e fine TCL_EVAL_IN
77b0: 56 4f 4b 45 09 09 30 78 30 38 30 30 30 30 0a 23 VOKE..0x080000.#
77c0: 64 65 66 69 6e 65 20 54 43 4c 5f 43 41 4e 43 45 define TCL_CANCE
77d0: 4c 5f 55 4e 57 49 4e 44 09 30 78 31 30 30 30 30 L_UNWIND.0x10000
77e0: 30 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 45 56 0.#define TCL_EV
77f0: 41 4c 5f 4e 4f 45 52 52 20 20 20 20 20 20 20 20 AL_NOERR
7800: 20 20 30 78 32 30 30 30 30 30 0a 0a 2f 2a 0a 20 0x200000../*.
7810: 2a 20 53 70 65 63 69 61 6c 20 66 72 65 65 50 72 * Special freePr
7820: 6f 63 20 76 61 6c 75 65 73 20 74 68 61 74 20 6d oc values that m
7830: 61 79 20 62 65 20 70 61 73 73 65 64 20 74 6f 20 ay be passed to
7840: 54 63 6c 5f 53 65 74 52 65 73 75 6c 74 20 28 73 Tcl_SetResult (s
7850: 65 65 20 74 68 65 20 6d 61 6e 0a 20 2a 20 70 61 ee the man. * pa
7860: 67 65 20 66 6f 72 20 64 65 74 61 69 6c 73 29 3a ge for details):
7870: 0a 20 2a 2f 0a 0a 23 64 65 66 69 6e 65 20 54 43 . */..#define TC
7880: 4c 5f 56 4f 4c 41 54 49 4c 45 09 09 28 28 54 63 L_VOLATILE..((Tc
7890: 6c 5f 46 72 65 65 50 72 6f 63 20 2a 29 20 31 29 l_FreeProc *) 1)
78a0: 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 53 54 41 .#define TCL_STA
78b0: 54 49 43 09 09 28 28 54 63 6c 5f 46 72 65 65 50 TIC..((Tcl_FreeP
78c0: 72 6f 63 20 2a 29 20 30 29 0a 23 64 65 66 69 6e roc *) 0).#defin
78d0: 65 20 54 43 4c 5f 44 59 4e 41 4d 49 43 09 09 28 e TCL_DYNAMIC..(
78e0: 28 54 63 6c 5f 46 72 65 65 50 72 6f 63 20 2a 29 (Tcl_FreeProc *)
78f0: 20 33 29 0a 0a 2f 2a 0a 20 2a 20 46 6c 61 67 20 3)../*. * Flag
7900: 76 61 6c 75 65 73 20 70 61 73 73 65 64 20 74 6f values passed to
7910: 20 76 61 72 69 61 62 6c 65 2d 72 65 6c 61 74 65 variable-relate
7920: 64 20 66 75 6e 63 74 69 6f 6e 73 2e 0a 20 2a 20 d functions.. *
7930: 57 41 52 4e 49 4e 47 3a 20 74 68 65 73 65 20 62 WARNING: these b
7940: 69 74 20 63 68 6f 69 63 65 73 20 6d 75 73 74 20 it choices must
7950: 6e 6f 74 20 63 6f 6e 66 6c 69 63 74 20 77 69 74 not conflict wit
7960: 68 20 74 68 65 20 62 69 74 20 63 68 6f 69 63 65 h the bit choice
7970: 20 66 6f 72 0a 20 2a 20 54 43 4c 5f 43 41 4e 43 for. * TCL_CANC
7980: 45 4c 5f 55 4e 57 49 4e 44 2c 20 61 62 6f 76 65 EL_UNWIND, above
7990: 2e 0a 20 2a 2f 0a 0a 23 64 65 66 69 6e 65 20 54 .. */..#define T
79a0: 43 4c 5f 47 4c 4f 42 41 4c 5f 4f 4e 4c 59 09 09 CL_GLOBAL_ONLY..
79b0: 20 31 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 4e 1.#define TCL_N
79c0: 41 4d 45 53 50 41 43 45 5f 4f 4e 4c 59 09 20 32 AMESPACE_ONLY. 2
79d0: 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 41 50 50 .#define TCL_APP
79e0: 45 4e 44 5f 56 41 4c 55 45 09 20 34 0a 23 64 65 END_VALUE. 4.#de
79f0: 66 69 6e 65 20 54 43 4c 5f 4c 49 53 54 5f 45 4c fine TCL_LIST_EL
7a00: 45 4d 45 4e 54 09 20 38 0a 23 64 65 66 69 6e 65 EMENT. 8.#define
7a10: 20 54 43 4c 5f 54 52 41 43 45 5f 52 45 41 44 53 TCL_TRACE_READS
7a20: 09 09 20 30 78 31 30 0a 23 64 65 66 69 6e 65 20 .. 0x10.#define
7a30: 54 43 4c 5f 54 52 41 43 45 5f 57 52 49 54 45 53 TCL_TRACE_WRITES
7a40: 09 20 30 78 32 30 0a 23 64 65 66 69 6e 65 20 54 . 0x20.#define T
7a50: 43 4c 5f 54 52 41 43 45 5f 55 4e 53 45 54 53 09 CL_TRACE_UNSETS.
7a60: 20 30 78 34 30 0a 23 64 65 66 69 6e 65 20 54 43 0x40.#define TC
7a70: 4c 5f 54 52 41 43 45 5f 44 45 53 54 52 4f 59 45 L_TRACE_DESTROYE
7a80: 44 09 20 30 78 38 30 0a 23 64 65 66 69 6e 65 20 D. 0x80.#define
7a90: 54 43 4c 5f 49 4e 54 45 52 50 5f 44 45 53 54 52 TCL_INTERP_DESTR
7aa0: 4f 59 45 44 09 20 30 78 31 30 30 0a 23 64 65 66 OYED. 0x100.#def
7ab0: 69 6e 65 20 54 43 4c 5f 4c 45 41 56 45 5f 45 52 ine TCL_LEAVE_ER
7ac0: 52 5f 4d 53 47 09 20 30 78 32 30 30 0a 23 64 65 R_MSG. 0x200.#de
7ad0: 66 69 6e 65 20 54 43 4c 5f 54 52 41 43 45 5f 41 fine TCL_TRACE_A
7ae0: 52 52 41 59 09 09 20 30 78 38 30 30 0a 23 69 66 RRAY.. 0x800.#if
7af0: 6e 64 65 66 20 54 43 4c 5f 52 45 4d 4f 56 45 5f ndef TCL_REMOVE_
7b00: 4f 42 53 4f 4c 45 54 45 5f 54 52 41 43 45 53 0a OBSOLETE_TRACES.
7b10: 2f 2a 20 52 65 71 75 69 72 65 64 20 74 6f 20 73 /* Required to s
7b20: 75 70 70 6f 72 74 20 6f 6c 64 20 76 61 72 69 61 upport old varia
7b30: 62 6c 65 2f 76 64 65 6c 65 74 65 2f 76 69 6e 66 ble/vdelete/vinf
7b40: 6f 20 74 72 61 63 65 73 2e 20 2a 2f 0a 23 64 65 o traces. */.#de
7b50: 66 69 6e 65 20 54 43 4c 5f 54 52 41 43 45 5f 4f fine TCL_TRACE_O
7b60: 4c 44 5f 53 54 59 4c 45 09 20 30 78 31 30 30 30 LD_STYLE. 0x1000
7b70: 0a 23 65 6e 64 69 66 0a 2f 2a 20 49 6e 64 69 63 .#endif./* Indic
7b80: 61 74 65 20 74 68 65 20 73 65 6d 61 6e 74 69 63 ate the semantic
7b90: 73 20 6f 66 20 74 68 65 20 72 65 73 75 6c 74 20 s of the result
7ba0: 6f 66 20 61 20 74 72 61 63 65 2e 20 2a 2f 0a 23 of a trace. */.#
7bb0: 64 65 66 69 6e 65 20 54 43 4c 5f 54 52 41 43 45 define TCL_TRACE
7bc0: 5f 52 45 53 55 4c 54 5f 44 59 4e 41 4d 49 43 20 _RESULT_DYNAMIC
7bd0: 30 78 38 30 30 30 0a 23 64 65 66 69 6e 65 20 54 0x8000.#define T
7be0: 43 4c 5f 54 52 41 43 45 5f 52 45 53 55 4c 54 5f CL_TRACE_RESULT_
7bf0: 4f 42 4a 45 43 54 20 20 30 78 31 30 30 30 30 0a OBJECT 0x10000.
7c00: 0a 2f 2a 0a 20 2a 20 46 6c 61 67 20 76 61 6c 75 ./*. * Flag valu
7c10: 65 73 20 66 6f 72 20 65 6e 73 65 6d 62 6c 65 20 es for ensemble
7c20: 63 6f 6d 6d 61 6e 64 73 2e 0a 20 2a 2f 0a 0a 23 commands.. */..#
7c30: 64 65 66 69 6e 65 20 54 43 4c 5f 45 4e 53 45 4d define TCL_ENSEM
7c40: 42 4c 45 5f 50 52 45 46 49 58 20 30 78 30 32 2f BLE_PREFIX 0x02/
7c50: 2a 20 46 6c 61 67 20 76 61 6c 75 65 20 74 6f 20 * Flag value to
7c60: 73 61 79 20 77 68 65 74 68 65 72 20 74 6f 20 61 say whether to a
7c70: 6c 6c 6f 77 0a 09 09 09 09 20 2a 20 75 6e 61 6d llow..... * unam
7c80: 62 69 67 75 6f 75 73 20 70 72 65 66 69 78 65 73 biguous prefixes
7c90: 20 6f 66 20 63 6f 6d 6d 61 6e 64 73 20 6f 72 20 of commands or
7ca0: 74 6f 0a 09 09 09 09 20 2a 20 72 65 71 75 69 72 to..... * requir
7cb0: 65 20 65 78 61 63 74 20 6d 61 74 63 68 65 73 20 e exact matches
7cc0: 66 6f 72 20 63 6f 6d 6d 61 6e 64 20 6e 61 6d 65 for command name
7cd0: 73 2e 20 2a 2f 0a 0a 2f 2a 0a 20 2a 20 46 6c 61 s. */../*. * Fla
7ce0: 67 20 76 61 6c 75 65 73 20 70 61 73 73 65 64 20 g values passed
7cf0: 74 6f 20 63 6f 6d 6d 61 6e 64 2d 72 65 6c 61 74 to command-relat
7d00: 65 64 20 66 75 6e 63 74 69 6f 6e 73 2e 0a 20 2a ed functions.. *
7d10: 2f 0a 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 54 /..#define TCL_T
7d20: 52 41 43 45 5f 52 45 4e 41 4d 45 09 30 78 32 30 RACE_RENAME.0x20
7d30: 30 30 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 54 00.#define TCL_T
7d40: 52 41 43 45 5f 44 45 4c 45 54 45 09 30 78 34 30 RACE_DELETE.0x40
7d50: 30 30 0a 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 00..#define TCL_
7d60: 41 4c 4c 4f 57 5f 49 4e 4c 49 4e 45 5f 43 4f 4d ALLOW_INLINE_COM
7d70: 50 49 4c 41 54 49 4f 4e 20 30 78 32 30 30 30 30 PILATION 0x20000
7d80: 0a 0a 2f 2a 0a 20 2a 20 54 79 70 65 73 20 66 6f ../*. * Types fo
7d90: 72 20 6c 69 6e 6b 65 64 20 76 61 72 69 61 62 6c r linked variabl
7da0: 65 73 3a 0a 20 2a 2f 0a 0a 23 64 65 66 69 6e 65 es:. */..#define
7db0: 20 54 43 4c 5f 4c 49 4e 4b 5f 49 4e 54 09 09 31 TCL_LINK_INT..1
7dc0: 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 4c 49 4e .#define TCL_LIN
7dd0: 4b 5f 44 4f 55 42 4c 45 09 09 32 0a 23 64 65 66 K_DOUBLE..2.#def
7de0: 69 6e 65 20 54 43 4c 5f 4c 49 4e 4b 5f 42 4f 4f ine TCL_LINK_BOO
7df0: 4c 45 41 4e 09 33 0a 23 64 65 66 69 6e 65 20 54 LEAN.3.#define T
7e00: 43 4c 5f 4c 49 4e 4b 5f 53 54 52 49 4e 47 09 09 CL_LINK_STRING..
7e10: 34 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 4c 49 4.#define TCL_LI
7e20: 4e 4b 5f 57 49 44 45 5f 49 4e 54 09 35 0a 23 64 NK_WIDE_INT.5.#d
7e30: 65 66 69 6e 65 20 54 43 4c 5f 4c 49 4e 4b 5f 43 efine TCL_LINK_C
7e40: 48 41 52 09 09 36 0a 23 64 65 66 69 6e 65 20 54 HAR..6.#define T
7e50: 43 4c 5f 4c 49 4e 4b 5f 55 43 48 41 52 09 09 37 CL_LINK_UCHAR..7
7e60: 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 4c 49 4e .#define TCL_LIN
7e70: 4b 5f 53 48 4f 52 54 09 09 38 0a 23 64 65 66 69 K_SHORT..8.#defi
7e80: 6e 65 20 54 43 4c 5f 4c 49 4e 4b 5f 55 53 48 4f ne TCL_LINK_USHO
7e90: 52 54 09 09 39 0a 23 64 65 66 69 6e 65 20 54 43 RT..9.#define TC
7ea0: 4c 5f 4c 49 4e 4b 5f 55 49 4e 54 09 09 31 30 0a L_LINK_UINT..10.
7eb0: 23 69 66 20 64 65 66 69 6e 65 64 28 54 43 4c 5f #if defined(TCL_
7ec0: 57 49 44 45 5f 49 4e 54 5f 49 53 5f 4c 4f 4e 47 WIDE_INT_IS_LONG
7ed0: 29 20 7c 7c 20 64 65 66 69 6e 65 64 28 5f 57 49 ) || defined(_WI
7ee0: 4e 33 32 29 20 7c 7c 20 64 65 66 69 6e 65 64 28 N32) || defined(
7ef0: 5f 5f 43 59 47 57 49 4e 5f 5f 29 0a 23 64 65 66 __CYGWIN__).#def
7f00: 69 6e 65 20 54 43 4c 5f 4c 49 4e 4b 5f 4c 4f 4e ine TCL_LINK_LON
7f10: 47 09 09 28 28 73 69 7a 65 6f 66 28 6c 6f 6e 67 G..((sizeof(long
7f20: 29 20 21 3d 20 73 69 7a 65 6f 66 28 69 6e 74 29 ) != sizeof(int)
7f30: 29 20 3f 20 54 43 4c 5f 4c 49 4e 4b 5f 57 49 44 ) ? TCL_LINK_WID
7f40: 45 5f 49 4e 54 20 3a 20 54 43 4c 5f 4c 49 4e 4b E_INT : TCL_LINK
7f50: 5f 49 4e 54 29 0a 23 64 65 66 69 6e 65 20 54 43 _INT).#define TC
7f60: 4c 5f 4c 49 4e 4b 5f 55 4c 4f 4e 47 09 09 28 28 L_LINK_ULONG..((
7f70: 73 69 7a 65 6f 66 28 6c 6f 6e 67 29 20 21 3d 20 sizeof(long) !=
7f80: 73 69 7a 65 6f 66 28 69 6e 74 29 29 20 3f 20 54 sizeof(int)) ? T
7f90: 43 4c 5f 4c 49 4e 4b 5f 57 49 44 45 5f 55 49 4e CL_LINK_WIDE_UIN
7fa0: 54 20 3a 20 54 43 4c 5f 4c 49 4e 4b 5f 55 49 4e T : TCL_LINK_UIN
7fb0: 54 29 0a 23 65 6c 73 65 0a 23 64 65 66 69 6e 65 T).#else.#define
7fc0: 20 54 43 4c 5f 4c 49 4e 4b 5f 4c 4f 4e 47 09 09 TCL_LINK_LONG..
7fd0: 31 31 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 4c 11.#define TCL_L
7fe0: 49 4e 4b 5f 55 4c 4f 4e 47 09 09 31 32 0a 23 65 INK_ULONG..12.#e
7ff0: 6e 64 69 66 0a 23 64 65 66 69 6e 65 20 54 43 4c ndif.#define TCL
8000: 5f 4c 49 4e 4b 5f 46 4c 4f 41 54 09 09 31 33 0a _LINK_FLOAT..13.
8010: 23 64 65 66 69 6e 65 20 54 43 4c 5f 4c 49 4e 4b #define TCL_LINK
8020: 5f 57 49 44 45 5f 55 49 4e 54 09 31 34 0a 23 64 _WIDE_UINT.14.#d
8030: 65 66 69 6e 65 20 54 43 4c 5f 4c 49 4e 4b 5f 43 efine TCL_LINK_C
8040: 48 41 52 53 09 09 31 35 0a 23 64 65 66 69 6e 65 HARS..15.#define
8050: 20 54 43 4c 5f 4c 49 4e 4b 5f 42 49 4e 41 52 59 TCL_LINK_BINARY
8060: 09 09 31 36 0a 23 64 65 66 69 6e 65 20 54 43 4c ..16.#define TCL
8070: 5f 4c 49 4e 4b 5f 52 45 41 44 5f 4f 4e 4c 59 09 _LINK_READ_ONLY.
8080: 30 78 38 30 0a 0c 0a 2f 2a 0a 20 2a 2d 2d 2d 2d 0x80.../*. *----
8090: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
80a0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
80b0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
80c0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
80d0: 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 2a 20 46 6f 72 77 --------. * Forw
80e0: 61 72 64 20 64 65 63 6c 61 72 61 74 69 6f 6e 73 ard declarations
80f0: 20 6f 66 20 54 63 6c 5f 48 61 73 68 54 61 62 6c of Tcl_HashTabl
8100: 65 20 61 6e 64 20 72 65 6c 61 74 65 64 20 74 79 e and related ty
8110: 70 65 73 2e 0a 20 2a 2f 0a 0a 23 69 66 6e 64 65 pes.. */..#ifnde
8120: 66 20 54 43 4c 5f 48 41 53 48 5f 54 59 50 45 0a f TCL_HASH_TYPE.
8130: 23 20 20 64 65 66 69 6e 65 20 54 43 4c 5f 48 41 # define TCL_HA
8140: 53 48 5f 54 59 50 45 20 73 69 7a 65 5f 74 0a 23 SH_TYPE size_t.#
8150: 65 6e 64 69 66 0a 0a 74 79 70 65 64 65 66 20 73 endif..typedef s
8160: 74 72 75 63 74 20 54 63 6c 5f 48 61 73 68 4b 65 truct Tcl_HashKe
8170: 79 54 79 70 65 20 54 63 6c 5f 48 61 73 68 4b 65 yType Tcl_HashKe
8180: 79 54 79 70 65 3b 0a 74 79 70 65 64 65 66 20 73 yType;.typedef s
8190: 74 72 75 63 74 20 54 63 6c 5f 48 61 73 68 54 61 truct Tcl_HashTa
81a0: 62 6c 65 20 54 63 6c 5f 48 61 73 68 54 61 62 6c ble Tcl_HashTabl
81b0: 65 3b 0a 74 79 70 65 64 65 66 20 73 74 72 75 63 e;.typedef struc
81c0: 74 20 54 63 6c 5f 48 61 73 68 45 6e 74 72 79 20 t Tcl_HashEntry
81d0: 54 63 6c 5f 48 61 73 68 45 6e 74 72 79 3b 0a 0a Tcl_HashEntry;..
81e0: 74 79 70 65 64 65 66 20 54 43 4c 5f 48 41 53 48 typedef TCL_HASH
81f0: 5f 54 59 50 45 20 28 54 63 6c 5f 48 61 73 68 4b _TYPE (Tcl_HashK
8200: 65 79 50 72 6f 63 29 20 28 54 63 6c 5f 48 61 73 eyProc) (Tcl_Has
8210: 68 54 61 62 6c 65 20 2a 74 61 62 6c 65 50 74 72 hTable *tablePtr
8220: 2c 20 76 6f 69 64 20 2a 6b 65 79 50 74 72 29 3b , void *keyPtr);
8230: 0a 74 79 70 65 64 65 66 20 69 6e 74 20 28 54 63 .typedef int (Tc
8240: 6c 5f 43 6f 6d 70 61 72 65 48 61 73 68 4b 65 79 l_CompareHashKey
8250: 73 50 72 6f 63 29 20 28 76 6f 69 64 20 2a 6b 65 sProc) (void *ke
8260: 79 50 74 72 2c 20 54 63 6c 5f 48 61 73 68 45 6e yPtr, Tcl_HashEn
8270: 74 72 79 20 2a 68 50 74 72 29 3b 0a 74 79 70 65 try *hPtr);.type
8280: 64 65 66 20 54 63 6c 5f 48 61 73 68 45 6e 74 72 def Tcl_HashEntr
8290: 79 20 2a 20 28 54 63 6c 5f 41 6c 6c 6f 63 48 61 y * (Tcl_AllocHa
82a0: 73 68 45 6e 74 72 79 50 72 6f 63 29 20 28 54 63 shEntryProc) (Tc
82b0: 6c 5f 48 61 73 68 54 61 62 6c 65 20 2a 74 61 62 l_HashTable *tab
82c0: 6c 65 50 74 72 2c 0a 09 76 6f 69 64 20 2a 6b 65 lePtr,..void *ke
82d0: 79 50 74 72 29 3b 0a 74 79 70 65 64 65 66 20 76 yPtr);.typedef v
82e0: 6f 69 64 20 28 54 63 6c 5f 46 72 65 65 48 61 73 oid (Tcl_FreeHas
82f0: 68 45 6e 74 72 79 50 72 6f 63 29 20 28 54 63 6c hEntryProc) (Tcl
8300: 5f 48 61 73 68 45 6e 74 72 79 20 2a 68 50 74 72 _HashEntry *hPtr
8310: 29 3b 0a 0a 2f 2a 0a 20 2a 20 53 74 72 75 63 74 );../*. * Struct
8320: 75 72 65 20 64 65 66 69 6e 69 74 69 6f 6e 20 66 ure definition f
8330: 6f 72 20 61 6e 20 65 6e 74 72 79 20 69 6e 20 61 or an entry in a
8340: 20 68 61 73 68 20 74 61 62 6c 65 2e 20 4e 6f 2d hash table. No-
8350: 6f 6e 65 20 6f 75 74 73 69 64 65 20 54 63 6c 0a one outside Tcl.
8360: 20 2a 20 73 68 6f 75 6c 64 20 61 63 63 65 73 73 * should access
8370: 20 61 6e 79 20 6f 66 20 74 68 65 73 65 20 66 69 any of these fi
8380: 65 6c 64 73 20 64 69 72 65 63 74 6c 79 3b 20 75 elds directly; u
8390: 73 65 20 74 68 65 20 6d 61 63 72 6f 73 20 64 65 se the macros de
83a0: 66 69 6e 65 64 20 62 65 6c 6f 77 2e 0a 20 2a 2f fined below.. */
83b0: 0a 0a 73 74 72 75 63 74 20 54 63 6c 5f 48 61 73 ..struct Tcl_Has
83c0: 68 45 6e 74 72 79 20 7b 0a 20 20 20 20 54 63 6c hEntry {. Tcl
83d0: 5f 48 61 73 68 45 6e 74 72 79 20 2a 6e 65 78 74 _HashEntry *next
83e0: 50 74 72 3b 09 2f 2a 20 50 6f 69 6e 74 65 72 20 Ptr;./* Pointer
83f0: 74 6f 20 6e 65 78 74 20 65 6e 74 72 79 20 69 6e to next entry in
8400: 20 74 68 69 73 20 68 61 73 68 20 62 75 63 6b 65 this hash bucke
8410: 74 2c 0a 09 09 09 09 20 2a 20 6f 72 20 4e 55 4c t,..... * or NUL
8420: 4c 20 66 6f 72 20 65 6e 64 20 6f 66 20 63 68 61 L for end of cha
8430: 69 6e 2e 20 2a 2f 0a 20 20 20 20 54 63 6c 5f 48 in. */. Tcl_H
8440: 61 73 68 54 61 62 6c 65 20 2a 74 61 62 6c 65 50 ashTable *tableP
8450: 74 72 3b 09 2f 2a 20 50 6f 69 6e 74 65 72 20 74 tr;./* Pointer t
8460: 6f 20 74 61 62 6c 65 20 63 6f 6e 74 61 69 6e 69 o table containi
8470: 6e 67 20 65 6e 74 72 79 2e 20 2a 2f 0a 20 20 20 ng entry. */.
8480: 20 73 69 7a 65 5f 74 20 68 61 73 68 3b 09 09 2f size_t hash;../
8490: 2a 20 48 61 73 68 20 76 61 6c 75 65 2e 20 2a 2f * Hash value. */
84a0: 0a 20 20 20 20 76 6f 69 64 20 2a 63 6c 69 65 6e . void *clien
84b0: 74 44 61 74 61 3b 09 09 2f 2a 20 41 70 70 6c 69 tData;../* Appli
84c0: 63 61 74 69 6f 6e 20 73 74 6f 72 65 73 20 73 6f cation stores so
84d0: 6d 65 74 68 69 6e 67 20 68 65 72 65 20 77 69 74 mething here wit
84e0: 68 0a 09 09 09 09 20 2a 20 54 63 6c 5f 53 65 74 h..... * Tcl_Set
84f0: 48 61 73 68 56 61 6c 75 65 2e 20 2a 2f 0a 20 20 HashValue. */.
8500: 20 20 75 6e 69 6f 6e 20 7b 09 09 09 2f 2a 20 4b union {.../* K
8510: 65 79 20 68 61 73 20 6f 6e 65 20 6f 66 20 74 68 ey has one of th
8520: 65 73 65 20 66 6f 72 6d 73 3a 20 2a 2f 0a 09 63 ese forms: */..c
8530: 68 61 72 20 2a 6f 6e 65 57 6f 72 64 56 61 6c 75 har *oneWordValu
8540: 65 3b 09 2f 2a 20 4f 6e 65 2d 77 6f 72 64 20 76 e;./* One-word v
8550: 61 6c 75 65 20 66 6f 72 20 6b 65 79 2e 20 2a 2f alue for key. */
8560: 0a 09 54 63 6c 5f 4f 62 6a 20 2a 6f 62 6a 50 74 ..Tcl_Obj *objPt
8570: 72 3b 09 2f 2a 20 54 63 6c 5f 4f 62 6a 20 2a 20 r;./* Tcl_Obj *
8580: 6b 65 79 20 76 61 6c 75 65 2e 20 2a 2f 0a 09 69 key value. */..i
8590: 6e 74 20 77 6f 72 64 73 5b 31 5d 3b 09 09 2f 2a nt words[1];../*
85a0: 20 4d 75 6c 74 69 70 6c 65 20 69 6e 74 65 67 65 Multiple intege
85b0: 72 20 77 6f 72 64 73 20 66 6f 72 20 6b 65 79 2e r words for key.
85c0: 20 54 68 65 20 61 63 74 75 61 6c 0a 09 09 09 09 The actual.....
85d0: 20 2a 20 73 69 7a 65 20 77 69 6c 6c 20 62 65 20 * size will be
85e0: 61 73 20 6c 61 72 67 65 20 61 73 20 6e 65 63 65 as large as nece
85f0: 73 73 61 72 79 20 66 6f 72 20 74 68 69 73 0a 09 ssary for this..
8600: 09 09 09 20 2a 20 74 61 62 6c 65 27 73 20 6b 65 ... * table's ke
8610: 79 73 2e 20 2a 2f 0a 09 63 68 61 72 20 73 74 72 ys. */..char str
8620: 69 6e 67 5b 31 5d 3b 09 09 2f 2a 20 53 74 72 69 ing[1];../* Stri
8630: 6e 67 20 66 6f 72 20 6b 65 79 2e 20 54 68 65 20 ng for key. The
8640: 61 63 74 75 61 6c 20 73 69 7a 65 20 77 69 6c 6c actual size will
8650: 20 62 65 20 61 73 0a 09 09 09 09 20 2a 20 6c 61 be as..... * la
8660: 72 67 65 20 61 73 20 6e 65 65 64 65 64 20 74 6f rge as needed to
8670: 20 68 6f 6c 64 20 74 68 65 20 6b 65 79 2e 20 2a hold the key. *
8680: 2f 0a 20 20 20 20 7d 20 6b 65 79 3b 09 09 09 2f /. } key;.../
8690: 2a 20 4d 55 53 54 20 42 45 20 4c 41 53 54 20 46 * MUST BE LAST F
86a0: 49 45 4c 44 20 49 4e 20 52 45 43 4f 52 44 21 21 IELD IN RECORD!!
86b0: 20 2a 2f 0a 7d 3b 0a 0a 2f 2a 0a 20 2a 20 46 6c */.};../*. * Fl
86c0: 61 67 73 20 75 73 65 64 20 69 6e 20 54 63 6c 5f ags used in Tcl_
86d0: 48 61 73 68 4b 65 79 54 79 70 65 2e 0a 20 2a 0a HashKeyType.. *.
86e0: 20 2a 20 54 43 4c 5f 48 41 53 48 5f 4b 45 59 5f * TCL_HASH_KEY_
86f0: 52 41 4e 44 4f 4d 49 5a 45 5f 48 41 53 48 20 2d RANDOMIZE_HASH -
8700: 0a 20 2a 09 09 09 09 54 68 65 72 65 20 61 72 65 . *....There are
8710: 20 73 6f 6d 65 20 74 68 69 6e 67 73 2c 20 70 6f some things, po
8720: 69 6e 74 65 72 73 20 66 6f 72 20 65 78 61 6d 70 inters for examp
8730: 6c 65 0a 20 2a 09 09 09 09 77 68 69 63 68 20 64 le. *....which d
8740: 6f 6e 27 74 20 68 61 73 68 20 77 65 6c 6c 20 62 on't hash well b
8750: 65 63 61 75 73 65 20 74 68 65 79 20 64 6f 20 6e ecause they do n
8760: 6f 74 20 75 73 65 0a 20 2a 09 09 09 09 74 68 65 ot use. *....the
8770: 20 6c 6f 77 65 72 20 62 69 74 73 2e 20 49 66 20 lower bits. If
8780: 74 68 69 73 20 66 6c 61 67 20 69 73 20 73 65 74 this flag is set
8790: 20 74 68 65 6e 20 74 68 65 0a 20 2a 09 09 09 09 then the. *....
87a0: 68 61 73 68 20 74 61 62 6c 65 20 77 69 6c 6c 20 hash table will
87b0: 61 74 74 65 6d 70 74 20 74 6f 20 72 65 63 74 69 attempt to recti
87c0: 66 79 20 74 68 69 73 20 62 79 0a 20 2a 09 09 09 fy this by. *...
87d0: 09 72 61 6e 64 6f 6d 69 73 69 6e 67 20 74 68 65 .randomising the
87e0: 20 62 69 74 73 20 61 6e 64 20 74 68 65 6e 20 75 bits and then u
87f0: 73 69 6e 67 20 74 68 65 20 75 70 70 65 72 0a 20 sing the upper.
8800: 2a 09 09 09 09 4e 20 62 69 74 73 20 61 73 20 74 *....N bits as t
8810: 68 65 20 69 6e 64 65 78 20 69 6e 74 6f 20 74 68 he index into th
8820: 65 20 74 61 62 6c 65 2e 0a 20 2a 20 54 43 4c 5f e table.. * TCL_
8830: 48 41 53 48 5f 4b 45 59 5f 53 59 53 54 45 4d 5f HASH_KEY_SYSTEM_
8840: 48 41 53 48 20 2d 09 49 66 20 74 68 69 73 20 66 HASH -.If this f
8850: 6c 61 67 20 69 73 20 73 65 74 20 74 68 65 6e 20 lag is set then
8860: 61 6c 6c 20 6d 65 6d 6f 72 79 20 69 6e 74 65 72 all memory inter
8870: 6e 61 6c 6c 79 0a 20 2a 20 20 20 20 20 20 20 20 nally. *
8880: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
8890: 20 20 20 20 20 20 61 6c 6c 6f 63 61 74 65 64 20 allocated
88a0: 66 6f 72 20 74 68 65 20 68 61 73 68 20 74 61 62 for the hash tab
88b0: 6c 65 20 74 68 61 74 20 69 73 20 6e 6f 74 20 66 le that is not f
88c0: 6f 72 20 61 6e 0a 20 2a 20 20 20 20 20 20 20 20 or an. *
88d0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
88e0: 20 20 20 20 20 20 65 6e 74 72 79 20 77 69 6c 6c entry will
88f0: 20 75 73 65 20 74 68 65 20 73 79 73 74 65 6d 20 use the system
8900: 68 65 61 70 2e 0a 20 2a 2f 0a 0a 23 64 65 66 69 heap.. */..#defi
8910: 6e 65 20 54 43 4c 5f 48 41 53 48 5f 4b 45 59 5f ne TCL_HASH_KEY_
8920: 52 41 4e 44 4f 4d 49 5a 45 5f 48 41 53 48 20 30 RANDOMIZE_HASH 0
8930: 78 31 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 48 x1.#define TCL_H
8940: 41 53 48 5f 4b 45 59 5f 53 59 53 54 45 4d 5f 48 ASH_KEY_SYSTEM_H
8950: 41 53 48 20 20 20 20 30 78 32 0a 0a 2f 2a 0a 20 ASH 0x2../*.
8960: 2a 20 53 74 72 75 63 74 75 72 65 20 64 65 66 69 * Structure defi
8970: 6e 69 74 69 6f 6e 20 66 6f 72 20 74 68 65 20 6d nition for the m
8980: 65 74 68 6f 64 73 20 61 73 73 6f 63 69 61 74 65 ethods associate
8990: 64 20 77 69 74 68 20 61 20 68 61 73 68 20 74 61 d with a hash ta
89a0: 62 6c 65 20 6b 65 79 20 74 79 70 65 2e 0a 20 2a ble key type.. *
89b0: 2f 0a 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 48 /..#define TCL_H
89c0: 41 53 48 5f 4b 45 59 5f 54 59 50 45 5f 56 45 52 ASH_KEY_TYPE_VER
89d0: 53 49 4f 4e 20 31 0a 73 74 72 75 63 74 20 54 63 SION 1.struct Tc
89e0: 6c 5f 48 61 73 68 4b 65 79 54 79 70 65 20 7b 0a l_HashKeyType {.
89f0: 20 20 20 20 69 6e 74 20 76 65 72 73 69 6f 6e 3b int version;
8a00: 09 09 2f 2a 20 56 65 72 73 69 6f 6e 20 6f 66 20 ../* Version of
8a10: 74 68 65 20 74 61 62 6c 65 2e 20 49 66 20 74 68 the table. If th
8a20: 69 73 20 73 74 72 75 63 74 75 72 65 20 69 73 0a is structure is.
8a30: 09 09 09 09 20 2a 20 65 78 74 65 6e 64 65 64 20 .... * extended
8a40: 69 6e 20 66 75 74 75 72 65 20 74 68 65 6e 20 74 in future then t
8a50: 68 65 20 76 65 72 73 69 6f 6e 20 63 61 6e 20 62 he version can b
8a60: 65 0a 09 09 09 09 20 2a 20 75 73 65 64 20 74 6f e..... * used to
8a70: 20 64 69 73 74 69 6e 67 75 69 73 68 20 62 65 74 distinguish bet
8a80: 77 65 65 6e 20 64 69 66 66 65 72 65 6e 74 0a 09 ween different..
8a90: 09 09 09 20 2a 20 73 74 72 75 63 74 75 72 65 73 ... * structures
8aa0: 2e 20 2a 2f 0a 20 20 20 20 69 6e 74 20 66 6c 61 . */. int fla
8ab0: 67 73 3b 09 09 09 2f 2a 20 46 6c 61 67 73 2c 20 gs;.../* Flags,
8ac0: 73 65 65 20 61 62 6f 76 65 20 66 6f 72 20 64 65 see above for de
8ad0: 74 61 69 6c 73 2e 20 2a 2f 0a 20 20 20 20 54 63 tails. */. Tc
8ae0: 6c 5f 48 61 73 68 4b 65 79 50 72 6f 63 20 2a 68 l_HashKeyProc *h
8af0: 61 73 68 4b 65 79 50 72 6f 63 3b 0a 09 09 09 09 ashKeyProc;.....
8b00: 2f 2a 20 43 61 6c 63 75 6c 61 74 65 73 20 61 20 /* Calculates a
8b10: 68 61 73 68 20 76 61 6c 75 65 20 66 6f 72 20 74 hash value for t
8b20: 68 65 20 6b 65 79 2e 20 49 66 0a 09 09 09 09 20 he key. If.....
8b30: 2a 20 74 68 69 73 20 69 73 20 4e 55 4c 4c 20 74 * this is NULL t
8b40: 68 65 6e 20 74 68 65 20 70 6f 69 6e 74 65 72 20 hen the pointer
8b50: 69 74 73 65 6c 66 20 69 73 0a 09 09 09 09 20 2a itself is..... *
8b60: 20 75 73 65 64 20 61 73 20 61 20 68 61 73 68 20 used as a hash
8b70: 76 61 6c 75 65 2e 20 2a 2f 0a 20 20 20 20 54 63 value. */. Tc
8b80: 6c 5f 43 6f 6d 70 61 72 65 48 61 73 68 4b 65 79 l_CompareHashKey
8b90: 73 50 72 6f 63 20 2a 63 6f 6d 70 61 72 65 4b 65 sProc *compareKe
8ba0: 79 73 50 72 6f 63 3b 0a 09 09 09 09 2f 2a 20 43 ysProc;...../* C
8bb0: 6f 6d 70 61 72 65 73 20 74 77 6f 20 6b 65 79 73 ompares two keys
8bc0: 20 61 6e 64 20 72 65 74 75 72 6e 73 20 7a 65 72 and returns zer
8bd0: 6f 20 69 66 20 74 68 65 79 0a 09 09 09 09 20 2a o if they..... *
8be0: 20 64 6f 20 6e 6f 74 20 6d 61 74 63 68 2c 20 61 do not match, a
8bf0: 6e 64 20 6e 6f 6e 2d 7a 65 72 6f 20 69 66 20 74 nd non-zero if t
8c00: 68 65 79 20 64 6f 2e 20 49 66 0a 09 09 09 09 20 hey do. If.....
8c10: 2a 20 74 68 69 73 20 69 73 20 4e 55 4c 4c 20 74 * this is NULL t
8c20: 68 65 6e 20 74 68 65 20 70 6f 69 6e 74 65 72 73 hen the pointers
8c30: 20 61 72 65 0a 09 09 09 09 20 2a 20 63 6f 6d 70 are..... * comp
8c40: 61 72 65 64 2e 20 2a 2f 0a 20 20 20 20 54 63 6c ared. */. Tcl
8c50: 5f 41 6c 6c 6f 63 48 61 73 68 45 6e 74 72 79 50 _AllocHashEntryP
8c60: 72 6f 63 20 2a 61 6c 6c 6f 63 45 6e 74 72 79 50 roc *allocEntryP
8c70: 72 6f 63 3b 0a 09 09 09 09 2f 2a 20 43 61 6c 6c roc;...../* Call
8c80: 65 64 20 74 6f 20 61 6c 6c 6f 63 61 74 65 20 6d ed to allocate m
8c90: 65 6d 6f 72 79 20 66 6f 72 20 61 20 6e 65 77 20 emory for a new
8ca0: 65 6e 74 72 79 2c 0a 09 09 09 09 20 2a 20 69 2e entry,..... * i.
8cb0: 65 2e 20 69 66 20 74 68 65 20 6b 65 79 20 69 73 e. if the key is
8cc0: 20 61 20 73 74 72 69 6e 67 20 74 68 65 6e 20 74 a string then t
8cd0: 68 69 73 20 63 6f 75 6c 64 0a 09 09 09 09 20 2a his could..... *
8ce0: 20 61 6c 6c 6f 63 61 74 65 20 61 20 73 69 6e 67 allocate a sing
8cf0: 6c 65 20 62 6c 6f 63 6b 20 77 68 69 63 68 20 63 le block which c
8d00: 6f 6e 74 61 69 6e 73 0a 09 09 09 09 20 2a 20 65 ontains..... * e
8d10: 6e 6f 75 67 68 20 73 70 61 63 65 20 66 6f 72 20 nough space for
8d20: 62 6f 74 68 20 74 68 65 20 65 6e 74 72 79 20 61 both the entry a
8d30: 6e 64 20 74 68 65 0a 09 09 09 09 20 2a 20 73 74 nd the..... * st
8d40: 72 69 6e 67 2e 20 4f 6e 6c 79 20 74 68 65 20 6b ring. Only the k
8d50: 65 79 20 66 69 65 6c 64 20 6f 66 20 74 68 65 20 ey field of the
8d60: 61 6c 6c 6f 63 61 74 65 64 0a 09 09 09 09 20 2a allocated..... *
8d70: 20 54 63 6c 5f 48 61 73 68 45 6e 74 72 79 20 73 Tcl_HashEntry s
8d80: 74 72 75 63 74 75 72 65 20 6e 65 65 64 73 20 74 tructure needs t
8d90: 6f 20 62 65 20 66 69 6c 6c 65 64 0a 09 09 09 09 o be filled.....
8da0: 20 2a 20 69 6e 2e 20 49 66 20 73 6f 6d 65 74 68 * in. If someth
8db0: 69 6e 67 20 65 6c 73 65 20 6e 65 65 64 73 20 74 ing else needs t
8dc0: 6f 20 62 65 20 64 6f 6e 65 20 74 6f 0a 09 09 09 o be done to....
8dd0: 09 20 2a 20 74 68 65 20 6b 65 79 2c 20 69 2e 65 . * the key, i.e
8de0: 2e 20 69 6e 63 72 65 6d 65 6e 74 69 6e 67 20 61 . incrementing a
8df0: 20 72 65 66 65 72 65 6e 63 65 0a 09 09 09 09 20 reference.....
8e00: 2a 20 63 6f 75 6e 74 20 74 68 65 6e 20 74 68 61 * count then tha
8e10: 74 20 73 68 6f 75 6c 64 20 62 65 20 64 6f 6e 65 t should be done
8e20: 20 62 79 20 74 68 69 73 0a 09 09 09 09 20 2a 20 by this..... *
8e30: 66 75 6e 63 74 69 6f 6e 2e 20 49 66 20 74 68 69 function. If thi
8e40: 73 20 69 73 20 4e 55 4c 4c 20 74 68 65 6e 20 54 s is NULL then T
8e50: 63 6c 5f 41 6c 6c 6f 63 20 69 73 0a 09 09 09 09 cl_Alloc is.....
8e60: 20 2a 20 75 73 65 64 20 74 6f 20 61 6c 6c 6f 63 * used to alloc
8e70: 61 74 65 20 65 6e 6f 75 67 68 20 73 70 61 63 65 ate enough space
8e80: 20 66 6f 72 20 61 0a 09 09 09 09 20 2a 20 54 63 for a..... * Tc
8e90: 6c 5f 48 61 73 68 45 6e 74 72 79 20 61 6e 64 20 l_HashEntry and
8ea0: 74 68 65 20 6b 65 79 20 70 6f 69 6e 74 65 72 20 the key pointer
8eb0: 69 73 0a 09 09 09 09 20 2a 20 61 73 73 69 67 6e is..... * assign
8ec0: 65 64 20 74 6f 20 6b 65 79 2e 6f 6e 65 57 6f 72 ed to key.oneWor
8ed0: 64 56 61 6c 75 65 2e 20 2a 2f 0a 20 20 20 20 54 dValue. */. T
8ee0: 63 6c 5f 46 72 65 65 48 61 73 68 45 6e 74 72 79 cl_FreeHashEntry
8ef0: 50 72 6f 63 20 2a 66 72 65 65 45 6e 74 72 79 50 Proc *freeEntryP
8f00: 72 6f 63 3b 0a 09 09 09 09 2f 2a 20 43 61 6c 6c roc;...../* Call
8f10: 65 64 20 74 6f 20 66 72 65 65 20 6d 65 6d 6f 72 ed to free memor
8f20: 79 20 61 73 73 6f 63 69 61 74 65 64 20 77 69 74 y associated wit
8f30: 68 20 61 6e 0a 09 09 09 09 20 2a 20 65 6e 74 72 h an..... * entr
8f40: 79 2e 20 49 66 20 73 6f 6d 65 74 68 69 6e 67 20 y. If something
8f50: 65 6c 73 65 20 6e 65 65 64 73 20 74 6f 20 62 65 else needs to be
8f60: 20 64 6f 6e 65 0a 09 09 09 09 20 2a 20 74 6f 20 done..... * to
8f70: 74 68 65 20 6b 65 79 2c 20 69 2e 65 2e 20 64 65 the key, i.e. de
8f80: 63 72 65 6d 65 6e 74 69 6e 67 20 61 20 72 65 66 crementing a ref
8f90: 65 72 65 6e 63 65 0a 09 09 09 09 20 2a 20 63 6f erence..... * co
8fa0: 75 6e 74 20 74 68 65 6e 20 74 68 61 74 20 73 68 unt then that sh
8fb0: 6f 75 6c 64 20 62 65 20 64 6f 6e 65 20 62 79 20 ould be done by
8fc0: 74 68 69 73 0a 09 09 09 09 20 2a 20 66 75 6e 63 this..... * func
8fd0: 74 69 6f 6e 2e 20 49 66 20 74 68 69 73 20 69 73 tion. If this is
8fe0: 20 4e 55 4c 4c 20 74 68 65 6e 20 54 63 6c 5f 46 NULL then Tcl_F
8ff0: 72 65 65 20 69 73 0a 09 09 09 09 20 2a 20 75 73 ree is..... * us
9000: 65 64 20 74 6f 20 66 72 65 65 20 74 68 65 20 54 ed to free the T
9010: 63 6c 5f 48 61 73 68 45 6e 74 72 79 2e 20 2a 2f cl_HashEntry. */
9020: 0a 7d 3b 0a 0a 2f 2a 0a 20 2a 20 53 74 72 75 63 .};../*. * Struc
9030: 74 75 72 65 20 64 65 66 69 6e 69 74 69 6f 6e 20 ture definition
9040: 66 6f 72 20 61 20 68 61 73 68 20 74 61 62 6c 65 for a hash table
9050: 2e 20 20 4d 75 73 74 20 62 65 20 69 6e 20 74 63 . Must be in tc
9060: 6c 2e 68 20 73 6f 20 63 6c 69 65 6e 74 73 20 63 l.h so clients c
9070: 61 6e 0a 20 2a 20 61 6c 6c 6f 63 61 74 65 20 73 an. * allocate s
9080: 70 61 63 65 20 66 6f 72 20 74 68 65 73 65 20 73 pace for these s
9090: 74 72 75 63 74 75 72 65 73 2c 20 62 75 74 20 63 tructures, but c
90a0: 6c 69 65 6e 74 73 20 73 68 6f 75 6c 64 20 6e 65 lients should ne
90b0: 76 65 72 20 61 63 63 65 73 73 20 61 6e 79 0a 20 ver access any.
90c0: 2a 20 66 69 65 6c 64 73 20 69 6e 20 74 68 69 73 * fields in this
90d0: 20 73 74 72 75 63 74 75 72 65 2e 0a 20 2a 2f 0a structure.. */.
90e0: 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 53 4d 41 .#define TCL_SMA
90f0: 4c 4c 5f 48 41 53 48 5f 54 41 42 4c 45 20 34 0a LL_HASH_TABLE 4.
9100: 73 74 72 75 63 74 20 54 63 6c 5f 48 61 73 68 54 struct Tcl_HashT
9110: 61 62 6c 65 20 7b 0a 20 20 20 20 54 63 6c 5f 48 able {. Tcl_H
9120: 61 73 68 45 6e 74 72 79 20 2a 2a 62 75 63 6b 65 ashEntry **bucke
9130: 74 73 3b 09 2f 2a 20 50 6f 69 6e 74 65 72 20 74 ts;./* Pointer t
9140: 6f 20 62 75 63 6b 65 74 20 61 72 72 61 79 2e 20 o bucket array.
9150: 45 61 63 68 20 65 6c 65 6d 65 6e 74 0a 09 09 09 Each element....
9160: 09 20 2a 20 70 6f 69 6e 74 73 20 74 6f 20 66 69 . * points to fi
9170: 72 73 74 20 65 6e 74 72 79 20 69 6e 20 62 75 63 rst entry in buc
9180: 6b 65 74 27 73 20 68 61 73 68 0a 09 09 09 09 20 ket's hash.....
9190: 2a 20 63 68 61 69 6e 2c 20 6f 72 20 4e 55 4c 4c * chain, or NULL
91a0: 2e 20 2a 2f 0a 20 20 20 20 54 63 6c 5f 48 61 73 . */. Tcl_Has
91b0: 68 45 6e 74 72 79 20 2a 73 74 61 74 69 63 42 75 hEntry *staticBu
91c0: 63 6b 65 74 73 5b 54 43 4c 5f 53 4d 41 4c 4c 5f ckets[TCL_SMALL_
91d0: 48 41 53 48 5f 54 41 42 4c 45 5d 3b 0a 09 09 09 HASH_TABLE];....
91e0: 09 2f 2a 20 42 75 63 6b 65 74 20 61 72 72 61 79 ./* Bucket array
91f0: 20 75 73 65 64 20 66 6f 72 20 73 6d 61 6c 6c 20 used for small
9200: 74 61 62 6c 65 73 20 28 74 6f 0a 09 09 09 09 20 tables (to.....
9210: 2a 20 61 76 6f 69 64 20 6d 61 6c 6c 6f 63 73 20 * avoid mallocs
9220: 61 6e 64 20 66 72 65 65 73 29 2e 20 2a 2f 0a 20 and frees). */.
9230: 20 20 20 73 69 7a 65 5f 74 20 6e 75 6d 42 75 63 size_t numBuc
9240: 6b 65 74 73 3b 09 09 2f 2a 20 54 6f 74 61 6c 20 kets;../* Total
9250: 6e 75 6d 62 65 72 20 6f 66 20 62 75 63 6b 65 74 number of bucket
9260: 73 20 61 6c 6c 6f 63 61 74 65 64 20 61 74 0a 09 s allocated at..
9270: 09 09 09 20 2a 20 2a 2a 62 75 63 6b 65 74 50 74 ... * **bucketPt
9280: 72 2e 20 2a 2f 0a 20 20 20 20 73 69 7a 65 5f 74 r. */. size_t
9290: 20 6e 75 6d 45 6e 74 72 69 65 73 3b 09 09 2f 2a numEntries;../*
92a0: 20 54 6f 74 61 6c 20 6e 75 6d 62 65 72 20 6f 66 Total number of
92b0: 20 65 6e 74 72 69 65 73 20 70 72 65 73 65 6e 74 entries present
92c0: 20 69 6e 0a 09 09 09 09 20 2a 20 74 61 62 6c 65 in..... * table
92d0: 2e 20 2a 2f 0a 20 20 20 20 73 69 7a 65 5f 74 20 . */. size_t
92e0: 72 65 62 75 69 6c 64 53 69 7a 65 3b 09 09 2f 2a rebuildSize;../*
92f0: 20 45 6e 6c 61 72 67 65 20 74 61 62 6c 65 20 77 Enlarge table w
9300: 68 65 6e 20 6e 75 6d 45 6e 74 72 69 65 73 20 67 hen numEntries g
9310: 65 74 73 20 74 6f 20 62 65 0a 09 09 09 09 20 2a ets to be..... *
9320: 20 74 68 69 73 20 6c 61 72 67 65 2e 20 2a 2f 0a this large. */.
9330: 20 20 20 20 73 69 7a 65 5f 74 20 6d 61 73 6b 3b size_t mask;
9340: 09 09 2f 2a 20 4d 61 73 6b 20 76 61 6c 75 65 20 ../* Mask value
9350: 75 73 65 64 20 69 6e 20 68 61 73 68 69 6e 67 20 used in hashing
9360: 66 75 6e 63 74 69 6f 6e 2e 20 2a 2f 0a 20 20 20 function. */.
9370: 20 69 6e 74 20 64 6f 77 6e 53 68 69 66 74 3b 09 int downShift;.
9380: 09 2f 2a 20 53 68 69 66 74 20 63 6f 75 6e 74 20 ./* Shift count
9390: 75 73 65 64 20 69 6e 20 68 61 73 68 69 6e 67 20 used in hashing
93a0: 66 75 6e 63 74 69 6f 6e 2e 0a 09 09 09 09 20 2a function...... *
93b0: 20 44 65 73 69 67 6e 65 64 20 74 6f 20 75 73 65 Designed to use
93c0: 20 68 69 67 68 2d 6f 72 64 65 72 20 62 69 74 73 high-order bits
93d0: 20 6f 66 0a 09 09 09 09 20 2a 20 72 61 6e 64 6f of..... * rando
93e0: 6d 69 7a 65 64 20 6b 65 79 73 2e 20 2a 2f 0a 20 mized keys. */.
93f0: 20 20 20 69 6e 74 20 6b 65 79 54 79 70 65 3b 09 int keyType;.
9400: 09 2f 2a 20 54 79 70 65 20 6f 66 20 6b 65 79 73 ./* Type of keys
9410: 20 75 73 65 64 20 69 6e 20 74 68 69 73 20 74 61 used in this ta
9420: 62 6c 65 2e 20 49 74 27 73 0a 09 09 09 09 20 2a ble. It's..... *
9430: 20 65 69 74 68 65 72 20 54 43 4c 5f 43 55 53 54 either TCL_CUST
9440: 4f 4d 5f 4b 45 59 53 2c 20 54 43 4c 5f 53 54 52 OM_KEYS, TCL_STR
9450: 49 4e 47 5f 4b 45 59 53 2c 0a 09 09 09 09 20 2a ING_KEYS,..... *
9460: 20 54 43 4c 5f 4f 4e 45 5f 57 4f 52 44 5f 4b 45 TCL_ONE_WORD_KE
9470: 59 53 2c 20 6f 72 20 61 6e 20 69 6e 74 65 67 65 YS, or an intege
9480: 72 20 67 69 76 69 6e 67 20 74 68 65 0a 09 09 09 r giving the....
9490: 09 20 2a 20 6e 75 6d 62 65 72 20 6f 66 20 69 6e . * number of in
94a0: 74 73 20 74 68 61 74 20 69 73 20 74 68 65 20 73 ts that is the s
94b0: 69 7a 65 20 6f 66 20 74 68 65 0a 09 09 09 09 20 ize of the.....
94c0: 2a 20 6b 65 79 2e 20 2a 2f 0a 20 20 20 20 54 63 * key. */. Tc
94d0: 6c 5f 48 61 73 68 45 6e 74 72 79 20 2a 28 2a 66 l_HashEntry *(*f
94e0: 69 6e 64 50 72 6f 63 29 20 28 54 63 6c 5f 48 61 indProc) (Tcl_Ha
94f0: 73 68 54 61 62 6c 65 20 2a 74 61 62 6c 65 50 74 shTable *tablePt
9500: 72 2c 20 63 6f 6e 73 74 20 63 68 61 72 20 2a 6b r, const char *k
9510: 65 79 29 3b 0a 20 20 20 20 54 63 6c 5f 48 61 73 ey);. Tcl_Has
9520: 68 45 6e 74 72 79 20 2a 28 2a 63 72 65 61 74 65 hEntry *(*create
9530: 50 72 6f 63 29 20 28 54 63 6c 5f 48 61 73 68 54 Proc) (Tcl_HashT
9540: 61 62 6c 65 20 2a 74 61 62 6c 65 50 74 72 2c 20 able *tablePtr,
9550: 63 6f 6e 73 74 20 63 68 61 72 20 2a 6b 65 79 2c const char *key,
9560: 0a 09 20 20 20 20 69 6e 74 20 2a 6e 65 77 50 74 .. int *newPt
9570: 72 29 3b 0a 20 20 20 20 63 6f 6e 73 74 20 54 63 r);. const Tc
9580: 6c 5f 48 61 73 68 4b 65 79 54 79 70 65 20 2a 74 l_HashKeyType *t
9590: 79 70 65 50 74 72 3b 0a 09 09 09 09 2f 2a 20 54 ypePtr;...../* T
95a0: 79 70 65 20 6f 66 20 74 68 65 20 6b 65 79 73 20 ype of the keys
95b0: 75 73 65 64 20 69 6e 20 74 68 65 0a 09 09 09 09 used in the.....
95c0: 20 2a 20 54 63 6c 5f 48 61 73 68 54 61 62 6c 65 * Tcl_HashTable
95d0: 2e 20 2a 2f 0a 7d 3b 0a 0a 2f 2a 0a 20 2a 20 53 . */.};../*. * S
95e0: 74 72 75 63 74 75 72 65 20 64 65 66 69 6e 69 74 tructure definit
95f0: 69 6f 6e 20 66 6f 72 20 69 6e 66 6f 72 6d 61 74 ion for informat
9600: 69 6f 6e 20 75 73 65 64 20 74 6f 20 6b 65 65 70 ion used to keep
9610: 20 74 72 61 63 6b 20 6f 66 20 73 65 61 72 63 68 track of search
9620: 65 73 20 74 68 72 6f 75 67 68 0a 20 2a 20 68 61 es through. * ha
9630: 73 68 20 74 61 62 6c 65 73 3a 0a 20 2a 2f 0a 0a sh tables:. */..
9640: 74 79 70 65 64 65 66 20 73 74 72 75 63 74 20 54 typedef struct T
9650: 63 6c 5f 48 61 73 68 53 65 61 72 63 68 20 7b 0a cl_HashSearch {.
9660: 20 20 20 20 54 63 6c 5f 48 61 73 68 54 61 62 6c Tcl_HashTabl
9670: 65 20 2a 74 61 62 6c 65 50 74 72 3b 09 2f 2a 20 e *tablePtr;./*
9680: 54 61 62 6c 65 20 62 65 69 6e 67 20 73 65 61 72 Table being sear
9690: 63 68 65 64 2e 20 2a 2f 0a 20 20 20 20 73 69 7a ched. */. siz
96a0: 65 5f 74 20 6e 65 78 74 49 6e 64 65 78 3b 09 09 e_t nextIndex;..
96b0: 2f 2a 20 49 6e 64 65 78 20 6f 66 20 6e 65 78 74 /* Index of next
96c0: 20 62 75 63 6b 65 74 20 74 6f 20 62 65 20 65 6e bucket to be en
96d0: 75 6d 65 72 61 74 65 64 20 61 66 74 65 72 0a 09 umerated after..
96e0: 09 09 09 20 2a 20 70 72 65 73 65 6e 74 20 6f 6e ... * present on
96f0: 65 2e 20 2a 2f 0a 20 20 20 20 54 63 6c 5f 48 61 e. */. Tcl_Ha
9700: 73 68 45 6e 74 72 79 20 2a 6e 65 78 74 45 6e 74 shEntry *nextEnt
9710: 72 79 50 74 72 3b 2f 2a 20 4e 65 78 74 20 65 6e ryPtr;/* Next en
9720: 74 72 79 20 74 6f 20 62 65 20 65 6e 75 6d 65 72 try to be enumer
9730: 61 74 65 64 20 69 6e 20 74 68 65 20 63 75 72 72 ated in the curr
9740: 65 6e 74 0a 09 09 09 09 20 2a 20 62 75 63 6b 65 ent..... * bucke
9750: 74 2e 20 2a 2f 0a 7d 20 54 63 6c 5f 48 61 73 68 t. */.} Tcl_Hash
9760: 53 65 61 72 63 68 3b 0a 0a 2f 2a 0a 20 2a 20 41 Search;../*. * A
9770: 63 63 65 70 74 61 62 6c 65 20 6b 65 79 20 74 79 cceptable key ty
9780: 70 65 73 20 66 6f 72 20 68 61 73 68 20 74 61 62 pes for hash tab
9790: 6c 65 73 3a 0a 20 2a 0a 20 2a 20 54 43 4c 5f 53 les:. *. * TCL_S
97a0: 54 52 49 4e 47 5f 4b 45 59 53 3a 09 09 54 68 65 TRING_KEYS:..The
97b0: 20 6b 65 79 73 20 61 72 65 20 73 74 72 69 6e 67 keys are string
97c0: 73 2c 20 74 68 65 79 20 61 72 65 20 63 6f 70 69 s, they are copi
97d0: 65 64 20 69 6e 74 6f 20 74 68 65 0a 20 2a 09 09 ed into the. *..
97e0: 09 09 65 6e 74 72 79 2e 0a 20 2a 20 54 43 4c 5f ..entry.. * TCL_
97f0: 4f 4e 45 5f 57 4f 52 44 5f 4b 45 59 53 3a 09 09 ONE_WORD_KEYS:..
9800: 54 68 65 20 6b 65 79 73 20 61 72 65 20 70 6f 69 The keys are poi
9810: 6e 74 65 72 73 2c 20 74 68 65 20 70 6f 69 6e 74 nters, the point
9820: 65 72 20 69 73 20 73 74 6f 72 65 64 0a 20 2a 09 er is stored. *.
9830: 09 09 09 69 6e 20 74 68 65 20 65 6e 74 72 79 2e ...in the entry.
9840: 0a 20 2a 20 54 43 4c 5f 43 55 53 54 4f 4d 5f 54 . * TCL_CUSTOM_T
9850: 59 50 45 5f 4b 45 59 53 3a 09 54 68 65 20 6b 65 YPE_KEYS:.The ke
9860: 79 73 20 61 72 65 20 61 72 62 69 74 72 61 72 79 ys are arbitrary
9870: 20 74 79 70 65 73 20 77 68 69 63 68 20 61 72 65 types which are
9880: 20 63 6f 70 69 65 64 0a 20 2a 09 09 09 09 69 6e copied. *....in
9890: 74 6f 20 74 68 65 20 65 6e 74 72 79 2e 0a 20 2a to the entry.. *
98a0: 20 54 43 4c 5f 43 55 53 54 4f 4d 5f 50 54 52 5f TCL_CUSTOM_PTR_
98b0: 4b 45 59 53 3a 09 09 54 68 65 20 6b 65 79 73 20 KEYS:..The keys
98c0: 61 72 65 20 70 6f 69 6e 74 65 72 73 20 74 6f 20 are pointers to
98d0: 61 72 62 69 74 72 61 72 79 20 74 79 70 65 73 2c arbitrary types,
98e0: 20 74 68 65 0a 20 2a 09 09 09 09 70 6f 69 6e 74 the. *....point
98f0: 65 72 20 69 73 20 73 74 6f 72 65 64 20 69 6e 20 er is stored in
9900: 74 68 65 20 65 6e 74 72 79 2e 0a 20 2a 0a 20 2a the entry.. *. *
9910: 20 57 68 69 6c 65 20 6d 61 69 6e 74 61 69 6e 69 While maintaini
9920: 6e 67 20 62 69 6e 61 72 79 20 63 6f 6d 70 61 74 ng binary compat
9930: 69 62 69 6c 69 74 79 20 74 68 65 20 61 62 6f 76 ibility the abov
9940: 65 20 68 61 76 65 20 74 6f 20 62 65 20 64 69 73 e have to be dis
9950: 74 69 6e 63 74 20 76 61 6c 75 65 73 0a 20 2a 20 tinct values. *
9960: 61 73 20 74 68 65 79 20 61 72 65 20 75 73 65 64 as they are used
9970: 20 74 6f 20 64 69 66 66 65 72 65 6e 74 69 61 74 to differentiat
9980: 65 20 62 65 74 77 65 65 6e 20 6f 6c 64 20 76 65 e between old ve
9990: 72 73 69 6f 6e 73 20 6f 66 20 74 68 65 20 68 61 rsions of the ha
99a0: 73 68 20 74 61 62 6c 65 0a 20 2a 20 77 68 69 63 sh table. * whic
99b0: 68 20 64 6f 6e 27 74 20 68 61 76 65 20 61 20 74 h don't have a t
99c0: 79 70 65 50 74 72 20 61 6e 64 20 6e 65 77 20 6f ypePtr and new o
99d0: 6e 65 73 20 77 68 69 63 68 20 64 6f 2e 20 4f 6e nes which do. On
99e0: 63 65 20 62 69 6e 61 72 79 20 63 6f 6d 70 61 74 ce binary compat
99f0: 69 62 69 6c 69 74 79 0a 20 2a 20 69 73 20 64 69 ibility. * is di
9a00: 73 63 61 72 64 65 64 20 69 6e 20 66 61 76 6f 75 scarded in favou
9a10: 72 20 6f 66 20 6d 61 6b 69 6e 67 20 6d 6f 72 65 r of making more
9a20: 20 77 69 64 65 20 73 70 72 65 61 64 20 63 68 61 wide spread cha
9a30: 6e 67 65 73 20 54 43 4c 5f 53 54 52 49 4e 47 5f nges TCL_STRING_
9a40: 4b 45 59 53 0a 20 2a 20 63 61 6e 20 62 65 20 74 KEYS. * can be t
9a50: 68 65 20 73 61 6d 65 20 61 73 20 54 43 4c 5f 43 he same as TCL_C
9a60: 55 53 54 4f 4d 5f 54 59 50 45 5f 4b 45 59 53 2c USTOM_TYPE_KEYS,
9a70: 20 61 6e 64 20 54 43 4c 5f 4f 4e 45 5f 57 4f 52 and TCL_ONE_WOR
9a80: 44 5f 4b 45 59 53 20 63 61 6e 20 62 65 20 74 68 D_KEYS can be th
9a90: 65 0a 20 2a 20 73 61 6d 65 20 61 73 20 54 43 4c e. * same as TCL
9aa0: 5f 43 55 53 54 4f 4d 5f 50 54 52 5f 4b 45 59 53 _CUSTOM_PTR_KEYS
9ab0: 20 62 65 63 61 75 73 65 20 74 68 65 79 20 73 69 because they si
9ac0: 6d 70 6c 79 20 64 65 74 65 72 6d 69 6e 65 20 68 mply determine h
9ad0: 6f 77 20 74 68 65 20 6b 65 79 20 69 73 0a 20 2a ow the key is. *
9ae0: 20 61 63 63 65 73 73 65 64 20 66 72 6f 6d 20 74 accessed from t
9af0: 68 65 20 65 6e 74 72 79 20 61 6e 64 20 6e 6f 74 he entry and not
9b00: 20 74 68 65 20 62 65 68 61 76 69 6f 75 72 2e 0a the behaviour..
9b10: 20 2a 2f 0a 0a 23 64 65 66 69 6e 65 20 54 43 4c */..#define TCL
9b20: 5f 53 54 52 49 4e 47 5f 4b 45 59 53 09 09 28 30 _STRING_KEYS..(0
9b30: 29 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 4f 4e ).#define TCL_ON
9b40: 45 5f 57 4f 52 44 5f 4b 45 59 53 09 28 31 29 0a E_WORD_KEYS.(1).
9b50: 23 64 65 66 69 6e 65 20 54 43 4c 5f 43 55 53 54 #define TCL_CUST
9b60: 4f 4d 5f 54 59 50 45 5f 4b 45 59 53 09 28 2d 32 OM_TYPE_KEYS.(-2
9b70: 29 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 43 55 ).#define TCL_CU
9b80: 53 54 4f 4d 5f 50 54 52 5f 4b 45 59 53 09 28 2d STOM_PTR_KEYS.(-
9b90: 31 29 0a 0a 2f 2a 0a 20 2a 20 53 74 72 75 63 74 1)../*. * Struct
9ba0: 75 72 65 20 64 65 66 69 6e 69 74 69 6f 6e 20 66 ure definition f
9bb0: 6f 72 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 75 or information u
9bc0: 73 65 64 20 74 6f 20 6b 65 65 70 20 74 72 61 63 sed to keep trac
9bd0: 6b 20 6f 66 20 73 65 61 72 63 68 65 73 20 74 68 k of searches th
9be0: 72 6f 75 67 68 0a 20 2a 20 64 69 63 74 69 6f 6e rough. * diction
9bf0: 61 72 69 65 73 2e 20 54 68 65 73 65 20 66 69 65 aries. These fie
9c00: 6c 64 73 20 73 68 6f 75 6c 64 20 6e 6f 74 20 62 lds should not b
9c10: 65 20 61 63 63 65 73 73 65 64 20 62 79 20 63 6f e accessed by co
9c20: 64 65 20 6f 75 74 73 69 64 65 0a 20 2a 20 74 63 de outside. * tc
9c30: 6c 44 69 63 74 4f 62 6a 2e 63 0a 20 2a 2f 0a 0a lDictObj.c. */..
9c40: 74 79 70 65 64 65 66 20 73 74 72 75 63 74 20 7b typedef struct {
9c50: 0a 20 20 20 20 76 6f 69 64 20 2a 6e 65 78 74 3b . void *next;
9c60: 09 09 09 2f 2a 20 53 65 61 72 63 68 20 70 6f 73 .../* Search pos
9c70: 69 74 69 6f 6e 20 66 6f 72 20 75 6e 64 65 72 6c ition for underl
9c80: 79 69 6e 67 20 68 61 73 68 0a 09 09 09 09 20 2a ying hash..... *
9c90: 20 74 61 62 6c 65 2e 20 2a 2f 0a 20 20 20 20 73 table. */. s
9ca0: 69 7a 65 5f 74 20 65 70 6f 63 68 3b 09 09 2f 2a ize_t epoch;../*
9cb0: 20 45 70 6f 63 68 20 6d 61 72 6b 65 72 20 66 6f Epoch marker fo
9cc0: 72 20 64 69 63 74 69 6f 6e 61 72 79 20 62 65 69 r dictionary bei
9cd0: 6e 67 20 73 65 61 72 63 68 65 64 2c 0a 09 09 09 ng searched,....
9ce0: 09 20 2a 20 6f 72 20 30 20 69 66 20 73 65 61 72 . * or 0 if sear
9cf0: 63 68 20 68 61 73 20 74 65 72 6d 69 6e 61 74 65 ch has terminate
9d00: 64 2e 20 2a 2f 0a 20 20 20 20 54 63 6c 5f 44 69 d. */. Tcl_Di
9d10: 63 74 20 64 69 63 74 69 6f 6e 61 72 79 50 74 72 ct dictionaryPtr
9d20: 3b 09 2f 2a 20 52 65 66 65 72 65 6e 63 65 20 74 ;./* Reference t
9d30: 6f 20 64 69 63 74 69 6f 6e 61 72 79 20 62 65 69 o dictionary bei
9d40: 6e 67 20 73 65 61 72 63 68 65 64 2e 20 2a 2f 0a ng searched. */.
9d50: 7d 20 54 63 6c 5f 44 69 63 74 53 65 61 72 63 68 } Tcl_DictSearch
9d60: 3b 0a 0c 0a 2f 2a 0a 20 2a 2d 2d 2d 2d 2d 2d 2d ;.../*. *-------
9d70: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
9d80: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
9d90: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
9da0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
9db0: 2d 2d 2d 2d 2d 0a 20 2a 20 46 6c 61 67 20 76 61 -----. * Flag va
9dc0: 6c 75 65 73 20 74 6f 20 70 61 73 73 20 74 6f 20 lues to pass to
9dd0: 54 63 6c 5f 44 6f 4f 6e 65 45 76 65 6e 74 20 74 Tcl_DoOneEvent t
9de0: 6f 20 64 69 73 61 62 6c 65 20 73 65 61 72 63 68 o disable search
9df0: 65 73 20 66 6f 72 20 73 6f 6d 65 20 6b 69 6e 64 es for some kind
9e00: 73 20 6f 66 0a 20 2a 20 65 76 65 6e 74 73 3a 0a s of. * events:.
9e10: 20 2a 2f 0a 0a 23 64 65 66 69 6e 65 20 54 43 4c */..#define TCL
9e20: 5f 44 4f 4e 54 5f 57 41 49 54 09 09 28 31 3c 3c _DONT_WAIT..(1<<
9e30: 31 29 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 57 1).#define TCL_W
9e40: 49 4e 44 4f 57 5f 45 56 45 4e 54 53 09 28 31 3c INDOW_EVENTS.(1<
9e50: 3c 32 29 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f <2).#define TCL_
9e60: 46 49 4c 45 5f 45 56 45 4e 54 53 09 09 28 31 3c FILE_EVENTS..(1<
9e70: 3c 33 29 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f <3).#define TCL_
9e80: 54 49 4d 45 52 5f 45 56 45 4e 54 53 09 28 31 3c TIMER_EVENTS.(1<
9e90: 3c 34 29 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f <4).#define TCL_
9ea0: 49 44 4c 45 5f 45 56 45 4e 54 53 09 09 28 31 3c IDLE_EVENTS..(1<
9eb0: 3c 35 29 09 2f 2a 20 57 41 53 20 30 78 31 30 20 <5)./* WAS 0x10
9ec0: 3f 3f 3f 3f 20 2a 2f 0a 23 64 65 66 69 6e 65 20 ???? */.#define
9ed0: 54 43 4c 5f 41 4c 4c 5f 45 56 45 4e 54 53 09 09 TCL_ALL_EVENTS..
9ee0: 28 7e 54 43 4c 5f 44 4f 4e 54 5f 57 41 49 54 29 (~TCL_DONT_WAIT)
9ef0: 0a 0a 2f 2a 0a 20 2a 20 54 68 65 20 66 6f 6c 6c ../*. * The foll
9f00: 6f 77 69 6e 67 20 73 74 72 75 63 74 75 72 65 20 owing structure
9f10: 64 65 66 69 6e 65 73 20 61 20 67 65 6e 65 72 69 defines a generi
9f20: 63 20 65 76 65 6e 74 20 66 6f 72 20 74 68 65 20 c event for the
9f30: 54 63 6c 20 65 76 65 6e 74 20 73 79 73 74 65 6d Tcl event system
9f40: 2e 0a 20 2a 20 54 68 65 73 65 20 61 72 65 20 74 .. * These are t
9f50: 68 65 20 74 68 69 6e 67 73 20 74 68 61 74 20 61 he things that a
9f60: 72 65 20 71 75 65 75 65 64 20 69 6e 20 63 61 6c re queued in cal
9f70: 6c 73 20 74 6f 20 54 63 6c 5f 51 75 65 75 65 45 ls to Tcl_QueueE
9f80: 76 65 6e 74 20 61 6e 64 0a 20 2a 20 73 65 72 76 vent and. * serv
9f90: 69 63 65 64 20 6c 61 74 65 72 20 62 79 20 54 63 iced later by Tc
9fa0: 6c 5f 44 6f 4f 6e 65 45 76 65 6e 74 2e 20 54 68 l_DoOneEvent. Th
9fb0: 65 72 65 20 63 61 6e 20 62 65 20 6d 61 6e 79 20 ere can be many
9fc0: 64 69 66 66 65 72 65 6e 74 20 6b 69 6e 64 73 20 different kinds
9fd0: 6f 66 0a 20 2a 20 65 76 65 6e 74 73 20 77 69 74 of. * events wit
9fe0: 68 20 64 69 66 66 65 72 65 6e 74 20 66 69 65 6c h different fiel
9ff0: 64 73 2c 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e ds, correspondin
a000: 67 20 74 6f 20 77 69 6e 64 6f 77 20 65 76 65 6e g to window even
a010: 74 73 2c 20 74 69 6d 65 72 20 65 76 65 6e 74 73 ts, timer events
a020: 2c 0a 20 2a 20 65 74 63 2e 20 54 68 65 20 73 74 ,. * etc. The st
a030: 72 75 63 74 75 72 65 20 66 6f 72 20 61 20 70 61 ructure for a pa
a040: 72 74 69 63 75 6c 61 72 20 65 76 65 6e 74 20 63 rticular event c
a050: 6f 6e 73 69 73 74 73 20 6f 66 20 61 20 54 63 6c onsists of a Tcl
a060: 5f 45 76 65 6e 74 20 68 65 61 64 65 72 0a 20 2a _Event header. *
a070: 20 66 6f 6c 6c 6f 77 65 64 20 62 79 20 61 64 64 followed by add
a080: 69 74 69 6f 6e 61 6c 20 69 6e 66 6f 72 6d 61 74 itional informat
a090: 69 6f 6e 20 73 70 65 63 69 66 69 63 20 74 6f 20 ion specific to
a0a0: 74 68 61 74 20 65 76 65 6e 74 2e 0a 20 2a 2f 0a that event.. */.
a0b0: 0a 73 74 72 75 63 74 20 54 63 6c 5f 45 76 65 6e .struct Tcl_Even
a0c0: 74 20 7b 0a 20 20 20 20 54 63 6c 5f 45 76 65 6e t {. Tcl_Even
a0d0: 74 50 72 6f 63 20 2a 70 72 6f 63 3b 09 2f 2a 20 tProc *proc;./*
a0e0: 46 75 6e 63 74 69 6f 6e 20 74 6f 20 63 61 6c 6c Function to call
a0f0: 20 74 6f 20 73 65 72 76 69 63 65 20 74 68 69 73 to service this
a100: 20 65 76 65 6e 74 2e 20 2a 2f 0a 20 20 20 20 73 event. */. s
a110: 74 72 75 63 74 20 54 63 6c 5f 45 76 65 6e 74 20 truct Tcl_Event
a120: 2a 6e 65 78 74 50 74 72 3b 09 2f 2a 20 4e 65 78 *nextPtr;./* Nex
a130: 74 20 69 6e 20 6c 69 73 74 20 6f 66 20 70 65 6e t in list of pen
a140: 64 69 6e 67 20 65 76 65 6e 74 73 2c 20 6f 72 20 ding events, or
a150: 4e 55 4c 4c 2e 20 2a 2f 0a 7d 3b 0a 0a 2f 2a 0a NULL. */.};../*.
a160: 20 2a 20 50 6f 73 69 74 69 6f 6e 73 20 74 6f 20 * Positions to
a170: 70 61 73 73 20 74 6f 20 54 63 6c 5f 51 75 65 75 pass to Tcl_Queu
a180: 65 45 76 65 6e 74 3a 0a 20 2a 2f 0a 0a 74 79 70 eEvent:. */..typ
a190: 65 64 65 66 20 65 6e 75 6d 20 7b 0a 20 20 20 20 edef enum {.
a1a0: 54 43 4c 5f 51 55 45 55 45 5f 54 41 49 4c 2c 20 TCL_QUEUE_TAIL,
a1b0: 54 43 4c 5f 51 55 45 55 45 5f 48 45 41 44 2c 20 TCL_QUEUE_HEAD,
a1c0: 54 43 4c 5f 51 55 45 55 45 5f 4d 41 52 4b 0a 7d TCL_QUEUE_MARK.}
a1d0: 20 54 63 6c 5f 51 75 65 75 65 50 6f 73 69 74 69 Tcl_QueuePositi
a1e0: 6f 6e 3b 0a 0a 2f 2a 0a 20 2a 20 56 61 6c 75 65 on;../*. * Value
a1f0: 73 20 74 6f 20 70 61 73 73 20 74 6f 20 54 63 6c s to pass to Tcl
a200: 5f 53 65 74 53 65 72 76 69 63 65 4d 6f 64 65 20 _SetServiceMode
a210: 74 6f 20 73 70 65 63 69 66 79 20 74 68 65 20 62 to specify the b
a220: 65 68 61 76 69 6f 72 20 6f 66 20 6e 6f 74 69 66 ehavior of notif
a230: 69 65 72 0a 20 2a 20 65 76 65 6e 74 20 72 6f 75 ier. * event rou
a240: 74 69 6e 65 73 2e 0a 20 2a 2f 0a 0a 23 64 65 66 tines.. */..#def
a250: 69 6e 65 20 54 43 4c 5f 53 45 52 56 49 43 45 5f ine TCL_SERVICE_
a260: 4e 4f 4e 45 20 30 0a 23 64 65 66 69 6e 65 20 54 NONE 0.#define T
a270: 43 4c 5f 53 45 52 56 49 43 45 5f 41 4c 4c 20 31 CL_SERVICE_ALL 1
a280: 0a 0a 2f 2a 0a 20 2a 20 54 68 65 20 66 6f 6c 6c ../*. * The foll
a290: 6f 77 69 6e 67 20 73 74 72 75 63 74 75 72 65 20 owing structure
a2a0: 6b 65 65 70 73 20 69 73 20 75 73 65 64 20 74 6f keeps is used to
a2b0: 20 68 6f 6c 64 20 61 20 74 69 6d 65 20 76 61 6c hold a time val
a2c0: 75 65 2c 20 65 69 74 68 65 72 20 61 73 20 61 6e ue, either as an
a2d0: 0a 20 2a 20 61 62 73 6f 6c 75 74 65 20 74 69 6d . * absolute tim
a2e0: 65 20 28 74 68 65 20 6e 75 6d 62 65 72 20 6f 66 e (the number of
a2f0: 20 73 65 63 6f 6e 64 73 20 66 72 6f 6d 20 74 68 seconds from th
a300: 65 20 65 70 6f 63 68 29 20 6f 72 20 61 73 20 61 e epoch) or as a
a310: 6e 20 65 6c 61 70 73 65 64 20 74 69 6d 65 2e 0a n elapsed time..
a320: 20 2a 20 4f 6e 20 55 6e 69 78 20 73 79 73 74 65 * On Unix syste
a330: 6d 73 20 74 68 65 20 65 70 6f 63 68 20 69 73 20 ms the epoch is
a340: 4d 69 64 6e 69 67 68 74 20 4a 61 6e 20 31 2c 20 Midnight Jan 1,
a350: 31 39 37 30 20 47 4d 54 2e 0a 20 2a 2f 0a 0a 74 1970 GMT.. */..t
a360: 79 70 65 64 65 66 20 73 74 72 75 63 74 20 54 63 ypedef struct Tc
a370: 6c 5f 54 69 6d 65 20 7b 0a 20 20 20 20 6c 6f 6e l_Time {. lon
a380: 67 20 73 65 63 3b 09 09 09 2f 2a 20 53 65 63 6f g sec;.../* Seco
a390: 6e 64 73 2e 20 2a 2f 0a 20 20 20 20 6c 6f 6e 67 nds. */. long
a3a0: 20 75 73 65 63 3b 09 09 09 2f 2a 20 4d 69 63 72 usec;.../* Micr
a3b0: 6f 73 65 63 6f 6e 64 73 2e 20 2a 2f 0a 7d 20 54 oseconds. */.} T
a3c0: 63 6c 5f 54 69 6d 65 3b 0a 0a 74 79 70 65 64 65 cl_Time;..typede
a3d0: 66 20 76 6f 69 64 20 28 54 63 6c 5f 53 65 74 54 f void (Tcl_SetT
a3e0: 69 6d 65 72 50 72 6f 63 29 20 28 63 6f 6e 73 74 imerProc) (const
a3f0: 20 54 63 6c 5f 54 69 6d 65 20 2a 74 69 6d 65 50 Tcl_Time *timeP
a400: 74 72 29 3b 0a 74 79 70 65 64 65 66 20 69 6e 74 tr);.typedef int
a410: 20 28 54 63 6c 5f 57 61 69 74 46 6f 72 45 76 65 (Tcl_WaitForEve
a420: 6e 74 50 72 6f 63 29 20 28 63 6f 6e 73 74 20 54 ntProc) (const T
a430: 63 6c 5f 54 69 6d 65 20 2a 74 69 6d 65 50 74 72 cl_Time *timePtr
a440: 29 3b 0a 0a 2f 2a 0a 20 2a 20 54 49 50 20 23 32 );../*. * TIP #2
a450: 33 33 20 28 56 69 72 74 75 61 6c 69 7a 65 64 20 33 (Virtualized
a460: 54 69 6d 65 29 0a 20 2a 2f 0a 0a 74 79 70 65 64 Time). */..typed
a470: 65 66 20 76 6f 69 64 20 28 54 63 6c 5f 47 65 74 ef void (Tcl_Get
a480: 54 69 6d 65 50 72 6f 63 29 20 20 20 28 54 63 6c TimeProc) (Tcl
a490: 5f 54 69 6d 65 20 2a 74 69 6d 65 62 75 66 2c 20 _Time *timebuf,
a4a0: 76 6f 69 64 20 2a 63 6c 69 65 6e 74 44 61 74 61 void *clientData
a4b0: 29 3b 0a 74 79 70 65 64 65 66 20 76 6f 69 64 20 );.typedef void
a4c0: 28 54 63 6c 5f 53 63 61 6c 65 54 69 6d 65 50 72 (Tcl_ScaleTimePr
a4d0: 6f 63 29 20 28 54 63 6c 5f 54 69 6d 65 20 2a 74 oc) (Tcl_Time *t
a4e0: 69 6d 65 62 75 66 2c 20 76 6f 69 64 20 2a 63 6c imebuf, void *cl
a4f0: 69 65 6e 74 44 61 74 61 29 3b 0a 0a 2f 2a 0a 20 ientData);../*.
a500: 2a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d *---------------
a510: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
a520: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
a530: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
a540: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 2a -------------. *
a550: 20 42 69 74 73 20 74 6f 20 70 61 73 73 20 74 6f Bits to pass to
a560: 20 54 63 6c 5f 43 72 65 61 74 65 46 69 6c 65 48 Tcl_CreateFileH
a570: 61 6e 64 6c 65 72 20 61 6e 64 20 54 63 6c 5f 43 andler and Tcl_C
a580: 72 65 61 74 65 43 68 61 6e 6e 65 6c 48 61 6e 64 reateChannelHand
a590: 6c 65 72 20 74 6f 0a 20 2a 20 69 6e 64 69 63 61 ler to. * indica
a5a0: 74 65 20 77 68 61 74 20 73 6f 72 74 73 20 6f 66 te what sorts of
a5b0: 20 65 76 65 6e 74 73 20 61 72 65 20 6f 66 20 69 events are of i
a5c0: 6e 74 65 72 65 73 74 3a 0a 20 2a 2f 0a 0a 23 64 nterest:. */..#d
a5d0: 65 66 69 6e 65 20 54 43 4c 5f 52 45 41 44 41 42 efine TCL_READAB
a5e0: 4c 45 09 09 28 31 3c 3c 31 29 0a 23 64 65 66 69 LE..(1<<1).#defi
a5f0: 6e 65 20 54 43 4c 5f 57 52 49 54 41 42 4c 45 09 ne TCL_WRITABLE.
a600: 09 28 31 3c 3c 32 29 0a 23 64 65 66 69 6e 65 20 .(1<<2).#define
a610: 54 43 4c 5f 45 58 43 45 50 54 49 4f 4e 09 09 28 TCL_EXCEPTION..(
a620: 31 3c 3c 33 29 0a 0a 2f 2a 0a 20 2a 20 46 6c 61 1<<3)../*. * Fla
a630: 67 20 76 61 6c 75 65 73 20 74 6f 20 70 61 73 73 g values to pass
a640: 20 74 6f 20 54 63 6c 5f 4f 70 65 6e 43 6f 6d 6d to Tcl_OpenComm
a650: 61 6e 64 43 68 61 6e 6e 65 6c 20 74 6f 20 69 6e andChannel to in
a660: 64 69 63 61 74 65 20 74 68 65 20 64 69 73 70 6f dicate the dispo
a670: 73 69 74 69 6f 6e 0a 20 2a 20 6f 66 20 74 68 65 sition. * of the
a680: 20 73 74 64 69 6f 20 68 61 6e 64 6c 65 73 2e 20 stdio handles.
a690: 54 43 4c 5f 53 54 44 49 4e 2c 20 54 43 4c 5f 53 TCL_STDIN, TCL_S
a6a0: 54 44 4f 55 54 2c 20 54 43 4c 5f 53 54 44 45 52 TDOUT, TCL_STDER
a6b0: 52 2c 20 61 72 65 20 61 6c 73 6f 20 75 73 65 64 R, are also used
a6c0: 20 69 6e 0a 20 2a 20 54 63 6c 5f 47 65 74 53 74 in. * Tcl_GetSt
a6d0: 64 43 68 61 6e 6e 65 6c 2e 0a 20 2a 2f 0a 0a 23 dChannel.. */..#
a6e0: 64 65 66 69 6e 65 20 54 43 4c 5f 53 54 44 49 4e define TCL_STDIN
a6f0: 09 09 28 31 3c 3c 31 29 0a 23 64 65 66 69 6e 65 ..(1<<1).#define
a700: 20 54 43 4c 5f 53 54 44 4f 55 54 09 09 28 31 3c TCL_STDOUT..(1<
a710: 3c 32 29 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f <2).#define TCL_
a720: 53 54 44 45 52 52 09 09 28 31 3c 3c 33 29 0a 23 STDERR..(1<<3).#
a730: 64 65 66 69 6e 65 20 54 43 4c 5f 45 4e 46 4f 52 define TCL_ENFOR
a740: 43 45 5f 4d 4f 44 45 09 28 31 3c 3c 34 29 0a 0a CE_MODE.(1<<4)..
a750: 2f 2a 0a 20 2a 20 42 69 74 73 20 70 61 73 73 65 /*. * Bits passe
a760: 64 20 74 6f 20 54 63 6c 5f 44 72 69 76 65 72 43 d to Tcl_DriverC
a770: 6c 6f 73 65 32 50 72 6f 63 20 74 6f 20 69 6e 64 lose2Proc to ind
a780: 69 63 61 74 65 20 77 68 69 63 68 20 73 69 64 65 icate which side
a790: 20 6f 66 20 61 20 63 68 61 6e 6e 65 6c 0a 20 2a of a channel. *
a7a0: 20 73 68 6f 75 6c 64 20 62 65 20 63 6c 6f 73 65 should be close
a7b0: 64 2e 0a 20 2a 2f 0a 0a 23 64 65 66 69 6e 65 20 d.. */..#define
a7c0: 54 43 4c 5f 43 4c 4f 53 45 5f 52 45 41 44 09 09 TCL_CLOSE_READ..
a7d0: 28 31 3c 3c 31 29 0a 23 64 65 66 69 6e 65 20 54 (1<<1).#define T
a7e0: 43 4c 5f 43 4c 4f 53 45 5f 57 52 49 54 45 09 09 CL_CLOSE_WRITE..
a7f0: 28 31 3c 3c 32 29 0a 0a 2f 2a 0a 20 2a 20 56 61 (1<<2)../*. * Va
a800: 6c 75 65 20 74 6f 20 75 73 65 20 61 73 20 74 68 lue to use as th
a810: 65 20 63 6c 6f 73 65 50 72 6f 63 20 66 6f 72 20 e closeProc for
a820: 61 20 63 68 61 6e 6e 65 6c 20 74 68 61 74 20 73 a channel that s
a830: 75 70 70 6f 72 74 73 20 74 68 65 20 63 6c 6f 73 upports the clos
a840: 65 32 50 72 6f 63 0a 20 2a 20 69 6e 74 65 72 66 e2Proc. * interf
a850: 61 63 65 2e 0a 20 2a 2f 0a 0a 23 64 65 66 69 6e ace.. */..#defin
a860: 65 20 54 43 4c 5f 43 4c 4f 53 45 32 50 52 4f 43 e TCL_CLOSE2PROC
a870: 09 09 28 28 54 63 6c 5f 44 72 69 76 65 72 43 6c ..((Tcl_DriverCl
a880: 6f 73 65 50 72 6f 63 20 2a 29 20 31 29 0a 0a 2f oseProc *) 1)../
a890: 2a 0a 20 2a 20 43 68 61 6e 6e 65 6c 20 76 65 72 *. * Channel ver
a8a0: 73 69 6f 6e 20 74 61 67 2e 20 54 68 69 73 20 77 sion tag. This w
a8b0: 61 73 20 69 6e 74 72 6f 64 75 63 65 64 20 69 6e as introduced in
a8c0: 20 38 2e 33 2e 32 2f 38 2e 34 2e 0a 20 2a 2f 0a 8.3.2/8.4.. */.
a8d0: 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 43 48 41 .#define TCL_CHA
a8e0: 4e 4e 45 4c 5f 56 45 52 53 49 4f 4e 5f 31 09 28 NNEL_VERSION_1.(
a8f0: 28 54 63 6c 5f 43 68 61 6e 6e 65 6c 54 79 70 65 (Tcl_ChannelType
a900: 56 65 72 73 69 6f 6e 29 20 30 78 31 29 0a 23 64 Version) 0x1).#d
a910: 65 66 69 6e 65 20 54 43 4c 5f 43 48 41 4e 4e 45 efine TCL_CHANNE
a920: 4c 5f 56 45 52 53 49 4f 4e 5f 32 09 28 28 54 63 L_VERSION_2.((Tc
a930: 6c 5f 43 68 61 6e 6e 65 6c 54 79 70 65 56 65 72 l_ChannelTypeVer
a940: 73 69 6f 6e 29 20 30 78 32 29 0a 23 64 65 66 69 sion) 0x2).#defi
a950: 6e 65 20 54 43 4c 5f 43 48 41 4e 4e 45 4c 5f 56 ne TCL_CHANNEL_V
a960: 45 52 53 49 4f 4e 5f 33 09 28 28 54 63 6c 5f 43 ERSION_3.((Tcl_C
a970: 68 61 6e 6e 65 6c 54 79 70 65 56 65 72 73 69 6f hannelTypeVersio
a980: 6e 29 20 30 78 33 29 0a 23 64 65 66 69 6e 65 20 n) 0x3).#define
a990: 54 43 4c 5f 43 48 41 4e 4e 45 4c 5f 56 45 52 53 TCL_CHANNEL_VERS
a9a0: 49 4f 4e 5f 34 09 28 28 54 63 6c 5f 43 68 61 6e ION_4.((Tcl_Chan
a9b0: 6e 65 6c 54 79 70 65 56 65 72 73 69 6f 6e 29 20 nelTypeVersion)
a9c0: 30 78 34 29 0a 23 64 65 66 69 6e 65 20 54 43 4c 0x4).#define TCL
a9d0: 5f 43 48 41 4e 4e 45 4c 5f 56 45 52 53 49 4f 4e _CHANNEL_VERSION
a9e0: 5f 35 09 28 28 54 63 6c 5f 43 68 61 6e 6e 65 6c _5.((Tcl_Channel
a9f0: 54 79 70 65 56 65 72 73 69 6f 6e 29 20 30 78 35 TypeVersion) 0x5
aa00: 29 0a 0a 2f 2a 0a 20 2a 20 54 49 50 20 23 32 31 )../*. * TIP #21
aa10: 38 3a 20 43 68 61 6e 6e 65 6c 20 41 63 74 69 6f 8: Channel Actio
aa20: 6e 73 2c 20 49 64 73 20 66 6f 72 20 54 63 6c 5f ns, Ids for Tcl_
aa30: 44 72 69 76 65 72 54 68 72 65 61 64 41 63 74 69 DriverThreadActi
aa40: 6f 6e 50 72 6f 63 2e 0a 20 2a 2f 0a 0a 23 64 65 onProc.. */..#de
aa50: 66 69 6e 65 20 54 43 4c 5f 43 48 41 4e 4e 45 4c fine TCL_CHANNEL
aa60: 5f 54 48 52 45 41 44 5f 49 4e 53 45 52 54 20 28 _THREAD_INSERT (
aa70: 30 29 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 43 0).#define TCL_C
aa80: 48 41 4e 4e 45 4c 5f 54 48 52 45 41 44 5f 52 45 HANNEL_THREAD_RE
aa90: 4d 4f 56 45 20 28 31 29 0a 0a 2f 2a 0a 20 2a 20 MOVE (1)../*. *
aaa0: 54 79 70 65 64 65 66 73 20 66 6f 72 20 74 68 65 Typedefs for the
aab0: 20 76 61 72 69 6f 75 73 20 6f 70 65 72 61 74 69 various operati
aac0: 6f 6e 73 20 69 6e 20 61 20 63 68 61 6e 6e 65 6c ons in a channel
aad0: 20 74 79 70 65 3a 0a 20 2a 2f 0a 0a 74 79 70 65 type:. */..type
aae0: 64 65 66 20 69 6e 74 09 28 54 63 6c 5f 44 72 69 def int.(Tcl_Dri
aaf0: 76 65 72 42 6c 6f 63 6b 4d 6f 64 65 50 72 6f 63 verBlockModeProc
ab00: 29 20 28 76 6f 69 64 20 2a 69 6e 73 74 61 6e 63 ) (void *instanc
ab10: 65 44 61 74 61 2c 20 69 6e 74 20 6d 6f 64 65 29 eData, int mode)
ab20: 3b 0a 74 79 70 65 64 65 66 20 69 6e 74 09 28 54 ;.typedef int.(T
ab30: 63 6c 5f 44 72 69 76 65 72 43 6c 6f 73 65 50 72 cl_DriverClosePr
ab40: 6f 63 29 20 28 76 6f 69 64 20 2a 69 6e 73 74 61 oc) (void *insta
ab50: 6e 63 65 44 61 74 61 2c 0a 09 09 09 54 63 6c 5f nceData,....Tcl_
ab60: 49 6e 74 65 72 70 20 2a 69 6e 74 65 72 70 29 3b Interp *interp);
ab70: 0a 74 79 70 65 64 65 66 20 69 6e 74 09 28 54 63 .typedef int.(Tc
ab80: 6c 5f 44 72 69 76 65 72 43 6c 6f 73 65 32 50 72 l_DriverClose2Pr
ab90: 6f 63 29 20 28 76 6f 69 64 20 2a 69 6e 73 74 61 oc) (void *insta
aba0: 6e 63 65 44 61 74 61 2c 0a 09 09 09 54 63 6c 5f nceData,....Tcl_
abb0: 49 6e 74 65 72 70 20 2a 69 6e 74 65 72 70 2c 20 Interp *interp,
abc0: 69 6e 74 20 66 6c 61 67 73 29 3b 0a 74 79 70 65 int flags);.type
abd0: 64 65 66 20 69 6e 74 09 28 54 63 6c 5f 44 72 69 def int.(Tcl_Dri
abe0: 76 65 72 49 6e 70 75 74 50 72 6f 63 29 20 28 76 verInputProc) (v
abf0: 6f 69 64 20 2a 69 6e 73 74 61 6e 63 65 44 61 74 oid *instanceDat
ac00: 61 2c 20 63 68 61 72 20 2a 62 75 66 2c 0a 09 09 a, char *buf,...
ac10: 09 69 6e 74 20 74 6f 52 65 61 64 2c 20 69 6e 74 .int toRead, int
ac20: 20 2a 65 72 72 6f 72 43 6f 64 65 50 74 72 29 3b *errorCodePtr);
ac30: 0a 74 79 70 65 64 65 66 20 69 6e 74 09 28 54 63 .typedef int.(Tc
ac40: 6c 5f 44 72 69 76 65 72 4f 75 74 70 75 74 50 72 l_DriverOutputPr
ac50: 6f 63 29 20 28 76 6f 69 64 20 2a 69 6e 73 74 61 oc) (void *insta
ac60: 6e 63 65 44 61 74 61 2c 0a 09 09 09 63 6f 6e 73 nceData,....cons
ac70: 74 20 63 68 61 72 20 2a 62 75 66 2c 20 69 6e 74 t char *buf, int
ac80: 20 74 6f 57 72 69 74 65 2c 20 69 6e 74 20 2a 65 toWrite, int *e
ac90: 72 72 6f 72 43 6f 64 65 50 74 72 29 3b 0a 74 79 rrorCodePtr);.ty
aca0: 70 65 64 65 66 20 69 6e 74 09 28 54 63 6c 5f 44 pedef int.(Tcl_D
acb0: 72 69 76 65 72 53 65 65 6b 50 72 6f 63 29 20 28 riverSeekProc) (
acc0: 76 6f 69 64 20 2a 69 6e 73 74 61 6e 63 65 44 61 void *instanceDa
acd0: 74 61 2c 20 6c 6f 6e 67 20 6f 66 66 73 65 74 2c ta, long offset,
ace0: 0a 09 09 09 69 6e 74 20 6d 6f 64 65 2c 20 69 6e ....int mode, in
acf0: 74 20 2a 65 72 72 6f 72 43 6f 64 65 50 74 72 29 t *errorCodePtr)
ad00: 3b 0a 74 79 70 65 64 65 66 20 69 6e 74 09 28 54 ;.typedef int.(T
ad10: 63 6c 5f 44 72 69 76 65 72 53 65 74 4f 70 74 69 cl_DriverSetOpti
ad20: 6f 6e 50 72 6f 63 29 20 28 76 6f 69 64 20 2a 69 onProc) (void *i
ad30: 6e 73 74 61 6e 63 65 44 61 74 61 2c 0a 09 09 09 nstanceData,....
ad40: 54 63 6c 5f 49 6e 74 65 72 70 20 2a 69 6e 74 65 Tcl_Interp *inte
ad50: 72 70 2c 20 63 6f 6e 73 74 20 63 68 61 72 20 2a rp, const char *
ad60: 6f 70 74 69 6f 6e 4e 61 6d 65 2c 0a 09 09 09 63 optionName,....c
ad70: 6f 6e 73 74 20 63 68 61 72 20 2a 76 61 6c 75 65 onst char *value
ad80: 29 3b 0a 74 79 70 65 64 65 66 20 69 6e 74 09 28 );.typedef int.(
ad90: 54 63 6c 5f 44 72 69 76 65 72 47 65 74 4f 70 74 Tcl_DriverGetOpt
ada0: 69 6f 6e 50 72 6f 63 29 20 28 76 6f 69 64 20 2a ionProc) (void *
adb0: 69 6e 73 74 61 6e 63 65 44 61 74 61 2c 0a 09 09 instanceData,...
adc0: 09 54 63 6c 5f 49 6e 74 65 72 70 20 2a 69 6e 74 .Tcl_Interp *int
add0: 65 72 70 2c 20 63 6f 6e 73 74 20 63 68 61 72 20 erp, const char
ade0: 2a 6f 70 74 69 6f 6e 4e 61 6d 65 2c 0a 09 09 09 *optionName,....
adf0: 54 63 6c 5f 44 53 74 72 69 6e 67 20 2a 64 73 50 Tcl_DString *dsP
ae00: 74 72 29 3b 0a 74 79 70 65 64 65 66 20 76 6f 69 tr);.typedef voi
ae10: 64 09 28 54 63 6c 5f 44 72 69 76 65 72 57 61 74 d.(Tcl_DriverWat
ae20: 63 68 50 72 6f 63 29 20 28 76 6f 69 64 20 2a 69 chProc) (void *i
ae30: 6e 73 74 61 6e 63 65 44 61 74 61 2c 20 69 6e 74 nstanceData, int
ae40: 20 6d 61 73 6b 29 3b 0a 74 79 70 65 64 65 66 20 mask);.typedef
ae50: 69 6e 74 09 28 54 63 6c 5f 44 72 69 76 65 72 47 int.(Tcl_DriverG
ae60: 65 74 48 61 6e 64 6c 65 50 72 6f 63 29 20 28 76 etHandleProc) (v
ae70: 6f 69 64 20 2a 69 6e 73 74 61 6e 63 65 44 61 74 oid *instanceDat
ae80: 61 2c 0a 09 09 09 69 6e 74 20 64 69 72 65 63 74 a,....int direct
ae90: 69 6f 6e 2c 20 76 6f 69 64 20 2a 2a 68 61 6e 64 ion, void **hand
aea0: 6c 65 50 74 72 29 3b 0a 74 79 70 65 64 65 66 20 lePtr);.typedef
aeb0: 69 6e 74 09 28 54 63 6c 5f 44 72 69 76 65 72 46 int.(Tcl_DriverF
aec0: 6c 75 73 68 50 72 6f 63 29 20 28 76 6f 69 64 20 lushProc) (void
aed0: 2a 69 6e 73 74 61 6e 63 65 44 61 74 61 29 3b 0a *instanceData);.
aee0: 74 79 70 65 64 65 66 20 69 6e 74 09 28 54 63 6c typedef int.(Tcl
aef0: 5f 44 72 69 76 65 72 48 61 6e 64 6c 65 72 50 72 _DriverHandlerPr
af00: 6f 63 29 20 28 76 6f 69 64 20 2a 69 6e 73 74 61 oc) (void *insta
af10: 6e 63 65 44 61 74 61 2c 0a 09 09 09 69 6e 74 20 nceData,....int
af20: 69 6e 74 65 72 65 73 74 4d 61 73 6b 29 3b 0a 74 interestMask);.t
af30: 79 70 65 64 65 66 20 54 63 6c 5f 57 69 64 65 49 ypedef Tcl_WideI
af40: 6e 74 20 28 54 63 6c 5f 44 72 69 76 65 72 57 69 nt (Tcl_DriverWi
af50: 64 65 53 65 65 6b 50 72 6f 63 29 20 28 76 6f 69 deSeekProc) (voi
af60: 64 20 2a 69 6e 73 74 61 6e 63 65 44 61 74 61 2c d *instanceData,
af70: 0a 09 09 09 54 63 6c 5f 57 69 64 65 49 6e 74 20 ....Tcl_WideInt
af80: 6f 66 66 73 65 74 2c 20 69 6e 74 20 6d 6f 64 65 offset, int mode
af90: 2c 20 69 6e 74 20 2a 65 72 72 6f 72 43 6f 64 65 , int *errorCode
afa0: 50 74 72 29 3b 0a 2f 2a 0a 20 2a 20 54 49 50 20 Ptr);./*. * TIP
afb0: 23 32 31 38 2c 20 43 68 61 6e 6e 65 6c 20 54 68 #218, Channel Th
afc0: 72 65 61 64 20 41 63 74 69 6f 6e 73 0a 20 2a 2f read Actions. */
afd0: 0a 74 79 70 65 64 65 66 20 76 6f 69 64 09 28 54 .typedef void.(T
afe0: 63 6c 5f 44 72 69 76 65 72 54 68 72 65 61 64 41 cl_DriverThreadA
aff0: 63 74 69 6f 6e 50 72 6f 63 29 20 28 76 6f 69 64 ctionProc) (void
b000: 20 2a 69 6e 73 74 61 6e 63 65 44 61 74 61 2c 0a *instanceData,.
b010: 09 09 09 69 6e 74 20 61 63 74 69 6f 6e 29 3b 0a ...int action);.
b020: 2f 2a 0a 20 2a 20 54 49 50 20 23 32 30 38 2c 20 /*. * TIP #208,
b030: 46 69 6c 65 20 54 72 75 6e 63 61 74 69 6f 6e 20 File Truncation
b040: 28 65 74 63 2e 29 0a 20 2a 2f 0a 74 79 70 65 64 (etc.). */.typed
b050: 65 66 20 69 6e 74 09 28 54 63 6c 5f 44 72 69 76 ef int.(Tcl_Driv
b060: 65 72 54 72 75 6e 63 61 74 65 50 72 6f 63 29 20 erTruncateProc)
b070: 28 76 6f 69 64 20 2a 69 6e 73 74 61 6e 63 65 44 (void *instanceD
b080: 61 74 61 2c 0a 09 09 09 54 63 6c 5f 57 69 64 65 ata,....Tcl_Wide
b090: 49 6e 74 20 6c 65 6e 67 74 68 29 3b 0a 0a 2f 2a Int length);../*
b0a0: 0a 20 2a 20 73 74 72 75 63 74 20 54 63 6c 5f 43 . * struct Tcl_C
b0b0: 68 61 6e 6e 65 6c 54 79 70 65 3a 0a 20 2a 0a 20 hannelType:. *.
b0c0: 2a 20 4f 6e 65 20 73 75 63 68 20 73 74 72 75 63 * One such struc
b0d0: 74 75 72 65 20 65 78 69 73 74 73 20 66 6f 72 20 ture exists for
b0e0: 65 61 63 68 20 74 79 70 65 20 28 6b 69 6e 64 29 each type (kind)
b0f0: 20 6f 66 20 63 68 61 6e 6e 65 6c 2e 20 49 74 20 of channel. It
b100: 63 6f 6c 6c 65 63 74 73 0a 20 2a 20 74 6f 67 65 collects. * toge
b110: 74 68 65 72 20 69 6e 20 6f 6e 65 20 70 6c 61 63 ther in one plac
b120: 65 20 61 6c 6c 20 74 68 65 20 66 75 6e 63 74 69 e all the functi
b130: 6f 6e 73 20 74 68 61 74 20 61 72 65 20 70 61 72 ons that are par
b140: 74 20 6f 66 20 74 68 65 20 73 70 65 63 69 66 69 t of the specifi
b150: 63 0a 20 2a 20 63 68 61 6e 6e 65 6c 20 74 79 70 c. * channel typ
b160: 65 2e 0a 20 2a 0a 20 2a 20 49 74 20 69 73 20 72 e.. *. * It is r
b170: 65 63 6f 6d 6d 65 6e 64 20 74 68 61 74 20 74 68 ecommend that th
b180: 65 20 54 63 6c 5f 43 68 61 6e 6e 65 6c 2a 20 66 e Tcl_Channel* f
b190: 75 6e 63 74 69 6f 6e 73 20 61 72 65 20 75 73 65 unctions are use
b1a0: 64 20 74 6f 20 61 63 63 65 73 73 20 65 6c 65 6d d to access elem
b1b0: 65 6e 74 73 0a 20 2a 20 6f 66 20 74 68 69 73 20 ents. * of this
b1c0: 73 74 72 75 63 74 75 72 65 2c 20 69 6e 73 74 65 structure, inste
b1d0: 61 64 20 6f 66 20 64 69 72 65 63 74 20 61 63 63 ad of direct acc
b1e0: 65 73 73 69 6e 67 2e 0a 20 2a 2f 0a 0a 74 79 70 essing.. */..typ
b1f0: 65 64 65 66 20 73 74 72 75 63 74 20 54 63 6c 5f edef struct Tcl_
b200: 43 68 61 6e 6e 65 6c 54 79 70 65 20 7b 0a 20 20 ChannelType {.
b210: 20 20 63 6f 6e 73 74 20 63 68 61 72 20 2a 74 79 const char *ty
b220: 70 65 4e 61 6d 65 3b 09 2f 2a 20 54 68 65 20 6e peName;./* The n
b230: 61 6d 65 20 6f 66 20 74 68 65 20 63 68 61 6e 6e ame of the chann
b240: 65 6c 20 74 79 70 65 20 69 6e 20 54 63 6c 0a 09 el type in Tcl..
b250: 09 09 09 20 2a 20 63 6f 6d 6d 61 6e 64 73 2e 20 ... * commands.
b260: 54 68 69 73 20 73 74 6f 72 61 67 65 20 69 73 20 This storage is
b270: 6f 77 6e 65 64 20 62 79 20 63 68 61 6e 6e 65 6c owned by channel
b280: 0a 09 09 09 09 20 2a 20 74 79 70 65 2e 20 2a 2f ..... * type. */
b290: 0a 20 20 20 20 54 63 6c 5f 43 68 61 6e 6e 65 6c . Tcl_Channel
b2a0: 54 79 70 65 56 65 72 73 69 6f 6e 20 76 65 72 73 TypeVersion vers
b2b0: 69 6f 6e 3b 0a 09 09 09 09 2f 2a 20 56 65 72 73 ion;...../* Vers
b2c0: 69 6f 6e 20 6f 66 20 74 68 65 20 63 68 61 6e 6e ion of the chann
b2d0: 65 6c 20 74 79 70 65 2e 20 2a 2f 0a 20 20 20 20 el type. */.
b2e0: 54 63 6c 5f 44 72 69 76 65 72 43 6c 6f 73 65 50 Tcl_DriverCloseP
b2f0: 72 6f 63 20 2a 63 6c 6f 73 65 50 72 6f 63 3b 0a roc *closeProc;.
b300: 09 09 09 09 2f 2a 20 46 75 6e 63 74 69 6f 6e 20 ..../* Function
b310: 74 6f 20 63 61 6c 6c 20 74 6f 20 63 6c 6f 73 65 to call to close
b320: 20 74 68 65 20 63 68 61 6e 6e 65 6c 2c 20 6f 72 the channel, or
b330: 0a 09 09 09 09 20 2a 20 54 43 4c 5f 43 4c 4f 53 ..... * TCL_CLOS
b340: 45 32 50 52 4f 43 20 69 66 20 74 68 65 20 63 6c E2PROC if the cl
b350: 6f 73 65 32 50 72 6f 63 20 73 68 6f 75 6c 64 20 ose2Proc should
b360: 62 65 0a 09 09 09 09 20 2a 20 75 73 65 64 20 69 be..... * used i
b370: 6e 73 74 65 61 64 2e 20 2a 2f 0a 20 20 20 20 54 nstead. */. T
b380: 63 6c 5f 44 72 69 76 65 72 49 6e 70 75 74 50 72 cl_DriverInputPr
b390: 6f 63 20 2a 69 6e 70 75 74 50 72 6f 63 3b 0a 09 oc *inputProc;..
b3a0: 09 09 09 2f 2a 20 46 75 6e 63 74 69 6f 6e 20 74 .../* Function t
b3b0: 6f 20 63 61 6c 6c 20 66 6f 72 20 69 6e 70 75 74 o call for input
b3c0: 20 6f 6e 20 63 68 61 6e 6e 65 6c 2e 20 2a 2f 0a on channel. */.
b3d0: 20 20 20 20 54 63 6c 5f 44 72 69 76 65 72 4f 75 Tcl_DriverOu
b3e0: 74 70 75 74 50 72 6f 63 20 2a 6f 75 74 70 75 74 tputProc *output
b3f0: 50 72 6f 63 3b 0a 09 09 09 09 2f 2a 20 46 75 6e Proc;...../* Fun
b400: 63 74 69 6f 6e 20 74 6f 20 63 61 6c 6c 20 66 6f ction to call fo
b410: 72 20 6f 75 74 70 75 74 20 6f 6e 20 63 68 61 6e r output on chan
b420: 6e 65 6c 2e 20 2a 2f 0a 20 20 20 20 54 63 6c 5f nel. */. Tcl_
b430: 44 72 69 76 65 72 53 65 65 6b 50 72 6f 63 20 2a DriverSeekProc *
b440: 73 65 65 6b 50 72 6f 63 3b 0a 09 09 09 09 2f 2a seekProc;...../*
b450: 20 46 75 6e 63 74 69 6f 6e 20 74 6f 20 63 61 6c Function to cal
b460: 6c 20 74 6f 20 73 65 65 6b 20 6f 6e 20 74 68 65 l to seek on the
b470: 20 63 68 61 6e 6e 65 6c 2e 0a 09 09 09 09 20 2a channel...... *
b480: 20 4d 61 79 20 62 65 20 4e 55 4c 4c 2e 20 2a 2f May be NULL. */
b490: 0a 20 20 20 20 54 63 6c 5f 44 72 69 76 65 72 53 . Tcl_DriverS
b4a0: 65 74 4f 70 74 69 6f 6e 50 72 6f 63 20 2a 73 65 etOptionProc *se
b4b0: 74 4f 70 74 69 6f 6e 50 72 6f 63 3b 0a 09 09 09 tOptionProc;....
b4c0: 09 2f 2a 20 53 65 74 20 61 6e 20 6f 70 74 69 6f ./* Set an optio
b4d0: 6e 20 6f 6e 20 61 20 63 68 61 6e 6e 65 6c 2e 20 n on a channel.
b4e0: 2a 2f 0a 20 20 20 20 54 63 6c 5f 44 72 69 76 65 */. Tcl_Drive
b4f0: 72 47 65 74 4f 70 74 69 6f 6e 50 72 6f 63 20 2a rGetOptionProc *
b500: 67 65 74 4f 70 74 69 6f 6e 50 72 6f 63 3b 0a 09 getOptionProc;..
b510: 09 09 09 2f 2a 20 47 65 74 20 61 6e 20 6f 70 74 .../* Get an opt
b520: 69 6f 6e 20 66 72 6f 6d 20 61 20 63 68 61 6e 6e ion from a chann
b530: 65 6c 2e 20 2a 2f 0a 20 20 20 20 54 63 6c 5f 44 el. */. Tcl_D
b540: 72 69 76 65 72 57 61 74 63 68 50 72 6f 63 20 2a riverWatchProc *
b550: 77 61 74 63 68 50 72 6f 63 3b 0a 09 09 09 09 2f watchProc;...../
b560: 2a 20 53 65 74 20 75 70 20 74 68 65 20 6e 6f 74 * Set up the not
b570: 69 66 69 65 72 20 74 6f 20 77 61 74 63 68 20 66 ifier to watch f
b580: 6f 72 20 65 76 65 6e 74 73 20 6f 6e 0a 09 09 09 or events on....
b590: 09 20 2a 20 74 68 69 73 20 63 68 61 6e 6e 65 6c . * this channel
b5a0: 2e 20 2a 2f 0a 20 20 20 20 54 63 6c 5f 44 72 69 . */. Tcl_Dri
b5b0: 76 65 72 47 65 74 48 61 6e 64 6c 65 50 72 6f 63 verGetHandleProc
b5c0: 20 2a 67 65 74 48 61 6e 64 6c 65 50 72 6f 63 3b *getHandleProc;
b5d0: 0a 09 09 09 09 2f 2a 20 47 65 74 20 61 6e 20 4f ...../* Get an O
b5e0: 53 20 68 61 6e 64 6c 65 20 66 72 6f 6d 20 74 68 S handle from th
b5f0: 65 20 63 68 61 6e 6e 65 6c 20 6f 72 20 4e 55 4c e channel or NUL
b600: 4c 0a 09 09 09 09 20 2a 20 69 66 20 6e 6f 74 20 L..... * if not
b610: 73 75 70 70 6f 72 74 65 64 2e 20 2a 2f 0a 20 20 supported. */.
b620: 20 20 54 63 6c 5f 44 72 69 76 65 72 43 6c 6f 73 Tcl_DriverClos
b630: 65 32 50 72 6f 63 20 2a 63 6c 6f 73 65 32 50 72 e2Proc *close2Pr
b640: 6f 63 3b 0a 09 09 09 09 2f 2a 20 46 75 6e 63 74 oc;...../* Funct
b650: 69 6f 6e 20 74 6f 20 63 61 6c 6c 20 74 6f 20 63 ion to call to c
b660: 6c 6f 73 65 20 74 68 65 20 63 68 61 6e 6e 65 6c lose the channel
b670: 20 69 66 0a 09 09 09 09 20 2a 20 74 68 65 20 64 if..... * the d
b680: 65 76 69 63 65 20 73 75 70 70 6f 72 74 73 20 63 evice supports c
b690: 6c 6f 73 69 6e 67 20 74 68 65 20 72 65 61 64 20 losing the read
b6a0: 26 0a 09 09 09 09 20 2a 20 77 72 69 74 65 20 73 &..... * write s
b6b0: 69 64 65 73 20 69 6e 64 65 70 65 6e 64 65 6e 74 ides independent
b6c0: 6c 79 2e 20 2a 2f 0a 20 20 20 20 54 63 6c 5f 44 ly. */. Tcl_D
b6d0: 72 69 76 65 72 42 6c 6f 63 6b 4d 6f 64 65 50 72 riverBlockModePr
b6e0: 6f 63 20 2a 62 6c 6f 63 6b 4d 6f 64 65 50 72 6f oc *blockModePro
b6f0: 63 3b 0a 09 09 09 09 2f 2a 20 53 65 74 20 62 6c c;...../* Set bl
b700: 6f 63 6b 69 6e 67 20 6d 6f 64 65 20 66 6f 72 20 ocking mode for
b710: 74 68 65 20 72 61 77 20 63 68 61 6e 6e 65 6c 2e the raw channel.
b720: 20 4d 61 79 0a 09 09 09 09 20 2a 20 62 65 20 4e May..... * be N
b730: 55 4c 4c 2e 20 2a 2f 0a 20 20 20 20 2f 2a 0a 20 ULL. */. /*.
b740: 20 20 20 20 2a 20 4f 6e 6c 79 20 76 61 6c 69 64 * Only valid
b750: 20 69 6e 20 54 43 4c 5f 43 48 41 4e 4e 45 4c 5f in TCL_CHANNEL_
b760: 56 45 52 53 49 4f 4e 5f 32 20 63 68 61 6e 6e 65 VERSION_2 channe
b770: 6c 73 20 6f 72 20 6c 61 74 65 72 2e 0a 20 20 20 ls or later..
b780: 20 20 2a 2f 0a 20 20 20 20 54 63 6c 5f 44 72 69 */. Tcl_Dri
b790: 76 65 72 46 6c 75 73 68 50 72 6f 63 20 2a 66 6c verFlushProc *fl
b7a0: 75 73 68 50 72 6f 63 3b 0a 09 09 09 09 2f 2a 20 ushProc;...../*
b7b0: 46 75 6e 63 74 69 6f 6e 20 74 6f 20 63 61 6c 6c Function to call
b7c0: 20 74 6f 20 66 6c 75 73 68 20 61 20 63 68 61 6e to flush a chan
b7d0: 6e 65 6c 2e 20 4d 61 79 20 62 65 0a 09 09 09 09 nel. May be.....
b7e0: 20 2a 20 4e 55 4c 4c 2e 20 2a 2f 0a 20 20 20 20 * NULL. */.
b7f0: 54 63 6c 5f 44 72 69 76 65 72 48 61 6e 64 6c 65 Tcl_DriverHandle
b800: 72 50 72 6f 63 20 2a 68 61 6e 64 6c 65 72 50 72 rProc *handlerPr
b810: 6f 63 3b 0a 09 09 09 09 2f 2a 20 46 75 6e 63 74 oc;...../* Funct
b820: 69 6f 6e 20 74 6f 20 63 61 6c 6c 20 74 6f 20 68 ion to call to h
b830: 61 6e 64 6c 65 20 61 20 63 68 61 6e 6e 65 6c 20 andle a channel
b840: 65 76 65 6e 74 2e 0a 09 09 09 09 20 2a 20 54 68 event...... * Th
b850: 69 73 20 77 69 6c 6c 20 62 65 20 70 61 73 73 65 is will be passe
b860: 64 20 75 70 20 74 68 65 20 73 74 61 63 6b 65 64 d up the stacked
b870: 20 63 68 61 6e 6e 65 6c 0a 09 09 09 09 20 2a 20 channel..... *
b880: 63 68 61 69 6e 2e 20 2a 2f 0a 20 20 20 20 2f 2a chain. */. /*
b890: 0a 20 20 20 20 20 2a 20 4f 6e 6c 79 20 76 61 6c . * Only val
b8a0: 69 64 20 69 6e 20 54 43 4c 5f 43 48 41 4e 4e 45 id in TCL_CHANNE
b8b0: 4c 5f 56 45 52 53 49 4f 4e 5f 33 20 63 68 61 6e L_VERSION_3 chan
b8c0: 6e 65 6c 73 20 6f 72 20 6c 61 74 65 72 2e 0a 20 nels or later..
b8d0: 20 20 20 20 2a 2f 0a 20 20 20 20 54 63 6c 5f 44 */. Tcl_D
b8e0: 72 69 76 65 72 57 69 64 65 53 65 65 6b 50 72 6f riverWideSeekPro
b8f0: 63 20 2a 77 69 64 65 53 65 65 6b 50 72 6f 63 3b c *wideSeekProc;
b900: 0a 09 09 09 09 2f 2a 20 46 75 6e 63 74 69 6f 6e ...../* Function
b910: 20 74 6f 20 63 61 6c 6c 20 74 6f 20 73 65 65 6b to call to seek
b920: 20 6f 6e 20 74 68 65 20 63 68 61 6e 6e 65 6c 0a on the channel.
b930: 09 09 09 09 20 2a 20 77 68 69 63 68 20 63 61 6e .... * which can
b940: 20 68 61 6e 64 6c 65 20 36 34 2d 62 69 74 20 6f handle 64-bit o
b950: 66 66 73 65 74 73 2e 20 4d 61 79 20 62 65 0a 09 ffsets. May be..
b960: 09 09 09 20 2a 20 4e 55 4c 4c 2c 20 61 6e 64 20 ... * NULL, and
b970: 6d 75 73 74 20 62 65 20 4e 55 4c 4c 20 69 66 20 must be NULL if
b980: 73 65 65 6b 50 72 6f 63 20 69 73 0a 09 09 09 09 seekProc is.....
b990: 20 2a 20 4e 55 4c 4c 2e 20 2a 2f 0a 20 20 20 20 * NULL. */.
b9a0: 2f 2a 0a 20 20 20 20 20 2a 20 4f 6e 6c 79 20 76 /*. * Only v
b9b0: 61 6c 69 64 20 69 6e 20 54 43 4c 5f 43 48 41 4e alid in TCL_CHAN
b9c0: 4e 45 4c 5f 56 45 52 53 49 4f 4e 5f 34 20 63 68 NEL_VERSION_4 ch
b9d0: 61 6e 6e 65 6c 73 20 6f 72 20 6c 61 74 65 72 2e annels or later.
b9e0: 0a 20 20 20 20 20 2a 20 54 49 50 20 23 32 31 38 . * TIP #218
b9f0: 2c 20 43 68 61 6e 6e 65 6c 20 54 68 72 65 61 64 , Channel Thread
ba00: 20 41 63 74 69 6f 6e 73 2e 0a 20 20 20 20 20 2a Actions.. *
ba10: 2f 0a 20 20 20 20 54 63 6c 5f 44 72 69 76 65 72 /. Tcl_Driver
ba20: 54 68 72 65 61 64 41 63 74 69 6f 6e 50 72 6f 63 ThreadActionProc
ba30: 20 2a 74 68 72 65 61 64 41 63 74 69 6f 6e 50 72 *threadActionPr
ba40: 6f 63 3b 0a 09 09 09 09 2f 2a 20 46 75 6e 63 74 oc;...../* Funct
ba50: 69 6f 6e 20 74 6f 20 63 61 6c 6c 20 74 6f 20 6e ion to call to n
ba60: 6f 74 69 66 79 20 74 68 65 20 64 72 69 76 65 72 otify the driver
ba70: 20 6f 66 0a 09 09 09 09 20 2a 20 74 68 72 65 61 of..... * threa
ba80: 64 20 73 70 65 63 69 66 69 63 20 61 63 74 69 76 d specific activ
ba90: 69 74 79 20 66 6f 72 20 61 20 63 68 61 6e 6e 65 ity for a channe
baa0: 6c 2e 20 4d 61 79 0a 09 09 09 09 20 2a 20 62 65 l. May..... * be
bab0: 20 4e 55 4c 4c 2e 20 2a 2f 0a 20 20 20 20 2f 2a NULL. */. /*
bac0: 0a 20 20 20 20 20 2a 20 4f 6e 6c 79 20 76 61 6c . * Only val
bad0: 69 64 20 69 6e 20 54 43 4c 5f 43 48 41 4e 4e 45 id in TCL_CHANNE
bae0: 4c 5f 56 45 52 53 49 4f 4e 5f 35 20 63 68 61 6e L_VERSION_5 chan
baf0: 6e 65 6c 73 20 6f 72 20 6c 61 74 65 72 2e 0a 20 nels or later..
bb00: 20 20 20 20 2a 20 54 49 50 20 23 32 30 38 2c 20 * TIP #208,
bb10: 46 69 6c 65 20 54 72 75 6e 63 61 74 69 6f 6e 2e File Truncation.
bb20: 0a 20 20 20 20 20 2a 2f 0a 20 20 20 20 54 63 6c . */. Tcl
bb30: 5f 44 72 69 76 65 72 54 72 75 6e 63 61 74 65 50 _DriverTruncateP
bb40: 72 6f 63 20 2a 74 72 75 6e 63 61 74 65 50 72 6f roc *truncatePro
bb50: 63 3b 0a 09 09 09 09 2f 2a 20 46 75 6e 63 74 69 c;...../* Functi
bb60: 6f 6e 20 74 6f 20 63 61 6c 6c 20 74 6f 20 74 72 on to call to tr
bb70: 75 6e 63 61 74 65 20 74 68 65 20 75 6e 64 65 72 uncate the under
bb80: 6c 79 69 6e 67 0a 09 09 09 09 20 2a 20 66 69 6c lying..... * fil
bb90: 65 20 74 6f 20 61 20 70 61 72 74 69 63 75 6c 61 e to a particula
bba0: 72 20 6c 65 6e 67 74 68 2e 20 4d 61 79 20 62 65 r length. May be
bbb0: 20 4e 55 4c 4c 20 69 66 0a 09 09 09 09 20 2a 20 NULL if..... *
bbc0: 74 68 65 20 63 68 61 6e 6e 65 6c 20 64 6f 65 73 the channel does
bbd0: 20 6e 6f 74 20 73 75 70 70 6f 72 74 20 74 72 75 not support tru
bbe0: 6e 63 61 74 69 6f 6e 2e 20 2a 2f 0a 7d 20 54 63 ncation. */.} Tc
bbf0: 6c 5f 43 68 61 6e 6e 65 6c 54 79 70 65 3b 0a 0a l_ChannelType;..
bc00: 2f 2a 0a 20 2a 20 54 68 65 20 66 6f 6c 6c 6f 77 /*. * The follow
bc10: 69 6e 67 20 66 6c 61 67 73 20 64 65 74 65 72 6d ing flags determ
bc20: 69 6e 65 20 77 68 65 74 68 65 72 20 74 68 65 20 ine whether the
bc30: 62 6c 6f 63 6b 4d 6f 64 65 50 72 6f 63 20 61 62 blockModeProc ab
bc40: 6f 76 65 20 73 68 6f 75 6c 64 20 73 65 74 0a 20 ove should set.
bc50: 2a 20 74 68 65 20 63 68 61 6e 6e 65 6c 20 69 6e * the channel in
bc60: 74 6f 20 62 6c 6f 63 6b 69 6e 67 20 6f 72 20 6e to blocking or n
bc70: 6f 6e 62 6c 6f 63 6b 69 6e 67 20 6d 6f 64 65 2e onblocking mode.
bc80: 20 54 68 65 79 20 61 72 65 20 70 61 73 73 65 64 They are passed
bc90: 20 61 73 20 61 72 67 75 6d 65 6e 74 73 0a 20 2a as arguments. *
bca0: 20 74 6f 20 74 68 65 20 62 6c 6f 63 6b 4d 6f 64 to the blockMod
bcb0: 65 50 72 6f 63 20 66 75 6e 63 74 69 6f 6e 20 69 eProc function i
bcc0: 6e 20 74 68 65 20 61 62 6f 76 65 20 73 74 72 75 n the above stru
bcd0: 63 74 75 72 65 2e 0a 20 2a 2f 0a 0a 23 64 65 66 cture.. */..#def
bce0: 69 6e 65 20 54 43 4c 5f 4d 4f 44 45 5f 42 4c 4f ine TCL_MODE_BLO
bcf0: 43 4b 49 4e 47 09 30 09 2f 2a 20 50 75 74 20 63 CKING.0./* Put c
bd00: 68 61 6e 6e 65 6c 20 69 6e 74 6f 20 62 6c 6f 63 hannel into bloc
bd10: 6b 69 6e 67 20 6d 6f 64 65 2e 20 2a 2f 0a 23 64 king mode. */.#d
bd20: 65 66 69 6e 65 20 54 43 4c 5f 4d 4f 44 45 5f 4e efine TCL_MODE_N
bd30: 4f 4e 42 4c 4f 43 4b 49 4e 47 09 31 09 2f 2a 20 ONBLOCKING.1./*
bd40: 50 75 74 20 63 68 61 6e 6e 65 6c 20 69 6e 74 6f Put channel into
bd50: 20 6e 6f 6e 62 6c 6f 63 6b 69 6e 67 0a 09 09 09 nonblocking....
bd60: 09 09 20 2a 20 6d 6f 64 65 2e 20 2a 2f 0a 0a 2f .. * mode. */../
bd70: 2a 0a 20 2a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d *. *------------
bd80: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
bd90: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
bda0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
bdb0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
bdc0: 0a 20 2a 20 45 6e 75 6d 20 66 6f 72 20 64 69 66 . * Enum for dif
bdd0: 66 65 72 65 6e 74 20 74 79 70 65 73 20 6f 66 20 ferent types of
bde0: 66 69 6c 65 20 70 61 74 68 73 2e 0a 20 2a 2f 0a file paths.. */.
bdf0: 0a 74 79 70 65 64 65 66 20 65 6e 75 6d 20 54 63 .typedef enum Tc
be00: 6c 5f 50 61 74 68 54 79 70 65 20 7b 0a 20 20 20 l_PathType {.
be10: 20 54 43 4c 5f 50 41 54 48 5f 41 42 53 4f 4c 55 TCL_PATH_ABSOLU
be20: 54 45 2c 0a 20 20 20 20 54 43 4c 5f 50 41 54 48 TE,. TCL_PATH
be30: 5f 52 45 4c 41 54 49 56 45 2c 0a 20 20 20 20 54 _RELATIVE,. T
be40: 43 4c 5f 50 41 54 48 5f 56 4f 4c 55 4d 45 5f 52 CL_PATH_VOLUME_R
be50: 45 4c 41 54 49 56 45 0a 7d 20 54 63 6c 5f 50 61 ELATIVE.} Tcl_Pa
be60: 74 68 54 79 70 65 3b 0a 0a 2f 2a 0a 20 2a 20 54 thType;../*. * T
be70: 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 73 74 72 he following str
be80: 75 63 74 75 72 65 20 69 73 20 75 73 65 64 20 74 ucture is used t
be90: 6f 20 70 61 73 73 20 67 6c 6f 62 20 74 79 70 65 o pass glob type
bea0: 20 64 61 74 61 20 61 6d 6f 6e 67 73 74 20 74 68 data amongst th
beb0: 65 20 76 61 72 69 6f 75 73 0a 20 2a 20 67 6c 6f e various. * glo
bec0: 62 20 72 6f 75 74 69 6e 65 73 20 61 6e 64 20 54 b routines and T
bed0: 63 6c 5f 46 53 4d 61 74 63 68 49 6e 44 69 72 65 cl_FSMatchInDire
bee0: 63 74 6f 72 79 2e 0a 20 2a 2f 0a 0a 74 79 70 65 ctory.. */..type
bef0: 64 65 66 20 73 74 72 75 63 74 20 54 63 6c 5f 47 def struct Tcl_G
bf00: 6c 6f 62 54 79 70 65 44 61 74 61 20 7b 0a 20 20 lobTypeData {.
bf10: 20 20 69 6e 74 20 74 79 70 65 3b 09 09 09 2f 2a int type;.../*
bf20: 20 43 6f 72 72 65 73 70 6f 6e 64 73 20 74 6f 20 Corresponds to
bf30: 62 63 64 70 66 6c 73 20 61 73 20 69 6e 20 27 66 bcdpfls as in 'f
bf40: 69 6e 64 20 2d 74 27 2e 20 2a 2f 0a 20 20 20 20 ind -t'. */.
bf50: 69 6e 74 20 70 65 72 6d 3b 09 09 09 2f 2a 20 43 int perm;.../* C
bf60: 6f 72 72 65 73 70 6f 6e 64 73 20 74 6f 20 66 69 orresponds to fi
bf70: 6c 65 20 70 65 72 6d 69 73 73 69 6f 6e 73 2e 20 le permissions.
bf80: 2a 2f 0a 20 20 20 20 54 63 6c 5f 4f 62 6a 20 2a */. Tcl_Obj *
bf90: 6d 61 63 54 79 70 65 3b 09 09 2f 2a 20 41 63 63 macType;../* Acc
bfa0: 65 70 74 61 62 6c 65 20 4d 61 63 20 74 79 70 65 eptable Mac type
bfb0: 2e 20 2a 2f 0a 20 20 20 20 54 63 6c 5f 4f 62 6a . */. Tcl_Obj
bfc0: 20 2a 6d 61 63 43 72 65 61 74 6f 72 3b 09 2f 2a *macCreator;./*
bfd0: 20 41 63 63 65 70 74 61 62 6c 65 20 4d 61 63 20 Acceptable Mac
bfe0: 63 72 65 61 74 6f 72 2e 20 2a 2f 0a 7d 20 54 63 creator. */.} Tc
bff0: 6c 5f 47 6c 6f 62 54 79 70 65 44 61 74 61 3b 0a l_GlobTypeData;.
c000: 0a 2f 2a 0a 20 2a 20 54 79 70 65 20 61 6e 64 20 ./*. * Type and
c010: 70 65 72 6d 69 73 73 69 6f 6e 20 64 65 66 69 6e permission defin
c020: 69 74 69 6f 6e 73 20 66 6f 72 20 67 6c 6f 62 20 itions for glob
c030: 63 6f 6d 6d 61 6e 64 2e 0a 20 2a 2f 0a 0a 23 64 command.. */..#d
c040: 65 66 69 6e 65 20 54 43 4c 5f 47 4c 4f 42 5f 54 efine TCL_GLOB_T
c050: 59 50 45 5f 42 4c 4f 43 4b 09 09 28 31 3c 3c 30 YPE_BLOCK..(1<<0
c060: 29 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 47 4c ).#define TCL_GL
c070: 4f 42 5f 54 59 50 45 5f 43 48 41 52 09 09 28 31 OB_TYPE_CHAR..(1
c080: 3c 3c 31 29 0a 23 64 65 66 69 6e 65 20 54 43 4c <<1).#define TCL
c090: 5f 47 4c 4f 42 5f 54 59 50 45 5f 44 49 52 09 09 _GLOB_TYPE_DIR..
c0a0: 28 31 3c 3c 32 29 0a 23 64 65 66 69 6e 65 20 54 (1<<2).#define T
c0b0: 43 4c 5f 47 4c 4f 42 5f 54 59 50 45 5f 50 49 50 CL_GLOB_TYPE_PIP
c0c0: 45 09 09 28 31 3c 3c 33 29 0a 23 64 65 66 69 6e E..(1<<3).#defin
c0d0: 65 20 54 43 4c 5f 47 4c 4f 42 5f 54 59 50 45 5f e TCL_GLOB_TYPE_
c0e0: 46 49 4c 45 09 09 28 31 3c 3c 34 29 0a 23 64 65 FILE..(1<<4).#de
c0f0: 66 69 6e 65 20 54 43 4c 5f 47 4c 4f 42 5f 54 59 fine TCL_GLOB_TY
c100: 50 45 5f 4c 49 4e 4b 09 09 28 31 3c 3c 35 29 0a PE_LINK..(1<<5).
c110: 23 64 65 66 69 6e 65 20 54 43 4c 5f 47 4c 4f 42 #define TCL_GLOB
c120: 5f 54 59 50 45 5f 53 4f 43 4b 09 09 28 31 3c 3c _TYPE_SOCK..(1<<
c130: 36 29 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 47 6).#define TCL_G
c140: 4c 4f 42 5f 54 59 50 45 5f 4d 4f 55 4e 54 09 09 LOB_TYPE_MOUNT..
c150: 28 31 3c 3c 37 29 0a 0a 23 64 65 66 69 6e 65 20 (1<<7)..#define
c160: 54 43 4c 5f 47 4c 4f 42 5f 50 45 52 4d 5f 52 4f TCL_GLOB_PERM_RO
c170: 4e 4c 59 09 09 28 31 3c 3c 30 29 0a 23 64 65 66 NLY..(1<<0).#def
c180: 69 6e 65 20 54 43 4c 5f 47 4c 4f 42 5f 50 45 52 ine TCL_GLOB_PER
c190: 4d 5f 48 49 44 44 45 4e 09 09 28 31 3c 3c 31 29 M_HIDDEN..(1<<1)
c1a0: 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 47 4c 4f .#define TCL_GLO
c1b0: 42 5f 50 45 52 4d 5f 52 09 09 09 28 31 3c 3c 32 B_PERM_R...(1<<2
c1c0: 29 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 47 4c ).#define TCL_GL
c1d0: 4f 42 5f 50 45 52 4d 5f 57 09 09 09 28 31 3c 3c OB_PERM_W...(1<<
c1e0: 33 29 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 47 3).#define TCL_G
c1f0: 4c 4f 42 5f 50 45 52 4d 5f 58 09 09 09 28 31 3c LOB_PERM_X...(1<
c200: 3c 34 29 0a 0a 2f 2a 0a 20 2a 20 46 6c 61 67 73 <4)../*. * Flags
c210: 20 66 6f 72 20 74 68 65 20 75 6e 6c 6f 61 64 20 for the unload
c220: 63 61 6c 6c 62 61 63 6b 20 66 75 6e 63 74 69 6f callback functio
c230: 6e 2e 0a 20 2a 2f 0a 0a 23 64 65 66 69 6e 65 20 n.. */..#define
c240: 54 43 4c 5f 55 4e 4c 4f 41 44 5f 44 45 54 41 43 TCL_UNLOAD_DETAC
c250: 48 5f 46 52 4f 4d 5f 49 4e 54 45 52 50 52 45 54 H_FROM_INTERPRET
c260: 45 52 09 28 31 3c 3c 30 29 0a 23 64 65 66 69 6e ER.(1<<0).#defin
c270: 65 20 54 43 4c 5f 55 4e 4c 4f 41 44 5f 44 45 54 e TCL_UNLOAD_DET
c280: 41 43 48 5f 46 52 4f 4d 5f 50 52 4f 43 45 53 53 ACH_FROM_PROCESS
c290: 09 09 28 31 3c 3c 31 29 0a 0a 2f 2a 0a 20 2a 20 ..(1<<1)../*. *
c2a0: 54 79 70 65 64 65 66 73 20 66 6f 72 20 74 68 65 Typedefs for the
c2b0: 20 76 61 72 69 6f 75 73 20 66 69 6c 65 73 79 73 various filesys
c2c0: 74 65 6d 20 6f 70 65 72 61 74 69 6f 6e 73 3a 0a tem operations:.
c2d0: 20 2a 2f 0a 0a 74 79 70 65 64 65 66 20 69 6e 74 */..typedef int
c2e0: 20 28 54 63 6c 5f 46 53 53 74 61 74 50 72 6f 63 (Tcl_FSStatProc
c2f0: 29 20 28 54 63 6c 5f 4f 62 6a 20 2a 70 61 74 68 ) (Tcl_Obj *path
c300: 50 74 72 2c 20 54 63 6c 5f 53 74 61 74 42 75 66 Ptr, Tcl_StatBuf
c310: 20 2a 62 75 66 29 3b 0a 74 79 70 65 64 65 66 20 *buf);.typedef
c320: 69 6e 74 20 28 54 63 6c 5f 46 53 41 63 63 65 73 int (Tcl_FSAcces
c330: 73 50 72 6f 63 29 20 28 54 63 6c 5f 4f 62 6a 20 sProc) (Tcl_Obj
c340: 2a 70 61 74 68 50 74 72 2c 20 69 6e 74 20 6d 6f *pathPtr, int mo
c350: 64 65 29 3b 0a 74 79 70 65 64 65 66 20 54 63 6c de);.typedef Tcl
c360: 5f 43 68 61 6e 6e 65 6c 20 28 54 63 6c 5f 46 53 _Channel (Tcl_FS
c370: 4f 70 65 6e 46 69 6c 65 43 68 61 6e 6e 65 6c 50 OpenFileChannelP
c380: 72 6f 63 29 20 28 54 63 6c 5f 49 6e 74 65 72 70 roc) (Tcl_Interp
c390: 20 2a 69 6e 74 65 72 70 2c 0a 09 54 63 6c 5f 4f *interp,..Tcl_O
c3a0: 62 6a 20 2a 70 61 74 68 50 74 72 2c 20 69 6e 74 bj *pathPtr, int
c3b0: 20 6d 6f 64 65 2c 20 69 6e 74 20 70 65 72 6d 69 mode, int permi
c3c0: 73 73 69 6f 6e 73 29 3b 0a 74 79 70 65 64 65 66 ssions);.typedef
c3d0: 20 69 6e 74 20 28 54 63 6c 5f 46 53 4d 61 74 63 int (Tcl_FSMatc
c3e0: 68 49 6e 44 69 72 65 63 74 6f 72 79 50 72 6f 63 hInDirectoryProc
c3f0: 29 20 28 54 63 6c 5f 49 6e 74 65 72 70 20 2a 69 ) (Tcl_Interp *i
c400: 6e 74 65 72 70 2c 20 54 63 6c 5f 4f 62 6a 20 2a nterp, Tcl_Obj *
c410: 72 65 73 75 6c 74 2c 0a 09 54 63 6c 5f 4f 62 6a result,..Tcl_Obj
c420: 20 2a 70 61 74 68 50 74 72 2c 20 63 6f 6e 73 74 *pathPtr, const
c430: 20 63 68 61 72 20 2a 70 61 74 74 65 72 6e 2c 20 char *pattern,
c440: 54 63 6c 5f 47 6c 6f 62 54 79 70 65 44 61 74 61 Tcl_GlobTypeData
c450: 20 2a 74 79 70 65 73 29 3b 0a 74 79 70 65 64 65 *types);.typede
c460: 66 20 54 63 6c 5f 4f 62 6a 20 2a 20 28 54 63 6c f Tcl_Obj * (Tcl
c470: 5f 46 53 47 65 74 43 77 64 50 72 6f 63 29 20 28 _FSGetCwdProc) (
c480: 54 63 6c 5f 49 6e 74 65 72 70 20 2a 69 6e 74 65 Tcl_Interp *inte
c490: 72 70 29 3b 0a 74 79 70 65 64 65 66 20 69 6e 74 rp);.typedef int
c4a0: 20 28 54 63 6c 5f 46 53 43 68 64 69 72 50 72 6f (Tcl_FSChdirPro
c4b0: 63 29 20 28 54 63 6c 5f 4f 62 6a 20 2a 70 61 74 c) (Tcl_Obj *pat
c4c0: 68 50 74 72 29 3b 0a 74 79 70 65 64 65 66 20 69 hPtr);.typedef i
c4d0: 6e 74 20 28 54 63 6c 5f 46 53 4c 73 74 61 74 50 nt (Tcl_FSLstatP
c4e0: 72 6f 63 29 20 28 54 63 6c 5f 4f 62 6a 20 2a 70 roc) (Tcl_Obj *p
c4f0: 61 74 68 50 74 72 2c 20 54 63 6c 5f 53 74 61 74 athPtr, Tcl_Stat
c500: 42 75 66 20 2a 62 75 66 29 3b 0a 74 79 70 65 64 Buf *buf);.typed
c510: 65 66 20 69 6e 74 20 28 54 63 6c 5f 46 53 43 72 ef int (Tcl_FSCr
c520: 65 61 74 65 44 69 72 65 63 74 6f 72 79 50 72 6f eateDirectoryPro
c530: 63 29 20 28 54 63 6c 5f 4f 62 6a 20 2a 70 61 74 c) (Tcl_Obj *pat
c540: 68 50 74 72 29 3b 0a 74 79 70 65 64 65 66 20 69 hPtr);.typedef i
c550: 6e 74 20 28 54 63 6c 5f 46 53 44 65 6c 65 74 65 nt (Tcl_FSDelete
c560: 46 69 6c 65 50 72 6f 63 29 20 28 54 63 6c 5f 4f FileProc) (Tcl_O
c570: 62 6a 20 2a 70 61 74 68 50 74 72 29 3b 0a 74 79 bj *pathPtr);.ty
c580: 70 65 64 65 66 20 69 6e 74 20 28 54 63 6c 5f 46 pedef int (Tcl_F
c590: 53 43 6f 70 79 44 69 72 65 63 74 6f 72 79 50 72 SCopyDirectoryPr
c5a0: 6f 63 29 20 28 54 63 6c 5f 4f 62 6a 20 2a 73 72 oc) (Tcl_Obj *sr
c5b0: 63 50 61 74 68 50 74 72 2c 0a 09 54 63 6c 5f 4f cPathPtr,..Tcl_O
c5c0: 62 6a 20 2a 64 65 73 74 50 61 74 68 50 74 72 2c bj *destPathPtr,
c5d0: 20 54 63 6c 5f 4f 62 6a 20 2a 2a 65 72 72 6f 72 Tcl_Obj **error
c5e0: 50 74 72 29 3b 0a 74 79 70 65 64 65 66 20 69 6e Ptr);.typedef in
c5f0: 74 20 28 54 63 6c 5f 46 53 43 6f 70 79 46 69 6c t (Tcl_FSCopyFil
c600: 65 50 72 6f 63 29 20 28 54 63 6c 5f 4f 62 6a 20 eProc) (Tcl_Obj
c610: 2a 73 72 63 50 61 74 68 50 74 72 2c 20 54 63 6c *srcPathPtr, Tcl
c620: 5f 4f 62 6a 20 2a 64 65 73 74 50 61 74 68 50 74 _Obj *destPathPt
c630: 72 29 3b 0a 74 79 70 65 64 65 66 20 69 6e 74 20 r);.typedef int
c640: 28 54 63 6c 5f 46 53 52 65 6d 6f 76 65 44 69 72 (Tcl_FSRemoveDir
c650: 65 63 74 6f 72 79 50 72 6f 63 29 20 28 54 63 6c ectoryProc) (Tcl
c660: 5f 4f 62 6a 20 2a 70 61 74 68 50 74 72 2c 20 69 _Obj *pathPtr, i
c670: 6e 74 20 72 65 63 75 72 73 69 76 65 2c 0a 09 54 nt recursive,..T
c680: 63 6c 5f 4f 62 6a 20 2a 2a 65 72 72 6f 72 50 74 cl_Obj **errorPt
c690: 72 29 3b 0a 74 79 70 65 64 65 66 20 69 6e 74 20 r);.typedef int
c6a0: 28 54 63 6c 5f 46 53 52 65 6e 61 6d 65 46 69 6c (Tcl_FSRenameFil
c6b0: 65 50 72 6f 63 29 20 28 54 63 6c 5f 4f 62 6a 20 eProc) (Tcl_Obj
c6c0: 2a 73 72 63 50 61 74 68 50 74 72 2c 20 54 63 6c *srcPathPtr, Tcl
c6d0: 5f 4f 62 6a 20 2a 64 65 73 74 50 61 74 68 50 74 _Obj *destPathPt
c6e0: 72 29 3b 0a 74 79 70 65 64 65 66 20 76 6f 69 64 r);.typedef void
c6f0: 20 28 54 63 6c 5f 46 53 55 6e 6c 6f 61 64 46 69 (Tcl_FSUnloadFi
c700: 6c 65 50 72 6f 63 29 20 28 54 63 6c 5f 4c 6f 61 leProc) (Tcl_Loa
c710: 64 48 61 6e 64 6c 65 20 6c 6f 61 64 48 61 6e 64 dHandle loadHand
c720: 6c 65 29 3b 0a 74 79 70 65 64 65 66 20 54 63 6c le);.typedef Tcl
c730: 5f 4f 62 6a 20 2a 20 28 54 63 6c 5f 46 53 4c 69 _Obj * (Tcl_FSLi
c740: 73 74 56 6f 6c 75 6d 65 73 50 72 6f 63 29 20 28 stVolumesProc) (
c750: 76 6f 69 64 29 3b 0a 2f 2a 20 57 65 20 68 61 76 void);./* We hav
c760: 65 20 74 6f 20 64 65 63 6c 61 72 65 20 74 68 65 e to declare the
c770: 20 75 74 69 6d 65 20 73 74 72 75 63 74 75 72 65 utime structure
c780: 20 68 65 72 65 2e 20 2a 2f 0a 73 74 72 75 63 74 here. */.struct
c790: 20 75 74 69 6d 62 75 66 3b 0a 74 79 70 65 64 65 utimbuf;.typede
c7a0: 66 20 69 6e 74 20 28 54 63 6c 5f 46 53 55 74 69 f int (Tcl_FSUti
c7b0: 6d 65 50 72 6f 63 29 20 28 54 63 6c 5f 4f 62 6a meProc) (Tcl_Obj
c7c0: 20 2a 70 61 74 68 50 74 72 2c 20 73 74 72 75 63 *pathPtr, struc
c7d0: 74 20 75 74 69 6d 62 75 66 20 2a 74 76 61 6c 29 t utimbuf *tval)
c7e0: 3b 0a 74 79 70 65 64 65 66 20 69 6e 74 20 28 54 ;.typedef int (T
c7f0: 63 6c 5f 46 53 4e 6f 72 6d 61 6c 69 7a 65 50 61 cl_FSNormalizePa
c800: 74 68 50 72 6f 63 29 20 28 54 63 6c 5f 49 6e 74 thProc) (Tcl_Int
c810: 65 72 70 20 2a 69 6e 74 65 72 70 2c 20 54 63 6c erp *interp, Tcl
c820: 5f 4f 62 6a 20 2a 70 61 74 68 50 74 72 2c 0a 09 _Obj *pathPtr,..
c830: 69 6e 74 20 6e 65 78 74 43 68 65 63 6b 70 6f 69 int nextCheckpoi
c840: 6e 74 29 3b 0a 74 79 70 65 64 65 66 20 69 6e 74 nt);.typedef int
c850: 20 28 54 63 6c 5f 46 53 46 69 6c 65 41 74 74 72 (Tcl_FSFileAttr
c860: 73 47 65 74 50 72 6f 63 29 20 28 54 63 6c 5f 49 sGetProc) (Tcl_I
c870: 6e 74 65 72 70 20 2a 69 6e 74 65 72 70 2c 20 69 nterp *interp, i
c880: 6e 74 20 69 6e 64 65 78 2c 0a 09 54 63 6c 5f 4f nt index,..Tcl_O
c890: 62 6a 20 2a 70 61 74 68 50 74 72 2c 20 54 63 6c bj *pathPtr, Tcl
c8a0: 5f 4f 62 6a 20 2a 2a 6f 62 6a 50 74 72 52 65 66 _Obj **objPtrRef
c8b0: 29 3b 0a 74 79 70 65 64 65 66 20 63 6f 6e 73 74 );.typedef const
c8c0: 20 63 68 61 72 20 2a 63 6f 6e 73 74 20 2a 20 28 char *const * (
c8d0: 54 63 6c 5f 46 53 46 69 6c 65 41 74 74 72 53 74 Tcl_FSFileAttrSt
c8e0: 72 69 6e 67 73 50 72 6f 63 29 20 28 54 63 6c 5f ringsProc) (Tcl_
c8f0: 4f 62 6a 20 2a 70 61 74 68 50 74 72 2c 0a 09 54 Obj *pathPtr,..T
c900: 63 6c 5f 4f 62 6a 20 2a 2a 6f 62 6a 50 74 72 52 cl_Obj **objPtrR
c910: 65 66 29 3b 0a 74 79 70 65 64 65 66 20 69 6e 74 ef);.typedef int
c920: 20 28 54 63 6c 5f 46 53 46 69 6c 65 41 74 74 72 (Tcl_FSFileAttr
c930: 73 53 65 74 50 72 6f 63 29 20 28 54 63 6c 5f 49 sSetProc) (Tcl_I
c940: 6e 74 65 72 70 20 2a 69 6e 74 65 72 70 2c 20 69 nterp *interp, i
c950: 6e 74 20 69 6e 64 65 78 2c 0a 09 54 63 6c 5f 4f nt index,..Tcl_O
c960: 62 6a 20 2a 70 61 74 68 50 74 72 2c 20 54 63 6c bj *pathPtr, Tcl
c970: 5f 4f 62 6a 20 2a 6f 62 6a 50 74 72 29 3b 0a 74 _Obj *objPtr);.t
c980: 79 70 65 64 65 66 20 54 63 6c 5f 4f 62 6a 20 2a ypedef Tcl_Obj *
c990: 20 28 54 63 6c 5f 46 53 4c 69 6e 6b 50 72 6f 63 (Tcl_FSLinkProc
c9a0: 29 20 28 54 63 6c 5f 4f 62 6a 20 2a 70 61 74 68 ) (Tcl_Obj *path
c9b0: 50 74 72 2c 20 54 63 6c 5f 4f 62 6a 20 2a 74 6f Ptr, Tcl_Obj *to
c9c0: 50 74 72 2c 0a 09 69 6e 74 20 6c 69 6e 6b 54 79 Ptr,..int linkTy
c9d0: 70 65 29 3b 0a 74 79 70 65 64 65 66 20 69 6e 74 pe);.typedef int
c9e0: 20 28 54 63 6c 5f 46 53 4c 6f 61 64 46 69 6c 65 (Tcl_FSLoadFile
c9f0: 50 72 6f 63 29 20 28 54 63 6c 5f 49 6e 74 65 72 Proc) (Tcl_Inter
ca00: 70 20 2a 69 6e 74 65 72 70 2c 20 54 63 6c 5f 4f p *interp, Tcl_O
ca10: 62 6a 20 2a 70 61 74 68 50 74 72 2c 0a 09 54 63 bj *pathPtr,..Tc
ca20: 6c 5f 4c 6f 61 64 48 61 6e 64 6c 65 20 2a 68 61 l_LoadHandle *ha
ca30: 6e 64 6c 65 50 74 72 2c 20 54 63 6c 5f 46 53 55 ndlePtr, Tcl_FSU
ca40: 6e 6c 6f 61 64 46 69 6c 65 50 72 6f 63 20 2a 2a nloadFileProc **
ca50: 75 6e 6c 6f 61 64 50 72 6f 63 50 74 72 29 3b 0a unloadProcPtr);.
ca60: 74 79 70 65 64 65 66 20 69 6e 74 20 28 54 63 6c typedef int (Tcl
ca70: 5f 46 53 50 61 74 68 49 6e 46 69 6c 65 73 79 73 _FSPathInFilesys
ca80: 74 65 6d 50 72 6f 63 29 20 28 54 63 6c 5f 4f 62 temProc) (Tcl_Ob
ca90: 6a 20 2a 70 61 74 68 50 74 72 2c 0a 09 76 6f 69 j *pathPtr,..voi
caa0: 64 20 2a 2a 63 6c 69 65 6e 74 44 61 74 61 50 74 d **clientDataPt
cab0: 72 29 3b 0a 74 79 70 65 64 65 66 20 54 63 6c 5f r);.typedef Tcl_
cac0: 4f 62 6a 20 2a 20 28 54 63 6c 5f 46 53 46 69 6c Obj * (Tcl_FSFil
cad0: 65 73 79 73 74 65 6d 50 61 74 68 54 79 70 65 50 esystemPathTypeP
cae0: 72 6f 63 29 20 28 54 63 6c 5f 4f 62 6a 20 2a 70 roc) (Tcl_Obj *p
caf0: 61 74 68 50 74 72 29 3b 0a 74 79 70 65 64 65 66 athPtr);.typedef
cb00: 20 54 63 6c 5f 4f 62 6a 20 2a 20 28 54 63 6c 5f Tcl_Obj * (Tcl_
cb10: 46 53 46 69 6c 65 73 79 73 74 65 6d 53 65 70 61 FSFilesystemSepa
cb20: 72 61 74 6f 72 50 72 6f 63 29 20 28 54 63 6c 5f ratorProc) (Tcl_
cb30: 4f 62 6a 20 2a 70 61 74 68 50 74 72 29 3b 0a 23 Obj *pathPtr);.#
cb40: 64 65 66 69 6e 65 20 54 63 6c 5f 46 53 46 72 65 define Tcl_FSFre
cb50: 65 49 6e 74 65 72 6e 61 6c 52 65 70 50 72 6f 63 eInternalRepProc
cb60: 20 54 63 6c 5f 46 72 65 65 50 72 6f 63 0a 74 79 Tcl_FreeProc.ty
cb70: 70 65 64 65 66 20 76 6f 69 64 20 2a 28 54 63 6c pedef void *(Tcl
cb80: 5f 46 53 44 75 70 49 6e 74 65 72 6e 61 6c 52 65 _FSDupInternalRe
cb90: 70 50 72 6f 63 29 20 28 76 6f 69 64 20 2a 63 6c pProc) (void *cl
cba0: 69 65 6e 74 44 61 74 61 29 3b 0a 74 79 70 65 64 ientData);.typed
cbb0: 65 66 20 54 63 6c 5f 4f 62 6a 20 2a 20 28 54 63 ef Tcl_Obj * (Tc
cbc0: 6c 5f 46 53 49 6e 74 65 72 6e 61 6c 54 6f 4e 6f l_FSInternalToNo
cbd0: 72 6d 61 6c 69 7a 65 64 50 72 6f 63 29 20 28 76 rmalizedProc) (v
cbe0: 6f 69 64 20 2a 63 6c 69 65 6e 74 44 61 74 61 29 oid *clientData)
cbf0: 3b 0a 74 79 70 65 64 65 66 20 76 6f 69 64 20 2a ;.typedef void *
cc00: 28 54 63 6c 5f 46 53 43 72 65 61 74 65 49 6e 74 (Tcl_FSCreateInt
cc10: 65 72 6e 61 6c 52 65 70 50 72 6f 63 29 20 28 54 ernalRepProc) (T
cc20: 63 6c 5f 4f 62 6a 20 2a 70 61 74 68 50 74 72 29 cl_Obj *pathPtr)
cc30: 3b 0a 0a 74 79 70 65 64 65 66 20 73 74 72 75 63 ;..typedef struc
cc40: 74 20 54 63 6c 5f 46 53 56 65 72 73 69 6f 6e 5f t Tcl_FSVersion_
cc50: 20 2a 54 63 6c 5f 46 53 56 65 72 73 69 6f 6e 3b *Tcl_FSVersion;
cc60: 0a 0a 2f 2a 0a 20 2a 2d 2d 2d 2d 2d 2d 2d 2d 2d ../*. *---------
cc70: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
cc80: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
cc90: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
cca0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
ccb0: 2d 2d 2d 0a 20 2a 20 44 61 74 61 20 73 74 72 75 ---. * Data stru
ccc0: 63 74 75 72 65 73 20 72 65 6c 61 74 65 64 20 74 ctures related t
ccd0: 6f 20 68 6f 6f 6b 69 6e 67 20 69 6e 74 6f 20 74 o hooking into t
cce0: 68 65 20 66 69 6c 65 73 79 73 74 65 6d 0a 20 2a he filesystem. *
ccf0: 2f 0a 0a 2f 2a 0a 20 2a 20 46 69 6c 65 73 79 73 /../*. * Filesys
cd00: 74 65 6d 20 76 65 72 73 69 6f 6e 20 74 61 67 2e tem version tag.
cd10: 20 20 54 68 69 73 20 77 61 73 20 69 6e 74 72 6f This was intro
cd20: 64 75 63 65 64 20 69 6e 20 38 2e 34 2e 0a 20 2a duced in 8.4.. *
cd30: 2f 0a 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 46 /..#define TCL_F
cd40: 49 4c 45 53 59 53 54 45 4d 5f 56 45 52 53 49 4f ILESYSTEM_VERSIO
cd50: 4e 5f 31 09 28 28 54 63 6c 5f 46 53 56 65 72 73 N_1.((Tcl_FSVers
cd60: 69 6f 6e 29 20 30 78 31 29 0a 0a 2f 2a 0a 20 2a ion) 0x1)../*. *
cd70: 20 73 74 72 75 63 74 20 54 63 6c 5f 46 69 6c 65 struct Tcl_File
cd80: 73 79 73 74 65 6d 3a 0a 20 2a 0a 20 2a 20 4f 6e system:. *. * On
cd90: 65 20 73 75 63 68 20 73 74 72 75 63 74 75 72 65 e such structure
cda0: 20 65 78 69 73 74 73 20 66 6f 72 20 65 61 63 68 exists for each
cdb0: 20 74 79 70 65 20 28 6b 69 6e 64 29 20 6f 66 20 type (kind) of
cdc0: 66 69 6c 65 73 79 73 74 65 6d 2e 20 49 74 20 63 filesystem. It c
cdd0: 6f 6c 6c 65 63 74 73 0a 20 2a 20 74 6f 67 65 74 ollects. * toget
cde0: 68 65 72 20 74 68 65 20 66 75 6e 63 74 69 6f 6e her the function
cdf0: 73 20 74 68 61 74 20 66 6f 72 6d 20 74 68 65 20 s that form the
ce00: 69 6e 74 65 72 66 61 63 65 20 66 6f 72 20 61 20 interface for a
ce10: 70 61 72 74 69 63 75 6c 72 20 74 68 65 0a 20 2a particulr the. *
ce20: 20 66 69 6c 65 73 79 73 74 65 6d 2e 20 54 63 6c filesystem. Tcl
ce30: 20 61 6c 77 61 79 73 20 61 63 63 65 73 73 65 73 always accesses
ce40: 20 74 68 65 20 66 69 6c 65 73 79 73 74 65 6d 20 the filesystem
ce50: 74 68 72 6f 75 67 68 20 6f 6e 65 20 6f 66 20 74 through one of t
ce60: 68 65 73 65 0a 20 2a 20 73 74 72 75 63 74 75 72 hese. * structur
ce70: 65 73 2e 0a 20 2a 0a 20 2a 20 4e 6f 74 20 61 6c es.. *. * Not al
ce80: 6c 20 65 6e 74 72 69 65 73 20 6e 65 65 64 20 62 l entries need b
ce90: 65 20 6e 6f 6e 2d 4e 55 4c 4c 3b 20 61 6e 79 20 e non-NULL; any
cea0: 77 68 69 63 68 20 61 72 65 20 4e 55 4c 4c 20 61 which are NULL a
ceb0: 72 65 20 73 69 6d 70 6c 79 20 69 67 6e 6f 72 65 re simply ignore
cec0: 64 2e 0a 20 2a 20 48 6f 77 65 76 65 72 2c 20 61 d.. * However, a
ced0: 20 63 6f 6d 70 6c 65 74 65 20 66 69 6c 65 73 79 complete filesy
cee0: 73 74 65 6d 20 73 68 6f 75 6c 64 20 70 72 6f 76 stem should prov
cef0: 69 64 65 20 61 6c 6c 20 6f 66 20 74 68 65 73 65 ide all of these
cf00: 20 66 75 6e 63 74 69 6f 6e 73 2e 20 54 68 65 0a functions. The.
cf10: 20 2a 20 65 78 70 6c 61 6e 61 74 69 6f 6e 73 20 * explanations
cf20: 69 6e 20 74 68 65 20 73 74 72 75 63 74 75 72 65 in the structure
cf30: 20 73 68 6f 77 20 74 68 65 20 69 6d 70 6f 72 74 show the import
cf40: 61 6e 63 65 20 6f 66 20 65 61 63 68 20 66 75 6e ance of each fun
cf50: 63 74 69 6f 6e 2e 0a 20 2a 2f 0a 0a 74 79 70 65 ction.. */..type
cf60: 64 65 66 20 73 74 72 75 63 74 20 54 63 6c 5f 46 def struct Tcl_F
cf70: 69 6c 65 73 79 73 74 65 6d 20 7b 0a 20 20 20 20 ilesystem {.
cf80: 63 6f 6e 73 74 20 63 68 61 72 20 2a 74 79 70 65 const char *type
cf90: 4e 61 6d 65 3b 09 2f 2a 20 54 68 65 20 6e 61 6d Name;./* The nam
cfa0: 65 20 6f 66 20 74 68 65 20 66 69 6c 65 73 79 73 e of the filesys
cfb0: 74 65 6d 2e 20 2a 2f 0a 20 20 20 20 73 69 7a 65 tem. */. size
cfc0: 5f 74 20 73 74 72 75 63 74 75 72 65 4c 65 6e 67 _t structureLeng
cfd0: 74 68 3b 09 2f 2a 20 4c 65 6e 67 74 68 20 6f 66 th;./* Length of
cfe0: 20 74 68 69 73 20 73 74 72 75 63 74 75 72 65 2c this structure,
cff0: 20 73 6f 20 66 75 74 75 72 65 20 62 69 6e 61 72 so future binar
d000: 79 0a 09 09 09 09 20 2a 20 63 6f 6d 70 61 74 69 y..... * compati
d010: 62 69 6c 69 74 79 20 63 61 6e 20 62 65 20 61 73 bility can be as
d020: 73 75 72 65 64 2e 20 2a 2f 0a 20 20 20 20 54 63 sured. */. Tc
d030: 6c 5f 46 53 56 65 72 73 69 6f 6e 20 76 65 72 73 l_FSVersion vers
d040: 69 6f 6e 3b 09 2f 2a 20 56 65 72 73 69 6f 6e 20 ion;./* Version
d050: 6f 66 20 74 68 65 20 66 69 6c 65 73 79 73 74 65 of the filesyste
d060: 6d 20 74 79 70 65 2e 20 2a 2f 0a 20 20 20 20 54 m type. */. T
d070: 63 6c 5f 46 53 50 61 74 68 49 6e 46 69 6c 65 73 cl_FSPathInFiles
d080: 79 73 74 65 6d 50 72 6f 63 20 2a 70 61 74 68 49 ystemProc *pathI
d090: 6e 46 69 6c 65 73 79 73 74 65 6d 50 72 6f 63 3b nFilesystemProc;
d0a0: 0a 09 09 09 09 2f 2a 20 44 65 74 65 72 6d 69 6e ...../* Determin
d0b0: 65 73 20 77 68 65 74 68 65 72 20 74 68 65 20 70 es whether the p
d0c0: 61 74 68 6e 61 6d 65 20 69 73 20 69 6e 20 74 68 athname is in th
d0d0: 69 73 0a 09 09 09 09 20 2a 20 66 69 6c 65 73 79 is..... * filesy
d0e0: 73 74 65 6d 2e 20 54 68 69 73 20 69 73 20 74 68 stem. This is th
d0f0: 65 20 6d 6f 73 74 20 69 6d 70 6f 72 74 61 6e 74 e most important
d100: 0a 09 09 09 09 20 2a 20 66 69 6c 65 73 79 73 74 ..... * filesyst
d110: 65 6d 20 66 75 6e 63 74 69 6f 6e 2e 20 2a 2f 0a em function. */.
d120: 20 20 20 20 54 63 6c 5f 46 53 44 75 70 49 6e 74 Tcl_FSDupInt
d130: 65 72 6e 61 6c 52 65 70 50 72 6f 63 20 2a 64 75 ernalRepProc *du
d140: 70 49 6e 74 65 72 6e 61 6c 52 65 70 50 72 6f 63 pInternalRepProc
d150: 3b 0a 09 09 09 09 2f 2a 20 44 75 70 6c 69 63 61 ;...../* Duplica
d160: 74 65 73 20 74 68 65 20 69 6e 74 65 72 6e 61 6c tes the internal
d170: 20 68 61 6e 64 6c 65 20 6f 66 20 74 68 65 20 6e handle of the n
d180: 6f 64 65 2e 0a 09 09 09 09 20 2a 20 49 66 20 69 ode...... * If i
d190: 74 20 69 73 20 4e 55 4c 4c 2c 20 74 68 65 20 66 t is NULL, the f
d1a0: 69 6c 65 73 79 73 74 65 6d 20 69 73 20 6c 65 73 ilesystem is les
d1b0: 73 0a 09 09 09 09 20 2a 20 70 65 72 66 6f 72 6d s..... * perform
d1c0: 61 6e 74 2e 20 2a 2f 0a 20 20 20 20 54 63 6c 5f ant. */. Tcl_
d1d0: 46 53 46 72 65 65 49 6e 74 65 72 6e 61 6c 52 65 FSFreeInternalRe
d1e0: 70 50 72 6f 63 20 2a 66 72 65 65 49 6e 74 65 72 pProc *freeInter
d1f0: 6e 61 6c 52 65 70 50 72 6f 63 3b 0a 09 09 09 09 nalRepProc;.....
d200: 2f 2a 20 46 72 65 65 73 20 74 68 65 20 69 6e 74 /* Frees the int
d210: 65 72 6e 61 6c 20 68 61 6e 64 6c 65 20 6f 66 20 ernal handle of
d220: 74 68 65 20 6e 6f 64 65 2e 20 20 4e 55 4c 4c 0a the node. NULL.
d230: 09 09 09 09 20 2a 20 6f 6e 6c 79 20 69 66 20 74 .... * only if t
d240: 68 65 72 65 20 69 73 20 6e 6f 20 6e 65 65 64 20 here is no need
d250: 74 6f 20 66 72 65 65 20 72 65 73 6f 75 72 63 65 to free resource
d260: 73 0a 09 09 09 09 20 2a 20 75 73 65 64 20 66 6f s..... * used fo
d270: 72 20 74 68 65 20 69 6e 74 65 72 6e 61 6c 20 68 r the internal h
d280: 61 6e 64 6c 65 2e 20 2a 2f 0a 20 20 20 20 54 63 andle. */. Tc
d290: 6c 5f 46 53 49 6e 74 65 72 6e 61 6c 54 6f 4e 6f l_FSInternalToNo
d2a0: 72 6d 61 6c 69 7a 65 64 50 72 6f 63 20 2a 69 6e rmalizedProc *in
d2b0: 74 65 72 6e 61 6c 54 6f 4e 6f 72 6d 61 6c 69 7a ternalToNormaliz
d2c0: 65 64 50 72 6f 63 3b 0a 09 09 09 09 2f 2a 20 43 edProc;...../* C
d2d0: 6f 6e 76 65 72 74 73 20 74 68 65 20 69 6e 74 65 onverts the inte
d2e0: 72 6e 61 6c 20 68 61 6e 64 6c 65 20 74 6f 20 61 rnal handle to a
d2f0: 20 6e 6f 72 6d 61 6c 69 7a 65 64 0a 09 09 09 09 normalized.....
d300: 20 2a 20 70 61 74 68 2e 20 20 4e 55 4c 4c 20 69 * path. NULL i
d310: 66 20 74 68 65 20 66 69 6c 65 73 79 73 74 65 6d f the filesystem
d320: 20 63 72 65 61 74 65 73 20 6e 6f 64 65 73 0a 09 creates nodes..
d330: 09 09 09 20 2a 20 68 61 76 69 6e 67 20 6e 6f 20 ... * having no
d340: 70 61 74 68 6e 61 6d 65 2e 20 2a 2f 0a 20 20 20 pathname. */.
d350: 20 54 63 6c 5f 46 53 43 72 65 61 74 65 49 6e 74 Tcl_FSCreateInt
d360: 65 72 6e 61 6c 52 65 70 50 72 6f 63 20 2a 63 72 ernalRepProc *cr
d370: 65 61 74 65 49 6e 74 65 72 6e 61 6c 52 65 70 50 eateInternalRepP
d380: 72 6f 63 3b 0a 09 09 09 09 2f 2a 20 43 72 65 61 roc;...../* Crea
d390: 74 65 73 20 61 6e 20 69 6e 74 65 72 6e 61 6c 20 tes an internal
d3a0: 68 61 6e 64 6c 65 20 66 6f 72 20 61 20 70 61 74 handle for a pat
d3b0: 68 6e 61 6d 65 2e 0a 09 09 09 09 20 2a 20 4d 61 hname...... * Ma
d3c0: 79 20 62 65 20 4e 55 4c 4c 20 69 66 20 70 61 74 y be NULL if pat
d3d0: 68 6e 61 6d 65 73 20 68 61 76 65 20 6e 6f 20 69 hnames have no i
d3e0: 6e 74 65 72 6e 61 6c 0a 09 09 09 09 20 2a 20 68 nternal..... * h
d3f0: 61 6e 64 6c 65 20 6f 72 20 69 66 20 70 61 74 68 andle or if path
d400: 49 6e 46 69 6c 65 73 79 73 74 65 6d 50 72 6f 63 InFilesystemProc
d410: 20 61 6c 77 61 79 73 0a 09 09 09 09 20 2a 20 69 always..... * i
d420: 6d 6d 65 64 69 61 74 65 6c 79 20 63 72 65 61 74 mmediately creat
d430: 65 73 20 61 6e 20 69 6e 74 65 72 6e 61 6c 0a 09 es an internal..
d440: 09 09 09 20 2a 20 72 65 70 72 65 73 65 6e 74 61 ... * representa
d450: 74 69 6f 6e 20 66 6f 72 20 70 61 74 68 6e 61 6d tion for pathnam
d460: 65 73 20 69 6e 20 74 68 65 0a 09 09 09 09 20 2a es in the..... *
d470: 20 66 69 6c 65 73 79 73 74 65 6d 2e 20 2a 2f 0a filesystem. */.
d480: 20 20 20 20 54 63 6c 5f 46 53 4e 6f 72 6d 61 6c Tcl_FSNormal
d490: 69 7a 65 50 61 74 68 50 72 6f 63 20 2a 6e 6f 72 izePathProc *nor
d4a0: 6d 61 6c 69 7a 65 50 61 74 68 50 72 6f 63 3b 0a malizePathProc;.
d4b0: 09 09 09 09 2f 2a 20 4e 6f 72 6d 61 6c 69 7a 65 ..../* Normalize
d4c0: 73 20 61 20 70 61 74 68 2e 20 20 53 68 6f 75 6c s a path. Shoul
d4d0: 64 20 62 65 20 69 6d 70 6c 65 6d 65 6e 74 65 64 d be implemented
d4e0: 20 69 66 0a 09 09 09 09 20 2a 20 74 68 65 20 66 if..... * the f
d4f0: 69 6c 65 73 79 73 74 65 6d 73 20 73 75 70 70 6f ilesystems suppo
d500: 72 74 73 20 6d 75 6c 74 69 70 6c 65 20 70 61 74 rts multiple pat
d510: 68 73 20 74 6f 0a 09 09 09 09 20 2a 20 74 68 65 hs to..... * the
d520: 20 73 61 6d 65 20 6e 6f 64 65 2e 20 2a 2f 0a 20 same node. */.
d530: 20 20 20 54 63 6c 5f 46 53 46 69 6c 65 73 79 73 Tcl_FSFilesys
d540: 74 65 6d 50 61 74 68 54 79 70 65 50 72 6f 63 20 temPathTypeProc
d550: 2a 66 69 6c 65 73 79 73 74 65 6d 50 61 74 68 54 *filesystemPathT
d560: 79 70 65 50 72 6f 63 3b 0a 09 09 09 09 2f 2a 20 ypeProc;...../*
d570: 44 65 74 65 72 6d 69 6e 65 73 20 74 68 65 20 74 Determines the t
d580: 79 70 65 20 6f 66 20 61 20 70 61 74 68 20 69 6e ype of a path in
d590: 20 74 68 69 73 0a 09 09 09 09 20 2a 20 66 69 6c this..... * fil
d5a0: 65 73 79 73 74 65 6d 2e 20 4d 61 79 20 62 65 20 esystem. May be
d5b0: 4e 55 4c 4c 2e 20 2a 2f 0a 20 20 20 20 54 63 6c NULL. */. Tcl
d5c0: 5f 46 53 46 69 6c 65 73 79 73 74 65 6d 53 65 70 _FSFilesystemSep
d5d0: 61 72 61 74 6f 72 50 72 6f 63 20 2a 66 69 6c 65 aratorProc *file
d5e0: 73 79 73 74 65 6d 53 65 70 61 72 61 74 6f 72 50 systemSeparatorP
d5f0: 72 6f 63 3b 0a 09 09 09 09 2f 2a 20 50 72 6f 64 roc;...../* Prod
d600: 75 63 65 73 20 74 68 65 20 73 65 70 61 72 61 74 uces the separat
d610: 6f 72 20 63 68 61 72 61 63 74 65 72 28 73 29 20 or character(s)
d620: 66 6f 72 20 74 68 69 73 0a 09 09 09 09 20 2a 20 for this..... *
d630: 66 69 6c 65 73 79 73 74 65 6d 2e 20 4d 75 73 74 filesystem. Must
d640: 20 6e 6f 74 20 62 65 20 4e 55 4c 4c 2e 20 2a 2f not be NULL. */
d650: 0a 20 20 20 20 54 63 6c 5f 46 53 53 74 61 74 50 . Tcl_FSStatP
d660: 72 6f 63 20 2a 73 74 61 74 50 72 6f 63 3b 09 2f roc *statProc;./
d670: 2a 20 43 61 6c 6c 65 64 20 62 79 20 27 54 63 6c * Called by 'Tcl
d680: 5f 46 53 53 74 61 74 28 29 27 2e 20 20 50 72 6f _FSStat()'. Pro
d690: 76 69 64 65 64 20 62 79 20 61 6e 79 0a 09 09 09 vided by any....
d6a0: 09 20 2a 20 72 65 61 73 6f 6e 61 62 6c 65 20 66 . * reasonable f
d6b0: 69 6c 65 73 79 73 74 65 6d 2e 20 2a 2f 0a 20 20 ilesystem. */.
d6c0: 20 20 54 63 6c 5f 46 53 41 63 63 65 73 73 50 72 Tcl_FSAccessPr
d6d0: 6f 63 20 2a 61 63 63 65 73 73 50 72 6f 63 3b 0a oc *accessProc;.
d6e0: 09 09 09 09 2f 2a 20 43 61 6c 6c 65 64 20 62 79 ..../* Called by
d6f0: 20 27 54 63 6c 5f 46 53 41 63 63 65 73 73 28 29 'Tcl_FSAccess()
d700: 27 2e 20 20 49 6d 70 6c 65 6d 65 6e 74 65 64 20 '. Implemented
d710: 62 79 0a 09 09 09 09 20 2a 20 61 6e 79 20 72 65 by..... * any re
d720: 61 73 6f 6e 61 62 6c 65 20 66 69 6c 65 73 79 73 asonable filesys
d730: 74 65 6d 2e 20 2a 2f 0a 20 20 20 20 54 63 6c 5f tem. */. Tcl_
d740: 46 53 4f 70 65 6e 46 69 6c 65 43 68 61 6e 6e 65 FSOpenFileChanne
d750: 6c 50 72 6f 63 20 2a 6f 70 65 6e 46 69 6c 65 43 lProc *openFileC
d760: 68 61 6e 6e 65 6c 50 72 6f 63 3b 0a 09 09 09 09 hannelProc;.....
d770: 2f 2a 20 43 61 6c 6c 65 64 20 62 79 20 27 54 63 /* Called by 'Tc
d780: 6c 5f 46 53 4f 70 65 6e 46 69 6c 65 43 68 61 6e l_FSOpenFileChan
d790: 6e 65 6c 28 29 27 2e 0a 09 09 09 09 20 2a 20 50 nel()'...... * P
d7a0: 72 6f 76 69 64 65 64 20 62 79 20 61 6e 79 20 72 rovided by any r
d7b0: 65 61 73 6f 6e 61 62 6c 65 20 66 69 6c 65 73 79 easonable filesy
d7c0: 73 74 65 6d 2e 20 2a 2f 0a 20 20 20 20 54 63 6c stem. */. Tcl
d7d0: 5f 46 53 4d 61 74 63 68 49 6e 44 69 72 65 63 74 _FSMatchInDirect
d7e0: 6f 72 79 50 72 6f 63 20 2a 6d 61 74 63 68 49 6e oryProc *matchIn
d7f0: 44 69 72 65 63 74 6f 72 79 50 72 6f 63 3b 0a 09 DirectoryProc;..
d800: 09 09 09 2f 2a 20 43 61 6c 6c 65 64 20 62 79 20 .../* Called by
d810: 27 54 63 6c 5f 46 53 4d 61 74 63 68 49 6e 44 69 'Tcl_FSMatchInDi
d820: 72 65 63 74 6f 72 79 28 29 27 2e 20 20 4e 55 4c rectory()'. NUL
d830: 4c 0a 09 09 09 09 20 2a 20 69 66 20 74 68 65 20 L..... * if the
d840: 66 69 6c 65 73 79 73 74 65 6d 20 64 6f 65 73 20 filesystem does
d850: 6e 6f 74 20 73 75 70 70 6f 72 74 20 67 6c 6f 62 not support glob
d860: 20 6f 72 0a 09 09 09 09 20 2a 20 72 65 63 75 72 or..... * recur
d870: 73 69 76 65 20 63 6f 70 79 2e 20 2a 2f 0a 20 20 sive copy. */.
d880: 20 20 54 63 6c 5f 46 53 55 74 69 6d 65 50 72 6f Tcl_FSUtimePro
d890: 63 20 2a 75 74 69 6d 65 50 72 6f 63 3b 09 2f 2a c *utimeProc;./*
d8a0: 20 43 61 6c 6c 65 64 20 62 79 20 27 54 63 6c 5f Called by 'Tcl_
d8b0: 46 53 55 74 69 6d 65 28 29 27 2c 20 62 79 20 27 FSUtime()', by '
d8c0: 66 69 6c 65 0a 09 09 09 09 20 2a 20 20 6d 74 69 file..... * mti
d8d0: 6d 65 27 20 74 6f 20 73 65 74 20 28 6e 6f 74 20 me' to set (not
d8e0: 72 65 61 64 29 20 74 69 6d 65 73 2c 20 27 66 69 read) times, 'fi
d8f0: 6c 65 0a 09 09 09 09 20 2a 20 20 61 74 69 6d 65 le..... * atime
d900: 27 2c 20 61 6e 64 20 74 68 65 20 6f 70 65 6e 2d ', and the open-
d910: 72 2f 6f 70 65 6e 2d 77 2f 66 63 6f 70 79 20 76 r/open-w/fcopy v
d920: 61 72 69 61 6e 74 0a 09 09 09 09 20 2a 20 20 6f ariant..... * o
d930: 66 20 27 66 69 6c 65 20 63 6f 70 79 27 2e 20 2a f 'file copy'. *
d940: 2f 0a 20 20 20 20 54 63 6c 5f 46 53 4c 69 6e 6b /. Tcl_FSLink
d950: 50 72 6f 63 20 2a 6c 69 6e 6b 50 72 6f 63 3b 09 Proc *linkProc;.
d960: 2f 2a 20 43 61 6c 6c 65 64 20 62 79 20 27 54 63 /* Called by 'Tc
d970: 6c 5f 46 53 4c 69 6e 6b 28 29 27 2e 20 4e 55 4c l_FSLink()'. NUL
d980: 4c 20 69 66 20 72 65 61 64 69 6e 67 20 6f 72 0a L if reading or.
d990: 09 09 09 09 20 2a 20 20 63 72 65 61 74 69 6e 67 .... * creating
d9a0: 20 6c 69 6e 6b 73 20 69 73 20 6e 6f 74 20 73 75 links is not su
d9b0: 70 70 6f 72 74 65 64 2e 20 2a 2f 0a 20 20 20 20 pported. */.
d9c0: 54 63 6c 5f 46 53 4c 69 73 74 56 6f 6c 75 6d 65 Tcl_FSListVolume
d9d0: 73 50 72 6f 63 20 2a 6c 69 73 74 56 6f 6c 75 6d sProc *listVolum
d9e0: 65 73 50 72 6f 63 3b 0a 09 09 09 09 2f 2a 20 4c esProc;...../* L
d9f0: 69 73 74 73 20 66 69 6c 65 73 79 73 74 65 6d 20 ists filesystem
da00: 76 6f 6c 75 6d 65 73 20 61 64 64 65 64 20 62 79 volumes added by
da10: 20 74 68 69 73 0a 09 09 09 09 20 2a 20 66 69 6c this..... * fil
da20: 65 73 79 73 74 65 6d 2e 20 4e 55 4c 4c 20 69 66 esystem. NULL if
da30: 20 74 68 65 20 66 69 6c 65 73 79 73 74 65 6d 20 the filesystem
da40: 64 6f 65 73 20 6e 6f 74 0a 09 09 09 09 20 2a 20 does not..... *
da50: 75 73 65 20 76 6f 6c 75 6d 65 73 2e 20 2a 2f 0a use volumes. */.
da60: 20 20 20 20 54 63 6c 5f 46 53 46 69 6c 65 41 74 Tcl_FSFileAt
da70: 74 72 53 74 72 69 6e 67 73 50 72 6f 63 20 2a 66 trStringsProc *f
da80: 69 6c 65 41 74 74 72 53 74 72 69 6e 67 73 50 72 ileAttrStringsPr
da90: 6f 63 3b 0a 09 09 09 09 2f 2a 20 4c 69 73 74 20 oc;...../* List
daa0: 61 6c 6c 20 76 61 6c 69 64 20 61 74 74 72 69 62 all valid attrib
dab0: 75 74 65 73 20 73 74 72 69 6e 67 73 2e 20 20 4e utes strings. N
dac0: 55 4c 4c 20 69 66 0a 09 09 09 09 20 2a 20 74 68 ULL if..... * th
dad0: 65 20 66 69 6c 65 73 79 73 74 65 6d 20 64 6f 65 e filesystem doe
dae0: 73 20 6e 6f 74 20 73 75 70 70 6f 72 74 20 74 68 s not support th
daf0: 65 20 27 66 69 6c 65 0a 09 09 09 09 20 2a 20 61 e 'file..... * a
db00: 74 74 72 69 62 75 74 65 73 27 20 63 6f 6d 6d 61 ttributes' comma
db10: 6e 64 2e 20 20 43 61 6e 20 62 65 20 75 73 65 64 nd. Can be used
db20: 20 74 6f 20 61 74 74 61 63 68 0a 09 09 09 09 20 to attach.....
db30: 2a 20 61 72 62 69 74 72 61 72 79 20 61 64 64 69 * arbitrary addi
db40: 74 69 6f 6e 61 6c 20 64 61 74 61 20 74 6f 20 66 tional data to f
db50: 69 6c 65 73 20 69 6e 20 61 0a 09 09 09 09 20 2a iles in a..... *
db60: 20 66 69 6c 65 73 79 73 74 65 6d 2e 20 2a 2f 0a filesystem. */.
db70: 20 20 20 20 54 63 6c 5f 46 53 46 69 6c 65 41 74 Tcl_FSFileAt
db80: 74 72 73 47 65 74 50 72 6f 63 20 2a 66 69 6c 65 trsGetProc *file
db90: 41 74 74 72 73 47 65 74 50 72 6f 63 3b 0a 09 09 AttrsGetProc;...
dba0: 09 09 2f 2a 20 43 61 6c 6c 65 64 20 62 79 20 27 ../* Called by '
dbb0: 54 63 6c 5f 46 53 46 69 6c 65 41 74 74 72 73 47 Tcl_FSFileAttrsG
dbc0: 65 74 28 29 27 20 61 6e 64 20 62 79 0a 09 09 09 et()' and by....
dbd0: 09 20 2a 20 27 66 69 6c 65 20 61 74 74 72 69 62 . * 'file attrib
dbe0: 75 74 65 73 27 2e 20 2a 2f 0a 20 20 20 20 54 63 utes'. */. Tc
dbf0: 6c 5f 46 53 46 69 6c 65 41 74 74 72 73 53 65 74 l_FSFileAttrsSet
dc00: 50 72 6f 63 20 2a 66 69 6c 65 41 74 74 72 73 53 Proc *fileAttrsS
dc10: 65 74 50 72 6f 63 3b 0a 09 09 09 09 2f 2a 20 43 etProc;...../* C
dc20: 61 6c 6c 65 64 20 62 79 20 27 54 63 6c 5f 46 53 alled by 'Tcl_FS
dc30: 46 69 6c 65 41 74 74 72 73 53 65 74 28 29 27 20 FileAttrsSet()'
dc40: 61 6e 64 20 62 79 0a 09 09 09 09 20 2a 20 27 66 and by..... * 'f
dc50: 69 6c 65 20 61 74 74 72 69 62 75 74 65 73 27 2e ile attributes'.
dc60: 20 20 2a 2f 0a 20 20 20 20 54 63 6c 5f 46 53 43 */. Tcl_FSC
dc70: 72 65 61 74 65 44 69 72 65 63 74 6f 72 79 50 72 reateDirectoryPr
dc80: 6f 63 20 2a 63 72 65 61 74 65 44 69 72 65 63 74 oc *createDirect
dc90: 6f 72 79 50 72 6f 63 3b 0a 09 09 09 09 2f 2a 20 oryProc;...../*
dca0: 43 61 6c 6c 65 64 20 62 79 20 27 54 63 6c 5f 46 Called by 'Tcl_F
dcb0: 53 43 72 65 61 74 65 44 69 72 65 63 74 6f 72 79 SCreateDirectory
dcc0: 28 29 27 2e 20 20 4d 61 79 20 62 65 0a 09 09 09 ()'. May be....
dcd0: 09 20 2a 20 4e 55 4c 4c 20 69 66 20 74 68 65 20 . * NULL if the
dce0: 66 69 6c 65 73 79 73 74 65 6d 20 69 73 20 72 65 filesystem is re
dcf0: 61 64 2d 6f 6e 6c 79 2e 20 2a 2f 0a 20 20 20 20 ad-only. */.
dd00: 54 63 6c 5f 46 53 52 65 6d 6f 76 65 44 69 72 65 Tcl_FSRemoveDire
dd10: 63 74 6f 72 79 50 72 6f 63 20 2a 72 65 6d 6f 76 ctoryProc *remov
dd20: 65 44 69 72 65 63 74 6f 72 79 50 72 6f 63 3b 0a eDirectoryProc;.
dd30: 09 09 09 09 2f 2a 20 43 61 6c 6c 65 64 20 62 79 ..../* Called by
dd40: 20 27 54 63 6c 5f 46 53 52 65 6d 6f 76 65 44 69 'Tcl_FSRemoveDi
dd50: 72 65 63 74 6f 72 79 28 29 27 2e 20 20 4d 61 79 rectory()'. May
dd60: 20 62 65 0a 09 09 09 09 20 2a 20 4e 55 4c 4c 20 be..... * NULL
dd70: 69 66 20 74 68 65 20 66 69 6c 65 73 79 73 74 65 if the filesyste
dd80: 6d 20 69 73 20 72 65 61 64 2d 6f 6e 6c 79 2e 20 m is read-only.
dd90: 2a 2f 0a 20 20 20 20 54 63 6c 5f 46 53 44 65 6c */. Tcl_FSDel
dda0: 65 74 65 46 69 6c 65 50 72 6f 63 20 2a 64 65 6c eteFileProc *del
ddb0: 65 74 65 46 69 6c 65 50 72 6f 63 3b 0a 09 09 09 eteFileProc;....
ddc0: 09 2f 2a 20 43 61 6c 6c 65 64 20 62 79 20 27 54 ./* Called by 'T
ddd0: 63 6c 5f 46 53 44 65 6c 65 74 65 46 69 6c 65 28 cl_FSDeleteFile(
dde0: 29 27 20 4d 61 79 20 62 65 20 4e 55 4c 4c 0a 09 )' May be NULL..
ddf0: 09 09 09 20 2a 20 69 66 20 74 68 65 20 66 69 6c ... * if the fil
de00: 65 73 79 73 74 65 6d 20 69 73 20 69 73 20 72 65 esystem is is re
de10: 61 64 2d 6f 6e 6c 79 2e 20 2a 2f 0a 20 20 20 20 ad-only. */.
de20: 54 63 6c 5f 46 53 43 6f 70 79 46 69 6c 65 50 72 Tcl_FSCopyFilePr
de30: 6f 63 20 2a 63 6f 70 79 46 69 6c 65 50 72 6f 63 oc *copyFileProc
de40: 3b 0a 09 09 09 09 2f 2a 20 43 61 6c 6c 65 64 20 ;...../* Called
de50: 62 79 20 27 54 63 6c 5f 46 53 43 6f 70 79 46 69 by 'Tcl_FSCopyFi
de60: 6c 65 28 29 27 2e 20 20 49 66 20 4e 55 4c 4c 2c le()'. If NULL,
de70: 20 66 6f 72 0a 09 09 09 09 20 2a 20 61 20 63 6f for..... * a co
de80: 70 79 20 6f 70 65 72 61 74 69 6f 6e 20 61 74 20 py operation at
de90: 74 68 65 20 73 63 72 69 70 74 20 6c 65 76 65 6c the script level
dea0: 20 28 6e 6f 74 0a 09 09 09 09 20 2a 20 43 29 20 (not..... * C)
deb0: 54 63 6c 20 75 73 65 73 20 6f 70 65 6e 2d 72 2c Tcl uses open-r,
dec0: 20 6f 70 65 6e 2d 77 20 61 6e 64 20 66 63 6f 70 open-w and fcop
ded0: 79 2e 20 2a 2f 0a 20 20 20 20 54 63 6c 5f 46 53 y. */. Tcl_FS
dee0: 52 65 6e 61 6d 65 46 69 6c 65 50 72 6f 63 20 2a RenameFileProc *
def0: 72 65 6e 61 6d 65 46 69 6c 65 50 72 6f 63 3b 0a renameFileProc;.
df00: 09 09 09 09 2f 2a 20 43 61 6c 6c 65 64 20 62 79 ..../* Called by
df10: 20 27 54 63 6c 5f 46 53 52 65 6e 61 6d 65 46 69 'Tcl_FSRenameFi
df20: 6c 65 28 29 27 2e 20 49 66 20 4e 55 4c 4c 2c 20 le()'. If NULL,
df30: 66 6f 72 0a 09 09 09 09 20 2a 20 61 20 72 65 6e for..... * a ren
df40: 61 6d 65 20 6f 70 65 72 61 74 69 6f 6e 20 61 74 ame operation at
df50: 20 74 68 65 20 73 63 72 69 70 74 20 6c 65 76 65 the script leve
df60: 6c 20 28 6e 6f 74 0a 09 09 09 09 20 2a 20 43 29 l (not..... * C)
df70: 20 54 63 6c 20 70 65 72 66 6f 72 6d 73 20 61 20 Tcl performs a
df80: 63 6f 70 79 20 6f 70 65 72 61 74 69 6f 6e 20 66 copy operation f
df90: 6f 6c 6c 6f 77 65 64 0a 09 09 09 09 20 2a 20 62 ollowed..... * b
dfa0: 79 20 61 20 64 65 6c 65 74 65 20 6f 70 65 72 61 y a delete opera
dfb0: 74 69 6f 6e 2e 20 2a 2f 0a 20 20 20 20 54 63 6c tion. */. Tcl
dfc0: 5f 46 53 43 6f 70 79 44 69 72 65 63 74 6f 72 79 _FSCopyDirectory
dfd0: 50 72 6f 63 20 2a 63 6f 70 79 44 69 72 65 63 74 Proc *copyDirect
dfe0: 6f 72 79 50 72 6f 63 3b 0a 09 09 09 09 2f 2a 20 oryProc;...../*
dff0: 43 61 6c 6c 65 64 20 62 79 20 27 54 63 6c 5f 46 Called by 'Tcl_F
e000: 53 43 6f 70 79 44 69 72 65 63 74 6f 72 79 28 29 SCopyDirectory()
e010: 27 2e 20 49 66 20 4e 55 4c 4c 2c 0a 09 09 09 09 '. If NULL,.....
e020: 20 2a 20 66 6f 72 20 61 20 63 6f 70 79 20 6f 70 * for a copy op
e030: 65 72 61 74 69 6f 6e 20 61 74 20 74 68 65 20 73 eration at the s
e040: 63 72 69 70 74 20 6c 65 76 65 6c 0a 09 09 09 09 cript level.....
e050: 20 2a 20 28 6e 6f 74 20 43 29 20 54 63 6c 20 72 * (not C) Tcl r
e060: 65 63 75 72 73 69 76 65 6c 79 20 63 72 65 61 74 ecursively creat
e070: 65 73 20 64 69 72 65 63 74 6f 72 69 65 73 0a 09 es directories..
e080: 09 09 09 20 2a 20 61 6e 64 20 63 6f 70 69 65 73 ... * and copies
e090: 20 66 69 6c 65 73 2e 20 2a 2f 0a 20 20 20 20 54 files. */. T
e0a0: 63 6c 5f 46 53 4c 73 74 61 74 50 72 6f 63 20 2a cl_FSLstatProc *
e0b0: 6c 73 74 61 74 50 72 6f 63 3b 09 2f 2a 20 43 61 lstatProc;./* Ca
e0c0: 6c 6c 65 64 20 62 79 20 27 54 63 6c 5f 46 53 4c lled by 'Tcl_FSL
e0d0: 73 74 61 74 28 29 27 2e 20 49 66 20 4e 55 4c 4c stat()'. If NULL
e0e0: 2c 20 54 63 6c 0a 09 09 09 09 20 2a 20 61 74 74 , Tcl..... * att
e0f0: 65 6d 70 74 73 20 74 6f 20 75 73 65 20 27 73 74 empts to use 'st
e100: 61 74 50 72 6f 63 27 20 69 6e 73 74 65 61 64 2e atProc' instead.
e110: 20 2a 2f 0a 20 20 20 20 54 63 6c 5f 46 53 4c 6f */. Tcl_FSLo
e120: 61 64 46 69 6c 65 50 72 6f 63 20 2a 6c 6f 61 64 adFileProc *load
e130: 46 69 6c 65 50 72 6f 63 3b 0a 09 09 09 09 2f 2a FileProc;...../*
e140: 20 43 61 6c 6c 65 64 20 62 79 20 27 54 63 6c 5f Called by 'Tcl_
e150: 46 53 4c 6f 61 64 46 69 6c 65 28 29 27 2e 20 49 FSLoadFile()'. I
e160: 66 20 4e 55 4c 4c 2c 20 54 63 6c 0a 09 09 09 09 f NULL, Tcl.....
e170: 20 2a 20 70 65 72 66 6f 72 6d 73 20 61 20 63 6f * performs a co
e180: 70 79 20 74 6f 20 61 20 74 65 6d 70 6f 72 61 72 py to a temporar
e190: 79 20 66 69 6c 65 20 69 6e 20 74 68 65 0a 09 09 y file in the...
e1a0: 09 09 20 2a 20 6e 61 74 69 76 65 20 66 69 6c 65 .. * native file
e1b0: 73 79 73 74 65 6d 20 61 6e 64 20 74 68 65 6e 20 system and then
e1c0: 63 61 6c 6c 73 0a 09 09 09 09 20 2a 20 54 63 6c calls..... * Tcl
e1d0: 5f 46 53 4c 6f 61 64 46 69 6c 65 28 29 20 6f 6e _FSLoadFile() on
e1e0: 20 74 68 61 74 20 74 65 6d 70 6f 72 61 72 79 20 that temporary
e1f0: 63 6f 70 79 2e 20 2a 2f 0a 20 20 20 20 54 63 6c copy. */. Tcl
e200: 5f 46 53 47 65 74 43 77 64 50 72 6f 63 20 2a 67 _FSGetCwdProc *g
e210: 65 74 43 77 64 50 72 6f 63 3b 0a 09 09 09 09 2f etCwdProc;...../
e220: 2a 20 43 61 6c 6c 65 64 20 62 79 20 27 54 63 6c * Called by 'Tcl
e230: 5f 46 53 47 65 74 43 77 64 28 29 27 2e 20 20 4e _FSGetCwd()'. N
e240: 6f 72 6d 61 6c 6c 79 20 4e 55 4c 4c 2e 0a 09 09 ormally NULL....
e250: 09 09 20 2a 20 55 73 75 61 6c 6c 79 20 6f 6e 6c .. * Usually onl
e260: 79 20 63 61 6c 6c 65 64 20 6f 6e 63 65 3a 20 20 y called once:
e270: 49 66 20 27 67 65 74 63 77 64 27 20 69 73 0a 09 If 'getcwd' is..
e280: 09 09 09 20 2a 20 63 61 6c 6c 65 64 20 62 65 66 ... * called bef
e290: 6f 72 65 20 27 63 68 64 69 72 27 20 69 73 20 65 ore 'chdir' is e
e2a0: 76 65 72 20 63 61 6c 6c 65 64 2e 20 2a 2f 0a 20 ver called. */.
e2b0: 20 20 20 54 63 6c 5f 46 53 43 68 64 69 72 50 72 Tcl_FSChdirPr
e2c0: 6f 63 20 2a 63 68 64 69 72 50 72 6f 63 3b 09 2f oc *chdirProc;./
e2d0: 2a 20 43 61 6c 6c 65 64 20 62 79 20 27 54 63 6c * Called by 'Tcl
e2e0: 5f 46 53 43 68 64 69 72 28 29 27 2e 20 20 46 6f _FSChdir()'. Fo
e2f0: 72 20 61 20 76 69 72 74 75 61 6c 0a 09 09 09 09 r a virtual.....
e300: 20 2a 20 66 69 6c 65 73 79 73 74 65 6d 2c 20 63 * filesystem, c
e310: 68 64 69 72 50 72 6f 63 20 6a 75 73 74 20 72 65 hdirProc just re
e320: 74 75 72 6e 73 20 7a 65 72 6f 0a 09 09 09 09 20 turns zero.....
e330: 2a 20 28 73 75 63 63 65 73 73 29 20 69 66 20 74 * (success) if t
e340: 68 65 20 70 61 74 68 6e 61 6d 65 20 69 73 20 61 he pathname is a
e350: 20 76 61 6c 69 64 0a 09 09 09 09 20 2a 20 64 69 valid..... * di
e360: 72 65 63 74 6f 72 79 2c 20 61 6e 64 20 73 6f 6d rectory, and som
e370: 65 20 6f 74 68 65 72 20 76 61 6c 75 65 20 6f 74 e other value ot
e380: 68 65 72 77 69 73 65 2e 0a 09 09 09 09 20 2a 20 herwise...... *
e390: 46 6f 72 20 41 20 72 65 61 6c 20 66 69 6c 65 73 For A real files
e3a0: 79 73 74 65 6d 2c 20 63 68 64 69 72 50 72 6f 63 ystem, chdirProc
e3b0: 20 70 65 72 66 6f 72 6d 73 0a 09 09 09 09 20 2a performs..... *
e3c0: 20 74 68 65 20 63 6f 72 72 65 63 74 20 61 63 74 the correct act
e3d0: 69 6f 6e 2c 20 65 2e 67 2e 20 20 63 61 6c 6c 73 ion, e.g. calls
e3e0: 20 74 68 65 20 73 79 73 74 65 6d 0a 09 09 09 09 the system.....
e3f0: 20 2a 20 27 63 68 64 69 72 27 20 66 75 6e 63 74 * 'chdir' funct
e400: 69 6f 6e 2e 20 49 66 20 6e 6f 74 20 69 6d 70 6c ion. If not impl
e410: 65 6d 65 6e 74 65 64 2c 20 74 68 65 6e 0a 09 09 emented, then...
e420: 09 09 20 2a 20 27 63 64 27 20 61 6e 64 20 27 70 .. * 'cd' and 'p
e430: 77 64 27 20 66 61 69 6c 20 66 6f 72 20 61 20 70 wd' fail for a p
e440: 61 74 68 6e 61 6d 65 20 69 6e 20 74 68 69 73 0a athname in this.
e450: 09 09 09 09 20 2a 20 66 69 6c 65 73 79 73 74 65 .... * filesyste
e460: 6d 2e 20 4f 6e 20 73 75 63 63 65 73 73 20 54 63 m. On success Tc
e470: 6c 20 73 74 6f 72 65 73 20 74 68 65 0a 09 09 09 l stores the....
e480: 09 20 2a 20 70 61 74 68 6e 61 6d 65 20 66 6f 72 . * pathname for
e490: 20 75 73 65 20 62 79 20 47 65 74 43 77 64 2e 20 use by GetCwd.
e4a0: 20 49 66 20 4e 55 4c 4c 2c 20 54 63 6c 0a 09 09 If NULL, Tcl...
e4b0: 09 09 20 2a 20 70 65 72 66 6f 72 6d 73 20 72 65 .. * performs re
e4c0: 63 6f 72 64 73 20 74 68 65 20 70 61 74 68 6e 61 cords the pathna
e4d0: 6d 65 20 61 73 20 74 68 65 20 6e 65 77 0a 09 09 me as the new...
e4e0: 09 09 20 2a 20 63 75 72 72 65 6e 74 20 64 69 72 .. * current dir
e4f0: 65 63 74 6f 72 79 20 69 66 20 69 74 20 70 61 73 ectory if it pas
e500: 73 65 73 20 61 20 73 65 72 69 65 73 20 6f 66 0a ses a series of.
e510: 09 09 09 09 20 2a 20 64 69 72 65 63 74 6f 72 79 .... * directory
e520: 20 61 63 63 65 73 73 20 63 68 65 63 6b 73 2e 20 access checks.
e530: 2a 2f 0a 7d 20 54 63 6c 5f 46 69 6c 65 73 79 73 */.} Tcl_Filesys
e540: 74 65 6d 3b 0a 0a 2f 2a 0a 20 2a 20 54 68 65 20 tem;../*. * The
e550: 66 6f 6c 6c 6f 77 69 6e 67 20 64 65 66 69 6e 69 following defini
e560: 74 69 6f 6e 73 20 61 72 65 20 75 73 65 64 20 61 tions are used a
e570: 73 20 76 61 6c 75 65 73 20 66 6f 72 20 74 68 65 s values for the
e580: 20 27 6c 69 6e 6b 41 63 74 69 6f 6e 27 20 66 6c 'linkAction' fl
e590: 61 67 20 74 6f 0a 20 2a 20 54 63 6c 5f 46 53 4c ag to. * Tcl_FSL
e5a0: 69 6e 6b 2c 20 6f 72 20 74 68 65 20 6c 69 6e 6b ink, or the link
e5b0: 50 72 6f 63 20 6f 66 20 61 6e 79 20 66 69 6c 65 Proc of any file
e5c0: 73 79 73 74 65 6d 2e 20 41 6e 79 20 63 6f 6d 62 system. Any comb
e5d0: 69 6e 61 74 69 6f 6e 20 6f 66 20 66 6c 61 67 73 ination of flags
e5e0: 20 63 61 6e 0a 20 2a 20 62 65 20 67 69 76 65 6e can. * be given
e5f0: 2e 20 46 6f 72 20 6c 69 6e 6b 20 63 72 65 61 74 . For link creat
e600: 69 6f 6e 2c 20 74 68 65 20 6c 69 6e 6b 50 72 6f ion, the linkPro
e610: 63 20 73 68 6f 75 6c 64 20 63 72 65 61 74 65 20 c should create
e620: 61 20 6c 69 6e 6b 20 77 68 69 63 68 0a 20 2a 20 a link which. *
e630: 6d 61 74 63 68 65 73 20 61 6e 79 20 6f 66 20 74 matches any of t
e640: 68 65 20 74 79 70 65 73 20 67 69 76 65 6e 2e 0a he types given..
e650: 20 2a 0a 20 2a 20 54 43 4c 5f 43 52 45 41 54 45 *. * TCL_CREATE
e660: 5f 53 59 4d 42 4f 4c 49 43 5f 4c 49 4e 4b 20 2d _SYMBOLIC_LINK -
e670: 09 43 72 65 61 74 65 20 61 20 73 79 6d 62 6f 6c .Create a symbol
e680: 69 63 20 6f 72 20 73 6f 66 74 20 6c 69 6e 6b 2e ic or soft link.
e690: 0a 20 2a 20 54 43 4c 5f 43 52 45 41 54 45 5f 48 . * TCL_CREATE_H
e6a0: 41 52 44 5f 4c 49 4e 4b 20 2d 09 43 72 65 61 74 ARD_LINK -.Creat
e6b0: 65 20 61 20 68 61 72 64 20 6c 69 6e 6b 2e 0a 20 e a hard link..
e6c0: 2a 2f 0a 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f */..#define TCL_
e6d0: 43 52 45 41 54 45 5f 53 59 4d 42 4f 4c 49 43 5f CREATE_SYMBOLIC_
e6e0: 4c 49 4e 4b 09 30 78 30 31 0a 23 64 65 66 69 6e LINK.0x01.#defin
e6f0: 65 20 54 43 4c 5f 43 52 45 41 54 45 5f 48 41 52 e TCL_CREATE_HAR
e700: 44 5f 4c 49 4e 4b 09 09 30 78 30 32 0a 0a 2f 2a D_LINK..0x02../*
e710: 0a 20 2a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d . *-------------
e720: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
e730: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
e740: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
e750: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a ---------------.
e760: 20 2a 20 54 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 * The following
e770: 20 73 74 72 75 63 74 75 72 65 20 72 65 70 72 65 structure repre
e780: 73 65 6e 74 73 20 74 68 65 20 4e 6f 74 69 66 69 sents the Notifi
e790: 65 72 20 66 75 6e 63 74 69 6f 6e 73 20 74 68 61 er functions tha
e7a0: 74 20 79 6f 75 20 63 61 6e 0a 20 2a 20 6f 76 65 t you can. * ove
e7b0: 72 72 69 64 65 20 77 69 74 68 20 74 68 65 20 54 rride with the T
e7c0: 63 6c 5f 53 65 74 4e 6f 74 69 66 69 65 72 20 63 cl_SetNotifier c
e7d0: 61 6c 6c 2e 0a 20 2a 2f 0a 0a 74 79 70 65 64 65 all.. */..typede
e7e0: 66 20 73 74 72 75 63 74 20 54 63 6c 5f 4e 6f 74 f struct Tcl_Not
e7f0: 69 66 69 65 72 50 72 6f 63 73 20 7b 0a 20 20 20 ifierProcs {.
e800: 20 54 63 6c 5f 53 65 74 54 69 6d 65 72 50 72 6f Tcl_SetTimerPro
e810: 63 20 2a 73 65 74 54 69 6d 65 72 50 72 6f 63 3b c *setTimerProc;
e820: 0a 20 20 20 20 54 63 6c 5f 57 61 69 74 46 6f 72 . Tcl_WaitFor
e830: 45 76 65 6e 74 50 72 6f 63 20 2a 77 61 69 74 46 EventProc *waitF
e840: 6f 72 45 76 65 6e 74 50 72 6f 63 3b 0a 20 20 20 orEventProc;.
e850: 20 54 63 6c 5f 43 72 65 61 74 65 46 69 6c 65 48 Tcl_CreateFileH
e860: 61 6e 64 6c 65 72 50 72 6f 63 20 2a 63 72 65 61 andlerProc *crea
e870: 74 65 46 69 6c 65 48 61 6e 64 6c 65 72 50 72 6f teFileHandlerPro
e880: 63 3b 0a 20 20 20 20 54 63 6c 5f 44 65 6c 65 74 c;. Tcl_Delet
e890: 65 46 69 6c 65 48 61 6e 64 6c 65 72 50 72 6f 63 eFileHandlerProc
e8a0: 20 2a 64 65 6c 65 74 65 46 69 6c 65 48 61 6e 64 *deleteFileHand
e8b0: 6c 65 72 50 72 6f 63 3b 0a 20 20 20 20 54 63 6c lerProc;. Tcl
e8c0: 5f 49 6e 69 74 4e 6f 74 69 66 69 65 72 50 72 6f _InitNotifierPro
e8d0: 63 20 2a 69 6e 69 74 4e 6f 74 69 66 69 65 72 50 c *initNotifierP
e8e0: 72 6f 63 3b 0a 20 20 20 20 54 63 6c 5f 46 69 6e roc;. Tcl_Fin
e8f0: 61 6c 69 7a 65 4e 6f 74 69 66 69 65 72 50 72 6f alizeNotifierPro
e900: 63 20 2a 66 69 6e 61 6c 69 7a 65 4e 6f 74 69 66 c *finalizeNotif
e910: 69 65 72 50 72 6f 63 3b 0a 20 20 20 20 54 63 6c ierProc;. Tcl
e920: 5f 41 6c 65 72 74 4e 6f 74 69 66 69 65 72 50 72 _AlertNotifierPr
e930: 6f 63 20 2a 61 6c 65 72 74 4e 6f 74 69 66 69 65 oc *alertNotifie
e940: 72 50 72 6f 63 3b 0a 20 20 20 20 54 63 6c 5f 53 rProc;. Tcl_S
e950: 65 72 76 69 63 65 4d 6f 64 65 48 6f 6f 6b 50 72 erviceModeHookPr
e960: 6f 63 20 2a 73 65 72 76 69 63 65 4d 6f 64 65 48 oc *serviceModeH
e970: 6f 6f 6b 50 72 6f 63 3b 0a 7d 20 54 63 6c 5f 4e ookProc;.} Tcl_N
e980: 6f 74 69 66 69 65 72 50 72 6f 63 73 3b 0a 0c 0a otifierProcs;...
e990: 2f 2a 0a 20 2a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d /*. *-----------
e9a0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
e9b0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
e9c0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
e9d0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
e9e0: 2d 0a 20 2a 20 54 68 65 20 66 6f 6c 6c 6f 77 69 -. * The followi
e9f0: 6e 67 20 64 61 74 61 20 73 74 72 75 63 74 75 72 ng data structur
ea00: 65 73 20 61 6e 64 20 64 65 63 6c 61 72 61 74 69 es and declarati
ea10: 6f 6e 73 20 61 72 65 20 66 6f 72 20 74 68 65 20 ons are for the
ea20: 6e 65 77 20 54 63 6c 20 70 61 72 73 65 72 2e 0a new Tcl parser..
ea30: 20 2a 0a 20 2a 20 46 6f 72 20 65 61 63 68 20 77 *. * For each w
ea40: 6f 72 64 20 6f 66 20 61 20 63 6f 6d 6d 61 6e 64 ord of a command
ea50: 2c 20 61 6e 64 20 66 6f 72 20 65 61 63 68 20 70 , and for each p
ea60: 69 65 63 65 20 6f 66 20 61 20 77 6f 72 64 20 73 iece of a word s
ea70: 75 63 68 20 61 73 20 61 20 76 61 72 69 61 62 6c uch as a variabl
ea80: 65 0a 20 2a 20 72 65 66 65 72 65 6e 63 65 2c 20 e. * reference,
ea90: 6f 6e 65 20 6f 66 20 74 68 65 20 66 6f 6c 6c 6f one of the follo
eaa0: 77 69 6e 67 20 73 74 72 75 63 74 75 72 65 73 20 wing structures
eab0: 69 73 20 63 72 65 61 74 65 64 20 74 6f 20 64 65 is created to de
eac0: 73 63 72 69 62 65 20 74 68 65 0a 20 2a 20 74 6f scribe the. * to
ead0: 6b 65 6e 2e 0a 20 2a 2f 0a 0a 74 79 70 65 64 65 ken.. */..typede
eae0: 66 20 73 74 72 75 63 74 20 54 63 6c 5f 54 6f 6b f struct Tcl_Tok
eaf0: 65 6e 20 7b 0a 20 20 20 20 69 6e 74 20 74 79 70 en {. int typ
eb00: 65 3b 09 09 09 2f 2a 20 54 79 70 65 20 6f 66 20 e;.../* Type of
eb10: 74 6f 6b 65 6e 2c 20 73 75 63 68 20 61 73 20 54 token, such as T
eb20: 43 4c 5f 54 4f 4b 45 4e 5f 57 4f 52 44 3b 20 73 CL_TOKEN_WORD; s
eb30: 65 65 0a 09 09 09 09 20 2a 20 62 65 6c 6f 77 20 ee..... * below
eb40: 66 6f 72 20 76 61 6c 69 64 20 74 79 70 65 73 2e for valid types.
eb50: 20 2a 2f 0a 20 20 20 20 63 6f 6e 73 74 20 63 68 */. const ch
eb60: 61 72 20 2a 73 74 61 72 74 3b 09 09 2f 2a 20 46 ar *start;../* F
eb70: 69 72 73 74 20 63 68 61 72 61 63 74 65 72 20 69 irst character i
eb80: 6e 20 74 6f 6b 65 6e 2e 20 2a 2f 0a 20 20 20 20 n token. */.
eb90: 73 69 7a 65 5f 74 20 73 69 7a 65 3b 09 09 09 2f size_t size;.../
eba0: 2a 20 4e 75 6d 62 65 72 20 6f 66 20 62 79 74 65 * Number of byte
ebb0: 73 20 69 6e 20 74 6f 6b 65 6e 2e 20 2a 2f 0a 20 s in token. */.
ebc0: 20 20 20 73 69 7a 65 5f 74 20 6e 75 6d 43 6f 6d size_t numCom
ebd0: 70 6f 6e 65 6e 74 73 3b 09 09 2f 2a 20 49 66 20 ponents;../* If
ebe0: 74 68 69 73 20 74 6f 6b 65 6e 20 69 73 20 63 6f this token is co
ebf0: 6d 70 6f 73 65 64 20 6f 66 20 6f 74 68 65 72 20 mposed of other
ec00: 74 6f 6b 65 6e 73 2c 0a 09 09 09 09 20 2a 20 74 tokens,..... * t
ec10: 68 69 73 20 66 69 65 6c 64 20 74 65 6c 6c 73 20 his field tells
ec20: 68 6f 77 20 6d 61 6e 79 20 6f 66 20 74 68 65 6d how many of them
ec30: 20 74 68 65 72 65 20 61 72 65 0a 09 09 09 09 20 there are.....
ec40: 2a 20 28 69 6e 63 6c 75 64 69 6e 67 20 63 6f 6d * (including com
ec50: 70 6f 6e 65 6e 74 73 20 6f 66 20 63 6f 6d 70 6f ponents of compo
ec60: 6e 65 6e 74 73 2c 20 65 74 63 2e 29 2e 0a 09 09 nents, etc.)....
ec70: 09 09 20 2a 20 54 68 65 20 63 6f 6d 70 6f 6e 65 .. * The compone
ec80: 6e 74 20 74 6f 6b 65 6e 73 20 69 6d 6d 65 64 69 nt tokens immedi
ec90: 61 74 65 6c 79 20 66 6f 6c 6c 6f 77 0a 09 09 09 ately follow....
eca0: 09 20 2a 20 74 68 69 73 20 6f 6e 65 2e 20 2a 2f . * this one. */
ecb0: 0a 7d 20 54 63 6c 5f 54 6f 6b 65 6e 3b 0a 0a 2f .} Tcl_Token;../
ecc0: 2a 0a 20 2a 20 54 79 70 65 20 76 61 6c 75 65 73 *. * Type values
ecd0: 20 64 65 66 69 6e 65 64 20 66 6f 72 20 54 63 6c defined for Tcl
ece0: 5f 54 6f 6b 65 6e 20 73 74 72 75 63 74 75 72 65 _Token structure
ecf0: 73 2e 20 54 68 65 73 65 20 76 61 6c 75 65 73 20 s. These values
ed00: 61 72 65 20 64 65 66 69 6e 65 64 20 61 73 0a 20 are defined as.
ed10: 2a 20 6d 61 73 6b 20 62 69 74 73 20 73 6f 20 74 * mask bits so t
ed20: 68 61 74 20 69 74 27 73 20 65 61 73 79 20 74 6f hat it's easy to
ed30: 20 63 68 65 63 6b 20 66 6f 72 20 63 6f 6c 6c 65 check for colle
ed40: 63 74 69 6f 6e 73 20 6f 66 20 74 79 70 65 73 2e ctions of types.
ed50: 0a 20 2a 0a 20 2a 20 54 43 4c 5f 54 4f 4b 45 4e . *. * TCL_TOKEN
ed60: 5f 57 4f 52 44 20 2d 09 09 54 68 65 20 74 6f 6b _WORD -..The tok
ed70: 65 6e 20 64 65 73 63 72 69 62 65 73 20 6f 6e 65 en describes one
ed80: 20 77 6f 72 64 20 6f 66 20 61 20 63 6f 6d 6d 61 word of a comma
ed90: 6e 64 2c 0a 20 2a 09 09 09 09 66 72 6f 6d 20 74 nd,. *....from t
eda0: 68 65 20 66 69 72 73 74 20 6e 6f 6e 2d 62 6c 61 he first non-bla
edb0: 6e 6b 20 63 68 61 72 61 63 74 65 72 20 6f 66 20 nk character of
edc0: 74 68 65 20 77 6f 72 64 0a 20 2a 09 09 09 09 28 the word. *....(
edd0: 77 68 69 63 68 20 6d 61 79 20 62 65 20 22 20 6f which may be " o
ede0: 72 20 7b 29 20 75 70 20 74 6f 20 62 75 74 20 6e r {) up to but n
edf0: 6f 74 20 69 6e 63 6c 75 64 69 6e 67 0a 20 2a 09 ot including. *.
ee00: 09 09 09 74 68 65 20 73 70 61 63 65 2c 20 73 65 ...the space, se
ee10: 6d 69 63 6f 6c 6f 6e 2c 20 6f 72 20 62 72 61 63 micolon, or brac
ee20: 6b 65 74 20 74 68 61 74 0a 20 2a 09 09 09 09 74 ket that. *....t
ee30: 65 72 6d 69 6e 61 74 65 73 20 74 68 65 20 77 6f erminates the wo
ee40: 72 64 2e 20 4e 75 6d 43 6f 6d 70 6f 6e 65 6e 74 rd. NumComponent
ee50: 73 20 63 6f 75 6e 74 73 20 74 68 65 0a 20 2a 09 s counts the. *.
ee60: 09 09 09 74 6f 74 61 6c 20 6e 75 6d 62 65 72 20 ...total number
ee70: 6f 66 20 73 75 62 2d 74 6f 6b 65 6e 73 20 74 68 of sub-tokens th
ee80: 61 74 20 6d 61 6b 65 20 75 70 20 74 68 65 0a 20 at make up the.
ee90: 2a 09 09 09 09 77 6f 72 64 2e 20 54 68 69 73 20 *....word. This
eea0: 69 6e 63 6c 75 64 65 73 2c 20 66 6f 72 20 65 78 includes, for ex
eeb0: 61 6d 70 6c 65 2c 20 73 75 62 2d 74 6f 6b 65 6e ample, sub-token
eec0: 73 0a 20 2a 09 09 09 09 6f 66 20 54 43 4c 5f 54 s. *....of TCL_T
eed0: 4f 4b 45 4e 5f 56 41 52 49 41 42 4c 45 20 74 6f OKEN_VARIABLE to
eee0: 6b 65 6e 73 2e 0a 20 2a 20 54 43 4c 5f 54 4f 4b kens.. * TCL_TOK
eef0: 45 4e 5f 53 49 4d 50 4c 45 5f 57 4f 52 44 20 2d EN_SIMPLE_WORD -
ef00: 09 54 68 69 73 20 74 6f 6b 65 6e 20 69 73 20 6a .This token is j
ef10: 75 73 74 20 6c 69 6b 65 20 54 43 4c 5f 54 4f 4b ust like TCL_TOK
ef20: 45 4e 5f 57 4f 52 44 20 65 78 63 65 70 74 0a 20 EN_WORD except.
ef30: 2a 09 09 09 09 74 68 61 74 20 74 68 65 20 77 6f *....that the wo
ef40: 72 64 20 69 73 20 67 75 61 72 61 6e 74 65 65 64 rd is guaranteed
ef50: 20 74 6f 20 63 6f 6e 73 69 73 74 20 6f 66 20 61 to consist of a
ef60: 0a 20 2a 09 09 09 09 73 69 6e 67 6c 65 20 54 43 . *....single TC
ef70: 4c 5f 54 4f 4b 45 4e 5f 54 45 58 54 20 73 75 62 L_TOKEN_TEXT sub
ef80: 2d 74 6f 6b 65 6e 2e 0a 20 2a 20 54 43 4c 5f 54 -token.. * TCL_T
ef90: 4f 4b 45 4e 5f 54 45 58 54 20 2d 09 09 54 68 65 OKEN_TEXT -..The
efa0: 20 74 6f 6b 65 6e 20 64 65 73 63 72 69 62 65 73 token describes
efb0: 20 61 20 72 61 6e 67 65 20 6f 66 20 6c 69 74 65 a range of lite
efc0: 72 61 6c 20 74 65 78 74 0a 20 2a 09 09 09 09 74 ral text. *....t
efd0: 68 61 74 20 69 73 20 70 61 72 74 20 6f 66 20 61 hat is part of a
efe0: 20 77 6f 72 64 2e 20 4e 75 6d 43 6f 6d 70 6f 6e word. NumCompon
eff0: 65 6e 74 73 20 69 73 0a 20 2a 09 09 09 09 61 6c ents is. *....al
f000: 77 61 79 73 20 30 2e 0a 20 2a 20 54 43 4c 5f 54 ways 0.. * TCL_T
f010: 4f 4b 45 4e 5f 42 53 20 2d 09 09 54 68 65 20 74 OKEN_BS -..The t
f020: 6f 6b 65 6e 20 64 65 73 63 72 69 62 65 73 20 61 oken describes a
f030: 20 62 61 63 6b 73 6c 61 73 68 20 73 65 71 75 65 backslash seque
f040: 6e 63 65 20 74 68 61 74 0a 20 2a 09 09 09 09 6d nce that. *....m
f050: 75 73 74 20 62 65 20 63 6f 6c 6c 61 70 73 65 64 ust be collapsed
f060: 2e 20 4e 75 6d 43 6f 6d 70 6f 6e 65 6e 74 73 20 . NumComponents
f070: 69 73 20 61 6c 77 61 79 73 20 30 2e 0a 20 2a 20 is always 0.. *
f080: 54 43 4c 5f 54 4f 4b 45 4e 5f 43 4f 4d 4d 41 4e TCL_TOKEN_COMMAN
f090: 44 20 2d 09 09 54 68 65 20 74 6f 6b 65 6e 20 64 D -..The token d
f0a0: 65 73 63 72 69 62 65 73 20 61 20 63 6f 6d 6d 61 escribes a comma
f0b0: 6e 64 20 77 68 6f 73 65 20 72 65 73 75 6c 74 0a nd whose result.
f0c0: 20 2a 09 09 09 09 6d 75 73 74 20 62 65 20 73 75 *....must be su
f0d0: 62 73 74 69 74 75 74 65 64 20 69 6e 74 6f 20 74 bstituted into t
f0e0: 68 65 20 77 6f 72 64 2e 20 54 68 65 20 74 6f 6b he word. The tok
f0f0: 65 6e 0a 20 2a 09 09 09 09 69 6e 63 6c 75 64 65 en. *....include
f100: 73 20 74 68 65 20 65 6e 63 6c 6f 73 69 6e 67 20 s the enclosing
f110: 62 72 61 63 6b 65 74 73 2e 20 4e 75 6d 43 6f 6d brackets. NumCom
f120: 70 6f 6e 65 6e 74 73 0a 20 2a 09 09 09 09 69 73 ponents. *....is
f130: 20 61 6c 77 61 79 73 20 30 2e 0a 20 2a 20 54 43 always 0.. * TC
f140: 4c 5f 54 4f 4b 45 4e 5f 56 41 52 49 41 42 4c 45 L_TOKEN_VARIABLE
f150: 20 2d 09 09 54 68 65 20 74 6f 6b 65 6e 20 64 65 -..The token de
f160: 73 63 72 69 62 65 73 20 61 20 76 61 72 69 61 62 scribes a variab
f170: 6c 65 20 73 75 62 73 74 69 74 75 74 69 6f 6e 2c le substitution,
f180: 0a 20 2a 09 09 09 09 69 6e 63 6c 75 64 69 6e 67 . *....including
f190: 20 74 68 65 20 64 6f 6c 6c 61 72 20 73 69 67 6e the dollar sign
f1a0: 2c 20 76 61 72 69 61 62 6c 65 20 6e 61 6d 65 2c , variable name,
f1b0: 20 61 6e 64 0a 20 2a 09 09 09 09 61 72 72 61 79 and. *....array
f1c0: 20 69 6e 64 65 78 20 28 69 66 20 74 68 65 72 65 index (if there
f1d0: 20 69 73 20 6f 6e 65 29 20 75 70 20 74 68 72 6f is one) up thro
f1e0: 75 67 68 20 74 68 65 0a 20 2a 09 09 09 09 72 69 ugh the. *....ri
f1f0: 67 68 74 20 70 61 72 65 6e 74 68 65 73 65 73 2e ght parentheses.
f200: 20 4e 75 6d 43 6f 6d 70 6f 6e 65 6e 74 73 20 74 NumComponents t
f210: 65 6c 6c 73 20 68 6f 77 0a 20 2a 09 09 09 09 6d ells how. *....m
f220: 61 6e 79 20 61 64 64 69 74 69 6f 6e 61 6c 20 74 any additional t
f230: 6f 6b 65 6e 73 20 66 6f 6c 6c 6f 77 20 74 6f 20 okens follow to
f240: 72 65 70 72 65 73 65 6e 74 20 74 68 65 0a 20 2a represent the. *
f250: 09 09 09 09 76 61 72 69 61 62 6c 65 20 6e 61 6d ....variable nam
f260: 65 2e 20 54 68 65 20 66 69 72 73 74 20 74 6f 6b e. The first tok
f270: 65 6e 20 77 69 6c 6c 20 62 65 20 61 0a 20 2a 09 en will be a. *.
f280: 09 09 09 54 43 4c 5f 54 4f 4b 45 4e 5f 54 45 58 ...TCL_TOKEN_TEX
f290: 54 20 74 6f 6b 65 6e 20 74 68 61 74 20 64 65 73 T token that des
f2a0: 63 72 69 62 65 73 20 74 68 65 0a 20 2a 09 09 09 cribes the. *...
f2b0: 09 76 61 72 69 61 62 6c 65 20 6e 61 6d 65 2e 20 .variable name.
f2c0: 49 66 20 74 68 65 20 76 61 72 69 61 62 6c 65 20 If the variable
f2d0: 69 73 20 61 6e 20 61 72 72 61 79 0a 20 2a 09 09 is an array. *..
f2e0: 09 09 72 65 66 65 72 65 6e 63 65 20 74 68 65 6e ..reference then
f2f0: 20 74 68 65 72 65 20 77 69 6c 6c 20 62 65 20 6f there will be o
f300: 6e 65 20 6f 72 20 6d 6f 72 65 0a 20 2a 09 09 09 ne or more. *...
f310: 09 61 64 64 69 74 69 6f 6e 61 6c 20 74 6f 6b 65 .additional toke
f320: 6e 73 2c 20 6f 66 20 74 79 70 65 20 54 43 4c 5f ns, of type TCL_
f330: 54 4f 4b 45 4e 5f 54 45 58 54 2c 0a 20 2a 09 09 TOKEN_TEXT,. *..
f340: 09 09 54 43 4c 5f 54 4f 4b 45 4e 5f 42 53 2c 20 ..TCL_TOKEN_BS,
f350: 54 43 4c 5f 54 4f 4b 45 4e 5f 43 4f 4d 4d 41 4e TCL_TOKEN_COMMAN
f360: 44 2c 20 61 6e 64 0a 20 2a 09 09 09 09 54 43 4c D, and. *....TCL
f370: 5f 54 4f 4b 45 4e 5f 56 41 52 49 41 42 4c 45 2c _TOKEN_VARIABLE,
f380: 20 74 68 61 74 20 64 65 73 63 72 69 62 65 20 74 that describe t
f390: 68 65 20 61 72 72 61 79 0a 20 2a 09 09 09 09 69 he array. *....i
f3a0: 6e 64 65 78 3b 20 6e 75 6d 43 6f 6d 70 6f 6e 65 ndex; numCompone
f3b0: 6e 74 73 20 63 6f 75 6e 74 73 20 74 68 65 20 74 nts counts the t
f3c0: 6f 74 61 6c 20 6e 75 6d 62 65 72 0a 20 2a 09 09 otal number. *..
f3d0: 09 09 6f 66 20 6e 65 73 74 65 64 20 74 6f 6b 65 ..of nested toke
f3e0: 6e 73 20 74 68 61 74 20 6d 61 6b 65 20 75 70 20 ns that make up
f3f0: 74 68 65 20 76 61 72 69 61 62 6c 65 0a 20 2a 09 the variable. *.
f400: 09 09 09 72 65 66 65 72 65 6e 63 65 2c 20 69 6e ...reference, in
f410: 63 6c 75 64 69 6e 67 20 73 75 62 2d 74 6f 6b 65 cluding sub-toke
f420: 6e 73 20 6f 66 0a 20 2a 09 09 09 09 54 43 4c 5f ns of. *....TCL_
f430: 54 4f 4b 45 4e 5f 56 41 52 49 41 42 4c 45 20 74 TOKEN_VARIABLE t
f440: 6f 6b 65 6e 73 2e 0a 20 2a 20 54 43 4c 5f 54 4f okens.. * TCL_TO
f450: 4b 45 4e 5f 53 55 42 5f 45 58 50 52 20 2d 09 09 KEN_SUB_EXPR -..
f460: 54 68 65 20 74 6f 6b 65 6e 20 64 65 73 63 72 69 The token descri
f470: 62 65 73 20 6f 6e 65 20 73 75 62 65 78 70 72 65 bes one subexpre
f480: 73 73 69 6f 6e 20 6f 66 20 61 6e 0a 20 2a 09 09 ssion of an. *..
f490: 09 09 65 78 70 72 65 73 73 69 6f 6e 2c 20 66 72 ..expression, fr
f4a0: 6f 6d 20 74 68 65 20 66 69 72 73 74 20 6e 6f 6e om the first non
f4b0: 2d 62 6c 61 6e 6b 20 63 68 61 72 61 63 74 65 72 -blank character
f4c0: 0a 20 2a 09 09 09 09 6f 66 20 74 68 65 20 73 75 . *....of the su
f4d0: 62 65 78 70 72 65 73 73 69 6f 6e 20 75 70 20 74 bexpression up t
f4e0: 6f 20 62 75 74 20 6e 6f 74 20 69 6e 63 6c 75 64 o but not includ
f4f0: 69 6e 67 0a 20 2a 09 09 09 09 74 68 65 20 73 70 ing. *....the sp
f500: 61 63 65 2c 20 62 72 61 63 65 2c 20 6f 72 20 62 ace, brace, or b
f510: 72 61 63 6b 65 74 20 74 68 61 74 20 74 65 72 6d racket that term
f520: 69 6e 61 74 65 73 0a 20 2a 09 09 09 09 74 68 65 inates. *....the
f530: 20 73 75 62 65 78 70 72 65 73 73 69 6f 6e 2e 20 subexpression.
f540: 4e 75 6d 43 6f 6d 70 6f 6e 65 6e 74 73 20 63 6f NumComponents co
f550: 75 6e 74 73 20 74 68 65 0a 20 2a 09 09 09 09 74 unts the. *....t
f560: 6f 74 61 6c 20 6e 75 6d 62 65 72 20 6f 66 20 66 otal number of f
f570: 6f 6c 6c 6f 77 69 6e 67 20 73 75 62 74 6f 6b 65 ollowing subtoke
f580: 6e 73 20 74 68 61 74 20 6d 61 6b 65 0a 20 2a 09 ns that make. *.
f590: 09 09 09 75 70 20 74 68 65 20 73 75 62 65 78 70 ...up the subexp
f5a0: 72 65 73 73 69 6f 6e 3b 20 74 68 69 73 20 69 6e ression; this in
f5b0: 63 6c 75 64 65 73 20 61 6c 6c 0a 20 2a 09 09 09 cludes all. *...
f5c0: 09 73 75 62 74 6f 6b 65 6e 73 20 66 6f 72 20 61 .subtokens for a
f5d0: 6e 79 20 6e 65 73 74 65 64 20 54 43 4c 5f 54 4f ny nested TCL_TO
f5e0: 4b 45 4e 5f 53 55 42 5f 45 58 50 52 0a 20 2a 09 KEN_SUB_EXPR. *.
f5f0: 09 09 09 74 6f 6b 65 6e 73 2e 20 46 6f 72 20 65 ...tokens. For e
f600: 78 61 6d 70 6c 65 2c 20 61 20 6e 75 6d 65 72 69 xample, a numeri
f610: 63 20 76 61 6c 75 65 20 75 73 65 64 20 61 73 20 c value used as
f620: 61 0a 20 2a 09 09 09 09 70 72 69 6d 69 74 69 76 a. *....primitiv
f630: 65 20 6f 70 65 72 61 6e 64 20 69 73 20 64 65 73 e operand is des
f640: 63 72 69 62 65 64 20 62 79 20 61 0a 20 2a 09 09 cribed by a. *..
f650: 09 09 54 43 4c 5f 54 4f 4b 45 4e 5f 53 55 42 5f ..TCL_TOKEN_SUB_
f660: 45 58 50 52 20 74 6f 6b 65 6e 20 66 6f 6c 6c 6f EXPR token follo
f670: 77 65 64 20 62 79 20 61 0a 20 2a 09 09 09 09 54 wed by a. *....T
f680: 43 4c 5f 54 4f 4b 45 4e 5f 54 45 58 54 20 74 6f CL_TOKEN_TEXT to
f690: 6b 65 6e 2e 20 41 20 62 69 6e 61 72 79 20 73 75 ken. A binary su
f6a0: 62 65 78 70 72 65 73 73 69 6f 6e 0a 20 2a 09 09 bexpression. *..
f6b0: 09 09 69 73 20 64 65 73 63 72 69 62 65 64 20 62 ..is described b
f6c0: 79 20 61 20 54 43 4c 5f 54 4f 4b 45 4e 5f 53 55 y a TCL_TOKEN_SU
f6d0: 42 5f 45 58 50 52 20 74 6f 6b 65 6e 0a 20 2a 09 B_EXPR token. *.
f6e0: 09 09 09 66 6f 6c 6c 6f 77 65 64 20 62 79 20 74 ...followed by t
f6f0: 68 65 20 54 43 4c 5f 54 4f 4b 45 4e 5f 4f 50 45 he TCL_TOKEN_OPE
f700: 52 41 54 4f 52 20 74 6f 6b 65 6e 20 66 6f 72 0a RATOR token for.
f710: 20 2a 09 09 09 09 74 68 65 20 6f 70 65 72 61 74 *....the operat
f720: 6f 72 2c 20 74 68 65 6e 20 54 43 4c 5f 54 4f 4b or, then TCL_TOK
f730: 45 4e 5f 53 55 42 5f 45 58 50 52 20 74 6f 6b 65 EN_SUB_EXPR toke
f740: 6e 73 0a 20 2a 09 09 09 09 66 6f 72 20 74 68 65 ns. *....for the
f750: 20 6c 65 66 74 20 74 68 65 6e 20 74 68 65 20 72 left then the r
f760: 69 67 68 74 20 6f 70 65 72 61 6e 64 73 2e 0a 20 ight operands..
f770: 2a 20 54 43 4c 5f 54 4f 4b 45 4e 5f 4f 50 45 52 * TCL_TOKEN_OPER
f780: 41 54 4f 52 20 2d 09 09 54 68 65 20 74 6f 6b 65 ATOR -..The toke
f790: 6e 20 64 65 73 63 72 69 62 65 73 20 6f 6e 65 20 n describes one
f7a0: 65 78 70 72 65 73 73 69 6f 6e 20 6f 70 65 72 61 expression opera
f7b0: 74 6f 72 2e 0a 20 2a 09 09 09 09 41 6e 20 6f 70 tor.. *....An op
f7c0: 65 72 61 74 6f 72 20 6d 69 67 68 74 20 62 65 20 erator might be
f7d0: 74 68 65 20 6e 61 6d 65 20 6f 66 20 61 20 6d 61 the name of a ma
f7e0: 74 68 0a 20 2a 09 09 09 09 66 75 6e 63 74 69 6f th. *....functio
f7f0: 6e 20 73 75 63 68 20 61 73 20 22 61 62 73 22 2e n such as "abs".
f800: 20 41 20 54 43 4c 5f 54 4f 4b 45 4e 5f 4f 50 45 A TCL_TOKEN_OPE
f810: 52 41 54 4f 52 0a 20 2a 09 09 09 09 74 6f 6b 65 RATOR. *....toke
f820: 6e 20 69 73 20 61 6c 77 61 79 73 20 70 72 65 63 n is always prec
f830: 65 65 64 65 64 20 62 79 20 6f 6e 65 0a 20 2a 09 eeded by one. *.
f840: 09 09 09 54 43 4c 5f 54 4f 4b 45 4e 5f 53 55 42 ...TCL_TOKEN_SUB
f850: 5f 45 58 50 52 20 74 6f 6b 65 6e 20 66 6f 72 20 _EXPR token for
f860: 74 68 65 20 6f 70 65 72 61 74 6f 72 27 73 0a 20 the operator's.
f870: 2a 09 09 09 09 73 75 62 65 78 70 72 65 73 73 69 *....subexpressi
f880: 6f 6e 2c 20 61 6e 64 20 69 73 20 66 6f 6c 6c 6f on, and is follo
f890: 77 65 64 20 62 79 20 7a 65 72 6f 20 6f 72 20 6d wed by zero or m
f8a0: 6f 72 65 0a 20 2a 09 09 09 09 54 43 4c 5f 54 4f ore. *....TCL_TO
f8b0: 4b 45 4e 5f 53 55 42 5f 45 58 50 52 20 74 6f 6b KEN_SUB_EXPR tok
f8c0: 65 6e 73 20 66 6f 72 20 74 68 65 20 6f 70 65 72 ens for the oper
f8d0: 61 74 6f 72 27 73 0a 20 2a 09 09 09 09 6f 70 65 ator's. *....ope
f8e0: 72 61 6e 64 73 2e 20 4e 75 6d 43 6f 6d 70 6f 6e rands. NumCompon
f8f0: 65 6e 74 73 20 69 73 20 61 6c 77 61 79 73 20 30 ents is always 0
f900: 2e 0a 20 2a 20 54 43 4c 5f 54 4f 4b 45 4e 5f 45 .. * TCL_TOKEN_E
f910: 58 50 41 4e 44 5f 57 4f 52 44 20 2d 09 54 68 69 XPAND_WORD -.Thi
f920: 73 20 74 6f 6b 65 6e 20 69 73 20 6a 75 73 74 20 s token is just
f930: 6c 69 6b 65 20 54 43 4c 5f 54 4f 4b 45 4e 5f 57 like TCL_TOKEN_W
f940: 4f 52 44 20 65 78 63 65 70 74 0a 20 2a 09 09 09 ORD except. *...
f950: 09 74 68 61 74 20 69 74 20 6d 61 72 6b 73 20 61 .that it marks a
f960: 20 77 6f 72 64 20 74 68 61 74 20 62 65 67 61 6e word that began
f970: 20 77 69 74 68 20 74 68 65 0a 20 2a 09 09 09 09 with the. *....
f980: 6c 69 74 65 72 61 6c 20 63 68 61 72 61 63 74 65 literal characte
f990: 72 20 70 72 65 66 69 78 20 22 7b 2a 7d 22 2e 20 r prefix "{*}".
f9a0: 54 68 69 73 20 77 6f 72 64 20 69 73 0a 20 2a 09 This word is. *.
f9b0: 09 09 09 6d 61 72 6b 65 64 20 74 6f 20 62 65 20 ...marked to be
f9c0: 65 78 70 61 6e 64 65 64 20 2d 20 74 68 61 74 20 expanded - that
f9d0: 69 73 2c 20 62 72 6f 6b 65 6e 20 69 6e 74 6f 0a is, broken into.
f9e0: 20 2a 09 09 09 09 77 6f 72 64 73 20 61 66 74 65 *....words afte
f9f0: 72 20 73 75 62 73 74 69 74 75 74 69 6f 6e 20 69 r substitution i
fa00: 73 20 63 6f 6d 70 6c 65 74 65 2e 0a 20 2a 2f 0a s complete.. */.
fa10: 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 54 4f 4b .#define TCL_TOK
fa20: 45 4e 5f 57 4f 52 44 09 09 31 0a 23 64 65 66 69 EN_WORD..1.#defi
fa30: 6e 65 20 54 43 4c 5f 54 4f 4b 45 4e 5f 53 49 4d ne TCL_TOKEN_SIM
fa40: 50 4c 45 5f 57 4f 52 44 09 32 0a 23 64 65 66 69 PLE_WORD.2.#defi
fa50: 6e 65 20 54 43 4c 5f 54 4f 4b 45 4e 5f 54 45 58 ne TCL_TOKEN_TEX
fa60: 54 09 09 34 0a 23 64 65 66 69 6e 65 20 54 43 4c T..4.#define TCL
fa70: 5f 54 4f 4b 45 4e 5f 42 53 09 09 38 0a 23 64 65 _TOKEN_BS..8.#de
fa80: 66 69 6e 65 20 54 43 4c 5f 54 4f 4b 45 4e 5f 43 fine TCL_TOKEN_C
fa90: 4f 4d 4d 41 4e 44 09 31 36 0a 23 64 65 66 69 6e OMMAND.16.#defin
faa0: 65 20 54 43 4c 5f 54 4f 4b 45 4e 5f 56 41 52 49 e TCL_TOKEN_VARI
fab0: 41 42 4c 45 09 33 32 0a 23 64 65 66 69 6e 65 20 ABLE.32.#define
fac0: 54 43 4c 5f 54 4f 4b 45 4e 5f 53 55 42 5f 45 58 TCL_TOKEN_SUB_EX
fad0: 50 52 09 36 34 0a 23 64 65 66 69 6e 65 20 54 43 PR.64.#define TC
fae0: 4c 5f 54 4f 4b 45 4e 5f 4f 50 45 52 41 54 4f 52 L_TOKEN_OPERATOR
faf0: 09 31 32 38 0a 23 64 65 66 69 6e 65 20 54 43 4c .128.#define TCL
fb00: 5f 54 4f 4b 45 4e 5f 45 58 50 41 4e 44 5f 57 4f _TOKEN_EXPAND_WO
fb10: 52 44 09 32 35 36 0a 0a 2f 2a 0a 20 2a 20 50 61 RD.256../*. * Pa
fb20: 72 73 69 6e 67 20 65 72 72 6f 72 20 74 79 70 65 rsing error type
fb30: 73 2e 20 4f 6e 20 61 6e 79 20 70 61 72 73 69 6e s. On any parsin
fb40: 67 20 65 72 72 6f 72 2c 20 6f 6e 65 20 6f 66 20 g error, one of
fb50: 74 68 65 73 65 20 76 61 6c 75 65 73 20 77 69 6c these values wil
fb60: 6c 20 62 65 0a 20 2a 20 73 74 6f 72 65 64 20 69 l be. * stored i
fb70: 6e 20 74 68 65 20 65 72 72 6f 72 20 66 69 65 6c n the error fiel
fb80: 64 20 6f 66 20 74 68 65 20 54 63 6c 5f 50 61 72 d of the Tcl_Par
fb90: 73 65 20 73 74 72 75 63 74 75 72 65 20 64 65 66 se structure def
fba0: 69 6e 65 64 20 62 65 6c 6f 77 2e 0a 20 2a 2f 0a ined below.. */.
fbb0: 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 50 41 52 .#define TCL_PAR
fbc0: 53 45 5f 53 55 43 43 45 53 53 09 09 30 0a 23 64 SE_SUCCESS..0.#d
fbd0: 65 66 69 6e 65 20 54 43 4c 5f 50 41 52 53 45 5f efine TCL_PARSE_
fbe0: 51 55 4f 54 45 5f 45 58 54 52 41 09 09 31 0a 23 QUOTE_EXTRA..1.#
fbf0: 64 65 66 69 6e 65 20 54 43 4c 5f 50 41 52 53 45 define TCL_PARSE
fc00: 5f 42 52 41 43 45 5f 45 58 54 52 41 09 09 32 0a _BRACE_EXTRA..2.
fc10: 23 64 65 66 69 6e 65 20 54 43 4c 5f 50 41 52 53 #define TCL_PARS
fc20: 45 5f 4d 49 53 53 49 4e 47 5f 42 52 41 43 45 09 E_MISSING_BRACE.
fc30: 09 33 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 50 .3.#define TCL_P
fc40: 41 52 53 45 5f 4d 49 53 53 49 4e 47 5f 42 52 41 ARSE_MISSING_BRA
fc50: 43 4b 45 54 09 34 0a 23 64 65 66 69 6e 65 20 54 CKET.4.#define T
fc60: 43 4c 5f 50 41 52 53 45 5f 4d 49 53 53 49 4e 47 CL_PARSE_MISSING
fc70: 5f 50 41 52 45 4e 09 09 35 0a 23 64 65 66 69 6e _PAREN..5.#defin
fc80: 65 20 54 43 4c 5f 50 41 52 53 45 5f 4d 49 53 53 e TCL_PARSE_MISS
fc90: 49 4e 47 5f 51 55 4f 54 45 09 09 36 0a 23 64 65 ING_QUOTE..6.#de
fca0: 66 69 6e 65 20 54 43 4c 5f 50 41 52 53 45 5f 4d fine TCL_PARSE_M
fcb0: 49 53 53 49 4e 47 5f 56 41 52 5f 42 52 41 43 45 ISSING_VAR_BRACE
fcc0: 09 37 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 50 .7.#define TCL_P
fcd0: 41 52 53 45 5f 53 59 4e 54 41 58 09 09 38 0a 23 ARSE_SYNTAX..8.#
fce0: 64 65 66 69 6e 65 20 54 43 4c 5f 50 41 52 53 45 define TCL_PARSE
fcf0: 5f 42 41 44 5f 4e 55 4d 42 45 52 09 09 39 0a 0a _BAD_NUMBER..9..
fd00: 2f 2a 0a 20 2a 20 41 20 73 74 72 75 63 74 75 72 /*. * A structur
fd10: 65 20 6f 66 20 74 68 65 20 66 6f 6c 6c 6f 77 69 e of the followi
fd20: 6e 67 20 74 79 70 65 20 69 73 20 66 69 6c 6c 65 ng type is fille
fd30: 64 20 69 6e 20 62 79 20 54 63 6c 5f 50 61 72 73 d in by Tcl_Pars
fd40: 65 43 6f 6d 6d 61 6e 64 2e 20 49 74 0a 20 2a 20 eCommand. It. *
fd50: 64 65 73 63 72 69 62 65 73 20 61 20 73 69 6e 67 describes a sing
fd60: 6c 65 20 63 6f 6d 6d 61 6e 64 20 70 61 72 73 65 le command parse
fd70: 64 20 66 72 6f 6d 20 61 6e 20 69 6e 70 75 74 20 d from an input
fd80: 73 74 72 69 6e 67 2e 0a 20 2a 2f 0a 0a 23 64 65 string.. */..#de
fd90: 66 69 6e 65 20 4e 55 4d 5f 53 54 41 54 49 43 5f fine NUM_STATIC_
fda0: 54 4f 4b 45 4e 53 20 32 30 0a 0a 74 79 70 65 64 TOKENS 20..typed
fdb0: 65 66 20 73 74 72 75 63 74 20 54 63 6c 5f 50 61 ef struct Tcl_Pa
fdc0: 72 73 65 20 7b 0a 20 20 20 20 63 6f 6e 73 74 20 rse {. const
fdd0: 63 68 61 72 20 2a 63 6f 6d 6d 65 6e 74 53 74 61 char *commentSta
fde0: 72 74 3b 09 2f 2a 20 50 6f 69 6e 74 65 72 20 74 rt;./* Pointer t
fdf0: 6f 20 23 20 74 68 61 74 20 62 65 67 69 6e 73 20 o # that begins
fe00: 74 68 65 20 66 69 72 73 74 20 6f 66 20 6f 6e 65 the first of one
fe10: 0a 09 09 09 09 20 2a 20 6f 72 20 6d 6f 72 65 20 ..... * or more
fe20: 63 6f 6d 6d 65 6e 74 73 20 70 72 65 63 65 64 69 comments precedi
fe30: 6e 67 20 74 68 65 20 63 6f 6d 6d 61 6e 64 2e 20 ng the command.
fe40: 2a 2f 0a 20 20 20 20 73 69 7a 65 5f 74 20 63 6f */. size_t co
fe50: 6d 6d 65 6e 74 53 69 7a 65 3b 09 09 2f 2a 20 4e mmentSize;../* N
fe60: 75 6d 62 65 72 20 6f 66 20 62 79 74 65 73 20 69 umber of bytes i
fe70: 6e 20 63 6f 6d 6d 65 6e 74 73 20 28 75 70 20 74 n comments (up t
fe80: 68 72 6f 75 67 68 0a 09 09 09 09 20 2a 20 6e 65 hrough..... * ne
fe90: 77 6c 69 6e 65 20 63 68 61 72 61 63 74 65 72 20 wline character
fea0: 74 68 61 74 20 74 65 72 6d 69 6e 61 74 65 73 20 that terminates
feb0: 74 68 65 20 6c 61 73 74 0a 09 09 09 09 20 2a 20 the last..... *
fec0: 63 6f 6d 6d 65 6e 74 29 2e 20 49 66 20 74 68 65 comment). If the
fed0: 72 65 20 77 65 72 65 20 6e 6f 20 63 6f 6d 6d 65 re were no comme
fee0: 6e 74 73 2c 20 74 68 69 73 0a 09 09 09 09 20 2a nts, this..... *
fef0: 20 66 69 65 6c 64 20 69 73 20 30 2e 20 2a 2f 0a field is 0. */.
ff00: 20 20 20 20 63 6f 6e 73 74 20 63 68 61 72 20 2a const char *
ff10: 63 6f 6d 6d 61 6e 64 53 74 61 72 74 3b 09 2f 2a commandStart;./*
ff20: 20 46 69 72 73 74 20 63 68 61 72 61 63 74 65 72 First character
ff30: 20 69 6e 20 66 69 72 73 74 20 77 6f 72 64 20 6f in first word o
ff40: 66 0a 09 09 09 09 20 2a 20 63 6f 6d 6d 61 6e 64 f..... * command
ff50: 2e 20 2a 2f 0a 20 20 20 20 69 6e 74 20 63 6f 6d . */. int com
ff60: 6d 61 6e 64 53 69 7a 65 3b 09 09 2f 2a 20 4e 75 mandSize;../* Nu
ff70: 6d 62 65 72 20 6f 66 20 62 79 74 65 73 20 69 6e mber of bytes in
ff80: 20 63 6f 6d 6d 61 6e 64 2c 20 69 6e 63 6c 75 64 command, includ
ff90: 69 6e 67 20 66 69 72 73 74 0a 09 09 09 09 20 2a ing first..... *
ffa0: 20 63 68 61 72 61 63 74 65 72 20 6f 66 20 66 69 character of fi
ffb0: 72 73 74 20 77 6f 72 64 2c 20 75 70 20 74 68 72 rst word, up thr
ffc0: 6f 75 67 68 20 74 68 65 0a 09 09 09 09 20 2a 20 ough the..... *
ffd0: 74 65 72 6d 69 6e 61 74 69 6e 67 20 6e 65 77 6c terminating newl
ffe0: 69 6e 65 2c 20 63 6c 6f 73 65 20 62 72 61 63 6b ine, close brack
fff0: 65 74 2c 20 6f 72 0a 09 09 09 09 20 2a 20 73 65 et, or..... * se
10000 6d 69 63 6f 6c 6f 6e 2e 20 2a 2f 0a 20 20 20 20 micolon. */.
10010 69 6e 74 20 6e 75 6d 57 6f 72 64 73 3b 09 09 2f int numWords;../
10020 2a 20 54 6f 74 61 6c 20 6e 75 6d 62 65 72 20 6f * Total number o
10030 66 20 77 6f 72 64 73 20 69 6e 20 63 6f 6d 6d 61 f words in comma
10040 6e 64 2e 20 4d 61 79 20 62 65 0a 09 09 09 09 20 nd. May be.....
10050 2a 20 30 2e 20 2a 2f 0a 20 20 20 20 54 63 6c 5f * 0. */. Tcl_
10060 54 6f 6b 65 6e 20 2a 74 6f 6b 65 6e 50 74 72 3b Token *tokenPtr;
10070 09 2f 2a 20 50 6f 69 6e 74 65 72 20 74 6f 20 66 ./* Pointer to f
10080 69 72 73 74 20 74 6f 6b 65 6e 20 72 65 70 72 65 irst token repre
10090 73 65 6e 74 69 6e 67 20 74 68 65 0a 09 09 09 09 senting the.....
100a0 20 2a 20 77 6f 72 64 73 20 6f 66 20 74 68 65 20 * words of the
100b0 63 6f 6d 6d 61 6e 64 2e 20 49 6e 69 74 69 61 6c command. Initial
100c0 6c 79 20 70 6f 69 6e 74 73 20 74 6f 0a 09 09 09 ly points to....
100d0 09 20 2a 20 73 74 61 74 69 63 54 6f 6b 65 6e 73 . * staticTokens
100e0 2c 20 62 75 74 20 6d 61 79 20 63 68 61 6e 67 65 , but may change
100f0 20 74 6f 20 70 6f 69 6e 74 20 74 6f 0a 09 09 09 to point to....
10100 09 20 2a 20 6d 61 6c 6c 6f 63 2d 65 64 20 73 70 . * malloc-ed sp
10110 61 63 65 20 69 66 20 63 6f 6d 6d 61 6e 64 20 65 ace if command e
10120 78 63 65 65 64 73 20 73 70 61 63 65 20 69 6e 0a xceeds space in.
10130 09 09 09 09 20 2a 20 73 74 61 74 69 63 54 6f 6b .... * staticTok
10140 65 6e 73 2e 20 2a 2f 0a 20 20 20 20 69 6e 74 20 ens. */. int
10150 6e 75 6d 54 6f 6b 65 6e 73 3b 09 09 2f 2a 20 54 numTokens;../* T
10160 6f 74 61 6c 20 6e 75 6d 62 65 72 20 6f 66 20 74 otal number of t
10170 6f 6b 65 6e 73 20 69 6e 20 63 6f 6d 6d 61 6e 64 okens in command
10180 2e 20 2a 2f 0a 20 20 20 20 69 6e 74 20 74 6f 6b . */. int tok
10190 65 6e 73 41 76 61 69 6c 61 62 6c 65 3b 09 2f 2a ensAvailable;./*
101a0 20 54 6f 74 61 6c 20 6e 75 6d 62 65 72 20 6f 66 Total number of
101b0 20 74 6f 6b 65 6e 73 20 61 76 61 69 6c 61 62 6c tokens availabl
101c0 65 20 61 74 0a 09 09 09 09 20 2a 20 2a 74 6f 6b e at..... * *tok
101d0 65 6e 50 74 72 2e 20 2a 2f 0a 20 20 20 20 69 6e enPtr. */. in
101e0 74 20 65 72 72 6f 72 54 79 70 65 3b 09 09 2f 2a t errorType;../*
101f0 20 4f 6e 65 20 6f 66 20 74 68 65 20 70 61 72 73 One of the pars
10200 69 6e 67 20 65 72 72 6f 72 20 74 79 70 65 73 20 ing error types
10210 64 65 66 69 6e 65 64 0a 09 09 09 09 20 2a 20 61 defined..... * a
10220 62 6f 76 65 2e 20 2a 2f 0a 0a 20 20 20 20 2f 2a bove. */.. /*
10230 0a 20 20 20 20 20 2a 20 54 68 65 20 66 69 65 6c . * The fiel
10240 64 73 20 62 65 6c 6f 77 20 61 72 65 20 69 6e 74 ds below are int
10250 65 6e 64 65 64 20 6f 6e 6c 79 20 66 6f 72 20 74 ended only for t
10260 68 65 20 70 72 69 76 61 74 65 20 75 73 65 20 6f he private use o
10270 66 20 74 68 65 20 70 61 72 73 65 72 2e 0a 20 20 f the parser..
10280 20 20 20 2a 20 54 68 65 79 20 73 68 6f 75 6c 64 * They should
10290 20 6e 6f 74 20 62 65 20 75 73 65 64 20 62 79 20 not be used by
102a0 66 75 6e 63 74 69 6f 6e 73 20 74 68 61 74 20 69 functions that i
102b0 6e 76 6f 6b 65 20 54 63 6c 5f 50 61 72 73 65 43 nvoke Tcl_ParseC
102c0 6f 6d 6d 61 6e 64 2e 0a 20 20 20 20 20 2a 2f 0a ommand.. */.
102d0 0a 20 20 20 20 63 6f 6e 73 74 20 63 68 61 72 20 . const char
102e0 2a 73 74 72 69 6e 67 3b 09 09 2f 2a 20 54 68 65 *string;../* The
102f0 20 6f 72 69 67 69 6e 61 6c 20 63 6f 6d 6d 61 6e original comman
10300 64 20 73 74 72 69 6e 67 20 70 61 73 73 65 64 20 d string passed
10310 74 6f 0a 09 09 09 09 20 2a 20 54 63 6c 5f 50 61 to..... * Tcl_Pa
10320 72 73 65 43 6f 6d 6d 61 6e 64 2e 20 2a 2f 0a 20 rseCommand. */.
10330 20 20 20 63 6f 6e 73 74 20 63 68 61 72 20 2a 65 const char *e
10340 6e 64 3b 09 09 2f 2a 20 50 6f 69 6e 74 73 20 74 nd;../* Points t
10350 6f 20 74 68 65 20 63 68 61 72 61 63 74 65 72 20 o the character
10360 6a 75 73 74 20 61 66 74 65 72 20 74 68 65 20 6c just after the l
10370 61 73 74 0a 09 09 09 09 20 2a 20 6f 6e 65 20 69 ast..... * one i
10380 6e 20 74 68 65 20 63 6f 6d 6d 61 6e 64 20 73 74 n the command st
10390 72 69 6e 67 2e 20 2a 2f 0a 20 20 20 20 54 63 6c ring. */. Tcl
103a0 5f 49 6e 74 65 72 70 20 2a 69 6e 74 65 72 70 3b _Interp *interp;
103b0 09 09 2f 2a 20 49 6e 74 65 72 70 72 65 74 65 72 ../* Interpreter
103c0 20 74 6f 20 75 73 65 20 66 6f 72 20 65 72 72 6f to use for erro
103d0 72 20 72 65 70 6f 72 74 69 6e 67 2c 20 6f 72 0a r reporting, or.
103e0 09 09 09 09 20 2a 20 4e 55 4c 4c 2e 20 2a 2f 0a .... * NULL. */.
103f0 20 20 20 20 63 6f 6e 73 74 20 63 68 61 72 20 2a const char *
10400 74 65 72 6d 3b 09 09 2f 2a 20 50 6f 69 6e 74 73 term;../* Points
10410 20 74 6f 20 63 68 61 72 61 63 74 65 72 20 69 6e to character in
10420 20 73 74 72 69 6e 67 20 74 68 61 74 0a 09 09 09 string that....
10430 09 20 2a 20 74 65 72 6d 69 6e 61 74 65 64 20 6d . * terminated m
10440 6f 73 74 20 72 65 63 65 6e 74 20 74 6f 6b 65 6e ost recent token
10450 2e 20 46 69 6c 6c 65 64 20 69 6e 20 62 79 0a 09 . Filled in by..
10460 09 09 09 20 2a 20 50 61 72 73 65 54 6f 6b 65 6e ... * ParseToken
10470 73 2e 20 49 66 20 61 6e 20 65 72 72 6f 72 20 6f s. If an error o
10480 63 63 75 72 73 2c 20 70 6f 69 6e 74 73 20 74 6f ccurs, points to
10490 0a 09 09 09 09 20 2a 20 62 65 67 69 6e 6e 69 6e ..... * beginnin
104a0 67 20 6f 66 20 72 65 67 69 6f 6e 20 77 68 65 72 g of region wher
104b0 65 20 74 68 65 20 65 72 72 6f 72 0a 09 09 09 09 e the error.....
104c0 20 2a 20 6f 63 63 75 72 72 65 64 20 28 65 2e 67 * occurred (e.g
104d0 2e 20 74 68 65 20 6f 70 65 6e 20 62 72 61 63 65 . the open brace
104e0 20 69 66 20 74 68 65 20 63 6c 6f 73 65 0a 09 09 if the close...
104f0 09 09 20 2a 20 62 72 61 63 65 20 69 73 20 6d 69 .. * brace is mi
10500 73 73 69 6e 67 29 2e 20 2a 2f 0a 20 20 20 20 69 ssing). */. i
10510 6e 74 20 69 6e 63 6f 6d 70 6c 65 74 65 3b 09 09 nt incomplete;..
10520 2f 2a 20 54 68 69 73 20 66 69 65 6c 64 20 69 73 /* This field is
10530 20 73 65 74 20 74 6f 20 31 20 62 79 20 54 63 6c set to 1 by Tcl
10540 5f 50 61 72 73 65 43 6f 6d 6d 61 6e 64 0a 09 09 _ParseCommand...
10550 09 09 20 2a 20 69 66 20 74 68 65 20 63 6f 6d 6d .. * if the comm
10560 61 6e 64 20 61 70 70 65 61 72 73 20 74 6f 20 62 and appears to b
10570 65 20 69 6e 63 6f 6d 70 6c 65 74 65 2e 0a 09 09 e incomplete....
10580 09 09 20 2a 20 54 68 69 73 20 69 6e 66 6f 72 6d .. * This inform
10590 61 74 69 6f 6e 20 69 73 20 75 73 65 64 20 62 79 ation is used by
105a0 0a 09 09 09 09 20 2a 20 54 63 6c 5f 43 6f 6d 6d ..... * Tcl_Comm
105b0 61 6e 64 43 6f 6d 70 6c 65 74 65 2e 20 2a 2f 0a andComplete. */.
105c0 20 20 20 20 54 63 6c 5f 54 6f 6b 65 6e 20 73 74 Tcl_Token st
105d0 61 74 69 63 54 6f 6b 65 6e 73 5b 4e 55 4d 5f 53 aticTokens[NUM_S
105e0 54 41 54 49 43 5f 54 4f 4b 45 4e 53 5d 3b 0a 09 TATIC_TOKENS];..
105f0 09 09 09 2f 2a 20 49 6e 69 74 69 61 6c 20 73 70 .../* Initial sp
10600 61 63 65 20 66 6f 72 20 74 6f 6b 65 6e 73 20 66 ace for tokens f
10610 6f 72 20 63 6f 6d 6d 61 6e 64 2e 20 54 68 69 73 or command. This
10620 0a 09 09 09 09 20 2a 20 73 70 61 63 65 20 73 68 ..... * space sh
10630 6f 75 6c 64 20 62 65 20 6c 61 72 67 65 20 65 6e ould be large en
10640 6f 75 67 68 20 74 6f 20 61 63 63 6f 6d 6d 6f 64 ough to accommod
10650 61 74 65 0a 09 09 09 09 20 2a 20 6d 6f 73 74 20 ate..... * most
10660 63 6f 6d 6d 61 6e 64 73 3b 20 64 79 6e 61 6d 69 commands; dynami
10670 63 20 73 70 61 63 65 20 69 73 20 61 6c 6c 6f 63 c space is alloc
10680 61 74 65 64 0a 09 09 09 09 20 2a 20 66 6f 72 20 ated..... * for
10690 76 65 72 79 20 6c 61 72 67 65 20 63 6f 6d 6d 61 very large comma
106a0 6e 64 73 20 74 68 61 74 20 64 6f 6e 27 74 20 66 nds that don't f
106b0 69 74 0a 09 09 09 09 20 2a 20 68 65 72 65 2e 20 it..... * here.
106c0 2a 2f 0a 7d 20 54 63 6c 5f 50 61 72 73 65 3b 0a */.} Tcl_Parse;.
106d0 0c 0a 2f 2a 0a 20 2a 2d 2d 2d 2d 2d 2d 2d 2d 2d ../*. *---------
106e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
106f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
10700 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
10710 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
10720 2d 2d 2d 0a 20 2a 20 54 68 65 20 66 6f 6c 6c 6f ---. * The follo
10730 77 69 6e 67 20 73 74 72 75 63 74 75 72 65 20 72 wing structure r
10740 65 70 72 65 73 65 6e 74 73 20 61 20 75 73 65 72 epresents a user
10750 2d 64 65 66 69 6e 65 64 20 65 6e 63 6f 64 69 6e -defined encodin
10760 67 2e 20 49 74 20 63 6f 6c 6c 65 63 74 73 0a 20 g. It collects.
10770 2a 20 74 6f 67 65 74 68 65 72 20 61 6c 6c 20 74 * together all t
10780 68 65 20 66 75 6e 63 74 69 6f 6e 73 20 74 68 61 he functions tha
10790 74 20 61 72 65 20 75 73 65 64 20 62 79 20 74 68 t are used by th
107a0 65 20 73 70 65 63 69 66 69 63 20 65 6e 63 6f 64 e specific encod
107b0 69 6e 67 2e 0a 20 2a 2f 0a 0a 74 79 70 65 64 65 ing.. */..typede
107c0 66 20 73 74 72 75 63 74 20 54 63 6c 5f 45 6e 63 f struct Tcl_Enc
107d0 6f 64 69 6e 67 54 79 70 65 20 7b 0a 20 20 20 20 odingType {.
107e0 63 6f 6e 73 74 20 63 68 61 72 20 2a 65 6e 63 6f const char *enco
107f0 64 69 6e 67 4e 61 6d 65 3b 09 2f 2a 20 54 68 65 dingName;./* The
10800 20 6e 61 6d 65 20 6f 66 20 74 68 65 20 65 6e 63 name of the enc
10810 6f 64 69 6e 67 2c 20 65 2e 67 2e 20 22 65 75 63 oding, e.g. "euc
10820 2d 6a 70 22 2e 0a 09 09 09 09 20 2a 20 54 68 69 -jp"...... * Thi
10830 73 20 6e 61 6d 65 20 69 73 20 74 68 65 20 75 6e s name is the un
10840 69 71 75 65 20 6b 65 79 20 66 6f 72 20 74 68 69 ique key for thi
10850 73 0a 09 09 09 09 20 2a 20 65 6e 63 6f 64 69 6e s..... * encodin
10860 67 20 74 79 70 65 2e 20 2a 2f 0a 20 20 20 20 54 g type. */. T
10870 63 6c 5f 45 6e 63 6f 64 69 6e 67 43 6f 6e 76 65 cl_EncodingConve
10880 72 74 50 72 6f 63 20 2a 74 6f 55 74 66 50 72 6f rtProc *toUtfPro
10890 63 3b 0a 09 09 09 09 2f 2a 20 46 75 6e 63 74 69 c;...../* Functi
108a0 6f 6e 20 74 6f 20 63 6f 6e 76 65 72 74 20 66 72 on to convert fr
108b0 6f 6d 20 65 78 74 65 72 6e 61 6c 20 65 6e 63 6f om external enco
108c0 64 69 6e 67 0a 09 09 09 09 20 2a 20 69 6e 74 6f ding..... * into
108d0 20 55 54 46 2d 38 2e 20 2a 2f 0a 20 20 20 20 54 UTF-8. */. T
108e0 63 6c 5f 45 6e 63 6f 64 69 6e 67 43 6f 6e 76 65 cl_EncodingConve
108f0 72 74 50 72 6f 63 20 2a 66 72 6f 6d 55 74 66 50 rtProc *fromUtfP
10900 72 6f 63 3b 0a 09 09 09 09 2f 2a 20 46 75 6e 63 roc;...../* Func
10910 74 69 6f 6e 20 74 6f 20 63 6f 6e 76 65 72 74 20 tion to convert
10920 66 72 6f 6d 20 55 54 46 2d 38 20 69 6e 74 6f 0a from UTF-8 into.
10930 09 09 09 09 20 2a 20 65 78 74 65 72 6e 61 6c 20 .... * external
10940 65 6e 63 6f 64 69 6e 67 2e 20 2a 2f 0a 20 20 20 encoding. */.
10950 20 54 63 6c 5f 46 72 65 65 50 72 6f 63 20 2a 66 Tcl_FreeProc *f
10960 72 65 65 50 72 6f 63 3b 0a 09 09 09 09 2f 2a 20 reeProc;...../*
10970 49 66 20 6e 6f 6e 2d 4e 55 4c 4c 2c 20 66 75 6e If non-NULL, fun
10980 63 74 69 6f 6e 20 74 6f 20 63 61 6c 6c 20 77 68 ction to call wh
10990 65 6e 20 74 68 69 73 0a 09 09 09 09 20 2a 20 65 en this..... * e
109a0 6e 63 6f 64 69 6e 67 20 69 73 20 64 65 6c 65 74 ncoding is delet
109b0 65 64 2e 20 2a 2f 0a 20 20 20 20 76 6f 69 64 20 ed. */. void
109c0 2a 63 6c 69 65 6e 74 44 61 74 61 3b 09 2f 2a 20 *clientData;./*
109d0 41 72 62 69 74 72 61 72 79 20 76 61 6c 75 65 20 Arbitrary value
109e0 61 73 73 6f 63 69 61 74 65 64 20 77 69 74 68 20 associated with
109f0 65 6e 63 6f 64 69 6e 67 0a 09 09 09 09 20 2a 20 encoding..... *
10a00 74 79 70 65 2e 20 50 61 73 73 65 64 20 74 6f 20 type. Passed to
10a10 63 6f 6e 76 65 72 73 69 6f 6e 20 66 75 6e 63 74 conversion funct
10a20 69 6f 6e 73 2e 20 2a 2f 0a 20 20 20 20 69 6e 74 ions. */. int
10a30 20 6e 75 6c 6c 53 69 7a 65 3b 09 09 2f 2a 20 4e nullSize;../* N
10a40 75 6d 62 65 72 20 6f 66 20 7a 65 72 6f 20 62 79 umber of zero by
10a50 74 65 73 20 74 68 61 74 20 73 69 67 6e 69 66 79 tes that signify
10a60 0a 09 09 09 09 20 2a 20 65 6e 64 2d 6f 66 2d 73 ..... * end-of-s
10a70 74 72 69 6e 67 20 69 6e 20 74 68 69 73 20 65 6e tring in this en
10a80 63 6f 64 69 6e 67 2e 20 54 68 69 73 20 6e 75 6d coding. This num
10a90 62 65 72 0a 09 09 09 09 20 2a 20 69 73 20 75 73 ber..... * is us
10aa0 65 64 20 74 6f 20 64 65 74 65 72 6d 69 6e 65 20 ed to determine
10ab0 74 68 65 20 73 6f 75 72 63 65 20 73 74 72 69 6e the source strin
10ac0 67 0a 09 09 09 09 20 2a 20 6c 65 6e 67 74 68 20 g..... * length
10ad0 77 68 65 6e 20 74 68 65 20 73 72 63 4c 65 6e 20 when the srcLen
10ae0 61 72 67 75 6d 65 6e 74 20 69 73 0a 09 09 09 09 argument is.....
10af0 20 2a 20 6e 65 67 61 74 69 76 65 2e 20 4d 75 73 * negative. Mus
10b00 74 20 62 65 20 31 20 6f 72 20 32 2e 20 2a 2f 0a t be 1 or 2. */.
10b10 7d 20 54 63 6c 5f 45 6e 63 6f 64 69 6e 67 54 79 } Tcl_EncodingTy
10b20 70 65 3b 0a 0a 2f 2a 0a 20 2a 20 54 68 65 20 66 pe;../*. * The f
10b30 6f 6c 6c 6f 77 69 6e 67 20 64 65 66 69 6e 69 74 ollowing definit
10b40 69 6f 6e 73 20 61 72 65 20 75 73 65 64 20 61 73 ions are used as
10b50 20 76 61 6c 75 65 73 20 66 6f 72 20 74 68 65 20 values for the
10b60 63 6f 6e 76 65 72 73 69 6f 6e 20 63 6f 6e 74 72 conversion contr
10b70 6f 6c 0a 20 2a 20 66 6c 61 67 73 20 61 72 67 75 ol. * flags argu
10b80 6d 65 6e 74 20 77 68 65 6e 20 63 6f 6e 76 65 72 ment when conver
10b90 74 69 6e 67 20 74 65 78 74 20 66 72 6f 6d 20 6f ting text from o
10ba0 6e 65 20 63 68 61 72 61 63 74 65 72 20 73 65 74 ne character set
10bb0 20 74 6f 20 61 6e 6f 74 68 65 72 3a 0a 20 2a 0a to another:. *.
10bc0 20 2a 20 54 43 4c 5f 45 4e 43 4f 44 49 4e 47 5f * TCL_ENCODING_
10bd0 53 54 41 52 54 20 2d 09 09 53 69 67 6e 69 66 69 START -..Signifi
10be0 65 73 20 74 68 61 74 20 74 68 65 20 73 6f 75 72 es that the sour
10bf0 63 65 20 62 75 66 66 65 72 20 69 73 20 74 68 65 ce buffer is the
10c00 20 66 69 72 73 74 0a 20 2a 09 09 09 09 62 6c 6f first. *....blo
10c10 63 6b 20 69 6e 20 61 20 28 70 6f 74 65 6e 74 69 ck in a (potenti
10c20 61 6c 6c 79 20 6d 75 6c 74 69 2d 62 6c 6f 63 6b ally multi-block
10c30 29 20 69 6e 70 75 74 0a 20 2a 09 09 09 09 73 74 ) input. *....st
10c40 72 65 61 6d 2e 20 54 65 6c 6c 73 20 74 68 65 20 ream. Tells the
10c50 63 6f 6e 76 65 72 73 69 6f 6e 20 66 75 6e 63 74 conversion funct
10c60 69 6f 6e 20 74 6f 20 72 65 73 65 74 0a 20 2a 09 ion to reset. *.
10c70 09 09 09 74 6f 20 61 6e 20 69 6e 69 74 69 61 6c ...to an initial
10c80 20 73 74 61 74 65 20 61 6e 64 20 70 65 72 66 6f state and perfo
10c90 72 6d 20 61 6e 79 0a 20 2a 09 09 09 09 69 6e 69 rm any. *....ini
10ca0 74 69 61 6c 69 7a 61 74 69 6f 6e 20 74 68 61 74 tialization that
10cb0 20 6e 65 65 64 73 20 74 6f 20 6f 63 63 75 72 20 needs to occur
10cc0 62 65 66 6f 72 65 20 74 68 65 0a 20 2a 09 09 09 before the. *...
10cd0 09 66 69 72 73 74 20 62 79 74 65 20 69 73 20 63 .first byte is c
10ce0 6f 6e 76 65 72 74 65 64 2e 20 49 66 20 74 68 65 onverted. If the
10cf0 20 73 6f 75 72 63 65 20 62 75 66 66 65 72 0a 20 source buffer.
10d00 2a 09 09 09 09 63 6f 6e 74 61 69 6e 73 20 74 68 *....contains th
10d10 65 20 65 6e 74 69 72 65 20 69 6e 70 75 74 20 73 e entire input s
10d20 74 72 65 61 6d 20 74 6f 20 62 65 0a 20 2a 09 09 tream to be. *..
10d30 09 09 63 6f 6e 76 65 72 74 65 64 2c 20 74 68 69 ..converted, thi
10d40 73 20 66 6c 61 67 20 73 68 6f 75 6c 64 20 62 65 s flag should be
10d50 20 73 65 74 2e 0a 20 2a 20 54 43 4c 5f 45 4e 43 set.. * TCL_ENC
10d60 4f 44 49 4e 47 5f 45 4e 44 20 2d 09 09 53 69 67 ODING_END -..Sig
10d70 6e 69 66 69 65 73 20 74 68 61 74 20 74 68 65 20 nifies that the
10d80 73 6f 75 72 63 65 20 62 75 66 66 65 72 20 69 73 source buffer is
10d90 20 74 68 65 20 6c 61 73 74 0a 20 2a 09 09 09 09 the last. *....
10da0 62 6c 6f 63 6b 20 69 6e 20 61 20 28 70 6f 74 65 block in a (pote
10db0 6e 74 69 61 6c 6c 79 20 6d 75 6c 74 69 2d 62 6c ntially multi-bl
10dc0 6f 63 6b 29 20 69 6e 70 75 74 0a 20 2a 09 09 09 ock) input. *...
10dd0 09 73 74 72 65 61 6d 2e 20 54 65 6c 6c 73 20 74 .stream. Tells t
10de0 68 65 20 63 6f 6e 76 65 72 73 69 6f 6e 20 72 6f he conversion ro
10df0 75 74 69 6e 65 20 74 6f 0a 20 2a 09 09 09 09 70 utine to. *....p
10e00 65 72 66 6f 72 6d 20 61 6e 79 20 66 69 6e 61 6c erform any final
10e10 69 7a 61 74 69 6f 6e 20 74 68 61 74 20 6e 65 65 ization that nee
10e20 64 73 20 74 6f 20 6f 63 63 75 72 0a 20 2a 09 09 ds to occur. *..
10e30 09 09 61 66 74 65 72 20 74 68 65 20 6c 61 73 74 ..after the last
10e40 20 62 79 74 65 20 69 73 20 63 6f 6e 76 65 72 74 byte is convert
10e50 65 64 20 61 6e 64 20 74 68 65 6e 20 74 6f 0a 20 ed and then to.
10e60 2a 09 09 09 09 72 65 73 65 74 20 74 6f 20 61 6e *....reset to an
10e70 20 69 6e 69 74 69 61 6c 20 73 74 61 74 65 2e 20 initial state.
10e80 49 66 20 74 68 65 20 73 6f 75 72 63 65 0a 20 2a If the source. *
10e90 09 09 09 09 62 75 66 66 65 72 20 63 6f 6e 74 61 ....buffer conta
10ea0 69 6e 73 20 74 68 65 20 65 6e 74 69 72 65 20 69 ins the entire i
10eb0 6e 70 75 74 20 73 74 72 65 61 6d 20 74 6f 20 62 nput stream to b
10ec0 65 0a 20 2a 09 09 09 09 63 6f 6e 76 65 72 74 65 e. *....converte
10ed0 64 2c 20 74 68 69 73 20 66 6c 61 67 20 73 68 6f d, this flag sho
10ee0 75 6c 64 20 62 65 20 73 65 74 2e 0a 20 2a 20 54 uld be set.. * T
10ef0 43 4c 5f 45 4e 43 4f 44 49 4e 47 5f 53 54 4f 50 CL_ENCODING_STOP
10f00 4f 4e 45 52 52 4f 52 20 2d 09 49 66 20 73 65 74 ONERROR -.If set
10f10 2c 20 74 68 65 20 63 6f 6e 76 65 72 74 65 72 20 , the converter
10f20 72 65 74 75 72 6e 73 20 69 6d 6d 65 64 69 61 74 returns immediat
10f30 65 6c 79 20 75 70 6f 6e 0a 20 2a 09 09 09 09 65 ely upon. *....e
10f40 6e 63 6f 75 6e 74 65 72 69 6e 67 20 61 6e 20 69 ncountering an i
10f50 6e 76 61 6c 69 64 20 62 79 74 65 20 73 65 71 75 nvalid byte sequ
10f60 65 6e 63 65 20 6f 72 20 61 0a 20 2a 09 09 09 09 ence or a. *....
10f70 73 6f 75 72 63 65 20 63 68 61 72 61 63 74 65 72 source character
10f80 20 74 68 61 74 20 68 61 73 20 6e 6f 20 6d 61 70 that has no map
10f90 70 69 6e 67 20 69 6e 20 74 68 65 0a 20 2a 09 09 ping in the. *..
10fa0 09 09 74 61 72 67 65 74 20 65 6e 63 6f 64 69 6e ..target encodin
10fb0 67 2e 20 49 66 20 63 6c 65 61 72 2c 20 74 68 65 g. If clear, the
10fc0 20 63 6f 6e 76 65 72 74 65 72 0a 20 2a 09 09 09 converter. *...
10fd0 09 73 75 62 73 74 69 74 75 65 73 20 74 68 65 20 .substitues the
10fe0 70 72 6f 62 6c 65 6d 61 74 69 63 20 63 68 61 72 problematic char
10ff0 61 63 74 65 72 28 73 29 20 77 69 74 68 0a 20 2a acter(s) with. *
11000 09 09 09 09 6f 6e 65 20 6f 72 20 6d 6f 72 65 20 ....one or more
11010 22 63 6c 6f 73 65 22 20 63 68 61 72 61 63 74 65 "close" characte
11020 72 73 20 69 6e 20 74 68 65 0a 20 2a 09 09 09 09 rs in the. *....
11030 64 65 73 74 69 6e 61 74 69 6f 6e 20 62 75 66 66 destination buff
11040 65 72 20 61 6e 64 20 74 68 65 6e 20 63 6f 6e 74 er and then cont
11050 69 6e 75 65 73 20 74 6f 0a 20 2a 09 09 09 09 63 inues to. *....c
11060 6f 6e 76 65 72 74 20 74 68 65 20 73 6f 75 72 63 onvert the sourc
11070 65 2e 0a 20 2a 20 54 43 4c 5f 45 4e 43 4f 44 49 e.. * TCL_ENCODI
11080 4e 47 5f 4e 4f 5f 54 45 52 4d 49 4e 41 54 45 20 NG_NO_TERMINATE
11090 2d 20 09 49 66 20 73 65 74 2c 20 54 63 6c 5f 45 - .If set, Tcl_E
110a0 78 74 65 72 6e 61 6c 54 6f 55 74 66 20 64 6f 65 xternalToUtf doe
110b0 73 20 6e 6f 74 20 61 70 70 65 6e 64 20 61 0a 20 s not append a.
110c0 2a 09 09 09 09 74 65 72 6d 69 6e 61 74 69 6e 67 *....terminating
110d0 20 4e 55 4c 20 62 79 74 65 2e 20 20 53 69 6e 63 NUL byte. Sinc
110e0 65 20 69 74 20 64 6f 65 73 20 6e 6f 74 20 6e 65 e it does not ne
110f0 65 64 0a 20 2a 09 09 09 09 61 6e 20 65 78 74 72 ed. *....an extr
11100 61 20 62 79 74 65 20 66 6f 72 20 61 20 74 65 72 a byte for a ter
11110 6d 69 6e 61 74 69 6e 67 20 4e 55 4c 2c 20 69 74 minating NUL, it
11120 20 66 69 6c 6c 73 0a 20 2a 09 09 09 09 61 6c 6c fills. *....all
11130 20 64 73 74 4c 65 6e 20 62 79 74 65 73 20 77 69 dstLen bytes wi
11140 74 68 20 65 6e 63 6f 64 65 64 20 55 54 46 2d 38 th encoded UTF-8
11150 20 63 6f 6e 74 65 6e 74 20 69 66 0a 20 2a 09 09 content if. *..
11160 09 09 6e 65 65 64 65 64 2e 20 20 49 66 20 63 6c ..needed. If cl
11170 65 61 72 2c 20 61 20 62 79 74 65 20 69 73 20 72 ear, a byte is r
11180 65 73 65 72 76 65 64 20 69 6e 20 74 68 65 0a 20 eserved in the.
11190 2a 09 09 09 09 64 73 74 20 73 70 61 63 65 20 66 *....dst space f
111a0 6f 72 20 4e 55 4c 20 74 65 72 6d 69 6e 61 74 69 or NUL terminati
111b0 6f 6e 2c 20 61 6e 64 20 61 0a 20 2a 09 09 09 09 on, and a. *....
111c0 74 65 72 6d 69 6e 61 74 69 6e 67 20 4e 55 4c 20 terminating NUL
111d0 69 73 20 61 70 70 65 6e 64 65 64 2e 0a 20 2a 20 is appended.. *
111e0 54 43 4c 5f 45 4e 43 4f 44 49 4e 47 5f 43 48 41 TCL_ENCODING_CHA
111f0 52 5f 4c 49 4d 49 54 20 2d 09 49 66 20 73 65 74 R_LIMIT -.If set
11200 20 61 6e 64 20 64 73 74 43 68 61 72 73 50 74 72 and dstCharsPtr
11210 20 69 73 20 6e 6f 74 20 4e 55 4c 4c 2c 20 74 68 is not NULL, th
11220 65 6e 0a 20 2a 09 09 09 09 54 63 6c 5f 45 78 74 en. *....Tcl_Ext
11230 65 72 6e 61 6c 54 6f 55 74 66 20 74 61 6b 65 73 ernalToUtf takes
11240 20 74 68 65 20 69 6e 69 74 69 61 6c 20 76 61 6c the initial val
11250 75 65 20 6f 66 0a 20 2a 09 09 09 09 2a 64 73 74 ue of. *....*dst
11260 43 68 61 72 73 50 74 72 20 61 73 20 61 20 6c 69 CharsPtr as a li
11270 6d 69 74 20 6f 66 20 74 68 65 20 6d 61 78 69 6d mit of the maxim
11280 75 6d 20 6e 75 6d 62 65 72 0a 20 2a 09 09 09 09 um number. *....
11290 6f 66 20 63 68 61 72 73 20 74 6f 20 70 72 6f 64 of chars to prod
112a0 75 63 65 20 69 6e 20 74 68 65 20 65 6e 63 6f 64 uce in the encod
112b0 65 64 20 55 54 46 2d 38 0a 20 2a 09 09 09 09 63 ed UTF-8. *....c
112c0 6f 6e 74 65 6e 74 2e 20 20 4f 74 68 65 72 77 69 ontent. Otherwi
112d0 73 65 2c 20 74 68 65 20 6e 75 6d 62 65 72 20 6f se, the number o
112e0 66 20 63 68 61 72 73 0a 20 2a 09 09 09 09 70 72 f chars. *....pr
112f0 6f 64 75 63 65 64 20 69 73 20 63 6f 6e 74 72 6f oduced is contro
11300 6c 6c 65 64 20 6f 6e 6c 79 20 62 79 20 6f 74 68 lled only by oth
11310 65 72 20 6c 69 6d 69 74 69 6e 67 0a 20 2a 09 09 er limiting. *..
11320 09 09 66 61 63 74 6f 72 73 2e 0a 20 2a 2f 0a 0a ..factors.. */..
11330 23 64 65 66 69 6e 65 20 54 43 4c 5f 45 4e 43 4f #define TCL_ENCO
11340 44 49 4e 47 5f 53 54 41 52 54 09 09 30 78 30 31 DING_START..0x01
11350 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 45 4e 43 .#define TCL_ENC
11360 4f 44 49 4e 47 5f 45 4e 44 09 09 30 78 30 32 0a ODING_END..0x02.
11370 23 64 65 66 69 6e 65 20 54 43 4c 5f 45 4e 43 4f #define TCL_ENCO
11380 44 49 4e 47 5f 53 54 4f 50 4f 4e 45 52 52 4f 52 DING_STOPONERROR
11390 09 30 78 30 34 0a 23 64 65 66 69 6e 65 20 54 43 .0x04.#define TC
113a0 4c 5f 45 4e 43 4f 44 49 4e 47 5f 4e 4f 5f 54 45 L_ENCODING_NO_TE
113b0 52 4d 49 4e 41 54 45 09 30 78 30 38 0a 23 64 65 RMINATE.0x08.#de
113c0 66 69 6e 65 20 54 43 4c 5f 45 4e 43 4f 44 49 4e fine TCL_ENCODIN
113d0 47 5f 43 48 41 52 5f 4c 49 4d 49 54 09 09 30 78 G_CHAR_LIMIT..0x
113e0 31 30 0a 0a 2f 2a 0a 20 2a 20 54 68 65 20 66 6f 10../*. * The fo
113f0 6c 6c 6f 77 69 6e 67 20 64 65 66 69 6e 69 74 69 llowing definiti
11400 6f 6e 73 20 61 72 65 20 74 68 65 20 65 72 72 6f ons are the erro
11410 72 20 63 6f 64 65 73 20 72 65 74 75 72 6e 65 64 r codes returned
11420 20 62 79 20 74 68 65 20 63 6f 6e 76 65 72 73 69 by the conversi
11430 6f 6e 0a 20 2a 20 72 6f 75 74 69 6e 65 73 3a 0a on. * routines:.
11440 20 2a 0a 20 2a 20 54 43 4c 5f 4f 4b 20 2d 09 09 *. * TCL_OK -..
11450 09 41 6c 6c 20 63 68 61 72 61 63 74 65 72 73 20 .All characters
11460 77 65 72 65 20 63 6f 6e 76 65 72 74 65 64 2e 0a were converted..
11470 20 2a 20 54 43 4c 5f 43 4f 4e 56 45 52 54 5f 4e * TCL_CONVERT_N
11480 4f 53 50 41 43 45 20 2d 09 54 68 65 20 6f 75 74 OSPACE -.The out
11490 70 75 74 20 62 75 66 66 65 72 20 77 6f 75 6c 64 put buffer would
114a0 20 6e 6f 74 20 68 61 76 65 20 62 65 65 6e 20 6c not have been l
114b0 61 72 67 65 0a 20 2a 09 09 09 09 65 6e 6f 75 67 arge. *....enoug
114c0 68 20 66 6f 72 20 61 6c 6c 20 6f 66 20 74 68 65 h for all of the
114d0 20 63 6f 6e 76 65 72 74 65 64 20 64 61 74 61 3b converted data;
114e0 20 61 73 20 6d 61 6e 79 0a 20 2a 09 09 09 09 63 as many. *....c
114f0 68 61 72 61 63 74 65 72 73 20 61 73 20 63 6f 75 haracters as cou
11500 6c 64 20 66 69 74 20 77 65 72 65 20 63 6f 6e 76 ld fit were conv
11510 65 72 74 65 64 20 74 68 6f 75 67 68 2e 0a 20 2a erted though.. *
11520 20 54 43 4c 5f 43 4f 4e 56 45 52 54 5f 4d 55 4c TCL_CONVERT_MUL
11530 54 49 42 59 54 45 20 2d 09 54 68 65 20 6c 61 73 TIBYTE -.The las
11540 74 20 66 65 77 20 62 79 74 65 73 20 69 6e 20 74 t few bytes in t
11550 68 65 20 73 6f 75 72 63 65 20 73 74 72 69 6e 67 he source string
11560 20 77 65 72 65 0a 20 2a 09 09 09 09 74 68 65 20 were. *....the
11570 62 65 67 69 6e 6e 69 6e 67 20 6f 66 20 61 20 6d beginning of a m
11580 75 6c 74 69 62 79 74 65 20 73 65 71 75 65 6e 63 ultibyte sequenc
11590 65 2c 20 62 75 74 0a 20 2a 09 09 09 09 6d 6f 72 e, but. *....mor
115a0 65 20 62 79 74 65 73 20 77 65 72 65 20 6e 65 65 e bytes were nee
115b0 64 65 64 20 74 6f 20 63 6f 6d 70 6c 65 74 65 20 ded to complete
115c0 74 68 69 73 0a 20 2a 09 09 09 09 73 65 71 75 65 this. *....seque
115d0 6e 63 65 2e 20 41 20 73 75 62 73 65 71 75 65 6e nce. A subsequen
115e0 74 20 63 61 6c 6c 20 74 6f 20 74 68 65 20 63 6f t call to the co
115f0 6e 76 65 72 73 69 6f 6e 0a 20 2a 09 09 09 09 72 nversion. *....r
11600 6f 75 74 69 6e 65 20 73 68 6f 75 6c 64 20 70 61 outine should pa
11610 73 73 20 74 68 65 20 62 65 67 69 6e 6e 69 6e 67 ss the beginning
11620 20 6f 66 20 74 68 69 73 0a 20 2a 09 09 09 09 75 of this. *....u
11630 6e 63 6f 6e 76 65 72 74 65 64 20 73 65 71 75 65 nconverted seque
11640 6e 63 65 20 70 6c 75 73 20 61 64 64 69 74 69 6f nce plus additio
11650 6e 61 6c 20 62 79 74 65 73 0a 20 2a 09 09 09 09 nal bytes. *....
11660 66 72 6f 6d 20 74 68 65 20 73 6f 75 72 63 65 20 from the source
11670 73 74 72 65 61 6d 20 74 6f 20 70 72 6f 70 65 72 stream to proper
11680 6c 79 20 63 6f 6e 76 65 72 74 20 74 68 65 0a 20 ly convert the.
11690 2a 09 09 09 09 66 6f 72 6d 65 72 6c 79 20 73 70 *....formerly sp
116a0 6c 69 74 2d 75 70 20 6d 75 6c 74 69 62 79 74 65 lit-up multibyte
116b0 20 73 65 71 75 65 6e 63 65 2e 0a 20 2a 20 54 43 sequence.. * TC
116c0 4c 5f 43 4f 4e 56 45 52 54 5f 53 59 4e 54 41 58 L_CONVERT_SYNTAX
116d0 20 2d 09 09 54 68 65 20 73 6f 75 72 63 65 20 73 -..The source s
116e0 74 72 65 61 6d 20 63 6f 6e 74 61 69 6e 65 64 20 tream contained
116f0 61 6e 20 69 6e 76 61 6c 69 64 0a 20 2a 09 09 09 an invalid. *...
11700 09 63 68 61 72 61 63 74 65 72 20 73 65 71 75 65 .character seque
11710 6e 63 65 2e 20 54 68 69 73 20 6d 61 79 20 6f 63 nce. This may oc
11720 63 75 72 20 69 66 20 74 68 65 0a 20 2a 09 09 09 cur if the. *...
11730 09 69 6e 70 75 74 20 73 74 72 65 61 6d 20 68 61 .input stream ha
11740 73 20 62 65 65 6e 20 64 61 6d 61 67 65 64 20 6f s been damaged o
11750 72 20 69 66 20 74 68 65 20 69 6e 70 75 74 0a 20 r if the input.
11760 2a 09 09 09 09 65 6e 63 6f 64 69 6e 67 20 6d 65 *....encoding me
11770 74 68 6f 64 20 77 61 73 20 6d 69 73 69 64 65 6e thod was misiden
11780 74 69 66 69 65 64 2e 20 54 68 69 73 20 65 72 72 tified. This err
11790 6f 72 0a 20 2a 09 09 09 09 69 73 20 72 65 70 6f or. *....is repo
117a0 72 74 65 64 20 6f 6e 6c 79 20 69 66 20 54 43 4c rted only if TCL
117b0 5f 45 4e 43 4f 44 49 4e 47 5f 53 54 4f 50 4f 4e _ENCODING_STOPON
117c0 45 52 52 4f 52 0a 20 2a 09 09 09 09 77 61 73 20 ERROR. *....was
117d0 73 70 65 63 69 66 69 65 64 2e 0a 20 2a 20 54 43 specified.. * TC
117e0 4c 5f 43 4f 4e 56 45 52 54 5f 55 4e 4b 4e 4f 57 L_CONVERT_UNKNOW
117f0 4e 20 2d 09 54 68 65 20 73 6f 75 72 63 65 20 73 N -.The source s
11800 74 72 69 6e 67 20 63 6f 6e 74 61 69 6e 65 64 20 tring contained
11810 61 20 63 68 61 72 61 63 74 65 72 20 74 68 61 74 a character that
11820 0a 20 2a 09 09 09 09 63 6f 75 6c 64 20 6e 6f 74 . *....could not
11830 20 62 65 20 72 65 70 72 65 73 65 6e 74 65 64 20 be represented
11840 69 6e 20 74 68 65 20 74 61 72 67 65 74 0a 20 2a in the target. *
11850 09 09 09 09 65 6e 63 6f 64 69 6e 67 2e 20 54 68 ....encoding. Th
11860 69 73 20 65 72 72 6f 72 20 69 73 20 72 65 70 6f is error is repo
11870 72 74 65 64 20 6f 6e 6c 79 20 69 66 0a 20 2a 09 rted only if. *.
11880 09 09 09 54 43 4c 5f 45 4e 43 4f 44 49 4e 47 5f ...TCL_ENCODING_
11890 53 54 4f 50 4f 4e 45 52 52 4f 52 20 77 61 73 20 STOPONERROR was
118a0 73 70 65 63 69 66 69 65 64 2e 0a 20 2a 2f 0a 0a specified.. */..
118b0 23 64 65 66 69 6e 65 20 54 43 4c 5f 43 4f 4e 56 #define TCL_CONV
118c0 45 52 54 5f 4d 55 4c 54 49 42 59 54 45 09 28 2d ERT_MULTIBYTE.(-
118d0 31 29 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 43 1).#define TCL_C
118e0 4f 4e 56 45 52 54 5f 53 59 4e 54 41 58 09 28 2d ONVERT_SYNTAX.(-
118f0 32 29 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 43 2).#define TCL_C
11900 4f 4e 56 45 52 54 5f 55 4e 4b 4e 4f 57 4e 09 28 ONVERT_UNKNOWN.(
11910 2d 33 29 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f -3).#define TCL_
11920 43 4f 4e 56 45 52 54 5f 4e 4f 53 50 41 43 45 09 CONVERT_NOSPACE.
11930 28 2d 34 29 0a 0a 2f 2a 0a 20 2a 20 54 68 65 20 (-4)../*. * The
11940 6d 61 78 69 6d 75 6d 20 6e 75 6d 62 65 72 20 6f maximum number o
11950 66 20 62 79 74 65 73 20 74 68 61 74 20 61 72 65 f bytes that are
11960 20 6e 65 63 65 73 73 61 72 79 20 74 6f 20 72 65 necessary to re
11970 70 72 65 73 65 6e 74 20 61 20 73 69 6e 67 6c 65 present a single
11980 0a 20 2a 20 55 6e 69 63 6f 64 65 20 63 68 61 72 . * Unicode char
11990 61 63 74 65 72 20 69 6e 20 55 54 46 2d 38 2e 20 acter in UTF-8.
119a0 54 68 65 20 76 61 6c 69 64 20 76 61 6c 75 65 73 The valid values
119b0 20 61 72 65 20 34 20 61 6e 64 20 36 0a 20 2a 20 are 4 and 6. *
119c0 28 6f 72 20 70 65 72 68 61 70 73 20 31 20 69 66 (or perhaps 1 if
119d0 20 77 65 20 77 61 6e 74 20 74 6f 20 73 75 70 70 we want to supp
119e0 6f 72 74 20 61 20 6e 6f 6e 2d 75 6e 69 63 6f 64 ort a non-unicod
119f0 65 20 65 6e 61 62 6c 65 64 20 63 6f 72 65 29 2e e enabled core).
11a00 20 49 66 20 34 2c 0a 20 2a 20 74 68 65 6e 20 54 If 4,. * then T
11a10 63 6c 5f 55 6e 69 43 68 61 72 20 6d 75 73 74 20 cl_UniChar must
11a20 62 65 20 32 2d 62 79 74 65 73 20 69 6e 20 73 69 be 2-bytes in si
11a30 7a 65 20 28 55 43 53 2d 32 29 20 28 74 68 65 20 ze (UCS-2) (the
11a40 64 65 66 61 75 6c 74 29 2e 20 49 66 20 36 2c 0a default). If 6,.
11a50 20 2a 20 74 68 65 6e 20 54 63 6c 5f 55 6e 69 43 * then Tcl_UniC
11a60 68 61 72 20 6d 75 73 74 20 62 65 20 34 2d 62 79 har must be 4-by
11a70 74 65 73 20 69 6e 20 73 69 7a 65 20 28 55 43 53 tes in size (UCS
11a80 2d 34 29 2e 20 41 74 20 74 68 69 73 20 74 69 6d -4). At this tim
11a90 65 20 55 43 53 2d 32 20 6d 6f 64 65 0a 20 2a 20 e UCS-2 mode. *
11aa0 69 73 20 74 68 65 20 64 65 66 61 75 6c 74 20 61 is the default a
11ab0 6e 64 20 72 65 63 6f 6d 6d 65 6e 64 65 64 20 6d nd recommended m
11ac0 6f 64 65 2e 20 55 43 53 2d 34 20 69 73 20 65 78 ode. UCS-4 is ex
11ad0 70 65 72 69 6d 65 6e 74 61 6c 20 61 6e 64 20 6e perimental and n
11ae0 6f 74 0a 20 2a 20 72 65 63 6f 6d 6d 65 6e 64 65 ot. * recommende
11af0 64 2e 20 49 74 20 77 6f 72 6b 73 20 66 6f 72 20 d. It works for
11b00 74 68 65 20 63 6f 72 65 2c 20 62 75 74 20 6d 6f the core, but mo
11b10 73 74 20 65 78 74 65 6e 73 69 6f 6e 73 20 65 78 st extensions ex
11b20 70 65 63 74 20 55 43 53 2d 32 2e 0a 20 2a 2f 0a pect UCS-2.. */.
11b30 0a 23 69 66 6e 64 65 66 20 54 43 4c 5f 55 54 46 .#ifndef TCL_UTF
11b40 5f 4d 41 58 0a 23 64 65 66 69 6e 65 20 54 43 4c _MAX.#define TCL
11b50 5f 55 54 46 5f 4d 41 58 09 09 34 0a 23 65 6e 64 _UTF_MAX..4.#end
11b60 69 66 0a 0a 2f 2a 0a 20 2a 20 54 68 69 73 20 72 if../*. * This r
11b70 65 70 72 65 73 65 6e 74 73 20 61 20 55 6e 69 63 epresents a Unic
11b80 6f 64 65 20 63 68 61 72 61 63 74 65 72 2e 20 41 ode character. A
11b90 6e 79 20 63 68 61 6e 67 65 73 20 74 6f 20 74 68 ny changes to th
11ba0 69 73 20 73 68 6f 75 6c 64 20 61 6c 73 6f 20 62 is should also b
11bb0 65 0a 20 2a 20 72 65 66 6c 65 63 74 65 64 20 69 e. * reflected i
11bc0 6e 20 72 65 67 63 75 73 74 6f 6d 2e 68 2e 0a 20 n regcustom.h..
11bd0 2a 2f 0a 0a 23 69 66 20 54 43 4c 5f 55 54 46 5f */..#if TCL_UTF_
11be0 4d 41 58 20 3e 20 34 0a 20 20 20 20 2f 2a 0a 20 MAX > 4. /*.
11bf0 20 20 20 20 2a 20 69 6e 74 20 69 73 6e 27 74 20 * int isn't
11c00 31 30 30 25 20 61 63 63 75 72 61 74 65 20 61 73 100% accurate as
11c10 20 69 74 20 73 68 6f 75 6c 64 20 62 65 20 61 20 it should be a
11c20 73 74 72 69 63 74 20 34 2d 62 79 74 65 20 76 61 strict 4-byte va
11c30 6c 75 65 0a 20 20 20 20 20 2a 20 28 70 65 72 68 lue. * (perh
11c40 61 70 73 20 77 63 68 61 72 5f 74 29 2e 20 36 34 aps wchar_t). 64
11c50 2d 62 69 74 20 73 79 73 74 65 6d 73 20 6d 61 79 -bit systems may
11c60 20 68 61 76 65 20 74 72 6f 75 62 6c 65 73 2e 20 have troubles.
11c70 54 68 65 20 73 69 7a 65 20 6f 66 20 74 68 69 73 The size of this
11c80 0a 20 20 20 20 20 2a 20 76 61 6c 75 65 20 6d 75 . * value mu
11c90 73 74 20 62 65 20 72 65 66 6c 65 63 74 65 64 20 st be reflected
11ca0 63 6f 72 72 65 63 74 6c 79 20 69 6e 20 72 65 67 correctly in reg
11cb0 63 75 73 74 6f 6d 2e 68 20 61 6e 64 0a 20 20 20 custom.h and.
11cc0 20 20 2a 20 69 6e 20 74 63 6c 45 6e 63 6f 64 69 * in tclEncodi
11cd0 6e 67 2e 63 2e 0a 20 20 20 20 20 2a 20 58 58 58 ng.c.. * XXX
11ce0 3a 20 54 63 6c 20 69 73 20 63 75 72 72 65 6e 74 : Tcl is current
11cf0 6c 79 20 55 43 53 2d 32 20 61 6e 64 20 70 6c 61 ly UCS-2 and pla
11d00 6e 6e 69 6e 67 20 55 54 46 2d 31 36 20 66 6f 72 nning UTF-16 for
11d10 20 74 68 65 20 55 6e 69 63 6f 64 65 0a 20 20 20 the Unicode.
11d20 20 20 2a 20 58 58 58 3a 20 73 74 72 69 6e 67 20 * XXX: string
11d30 72 65 70 20 74 68 61 74 20 54 63 6c 5f 55 6e 69 rep that Tcl_Uni
11d40 43 68 61 72 20 72 65 70 72 65 73 65 6e 74 73 2e Char represents.
11d50 20 20 43 68 61 6e 67 69 6e 67 20 74 68 65 20 73 Changing the s
11d60 69 7a 65 0a 20 20 20 20 20 2a 20 58 58 58 3a 20 ize. * XXX:
11d70 6f 66 20 54 63 6c 5f 55 6e 69 43 68 61 72 20 69 of Tcl_UniChar i
11d80 73 20 2f 6e 6f 74 2f 20 73 75 70 70 6f 72 74 65 s /not/ supporte
11d90 64 2e 0a 20 20 20 20 20 2a 2f 0a 74 79 70 65 64 d.. */.typed
11da0 65 66 20 69 6e 74 20 54 63 6c 5f 55 6e 69 43 68 ef int Tcl_UniCh
11db0 61 72 3b 0a 23 65 6c 73 65 0a 74 79 70 65 64 65 ar;.#else.typede
11dc0 66 20 75 6e 73 69 67 6e 65 64 20 73 68 6f 72 74 f unsigned short
11dd0 20 54 63 6c 5f 55 6e 69 43 68 61 72 3b 0a 23 65 Tcl_UniChar;.#e
11de0 6e 64 69 66 0a 0c 0a 2f 2a 0a 20 2a 2d 2d 2d 2d ndif.../*. *----
11df0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
11e00 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
11e10 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
11e20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
11e30 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 2a 20 54 49 50 20 --------. * TIP
11e40 23 35 39 3a 20 54 68 65 20 66 6f 6c 6c 6f 77 69 #59: The followi
11e50 6e 67 20 73 74 72 75 63 74 75 72 65 20 69 73 20 ng structure is
11e60 75 73 65 64 20 69 6e 20 63 61 6c 6c 73 20 27 54 used in calls 'T
11e70 63 6c 5f 52 65 67 69 73 74 65 72 43 6f 6e 66 69 cl_RegisterConfi
11e80 67 27 20 74 6f 0a 20 2a 20 70 72 6f 76 69 64 65 g' to. * provide
11e90 20 74 68 65 20 73 79 73 74 65 6d 20 77 69 74 68 the system with
11ea0 20 74 68 65 20 65 6d 62 65 64 64 65 64 20 63 6f the embedded co
11eb0 6e 66 69 67 75 72 61 74 69 6f 6e 20 64 61 74 61 nfiguration data
11ec0 2e 0a 20 2a 2f 0a 0a 74 79 70 65 64 65 66 20 73 .. */..typedef s
11ed0 74 72 75 63 74 20 54 63 6c 5f 43 6f 6e 66 69 67 truct Tcl_Config
11ee0 20 7b 0a 20 20 20 20 63 6f 6e 73 74 20 63 68 61 {. const cha
11ef0 72 20 2a 6b 65 79 3b 09 09 2f 2a 20 43 6f 6e 66 r *key;../* Conf
11f00 69 67 75 72 61 74 69 6f 6e 20 6b 65 79 20 74 6f iguration key to
11f10 20 72 65 67 69 73 74 65 72 2e 20 41 53 43 49 49 register. ASCII
11f20 0a 09 09 09 09 20 2a 20 65 6e 63 6f 64 65 64 2c ..... * encoded,
11f30 20 74 68 75 73 20 55 54 46 2d 38 2e 20 2a 2f 0a thus UTF-8. */.
11f40 20 20 20 20 63 6f 6e 73 74 20 63 68 61 72 20 2a const char *
11f50 76 61 6c 75 65 3b 09 09 2f 2a 20 54 68 65 20 76 value;../* The v
11f60 61 6c 75 65 20 61 73 73 6f 63 69 61 74 65 64 20 alue associated
11f70 77 69 74 68 20 74 68 65 20 6b 65 79 2e 20 53 79 with the key. Sy
11f80 73 74 65 6d 0a 09 09 09 09 20 2a 20 65 6e 63 6f stem..... * enco
11f90 64 69 6e 67 2e 20 2a 2f 0a 7d 20 54 63 6c 5f 43 ding. */.} Tcl_C
11fa0 6f 6e 66 69 67 3b 0a 0a 2f 2a 0a 20 2a 2d 2d 2d onfig;../*. *---
11fb0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
11fc0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
11fd0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
11fe0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
11ff0 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 2a 20 46 6c 61 ---------. * Fla
12000 67 73 20 66 6f 72 20 54 49 50 23 31 34 33 20 6c gs for TIP#143 l
12010 69 6d 69 74 73 2c 20 64 65 74 61 69 6c 69 6e 67 imits, detailing
12020 20 77 68 69 63 68 20 6c 69 6d 69 74 73 20 61 72 which limits ar
12030 65 20 61 63 74 69 76 65 20 69 6e 20 61 6e 0a 20 e active in an.
12040 2a 20 69 6e 74 65 72 70 72 65 74 65 72 2e 20 55 * interpreter. U
12050 73 65 64 20 66 6f 72 20 54 63 6c 5f 7b 41 64 64 sed for Tcl_{Add
12060 2c 52 65 6d 6f 76 65 7d 4c 69 6d 69 74 48 61 6e ,Remove}LimitHan
12070 64 6c 65 72 20 74 79 70 65 20 61 72 67 75 6d 65 dler type argume
12080 6e 74 2e 0a 20 2a 2f 0a 0a 23 64 65 66 69 6e 65 nt.. */..#define
12090 20 54 43 4c 5f 4c 49 4d 49 54 5f 43 4f 4d 4d 41 TCL_LIMIT_COMMA
120a0 4e 44 53 09 30 78 30 31 0a 23 64 65 66 69 6e 65 NDS.0x01.#define
120b0 20 54 43 4c 5f 4c 49 4d 49 54 5f 54 49 4d 45 09 TCL_LIMIT_TIME.
120c0 09 30 78 30 32 0a 0a 2f 2a 0a 20 2a 20 53 74 72 .0x02../*. * Str
120d0 75 63 74 75 72 65 20 63 6f 6e 74 61 69 6e 69 6e ucture containin
120e0 67 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 61 62 g information ab
120f0 6f 75 74 20 61 20 6c 69 6d 69 74 20 68 61 6e 64 out a limit hand
12100 6c 65 72 20 74 6f 20 62 65 20 63 61 6c 6c 65 64 ler to be called
12110 20 77 68 65 6e 20 61 0a 20 2a 20 63 6f 6d 6d 61 when a. * comma
12120 6e 64 2d 20 6f 72 20 74 69 6d 65 2d 6c 69 6d 69 nd- or time-limi
12130 74 20 69 73 20 65 78 63 65 65 64 65 64 20 62 79 t is exceeded by
12140 20 61 6e 20 69 6e 74 65 72 70 72 65 74 65 72 2e an interpreter.
12150 0a 20 2a 2f 0a 0a 74 79 70 65 64 65 66 20 76 6f . */..typedef vo
12160 69 64 20 28 54 63 6c 5f 4c 69 6d 69 74 48 61 6e id (Tcl_LimitHan
12170 64 6c 65 72 50 72 6f 63 29 20 28 76 6f 69 64 20 dlerProc) (void
12180 2a 63 6c 69 65 6e 74 44 61 74 61 2c 20 54 63 6c *clientData, Tcl
12190 5f 49 6e 74 65 72 70 20 2a 69 6e 74 65 72 70 29 _Interp *interp)
121a0 3b 0a 74 79 70 65 64 65 66 20 76 6f 69 64 20 28 ;.typedef void (
121b0 54 63 6c 5f 4c 69 6d 69 74 48 61 6e 64 6c 65 72 Tcl_LimitHandler
121c0 44 65 6c 65 74 65 50 72 6f 63 29 20 28 76 6f 69 DeleteProc) (voi
121d0 64 20 2a 63 6c 69 65 6e 74 44 61 74 61 29 3b 0a d *clientData);.
121e0 0a 2f 2a 0a 20 2a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ./*. *----------
121f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
12200 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
12210 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
12220 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
12230 2d 2d 0a 20 2a 20 4f 76 65 72 72 69 64 65 20 64 --. * Override d
12240 65 66 69 6e 69 74 69 6f 6e 73 20 66 6f 72 20 6c efinitions for l
12250 69 62 74 6f 6d 6d 61 74 68 2e 0a 20 2a 2f 0a 0a ibtommath.. */..
12260 74 79 70 65 64 65 66 20 73 74 72 75 63 74 20 6d typedef struct m
12270 70 5f 69 6e 74 20 6d 70 5f 69 6e 74 3b 0a 23 64 p_int mp_int;.#d
12280 65 66 69 6e 65 20 4d 50 5f 49 4e 54 5f 44 45 43 efine MP_INT_DEC
12290 4c 41 52 45 44 0a 0a 2f 2a 0a 20 2a 2d 2d 2d 2d LARED../*. *----
122a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
122b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
122c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
122d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
122e0 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 2a 20 44 65 66 69 --------. * Defi
122f0 6e 69 74 69 6f 6e 73 20 6e 65 65 64 65 64 20 66 nitions needed f
12300 6f 72 20 54 63 6c 5f 50 61 72 73 65 41 72 67 76 or Tcl_ParseArgv
12310 4f 62 6a 20 72 6f 75 74 69 6e 65 73 2e 0a 20 2a Obj routines.. *
12320 20 42 61 73 65 64 20 6f 6e 20 74 6b 41 72 67 76 Based on tkArgv
12330 2e 63 2e 0a 20 2a 20 4d 6f 64 69 66 69 63 61 74 .c.. * Modificat
12340 69 6f 6e 73 20 66 72 6f 6d 20 74 68 65 20 6f 72 ions from the or
12350 69 67 69 6e 61 6c 20 61 72 65 20 63 6f 70 79 72 iginal are copyr
12360 69 67 68 74 20 28 63 29 20 53 61 6d 20 42 72 6f ight (c) Sam Bro
12370 6d 6c 65 79 20 32 30 30 36 0a 20 2a 2f 0a 0a 74 mley 2006. */..t
12380 79 70 65 64 65 66 20 73 74 72 75 63 74 20 7b 0a ypedef struct {.
12390 20 20 20 20 69 6e 74 20 74 79 70 65 3b 09 09 09 int type;...
123a0 2f 2a 20 49 6e 64 69 63 61 74 65 73 20 74 68 65 /* Indicates the
123b0 20 6f 70 74 69 6f 6e 20 74 79 70 65 3b 20 73 65 option type; se
123c0 65 20 62 65 6c 6f 77 2e 20 2a 2f 0a 20 20 20 20 e below. */.
123d0 63 6f 6e 73 74 20 63 68 61 72 20 2a 6b 65 79 53 const char *keyS
123e0 74 72 3b 09 09 2f 2a 20 54 68 65 20 6b 65 79 20 tr;../* The key
123f0 73 74 72 69 6e 67 20 74 68 61 74 20 66 6c 61 67 string that flag
12400 73 20 74 68 65 20 6f 70 74 69 6f 6e 20 69 6e 20 s the option in
12410 74 68 65 0a 09 09 09 09 20 2a 20 61 72 67 76 20 the..... * argv
12420 61 72 72 61 79 2e 20 2a 2f 0a 20 20 20 20 76 6f array. */. vo
12430 69 64 20 2a 73 72 63 50 74 72 3b 09 09 2f 2a 20 id *srcPtr;../*
12440 56 61 6c 75 65 20 74 6f 20 62 65 20 75 73 65 64 Value to be used
12450 20 69 6e 20 73 65 74 74 69 6e 67 20 64 73 74 3b in setting dst;
12460 20 75 73 61 67 65 0a 09 09 09 09 20 2a 20 64 65 usage..... * de
12470 70 65 6e 64 73 20 6f 6e 20 74 79 70 65 2e 2a 2f pends on type.*/
12480 0a 20 20 20 20 76 6f 69 64 20 2a 64 73 74 50 74 . void *dstPt
12490 72 3b 09 09 2f 2a 20 41 64 64 72 65 73 73 20 6f r;../* Address o
124a0 66 20 76 61 6c 75 65 20 74 6f 20 62 65 20 6d 6f f value to be mo
124b0 64 69 66 69 65 64 3b 20 75 73 61 67 65 0a 09 09 dified; usage...
124c0 09 09 20 2a 20 64 65 70 65 6e 64 73 20 6f 6e 20 .. * depends on
124d0 74 79 70 65 2e 2a 2f 0a 20 20 20 20 63 6f 6e 73 type.*/. cons
124e0 74 20 63 68 61 72 20 2a 68 65 6c 70 53 74 72 3b t char *helpStr;
124f0 09 2f 2a 20 44 6f 63 75 6d 65 6e 74 61 74 69 6f ./* Documentatio
12500 6e 20 6d 65 73 73 61 67 65 20 64 65 73 63 72 69 n message descri
12510 62 69 6e 67 20 74 68 69 73 0a 09 09 09 09 20 2a bing this..... *
12520 20 6f 70 74 69 6f 6e 2e 20 2a 2f 0a 20 20 20 20 option. */.
12530 76 6f 69 64 20 2a 63 6c 69 65 6e 74 44 61 74 61 void *clientData
12540 3b 09 2f 2a 20 57 6f 72 64 20 74 6f 20 70 61 73 ;./* Word to pas
12550 73 20 74 6f 20 66 75 6e 63 74 69 6f 6e 20 63 61 s to function ca
12560 6c 6c 62 61 63 6b 73 2e 20 2a 2f 0a 7d 20 54 63 llbacks. */.} Tc
12570 6c 5f 41 72 67 76 49 6e 66 6f 3b 0a 0a 2f 2a 0a l_ArgvInfo;../*.
12580 20 2a 20 4c 65 67 61 6c 20 76 61 6c 75 65 73 20 * Legal values
12590 66 6f 72 20 74 68 65 20 74 79 70 65 20 66 69 65 for the type fie
125a0 6c 64 20 6f 66 20 61 20 54 63 6c 5f 41 72 67 49 ld of a Tcl_ArgI
125b0 6e 66 6f 3a 20 73 65 65 20 74 68 65 20 75 73 65 nfo: see the use
125c0 72 0a 20 2a 20 64 6f 63 75 6d 65 6e 74 61 74 69 r. * documentati
125d0 6f 6e 20 66 6f 72 20 64 65 74 61 69 6c 73 2e 0a on for details..
125e0 20 2a 2f 0a 0a 23 64 65 66 69 6e 65 20 54 43 4c */..#define TCL
125f0 5f 41 52 47 56 5f 43 4f 4e 53 54 41 4e 54 09 31 _ARGV_CONSTANT.1
12600 35 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 41 52 5.#define TCL_AR
12610 47 56 5f 49 4e 54 09 09 31 36 0a 23 64 65 66 69 GV_INT..16.#defi
12620 6e 65 20 54 43 4c 5f 41 52 47 56 5f 53 54 52 49 ne TCL_ARGV_STRI
12630 4e 47 09 09 31 37 0a 23 64 65 66 69 6e 65 20 54 NG..17.#define T
12640 43 4c 5f 41 52 47 56 5f 52 45 53 54 09 09 31 38 CL_ARGV_REST..18
12650 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 41 52 47 .#define TCL_ARG
12660 56 5f 46 4c 4f 41 54 09 09 31 39 0a 23 64 65 66 V_FLOAT..19.#def
12670 69 6e 65 20 54 43 4c 5f 41 52 47 56 5f 46 55 4e ine TCL_ARGV_FUN
12680 43 09 09 32 30 0a 23 64 65 66 69 6e 65 20 54 43 C..20.#define TC
12690 4c 5f 41 52 47 56 5f 47 45 4e 46 55 4e 43 09 32 L_ARGV_GENFUNC.2
126a0 31 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 41 52 1.#define TCL_AR
126b0 47 56 5f 48 45 4c 50 09 09 32 32 0a 23 64 65 66 GV_HELP..22.#def
126c0 69 6e 65 20 54 43 4c 5f 41 52 47 56 5f 45 4e 44 ine TCL_ARGV_END
126d0 09 09 32 33 0a 0a 2f 2a 0a 20 2a 20 54 79 70 65 ..23../*. * Type
126e0 73 20 6f 66 20 63 61 6c 6c 62 61 63 6b 20 66 75 s of callback fu
126f0 6e 63 74 69 6f 6e 73 20 66 6f 72 20 74 68 65 20 nctions for the
12700 54 43 4c 5f 41 52 47 56 5f 46 55 4e 43 20 61 6e TCL_ARGV_FUNC an
12710 64 20 54 43 4c 5f 41 52 47 56 5f 47 45 4e 46 55 d TCL_ARGV_GENFU
12720 4e 43 0a 20 2a 20 61 72 67 75 6d 65 6e 74 20 74 NC. * argument t
12730 79 70 65 73 3a 0a 20 2a 2f 0a 0a 74 79 70 65 64 ypes:. */..typed
12740 65 66 20 69 6e 74 20 28 54 63 6c 5f 41 72 67 76 ef int (Tcl_Argv
12750 46 75 6e 63 50 72 6f 63 29 28 76 6f 69 64 20 2a FuncProc)(void *
12760 63 6c 69 65 6e 74 44 61 74 61 2c 20 54 63 6c 5f clientData, Tcl_
12770 4f 62 6a 20 2a 6f 62 6a 50 74 72 2c 0a 09 76 6f Obj *objPtr,..vo
12780 69 64 20 2a 64 73 74 50 74 72 29 3b 0a 74 79 70 id *dstPtr);.typ
12790 65 64 65 66 20 69 6e 74 20 28 54 63 6c 5f 41 72 edef int (Tcl_Ar
127a0 67 76 47 65 6e 46 75 6e 63 50 72 6f 63 29 28 76 gvGenFuncProc)(v
127b0 6f 69 64 20 2a 63 6c 69 65 6e 74 44 61 74 61 2c oid *clientData,
127c0 20 54 63 6c 5f 49 6e 74 65 72 70 20 2a 69 6e 74 Tcl_Interp *int
127d0 65 72 70 2c 0a 09 69 6e 74 20 6f 62 6a 63 2c 20 erp,..int objc,
127e0 54 63 6c 5f 4f 62 6a 20 2a 63 6f 6e 73 74 20 2a Tcl_Obj *const *
127f0 6f 62 6a 76 2c 20 76 6f 69 64 20 2a 64 73 74 50 objv, void *dstP
12800 74 72 29 3b 0a 0a 2f 2a 0a 20 2a 20 53 68 6f 72 tr);../*. * Shor
12810 74 68 61 6e 64 20 66 6f 72 20 63 6f 6d 6d 6f 6e thand for common
12820 6c 79 20 75 73 65 64 20 61 72 67 54 61 62 6c 65 ly used argTable
12830 20 65 6e 74 72 69 65 73 2e 0a 20 2a 2f 0a 0a 23 entries.. */..#
12840 64 65 66 69 6e 65 20 54 43 4c 5f 41 52 47 56 5f define TCL_ARGV_
12850 41 55 54 4f 5f 48 45 4c 50 20 5c 0a 20 20 20 20 AUTO_HELP \.
12860 7b 54 43 4c 5f 41 52 47 56 5f 48 45 4c 50 2c 09 {TCL_ARGV_HELP,.
12870 22 2d 68 65 6c 70 22 2c 09 4e 55 4c 4c 2c 09 4e "-help",.NULL,.N
12880 55 4c 4c 2c 20 5c 0a 09 20 20 20 20 22 50 72 69 ULL, \.. "Pri
12890 6e 74 20 73 75 6d 6d 61 72 79 20 6f 66 20 63 6f nt summary of co
128a0 6d 6d 61 6e 64 2d 6c 69 6e 65 20 6f 70 74 69 6f mmand-line optio
128b0 6e 73 20 61 6e 64 20 61 62 6f 72 74 22 2c 20 4e ns and abort", N
128c0 55 4c 4c 7d 0a 23 64 65 66 69 6e 65 20 54 43 4c ULL}.#define TCL
128d0 5f 41 52 47 56 5f 41 55 54 4f 5f 52 45 53 54 20 _ARGV_AUTO_REST
128e0 5c 0a 20 20 20 20 7b 54 43 4c 5f 41 52 47 56 5f \. {TCL_ARGV_
128f0 52 45 53 54 2c 09 22 2d 2d 22 2c 09 09 4e 55 4c REST,."--",..NUL
12900 4c 2c 09 4e 55 4c 4c 2c 20 5c 0a 09 20 20 20 20 L,.NULL, \..
12910 22 4d 61 72 6b 73 20 74 68 65 20 65 6e 64 20 6f "Marks the end o
12920 66 20 74 68 65 20 6f 70 74 69 6f 6e 73 22 2c 20 f the options",
12930 4e 55 4c 4c 7d 0a 23 64 65 66 69 6e 65 20 54 43 NULL}.#define TC
12940 4c 5f 41 52 47 56 5f 54 41 42 4c 45 5f 45 4e 44 L_ARGV_TABLE_END
12950 20 5c 0a 20 20 20 20 7b 54 43 4c 5f 41 52 47 56 \. {TCL_ARGV
12960 5f 45 4e 44 2c 20 4e 55 4c 4c 2c 20 4e 55 4c 4c _END, NULL, NULL
12970 2c 20 4e 55 4c 4c 2c 20 4e 55 4c 4c 2c 20 4e 55 , NULL, NULL, NU
12980 4c 4c 7d 0a 0a 2f 2a 0a 20 2a 2d 2d 2d 2d 2d 2d LL}../*. *------
12990 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
129a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
129b0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
129c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
129d0 2d 2d 2d 2d 2d 2d 0a 20 2a 20 44 65 66 69 6e 69 ------. * Defini
129e0 74 69 6f 6e 73 20 6e 65 65 64 65 64 20 66 6f 72 tions needed for
129f0 20 54 63 6c 5f 5a 6c 69 62 20 72 6f 75 74 69 6e Tcl_Zlib routin
12a00 65 73 2e 20 5b 54 49 50 20 23 32 33 34 5d 0a 20 es. [TIP #234].
12a10 2a 0a 20 2a 20 43 6f 6e 73 74 61 6e 74 73 20 66 *. * Constants f
12a20 6f 72 20 74 68 65 20 66 6f 72 6d 61 74 20 66 6c or the format fl
12a30 61 67 73 20 64 65 73 63 72 69 62 69 6e 67 20 77 ags describing w
12a40 68 61 74 20 73 6f 72 74 20 6f 66 20 64 61 74 61 hat sort of data
12a50 20 66 6f 72 6d 61 74 20 69 73 0a 20 2a 20 64 65 format is. * de
12a60 73 69 72 65 64 2f 65 78 70 65 63 74 65 64 20 66 sired/expected f
12a70 6f 72 20 74 68 65 20 54 63 6c 5f 5a 6c 69 62 44 or the Tcl_ZlibD
12a80 65 66 6c 61 74 65 2c 20 54 63 6c 5f 5a 6c 69 62 eflate, Tcl_Zlib
12a90 49 6e 66 6c 61 74 65 20 61 6e 64 0a 20 2a 20 54 Inflate and. * T
12aa0 63 6c 5f 5a 6c 69 62 53 74 72 65 61 6d 49 6e 69 cl_ZlibStreamIni
12ab0 74 20 66 75 6e 63 74 69 6f 6e 73 2e 0a 20 2a 2f t functions.. */
12ac0 0a 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 5a 4c ..#define TCL_ZL
12ad0 49 42 5f 46 4f 52 4d 41 54 5f 52 41 57 09 31 0a IB_FORMAT_RAW.1.
12ae0 23 64 65 66 69 6e 65 20 54 43 4c 5f 5a 4c 49 42 #define TCL_ZLIB
12af0 5f 46 4f 52 4d 41 54 5f 5a 4c 49 42 09 32 0a 23 _FORMAT_ZLIB.2.#
12b00 64 65 66 69 6e 65 20 54 43 4c 5f 5a 4c 49 42 5f define TCL_ZLIB_
12b10 46 4f 52 4d 41 54 5f 47 5a 49 50 09 34 0a 23 64 FORMAT_GZIP.4.#d
12b20 65 66 69 6e 65 20 54 43 4c 5f 5a 4c 49 42 5f 46 efine TCL_ZLIB_F
12b30 4f 52 4d 41 54 5f 41 55 54 4f 09 38 0a 0a 2f 2a ORMAT_AUTO.8../*
12b40 0a 20 2a 20 43 6f 6e 73 74 61 6e 74 73 20 74 68 . * Constants th
12b50 61 74 20 64 65 73 63 72 69 62 65 20 77 68 65 74 at describe whet
12b60 68 65 72 20 74 68 65 20 73 74 72 65 61 6d 20 69 her the stream i
12b70 73 20 74 6f 20 6f 70 65 72 61 74 65 20 69 6e 20 s to operate in
12b80 63 6f 6d 70 72 65 73 73 69 6e 67 20 6f 72 0a 20 compressing or.
12b90 2a 20 64 65 63 6f 6d 70 72 65 73 73 69 6e 67 20 * decompressing
12ba0 6d 6f 64 65 2e 0a 20 2a 2f 0a 0a 23 64 65 66 69 mode.. */..#defi
12bb0 6e 65 20 54 43 4c 5f 5a 4c 49 42 5f 53 54 52 45 ne TCL_ZLIB_STRE
12bc0 41 4d 5f 44 45 46 4c 41 54 45 09 31 36 0a 23 64 AM_DEFLATE.16.#d
12bd0 65 66 69 6e 65 20 54 43 4c 5f 5a 4c 49 42 5f 53 efine TCL_ZLIB_S
12be0 54 52 45 41 4d 5f 49 4e 46 4c 41 54 45 09 33 32 TREAM_INFLATE.32
12bf0 0a 0a 2f 2a 0a 20 2a 20 43 6f 6e 73 74 61 6e 74 ../*. * Constant
12c00 73 20 67 69 76 69 6e 67 20 63 6f 6d 70 72 65 73 s giving compres
12c10 73 69 6f 6e 20 6c 65 76 65 6c 73 2e 20 55 73 65 sion levels. Use
12c20 20 6f 66 20 54 43 4c 5f 5a 4c 49 42 5f 43 4f 4d of TCL_ZLIB_COM
12c30 50 52 45 53 53 5f 44 45 46 41 55 4c 54 20 69 73 PRESS_DEFAULT is
12c40 0a 20 2a 20 72 65 63 6f 6d 6d 65 6e 64 65 64 2e . * recommended.
12c50 0a 20 2a 2f 0a 0a 23 64 65 66 69 6e 65 20 54 43 . */..#define TC
12c60 4c 5f 5a 4c 49 42 5f 43 4f 4d 50 52 45 53 53 5f L_ZLIB_COMPRESS_
12c70 4e 4f 4e 45 09 30 0a 23 64 65 66 69 6e 65 20 54 NONE.0.#define T
12c80 43 4c 5f 5a 4c 49 42 5f 43 4f 4d 50 52 45 53 53 CL_ZLIB_COMPRESS
12c90 5f 46 41 53 54 09 31 0a 23 64 65 66 69 6e 65 20 _FAST.1.#define
12ca0 54 43 4c 5f 5a 4c 49 42 5f 43 4f 4d 50 52 45 53 TCL_ZLIB_COMPRES
12cb0 53 5f 42 45 53 54 09 39 0a 23 64 65 66 69 6e 65 S_BEST.9.#define
12cc0 20 54 43 4c 5f 5a 4c 49 42 5f 43 4f 4d 50 52 45 TCL_ZLIB_COMPRE
12cd0 53 53 5f 44 45 46 41 55 4c 54 20 28 2d 31 29 0a SS_DEFAULT (-1).
12ce0 0a 2f 2a 0a 20 2a 20 43 6f 6e 73 74 61 6e 74 73 ./*. * Constants
12cf0 20 66 6f 72 20 74 79 70 65 73 20 6f 66 20 66 6c for types of fl
12d00 75 73 68 69 6e 67 2c 20 75 73 65 64 20 77 69 74 ushing, used wit
12d10 68 20 54 63 6c 5f 5a 6c 69 62 46 6c 75 73 68 2e h Tcl_ZlibFlush.
12d20 0a 20 2a 2f 0a 0a 23 64 65 66 69 6e 65 20 54 43 . */..#define TC
12d30 4c 5f 5a 4c 49 42 5f 4e 4f 5f 46 4c 55 53 48 09 L_ZLIB_NO_FLUSH.
12d40 30 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 5a 4c 0.#define TCL_ZL
12d50 49 42 5f 46 4c 55 53 48 09 09 32 0a 23 64 65 66 IB_FLUSH..2.#def
12d60 69 6e 65 20 54 43 4c 5f 5a 4c 49 42 5f 46 55 4c ine TCL_ZLIB_FUL
12d70 4c 46 4c 55 53 48 09 33 0a 23 64 65 66 69 6e 65 LFLUSH.3.#define
12d80 20 54 43 4c 5f 5a 4c 49 42 5f 46 49 4e 41 4c 49 TCL_ZLIB_FINALI
12d90 5a 45 09 34 0a 0a 2f 2a 0a 20 2a 2d 2d 2d 2d 2d ZE.4../*. *-----
12da0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
12db0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
12dc0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
12dd0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
12de0 2d 2d 2d 2d 2d 2d 2d 0a 20 2a 20 44 65 66 69 6e -------. * Defin
12df0 69 74 69 6f 6e 73 20 6e 65 65 64 65 64 20 66 6f itions needed fo
12e00 72 20 74 68 65 20 54 63 6c 5f 4c 6f 61 64 46 69 r the Tcl_LoadFi
12e10 6c 65 20 66 75 6e 63 74 69 6f 6e 2e 20 5b 54 49 le function. [TI
12e20 50 20 23 34 31 36 5d 0a 20 2a 2f 0a 0a 23 64 65 P #416]. */..#de
12e30 66 69 6e 65 20 54 43 4c 5f 4c 4f 41 44 5f 47 4c fine TCL_LOAD_GL
12e40 4f 42 41 4c 20 31 0a 23 64 65 66 69 6e 65 20 54 OBAL 1.#define T
12e50 43 4c 5f 4c 4f 41 44 5f 4c 41 5a 59 20 32 0a 0a CL_LOAD_LAZY 2..
12e60 2f 2a 0a 20 2a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d /*. *-----------
12e70 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
12e80 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
12e90 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
12ea0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
12eb0 2d 0a 20 2a 20 44 65 66 69 6e 69 74 69 6f 6e 73 -. * Definitions
12ec0 20 6e 65 65 64 65 64 20 66 6f 72 20 74 68 65 20 needed for the
12ed0 54 63 6c 5f 4f 70 65 6e 54 63 70 53 65 72 76 65 Tcl_OpenTcpServe
12ee0 72 45 78 20 66 75 6e 63 74 69 6f 6e 2e 20 5b 54 rEx function. [T
12ef0 49 50 20 23 34 35 36 5d 0a 20 2a 2f 0a 23 64 65 IP #456]. */.#de
12f00 66 69 6e 65 20 54 43 4c 5f 54 43 50 53 45 52 56 fine TCL_TCPSERV
12f10 45 52 5f 52 45 55 53 45 41 44 44 52 20 28 31 3c ER_REUSEADDR (1<
12f20 3c 30 29 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f <0).#define TCL_
12f30 54 43 50 53 45 52 56 45 52 5f 52 45 55 53 45 50 TCPSERVER_REUSEP
12f40 4f 52 54 20 28 31 3c 3c 31 29 0a 0a 2f 2a 0a 20 ORT (1<<1)../*.
12f50 2a 20 43 6f 6e 73 74 61 6e 74 73 20 66 6f 72 20 * Constants for
12f60 73 70 65 63 69 61 6c 20 73 69 7a 65 5f 74 2d 74 special size_t-t
12f70 79 70 65 64 20 76 61 6c 75 65 73 2c 20 73 65 65 yped values, see
12f80 20 54 49 50 20 23 34 39 34 0a 20 2a 2f 0a 0a 23 TIP #494. */..#
12f90 64 65 66 69 6e 65 20 54 43 4c 5f 49 4f 5f 46 41 define TCL_IO_FA
12fa0 49 4c 55 52 45 09 28 28 73 69 7a 65 5f 74 29 2d ILURE.((size_t)-
12fb0 31 29 0a 23 64 65 66 69 6e 65 20 54 43 4c 5f 41 1).#define TCL_A
12fc0 55 54 4f 5f 4c 45 4e 47 54 48 09 28 28 73 69 7a UTO_LENGTH.((siz
12fd0 65 5f 74 29 2d 31 29 0a 23 64 65 66 69 6e 65 20 e_t)-1).#define
12fe0 54 43 4c 5f 49 4e 44 45 58 5f 4e 4f 4e 45 20 20 TCL_INDEX_NONE
12ff0 28 28 73 69 7a 65 5f 74 29 2d 31 29 0a 0a 2f 2a ((size_t)-1)../*
13000 0a 20 2a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d . *-------------
13010 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
13020 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
13030 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
13040 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a ---------------.
13050 20 2a 20 53 69 6e 67 6c 65 20 70 75 62 6c 69 63 * Single public
13060 20 64 65 63 6c 61 72 61 74 69 6f 6e 20 66 6f 72 declaration for
13070 20 4e 52 45 2e 0a 20 2a 2f 0a 0a 74 79 70 65 64 NRE.. */..typed
13080 65 66 20 69 6e 74 20 28 54 63 6c 5f 4e 52 50 6f ef int (Tcl_NRPo
13090 73 74 50 72 6f 63 29 20 28 76 6f 69 64 20 2a 64 stProc) (void *d
130a0 61 74 61 5b 5d 2c 20 54 63 6c 5f 49 6e 74 65 72 ata[], Tcl_Inter
130b0 70 20 2a 69 6e 74 65 72 70 2c 0a 09 09 09 09 69 p *interp,.....i
130c0 6e 74 20 72 65 73 75 6c 74 29 3b 0a 0a 2f 2a 0a nt result);../*.
130d0 20 2a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d *--------------
130e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
130f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
13100 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
13110 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 --------------.
13120 2a 20 54 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 * The following
13130 63 6f 6e 73 74 61 6e 74 20 69 73 20 75 73 65 64 constant is used
13140 20 74 6f 20 74 65 73 74 20 66 6f 72 20 6f 6c 64 to test for old
13150 65 72 20 76 65 72 73 69 6f 6e 73 20 6f 66 20 54 er versions of T
13160 63 6c 20 69 6e 20 74 68 65 0a 20 2a 20 73 74 75 cl in the. * stu
13170 62 73 20 74 61 62 6c 65 73 2e 20 49 66 20 54 43 bs tables. If TC
13180 4c 5f 55 54 46 5f 4d 41 58 3e 34 20 75 73 65 20 L_UTF_MAX>4 use
13190 61 20 64 69 66 66 65 72 65 6e 74 20 76 61 6c 75 a different valu
131a0 65 2e 0a 20 2a 2f 0a 0a 23 64 65 66 69 6e 65 20 e.. */..#define
131b0 54 43 4c 5f 53 54 55 42 5f 4d 41 47 49 43 09 09 TCL_STUB_MAGIC..
131c0 28 28 69 6e 74 29 20 30 78 46 43 41 33 42 41 43 ((int) 0xFCA3BAC
131d0 42 20 2b 20 28 69 6e 74 29 20 73 69 7a 65 6f 66 B + (int) sizeof
131e0 28 76 6f 69 64 20 2a 29 20 2b 20 28 54 43 4c 5f (void *) + (TCL_
131f0 55 54 46 5f 4d 41 58 3e 34 29 29 0a 0a 2f 2a 0a UTF_MAX>4))../*.
13200 20 2a 20 54 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 * The following
13210 20 66 75 6e 63 74 69 6f 6e 20 69 73 20 72 65 71 function is req
13220 75 69 72 65 64 20 74 6f 20 62 65 20 64 65 66 69 uired to be defi
13230 6e 65 64 20 69 6e 20 61 6c 6c 20 73 74 75 62 73 ned in all stubs
13240 20 61 77 61 72 65 0a 20 2a 20 65 78 74 65 6e 73 aware. * extens
13250 69 6f 6e 73 2e 20 54 68 65 20 66 75 6e 63 74 69 ions. The functi
13260 6f 6e 20 69 73 20 61 63 74 75 61 6c 6c 79 20 69 on is actually i
13270 6d 70 6c 65 6d 65 6e 74 65 64 20 69 6e 20 74 68 mplemented in th
13280 65 20 73 74 75 62 20 6c 69 62 72 61 72 79 2c 20 e stub library,
13290 6e 6f 74 0a 20 2a 20 74 68 65 20 6d 61 69 6e 20 not. * the main
132a0 54 63 6c 20 6c 69 62 72 61 72 79 2c 20 61 6c 74 Tcl library, alt
132b0 68 6f 75 67 68 20 74 68 65 72 65 20 69 73 20 61 hough there is a
132c0 20 74 72 69 76 69 61 6c 20 69 6d 70 6c 65 6d 65 trivial impleme
132d0 6e 74 61 74 69 6f 6e 20 69 6e 20 74 68 65 0a 20 ntation in the.
132e0 2a 20 6d 61 69 6e 20 6c 69 62 72 61 72 79 20 69 * main library i
132f0 6e 20 63 61 73 65 20 61 6e 20 65 78 74 65 6e 73 n case an extens
13300 69 6f 6e 20 69 73 20 73 74 61 74 69 63 61 6c 6c ion is staticall
13310 79 20 6c 69 6e 6b 65 64 20 69 6e 74 6f 20 61 6e y linked into an
13320 20 61 70 70 6c 69 63 61 74 69 6f 6e 2e 0a 20 2a application.. *
13330 2f 0a 0a 63 6f 6e 73 74 20 63 68 61 72 20 2a 09 /..const char *.
13340 09 54 63 6c 5f 49 6e 69 74 53 74 75 62 73 28 54 .Tcl_InitStubs(T
13350 63 6c 5f 49 6e 74 65 72 70 20 2a 69 6e 74 65 72 cl_Interp *inter
13360 70 2c 20 63 6f 6e 73 74 20 63 68 61 72 20 2a 76 p, const char *v
13370 65 72 73 69 6f 6e 2c 0a 09 09 09 20 20 20 20 69 ersion,.... i
13380 6e 74 20 65 78 61 63 74 2c 20 69 6e 74 20 6d 61 nt exact, int ma
13390 67 69 63 29 3b 0a 63 6f 6e 73 74 20 63 68 61 72 gic);.const char
133a0 20 2a 09 09 54 63 6c 54 6f 6d 4d 61 74 68 49 6e *..TclTomMathIn
133b0 69 74 69 61 6c 69 7a 65 53 74 75 62 73 28 54 63 itializeStubs(Tc
133c0 6c 5f 49 6e 74 65 72 70 20 2a 69 6e 74 65 72 70 l_Interp *interp
133d0 2c 0a 09 09 09 20 20 20 20 63 6f 6e 73 74 20 63 ,.... const c
133e0 68 61 72 20 2a 76 65 72 73 69 6f 6e 2c 20 69 6e har *version, in
133f0 74 20 65 70 6f 63 68 2c 20 69 6e 74 20 72 65 76 t epoch, int rev
13400 69 73 69 6f 6e 29 3b 0a 23 69 66 20 64 65 66 69 ision);.#if defi
13410 6e 65 64 28 5f 57 49 4e 33 32 29 0a 20 20 20 20 ned(_WIN32).
13420 54 43 4c 5f 4e 4f 52 45 54 55 52 4e 31 20 76 6f TCL_NORETURN1 vo
13430 69 64 20 54 63 6c 5f 43 6f 6e 73 6f 6c 65 50 61 id Tcl_ConsolePa
13440 6e 69 63 28 63 6f 6e 73 74 20 63 68 61 72 20 2a nic(const char *
13450 66 6f 72 6d 61 74 2c 20 2e 2e 2e 29 3b 0a 23 65 format, ...);.#e
13460 6c 73 65 0a 23 20 20 20 64 65 66 69 6e 65 20 54 lse.# define T
13470 63 6c 5f 43 6f 6e 73 6f 6c 65 50 61 6e 69 63 20 cl_ConsolePanic
13480 4e 55 4c 4c 0a 23 65 6e 64 69 66 0a 0a 23 69 66 NULL.#endif..#if
13490 64 65 66 20 55 53 45 5f 54 43 4c 5f 53 54 55 42 def USE_TCL_STUB
134a0 53 0a 23 69 66 20 54 43 4c 5f 52 45 4c 45 41 53 S.#if TCL_RELEAS
134b0 45 5f 4c 45 56 45 4c 20 3d 3d 20 54 43 4c 5f 46 E_LEVEL == TCL_F
134c0 49 4e 41 4c 5f 52 45 4c 45 41 53 45 0a 23 20 20 INAL_RELEASE.#
134d0 20 64 65 66 69 6e 65 20 54 63 6c 5f 49 6e 69 74 define Tcl_Init
134e0 53 74 75 62 73 28 69 6e 74 65 72 70 2c 20 76 65 Stubs(interp, ve
134f0 72 73 69 6f 6e 2c 20 65 78 61 63 74 29 20 5c 0a rsion, exact) \.
13500 09 28 54 63 6c 5f 49 6e 69 74 53 74 75 62 73 29 .(Tcl_InitStubs)
13510 28 69 6e 74 65 72 70 2c 20 76 65 72 73 69 6f 6e (interp, version
13520 2c 20 5c 0a 09 20 20 20 20 28 65 78 61 63 74 29 , \.. (exact)
13530 7c 28 54 43 4c 5f 4d 41 4a 4f 52 5f 56 45 52 53 |(TCL_MAJOR_VERS
13540 49 4f 4e 3c 3c 38 29 7c 28 54 43 4c 5f 4d 49 4e ION<<8)|(TCL_MIN
13550 4f 52 5f 56 45 52 53 49 4f 4e 3c 3c 31 36 29 2c OR_VERSION<<16),
13560 20 5c 0a 09 20 20 20 20 54 43 4c 5f 53 54 55 42 \.. TCL_STUB
13570 5f 4d 41 47 49 43 29 0a 23 65 6c 73 65 0a 23 20 _MAGIC).#else.#
13580 20 20 64 65 66 69 6e 65 20 54 63 6c 5f 49 6e 69 define Tcl_Ini
13590 74 53 74 75 62 73 28 69 6e 74 65 72 70 2c 20 76 tStubs(interp, v
135a0 65 72 73 69 6f 6e 2c 20 65 78 61 63 74 29 20 5c ersion, exact) \
135b0 0a 09 28 54 63 6c 5f 49 6e 69 74 53 74 75 62 73 ..(Tcl_InitStubs
135c0 29 28 69 6e 74 65 72 70 2c 20 54 43 4c 5f 50 41 )(interp, TCL_PA
135d0 54 43 48 5f 4c 45 56 45 4c 2c 20 5c 0a 09 20 20 TCH_LEVEL, \..
135e0 20 20 31 7c 28 54 43 4c 5f 4d 41 4a 4f 52 5f 56 1|(TCL_MAJOR_V
135f0 45 52 53 49 4f 4e 3c 3c 38 29 7c 28 54 43 4c 5f ERSION<<8)|(TCL_
13600 4d 49 4e 4f 52 5f 56 45 52 53 49 4f 4e 3c 3c 31 MINOR_VERSION<<1
13610 36 29 2c 20 5c 0a 09 20 20 20 20 54 43 4c 5f 53 6), \.. TCL_S
13620 54 55 42 5f 4d 41 47 49 43 29 0a 23 65 6e 64 69 TUB_MAGIC).#endi
13630 66 0a 23 65 6c 73 65 0a 23 69 66 20 54 43 4c 5f f.#else.#if TCL_
13640 52 45 4c 45 41 53 45 5f 4c 45 56 45 4c 20 3d 3d RELEASE_LEVEL ==
13650 20 54 43 4c 5f 46 49 4e 41 4c 5f 52 45 4c 45 41 TCL_FINAL_RELEA
13660 53 45 0a 23 20 20 20 64 65 66 69 6e 65 20 54 63 SE.# define Tc
13670 6c 5f 49 6e 69 74 53 74 75 62 73 28 69 6e 74 65 l_InitStubs(inte
13680 72 70 2c 20 76 65 72 73 69 6f 6e 2c 20 65 78 61 rp, version, exa
13690 63 74 29 20 5c 0a 09 54 63 6c 5f 50 6b 67 49 6e ct) \..Tcl_PkgIn
136a0 69 74 53 74 75 62 73 43 68 65 63 6b 28 69 6e 74 itStubsCheck(int
136b0 65 72 70 2c 20 76 65 72 73 69 6f 6e 2c 20 5c 0a erp, version, \.
136c0 09 09 28 65 78 61 63 74 29 7c 28 54 43 4c 5f 4d ..(exact)|(TCL_M
136d0 41 4a 4f 52 5f 56 45 52 53 49 4f 4e 3c 3c 38 29 AJOR_VERSION<<8)
136e0 7c 28 54 43 4c 5f 4d 49 4e 4f 52 5f 56 45 52 53 |(TCL_MINOR_VERS
136f0 49 4f 4e 3c 3c 31 36 29 29 0a 23 65 6c 73 65 0a ION<<16)).#else.
13700 23 20 20 20 64 65 66 69 6e 65 20 54 63 6c 5f 49 # define Tcl_I
13710 6e 69 74 53 74 75 62 73 28 69 6e 74 65 72 70 2c nitStubs(interp,
13720 20 76 65 72 73 69 6f 6e 2c 20 65 78 61 63 74 29 version, exact)
13730 20 5c 0a 09 54 63 6c 5f 50 6b 67 49 6e 69 74 53 \..Tcl_PkgInitS
13740 74 75 62 73 43 68 65 63 6b 28 69 6e 74 65 72 70 tubsCheck(interp
13750 2c 20 54 43 4c 5f 50 41 54 43 48 5f 4c 45 56 45 , TCL_PATCH_LEVE
13760 4c 2c 20 5c 0a 09 09 31 7c 28 54 43 4c 5f 4d 41 L, \...1|(TCL_MA
13770 4a 4f 52 5f 56 45 52 53 49 4f 4e 3c 3c 38 29 7c JOR_VERSION<<8)|
13780 28 54 43 4c 5f 4d 49 4e 4f 52 5f 56 45 52 53 49 (TCL_MINOR_VERSI
13790 4f 4e 3c 3c 31 36 29 29 0a 23 65 6e 64 69 66 0a ON<<16)).#endif.
137a0 23 65 6e 64 69 66 0a 0a 2f 2a 0a 20 2a 20 50 75 #endif../*. * Pu
137b0 62 6c 69 63 20 66 75 6e 63 74 69 6f 6e 73 20 74 blic functions t
137c0 68 61 74 20 61 72 65 20 6e 6f 74 20 61 63 63 65 hat are not acce
137d0 73 73 69 62 6c 65 20 76 69 61 20 74 68 65 20 73 ssible via the s
137e0 74 75 62 73 20 74 61 62 6c 65 2e 0a 20 2a 20 54 tubs table.. * T
137f0 63 6c 5f 47 65 74 4d 65 6d 6f 72 79 49 6e 66 6f cl_GetMemoryInfo
13800 20 69 73 20 6e 65 65 64 65 64 20 66 6f 72 20 41 is needed for A
13810 4f 4c 73 65 72 76 65 72 2e 20 5b 42 75 67 20 31 OLserver. [Bug 1
13820 38 36 38 31 37 31 5d 0a 20 2a 2f 0a 0a 23 64 65 868171]. */..#de
13830 66 69 6e 65 20 54 63 6c 5f 4d 61 69 6e 28 61 72 fine Tcl_Main(ar
13840 67 63 2c 20 61 72 67 76 2c 20 70 72 6f 63 29 20 gc, argv, proc)
13850 54 63 6c 5f 4d 61 69 6e 45 78 28 61 72 67 63 2c Tcl_MainEx(argc,
13860 20 61 72 67 76 2c 20 70 72 6f 63 2c 20 5c 0a 09 argv, proc, \..
13870 20 20 20 20 28 28 54 63 6c 5f 53 65 74 50 61 6e ((Tcl_SetPan
13880 69 63 50 72 6f 63 28 54 63 6c 5f 43 6f 6e 73 6f icProc(Tcl_Conso
13890 6c 65 50 61 6e 69 63 29 2c 20 54 63 6c 5f 43 72 lePanic), Tcl_Cr
138a0 65 61 74 65 49 6e 74 65 72 70 29 28 29 29 29 0a eateInterp)())).
138b0 45 58 54 45 52 4e 20 54 43 4c 5f 4e 4f 52 45 54 EXTERN TCL_NORET
138c0 55 52 4e 20 76 6f 69 64 20 54 63 6c 5f 4d 61 69 URN void Tcl_Mai
138d0 6e 45 78 28 69 6e 74 20 61 72 67 63 2c 20 63 68 nEx(int argc, ch
138e0 61 72 20 2a 2a 61 72 67 76 2c 0a 09 09 09 20 20 ar **argv,....
138f0 20 20 54 63 6c 5f 41 70 70 49 6e 69 74 50 72 6f Tcl_AppInitPro
13900 63 20 2a 61 70 70 49 6e 69 74 50 72 6f 63 2c 20 c *appInitProc,
13910 54 63 6c 5f 49 6e 74 65 72 70 20 2a 69 6e 74 65 Tcl_Interp *inte
13920 72 70 29 3b 0a 45 58 54 45 52 4e 20 63 6f 6e 73 rp);.EXTERN cons
13930 74 20 63 68 61 72 20 2a 09 54 63 6c 5f 50 6b 67 t char *.Tcl_Pkg
13940 49 6e 69 74 53 74 75 62 73 43 68 65 63 6b 28 54 InitStubsCheck(T
13950 63 6c 5f 49 6e 74 65 72 70 20 2a 69 6e 74 65 72 cl_Interp *inter
13960 70 2c 0a 09 09 09 20 20 20 20 63 6f 6e 73 74 20 p,.... const
13970 63 68 61 72 20 2a 76 65 72 73 69 6f 6e 2c 20 69 char *version, i
13980 6e 74 20 65 78 61 63 74 29 3b 0a 45 58 54 45 52 nt exact);.EXTER
13990 4e 20 76 6f 69 64 09 09 54 63 6c 5f 49 6e 69 74 N void..Tcl_Init
139a0 53 75 62 73 79 73 74 65 6d 73 28 76 6f 69 64 29 Subsystems(void)
139b0 3b 0a 45 58 54 45 52 4e 20 76 6f 69 64 09 09 54 ;.EXTERN void..T
139c0 63 6c 5f 47 65 74 4d 65 6d 6f 72 79 49 6e 66 6f cl_GetMemoryInfo
139d0 28 54 63 6c 5f 44 53 74 72 69 6e 67 20 2a 64 73 (Tcl_DString *ds
139e0 50 74 72 29 3b 0a 45 58 54 45 52 4e 20 76 6f 69 Ptr);.EXTERN voi
139f0 64 09 09 54 63 6c 5f 46 69 6e 64 45 78 65 63 75 d..Tcl_FindExecu
13a00 74 61 62 6c 65 28 63 6f 6e 73 74 20 63 68 61 72 table(const char
13a10 20 2a 61 72 67 76 30 29 3b 0a 45 58 54 45 52 4e *argv0);.EXTERN
13a20 20 76 6f 69 64 09 09 54 63 6c 5f 53 65 74 50 61 void..Tcl_SetPa
13a30 6e 69 63 50 72 6f 63 28 0a 09 09 09 20 20 20 20 nicProc(....
13a40 54 43 4c 5f 4e 4f 52 45 54 55 52 4e 31 20 54 63 TCL_NORETURN1 Tc
13a50 6c 5f 50 61 6e 69 63 50 72 6f 63 20 2a 70 61 6e l_PanicProc *pan
13a60 69 63 50 72 6f 63 29 3b 0a 45 58 54 45 52 4e 20 icProc);.EXTERN
13a70 76 6f 69 64 09 09 54 63 6c 5f 53 74 61 74 69 63 void..Tcl_Static
13a80 50 61 63 6b 61 67 65 28 54 63 6c 5f 49 6e 74 65 Package(Tcl_Inte
13a90 72 70 20 2a 69 6e 74 65 72 70 2c 0a 09 09 09 20 rp *interp,....
13aa0 20 20 20 63 6f 6e 73 74 20 63 68 61 72 20 2a 70 const char *p
13ab0 6b 67 4e 61 6d 65 2c 0a 09 09 09 20 20 20 20 54 kgName,.... T
13ac0 63 6c 5f 50 61 63 6b 61 67 65 49 6e 69 74 50 72 cl_PackageInitPr
13ad0 6f 63 20 2a 69 6e 69 74 50 72 6f 63 2c 0a 09 09 oc *initProc,...
13ae0 09 20 20 20 20 54 63 6c 5f 50 61 63 6b 61 67 65 . Tcl_Package
13af0 49 6e 69 74 50 72 6f 63 20 2a 73 61 66 65 49 6e InitProc *safeIn
13b00 69 74 50 72 6f 63 29 3b 0a 45 58 54 45 52 4e 20 itProc);.EXTERN
13b10 54 63 6c 5f 45 78 69 74 50 72 6f 63 20 2a 54 63 Tcl_ExitProc *Tc
13b20 6c 5f 53 65 74 45 78 69 74 50 72 6f 63 28 54 43 l_SetExitProc(TC
13b30 4c 5f 4e 4f 52 45 54 55 52 4e 31 20 54 63 6c 5f L_NORETURN1 Tcl_
13b40 45 78 69 74 50 72 6f 63 20 2a 70 72 6f 63 29 3b ExitProc *proc);
13b50 0a 23 69 66 64 65 66 20 5f 57 49 4e 33 32 0a 45 .#ifdef _WIN32.E
13b60 58 54 45 52 4e 20 69 6e 74 09 09 54 63 6c 5a 69 XTERN int..TclZi
13b70 70 66 73 5f 41 70 70 48 6f 6f 6b 28 69 6e 74 20 pfs_AppHook(int
13b80 2a 61 72 67 63 2c 20 77 63 68 61 72 5f 74 20 2a *argc, wchar_t *
13b90 2a 2a 61 72 67 76 29 3b 0a 23 65 6c 73 65 0a 45 **argv);.#else.E
13ba0 58 54 45 52 4e 20 69 6e 74 09 09 54 63 6c 5a 69 XTERN int..TclZi
13bb0 70 66 73 5f 41 70 70 48 6f 6f 6b 28 69 6e 74 20 pfs_AppHook(int
13bc0 2a 61 72 67 63 2c 20 63 68 61 72 20 2a 2a 2a 61 *argc, char ***a
13bd0 72 67 76 29 3b 0a 23 65 6e 64 69 66 0a 0c 0a 2f rgv);.#endif.../
13be0 2a 0a 20 2a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d *. *------------
13bf0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
13c00 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
13c10 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
13c20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
13c30 0a 20 2a 20 49 6e 63 6c 75 64 65 20 74 68 65 20 . * Include the
13c40 70 75 62 6c 69 63 20 66 75 6e 63 74 69 6f 6e 20 public function
13c50 64 65 63 6c 61 72 61 74 69 6f 6e 73 20 74 68 61 declarations tha
13c60 74 20 61 72 65 20 61 63 63 65 73 73 69 62 6c 65 t are accessible
13c70 20 76 69 61 20 74 68 65 20 73 74 75 62 73 0a 20 via the stubs.
13c80 2a 20 74 61 62 6c 65 2e 0a 20 2a 2f 0a 0a 23 69 * table.. */..#i
13c90 6e 63 6c 75 64 65 20 22 74 63 6c 44 65 63 6c 73 nclude "tclDecls
13ca0 2e 68 22 0a 0a 2f 2a 0a 20 2a 20 49 6e 63 6c 75 .h"../*. * Inclu
13cb0 64 65 20 70 6c 61 74 66 6f 72 6d 20 73 70 65 63 de platform spec
13cc0 69 66 69 63 20 70 75 62 6c 69 63 20 66 75 6e 63 ific public func
13cd0 74 69 6f 6e 20 64 65 63 6c 61 72 61 74 69 6f 6e tion declaration
13ce0 73 20 74 68 61 74 20 61 72 65 20 61 63 63 65 73 s that are acces
13cf0 73 69 62 6c 65 0a 20 2a 20 76 69 61 20 74 68 65 sible. * via the
13d00 20 73 74 75 62 73 20 74 61 62 6c 65 2e 20 4d 61 stubs table. Ma
13d10 6b 65 20 61 6c 6c 20 54 63 6c 4f 4f 20 73 79 6d ke all TclOO sym
13d20 62 6f 6c 73 20 4d 4f 44 55 4c 45 5f 53 43 4f 50 bols MODULE_SCOP
13d30 45 20 28 77 68 69 63 68 20 6f 6e 6c 79 0a 20 2a E (which only. *
13d40 20 68 61 73 20 65 66 66 65 63 74 20 6f 6e 20 62 has effect on b
13d50 75 69 6c 64 69 6e 67 20 69 74 20 61 73 20 61 20 uilding it as a
13d60 73 68 61 72 65 64 20 6c 69 62 72 61 72 79 29 2e shared library).
13d70 20 53 65 65 20 74 69 63 6b 65 74 20 5b 33 30 31 See ticket [301
13d80 30 33 35 32 5d 2e 0a 20 2a 2f 0a 0a 23 69 66 20 0352].. */..#if
13d90 64 65 66 69 6e 65 64 28 42 55 49 4c 44 5f 74 63 defined(BUILD_tc
13da0 6c 29 0a 23 20 20 20 75 6e 64 65 66 20 54 43 4c l).# undef TCL
13db0 41 50 49 0a 23 20 20 20 64 65 66 69 6e 65 20 54 API.# define T
13dc0 43 4c 41 50 49 20 4d 4f 44 55 4c 45 5f 53 43 4f CLAPI MODULE_SCO
13dd0 50 45 0a 23 65 6e 64 69 66 0a 0a 23 69 6e 63 6c PE.#endif..#incl
13de0 75 64 65 20 22 74 63 6c 50 6c 61 74 44 65 63 6c ude "tclPlatDecl
13df0 73 2e 68 22 0a 0a 2f 2a 0a 20 2a 2d 2d 2d 2d 2d s.h"../*. *-----
13e00 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
13e10 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
13e20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
13e30 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
13e40 2d 2d 2d 2d 2d 2d 2d 0a 20 2a 20 54 68 65 20 66 -------. * The f
13e50 6f 6c 6c 6f 77 69 6e 67 20 64 65 63 6c 61 72 61 ollowing declara
13e60 74 69 6f 6e 73 20 6d 61 70 20 63 6b 61 6c 6c 6f tions map ckallo
13e70 63 20 61 6e 64 20 63 6b 66 72 65 65 20 74 6f 20 c and ckfree to
13e80 54 63 6c 5f 41 6c 6c 6f 63 20 61 6e 64 0a 20 2a Tcl_Alloc and. *
13e90 20 54 63 6c 5f 46 72 65 65 20 66 6f 72 20 75 73 Tcl_Free for us
13ea0 65 20 69 6e 20 54 63 6c 2d 38 2e 78 2d 63 6f 6d e in Tcl-8.x-com
13eb0 70 61 74 69 62 6c 65 20 65 78 74 65 6e 73 69 6f patible extensio
13ec0 6e 73 2e 0a 20 2a 2f 0a 0a 23 69 66 6e 64 65 66 ns.. */..#ifndef
13ed0 20 42 55 49 4c 44 5f 74 63 6c 0a 23 20 20 20 64 BUILD_tcl.# d
13ee0 65 66 69 6e 65 20 63 6b 61 6c 6c 6f 63 20 54 63 efine ckalloc Tc
13ef0 6c 5f 41 6c 6c 6f 63 0a 23 20 20 20 64 65 66 69 l_Alloc.# defi
13f00 6e 65 20 61 74 74 65 6d 70 74 63 6b 61 6c 6c 6f ne attemptckallo
13f10 63 20 54 63 6c 5f 41 74 74 65 6d 70 74 41 6c 6c c Tcl_AttemptAll
13f20 6f 63 0a 23 20 20 20 69 66 64 65 66 20 5f 4d 53 oc.# ifdef _MS
13f30 43 5f 56 45 52 0a 09 2f 2a 20 53 69 6c 65 6e 63 C_VER../* Silenc
13f40 65 20 69 6e 76 61 6c 69 64 20 43 34 30 39 30 20 e invalid C4090
13f50 77 61 72 6e 69 6e 67 73 20 2a 2f 0a 23 09 64 65 warnings */.#.de
13f60 66 69 6e 65 20 63 6b 66 72 65 65 28 61 29 20 54 fine ckfree(a) T
13f70 63 6c 5f 46 72 65 65 28 28 63 68 61 72 20 2a 29 cl_Free((char *)
13f80 28 61 29 29 0a 23 09 64 65 66 69 6e 65 20 63 6b (a)).#.define ck
13f90 72 65 61 6c 6c 6f 63 28 61 2c 62 29 20 54 63 6c realloc(a,b) Tcl
13fa0 5f 52 65 61 6c 6c 6f 63 28 28 63 68 61 72 20 2a _Realloc((char *
13fb0 29 28 61 29 2c 28 62 29 29 0a 23 09 64 65 66 69 )(a),(b)).#.defi
13fc0 6e 65 20 61 74 74 65 6d 70 74 63 6b 72 65 61 6c ne attemptckreal
13fd0 6c 6f 63 28 61 2c 62 29 20 54 63 6c 5f 41 74 74 loc(a,b) Tcl_Att
13fe0 65 6d 70 74 52 65 61 6c 6c 6f 63 28 28 63 68 61 emptRealloc((cha
13ff0 72 20 2a 29 28 61 29 2c 28 62 29 29 0a 23 20 20 r *)(a),(b)).#
14000 20 65 6c 73 65 0a 23 09 64 65 66 69 6e 65 20 63 else.#.define c
14010 6b 66 72 65 65 20 54 63 6c 5f 46 72 65 65 0a 23 kfree Tcl_Free.#
14020 09 64 65 66 69 6e 65 20 63 6b 72 65 61 6c 6c 6f .define ckreallo
14030 63 20 54 63 6c 5f 52 65 61 6c 6c 6f 63 0a 23 09 c Tcl_Realloc.#.
14040 64 65 66 69 6e 65 20 61 74 74 65 6d 70 74 63 6b define attemptck
14050 72 65 61 6c 6c 6f 63 20 54 63 6c 5f 41 74 74 65 realloc Tcl_Atte
14060 6d 70 74 52 65 61 6c 6c 6f 63 0a 23 20 20 20 65 mptRealloc.# e
14070 6e 64 69 66 0a 23 65 6e 64 69 66 0a 0a 23 69 66 ndif.#endif..#if
14080 6e 64 65 66 20 54 43 4c 5f 4d 45 4d 5f 44 45 42 ndef TCL_MEM_DEB
14090 55 47 0a 0a 2f 2a 0a 20 2a 20 49 66 20 77 65 20 UG../*. * If we
140a0 61 72 65 20 6e 6f 74 20 75 73 69 6e 67 20 74 68 are not using th
140b0 65 20 64 65 62 75 67 67 69 6e 67 20 61 6c 6c 6f e debugging allo
140c0 63 61 74 6f 72 2c 20 77 65 20 73 68 6f 75 6c 64 cator, we should
140d0 20 63 61 6c 6c 20 74 68 65 20 54 63 6c 5f 41 6c call the Tcl_Al
140e0 6c 6f 63 2c 0a 20 2a 20 65 74 20 61 6c 2e 20 72 loc,. * et al. r
140f0 6f 75 74 69 6e 65 73 20 69 6e 20 6f 72 64 65 72 outines in order
14100 20 74 6f 20 67 75 61 72 61 6e 74 65 65 20 74 68 to guarantee th
14110 61 74 20 65 76 65 72 79 20 6d 6f 64 75 6c 65 20 at every module
14120 69 73 20 75 73 69 6e 67 20 74 68 65 20 73 61 6d is using the sam
14130 65 0a 20 2a 20 6d 65 6d 6f 72 79 20 61 6c 6c 6f e. * memory allo
14140 63 61 74 6f 72 20 62 6f 74 68 20 69 6e 73 69 64 cator both insid
14150 65 20 61 6e 64 20 6f 75 74 73 69 64 65 20 6f 66 e and outside of
14160 20 74 68 65 20 54 63 6c 20 6c 69 62 72 61 72 79 the Tcl library
14170 2e 0a 20 2a 2f 0a 0a 23 20 20 20 75 6e 64 65 66 .. */..# undef
14180 20 20 54 63 6c 5f 49 6e 69 74 4d 65 6d 6f 72 79 Tcl_InitMemory
14190 0a 23 20 20 20 64 65 66 69 6e 65 20 54 63 6c 5f .# define Tcl_
141a0 49 6e 69 74 4d 65 6d 6f 72 79 28 78 29 0a 23 20 InitMemory(x).#
141b0 20 20 75 6e 64 65 66 20 20 54 63 6c 5f 44 75 6d undef Tcl_Dum
141c0 70 41 63 74 69 76 65 4d 65 6d 6f 72 79 0a 23 20 pActiveMemory.#
141d0 20 20 64 65 66 69 6e 65 20 54 63 6c 5f 44 75 6d define Tcl_Dum
141e0 70 41 63 74 69 76 65 4d 65 6d 6f 72 79 28 78 29 pActiveMemory(x)
141f0 0a 23 20 20 20 75 6e 64 65 66 20 20 54 63 6c 5f .# undef Tcl_
14200 56 61 6c 69 64 61 74 65 41 6c 6c 4d 65 6d 6f 72 ValidateAllMemor
14210 79 0a 23 20 20 20 64 65 66 69 6e 65 20 54 63 6c y.# define Tcl
14220 5f 56 61 6c 69 64 61 74 65 41 6c 6c 4d 65 6d 6f _ValidateAllMemo
14230 72 79 28 78 2c 79 29 0a 0a 23 65 6e 64 69 66 20 ry(x,y)..#endif
14240 2f 2a 20 21 54 43 4c 5f 4d 45 4d 5f 44 45 42 55 /* !TCL_MEM_DEBU
14250 47 20 2a 2f 0a 0a 23 69 66 64 65 66 20 54 43 4c G */..#ifdef TCL
14260 5f 4d 45 4d 5f 44 45 42 55 47 0a 23 20 20 20 75 _MEM_DEBUG.# u
14270 6e 64 65 66 20 54 63 6c 5f 49 6e 63 72 52 65 66 ndef Tcl_IncrRef
14280 43 6f 75 6e 74 0a 23 20 20 20 64 65 66 69 6e 65 Count.# define
14290 20 54 63 6c 5f 49 6e 63 72 52 65 66 43 6f 75 6e Tcl_IncrRefCoun
142a0 74 28 6f 62 6a 50 74 72 29 20 5c 0a 09 54 63 6c t(objPtr) \..Tcl
142b0 5f 44 62 49 6e 63 72 52 65 66 43 6f 75 6e 74 28 _DbIncrRefCount(
142c0 6f 62 6a 50 74 72 2c 20 5f 5f 46 49 4c 45 5f 5f objPtr, __FILE__
142d0 2c 20 5f 5f 4c 49 4e 45 5f 5f 29 0a 23 20 20 20 , __LINE__).#
142e0 75 6e 64 65 66 20 54 63 6c 5f 44 65 63 72 52 65 undef Tcl_DecrRe
142f0 66 43 6f 75 6e 74 0a 23 20 20 20 64 65 66 69 6e fCount.# defin
14300 65 20 54 63 6c 5f 44 65 63 72 52 65 66 43 6f 75 e Tcl_DecrRefCou
14310 6e 74 28 6f 62 6a 50 74 72 29 20 5c 0a 09 54 63 nt(objPtr) \..Tc
14320 6c 5f 44 62 44 65 63 72 52 65 66 43 6f 75 6e 74 l_DbDecrRefCount
14330 28 6f 62 6a 50 74 72 2c 20 5f 5f 46 49 4c 45 5f (objPtr, __FILE_
14340 5f 2c 20 5f 5f 4c 49 4e 45 5f 5f 29 0a 23 20 20 _, __LINE__).#
14350 20 75 6e 64 65 66 20 54 63 6c 5f 49 73 53 68 61 undef Tcl_IsSha
14360 72 65 64 0a 23 20 20 20 64 65 66 69 6e 65 20 54 red.# define T
14370 63 6c 5f 49 73 53 68 61 72 65 64 28 6f 62 6a 50 cl_IsShared(objP
14380 74 72 29 20 5c 0a 09 54 63 6c 5f 44 62 49 73 53 tr) \..Tcl_DbIsS
14390 68 61 72 65 64 28 6f 62 6a 50 74 72 2c 20 5f 5f hared(objPtr, __
143a0 46 49 4c 45 5f 5f 2c 20 5f 5f 4c 49 4e 45 5f 5f FILE__, __LINE__
143b0 29 0a 23 65 6c 73 65 0a 23 20 20 20 75 6e 64 65 ).#else.# unde
143c0 66 20 54 63 6c 5f 49 6e 63 72 52 65 66 43 6f 75 f Tcl_IncrRefCou
143d0 6e 74 0a 23 20 20 20 64 65 66 69 6e 65 20 54 63 nt.# define Tc
143e0 6c 5f 49 6e 63 72 52 65 66 43 6f 75 6e 74 28 6f l_IncrRefCount(o
143f0 62 6a 50 74 72 29 20 5c 0a 09 2b 2b 28 6f 62 6a bjPtr) \..++(obj
14400 50 74 72 29 2d 3e 72 65 66 43 6f 75 6e 74 0a 20 Ptr)->refCount.
14410 20 20 20 2f 2a 0a 20 20 20 20 20 2a 20 55 73 65 /*. * Use
14420 20 64 6f 2f 77 68 69 6c 65 30 20 69 64 69 6f 6d do/while0 idiom
14430 20 66 6f 72 20 6f 70 74 69 6d 75 6d 20 63 6f 72 for optimum cor
14440 72 65 63 74 6e 65 73 73 20 77 69 74 68 6f 75 74 rectness without
14450 20 63 6f 6d 70 69 6c 65 72 20 77 61 72 6e 69 6e compiler warnin
14460 67 73 2e 0a 20 20 20 20 20 2a 20 68 74 74 70 3a gs.. * http:
14470 2f 2f 63 32 2e 63 6f 6d 2f 63 67 69 2f 77 69 6b //c2.com/cgi/wik
14480 69 3f 54 72 69 76 69 61 6c 44 6f 57 68 69 6c 65 i?TrivialDoWhile
14490 4c 6f 6f 70 0a 20 20 20 20 20 2a 2f 0a 23 20 20 Loop. */.#
144a0 20 75 6e 64 65 66 20 54 63 6c 5f 44 65 63 72 52 undef Tcl_DecrR
144b0 65 66 43 6f 75 6e 74 0a 23 20 20 20 64 65 66 69 efCount.# defi
144c0 6e 65 20 54 63 6c 5f 44 65 63 72 52 65 66 43 6f ne Tcl_DecrRefCo
144d0 75 6e 74 28 6f 62 6a 50 74 72 29 20 5c 0a 09 64 unt(objPtr) \..d
144e0 6f 20 7b 20 5c 0a 09 20 20 20 20 54 63 6c 5f 4f o { \.. Tcl_O
144f0 62 6a 20 2a 5f 6f 62 6a 50 74 72 20 3d 20 28 6f bj *_objPtr = (o
14500 62 6a 50 74 72 29 3b 20 5c 0a 09 20 20 20 20 69 bjPtr); \.. i
14510 66 20 28 28 5f 6f 62 6a 50 74 72 29 2d 3e 72 65 f ((_objPtr)->re
14520 66 43 6f 75 6e 74 2d 2d 20 3c 3d 20 31 29 20 7b fCount-- <= 1) {
14530 20 5c 0a 09 09 54 63 6c 46 72 65 65 4f 62 6a 28 \...TclFreeObj(
14540 5f 6f 62 6a 50 74 72 29 3b 20 5c 0a 09 20 20 20 _objPtr); \..
14550 20 7d 20 5c 0a 09 7d 20 77 68 69 6c 65 28 30 29 } \..} while(0)
14560 0a 23 20 20 20 75 6e 64 65 66 20 54 63 6c 5f 49 .# undef Tcl_I
14570 73 53 68 61 72 65 64 0a 23 20 20 20 64 65 66 69 sShared.# defi
14580 6e 65 20 54 63 6c 5f 49 73 53 68 61 72 65 64 28 ne Tcl_IsShared(
14590 6f 62 6a 50 74 72 29 20 5c 0a 09 28 28 6f 62 6a objPtr) \..((obj
145a0 50 74 72 29 2d 3e 72 65 66 43 6f 75 6e 74 20 3e Ptr)->refCount >
145b0 20 31 29 0a 23 65 6e 64 69 66 0a 0a 2f 2a 0a 20 1).#endif../*.
145c0 2a 20 4d 61 63 72 6f 73 20 61 6e 64 20 64 65 66 * Macros and def
145d0 69 6e 69 74 69 6f 6e 73 20 74 68 61 74 20 68 65 initions that he
145e0 6c 70 20 74 6f 20 64 65 62 75 67 20 74 68 65 20 lp to debug the
145f0 75 73 65 20 6f 66 20 54 63 6c 20 6f 62 6a 65 63 use of Tcl objec
14600 74 73 2e 20 57 68 65 6e 0a 20 2a 20 54 43 4c 5f ts. When. * TCL_
14610 4d 45 4d 5f 44 45 42 55 47 20 69 73 20 64 65 66 MEM_DEBUG is def
14620 69 6e 65 64 2c 20 74 68 65 20 54 63 6c 5f 4e 65 ined, the Tcl_Ne
14630 77 20 64 65 63 6c 61 72 61 74 69 6f 6e 73 20 61 w declarations a
14640 72 65 20 6f 76 65 72 72 69 64 64 65 6e 20 74 6f re overridden to
14650 20 63 61 6c 6c 0a 20 2a 20 64 65 62 75 67 67 69 call. * debuggi
14660 6e 67 20 76 65 72 73 69 6f 6e 73 20 6f 66 20 74 ng versions of t
14670 68 65 20 6f 62 6a 65 63 74 20 63 72 65 61 74 69 he object creati
14680 6f 6e 20 66 75 6e 63 74 69 6f 6e 73 2e 0a 20 2a on functions.. *
14690 2f 0a 0a 23 69 66 64 65 66 20 54 43 4c 5f 4d 45 /..#ifdef TCL_ME
146a0 4d 5f 44 45 42 55 47 0a 23 20 20 75 6e 64 65 66 M_DEBUG.# undef
146b0 20 20 54 63 6c 5f 4e 65 77 42 69 67 6e 75 6d 4f Tcl_NewBignumO
146c0 62 6a 0a 23 20 20 64 65 66 69 6e 65 20 54 63 6c bj.# define Tcl
146d0 5f 4e 65 77 42 69 67 6e 75 6d 4f 62 6a 28 76 61 _NewBignumObj(va
146e0 6c 29 20 5c 0a 20 20 20 20 20 54 63 6c 5f 44 62 l) \. Tcl_Db
146f0 4e 65 77 42 69 67 6e 75 6d 4f 62 6a 28 76 61 6c NewBignumObj(val
14700 2c 20 5f 5f 46 49 4c 45 5f 5f 2c 20 5f 5f 4c 49 , __FILE__, __LI
14710 4e 45 5f 5f 29 0a 23 20 20 75 6e 64 65 66 20 20 NE__).# undef
14720 54 63 6c 5f 4e 65 77 42 6f 6f 6c 65 61 6e 4f 62 Tcl_NewBooleanOb
14730 6a 0a 23 20 20 64 65 66 69 6e 65 20 54 63 6c 5f j.# define Tcl_
14740 4e 65 77 42 6f 6f 6c 65 61 6e 4f 62 6a 28 76 61 NewBooleanObj(va
14750 6c 29 20 5c 0a 20 20 20 20 20 54 63 6c 5f 44 62 l) \. Tcl_Db
14760 4e 65 77 57 69 64 65 49 6e 74 4f 62 6a 28 28 76 NewWideIntObj((v
14770 61 6c 29 21 3d 30 2c 20 5f 5f 46 49 4c 45 5f 5f al)!=0, __FILE__
14780 2c 20 5f 5f 4c 49 4e 45 5f 5f 29 0a 23 20 20 75 , __LINE__).# u
14790 6e 64 65 66 20 20 54 63 6c 5f 4e 65 77 42 79 74 ndef Tcl_NewByt
147a0 65 41 72 72 61 79 4f 62 6a 0a 23 20 20 64 65 66 eArrayObj.# def
147b0 69 6e 65 20 54 63 6c 5f 4e 65 77 42 79 74 65 41 ine Tcl_NewByteA
147c0 72 72 61 79 4f 62 6a 28 62 79 74 65 73 2c 20 6c rrayObj(bytes, l
147d0 65 6e 29 20 5c 0a 20 20 20 20 20 54 63 6c 5f 44 en) \. Tcl_D
147e0 62 4e 65 77 42 79 74 65 41 72 72 61 79 4f 62 6a bNewByteArrayObj
147f0 28 62 79 74 65 73 2c 20 6c 65 6e 2c 20 5f 5f 46 (bytes, len, __F
14800 49 4c 45 5f 5f 2c 20 5f 5f 4c 49 4e 45 5f 5f 29 ILE__, __LINE__)
14810 0a 23 20 20 75 6e 64 65 66 20 20 54 63 6c 5f 4e .# undef Tcl_N
14820 65 77 44 6f 75 62 6c 65 4f 62 6a 0a 23 20 20 64 ewDoubleObj.# d
14830 65 66 69 6e 65 20 54 63 6c 5f 4e 65 77 44 6f 75 efine Tcl_NewDou
14840 62 6c 65 4f 62 6a 28 76 61 6c 29 20 5c 0a 20 20 bleObj(val) \.
14850 20 20 20 54 63 6c 5f 44 62 4e 65 77 44 6f 75 62 Tcl_DbNewDoub
14860 6c 65 4f 62 6a 28 76 61 6c 2c 20 5f 5f 46 49 4c leObj(val, __FIL
14870 45 5f 5f 2c 20 5f 5f 4c 49 4e 45 5f 5f 29 0a 23 E__, __LINE__).#
14880 20 20 75 6e 64 65 66 20 20 54 63 6c 5f 4e 65 77 undef Tcl_New
14890 4c 69 73 74 4f 62 6a 0a 23 20 20 64 65 66 69 6e ListObj.# defin
148a0 65 20 54 63 6c 5f 4e 65 77 4c 69 73 74 4f 62 6a e Tcl_NewListObj
148b0 28 6f 62 6a 63 2c 20 6f 62 6a 76 29 20 5c 0a 20 (objc, objv) \.
148c0 20 20 20 20 54 63 6c 5f 44 62 4e 65 77 4c 69 73 Tcl_DbNewLis
148d0 74 4f 62 6a 28 6f 62 6a 63 2c 20 6f 62 6a 76 2c tObj(objc, objv,
148e0 20 5f 5f 46 49 4c 45 5f 5f 2c 20 5f 5f 4c 49 4e __FILE__, __LIN
148f0 45 5f 5f 29 0a 23 20 20 75 6e 64 65 66 20 20 54 E__).# undef T
14900 63 6c 5f 4e 65 77 4f 62 6a 0a 23 20 20 64 65 66 cl_NewObj.# def
14910 69 6e 65 20 54 63 6c 5f 4e 65 77 4f 62 6a 28 29 ine Tcl_NewObj()
14920 20 5c 0a 20 20 20 20 20 54 63 6c 5f 44 62 4e 65 \. Tcl_DbNe
14930 77 4f 62 6a 28 5f 5f 46 49 4c 45 5f 5f 2c 20 5f wObj(__FILE__, _
14940 5f 4c 49 4e 45 5f 5f 29 0a 23 20 20 75 6e 64 65 _LINE__).# unde
14950 66 20 20 54 63 6c 5f 4e 65 77 53 74 72 69 6e 67 f Tcl_NewString
14960 4f 62 6a 0a 23 20 20 64 65 66 69 6e 65 20 54 63 Obj.# define Tc
14970 6c 5f 4e 65 77 53 74 72 69 6e 67 4f 62 6a 28 62 l_NewStringObj(b
14980 79 74 65 73 2c 20 6c 65 6e 29 20 5c 0a 20 20 20 ytes, len) \.
14990 20 20 54 63 6c 5f 44 62 4e 65 77 53 74 72 69 6e Tcl_DbNewStrin
149a0 67 4f 62 6a 28 62 79 74 65 73 2c 20 6c 65 6e 2c gObj(bytes, len,
149b0 20 5f 5f 46 49 4c 45 5f 5f 2c 20 5f 5f 4c 49 4e __FILE__, __LIN
149c0 45 5f 5f 29 0a 23 20 20 75 6e 64 65 66 20 20 54 E__).# undef T
149d0 63 6c 5f 4e 65 77 57 69 64 65 49 6e 74 4f 62 6a cl_NewWideIntObj
149e0 0a 23 20 20 64 65 66 69 6e 65 20 54 63 6c 5f 4e .# define Tcl_N
149f0 65 77 57 69 64 65 49 6e 74 4f 62 6a 28 76 61 6c ewWideIntObj(val
14a00 29 20 5c 0a 20 20 20 20 20 54 63 6c 5f 44 62 4e ) \. Tcl_DbN
14a10 65 77 57 69 64 65 49 6e 74 4f 62 6a 28 76 61 6c ewWideIntObj(val
14a20 2c 20 5f 5f 46 49 4c 45 5f 5f 2c 20 5f 5f 4c 49 , __FILE__, __LI
14a30 4e 45 5f 5f 29 0a 23 65 6e 64 69 66 20 2f 2a 20 NE__).#endif /*
14a40 54 43 4c 5f 4d 45 4d 5f 44 45 42 55 47 20 2a 2f TCL_MEM_DEBUG */
14a50 0a 0a 2f 2a 0a 20 2a 2d 2d 2d 2d 2d 2d 2d 2d 2d ../*. *---------
14a60 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
14a70 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
14a80 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
14a90 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
14aa0 2d 2d 2d 0a 20 2a 20 4d 61 63 72 6f 73 20 66 6f ---. * Macros fo
14ab0 72 20 63 6c 69 65 6e 74 73 20 74 6f 20 75 73 65 r clients to use
14ac0 20 74 6f 20 61 63 63 65 73 73 20 66 69 65 6c 64 to access field
14ad0 73 20 6f 66 20 68 61 73 68 20 65 6e 74 72 69 65 s of hash entrie
14ae0 73 3a 0a 20 2a 2f 0a 0a 23 64 65 66 69 6e 65 20 s:. */..#define
14af0 54 63 6c 5f 47 65 74 48 61 73 68 56 61 6c 75 65 Tcl_GetHashValue
14b00 28 68 29 20 28 28 68 29 2d 3e 63 6c 69 65 6e 74 (h) ((h)->client
14b10 44 61 74 61 29 0a 23 64 65 66 69 6e 65 20 54 63 Data).#define Tc
14b20 6c 5f 53 65 74 48 61 73 68 56 61 6c 75 65 28 68 l_SetHashValue(h
14b30 2c 20 76 61 6c 75 65 29 20 28 28 68 29 2d 3e 63 , value) ((h)->c
14b40 6c 69 65 6e 74 44 61 74 61 20 3d 20 28 76 6f 69 lientData = (voi
14b50 64 20 2a 29 20 28 76 61 6c 75 65 29 29 0a 23 64 d *) (value)).#d
14b60 65 66 69 6e 65 20 54 63 6c 5f 47 65 74 48 61 73 efine Tcl_GetHas
14b70 68 4b 65 79 28 74 61 62 6c 65 50 74 72 2c 20 68 hKey(tablePtr, h
14b80 29 20 5c 0a 09 28 28 76 6f 69 64 20 2a 29 20 28 ) \..((void *) (
14b90 28 28 74 61 62 6c 65 50 74 72 29 2d 3e 6b 65 79 ((tablePtr)->key
14ba0 54 79 70 65 20 3d 3d 20 54 43 4c 5f 4f 4e 45 5f Type == TCL_ONE_
14bb0 57 4f 52 44 5f 4b 45 59 53 20 7c 7c 20 5c 0a 09 WORD_KEYS || \..
14bc0 09 20 20 20 20 28 74 61 62 6c 65 50 74 72 29 2d . (tablePtr)-
14bd0 3e 6b 65 79 54 79 70 65 20 3d 3d 20 54 43 4c 5f >keyType == TCL_
14be0 43 55 53 54 4f 4d 5f 50 54 52 5f 4b 45 59 53 29 CUSTOM_PTR_KEYS)
14bf0 20 5c 0a 09 09 20 20 20 3f 20 28 68 29 2d 3e 6b \... ? (h)->k
14c00 65 79 2e 6f 6e 65 57 6f 72 64 56 61 6c 75 65 20 ey.oneWordValue
14c10 5c 0a 09 09 20 20 20 3a 20 28 68 29 2d 3e 6b 65 \... : (h)->ke
14c20 79 2e 73 74 72 69 6e 67 29 29 0a 0a 2f 2a 0a 20 y.string))../*.
14c30 2a 20 4d 61 63 72 6f 73 20 74 6f 20 75 73 65 20 * Macros to use
14c40 66 6f 72 20 63 6c 69 65 6e 74 73 20 74 6f 20 75 for clients to u
14c50 73 65 20 74 6f 20 69 6e 76 6f 6b 65 20 66 69 6e se to invoke fin
14c60 64 20 61 6e 64 20 63 72 65 61 74 65 20 66 75 6e d and create fun
14c70 63 74 69 6f 6e 73 20 66 6f 72 0a 20 2a 20 68 61 ctions for. * ha
14c80 73 68 20 74 61 62 6c 65 73 3a 0a 20 2a 2f 0a 0a sh tables:. */..
14c90 23 64 65 66 69 6e 65 20 54 63 6c 5f 46 69 6e 64 #define Tcl_Find
14ca0 48 61 73 68 45 6e 74 72 79 28 74 61 62 6c 65 50 HashEntry(tableP
14cb0 74 72 2c 20 6b 65 79 29 20 5c 0a 09 28 2a 28 28 tr, key) \..(*((
14cc0 74 61 62 6c 65 50 74 72 29 2d 3e 66 69 6e 64 50 tablePtr)->findP
14cd0 72 6f 63 29 29 28 74 61 62 6c 65 50 74 72 2c 20 roc))(tablePtr,
14ce0 28 63 6f 6e 73 74 20 63 68 61 72 20 2a 29 28 6b (const char *)(k
14cf0 65 79 29 29 0a 23 64 65 66 69 6e 65 20 54 63 6c ey)).#define Tcl
14d00 5f 43 72 65 61 74 65 48 61 73 68 45 6e 74 72 79 _CreateHashEntry
14d10 28 74 61 62 6c 65 50 74 72 2c 20 6b 65 79 2c 20 (tablePtr, key,
14d20 6e 65 77 50 74 72 29 20 5c 0a 09 28 2a 28 28 74 newPtr) \..(*((t
14d30 61 62 6c 65 50 74 72 29 2d 3e 63 72 65 61 74 65 ablePtr)->create
14d40 50 72 6f 63 29 29 28 74 61 62 6c 65 50 74 72 2c Proc))(tablePtr,
14d50 20 28 63 6f 6e 73 74 20 63 68 61 72 20 2a 29 28 (const char *)(
14d60 6b 65 79 29 2c 20 6e 65 77 50 74 72 29 0a 0a 23 key), newPtr)..#
14d70 65 6e 64 69 66 20 2f 2a 20 52 43 5f 49 4e 56 4f endif /* RC_INVO
14d80 4b 45 44 20 2a 2f 0a 0a 2f 2a 0a 20 2a 20 65 6e KED */../*. * en
14d90 64 20 62 6c 6f 63 6b 20 66 6f 72 20 43 2b 2b 0a d block for C++.
14da0 20 2a 2f 0a 0a 23 69 66 64 65 66 20 5f 5f 63 70 */..#ifdef __cp
14db0 6c 75 73 70 6c 75 73 0a 7d 0a 23 65 6e 64 69 66 lusplus.}.#endif
14dc0 0a 0a 23 65 6e 64 69 66 20 2f 2a 20 5f 54 43 4c ..#endif /* _TCL
14dd0 20 2a 2f 0a 0c 0a 2f 2a 0a 20 2a 20 4c 6f 63 61 */.../*. * Loca
14de0 6c 20 56 61 72 69 61 62 6c 65 73 3a 0a 20 2a 20 l Variables:. *
14df0 6d 6f 64 65 3a 20 63 0a 20 2a 20 63 2d 62 61 73 mode: c. * c-bas
14e00 69 63 2d 6f 66 66 73 65 74 3a 20 34 0a 20 2a 20 ic-offset: 4. *
14e10 66 69 6c 6c 2d 63 6f 6c 75 6d 6e 3a 20 37 38 0a fill-column: 78.
14e20 20 2a 20 45 6e 64 3a 0a 20 2a 2f 0a * End:. */.