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) 1994-1996 Sun Microsystems, Inc. 9 * 10 * See the file "license.terms" for information on usage and redistribution 11 * of this file, and for a DISCLAIMER OF ALL WARRANTIES. 12 * 13 * SCCS: @(#) tcl.h 1.302 97/01/22 08:47:54 14 */ 15 16#ifndef _TCL 17#define _TCL 18 19/* 20 * When version numbers change here, must also go into the following files 21 * and update the version numbers: 22 * 23 * library/init.tcl 24 * unix/configure.in 25 * unix/pkginfo 26 * win/makefile.bc 27 * win/makefile.vc 28 * 29 * The release level should be 0 for alpha, 1 for beta, and 2 for 30 * final/patch. The release serial value is the number that follows the 31 * "a", "b", or "p" in the patch level; for example, if the patch level 32 * is 7.6b2, TCL_RELEASE_SERIAL is 2. It restarts at 1 whenever the 33 * release level is changed, except for the final release which is 0 34 * (the first patch will start at 1). 35 */ 36 37#define TCL_MAJOR_VERSION 8 38#define TCL_MINOR_VERSION 0 39#define TCL_RELEASE_LEVEL 0 40#define TCL_RELEASE_SERIAL 2 41 42#define TCL_VERSION "8.0" 43#define TCL_PATCH_LEVEL "8.0a2" 44 45/* 46 * The following definitions set up the proper options for Windows 47 * compilers. We use this method because there is no autoconf equivalent. 48 */ 49 50#ifndef __WIN32__ 51# if defined(_WIN32) || defined(WIN32) 52# define __WIN32__ 53# endif 54#endif 55 56#ifdef __WIN32__ 57# ifndef STRICT 58# define STRICT 59# endif 60# ifndef USE_PROTOTYPE 61# define USE_PROTOTYPE 1 62# endif 63# ifndef HAS_STDARG 64# define HAS_STDARG 1 65# endif 66# ifndef USE_PROTOTYPE 67# define USE_PROTOTYPE 1 68# endif 69# ifndef USE_TCLALLOC 70# define USE_TCLALLOC 1 71# endif 72# ifndef STRINGIFY 73# define STRINGIFY(x) STRINGIFY1(x) 74# define STRINGIFY1(x) #x 75# endif 76#endif /* __WIN32__ */ 77 78/* 79 * The following definitions set up the proper options for Macintosh 80 * compilers. We use this method because there is no autoconf equivalent. 81 */ 82 83#ifdef MAC_TCL 84# ifndef HAS_STDARG 85# define HAS_STDARG 1 86# endif 87# ifndef USE_TCLALLOC 88# define USE_TCLALLOC 1 89# endif 90# ifndef NO_STRERROR 91# define NO_STRERROR 1 92# endif 93#endif 94 95/* 96 * A special definition used to allow this header file to be included 97 * in resource files so that they can get obtain version information from 98 * this file. Resource compilers don't like all the C stuff, like typedefs 99 * and procedure declarations, that occur below. 100 */ 101 102#ifndef RESOURCE_INCLUDED 103 104#ifndef BUFSIZ 105#include <stdio.h> 106#endif 107 108/* 109 * Definitions that allow Tcl functions with variable numbers of 110 * arguments to be used with either varargs.h or stdarg.h. TCL_VARARGS 111 * is used in procedure prototypes. TCL_VARARGS_DEF is used to declare 112 * the arguments in a function definiton: it takes the type and name of 113 * the first argument and supplies the appropriate argument declaration 114 * string for use in the function definition. TCL_VARARGS_START 115 * initializes the va_list data structure and returns the first argument. 116 */ 117 118#if defined(__STDC__) || defined(HAS_STDARG) 119# define TCL_VARARGS(type, name) (type name, ...) 120# define TCL_VARARGS_DEF(type, name) (type name, ...) 121# define TCL_VARARGS_START(type, name, list) (va_start(list, name), name) 122#else 123# ifdef __cplusplus 124# define TCL_VARARGS(type, name) (type name, ...) 125# define TCL_VARARGS_DEF(type, name) (type va_alist, ...) 126# else 127# define TCL_VARARGS(type, name) () 128# define TCL_VARARGS_DEF(type, name) (va_alist) 129# endif 130# define TCL_VARARGS_START(type, name, list) \ 131 (va_start(list), va_arg(list, type)) 132#endif 133 134/* 135 * Definitions that allow this header file to be used either with or 136 * without ANSI C features like function prototypes. 137 */ 138 139#undef _ANSI_ARGS_ 140#undef CONST 141 142#if ((defined(__STDC__) || defined(SABER)) && !defined(NO_PROTOTYPE)) || defined(__cplusplus) || defined(USE_PROTOTYPE) 143# define _USING_PROTOTYPES_ 1 144# define _ANSI_ARGS_(x) x 145# define CONST const 146#else 147# define _ANSI_ARGS_(x) () 148# define CONST 149#endif 150 151#ifdef __cplusplus 152# define EXTERN extern "C" 153#else 154# define EXTERN extern 155#endif 156 157/* 158 * Macro to use instead of "void" for arguments that must have 159 * type "void *" in ANSI C; maps them to type "char *" in 160 * non-ANSI systems. 161 */ 162#ifndef __WIN32__ 163#ifndef VOID 164# ifdef __STDC__ 165# define VOID void 166# else 167# define VOID char 168# endif 169#endif 170#else /* __WIN32__ */ 171/* 172 * The following code is copied from winnt.h 173 */ 174#ifndef VOID 175#define VOID void 176typedef char CHAR; 177typedef short SHORT; 178typedef long LONG; 179#endif 180#endif /* __WIN32__ */ 181 182/* 183 * Miscellaneous declarations. 184 */ 185 186#ifndef NULL 187#define NULL 0 188#endif 189 190#ifndef _CLIENTDATA 191# if defined(__STDC__) || defined(__cplusplus) 192 typedef void *ClientData; 193# else 194 typedef int *ClientData; 195# endif /* __STDC__ */ 196#define _CLIENTDATA 197#endif 198 199/* 200 * Data structures defined opaquely in this module. The definitions 201 * below just provide dummy types. A few fields are made visible in 202 * Tcl_Interp structures, namely those for returning string values. 203 * Note: any change to the Tcl_Interp definition below must be mirrored 204 * in the "real" definition in tclInt.h. 205 * Note: Tcl_ObjCmdProc procedures do not directly set result and freeProc. 206 * Instead, they set a Tcl_Obj member in the "real" structure that can be 207 * accessed with Tcl_GetObjResult() and Tcl_SetObjResult(). 208 */ 209 210typedef struct Tcl_Interp { 211 char *result; /* Points to result string returned by last 212 * command. */ 213 void (*freeProc) _ANSI_ARGS_((char *blockPtr)); 214 /* Zero means result is statically allocated. 215 * TCL_DYNAMIC means result was allocated with 216 * ckalloc and should be freed with ckfree. 217 * Other values give address of procedure 218 * to invoke to free the result. Must be 219 * freed by Tcl_Eval before executing next 220 * command. */ 221 int errorLine; /* When TCL_ERROR is returned, this gives 222 * the line number within the command where 223 * the error occurred (1 means first line). */ 224} Tcl_Interp; 225 226typedef struct Tcl_AsyncHandler_ *Tcl_AsyncHandler; 227typedef struct Tcl_Command_ *Tcl_Command; 228typedef struct Tcl_Event Tcl_Event; 229typedef struct Tcl_File_ *Tcl_File; 230typedef struct Tcl_Channel_ *Tcl_Channel; 231typedef struct Tcl_RegExp_ *Tcl_RegExp; 232typedef struct Tcl_TimerToken_ *Tcl_TimerToken; 233typedef struct Tcl_Trace_ *Tcl_Trace; 234typedef struct Tcl_Pid_ *Tcl_Pid; 235 236/* 237 * When a TCL command returns, the string pointer interp->result points to 238 * a string containing return information from the command. In addition, 239 * the command procedure returns an integer value, which is one of the 240 * following: 241 * 242 * TCL_OK Command completed normally; interp->result contains 243 * the command's result. 244 * TCL_ERROR The command couldn't be completed successfully; 245 * interp->result describes what went wrong. 246 * TCL_RETURN The command requests that the current procedure 247 * return; interp->result contains the procedure's 248 * return value. 249 * TCL_BREAK The command requests that the innermost loop 250 * be exited; interp->result is meaningless. 251 * TCL_CONTINUE Go on to the next iteration of the current loop; 252 * interp->result is meaningless. 253 */ 254 255#define TCL_OK 0 256#define TCL_ERROR 1 257#define TCL_RETURN 2 258#define TCL_BREAK 3 259#define TCL_CONTINUE 4 260 261#define TCL_RESULT_SIZE 200 262 263/* 264 * Argument descriptors for math function callbacks in expressions: 265 */ 266 267typedef enum {TCL_INT, TCL_DOUBLE, TCL_EITHER} Tcl_ValueType; 268typedef struct Tcl_Value { 269 Tcl_ValueType type; /* Indicates intValue or doubleValue is 270 * valid, or both. */ 271 long intValue; /* Integer value. */ 272 double doubleValue; /* Double-precision floating value. */ 273} Tcl_Value; 274 275/* 276 * Forward declaration of Tcl_Obj to prevent an error when the forward 277 * reference to Tcl_Obj is encountered in the procedure types declared 278 * below. 279 */ 280 281struct Tcl_Obj; 282 283/* 284 * Procedure types defined by Tcl: 285 */ 286 287typedef int (Tcl_AppInitProc) _ANSI_ARGS_((Tcl_Interp *interp)); 288typedef int (Tcl_AsyncProc) _ANSI_ARGS_((ClientData clientData, 289 Tcl_Interp *interp, int code)); 290typedef void (Tcl_ChannelProc) _ANSI_ARGS_((ClientData clientData, int mask)); 291typedef void (Tcl_CloseProc) _ANSI_ARGS_((ClientData data)); 292typedef void (Tcl_CmdDeleteProc) _ANSI_ARGS_((ClientData clientData)); 293typedef int (Tcl_CmdProc) _ANSI_ARGS_((ClientData clientData, 294 Tcl_Interp *interp, int argc, char *argv[])); 295typedef void (Tcl_CmdTraceProc) _ANSI_ARGS_((ClientData clientData, 296 Tcl_Interp *interp, int level, char *command, Tcl_CmdProc *proc, 297 ClientData cmdClientData, int argc, char *argv[])); 298typedef void (Tcl_DupInternalRepProc) _ANSI_ARGS_((struct Tcl_Obj *srcPtr, 299 struct Tcl_Obj *dupPtr)); 300typedef int (Tcl_EventProc) _ANSI_ARGS_((Tcl_Event *evPtr, int flags)); 301typedef void (Tcl_EventCheckProc) _ANSI_ARGS_((ClientData clientData, 302 int flags)); 303typedef int (Tcl_EventDeleteProc) _ANSI_ARGS_((Tcl_Event *evPtr, 304 ClientData clientData)); 305typedef void (Tcl_EventSetupProc) _ANSI_ARGS_((ClientData clientData, 306 int flags)); 307typedef void (Tcl_ExitProc) _ANSI_ARGS_((ClientData clientData)); 308typedef void (Tcl_FileProc) _ANSI_ARGS_((ClientData clientData, int mask)); 309typedef void (Tcl_FileFreeProc) _ANSI_ARGS_((ClientData clientData)); 310typedef void (Tcl_FreeInternalRepProc) _ANSI_ARGS_((struct Tcl_Obj *objPtr)); 311typedef void (Tcl_FreeProc) _ANSI_ARGS_((char *blockPtr)); 312typedef void (Tcl_IdleProc) _ANSI_ARGS_((ClientData clientData)); 313typedef void (Tcl_InterpDeleteProc) _ANSI_ARGS_((ClientData clientData, 314 Tcl_Interp *interp)); 315typedef int (Tcl_MathProc) _ANSI_ARGS_((ClientData clientData, 316 Tcl_Interp *interp, Tcl_Value *args, Tcl_Value *resultPtr)); 317typedef int (Tcl_ObjCmdProc) _ANSI_ARGS_((ClientData clientData, 318 Tcl_Interp *interp, int objc, struct Tcl_Obj *objv[])); 319typedef int (Tcl_PackageInitProc) _ANSI_ARGS_((Tcl_Interp *interp)); 320typedef void (Tcl_TcpAcceptProc) _ANSI_ARGS_((ClientData callbackData, 321 Tcl_Channel chan, char *address, int port)); 322typedef void (Tcl_TimerProc) _ANSI_ARGS_((ClientData clientData)); 323typedef int (Tcl_SetFromAnyProc) _ANSI_ARGS_((Tcl_Interp *interp, 324 struct Tcl_Obj *objPtr)); 325typedef void (Tcl_UpdateStringProc) _ANSI_ARGS_((struct Tcl_Obj *objPtr)); 326typedef char *(Tcl_VarTraceProc) _ANSI_ARGS_((ClientData clientData, 327 Tcl_Interp *interp, char *part1, char *part2, int flags)); 328 329/* 330 * The following structure represents a type of object, which is a 331 * particular internal representation for an object plus a set of 332 * procedures that provide standard operations on objects of that type. 333 */ 334 335typedef struct Tcl_ObjType { 336 char *name; /* Name of the type, e.g. "int". */ 337 Tcl_FreeInternalRepProc *freeIntRepProc; 338 /* Called to free any storage for the type's 339 * internal rep. NULL if the internal rep 340 * does not need freeing. */ 341 Tcl_DupInternalRepProc *dupIntRepProc; 342 /* Called to create a new object as a copy 343 * of an existing object. */ 344 Tcl_UpdateStringProc *updateStringProc; 345 /* Called to update the string rep from the 346 * type's internal representation. */ 347 Tcl_SetFromAnyProc *setFromAnyProc; 348 /* Called to convert the object's internal 349 * rep to this type. Frees the internal rep 350 * of the old type. Returns TCL_ERROR on 351 * failure. */ 352} Tcl_ObjType; 353 354/* 355 * One of the following structures exists for each object in the Tcl 356 * system. An object stores a value as either a string, some internal 357 * representation, or both. 358 */ 359 360typedef struct Tcl_Obj { 361 int refCount; /* When 0 the object will be freed. */ 362 char *bytes; /* This points to the first byte of the 363 * object's string representation. The 364 * array must be followed by a null byte 365 * (i.e., at offset length) but may also 366 * contain embedded null characters. The 367 * array's storage is allocated by 368 * ckalloc. NULL indicates the string 369 * rep is empty or invalid and must be 370 * regenerated from the internal rep. 371 * Clients should use 372 * Tcl_GetStringFromObj to get a pointer 373 * to the byte array as a readonly 374 * value. As a special case, if both 375 * bytes and typePtr are NULL, the 376 * object represents an empty string. */ 377 int length; /* The number of bytes at *bytes, not 378 * including the terminating null. */ 379 Tcl_ObjType *typePtr; /* Denotes the object's type. Always 380 * corresponds to the type of the object's 381 * internal rep. NULL indicates the object 382 * has no internal rep (has no type). If 383 * both string and typePtr are NULL, the 384 * Tcl_Obj represents an empty string. */ 385 union { /* The internal representation: */ 386 long intValue; /* - an integer value */ 387 double doubleValue; /* - a double-precision floating value */ 388 VOID *otherValuePtr; /* - another, type-specific value */ 389 struct { /* - internal rep as two pointers */ 390 VOID *ptr1; 391 VOID *ptr2; 392 } twoPtrValue; 393 } internalRep; 394} Tcl_Obj; 395 396/* 397 * Macros to increment and decrement a Tcl_Obj's reference count, and to 398 * test whether an object is shared (i.e. has reference count > 1). 399 * Note: clients should use Tcl_DecrRefCount() when they are finished using 400 * an object, and should never call TclFreeObj() directly. TclFreeObj() is 401 * only defined and made public in tcl.h to support Tcl_DecrRefCount's macro 402 * definition. Note also that Tcl_DecrRefCount() refers to the parameter 403 * "obj" twice. This means that you should avoid calling it with an 404 * expression that is expensive to compute or has side effects. 405 */ 406 407#define Tcl_IncrRefCount(objPtr) \ 408 ++(objPtr)->refCount 409#define Tcl_DecrRefCount(objPtr) \ 410 if (--(objPtr)->refCount <= 0) TclFreeObj(objPtr) 411#define Tcl_IsShared(objPtr) \ 412 ((objPtr)->refCount > 1) 413 414/* 415 * Macros and definitions that help to debug the use of Tcl objects. 416 * When TCL_MEM_DEBUG is defined, the Tcl_New* declarations are 417 * overridden to call debugging versions of the object creation procedures. 418 */ 419 420EXTERN Tcl_Obj * Tcl_NewBooleanObj _ANSI_ARGS_((int boolValue)); 421EXTERN Tcl_Obj * Tcl_NewDoubleObj _ANSI_ARGS_((double doubleValue)); 422EXTERN Tcl_Obj * Tcl_NewIntObj _ANSI_ARGS_((long intValue)); 423EXTERN Tcl_Obj * Tcl_NewListObj _ANSI_ARGS_((int objc, 424 Tcl_Obj **objv)); 425EXTERN Tcl_Obj * Tcl_NewObj _ANSI_ARGS_((void)); 426EXTERN Tcl_Obj * Tcl_NewStringObj _ANSI_ARGS_((char *bytes, 427 int length)); 428 429#ifdef TCL_MEM_DEBUG 430# define Tcl_NewBooleanObj(val) \ 431 Tcl_DbNewBooleanObj(val, __FILE__, __LINE__) 432# define Tcl_NewDoubleObj(val) \ 433 Tcl_DbNewDoubleObj(val, __FILE__, __LINE__) 434# define Tcl_NewIntObj(val) \ 435 Tcl_DbNewIntObj(val, __FILE__, __LINE__) 436# define Tcl_NewListObj(objc, objv) \ 437 Tcl_DbNewListObj(objc, objv, __FILE__, __LINE__) 438# define Tcl_NewObj() \ 439 Tcl_DbNewObj(__FILE__, __LINE__) 440# define Tcl_NewStringObj(bytes, len) \ 441 Tcl_DbNewStringObj(bytes, len, __FILE__, __LINE__) 442#endif /* TCL_MEM_DEBUG */ 443 444/* 445 * Information about commands that is returned by Tcl_GetCmdInfo and passed 446 * to Tcl_SetCmdInfo. proc is a traditional Tcl argc/argv string-based 447 * command procedure while objProc is an objc/objv object-based procedure. 448 * objProc is called directly by the bytecode interpreter whenever the 449 * command is invoked. proc is only called by the compatibility routine 450 * TclInvokeStringCommand when no object-based procedure was otherwise 451 * defined for a command. Tcl_CreateCommand and Tcl_CreateObjCommand 452 * ensure that both proc and objProc are non-NULL. 453 */ 454 455typedef struct Tcl_CmdInfo { 456 Tcl_CmdProc *proc; /* Command's string-based procedure. */ 457 Tcl_ObjCmdProc *objProc; /* Command's object-based procedure. */ 458 ClientData clientData; /* ClientData for string proc. */ 459 ClientData objClientData; /* ClientData for object proc. */ 460 Tcl_CmdDeleteProc *deleteProc; 461 /* Procedure to call when command is 462 * deleted. */ 463 ClientData deleteData; /* Value to pass to deleteProc (usually 464 * the same as clientData). */ 465} Tcl_CmdInfo; 466 467/* 468 * The structure defined below is used to hold dynamic strings. The only 469 * field that clients should use is the string field, and they should 470 * never modify it. 471 */ 472 473#define TCL_DSTRING_STATIC_SIZE 200 474typedef struct Tcl_DString { 475 char *string; /* Points to beginning of string: either 476 * staticSpace below or a malloc'ed array. */ 477 int length; /* Number of non-NULL characters in the 478 * string. */ 479 int spaceAvl; /* Total number of bytes available for the 480 * string and its terminating NULL char. */ 481 char staticSpace[TCL_DSTRING_STATIC_SIZE]; 482 /* Space to use in common case where string 483 * is small. */ 484} Tcl_DString; 485 486#define Tcl_DStringLength(dsPtr) ((dsPtr)->length) 487#define Tcl_DStringValue(dsPtr) ((dsPtr)->string) 488#define Tcl_DStringTrunc Tcl_DStringSetLength 489 490/* 491 * Definitions for the maximum number of digits of precision that may 492 * be specified in the "tcl_precision" variable, and the number of 493 * characters of buffer space required by Tcl_PrintDouble. 494 */ 495 496#define TCL_MAX_PREC 17 497#define TCL_DOUBLE_SPACE (TCL_MAX_PREC+10) 498 499/* 500 * Flag that may be passed to Tcl_ConvertElement to force it not to 501 * output braces (careful! if you change this flag be sure to change 502 * the definitions at the front of tclUtil.c). 503 */ 504 505#define TCL_DONT_USE_BRACES 1 506 507/* 508 * Flag values passed to Tcl_RecordAndEval. 509 * WARNING: these bit choices must not conflict with the bit choices 510 * for evalFlag bits in tclInt.h!! 511 */ 512 513#define TCL_NO_EVAL 0x10000 514#define TCL_EVAL_GLOBAL 0x20000 515 516/* 517 * Special freeProc values that may be passed to Tcl_SetResult (see 518 * the man page for details): 519 */ 520 521#define TCL_VOLATILE ((Tcl_FreeProc *) 1) 522#define TCL_STATIC ((Tcl_FreeProc *) 0) 523#define TCL_DYNAMIC ((Tcl_FreeProc *) 3) 524 525/* 526 * Flag values passed to variable-related procedures. 527 */ 528 529#define TCL_GLOBAL_ONLY 1 530#define TCL_APPEND_VALUE 2 531#define TCL_LIST_ELEMENT 4 532#define TCL_TRACE_READS 0x10 533#define TCL_TRACE_WRITES 0x20 534#define TCL_TRACE_UNSETS 0x40 535#define TCL_TRACE_DESTROYED 0x80 536#define TCL_INTERP_DESTROYED 0x100 537#define TCL_LEAVE_ERR_MSG 0x200 538#define TCL_PART1_NOT_PARSED 0x400 539 540/* 541 * Types for linked variables: 542 */ 543 544#define TCL_LINK_INT 1 545#define TCL_LINK_DOUBLE 2 546#define TCL_LINK_BOOLEAN 3 547#define TCL_LINK_STRING 4 548#define TCL_LINK_READ_ONLY 0x80 549 550/* 551 * The following declarations either map ckalloc and ckfree to 552 * malloc and free, or they map them to procedures with all sorts 553 * of debugging hooks defined in tclCkalloc.c. 554 */ 555 556EXTERN char * Tcl_Alloc _ANSI_ARGS_((unsigned int size)); 557EXTERN void Tcl_Free _ANSI_ARGS_((char *ptr)); 558EXTERN char * Tcl_Realloc _ANSI_ARGS_((char *ptr, 559 unsigned int size)); 560 561#ifdef TCL_MEM_DEBUG 562 563# define Tcl_Alloc(x) Tcl_DbCkalloc(x, __FILE__, __LINE__) 564# define Tcl_Free(x) Tcl_DbCkfree(x, __FILE__, __LINE__) 565# define Tcl_Realloc(x,y) Tcl_DbCkrealloc((x), (y),__FILE__, __LINE__) 566# define ckalloc(x) Tcl_DbCkalloc(x, __FILE__, __LINE__) 567# define ckfree(x) Tcl_DbCkfree(x, __FILE__, __LINE__) 568# define ckrealloc(x,y) Tcl_DbCkrealloc((x), (y),__FILE__, __LINE__) 569 570EXTERN int Tcl_DumpActiveMemory _ANSI_ARGS_((char *fileName)); 571EXTERN void Tcl_ValidateAllMemory _ANSI_ARGS_((char *file, 572 int line)); 573 574#else 575 576# if USE_TCLALLOC 577# define ckalloc(x) Tcl_Alloc(x) 578# define ckfree(x) Tcl_Free(x) 579# define ckrealloc(x,y) Tcl_Realloc(x,y) 580# else 581# define ckalloc(x) malloc(x) 582# define ckfree(x) free(x) 583# define ckrealloc(x,y) realloc(x,y) 584# endif 585# define Tcl_DumpActiveMemory(x) 586# define Tcl_ValidateAllMemory(x,y) 587 588#endif /* TCL_MEM_DEBUG */ 589 590/* 591 * Macros to free up result of interpreter. 592 */ 593 594#define Tcl_FreeResult(interp) \ 595 if ((interp)->freeProc != 0) { \ 596 if (((interp)->freeProc == TCL_DYNAMIC) \ 597 || ((interp)->freeProc == (Tcl_FreeProc *) free)) { \ 598 ckfree((interp)->result); \ 599 } else { \ 600 (*(interp)->freeProc)((interp)->result); \ 601 } \ 602 (interp)->freeProc = 0; \ 603 } 604 605/* 606 * Forward declaration of Tcl_HashTable. Needed by some C++ compilers 607 * to prevent errors when the forward reference to Tcl_HashTable is 608 * encountered in the Tcl_HashEntry structure. 609 */ 610 611#ifdef __cplusplus 612struct Tcl_HashTable; 613#endif 614 615/* 616 * Structure definition for an entry in a hash table. No-one outside 617 * Tcl should access any of these fields directly; use the macros 618 * defined below. 619 */ 620 621typedef struct Tcl_HashEntry { 622 struct Tcl_HashEntry *nextPtr; /* Pointer to next entry in this 623 * hash bucket, or NULL for end of 624 * chain. */ 625 struct Tcl_HashTable *tablePtr; /* Pointer to table containing entry. */ 626 struct Tcl_HashEntry **bucketPtr; /* Pointer to bucket that points to 627 * first entry in this entry's chain: 628 * used for deleting the entry. */ 629 ClientData clientData; /* Application stores something here 630 * with Tcl_SetHashValue. */ 631 union { /* Key has one of these forms: */ 632 char *oneWordValue; /* One-word value for key. */ 633 int words[1]; /* Multiple integer words for key. 634 * The actual size will be as large 635 * as necessary for this table's 636 * keys. */ 637 char string[4]; /* String for key. The actual size 638 * will be as large as needed to hold 639 * the key. */ 640 } key; /* MUST BE LAST FIELD IN RECORD!! */ 641} Tcl_HashEntry; 642 643/* 644 * Structure definition for a hash table. Must be in tcl.h so clients 645 * can allocate space for these structures, but clients should never 646 * access any fields in this structure. 647 */ 648 649#define TCL_SMALL_HASH_TABLE 4 650typedef struct Tcl_HashTable { 651 Tcl_HashEntry **buckets; /* Pointer to bucket array. Each 652 * element points to first entry in 653 * bucket's hash chain, or NULL. */ 654 Tcl_HashEntry *staticBuckets[TCL_SMALL_HASH_TABLE]; 655 /* Bucket array used for small tables 656 * (to avoid mallocs and frees). */ 657 int numBuckets; /* Total number of buckets allocated 658 * at **bucketPtr. */ 659 int numEntries; /* Total number of entries present 660 * in table. */ 661 int rebuildSize; /* Enlarge table when numEntries gets 662 * to be this large. */ 663 int downShift; /* Shift count used in hashing 664 * function. Designed to use high- 665 * order bits of randomized keys. */ 666 int mask; /* Mask value used in hashing 667 * function. */ 668 int keyType; /* Type of keys used in this table. 669 * It's either TCL_STRING_KEYS, 670 * TCL_ONE_WORD_KEYS, or an integer 671 * giving the number of ints that 672 * is the size of the key. 673 */ 674 Tcl_HashEntry *(*findProc) _ANSI_ARGS_((struct Tcl_HashTable *tablePtr, 675 CONST char *key)); 676 Tcl_HashEntry *(*createProc) _ANSI_ARGS_((struct Tcl_HashTable *tablePtr, 677 CONST char *key, int *newPtr)); 678} Tcl_HashTable; 679 680/* 681 * Structure definition for information used to keep track of searches 682 * through hash tables: 683 */ 684 685typedef struct Tcl_HashSearch { 686 Tcl_HashTable *tablePtr; /* Table being searched. */ 687 int nextIndex; /* Index of next bucket to be 688 * enumerated after present one. */ 689 Tcl_HashEntry *nextEntryPtr; /* Next entry to be enumerated in the 690 * the current bucket. */ 691} Tcl_HashSearch; 692 693/* 694 * Acceptable key types for hash tables: 695 */ 696 697#define TCL_STRING_KEYS 0 698#define TCL_ONE_WORD_KEYS 1 699 700/* 701 * Macros for clients to use to access fields of hash entries: 702 */ 703 704#define Tcl_GetHashValue(h) ((h)->clientData) 705#define Tcl_SetHashValue(h, value) ((h)->clientData = (ClientData) (value)) 706#define Tcl_GetHashKey(tablePtr, h) \ 707 ((char *) (((tablePtr)->keyType == TCL_ONE_WORD_KEYS) ? (h)->key.oneWordValue \ 708 : (h)->key.string)) 709 710/* 711 * Macros to use for clients to use to invoke find and create procedures 712 * for hash tables: 713 */ 714 715#define Tcl_FindHashEntry(tablePtr, key) \ 716 (*((tablePtr)->findProc))(tablePtr, key) 717#define Tcl_CreateHashEntry(tablePtr, key, newPtr) \ 718 (*((tablePtr)->createProc))(tablePtr, key, newPtr) 719 720/* 721 * Flag values to pass to Tcl_DoOneEvent to disable searches 722 * for some kinds of events: 723 */ 724 725#define TCL_DONT_WAIT (1<<1) 726#define TCL_WINDOW_EVENTS (1<<2) 727#define TCL_FILE_EVENTS (1<<3) 728#define TCL_TIMER_EVENTS (1<<4) 729#define TCL_IDLE_EVENTS (1<<5) /* WAS 0x10 ???? */ 730#define TCL_ALL_EVENTS (~TCL_DONT_WAIT) 731 732/* 733 * The following structure defines a generic event for the Tcl event 734 * system. These are the things that are queued in calls to Tcl_QueueEvent 735 * and serviced later by Tcl_DoOneEvent. There can be many different 736 * kinds of events with different fields, corresponding to window events, 737 * timer events, etc. The structure for a particular event consists of 738 * a Tcl_Event header followed by additional information specific to that 739 * event. 740 */ 741 742struct Tcl_Event { 743 Tcl_EventProc *proc; /* Procedure to call to service this event. */ 744 struct Tcl_Event *nextPtr; /* Next in list of pending events, or NULL. */ 745}; 746 747/* 748 * Positions to pass to Tk_QueueEvent: 749 */ 750 751typedef enum { 752 TCL_QUEUE_TAIL, TCL_QUEUE_HEAD, TCL_QUEUE_MARK 753} Tcl_QueuePosition; 754 755/* 756 * The following structure keeps is used to hold a time value, either as 757 * an absolute time (the number of seconds from the epoch) or as an 758 * elapsed time. On Unix systems the epoch is Midnight Jan 1, 1970 GMT. 759 * On Macintosh systems the epoch is Midnight Jan 1, 1904 GMT. 760 */ 761 762typedef struct Tcl_Time { 763 long sec; /* Seconds. */ 764 long usec; /* Microseconds. */ 765} Tcl_Time; 766 767/* 768 * Bits to pass to Tcl_CreateFileHandler and Tcl_CreateChannelHandler 769 * to indicate what sorts of events are of interest: 770 */ 771 772#define TCL_READABLE (1<<1) 773#define TCL_WRITABLE (1<<2) 774#define TCL_EXCEPTION (1<<3) 775 776/* 777 * Flag values to pass to Tcl_OpenCommandChannel to indicate the 778 * disposition of the stdio handles. TCL_STDIN, TCL_STDOUT, TCL_STDERR, 779 * are also used in Tcl_GetStdChannel. 780 */ 781 782#define TCL_STDIN (1<<1) 783#define TCL_STDOUT (1<<2) 784#define TCL_STDERR (1<<3) 785#define TCL_ENFORCE_MODE (1<<4) 786 787/* 788 * Typedefs for the various operations in a channel type: 789 */ 790 791typedef int (Tcl_DriverBlockModeProc) _ANSI_ARGS_((ClientData instanceData, 792 int mode)); 793typedef int (Tcl_DriverCloseProc) _ANSI_ARGS_((ClientData instanceData, 794 Tcl_Interp *interp)); 795typedef int (Tcl_DriverInputProc) _ANSI_ARGS_((ClientData instanceData, 796 char *buf, int toRead, int *errorCodePtr)); 797typedef int (Tcl_DriverOutputProc) _ANSI_ARGS_((ClientData instanceData, 798 char *buf, int toWrite, int *errorCodePtr)); 799typedef int (Tcl_DriverSeekProc) _ANSI_ARGS_((ClientData instanceData, 800 long offset, int mode, int *errorCodePtr)); 801typedef int (Tcl_DriverSetOptionProc) _ANSI_ARGS_(( 802 ClientData instanceData, Tcl_Interp *interp, 803 char *optionName, char *value)); 804typedef int (Tcl_DriverGetOptionProc) _ANSI_ARGS_(( 805 ClientData instanceData, char *optionName, 806 Tcl_DString *dsPtr)); 807typedef void (Tcl_DriverWatchChannelProc) _ANSI_ARGS_(( 808 ClientData instanceData, int mask)); 809typedef int (Tcl_DriverChannelReadyProc) _ANSI_ARGS_(( 810 ClientData instanceData, int mask)); 811typedef Tcl_File (Tcl_DriverGetFileProc) _ANSI_ARGS_((ClientData instanceData, 812 int mask)); 813 814/* 815 * Enum for different end of line translation and recognition modes. 816 */ 817 818typedef enum Tcl_EolTranslation { 819 TCL_TRANSLATE_AUTO, /* Eol == \r, \n and \r\n. */ 820 TCL_TRANSLATE_CR, /* Eol == \r. */ 821 TCL_TRANSLATE_LF, /* Eol == \n. */ 822 TCL_TRANSLATE_CRLF /* Eol == \r\n. */ 823} Tcl_EolTranslation; 824 825/* 826 * Enum for different byteorders. 827 */ 828 829typedef enum Tcl_ByteOrder { 830 TCL_BIGENDIAN, /* Multibyte words are stored with MSB first */ 831 TCL_SMALLENDIAN /* Multibyte words are stored with MSB last */ 832} Tcl_ByteOrder; 833 834/* 835 * struct Tcl_ChannelType: 836 * 837 * One such structure exists for each type (kind) of channel. 838 * It collects together in one place all the functions that are 839 * part of the specific channel type. 840 */ 841 842typedef struct Tcl_ChannelType { 843 char *typeName; /* The name of the channel type in Tcl 844 * commands. This storage is owned by 845 * channel type. */ 846 Tcl_DriverBlockModeProc *blockModeProc; 847 /* Set blocking mode for the 848 * raw channel. May be NULL. */ 849 Tcl_DriverCloseProc *closeProc; /* Procedure to call to close 850 * the channel. */ 851 Tcl_DriverInputProc *inputProc; /* Procedure to call for input 852 * on channel. */ 853 Tcl_DriverOutputProc *outputProc; /* Procedure to call for output 854 * on channel. */ 855 Tcl_DriverSeekProc *seekProc; /* Procedure to call to seek 856 * on the channel. May be NULL. */ 857 Tcl_DriverSetOptionProc *setOptionProc; 858 /* Set an option on a channel. */ 859 Tcl_DriverGetOptionProc *getOptionProc; 860 /* Get an option from a channel. */ 861 Tcl_DriverWatchChannelProc *watchChannelProc; 862 /* Set up the notifier to watch 863 * for events on this channel. */ 864 Tcl_DriverChannelReadyProc *channelReadyProc; 865 /* Check for events of interest on 866 * this channel. */ 867 Tcl_DriverGetFileProc *getFileProc; /* Get a Tcl_File from the channel 868 * or NULL if not supported. */ 869} Tcl_ChannelType; 870 871/* 872 * The following flags determine whether the blockModeProc above should 873 * set the channel into blocking or nonblocking mode. They are passed 874 * as arguments to the blockModeProc procedure in the above structure. 875 */ 876 877#define TCL_MODE_BLOCKING 0 /* Put channel into blocking mode. */ 878#define TCL_MODE_NONBLOCKING 1 /* Put channel into nonblocking 879 * mode. */ 880 881/* 882 * Types for file handles: 883 */ 884 885#define TCL_UNIX_FD 1 886#define TCL_MAC_FILE 2 887#define TCL_MAC_SOCKET 3 888#define TCL_WIN_PIPE 4 889#define TCL_WIN_FILE 5 890#define TCL_WIN_SOCKET 6 891#define TCL_WIN_CONSOLE 7 892#define TCL_WIN32S_PIPE 8 893 894/* 895 * Enum for different types of file paths. 896 */ 897 898typedef enum Tcl_PathType { 899 TCL_PATH_ABSOLUTE, 900 TCL_PATH_RELATIVE, 901 TCL_PATH_VOLUME_RELATIVE 902} Tcl_PathType; 903 904/* 905 * The following interface is exported for backwards compatibility, but 906 * is only implemented on Unix. Portable applications should use 907 * Tcl_OpenCommandChannel, instead. 908 */ 909 910EXTERN int Tcl_CreatePipeline _ANSI_ARGS_((Tcl_Interp *interp, 911 int argc, char **argv, Tcl_Pid **pidArrayPtr, 912 int *inPipePtr, int *outPipePtr, 913 int *errFilePtr)); 914 915/* 916 * Exported Tcl procedures: 917 */ 918 919EXTERN void Tcl_AddErrorInfo _ANSI_ARGS_((Tcl_Interp *interp, 920 char *message)); 921EXTERN void Tcl_AddObjErrorInfo _ANSI_ARGS_((Tcl_Interp *interp, 922 char *message, int length)); 923EXTERN void Tcl_AllowExceptions _ANSI_ARGS_((Tcl_Interp *interp)); 924EXTERN void Tcl_AppendElement _ANSI_ARGS_((Tcl_Interp *interp, 925 char *string)); 926EXTERN void Tcl_AppendResult _ANSI_ARGS_( 927 TCL_VARARGS(Tcl_Interp *,interp)); 928EXTERN int Tcl_AppInit _ANSI_ARGS_((Tcl_Interp *interp)); 929EXTERN Tcl_AsyncHandler Tcl_AsyncCreate _ANSI_ARGS_((Tcl_AsyncProc *proc, 930 ClientData clientData)); 931EXTERN void Tcl_AsyncDelete _ANSI_ARGS_((Tcl_AsyncHandler async)); 932EXTERN int Tcl_AsyncInvoke _ANSI_ARGS_((Tcl_Interp *interp, 933 int code)); 934EXTERN void Tcl_AsyncMark _ANSI_ARGS_((Tcl_AsyncHandler async)); 935EXTERN int Tcl_AsyncReady _ANSI_ARGS_((void)); 936EXTERN void Tcl_BackgroundError _ANSI_ARGS_((Tcl_Interp *interp)); 937EXTERN char Tcl_Backslash _ANSI_ARGS_((char *src, 938 int *readPtr)); 939EXTERN void Tcl_CallWhenDeleted _ANSI_ARGS_((Tcl_Interp *interp, 940 Tcl_InterpDeleteProc *proc, 941 ClientData clientData)); 942EXTERN void Tcl_CancelIdleCall _ANSI_ARGS_((Tcl_IdleProc *idleProc, 943 ClientData clientData)); 944#define Tcl_Ckalloc Tcl_Alloc 945#define Tcl_Ckfree Tcl_Free 946#define Tcl_Ckrealloc Tcl_Realloc 947EXTERN int Tcl_Close _ANSI_ARGS_((Tcl_Interp *interp, 948 Tcl_Channel chan)); 949EXTERN int Tcl_CommandComplete _ANSI_ARGS_((char *cmd)); 950EXTERN char * Tcl_Concat _ANSI_ARGS_((int argc, char **argv)); 951EXTERN int Tcl_ConvertElement _ANSI_ARGS_((char *src, 952 char *dst, int flags)); 953EXTERN int Tcl_ConvertToType _ANSI_ARGS_((Tcl_Interp *interp, 954 Tcl_Obj *objPtr, Tcl_ObjType *typePtr)); 955EXTERN int Tcl_CreateAlias _ANSI_ARGS_((Tcl_Interp *slave, 956 char *slaveCmd, Tcl_Interp *target, 957 char *targetCmd, int argc, char **argv)); 958EXTERN Tcl_Channel Tcl_CreateChannel _ANSI_ARGS_(( 959 Tcl_ChannelType *typePtr, char *chanName, 960 ClientData instanceData, int mask)); 961EXTERN void Tcl_CreateChannelHandler _ANSI_ARGS_(( 962 Tcl_Channel chan, int mask, 963 Tcl_ChannelProc *proc, ClientData clientData)); 964EXTERN void Tcl_CreateCloseHandler _ANSI_ARGS_(( 965 Tcl_Channel chan, Tcl_CloseProc *proc, 966 ClientData clientData)); 967EXTERN Tcl_Command Tcl_CreateCommand _ANSI_ARGS_((Tcl_Interp *interp, 968 char *cmdName, Tcl_CmdProc *proc, 969 ClientData clientData, 970 Tcl_CmdDeleteProc *deleteProc)); 971EXTERN void Tcl_CreateEventSource _ANSI_ARGS_(( 972 Tcl_EventSetupProc *setupProc, Tcl_EventCheckProc 973 *checkProc, ClientData clientData)); 974EXTERN void Tcl_CreateExitHandler _ANSI_ARGS_((Tcl_ExitProc *proc, 975 ClientData clientData)); 976EXTERN void Tcl_CreateFileHandler _ANSI_ARGS_(( 977 Tcl_File file, int mask, Tcl_FileProc *proc, 978 ClientData clientData)); 979EXTERN Tcl_Interp * Tcl_CreateInterp _ANSI_ARGS_((void)); 980EXTERN void Tcl_CreateMathFunc _ANSI_ARGS_((Tcl_Interp *interp, 981 char *name, int numArgs, Tcl_ValueType *argTypes, 982 Tcl_MathProc *proc, ClientData clientData)); 983EXTERN void Tcl_CreateModalTimeout _ANSI_ARGS_((int milliseconds, 984 Tcl_TimerProc *proc, ClientData clientData)); 985EXTERN Tcl_Command Tcl_CreateObjCommand _ANSI_ARGS_(( 986 Tcl_Interp *interp, char *name, int nameLength, 987 Tcl_ObjCmdProc *proc, ClientData clientData, 988 Tcl_CmdDeleteProc *deleteProc)); 989EXTERN Tcl_Interp * Tcl_CreateSlave _ANSI_ARGS_((Tcl_Interp *interp, 990 char *slaveName, int isSafe)); 991EXTERN Tcl_TimerToken Tcl_CreateTimerHandler _ANSI_ARGS_((int milliseconds, 992 Tcl_TimerProc *proc, ClientData clientData)); 993EXTERN Tcl_Trace Tcl_CreateTrace _ANSI_ARGS_((Tcl_Interp *interp, 994 int level, Tcl_CmdTraceProc *proc, 995 ClientData clientData)); 996EXTERN char * Tcl_DbCkalloc _ANSI_ARGS_((unsigned int size, 997 char *file, int line)); 998EXTERN int Tcl_DbCkfree _ANSI_ARGS_((char *ptr, 999 char *file, int line)); 1000EXTERN char * Tcl_DbCkrealloc _ANSI_ARGS_((char *ptr, 1001 unsigned int size, char *file, int line)); 1002EXTERN Tcl_Obj * Tcl_DbNewBooleanObj _ANSI_ARGS_((int boolValue, 1003 char *file, int line)); 1004EXTERN Tcl_Obj * Tcl_DbNewDoubleObj _ANSI_ARGS_((double doubleValue, 1005 char *file, int line)); 1006EXTERN Tcl_Obj * Tcl_DbNewIntObj _ANSI_ARGS_((long intValue, 1007 char *file, int line)); 1008EXTERN Tcl_Obj * Tcl_DbNewListObj _ANSI_ARGS_((int objc, 1009 Tcl_Obj **objv, char *file, int line)); 1010EXTERN Tcl_Obj * Tcl_DbNewObj _ANSI_ARGS_((char *file, int line)); 1011EXTERN Tcl_Obj * Tcl_DbNewStringObj _ANSI_ARGS_((char *bytes, 1012 int length, char *file, int line)); 1013EXTERN void Tcl_DeleteAssocData _ANSI_ARGS_((Tcl_Interp *interp, 1014 char *name)); 1015EXTERN int Tcl_DeleteCommand _ANSI_ARGS_((Tcl_Interp *interp, 1016 char *cmdName)); 1017EXTERN void Tcl_DeleteChannelHandler _ANSI_ARGS_(( 1018 Tcl_Channel chan, Tcl_ChannelProc *proc, 1019 ClientData clientData)); 1020EXTERN void Tcl_DeleteCloseHandler _ANSI_ARGS_(( 1021 Tcl_Channel chan, Tcl_CloseProc *proc, 1022 ClientData clientData)); 1023EXTERN void Tcl_DeleteEventSource _ANSI_ARGS_(( 1024 Tcl_EventSetupProc *setupProc, 1025 Tcl_EventCheckProc *checkProc, 1026 ClientData clientData)); 1027EXTERN void Tcl_DeleteEvents _ANSI_ARGS_(( 1028 Tcl_EventDeleteProc *proc, 1029 ClientData clientData)); 1030EXTERN void Tcl_DeleteExitHandler _ANSI_ARGS_(( 1031 Tcl_ExitProc *proc, ClientData clientData)); 1032EXTERN void Tcl_DeleteFileHandler _ANSI_ARGS_(( 1033 Tcl_File file)); 1034EXTERN void Tcl_DeleteHashEntry _ANSI_ARGS_(( 1035 Tcl_HashEntry *entryPtr)); 1036EXTERN void Tcl_DeleteHashTable _ANSI_ARGS_(( 1037 Tcl_HashTable *tablePtr)); 1038EXTERN void Tcl_DeleteInterp _ANSI_ARGS_((Tcl_Interp *interp)); 1039EXTERN void Tcl_DeleteModalTimeout _ANSI_ARGS_(( 1040 Tcl_TimerProc *proc, ClientData clientData)); 1041EXTERN void Tcl_DeleteTimerHandler _ANSI_ARGS_(( 1042 Tcl_TimerToken token)); 1043EXTERN void Tcl_DeleteTrace _ANSI_ARGS_((Tcl_Interp *interp, 1044 Tcl_Trace trace)); 1045EXTERN void Tcl_DetachPids _ANSI_ARGS_((int numPids, Tcl_Pid *pidPtr)); 1046EXTERN void Tcl_DontCallWhenDeleted _ANSI_ARGS_(( 1047 Tcl_Interp *interp, Tcl_InterpDeleteProc *proc, 1048 ClientData clientData)); 1049EXTERN int Tcl_DoOneEvent _ANSI_ARGS_((int flags)); 1050EXTERN void Tcl_DoWhenIdle _ANSI_ARGS_((Tcl_IdleProc *proc, 1051 ClientData clientData)); 1052EXTERN char * Tcl_DStringAppend _ANSI_ARGS_((Tcl_DString *dsPtr, 1053 char *string, int length)); 1054EXTERN char * Tcl_DStringAppendElement _ANSI_ARGS_(( 1055 Tcl_DString *dsPtr, char *string)); 1056EXTERN void Tcl_DStringEndSublist _ANSI_ARGS_((Tcl_DString *dsPtr)); 1057EXTERN void Tcl_DStringFree _ANSI_ARGS_((Tcl_DString *dsPtr)); 1058EXTERN void Tcl_DStringGetResult _ANSI_ARGS_((Tcl_Interp *interp, 1059 Tcl_DString *dsPtr)); 1060EXTERN void Tcl_DStringInit _ANSI_ARGS_((Tcl_DString *dsPtr)); 1061EXTERN void Tcl_DStringResult _ANSI_ARGS_((Tcl_Interp *interp, 1062 Tcl_DString *dsPtr)); 1063EXTERN void Tcl_DStringSetLength _ANSI_ARGS_((Tcl_DString *dsPtr, 1064 int length)); 1065EXTERN void Tcl_DStringStartSublist _ANSI_ARGS_(( 1066 Tcl_DString *dsPtr)); 1067EXTERN Tcl_Obj * Tcl_DuplicateObj _ANSI_ARGS_((Tcl_Obj *objPtr)); 1068EXTERN int Tcl_Eof _ANSI_ARGS_((Tcl_Channel chan)); 1069EXTERN char * Tcl_ErrnoId _ANSI_ARGS_((void)); 1070EXTERN char * Tcl_ErrnoMsg _ANSI_ARGS_((int err)); 1071EXTERN int Tcl_Eval _ANSI_ARGS_((Tcl_Interp *interp, 1072 char *string)); 1073EXTERN int Tcl_EvalFile _ANSI_ARGS_((Tcl_Interp *interp, 1074 char *fileName)); 1075EXTERN void Tcl_EventuallyFree _ANSI_ARGS_((ClientData clientData, 1076 Tcl_FreeProc *freeProc)); 1077EXTERN int Tcl_EvalObj _ANSI_ARGS_((Tcl_Interp *interp, 1078 Tcl_Obj *objPtr)); 1079EXTERN void Tcl_Exit _ANSI_ARGS_((int status)); 1080EXTERN int Tcl_ExposeCommand _ANSI_ARGS_((Tcl_Interp *interp, 1081 char *hiddenCmdName, char *cmdName)); 1082EXTERN int Tcl_ExprBoolean _ANSI_ARGS_((Tcl_Interp *interp, 1083 char *string, int *ptr)); 1084EXTERN int Tcl_ExprBooleanObj _ANSI_ARGS_((Tcl_Interp *interp, 1085 Tcl_Obj *objPtr, int *ptr)); 1086EXTERN int Tcl_ExprDouble _ANSI_ARGS_((Tcl_Interp *interp, 1087 char *string, double *ptr)); 1088EXTERN int Tcl_ExprDoubleObj _ANSI_ARGS_((Tcl_Interp *interp, 1089 Tcl_Obj *objPtr, double *ptr)); 1090EXTERN int Tcl_ExprLong _ANSI_ARGS_((Tcl_Interp *interp, 1091 char *string, long *ptr)); 1092EXTERN int Tcl_ExprLongObj _ANSI_ARGS_((Tcl_Interp *interp, 1093 Tcl_Obj *objPtr, long *ptr)); 1094EXTERN int Tcl_ExprString _ANSI_ARGS_((Tcl_Interp *interp, 1095 char *string)); 1096EXTERN int Tcl_ExprStringObj _ANSI_ARGS_((Tcl_Interp *interp, 1097 Tcl_Obj *objPtr)); 1098EXTERN int Tcl_FileReady _ANSI_ARGS_((Tcl_File file, 1099 int mask)); 1100EXTERN void Tcl_Finalize _ANSI_ARGS_((void)); 1101EXTERN void Tcl_FindExecutable _ANSI_ARGS_((char *argv0)); 1102EXTERN Tcl_HashEntry * Tcl_FirstHashEntry _ANSI_ARGS_(( 1103 Tcl_HashTable *tablePtr, 1104 Tcl_HashSearch *searchPtr)); 1105EXTERN int Tcl_Flush _ANSI_ARGS_((Tcl_Channel chan)); 1106EXTERN void Tcl_FreeFile _ANSI_ARGS_(( 1107 Tcl_File file)); 1108EXTERN void TclFreeObj _ANSI_ARGS_((Tcl_Obj *objPtr)); 1109EXTERN int Tcl_GetAlias _ANSI_ARGS_((Tcl_Interp *interp, 1110 char *slaveCmd, Tcl_Interp **targetInterpPtr, 1111 char **targetCmdPtr, int *argcPtr, 1112 char ***argvPtr)); 1113EXTERN int Tcl_GetAllObjTypes _ANSI_ARGS_((Tcl_Interp *interp, 1114 Tcl_Obj **objPtrPtr)); 1115EXTERN ClientData Tcl_GetAssocData _ANSI_ARGS_((Tcl_Interp *interp, 1116 char *name, Tcl_InterpDeleteProc **procPtr)); 1117EXTERN int Tcl_GetBoolean _ANSI_ARGS_((Tcl_Interp *interp, 1118 char *string, int *boolPtr)); 1119EXTERN int Tcl_GetBooleanFromObj _ANSI_ARGS_(( 1120 Tcl_Interp *interp, Tcl_Obj *objPtr, 1121 int *boolPtr)); 1122EXTERN Tcl_Channel Tcl_GetChannel _ANSI_ARGS_((Tcl_Interp *interp, 1123 char *chanName, int *modePtr)); 1124EXTERN int Tcl_GetChannelBufferSize _ANSI_ARGS_(( 1125 Tcl_Channel chan)); 1126EXTERN Tcl_ByteOrder Tcl_GetChannelByteorder _ANSI_ARGS_(( 1127 Tcl_Channel chan)); 1128EXTERN Tcl_ByteOrder Tcl_GetHostByteorder _ANSI_ARGS_(()); 1129EXTERN Tcl_File Tcl_GetChannelFile _ANSI_ARGS_((Tcl_Channel chan, 1130 int direction)); 1131EXTERN ClientData Tcl_GetChannelInstanceData _ANSI_ARGS_(( 1132 Tcl_Channel chan)); 1133EXTERN int Tcl_GetChannelMode _ANSI_ARGS_((Tcl_Channel chan)); 1134EXTERN char * Tcl_GetChannelName _ANSI_ARGS_((Tcl_Channel chan)); 1135EXTERN int Tcl_GetChannelOption _ANSI_ARGS_((Tcl_Channel chan, 1136 char *optionName, Tcl_DString *dsPtr)); 1137EXTERN Tcl_ChannelType * Tcl_GetChannelType _ANSI_ARGS_((Tcl_Channel chan)); 1138EXTERN int Tcl_GetCommandInfo _ANSI_ARGS_((Tcl_Interp *interp, 1139 char *cmdName, Tcl_CmdInfo *infoPtr)); 1140EXTERN char * Tcl_GetCommandName _ANSI_ARGS_((Tcl_Interp *interp, 1141 Tcl_Command command)); 1142EXTERN char * Tcl_GetCwd _ANSI_ARGS_((char *buf, int len)); 1143EXTERN int Tcl_GetDouble _ANSI_ARGS_((Tcl_Interp *interp, 1144 char *string, double *doublePtr)); 1145EXTERN int Tcl_GetDoubleFromObj _ANSI_ARGS_(( 1146 Tcl_Interp *interp, Tcl_Obj *objPtr, 1147 double *doublePtr)); 1148EXTERN int Tcl_GetErrno _ANSI_ARGS_((void)); 1149EXTERN int Tcl_GetErrorLine _ANSI_ARGS_((Tcl_Interp *interp)); 1150EXTERN Tcl_File Tcl_GetFile _ANSI_ARGS_((ClientData fileData, 1151 int type)); 1152EXTERN ClientData Tcl_GetFileInfo _ANSI_ARGS_((Tcl_File file, 1153 int *typePtr)); 1154EXTERN char * Tcl_GetHostName _ANSI_ARGS_((void)); 1155EXTERN int Tcl_GetIndexFromObj _ANSI_ARGS_((Tcl_Interp *interp, 1156 Tcl_Obj *objPtr, char **tablePtr, char *msg, 1157 int *indexPtr)); 1158EXTERN int Tcl_GetInt _ANSI_ARGS_((Tcl_Interp *interp, 1159 char *string, int *intPtr)); 1160EXTERN int Tcl_GetInterpPath _ANSI_ARGS_((Tcl_Interp *askInterp, 1161 Tcl_Interp *slaveInterp)); 1162EXTERN int Tcl_GetIntFromObj _ANSI_ARGS_((Tcl_Interp *interp, 1163 Tcl_Obj *objPtr, long *intPtr)); 1164EXTERN Tcl_Interp * Tcl_GetMaster _ANSI_ARGS_((Tcl_Interp *interp)); 1165EXTERN ClientData Tcl_GetNotifierData _ANSI_ARGS_((Tcl_File file, 1166 Tcl_FileFreeProc **freeProcPtr)); 1167EXTERN Tcl_Obj * Tcl_GetObjResult _ANSI_ARGS_((Tcl_Interp *interp)); 1168EXTERN Tcl_ObjType * Tcl_GetObjType _ANSI_ARGS_((char *typeName)); 1169EXTERN int Tcl_GetOpenFile _ANSI_ARGS_((Tcl_Interp *interp, 1170 char *string, int write, int checkUsage, 1171 ClientData *filePtr)); 1172EXTERN Tcl_PathType Tcl_GetPathType _ANSI_ARGS_((char *path)); 1173EXTERN int Tcl_Gets _ANSI_ARGS_((Tcl_Channel chan, 1174 Tcl_DString *dsPtr)); 1175EXTERN Tcl_Interp * Tcl_GetSlave _ANSI_ARGS_((Tcl_Interp *interp, 1176 char *slaveName)); 1177EXTERN Tcl_Channel Tcl_GetStdChannel _ANSI_ARGS_((int type)); 1178EXTERN char * Tcl_GetStringFromObj _ANSI_ARGS_((Tcl_Obj *objPtr, 1179 int *lengthPtr)); 1180EXTERN char * Tcl_GetVar _ANSI_ARGS_((Tcl_Interp *interp, 1181 char *varName, int flags)); 1182EXTERN char * Tcl_GetVar2 _ANSI_ARGS_((Tcl_Interp *interp, 1183 char *part1, char *part2, int flags)); 1184EXTERN int Tcl_GlobalEval _ANSI_ARGS_((Tcl_Interp *interp, 1185 char *command)); 1186EXTERN int Tcl_GlobalEvalObj _ANSI_ARGS_((Tcl_Interp *interp, 1187 Tcl_Obj *objPtr)); 1188EXTERN char * Tcl_HashStats _ANSI_ARGS_((Tcl_HashTable *tablePtr)); 1189EXTERN int Tcl_HideCommand _ANSI_ARGS_((Tcl_Interp *interp, 1190 char *cmdName, char *hiddenCmdName)); 1191EXTERN int Tcl_Init _ANSI_ARGS_((Tcl_Interp *interp)); 1192EXTERN void Tcl_InitHashTable _ANSI_ARGS_((Tcl_HashTable *tablePtr, 1193 int keyType)); 1194EXTERN void Tcl_InitMemory _ANSI_ARGS_((Tcl_Interp *interp)); 1195EXTERN int Tcl_InputBlocked _ANSI_ARGS_((Tcl_Channel chan)); 1196EXTERN int Tcl_InputBuffered _ANSI_ARGS_((Tcl_Channel chan)); 1197EXTERN int Tcl_InterpDeleted _ANSI_ARGS_((Tcl_Interp *interp)); 1198EXTERN int Tcl_IsSafe _ANSI_ARGS_((Tcl_Interp *interp)); 1199EXTERN char * Tcl_JoinPath _ANSI_ARGS_((int argc, char **argv, 1200 Tcl_DString *resultPtr)); 1201EXTERN int Tcl_LinkVar _ANSI_ARGS_((Tcl_Interp *interp, 1202 char *varName, char *addr, int type)); 1203EXTERN int Tcl_ListObjAppendList _ANSI_ARGS_(( 1204 Tcl_Interp *interp, Tcl_Obj *listPtr, 1205 Tcl_Obj *elemListPtr)); 1206EXTERN int Tcl_ListObjAppendElement _ANSI_ARGS_(( 1207 Tcl_Interp *interp, Tcl_Obj *listPtr, 1208 Tcl_Obj *objPtr)); 1209EXTERN int Tcl_ListObjGetElements _ANSI_ARGS_(( 1210 Tcl_Interp *interp, Tcl_Obj *listPtr, 1211 int *objcPtr, Tcl_Obj ***objvPtr)); 1212EXTERN int Tcl_ListObjIndex _ANSI_ARGS_((Tcl_Interp *interp, 1213 Tcl_Obj *listPtr, int index, 1214 Tcl_Obj **objPtrPtr)); 1215EXTERN int Tcl_ListObjLength _ANSI_ARGS_((Tcl_Interp *interp, 1216 Tcl_Obj *listPtr, int *intPtr)); 1217EXTERN int Tcl_ListObjReplace _ANSI_ARGS_((Tcl_Interp *interp, 1218 Tcl_Obj *listPtr, int first, int count, 1219 int objc, Tcl_Obj **objv)); 1220EXTERN void Tcl_Main _ANSI_ARGS_((int argc, char **argv, 1221 Tcl_AppInitProc *appInitProc)); 1222EXTERN Tcl_Channel Tcl_MakeFileChannel _ANSI_ARGS_((ClientData inFile, 1223 ClientData outFile, int mode)); 1224EXTERN int Tcl_MakeSafe _ANSI_ARGS_((Tcl_Interp *interp)); 1225EXTERN Tcl_Channel Tcl_MakeTcpClientChannel _ANSI_ARGS_(( 1226 ClientData tcpSocket)); 1227EXTERN char * Tcl_Merge _ANSI_ARGS_((int argc, char **argv)); 1228EXTERN Tcl_HashEntry * Tcl_NextHashEntry _ANSI_ARGS_(( 1229 Tcl_HashSearch *searchPtr)); 1230EXTERN Tcl_Obj * Tcl_ObjGetVar2 _ANSI_ARGS_((Tcl_Interp *interp, 1231 Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, 1232 int flags)); 1233EXTERN Tcl_Obj * Tcl_ObjSetVar2 _ANSI_ARGS_((Tcl_Interp *interp, 1234 Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, 1235 Tcl_Obj *newValuePtr, int flags)); 1236EXTERN Tcl_Channel Tcl_OpenCommandChannel _ANSI_ARGS_(( 1237 Tcl_Interp *interp, int argc, char **argv, 1238 int flags)); 1239EXTERN Tcl_Channel Tcl_OpenFileChannel _ANSI_ARGS_((Tcl_Interp *interp, 1240 char *fileName, char *modeString, 1241 int permissions)); 1242EXTERN Tcl_Channel Tcl_OpenTcpClient _ANSI_ARGS_((Tcl_Interp *interp, 1243 int port, char *address, char *myaddr, 1244 int myport, int async)); 1245EXTERN Tcl_Channel Tcl_OpenTcpServer _ANSI_ARGS_((Tcl_Interp *interp, 1246 int port, char *host, 1247 Tcl_TcpAcceptProc *acceptProc, 1248 ClientData callbackData)); 1249EXTERN char * Tcl_ParseVar _ANSI_ARGS_((Tcl_Interp *interp, 1250 char *string, char **termPtr)); 1251EXTERN int Tcl_PkgProvide _ANSI_ARGS_((Tcl_Interp *interp, 1252 char *name, char *version)); 1253EXTERN char * Tcl_PkgRequire _ANSI_ARGS_((Tcl_Interp *interp, 1254 char *name, char *version, int exact)); 1255EXTERN char * Tcl_PosixError _ANSI_ARGS_((Tcl_Interp *interp)); 1256EXTERN void Tcl_Preserve _ANSI_ARGS_((ClientData data)); 1257EXTERN void Tcl_PrintDouble _ANSI_ARGS_((Tcl_Interp *interp, 1258 double value, char *dst)); 1259EXTERN int Tcl_PutEnv _ANSI_ARGS_((CONST char *string)); 1260EXTERN void Tcl_QueueEvent _ANSI_ARGS_((Tcl_Event *evPtr, 1261 Tcl_QueuePosition position)); 1262EXTERN int Tcl_Read _ANSI_ARGS_((Tcl_Channel chan, 1263 char *bufPtr, int toRead)); 1264EXTERN void Tcl_ReapDetachedProcs _ANSI_ARGS_((void)); 1265EXTERN int Tcl_RecordAndEval _ANSI_ARGS_((Tcl_Interp *interp, 1266 char *cmd, int flags)); 1267EXTERN Tcl_RegExp Tcl_RegExpCompile _ANSI_ARGS_((Tcl_Interp *interp, 1268 char *string)); 1269EXTERN int Tcl_RegExpExec _ANSI_ARGS_((Tcl_Interp *interp, 1270 Tcl_RegExp regexp, char *string, char *start)); 1271EXTERN int Tcl_RegExpMatch _ANSI_ARGS_((Tcl_Interp *interp, 1272 char *string, char *pattern)); 1273EXTERN void Tcl_RegExpRange _ANSI_ARGS_((Tcl_RegExp regexp, 1274 int index, char **startPtr, char **endPtr)); 1275EXTERN void Tcl_RegisterChannel _ANSI_ARGS_((Tcl_Interp *interp, 1276 Tcl_Channel chan)); 1277EXTERN void Tcl_RegisterObjType _ANSI_ARGS_(( 1278 Tcl_ObjType *typePtr)); 1279EXTERN void Tcl_Release _ANSI_ARGS_((ClientData clientData)); 1280EXTERN void Tcl_ResetObjResult _ANSI_ARGS_((Tcl_Interp *interp)); 1281EXTERN void Tcl_ResetResult _ANSI_ARGS_((Tcl_Interp *interp)); 1282#define Tcl_Return Tcl_SetResult 1283EXTERN int Tcl_ScanElement _ANSI_ARGS_((char *string, 1284 int *flagPtr)); 1285EXTERN int Tcl_Seek _ANSI_ARGS_((Tcl_Channel chan, 1286 int offset, int mode)); 1287EXTERN void Tcl_SetAssocData _ANSI_ARGS_((Tcl_Interp *interp, 1288 char *name, Tcl_InterpDeleteProc *proc, 1289 ClientData clientData)); 1290EXTERN void Tcl_SetBooleanObj _ANSI_ARGS_((Tcl_Obj *objPtr, 1291 int boolValue)); 1292EXTERN void Tcl_SetChannelBufferSize _ANSI_ARGS_(( 1293 Tcl_Channel chan, int sz)); 1294EXTERN int Tcl_SetChannelOption _ANSI_ARGS_(( 1295 Tcl_Interp *interp, Tcl_Channel chan, 1296 char *optionName, char *newValue)); 1297EXTERN int Tcl_SetCommandInfo _ANSI_ARGS_((Tcl_Interp *interp, 1298 char *cmdName, Tcl_CmdInfo *infoPtr)); 1299EXTERN void Tcl_SetDoubleObj _ANSI_ARGS_((Tcl_Obj *objPtr, 1300 double doubleValue)); 1301EXTERN void Tcl_SetErrno _ANSI_ARGS_((int err)); 1302EXTERN void Tcl_SetErrorCode _ANSI_ARGS_( 1303 TCL_VARARGS(Tcl_Interp *,interp)); 1304EXTERN void Tcl_SetIntObj _ANSI_ARGS_((Tcl_Obj *objPtr, 1305 long intValue)); 1306EXTERN void Tcl_SetMaxBlockTime _ANSI_ARGS_((Tcl_Time *timePtr)); 1307EXTERN void Tcl_SetNotifierData _ANSI_ARGS_((Tcl_File file, 1308 Tcl_FileFreeProc *freeProcPtr, ClientData data)); 1309EXTERN void Tcl_SetObjResult _ANSI_ARGS_((Tcl_Interp *interp, 1310 Tcl_Obj *resultObjPtr)); 1311EXTERN void Tcl_SetPanicProc _ANSI_ARGS_((void (*proc) 1312 _ANSI_ARGS_(TCL_VARARGS(char *, format)))); 1313EXTERN int Tcl_SetRecursionLimit _ANSI_ARGS_((Tcl_Interp *interp, 1314 int depth)); 1315EXTERN void Tcl_SetResult _ANSI_ARGS_((Tcl_Interp *interp, 1316 char *string, Tcl_FreeProc *freeProc)); 1317EXTERN void Tcl_SetStdChannel _ANSI_ARGS_((Tcl_Channel channel, 1318 int type)); 1319EXTERN void Tcl_SetStringObj _ANSI_ARGS_((Tcl_Obj *objPtr, 1320 char *bytes, int length)); 1321EXTERN char * Tcl_SetVar _ANSI_ARGS_((Tcl_Interp *interp, 1322 char *varName, char *newValue, int flags)); 1323EXTERN char * Tcl_SetVar2 _ANSI_ARGS_((Tcl_Interp *interp, 1324 char *part1, char *part2, char *newValue, 1325 int flags)); 1326EXTERN char * Tcl_SignalId _ANSI_ARGS_((int sig)); 1327EXTERN char * Tcl_SignalMsg _ANSI_ARGS_((int sig)); 1328EXTERN void Tcl_Sleep _ANSI_ARGS_((int ms)); 1329EXTERN void Tcl_SourceRCFile _ANSI_ARGS_((Tcl_Interp *interp)); 1330EXTERN int Tcl_SplitList _ANSI_ARGS_((Tcl_Interp *interp, 1331 char *list, int *argcPtr, char ***argvPtr)); 1332EXTERN void Tcl_SplitPath _ANSI_ARGS_((char *path, 1333 int *argcPtr, char ***argvPtr)); 1334EXTERN void Tcl_StaticPackage _ANSI_ARGS_((Tcl_Interp *interp, 1335 char *pkgName, Tcl_PackageInitProc *initProc, 1336 Tcl_PackageInitProc *safeInitProc)); 1337EXTERN int Tcl_StringMatch _ANSI_ARGS_((char *string, 1338 char *pattern)); 1339EXTERN void Tcl_StringObjAppend _ANSI_ARGS_((Tcl_Obj *objPtr, 1340 char *bytes, int length)); 1341EXTERN void Tcl_StringObjAppendObj _ANSI_ARGS_((Tcl_Obj *objPtr, 1342 Tcl_Obj *srcPtr)); 1343EXTERN int Tcl_Tell _ANSI_ARGS_((Tcl_Channel chan)); 1344#define Tcl_TildeSubst Tcl_TranslateFileName 1345EXTERN int Tcl_TraceVar _ANSI_ARGS_((Tcl_Interp *interp, 1346 char *varName, int flags, Tcl_VarTraceProc *proc, 1347 ClientData clientData)); 1348EXTERN int Tcl_TraceVar2 _ANSI_ARGS_((Tcl_Interp *interp, 1349 char *part1, char *part2, int flags, 1350 Tcl_VarTraceProc *proc, ClientData clientData)); 1351EXTERN char * Tcl_TranslateFileName _ANSI_ARGS_((Tcl_Interp *interp, 1352 char *name, Tcl_DString *bufferPtr)); 1353EXTERN int Tcl_Ungets _ANSI_ARGS_((Tcl_Channel chan, char *str, 1354 int len, int atHead)); 1355EXTERN void Tcl_UnlinkVar _ANSI_ARGS_((Tcl_Interp *interp, 1356 char *varName)); 1357EXTERN int Tcl_UnregisterChannel _ANSI_ARGS_((Tcl_Interp *interp, 1358 Tcl_Channel chan)); 1359EXTERN int Tcl_UnsetVar _ANSI_ARGS_((Tcl_Interp *interp, 1360 char *varName, int flags)); 1361EXTERN int Tcl_UnsetVar2 _ANSI_ARGS_((Tcl_Interp *interp, 1362 char *part1, char *part2, int flags)); 1363EXTERN void Tcl_UntraceVar _ANSI_ARGS_((Tcl_Interp *interp, 1364 char *varName, int flags, Tcl_VarTraceProc *proc, 1365 ClientData clientData)); 1366EXTERN void Tcl_UntraceVar2 _ANSI_ARGS_((Tcl_Interp *interp, 1367 char *part1, char *part2, int flags, 1368 Tcl_VarTraceProc *proc, ClientData clientData)); 1369EXTERN void Tcl_UpdateLinkedVar _ANSI_ARGS_((Tcl_Interp *interp, 1370 char *varName)); 1371EXTERN int Tcl_UpVar _ANSI_ARGS_((Tcl_Interp *interp, 1372 char *frameName, char *varName, 1373 char *localName, int flags)); 1374EXTERN int Tcl_UpVar2 _ANSI_ARGS_((Tcl_Interp *interp, 1375 char *frameName, char *part1, char *part2, 1376 char *localName, int flags)); 1377EXTERN int Tcl_VarEval _ANSI_ARGS_( 1378 TCL_VARARGS(Tcl_Interp *,interp)); 1379EXTERN ClientData Tcl_VarTraceInfo _ANSI_ARGS_((Tcl_Interp *interp, 1380 char *varName, int flags, 1381 Tcl_VarTraceProc *procPtr, 1382 ClientData prevClientData)); 1383EXTERN ClientData Tcl_VarTraceInfo2 _ANSI_ARGS_((Tcl_Interp *interp, 1384 char *part1, char *part2, int flags, 1385 Tcl_VarTraceProc *procPtr, 1386 ClientData prevClientData)); 1387EXTERN int Tcl_WaitForEvent _ANSI_ARGS_((Tcl_Time *timePtr)); 1388EXTERN Tcl_Pid Tcl_WaitPid _ANSI_ARGS_((Tcl_Pid pid, int *statPtr, 1389 int options)); 1390EXTERN void Tcl_WatchFile _ANSI_ARGS_((Tcl_File file, 1391 int mask)); 1392EXTERN int Tcl_Write _ANSI_ARGS_((Tcl_Channel chan, 1393 char *s, int slen)); 1394 1395EXTERN Tcl_Channel Tcl_ReplaceChannel _ANSI_ARGS_ ((Tcl_Interp* interp, 1396 Tcl_ChannelType* typePtr, ClientData instanceData, 1397 int mask, Tcl_Channel prevChan)); 1398 1399EXTERN void Tcl_UndoReplaceChannel _ANSI_ARGS_ ((Tcl_Interp* interp, 1400 Tcl_Channel chan)); 1401 1402#endif /* RESOURCE_INCLUDED */ 1403#endif /* _TCL */ 1404