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