1/* 2 * tcl.h -- 3 * 4 * This header file describes the externally-visible facilities 5 * of the Tcl interpreter. 6 * 7 * Copyright (c) 1987-1994 The Regents of the University of California. 8 * Copyright (c) 1993-1996 Lucent Technologies. 9 * Copyright (c) 1994-1998 Sun Microsystems, Inc. 10 * Copyright (c) 1998 by Scriptics Corporation. 11 * 12 * See the file "license.terms" for information on usage and redistribution 13 * of this file, and for a DISCLAIMER OF ALL WARRANTIES. 14 * 15 * RCS: @(#) $Id: tcl.h.orig,v 1.1 1998/12/23 21:16:57 aku Exp $ 16 */ 17 18#ifndef _TCL 19#define _TCL 20 21/* 22 * When version numbers change here, must also go into the following files 23 * and update the version numbers: 24 * 25 * README 26 * library/init.tcl (only if major.minor changes, not patchlevel) 27 * unix/configure.in 28 * win/makefile.bc (only if major.minor changes, not patchlevel) 29 * win/makefile.vc (only if major.minor changes, not patchlevel) 30 * win/pkgIndex.tcl (for tclregNN.dll) 31 * README 32 * mac/README 33 * win/README 34 * win/README.binary 35 * unix/README 36 * 37 * The release level should be 0 for alpha, 1 for beta, and 2 for 38 * final/patch. The release serial value is the number that follows the 39 * "a", "b", or "p" in the patch level; for example, if the patch level 40 * is 7.6b2, TCL_RELEASE_SERIAL is 2. It restarts at 1 whenever the 41 * release level is changed, except for the final release which is 0 42 * (the first patch will start at 1). 43 */ 44 45#define TCL_MAJOR_VERSION 8 46#define TCL_MINOR_VERSION 1 47#define TCL_RELEASE_LEVEL 1 48#define TCL_RELEASE_SERIAL 1 49 50#define TCL_VERSION "8.1" 51#define TCL_PATCH_LEVEL "8.1b1" 52 53/* 54 * The following definitions set up the proper options for Windows 55 * compilers. We use this method because there is no autoconf equivalent. 56 */ 57 58#ifndef __WIN32__ 59# if defined(_WIN32) || defined(WIN32) 60# define __WIN32__ 61# endif 62#endif 63 64#ifdef __WIN32__ 65# ifndef STRICT 66# define STRICT 67# endif 68# ifndef USE_PROTOTYPE 69# define USE_PROTOTYPE 1 70# endif 71# ifndef HAS_STDARG 72# define HAS_STDARG 1 73# endif 74# ifndef USE_PROTOTYPE 75# define USE_PROTOTYPE 1 76# endif 77# ifndef USE_TCLALLOC 78# define USE_TCLALLOC 1 79# endif 80#endif /* __WIN32__ */ 81 82/* 83 * The following definitions set up the proper options for Macintosh 84 * compilers. We use this method because there is no autoconf equivalent. 85 */ 86 87#ifdef MAC_TCL 88# ifndef HAS_STDARG 89# define HAS_STDARG 1 90# endif 91# ifndef USE_TCLALLOC 92# define USE_TCLALLOC 1 93# endif 94# ifndef NO_STRERROR 95# define NO_STRERROR 1 96# endif 97# define INLINE 98#endif 99 100/* 101 * Utility macros: STRINGIFY takes an argument and wraps it in "" (double 102 * quotation marks), JOIN joins two arguments. 103 */ 104 105#define VERBATIM(x) x 106#ifdef _MSC_VER 107# define STRINGIFY(x) STRINGIFY1(x) 108# define STRINGIFY1(x) #x 109# define JOIN(a,b) JOIN1(a,b) 110# define JOIN1(a,b) a##b 111#else 112# ifdef RESOURCE_INCLUDED 113# define STRINGIFY(x) STRINGIFY1(x) 114# define STRINGIFY1(x) #x 115# define JOIN(a,b) JOIN1(a,b) 116# define JOIN1(a,b) a##b 117# else 118# ifdef __STDC__ 119# define STRINGIFY(x) #x 120# define JOIN(a,b) a##b 121# else 122# define STRINGIFY(x) "x" 123# define JOIN(a,b) VERBATIM(a)VERBATIM(b) 124# endif 125# endif 126#endif 127 128/* 129 * A special definition used to allow this header file to be included 130 * in resource files so that they can get obtain version information from 131 * this file. Resource compilers don't like all the C stuff, like typedefs 132 * and procedure declarations, that occur below. 133 */ 134 135#ifndef RESOURCE_INCLUDED 136 137#ifndef BUFSIZ 138#include <stdio.h> 139#endif 140 141/* 142 * Definitions that allow Tcl functions with variable numbers of 143 * arguments to be used with either varargs.h or stdarg.h. TCL_VARARGS 144 * is used in procedure prototypes. TCL_VARARGS_DEF is used to declare 145 * the arguments in a function definiton: it takes the type and name of 146 * the first argument and supplies the appropriate argument declaration 147 * string for use in the function definition. TCL_VARARGS_START 148 * initializes the va_list data structure and returns the first argument. 149 */ 150 151#if defined(__STDC__) || defined(HAS_STDARG) 152# define TCL_VARARGS(type, name) (type name, ...) 153# define TCL_VARARGS_DEF(type, name) (type name, ...) 154# define TCL_VARARGS_START(type, name, list) (va_start(list, name), name) 155#else 156# ifdef __cplusplus 157# define TCL_VARARGS(type, name) (type name, ...) 158# define TCL_VARARGS_DEF(type, name) (type va_alist, ...) 159# else 160# define TCL_VARARGS(type, name) () 161# define TCL_VARARGS_DEF(type, name) (va_alist) 162# endif 163# define TCL_VARARGS_START(type, name, list) \ 164 (va_start(list), va_arg(list, type)) 165#endif 166 167/* 168 * Macros used to declare a function to be exported by a DLL. 169 * Used by Windows, maps to no-op declarations on non-Windows systems. 170 * The default build on windows is for a DLL, which causes the DLLIMPORT 171 * and DLLEXPORT macros to be nonempty. To build a static library, the 172 * macro STATIC_BUILD should be defined. 173 * The support follows the convention that a macro called BUILD_xxxx, where 174 * xxxx is the name of a library we are building, is set on the compile line 175 * for sources that are to be placed in the library. See BUILD_tcl in this 176 * file for an example of how the macro is to be used. 177 */ 178 179#ifdef __WIN32__ 180# ifdef STATIC_BUILD 181# define DLLIMPORT 182# define DLLEXPORT 183# else 184# ifdef _MSC_VER 185# define DLLIMPORT __declspec(dllimport) 186# define DLLEXPORT __declspec(dllexport) 187# else 188# define DLLIMPORT 189# define DLLEXPORT 190# endif 191# endif 192#else 193# define DLLIMPORT 194# define DLLEXPORT 195#endif 196 197#ifdef TCL_STORAGE_CLASS 198# undef TCL_STORAGE_CLASS 199#endif 200#ifdef BUILD_tcl 201# define TCL_STORAGE_CLASS DLLEXPORT 202#else 203# define TCL_STORAGE_CLASS DLLIMPORT 204#endif 205 206/* 207 * Definitions that allow this header file to be used either with or 208 * without ANSI C features like function prototypes. 209 */ 210 211#undef _ANSI_ARGS_ 212#undef CONST 213#ifndef INLINE 214# define INLINE 215#endif 216 217#if ((defined(__STDC__) || defined(SABER)) && !defined(NO_PROTOTYPE)) || defined(__cplusplus) || defined(USE_PROTOTYPE) 218# define _USING_PROTOTYPES_ 1 219# define _ANSI_ARGS_(x) x 220# define CONST const 221#else 222# define _ANSI_ARGS_(x) () 223# define CONST 224#endif 225 226#ifdef __cplusplus 227# define EXTERN extern "C" TCL_STORAGE_CLASS 228#else 229# define EXTERN extern TCL_STORAGE_CLASS 230#endif 231 232/* 233 * Macro to use instead of "void" for arguments that must have 234 * type "void *" in ANSI C; maps them to type "char *" in 235 * non-ANSI systems. 236 */ 237#ifndef __WIN32__ 238#ifndef VOID 239# ifdef __STDC__ 240# define VOID void 241# else 242# define VOID char 243# endif 244#endif 245#else /* __WIN32__ */ 246/* 247 * The following code is copied from winnt.h 248 */ 249#ifndef VOID 250#define VOID void 251typedef char CHAR; 252typedef short SHORT; 253typedef long LONG; 254#endif 255#endif /* __WIN32__ */ 256 257/* 258 * Miscellaneous declarations. 259 */ 260 261#ifndef NULL 262#define NULL 0 263#endif 264 265#ifndef _CLIENTDATA 266# if defined(__STDC__) || defined(__cplusplus) 267 typedef void *ClientData; 268# else 269 typedef int *ClientData; 270# endif /* __STDC__ */ 271#define _CLIENTDATA 272#endif 273 274/* 275 * Data structures defined opaquely in this module. The definitions below 276 * just provide dummy types. A few fields are made visible in Tcl_Interp 277 * structures, namely those used for returning a string result from 278 * commands. Direct access to the result field is discouraged in Tcl 8.0. 279 * The interpreter result is either an object or a string, and the two 280 * values are kept consistent unless some C code sets interp->result 281 * directly. Programmers should use either the procedure Tcl_GetObjResult() 282 * or Tcl_GetStringResult() to read the interpreter's result. See the 283 * SetResult man page for details. 284 * 285 * Note: any change to the Tcl_Interp definition below must be mirrored 286 * in the "real" definition in tclInt.h. 287 * 288 * Note: Tcl_ObjCmdProc procedures do not directly set result and freeProc. 289 * Instead, they set a Tcl_Obj member in the "real" structure that can be 290 * accessed with Tcl_GetObjResult() and Tcl_SetObjResult(). 291 */ 292 293typedef struct Tcl_Interp { 294 char *result; /* If the last command returned a string 295 * result, this points to it. */ 296 void (*freeProc) _ANSI_ARGS_((char *blockPtr)); 297 /* Zero means the string result is 298 * statically allocated. TCL_DYNAMIC means 299 * it was allocated with ckalloc and should 300 * be freed with ckfree. Other values give 301 * the address of procedure to invoke to 302 * free the result. Tcl_Eval must free it 303 * before executing next command. */ 304 int errorLine; /* When TCL_ERROR is returned, this gives 305 * the line number within the command where 306 * the error occurred (1 if first line). */ 307} Tcl_Interp; 308 309typedef struct Tcl_AsyncHandler_ *Tcl_AsyncHandler; 310typedef struct Tcl_Channel_ *Tcl_Channel; 311typedef struct Tcl_Command_ *Tcl_Command; 312typedef struct Tcl_Condition_ *Tcl_Condition; 313typedef struct Tcl_EncodingState_ *Tcl_EncodingState; 314typedef struct Tcl_Encoding_ *Tcl_Encoding; 315typedef struct Tcl_Event Tcl_Event; 316typedef struct Tcl_Mutex_ *Tcl_Mutex; 317typedef struct Tcl_Pid_ *Tcl_Pid; 318typedef struct Tcl_RegExp_ *Tcl_RegExp; 319typedef struct Tcl_ThreadDataKey_ *Tcl_ThreadDataKey; 320typedef struct Tcl_ThreadId_ *Tcl_ThreadId; 321typedef struct Tcl_TimerToken_ *Tcl_TimerToken; 322typedef struct Tcl_Trace_ *Tcl_Trace; 323typedef struct Tcl_Var_ *Tcl_Var; 324 325/* 326 * When a TCL command returns, the interpreter contains a result from the 327 * command. Programmers are strongly encouraged to use one of the 328 * procedures Tcl_GetObjResult() or Tcl_GetStringResult() to read the 329 * interpreter's result. See the SetResult man page for details. Besides 330 * this result, the command procedure returns an integer code, which is 331 * one of the following: 332 * 333 * TCL_OK Command completed normally; the interpreter's 334 * result contains the command's result. 335 * TCL_ERROR The command couldn't be completed successfully; 336 * the interpreter's result describes what went wrong. 337 * TCL_RETURN The command requests that the current procedure 338 * return; the interpreter's result contains the 339 * procedure's return value. 340 * TCL_BREAK The command requests that the innermost loop 341 * be exited; the interpreter's result is meaningless. 342 * TCL_CONTINUE Go on to the next iteration of the current loop; 343 * the interpreter's result is meaningless. 344 */ 345 346#define TCL_OK 0 347#define TCL_ERROR 1 348#define TCL_RETURN 2 349#define TCL_BREAK 3 350#define TCL_CONTINUE 4 351 352#define TCL_RESULT_SIZE 200 353 354/* 355 * Argument descriptors for math function callbacks in expressions: 356 */ 357 358typedef enum {TCL_INT, TCL_DOUBLE, TCL_EITHER} Tcl_ValueType; 359typedef struct Tcl_Value { 360 Tcl_ValueType type; /* Indicates intValue or doubleValue is 361 * valid, or both. */ 362 long intValue; /* Integer value. */ 363 double doubleValue; /* Double-precision floating value. */ 364} Tcl_Value; 365 366/* 367 * Forward declaration of Tcl_Obj to prevent an error when the forward 368 * reference to Tcl_Obj is encountered in the procedure types declared 369 * below. 370 */ 371 372struct Tcl_Obj; 373 374/* 375 * Procedure types defined by Tcl: 376 */ 377 378typedef int (Tcl_AppInitProc) _ANSI_ARGS_((Tcl_Interp *interp)); 379typedef int (Tcl_AsyncProc) _ANSI_ARGS_((ClientData clientData, 380 Tcl_Interp *interp, int code)); 381typedef void (Tcl_ChannelProc) _ANSI_ARGS_((ClientData clientData, int mask)); 382typedef void (Tcl_CloseProc) _ANSI_ARGS_((ClientData data)); 383typedef void (Tcl_CmdDeleteProc) _ANSI_ARGS_((ClientData clientData)); 384typedef int (Tcl_CmdProc) _ANSI_ARGS_((ClientData clientData, 385 Tcl_Interp *interp, int argc, char *argv[])); 386typedef void (Tcl_CmdTraceProc) _ANSI_ARGS_((ClientData clientData, 387 Tcl_Interp *interp, int level, char *command, Tcl_CmdProc *proc, 388 ClientData cmdClientData, int argc, char *argv[])); 389typedef void (Tcl_DupInternalRepProc) _ANSI_ARGS_((struct Tcl_Obj *srcPtr, 390 struct Tcl_Obj *dupPtr)); 391typedef int (Tcl_EncodingConvertProc)_ANSI_ARGS_((ClientData clientData, 392 CONST char *src, int srcLen, int flags, Tcl_EncodingState *statePtr, 393 char *dst, int dstLen, int *srcReadPtr, int *dstWrotePtr, 394 int *dstCharsPtr)); 395typedef void (Tcl_EncodingFreeProc)_ANSI_ARGS_((ClientData clientData)); 396typedef int (Tcl_EventProc) _ANSI_ARGS_((Tcl_Event *evPtr, int flags)); 397typedef void (Tcl_EventCheckProc) _ANSI_ARGS_((ClientData clientData, 398 int flags)); 399typedef int (Tcl_EventDeleteProc) _ANSI_ARGS_((Tcl_Event *evPtr, 400 ClientData clientData)); 401typedef void (Tcl_EventSetupProc) _ANSI_ARGS_((ClientData clientData, 402 int flags)); 403typedef void (Tcl_ExitProc) _ANSI_ARGS_((ClientData clientData)); 404typedef void (Tcl_FileProc) _ANSI_ARGS_((ClientData clientData, int mask)); 405typedef void (Tcl_FileFreeProc) _ANSI_ARGS_((ClientData clientData)); 406typedef void (Tcl_FreeInternalRepProc) _ANSI_ARGS_((struct Tcl_Obj *objPtr)); 407typedef void (Tcl_FreeProc) _ANSI_ARGS_((char *blockPtr)); 408typedef void (Tcl_IdleProc) _ANSI_ARGS_((ClientData clientData)); 409typedef void (Tcl_InterpDeleteProc) _ANSI_ARGS_((ClientData clientData, 410 Tcl_Interp *interp)); 411typedef int (Tcl_MathProc) _ANSI_ARGS_((ClientData clientData, 412 Tcl_Interp *interp, Tcl_Value *args, Tcl_Value *resultPtr)); 413typedef void (Tcl_NamespaceDeleteProc) _ANSI_ARGS_((ClientData clientData)); 414typedef int (Tcl_ObjCmdProc) _ANSI_ARGS_((ClientData clientData, 415 Tcl_Interp *interp, int objc, struct Tcl_Obj *CONST objv[])); 416typedef int (Tcl_PackageInitProc) _ANSI_ARGS_((Tcl_Interp *interp)); 417typedef void (Tcl_TcpAcceptProc) _ANSI_ARGS_((ClientData callbackData, 418 Tcl_Channel chan, char *address, int port)); 419typedef void (Tcl_TimerProc) _ANSI_ARGS_((ClientData clientData)); 420typedef int (Tcl_SetFromAnyProc) _ANSI_ARGS_((Tcl_Interp *interp, 421 struct Tcl_Obj *objPtr)); 422typedef void (Tcl_UpdateStringProc) _ANSI_ARGS_((struct Tcl_Obj *objPtr)); 423typedef char *(Tcl_VarTraceProc) _ANSI_ARGS_((ClientData clientData, 424 Tcl_Interp *interp, char *part1, char *part2, int flags)); 425 426/* 427 * The following structure represents a type of object, which is a 428 * particular internal representation for an object plus a set of 429 * procedures that provide standard operations on objects of that type. 430 */ 431 432typedef struct Tcl_ObjType { 433 char *name; /* Name of the type, e.g. "int". */ 434 Tcl_FreeInternalRepProc *freeIntRepProc; 435 /* Called to free any storage for the type's 436 * internal rep. NULL if the internal rep 437 * does not need freeing. */ 438 Tcl_DupInternalRepProc *dupIntRepProc; 439 /* Called to create a new object as a copy 440 * of an existing object. */ 441 Tcl_UpdateStringProc *updateStringProc; 442 /* Called to update the string rep from the 443 * type's internal representation. */ 444 Tcl_SetFromAnyProc *setFromAnyProc; 445 /* Called to convert the object's internal 446 * rep to this type. Frees the internal rep 447 * of the old type. Returns TCL_ERROR on 448 * failure. */ 449} Tcl_ObjType; 450 451/* 452 * One of the following structures exists for each object in the Tcl 453 * system. An object stores a value as either a string, some internal 454 * representation, or both. 455 */ 456 457typedef struct Tcl_Obj { 458 int refCount; /* When 0 the object will be freed. */ 459 char *bytes; /* This points to the first byte of the 460 * object's string representation. The array 461 * must be followed by a null byte (i.e., at 462 * offset length) but may also contain 463 * embedded null characters. The array's 464 * storage is allocated by ckalloc. NULL 465 * means the string rep is invalid and must 466 * be regenerated from the internal rep. 467 * Clients should use Tcl_GetStringFromObj 468 * or Tcl_GetString to get a pointer to the 469 * byte array as a readonly value. */ 470 int length; /* The number of bytes at *bytes, not 471 * including the terminating null. */ 472 Tcl_ObjType *typePtr; /* Denotes the object's type. Always 473 * corresponds to the type of the object's 474 * internal rep. NULL indicates the object 475 * has no internal rep (has no type). */ 476 union { /* The internal representation: */ 477 long longValue; /* - an long integer value */ 478 double doubleValue; /* - a double-precision floating value */ 479 VOID *otherValuePtr; /* - another, type-specific value */ 480 struct { /* - internal rep as two pointers */ 481 VOID *ptr1; 482 VOID *ptr2; 483 } twoPtrValue; 484 } internalRep; 485} Tcl_Obj; 486 487/* 488 * Macros to increment and decrement a Tcl_Obj's reference count, and to 489 * test whether an object is shared (i.e. has reference count > 1). 490 * Note: clients should use Tcl_DecrRefCount() when they are finished using 491 * an object, and should never call TclFreeObj() directly. TclFreeObj() is 492 * only defined and made public in tcl.h to support Tcl_DecrRefCount's macro 493 * definition. Note also that Tcl_DecrRefCount() refers to the parameter 494 * "obj" twice. This means that you should avoid calling it with an 495 * expression that is expensive to compute or has side effects. 496 */ 497 498EXTERN void Tcl_IncrRefCount _ANSI_ARGS_((Tcl_Obj *objPtr)); 499EXTERN void Tcl_DecrRefCount _ANSI_ARGS_((Tcl_Obj *objPtr)); 500EXTERN int Tcl_IsShared _ANSI_ARGS_((Tcl_Obj *objPtr)); 501 502#ifdef TCL_MEM_DEBUG 503# define Tcl_IncrRefCount(objPtr) \ 504 Tcl_DbIncrRefCount(objPtr, __FILE__, __LINE__) 505# define Tcl_DecrRefCount(objPtr) \ 506 Tcl_DbDecrRefCount(objPtr, __FILE__, __LINE__) 507# define Tcl_IsShared(objPtr) \ 508 Tcl_DbIsShared(objPtr, __FILE__, __LINE__) 509#else 510# define Tcl_IncrRefCount(objPtr) \ 511 ++(objPtr)->refCount 512# define Tcl_DecrRefCount(objPtr) \ 513 if (--(objPtr)->refCount <= 0) TclFreeObj(objPtr) 514# define Tcl_IsShared(objPtr) \ 515 ((objPtr)->refCount > 1) 516#endif 517 518/* 519 * Macros and definitions that help to debug the use of Tcl objects. 520 * When TCL_MEM_DEBUG is defined, the Tcl_New* declarations are 521 * overridden to call debugging versions of the object creation procedures. 522 */ 523 524EXTERN Tcl_Obj * Tcl_NewBooleanObj _ANSI_ARGS_((int boolValue)); 525EXTERN Tcl_Obj * Tcl_NewByteArrayObj _ANSI_ARGS_((unsigned char *bytes, 526 int length)); 527EXTERN Tcl_Obj * Tcl_NewDoubleObj _ANSI_ARGS_((double doubleValue)); 528EXTERN Tcl_Obj * Tcl_NewIntObj _ANSI_ARGS_((int intValue)); 529EXTERN Tcl_Obj * Tcl_NewListObj _ANSI_ARGS_((int objc, 530 Tcl_Obj *CONST objv[])); 531EXTERN Tcl_Obj * Tcl_NewLongObj _ANSI_ARGS_((long longValue)); 532EXTERN Tcl_Obj * Tcl_NewObj _ANSI_ARGS_((void)); 533EXTERN Tcl_Obj * Tcl_NewStringObj _ANSI_ARGS_((CONST char *bytes, 534 int length)); 535 536#ifdef TCL_MEM_DEBUG 537# define Tcl_NewBooleanObj(val) \ 538 Tcl_DbNewBooleanObj(val, __FILE__, __LINE__) 539# define Tcl_NewDoubleObj(val) \ 540 Tcl_DbNewDoubleObj(val, __FILE__, __LINE__) 541# define Tcl_NewIntObj(val) \ 542 Tcl_DbNewLongObj(val, __FILE__, __LINE__) 543# define Tcl_NewListObj(objc, objv) \ 544 Tcl_DbNewListObj(objc, objv, __FILE__, __LINE__) 545# define Tcl_NewLongObj(val) \ 546 Tcl_DbNewLongObj(val, __FILE__, __LINE__) 547# define Tcl_NewObj() \ 548 Tcl_DbNewObj(__FILE__, __LINE__) 549# define Tcl_NewStringObj(bytes, len) \ 550 Tcl_DbNewStringObj(bytes, len, __FILE__, __LINE__) 551#endif /* TCL_MEM_DEBUG */ 552 553/* 554 * The following structure contains the state needed by 555 * Tcl_SaveResult. No-one outside of Tcl should access any of these 556 * fields. This structure is typically allocated on the stack. 557 */ 558 559typedef struct Tcl_SavedResult { 560 char *result; 561 Tcl_FreeProc *freeProc; 562 Tcl_Obj *objResultPtr; 563 char *appendResult; 564 int appendAvl; 565 int appendUsed; 566 char resultSpace[TCL_RESULT_SIZE+1]; 567} Tcl_SavedResult; 568 569 570/* 571 * The following definitions support Tcl's namespace facility. 572 * Note: the first five fields must match exactly the fields in a 573 * Namespace structure (see tcl.h). 574 */ 575 576typedef struct Tcl_Namespace { 577 char *name; /* The namespace's name within its parent 578 * namespace. This contains no ::'s. The 579 * name of the global namespace is "" 580 * although "::" is an synonym. */ 581 char *fullName; /* The namespace's fully qualified name. 582 * This starts with ::. */ 583 ClientData clientData; /* Arbitrary value associated with this 584 * namespace. */ 585 Tcl_NamespaceDeleteProc* deleteProc; 586 /* Procedure invoked when deleting the 587 * namespace to, e.g., free clientData. */ 588 struct Tcl_Namespace* parentPtr; 589 /* Points to the namespace that contains 590 * this one. NULL if this is the global 591 * namespace. */ 592} Tcl_Namespace; 593 594/* 595 * The following structure represents a call frame, or activation record. 596 * A call frame defines a naming context for a procedure call: its local 597 * scope (for local variables) and its namespace scope (used for non-local 598 * variables; often the global :: namespace). A call frame can also define 599 * the naming context for a namespace eval or namespace inscope command: 600 * the namespace in which the command's code should execute. The 601 * Tcl_CallFrame structures exist only while procedures or namespace 602 * eval/inscope's are being executed, and provide a Tcl call stack. 603 * 604 * A call frame is initialized and pushed using Tcl_PushCallFrame and 605 * popped using Tcl_PopCallFrame. Storage for a Tcl_CallFrame must be 606 * provided by the Tcl_PushCallFrame caller, and callers typically allocate 607 * them on the C call stack for efficiency. For this reason, Tcl_CallFrame 608 * is defined as a structure and not as an opaque token. However, most 609 * Tcl_CallFrame fields are hidden since applications should not access 610 * them directly; others are declared as "dummyX". 611 * 612 * WARNING!! The structure definition must be kept consistent with the 613 * CallFrame structure in tclInt.h. If you change one, change the other. 614 */ 615 616typedef struct Tcl_CallFrame { 617 Tcl_Namespace *nsPtr; 618 int dummy1; 619 int dummy2; 620 char *dummy3; 621 char *dummy4; 622 char *dummy5; 623 int dummy6; 624 char *dummy7; 625 char *dummy8; 626 int dummy9; 627 char* dummy10; 628} Tcl_CallFrame; 629 630/* 631 * Information about commands that is returned by Tcl_GetCommandInfo and 632 * passed to Tcl_SetCommandInfo. objProc is an objc/objv object-based 633 * command procedure while proc is a traditional Tcl argc/argv 634 * string-based procedure. Tcl_CreateObjCommand and Tcl_CreateCommand 635 * ensure that both objProc and proc are non-NULL and can be called to 636 * execute the command. However, it may be faster to call one instead of 637 * the other. The member isNativeObjectProc is set to 1 if an 638 * object-based procedure was registered by Tcl_CreateObjCommand, and to 639 * 0 if a string-based procedure was registered by Tcl_CreateCommand. 640 * The other procedure is typically set to a compatibility wrapper that 641 * does string-to-object or object-to-string argument conversions then 642 * calls the other procedure. 643 */ 644 645typedef struct Tcl_CmdInfo { 646 int isNativeObjectProc; /* 1 if objProc was registered by a call to 647 * Tcl_CreateObjCommand; 0 otherwise. 648 * Tcl_SetCmdInfo does not modify this 649 * field. */ 650 Tcl_ObjCmdProc *objProc; /* Command's object-based procedure. */ 651 ClientData objClientData; /* ClientData for object proc. */ 652 Tcl_CmdProc *proc; /* Command's string-based procedure. */ 653 ClientData clientData; /* ClientData for string proc. */ 654 Tcl_CmdDeleteProc *deleteProc; 655 /* Procedure to call when command is 656 * deleted. */ 657 ClientData deleteData; /* Value to pass to deleteProc (usually 658 * the same as clientData). */ 659 Tcl_Namespace *namespacePtr; /* Points to the namespace that contains 660 * this command. Note that Tcl_SetCmdInfo 661 * will not change a command's namespace; 662 * use Tcl_RenameCommand to do that. */ 663 664} Tcl_CmdInfo; 665 666/* 667 * The structure defined below is used to hold dynamic strings. The only 668 * field that clients should use is the string field, and they should 669 * never modify it. 670 */ 671 672#define TCL_DSTRING_STATIC_SIZE 200 673typedef struct Tcl_DString { 674 char *string; /* Points to beginning of string: either 675 * staticSpace below or a malloced array. */ 676 int length; /* Number of non-NULL characters in the 677 * string. */ 678 int spaceAvl; /* Total number of bytes available for the 679 * string and its terminating NULL char. */ 680 char staticSpace[TCL_DSTRING_STATIC_SIZE]; 681 /* Space to use in common case where string 682 * is small. */ 683} Tcl_DString; 684 685#define Tcl_DStringLength(dsPtr) ((dsPtr)->length) 686#define Tcl_DStringValue(dsPtr) ((dsPtr)->string) 687#define Tcl_DStringTrunc Tcl_DStringSetLength 688 689/* 690 * Definitions for the maximum number of digits of precision that may 691 * be specified in the "tcl_precision" variable, and the number of 692 * bytes of buffer space required by Tcl_PrintDouble. 693 */ 694 695#define TCL_MAX_PREC 17 696#define TCL_DOUBLE_SPACE (TCL_MAX_PREC+10) 697 698/* 699 * Definition for a number of bytes of buffer space sufficient to hold the 700 * string representation of an integer in base 10 (assuming the existence 701 * of 64-bit integers). 702 */ 703 704#define TCL_INTEGER_SPACE 24 705 706/* 707 * Flag that may be passed to Tcl_ConvertElement to force it not to 708 * output braces (careful! if you change this flag be sure to change 709 * the definitions at the front of tclUtil.c). 710 */ 711 712#define TCL_DONT_USE_BRACES 1 713 714/* 715 * Flag that may be passed to Tcl_GetIndexFromObj to force it to disallow 716 * abbreviated strings. 717 */ 718 719#define TCL_EXACT 1 720 721/* 722 * Flag values passed to Tcl_RecordAndEval and/or Tcl_EvalObj. 723 * WARNING: these bit choices must not conflict with the bit choices 724 * for evalFlag bits in tclInt.h!! 725 */ 726 727#define TCL_NO_EVAL 0x10000 728#define TCL_EVAL_GLOBAL 0x20000 729#define TCL_EVAL_DIRECT 0x40000 730 731/* 732 * Special freeProc values that may be passed to Tcl_SetResult (see 733 * the man page for details): 734 */ 735 736#define TCL_VOLATILE ((Tcl_FreeProc *) 1) 737#define TCL_STATIC ((Tcl_FreeProc *) 0) 738#define TCL_DYNAMIC ((Tcl_FreeProc *) 3) 739 740/* 741 * Flag values passed to variable-related procedures. 742 */ 743 744#define TCL_GLOBAL_ONLY 1 745#define TCL_NAMESPACE_ONLY 2 746#define TCL_APPEND_VALUE 4 747#define TCL_LIST_ELEMENT 8 748#define TCL_TRACE_READS 0x10 749#define TCL_TRACE_WRITES 0x20 750#define TCL_TRACE_UNSETS 0x40 751#define TCL_TRACE_DESTROYED 0x80 752#define TCL_INTERP_DESTROYED 0x100 753#define TCL_LEAVE_ERR_MSG 0x200 754#define TCL_TRACE_ARRAY 0x800 755 756/* 757 * The TCL_PARSE_PART1 flag is deprecated and has no effect. 758 * The part1 is now always parsed whenever the part2 is NULL. 759 * (This is to avoid a common error when converting code to 760 * use the new object based APIs and forgetting to give the 761 * flag) 762 */ 763#ifndef TCL_NO_DEPRECATED 764#define TCL_PARSE_PART1 0x400 765#endif 766 767 768/* 769 * Types for linked variables: 770 */ 771 772#define TCL_LINK_INT 1 773#define TCL_LINK_DOUBLE 2 774#define TCL_LINK_BOOLEAN 3 775#define TCL_LINK_STRING 4 776#define TCL_LINK_READ_ONLY 0x80 777 778/* 779 * The following declarations either map ckalloc and ckfree to 780 * malloc and free, or they map them to procedures with all sorts 781 * of debugging hooks defined in tclCkalloc.c. 782 */ 783 784EXTERN char * Tcl_Alloc _ANSI_ARGS_((unsigned int size)); 785EXTERN void Tcl_Free _ANSI_ARGS_((char *ptr)); 786EXTERN char * Tcl_Realloc _ANSI_ARGS_((char *ptr, 787 unsigned int size)); 788EXTERN void Tcl_InitMemory _ANSI_ARGS_((Tcl_Interp *interp)); 789EXTERN int Tcl_DumpActiveMemory _ANSI_ARGS_((char *fileName)); 790EXTERN void Tcl_ValidateAllMemory _ANSI_ARGS_((char *file, 791 int line)); 792 793#ifdef TCL_MEM_DEBUG 794 795# define Tcl_Alloc(x) Tcl_DbCkalloc(x, __FILE__, __LINE__) 796# define Tcl_Free(x) Tcl_DbCkfree(x, __FILE__, __LINE__) 797# define Tcl_Realloc(x,y) Tcl_DbCkrealloc((x), (y),__FILE__, __LINE__) 798# define ckalloc(x) Tcl_DbCkalloc(x, __FILE__, __LINE__) 799# define ckfree(x) Tcl_DbCkfree(x, __FILE__, __LINE__) 800# define ckrealloc(x,y) Tcl_DbCkrealloc((x), (y),__FILE__, __LINE__) 801 802#else 803 804# if USE_TCLALLOC 805# define ckalloc(x) Tcl_Alloc(x) 806# define ckfree(x) Tcl_Free(x) 807# define ckrealloc(x,y) Tcl_Realloc(x,y) 808# else 809# define ckalloc(x) malloc(x) 810# define ckfree(x) free(x) 811# define ckrealloc(x,y) realloc(x,y) 812# endif 813# define Tcl_InitMemory(x) 814# define Tcl_DumpActiveMemory(x) 815# define Tcl_ValidateAllMemory(x,y) 816 817#endif /* TCL_MEM_DEBUG */ 818 819/* 820 * Forward declaration of Tcl_HashTable. Needed by some C++ compilers 821 * to prevent errors when the forward reference to Tcl_HashTable is 822 * encountered in the Tcl_HashEntry structure. 823 */ 824 825#ifdef __cplusplus 826struct Tcl_HashTable; 827#endif 828 829/* 830 * Structure definition for an entry in a hash table. No-one outside 831 * Tcl should access any of these fields directly; use the macros 832 * defined below. 833 */ 834 835typedef struct Tcl_HashEntry { 836 struct Tcl_HashEntry *nextPtr; /* Pointer to next entry in this 837 * hash bucket, or NULL for end of 838 * chain. */ 839 struct Tcl_HashTable *tablePtr; /* Pointer to table containing entry. */ 840 struct Tcl_HashEntry **bucketPtr; /* Pointer to bucket that points to 841 * first entry in this entry's chain: 842 * used for deleting the entry. */ 843 ClientData clientData; /* Application stores something here 844 * with Tcl_SetHashValue. */ 845 union { /* Key has one of these forms: */ 846 char *oneWordValue; /* One-word value for key. */ 847 int words[1]; /* Multiple integer words for key. 848 * The actual size will be as large 849 * as necessary for this table's 850 * keys. */ 851 char string[4]; /* String for key. The actual size 852 * will be as large as needed to hold 853 * the key. */ 854 } key; /* MUST BE LAST FIELD IN RECORD!! */ 855} Tcl_HashEntry; 856 857/* 858 * Structure definition for a hash table. Must be in tcl.h so clients 859 * can allocate space for these structures, but clients should never 860 * access any fields in this structure. 861 */ 862 863#define TCL_SMALL_HASH_TABLE 4 864typedef struct Tcl_HashTable { 865 Tcl_HashEntry **buckets; /* Pointer to bucket array. Each 866 * element points to first entry in 867 * bucket's hash chain, or NULL. */ 868 Tcl_HashEntry *staticBuckets[TCL_SMALL_HASH_TABLE]; 869 /* Bucket array used for small tables 870 * (to avoid mallocs and frees). */ 871 int numBuckets; /* Total number of buckets allocated 872 * at **bucketPtr. */ 873 int numEntries; /* Total number of entries present 874 * in table. */ 875 int rebuildSize; /* Enlarge table when numEntries gets 876 * to be this large. */ 877 int downShift; /* Shift count used in hashing 878 * function. Designed to use high- 879 * order bits of randomized keys. */ 880 int mask; /* Mask value used in hashing 881 * function. */ 882 int keyType; /* Type of keys used in this table. 883 * It's either TCL_STRING_KEYS, 884 * TCL_ONE_WORD_KEYS, or an integer 885 * giving the number of ints that 886 * is the size of the key. 887 */ 888 Tcl_HashEntry *(*findProc) _ANSI_ARGS_((struct Tcl_HashTable *tablePtr, 889 CONST char *key)); 890 Tcl_HashEntry *(*createProc) _ANSI_ARGS_((struct Tcl_HashTable *tablePtr, 891 CONST char *key, int *newPtr)); 892} Tcl_HashTable; 893 894/* 895 * Structure definition for information used to keep track of searches 896 * through hash tables: 897 */ 898 899typedef struct Tcl_HashSearch { 900 Tcl_HashTable *tablePtr; /* Table being searched. */ 901 int nextIndex; /* Index of next bucket to be 902 * enumerated after present one. */ 903 Tcl_HashEntry *nextEntryPtr; /* Next entry to be enumerated in the 904 * the current bucket. */ 905} Tcl_HashSearch; 906 907/* 908 * Acceptable key types for hash tables: 909 */ 910 911#define TCL_STRING_KEYS 0 912#define TCL_ONE_WORD_KEYS 1 913 914/* 915 * Macros for clients to use to access fields of hash entries: 916 */ 917 918#define Tcl_GetHashValue(h) ((h)->clientData) 919#define Tcl_SetHashValue(h, value) ((h)->clientData = (ClientData) (value)) 920#define Tcl_GetHashKey(tablePtr, h) \ 921 ((char *) (((tablePtr)->keyType == TCL_ONE_WORD_KEYS) ? (h)->key.oneWordValue \ 922 : (h)->key.string)) 923 924/* 925 * Macros to use for clients to use to invoke find and create procedures 926 * for hash tables: 927 */ 928 929#define Tcl_FindHashEntry(tablePtr, key) \ 930 (*((tablePtr)->findProc))(tablePtr, key) 931#define Tcl_CreateHashEntry(tablePtr, key, newPtr) \ 932 (*((tablePtr)->createProc))(tablePtr, key, newPtr) 933 934/* 935 * Flag values to pass to Tcl_DoOneEvent to disable searches 936 * for some kinds of events: 937 */ 938 939#define TCL_DONT_WAIT (1<<1) 940#define TCL_WINDOW_EVENTS (1<<2) 941#define TCL_FILE_EVENTS (1<<3) 942#define TCL_TIMER_EVENTS (1<<4) 943#define TCL_IDLE_EVENTS (1<<5) /* WAS 0x10 ???? */ 944#define TCL_ALL_EVENTS (~TCL_DONT_WAIT) 945 946/* 947 * The following structure defines a generic event for the Tcl event 948 * system. These are the things that are queued in calls to Tcl_QueueEvent 949 * and serviced later by Tcl_DoOneEvent. There can be many different 950 * kinds of events with different fields, corresponding to window events, 951 * timer events, etc. The structure for a particular event consists of 952 * a Tcl_Event header followed by additional information specific to that 953 * event. 954 */ 955 956struct Tcl_Event { 957 Tcl_EventProc *proc; /* Procedure to call to service this event. */ 958 struct Tcl_Event *nextPtr; /* Next in list of pending events, or NULL. */ 959}; 960 961/* 962 * Positions to pass to Tcl_QueueEvent: 963 */ 964 965typedef enum { 966 TCL_QUEUE_TAIL, TCL_QUEUE_HEAD, TCL_QUEUE_MARK 967} Tcl_QueuePosition; 968 969/* 970 * Values to pass to Tcl_SetServiceMode to specify the behavior of notifier 971 * event routines. 972 */ 973 974#define TCL_SERVICE_NONE 0 975#define TCL_SERVICE_ALL 1 976 977/* 978 * The following structure keeps is used to hold a time value, either as 979 * an absolute time (the number of seconds from the epoch) or as an 980 * elapsed time. On Unix systems the epoch is Midnight Jan 1, 1970 GMT. 981 * On Macintosh systems the epoch is Midnight Jan 1, 1904 GMT. 982 */ 983 984typedef struct Tcl_Time { 985 long sec; /* Seconds. */ 986 long usec; /* Microseconds. */ 987} Tcl_Time; 988 989/* 990 * Bits to pass to Tcl_CreateFileHandler and Tcl_CreateChannelHandler 991 * to indicate what sorts of events are of interest: 992 */ 993 994#define TCL_READABLE (1<<1) 995#define TCL_WRITABLE (1<<2) 996#define TCL_EXCEPTION (1<<3) 997 998/* 999 * Flag values to pass to Tcl_OpenCommandChannel to indicate the 1000 * disposition of the stdio handles. TCL_STDIN, TCL_STDOUT, TCL_STDERR, 1001 * are also used in Tcl_GetStdChannel. 1002 */ 1003 1004#define TCL_STDIN (1<<1) 1005#define TCL_STDOUT (1<<2) 1006#define TCL_STDERR (1<<3) 1007#define TCL_ENFORCE_MODE (1<<4) 1008 1009/* 1010 * Bits passed to Tcl_DriverClose2Proc to indicate which side of a channel 1011 * should be closed. 1012 */ 1013 1014#define TCL_CLOSE_READ (1<<1) 1015#define TCL_CLOSE_WRITE (1<<2) 1016 1017/* 1018 * Value to use as the closeProc for a channel that supports the 1019 * close2Proc interface. 1020 */ 1021 1022#define TCL_CLOSE2PROC ((Tcl_DriverCloseProc *)1) 1023 1024/* 1025 * Typedefs for the various operations in a channel type: 1026 */ 1027 1028typedef int (Tcl_DriverBlockModeProc) _ANSI_ARGS_(( 1029 ClientData instanceData, int mode)); 1030typedef int (Tcl_DriverCloseProc) _ANSI_ARGS_((ClientData instanceData, 1031 Tcl_Interp *interp)); 1032typedef int (Tcl_DriverClose2Proc) _ANSI_ARGS_((ClientData instanceData, 1033 Tcl_Interp *interp, int flags)); 1034typedef int (Tcl_DriverInputProc) _ANSI_ARGS_((ClientData instanceData, 1035 char *buf, int toRead, int *errorCodePtr)); 1036typedef int (Tcl_DriverOutputProc) _ANSI_ARGS_((ClientData instanceData, 1037 char *buf, int toWrite, int *errorCodePtr)); 1038typedef int (Tcl_DriverSeekProc) _ANSI_ARGS_((ClientData instanceData, 1039 long offset, int mode, int *errorCodePtr)); 1040typedef int (Tcl_DriverSetOptionProc) _ANSI_ARGS_(( 1041 ClientData instanceData, Tcl_Interp *interp, 1042 char *optionName, char *value)); 1043typedef int (Tcl_DriverGetOptionProc) _ANSI_ARGS_(( 1044 ClientData instanceData, Tcl_Interp *interp, 1045 char *optionName, Tcl_DString *dsPtr)); 1046typedef void (Tcl_DriverWatchProc) _ANSI_ARGS_(( 1047 ClientData instanceData, int mask)); 1048typedef int (Tcl_DriverGetHandleProc) _ANSI_ARGS_(( 1049 ClientData instanceData, int direction, 1050 ClientData *handlePtr)); 1051 1052/* 1053 * Enum for different end of line translation and recognition modes. 1054 */ 1055 1056typedef enum Tcl_EolTranslation { 1057 TCL_TRANSLATE_AUTO, /* Eol == \r, \n and \r\n. */ 1058 TCL_TRANSLATE_CR, /* Eol == \r. */ 1059 TCL_TRANSLATE_LF, /* Eol == \n. */ 1060 TCL_TRANSLATE_CRLF /* Eol == \r\n. */ 1061} Tcl_EolTranslation; 1062 1063/* 1064 * struct Tcl_ChannelType: 1065 * 1066 * One such structure exists for each type (kind) of channel. 1067 * It collects together in one place all the functions that are 1068 * part of the specific channel type. 1069 */ 1070 1071typedef struct Tcl_ChannelType { 1072 char *typeName; /* The name of the channel type in Tcl 1073 * commands. This storage is owned by 1074 * channel type. */ 1075 Tcl_DriverBlockModeProc *blockModeProc; 1076 /* Set blocking mode for the 1077 * raw channel. May be NULL. */ 1078 Tcl_DriverCloseProc *closeProc; /* Procedure to call to close the 1079 * channel, or TCL_CLOSE2PROC if the 1080 * close2Proc should be used 1081 * instead. */ 1082 Tcl_DriverInputProc *inputProc; /* Procedure to call for input 1083 * on channel. */ 1084 Tcl_DriverOutputProc *outputProc; /* Procedure to call for output 1085 * on channel. */ 1086 Tcl_DriverSeekProc *seekProc; /* Procedure to call to seek 1087 * on the channel. May be NULL. */ 1088 Tcl_DriverSetOptionProc *setOptionProc; 1089 /* Set an option on a channel. */ 1090 Tcl_DriverGetOptionProc *getOptionProc; 1091 /* Get an option from a channel. */ 1092 Tcl_DriverWatchProc *watchProc; /* Set up the notifier to watch 1093 * for events on this channel. */ 1094 Tcl_DriverGetHandleProc *getHandleProc; 1095 /* Get an OS handle from the channel 1096 * or NULL if not supported. */ 1097 Tcl_DriverClose2Proc *close2Proc; /* Procedure to call to close the 1098 * channel if the device supports 1099 * closing the read & write sides 1100 * independently. */ 1101} Tcl_ChannelType; 1102 1103/* 1104 * The following flags determine whether the blockModeProc above should 1105 * set the channel into blocking or nonblocking mode. They are passed 1106 * as arguments to the blockModeProc procedure in the above structure. 1107 */ 1108 1109#define TCL_MODE_BLOCKING 0 /* Put channel into blocking mode. */ 1110#define TCL_MODE_NONBLOCKING 1 /* Put channel into nonblocking 1111 * mode. */ 1112 1113/* 1114 * Enum for different types of file paths. 1115 */ 1116 1117typedef enum Tcl_PathType { 1118 TCL_PATH_ABSOLUTE, 1119 TCL_PATH_RELATIVE, 1120 TCL_PATH_VOLUME_RELATIVE 1121} Tcl_PathType; 1122 1123/* 1124 * The following structure represents a user-defined encoding. It collects 1125 * together all the functions that are used by the specific encoding. 1126 */ 1127 1128typedef struct Tcl_EncodingType { 1129 CONST char *encodingName; /* The name of the encoding, e.g. "euc-jp". 1130 * This name is the unique key for this 1131 * encoding type. */ 1132 Tcl_EncodingConvertProc *toUtfProc; 1133 /* Procedure to convert from external 1134 * encoding into UTF-8. */ 1135 Tcl_EncodingConvertProc *fromUtfProc; 1136 /* Procedure to convert from UTF-8 into 1137 * external encoding. */ 1138 Tcl_EncodingFreeProc *freeProc; 1139 /* If non-NULL, procedure to call when this 1140 * encoding is deleted. */ 1141 ClientData clientData; /* Arbitrary value associated with encoding 1142 * type. Passed to conversion procedures. */ 1143 int nullSize; /* Number of zero bytes that signify 1144 * end-of-string in this encoding. This 1145 * number is used to determine the source 1146 * string length when the srcLen argument is 1147 * negative. Must be 1 or 2. */ 1148} Tcl_EncodingType; 1149 1150/* 1151 * The following definitions are used as values for the conversion control 1152 * flags argument when converting text from one character set to another: 1153 * 1154 * TCL_ENCODING_START: Signifies that the source buffer is the first 1155 * block in a (potentially multi-block) input 1156 * stream. Tells the conversion procedure to 1157 * reset to an initial state and perform any 1158 * initialization that needs to occur before the 1159 * first byte is converted. If the source 1160 * buffer contains the entire input stream to be 1161 * converted, this flag should be set. 1162 * 1163 * TCL_ENCODING_END: Signifies that the source buffer is the last 1164 * block in a (potentially multi-block) input 1165 * stream. Tells the conversion routine to 1166 * perform any finalization that needs to occur 1167 * after the last byte is converted and then to 1168 * reset to an initial state. If the source 1169 * buffer contains the entire input stream to be 1170 * converted, this flag should be set. 1171 * 1172 * TCL_ENCODING_STOPONERROR: If set, then the converter will return 1173 * immediately upon encountering an invalid 1174 * byte sequence or a source character that has 1175 * no mapping in the target encoding. If clear, 1176 * then the converter will skip the problem, 1177 * substituting one or more "close" characters 1178 * in the destination buffer and then continue 1179 * to sonvert the source. 1180 */ 1181 1182#define TCL_ENCODING_START 0x01 1183#define TCL_ENCODING_END 0x02 1184#define TCL_ENCODING_STOPONERROR 0x04 1185 1186/* 1187 * The following definitions are the error codes returned by the conversion 1188 * routines: 1189 * 1190 * TCL_OK: All characters were converted. 1191 * 1192 * TCL_CONVERT_NOSPACE: The output buffer would not have been large 1193 * enough for all of the converted data; as many 1194 * characters as could fit were converted though. 1195 * 1196 * TCL_CONVERT_MULTIBYTE: The last few bytes in the source string were 1197 * the beginning of a multibyte sequence, but 1198 * more bytes were needed to complete this 1199 * sequence. A subsequent call to the conversion 1200 * routine should pass the beginning of this 1201 * unconverted sequence plus additional bytes 1202 * from the source stream to properly convert 1203 * the formerly split-up multibyte sequence. 1204 * 1205 * TCL_CONVERT_SYNTAX: The source stream contained an invalid 1206 * character sequence. This may occur if the 1207 * input stream has been damaged or if the input 1208 * encoding method was misidentified. This error 1209 * is reported only if TCL_ENCODING_STOPONERROR 1210 * was specified. 1211 * 1212 * TCL_CONVERT_UNKNOWN: The source string contained a character 1213 * that could not be represented in the target 1214 * encoding. This error is reported only if 1215 * TCL_ENCODING_STOPONERROR was specified. 1216 */ 1217 1218#define TCL_CONVERT_MULTIBYTE -1 1219#define TCL_CONVERT_SYNTAX -2 1220#define TCL_CONVERT_UNKNOWN -3 1221#define TCL_CONVERT_NOSPACE -4 1222 1223/* 1224 * The maximum number of bytes that are necessary to represent a single 1225 * Unicode character in UTF-8. 1226 */ 1227 1228#define TCL_UTF_MAX 3 1229 1230/* 1231 * This represents a Unicode character. 1232 */ 1233 1234typedef unsigned short Tcl_UniChar; 1235 1236/* 1237 * Exported Tcl procedures: 1238 */ 1239 1240EXTERN void Tcl_AddErrorInfo _ANSI_ARGS_((Tcl_Interp *interp, 1241 CONST char *message)); 1242EXTERN void Tcl_AddObjErrorInfo _ANSI_ARGS_((Tcl_Interp *interp, 1243 CONST char *message, int length)); 1244EXTERN void Tcl_AllowExceptions _ANSI_ARGS_((Tcl_Interp *interp)); 1245EXTERN int Tcl_AppendAllObjTypes _ANSI_ARGS_(( 1246 Tcl_Interp *interp, Tcl_Obj *objPtr)); 1247EXTERN void Tcl_AppendElement _ANSI_ARGS_((Tcl_Interp *interp, 1248 CONST char *string)); 1249EXTERN void Tcl_AppendResult _ANSI_ARGS_( 1250 TCL_VARARGS(Tcl_Interp *,interp)); 1251EXTERN void Tcl_AppendObjToObj _ANSI_ARGS_((Tcl_Obj *objPtr, 1252 Tcl_Obj *appendObjPtr)); 1253EXTERN void Tcl_AppendToObj _ANSI_ARGS_((Tcl_Obj *objPtr, 1254 char *bytes, int length)); 1255EXTERN void Tcl_AppendStringsToObj _ANSI_ARGS_( 1256 TCL_VARARGS(Tcl_Obj *,interp)); 1257EXTERN int Tcl_AppInit _ANSI_ARGS_((Tcl_Interp *interp)); 1258EXTERN void Tcl_AlertNotifier _ANSI_ARGS_((ClientData clientData)); 1259EXTERN Tcl_AsyncHandler Tcl_AsyncCreate _ANSI_ARGS_((Tcl_AsyncProc *proc, 1260 ClientData clientData)); 1261EXTERN void Tcl_AsyncDelete _ANSI_ARGS_((Tcl_AsyncHandler async)); 1262EXTERN int Tcl_AsyncInvoke _ANSI_ARGS_((Tcl_Interp *interp, 1263 int code)); 1264EXTERN void Tcl_AsyncMark _ANSI_ARGS_((Tcl_AsyncHandler async)); 1265EXTERN int Tcl_AsyncReady _ANSI_ARGS_((void)); 1266EXTERN void Tcl_BackgroundError _ANSI_ARGS_((Tcl_Interp *interp)); 1267EXTERN char Tcl_Backslash _ANSI_ARGS_((CONST char *src, 1268 int *readPtr)); 1269EXTERN int Tcl_BadChannelOption _ANSI_ARGS_((Tcl_Interp *interp, 1270 char *optionName, char *optionList)); 1271EXTERN void Tcl_CallWhenDeleted _ANSI_ARGS_((Tcl_Interp *interp, 1272 Tcl_InterpDeleteProc *proc, 1273 ClientData clientData)); 1274EXTERN void Tcl_CancelIdleCall _ANSI_ARGS_((Tcl_IdleProc *idleProc, 1275 ClientData clientData)); 1276#define Tcl_Ckalloc Tcl_Alloc 1277#define Tcl_Ckfree Tcl_Free 1278#define Tcl_Ckrealloc Tcl_Realloc 1279EXTERN int Tcl_Close _ANSI_ARGS_((Tcl_Interp *interp, 1280 Tcl_Channel chan)); 1281EXTERN int Tcl_CommandComplete _ANSI_ARGS_((char *cmd)); 1282EXTERN char * Tcl_Concat _ANSI_ARGS_((int argc, char **argv)); 1283EXTERN Tcl_Obj * Tcl_ConcatObj _ANSI_ARGS_((int objc, 1284 Tcl_Obj *CONST objv[])); 1285EXTERN int Tcl_ConvertCountedElement _ANSI_ARGS_((CONST char *src, 1286 int length, char *dst, int flags)); 1287EXTERN int Tcl_ConvertElement _ANSI_ARGS_((CONST char *src, 1288 char *dst, int flags)); 1289EXTERN int Tcl_ConvertToType _ANSI_ARGS_((Tcl_Interp *interp, 1290 Tcl_Obj *objPtr, Tcl_ObjType *typePtr)); 1291EXTERN int Tcl_CreateAlias _ANSI_ARGS_((Tcl_Interp *slave, 1292 char *slaveCmd, Tcl_Interp *target, 1293 char *targetCmd, int argc, char **argv)); 1294EXTERN int Tcl_CreateAliasObj _ANSI_ARGS_((Tcl_Interp *slave, 1295 char *slaveCmd, Tcl_Interp *target, 1296 char *targetCmd, int objc, 1297 Tcl_Obj *CONST objv[])); 1298EXTERN Tcl_Channel Tcl_CreateChannel _ANSI_ARGS_(( 1299 Tcl_ChannelType *typePtr, char *chanName, 1300 ClientData instanceData, int mask)); 1301EXTERN void Tcl_CreateChannelHandler _ANSI_ARGS_(( 1302 Tcl_Channel chan, int mask, 1303 Tcl_ChannelProc *proc, ClientData clientData)); 1304EXTERN void Tcl_CreateCloseHandler _ANSI_ARGS_(( 1305 Tcl_Channel chan, Tcl_CloseProc *proc, 1306 ClientData clientData)); 1307EXTERN Tcl_Command Tcl_CreateCommand _ANSI_ARGS_((Tcl_Interp *interp, 1308 char *cmdName, Tcl_CmdProc *proc, 1309 ClientData clientData, 1310 Tcl_CmdDeleteProc *deleteProc)); 1311EXTERN void Tcl_CreateEventSource _ANSI_ARGS_(( 1312 Tcl_EventSetupProc *setupProc, 1313 Tcl_EventCheckProc *checkProc, 1314 ClientData clientData)); 1315EXTERN Tcl_Encoding Tcl_CreateEncoding _ANSI_ARGS_(( 1316 Tcl_EncodingType *typePtr)); 1317EXTERN void Tcl_CreateExitHandler _ANSI_ARGS_((Tcl_ExitProc *proc, 1318 ClientData clientData)); 1319EXTERN void Tcl_CreateFileHandler _ANSI_ARGS_(( 1320 int fd, int mask, Tcl_FileProc *proc, 1321 ClientData clientData)); 1322EXTERN Tcl_Interp * Tcl_CreateInterp _ANSI_ARGS_((void)); 1323EXTERN void Tcl_CreateMathFunc _ANSI_ARGS_((Tcl_Interp *interp, 1324 char *name, int numArgs, Tcl_ValueType *argTypes, 1325 Tcl_MathProc *proc, ClientData clientData)); 1326EXTERN Tcl_Command Tcl_CreateObjCommand _ANSI_ARGS_(( 1327 Tcl_Interp *interp, char *cmdName, 1328 Tcl_ObjCmdProc *proc, ClientData clientData, 1329 Tcl_CmdDeleteProc *deleteProc)); 1330EXTERN Tcl_Interp * Tcl_CreateSlave _ANSI_ARGS_((Tcl_Interp *interp, 1331 char *slaveName, int isSafe)); 1332EXTERN void Tcl_CreateThreadExitHandler 1333 _ANSI_ARGS_((Tcl_ExitProc *proc, 1334 ClientData clientData)); 1335EXTERN Tcl_TimerToken Tcl_CreateTimerHandler _ANSI_ARGS_((int milliseconds, 1336 Tcl_TimerProc *proc, ClientData clientData)); 1337EXTERN Tcl_Trace Tcl_CreateTrace _ANSI_ARGS_((Tcl_Interp *interp, 1338 int level, Tcl_CmdTraceProc *proc, 1339 ClientData clientData)); 1340EXTERN char * Tcl_DbCkalloc _ANSI_ARGS_((unsigned int size, 1341 char *file, int line)); 1342EXTERN int Tcl_DbCkfree _ANSI_ARGS_((char *ptr, 1343 char *file, int line)); 1344EXTERN char * Tcl_DbCkrealloc _ANSI_ARGS_((char *ptr, 1345 unsigned int size, char *file, int line)); 1346EXTERN void Tcl_DbDecrRefCount _ANSI_ARGS_((Tcl_Obj *objPtr, 1347 char *file, int line)); 1348EXTERN void Tcl_DbIncrRefCount _ANSI_ARGS_((Tcl_Obj *objPtr, 1349 char *file, int line)); 1350EXTERN int Tcl_DbIsShared _ANSI_ARGS_((Tcl_Obj *objPtr, 1351 char *file, int line)); 1352EXTERN Tcl_Obj * Tcl_DbNewBooleanObj _ANSI_ARGS_((int boolValue, 1353 char *file, int line)); 1354EXTERN Tcl_Obj * Tcl_DbNewDoubleObj _ANSI_ARGS_((double doubleValue, 1355 char *file, int line)); 1356EXTERN Tcl_Obj * Tcl_DbNewListObj _ANSI_ARGS_((int objc, 1357 Tcl_Obj *CONST objv[], char *file, int line)); 1358EXTERN Tcl_Obj * Tcl_DbNewLongObj _ANSI_ARGS_((long longValue, 1359 char *file, int line)); 1360EXTERN Tcl_Obj * Tcl_DbNewObj _ANSI_ARGS_((char *file, int line)); 1361EXTERN Tcl_Obj * Tcl_DbNewStringObj _ANSI_ARGS_((CONST char *bytes, 1362 int length, char *file, int line)); 1363EXTERN void Tcl_DeleteAssocData _ANSI_ARGS_((Tcl_Interp *interp, 1364 char *name)); 1365EXTERN int Tcl_DeleteCommand _ANSI_ARGS_((Tcl_Interp *interp, 1366 char *cmdName)); 1367EXTERN int Tcl_DeleteCommandFromToken _ANSI_ARGS_(( 1368 Tcl_Interp *interp, Tcl_Command command)); 1369EXTERN void Tcl_DeleteChannelHandler _ANSI_ARGS_(( 1370 Tcl_Channel chan, Tcl_ChannelProc *proc, 1371 ClientData clientData)); 1372EXTERN void Tcl_DeleteCloseHandler _ANSI_ARGS_(( 1373 Tcl_Channel chan, Tcl_CloseProc *proc, 1374 ClientData clientData)); 1375EXTERN void Tcl_DeleteEvents _ANSI_ARGS_(( 1376 Tcl_EventDeleteProc *proc, 1377 ClientData clientData)); 1378EXTERN void Tcl_DeleteEventSource _ANSI_ARGS_(( 1379 Tcl_EventSetupProc *setupProc, 1380 Tcl_EventCheckProc *checkProc, 1381 ClientData clientData)); 1382EXTERN void Tcl_DeleteExitHandler _ANSI_ARGS_((Tcl_ExitProc *proc, 1383 ClientData clientData)); 1384EXTERN void Tcl_DeleteFileHandler _ANSI_ARGS_((int fd)); 1385EXTERN void Tcl_DeleteHashEntry _ANSI_ARGS_(( 1386 Tcl_HashEntry *entryPtr)); 1387EXTERN void Tcl_DeleteHashTable _ANSI_ARGS_(( 1388 Tcl_HashTable *tablePtr)); 1389EXTERN void Tcl_DeleteInterp _ANSI_ARGS_((Tcl_Interp *interp)); 1390EXTERN void Tcl_DeleteThreadExitHandler 1391 _ANSI_ARGS_((Tcl_ExitProc *proc, 1392 ClientData clientData)); 1393EXTERN void Tcl_DeleteTimerHandler _ANSI_ARGS_(( 1394 Tcl_TimerToken token)); 1395EXTERN void Tcl_DeleteTrace _ANSI_ARGS_((Tcl_Interp *interp, 1396 Tcl_Trace trace)); 1397EXTERN void Tcl_DetachPids _ANSI_ARGS_((int numPids, Tcl_Pid *pidPtr)); 1398EXTERN void Tcl_DiscardResult _ANSI_ARGS_(( 1399 Tcl_SavedResult *statePtr)); 1400EXTERN void Tcl_DontCallWhenDeleted _ANSI_ARGS_(( 1401 Tcl_Interp *interp, Tcl_InterpDeleteProc *proc, 1402 ClientData clientData)); 1403EXTERN int Tcl_DoOneEvent _ANSI_ARGS_((int flags)); 1404EXTERN void Tcl_DoWhenIdle _ANSI_ARGS_((Tcl_IdleProc *proc, 1405 ClientData clientData)); 1406EXTERN char * Tcl_DStringAppend _ANSI_ARGS_((Tcl_DString *dsPtr, 1407 CONST char *string, int length)); 1408EXTERN char * Tcl_DStringAppendElement _ANSI_ARGS_(( 1409 Tcl_DString *dsPtr, CONST char *string)); 1410EXTERN void Tcl_DStringEndSublist _ANSI_ARGS_((Tcl_DString *dsPtr)); 1411EXTERN void Tcl_DStringFree _ANSI_ARGS_((Tcl_DString *dsPtr)); 1412EXTERN void Tcl_DStringGetResult _ANSI_ARGS_((Tcl_Interp *interp, 1413 Tcl_DString *dsPtr)); 1414EXTERN void Tcl_DStringInit _ANSI_ARGS_((Tcl_DString *dsPtr)); 1415EXTERN void Tcl_DStringResult _ANSI_ARGS_((Tcl_Interp *interp, 1416 Tcl_DString *dsPtr)); 1417EXTERN void Tcl_DStringSetLength _ANSI_ARGS_((Tcl_DString *dsPtr, 1418 int length)); 1419EXTERN void Tcl_DStringStartSublist _ANSI_ARGS_(( 1420 Tcl_DString *dsPtr)); 1421EXTERN Tcl_Obj * Tcl_DuplicateObj _ANSI_ARGS_((Tcl_Obj *objPtr)); 1422EXTERN int Tcl_Eof _ANSI_ARGS_((Tcl_Channel chan)); 1423EXTERN char * Tcl_ErrnoId _ANSI_ARGS_((void)); 1424EXTERN char * Tcl_ErrnoMsg _ANSI_ARGS_((int err)); 1425EXTERN int Tcl_Eval _ANSI_ARGS_((Tcl_Interp *interp, 1426 char *string)); 1427EXTERN int Tcl_Eval2 _ANSI_ARGS_((Tcl_Interp *interp, 1428 char *script, int numBytes, int flags)); 1429EXTERN int Tcl_EvalFile _ANSI_ARGS_((Tcl_Interp *interp, 1430 char *fileName)); 1431EXTERN int Tcl_EvalObjv _ANSI_ARGS_ ((Tcl_Interp *interp, 1432 int objc, Tcl_Obj *CONST objv[], int flags)); 1433EXTERN int Tcl_EvalObj _ANSI_ARGS_((Tcl_Interp *interp, 1434 Tcl_Obj *objPtr, int flags)); 1435EXTERN void Tcl_EventuallyFree _ANSI_ARGS_((ClientData clientData, 1436 Tcl_FreeProc *freeProc)); 1437EXTERN void Tcl_Exit _ANSI_ARGS_((int status)); 1438EXTERN void Tcl_ExitThread _ANSI_ARGS_((int status)); 1439EXTERN int Tcl_ExposeCommand _ANSI_ARGS_((Tcl_Interp *interp, 1440 char *hiddenCmdToken, char *cmdName)); 1441EXTERN int Tcl_ExprBoolean _ANSI_ARGS_((Tcl_Interp *interp, 1442 char *string, int *ptr)); 1443EXTERN int Tcl_ExprBooleanObj _ANSI_ARGS_((Tcl_Interp *interp, 1444 Tcl_Obj *objPtr, int *ptr)); 1445EXTERN int Tcl_ExprDouble _ANSI_ARGS_((Tcl_Interp *interp, 1446 char *string, double *ptr)); 1447EXTERN int Tcl_ExprDoubleObj _ANSI_ARGS_((Tcl_Interp *interp, 1448 Tcl_Obj *objPtr, double *ptr)); 1449EXTERN int Tcl_ExprLong _ANSI_ARGS_((Tcl_Interp *interp, 1450 char *string, long *ptr)); 1451EXTERN int Tcl_ExprLongObj _ANSI_ARGS_((Tcl_Interp *interp, 1452 Tcl_Obj *objPtr, long *ptr)); 1453EXTERN int Tcl_ExprObj _ANSI_ARGS_((Tcl_Interp *interp, 1454 Tcl_Obj *objPtr, Tcl_Obj **resultPtrPtr)); 1455EXTERN int Tcl_ExprString _ANSI_ARGS_((Tcl_Interp *interp, 1456 char *string)); 1457EXTERN int Tcl_ExternalToUtf _ANSI_ARGS_((Tcl_Interp *interp, 1458 Tcl_Encoding encoding, CONST char *src, int srcLen, 1459 int flags, Tcl_EncodingState *statePtr, char *dst, 1460 int dstLen, int *srcReadPtr, int *dstWrotePtr, 1461 int *dstCharsPtr)); 1462EXTERN char * Tcl_ExternalToUtfDString _ANSI_ARGS_(( 1463 Tcl_Encoding encoding, CONST char *src, 1464 int srcLen, Tcl_DString *dsPtr)); 1465EXTERN void Tcl_Finalize _ANSI_ARGS_((void)); 1466EXTERN void Tcl_FinalizeThread _ANSI_ARGS_((void)); 1467EXTERN void Tcl_FinalizeNotifier _ANSI_ARGS_(( 1468 ClientData clientData)); 1469EXTERN void Tcl_FindExecutable _ANSI_ARGS_((CONST char *argv0)); 1470EXTERN Tcl_HashEntry * Tcl_FirstHashEntry _ANSI_ARGS_(( 1471 Tcl_HashTable *tablePtr, 1472 Tcl_HashSearch *searchPtr)); 1473EXTERN int Tcl_Flush _ANSI_ARGS_((Tcl_Channel chan)); 1474EXTERN void Tcl_FreeEncoding _ANSI_ARGS_((Tcl_Encoding encoding)); 1475EXTERN void TclFreeObj _ANSI_ARGS_((Tcl_Obj *objPtr)); 1476EXTERN void Tcl_FreeResult _ANSI_ARGS_((Tcl_Interp *interp)); 1477EXTERN int Tcl_GetAlias _ANSI_ARGS_((Tcl_Interp *interp, 1478 char *slaveCmd, Tcl_Interp **targetInterpPtr, 1479 char **targetCmdPtr, int *argcPtr, 1480 char ***argvPtr)); 1481EXTERN int Tcl_GetAliasObj _ANSI_ARGS_((Tcl_Interp *interp, 1482 char *slaveCmd, Tcl_Interp **targetInterpPtr, 1483 char **targetCmdPtr, int *objcPtr, 1484 Tcl_Obj ***objv)); 1485EXTERN ClientData Tcl_GetAssocData _ANSI_ARGS_((Tcl_Interp *interp, 1486 char *name, Tcl_InterpDeleteProc **procPtr)); 1487EXTERN int Tcl_GetBoolean _ANSI_ARGS_((Tcl_Interp *interp, 1488 char *string, int *boolPtr)); 1489EXTERN int Tcl_GetBooleanFromObj _ANSI_ARGS_(( 1490 Tcl_Interp *interp, Tcl_Obj *objPtr, 1491 int *boolPtr)); 1492EXTERN unsigned char * Tcl_GetByteArrayFromObj _ANSI_ARGS_(( 1493 Tcl_Obj *objPtr, int *lengthPtr)); 1494EXTERN Tcl_Channel Tcl_GetChannel _ANSI_ARGS_((Tcl_Interp *interp, 1495 char *chanName, int *modePtr)); 1496EXTERN int Tcl_GetChannelBufferSize _ANSI_ARGS_(( 1497 Tcl_Channel chan)); 1498EXTERN int Tcl_GetChannelHandle _ANSI_ARGS_((Tcl_Channel chan, 1499 int direction, ClientData *handlePtr)); 1500EXTERN ClientData Tcl_GetChannelInstanceData _ANSI_ARGS_(( 1501 Tcl_Channel chan)); 1502EXTERN int Tcl_GetChannelMode _ANSI_ARGS_((Tcl_Channel chan)); 1503EXTERN char * Tcl_GetChannelName _ANSI_ARGS_((Tcl_Channel chan)); 1504EXTERN int Tcl_GetChannelOption _ANSI_ARGS_((Tcl_Interp *interp, 1505 Tcl_Channel chan, char *optionName, 1506 Tcl_DString *dsPtr)); 1507EXTERN Tcl_ChannelType * Tcl_GetChannelType _ANSI_ARGS_((Tcl_Channel chan)); 1508EXTERN int Tcl_GetCommandInfo _ANSI_ARGS_((Tcl_Interp *interp, 1509 char *cmdName, Tcl_CmdInfo *infoPtr)); 1510EXTERN char * Tcl_GetCommandName _ANSI_ARGS_((Tcl_Interp *interp, 1511 Tcl_Command command)); 1512EXTERN Tcl_ThreadId Tcl_GetCurrentThread _ANSI_ARGS_((void)); 1513EXTERN int Tcl_GetDouble _ANSI_ARGS_((Tcl_Interp *interp, 1514 char *string, double *doublePtr)); 1515EXTERN int Tcl_GetDoubleFromObj _ANSI_ARGS_(( 1516 Tcl_Interp *interp, Tcl_Obj *objPtr, 1517 double *doublePtr)); 1518EXTERN Tcl_Encoding Tcl_GetEncoding _ANSI_ARGS_((Tcl_Interp *interp, 1519 CONST char *name)); 1520EXTERN char * Tcl_GetEncodingName _ANSI_ARGS_(( 1521 Tcl_Encoding encoding)); 1522EXTERN void Tcl_GetEncodingNames _ANSI_ARGS_((Tcl_Interp *interp)); 1523EXTERN Tcl_Obj * Tcl_GetEncodingPath _ANSI_ARGS_((void)); 1524EXTERN int Tcl_GetErrno _ANSI_ARGS_((void)); 1525EXTERN char * Tcl_GetHostName _ANSI_ARGS_((void)); 1526EXTERN int Tcl_GetIndexFromObj _ANSI_ARGS_((Tcl_Interp *interp, 1527 Tcl_Obj *objPtr, char **tablePtr, char *msg, 1528 int flags, int *indexPtr)); 1529EXTERN int Tcl_GetIndexFromObjStruct _ANSI_ARGS_(( 1530 Tcl_Interp *interp, Tcl_Obj *objPtr, 1531 char **tablePtr, int offset, char *msg, int flags, 1532 int *indexPtr)); 1533EXTERN int Tcl_GetInt _ANSI_ARGS_((Tcl_Interp *interp, 1534 char *string, int *intPtr)); 1535EXTERN int Tcl_GetInterpPath _ANSI_ARGS_((Tcl_Interp *askInterp, 1536 Tcl_Interp *slaveInterp)); 1537EXTERN int Tcl_GetIntFromObj _ANSI_ARGS_((Tcl_Interp *interp, 1538 Tcl_Obj *objPtr, int *intPtr)); 1539EXTERN int Tcl_GetLongFromObj _ANSI_ARGS_((Tcl_Interp *interp, 1540 Tcl_Obj *objPtr, long *longPtr)); 1541EXTERN Tcl_Interp * Tcl_GetMaster _ANSI_ARGS_((Tcl_Interp *interp)); 1542EXTERN CONST char * Tcl_GetNameOfExecutable _ANSI_ARGS_((void)); 1543EXTERN Tcl_Obj * Tcl_GetObjResult _ANSI_ARGS_((Tcl_Interp *interp)); 1544EXTERN Tcl_Obj * Tcl_GetObjVar2 _ANSI_ARGS_((Tcl_Interp *interp, 1545 char *part1, char *part2, int flags)); 1546EXTERN Tcl_ObjType * Tcl_GetObjType _ANSI_ARGS_((char *typeName)); 1547EXTERN int Tcl_GetOpenFile _ANSI_ARGS_((Tcl_Interp *interp, 1548 char *string, int write, int checkUsage, 1549 ClientData *filePtr)); 1550EXTERN Tcl_PathType Tcl_GetPathType _ANSI_ARGS_((char *path)); 1551EXTERN int Tcl_Gets _ANSI_ARGS_((Tcl_Channel chan, 1552 Tcl_DString *dsPtr)); 1553EXTERN int Tcl_GetsObj _ANSI_ARGS_((Tcl_Channel chan, 1554 Tcl_Obj *objPtr)); 1555EXTERN int Tcl_GetServiceMode _ANSI_ARGS_((void)); 1556EXTERN Tcl_Interp * Tcl_GetSlave _ANSI_ARGS_((Tcl_Interp *interp, 1557 char *slaveName)); 1558EXTERN Tcl_Channel Tcl_GetStdChannel _ANSI_ARGS_((int type)); 1559EXTERN char * Tcl_GetString _ANSI_ARGS_((Tcl_Obj *objPtr)); 1560EXTERN char * Tcl_GetStringFromObj _ANSI_ARGS_((Tcl_Obj *objPtr, 1561 int *lengthPtr)); 1562EXTERN char * Tcl_GetStringResult _ANSI_ARGS_((Tcl_Interp *interp)); 1563EXTERN VOID * Tcl_GetThreadData _ANSI_ARGS_(( 1564 Tcl_ThreadDataKey *keyPtr, int size)); 1565EXTERN char * Tcl_GetVar _ANSI_ARGS_((Tcl_Interp *interp, 1566 char *varName, int flags)); 1567EXTERN char * Tcl_GetVar2 _ANSI_ARGS_((Tcl_Interp *interp, 1568 char *part1, char *part2, int flags)); 1569EXTERN int Tcl_GlobalEval _ANSI_ARGS_((Tcl_Interp *interp, 1570 char *command)); 1571EXTERN char * Tcl_HashStats _ANSI_ARGS_((Tcl_HashTable *tablePtr)); 1572EXTERN int Tcl_HideCommand _ANSI_ARGS_((Tcl_Interp *interp, 1573 char *cmdName, char *hiddenCmdToken)); 1574EXTERN int Tcl_Init _ANSI_ARGS_((Tcl_Interp *interp)); 1575EXTERN void Tcl_InitHashTable _ANSI_ARGS_((Tcl_HashTable *tablePtr, 1576 int keyType)); 1577EXTERN void Tcl_InitMemory _ANSI_ARGS_((Tcl_Interp *interp)); 1578EXTERN ClientData Tcl_InitNotifier _ANSI_ARGS_((void)); 1579EXTERN int Tcl_InputBlocked _ANSI_ARGS_((Tcl_Channel chan)); 1580EXTERN int Tcl_InputBuffered _ANSI_ARGS_((Tcl_Channel chan)); 1581EXTERN int Tcl_InterpDeleted _ANSI_ARGS_((Tcl_Interp *interp)); 1582EXTERN int Tcl_IsSafe _ANSI_ARGS_((Tcl_Interp *interp)); 1583EXTERN void Tcl_InvalidateStringRep _ANSI_ARGS_(( 1584 Tcl_Obj *objPtr)); 1585EXTERN char * Tcl_JoinPath _ANSI_ARGS_((int argc, char **argv, 1586 Tcl_DString *resultPtr)); 1587EXTERN int Tcl_LinkVar _ANSI_ARGS_((Tcl_Interp *interp, 1588 char *varName, char *addr, int type)); 1589EXTERN int Tcl_ListObjAppendList _ANSI_ARGS_(( 1590 Tcl_Interp *interp, Tcl_Obj *listPtr, 1591 Tcl_Obj *elemListPtr)); 1592EXTERN int Tcl_ListObjAppendElement _ANSI_ARGS_(( 1593 Tcl_Interp *interp, Tcl_Obj *listPtr, 1594 Tcl_Obj *objPtr)); 1595EXTERN int Tcl_ListObjGetElements _ANSI_ARGS_(( 1596 Tcl_Interp *interp, Tcl_Obj *listPtr, 1597 int *objcPtr, Tcl_Obj ***objvPtr)); 1598EXTERN int Tcl_ListObjIndex _ANSI_ARGS_((Tcl_Interp *interp, 1599 Tcl_Obj *listPtr, int index, 1600 Tcl_Obj **objPtrPtr)); 1601EXTERN int Tcl_ListObjLength _ANSI_ARGS_((Tcl_Interp *interp, 1602 Tcl_Obj *listPtr, int *intPtr)); 1603EXTERN int Tcl_ListObjReplace _ANSI_ARGS_((Tcl_Interp *interp, 1604 Tcl_Obj *listPtr, int first, int count, 1605 int objc, Tcl_Obj *CONST objv[])); 1606EXTERN void Tcl_Main _ANSI_ARGS_((int argc, char **argv, 1607 Tcl_AppInitProc *appInitProc)); 1608EXTERN Tcl_Channel Tcl_MakeFileChannel _ANSI_ARGS_((ClientData handle, 1609 int mode)); 1610EXTERN int Tcl_MakeSafe _ANSI_ARGS_((Tcl_Interp *interp)); 1611EXTERN Tcl_Channel Tcl_MakeTcpClientChannel _ANSI_ARGS_(( 1612 ClientData tcpSocket)); 1613EXTERN char * Tcl_Merge _ANSI_ARGS_((int argc, char **argv)); 1614#ifdef TCL_THREADS 1615EXTERN void Tcl_MutexLock _ANSI_ARGS_((Tcl_Mutex *mutexPtr)); 1616EXTERN void Tcl_MutexUnlock _ANSI_ARGS_((Tcl_Mutex *mutexPtr)); 1617EXTERN void Tcl_ConditionNotify _ANSI_ARGS_((Tcl_Condition *condPtr)); 1618EXTERN void Tcl_ConditionWait _ANSI_ARGS_((Tcl_Condition *condPtr, 1619 Tcl_Mutex *mutexPtr, Tcl_Time *timePtr)); 1620#else 1621#define Tcl_MutexLock(mutexPtr) 1622#define Tcl_MutexUnlock(mutexPtr) 1623#define Tcl_ConditionNotify(condPtr) 1624#define Tcl_ConditionWait(condPtr, mutexPtr, timePtr) 1625#endif /* TCL_THREADS */ 1626EXTERN Tcl_HashEntry * Tcl_NextHashEntry _ANSI_ARGS_(( 1627 Tcl_HashSearch *searchPtr)); 1628EXTERN void Tcl_NotifyChannel _ANSI_ARGS_((Tcl_Channel channel, 1629 int mask)); 1630EXTERN int Tcl_NumUtfChars _ANSI_ARGS_((CONST char *src, 1631 int len)); 1632EXTERN Tcl_Channel Tcl_OpenCommandChannel _ANSI_ARGS_(( 1633 Tcl_Interp *interp, int argc, char **argv, 1634 int flags)); 1635EXTERN Tcl_Channel Tcl_OpenFileChannel _ANSI_ARGS_((Tcl_Interp *interp, 1636 char *fileName, char *modeString, 1637 int permissions)); 1638EXTERN Tcl_Channel Tcl_OpenTcpClient _ANSI_ARGS_((Tcl_Interp *interp, 1639 int port, char *address, char *myaddr, 1640 int myport, int async)); 1641EXTERN Tcl_Channel Tcl_OpenTcpServer _ANSI_ARGS_((Tcl_Interp *interp, 1642 int port, char *host, 1643 Tcl_TcpAcceptProc *acceptProc, 1644 ClientData callbackData)); 1645EXTERN char * Tcl_ParseVar _ANSI_ARGS_((Tcl_Interp *interp, 1646 char *string, char **termPtr)); 1647EXTERN int Tcl_PkgProvide _ANSI_ARGS_((Tcl_Interp *interp, 1648 char *name, char *version)); 1649EXTERN char * Tcl_PkgRequire _ANSI_ARGS_((Tcl_Interp *interp, 1650 char *name, char *version, int exact)); 1651EXTERN char * Tcl_PosixError _ANSI_ARGS_((Tcl_Interp *interp)); 1652EXTERN void Tcl_Preserve _ANSI_ARGS_((ClientData data)); 1653EXTERN void Tcl_PrintDouble _ANSI_ARGS_((Tcl_Interp *interp, 1654 double value, char *dst)); 1655EXTERN int Tcl_PutEnv _ANSI_ARGS_((CONST char *string)); 1656EXTERN void Tcl_QueueEvent _ANSI_ARGS_((Tcl_Event *evPtr, 1657 Tcl_QueuePosition position)); 1658EXTERN int Tcl_Read _ANSI_ARGS_((Tcl_Channel chan, 1659 char *bufPtr, int toRead)); 1660EXTERN int Tcl_ReadChars _ANSI_ARGS_((Tcl_Channel channel, 1661 Tcl_Obj *objPtr, int charsToRead, int appendFlag)); 1662EXTERN void Tcl_ReapDetachedProcs _ANSI_ARGS_((void)); 1663EXTERN int Tcl_RecordAndEval _ANSI_ARGS_((Tcl_Interp *interp, 1664 char *cmd, int flags)); 1665EXTERN int Tcl_RecordAndEvalObj _ANSI_ARGS_((Tcl_Interp *interp, 1666 Tcl_Obj *cmdPtr, int flags)); 1667EXTERN Tcl_RegExp Tcl_RegExpCompile _ANSI_ARGS_((Tcl_Interp *interp, 1668 char *string)); 1669EXTERN int Tcl_RegExpExec _ANSI_ARGS_((Tcl_Interp *interp, 1670 Tcl_RegExp re, CONST char *string, 1671 CONST char *start)); 1672EXTERN int Tcl_RegExpMatch _ANSI_ARGS_((Tcl_Interp *interp, 1673 char *string, char *pattern)); 1674EXTERN void Tcl_RegExpRange _ANSI_ARGS_((Tcl_RegExp re, 1675 int index, char **startPtr, char **endPtr)); 1676EXTERN void Tcl_RegisterChannel _ANSI_ARGS_((Tcl_Interp *interp, 1677 Tcl_Channel chan)); 1678EXTERN void Tcl_RegisterObjType _ANSI_ARGS_(( 1679 Tcl_ObjType *typePtr)); 1680EXTERN void Tcl_Release _ANSI_ARGS_((ClientData clientData)); 1681EXTERN void Tcl_ResetResult _ANSI_ARGS_((Tcl_Interp *interp)); 1682EXTERN void Tcl_RestoreResult _ANSI_ARGS_((Tcl_Interp *interp, 1683 Tcl_SavedResult *statePtr)); 1684#define Tcl_Return Tcl_SetResult 1685EXTERN void Tcl_SaveResult _ANSI_ARGS_((Tcl_Interp *interp, 1686 Tcl_SavedResult *statePtr)); 1687EXTERN int Tcl_ScanCountedElement _ANSI_ARGS_((CONST char *string, 1688 int length, int *flagPtr)); 1689EXTERN int Tcl_ScanElement _ANSI_ARGS_((CONST char *string, 1690 int *flagPtr)); 1691EXTERN int Tcl_Seek _ANSI_ARGS_((Tcl_Channel chan, 1692 int offset, int mode)); 1693EXTERN int Tcl_ServiceAll _ANSI_ARGS_((void)); 1694EXTERN int Tcl_ServiceEvent _ANSI_ARGS_((int flags)); 1695EXTERN void Tcl_SetAssocData _ANSI_ARGS_((Tcl_Interp *interp, 1696 char *name, Tcl_InterpDeleteProc *proc, 1697 ClientData clientData)); 1698EXTERN void Tcl_SetBooleanObj _ANSI_ARGS_((Tcl_Obj *objPtr, 1699 int boolValue)); 1700EXTERN unsigned char * Tcl_SetByteArrayLength _ANSI_ARGS_((Tcl_Obj *objPtr, 1701 int length)); 1702EXTERN void Tcl_SetByteArrayObj _ANSI_ARGS_((Tcl_Obj *objPtr, 1703 unsigned char *bytes, int length)); 1704EXTERN void Tcl_SetChannelBufferSize _ANSI_ARGS_(( 1705 Tcl_Channel chan, int sz)); 1706EXTERN int Tcl_SetChannelOption _ANSI_ARGS_(( 1707 Tcl_Interp *interp, Tcl_Channel chan, 1708 char *optionName, char *newValue)); 1709EXTERN int Tcl_SetCommandInfo _ANSI_ARGS_((Tcl_Interp *interp, 1710 char *cmdName, Tcl_CmdInfo *infoPtr)); 1711EXTERN void Tcl_SetDoubleObj _ANSI_ARGS_((Tcl_Obj *objPtr, 1712 double doubleValue)); 1713EXTERN void Tcl_SetErrno _ANSI_ARGS_((int err)); 1714EXTERN void Tcl_SetErrorCode _ANSI_ARGS_( 1715 TCL_VARARGS(Tcl_Interp *,arg1)); 1716EXTERN void Tcl_SetIntObj _ANSI_ARGS_((Tcl_Obj *objPtr, 1717 int intValue)); 1718EXTERN void Tcl_SetListObj _ANSI_ARGS_((Tcl_Obj *objPtr, 1719 int objc, Tcl_Obj *CONST objv[])); 1720EXTERN void Tcl_SetLongObj _ANSI_ARGS_((Tcl_Obj *objPtr, 1721 long longValue)); 1722EXTERN void Tcl_SetMaxBlockTime _ANSI_ARGS_((Tcl_Time *timePtr)); 1723EXTERN void Tcl_SetObjErrorCode _ANSI_ARGS_((Tcl_Interp *interp, 1724 Tcl_Obj *errorObjPtr)); 1725EXTERN void Tcl_SetObjLength _ANSI_ARGS_((Tcl_Obj *objPtr, 1726 int length)); 1727EXTERN void Tcl_SetObjResult _ANSI_ARGS_((Tcl_Interp *interp, 1728 Tcl_Obj *resultObjPtr)); 1729EXTERN Tcl_Obj * Tcl_SetObjVar2 _ANSI_ARGS_((Tcl_Interp *interp, 1730 char *part1, char *part2, Tcl_Obj *newValuePtr, 1731 int flags)); 1732EXTERN void Tcl_SetPanicProc _ANSI_ARGS_((void (*proc) 1733 _ANSI_ARGS_(TCL_VARARGS(char *, format)))); 1734EXTERN int Tcl_SetRecursionLimit _ANSI_ARGS_((Tcl_Interp *interp, 1735 int depth)); 1736EXTERN void Tcl_SetResult _ANSI_ARGS_((Tcl_Interp *interp, 1737 char *string, Tcl_FreeProc *freeProc)); 1738EXTERN int Tcl_SetServiceMode _ANSI_ARGS_((int mode)); 1739EXTERN void Tcl_SetStdChannel _ANSI_ARGS_((Tcl_Channel channel, 1740 int type)); 1741EXTERN void Tcl_SetStringObj _ANSI_ARGS_((Tcl_Obj *objPtr, 1742 char *bytes, int length)); 1743EXTERN void Tcl_SetTimer _ANSI_ARGS_((Tcl_Time *timePtr)); 1744EXTERN int Tcl_SetSystemEncoding _ANSI_ARGS_((Tcl_Interp *interp, 1745 CONST char *name)); 1746EXTERN char * Tcl_SetVar _ANSI_ARGS_((Tcl_Interp *interp, 1747 char *varName, char *newValue, int flags)); 1748EXTERN char * Tcl_SetVar2 _ANSI_ARGS_((Tcl_Interp *interp, 1749 char *part1, char *part2, char *newValue, 1750 int flags)); 1751EXTERN char * Tcl_SignalId _ANSI_ARGS_((int sig)); 1752EXTERN char * Tcl_SignalMsg _ANSI_ARGS_((int sig)); 1753EXTERN void Tcl_Sleep _ANSI_ARGS_((int ms)); 1754EXTERN void Tcl_SourceRCFile _ANSI_ARGS_((Tcl_Interp *interp)); 1755EXTERN int Tcl_SplitList _ANSI_ARGS_((Tcl_Interp *interp, 1756 CONST char *list, int *argcPtr, char ***argvPtr)); 1757EXTERN void Tcl_SplitPath _ANSI_ARGS_((CONST char *path, 1758 int *argcPtr, char ***argvPtr)); 1759EXTERN void Tcl_StaticPackage _ANSI_ARGS_((Tcl_Interp *interp, 1760 char *pkgName, Tcl_PackageInitProc *initProc, 1761 Tcl_PackageInitProc *safeInitProc)); 1762EXTERN int Tcl_StringMatch _ANSI_ARGS_((CONST char *string, 1763 CONST char *pattern)); 1764EXTERN int Tcl_Tell _ANSI_ARGS_((Tcl_Channel chan)); 1765EXTERN void Tcl_ThreadAlert _ANSI_ARGS_((Tcl_ThreadId threadId)); 1766EXTERN void Tcl_ThreadQueueEvent _ANSI_ARGS_(( 1767 Tcl_ThreadId threadId, Tcl_Event* evPtr, 1768 Tcl_QueuePosition position)); 1769#define Tcl_TildeSubst Tcl_TranslateFileName 1770EXTERN int Tcl_TraceVar _ANSI_ARGS_((Tcl_Interp *interp, 1771 char *varName, int flags, Tcl_VarTraceProc *proc, 1772 ClientData clientData)); 1773EXTERN int Tcl_TraceVar2 _ANSI_ARGS_((Tcl_Interp *interp, 1774 char *part1, char *part2, int flags, 1775 Tcl_VarTraceProc *proc, ClientData clientData)); 1776EXTERN char * Tcl_TranslateFileName _ANSI_ARGS_((Tcl_Interp *interp, 1777 char *name, Tcl_DString *bufferPtr)); 1778EXTERN int Tcl_Ungets _ANSI_ARGS_((Tcl_Channel chan, char *str, 1779 int len, int atHead)); 1780EXTERN Tcl_UniChar Tcl_UniCharAtIndex _ANSI_ARGS_((CONST char *src, 1781 int index)); 1782EXTERN Tcl_UniChar Tcl_UniCharToLower _ANSI_ARGS_((int ch)); 1783EXTERN Tcl_UniChar Tcl_UniCharToTitle _ANSI_ARGS_((int ch)); 1784EXTERN Tcl_UniChar Tcl_UniCharToUpper _ANSI_ARGS_((int ch)); 1785EXTERN int Tcl_UniCharToUtf _ANSI_ARGS_((int ch, 1786 char *buf)); 1787EXTERN void Tcl_UnlinkVar _ANSI_ARGS_((Tcl_Interp *interp, 1788 char *varName)); 1789EXTERN int Tcl_UnregisterChannel _ANSI_ARGS_((Tcl_Interp *interp, 1790 Tcl_Channel chan)); 1791EXTERN int Tcl_UnsetVar _ANSI_ARGS_((Tcl_Interp *interp, 1792 char *varName, int flags)); 1793EXTERN int Tcl_UnsetVar2 _ANSI_ARGS_((Tcl_Interp *interp, 1794 char *part1, char *part2, int flags)); 1795EXTERN void Tcl_UntraceVar _ANSI_ARGS_((Tcl_Interp *interp, 1796 char *varName, int flags, Tcl_VarTraceProc *proc, 1797 ClientData clientData)); 1798EXTERN void Tcl_UntraceVar2 _ANSI_ARGS_((Tcl_Interp *interp, 1799 char *part1, char *part2, int flags, 1800 Tcl_VarTraceProc *proc, ClientData clientData)); 1801EXTERN void Tcl_UpdateLinkedVar _ANSI_ARGS_((Tcl_Interp *interp, 1802 char *varName)); 1803EXTERN int Tcl_UpVar _ANSI_ARGS_((Tcl_Interp *interp, 1804 char *frameName, char *varName, 1805 char *localName, int flags)); 1806EXTERN int Tcl_UpVar2 _ANSI_ARGS_((Tcl_Interp *interp, 1807 char *frameName, char *part1, char *part2, 1808 char *localName, int flags)); 1809EXTERN char * Tcl_UtfAtIndex _ANSI_ARGS_((CONST char *src, 1810 int index)); 1811EXTERN int Tcl_UtfCharComplete _ANSI_ARGS_((CONST char *src, 1812 int len)); 1813EXTERN int Tcl_UtfBackslash _ANSI_ARGS_((CONST char *src, 1814 int *readPtr, char *dst)); 1815EXTERN char * Tcl_UtfFindFirst _ANSI_ARGS_((CONST char *src, 1816 int ch)); 1817EXTERN char * Tcl_UtfFindLast _ANSI_ARGS_((CONST char *src, 1818 int ch)); 1819EXTERN int Tcl_UtfIsLower _ANSI_ARGS_((CONST char *src)); 1820EXTERN int Tcl_UtfIsUpper _ANSI_ARGS_((CONST char *src)); 1821EXTERN char * Tcl_UtfNext _ANSI_ARGS_((CONST char *src)); 1822EXTERN char * Tcl_UtfPrev _ANSI_ARGS_((CONST char *src, 1823 CONST char *start)); 1824EXTERN int Tcl_UtfToExternal _ANSI_ARGS_((Tcl_Interp *interp, 1825 Tcl_Encoding encoding, CONST char *src, int srcLen, 1826 int flags, Tcl_EncodingState *statePtr, char *dst, 1827 int dstLen, int *srcReadPtr, int *dstWrotePtr, 1828 int *dstCharsPtr)); 1829EXTERN char * Tcl_UtfToExternalDString _ANSI_ARGS_(( 1830 Tcl_Encoding encoding, CONST char *src, 1831 int srcLen, Tcl_DString *dsPtr)); 1832EXTERN int Tcl_UtfToLower _ANSI_ARGS_((char *src)); 1833EXTERN int Tcl_UtfToTitle _ANSI_ARGS_((char *src)); 1834EXTERN int Tcl_UtfToUniChar _ANSI_ARGS_((CONST char *src, 1835 Tcl_UniChar *chPtr)); 1836EXTERN int Tcl_UtfToUpper _ANSI_ARGS_((char *src)); 1837EXTERN int Tcl_VarEval _ANSI_ARGS_( 1838 TCL_VARARGS(Tcl_Interp *,interp)); 1839EXTERN ClientData Tcl_VarTraceInfo _ANSI_ARGS_((Tcl_Interp *interp, 1840 char *varName, int flags, 1841 Tcl_VarTraceProc *procPtr, 1842 ClientData prevClientData)); 1843EXTERN ClientData Tcl_VarTraceInfo2 _ANSI_ARGS_((Tcl_Interp *interp, 1844 char *part1, char *part2, int flags, 1845 Tcl_VarTraceProc *procPtr, 1846 ClientData prevClientData)); 1847EXTERN int Tcl_WaitForEvent _ANSI_ARGS_((Tcl_Time *timePtr)); 1848EXTERN Tcl_Pid Tcl_WaitPid _ANSI_ARGS_((Tcl_Pid pid, int *statPtr, 1849 int options)); 1850EXTERN int Tcl_Write _ANSI_ARGS_((Tcl_Channel chan, 1851 char *src, int srcLen)); 1852EXTERN int Tcl_WriteChars _ANSI_ARGS_((Tcl_Channel chan, 1853 CONST char *src, int srcLen)); 1854EXTERN int Tcl_WriteObj _ANSI_ARGS_((Tcl_Channel chan, 1855 Tcl_Obj *objPtr)); 1856EXTERN void Tcl_WrongNumArgs _ANSI_ARGS_((Tcl_Interp *interp, 1857 int objc, Tcl_Obj *CONST objv[], char *message)); 1858 1859#endif /* RESOURCE_INCLUDED */ 1860 1861#undef TCL_STORAGE_CLASS 1862#define TCL_STORAGE_CLASS DLLIMPORT 1863 1864#endif /* _TCL */ 1865