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