| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #ifndef _TCLINT |
| #define _TCLINT |
|
|
| |
| |
| |
|
|
| #undef ACCEPT_NAN |
|
|
| |
| |
| |
| |
| |
| |
| |
|
|
| #include "tclPort.h" |
|
|
| #include <stdio.h> |
|
|
| #include <ctype.h> |
| #ifdef NO_STDLIB_H |
| # include "../compat/stdlib.h" |
| #else |
| # include <stdlib.h> |
| #endif |
| #ifdef NO_STRING_H |
| #include "../compat/string.h" |
| #else |
| #include <string.h> |
| #endif |
| #if defined(STDC_HEADERS) || defined(__STDC__) || defined(__C99__FUNC__) \ |
| || defined(__cplusplus) || defined(_MSC_VER) || defined(__ICC) |
| #include <stddef.h> |
| #else |
| typedef int ptrdiff_t; |
| #endif |
|
|
| |
| |
| |
| |
| |
|
|
| #ifdef HAVE_SYS_TYPES_H |
| # include <sys/types.h> |
| #endif |
| #ifdef HAVE_SYS_PARAM_H |
| # include <sys/param.h> |
| #endif |
| #ifdef BYTE_ORDER |
| # ifdef BIG_ENDIAN |
| # if BYTE_ORDER == BIG_ENDIAN |
| # undef WORDS_BIGENDIAN |
| # define WORDS_BIGENDIAN 1 |
| # endif |
| # endif |
| # ifdef LITTLE_ENDIAN |
| # if BYTE_ORDER == LITTLE_ENDIAN |
| # undef WORDS_BIGENDIAN |
| # endif |
| # endif |
| #endif |
|
|
| |
| |
| |
| |
|
|
| #ifndef MODULE_SCOPE |
| # ifdef __cplusplus |
| # define MODULE_SCOPE extern "C" |
| # else |
| # define MODULE_SCOPE extern |
| # endif |
| #endif |
|
|
| |
| |
| |
| |
| |
|
|
| #if !defined(INT2PTR) && !defined(PTR2INT) |
| # if defined(HAVE_INTPTR_T) || defined(intptr_t) |
| # define INT2PTR(p) ((void *)(intptr_t)(p)) |
| # define PTR2INT(p) ((int)(intptr_t)(p)) |
| # else |
| # define INT2PTR(p) ((void *)(p)) |
| # define PTR2INT(p) ((int)(p)) |
| # endif |
| #endif |
| #if !defined(UINT2PTR) && !defined(PTR2UINT) |
| # if defined(HAVE_UINTPTR_T) || defined(uintptr_t) |
| # define UINT2PTR(p) ((void *)(uintptr_t)(p)) |
| # define PTR2UINT(p) ((unsigned int)(uintptr_t)(p)) |
| # else |
| # define UINT2PTR(p) ((void *)(p)) |
| # define PTR2UINT(p) ((unsigned int)(p)) |
| # endif |
| #endif |
|
|
| #if defined(_WIN32) && defined(_MSC_VER) |
| # define vsnprintf _vsnprintf |
| # define snprintf _snprintf |
| #endif |
|
|
| |
| |
| |
| |
|
|
| struct Tcl_ResolvedVarInfo; |
|
|
| typedef Tcl_Var (Tcl_ResolveRuntimeVarProc)(Tcl_Interp *interp, |
| struct Tcl_ResolvedVarInfo *vinfoPtr); |
|
|
| typedef void (Tcl_ResolveVarDeleteProc)(struct Tcl_ResolvedVarInfo *vinfoPtr); |
|
|
| |
| |
| |
| |
| |
|
|
| typedef struct Tcl_ResolvedVarInfo { |
| Tcl_ResolveRuntimeVarProc *fetchProc; |
| Tcl_ResolveVarDeleteProc *deleteProc; |
| } Tcl_ResolvedVarInfo; |
|
|
| typedef int (Tcl_ResolveCompiledVarProc)(Tcl_Interp *interp, |
| CONST84 char *name, int length, Tcl_Namespace *context, |
| Tcl_ResolvedVarInfo **rPtr); |
|
|
| typedef int (Tcl_ResolveVarProc)(Tcl_Interp *interp, CONST84 char *name, |
| Tcl_Namespace *context, int flags, Tcl_Var *rPtr); |
|
|
| typedef int (Tcl_ResolveCmdProc)(Tcl_Interp *interp, CONST84 char *name, |
| Tcl_Namespace *context, int flags, Tcl_Command *rPtr); |
|
|
| typedef struct Tcl_ResolverInfo { |
| Tcl_ResolveCmdProc *cmdResProc; |
| |
| |
| Tcl_ResolveVarProc *varResProc; |
| |
| |
| |
| Tcl_ResolveCompiledVarProc *compiledVarResProc; |
| |
| |
| } Tcl_ResolverInfo; |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #define TCL_AVOID_RESOLVERS 0x40000 |
|
|
| |
| |
| |
| |
| |
|
|
| typedef struct Tcl_Ensemble Tcl_Ensemble; |
| typedef struct NamespacePathEntry NamespacePathEntry; |
|
|
| |
| |
| |
| |
| |
| |
|
|
| typedef struct TclVarHashTable { |
| Tcl_HashTable table; |
| struct Namespace *nsPtr; |
| } TclVarHashTable; |
|
|
| |
| |
| |
|
|
| #define TclVarHashFindVar(tablePtr, key) \ |
| TclVarHashCreateVar((tablePtr), (key), NULL) |
|
|
| |
| |
| |
| |
| |
| |
|
|
| #undef BREAK_NAMESPACE_COMPAT |
|
|
| |
| |
| |
| |
| |
| |
|
|
| typedef struct Namespace { |
| char *name; |
| |
| |
| |
| char *fullName; |
| |
| ClientData clientData; |
| |
| Tcl_NamespaceDeleteProc *deleteProc; |
| |
| |
| struct Namespace *parentPtr; |
| |
| |
| #ifndef BREAK_NAMESPACE_COMPAT |
| Tcl_HashTable childTable; |
| |
| #else |
| Tcl_HashTable *childTablePtr; |
| |
| |
| |
| #endif |
| long nsId; |
| Tcl_Interp *interp; |
| |
| int flags; |
| |
| int activationCount; |
| |
| |
| |
| int refCount; |
| |
| |
| Tcl_HashTable cmdTable; |
| |
| |
| |
| |
| |
| |
| |
| TclVarHashTable varTable; |
| |
| |
| char **exportArrayPtr; |
| |
| |
| |
| |
| |
| |
| int numExportPatterns; |
| |
| int maxExportPatterns; |
| |
| int cmdRefEpoch; |
| |
| |
| |
| |
| int resolverEpoch; |
| |
| |
| |
| |
| |
| |
| Tcl_ResolveCmdProc *cmdResProc; |
| |
| |
| |
| |
| |
| Tcl_ResolveVarProc *varResProc; |
| |
| |
| |
| |
| |
| |
| Tcl_ResolveCompiledVarProc *compiledVarResProc; |
| |
| |
| |
| |
| |
| |
| int exportLookupEpoch; |
| |
| |
| |
| |
| Tcl_Ensemble *ensembles; |
| |
| |
| Tcl_Obj *unknownHandlerPtr; |
| |
| |
| int commandPathLength; |
| NamespacePathEntry *commandPathArray; |
| |
| |
| NamespacePathEntry *commandPathSourceList; |
| |
| |
| Tcl_NamespaceDeleteProc *earlyDeleteProc; |
| |
| |
| |
| |
| |
| } Namespace; |
|
|
| |
| |
| |
|
|
| struct NamespacePathEntry { |
| Namespace *nsPtr; |
| |
| |
| Namespace *creatorNsPtr; |
| |
| |
| |
| |
| NamespacePathEntry *prevPtr, *nextPtr; |
| |
| |
| |
| }; |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #define NS_DYING 0x01 |
| #define NS_DEAD 0x02 |
| #define NS_KILLED 0x04 |
| #define NS_SUPPRESS_COMPILATION 0x08 |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #define TCL_CREATE_NS_IF_UNKNOWN 0x800 |
| #define TCL_FIND_ONLY_NS 0x1000 |
|
|
| |
| |
| |
| |
| |
| |
| |
|
|
| typedef struct EnsembleConfig { |
| Namespace *nsPtr; |
| Tcl_Command token; |
| |
| |
| |
| |
| int epoch; |
| |
| char **subcommandArrayPtr; |
| |
| |
| |
| Tcl_HashTable subcommandTable; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| struct EnsembleConfig *next; |
| |
| |
| |
| |
| |
| |
| int flags; |
| |
|
|
| |
|
|
| Tcl_Obj *subcommandDict; |
| |
| |
| |
| |
| Tcl_Obj *subcmdList; |
| |
| |
| |
| |
| |
| |
| Tcl_Obj *unknownHandler; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| Tcl_Obj *parameterList; |
| int numParameters; |
| |
| |
| |
| } EnsembleConfig; |
|
|
| |
| |
| |
|
|
| #define ENSEMBLE_DEAD 0x1 |
| |
| #define ENSEMBLE_COMPILE 0x4 |
| |
|
|
| |
| |
| |
| |
| |
|
|
| |
| |
| |
| |
| |
|
|
| typedef struct VarTrace { |
| Tcl_VarTraceProc *traceProc; |
| |
| ClientData clientData; |
| int flags; |
| |
| |
| |
| struct VarTrace *nextPtr; |
| |
| } VarTrace; |
|
|
| |
| |
| |
| |
| |
|
|
| typedef struct CommandTrace { |
| Tcl_CommandTraceProc *traceProc; |
| |
| |
| ClientData clientData; |
| int flags; |
| |
| |
| struct CommandTrace *nextPtr; |
| |
| |
| int refCount; |
| |
| |
| |
| } CommandTrace; |
|
|
| |
| |
| |
| |
| |
| |
|
|
| typedef struct ActiveCommandTrace { |
| struct Command *cmdPtr; |
| struct ActiveCommandTrace *nextPtr; |
| |
| |
| CommandTrace *nextTracePtr; |
| |
| |
| |
| int reverseScan; |
| |
| } ActiveCommandTrace; |
|
|
| |
| |
| |
| |
| |
| |
| |
|
|
| typedef struct ActiveVarTrace { |
| struct Var *varPtr; |
| struct ActiveVarTrace *nextPtr; |
| |
| |
| VarTrace *nextTracePtr; |
| |
| |
| |
| } ActiveVarTrace; |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| typedef struct Var { |
| int flags; |
| |
| union { |
| Tcl_Obj *objPtr; |
| |
| TclVarHashTable *tablePtr; |
| |
| |
| |
| struct Var *linkPtr; |
| |
| |
| |
| } value; |
| } Var; |
|
|
| typedef struct VarInHash { |
| Var var; |
| int refCount; |
| |
| |
| |
| |
| |
| |
| |
| Tcl_HashEntry entry; |
| |
| |
| |
| |
| } VarInHash; |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| |
| #define VAR_ARRAY 0x1 |
| #define VAR_LINK 0x2 |
|
|
| |
| #define VAR_IN_HASHTABLE 0x4 |
| #define VAR_DEAD_HASH 0x8 |
| #define VAR_ARRAY_ELEMENT 0x1000 |
| #define VAR_NAMESPACE_VAR 0x80 |
|
|
| #define VAR_ALL_HASH \ |
| (VAR_IN_HASHTABLE|VAR_DEAD_HASH|VAR_NAMESPACE_VAR|VAR_ARRAY_ELEMENT) |
|
|
| |
|
|
| #define VAR_TRACED_READ 0x10 |
| #define VAR_TRACED_WRITE 0x20 |
| #define VAR_TRACED_UNSET 0x40 |
| #define VAR_TRACED_ARRAY 0x800 |
| #define VAR_TRACE_ACTIVE 0x2000 |
| #define VAR_SEARCH_ACTIVE 0x4000 |
| #define VAR_ALL_TRACES \ |
| (VAR_TRACED_READ|VAR_TRACED_WRITE|VAR_TRACED_ARRAY|VAR_TRACED_UNSET) |
|
|
| |
| #define VAR_ARGUMENT 0x100 |
| #define VAR_TEMPORARY 0x200 |
| #define VAR_IS_ARGS 0x400 |
| #define VAR_RESOLVED 0x8000 |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #define TclSetVarScalar(varPtr) \ |
| (varPtr)->flags &= ~(VAR_ARRAY|VAR_LINK) |
|
|
| #define TclSetVarArray(varPtr) \ |
| (varPtr)->flags = ((varPtr)->flags & ~VAR_LINK) | VAR_ARRAY |
|
|
| #define TclSetVarLink(varPtr) \ |
| (varPtr)->flags = ((varPtr)->flags & ~VAR_ARRAY) | VAR_LINK |
|
|
| #define TclSetVarArrayElement(varPtr) \ |
| (varPtr)->flags = ((varPtr)->flags & ~VAR_ARRAY) | VAR_ARRAY_ELEMENT |
|
|
| #define TclSetVarUndefined(varPtr) \ |
| (varPtr)->flags &= ~(VAR_ARRAY|VAR_LINK);\ |
| (varPtr)->value.objPtr = NULL |
|
|
| #define TclClearVarUndefined(varPtr) |
|
|
| #define TclSetVarTraceActive(varPtr) \ |
| (varPtr)->flags |= VAR_TRACE_ACTIVE |
|
|
| #define TclClearVarTraceActive(varPtr) \ |
| (varPtr)->flags &= ~VAR_TRACE_ACTIVE |
|
|
| #define TclSetVarNamespaceVar(varPtr) \ |
| if (!TclIsVarNamespaceVar(varPtr)) {\ |
| (varPtr)->flags |= VAR_NAMESPACE_VAR;\ |
| if (TclIsVarInHash(varPtr)) {\ |
| ((VarInHash *)(varPtr))->refCount++;\ |
| }\ |
| } |
|
|
| #define TclClearVarNamespaceVar(varPtr) \ |
| if (TclIsVarNamespaceVar(varPtr)) {\ |
| (varPtr)->flags &= ~VAR_NAMESPACE_VAR;\ |
| if (TclIsVarInHash(varPtr)) {\ |
| ((VarInHash *)(varPtr))->refCount--;\ |
| }\ |
| } |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #define TclIsVarScalar(varPtr) \ |
| !((varPtr)->flags & (VAR_ARRAY|VAR_LINK)) |
|
|
| #define TclIsVarLink(varPtr) \ |
| ((varPtr)->flags & VAR_LINK) |
|
|
| #define TclIsVarArray(varPtr) \ |
| ((varPtr)->flags & VAR_ARRAY) |
|
|
| #define TclIsVarUndefined(varPtr) \ |
| ((varPtr)->value.objPtr == NULL) |
|
|
| #define TclIsVarArrayElement(varPtr) \ |
| ((varPtr)->flags & VAR_ARRAY_ELEMENT) |
|
|
| #define TclIsVarNamespaceVar(varPtr) \ |
| ((varPtr)->flags & VAR_NAMESPACE_VAR) |
|
|
| #define TclIsVarTemporary(varPtr) \ |
| ((varPtr)->flags & VAR_TEMPORARY) |
|
|
| #define TclIsVarArgument(varPtr) \ |
| ((varPtr)->flags & VAR_ARGUMENT) |
|
|
| #define TclIsVarResolved(varPtr) \ |
| ((varPtr)->flags & VAR_RESOLVED) |
|
|
| #define TclIsVarTraceActive(varPtr) \ |
| ((varPtr)->flags & VAR_TRACE_ACTIVE) |
|
|
| #define TclIsVarTraced(varPtr) \ |
| ((varPtr)->flags & VAR_ALL_TRACES) |
|
|
| #define TclIsVarInHash(varPtr) \ |
| ((varPtr)->flags & VAR_IN_HASHTABLE) |
|
|
| #define TclIsVarDeadHash(varPtr) \ |
| ((varPtr)->flags & VAR_DEAD_HASH) |
|
|
| #define TclGetVarNsPtr(varPtr) \ |
| (TclIsVarInHash(varPtr) \ |
| ? ((TclVarHashTable *) ((((VarInHash *) (varPtr))->entry.tablePtr)))->nsPtr \ |
| : NULL) |
|
|
| #define VarHashRefCount(varPtr) \ |
| ((VarInHash *) (varPtr))->refCount |
|
|
| |
| |
| |
|
|
| #define TclIsVarDirectReadable(varPtr) \ |
| ( !((varPtr)->flags & (VAR_ARRAY|VAR_LINK|VAR_TRACED_READ)) \ |
| && (varPtr)->value.objPtr) |
|
|
| #define TclIsVarDirectWritable(varPtr) \ |
| !((varPtr)->flags & (VAR_ARRAY|VAR_LINK|VAR_TRACED_WRITE|VAR_DEAD_HASH)) |
|
|
| #define TclIsVarDirectUnsettable(varPtr) \ |
| !((varPtr)->flags & (VAR_ARRAY|VAR_LINK|VAR_TRACED_READ|VAR_TRACED_WRITE|VAR_TRACED_UNSET|VAR_DEAD_HASH)) |
|
|
| #define TclIsVarDirectModifyable(varPtr) \ |
| ( !((varPtr)->flags & (VAR_ARRAY|VAR_LINK|VAR_TRACED_READ|VAR_TRACED_WRITE)) \ |
| && (varPtr)->value.objPtr) |
|
|
| #define TclIsVarDirectReadable2(varPtr, arrayPtr) \ |
| (TclIsVarDirectReadable(varPtr) &&\ |
| (!(arrayPtr) || !((arrayPtr)->flags & VAR_TRACED_READ))) |
|
|
| #define TclIsVarDirectWritable2(varPtr, arrayPtr) \ |
| (TclIsVarDirectWritable(varPtr) &&\ |
| (!(arrayPtr) || !((arrayPtr)->flags & VAR_TRACED_WRITE))) |
|
|
| #define TclIsVarDirectModifyable2(varPtr, arrayPtr) \ |
| (TclIsVarDirectModifyable(varPtr) &&\ |
| (!(arrayPtr) || !((arrayPtr)->flags & (VAR_TRACED_READ|VAR_TRACED_WRITE)))) |
|
|
| |
| |
| |
| |
| |
| |
|
|
| #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) |
| # define TCLFLEXARRAY |
| #elif defined(__GNUC__) && (__GNUC__ > 2) |
| # define TCLFLEXARRAY 0 |
| #else |
| # define TCLFLEXARRAY 1 |
| #endif |
|
|
| |
| |
| |
| |
|
|
| struct Command; |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| typedef struct CompiledLocal { |
| struct CompiledLocal *nextPtr; |
| |
| |
| |
| int nameLength; |
| |
| int frameIndex; |
| |
| int flags; |
| |
| |
| |
| Tcl_Obj *defValuePtr; |
| |
| |
| Tcl_ResolvedVarInfo *resolveInfo; |
| |
| |
| |
| |
| |
| |
| char name[TCLFLEXARRAY]; |
| |
| |
| |
| |
| } CompiledLocal; |
|
|
| |
| |
| |
| |
| |
|
|
| typedef struct Proc { |
| struct Interp *iPtr; |
| |
| int refCount; |
| |
| |
| |
| |
| struct Command *cmdPtr; |
| |
| |
| |
| Tcl_Obj *bodyPtr; |
| |
| int numArgs; |
| int numCompiledLocals; |
| |
| |
| CompiledLocal *firstLocalPtr; |
| |
| |
| |
| |
| |
| CompiledLocal *lastLocalPtr; |
| |
| |
| } Proc; |
|
|
| |
| |
| |
| |
|
|
| typedef void (ProcErrorProc)(Tcl_Interp *interp, Tcl_Obj *procNameObj); |
|
|
| |
| |
| |
| |
|
|
| typedef struct Trace { |
| int level; |
| |
| Tcl_CmdObjTraceProc *proc; |
| ClientData clientData; |
| struct Trace *nextPtr; |
| int flags; |
| |
| Tcl_CmdObjTraceDeleteProc *delProc; |
| |
| } Trace; |
|
|
| |
| |
| |
| |
| |
| |
| |
|
|
| typedef struct ActiveInterpTrace { |
| struct ActiveInterpTrace *nextPtr; |
| |
| |
| Trace *nextTracePtr; |
| |
| |
| |
| int reverseScan; |
| |
| } ActiveInterpTrace; |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #define TCL_TRACE_ENTER_EXEC 1 |
| #define TCL_TRACE_LEAVE_EXEC 2 |
|
|
| |
| |
| |
| |
| |
| |
|
|
| typedef struct AssocData { |
| Tcl_InterpDeleteProc *proc; |
| ClientData clientData; |
| } AssocData; |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| |
| |
| |
| |
|
|
| typedef struct LocalCache { |
| int refCount; |
| int numVars; |
| Tcl_Obj *varName0; |
| } LocalCache; |
|
|
| #define localName(framePtr, i) \ |
| ((&((framePtr)->localCachePtr->varName0))[(i)]) |
|
|
| MODULE_SCOPE void TclFreeLocalCache(Tcl_Interp *interp, |
| LocalCache *localCachePtr); |
|
|
| typedef struct CallFrame { |
| Namespace *nsPtr; |
| |
| int isProcCallFrame; |
| |
| |
| |
| |
| |
| |
| int objc; |
| |
| Tcl_Obj *const *objv; |
| struct CallFrame *callerPtr; |
| |
| |
| |
| struct CallFrame *callerVarPtr; |
| |
| |
| |
| |
| |
| |
| int level; |
| |
| |
| |
| Proc *procPtr; |
| |
| |
| |
| |
| TclVarHashTable *varTablePtr; |
| |
| |
| |
| |
| int numCompiledLocals; |
| |
| Var *compiledLocals; |
| |
| |
| |
| ClientData clientData; |
| |
| |
| |
| |
| |
| |
| |
| |
| LocalCache *localCachePtr; |
| Tcl_Obj *tailcallPtr; |
| |
| } CallFrame; |
|
|
| #define FRAME_IS_PROC 0x1 |
| #define FRAME_IS_LAMBDA 0x2 |
| #define FRAME_IS_METHOD 0x4 |
| |
| |
| #define FRAME_IS_OO_DEFINE 0x8 |
| |
| |
| |
| |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| typedef struct CmdFrame { |
| |
| |
| |
|
|
| int type; |
| int level; |
| |
| int *line; |
| int nline; |
| CallFrame *framePtr; |
| |
| struct CmdFrame *nextPtr; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| union { |
| struct { |
| Tcl_Obj *path; |
| |
| } eval; |
| struct { |
| const void *codePtr; |
| const char *pc; |
| } tebc; |
| } data; |
| Tcl_Obj *cmdObj; |
| const char *cmd; |
| int len; |
| const struct CFWordBC *litarg; |
| |
| |
| |
| |
| } CmdFrame; |
|
|
| typedef struct CFWord { |
| CmdFrame *framePtr; |
| int word; |
| int refCount; |
| |
| } CFWord; |
|
|
| typedef struct CFWordBC { |
| CmdFrame *framePtr; |
| int pc; |
| |
| int word; |
| |
| struct CFWordBC *prevPtr; |
| struct CFWordBC *nextPtr; |
| |
| Tcl_Obj *obj; |
| } CFWordBC; |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #define CLL_END (-1) |
|
|
| typedef struct ContLineLoc { |
| int num; |
| |
| int loc[TCLFLEXARRAY]; |
| |
| |
| |
| |
| |
| } ContLineLoc; |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #define TCL_LOCATION_EVAL (0) |
| #define TCL_LOCATION_BC (2) |
| #define TCL_LOCATION_PREBC (3) |
| |
| #define TCL_LOCATION_SOURCE (4) |
| #define TCL_LOCATION_PROC (5) |
| #define TCL_LOCATION_LAST (6) |
|
|
| |
| |
| |
| |
| |
|
|
| typedef Tcl_Obj * (GetFrameInfoValueProc)(ClientData clientData); |
| typedef struct { |
| const char *name; |
| GetFrameInfoValueProc *proc; |
| |
| |
| ClientData clientData; |
| |
| } ExtraFrameInfoField; |
| typedef struct { |
| int length; |
| ExtraFrameInfoField fields[2]; |
| |
| |
| } ExtraFrameInfo; |
|
|
| |
| |
| |
| |
| |
| |
| |
|
|
| typedef void **TclHandle; |
|
|
| |
| |
| |
| |
| |
| |
|
|
| #define TCL_REG_BOSONLY 002000 |
| |
|
|
| |
| |
| |
| |
| |
|
|
| MODULE_SCOPE void * TclThreadDataKeyGet(Tcl_ThreadDataKey *keyPtr); |
| MODULE_SCOPE void TclThreadDataKeySet(Tcl_ThreadDataKey *keyPtr, |
| void *data); |
|
|
| |
| |
| |
|
|
| #define TCL_TSD_INIT(keyPtr) \ |
| (ThreadSpecificData *)Tcl_GetThreadData((keyPtr), sizeof(ThreadSpecificData)) |
|
|
| |
| |
| |
| |
| |
| |
|
|
| |
| |
| |
| |
| |
|
|
| struct CompileEnv; |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #define TCL_OUT_LINE_COMPILE TCL_ERROR |
|
|
| typedef int (CompileProc)(Tcl_Interp *interp, Tcl_Parse *parsePtr, |
| struct Command *cmdPtr, struct CompileEnv *compEnvPtr); |
|
|
| |
| |
| |
| |
|
|
| typedef int (CompileHookProc)(Tcl_Interp *interp, |
| struct CompileEnv *compEnvPtr, ClientData clientData); |
|
|
| |
| |
| |
|
|
| typedef struct ExecStack { |
| struct ExecStack *prevPtr; |
| struct ExecStack *nextPtr; |
| Tcl_Obj **markerPtr; |
| Tcl_Obj **endPtr; |
| Tcl_Obj **tosPtr; |
| Tcl_Obj *stackWords[TCLFLEXARRAY]; |
| } ExecStack; |
|
|
| |
| |
| |
| |
| |
| |
| |
|
|
| typedef struct CorContext { |
| struct CallFrame *framePtr; |
| struct CallFrame *varFramePtr; |
| struct CmdFrame *cmdFramePtr; |
| Tcl_HashTable *lineLABCPtr; |
| } CorContext; |
|
|
| typedef struct CoroutineData { |
| struct Command *cmdPtr; |
| struct ExecEnv *eePtr; |
| |
| struct ExecEnv *callerEEPtr; |
| |
| |
| |
| CorContext caller; |
| CorContext running; |
| Tcl_HashTable *lineLABCPtr; |
| void *stackLevel; |
| int auxNumLevels; |
| |
| |
| |
| int nargs; |
| |
| |
| } CoroutineData; |
|
|
| typedef struct ExecEnv { |
| ExecStack *execStackPtr; |
| |
| Tcl_Obj *constants[2]; |
| struct Tcl_Interp *interp; |
| struct NRE_callback *callbackPtr; |
| |
| struct CoroutineData *corPtr; |
| int rewind; |
| } ExecEnv; |
|
|
| #define COR_IS_SUSPENDED(corPtr) \ |
| ((corPtr)->stackLevel == NULL) |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| typedef struct LiteralEntry { |
| struct LiteralEntry *nextPtr; |
| |
| |
| Tcl_Obj *objPtr; |
| |
| int refCount; |
| |
| |
| |
| |
| Namespace *nsPtr; |
| |
| |
| |
| } LiteralEntry; |
|
|
| typedef struct LiteralTable { |
| LiteralEntry **buckets; |
| |
| |
| LiteralEntry *staticBuckets[TCL_SMALL_HASH_TABLE]; |
| |
| |
| int numBuckets; |
| |
| int numEntries; |
| |
| int rebuildSize; |
| |
| int mask; |
| } LiteralTable; |
|
|
| |
| |
| |
| |
| |
|
|
| #ifdef TCL_COMPILE_STATS |
| typedef struct ByteCodeStats { |
| long numExecutions; |
| long numCompilations; |
| long numByteCodesFreed; |
| long instructionCount[256]; |
| |
|
|
| double totalSrcBytes; |
| double totalByteCodeBytes; |
| double currentSrcBytes; |
| double currentByteCodeBytes; |
|
|
| long srcCount[32]; |
| |
| long byteCodeCount[32]; |
| long lifetimeCount[32]; |
|
|
| double currentInstBytes; |
| double currentLitBytes; |
| double currentExceptBytes; |
| double currentAuxBytes; |
| double currentCmdMapBytes; |
|
|
| long numLiteralsCreated; |
| double totalLitStringBytes; |
| double currentLitStringBytes; |
| |
| long literalCount[32]; |
| } ByteCodeStats; |
| #endif |
|
|
| |
| |
| |
| |
| |
|
|
| typedef struct { |
| const char *name; |
| Tcl_ObjCmdProc *proc; |
| CompileProc *compileProc; |
| Tcl_ObjCmdProc *nreProc; |
| ClientData clientData; |
| int unsafe; |
| |
| } EnsembleImplMap; |
|
|
| |
| |
| |
| |
| |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| typedef struct ImportRef { |
| struct Command *importedCmdPtr; |
| |
| |
| |
| |
| struct ImportRef *nextPtr; |
| |
| |
| |
| |
| } ImportRef; |
|
|
| |
| |
| |
| |
| |
|
|
| typedef struct ImportedCmdData { |
| struct Command *realCmdPtr; |
| |
| struct Command *selfPtr; |
| |
| |
| |
| } ImportedCmdData; |
|
|
| |
| |
| |
| |
|
|
| typedef struct Command { |
| Tcl_HashEntry *hPtr; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| Namespace *nsPtr; |
| |
| int refCount; |
| |
| |
| |
| |
| int cmdEpoch; |
| |
| |
| CompileProc *compileProc; |
| |
| Tcl_ObjCmdProc *objProc; |
| ClientData objClientData; |
| Tcl_CmdProc *proc; |
| ClientData clientData; |
| Tcl_CmdDeleteProc *deleteProc; |
| |
| |
| ClientData deleteData; |
| int flags; |
| |
| ImportRef *importRefPtr; |
| |
| |
| |
| |
| |
| |
| CommandTrace *tracePtr; |
| |
| Tcl_ObjCmdProc *nreProc; |
| } Command; |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #define CMD_IS_DELETED 0x01 |
| #define CMD_TRACE_ACTIVE 0x02 |
| #define CMD_HAS_EXEC_TRACES 0x04 |
| #define CMD_COMPILES_EXPANDED 0x08 |
| #define CMD_REDEF_IN_PROGRESS 0x10 |
| #define CMD_VIA_RESOLVER 0x20 |
| #define CMD_DEAD 0x40 |
|
|
|
|
| |
| |
| |
| |
| |
|
|
| |
| |
| |
| |
| |
| |
| |
|
|
| typedef struct ResolverScheme { |
| char *name; |
| Tcl_ResolveCmdProc *cmdResProc; |
| |
| |
| Tcl_ResolveVarProc *varResProc; |
| |
| |
| |
| Tcl_ResolveCompiledVarProc *compiledVarResProc; |
| |
| |
|
|
| struct ResolverScheme *nextPtr; |
| |
| } ResolverScheme; |
|
|
| |
| |
| |
|
|
| typedef struct LimitHandler LimitHandler; |
|
|
| |
| |
| |
| |
|
|
| enum PkgPreferOptions { |
| PKG_PREFER_LATEST, PKG_PREFER_STABLE |
| }; |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| typedef struct AllocCache { |
| struct Cache *nextPtr; |
| Tcl_ThreadId owner; |
| Tcl_Obj *firstObjPtr; |
| int numObjects; |
| } AllocCache; |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| typedef struct Interp { |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| char *result; |
| |
| |
| Tcl_FreeProc *freeProc; |
| |
| |
| |
| |
| |
| |
| int errorLine; |
| |
| |
| const struct TclStubs *stubTable; |
| |
| |
| |
| |
| |
| |
|
|
| TclHandle handle; |
| |
|
|
| Namespace *globalNsPtr; |
| Tcl_HashTable *hiddenCmdTablePtr; |
| |
| |
| |
| ClientData interpInfo; |
| |
| |
| union { |
| void (*optimizer)(void *envPtr); |
| Tcl_HashTable unused2; |
| |
| |
| |
| |
| } extra; |
| |
| |
| |
| |
|
|
| int numLevels; |
| |
| |
| |
| |
| int maxNestingDepth; |
| |
| |
| CallFrame *framePtr; |
| |
| CallFrame *varFramePtr; |
| |
| |
| |
| ActiveVarTrace *activeVarTracePtr; |
| |
| |
| int returnCode; |
| CallFrame *rootFramePtr; |
| |
| Namespace *lookupNsPtr; |
| |
|
|
| |
| |
| |
| |
|
|
| char *appendResult; |
| |
| |
| int appendAvl; |
| |
| int appendUsed; |
| |
|
|
| |
| |
| |
|
|
| Tcl_HashTable packageTable; |
| |
| |
| |
| char *packageUnknown; |
| |
| |
| |
| |
| |
| |
|
|
| int cmdCount; |
| |
| int evalFlags; |
| |
| |
| |
| int unused1; |
| LiteralTable literalTable; |
| |
| |
| |
| |
| int compileEpoch; |
| |
| |
| |
| |
| Proc *compiledProcPtr; |
| |
| |
| |
| |
| ResolverScheme *resolverPtr; |
| |
| |
| |
| |
| |
| Tcl_Obj *scriptFile; |
| |
| |
| int flags; |
| long randSeed; |
| Trace *tracePtr; |
| Tcl_HashTable *assocData; |
| |
| |
| struct ExecEnv *execEnvPtr; |
| |
| |
| Tcl_Obj *emptyObjPtr; |
| |
| |
| |
| char resultSpace[TCL_RESULT_SIZE+1]; |
| |
| Tcl_Obj *objResultPtr; |
| |
| |
| Tcl_ThreadId threadId; |
|
|
| ActiveCommandTrace *activeCmdTracePtr; |
| |
| |
| ActiveInterpTrace *activeInterpTracePtr; |
| |
| |
|
|
| int tracesForbiddingInline; |
| |
| |
|
|
| |
| |
| |
|
|
| Tcl_Obj *returnOpts; |
| |
|
|
| Tcl_Obj *errorInfo; |
| Tcl_Obj *eiVar; |
| Tcl_Obj *errorCode; |
| Tcl_Obj *ecVar; |
| int returnLevel; |
|
|
| |
| |
| |
|
|
| struct { |
| int active; |
| |
| int granularityTicker; |
| |
| int exceeded; |
| |
| |
|
|
| int cmdCount; |
| |
| LimitHandler *cmdHandlers; |
| |
| |
| int cmdGranularity; |
| |
|
|
| Tcl_Time time; |
| |
| LimitHandler *timeHandlers; |
| |
| |
| int timeGranularity; |
| |
| Tcl_TimerToken timeEvent; |
| |
| |
|
|
| Tcl_HashTable callbacks; |
| |
| |
| |
| } limit; |
|
|
| |
| |
| |
| |
|
|
| struct { |
| Tcl_Obj *const *sourceObjs; |
| |
| |
| |
| |
| int numRemovedObjs; |
| |
| int numInsertedObjs; |
| |
| } ensembleRewrite; |
|
|
| |
| |
| |
|
|
| Tcl_Obj *chanMsg; |
| |
| |
| |
| |
|
|
| |
| |
| |
|
|
| CmdFrame *cmdFramePtr; |
| |
| |
| const CmdFrame *invokeCmdFramePtr; |
| |
| |
| |
| |
| int invokeWord; |
| |
| Tcl_HashTable *linePBodyPtr; |
| |
| |
| |
| |
| Tcl_HashTable *lineBCPtr; |
| |
| |
| |
| |
| |
| Tcl_HashTable *lineLABCPtr; |
| Tcl_HashTable *lineLAPtr; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| ContLineLoc *scriptCLLocPtr; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| int packagePrefer; |
|
|
| |
| |
| |
|
|
| Tcl_HashTable varTraces; |
| |
| Tcl_HashTable varSearches; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| AllocCache *allocCache; |
| void *pendingObjDataPtr; |
| |
| |
| int *asyncReadyPtr; |
| |
| |
| |
| |
| void *objectFoundation; |
| |
| |
| |
| |
|
|
| struct NRE_callback *deferredCallbacks; |
| |
| |
| |
| |
| |
|
|
| |
| |
| |
|
|
| Tcl_AsyncHandler asyncCancel; |
| |
| Tcl_Obj *asyncCancelMsg; |
| |
| |
| |
| |
| |
|
|
| |
| |
| |
| Tcl_Obj *errorStack; |
| Tcl_Obj *upLiteral; |
| Tcl_Obj *callLiteral; |
| Tcl_Obj *innerLiteral; |
| Tcl_Obj *innerContext; |
| int resetErrorStack; |
|
|
| #ifdef TCL_COMPILE_STATS |
| |
| |
| |
| |
|
|
| ByteCodeStats stats; |
| |
| #endif |
| } Interp; |
|
|
| |
| |
| |
|
|
| #define TclAsyncReady(iPtr) \ |
| *((iPtr)->asyncReadyPtr) |
|
|
| |
| |
| |
|
|
| #define TclCanceled(iPtr) \ |
| (((iPtr)->flags & CANCELED) || ((iPtr)->flags & TCL_CANCEL_UNWIND)) |
|
|
| #define TclSetCancelFlags(iPtr, cancelFlags) \ |
| (iPtr)->flags |= CANCELED; \ |
| if ((cancelFlags) & TCL_CANCEL_UNWIND) { \ |
| (iPtr)->flags |= TCL_CANCEL_UNWIND; \ |
| } |
|
|
| #define TclUnsetCancelFlags(iPtr) \ |
| (iPtr)->flags &= (~(CANCELED | TCL_CANCEL_UNWIND)) |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #define TclSpliceIn(a,b) \ |
| (a)->nextPtr = (b); \ |
| if ((b) != NULL) { \ |
| (b)->prevPtr = (a); \ |
| } \ |
| (a)->prevPtr = NULL, (b) = (a); |
|
|
| #define TclSpliceOut(a,b) \ |
| if ((a)->prevPtr != NULL) { \ |
| (a)->prevPtr->nextPtr = (a)->nextPtr; \ |
| } else { \ |
| (b) = (a)->nextPtr; \ |
| } \ |
| if ((a)->nextPtr != NULL) { \ |
| (a)->nextPtr->prevPtr = (a)->prevPtr; \ |
| } |
|
|
| |
| |
| |
| |
| |
| |
| |
|
|
| #define TCL_ALLOW_EXCEPTIONS 0x04 |
| #define TCL_EVAL_FILE 0x02 |
| #define TCL_EVAL_SOURCE_IN_FRAME 0x10 |
| #define TCL_EVAL_NORESOLVE 0x20 |
| #define TCL_EVAL_DISCARD_RESULT 0x40 |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #define DELETED 1 |
| #define ERR_ALREADY_LOGGED 4 |
| #define INTERP_DEBUG_FRAME 0x10 |
| #define DONT_COMPILE_CMDS_INLINE 0x20 |
| #define RAND_SEED_INITIALIZED 0x40 |
| #define SAFE_INTERP 0x80 |
| #define INTERP_TRACE_IN_PROGRESS 0x200 |
| #define INTERP_ALTERNATE_WRONG_ARGS 0x400 |
| #define ERR_LEGACY_COPY 0x800 |
| #define CANCELED 0x1000 |
|
|
| |
| |
| |
| |
|
|
| #define MAX_NESTING_DEPTH 1000 |
|
|
| |
| |
| |
| |
| |
|
|
| #define UCHAR(c) ((unsigned char) (c)) |
|
|
| |
| |
| |
| |
|
|
| #if defined(__APPLE__) |
| #define TCL_ALLOCALIGN 16 |
| #else |
| #define TCL_ALLOCALIGN (2*sizeof(void *)) |
| #endif |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #define TCL_ALIGN(x) (((int)(x) + 7) & ~7) |
|
|
| |
| |
| |
| |
|
|
| typedef enum { |
| TCL_PLATFORM_UNIX = 0, |
| TCL_PLATFORM_WINDOWS = 2 |
| } TclPlatformType; |
|
|
| |
| |
| |
| |
| |
|
|
| typedef enum TclEolTranslation { |
| TCL_TRANSLATE_AUTO, |
| TCL_TRANSLATE_CR, |
| TCL_TRANSLATE_LF, |
| TCL_TRANSLATE_CRLF |
| } TclEolTranslation; |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #define TCL_INVOKE_HIDDEN (1<<0) |
| #define TCL_INVOKE_NO_UNKNOWN (1<<1) |
| #define TCL_INVOKE_NO_TRACEBACK (1<<2) |
|
|
| |
| |
| |
| |
| |
| |
| |
|
|
| typedef struct List { |
| int refCount; |
| int maxElemCount; |
| int elemCount; |
| int canonicalFlag; |
| |
| |
| |
| Tcl_Obj *elements; |
| |
| } List; |
|
|
| #define LIST_MAX \ |
| (1 + (int)(((size_t)UINT_MAX - sizeof(List))/sizeof(Tcl_Obj *))) |
| #define LIST_SIZE(numElems) \ |
| (unsigned)(sizeof(List) + (((numElems) - 1) * sizeof(Tcl_Obj *))) |
|
|
| |
| |
| |
|
|
| #define ListRepPtr(listPtr) \ |
| ((List *) (listPtr)->internalRep.twoPtrValue.ptr1) |
|
|
| |
| #define ListSetIntRep(objPtr, listRepPtr) \ |
| (objPtr)->internalRep.twoPtrValue.ptr1 = (void *)(listRepPtr), \ |
| (objPtr)->internalRep.twoPtrValue.ptr2 = NULL, \ |
| (listRepPtr)->refCount++, \ |
| (objPtr)->typePtr = &tclListType |
|
|
| #define ListObjGetElements(listPtr, objc, objv) \ |
| ((objv) = &(ListRepPtr(listPtr)->elements), \ |
| (objc) = ListRepPtr(listPtr)->elemCount) |
|
|
| #define ListObjLength(listPtr, len) \ |
| ((len) = ListRepPtr(listPtr)->elemCount) |
|
|
| #define ListObjIsCanonical(listPtr) \ |
| (((listPtr)->bytes == NULL) || ListRepPtr(listPtr)->canonicalFlag) |
|
|
| #define TclListObjGetElements(interp, listPtr, objcPtr, objvPtr) \ |
| (((listPtr)->typePtr == &tclListType) \ |
| ? ((ListObjGetElements((listPtr), *(objcPtr), *(objvPtr))), TCL_OK)\ |
| : Tcl_ListObjGetElements((interp), (listPtr), (objcPtr), (objvPtr))) |
|
|
| #define TclListObjLength(interp, listPtr, lenPtr) \ |
| (((listPtr)->typePtr == &tclListType) \ |
| ? ((ListObjLength((listPtr), *(lenPtr))), TCL_OK)\ |
| : Tcl_ListObjLength((interp), (listPtr), (lenPtr))) |
|
|
| #define TclListObjIsCanonical(listPtr) \ |
| (((listPtr)->typePtr == &tclListType) ? ListObjIsCanonical((listPtr)) : 0) |
|
|
| |
| |
| |
| |
|
|
| #define TCL_EACH_KEEP_NONE 0 |
| #define TCL_EACH_COLLECT 1 |
|
|
| |
| |
| |
| |
| |
| |
|
|
| #define TclGetLongFromObj(interp, objPtr, longPtr) \ |
| (((objPtr)->typePtr == &tclIntType) \ |
| ? ((*(longPtr) = (objPtr)->internalRep.longValue), TCL_OK) \ |
| : Tcl_GetLongFromObj((interp), (objPtr), (longPtr))) |
|
|
| #if (LONG_MAX == INT_MAX) |
| #define TclGetIntFromObj(interp, objPtr, intPtr) \ |
| (((objPtr)->typePtr == &tclIntType) \ |
| ? ((*(intPtr) = (objPtr)->internalRep.longValue), TCL_OK) \ |
| : Tcl_GetIntFromObj((interp), (objPtr), (intPtr))) |
| #define TclGetIntForIndexM(interp, objPtr, endValue, idxPtr) \ |
| (((objPtr)->typePtr == &tclIntType) \ |
| ? ((*(idxPtr) = (objPtr)->internalRep.longValue), TCL_OK) \ |
| : TclGetIntForIndex((interp), (objPtr), (endValue), (idxPtr))) |
| #else |
| #define TclGetIntFromObj(interp, objPtr, intPtr) \ |
| (((objPtr)->typePtr == &tclIntType \ |
| && (objPtr)->internalRep.longValue >= -(Tcl_WideInt)(UINT_MAX) \ |
| && (objPtr)->internalRep.longValue <= (Tcl_WideInt)(UINT_MAX)) \ |
| ? ((*(intPtr) = (objPtr)->internalRep.longValue), TCL_OK) \ |
| : Tcl_GetIntFromObj((interp), (objPtr), (intPtr))) |
| #define TclGetIntForIndexM(interp, objPtr, endValue, idxPtr) \ |
| (((objPtr)->typePtr == &tclIntType \ |
| && (objPtr)->internalRep.longValue >= INT_MIN \ |
| && (objPtr)->internalRep.longValue <= INT_MAX) \ |
| ? ((*(idxPtr) = (objPtr)->internalRep.longValue), TCL_OK) \ |
| : TclGetIntForIndex((interp), (objPtr), (endValue), (idxPtr))) |
| #endif |
|
|
| |
| |
| |
| |
| |
| |
| |
|
|
| #ifdef TCL_WIDE_INT_IS_LONG |
| #define TclGetWideIntFromObj(interp, objPtr, wideIntPtr) \ |
| (((objPtr)->typePtr == &tclIntType) \ |
| ? (*(wideIntPtr) = (Tcl_WideInt) \ |
| ((objPtr)->internalRep.longValue), TCL_OK) : \ |
| Tcl_GetWideIntFromObj((interp), (objPtr), (wideIntPtr))) |
| #else |
| #define TclGetWideIntFromObj(interp, objPtr, wideIntPtr) \ |
| (((objPtr)->typePtr == &tclWideIntType) \ |
| ? (*(wideIntPtr) = (objPtr)->internalRep.wideValue, TCL_OK) : \ |
| ((objPtr)->typePtr == &tclIntType) \ |
| ? (*(wideIntPtr) = (Tcl_WideInt) \ |
| ((objPtr)->internalRep.longValue), TCL_OK) : \ |
| Tcl_GetWideIntFromObj((interp), (objPtr), (wideIntPtr))) |
| #endif |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #define DICT_PATH_READ 0 |
| #define DICT_PATH_UPDATE 1 |
| #define DICT_PATH_EXISTS 2 |
| #define DICT_PATH_CREATE 5 |
|
|
| #define DICT_PATH_NON_EXISTENT ((Tcl_Obj *) (void *) 1) |
|
|
| |
| |
| |
| |
| |
|
|
| |
| |
| |
| |
| |
| |
| |
|
|
| #define TCL_FILESYSTEM_VERSION_2 ((Tcl_FSVersion) 0x2) |
| typedef ClientData (TclFSGetCwdProc2)(ClientData clientData); |
| typedef int (Tcl_FSLoadFileProc2) (Tcl_Interp *interp, Tcl_Obj *pathPtr, |
| Tcl_LoadHandle *handlePtr, Tcl_FSUnloadFileProc **unloadProcPtr, int flags); |
|
|
| |
| |
| |
| |
| |
| |
| |
|
|
| typedef int (TclGetFileAttrProc)(Tcl_Interp *interp, int objIndex, |
| Tcl_Obj *fileName, Tcl_Obj **attrObjPtrPtr); |
| typedef int (TclSetFileAttrProc)(Tcl_Interp *interp, int objIndex, |
| Tcl_Obj *fileName, Tcl_Obj *attrObjPtr); |
|
|
| typedef struct TclFileAttrProcs { |
| TclGetFileAttrProc *getProc; |
| TclSetFileAttrProc *setProc; |
| } TclFileAttrProcs; |
|
|
| |
| |
| |
| |
|
|
| typedef struct TclFile_ *TclFile; |
|
|
| |
| |
| |
| |
|
|
| #define TCL_GLOBMODE_NO_COMPLAIN 1 |
| #define TCL_GLOBMODE_JOIN 2 |
| #define TCL_GLOBMODE_DIR 4 |
| #define TCL_GLOBMODE_TAILS 8 |
|
|
| typedef enum Tcl_PathPart { |
| TCL_PATH_DIRNAME, |
| TCL_PATH_TAIL, |
| TCL_PATH_EXTENSION, |
| TCL_PATH_ROOT |
| } Tcl_PathPart; |
|
|
| |
| |
| |
| |
| |
|
|
| typedef int (TclStatProc_)(const char *path, struct stat *buf); |
| typedef int (TclAccessProc_)(const char *path, int mode); |
| typedef Tcl_Channel (TclOpenFileChannelProc_)(Tcl_Interp *interp, |
| const char *fileName, const char *modeString, int permissions); |
|
|
| |
| |
| |
| |
| |
|
|
| typedef Tcl_CmdProc *TclCmdProcType; |
| typedef Tcl_ObjCmdProc *TclObjCmdProcType; |
|
|
| |
| |
| |
| |
| |
|
|
| typedef void (TclInitProcessGlobalValueProc)(char **valuePtr, int *lengthPtr, |
| Tcl_Encoding *encodingPtr); |
|
|
| |
| |
| |
| |
| |
| |
| |
|
|
| typedef struct ProcessGlobalValue { |
| int epoch; |
| |
| int numBytes; |
| char *value; |
| Tcl_Encoding encoding; |
| |
| TclInitProcessGlobalValueProc *proc; |
| |
| |
| |
| Tcl_Mutex mutex; |
| |
| Tcl_ThreadDataKey key; |
| |
| } ProcessGlobalValue; |
|
|
| |
| |
| |
| |
| |
|
|
| #define TCL_PARSE_DECIMAL_ONLY 1 |
| |
| |
| #define TCL_PARSE_OCTAL_ONLY 2 |
| |
| #define TCL_PARSE_HEXADECIMAL_ONLY 4 |
| |
| #define TCL_PARSE_INTEGER_ONLY 8 |
| |
| #define TCL_PARSE_SCAN_PREFIXES 16 |
| |
| |
| #define TCL_PARSE_NO_WHITESPACE 32 |
| |
| #define TCL_PARSE_BINARY_ONLY 64 |
| |
|
|
| |
| |
| |
| |
| |
|
|
| #define TCL_NUMBER_LONG 1 |
| #define TCL_NUMBER_WIDE 2 |
| #define TCL_NUMBER_BIG 3 |
| #define TCL_NUMBER_DOUBLE 4 |
| #define TCL_NUMBER_NAN 5 |
|
|
| |
| |
| |
| |
| |
|
|
| MODULE_SCOPE char *tclNativeExecutableName; |
| MODULE_SCOPE int tclFindExecutableSearchDone; |
| MODULE_SCOPE char *tclMemDumpFileName; |
| MODULE_SCOPE TclPlatformType tclPlatform; |
| MODULE_SCOPE Tcl_NotifierProcs tclNotifierHooks; |
|
|
| MODULE_SCOPE Tcl_Encoding tclIdentityEncoding; |
|
|
| |
| |
| |
| |
|
|
| MODULE_SCOPE Tcl_GetTimeProc *tclGetTimeProcPtr; |
| MODULE_SCOPE Tcl_ScaleTimeProc *tclScaleTimeProcPtr; |
| MODULE_SCOPE ClientData tclTimeClientData; |
|
|
| |
| |
| |
|
|
| MODULE_SCOPE const Tcl_ObjType tclBignumType; |
| MODULE_SCOPE const Tcl_ObjType tclBooleanType; |
| MODULE_SCOPE const Tcl_ObjType tclByteArrayType; |
| MODULE_SCOPE const Tcl_ObjType tclByteCodeType; |
| MODULE_SCOPE const Tcl_ObjType tclDoubleType; |
| MODULE_SCOPE const Tcl_ObjType tclEndOffsetType; |
| MODULE_SCOPE const Tcl_ObjType tclIntType; |
| MODULE_SCOPE const Tcl_ObjType tclListType; |
| MODULE_SCOPE const Tcl_ObjType tclDictType; |
| MODULE_SCOPE const Tcl_ObjType tclProcBodyType; |
| MODULE_SCOPE const Tcl_ObjType tclStringType; |
| MODULE_SCOPE const Tcl_ObjType tclArraySearchType; |
| MODULE_SCOPE const Tcl_ObjType tclEnsembleCmdType; |
| #ifndef TCL_WIDE_INT_IS_LONG |
| MODULE_SCOPE const Tcl_ObjType tclWideIntType; |
| #endif |
| MODULE_SCOPE const Tcl_ObjType tclRegexpType; |
| MODULE_SCOPE Tcl_ObjType tclCmdNameType; |
|
|
| |
| |
| |
|
|
| MODULE_SCOPE const Tcl_HashKeyType tclArrayHashKeyType; |
| MODULE_SCOPE const Tcl_HashKeyType tclOneWordHashKeyType; |
| MODULE_SCOPE const Tcl_HashKeyType tclStringHashKeyType; |
| MODULE_SCOPE const Tcl_HashKeyType tclObjHashKeyType; |
|
|
| |
| |
| |
| |
|
|
| MODULE_SCOPE Tcl_Obj * tclFreeObjList; |
|
|
| #ifdef TCL_COMPILE_STATS |
| MODULE_SCOPE long tclObjsAlloced; |
| MODULE_SCOPE long tclObjsFreed; |
| #define TCL_MAX_SHARED_OBJ_STATS 5 |
| MODULE_SCOPE long tclObjsShared[TCL_MAX_SHARED_OBJ_STATS]; |
| #endif |
|
|
| |
| |
| |
| |
| |
|
|
| MODULE_SCOPE char * tclEmptyStringRep; |
| MODULE_SCOPE char tclEmptyString; |
|
|
| enum CheckEmptyStringResult { |
| TCL_EMPTYSTRING_UNKNOWN = -1, TCL_EMPTYSTRING_NO, TCL_EMPTYSTRING_YES |
| }; |
|
|
| |
| |
| |
| |
| |
| |
|
|
| MODULE_SCOPE Tcl_ObjCmdProc TclNRApplyObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclNREvalObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclNRCatchObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclNRExprObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclNRForObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclNRForeachCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclNRIfObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclNRLmapCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclNRPackageObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclNRSourceObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclNRSubstObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclNRSwitchObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclNRTryObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclNRUplevelObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclNRWhileObjCmd; |
|
|
| MODULE_SCOPE Tcl_NRPostProc TclNRForIterCallback; |
| MODULE_SCOPE Tcl_NRPostProc TclNRCoroutineActivateCallback; |
| MODULE_SCOPE Tcl_ObjCmdProc TclNRTailcallObjCmd; |
| MODULE_SCOPE Tcl_NRPostProc TclNRTailcallEval; |
| MODULE_SCOPE Tcl_ObjCmdProc TclNRCoroutineObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclNRYieldObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclNRYieldmObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclNRYieldToObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclNRInvoke; |
| MODULE_SCOPE Tcl_NRPostProc TclNRReleaseValues; |
|
|
| MODULE_SCOPE void TclSetTailcall(Tcl_Interp *interp, Tcl_Obj *tailcallPtr); |
| MODULE_SCOPE void TclPushTailcallPoint(Tcl_Interp *interp); |
|
|
| |
| MODULE_SCOPE void TclMarkTailcall(Tcl_Interp *interp); |
| MODULE_SCOPE void TclSkipTailcall(Tcl_Interp *interp); |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| typedef struct ForIterData { |
| Tcl_Obj *cond; |
| Tcl_Obj *body; |
| Tcl_Obj *next; |
| const char *msg; |
| int word; |
| } ForIterData; |
|
|
| |
| |
| |
|
|
| typedef void* TclFindSymbolProc(Tcl_Interp* interp, Tcl_LoadHandle loadHandle, |
| const char* symbol); |
| struct Tcl_LoadHandle_ { |
| ClientData clientData; |
| |
| |
| |
| |
| TclFindSymbolProc* findSymbolProcPtr; |
| |
| |
| Tcl_FSUnloadFileProc* unloadFileProcPtr; |
| |
| }; |
|
|
| |
|
|
| #define TCL_DD_SHORTEST 0x4 |
| |
| #define TCL_DD_STEELE 0x5 |
| |
| #define TCL_DD_E_FORMAT 0x2 |
| |
| |
| #define TCL_DD_F_FORMAT 0x3 |
| |
| |
|
|
| #define TCL_DD_SHORTEN_FLAG 0x4 |
| |
| |
| #define TCL_DD_NO_QUICK 0x8 |
| |
|
|
| #define TCL_DD_CONVERSION_TYPE_MASK 0x3 |
| |
| #define TCL_DD_STEELE0 0x1 |
| |
| #define TCL_DD_SHORTEST0 0x0 |
| |
|
|
| |
| |
| |
| |
| |
|
|
| MODULE_SCOPE void TclAppendBytesToByteArray(Tcl_Obj *objPtr, |
| const unsigned char *bytes, int len); |
| MODULE_SCOPE void TclAppendUtfToUtf(Tcl_Obj *objPtr, |
| const char *bytes, int numBytes); |
| MODULE_SCOPE void TclAdvanceContinuations(int *line, int **next, |
| int loc); |
| MODULE_SCOPE void TclAdvanceLines(int *line, const char *start, |
| const char *end); |
| MODULE_SCOPE void TclArgumentEnter(Tcl_Interp *interp, |
| Tcl_Obj *objv[], int objc, CmdFrame *cf); |
| MODULE_SCOPE void TclArgumentRelease(Tcl_Interp *interp, |
| Tcl_Obj *objv[], int objc); |
| MODULE_SCOPE void TclArgumentBCEnter(Tcl_Interp *interp, |
| Tcl_Obj *objv[], int objc, |
| void *codePtr, CmdFrame *cfPtr, int cmd, int pc); |
| MODULE_SCOPE void TclArgumentBCRelease(Tcl_Interp *interp, |
| CmdFrame *cfPtr); |
| MODULE_SCOPE void TclArgumentGet(Tcl_Interp *interp, Tcl_Obj *obj, |
| CmdFrame **cfPtrPtr, int *wordPtr); |
| MODULE_SCOPE double TclBignumToDouble(const mp_int *bignum); |
| MODULE_SCOPE int TclByteArrayMatch(const unsigned char *string, |
| int strLen, const unsigned char *pattern, |
| int ptnLen, int flags); |
| MODULE_SCOPE double TclCeil(const mp_int *a); |
| MODULE_SCOPE void TclChannelPreserve(Tcl_Channel chan); |
| MODULE_SCOPE void TclChannelRelease(Tcl_Channel chan); |
| MODULE_SCOPE int TclCheckArrayTraces(Tcl_Interp *interp, Var *varPtr, |
| Var *arrayPtr, Tcl_Obj *name, int index); |
| MODULE_SCOPE int TclCheckBadOctal(Tcl_Interp *interp, |
| const char *value); |
| MODULE_SCOPE int TclCheckEmptyString(Tcl_Obj *objPtr); |
| MODULE_SCOPE int TclChanCaughtErrorBypass(Tcl_Interp *interp, |
| Tcl_Channel chan); |
| MODULE_SCOPE Tcl_ObjCmdProc TclChannelNamesCmd; |
| MODULE_SCOPE Tcl_NRPostProc TclClearRootEnsemble; |
| MODULE_SCOPE ContLineLoc *TclContinuationsEnter(Tcl_Obj *objPtr, int num, |
| int *loc); |
| MODULE_SCOPE void TclContinuationsEnterDerived(Tcl_Obj *objPtr, |
| int start, int *clNext); |
| MODULE_SCOPE ContLineLoc *TclContinuationsGet(Tcl_Obj *objPtr); |
| MODULE_SCOPE void TclContinuationsCopy(Tcl_Obj *objPtr, |
| Tcl_Obj *originObjPtr); |
| MODULE_SCOPE int TclConvertElement(const char *src, int length, |
| char *dst, int flags); |
| MODULE_SCOPE Tcl_Command TclCreateObjCommandInNs(Tcl_Interp *interp, |
| const char *cmdName, Tcl_Namespace *nsPtr, |
| Tcl_ObjCmdProc *proc, ClientData clientData, |
| Tcl_CmdDeleteProc *deleteProc); |
| MODULE_SCOPE Tcl_Command TclCreateEnsembleInNs(Tcl_Interp *interp, |
| const char *name, Tcl_Namespace *nameNamespacePtr, |
| Tcl_Namespace *ensembleNamespacePtr, int flags); |
| MODULE_SCOPE void TclDeleteNamespaceVars(Namespace *nsPtr); |
| MODULE_SCOPE int TclFindDictElement(Tcl_Interp *interp, |
| const char *dict, int dictLength, |
| const char **elementPtr, const char **nextPtr, |
| int *sizePtr, int *literalPtr); |
| |
| MODULE_SCOPE int TclEvalEx(Tcl_Interp *interp, const char *script, |
| int numBytes, int flags, int line, |
| int *clNextOuter, const char *outerScript); |
| MODULE_SCOPE Tcl_ObjCmdProc TclFileAttrsCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclFileCopyCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclFileDeleteCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclFileLinkCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclFileMakeDirsCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclFileReadLinkCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclFileRenameCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclFileTemporaryCmd; |
| MODULE_SCOPE void TclCreateLateExitHandler(Tcl_ExitProc *proc, |
| ClientData clientData); |
| MODULE_SCOPE void TclDeleteLateExitHandler(Tcl_ExitProc *proc, |
| ClientData clientData); |
| MODULE_SCOPE char * TclDStringAppendObj(Tcl_DString *dsPtr, |
| Tcl_Obj *objPtr); |
| MODULE_SCOPE char * TclDStringAppendDString(Tcl_DString *dsPtr, |
| Tcl_DString *toAppendPtr); |
| MODULE_SCOPE Tcl_Obj * TclDStringToObj(Tcl_DString *dsPtr); |
| MODULE_SCOPE Tcl_Obj *const *TclFetchEnsembleRoot(Tcl_Interp *interp, |
| Tcl_Obj *const *objv, int objc, int *objcPtr); |
| MODULE_SCOPE Tcl_Obj *const *TclEnsembleGetRewriteValues(Tcl_Interp *interp); |
| MODULE_SCOPE Tcl_Namespace *TclEnsureNamespace(Tcl_Interp *interp, |
| Tcl_Namespace *namespacePtr); |
| MODULE_SCOPE void TclFinalizeAllocSubsystem(void); |
| MODULE_SCOPE void TclFinalizeAsync(void); |
| MODULE_SCOPE void TclFinalizeDoubleConversion(void); |
| MODULE_SCOPE void TclFinalizeEncodingSubsystem(void); |
| MODULE_SCOPE void TclFinalizeEnvironment(void); |
| MODULE_SCOPE void TclFinalizeEvaluation(void); |
| MODULE_SCOPE void TclFinalizeExecution(void); |
| MODULE_SCOPE void TclFinalizeIOSubsystem(void); |
| MODULE_SCOPE void TclFinalizeFilesystem(void); |
| MODULE_SCOPE void TclResetFilesystem(void); |
| MODULE_SCOPE void TclFinalizeLoad(void); |
| MODULE_SCOPE void TclFinalizeLock(void); |
| MODULE_SCOPE void TclFinalizeMemorySubsystem(void); |
| MODULE_SCOPE void TclFinalizeNotifier(void); |
| MODULE_SCOPE void TclFinalizeObjects(void); |
| MODULE_SCOPE void TclFinalizePreserve(void); |
| MODULE_SCOPE void TclFinalizeSynchronization(void); |
| MODULE_SCOPE void TclFinalizeThreadAlloc(void); |
| MODULE_SCOPE void TclFinalizeThreadAllocThread(void); |
| MODULE_SCOPE void TclFinalizeThreadData(int quick); |
| MODULE_SCOPE void TclFinalizeThreadObjects(void); |
| MODULE_SCOPE double TclFloor(const mp_int *a); |
| MODULE_SCOPE void TclFormatNaN(double value, char *buffer); |
| MODULE_SCOPE int TclFSFileAttrIndex(Tcl_Obj *pathPtr, |
| const char *attributeName, int *indexPtr); |
| MODULE_SCOPE Tcl_Command TclNRCreateCommandInNs(Tcl_Interp *interp, |
| const char *cmdName, Tcl_Namespace *nsPtr, |
| Tcl_ObjCmdProc *proc, Tcl_ObjCmdProc *nreProc, |
| ClientData clientData, Tcl_CmdDeleteProc *deleteProc); |
| MODULE_SCOPE int TclNREvalFile(Tcl_Interp *interp, Tcl_Obj *pathPtr, |
| const char *encodingName); |
| MODULE_SCOPE int * TclGetAsyncReadyPtr(void); |
| MODULE_SCOPE Tcl_Obj * TclGetBgErrorHandler(Tcl_Interp *interp); |
| MODULE_SCOPE int TclGetChannelFromObj(Tcl_Interp *interp, |
| Tcl_Obj *objPtr, Tcl_Channel *chanPtr, |
| int *modePtr, int flags); |
| MODULE_SCOPE CmdFrame * TclGetCmdFrameForProcedure(Proc *procPtr); |
| MODULE_SCOPE int TclGetCompletionCodeFromObj(Tcl_Interp *interp, |
| Tcl_Obj *value, int *code); |
| MODULE_SCOPE int TclGetNumberFromObj(Tcl_Interp *interp, |
| Tcl_Obj *objPtr, ClientData *clientDataPtr, |
| int *typePtr); |
| MODULE_SCOPE int TclGetOpenModeEx(Tcl_Interp *interp, |
| const char *modeString, int *seekFlagPtr, |
| int *binaryPtr); |
| MODULE_SCOPE Tcl_Obj * TclGetProcessGlobalValue(ProcessGlobalValue *pgvPtr); |
| MODULE_SCOPE Tcl_Obj * TclGetSourceFromFrame(CmdFrame *cfPtr, int objc, |
| Tcl_Obj *const objv[]); |
| MODULE_SCOPE char * TclGetStringStorage(Tcl_Obj *objPtr, |
| unsigned int *sizePtr); |
| MODULE_SCOPE int TclGlob(Tcl_Interp *interp, char *pattern, |
| Tcl_Obj *unquotedPrefix, int globFlags, |
| Tcl_GlobTypeData *types); |
| MODULE_SCOPE int TclIncrObj(Tcl_Interp *interp, Tcl_Obj *valuePtr, |
| Tcl_Obj *incrPtr); |
| MODULE_SCOPE Tcl_Obj * TclIncrObjVar2(Tcl_Interp *interp, Tcl_Obj *part1Ptr, |
| Tcl_Obj *part2Ptr, Tcl_Obj *incrPtr, int flags); |
| MODULE_SCOPE Tcl_ObjCmdProc TclInfoExistsCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclInfoCoroutineCmd; |
| MODULE_SCOPE Tcl_Obj * TclInfoFrame(Tcl_Interp *interp, CmdFrame *framePtr); |
| MODULE_SCOPE Tcl_ObjCmdProc TclInfoGlobalsCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclInfoLocalsCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclInfoVarsCmd; |
| MODULE_SCOPE void TclInitAlloc(void); |
| MODULE_SCOPE void TclInitDbCkalloc(void); |
| MODULE_SCOPE void TclInitDoubleConversion(void); |
| MODULE_SCOPE void TclInitEmbeddedConfigurationInformation( |
| Tcl_Interp *interp); |
| MODULE_SCOPE void TclInitEncodingSubsystem(void); |
| MODULE_SCOPE void TclInitIOSubsystem(void); |
| MODULE_SCOPE void TclInitLimitSupport(Tcl_Interp *interp); |
| MODULE_SCOPE void TclInitNamespaceSubsystem(void); |
| MODULE_SCOPE void TclInitNotifier(void); |
| MODULE_SCOPE void TclInitObjSubsystem(void); |
| MODULE_SCOPE const char *TclInitSubsystems(void); |
| MODULE_SCOPE int TclInterpReady(Tcl_Interp *interp); |
| MODULE_SCOPE int TclIsBareword(int byte); |
| MODULE_SCOPE Tcl_Obj * TclJoinPath(int elements, Tcl_Obj * const objv[], |
| int forceRelative); |
| MODULE_SCOPE int TclJoinThread(Tcl_ThreadId id, int *result); |
| MODULE_SCOPE void TclLimitRemoveAllHandlers(Tcl_Interp *interp); |
| MODULE_SCOPE Tcl_Obj * TclLindexList(Tcl_Interp *interp, |
| Tcl_Obj *listPtr, Tcl_Obj *argPtr); |
| MODULE_SCOPE Tcl_Obj * TclLindexFlat(Tcl_Interp *interp, Tcl_Obj *listPtr, |
| int indexCount, Tcl_Obj *const indexArray[]); |
| |
| MODULE_SCOPE void TclListLines(Tcl_Obj *listObj, int line, int n, |
| int *lines, Tcl_Obj *const *elems); |
| MODULE_SCOPE Tcl_Obj * TclListObjCopy(Tcl_Interp *interp, Tcl_Obj *listPtr); |
| MODULE_SCOPE Tcl_Obj * TclLsetList(Tcl_Interp *interp, Tcl_Obj *listPtr, |
| Tcl_Obj *indexPtr, Tcl_Obj *valuePtr); |
| MODULE_SCOPE Tcl_Obj * TclLsetFlat(Tcl_Interp *interp, Tcl_Obj *listPtr, |
| int indexCount, Tcl_Obj *const indexArray[], |
| Tcl_Obj *valuePtr); |
| MODULE_SCOPE Tcl_Command TclMakeEnsemble(Tcl_Interp *interp, const char *name, |
| const EnsembleImplMap map[]); |
| MODULE_SCOPE int TclMaxListLength(const char *bytes, int numBytes, |
| const char **endPtr); |
| MODULE_SCOPE int TclMergeReturnOptions(Tcl_Interp *interp, int objc, |
| Tcl_Obj *const objv[], Tcl_Obj **optionsPtrPtr, |
| int *codePtr, int *levelPtr); |
| MODULE_SCOPE Tcl_Obj * TclNoErrorStack(Tcl_Interp *interp, Tcl_Obj *options); |
| MODULE_SCOPE int TclNokia770Doubles(void); |
| MODULE_SCOPE void TclNsDecrRefCount(Namespace *nsPtr); |
| MODULE_SCOPE int TclNamespaceDeleted(Namespace *nsPtr); |
| MODULE_SCOPE void TclObjVarErrMsg(Tcl_Interp *interp, Tcl_Obj *part1Ptr, |
| Tcl_Obj *part2Ptr, const char *operation, |
| const char *reason, int index); |
| MODULE_SCOPE int TclObjInvokeNamespace(Tcl_Interp *interp, |
| int objc, Tcl_Obj *const objv[], |
| Tcl_Namespace *nsPtr, int flags); |
| MODULE_SCOPE int TclObjUnsetVar2(Tcl_Interp *interp, |
| Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, int flags); |
| MODULE_SCOPE int TclParseBackslash(const char *src, |
| int numBytes, int *readPtr, char *dst); |
| MODULE_SCOPE int TclParseNumber(Tcl_Interp *interp, Tcl_Obj *objPtr, |
| const char *expected, const char *bytes, |
| int numBytes, const char **endPtrPtr, int flags); |
| MODULE_SCOPE void TclParseInit(Tcl_Interp *interp, const char *string, |
| int numBytes, Tcl_Parse *parsePtr); |
| MODULE_SCOPE int TclParseAllWhiteSpace(const char *src, int numBytes); |
| MODULE_SCOPE int TclProcessReturn(Tcl_Interp *interp, |
| int code, int level, Tcl_Obj *returnOpts); |
| MODULE_SCOPE int TclpObjLstat(Tcl_Obj *pathPtr, Tcl_StatBuf *buf); |
| MODULE_SCOPE Tcl_Obj * TclpTempFileName(void); |
| MODULE_SCOPE Tcl_Obj * TclpTempFileNameForLibrary(Tcl_Interp *interp, Tcl_Obj* pathPtr); |
| MODULE_SCOPE Tcl_Obj * TclNewFSPathObj(Tcl_Obj *dirPtr, const char *addStrRep, |
| int len); |
| MODULE_SCOPE int TclpDeleteFile(const void *path); |
| MODULE_SCOPE void TclpFinalizeCondition(Tcl_Condition *condPtr); |
| MODULE_SCOPE void TclpFinalizeMutex(Tcl_Mutex *mutexPtr); |
| MODULE_SCOPE void TclpFinalizePipes(void); |
| MODULE_SCOPE void TclpFinalizeSockets(void); |
| MODULE_SCOPE int TclCreateSocketAddress(Tcl_Interp *interp, |
| struct addrinfo **addrlist, |
| const char *host, int port, int willBind, |
| const char **errorMsgPtr); |
| MODULE_SCOPE int TclpThreadCreate(Tcl_ThreadId *idPtr, |
| Tcl_ThreadCreateProc *proc, ClientData clientData, |
| int stackSize, int flags); |
| MODULE_SCOPE int TclpFindVariable(const char *name, int *lengthPtr); |
| MODULE_SCOPE void TclpInitLibraryPath(char **valuePtr, |
| int *lengthPtr, Tcl_Encoding *encodingPtr); |
| MODULE_SCOPE void TclpInitLock(void); |
| MODULE_SCOPE void TclpInitPlatform(void); |
| MODULE_SCOPE void TclpInitUnlock(void); |
| MODULE_SCOPE Tcl_Obj * TclpObjListVolumes(void); |
| MODULE_SCOPE void TclpGlobalLock(void); |
| MODULE_SCOPE void TclpGlobalUnlock(void); |
| MODULE_SCOPE int TclpObjNormalizePath(Tcl_Interp *interp, |
| Tcl_Obj *pathPtr, int nextCheckpoint); |
| MODULE_SCOPE void TclpNativeJoinPath(Tcl_Obj *prefix, const char *joining); |
| MODULE_SCOPE Tcl_Obj * TclpNativeSplitPath(Tcl_Obj *pathPtr, int *lenPtr); |
| MODULE_SCOPE Tcl_PathType TclpGetNativePathType(Tcl_Obj *pathPtr, |
| int *driveNameLengthPtr, Tcl_Obj **driveNameRef); |
| MODULE_SCOPE int TclCrossFilesystemCopy(Tcl_Interp *interp, |
| Tcl_Obj *source, Tcl_Obj *target); |
| MODULE_SCOPE int TclpMatchInDirectory(Tcl_Interp *interp, |
| Tcl_Obj *resultPtr, Tcl_Obj *pathPtr, |
| const char *pattern, Tcl_GlobTypeData *types); |
| MODULE_SCOPE ClientData TclpGetNativeCwd(ClientData clientData); |
| MODULE_SCOPE Tcl_FSDupInternalRepProc TclNativeDupInternalRep; |
| MODULE_SCOPE Tcl_Obj * TclpObjLink(Tcl_Obj *pathPtr, Tcl_Obj *toPtr, |
| int linkType); |
| MODULE_SCOPE int TclpObjChdir(Tcl_Obj *pathPtr); |
| MODULE_SCOPE Tcl_Channel TclpOpenTemporaryFile(Tcl_Obj *dirObj, |
| Tcl_Obj *basenameObj, Tcl_Obj *extensionObj, |
| Tcl_Obj *resultingNameObj); |
| MODULE_SCOPE Tcl_Obj * TclPathPart(Tcl_Interp *interp, Tcl_Obj *pathPtr, |
| Tcl_PathPart portion); |
| MODULE_SCOPE char * TclpReadlink(const char *fileName, |
| Tcl_DString *linkPtr); |
| MODULE_SCOPE void TclpSetVariables(Tcl_Interp *interp); |
| MODULE_SCOPE void * TclThreadStorageKeyGet(Tcl_ThreadDataKey *keyPtr); |
| MODULE_SCOPE void TclThreadStorageKeySet(Tcl_ThreadDataKey *keyPtr, |
| void *data); |
| MODULE_SCOPE void TclpThreadExit(int status); |
| MODULE_SCOPE void TclRememberCondition(Tcl_Condition *mutex); |
| MODULE_SCOPE void TclRememberJoinableThread(Tcl_ThreadId id); |
| MODULE_SCOPE void TclRememberMutex(Tcl_Mutex *mutex); |
| MODULE_SCOPE void TclRemoveScriptLimitCallbacks(Tcl_Interp *interp); |
| MODULE_SCOPE int TclReToGlob(Tcl_Interp *interp, const char *reStr, |
| int reStrLen, Tcl_DString *dsPtr, int *flagsPtr, |
| int *quantifiersFoundPtr); |
| MODULE_SCOPE unsigned int TclScanElement(const char *string, int length, |
| char *flagPtr); |
| MODULE_SCOPE void TclSetBgErrorHandler(Tcl_Interp *interp, |
| Tcl_Obj *cmdPrefix); |
| MODULE_SCOPE void TclSetBignumInternalRep(Tcl_Obj *objPtr, |
| mp_int *bignumValue); |
| MODULE_SCOPE int TclSetBooleanFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr); |
| MODULE_SCOPE void TclSetCmdNameObj(Tcl_Interp *interp, Tcl_Obj *objPtr, |
| Command *cmdPtr); |
| MODULE_SCOPE void TclSetDuplicateObj(Tcl_Obj *dupPtr, Tcl_Obj *objPtr); |
| MODULE_SCOPE void TclSetProcessGlobalValue(ProcessGlobalValue *pgvPtr, |
| Tcl_Obj *newValue, Tcl_Encoding encoding); |
| MODULE_SCOPE void TclSignalExitThread(Tcl_ThreadId id, int result); |
| MODULE_SCOPE void TclSpellFix(Tcl_Interp *interp, |
| Tcl_Obj *const *objv, int objc, int subIdx, |
| Tcl_Obj *bad, Tcl_Obj *fix); |
| MODULE_SCOPE void * TclStackRealloc(Tcl_Interp *interp, void *ptr, |
| int numBytes); |
|
|
| typedef int (*memCmpFn_t)(const void*, const void*, size_t); |
| MODULE_SCOPE int TclStringCmp(Tcl_Obj *value1Ptr, Tcl_Obj *value2Ptr, |
| int checkEq, int nocase, int reqlength); |
| MODULE_SCOPE int TclUniCharNcasecmp(const void*, const void*, size_t); |
| MODULE_SCOPE int TclUtfNcasecmp(const void*, const void*, size_t); |
| MODULE_SCOPE int TclUtfNcmp(const void*, const void*, size_t); |
| MODULE_SCOPE int TclUniCharNcmp(const void*, const void*, size_t); |
| MODULE_SCOPE int TclUtfNcmp2(const void*, const void*, size_t); |
| MODULE_SCOPE int TclStringCmpOpts(Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], |
| int *nocase, int *reqlength); |
| MODULE_SCOPE int TclStringMatch(const char *str, int strLen, |
| const char *pattern, int ptnLen, int flags); |
| MODULE_SCOPE int TclStringMatchObj(Tcl_Obj *stringObj, |
| Tcl_Obj *patternObj, int flags); |
| MODULE_SCOPE Tcl_Obj * TclStringReverse(Tcl_Obj *objPtr); |
| MODULE_SCOPE void TclSubstCompile(Tcl_Interp *interp, const char *bytes, |
| int numBytes, int flags, int line, |
| struct CompileEnv *envPtr); |
| MODULE_SCOPE int TclSubstOptions(Tcl_Interp *interp, int numOpts, |
| Tcl_Obj *const opts[], int *flagPtr); |
| MODULE_SCOPE void TclSubstParse(Tcl_Interp *interp, const char *bytes, |
| int numBytes, int flags, Tcl_Parse *parsePtr, |
| Tcl_InterpState *statePtr); |
| MODULE_SCOPE int TclSubstTokens(Tcl_Interp *interp, Tcl_Token *tokenPtr, |
| int count, int *tokensLeftPtr, int line, |
| int *clNextOuter, const char *outerScript); |
| MODULE_SCOPE int TclTrim(const char *bytes, int numBytes, |
| const char *trim, int numTrim, int *trimRight); |
| MODULE_SCOPE int TclTrimLeft(const char *bytes, int numBytes, |
| const char *trim, int numTrim); |
| MODULE_SCOPE int TclTrimRight(const char *bytes, int numBytes, |
| const char *trim, int numTrim); |
| MODULE_SCOPE int TclUtfCasecmp(const char *cs, const char *ct); |
| MODULE_SCOPE int TclUtfToUCS4(const char *, int *); |
| MODULE_SCOPE int TclUCS4ToUtf(int, char *); |
| MODULE_SCOPE int TclUCS4ToLower(int ch); |
| #if TCL_UTF_MAX == 4 |
| MODULE_SCOPE int TclGetUCS4(Tcl_Obj *, int); |
| MODULE_SCOPE int TclUniCharToUCS4(const Tcl_UniChar *, int *); |
| #else |
| # define TclGetUCS4 Tcl_GetUniChar |
| # define TclUniCharToUCS4(src, ptr) (*ptr = *(src),1) |
| #endif |
|
|
| |
| |
| |
| |
| |
| # define TclUCS4Complete(src, length) (((unsigned)(UCHAR(*(src)) - 0xF0) < 5) \ |
| ? ((length) >= 4) : (UCHAR(*(src)) == 0xED) ? ((length) >= 6) : Tcl_UtfCharComplete((src), (length))) |
| MODULE_SCOPE Tcl_Obj * TclpNativeToNormalized(ClientData clientData); |
| MODULE_SCOPE Tcl_Obj * TclpFilesystemPathType(Tcl_Obj *pathPtr); |
| MODULE_SCOPE int TclpDlopen(Tcl_Interp *interp, Tcl_Obj *pathPtr, |
| Tcl_LoadHandle *loadHandle, |
| Tcl_FSUnloadFileProc **unloadProcPtr, int flags); |
| MODULE_SCOPE int TclpUtime(Tcl_Obj *pathPtr, struct utimbuf *tval); |
| #ifdef TCL_LOAD_FROM_MEMORY |
| MODULE_SCOPE void * TclpLoadMemoryGetBuffer(Tcl_Interp *interp, int size); |
| MODULE_SCOPE int TclpLoadMemory(Tcl_Interp *interp, void *buffer, |
| int size, int codeSize, Tcl_LoadHandle *loadHandle, |
| Tcl_FSUnloadFileProc **unloadProcPtr, int flags); |
| #endif |
| MODULE_SCOPE void TclInitThreadStorage(void); |
| MODULE_SCOPE void TclFinalizeThreadDataThread(void); |
| MODULE_SCOPE void TclFinalizeThreadStorage(void); |
|
|
| |
| #if (!defined(_WIN32) || !defined(_MSC_VER) || (_MSC_VER >= 1400)) |
| # define TclWideMUInt Tcl_WideUInt |
| #else |
| |
| # define TclWideMUInt Tcl_WideInt |
| #endif |
| #ifdef TCL_WIDE_CLICKS |
| MODULE_SCOPE Tcl_WideInt TclpGetWideClicks(void); |
| MODULE_SCOPE double TclpWideClicksToNanoseconds(Tcl_WideInt clicks); |
| MODULE_SCOPE double TclpWideClickInMicrosec(void); |
| #else |
| # ifdef _WIN32 |
| # define TCL_WIDE_CLICKS 1 |
| MODULE_SCOPE Tcl_WideInt TclpGetWideClicks(void); |
| MODULE_SCOPE double TclpWideClickInMicrosec(void); |
| # define TclpWideClicksToNanoseconds(clicks) \ |
| ((double)(clicks) * TclpWideClickInMicrosec() * 1000) |
| # endif |
| #endif |
| MODULE_SCOPE Tcl_WideInt TclpGetMicroseconds(void); |
|
|
| MODULE_SCOPE int TclZlibInit(Tcl_Interp *interp); |
| MODULE_SCOPE void * TclpThreadCreateKey(void); |
| MODULE_SCOPE void TclpThreadDeleteKey(void *keyPtr); |
| MODULE_SCOPE void TclpThreadSetGlobalTSD(void *tsdKeyPtr, void *ptr); |
| MODULE_SCOPE void * TclpThreadGetGlobalTSD(void *tsdKeyPtr); |
| MODULE_SCOPE void TclErrorStackResetIf(Tcl_Interp *interp, |
| const char *msg, int length); |
|
|
| |
| |
| |
| |
| |
|
|
| MODULE_SCOPE int TclIsSpaceProc(int byte); |
| # define TclIsSpaceProcM(byte) \ |
| (((byte) > 0x20) ? 0 : TclIsSpaceProc(byte)) |
|
|
| |
| |
| |
| |
| |
|
|
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_AfterObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_AppendObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_ApplyObjCmd; |
| MODULE_SCOPE Tcl_Command TclInitArrayCmd(Tcl_Interp *interp); |
| MODULE_SCOPE Tcl_Command TclInitBinaryCmd(Tcl_Interp *interp); |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_BreakObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_CaseObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_CatchObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_CdObjCmd; |
| MODULE_SCOPE Tcl_Command TclInitChanCmd(Tcl_Interp *interp); |
| MODULE_SCOPE Tcl_ObjCmdProc TclChanCreateObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclChanPostEventObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclChanPopObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclChanPushObjCmd; |
| MODULE_SCOPE void TclClockInit(Tcl_Interp *interp); |
| MODULE_SCOPE Tcl_ObjCmdProc TclClockOldscanObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_CloseObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_ConcatObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_ContinueObjCmd; |
| MODULE_SCOPE Tcl_TimerToken TclCreateAbsoluteTimerHandler( |
| Tcl_Time *timePtr, Tcl_TimerProc *proc, |
| ClientData clientData); |
| MODULE_SCOPE Tcl_ObjCmdProc TclDefaultBgErrorHandlerObjCmd; |
| MODULE_SCOPE Tcl_Command TclInitDictCmd(Tcl_Interp *interp); |
| MODULE_SCOPE int TclDictWithFinish(Tcl_Interp *interp, Var *varPtr, |
| Var *arrayPtr, Tcl_Obj *part1Ptr, |
| Tcl_Obj *part2Ptr, int index, int pathc, |
| Tcl_Obj *const pathv[], Tcl_Obj *keysPtr); |
| MODULE_SCOPE Tcl_Obj * TclDictWithInit(Tcl_Interp *interp, Tcl_Obj *dictPtr, |
| int pathc, Tcl_Obj *const pathv[]); |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_DisassembleObjCmd; |
|
|
| |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_AssembleObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclNRAssembleObjCmd; |
| MODULE_SCOPE Tcl_Command TclInitEncodingCmd(Tcl_Interp *interp); |
| MODULE_SCOPE int TclMakeEncodingCommandSafe(Tcl_Interp *interp); |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_EofObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_ErrorObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_EvalObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_ExecObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_ExitObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_ExprObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_FblockedObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_FconfigureObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_FcopyObjCmd; |
| MODULE_SCOPE Tcl_Command TclInitFileCmd(Tcl_Interp *interp); |
| MODULE_SCOPE int TclMakeFileCommandSafe(Tcl_Interp *interp); |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_FileEventObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_FlushObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_ForObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_ForeachObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_FormatObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_GetsObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_GlobalObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_GlobObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_IfObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_IncrObjCmd; |
| MODULE_SCOPE Tcl_Command TclInitInfoCmd(Tcl_Interp *interp); |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_InterpObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_JoinObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_LappendObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_LassignObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_LindexObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_LinsertObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_LlengthObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_ListObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_LmapObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_LoadObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_LrangeObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_LrepeatObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_LreplaceObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_LreverseObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_LsearchObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_LsetObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_LsortObjCmd; |
| MODULE_SCOPE Tcl_Command TclInitNamespaceCmd(Tcl_Interp *interp); |
| MODULE_SCOPE Tcl_ObjCmdProc TclNamespaceEnsembleCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_OpenObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_PackageObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_PidObjCmd; |
| MODULE_SCOPE Tcl_Command TclInitPrefixCmd(Tcl_Interp *interp); |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_PutsObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_PwdObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_ReadObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_RegexpObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_RegsubObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_RenameObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_RepresentationCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_ReturnObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_ScanObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_SeekObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_SetObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_SplitObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_SocketObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_SourceObjCmd; |
| MODULE_SCOPE Tcl_Command TclInitStringCmd(Tcl_Interp *interp); |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_SubstObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_SwitchObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_TellObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_ThrowObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_TimeObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_TimeRateObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_TraceObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_TryObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_UnloadObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_UnsetObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_UpdateObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_UplevelObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_UpvarObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_VariableObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_VwaitObjCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc Tcl_WhileObjCmd; |
|
|
| |
| |
| |
| |
| |
|
|
| MODULE_SCOPE CompileProc TclCompileAppendCmd; |
| MODULE_SCOPE CompileProc TclCompileArrayExistsCmd; |
| MODULE_SCOPE CompileProc TclCompileArraySetCmd; |
| MODULE_SCOPE CompileProc TclCompileArrayUnsetCmd; |
| MODULE_SCOPE CompileProc TclCompileBreakCmd; |
| MODULE_SCOPE CompileProc TclCompileCatchCmd; |
| MODULE_SCOPE CompileProc TclCompileClockClicksCmd; |
| MODULE_SCOPE CompileProc TclCompileClockReadingCmd; |
| MODULE_SCOPE CompileProc TclCompileConcatCmd; |
| MODULE_SCOPE CompileProc TclCompileContinueCmd; |
| MODULE_SCOPE CompileProc TclCompileDictAppendCmd; |
| MODULE_SCOPE CompileProc TclCompileDictCreateCmd; |
| MODULE_SCOPE CompileProc TclCompileDictExistsCmd; |
| MODULE_SCOPE CompileProc TclCompileDictForCmd; |
| MODULE_SCOPE CompileProc TclCompileDictGetCmd; |
| MODULE_SCOPE CompileProc TclCompileDictIncrCmd; |
| MODULE_SCOPE CompileProc TclCompileDictLappendCmd; |
| MODULE_SCOPE CompileProc TclCompileDictMapCmd; |
| MODULE_SCOPE CompileProc TclCompileDictMergeCmd; |
| MODULE_SCOPE CompileProc TclCompileDictSetCmd; |
| MODULE_SCOPE CompileProc TclCompileDictUnsetCmd; |
| MODULE_SCOPE CompileProc TclCompileDictUpdateCmd; |
| MODULE_SCOPE CompileProc TclCompileDictWithCmd; |
| MODULE_SCOPE CompileProc TclCompileEnsemble; |
| MODULE_SCOPE CompileProc TclCompileErrorCmd; |
| MODULE_SCOPE CompileProc TclCompileExprCmd; |
| MODULE_SCOPE CompileProc TclCompileForCmd; |
| MODULE_SCOPE CompileProc TclCompileForeachCmd; |
| MODULE_SCOPE CompileProc TclCompileFormatCmd; |
| MODULE_SCOPE CompileProc TclCompileGlobalCmd; |
| MODULE_SCOPE CompileProc TclCompileIfCmd; |
| MODULE_SCOPE CompileProc TclCompileInfoCommandsCmd; |
| MODULE_SCOPE CompileProc TclCompileInfoCoroutineCmd; |
| MODULE_SCOPE CompileProc TclCompileInfoExistsCmd; |
| MODULE_SCOPE CompileProc TclCompileInfoLevelCmd; |
| MODULE_SCOPE CompileProc TclCompileInfoObjectClassCmd; |
| MODULE_SCOPE CompileProc TclCompileInfoObjectIsACmd; |
| MODULE_SCOPE CompileProc TclCompileInfoObjectNamespaceCmd; |
| MODULE_SCOPE CompileProc TclCompileIncrCmd; |
| MODULE_SCOPE CompileProc TclCompileLappendCmd; |
| MODULE_SCOPE CompileProc TclCompileLassignCmd; |
| MODULE_SCOPE CompileProc TclCompileLindexCmd; |
| MODULE_SCOPE CompileProc TclCompileLinsertCmd; |
| MODULE_SCOPE CompileProc TclCompileListCmd; |
| MODULE_SCOPE CompileProc TclCompileLlengthCmd; |
| MODULE_SCOPE CompileProc TclCompileLmapCmd; |
| MODULE_SCOPE CompileProc TclCompileLrangeCmd; |
| MODULE_SCOPE CompileProc TclCompileLreplaceCmd; |
| MODULE_SCOPE CompileProc TclCompileLsetCmd; |
| MODULE_SCOPE CompileProc TclCompileNamespaceCodeCmd; |
| MODULE_SCOPE CompileProc TclCompileNamespaceCurrentCmd; |
| MODULE_SCOPE CompileProc TclCompileNamespaceOriginCmd; |
| MODULE_SCOPE CompileProc TclCompileNamespaceQualifiersCmd; |
| MODULE_SCOPE CompileProc TclCompileNamespaceTailCmd; |
| MODULE_SCOPE CompileProc TclCompileNamespaceUpvarCmd; |
| MODULE_SCOPE CompileProc TclCompileNamespaceWhichCmd; |
| MODULE_SCOPE CompileProc TclCompileNoOp; |
| MODULE_SCOPE CompileProc TclCompileObjectNextCmd; |
| MODULE_SCOPE CompileProc TclCompileObjectNextToCmd; |
| MODULE_SCOPE CompileProc TclCompileObjectSelfCmd; |
| MODULE_SCOPE CompileProc TclCompileRegexpCmd; |
| MODULE_SCOPE CompileProc TclCompileRegsubCmd; |
| MODULE_SCOPE CompileProc TclCompileReturnCmd; |
| MODULE_SCOPE CompileProc TclCompileSetCmd; |
| MODULE_SCOPE CompileProc TclCompileStringCatCmd; |
| MODULE_SCOPE CompileProc TclCompileStringCmpCmd; |
| MODULE_SCOPE CompileProc TclCompileStringEqualCmd; |
| MODULE_SCOPE CompileProc TclCompileStringFirstCmd; |
| MODULE_SCOPE CompileProc TclCompileStringIndexCmd; |
| MODULE_SCOPE CompileProc TclCompileStringIsCmd; |
| MODULE_SCOPE CompileProc TclCompileStringLastCmd; |
| MODULE_SCOPE CompileProc TclCompileStringLenCmd; |
| MODULE_SCOPE CompileProc TclCompileStringMapCmd; |
| MODULE_SCOPE CompileProc TclCompileStringMatchCmd; |
| MODULE_SCOPE CompileProc TclCompileStringRangeCmd; |
| MODULE_SCOPE CompileProc TclCompileStringReplaceCmd; |
| MODULE_SCOPE CompileProc TclCompileStringToLowerCmd; |
| MODULE_SCOPE CompileProc TclCompileStringToTitleCmd; |
| MODULE_SCOPE CompileProc TclCompileStringToUpperCmd; |
| MODULE_SCOPE CompileProc TclCompileStringTrimCmd; |
| MODULE_SCOPE CompileProc TclCompileStringTrimLCmd; |
| MODULE_SCOPE CompileProc TclCompileStringTrimRCmd; |
| MODULE_SCOPE CompileProc TclCompileSubstCmd; |
| MODULE_SCOPE CompileProc TclCompileSwitchCmd; |
| MODULE_SCOPE CompileProc TclCompileTailcallCmd; |
| MODULE_SCOPE CompileProc TclCompileThrowCmd; |
| MODULE_SCOPE CompileProc TclCompileTryCmd; |
| MODULE_SCOPE CompileProc TclCompileUnsetCmd; |
| MODULE_SCOPE CompileProc TclCompileUpvarCmd; |
| MODULE_SCOPE CompileProc TclCompileVariableCmd; |
| MODULE_SCOPE CompileProc TclCompileWhileCmd; |
| MODULE_SCOPE CompileProc TclCompileYieldCmd; |
| MODULE_SCOPE CompileProc TclCompileYieldToCmd; |
| MODULE_SCOPE CompileProc TclCompileBasic0ArgCmd; |
| MODULE_SCOPE CompileProc TclCompileBasic1ArgCmd; |
| MODULE_SCOPE CompileProc TclCompileBasic2ArgCmd; |
| MODULE_SCOPE CompileProc TclCompileBasic3ArgCmd; |
| MODULE_SCOPE CompileProc TclCompileBasic0Or1ArgCmd; |
| MODULE_SCOPE CompileProc TclCompileBasic1Or2ArgCmd; |
| MODULE_SCOPE CompileProc TclCompileBasic2Or3ArgCmd; |
| MODULE_SCOPE CompileProc TclCompileBasic0To2ArgCmd; |
| MODULE_SCOPE CompileProc TclCompileBasic1To3ArgCmd; |
| MODULE_SCOPE CompileProc TclCompileBasicMin0ArgCmd; |
| MODULE_SCOPE CompileProc TclCompileBasicMin1ArgCmd; |
| MODULE_SCOPE CompileProc TclCompileBasicMin2ArgCmd; |
|
|
| MODULE_SCOPE Tcl_ObjCmdProc TclInvertOpCmd; |
| MODULE_SCOPE CompileProc TclCompileInvertOpCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclNotOpCmd; |
| MODULE_SCOPE CompileProc TclCompileNotOpCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclAddOpCmd; |
| MODULE_SCOPE CompileProc TclCompileAddOpCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclMulOpCmd; |
| MODULE_SCOPE CompileProc TclCompileMulOpCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclAndOpCmd; |
| MODULE_SCOPE CompileProc TclCompileAndOpCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclOrOpCmd; |
| MODULE_SCOPE CompileProc TclCompileOrOpCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclXorOpCmd; |
| MODULE_SCOPE CompileProc TclCompileXorOpCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclPowOpCmd; |
| MODULE_SCOPE CompileProc TclCompilePowOpCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclLshiftOpCmd; |
| MODULE_SCOPE CompileProc TclCompileLshiftOpCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclRshiftOpCmd; |
| MODULE_SCOPE CompileProc TclCompileRshiftOpCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclModOpCmd; |
| MODULE_SCOPE CompileProc TclCompileModOpCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclNeqOpCmd; |
| MODULE_SCOPE CompileProc TclCompileNeqOpCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclStrneqOpCmd; |
| MODULE_SCOPE CompileProc TclCompileStrneqOpCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclInOpCmd; |
| MODULE_SCOPE CompileProc TclCompileInOpCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclNiOpCmd; |
| MODULE_SCOPE CompileProc TclCompileNiOpCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclMinusOpCmd; |
| MODULE_SCOPE CompileProc TclCompileMinusOpCmd; |
| MODULE_SCOPE Tcl_ObjCmdProc TclDivOpCmd; |
| MODULE_SCOPE CompileProc TclCompileDivOpCmd; |
| MODULE_SCOPE CompileProc TclCompileLessOpCmd; |
| MODULE_SCOPE CompileProc TclCompileLeqOpCmd; |
| MODULE_SCOPE CompileProc TclCompileGreaterOpCmd; |
| MODULE_SCOPE CompileProc TclCompileGeqOpCmd; |
| MODULE_SCOPE CompileProc TclCompileEqOpCmd; |
| MODULE_SCOPE CompileProc TclCompileStreqOpCmd; |
|
|
| MODULE_SCOPE CompileProc TclCompileAssembleCmd; |
|
|
| |
| |
| |
| |
| |
|
|
| MODULE_SCOPE Var * TclObjLookupVarEx(Tcl_Interp * interp, |
| Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, int flags, |
| const char *msg, int createPart1, |
| int createPart2, Var **arrayPtrPtr); |
| MODULE_SCOPE Var * TclLookupArrayElement(Tcl_Interp *interp, |
| Tcl_Obj *arrayNamePtr, Tcl_Obj *elNamePtr, |
| int flags, const char *msg, |
| int createPart1, int createPart2, |
| Var *arrayPtr, int index); |
| MODULE_SCOPE Tcl_Obj * TclPtrGetVarIdx(Tcl_Interp *interp, |
| Var *varPtr, Var *arrayPtr, Tcl_Obj *part1Ptr, |
| Tcl_Obj *part2Ptr, int flags, int index); |
| MODULE_SCOPE Tcl_Obj * TclPtrSetVarIdx(Tcl_Interp *interp, |
| Var *varPtr, Var *arrayPtr, Tcl_Obj *part1Ptr, |
| Tcl_Obj *part2Ptr, Tcl_Obj *newValuePtr, |
| int flags, int index); |
| MODULE_SCOPE Tcl_Obj * TclPtrIncrObjVarIdx(Tcl_Interp *interp, |
| Var *varPtr, Var *arrayPtr, Tcl_Obj *part1Ptr, |
| Tcl_Obj *part2Ptr, Tcl_Obj *incrPtr, |
| int flags, int index); |
| MODULE_SCOPE int TclPtrObjMakeUpvarIdx(Tcl_Interp *interp, |
| Var *otherPtr, Tcl_Obj *myNamePtr, int myFlags, |
| int index); |
| MODULE_SCOPE int TclPtrUnsetVarIdx(Tcl_Interp *interp, Var *varPtr, |
| Var *arrayPtr, Tcl_Obj *part1Ptr, |
| Tcl_Obj *part2Ptr, int flags, |
| int index); |
| MODULE_SCOPE void TclInvalidateNsPath(Namespace *nsPtr); |
| MODULE_SCOPE void TclFindArrayPtrElements(Var *arrayPtr, |
| Tcl_HashTable *tablePtr); |
|
|
| |
| |
| |
|
|
| MODULE_SCOPE int TclObjCallVarTraces(Interp *iPtr, Var *arrayPtr, |
| Var *varPtr, Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, |
| int flags, int leaveErrMsg, int index); |
|
|
| |
| |
| |
|
|
| MODULE_SCOPE int TclCompareObjKeys(void *keyPtr, Tcl_HashEntry *hPtr); |
| MODULE_SCOPE void TclFreeObjEntry(Tcl_HashEntry *hPtr); |
| MODULE_SCOPE unsigned TclHashObjKey(Tcl_HashTable *tablePtr, void *keyPtr); |
|
|
| MODULE_SCOPE int TclFullFinalizationRequested(void); |
|
|
| |
| |
| |
| |
|
|
| MODULE_SCOPE int TclIndexEncode(Tcl_Interp *interp, Tcl_Obj *objPtr, |
| int before, int after, int *indexPtr); |
| MODULE_SCOPE int TclIndexDecode(int encoded, int endValue); |
|
|
| MODULE_SCOPE void TclBN_s_mp_reverse(unsigned char *s, size_t len); |
|
|
| |
| #define TCL_INDEX_END (-2) |
| #define TCL_INDEX_BEFORE (-1) |
| #define TCL_INDEX_START (0) |
| #define TCL_INDEX_AFTER (INT_MAX) |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| |
| |
| |
|
|
| #ifdef USE_DTRACE |
| #ifndef _TCLDTRACE_H |
| #include "tclDTrace.h" |
| #endif |
| #define TCL_DTRACE_OBJ_CREATE(objPtr) TCL_OBJ_CREATE(objPtr) |
| #define TCL_DTRACE_OBJ_FREE(objPtr) TCL_OBJ_FREE(objPtr) |
| #else |
| #define TCL_DTRACE_OBJ_CREATE(objPtr) {} |
| #define TCL_DTRACE_OBJ_FREE(objPtr) {} |
| #endif |
|
|
| #ifdef TCL_COMPILE_STATS |
| # define TclIncrObjsAllocated() \ |
| tclObjsAlloced++ |
| # define TclIncrObjsFreed() \ |
| tclObjsFreed++ |
| #else |
| # define TclIncrObjsAllocated() |
| # define TclIncrObjsFreed() |
| #endif |
|
|
| # define TclAllocObjStorage(objPtr) \ |
| TclAllocObjStorageEx(NULL, (objPtr)) |
|
|
| # define TclFreeObjStorage(objPtr) \ |
| TclFreeObjStorageEx(NULL, (objPtr)) |
|
|
| #ifndef TCL_MEM_DEBUG |
| # define TclNewObj(objPtr) \ |
| TclIncrObjsAllocated(); \ |
| TclAllocObjStorage(objPtr); \ |
| (objPtr)->refCount = 0; \ |
| (objPtr)->bytes = tclEmptyStringRep; \ |
| (objPtr)->length = 0; \ |
| (objPtr)->typePtr = NULL; \ |
| TCL_DTRACE_OBJ_CREATE(objPtr) |
|
|
| |
| |
| |
| |
| |
| |
|
|
| # define TclDecrRefCount(objPtr) \ |
| if ((objPtr)->refCount-- > 1) ; else { \ |
| if (!(objPtr)->typePtr || !(objPtr)->typePtr->freeIntRepProc) { \ |
| TCL_DTRACE_OBJ_FREE(objPtr); \ |
| if ((objPtr)->bytes \ |
| && ((objPtr)->bytes != tclEmptyStringRep)) { \ |
| ckfree((char *)(objPtr)->bytes); \ |
| } \ |
| (objPtr)->length = -1; \ |
| TclFreeObjStorage(objPtr); \ |
| TclIncrObjsFreed(); \ |
| } else { \ |
| TclFreeObj(objPtr); \ |
| } \ |
| } |
|
|
| #if defined(PURIFY) |
|
|
| |
| |
| |
| |
| |
| |
|
|
| # define TclAllocObjStorageEx(interp, objPtr) \ |
| (objPtr) = (Tcl_Obj *)ckalloc(sizeof(Tcl_Obj)) |
|
|
| # define TclFreeObjStorageEx(interp, objPtr) \ |
| ckfree((char *)(objPtr)) |
|
|
| #undef USE_THREAD_ALLOC |
| #undef USE_TCLALLOC |
| #elif defined(TCL_THREADS) && defined(USE_THREAD_ALLOC) |
|
|
| |
| |
| |
| |
|
|
| MODULE_SCOPE Tcl_Obj * TclThreadAllocObj(void); |
| MODULE_SCOPE void TclThreadFreeObj(Tcl_Obj *); |
| MODULE_SCOPE Tcl_Mutex *TclpNewAllocMutex(void); |
| MODULE_SCOPE void TclFreeAllocCache(void *); |
| MODULE_SCOPE void * TclpGetAllocCache(void); |
| MODULE_SCOPE void TclpSetAllocCache(void *); |
| MODULE_SCOPE void TclpFreeAllocMutex(Tcl_Mutex *mutex); |
| MODULE_SCOPE void TclpFreeAllocCache(void *); |
|
|
| |
| |
| |
| |
| |
| |
| |
|
|
| # define ALLOC_NOBJHIGH 1200 |
|
|
| # define TclAllocObjStorageEx(interp, objPtr) \ |
| do { \ |
| AllocCache *cachePtr; \ |
| if (((interp) == NULL) || \ |
| ((cachePtr = ((Interp *)(interp))->allocCache), \ |
| (cachePtr->numObjects == 0))) { \ |
| (objPtr) = TclThreadAllocObj(); \ |
| } else { \ |
| (objPtr) = cachePtr->firstObjPtr; \ |
| cachePtr->firstObjPtr = (Tcl_Obj *)(objPtr)->internalRep.twoPtrValue.ptr1; \ |
| --cachePtr->numObjects; \ |
| } \ |
| } while (0) |
|
|
| # define TclFreeObjStorageEx(interp, objPtr) \ |
| do { \ |
| AllocCache *cachePtr; \ |
| if (((interp) == NULL) || \ |
| ((cachePtr = ((Interp *)(interp))->allocCache), \ |
| ((cachePtr->numObjects == 0) || \ |
| (cachePtr->numObjects >= ALLOC_NOBJHIGH)))) { \ |
| TclThreadFreeObj(objPtr); \ |
| } else { \ |
| (objPtr)->internalRep.twoPtrValue.ptr1 = cachePtr->firstObjPtr; \ |
| cachePtr->firstObjPtr = objPtr; \ |
| ++cachePtr->numObjects; \ |
| } \ |
| } while (0) |
|
|
| #else |
|
|
| #if defined(USE_TCLALLOC) && USE_TCLALLOC |
| MODULE_SCOPE void TclFinalizeAllocSubsystem(); |
| MODULE_SCOPE void TclInitAlloc(); |
| #else |
| # define USE_TCLALLOC 0 |
| #endif |
|
|
| #ifdef TCL_THREADS |
| |
| MODULE_SCOPE Tcl_Mutex tclObjMutex; |
| #endif |
|
|
| # define TclAllocObjStorageEx(interp, objPtr) \ |
| do { \ |
| Tcl_MutexLock(&tclObjMutex); \ |
| if (tclFreeObjList == NULL) { \ |
| TclAllocateFreeObjects(); \ |
| } \ |
| (objPtr) = tclFreeObjList; \ |
| tclFreeObjList = (Tcl_Obj *) \ |
| tclFreeObjList->internalRep.twoPtrValue.ptr1; \ |
| Tcl_MutexUnlock(&tclObjMutex); \ |
| } while (0) |
|
|
| # define TclFreeObjStorageEx(interp, objPtr) \ |
| do { \ |
| Tcl_MutexLock(&tclObjMutex); \ |
| (objPtr)->internalRep.twoPtrValue.ptr1 = (void *) tclFreeObjList; \ |
| tclFreeObjList = (objPtr); \ |
| Tcl_MutexUnlock(&tclObjMutex); \ |
| } while (0) |
| #endif |
|
|
| #else |
| MODULE_SCOPE void TclDbInitNewObj(Tcl_Obj *objPtr, const char *file, |
| int line); |
|
|
| # define TclDbNewObj(objPtr, file, line) \ |
| do { \ |
| TclIncrObjsAllocated(); \ |
| (objPtr) = (Tcl_Obj *) \ |
| Tcl_DbCkalloc(sizeof(Tcl_Obj), (file), (line)); \ |
| TclDbInitNewObj((objPtr), (file), (line)); \ |
| TCL_DTRACE_OBJ_CREATE(objPtr); \ |
| } while (0) |
|
|
| # define TclNewObj(objPtr) \ |
| TclDbNewObj(objPtr, __FILE__, __LINE__); |
|
|
| # define TclDecrRefCount(objPtr) \ |
| Tcl_DbDecrRefCount(objPtr, __FILE__, __LINE__) |
|
|
| # define TclNewListObjDirect(objc, objv) \ |
| TclDbNewListObjDirect(objc, objv, __FILE__, __LINE__) |
|
|
| #undef USE_THREAD_ALLOC |
| #endif |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #define TclInitStringRep(objPtr, bytePtr, len) \ |
| if ((len) == 0) { \ |
| (objPtr)->bytes = tclEmptyStringRep; \ |
| (objPtr)->length = 0; \ |
| } else { \ |
| (objPtr)->bytes = (char *) ckalloc((unsigned int)(len) + 1U); \ |
| memcpy((objPtr)->bytes, (bytePtr), (len)); \ |
| (objPtr)->bytes[len] = '\0'; \ |
| (objPtr)->length = (len); \ |
| } |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #define TclGetString(objPtr) \ |
| ((objPtr)->bytes? (objPtr)->bytes : Tcl_GetString(objPtr)) |
|
|
| #define TclGetStringFromObj(objPtr, lenPtr) \ |
| ((objPtr)->bytes \ |
| ? (*(lenPtr) = (objPtr)->length, (objPtr)->bytes) \ |
| : Tcl_GetStringFromObj((objPtr), (lenPtr))) |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #define TclFreeIntRep(objPtr) \ |
| if ((objPtr)->typePtr != NULL) { \ |
| if ((objPtr)->typePtr->freeIntRepProc != NULL) { \ |
| (objPtr)->typePtr->freeIntRepProc(objPtr); \ |
| } \ |
| (objPtr)->typePtr = NULL; \ |
| } |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #define TclInvalidateStringRep(objPtr) \ |
| do { \ |
| Tcl_Obj *_isobjPtr = (Tcl_Obj *)(objPtr); \ |
| if (_isobjPtr->bytes != NULL) { \ |
| if (_isobjPtr->bytes != tclEmptyStringRep) { \ |
| ckfree((char *)_isobjPtr->bytes); \ |
| } \ |
| _isobjPtr->bytes = NULL; \ |
| } \ |
| } while (0) |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #define TclHasStringRep(objPtr) \ |
| ((objPtr)->bytes != NULL) |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| |
| #ifndef TCL_MIN_GROWTH |
| # ifdef TCL_GROWTH_MIN_ALLOC |
| |
| # define TCL_MIN_GROWTH TCL_GROWTH_MIN_ALLOC |
| # else |
| # define TCL_MIN_GROWTH 1024 |
| # endif |
| #endif |
|
|
| |
| #ifndef TCL_MIN_TOKEN_GROWTH |
| #define TCL_MIN_TOKEN_GROWTH TCL_MIN_GROWTH/sizeof(Tcl_Token) |
| #endif |
|
|
| #define TCL_MAX_TOKENS (int)(UINT_MAX / sizeof(Tcl_Token)) |
| #define TclGrowTokenArray(tokenPtr, used, available, append, staticPtr) \ |
| do { \ |
| int _needed = (used) + (append); \ |
| if (_needed > TCL_MAX_TOKENS) { \ |
| Tcl_Panic("max # of tokens for a Tcl parse (%d) exceeded", \ |
| TCL_MAX_TOKENS); \ |
| } \ |
| if (_needed > (available)) { \ |
| int allocated = 2 * _needed; \ |
| Tcl_Token *oldPtr = (tokenPtr); \ |
| Tcl_Token *newPtr; \ |
| if (oldPtr == (staticPtr)) { \ |
| oldPtr = NULL; \ |
| } \ |
| if (allocated > TCL_MAX_TOKENS) { \ |
| allocated = TCL_MAX_TOKENS; \ |
| } \ |
| newPtr = (Tcl_Token *) attemptckrealloc((char *) oldPtr, \ |
| allocated * sizeof(Tcl_Token)); \ |
| if (newPtr == NULL) { \ |
| allocated = _needed + (append) + TCL_MIN_TOKEN_GROWTH; \ |
| if (allocated > TCL_MAX_TOKENS) { \ |
| allocated = TCL_MAX_TOKENS; \ |
| } \ |
| newPtr = (Tcl_Token *) ckrealloc((char *) oldPtr, \ |
| allocated * sizeof(Tcl_Token)); \ |
| } \ |
| (available) = allocated; \ |
| if (oldPtr == NULL) { \ |
| memcpy(newPtr, staticPtr, \ |
| (used) * sizeof(Tcl_Token)); \ |
| } \ |
| (tokenPtr) = newPtr; \ |
| } \ |
| } while (0) |
|
|
| #define TclGrowParseTokenArray(parsePtr, append) \ |
| TclGrowTokenArray((parsePtr)->tokenPtr, (parsePtr)->numTokens, \ |
| (parsePtr)->tokensAvailable, (append), \ |
| (parsePtr)->staticTokens) |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #define TclUtfToUniChar(str, chPtr) \ |
| (((UCHAR(*(str))) < 0x80) ? \ |
| ((*(chPtr) = UCHAR(*(str))), 1) \ |
| : Tcl_UtfToUniChar(str, chPtr)) |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #define TclNumUtfChars(numChars, bytes, numBytes) \ |
| do { \ |
| int _count, _i = (numBytes); \ |
| unsigned char *_str = (unsigned char *) (bytes); \ |
| while (_i && (*_str < 0xC0)) { _i--; _str++; } \ |
| _count = (numBytes) - _i; \ |
| if (_i) { \ |
| _count += Tcl_NumUtfChars((bytes) + _count, _i); \ |
| } \ |
| (numChars) = _count; \ |
| } while (0); |
|
|
| #define TclUtfPrev(src, start) \ |
| (((src) < (start)+2) ? (start) : \ |
| (UCHAR(*((src) - 1))) < 0x80 ? (src)-1 : \ |
| Tcl_UtfPrev(src, start)) |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #define TclIsPureByteArray(objPtr) \ |
| (((objPtr)->typePtr==&tclByteArrayType) && ((objPtr)->bytes==NULL)) |
| #define TclIsPureDict(objPtr) \ |
| (((objPtr)->bytes==NULL) && ((objPtr)->typePtr==&tclDictType)) |
|
|
| #define TclIsPureList(objPtr) \ |
| (((objPtr)->bytes==NULL) && ((objPtr)->typePtr==&tclListType)) |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #if defined(WORDS_BIGENDIAN) && (TCL_UTF_MAX != 4) |
| # define TclUniCharNcmp(cs,ct,n) memcmp((cs),(ct),(n)*sizeof(Tcl_UniChar)) |
| #endif |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #define TclInvalidateNsCmdLookup(nsPtr) \ |
| if ((nsPtr)->numExportPatterns) { \ |
| (nsPtr)->exportLookupEpoch++; \ |
| } \ |
| if ((nsPtr)->commandPathLength) { \ |
| (nsPtr)->cmdRefEpoch++; \ |
| } |
|
|
| |
| |
| |
| |
| |
| |
| |
|
|
| MODULE_SCOPE Tcl_PackageInitProc TclTommath_Init; |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| MODULE_SCOPE Tcl_PackageInitProc TclplatformtestInit; |
| MODULE_SCOPE Tcl_PackageInitProc TclObjTest_Init; |
| MODULE_SCOPE Tcl_PackageInitProc TclThread_Init; |
| MODULE_SCOPE Tcl_PackageInitProc Procbodytest_Init; |
| MODULE_SCOPE Tcl_PackageInitProc Procbodytest_SafeInit; |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #define TclMatchIsTrivial(pattern) \ |
| (strpbrk((pattern), "*[?\\") == NULL) |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #define TclSetLongObj(objPtr, i) \ |
| do { \ |
| TclInvalidateStringRep(objPtr); \ |
| TclFreeIntRep(objPtr); \ |
| (objPtr)->internalRep.longValue = (long)(i); \ |
| (objPtr)->typePtr = &tclIntType; \ |
| } while (0) |
|
|
| #define TclSetIntObj(objPtr, l) \ |
| TclSetLongObj(objPtr, l) |
|
|
| |
| |
| |
| |
| |
| |
|
|
| #define TclSetBooleanObj(objPtr, b) \ |
| TclSetLongObj(objPtr, (b)!=0); |
|
|
| #ifndef TCL_WIDE_INT_IS_LONG |
| #define TclSetWideIntObj(objPtr, w) \ |
| do { \ |
| TclInvalidateStringRep(objPtr); \ |
| TclFreeIntRep(objPtr); \ |
| (objPtr)->internalRep.wideValue = (Tcl_WideInt)(w); \ |
| (objPtr)->typePtr = &tclWideIntType; \ |
| } while (0) |
| #endif |
|
|
| #define TclSetDoubleObj(objPtr, d) \ |
| do { \ |
| TclInvalidateStringRep(objPtr); \ |
| TclFreeIntRep(objPtr); \ |
| (objPtr)->internalRep.doubleValue = (double)(d); \ |
| (objPtr)->typePtr = &tclDoubleType; \ |
| } while (0) |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #ifndef TCL_MEM_DEBUG |
| #define TclNewLongObj(objPtr, i) \ |
| do { \ |
| TclIncrObjsAllocated(); \ |
| TclAllocObjStorage(objPtr); \ |
| (objPtr)->refCount = 0; \ |
| (objPtr)->bytes = NULL; \ |
| (objPtr)->internalRep.longValue = (long)(i); \ |
| (objPtr)->typePtr = &tclIntType; \ |
| TCL_DTRACE_OBJ_CREATE(objPtr); \ |
| } while (0) |
|
|
| #define TclNewIntObj(objPtr, l) \ |
| TclNewLongObj(objPtr, l) |
|
|
| |
| |
| |
| |
| #define TclNewBooleanObj(objPtr, b) \ |
| TclNewLongObj((objPtr), (b)!=0) |
|
|
| #define TclNewDoubleObj(objPtr, d) \ |
| do { \ |
| TclIncrObjsAllocated(); \ |
| TclAllocObjStorage(objPtr); \ |
| (objPtr)->refCount = 0; \ |
| (objPtr)->bytes = NULL; \ |
| (objPtr)->internalRep.doubleValue = (double)(d); \ |
| (objPtr)->typePtr = &tclDoubleType; \ |
| TCL_DTRACE_OBJ_CREATE(objPtr); \ |
| } while (0) |
|
|
| #define TclNewStringObj(objPtr, s, len) \ |
| do { \ |
| TclIncrObjsAllocated(); \ |
| TclAllocObjStorage(objPtr); \ |
| (objPtr)->refCount = 0; \ |
| TclInitStringRep((objPtr), (s), (len)); \ |
| (objPtr)->typePtr = NULL; \ |
| TCL_DTRACE_OBJ_CREATE(objPtr); \ |
| } while (0) |
|
|
| #else |
| #define TclNewIntObj(objPtr, i) \ |
| (objPtr) = Tcl_NewIntObj(i) |
|
|
| #define TclNewLongObj(objPtr, l) \ |
| (objPtr) = Tcl_NewLongObj(l) |
|
|
| #define TclNewBooleanObj(objPtr, b) \ |
| (objPtr) = Tcl_NewBooleanObj(b) |
|
|
| #define TclNewDoubleObj(objPtr, d) \ |
| (objPtr) = Tcl_NewDoubleObj(d) |
|
|
| #define TclNewStringObj(objPtr, s, len) \ |
| (objPtr) = Tcl_NewStringObj((s), (len)) |
| #endif |
|
|
| |
| |
| |
| |
| #define TclNewLiteralStringObj(objPtr, sLiteral) \ |
| TclNewStringObj((objPtr), (sLiteral), sizeof(sLiteral "") - 1) |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #define TclDStringAppendLiteral(dsPtr, sLiteral) \ |
| Tcl_DStringAppend((dsPtr), (sLiteral), sizeof(sLiteral "") - 1) |
| #define TclDStringClear(dsPtr) \ |
| Tcl_DStringSetLength((dsPtr), 0) |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #ifdef _MSC_VER |
| # define TclIsInfinite(d) (!(_finite((d)))) |
| # define TclIsNaN(d) (_isnan((d))) |
| #else |
| # define TclIsInfinite(d) ((d) > DBL_MAX || (d) < -DBL_MAX) |
| # ifdef NO_ISNAN |
| # define TclIsNaN(d) ((d) != (d)) |
| # else |
| # define TclIsNaN(d) (isnan(d)) |
| # endif |
| #endif |
|
|
| |
| |
| |
| |
| |
|
|
| #ifdef offsetof |
| #define TclOffset(type, field) ((int) offsetof(type, field)) |
| #else |
| #define TclOffset(type, field) ((int) ((char *) &((type *) 0)->field)) |
| #endif |
|
|
| |
| |
| |
| |
|
|
| #define TclGetCurrentNamespace(interp) \ |
| (Tcl_Namespace *) ((Interp *)(interp))->varFramePtr->nsPtr |
|
|
| #define TclGetGlobalNamespace(interp) \ |
| (Tcl_Namespace *) ((Interp *)(interp))->globalNsPtr |
|
|
| |
| |
| |
| |
| |
|
|
| #define TclCleanupCommandMacro(cmdPtr) \ |
| do { \ |
| if ((cmdPtr)->refCount-- <= 1) { \ |
| ckfree(cmdPtr); \ |
| } \ |
| } while (0) |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #define TclLimitExceeded(limit) ((limit).exceeded != 0) |
|
|
| #define TclLimitReady(limit) \ |
| (((limit).active == 0) ? 0 : \ |
| (++(limit).granularityTicker, \ |
| ((((limit).active & TCL_LIMIT_COMMANDS) && \ |
| (((limit).cmdGranularity == 1) || \ |
| ((limit).granularityTicker % (limit).cmdGranularity == 0))) \ |
| ? 1 : \ |
| (((limit).active & TCL_LIMIT_TIME) && \ |
| (((limit).timeGranularity == 1) || \ |
| ((limit).granularityTicker % (limit).timeGranularity == 0)))\ |
| ? 1 : 0))) |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #define TCL_CT_ASSERT(e) \ |
| {enum { ct_assert_value = 1/(!!(e)) };} |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #define TclSmallAlloc(nbytes, memPtr) \ |
| TclSmallAllocEx(NULL, (nbytes), (memPtr)) |
|
|
| #define TclSmallFree(memPtr) \ |
| TclSmallFreeEx(NULL, (memPtr)) |
|
|
| #ifndef TCL_MEM_DEBUG |
| #define TclSmallAllocEx(interp, nbytes, memPtr) \ |
| do { \ |
| Tcl_Obj *_objPtr; \ |
| TCL_CT_ASSERT((nbytes)<=sizeof(Tcl_Obj)); \ |
| TclIncrObjsAllocated(); \ |
| TclAllocObjStorageEx((interp), (_objPtr)); \ |
| *(void **)&(memPtr) = (void *) (_objPtr); \ |
| } while (0) |
|
|
| #define TclSmallFreeEx(interp, memPtr) \ |
| do { \ |
| TclFreeObjStorageEx((interp), (Tcl_Obj *)(memPtr)); \ |
| TclIncrObjsFreed(); \ |
| } while (0) |
|
|
| #else |
| #define TclSmallAllocEx(interp, nbytes, memPtr) \ |
| do { \ |
| Tcl_Obj *_objPtr; \ |
| TCL_CT_ASSERT((nbytes)<=sizeof(Tcl_Obj)); \ |
| TclNewObj(_objPtr); \ |
| *(void **)&(memPtr) = (void *)_objPtr; \ |
| } while (0) |
|
|
| #define TclSmallFreeEx(interp, memPtr) \ |
| do { \ |
| Tcl_Obj *_objPtr = (Tcl_Obj *)(memPtr); \ |
| _objPtr->bytes = NULL; \ |
| _objPtr->typePtr = NULL; \ |
| _objPtr->refCount = 1; \ |
| TclDecrRefCount(_objPtr); \ |
| } while (0) |
| #endif |
|
|
| |
| |
| |
|
|
| #if defined(PURIFY) && defined(__clang__) |
| #if __has_feature(attribute_analyzer_noreturn) && \ |
| !defined(Tcl_Panic) && defined(Tcl_Panic_TCL_DECLARED) |
| void Tcl_Panic(const char *, ...) __attribute__((analyzer_noreturn)); |
| #endif |
| #if !defined(CLANG_ASSERT) |
| #include <assert.h> |
| #define CLANG_ASSERT(x) assert(x) |
| #endif |
| #elif !defined(CLANG_ASSERT) |
| #define CLANG_ASSERT(x) |
| #endif |
|
|
| |
| |
| |
| |
| |
|
|
| #define NRE_USE_SMALL_ALLOC 1 |
| #ifndef NRE_ENABLE_ASSERTS |
| #define NRE_ENABLE_ASSERTS 0 |
| #endif |
|
|
| |
| |
| |
| |
| |
|
|
| typedef struct NRE_callback { |
| Tcl_NRPostProc *procPtr; |
| ClientData data[4]; |
| struct NRE_callback *nextPtr; |
| } NRE_callback; |
|
|
| #define TOP_CB(iPtr) (((Interp *)(iPtr))->execEnvPtr->callbackPtr) |
|
|
| |
| |
| |
|
|
| #define TclNRAddCallback(interp,postProcPtr,data0,data1,data2,data3) \ |
| do { \ |
| NRE_callback *_callbackPtr; \ |
| TCLNR_ALLOC((interp), (_callbackPtr)); \ |
| _callbackPtr->procPtr = (postProcPtr); \ |
| _callbackPtr->data[0] = (ClientData)(data0); \ |
| _callbackPtr->data[1] = (ClientData)(data1); \ |
| _callbackPtr->data[2] = (ClientData)(data2); \ |
| _callbackPtr->data[3] = (ClientData)(data3); \ |
| _callbackPtr->nextPtr = TOP_CB(interp); \ |
| TOP_CB(interp) = _callbackPtr; \ |
| } while (0) |
|
|
| #if NRE_USE_SMALL_ALLOC |
| #define TCLNR_ALLOC(interp, ptr) \ |
| TclSmallAllocEx(interp, sizeof(NRE_callback), (ptr)) |
| #define TCLNR_FREE(interp, ptr) TclSmallFreeEx((interp), (ptr)) |
| #else |
| #define TCLNR_ALLOC(interp, ptr) \ |
| ((ptr) = (void *)ckalloc(sizeof(NRE_callback))) |
| #define TCLNR_FREE(interp, ptr) ckfree((char *) (ptr)) |
| #endif |
|
|
| #if NRE_ENABLE_ASSERTS |
| #define NRE_ASSERT(expr) assert((expr)) |
| #else |
| #define NRE_ASSERT(expr) |
| #endif |
|
|
| #include "tclIntDecls.h" |
| #include "tclIntPlatDecls.h" |
| #include "tclTomMathDecls.h" |
|
|
| #if !defined(USE_TCL_STUBS) && !defined(TCL_MEM_DEBUG) |
| #define Tcl_AttemptAlloc TclpAlloc |
| #define Tcl_AttemptRealloc TclpRealloc |
| #define Tcl_Free TclpFree |
| #endif |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #ifdef MAC_OSX_TCL |
| #define TCL_MAC_EMPTY_FILE(name) \ |
| static __attribute__((used)) const void *const TclUnusedFile_ ## name = NULL; |
| #else |
| #define TCL_MAC_EMPTY_FILE(name) |
| #endif |
|
|
| |
| |
| |
|
|
| MODULE_SCOPE size_t TclEnvEpoch; |
| |
|
|
| #endif |
|
|
| |
| |
| |
| |
| |
| |
| |
|
|