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 187 typedef char CHAR; 188 typedef short SHORT; 189 typedef 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 229 typedef 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 245 typedef struct Tcl_AsyncHandler_ *Tcl_AsyncHandler; 246 typedef struct Tcl_Channel_ *Tcl_Channel; 247 typedef struct Tcl_Command_ *Tcl_Command; 248 typedef struct Tcl_Condition_ *Tcl_Condition; 249 typedef struct Tcl_EncodingState_ *Tcl_EncodingState; 250 typedef struct Tcl_Encoding_ *Tcl_Encoding; 251 typedef struct Tcl_Event Tcl_Event; 252 typedef struct Tcl_Mutex_ *Tcl_Mutex; 253 typedef struct Tcl_Pid_ *Tcl_Pid; 254 typedef struct Tcl_RegExp_ *Tcl_RegExp; 255 typedef struct Tcl_ThreadDataKey_ *Tcl_ThreadDataKey; 256 typedef struct Tcl_ThreadId_ *Tcl_ThreadId; 257 typedef struct Tcl_TimerToken_ *Tcl_TimerToken; 258 typedef struct Tcl_Trace_ *Tcl_Trace; 259 typedef 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 294 typedef enum {TCL_INT, TCL_DOUBLE, TCL_EITHER} Tcl_ValueType; 295 typedef 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 308 struct Tcl_Obj; 309 310 /* 311 * Procedure types defined by Tcl: 312 */ 313 314 typedef int (Tcl_AppInitProc) _ANSI_ARGS_((Tcl_Interp *interp)); 315 typedef int (Tcl_AsyncProc) _ANSI_ARGS_((ClientData clientData, 316 Tcl_Interp *interp, int code)); 317 typedef void (Tcl_ChannelProc) _ANSI_ARGS_((ClientData clientData, int mask)); 318 typedef void (Tcl_CloseProc) _ANSI_ARGS_((ClientData data)); 319 typedef void (Tcl_CmdDeleteProc) _ANSI_ARGS_((ClientData clientData)); 320 typedef int (Tcl_CmdProc) _ANSI_ARGS_((ClientData clientData, 321 Tcl_Interp *interp, int argc, char *argv[])); 322 typedef 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[])); 325 typedef void (Tcl_DupInternalRepProc) _ANSI_ARGS_((struct Tcl_Obj *srcPtr, 326 struct Tcl_Obj *dupPtr)); 327 typedef 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)); 331 typedef void (Tcl_EncodingFreeProc)_ANSI_ARGS_((ClientData clientData)); 332 typedef int (Tcl_EventProc) _ANSI_ARGS_((Tcl_Event *evPtr, int flags)); 333 typedef void (Tcl_EventCheckProc) _ANSI_ARGS_((ClientData clientData, 334 int flags)); 335 typedef int (Tcl_EventDeleteProc) _ANSI_ARGS_((Tcl_Event *evPtr, 336 ClientData clientData)); 337 typedef void (Tcl_EventSetupProc) _ANSI_ARGS_((ClientData clientData, 338 int flags)); 339 typedef void (Tcl_ExitProc) _ANSI_ARGS_((ClientData clientData)); 340 typedef void (Tcl_FileProc) _ANSI_ARGS_((ClientData clientData, int mask)); 341 typedef void (Tcl_FileFreeProc) _ANSI_ARGS_((ClientData clientData)); 342 typedef void (Tcl_FreeInternalRepProc) _ANSI_ARGS_((struct Tcl_Obj *objPtr)); 343 typedef void (Tcl_FreeProc) _ANSI_ARGS_((char *blockPtr)); 344 typedef void (Tcl_IdleProc) _ANSI_ARGS_((ClientData clientData)); 345 typedef void (Tcl_InterpDeleteProc) _ANSI_ARGS_((ClientData clientData, 346 Tcl_Interp *interp)); 347 typedef int (Tcl_MathProc) _ANSI_ARGS_((ClientData clientData, 348 Tcl_Interp *interp, Tcl_Value *args, Tcl_Value *resultPtr)); 349 typedef void (Tcl_NamespaceDeleteProc) _ANSI_ARGS_((ClientData clientData)); 350 typedef int (Tcl_ObjCmdProc) _ANSI_ARGS_((ClientData clientData, 351 Tcl_Interp *interp, int objc, struct Tcl_Obj *CONST objv[])); 352 typedef int (Tcl_PackageInitProc) _ANSI_ARGS_((Tcl_Interp *interp)); 353 typedef void (Tcl_TcpAcceptProc) _ANSI_ARGS_((ClientData callbackData, 354 Tcl_Channel chan, char *address, int port)); 355 typedef void (Tcl_TimerProc) _ANSI_ARGS_((ClientData clientData)); 356 typedef int (Tcl_SetFromAnyProc) _ANSI_ARGS_((Tcl_Interp *interp, 357 struct Tcl_Obj *objPtr)); 358 typedef void (Tcl_UpdateStringProc) _ANSI_ARGS_((struct Tcl_Obj *objPtr)); 359 typedef 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 368 typedef 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 393 typedef 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 434 EXTERN void Tcl_IncrRefCount _ANSI_ARGS_((Tcl_Obj *objPtr)); 435 EXTERN void Tcl_DecrRefCount _ANSI_ARGS_((Tcl_Obj *objPtr)); 436 EXTERN 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 460 EXTERN Tcl_Obj * Tcl_NewBooleanObj _ANSI_ARGS_((int boolValue)); 461 EXTERN Tcl_Obj * Tcl_NewByteArrayObj _ANSI_ARGS_((unsigned char *bytes, 462 int length)); 463 EXTERN Tcl_Obj * Tcl_NewDoubleObj _ANSI_ARGS_((double doubleValue)); 464 EXTERN Tcl_Obj * Tcl_NewIntObj _ANSI_ARGS_((int intValue)); 465 EXTERN Tcl_Obj * Tcl_NewListObj _ANSI_ARGS_((int objc, 466 Tcl_Obj *CONST objv[])); 467 EXTERN Tcl_Obj * Tcl_NewLongObj _ANSI_ARGS_((long longValue)); 468 EXTERN Tcl_Obj * Tcl_NewObj _ANSI_ARGS_((void)); 469 EXTERN 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 495 typedef 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 512 typedef 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 552 typedef 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 581 typedef 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 609 typedef 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 720 EXTERN char * Tcl_Alloc _ANSI_ARGS_((unsigned int size)); 721 EXTERN void Tcl_Free _ANSI_ARGS_((char *ptr)); 722 EXTERN char * Tcl_Realloc _ANSI_ARGS_((char *ptr, 723 unsigned int size)); 724 EXTERN void Tcl_InitMemory _ANSI_ARGS_((Tcl_Interp *interp)); 725 EXTERN int Tcl_DumpActiveMemory _ANSI_ARGS_((char *fileName)); 726 EXTERN 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 762 struct 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 771 typedef 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 800 typedef 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 835 typedef 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 892 struct 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 901 typedef 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 920 typedef 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 964 typedef int (Tcl_DriverBlockModeProc) _ANSI_ARGS_(( 965 ClientData instanceData, int mode)); 966 typedef int (Tcl_DriverCloseProc) _ANSI_ARGS_((ClientData instanceData, 967 Tcl_Interp *interp)); 968 typedef int (Tcl_DriverClose2Proc) _ANSI_ARGS_((ClientData instanceData, 969 Tcl_Interp *interp, int flags)); 970 typedef int (Tcl_DriverInputProc) _ANSI_ARGS_((ClientData instanceData, 971 char *buf, int toRead, int *errorCodePtr)); 972 typedef int (Tcl_DriverOutputProc) _ANSI_ARGS_((ClientData instanceData, 973 char *buf, int toWrite, int *errorCodePtr)); 974 typedef int (Tcl_DriverSeekProc) _ANSI_ARGS_((ClientData instanceData, 975 long offset, int mode, int *errorCodePtr)); 976 typedef int (Tcl_DriverSetOptionProc) _ANSI_ARGS_(( 977 ClientData instanceData, Tcl_Interp *interp, 978 char *optionName, char *value)); 979 typedef int (Tcl_DriverGetOptionProc) _ANSI_ARGS_(( 980 ClientData instanceData, Tcl_Interp *interp, 981 char *optionName, Tcl_DString *dsPtr)); 982 typedef void (Tcl_DriverWatchProc) _ANSI_ARGS_(( 983 ClientData instanceData, int mask)); 984 typedef 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 992 typedef 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 1007 typedef 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 1053 typedef 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 1064 typedef 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 1170 typedef unsigned short Tcl_UniChar; 1171 1172 /* 1173 * Exported Tcl procedures: 1174 */ 1175 1176 EXTERN void Tcl_AddErrorInfo _ANSI_ARGS_((Tcl_Interp *interp, 1177 CONST char *message)); 1178 EXTERN void Tcl_AddObjErrorInfo _ANSI_ARGS_((Tcl_Interp *interp, 1179 CONST char *message, int length)); 1180 EXTERN void Tcl_AllowExceptions _ANSI_ARGS_((Tcl_Interp *interp)); 1181 EXTERN int Tcl_AppendAllObjTypes _ANSI_ARGS_(( 1182 Tcl_Interp *interp, Tcl_Obj *objPtr)); 1183 EXTERN void Tcl_AppendElement _ANSI_ARGS_((Tcl_Interp *interp, 1184 CONST char *string)); 1185 EXTERN void Tcl_AppendResult _ANSI_ARGS_( 1186 TCL_VARARGS(Tcl_Interp *,interp)); 1187 EXTERN void Tcl_AppendObjToObj _ANSI_ARGS_((Tcl_Obj *objPtr, 1188 Tcl_Obj *appendObjPtr)); 1189 EXTERN void Tcl_AppendToObj _ANSI_ARGS_((Tcl_Obj *objPtr, 1190 char *bytes, int length)); 1191 EXTERN void Tcl_AppendStringsToObj _ANSI_ARGS_( 1192 TCL_VARARGS(Tcl_Obj *,interp)); 1193 EXTERN int Tcl_AppInit _ANSI_ARGS_((Tcl_Interp *interp)); 1194 EXTERN void Tcl_AlertNotifier _ANSI_ARGS_((ClientData clientData)); 1195 EXTERN Tcl_AsyncHandler Tcl_AsyncCreate _ANSI_ARGS_((Tcl_AsyncProc *proc, 1196 ClientData clientData)); 1197 EXTERN void Tcl_AsyncDelete _ANSI_ARGS_((Tcl_AsyncHandler async)); 1198 EXTERN int Tcl_AsyncInvoke _ANSI_ARGS_((Tcl_Interp *interp, 1199 int code)); 1200 EXTERN void Tcl_AsyncMark _ANSI_ARGS_((Tcl_AsyncHandler async)); 1201 EXTERN int Tcl_AsyncReady _ANSI_ARGS_((void)); 1202 EXTERN void Tcl_BackgroundError _ANSI_ARGS_((Tcl_Interp *interp)); 1203 EXTERN char Tcl_Backslash _ANSI_ARGS_((CONST char *src, 1204 int *readPtr)); 1205 EXTERN int Tcl_BadChannelOption _ANSI_ARGS_((Tcl_Interp *interp, 1206 char *optionName, char *optionList)); 1207 EXTERN void Tcl_CallWhenDeleted _ANSI_ARGS_((Tcl_Interp *interp, 1208 Tcl_InterpDeleteProc *proc, 1209 ClientData clientData)); 1210 EXTERN 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 1215 EXTERN int Tcl_Close _ANSI_ARGS_((Tcl_Interp *interp, 1216 Tcl_Channel chan)); 1217 EXTERN int Tcl_CommandComplete _ANSI_ARGS_((char *cmd)); 1218 EXTERN char * Tcl_Concat _ANSI_ARGS_((int argc, char **argv)); 1219 EXTERN Tcl_Obj * Tcl_ConcatObj _ANSI_ARGS_((int objc, 1220 Tcl_Obj *CONST objv[])); 1221 EXTERN int Tcl_ConvertCountedElement _ANSI_ARGS_((CONST char *src, 1222 int length, char *dst, int flags)); 1223 EXTERN int Tcl_ConvertElement _ANSI_ARGS_((CONST char *src, 1224 char *dst, int flags)); 1225 EXTERN int Tcl_ConvertToType _ANSI_ARGS_((Tcl_Interp *interp, 1226 Tcl_Obj *objPtr, Tcl_ObjType *typePtr)); 1227 EXTERN int Tcl_CreateAlias _ANSI_ARGS_((Tcl_Interp *slave, 1228 char *slaveCmd, Tcl_Interp *target, 1229 char *targetCmd, int argc, char **argv)); 1230 EXTERN int Tcl_CreateAliasObj _ANSI_ARGS_((Tcl_Interp *slave, 1231 char *slaveCmd, Tcl_Interp *target, 1232 char *targetCmd, int objc, 1233 Tcl_Obj *CONST objv[])); 1234 EXTERN Tcl_Channel Tcl_CreateChannel _ANSI_ARGS_(( 1235 Tcl_ChannelType *typePtr, char *chanName, 1236 ClientData instanceData, int mask)); 1237 EXTERN void Tcl_CreateChannelHandler _ANSI_ARGS_(( 1238 Tcl_Channel chan, int mask, 1239 Tcl_ChannelProc *proc, ClientData clientData)); 1240 EXTERN void Tcl_CreateCloseHandler _ANSI_ARGS_(( 1241 Tcl_Channel chan, Tcl_CloseProc *proc, 1242 ClientData clientData)); 1243 EXTERN Tcl_Command Tcl_CreateCommand _ANSI_ARGS_((Tcl_Interp *interp, 1244 char *cmdName, Tcl_CmdProc *proc, 1245 ClientData clientData, 1246 Tcl_CmdDeleteProc *deleteProc)); 1247 EXTERN void Tcl_CreateEventSource _ANSI_ARGS_(( 1248 Tcl_EventSetupProc *setupProc, 1249 Tcl_EventCheckProc *checkProc, 1250 ClientData clientData)); 1251 EXTERN Tcl_Encoding Tcl_CreateEncoding _ANSI_ARGS_(( 1252 Tcl_EncodingType *typePtr)); 1253 EXTERN void Tcl_CreateExitHandler _ANSI_ARGS_((Tcl_ExitProc *proc, 1254 ClientData clientData)); 1255 EXTERN void Tcl_CreateFileHandler _ANSI_ARGS_(( 1256 int fd, int mask, Tcl_FileProc *proc, 1257 ClientData clientData)); 1258 EXTERN Tcl_Interp * Tcl_CreateInterp _ANSI_ARGS_((void)); 1259 EXTERN void Tcl_CreateMathFunc _ANSI_ARGS_((Tcl_Interp *interp, 1260 char *name, int numArgs, Tcl_ValueType *argTypes, 1261 Tcl_MathProc *proc, ClientData clientData)); 1262 EXTERN Tcl_Command Tcl_CreateObjCommand _ANSI_ARGS_(( 1263 Tcl_Interp *interp, char *cmdName, 1264 Tcl_ObjCmdProc *proc, ClientData clientData, 1265 Tcl_CmdDeleteProc *deleteProc)); 1266 EXTERN Tcl_Interp * Tcl_CreateSlave _ANSI_ARGS_((Tcl_Interp *interp, 1267 char *slaveName, int isSafe)); 1268 EXTERN void Tcl_CreateThreadExitHandler 1269 _ANSI_ARGS_((Tcl_ExitProc *proc, 1270 ClientData clientData)); 1271 EXTERN Tcl_TimerToken Tcl_CreateTimerHandler _ANSI_ARGS_((int milliseconds, 1272 Tcl_TimerProc *proc, ClientData clientData)); 1273 EXTERN Tcl_Trace Tcl_CreateTrace _ANSI_ARGS_((Tcl_Interp *interp, 1274 int level, Tcl_CmdTraceProc *proc, 1275 ClientData clientData)); 1276 EXTERN char * Tcl_DbCkalloc _ANSI_ARGS_((unsigned int size, 1277 char *file, int line)); 1278 EXTERN int Tcl_DbCkfree _ANSI_ARGS_((char *ptr, 1279 char *file, int line)); 1280 EXTERN char * Tcl_DbCkrealloc _ANSI_ARGS_((char *ptr, 1281 unsigned int size, char *file, int line)); 1282 EXTERN void Tcl_DbDecrRefCount _ANSI_ARGS_((Tcl_Obj *objPtr, 1283 char *file, int line)); 1284 EXTERN void Tcl_DbIncrRefCount _ANSI_ARGS_((Tcl_Obj *objPtr, 1285 char *file, int line)); 1286 EXTERN int Tcl_DbIsShared _ANSI_ARGS_((Tcl_Obj *objPtr, 1287 char *file, int line)); 1288 EXTERN Tcl_Obj * Tcl_DbNewBooleanObj _ANSI_ARGS_((int boolValue, 1289 char *file, int line)); 1290 EXTERN Tcl_Obj * Tcl_DbNewDoubleObj _ANSI_ARGS_((double doubleValue, 1291 char *file, int line)); 1292 EXTERN Tcl_Obj * Tcl_DbNewListObj _ANSI_ARGS_((int objc, 1293 Tcl_Obj *CONST objv[], char *file, int line)); 1294 EXTERN Tcl_Obj * Tcl_DbNewLongObj _ANSI_ARGS_((long longValue, 1295 char *file, int line)); 1296 EXTERN Tcl_Obj * Tcl_DbNewObj _ANSI_ARGS_((char *file, int line)); 1297 EXTERN Tcl_Obj * Tcl_DbNewStringObj _ANSI_ARGS_((CONST char *bytes, 1298 int length, char *file, int line)); 1299 EXTERN void Tcl_DeleteAssocData _ANSI_ARGS_((Tcl_Interp *interp, 1300 char *name)); 1301 EXTERN int Tcl_DeleteCommand _ANSI_ARGS_((Tcl_Interp *interp, 1302 char *cmdName)); 1303 EXTERN int Tcl_DeleteCommandFromToken _ANSI_ARGS_(( 1304 Tcl_Interp *interp, Tcl_Command command)); 1305 EXTERN void Tcl_DeleteChannelHandler _ANSI_ARGS_(( 1306 Tcl_Channel chan, Tcl_ChannelProc *proc, 1307 ClientData clientData)); 1308 EXTERN void Tcl_DeleteCloseHandler _ANSI_ARGS_(( 1309 Tcl_Channel chan, Tcl_CloseProc *proc, 1310 ClientData clientData)); 1311 EXTERN void Tcl_DeleteEvents _ANSI_ARGS_(( 1312 Tcl_EventDeleteProc *proc, 1313 ClientData clientData)); 1314 EXTERN void Tcl_DeleteEventSource _ANSI_ARGS_(( 1315 Tcl_EventSetupProc *setupProc, 1316 Tcl_EventCheckProc *checkProc, 1317 ClientData clientData)); 1318 EXTERN void Tcl_DeleteExitHandler _ANSI_ARGS_((Tcl_ExitProc *proc, 1319 ClientData clientData)); 1320 EXTERN void Tcl_DeleteFileHandler _ANSI_ARGS_((int fd)); 1321 EXTERN void Tcl_DeleteHashEntry _ANSI_ARGS_(( 1322 Tcl_HashEntry *entryPtr)); 1323 EXTERN void Tcl_DeleteHashTable _ANSI_ARGS_(( 1324 Tcl_HashTable *tablePtr)); 1325 EXTERN void Tcl_DeleteInterp _ANSI_ARGS_((Tcl_Interp *interp)); 1326 EXTERN void Tcl_DeleteThreadExitHandler 1327 _ANSI_ARGS_((Tcl_ExitProc *proc, 1328 ClientData clientData)); 1329 EXTERN void Tcl_DeleteTimerHandler _ANSI_ARGS_(( 1330 Tcl_TimerToken token)); 1331 EXTERN void Tcl_DeleteTrace _ANSI_ARGS_((Tcl_Interp *interp, 1332 Tcl_Trace trace)); 1333 EXTERN void Tcl_DetachPids _ANSI_ARGS_((int numPids, Tcl_Pid *pidPtr)); 1334 EXTERN void Tcl_DiscardResult _ANSI_ARGS_(( 1335 Tcl_SavedResult *statePtr)); 1336 EXTERN void Tcl_DontCallWhenDeleted _ANSI_ARGS_(( 1337 Tcl_Interp *interp, Tcl_InterpDeleteProc *proc, 1338 ClientData clientData)); 1339 EXTERN int Tcl_DoOneEvent _ANSI_ARGS_((int flags)); 1340 EXTERN void Tcl_DoWhenIdle _ANSI_ARGS_((Tcl_IdleProc *proc, 1341 ClientData clientData)); 1342 EXTERN char * Tcl_DStringAppend _ANSI_ARGS_((Tcl_DString *dsPtr, 1343 CONST char *string, int length)); 1344 EXTERN char * Tcl_DStringAppendElement _ANSI_ARGS_(( 1345 Tcl_DString *dsPtr, CONST char *string)); 1346 EXTERN void Tcl_DStringEndSublist _ANSI_ARGS_((Tcl_DString *dsPtr)); 1347 EXTERN void Tcl_DStringFree _ANSI_ARGS_((Tcl_DString *dsPtr)); 1348 EXTERN void Tcl_DStringGetResult _ANSI_ARGS_((Tcl_Interp *interp, 1349 Tcl_DString *dsPtr)); 1350 EXTERN void Tcl_DStringInit _ANSI_ARGS_((Tcl_DString *dsPtr)); 1351 EXTERN void Tcl_DStringResult _ANSI_ARGS_((Tcl_Interp *interp, 1352 Tcl_DString *dsPtr)); 1353 EXTERN void Tcl_DStringSetLength _ANSI_ARGS_((Tcl_DString *dsPtr, 1354 int length)); 1355 EXTERN void Tcl_DStringStartSublist _ANSI_ARGS_(( 1356 Tcl_DString *dsPtr)); 1357 EXTERN Tcl_Obj * Tcl_DuplicateObj _ANSI_ARGS_((Tcl_Obj *objPtr)); 1358 EXTERN int Tcl_Eof _ANSI_ARGS_((Tcl_Channel chan)); 1359 EXTERN char * Tcl_ErrnoId _ANSI_ARGS_((void)); 1360 EXTERN char * Tcl_ErrnoMsg _ANSI_ARGS_((int err)); 1361 EXTERN int Tcl_Eval _ANSI_ARGS_((Tcl_Interp *interp, 1362 char *string)); 1363 EXTERN int Tcl_Eval2 _ANSI_ARGS_((Tcl_Interp *interp, 1364 char *script, int numBytes, int flags)); 1365 EXTERN int Tcl_EvalFile _ANSI_ARGS_((Tcl_Interp *interp, 1366 char *fileName)); 1367 EXTERN int Tcl_EvalObjv _ANSI_ARGS_ ((Tcl_Interp *interp, 1368 int objc, Tcl_Obj *CONST objv[], char *string, 1369 int length, int flags)); 1370 EXTERN int Tcl_EvalObj _ANSI_ARGS_((Tcl_Interp *interp, 1371 Tcl_Obj *objPtr, int flags)); 1372 EXTERN void Tcl_EventuallyFree _ANSI_ARGS_((ClientData clientData, 1373 Tcl_FreeProc *freeProc)); 1374 EXTERN void Tcl_Exit _ANSI_ARGS_((int status)); 1375 EXTERN void Tcl_ExitThread _ANSI_ARGS_((int status)); 1376 EXTERN int Tcl_ExposeCommand _ANSI_ARGS_((Tcl_Interp *interp, 1377 char *hiddenCmdToken, char *cmdName)); 1378 EXTERN int Tcl_ExprBoolean _ANSI_ARGS_((Tcl_Interp *interp, 1379 char *string, int *ptr)); 1380 EXTERN int Tcl_ExprBooleanObj _ANSI_ARGS_((Tcl_Interp *interp, 1381 Tcl_Obj *objPtr, int *ptr)); 1382 EXTERN int Tcl_ExprDouble _ANSI_ARGS_((Tcl_Interp *interp, 1383 char *string, double *ptr)); 1384 EXTERN int Tcl_ExprDoubleObj _ANSI_ARGS_((Tcl_Interp *interp, 1385 Tcl_Obj *objPtr, double *ptr)); 1386 EXTERN int Tcl_ExprLong _ANSI_ARGS_((Tcl_Interp *interp, 1387 char *string, long *ptr)); 1388 EXTERN int Tcl_ExprLongObj _ANSI_ARGS_((Tcl_Interp *interp, 1389 Tcl_Obj *objPtr, long *ptr)); 1390 EXTERN int Tcl_ExprObj _ANSI_ARGS_((Tcl_Interp *interp, 1391 Tcl_Obj *objPtr, Tcl_Obj **resultPtrPtr)); 1392 EXTERN int Tcl_ExprString _ANSI_ARGS_((Tcl_Interp *interp, 1393 char *string)); 1394 EXTERN 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)); 1399 EXTERN char * Tcl_ExternalToUtfDString _ANSI_ARGS_(( 1400 Tcl_Encoding encoding, CONST char *src, 1401 int srcLen, Tcl_DString *dsPtr)); 1402 EXTERN void Tcl_Finalize _ANSI_ARGS_((void)); 1403 EXTERN void Tcl_FinalizeThread _ANSI_ARGS_((void)); 1404 EXTERN void Tcl_FinalizeNotifier _ANSI_ARGS_(( 1405 ClientData clientData)); 1406 EXTERN void Tcl_FindExecutable _ANSI_ARGS_((CONST char *argv0)); 1407 EXTERN Tcl_HashEntry * Tcl_FirstHashEntry _ANSI_ARGS_(( 1408 Tcl_HashTable *tablePtr, 1409 Tcl_HashSearch *searchPtr)); 1410 EXTERN int Tcl_Flush _ANSI_ARGS_((Tcl_Channel chan)); 1411 EXTERN void Tcl_FreeEncoding _ANSI_ARGS_((Tcl_Encoding encoding)); 1412 EXTERN void TclFreeObj _ANSI_ARGS_((Tcl_Obj *objPtr)); 1413 EXTERN void Tcl_FreeResult _ANSI_ARGS_((Tcl_Interp *interp)); 1414 EXTERN int Tcl_GetAlias _ANSI_ARGS_((Tcl_Interp *interp, 1415 char *slaveCmd, Tcl_Interp **targetInterpPtr, 1416 char **targetCmdPtr, int *argcPtr, 1417 char ***argvPtr)); 1418 EXTERN int Tcl_GetAliasObj _ANSI_ARGS_((Tcl_Interp *interp, 1419 char *slaveCmd, Tcl_Interp **targetInterpPtr, 1420 char **targetCmdPtr, int *objcPtr, 1421 Tcl_Obj ***objv)); 1422 EXTERN ClientData Tcl_GetAssocData _ANSI_ARGS_((Tcl_Interp *interp, 1423 char *name, Tcl_InterpDeleteProc **procPtr)); 1424 EXTERN int Tcl_GetBoolean _ANSI_ARGS_((Tcl_Interp *interp, 1425 char *string, int *boolPtr)); 1426 EXTERN int Tcl_GetBooleanFromObj _ANSI_ARGS_(( 1427 Tcl_Interp *interp, Tcl_Obj *objPtr, 1428 int *boolPtr)); 1429 EXTERN unsigned char * Tcl_GetByteArrayFromObj _ANSI_ARGS_(( 1430 Tcl_Obj *objPtr, int *lengthPtr)); 1431 EXTERN Tcl_Channel Tcl_GetChannel _ANSI_ARGS_((Tcl_Interp *interp, 1432 char *chanName, int *modePtr)); 1433 EXTERN int Tcl_GetChannelBufferSize _ANSI_ARGS_(( 1434 Tcl_Channel chan)); 1435 1436 /* Andreas Kupries <andreas_kupries@users.sourceforge.net>, 05/31/1997. 1437 * Support of Tcl-Trf (binio). 1438 */ 1439 EXTERN int Tcl_GetChannelByteorder _ANSI_ARGS_(( 1440 Tcl_Channel chan)); 1441 1442 EXTERN int Tcl_GetChannelHandle _ANSI_ARGS_((Tcl_Channel chan, 1443 int direction, ClientData *handlePtr)); 1444 EXTERN ClientData Tcl_GetChannelInstanceData _ANSI_ARGS_(( 1445 Tcl_Channel chan)); 1446 EXTERN int Tcl_GetChannelMode _ANSI_ARGS_((Tcl_Channel chan)); 1447 EXTERN char * Tcl_GetChannelName _ANSI_ARGS_((Tcl_Channel chan)); 1448 EXTERN int Tcl_GetChannelOption _ANSI_ARGS_((Tcl_Interp *interp, 1449 Tcl_Channel chan, char *optionName, 1450 Tcl_DString *dsPtr)); 1451 EXTERN Tcl_ChannelType * Tcl_GetChannelType _ANSI_ARGS_((Tcl_Channel chan)); 1452 EXTERN int Tcl_GetCommandInfo _ANSI_ARGS_((Tcl_Interp *interp, 1453 char *cmdName, Tcl_CmdInfo *infoPtr)); 1454 EXTERN char * Tcl_GetCommandName _ANSI_ARGS_((Tcl_Interp *interp, 1455 Tcl_Command command)); 1456 EXTERN Tcl_ThreadId Tcl_GetCurrentThread _ANSI_ARGS_((void)); 1457 EXTERN int Tcl_GetDouble _ANSI_ARGS_((Tcl_Interp *interp, 1458 char *string, double *doublePtr)); 1459 EXTERN int Tcl_GetDoubleFromObj _ANSI_ARGS_(( 1460 Tcl_Interp *interp, Tcl_Obj *objPtr, 1461 double *doublePtr)); 1462 EXTERN Tcl_Encoding Tcl_GetEncoding _ANSI_ARGS_((Tcl_Interp *interp, 1463 CONST char *name)); 1464 EXTERN char * Tcl_GetEncodingName _ANSI_ARGS_(( 1465 Tcl_Encoding encoding)); 1466 EXTERN void Tcl_GetEncodingNames _ANSI_ARGS_((Tcl_Interp *interp)); 1467 EXTERN Tcl_Obj * Tcl_GetEncodingPath _ANSI_ARGS_((void)); 1468 EXTERN int Tcl_GetErrno _ANSI_ARGS_((void)); 1469 EXTERN int Tcl_GetErrorLine _ANSI_ARGS_((Tcl_Interp *interp)); 1470 EXTERN char * Tcl_GetHostName _ANSI_ARGS_((void)); 1471 EXTERN int Tcl_GetIndexFromObj _ANSI_ARGS_((Tcl_Interp *interp, 1472 Tcl_Obj *objPtr, char **tablePtr, char *msg, 1473 int flags, int *indexPtr)); 1474 EXTERN int Tcl_GetIndexFromObjStruct _ANSI_ARGS_(( 1475 Tcl_Interp *interp, Tcl_Obj *objPtr, 1476 char **tablePtr, int offset, char *msg, int flags, 1477 int *indexPtr)); 1478 EXTERN int Tcl_GetInt _ANSI_ARGS_((Tcl_Interp *interp, 1479 char *string, int *intPtr)); 1480 EXTERN int Tcl_GetInterpPath _ANSI_ARGS_((Tcl_Interp *askInterp, 1481 Tcl_Interp *slaveInterp)); 1482 EXTERN int Tcl_GetIntFromObj _ANSI_ARGS_((Tcl_Interp *interp, 1483 Tcl_Obj *objPtr, int *intPtr)); 1484 EXTERN int Tcl_GetLongFromObj _ANSI_ARGS_((Tcl_Interp *interp, 1485 Tcl_Obj *objPtr, long *longPtr)); 1486 EXTERN Tcl_Interp * Tcl_GetMaster _ANSI_ARGS_((Tcl_Interp *interp)); 1487 EXTERN Tcl_Obj * Tcl_GetObjResult _ANSI_ARGS_((Tcl_Interp *interp)); 1488 EXTERN Tcl_Obj * Tcl_GetObjVar2 _ANSI_ARGS_((Tcl_Interp *interp, 1489 char *part1, char *part2, int flags)); 1490 EXTERN Tcl_ObjType * Tcl_GetObjType _ANSI_ARGS_((char *typeName)); 1491 EXTERN int Tcl_GetOpenFile _ANSI_ARGS_((Tcl_Interp *interp, 1492 char *string, int write, int checkUsage, 1493 ClientData *filePtr)); 1494 EXTERN Tcl_Command Tcl_GetOriginalCommand _ANSI_ARGS_(( 1495 Tcl_Command command)); 1496 EXTERN Tcl_PathType Tcl_GetPathType _ANSI_ARGS_((char *path)); 1497 EXTERN int Tcl_Gets _ANSI_ARGS_((Tcl_Channel chan, 1498 Tcl_DString *dsPtr)); 1499 EXTERN int Tcl_GetsObj _ANSI_ARGS_((Tcl_Channel chan, 1500 Tcl_Obj *objPtr)); 1501 EXTERN int Tcl_GetServiceMode _ANSI_ARGS_((void)); 1502 EXTERN Tcl_Interp * Tcl_GetSlave _ANSI_ARGS_((Tcl_Interp *interp, 1503 char *slaveName)); 1504 EXTERN Tcl_Channel Tcl_GetStdChannel _ANSI_ARGS_((int type)); 1505 EXTERN char * Tcl_GetString _ANSI_ARGS_((Tcl_Obj *objPtr)); 1506 EXTERN char * Tcl_GetStringFromObj _ANSI_ARGS_((Tcl_Obj *objPtr, 1507 int *lengthPtr)); 1508 EXTERN char * Tcl_GetStringResult _ANSI_ARGS_((Tcl_Interp *interp)); 1509 EXTERN VOID * Tcl_GetThreadData _ANSI_ARGS_(( 1510 Tcl_ThreadDataKey *keyPtr, int size)); 1511 EXTERN char * Tcl_GetVar _ANSI_ARGS_((Tcl_Interp *interp, 1512 char *varName, int flags)); 1513 EXTERN char * Tcl_GetVar2 _ANSI_ARGS_((Tcl_Interp *interp, 1514 char *part1, char *part2, int flags)); 1515 EXTERN int Tcl_GlobalEval _ANSI_ARGS_((Tcl_Interp *interp, 1516 char *command)); 1517 EXTERN char * Tcl_HashStats _ANSI_ARGS_((Tcl_HashTable *tablePtr)); 1518 EXTERN int Tcl_HideCommand _ANSI_ARGS_((Tcl_Interp *interp, 1519 char *cmdName, char *hiddenCmdToken)); 1520 EXTERN int Tcl_Init _ANSI_ARGS_((Tcl_Interp *interp)); 1521 EXTERN void Tcl_InitHashTable _ANSI_ARGS_((Tcl_HashTable *tablePtr, 1522 int keyType)); 1523 EXTERN ClientData Tcl_InitNotifier _ANSI_ARGS_((void)); 1524 EXTERN int Tcl_InputBlocked _ANSI_ARGS_((Tcl_Channel chan)); 1525 EXTERN int Tcl_InputBuffered _ANSI_ARGS_((Tcl_Channel chan)); 1526 EXTERN int Tcl_InterpDeleted _ANSI_ARGS_((Tcl_Interp *interp)); 1527 EXTERN int Tcl_IsSafe _ANSI_ARGS_((Tcl_Interp *interp)); 1528 EXTERN void Tcl_InvalidateStringRep _ANSI_ARGS_(( 1529 Tcl_Obj *objPtr)); 1530 EXTERN char * Tcl_JoinPath _ANSI_ARGS_((int argc, char **argv, 1531 Tcl_DString *resultPtr)); 1532 EXTERN int Tcl_LinkVar _ANSI_ARGS_((Tcl_Interp *interp, 1533 char *varName, char *addr, int type)); 1534 EXTERN int Tcl_ListObjAppendList _ANSI_ARGS_(( 1535 Tcl_Interp *interp, Tcl_Obj *listPtr, 1536 Tcl_Obj *elemListPtr)); 1537 EXTERN int Tcl_ListObjAppendElement _ANSI_ARGS_(( 1538 Tcl_Interp *interp, Tcl_Obj *listPtr, 1539 Tcl_Obj *objPtr)); 1540 EXTERN int Tcl_ListObjGetElements _ANSI_ARGS_(( 1541 Tcl_Interp *interp, Tcl_Obj *listPtr, 1542 int *objcPtr, Tcl_Obj ***objvPtr)); 1543 EXTERN int Tcl_ListObjIndex _ANSI_ARGS_((Tcl_Interp *interp, 1544 Tcl_Obj *listPtr, int index, 1545 Tcl_Obj **objPtrPtr)); 1546 EXTERN int Tcl_ListObjLength _ANSI_ARGS_((Tcl_Interp *interp, 1547 Tcl_Obj *listPtr, int *intPtr)); 1548 EXTERN int Tcl_ListObjReplace _ANSI_ARGS_((Tcl_Interp *interp, 1549 Tcl_Obj *listPtr, int first, int count, 1550 int objc, Tcl_Obj *CONST objv[])); 1551 EXTERN void Tcl_Main _ANSI_ARGS_((int argc, char **argv, 1552 Tcl_AppInitProc *appInitProc)); 1553 EXTERN Tcl_Channel Tcl_MakeFileChannel _ANSI_ARGS_((ClientData handle, 1554 int mode)); 1555 EXTERN int Tcl_MakeSafe _ANSI_ARGS_((Tcl_Interp *interp)); 1556 EXTERN Tcl_Channel Tcl_MakeTcpClientChannel _ANSI_ARGS_(( 1557 ClientData tcpSocket)); 1558 EXTERN char * Tcl_Merge _ANSI_ARGS_((int argc, char **argv)); 1559 #ifdef TCL_THREADS 1560 EXTERN void Tcl_MutexLock _ANSI_ARGS_((Tcl_Mutex *mutexPtr)); 1561 EXTERN void Tcl_MutexUnlock _ANSI_ARGS_((Tcl_Mutex *mutexPtr)); 1562 EXTERN void Tcl_ConditionNotify _ANSI_ARGS_((Tcl_Condition *condPtr)); 1563 EXTERN void Tcl_ConditionWait _ANSI_ARGS_((Tcl_Condition *condPtr, 1564 Tcl_Mutex *mutexPtr, Tcl_Time *timePtr)); 1565 #else 1566 #define Tcl_MutexLock(mutexPtr) 1567 #define Tcl_MutexUnlock(mutexPtr) 1568 #define Tcl_ConditionNotify(condPtr) 1569 #define Tcl_ConditionWait(condPtr, mutexPtr, timePtr) 1570 #endif /* TCL_THREADS */ 1571 EXTERN Tcl_HashEntry * Tcl_NextHashEntry _ANSI_ARGS_(( 1572 Tcl_HashSearch *searchPtr)); 1573 EXTERN void Tcl_NotifyChannel _ANSI_ARGS_((Tcl_Channel channel, 1574 int mask)); 1575 EXTERN int Tcl_NumUtfChars _ANSI_ARGS_((CONST char *src, 1576 int len)); 1577 EXTERN Tcl_Channel Tcl_OpenCommandChannel _ANSI_ARGS_(( 1578 Tcl_Interp *interp, int argc, char **argv, 1579 int flags)); 1580 EXTERN Tcl_Channel Tcl_OpenFileChannel _ANSI_ARGS_((Tcl_Interp *interp, 1581 char *fileName, char *modeString, 1582 int permissions)); 1583 EXTERN Tcl_Channel Tcl_OpenTcpClient _ANSI_ARGS_((Tcl_Interp *interp, 1584 int port, char *address, char *myaddr, 1585 int myport, int async)); 1586 EXTERN Tcl_Channel Tcl_OpenTcpServer _ANSI_ARGS_((Tcl_Interp *interp, 1587 int port, char *host, 1588 Tcl_TcpAcceptProc *acceptProc, 1589 ClientData callbackData)); 1590 EXTERN char * Tcl_ParseVar _ANSI_ARGS_((Tcl_Interp *interp, 1591 char *string, char **termPtr)); 1592 EXTERN int Tcl_PkgProvide _ANSI_ARGS_((Tcl_Interp *interp, 1593 char *name, char *version)); 1594 EXTERN char * Tcl_PkgRequire _ANSI_ARGS_((Tcl_Interp *interp, 1595 char *name, char *version, int exact)); 1596 EXTERN char * Tcl_PosixError _ANSI_ARGS_((Tcl_Interp *interp)); 1597 EXTERN void Tcl_Preserve _ANSI_ARGS_((ClientData data)); 1598 EXTERN void Tcl_PrintDouble _ANSI_ARGS_((Tcl_Interp *interp, 1599 double value, char *dst)); 1600 EXTERN int Tcl_PutEnv _ANSI_ARGS_((CONST char *string)); 1601 EXTERN void Tcl_QueueEvent _ANSI_ARGS_((Tcl_Event *evPtr, 1602 Tcl_QueuePosition position)); 1603 EXTERN int Tcl_Read _ANSI_ARGS_((Tcl_Channel chan, 1604 char *bufPtr, int toRead)); 1605 EXTERN int Tcl_ReadChars _ANSI_ARGS_((Tcl_Channel channel, 1606 Tcl_Obj *objPtr, int charsToRead, int appendFlag)); 1607 EXTERN void Tcl_ReapDetachedProcs _ANSI_ARGS_((void)); 1608 EXTERN int Tcl_RecordAndEval _ANSI_ARGS_((Tcl_Interp *interp, 1609 char *cmd, int flags)); 1610 EXTERN int Tcl_RecordAndEvalObj _ANSI_ARGS_((Tcl_Interp *interp, 1611 Tcl_Obj *cmdPtr, int flags)); 1612 EXTERN Tcl_RegExp Tcl_RegExpCompile _ANSI_ARGS_((Tcl_Interp *interp, 1613 char *string)); 1614 EXTERN int Tcl_RegExpExec _ANSI_ARGS_((Tcl_Interp *interp, 1615 Tcl_RegExp regexp, CONST char *string, 1616 CONST char *start)); 1617 EXTERN int Tcl_RegExpMatch _ANSI_ARGS_((Tcl_Interp *interp, 1618 char *string, char *pattern)); 1619 EXTERN void Tcl_RegExpRange _ANSI_ARGS_((Tcl_RegExp regexp, 1620 int index, char **startPtr, char **endPtr)); 1621 EXTERN void Tcl_RegisterChannel _ANSI_ARGS_((Tcl_Interp *interp, 1622 Tcl_Channel chan)); 1623 EXTERN void Tcl_RegisterObjType _ANSI_ARGS_(( 1624 Tcl_ObjType *typePtr)); 1625 EXTERN void Tcl_Release _ANSI_ARGS_((ClientData clientData)); 1626 EXTERN void Tcl_RestartIdleTimer _ANSI_ARGS_((void)); 1627 EXTERN void Tcl_ResetResult _ANSI_ARGS_((Tcl_Interp *interp)); 1628 EXTERN void Tcl_RestoreResult _ANSI_ARGS_((Tcl_Interp *interp, 1629 Tcl_SavedResult *statePtr)); 1630 #define Tcl_Return Tcl_SetResult 1631 EXTERN void Tcl_SaveResult _ANSI_ARGS_((Tcl_Interp *interp, 1632 Tcl_SavedResult *statePtr)); 1633 EXTERN int Tcl_ScanCountedElement _ANSI_ARGS_((CONST char *string, 1634 int length, int *flagPtr)); 1635 EXTERN int Tcl_ScanElement _ANSI_ARGS_((CONST char *string, 1636 int *flagPtr)); 1637 EXTERN int Tcl_Seek _ANSI_ARGS_((Tcl_Channel chan, 1638 int offset, int mode)); 1639 EXTERN int Tcl_ServiceAll _ANSI_ARGS_((void)); 1640 EXTERN int Tcl_ServiceEvent _ANSI_ARGS_((int flags)); 1641 EXTERN void Tcl_SetAssocData _ANSI_ARGS_((Tcl_Interp *interp, 1642 char *name, Tcl_InterpDeleteProc *proc, 1643 ClientData clientData)); 1644 EXTERN void Tcl_SetBooleanObj _ANSI_ARGS_((Tcl_Obj *objPtr, 1645 int boolValue)); 1646 EXTERN unsigned char * Tcl_SetByteArrayLength _ANSI_ARGS_((Tcl_Obj *objPtr, 1647 int length)); 1648 EXTERN void Tcl_SetByteArrayObj _ANSI_ARGS_((Tcl_Obj *objPtr, 1649 unsigned char *bytes, int length)); 1650 EXTERN void Tcl_SetChannelBufferSize _ANSI_ARGS_(( 1651 Tcl_Channel chan, int sz)); 1652 EXTERN int Tcl_SetChannelOption _ANSI_ARGS_(( 1653 Tcl_Interp *interp, Tcl_Channel chan, 1654 char *optionName, char *newValue)); 1655 EXTERN int Tcl_SetCommandInfo _ANSI_ARGS_((Tcl_Interp *interp, 1656 char *cmdName, Tcl_CmdInfo *infoPtr)); 1657 EXTERN void Tcl_SetDoubleObj _ANSI_ARGS_((Tcl_Obj *objPtr, 1658 double doubleValue)); 1659 EXTERN void Tcl_SetErrno _ANSI_ARGS_((int err)); 1660 EXTERN void Tcl_SetErrorCode _ANSI_ARGS_( 1661 TCL_VARARGS(Tcl_Interp *,arg1)); 1662 EXTERN void Tcl_SetIntObj _ANSI_ARGS_((Tcl_Obj *objPtr, 1663 int intValue)); 1664 EXTERN void Tcl_SetListObj _ANSI_ARGS_((Tcl_Obj *objPtr, 1665 int objc, Tcl_Obj *CONST objv[])); 1666 EXTERN void Tcl_SetLongObj _ANSI_ARGS_((Tcl_Obj *objPtr, 1667 long longValue)); 1668 EXTERN void Tcl_SetMaxBlockTime _ANSI_ARGS_((Tcl_Time *timePtr)); 1669 EXTERN void Tcl_SetObjErrorCode _ANSI_ARGS_((Tcl_Interp *interp, 1670 Tcl_Obj *errorObjPtr)); 1671 EXTERN void Tcl_SetObjLength _ANSI_ARGS_((Tcl_Obj *objPtr, 1672 int length)); 1673 EXTERN void Tcl_SetObjResult _ANSI_ARGS_((Tcl_Interp *interp, 1674 Tcl_Obj *resultObjPtr)); 1675 EXTERN Tcl_Obj * Tcl_SetObjVar2 _ANSI_ARGS_((Tcl_Interp *interp, 1676 char *part1, char *part2, Tcl_Obj *newValuePtr, 1677 int flags)); 1678 EXTERN void Tcl_SetPanicProc _ANSI_ARGS_((void (*proc) 1679 _ANSI_ARGS_(TCL_VARARGS(char *, format)))); 1680 EXTERN int Tcl_SetRecursionLimit _ANSI_ARGS_((Tcl_Interp *interp, 1681 int depth)); 1682 EXTERN void Tcl_SetResult _ANSI_ARGS_((Tcl_Interp *interp, 1683 char *string, Tcl_FreeProc *freeProc)); 1684 EXTERN int Tcl_SetServiceMode _ANSI_ARGS_((int mode)); 1685 EXTERN void Tcl_SetStdChannel _ANSI_ARGS_((Tcl_Channel channel, 1686 int type)); 1687 EXTERN void Tcl_SetStringObj _ANSI_ARGS_((Tcl_Obj *objPtr, 1688 char *bytes, int length)); 1689 EXTERN void Tcl_SetTimer _ANSI_ARGS_((Tcl_Time *timePtr)); 1690 EXTERN int Tcl_SetSystemEncoding _ANSI_ARGS_((Tcl_Interp *interp, 1691 CONST char *name)); 1692 EXTERN char * Tcl_SetVar _ANSI_ARGS_((Tcl_Interp *interp, 1693 char *varName, char *newValue, int flags)); 1694 EXTERN char * Tcl_SetVar2 _ANSI_ARGS_((Tcl_Interp *interp, 1695 char *part1, char *part2, char *newValue, 1696 int flags)); 1697 EXTERN char * Tcl_SignalId _ANSI_ARGS_((int sig)); 1698 EXTERN char * Tcl_SignalMsg _ANSI_ARGS_((int sig)); 1699 EXTERN void Tcl_Sleep _ANSI_ARGS_((int ms)); 1700 EXTERN void Tcl_SourceRCFile _ANSI_ARGS_((Tcl_Interp *interp)); 1701 EXTERN int Tcl_SplitList _ANSI_ARGS_((Tcl_Interp *interp, 1702 CONST char *list, int *argcPtr, char ***argvPtr)); 1703 EXTERN void Tcl_SplitPath _ANSI_ARGS_((CONST char *path, 1704 int *argcPtr, char ***argvPtr)); 1705 EXTERN void Tcl_StaticPackage _ANSI_ARGS_((Tcl_Interp *interp, 1706 char *pkgName, Tcl_PackageInitProc *initProc, 1707 Tcl_PackageInitProc *safeInitProc)); 1708 EXTERN int Tcl_StringMatch _ANSI_ARGS_((CONST char *string, 1709 CONST char *pattern)); 1710 EXTERN int Tcl_Tell _ANSI_ARGS_((Tcl_Channel chan)); 1711 EXTERN void Tcl_ThreadAlert _ANSI_ARGS_((Tcl_ThreadId threadId)); 1712 EXTERN void Tcl_ThreadQueueEvent _ANSI_ARGS_(( 1713 Tcl_ThreadId threadId, Tcl_Event* evPtr, 1714 Tcl_QueuePosition position)); 1715 #define Tcl_TildeSubst Tcl_TranslateFileName 1716 EXTERN int Tcl_TraceVar _ANSI_ARGS_((Tcl_Interp *interp, 1717 char *varName, int flags, Tcl_VarTraceProc *proc, 1718 ClientData clientData)); 1719 EXTERN int Tcl_TraceVar2 _ANSI_ARGS_((Tcl_Interp *interp, 1720 char *part1, char *part2, int flags, 1721 Tcl_VarTraceProc *proc, ClientData clientData)); 1722 EXTERN char * Tcl_TranslateFileName _ANSI_ARGS_((Tcl_Interp *interp, 1723 char *name, Tcl_DString *bufferPtr)); 1724 EXTERN int Tcl_Ungets _ANSI_ARGS_((Tcl_Channel chan, char *str, 1725 int len, int atHead)); 1726 EXTERN Tcl_UniChar Tcl_UniCharAtIndex _ANSI_ARGS_((CONST char *src, 1727 int index)); 1728 EXTERN Tcl_UniChar Tcl_UniCharToLower _ANSI_ARGS_((int ch)); 1729 EXTERN Tcl_UniChar Tcl_UniCharToTitle _ANSI_ARGS_((int ch)); 1730 EXTERN Tcl_UniChar Tcl_UniCharToUpper _ANSI_ARGS_((int ch)); 1731 EXTERN int Tcl_UniCharToUtf _ANSI_ARGS_((int ch, 1732 char *buf)); 1733 EXTERN void Tcl_UnlinkVar _ANSI_ARGS_((Tcl_Interp *interp, 1734 char *varName)); 1735 EXTERN int Tcl_UnregisterChannel _ANSI_ARGS_((Tcl_Interp *interp, 1736 Tcl_Channel chan)); 1737 EXTERN int Tcl_UnsetVar _ANSI_ARGS_((Tcl_Interp *interp, 1738 char *varName, int flags)); 1739 EXTERN int Tcl_UnsetVar2 _ANSI_ARGS_((Tcl_Interp *interp, 1740 char *part1, char *part2, int flags)); 1741 EXTERN void Tcl_UntraceVar _ANSI_ARGS_((Tcl_Interp *interp, 1742 char *varName, int flags, Tcl_VarTraceProc *proc, 1743 ClientData clientData)); 1744 EXTERN void Tcl_UntraceVar2 _ANSI_ARGS_((Tcl_Interp *interp, 1745 char *part1, char *part2, int flags, 1746 Tcl_VarTraceProc *proc, ClientData clientData)); 1747 EXTERN void Tcl_UpdateLinkedVar _ANSI_ARGS_((Tcl_Interp *interp, 1748 char *varName)); 1749 EXTERN int Tcl_UpVar _ANSI_ARGS_((Tcl_Interp *interp, 1750 char *frameName, char *varName, 1751 char *localName, int flags)); 1752 EXTERN int Tcl_UpVar2 _ANSI_ARGS_((Tcl_Interp *interp, 1753 char *frameName, char *part1, char *part2, 1754 char *localName, int flags)); 1755 EXTERN char * Tcl_UtfAtIndex _ANSI_ARGS_((CONST char *src, 1756 int index)); 1757 EXTERN int Tcl_UtfCharComplete _ANSI_ARGS_((CONST char *src, 1758 int len)); 1759 EXTERN int Tcl_UtfBackslash _ANSI_ARGS_((CONST char *src, 1760 int *readPtr, char *dst)); 1761 EXTERN char * Tcl_UtfFindFirst _ANSI_ARGS_((CONST char *src, 1762 int ch)); 1763 EXTERN char * Tcl_UtfFindLast _ANSI_ARGS_((CONST char *src, 1764 int ch)); 1765 EXTERN int Tcl_UtfIsLower _ANSI_ARGS_((CONST char *src)); 1766 EXTERN int Tcl_UtfIsUpper _ANSI_ARGS_((CONST char *src)); 1767 EXTERN char * Tcl_UtfNext _ANSI_ARGS_((CONST char *src)); 1768 EXTERN char * Tcl_UtfPrev _ANSI_ARGS_((CONST char *src, 1769 CONST char *start)); 1770 EXTERN int Tcl_UtfToExternal _ANSI_ARGS_((Tcl_Interp *interp, 1771 Tcl_Encoding encoding, CONST char *src, int srcLen, 1772 int flags, Tcl_EncodingState *statePtr, char *dst, 1773 int dstLen, int *srcReadPtr, int *dstWrotePtr, 1774 int *dstCharsPtr)); 1775 EXTERN char * Tcl_UtfToExternalDString _ANSI_ARGS_(( 1776 Tcl_Encoding encoding, CONST char *src, 1777 int srcLen, Tcl_DString *dsPtr)); 1778 EXTERN int Tcl_UtfToLower _ANSI_ARGS_((char *src)); 1779 EXTERN int Tcl_UtfToTitle _ANSI_ARGS_((char *src)); 1780 EXTERN int Tcl_UtfToUniChar _ANSI_ARGS_((CONST char *src, 1781 Tcl_UniChar *chPtr)); 1782 EXTERN int Tcl_UtfToUpper _ANSI_ARGS_((char *src)); 1783 EXTERN int Tcl_VarEval _ANSI_ARGS_( 1784 TCL_VARARGS(Tcl_Interp *,interp)); 1785 EXTERN ClientData Tcl_VarTraceInfo _ANSI_ARGS_((Tcl_Interp *interp, 1786 char *varName, int flags, 1787 Tcl_VarTraceProc *procPtr, 1788 ClientData prevClientData)); 1789 EXTERN ClientData Tcl_VarTraceInfo2 _ANSI_ARGS_((Tcl_Interp *interp, 1790 char *part1, char *part2, int flags, 1791 Tcl_VarTraceProc *procPtr, 1792 ClientData prevClientData)); 1793 EXTERN int Tcl_WaitForEvent _ANSI_ARGS_((Tcl_Time *timePtr)); 1794 EXTERN Tcl_Pid Tcl_WaitPid _ANSI_ARGS_((Tcl_Pid pid, int *statPtr, 1795 int options)); 1796 EXTERN int Tcl_Write _ANSI_ARGS_((Tcl_Channel chan, 1797 char *src, int srcLen)); 1798 EXTERN int Tcl_WriteChars _ANSI_ARGS_((Tcl_Channel chan, 1799 CONST char *src, int srcLen)); 1800 EXTERN int Tcl_WriteObj _ANSI_ARGS_((Tcl_Channel chan, 1801 Tcl_Obj *objPtr)); 1802 EXTERN void Tcl_WrongNumArgs _ANSI_ARGS_((Tcl_Interp *interp, 1803 int objc, Tcl_Obj *CONST objv[], char *message)); 1804 1805 /* Andreas Kupries <andreas_kupries@users.sourceforge.net>, 05/31/1997. 1806 * Support for Tcl-Trf (channel interceptors). 1807 */ 1808 1809 EXTERN Tcl_Channel Tcl_ReplaceChannel _ANSI_ARGS_ ((Tcl_Interp* interp, 1810 Tcl_ChannelType* typePtr, 1811 ClientData instanceData, 1812 int mask, 1813 Tcl_Channel prevChan)); 1814 1815 EXTERN void Tcl_UndoReplaceChannel _ANSI_ARGS_ ((Tcl_Interp* interp, 1816 Tcl_Channel chan)); 1817 1818 1819 #endif /* RESOURCE_INCLUDED */ 1820 #endif /* _TCL */ 1821