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