tcl.h   tcl.h 
/* /*
* tcl.h -- * tcl.h --
* *
* This header file describes the externally-visible facilities * This header file describes the externally-visible facilities
* of the Tcl interpreter. * of the Tcl interpreter.
* *
* Copyright (c) 1987-1994 The Regents of the University of California. * Copyright (c) 1987-1994 The Regents of the University of California.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
* Copyright (c) 1993-1996 Lucent Technologies. * Copyright (c) 1993-1996 Lucent Technologies.
* Copyright (c) 1998-1999 Scriptics Corporation. * Copyright (c) 1994-1998 Sun Microsystems, Inc.
* Copyright (c) 1998-1999 by Scriptics Corporation.
* *
* See the file "license.terms" for information on usage and redistribution * See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES. * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
* *
* RCS: @(#) $Id: tcl.h,v 1.33 1999/02/03 02:58:25 stanton Exp $ * RCS: @(#) $Id: tcl.h,v 1.42 1999/04/21 21:50:23 rjohnson Exp $
*/ */
#ifndef _TCL #ifndef _TCL
#define _TCL #define _TCL
/* /*
* The following defines are used to indicate the various release levels.
*/
#define TCL_ALPHA_RELEASE 0
#define TCL_BETA_RELEASE 1
#define TCL_FINAL_RELEASE 2
/*
* When version numbers change here, must also go into the following files * When version numbers change here, must also go into the following files
* and update the version numbers: * and update the version numbers:
* *
* README
* library/init.tcl (only if major.minor changes, not patchlevel) * library/init.tcl (only if major.minor changes, not patchlevel)
* unix/configure.in * unix/configure.in
* win/makefile.bc (only if major.minor changes, not patchlevel) * win/makefile.bc (only if major.minor changes, not patchlevel)
* win/makefile.vc (only if major.minor changes, not patchlevel) * win/makefile.vc (only if major.minor changes, not patchlevel)
* win/README * win/pkgIndex.tcl (for tclregNN.dll, not patchlevel)
* win/README.binary * README
* mac/README * mac/README
* * win/README.binary
* The release level should be 0 for alpha, 1 for beta, and 2 for * win/README (only if major.minor changes, not patchlevel)
* final/patch. The release serial value is the number that follows the * unix/README (only if major.minor changes, not patchlevel)
* "a", "b", or "p" in the patch level; for example, if the patch level
* is 7.6b2, TCL_RELEASE_SERIAL is 2. It restarts at 1 whenever the
* release level is changed, except for the final release which is 0
* (the first patch will start at 1).
*/ */
#define TCL_MAJOR_VERSION 8 #define TCL_MAJOR_VERSION 8
#define TCL_MINOR_VERSION 0 #define TCL_MINOR_VERSION 1
#define TCL_RELEASE_LEVEL 2 #define TCL_RELEASE_LEVEL TCL_FINAL_RELEASE
#define TCL_RELEASE_SERIAL 5 #define TCL_RELEASE_SERIAL 0
#define TCL_VERSION "8.0" #define TCL_VERSION "8.1"
#define TCL_PATCH_LEVEL "8.0.5" #define TCL_PATCH_LEVEL "8.1.0"
/* /*
* The following definitions set up the proper options for Windows * The following definitions set up the proper options for Windows
* compilers. We use this method because there is no autoconf equivalent. * compilers. We use this method because there is no autoconf equivalent.
*/ */
#ifndef __WIN32__ #ifndef __WIN32__
# if defined(_WIN32) || defined(WIN32) # if defined(_WIN32) || defined(WIN32)
# define __WIN32__ # define __WIN32__
# endif # endif
skipping to change at line 100 skipping to change at line 103
#ifdef MAC_TCL #ifdef MAC_TCL
# ifndef HAS_STDARG # ifndef HAS_STDARG
# define HAS_STDARG 1 # define HAS_STDARG 1
# endif # endif
# ifndef USE_TCLALLOC # ifndef USE_TCLALLOC
# define USE_TCLALLOC 1 # define USE_TCLALLOC 1
# endif # endif
# ifndef NO_STRERROR # ifndef NO_STRERROR
# define NO_STRERROR 1 # define NO_STRERROR 1
# endif # endif
# define INLINE
#endif #endif
/* /*
* Utility macros: STRINGIFY takes an argument and wraps it in "" (double * Utility macros: STRINGIFY takes an argument and wraps it in "" (double
* quotation marks), JOIN joins two arguments. * quotation marks), JOIN joins two arguments.
*/ */
#define VERBATIM(x) x #define VERBATIM(x) x
#ifdef _MSC_VER #ifdef _MSC_VER
# define STRINGIFY(x) STRINGIFY1(x) # define STRINGIFY(x) STRINGIFY1(x)
skipping to change at line 131 skipping to change at line 135
# define STRINGIFY(x) #x # define STRINGIFY(x) #x
# define JOIN(a,b) a##b # define JOIN(a,b) a##b
# else # else
# define STRINGIFY(x) "x" # define STRINGIFY(x) "x"
# define JOIN(a,b) VERBATIM(a)VERBATIM(b) # define JOIN(a,b) VERBATIM(a)VERBATIM(b)
# endif # endif
# endif # endif
#endif #endif
/* /*
* Special macro to define mutexes, that doesn't do anything
* if we are not using threads.
*/
#ifdef TCL_THREADS
#define TCL_DECLARE_MUTEX(name) static Tcl_Mutex name;
#else
#define TCL_DECLARE_MUTEX(name)
#endif
/*
* Macros that eliminate the overhead of the thread synchronization
* functions when compiling without thread support.
*/
#ifndef TCL_THREADS
#define Tcl_MutexLock(mutexPtr)
#define Tcl_MutexUnlock(mutexPtr)
#define Tcl_ConditionNotify(condPtr)
#define Tcl_ConditionWait(condPtr, mutexPtr, timePtr)
#endif /* TCL_THREADS */
/*
* A special definition used to allow this header file to be included * A special definition used to allow this header file to be included
* in resource files so that they can get obtain version information from * in resource files so that they can get obtain version information from
* this file. Resource compilers don't like all the C stuff, like typedefs * this file. Resource compilers don't like all the C stuff, like typedefs
* and procedure declarations, that occur below. * and procedure declarations, that occur below.
*/ */
#ifndef RESOURCE_INCLUDED #ifndef RESOURCE_INCLUDED
#ifndef BUFSIZ #ifndef BUFSIZ
#include <stdio.h> #include <stdio.h>
skipping to change at line 154 skipping to change at line 181
* Definitions that allow Tcl functions with variable numbers of * Definitions that allow Tcl functions with variable numbers of
* arguments to be used with either varargs.h or stdarg.h. TCL_VARARGS * arguments to be used with either varargs.h or stdarg.h. TCL_VARARGS
* is used in procedure prototypes. TCL_VARARGS_DEF is used to declare * is used in procedure prototypes. TCL_VARARGS_DEF is used to declare
* the arguments in a function definiton: it takes the type and name of * the arguments in a function definiton: it takes the type and name of
* the first argument and supplies the appropriate argument declaration * the first argument and supplies the appropriate argument declaration
* string for use in the function definition. TCL_VARARGS_START * string for use in the function definition. TCL_VARARGS_START
* initializes the va_list data structure and returns the first argument. * initializes the va_list data structure and returns the first argument.
*/ */
#if defined(__STDC__) || defined(HAS_STDARG) #if defined(__STDC__) || defined(HAS_STDARG)
# include <stdarg.h>
# define TCL_VARARGS(type, name) (type name, ...) # define TCL_VARARGS(type, name) (type name, ...)
# define TCL_VARARGS_DEF(type, name) (type name, ...) # define TCL_VARARGS_DEF(type, name) (type name, ...)
# define TCL_VARARGS_START(type, name, list) (va_start(list, name), name) # define TCL_VARARGS_START(type, name, list) (va_start(list, name), name)
#else #else
# include <varargs.h>
# ifdef __cplusplus # ifdef __cplusplus
# define TCL_VARARGS(type, name) (type name, ...) # define TCL_VARARGS(type, name) (type name, ...)
# define TCL_VARARGS_DEF(type, name) (type va_alist, ...) # define TCL_VARARGS_DEF(type, name) (type va_alist, ...)
# else # else
# define TCL_VARARGS(type, name) () # define TCL_VARARGS(type, name) ()
# define TCL_VARARGS_DEF(type, name) (va_alist) # define TCL_VARARGS_DEF(type, name) (va_alist)
# endif # endif
# define TCL_VARARGS_START(type, name, list) \ # define TCL_VARARGS_START(type, name, list) \
(va_start(list), va_arg(list, type)) (va_start(list), va_arg(list, type))
#endif #endif
/* /*
* Macros used to declare a function to be exported by a DLL. * Macros used to declare a function to be exported by a DLL.
* Used by Windows, maps to no-op declarations on non-Windows systems. * Used by Windows, maps to no-op declarations on non-Windows systems.
* The default build on windows is for a DLL, which causes the DLLIMPORT * The default build on windows is for a DLL, which causes the DLLIMPORT
* and DLLEXPORT macros to be nonempty. To build a static library, the * and DLLEXPORT macros to be nonempty. To build a static library, the
* macro STATIC_BUILD should be defined. * macro STATIC_BUILD should be defined.
* The support follows the convention that a macro called BUILD_xxxx, where
* xxxx is the name of a library we are building, is set on the compile lin
e
* for sources that are to be placed in the library. See BUILD_tcl in this
* file for an example of how the macro is to be used.
*/ */
#ifdef __WIN32__ #ifdef STATIC_BUILD
# ifdef STATIC_BUILD # define DLLIMPORT
# define DLLIMPORT # define DLLEXPORT
# define DLLEXPORT #else
# else # if defined(__WIN32__) && (defined(_MSC_VER) || (defined(__GNUC__) && defi
# if defined(_MSC_VER) || (defined(__GNUC__) && defined(__declspec)) ned(__declspec)))
# define DLLIMPORT __declspec(dllimport) # define DLLIMPORT __declspec(dllimport)
# define DLLEXPORT __declspec(dllexport) # define DLLEXPORT __declspec(dllexport)
# else # else
# define DLLIMPORT # define DLLIMPORT
# define DLLEXPORT # define DLLEXPORT
# endif
# endif # endif
#else
# define DLLIMPORT
# define DLLEXPORT
#endif #endif
#ifdef TCL_STORAGE_CLASS /*
# undef TCL_STORAGE_CLASS * These macros are used to control whether functions are being declared fo
#endif r
* import or export. If a function is being declared while it is being bui
lt
* to be included in a shared library, then it should have the DLLEXPORT
* storage class. If is being declared for use by a module that is going t
o
* link against the shared library, then it should have the DLLIMPORT stora
ge
* class. If the symbol is beind declared for a static build or for use fr
om a
* stub library, then the storage class should be empty.
*
* The convention is that a macro called BUILD_xxxx, where xxxx is the
* name of a library we are building, is set on the compile line for source
s
* that are to be placed in the library. When this macro is set, the
* storage class will be set to DLLEXPORT. At the end of the header file,
the
* storage class will be reset to DLLIMPORt.
*/
#undef TCL_STORAGE_CLASS
#ifdef BUILD_tcl #ifdef BUILD_tcl
# define TCL_STORAGE_CLASS DLLEXPORT # define TCL_STORAGE_CLASS DLLEXPORT
#else #else
# define TCL_STORAGE_CLASS DLLIMPORT # ifdef USE_TCL_STUBS
# define TCL_STORAGE_CLASS
# else
# define TCL_STORAGE_CLASS DLLIMPORT
# endif
#endif #endif
/* /*
* Definitions that allow this header file to be used either with or * Definitions that allow this header file to be used either with or
* without ANSI C features like function prototypes. * without ANSI C features like function prototypes.
*/ */
#undef _ANSI_ARGS_ #undef _ANSI_ARGS_
#undef CONST #undef CONST
#ifndef INLINE
# define INLINE
#endif
#if ((defined(__STDC__) || defined(SABER)) && !defined(NO_PROTOTYPE)) || de fined(__cplusplus) || defined(USE_PROTOTYPE) #if ((defined(__STDC__) || defined(SABER)) && !defined(NO_PROTOTYPE)) || de fined(__cplusplus) || defined(USE_PROTOTYPE)
# define _USING_PROTOTYPES_ 1 # define _USING_PROTOTYPES_ 1
# define _ANSI_ARGS_(x) x # define _ANSI_ARGS_(x) x
# define CONST const # define CONST const
#else #else
# define _ANSI_ARGS_(x) () # define _ANSI_ARGS_(x) ()
# define CONST # define CONST
#endif #endif
skipping to change at line 311 skipping to change at line 354
* free the result. Tcl_Eval must free it * free the result. Tcl_Eval must free it
* before executing next command. */ * before executing next command. */
int errorLine; /* When TCL_ERROR is returned, this gives int errorLine; /* When TCL_ERROR is returned, this gives
* the line number within the command where * the line number within the command where
* the error occurred (1 if first line). */ * the error occurred (1 if first line). */
} Tcl_Interp; } Tcl_Interp;
typedef struct Tcl_AsyncHandler_ *Tcl_AsyncHandler; typedef struct Tcl_AsyncHandler_ *Tcl_AsyncHandler;
typedef struct Tcl_Channel_ *Tcl_Channel; typedef struct Tcl_Channel_ *Tcl_Channel;
typedef struct Tcl_Command_ *Tcl_Command; typedef struct Tcl_Command_ *Tcl_Command;
typedef struct Tcl_Condition_ *Tcl_Condition;
typedef struct Tcl_EncodingState_ *Tcl_EncodingState;
typedef struct Tcl_Encoding_ *Tcl_Encoding;
typedef struct Tcl_Event Tcl_Event; typedef struct Tcl_Event Tcl_Event;
typedef struct Tcl_Mutex_ *Tcl_Mutex;
typedef struct Tcl_Pid_ *Tcl_Pid; typedef struct Tcl_Pid_ *Tcl_Pid;
typedef struct Tcl_RegExp_ *Tcl_RegExp; typedef struct Tcl_RegExp_ *Tcl_RegExp;
typedef struct Tcl_ThreadDataKey_ *Tcl_ThreadDataKey;
typedef struct Tcl_ThreadId_ *Tcl_ThreadId;
typedef struct Tcl_TimerToken_ *Tcl_TimerToken; typedef struct Tcl_TimerToken_ *Tcl_TimerToken;
typedef struct Tcl_Trace_ *Tcl_Trace; typedef struct Tcl_Trace_ *Tcl_Trace;
typedef struct Tcl_Var_ *Tcl_Var; typedef struct Tcl_Var_ *Tcl_Var;
/* /*
* Picky compilers complain if this typdef doesn't appear before the
* struct's reference in tclDecls.h.
*/
typedef struct stat *Tcl_Stat_;
/*
* When a TCL command returns, the interpreter contains a result from the * When a TCL command returns, the interpreter contains a result from the
* command. Programmers are strongly encouraged to use one of the * command. Programmers are strongly encouraged to use one of the
* procedures Tcl_GetObjResult() or Tcl_GetStringResult() to read the * procedures Tcl_GetObjResult() or Tcl_GetStringResult() to read the
* interpreter's result. See the SetResult man page for details. Besides * interpreter's result. See the SetResult man page for details. Besides
* this result, the command procedure returns an integer code, which is * this result, the command procedure returns an integer code, which is
* one of the following: * one of the following:
* *
* TCL_OK Command completed normally; the interpreter's * TCL_OK Command completed normally; the interpreter's
* result contains the command's result. * result contains the command's result.
* TCL_ERROR The command couldn't be completed successfully; * TCL_ERROR The command couldn't be completed successfully;
skipping to change at line 384 skipping to change at line 440
typedef void (Tcl_ChannelProc) _ANSI_ARGS_((ClientData clientData, int mask )); typedef void (Tcl_ChannelProc) _ANSI_ARGS_((ClientData clientData, int mask ));
typedef void (Tcl_CloseProc) _ANSI_ARGS_((ClientData data)); typedef void (Tcl_CloseProc) _ANSI_ARGS_((ClientData data));
typedef void (Tcl_CmdDeleteProc) _ANSI_ARGS_((ClientData clientData)); typedef void (Tcl_CmdDeleteProc) _ANSI_ARGS_((ClientData clientData));
typedef int (Tcl_CmdProc) _ANSI_ARGS_((ClientData clientData, typedef int (Tcl_CmdProc) _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, int argc, char *argv[])); Tcl_Interp *interp, int argc, char *argv[]));
typedef void (Tcl_CmdTraceProc) _ANSI_ARGS_((ClientData clientData, typedef void (Tcl_CmdTraceProc) _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, int level, char *command, Tcl_CmdProc *proc, Tcl_Interp *interp, int level, char *command, Tcl_CmdProc *proc,
ClientData cmdClientData, int argc, char *argv[])); ClientData cmdClientData, int argc, char *argv[]));
typedef void (Tcl_DupInternalRepProc) _ANSI_ARGS_((struct Tcl_Obj *srcPtr, typedef void (Tcl_DupInternalRepProc) _ANSI_ARGS_((struct Tcl_Obj *srcPtr,
struct Tcl_Obj *dupPtr)); struct Tcl_Obj *dupPtr));
typedef int (Tcl_EncodingConvertProc)_ANSI_ARGS_((ClientData clientData,
CONST char *src, int srcLen, int flags, Tcl_EncodingState *statePtr,
char *dst, int dstLen, int *srcReadPtr, int *dstWrotePtr,
int *dstCharsPtr));
typedef void (Tcl_EncodingFreeProc)_ANSI_ARGS_((ClientData clientData));
typedef int (Tcl_EventProc) _ANSI_ARGS_((Tcl_Event *evPtr, int flags)); typedef int (Tcl_EventProc) _ANSI_ARGS_((Tcl_Event *evPtr, int flags));
typedef void (Tcl_EventCheckProc) _ANSI_ARGS_((ClientData clientData, typedef void (Tcl_EventCheckProc) _ANSI_ARGS_((ClientData clientData,
int flags)); int flags));
typedef int (Tcl_EventDeleteProc) _ANSI_ARGS_((Tcl_Event *evPtr, typedef int (Tcl_EventDeleteProc) _ANSI_ARGS_((Tcl_Event *evPtr,
ClientData clientData)); ClientData clientData));
typedef void (Tcl_EventSetupProc) _ANSI_ARGS_((ClientData clientData, typedef void (Tcl_EventSetupProc) _ANSI_ARGS_((ClientData clientData,
int flags)); int flags));
typedef void (Tcl_ExitProc) _ANSI_ARGS_((ClientData clientData)); typedef void (Tcl_ExitProc) _ANSI_ARGS_((ClientData clientData));
typedef void (Tcl_FileProc) _ANSI_ARGS_((ClientData clientData, int mask)); typedef void (Tcl_FileProc) _ANSI_ARGS_((ClientData clientData, int mask));
typedef void (Tcl_FileFreeProc) _ANSI_ARGS_((ClientData clientData)); typedef void (Tcl_FileFreeProc) _ANSI_ARGS_((ClientData clientData));
typedef void (Tcl_FreeInternalRepProc) _ANSI_ARGS_((struct Tcl_Obj *objPtr) ); typedef void (Tcl_FreeInternalRepProc) _ANSI_ARGS_((struct Tcl_Obj *objPtr) );
typedef void (Tcl_FreeProc) _ANSI_ARGS_((char *blockPtr)); typedef void (Tcl_FreeProc) _ANSI_ARGS_((char *blockPtr));
typedef void (Tcl_IdleProc) _ANSI_ARGS_((ClientData clientData)); typedef void (Tcl_IdleProc) _ANSI_ARGS_((ClientData clientData));
typedef void (Tcl_InterpDeleteProc) _ANSI_ARGS_((ClientData clientData, typedef void (Tcl_InterpDeleteProc) _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp)); Tcl_Interp *interp));
typedef int (Tcl_MathProc) _ANSI_ARGS_((ClientData clientData, typedef int (Tcl_MathProc) _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, Tcl_Value *args, Tcl_Value *resultPtr)); Tcl_Interp *interp, Tcl_Value *args, Tcl_Value *resultPtr));
typedef void (Tcl_NamespaceDeleteProc) _ANSI_ARGS_((ClientData clientData)) ; typedef void (Tcl_NamespaceDeleteProc) _ANSI_ARGS_((ClientData clientData)) ;
typedef int (Tcl_ObjCmdProc) _ANSI_ARGS_((ClientData clientData, typedef int (Tcl_ObjCmdProc) _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, int objc, struct Tcl_Obj * CONST objv[])); Tcl_Interp *interp, int objc, struct Tcl_Obj *CONST objv[]));
typedef int (Tcl_PackageInitProc) _ANSI_ARGS_((Tcl_Interp *interp)); typedef int (Tcl_PackageInitProc) _ANSI_ARGS_((Tcl_Interp *interp));
typedef void (Tcl_PanicProc) _ANSI_ARGS_(TCL_VARARGS(char *, format));
typedef void (Tcl_TcpAcceptProc) _ANSI_ARGS_((ClientData callbackData, typedef void (Tcl_TcpAcceptProc) _ANSI_ARGS_((ClientData callbackData,
Tcl_Channel chan, char *address, int port)); Tcl_Channel chan, char *address, int port));
typedef void (Tcl_TimerProc) _ANSI_ARGS_((ClientData clientData)); typedef void (Tcl_TimerProc) _ANSI_ARGS_((ClientData clientData));
typedef int (Tcl_SetFromAnyProc) _ANSI_ARGS_((Tcl_Interp *interp, typedef int (Tcl_SetFromAnyProc) _ANSI_ARGS_((Tcl_Interp *interp,
struct Tcl_Obj *objPtr)); struct Tcl_Obj *objPtr));
typedef void (Tcl_UpdateStringProc) _ANSI_ARGS_((struct Tcl_Obj *objPtr)); typedef void (Tcl_UpdateStringProc) _ANSI_ARGS_((struct Tcl_Obj *objPtr));
typedef char *(Tcl_VarTraceProc) _ANSI_ARGS_((ClientData clientData, typedef char *(Tcl_VarTraceProc) _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, char *part1, char *part2, int flags)); Tcl_Interp *interp, char *part1, char *part2, int flags));
/* /*
skipping to change at line 456 skipping to change at line 518
int refCount; /* When 0 the object will be freed. */ int refCount; /* When 0 the object will be freed. */
char *bytes; /* This points to the first byte of the char *bytes; /* This points to the first byte of the
* object's string representation. The array * object's string representation. The array
* must be followed by a null byte (i.e., at * must be followed by a null byte (i.e., at
* offset length) but may also contain * offset length) but may also contain
* embedded null characters. The array's * embedded null characters. The array's
* storage is allocated by ckalloc. NULL * storage is allocated by ckalloc. NULL
* means the string rep is invalid and must * means the string rep is invalid and must
* be regenerated from the internal rep. * be regenerated from the internal rep.
* Clients should use Tcl_GetStringFromObj * Clients should use Tcl_GetStringFromObj
* to get a pointer to the byte array as a * or Tcl_GetString to get a pointer to the
* readonly value. */ * byte array as a readonly value. */
int length; /* The number of bytes at *bytes, no t int length; /* The number of bytes at *bytes, no t
* including the terminating null. */ * including the terminating null. */
Tcl_ObjType *typePtr; /* Denotes the object's type. Always Tcl_ObjType *typePtr; /* Denotes the object's type. Always
* corresponds to the type of the object's * corresponds to the type of the object's
* internal rep. NULL indicates the object * internal rep. NULL indicates the object
* has no internal rep (has no type). */ * has no internal rep (has no type). */
union { /* The internal representation: */ union { /* The internal representation: */
long longValue; /* - an long integer value */ long longValue; /* - an long integer value */
double doubleValue; /* - a double-precision floating value */ double doubleValue; /* - a double-precision floating value */
VOID *otherValuePtr; /* - another, type-specific value */ VOID *otherValuePtr; /* - another, type-specific value */
skipping to change at line 508 skipping to change at line 570
# define Tcl_IncrRefCount(objPtr) \ # define Tcl_IncrRefCount(objPtr) \
++(objPtr)->refCount ++(objPtr)->refCount
# define Tcl_DecrRefCount(objPtr) \ # define Tcl_DecrRefCount(objPtr) \
if (--(objPtr)->refCount <= 0) TclFreeObj(objPtr) if (--(objPtr)->refCount <= 0) TclFreeObj(objPtr)
# define Tcl_IsShared(objPtr) \ # define Tcl_IsShared(objPtr) \
((objPtr)->refCount > 1) ((objPtr)->refCount > 1)
#endif #endif
/* /*
* Macros and definitions that help to debug the use of Tcl objects. * Macros and definitions that help to debug the use of Tcl objects.
* When TCL_MEM_DEBUG is defined, the Tcl_New* declarations are * When TCL_MEM_DEBUG is defined, the Tcl_New declarations are
* overridden to call debugging versions of the object creation procedures. * overridden to call debugging versions of the object creation procedures.
*/ */
EXTERN Tcl_Obj * Tcl_NewBooleanObj _ANSI_ARGS_((int boolValue));
EXTERN Tcl_Obj * Tcl_NewDoubleObj _ANSI_ARGS_((double doubleValue));
EXTERN Tcl_Obj * Tcl_NewIntObj _ANSI_ARGS_((int intValue));
EXTERN Tcl_Obj * Tcl_NewListObj _ANSI_ARGS_((int objc,
Tcl_Obj *CONST objv[]));
EXTERN Tcl_Obj * Tcl_NewLongObj _ANSI_ARGS_((long longValue));
EXTERN Tcl_Obj * Tcl_NewObj _ANSI_ARGS_((void));
EXTERN Tcl_Obj * Tcl_NewStringObj _ANSI_ARGS_((char *bytes,
int length));
#ifdef TCL_MEM_DEBUG #ifdef TCL_MEM_DEBUG
# define Tcl_NewBooleanObj(val) \ # define Tcl_NewBooleanObj(val) \
Tcl_DbNewBooleanObj(val, __FILE__, __LINE__) Tcl_DbNewBooleanObj(val, __FILE__, __LINE__)
# define Tcl_NewByteArrayObj(bytes, len) \
Tcl_DbNewByteArrayObj(bytes, len, __FILE__, __LINE__)
# define Tcl_NewDoubleObj(val) \ # define Tcl_NewDoubleObj(val) \
Tcl_DbNewDoubleObj(val, __FILE__, __LINE__) Tcl_DbNewDoubleObj(val, __FILE__, __LINE__)
# define Tcl_NewIntObj(val) \ # define Tcl_NewIntObj(val) \
Tcl_DbNewLongObj(val, __FILE__, __LINE__) Tcl_DbNewLongObj(val, __FILE__, __LINE__)
# define Tcl_NewListObj(objc, objv) \ # define Tcl_NewListObj(objc, objv) \
Tcl_DbNewListObj(objc, objv, __FILE__, __LINE__) Tcl_DbNewListObj(objc, objv, __FILE__, __LINE__)
# define Tcl_NewLongObj(val) \ # define Tcl_NewLongObj(val) \
Tcl_DbNewLongObj(val, __FILE__, __LINE__) Tcl_DbNewLongObj(val, __FILE__, __LINE__)
# define Tcl_NewObj() \ # define Tcl_NewObj() \
Tcl_DbNewObj(__FILE__, __LINE__) Tcl_DbNewObj(__FILE__, __LINE__)
# define Tcl_NewStringObj(bytes, len) \ # define Tcl_NewStringObj(bytes, len) \
Tcl_DbNewStringObj(bytes, len, __FILE__, __LINE__) Tcl_DbNewStringObj(bytes, len, __FILE__, __LINE__)
#endif /* TCL_MEM_DEBUG */ #endif /* TCL_MEM_DEBUG */
/* /*
* The following structure contains the state needed by
* Tcl_SaveResult. No-one outside of Tcl should access any of these
* fields. This structure is typically allocated on the stack.
*/
typedef struct Tcl_SavedResult {
char *result;
Tcl_FreeProc *freeProc;
Tcl_Obj *objResultPtr;
char *appendResult;
int appendAvl;
int appendUsed;
char resultSpace[TCL_RESULT_SIZE+1];
} Tcl_SavedResult;
/*
* The following definitions support Tcl's namespace facility. * The following definitions support Tcl's namespace facility.
* Note: the first five fields must match exactly the fields in a * Note: the first five fields must match exactly the fields in a
* Namespace structure (see tcl.h). * Namespace structure (see tcl.h).
*/ */
typedef struct Tcl_Namespace { typedef struct Tcl_Namespace {
char *name; /* The namespace's name within its parent char *name; /* The namespace's name within its parent
* namespace. This contains no ::'s. The * namespace. This contains no ::'s. The
* name of the global namespace is "" * name of the global namespace is ""
* although "::" is an synonym. */ * although "::" is an synonym. */
skipping to change at line 661 skipping to change at line 731
* is small. */ * is small. */
} Tcl_DString; } Tcl_DString;
#define Tcl_DStringLength(dsPtr) ((dsPtr)->length) #define Tcl_DStringLength(dsPtr) ((dsPtr)->length)
#define Tcl_DStringValue(dsPtr) ((dsPtr)->string) #define Tcl_DStringValue(dsPtr) ((dsPtr)->string)
#define Tcl_DStringTrunc Tcl_DStringSetLength #define Tcl_DStringTrunc Tcl_DStringSetLength
/* /*
* Definitions for the maximum number of digits of precision that may * Definitions for the maximum number of digits of precision that may
* be specified in the "tcl_precision" variable, and the number of * be specified in the "tcl_precision" variable, and the number of
* characters of buffer space required by Tcl_PrintDouble. * bytes of buffer space required by Tcl_PrintDouble.
*/ */
#define TCL_MAX_PREC 17 #define TCL_MAX_PREC 17
#define TCL_DOUBLE_SPACE (TCL_MAX_PREC+10) #define TCL_DOUBLE_SPACE (TCL_MAX_PREC+10)
/* /*
* Definition for a number of bytes of buffer space sufficient to hold the
* string representation of an integer in base 10 (assuming the existence
* of 64-bit integers).
*/
#define TCL_INTEGER_SPACE 24
/*
* Flag that may be passed to Tcl_ConvertElement to force it not to * Flag that may be passed to Tcl_ConvertElement to force it not to
* output braces (careful! if you change this flag be sure to change * output braces (careful! if you change this flag be sure to change
* the definitions at the front of tclUtil.c). * the definitions at the front of tclUtil.c).
*/ */
#define TCL_DONT_USE_BRACES 1 #define TCL_DONT_USE_BRACES 1
/* /*
* Flag that may be passed to Tcl_GetIndexFromObj to force it to disallow * Flag that may be passed to Tcl_GetIndexFromObj to force it to disallow
* abbreviated strings. * abbreviated strings.
*/ */
#define TCL_EXACT 1 #define TCL_EXACT 1
/* /*
* Flag values passed to Tcl_RecordAndEval. * Flag values passed to Tcl_RecordAndEval and/or Tcl_EvalObj.
* WARNING: these bit choices must not conflict with the bit choices * WARNING: these bit choices must not conflict with the bit choices
* for evalFlag bits in tclInt.h!! * for evalFlag bits in tclInt.h!!
*/ */
#define TCL_NO_EVAL 0x10000 #define TCL_NO_EVAL 0x10000
#define TCL_EVAL_GLOBAL 0x20000 #define TCL_EVAL_GLOBAL 0x20000
#define TCL_EVAL_DIRECT 0x40000
/* /*
* Special freeProc values that may be passed to Tcl_SetResult (see * Special freeProc values that may be passed to Tcl_SetResult (see
* the man page for details): * the man page for details):
*/ */
#define TCL_VOLATILE ((Tcl_FreeProc *) 1) #define TCL_VOLATILE ((Tcl_FreeProc *) 1)
#define TCL_STATIC ((Tcl_FreeProc *) 0) #define TCL_STATIC ((Tcl_FreeProc *) 0)
#define TCL_DYNAMIC ((Tcl_FreeProc *) 3) #define TCL_DYNAMIC ((Tcl_FreeProc *) 3)
skipping to change at line 714 skipping to change at line 793
#define TCL_GLOBAL_ONLY 1 #define TCL_GLOBAL_ONLY 1
#define TCL_NAMESPACE_ONLY 2 #define TCL_NAMESPACE_ONLY 2
#define TCL_APPEND_VALUE 4 #define TCL_APPEND_VALUE 4
#define TCL_LIST_ELEMENT 8 #define TCL_LIST_ELEMENT 8
#define TCL_TRACE_READS 0x10 #define TCL_TRACE_READS 0x10
#define TCL_TRACE_WRITES 0x20 #define TCL_TRACE_WRITES 0x20
#define TCL_TRACE_UNSETS 0x40 #define TCL_TRACE_UNSETS 0x40
#define TCL_TRACE_DESTROYED 0x80 #define TCL_TRACE_DESTROYED 0x80
#define TCL_INTERP_DESTROYED 0x100 #define TCL_INTERP_DESTROYED 0x100
#define TCL_LEAVE_ERR_MSG 0x200 #define TCL_LEAVE_ERR_MSG 0x200
#define TCL_PARSE_PART1 0x400 #define TCL_TRACE_ARRAY 0x800
/*
* The TCL_PARSE_PART1 flag is deprecated and has no effect.
* The part1 is now always parsed whenever the part2 is NULL.
* (This is to avoid a common error when converting code to
* use the new object based APIs and forgetting to give the
* flag)
*/
#ifndef TCL_NO_DEPRECATED
#define TCL_PARSE_PART1 0x400
#endif
/* /*
* Types for linked variables: * Types for linked variables:
*/ */
#define TCL_LINK_INT 1 #define TCL_LINK_INT 1
#define TCL_LINK_DOUBLE 2 #define TCL_LINK_DOUBLE 2
#define TCL_LINK_BOOLEAN 3 #define TCL_LINK_BOOLEAN 3
#define TCL_LINK_STRING 4 #define TCL_LINK_STRING 4
#define TCL_LINK_READ_ONLY 0x80 #define TCL_LINK_READ_ONLY 0x80
/* /*
* The following declarations either map ckalloc and ckfree to
* malloc and free, or they map them to procedures with all sorts
* of debugging hooks defined in tclCkalloc.c.
*/
EXTERN char * Tcl_Alloc _ANSI_ARGS_((unsigned int size));
EXTERN void Tcl_Free _ANSI_ARGS_((char *ptr));
EXTERN char * Tcl_Realloc _ANSI_ARGS_((char *ptr,
unsigned int size));
#ifdef TCL_MEM_DEBUG
# define Tcl_Alloc(x) Tcl_DbCkalloc(x, __FILE__, __LINE__)
# define Tcl_Free(x) Tcl_DbCkfree(x, __FILE__, __LINE__)
# define Tcl_Realloc(x,y) Tcl_DbCkrealloc((x), (y),__FILE__, __LINE__)
# define ckalloc(x) Tcl_DbCkalloc(x, __FILE__, __LINE__)
# define ckfree(x) Tcl_DbCkfree(x, __FILE__, __LINE__)
# define ckrealloc(x,y) Tcl_DbCkrealloc((x), (y),__FILE__, __LINE__)
EXTERN int Tcl_DumpActiveMemory _ANSI_ARGS_((char *fileName));
EXTERN void Tcl_ValidateAllMemory _ANSI_ARGS_((char *file,
int line));
#else
/*
* If USE_TCLALLOC is true, then we need to call Tcl_Alloc instead of
* the native malloc/free. The only time USE_TCLALLOC should not be
* true is when compiling the Tcl/Tk libraries on Unix systems. In this
* case we can safely call the native malloc/free directly as a performance
* optimization.
*/
# if USE_TCLALLOC
# define ckalloc(x) Tcl_Alloc(x)
# define ckfree(x) Tcl_Free(x)
# define ckrealloc(x,y) Tcl_Realloc(x,y)
# else
# define ckalloc(x) malloc(x)
# define ckfree(x) free(x)
# define ckrealloc(x,y) realloc(x,y)
# endif
# define Tcl_DumpActiveMemory(x)
# define Tcl_ValidateAllMemory(x,y)
#endif /* TCL_MEM_DEBUG */
/*
* Forward declaration of Tcl_HashTable. Needed by some C++ compilers * Forward declaration of Tcl_HashTable. Needed by some C++ compilers
* to prevent errors when the forward reference to Tcl_HashTable is * to prevent errors when the forward reference to Tcl_HashTable is
* encountered in the Tcl_HashEntry structure. * encountered in the Tcl_HashEntry structure.
*/ */
#ifdef __cplusplus #ifdef __cplusplus
struct Tcl_HashTable; struct Tcl_HashTable;
#endif #endif
/* /*
skipping to change at line 965 skipping to change at line 1007
* disposition of the stdio handles. TCL_STDIN, TCL_STDOUT, TCL_STDERR, * disposition of the stdio handles. TCL_STDIN, TCL_STDOUT, TCL_STDERR,
* are also used in Tcl_GetStdChannel. * are also used in Tcl_GetStdChannel.
*/ */
#define TCL_STDIN (1<<1) #define TCL_STDIN (1<<1)
#define TCL_STDOUT (1<<2) #define TCL_STDOUT (1<<2)
#define TCL_STDERR (1<<3) #define TCL_STDERR (1<<3)
#define TCL_ENFORCE_MODE (1<<4) #define TCL_ENFORCE_MODE (1<<4)
/* /*
* Bits passed to Tcl_DriverClose2Proc to indicate which side of a channel
* should be closed.
*/
#define TCL_CLOSE_READ (1<<1)
#define TCL_CLOSE_WRITE (1<<2)
/*
* Value to use as the closeProc for a channel that supports the
* close2Proc interface.
*/
#define TCL_CLOSE2PROC ((Tcl_DriverCloseProc *)1)
/*
* Typedefs for the various operations in a channel type: * Typedefs for the various operations in a channel type:
*/ */
typedef int (Tcl_DriverBlockModeProc) _ANSI_ARGS_(( typedef int (Tcl_DriverBlockModeProc) _ANSI_ARGS_((
ClientData instanceData, int mode)); ClientData instanceData, int mode));
typedef int (Tcl_DriverCloseProc) _ANSI_ARGS_((ClientData instanceData, typedef int (Tcl_DriverCloseProc) _ANSI_ARGS_((ClientData instanceData,
Tcl_Interp *interp)); Tcl_Interp *interp));
typedef int (Tcl_DriverClose2Proc) _ANSI_ARGS_((ClientData instanceData,
Tcl_Interp *interp, int flags));
typedef int (Tcl_DriverInputProc) _ANSI_ARGS_((ClientData instanceData, typedef int (Tcl_DriverInputProc) _ANSI_ARGS_((ClientData instanceData,
char *buf, int toRead, int *errorCodePtr)); char *buf, int toRead, int *errorCodePtr));
typedef int (Tcl_DriverOutputProc) _ANSI_ARGS_((ClientData instanceData, typedef int (Tcl_DriverOutputProc) _ANSI_ARGS_((ClientData instanceData,
char *buf, int toWrite, int *errorCodePtr)); char *buf, int toWrite, int *errorCodePtr));
typedef int (Tcl_DriverSeekProc) _ANSI_ARGS_((ClientData instanceData, typedef int (Tcl_DriverSeekProc) _ANSI_ARGS_((ClientData instanceData,
long offset, int mode, int *errorCodePtr)); long offset, int mode, int *errorCodePtr));
typedef int (Tcl_DriverSetOptionProc) _ANSI_ARGS_(( typedef int (Tcl_DriverSetOptionProc) _ANSI_ARGS_((
ClientData instanceData, Tcl_Interp *interp, ClientData instanceData, Tcl_Interp *interp,
char *optionName, char *value)); char *optionName, char *value));
typedef int (Tcl_DriverGetOptionProc) _ANSI_ARGS_(( typedef int (Tcl_DriverGetOptionProc) _ANSI_ARGS_((
ClientData instanceData, Tcl_Interp *interp, ClientData instanceData, Tcl_Interp *interp,
char *optionName, Tcl_DString *dsPtr)); char *optionName, Tcl_DString *dsPtr));
typedef void (Tcl_DriverWatchProc) _ANSI_ARGS_(( typedef void (Tcl_DriverWatchProc) _ANSI_ARGS_((
ClientData instanceData, int mask)); ClientData instanceData, int mask));
typedef int (Tcl_DriverGetHandleProc) _ANSI_ARGS_(( typedef int (Tcl_DriverGetHandleProc) _ANSI_ARGS_((
ClientData instanceData, int direction, ClientData instanceData, int direction,
ClientData *handlePtr)); ClientData *handlePtr));
/* /*
* The following declarations either map ckalloc and ckfree to
* malloc and free, or they map them to procedures with all sorts
* of debugging hooks defined in tclCkalloc.c.
*/
#ifdef TCL_MEM_DEBUG
# define ckalloc(x) Tcl_DbCkalloc(x, __FILE__, __LINE__)
# define ckfree(x) Tcl_DbCkfree(x, __FILE__, __LINE__)
# define ckrealloc(x,y) Tcl_DbCkrealloc((x), (y),__FILE__, __LINE__)
#else /* !TCL_MEM_DEBUG */
/*
* If USE_TCLALLOC is true, then we need to call Tcl_Alloc instead of
* the native malloc/free. The only time USE_TCLALLOC should not be
* true is when compiling the Tcl/Tk libraries on Unix systems. In this
* case we can safely call the native malloc/free directly as a performance
* optimization.
*/
# if USE_TCLALLOC
# define ckalloc(x) Tcl_Alloc(x)
# define ckfree(x) Tcl_Free(x)
# define ckrealloc(x,y) Tcl_Realloc(x,y)
# else
# define ckalloc(x) malloc(x)
# define ckfree(x) free(x)
# define ckrealloc(x,y) realloc(x,y)
# endif
# define Tcl_InitMemory(x)
# define Tcl_DumpActiveMemory(x)
# define Tcl_ValidateAllMemory(x,y)
#endif /* !TCL_MEM_DEBUG */
/*
* Enum for different end of line translation and recognition modes. * Enum for different end of line translation and recognition modes.
*/ */
typedef enum Tcl_EolTranslation { typedef enum Tcl_EolTranslation {
TCL_TRANSLATE_AUTO, /* Eol == \r, \n and \r\n. * / TCL_TRANSLATE_AUTO, /* Eol == \r, \n and \r\n. * /
TCL_TRANSLATE_CR, /* Eol == \r. */ TCL_TRANSLATE_CR, /* Eol == \r. */
TCL_TRANSLATE_LF, /* Eol == \n. */ TCL_TRANSLATE_LF, /* Eol == \n. */
TCL_TRANSLATE_CRLF /* Eol == \r\n. */ TCL_TRANSLATE_CRLF /* Eol == \r\n. */
} Tcl_EolTranslation; } Tcl_EolTranslation;
skipping to change at line 1016 skipping to change at line 1112
* part of the specific channel type. * part of the specific channel type.
*/ */
typedef struct Tcl_ChannelType { typedef struct Tcl_ChannelType {
char *typeName; /* The name of the channel type in T cl char *typeName; /* The name of the channel type in T cl
* commands. This storage is owned by * commands. This storage is owned by
* channel type. */ * channel type. */
Tcl_DriverBlockModeProc *blockModeProc; Tcl_DriverBlockModeProc *blockModeProc;
/* Set blocking mode for the /* Set blocking mode for the
* raw channel. May be NULL. */ * raw channel. May be NULL. */
Tcl_DriverCloseProc *closeProc; /* Procedure to call to close Tcl_DriverCloseProc *closeProc; /* Procedure to call to close the
* the channel. */ * channel, or TCL_CLOSE2PROC if th
e
* close2Proc should be used
* instead. */
Tcl_DriverInputProc *inputProc; /* Procedure to call for input Tcl_DriverInputProc *inputProc; /* Procedure to call for input
* on channel. */ * on channel. */
Tcl_DriverOutputProc *outputProc; /* Procedure to call for output Tcl_DriverOutputProc *outputProc; /* Procedure to call for output
* on channel. */ * on channel. */
Tcl_DriverSeekProc *seekProc; /* Procedure to call to seek Tcl_DriverSeekProc *seekProc; /* Procedure to call to seek
* on the channel. May be NULL. */ * on the channel. May be NULL. */
Tcl_DriverSetOptionProc *setOptionProc; Tcl_DriverSetOptionProc *setOptionProc;
/* Set an option on a channel. */ /* Set an option on a channel. */
Tcl_DriverGetOptionProc *getOptionProc; Tcl_DriverGetOptionProc *getOptionProc;
/* Get an option from a channel. */ /* Get an option from a channel. */
Tcl_DriverWatchProc *watchProc; /* Set up the notifier to watch Tcl_DriverWatchProc *watchProc; /* Set up the notifier to watch
* for events on this channel. */ * for events on this channel. */
Tcl_DriverGetHandleProc *getHandleProc; Tcl_DriverGetHandleProc *getHandleProc;
/* Get an OS handle from the channel /* Get an OS handle from the channel
* or NULL if not supported. */ * or NULL if not supported. */
VOID *reserved; /* reserved for future expansion */ Tcl_DriverClose2Proc *close2Proc; /* Procedure to call to close the
* channel if the device supports
* closing the read & write sides
* independently. */
} Tcl_ChannelType; } Tcl_ChannelType;
/* /*
* The following flags determine whether the blockModeProc above should * The following flags determine whether the blockModeProc above should
* set the channel into blocking or nonblocking mode. They are passed * set the channel into blocking or nonblocking mode. They are passed
* as arguments to the blockModeProc procedure in the above structure. * as arguments to the blockModeProc procedure in the above structure.
*/ */
#define TCL_MODE_BLOCKING 0 /* Put channel into blocking mode. * / #define TCL_MODE_BLOCKING 0 /* Put channel into blocking mode. * /
#define TCL_MODE_NONBLOCKING 1 /* Put channel into nonblocking #define TCL_MODE_NONBLOCKING 1 /* Put channel into nonblocking
skipping to change at line 1057 skipping to change at line 1158
* Enum for different types of file paths. * Enum for different types of file paths.
*/ */
typedef enum Tcl_PathType { typedef enum Tcl_PathType {
TCL_PATH_ABSOLUTE, TCL_PATH_ABSOLUTE,
TCL_PATH_RELATIVE, TCL_PATH_RELATIVE,
TCL_PATH_VOLUME_RELATIVE TCL_PATH_VOLUME_RELATIVE
} Tcl_PathType; } Tcl_PathType;
/* /*
* Exported Tcl procedures: * The following structure represents a user-defined encoding. It collects
* together all the functions that are used by the specific encoding.
*/
typedef struct Tcl_EncodingType {
CONST char *encodingName; /* The name of the encoding, e.g. "euc-jp".
* This name is the unique key for this
* encoding type. */
Tcl_EncodingConvertProc *toUtfProc;
/* Procedure to convert from external
* encoding into UTF-8. */
Tcl_EncodingConvertProc *fromUtfProc;
/* Procedure to convert from UTF-8 into
* external encoding. */
Tcl_EncodingFreeProc *freeProc;
/* If non-NULL, procedure to call when this
* encoding is deleted. */
ClientData clientData; /* Arbitrary value associated with encoding
* type. Passed to conversion procedures. *
/
int nullSize; /* Number of zero bytes that signify
* end-of-string in this encoding. This
* number is used to determine the source
* string length when the srcLen argument is
* negative. Must be 1 or 2. */
} Tcl_EncodingType;
/*
* The following definitions are used as values for the conversion control
* flags argument when converting text from one character set to another:
*
* TCL_ENCODING_START: Signifies that the source buffer is the firs
t
* block in a (potentially multi-block) input
* stream. Tells the conversion procedure to
* reset to an initial state and perform any
* initialization that needs to occur before th
e
* first byte is converted. If the source
* buffer contains the entire input stream to b
e
* converted, this flag should be set.
*
* TCL_ENCODING_END: Signifies that the source buffer is the last
* block in a (potentially multi-block) input
* stream. Tells the conversion routine to
* perform any finalization that needs to occur
* after the last byte is converted and then to
* reset to an initial state. If the source
* buffer contains the entire input stream to b
e
* converted, this flag should be set.
*
* TCL_ENCODING_STOPONERROR: If set, then the converter will return
* immediately upon encountering an invalid
* byte sequence or a source character that has
* no mapping in the target encoding. If clear
,
* then the converter will skip the problem,
* substituting one or more "close" characters
* in the destination buffer and then continue
* to sonvert the source.
*/
#define TCL_ENCODING_START 0x01
#define TCL_ENCODING_END 0x02
#define TCL_ENCODING_STOPONERROR 0x04
/*
*----------------------------------------------------------------
* The following data structures and declarations are for the new
* Tcl parser. This stuff should all move to tcl.h eventually.
*----------------------------------------------------------------
*/
/*
* For each word of a command, and for each piece of a word such as a
* variable reference, one of the following structures is created to
* describe the token.
*/
typedef struct Tcl_Token {
int type; /* Type of token, such as TCL_TOKEN_WORD;
* see below for valid types. */
char *start; /* First character in token. */
int size; /* Number of bytes in token. */
int numComponents; /* If this token is composed of other
* tokens, this field tells how many of
* them there are (including components of
* components, etc.). The component tokens
* immediately follow this one. */
} Tcl_Token;
/*
* Type values defined for Tcl_Token structures. These values are
* defined as mask bits so that it's easy to check for collections of
* types.
*
* TCL_TOKEN_WORD - The token describes one word of a command,
* from the first non-blank character of
* the word (which may be " or {) up to but
* not including the space, semicolon, or
* bracket that terminates the word.
* NumComponents counts the total number of
* sub-tokens that make up the word. This
* includes, for example, sub-tokens of
* TCL_TOKEN_VARIABLE tokens.
* TCL_TOKEN_SIMPLE_WORD - This token is just like TCL_TOKEN_WORD
* except that the word is guaranteed to
* consist of a single TCL_TOKEN_TEXT
* sub-token.
* TCL_TOKEN_TEXT - The token describes a range of literal
* text that is part of a word.
* NumComponents is always 0.
* TCL_TOKEN_BS - The token describes a backslash sequence
* that must be collapsed. NumComponents
* is always 0.
* TCL_TOKEN_COMMAND - The token describes a command whose result
* must be substituted into the word. The
* token includes the enclosing brackets.
* NumComponents is always 0.
* TCL_TOKEN_VARIABLE - The token describes a variable
* substitution, including the dollar sign,
* variable name, and array index (if there
* is one) up through the right
* parentheses. NumComponents tells how
* many additional tokens follow to
* represent the variable name. The first
* token will be a TCL_TOKEN_TEXT token
* that describes the variable name. If
* the variable is an array reference then
* there will be one or more additional
* tokens, of type TCL_TOKEN_TEXT,
* TCL_TOKEN_BS, TCL_TOKEN_COMMAND, and
* TCL_TOKEN_VARIABLE, that describe the
* array index; numComponents counts the
* total number of nested tokens that make
* up the variable reference, including
* sub-tokens of TCL_TOKEN_VARIABLE tokens.
* TCL_TOKEN_SUB_EXPR - The token describes one subexpressio
n of a
* expression, from the first non-blank
* character of the subexpression up to but not
* including the space, brace, or bracket
* that terminates the subexpression.
* NumComponents counts the total number of
* following subtokens that make up the
* subexpression; this includes all subtokens
* for any nested TCL_TOKEN_SUB_EXPR tokens.
* For example, a numeric value used as a
* primitive operand is described by a
* TCL_TOKEN_SUB_EXPR token followed by a
* TCL_TOKEN_TEXT token. A binary subexpression
* is described by a TCL_TOKEN_SUB_EXPR token
* followed by the TCL_TOKEN_OPERATOR token
* for the operator, then TCL_TOKEN_SUB_EXPR
* tokens for the left then the right operands.
* TCL_TOKEN_OPERATOR - The token describes one expression o
perator.
* An operator might be the name of a math
* function such as "abs". A TCL_TOKEN_OPERATOR
* token is always preceeded by one
* TCL_TOKEN_SUB_EXPR token for the operator's
* subexpression, and is followed by zero or
* more TCL_TOKEN_SUB_EXPR tokens for the
* operator's operands. NumComponents is
* always 0.
*/
#define TCL_TOKEN_WORD 1
#define TCL_TOKEN_SIMPLE_WORD 2
#define TCL_TOKEN_TEXT 4
#define TCL_TOKEN_BS 8
#define TCL_TOKEN_COMMAND 16
#define TCL_TOKEN_VARIABLE 32
#define TCL_TOKEN_SUB_EXPR 64
#define TCL_TOKEN_OPERATOR 128
/*
* Parsing error types. On any parsing error, one of these values
* will be stored in the error field of the Tcl_Parse structure
* defined below.
*/
#define TCL_PARSE_SUCCESS 0
#define TCL_PARSE_QUOTE_EXTRA 1
#define TCL_PARSE_BRACE_EXTRA 2
#define TCL_PARSE_MISSING_BRACE 3
#define TCL_PARSE_MISSING_BRACKET 4
#define TCL_PARSE_MISSING_PAREN 5
#define TCL_PARSE_MISSING_QUOTE 6
#define TCL_PARSE_MISSING_VAR_BRACE 7
#define TCL_PARSE_SYNTAX 8
#define TCL_PARSE_BAD_NUMBER 9
/*
* A structure of the following type is filled in by Tcl_ParseCommand.
* It describes a single command parsed from an input string.
*/
#define NUM_STATIC_TOKENS 20
typedef struct Tcl_Parse {
char *commentStart; /* Pointer to # that begins the firs
t of
* one or more comments preceding the
* command. */
int commentSize; /* Number of bytes in comments (up through
* newline character that terminates the
* last comment). If there were no
* comments, this field is 0. */
char *commandStart; /* First character in first word of
command. */
int commandSize; /* Number of bytes in command, including
* first character of first word, up
* through the terminating newline,
* close bracket, or semicolon. */
int numWords; /* Total number of words in command. May
* be 0. */
Tcl_Token *tokenPtr; /* Pointer to first token representing
* the words of the command. Initially
* points to staticTokens, but may change
* to point to malloc-ed space if command
* exceeds space in staticTokens. */
int numTokens; /* Total number of tokens in command. */
int tokensAvailable; /* Total number of tokens available at
* *tokenPtr. */
int errorType; /* One of the parsing error types defined
* above. */
/*
* The fields below are intended only for the private use of the
* parser. They should not be used by procedures that invoke
* Tcl_ParseCommand.
*/
char *string; /* The original command string passed to
* Tcl_ParseCommand. */
char *end; /* Points to the character just after the
* last one in the command string. */
Tcl_Interp *interp; /* Interpreter to use for error repo
rting,
* or NULL. */
char *term; /* Points to character in string tha
t
* terminated most recent token. Filled in
* by ParseTokens. If an error occurs,
* points to beginning of region where the
* error occurred (e.g. the open brace if
* the close brace is missing). */
int incomplete; /* This field is set to 1 by Tcl_ParseComman
d
* if the command appears to be incomplete.
* This information is used by
* Tcl_CommandComplete. */
Tcl_Token staticTokens[NUM_STATIC_TOKENS];
/* Initial space for tokens for command.
* This space should be large enough to
* accommodate most commands; dynamic
* space is allocated for very large
* commands that don't fit here. */
} Tcl_Parse;
/*
* The following definitions are the error codes returned by the conversion
* routines:
*
* TCL_OK: All characters were converted.
*
* TCL_CONVERT_NOSPACE: The output buffer would not have bee
n large
* enough for all of the converted data; as man
y
* characters as could fit were converted thoug
h.
*
* TCL_CONVERT_MULTIBYTE: The last few bytes in the source string were
* the beginning of a multibyte sequence, but
* more bytes were needed to complete this
* sequence. A subsequent call to the conversi
on
* routine should pass the beginning of this
* unconverted sequence plus additional bytes
* from the source stream to properly convert
* the formerly split-up multibyte sequence.
*
* TCL_CONVERT_SYNTAX: The source stream contained an invalid
* character sequence. This may occur if the
* input stream has been damaged or if the inpu
t
* encoding method was misidentified. This err
or
* is reported only if TCL_ENCODING_STOPONERROR
* was specified.
*
* TCL_CONVERT_UNKNOWN: The source string contained a charac
ter
* that could not be represented in the target
* encoding. This error is reported only if
* TCL_ENCODING_STOPONERROR was specified.
*/
#define TCL_CONVERT_MULTIBYTE -1
#define TCL_CONVERT_SYNTAX -2
#define TCL_CONVERT_UNKNOWN -3
#define TCL_CONVERT_NOSPACE -4
/*
* The maximum number of bytes that are necessary to represent a single
* Unicode character in UTF-8.
*/
#define TCL_UTF_MAX 3
/*
* This represents a Unicode character.
*/
typedef unsigned short Tcl_UniChar;
/*
* Deprecated Tcl procedures:
*/
#ifndef TCL_NO_DEPRECATED
#define Tcl_EvalObj(interp,objPtr) Tcl_EvalObjEx((interp),(objPtr),0)
#define Tcl_GlobalEvalObj(interp,objPtr) \
Tcl_EvalObjEx((interp),(objPtr),TCL_EVAL_GLOBAL)
#endif
/*
* These function have been renamed. The old names are deprecated, but we
* define these macros for backwards compatibilty.
*/ */
EXTERN void Tcl_AddErrorInfo _ANSI_ARGS_((Tcl_Interp *interp,
char *message));
EXTERN void Tcl_AddObjErrorInfo _ANSI_ARGS_((Tcl_Interp *interp,
char *message, int length));
EXTERN void Tcl_AllowExceptions _ANSI_ARGS_((Tcl_Interp *interp)
);
EXTERN int Tcl_AppendAllObjTypes _ANSI_ARGS_((
Tcl_Interp *interp, Tcl_Obj *objPtr));
EXTERN void Tcl_AppendElement _ANSI_ARGS_((Tcl_Interp *interp,
char *string));
EXTERN void Tcl_AppendResult _ANSI_ARGS_(
TCL_VARARGS(Tcl_Interp *,interp));
EXTERN void Tcl_AppendToObj _ANSI_ARGS_((Tcl_Obj *objPtr,
char *bytes, int length));
EXTERN void Tcl_AppendStringsToObj _ANSI_ARGS_(
TCL_VARARGS(Tcl_Obj *,interp));
EXTERN Tcl_AsyncHandler Tcl_AsyncCreate _ANSI_ARGS_((Tcl_AsyncProc *
proc,
ClientData clientData));
EXTERN void Tcl_AsyncDelete _ANSI_ARGS_((Tcl_AsyncHandler async)
);
EXTERN int Tcl_AsyncInvoke _ANSI_ARGS_((Tcl_Interp *interp,
int code));
EXTERN void Tcl_AsyncMark _ANSI_ARGS_((Tcl_AsyncHandler async));
EXTERN int Tcl_AsyncReady _ANSI_ARGS_((void));
EXTERN void Tcl_BackgroundError _ANSI_ARGS_((Tcl_Interp *interp)
);
EXTERN char Tcl_Backslash _ANSI_ARGS_((CONST char *src,
int *readPtr));
EXTERN int Tcl_BadChannelOption _ANSI_ARGS_((Tcl_Interp *interp
,
char *optionName, char *optionList));
EXTERN void Tcl_CallWhenDeleted _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_InterpDeleteProc *proc,
ClientData clientData));
EXTERN void Tcl_CancelIdleCall _ANSI_ARGS_((Tcl_IdleProc *idlePr
oc,
ClientData clientData));
#define Tcl_Ckalloc Tcl_Alloc #define Tcl_Ckalloc Tcl_Alloc
#define Tcl_Ckfree Tcl_Free #define Tcl_Ckfree Tcl_Free
#define Tcl_Ckrealloc Tcl_Realloc #define Tcl_Ckrealloc Tcl_Realloc
EXTERN int Tcl_Close _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_Channel chan));
EXTERN int Tcl_CommandComplete _ANSI_ARGS_((char *cmd));
EXTERN char * Tcl_Concat _ANSI_ARGS_((int argc, char **argv));
EXTERN Tcl_Obj * Tcl_ConcatObj _ANSI_ARGS_((int objc,
Tcl_Obj *CONST objv[]));
EXTERN int Tcl_ConvertCountedElement _ANSI_ARGS_((CONST char *s
rc,
int length, char *dst, int flags));
EXTERN int Tcl_ConvertElement _ANSI_ARGS_((CONST char *src,
char *dst, int flags));
EXTERN int Tcl_ConvertToType _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_Obj *objPtr, Tcl_ObjType *typePtr));
EXTERN int Tcl_CreateAlias _ANSI_ARGS_((Tcl_Interp *slave,
char *slaveCmd, Tcl_Interp *target,
char *targetCmd, int argc, char **argv));
EXTERN int Tcl_CreateAliasObj _ANSI_ARGS_((Tcl_Interp *slave,
char *slaveCmd, Tcl_Interp *target,
char *targetCmd, int objc,
Tcl_Obj *CONST objv[]));
EXTERN Tcl_Channel Tcl_CreateChannel _ANSI_ARGS_((
Tcl_ChannelType *typePtr, char *chanName,
ClientData instanceData, int mask));
EXTERN void Tcl_CreateChannelHandler _ANSI_ARGS_((
Tcl_Channel chan, int mask,
Tcl_ChannelProc *proc, ClientData clientData));
EXTERN void Tcl_CreateCloseHandler _ANSI_ARGS_((
Tcl_Channel chan, Tcl_CloseProc *proc,
ClientData clientData));
EXTERN Tcl_Command Tcl_CreateCommand _ANSI_ARGS_((Tcl_Interp *interp,
char *cmdName, Tcl_CmdProc *proc,
ClientData clientData,
Tcl_CmdDeleteProc *deleteProc));
EXTERN void Tcl_CreateEventSource _ANSI_ARGS_((
Tcl_EventSetupProc *setupProc,
Tcl_EventCheckProc *checkProc,
ClientData clientData));
EXTERN void Tcl_CreateExitHandler _ANSI_ARGS_((Tcl_ExitProc *pro
c,
ClientData clientData));
EXTERN void Tcl_CreateFileHandler _ANSI_ARGS_((
int fd, int mask, Tcl_FileProc *proc,
ClientData clientData));
EXTERN Tcl_Interp * Tcl_CreateInterp _ANSI_ARGS_((void));
EXTERN void Tcl_CreateMathFunc _ANSI_ARGS_((Tcl_Interp *interp,
char *name, int numArgs, Tcl_ValueType *argTypes
,
Tcl_MathProc *proc, ClientData clientData));
EXTERN Tcl_Command Tcl_CreateObjCommand _ANSI_ARGS_((
Tcl_Interp *interp, char *cmdName,
Tcl_ObjCmdProc *proc, ClientData clientData,
Tcl_CmdDeleteProc *deleteProc));
EXTERN Tcl_Interp * Tcl_CreateSlave _ANSI_ARGS_((Tcl_Interp *interp,
char *slaveName, int isSafe));
EXTERN Tcl_TimerToken Tcl_CreateTimerHandler _ANSI_ARGS_((int milliseconds
,
Tcl_TimerProc *proc, ClientData clientData));
EXTERN Tcl_Trace Tcl_CreateTrace _ANSI_ARGS_((Tcl_Interp *interp,
int level, Tcl_CmdTraceProc *proc,
ClientData clientData));
EXTERN char * Tcl_DbCkalloc _ANSI_ARGS_((unsigned int size,
char *file, int line));
EXTERN int Tcl_DbCkfree _ANSI_ARGS_((char *ptr,
char *file, int line));
EXTERN char * Tcl_DbCkrealloc _ANSI_ARGS_((char *ptr,
unsigned int size, char *file, int line));
EXTERN void Tcl_DbDecrRefCount _ANSI_ARGS_((Tcl_Obj *objPtr,
char *file, int line));
EXTERN void Tcl_DbIncrRefCount _ANSI_ARGS_((Tcl_Obj *objPtr,
char *file, int line));
EXTERN int Tcl_DbIsShared _ANSI_ARGS_((Tcl_Obj *objPtr,
char *file, int line));
EXTERN Tcl_Obj * Tcl_DbNewBooleanObj _ANSI_ARGS_((int boolValue,
char *file, int line));
EXTERN Tcl_Obj * Tcl_DbNewDoubleObj _ANSI_ARGS_((double doubleValue,
char *file, int line));
EXTERN Tcl_Obj * Tcl_DbNewListObj _ANSI_ARGS_((int objc,
Tcl_Obj *CONST objv[], char *file, int line));
EXTERN Tcl_Obj * Tcl_DbNewLongObj _ANSI_ARGS_((long longValue,
char *file, int line));
EXTERN Tcl_Obj * Tcl_DbNewObj _ANSI_ARGS_((char *file, int line));
EXTERN Tcl_Obj * Tcl_DbNewStringObj _ANSI_ARGS_((char *bytes,
int length, char *file, int line));
EXTERN void Tcl_DeleteAssocData _ANSI_ARGS_((Tcl_Interp *interp,
char *name));
EXTERN int Tcl_DeleteCommand _ANSI_ARGS_((Tcl_Interp *interp,
char *cmdName));
EXTERN int Tcl_DeleteCommandFromToken _ANSI_ARGS_((
Tcl_Interp *interp, Tcl_Command command));
EXTERN void Tcl_DeleteChannelHandler _ANSI_ARGS_((
Tcl_Channel chan, Tcl_ChannelProc *proc,
ClientData clientData));
EXTERN void Tcl_DeleteCloseHandler _ANSI_ARGS_((
Tcl_Channel chan, Tcl_CloseProc *proc,
ClientData clientData));
EXTERN void Tcl_DeleteEvents _ANSI_ARGS_((
Tcl_EventDeleteProc *proc,
ClientData clientData));
EXTERN void Tcl_DeleteEventSource _ANSI_ARGS_((
Tcl_EventSetupProc *setupProc,
Tcl_EventCheckProc *checkProc,
ClientData clientData));
EXTERN void Tcl_DeleteExitHandler _ANSI_ARGS_((Tcl_ExitProc *pro
c,
ClientData clientData));
EXTERN void Tcl_DeleteFileHandler _ANSI_ARGS_((int fd));
EXTERN void Tcl_DeleteHashEntry _ANSI_ARGS_((
Tcl_HashEntry *entryPtr));
EXTERN void Tcl_DeleteHashTable _ANSI_ARGS_((
Tcl_HashTable *tablePtr));
EXTERN void Tcl_DeleteInterp _ANSI_ARGS_((Tcl_Interp *interp));
EXTERN void Tcl_DeleteTimerHandler _ANSI_ARGS_((
Tcl_TimerToken token));
EXTERN void Tcl_DeleteTrace _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_Trace trace));
EXTERN void Tcl_DetachPids _ANSI_ARGS_((int numPids, Tcl_Pid *pi
dPtr));
EXTERN void Tcl_DontCallWhenDeleted _ANSI_ARGS_((
Tcl_Interp *interp, Tcl_InterpDeleteProc *proc,
ClientData clientData));
EXTERN int Tcl_DoOneEvent _ANSI_ARGS_((int flags));
EXTERN void Tcl_DoWhenIdle _ANSI_ARGS_((Tcl_IdleProc *proc,
ClientData clientData));
EXTERN char * Tcl_DStringAppend _ANSI_ARGS_((Tcl_DString *dsPtr,
CONST char *string, int length));
EXTERN char * Tcl_DStringAppendElement _ANSI_ARGS_((
Tcl_DString *dsPtr, CONST char *string));
EXTERN void Tcl_DStringEndSublist _ANSI_ARGS_((Tcl_DString *dsPt
r));
EXTERN void Tcl_DStringFree _ANSI_ARGS_((Tcl_DString *dsPtr));
EXTERN void Tcl_DStringGetResult _ANSI_ARGS_((Tcl_Interp *interp
,
Tcl_DString *dsPtr));
EXTERN void Tcl_DStringInit _ANSI_ARGS_((Tcl_DString *dsPtr));
EXTERN void Tcl_DStringResult _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_DString *dsPtr));
EXTERN void Tcl_DStringSetLength _ANSI_ARGS_((Tcl_DString *dsPtr
,
int length));
EXTERN void Tcl_DStringStartSublist _ANSI_ARGS_((
Tcl_DString *dsPtr));
EXTERN Tcl_Obj * Tcl_DuplicateObj _ANSI_ARGS_((Tcl_Obj *objPtr));
EXTERN int Tcl_Eof _ANSI_ARGS_((Tcl_Channel chan));
EXTERN char * Tcl_ErrnoId _ANSI_ARGS_((void));
EXTERN char * Tcl_ErrnoMsg _ANSI_ARGS_((int err));
EXTERN int Tcl_Eval _ANSI_ARGS_((Tcl_Interp *interp,
char *string));
EXTERN int Tcl_EvalFile _ANSI_ARGS_((Tcl_Interp *interp,
char *fileName));
EXTERN void Tcl_EventuallyFree _ANSI_ARGS_((ClientData clientDat
a,
Tcl_FreeProc *freeProc));
EXTERN int Tcl_EvalObj _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_Obj *objPtr));
EXTERN void Tcl_Exit _ANSI_ARGS_((int status));
EXTERN int Tcl_ExposeCommand _ANSI_ARGS_((Tcl_Interp *interp,
char *hiddenCmdToken, char *cmdName));
EXTERN int Tcl_ExprBoolean _ANSI_ARGS_((Tcl_Interp *interp,
char *string, int *ptr));
EXTERN int Tcl_ExprBooleanObj _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_Obj *objPtr, int *ptr));
EXTERN int Tcl_ExprDouble _ANSI_ARGS_((Tcl_Interp *interp,
char *string, double *ptr));
EXTERN int Tcl_ExprDoubleObj _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_Obj *objPtr, double *ptr));
EXTERN int Tcl_ExprLong _ANSI_ARGS_((Tcl_Interp *interp,
char *string, long *ptr));
EXTERN int Tcl_ExprLongObj _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_Obj *objPtr, long *ptr));
EXTERN int Tcl_ExprObj _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_Obj *objPtr, Tcl_Obj **resultPtrPtr));
EXTERN int Tcl_ExprString _ANSI_ARGS_((Tcl_Interp *interp,
char *string));
EXTERN void Tcl_Finalize _ANSI_ARGS_((void));
EXTERN void Tcl_FindExecutable _ANSI_ARGS_((char *argv0));
EXTERN Tcl_HashEntry * Tcl_FirstHashEntry _ANSI_ARGS_((
Tcl_HashTable *tablePtr,
Tcl_HashSearch *searchPtr));
EXTERN int Tcl_Flush _ANSI_ARGS_((Tcl_Channel chan));
EXTERN void TclFreeObj _ANSI_ARGS_((Tcl_Obj *objPtr));
EXTERN void Tcl_FreeResult _ANSI_ARGS_((Tcl_Interp *interp));
EXTERN int Tcl_GetAlias _ANSI_ARGS_((Tcl_Interp *interp,
char *slaveCmd, Tcl_Interp **targetInter
pPtr,
char **targetCmdPtr, int *argcPtr,
char ***argvPtr));
EXTERN int Tcl_GetAliasObj _ANSI_ARGS_((Tcl_Interp *interp,
char *slaveCmd, Tcl_Interp **targetInter
pPtr,
char **targetCmdPtr, int *objcPtr,
Tcl_Obj ***objv));
EXTERN ClientData Tcl_GetAssocData _ANSI_ARGS_((Tcl_Interp *interp,
char *name, Tcl_InterpDeleteProc **procPtr));
EXTERN int Tcl_GetBoolean _ANSI_ARGS_((Tcl_Interp *interp,
char *string, int *boolPtr));
EXTERN int Tcl_GetBooleanFromObj _ANSI_ARGS_((
Tcl_Interp *interp, Tcl_Obj *objPtr,
int *boolPtr));
EXTERN Tcl_Channel Tcl_GetChannel _ANSI_ARGS_((Tcl_Interp *interp,
char *chanName, int *modePtr));
EXTERN int Tcl_GetChannelBufferSize _ANSI_ARGS_((
Tcl_Channel chan));
EXTERN int Tcl_GetChannelHandle _ANSI_ARGS_((Tcl_Channel chan,
int direction, ClientData *handlePtr));
EXTERN ClientData Tcl_GetChannelInstanceData _ANSI_ARGS_((
Tcl_Channel chan));
EXTERN int Tcl_GetChannelMode _ANSI_ARGS_((Tcl_Channel chan));
EXTERN char * Tcl_GetChannelName _ANSI_ARGS_((Tcl_Channel chan));
EXTERN int Tcl_GetChannelOption _ANSI_ARGS_((Tcl_Interp *interp
,
Tcl_Channel chan, char *optionName,
Tcl_DString *dsPtr));
EXTERN Tcl_ChannelType * Tcl_GetChannelType _ANSI_ARGS_((Tcl_Channel chan))
;
EXTERN int Tcl_GetCommandInfo _ANSI_ARGS_((Tcl_Interp *interp,
char *cmdName, Tcl_CmdInfo *infoPtr));
EXTERN char * Tcl_GetCommandName _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_Command command));
EXTERN int Tcl_GetDouble _ANSI_ARGS_((Tcl_Interp *interp,
char *string, double *doublePtr));
EXTERN int Tcl_GetDoubleFromObj _ANSI_ARGS_((
Tcl_Interp *interp, Tcl_Obj *objPtr,
double *doublePtr));
EXTERN int Tcl_GetErrno _ANSI_ARGS_((void));
EXTERN char * Tcl_GetHostName _ANSI_ARGS_((void));
EXTERN int Tcl_GetIndexFromObj _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_Obj *objPtr, char **tablePtr, char *msg,
int flags, int *indexPtr));
EXTERN int Tcl_GetInt _ANSI_ARGS_((Tcl_Interp *interp,
char *string, int *intPtr));
EXTERN int Tcl_GetInterpPath _ANSI_ARGS_((Tcl_Interp *askInterp
,
Tcl_Interp *slaveInterp));
EXTERN int Tcl_GetIntFromObj _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_Obj *objPtr, int *intPtr));
EXTERN int Tcl_GetLongFromObj _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_Obj *objPtr, long *longPtr));
EXTERN Tcl_Interp * Tcl_GetMaster _ANSI_ARGS_((Tcl_Interp *interp));
EXTERN CONST char * Tcl_GetNameOfExecutable _ANSI_ARGS_((void));
EXTERN Tcl_Obj * Tcl_GetObjResult _ANSI_ARGS_((Tcl_Interp *interp));
EXTERN Tcl_ObjType * Tcl_GetObjType _ANSI_ARGS_((char *typeName));
EXTERN int Tcl_GetOpenFile _ANSI_ARGS_((Tcl_Interp *interp,
char *string, int write, int checkUsage,
ClientData *filePtr));
EXTERN Tcl_PathType Tcl_GetPathType _ANSI_ARGS_((char *path));
EXTERN int Tcl_Gets _ANSI_ARGS_((Tcl_Channel chan,
Tcl_DString *dsPtr));
EXTERN int Tcl_GetsObj _ANSI_ARGS_((Tcl_Channel chan,
Tcl_Obj *objPtr));
EXTERN int Tcl_GetServiceMode _ANSI_ARGS_((void));
EXTERN Tcl_Interp * Tcl_GetSlave _ANSI_ARGS_((Tcl_Interp *interp,
char *slaveName));
EXTERN Tcl_Channel Tcl_GetStdChannel _ANSI_ARGS_((int type));
EXTERN char * Tcl_GetStringFromObj _ANSI_ARGS_((Tcl_Obj *objPtr,
int *lengthPtr));
EXTERN char * Tcl_GetStringResult _ANSI_ARGS_((Tcl_Interp *interp)
);
EXTERN char * Tcl_GetVar _ANSI_ARGS_((Tcl_Interp *interp,
char *varName, int flags));
EXTERN char * Tcl_GetVar2 _ANSI_ARGS_((Tcl_Interp *interp,
char *part1, char *part2, int flags));
EXTERN int Tcl_GlobalEval _ANSI_ARGS_((Tcl_Interp *interp,
char *command));
EXTERN int Tcl_GlobalEvalObj _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_Obj *objPtr));
EXTERN char * Tcl_HashStats _ANSI_ARGS_((Tcl_HashTable *tablePtr))
;
EXTERN int Tcl_HideCommand _ANSI_ARGS_((Tcl_Interp *interp,
char *cmdName, char *hiddenCmdToken));
EXTERN int Tcl_Init _ANSI_ARGS_((Tcl_Interp *interp));
EXTERN void Tcl_InitHashTable _ANSI_ARGS_((Tcl_HashTable *tableP
tr,
int keyType));
EXTERN void Tcl_InitMemory _ANSI_ARGS_((Tcl_Interp *interp));
EXTERN int Tcl_InputBlocked _ANSI_ARGS_((Tcl_Channel chan));
EXTERN int Tcl_InputBuffered _ANSI_ARGS_((Tcl_Channel chan));
EXTERN int Tcl_InterpDeleted _ANSI_ARGS_((Tcl_Interp *interp));
EXTERN int Tcl_IsSafe _ANSI_ARGS_((Tcl_Interp *interp));
EXTERN void Tcl_InvalidateStringRep _ANSI_ARGS_((
Tcl_Obj *objPtr));
EXTERN char * Tcl_JoinPath _ANSI_ARGS_((int argc, char **argv,
Tcl_DString *resultPtr));
EXTERN int Tcl_LinkVar _ANSI_ARGS_((Tcl_Interp *interp,
char *varName, char *addr, int type));
EXTERN int Tcl_ListObjAppendList _ANSI_ARGS_((
Tcl_Interp *interp, Tcl_Obj *listPtr,
Tcl_Obj *elemListPtr));
EXTERN int Tcl_ListObjAppendElement _ANSI_ARGS_((
Tcl_Interp *interp, Tcl_Obj *listPtr,
Tcl_Obj *objPtr));
EXTERN int Tcl_ListObjGetElements _ANSI_ARGS_((
Tcl_Interp *interp, Tcl_Obj *listPtr,
int *objcPtr, Tcl_Obj ***objvPtr));
EXTERN int Tcl_ListObjIndex _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_Obj *listPtr, int index,
Tcl_Obj **objPtrPtr));
EXTERN int Tcl_ListObjLength _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_Obj *listPtr, int *intPtr));
EXTERN int Tcl_ListObjReplace _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_Obj *listPtr, int first, int count,
int objc, Tcl_Obj *CONST objv[]));
EXTERN void Tcl_Main _ANSI_ARGS_((int argc, char **argv,
Tcl_AppInitProc *appInitProc));
EXTERN Tcl_Channel Tcl_MakeFileChannel _ANSI_ARGS_((ClientData handle,
int mode));
EXTERN int Tcl_MakeSafe _ANSI_ARGS_((Tcl_Interp *interp));
EXTERN Tcl_Channel Tcl_MakeTcpClientChannel _ANSI_ARGS_((
ClientData tcpSocket));
EXTERN char * Tcl_Merge _ANSI_ARGS_((int argc, char **argv));
EXTERN Tcl_HashEntry * Tcl_NextHashEntry _ANSI_ARGS_((
Tcl_HashSearch *searchPtr));
EXTERN void Tcl_NotifyChannel _ANSI_ARGS_((Tcl_Channel channel,
int mask));
EXTERN Tcl_Obj * Tcl_ObjGetVar2 _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr,
int flags));
EXTERN Tcl_Obj * Tcl_ObjSetVar2 _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr,
Tcl_Obj *newValuePtr, int flags));
EXTERN Tcl_Channel Tcl_OpenCommandChannel _ANSI_ARGS_((
Tcl_Interp *interp, int argc, char **argv,
int flags));
EXTERN Tcl_Channel Tcl_OpenFileChannel _ANSI_ARGS_((Tcl_Interp *interp,
char *fileName, char *modeString,
int permissions));
EXTERN Tcl_Channel Tcl_OpenTcpClient _ANSI_ARGS_((Tcl_Interp *interp,
int port, char *address, char *myaddr,
int myport, int async));
EXTERN Tcl_Channel Tcl_OpenTcpServer _ANSI_ARGS_((Tcl_Interp *interp,
int port, char *host,
Tcl_TcpAcceptProc *acceptProc,
ClientData callbackData));
EXTERN char * Tcl_ParseVar _ANSI_ARGS_((Tcl_Interp *interp,
char *string, char **termPtr));
EXTERN int Tcl_PkgProvide _ANSI_ARGS_((Tcl_Interp *interp,
char *name, char *version));
EXTERN char * Tcl_PkgRequire _ANSI_ARGS_((Tcl_Interp *interp,
char *name, char *version, int exact));
EXTERN char * Tcl_PosixError _ANSI_ARGS_((Tcl_Interp *interp));
EXTERN void Tcl_Preserve _ANSI_ARGS_((ClientData data));
EXTERN void Tcl_PrintDouble _ANSI_ARGS_((Tcl_Interp *interp,
double value, char *dst));
EXTERN int Tcl_PutEnv _ANSI_ARGS_((CONST char *string));
EXTERN void Tcl_QueueEvent _ANSI_ARGS_((Tcl_Event *evPtr,
Tcl_QueuePosition position));
EXTERN int Tcl_Read _ANSI_ARGS_((Tcl_Channel chan,
char *bufPtr, int toRead));
EXTERN void Tcl_ReapDetachedProcs _ANSI_ARGS_((void));
EXTERN int Tcl_RecordAndEval _ANSI_ARGS_((Tcl_Interp *interp,
char *cmd, int flags));
EXTERN int Tcl_RecordAndEvalObj _ANSI_ARGS_((Tcl_Interp *interp
,
Tcl_Obj *cmdPtr, int flags));
EXTERN Tcl_RegExp Tcl_RegExpCompile _ANSI_ARGS_((Tcl_Interp *interp,
char *string));
EXTERN int Tcl_RegExpExec _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_RegExp regexp, char *string, char *start));
EXTERN int Tcl_RegExpMatch _ANSI_ARGS_((Tcl_Interp *interp,
char *string, char *pattern));
EXTERN void Tcl_RegExpRange _ANSI_ARGS_((Tcl_RegExp regexp,
int index, char **startPtr, char **endPtr));
EXTERN void Tcl_RegisterChannel _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_Channel chan));
EXTERN void Tcl_RegisterObjType _ANSI_ARGS_((
Tcl_ObjType *typePtr));
EXTERN void Tcl_Release _ANSI_ARGS_((ClientData clientData));
EXTERN void Tcl_ResetResult _ANSI_ARGS_((Tcl_Interp *interp));
#define Tcl_Return Tcl_SetResult #define Tcl_Return Tcl_SetResult
EXTERN int Tcl_ScanCountedElement _ANSI_ARGS_((CONST char *stri
ng,
int length, int *flagPtr));
EXTERN int Tcl_ScanElement _ANSI_ARGS_((CONST char *string,
int *flagPtr));
EXTERN int Tcl_Seek _ANSI_ARGS_((Tcl_Channel chan,
int offset, int mode));
EXTERN int Tcl_ServiceAll _ANSI_ARGS_((void));
EXTERN int Tcl_ServiceEvent _ANSI_ARGS_((int flags));
EXTERN void Tcl_SetAssocData _ANSI_ARGS_((Tcl_Interp *interp,
char *name, Tcl_InterpDeleteProc *proc,
ClientData clientData));
EXTERN void Tcl_SetBooleanObj _ANSI_ARGS_((Tcl_Obj *objPtr,
int boolValue));
EXTERN void Tcl_SetChannelBufferSize _ANSI_ARGS_((
Tcl_Channel chan, int sz));
EXTERN int Tcl_SetChannelOption _ANSI_ARGS_((
Tcl_Interp *interp, Tcl_Channel chan,
char *optionName, char *newValue));
EXTERN int Tcl_SetCommandInfo _ANSI_ARGS_((Tcl_Interp *interp,
char *cmdName, Tcl_CmdInfo *infoPtr));
EXTERN void Tcl_SetDoubleObj _ANSI_ARGS_((Tcl_Obj *objPtr,
double doubleValue));
EXTERN void Tcl_SetErrno _ANSI_ARGS_((int err));
EXTERN void Tcl_SetErrorCode _ANSI_ARGS_(
TCL_VARARGS(Tcl_Interp *,arg1));
EXTERN void Tcl_SetIntObj _ANSI_ARGS_((Tcl_Obj *objPtr,
int intValue));
EXTERN void Tcl_SetListObj _ANSI_ARGS_((Tcl_Obj *objPtr,
int objc, Tcl_Obj *CONST objv[]));
EXTERN void Tcl_SetLongObj _ANSI_ARGS_((Tcl_Obj *objPtr,
long longValue));
EXTERN void Tcl_SetMaxBlockTime _ANSI_ARGS_((Tcl_Time *timePtr))
;
EXTERN void Tcl_SetObjErrorCode _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_Obj *errorObjPtr));
EXTERN void Tcl_SetObjLength _ANSI_ARGS_((Tcl_Obj *objPtr,
int length));
EXTERN void Tcl_SetObjResult _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_Obj *resultObjPtr));
EXTERN void Tcl_SetPanicProc _ANSI_ARGS_((void (*proc)
_ANSI_ARGS_(TCL_VARARGS(char *, format))));
EXTERN int Tcl_SetRecursionLimit _ANSI_ARGS_((Tcl_Interp *inter
p,
int depth));
EXTERN void Tcl_SetResult _ANSI_ARGS_((Tcl_Interp *interp,
char *string, Tcl_FreeProc *freeProc));
EXTERN int Tcl_SetServiceMode _ANSI_ARGS_((int mode));
EXTERN void Tcl_SetStdChannel _ANSI_ARGS_((Tcl_Channel channel,
int type));
EXTERN void Tcl_SetStringObj _ANSI_ARGS_((Tcl_Obj *objPtr,
char *bytes, int length));
EXTERN void Tcl_SetTimer _ANSI_ARGS_((Tcl_Time *timePtr));
EXTERN char * Tcl_SetVar _ANSI_ARGS_((Tcl_Interp *interp,
char *varName, char *newValue, int flags));
EXTERN char * Tcl_SetVar2 _ANSI_ARGS_((Tcl_Interp *interp,
char *part1, char *part2, char *newValue,
int flags));
EXTERN char * Tcl_SignalId _ANSI_ARGS_((int sig));
EXTERN char * Tcl_SignalMsg _ANSI_ARGS_((int sig));
EXTERN void Tcl_Sleep _ANSI_ARGS_((int ms));
EXTERN void Tcl_SourceRCFile _ANSI_ARGS_((Tcl_Interp *interp));
EXTERN int Tcl_SplitList _ANSI_ARGS_((Tcl_Interp *interp,
char *list, int *argcPtr, char ***argvPtr));
EXTERN void Tcl_SplitPath _ANSI_ARGS_((char *path,
int *argcPtr, char ***argvPtr));
EXTERN void Tcl_StaticPackage _ANSI_ARGS_((Tcl_Interp *interp,
char *pkgName, Tcl_PackageInitProc *initProc,
Tcl_PackageInitProc *safeInitProc));
EXTERN int Tcl_StringMatch _ANSI_ARGS_((char *string,
char *pattern));
EXTERN int Tcl_Tell _ANSI_ARGS_((Tcl_Channel chan));
#define Tcl_TildeSubst Tcl_TranslateFileName #define Tcl_TildeSubst Tcl_TranslateFileName
EXTERN int Tcl_TraceVar _ANSI_ARGS_((Tcl_Interp *interp, #define panic Tcl_Panic
char *varName, int flags, Tcl_VarTraceProc *proc #define panicVA Tcl_PanicVA
,
ClientData clientData));
EXTERN int Tcl_TraceVar2 _ANSI_ARGS_((Tcl_Interp *interp,
char *part1, char *part2, int flags,
Tcl_VarTraceProc *proc, ClientData clientData));
EXTERN char * Tcl_TranslateFileName _ANSI_ARGS_((Tcl_Interp *inter
p,
char *name, Tcl_DString *bufferPtr));
EXTERN int Tcl_Ungets _ANSI_ARGS_((Tcl_Channel chan, char *str,
int len, int atHead));
EXTERN void Tcl_UnlinkVar _ANSI_ARGS_((Tcl_Interp *interp,
char *varName));
EXTERN int Tcl_UnregisterChannel _ANSI_ARGS_((Tcl_Interp *inter
p,
Tcl_Channel chan));
EXTERN int Tcl_UnsetVar _ANSI_ARGS_((Tcl_Interp *interp,
char *varName, int flags));
EXTERN int Tcl_UnsetVar2 _ANSI_ARGS_((Tcl_Interp *interp,
char *part1, char *part2, int flags));
EXTERN void Tcl_UntraceVar _ANSI_ARGS_((Tcl_Interp *interp,
char *varName, int flags, Tcl_VarTraceProc *proc
,
ClientData clientData));
EXTERN void Tcl_UntraceVar2 _ANSI_ARGS_((Tcl_Interp *interp,
char *part1, char *part2, int flags,
Tcl_VarTraceProc *proc, ClientData clientData));
EXTERN void Tcl_UpdateLinkedVar _ANSI_ARGS_((Tcl_Interp *interp,
char *varName));
EXTERN int Tcl_UpVar _ANSI_ARGS_((Tcl_Interp *interp,
char *frameName, char *varName,
char *localName, int flags));
EXTERN int Tcl_UpVar2 _ANSI_ARGS_((Tcl_Interp *interp,
char *frameName, char *part1, char *part2,
char *localName, int flags));
EXTERN int Tcl_VarEval _ANSI_ARGS_(
TCL_VARARGS(Tcl_Interp *,interp));
EXTERN ClientData Tcl_VarTraceInfo _ANSI_ARGS_((Tcl_Interp *interp,
char *varName, int flags,
Tcl_VarTraceProc *procPtr,
ClientData prevClientData));
EXTERN ClientData Tcl_VarTraceInfo2 _ANSI_ARGS_((Tcl_Interp *interp,
char *part1, char *part2, int flags,
Tcl_VarTraceProc *procPtr,
ClientData prevClientData));
EXTERN int Tcl_WaitForEvent _ANSI_ARGS_((Tcl_Time *timePtr));
EXTERN Tcl_Pid Tcl_WaitPid _ANSI_ARGS_((Tcl_Pid pid, int *statPtr,
int options));
EXTERN int Tcl_Write _ANSI_ARGS_((Tcl_Channel chan,
char *s, int slen));
EXTERN void Tcl_WrongNumArgs _ANSI_ARGS_((Tcl_Interp *interp,
int objc, Tcl_Obj *CONST objv[], char *message))
;
#undef TCL_STORAGE_CLASS /*
#define TCL_STORAGE_CLASS * The following constant is used to test for older versions of Tcl
* in the stubs tables.
*
* Jan Nijtman's plus patch uses 0xFCA1BACF, so we need to pick a different
* value since the stubs tables don't match.
*/
#define TCL_STUB_MAGIC 0xFCA3BACF
/*
* The following function is required to be defined in all stubs aware
* extensions. The function is actually implemented in the stub
* library, not the main Tcl library, although there is a trivial
* implementation in the main library in case an extension is statically
* linked into an application.
*/
EXTERN char * Tcl_InitStubs _ANSI_ARGS_((Tcl_Interp *interp,
char *version, int exact));
#ifndef USE_TCL_STUBS
/*
* When not using stubs, make it a macro.
*/
#define Tcl_InitStubs(interp, version, exact) \
Tcl_PkgRequire(interp, "Tcl", version, exact)
#endif
/*
* Include the public function declarations that are accessible via
* the stubs table.
*/
#include "tclDecls.h"
/*
* Public functions that are not accessible via the stubs table.
*/
EXTERN void Tcl_Main _ANSI_ARGS_((int argc, char **argv,
Tcl_AppInitProc *appInitProc));
/* /*
* Convenience declaration of Tcl_AppInit for backwards compatibility. * Convenience declaration of Tcl_AppInit for backwards compatibility.
* This function is not *implemented* by the tcl library, so the storage * This function is not *implemented* by the tcl library, so the storage
* class is neither DLLEXPORT nor DLLIMPORT * class is neither DLLEXPORT nor DLLIMPORT
*/ */
EXTERN int Tcl_AppInit _ANSI_ARGS_((Tcl_Interp *interp)); #undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS
EXTERN int Tcl_AppInit _ANSI_ARGS_((Tcl_Interp *interp));
#endif /* RESOURCE_INCLUDED */ #endif /* RESOURCE_INCLUDED */
#undef TCL_STORAGE_CLASS #undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLIMPORT #define TCL_STORAGE_CLASS DLLIMPORT
#endif /* _TCL */ #endif /* _TCL */
 End of changes. 50 change blocks. 
643 lines changed or deleted 601 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/