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