home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tkisrc04.zip / tcl / os2 / tcl.h < prev    next >
C/C++ Source or Header  |  1998-08-07  |  41KB  |  1,058 lines

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