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