/TCL/src/tcl_h.cs
C# | 2376 lines | 72 code | 218 blank | 2086 comment | 1 complexity | 1a92c9cc60b095241492a1628f13633d MD5 | raw file
Large files files are truncated, but you can click here to view the full file
- namespace tcl.lang
- {
- public partial class TCL
- {
- /*
- * tcl.h --
- *
- * This header file describes the externally-visible facilities
- * of the Tcl interpreter.
- *
- * Copyright (c) 1987-1994 The Regents of the University of California.
- * Copyright (c) 1993-1996 Lucent Technologies.
- * Copyright (c) 1994-1998 Sun Microsystems, Inc.
- * Copyright (c) 1998-2000 by Scriptics Corporation.
- * Copyright (c) 2002 by Kevin B. Kenny. All rights reserved.
- *
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- * Included in SQLite3 port to C# for use in testharness only; 2008 Noah B Hart
- *
- * RCS @(#) $Id: tcl.h,v 1.153.2.34 2008/02/06 15:25:15 dgp Exp $
- */
- #if !_TCL
- //#define _TCL
- /*
- * For C++ compilers, use extern "C"
- */
- #if __cplusplus
- //extern "C" {
- #endif
- /*
- * The following defines are used to indicate the various release levels.
- */
- //#define TCL_ALPHA_RELEASE 0
- //#define TCL_BETA_RELEASE 1
- //#define TCL_FINAL_RELEASE 2
- /*
- * When version numbers change here, must also go into the following files
- * and update the version numbers:
- *
- * library/init.tcl (only if Major.minor changes, not patchlevel) 1 LOC
- * unix/configure.in (2 LOC Major, 2 LOC minor, 1 LOC patch)
- * win/configure.in (as above)
- * win/tcl.m4 (not patchlevel)
- * win/makefile.vc (not patchlevel) 2 LOC
- * README (sections 0 and 2)
- * mac/README (2 LOC, not patchlevel)
- * macosx/Tcl.pbproj/project.pbxproj (not patchlevel) 1 LOC
- * macosx/Tcl.pbproj/default.pbxuser (not patchlevel) 1 LOC
- * win/README.binary (sections 0-4)
- * win/README (not patchlevel) (sections 0 and 2)
- * unix/tcl.spec (2 LOC Major/Minor, 1 LOC patch)
- * tests/basic.test (1 LOC M/M, not patchlevel)
- * tools/tcl.hpj.in (not patchlevel, for windows installer)
- * tools/tcl.wse.in (for windows installer)
- * tools/tclSplash.bmp (not patchlevel)
- */
- //#define TCL_MAJOR_VERSION 8
- //#define TCL_MINOR_VERSION 4
- //#define TCL_RELEASE_LEVEL TCL_FINAL_RELEASE
- //#define TCL_RELEASE_SERIAL 18
- //#define TCL_VERSION "8.4"
- //#define TCL_PATCH_LEVEL "8.4.18"
- /*
- * The following definitions set up the proper options for Windows
- * compilers. We use this method because there is no autoconf equivalent.
- */
- //#if !__WIN32__
- //# if defined(_WIN32) || defined(WIN32) || defined(__MINGW32__) || defined(__BORLANDC__)
- //# define __WIN32__
- //# ifndef WIN32
- //# define WIN32
- //# endif
- //# endif
- //#endif
- /*
- * STRICT: See MSDN Article Q83456
- */
- //#if __WIN32__
- //# ifndef STRICT
- //# define STRICT
- //# endif
- //#endif // * __WIN32__ */
- /*
- * The following definitions set up the proper options for Macintosh
- * compilers. We use this method because there is no autoconf equivalent.
- */
- //#if MAC_TCL
- //#include <ConditionalMacros.h>
- //# ifndef USE_TCLALLOC
- //# define USE_TCLALLOC 1
- //# endif
- //# ifndef NO_STRERROR
- //# define NO_STRERROR 1
- //# endif
- //# define INLINE
- //#endif
- /*
- * Utility macros: STRINGIFY takes an argument and wraps it in "" (double
- * quotation marks), JOIN joins two arguments.
- */
- //#if !STRINGIFY
- //# define STRINGIFY(x) STRINGIFY1(x)
- //# define STRINGIFY1(x) #x
- //#endif
- //#if !JOIN
- //# define JOIN(a,b) JOIN1(a,b)
- //# define JOIN1(a,b) a##b
- //#endif
- /*
- * A special definition used to allow this header file to be included
- * from windows or mac resource files so that they can obtain version
- * information. RC_INVOKED is defined by default by the windows RC tool
- * and manually set for macintosh.
- *
- * Resource compilers don't like all the C stuff, like typedefs and
- * procedure declarations, that occur below, so block them out.
- */
- #if !RC_INVOKED
- /*
- * Special macro to define mutexes, that doesn't do anything
- * if we are not using threads.
- */
- #if TCL_THREADS
- //#define TCL_DECLARE_MUTEX(name) static Tcl_Mutex name;
- #else
- //#define TCL_DECLARE_MUTEX(name)
- #endif
- /*
- * Macros that eliminate the overhead of the thread synchronization
- * functions when compiling without thread support.
- */
- #if !TCL_THREADS
- //#define Tcl_MutexLock(mutexPtr)
- //#define Tcl_MutexUnlock(mutexPtr)
- //#define Tcl_MutexFinalize(mutexPtr)
- //#define Tcl_ConditionNotify(condPtr)
- //#define Tcl_ConditionWait(condPtr, mutexPtr, timePtr)
- //#define Tcl_ConditionFinalize(condPtr)
- #endif // * TCL_THREADS */
- //#if !BUFSIZ
- //# include <stdio.h>
- //#endif
- /*
- * Definitions that allow Tcl functions with variable numbers of
- * arguments to be used with either varargs.h or stdarg.h. TCL_VARARGS
- * is used in procedure prototypes. TCL_VARARGS_DEF is used to declare
- * the arguments in a function definiton: it takes the type and name of
- * the first argument and supplies the appropriate argument declaration
- * string for use in the function definition. TCL_VARARGS_START
- * initializes the va_list data structure and returns the first argument.
- */
- //#if !(NO_STDARG)
- //# include <stdarg.h>
- //# define TCL_VARARGS(type, name) (type name, ...)
- //# define TCL_VARARGS_DEF(type, name) (type name, ...)
- //# define TCL_VARARGS_START(type, name, list) (va_start(list, name), name)
- //#else
- //# include <varargs.h>
- //# define TCL_VARARGS(type, name) ()
- //# define TCL_VARARGS_DEF(type, name) (va_alist)
- //# define TCL_VARARGS_START(type, name, list) \
- // (va_start(list), va_arg(list, type))
- //#endif
- /*
- * Macros used to declare a function to be exported by a DLL.
- * Used by Windows, maps to no-op declarations on non-Windows systems.
- * The default build on windows is for a DLL, which causes the DLLIMPORT
- * and DLLEXPORT macros to be nonempty. To build a static library, the
- * macro STATIC_BUILD should be defined.
- */
- //#if STATIC_BUILD
- //# define DLLIMPORT
- //# define DLLEXPORT
- //#else
- //# if (defined(__WIN32__) && (defined(_MSC_VER) || (__BORLANDC__ >= 0x0550) || (defined(__GNUC__) && defined(__declspec)))) || (defined(MAC_TCL) && FUNCTION_DECLSPEC)
- //# define DLLIMPORT __declspec(dllimport)
- //# define DLLEXPORT __declspec(dllexport)
- //# else
- //# define DLLIMPORT
- //# define DLLEXPORT
- //# endif
- //#endif
- /*
- * These macros are used to control whether functions are being declared for
- * import or export. If a function is being declared while it is being built
- * to be included in a shared library, then it should have the DLLEXPORT
- * storage class. If is being declared for use by a module that is going to
- * link against the shared library, then it should have the DLLIMPORT storage
- * class. If the symbol is beind declared for a static build or for use from a
- * stub library, then the storage class should be empty.
- *
- * The convention is that a macro called BUILD_xxxx, where xxxx is the
- * name of a library we are building, is set on the compile line for sources
- * that are to be placed in the library. When this macro is set, the
- * storage class will be set to DLLEXPORT. At the end of the header file, the
- * storage class will be reset to DLLIMPORT.
- */
- //#undef TCL_STORAGE_CLASS
- //#if BUILD_tcl
- //# define TCL_STORAGE_CLASS DLLEXPORT
- //#else
- //# ifdef USE_TCL_STUBS
- //# define TCL_STORAGE_CLASS
- //# else
- //# define TCL_STORAGE_CLASS DLLIMPORT
- //# endif
- //#endif
- /*
- * Definitions that allow this header file to be used either with or
- * without ANSI C features like function prototypes.
- */
- //#undef _ANSI_ARGS_
- //#undef CONST
- //#if !INLINE
- //# define INLINE
- //#endif
- //#if !NO_CONST
- //# define CONST const
- //#else
- //# define CONST
- //#endif
- //#if !NO_PROTOTYPES
- //# define _ANSI_ARGS_(x) x
- //#else
- //# define _ANSI_ARGS_(x) ()
- //#endif
- //#if USE_NON_CONST
- //# ifdef USE_COMPAT_CONST
- //# error define at most one of USE_NON_CONST and USE_COMPAT_CONST
- //# endif
- //# define CONST84
- //# define CONST84_RETURN
- //#else
- //# ifdef USE_COMPAT_CONST
- //# define CONST84
- //# define CONST84_RETURN CONST
- //# else
- //# define CONST84 CONST
- //# define CONST84_RETURN CONST
- //# endif
- //#endif
- /*
- * Make sure EXTERN isn't defined elsewhere
- */
- //#if EXTERN
- //# undef EXTERN
- //#endif // * EXTERN */
- //#if __cplusplus
- //# define EXTERN extern "C" TCL_STORAGE_CLASS
- //#else
- //# define EXTERN extern TCL_STORAGE_CLASS
- //#endif
- /*
- * The following code is copied from winnt.h.
- * If we don't replicate it here, then <windows.h> can't be included
- * after tcl.h, since tcl.h also defines VOID.
- * This block is skipped under Cygwin and Mingw.
- *
- *
- */
- //#if (__WIN32__) && !HAVE_WINNT_IGNORE_VOID)
- //#if !VOID
- ////#define VOID void
- ////typedef char CHAR;
- ////typedef short SHORT;
- ////typedef long LONG;
- //#endif
- //#endif // * __WIN32__ && !HAVE_WINNT_IGNORE_VOID */
- /*
- * Macro to use instead of "void" for arguments that must have
- * type "void *" in ANSI C; maps them to type "char *" in
- * non-ANSI systems.
- */
- //#if !NO_VOID
- //# define VOID void
- //#else
- //# define VOID char
- //#endif
- ///*
- //* Miscellaneous declarations.
- //*/
- //#if !_CLIENTDATA
- //# ifndef NO_VOID
- //// typedef void *ClientData;
- //# else
- //// typedef int *ClientData;
- //# endif
- //# define _CLIENTDATA
- //#endif
- /*
- * Darwin specifc configure overrides (to support fat compiles, where
- * configure runs only once for multiple architectures):
- */
- //#if __APPLE__
- //# ifdef __LP64__
- //# undef TCL_WIDE_INT_TYPE
- //# define TCL_WIDE_INT_IS_LONG 1
- //# else /* !__LP64__ */
- //# define TCL_WIDE_INT_TYPE long long
- //# undef TCL_WIDE_INT_IS_LONG
- //# endif /* __LP64__ */
- //# undef HAVE_STRUCT_STAT64
- //#endif // * __APPLE__ */
- /*
- * Define Tcl_WideInt to be a type that is (at least) 64-bits wide,
- * and define Tcl_Wideu32 to be the unsigned variant of that type
- * (assuming that where we have one, we can have the other.)
- *
- * Also defines the following macros:
- * TCL_WIDE_INT_IS_LONG - if wide ints are really longs (i.e. we're on
- * a real 64-bit system.)
- * Tcl_WideAsLong - forgetful converter from wideInt to long.
- * Tcl_LongAsWide - sign-extending converter from long to wideInt.
- * Tcl_WideAsDouble - converter from wideInt to double.
- * Tcl_DoubleAsWide - converter from double to wideInt.
- *
- * The following invariant should hold for any long value 'longVal':
- * longVal == TCL.Tcl_WideAsLong(Tcl_LongAsWide(longVal))
- *
- * Note on converting between Tcl_WideInt and strings. This
- * implementation (in tclObj.c) depends on the functions strtoull()
- * and sprintf(...,"%" TCL_LL_MODIFIER "d",...). TCL_LL_MODIFIER_SIZE
- * is the length of the modifier string, which is "ll" on most 32-bit
- * Unix systems. It has to be split up like this to allow for the more
- * complex formats sometimes needed (e.g. in the format(n) command.)
- */
- //#if !(TCL_WIDE_INT_TYPE)&&!TCL_WIDE_INT_IS_LONG)
- //# if defined(__GNUC__)
- //# define TCL_WIDE_INT_TYPE long long
- //# if defined(__WIN32__) && !__CYGWIN__)
- //# define TCL_LL_MODIFIER "I64"
- //# define TCL_LL_MODIFIER_SIZE 3
- //# else
- //# define TCL_LL_MODIFIER "L"
- //# define TCL_LL_MODIFIER_SIZE 1
- //# endif
- ////typedef struct stat Tcl_StatBuf;
- //# elif defined(__WIN32__)
- //# define TCL_WIDE_INT_TYPE __int64
- //# ifdef __BORLANDC__
- ////typedef struct stati64 Tcl_StatBuf;
- //# define TCL_LL_MODIFIER "L"
- //# define TCL_LL_MODIFIER_SIZE 1
- //# else /* __BORLANDC__ */
- //# if _MSC_VER < 1400 || !_M_IX86)
- ////typedef struct _stati64 Tcl_StatBuf;
- //# else
- ////typedef struct _stat64 Tcl_StatBuf;
- //# endif /* _MSC_VER < 1400 */
- //# define TCL_LL_MODIFIER "I64"
- //# define TCL_LL_MODIFIER_SIZE 3
- //# endif /* __BORLANDC__ */
- //# else /* __WIN32__ */
- ///*
- //* Don't know what platform it is and configure hasn't discovered what
- //* is going on for us. Try to guess...
- //*/
- //# ifdef NO_LIMITS_H
- //# error please define either TCL_WIDE_INT_TYPE or TCL_WIDE_INT_IS_LONG
- //# else /* !NO_LIMITS_H */
- //# include <limits.h>
- //# if (INT_MAX < LONG_MAX)
- //# define TCL_WIDE_INT_IS_LONG 1
- //# else
- //# define TCL_WIDE_INT_TYPE long long
- //# endif
- //# endif /* NO_LIMITS_H */
- //# endif /* __WIN32__ */
- //#endif // * !TCL_WIDE_INT_TYPE & !TCL_WIDE_INT_IS_LONG */
- //#if TCL_WIDE_INT_IS_LONG
- //# undef TCL_WIDE_INT_TYPE
- //# define TCL_WIDE_INT_TYPE long
- //#endif // * TCL_WIDE_INT_IS_LONG */
- ////typedef TCL_WIDE_INT_TYPE Tcl_WideInt;
- ////typedef unsigned TCL_WIDE_INT_TYPE Tcl_Wideu32;
- //#if TCL_WIDE_INT_IS_LONG
- ////typedef struct stat Tcl_StatBuf;
- //# define Tcl_WideAsLong(val) ((long)(val))
- //# define Tcl_LongAsWide(val) ((long)(val))
- //# define Tcl_WideAsDouble(val) ((double)((long)(val)))
- //# define Tcl_DoubleAsWide(val) ((long)((double)(val)))
- //# ifndef TCL_LL_MODIFIER
- //# define TCL_LL_MODIFIER "l"
- //# define TCL_LL_MODIFIER_SIZE 1
- //# endif /* !TCL_LL_MODIFIER */
- //#else /* TCL_WIDE_INT_IS_LONG */
- ///*
- //* The next short section of defines are only done when not running on
- //* Windows or some other strange platform.
- //*/
- //# ifndef TCL_LL_MODIFIER
- //# ifdef HAVE_STRUCT_STAT64
- ////typedef struct stat64 Tcl_StatBuf;
- //# else
- ////typedef struct stat Tcl_StatBuf;
- //# endif /* HAVE_STRUCT_STAT64 */
- //# define TCL_LL_MODIFIER "ll"
- //# define TCL_LL_MODIFIER_SIZE 2
- //# endif /* !TCL_LL_MODIFIER */
- //# define Tcl_WideAsLong(val) ((long)((Tcl_WideInt)(val)))
- //# define Tcl_LongAsWide(val) ((Tcl_WideInt)((long)(val)))
- //# define Tcl_WideAsDouble(val) ((double)((Tcl_WideInt)(val)))
- //# define Tcl_DoubleAsWide(val) ((Tcl_WideInt)((double)(val)))
- //#endif // * TCL_WIDE_INT_IS_LONG */
- /*
- * This flag controls whether binary compatability is maintained with
- * extensions built against a previous version of Tcl. This is true
- * by default.
- */
- //#if !TCL_PRESERVE_BINARY_COMPATABILITY
- //# define TCL_PRESERVE_BINARY_COMPATABILITY 1
- //#endif
- /*
- * Data structures defined opaquely in this module. The definitions below
- * just provide dummy types. A few fields are made visible in Tcl_Interp
- * structures, namely those used for returning a string result from
- * commands. Direct access to the result field is discouraged in Tcl 8.0.
- * The interpreter result is either an object or a string, and the two
- * values are kept consistent unless some C code sets interp.result
- * directly. Programmers should use either the procedure Tcl_GetObjResult()
- * or Tcl_GetStringResult() to read the interpreter's result. See the
- * SetResult man page for details.
- *
- * Note: any change to the Tcl_Interp definition below must be mirrored
- * in the "real" definition in tclInt.h.
- *
- * Note: Tcl_ObjCmdProc procedures do not directly set result and freeProc.
- * Instead, they set a Tcl_Obj member in the "real" structure that can be
- * accessed with Tcl_GetObjResult() and Tcl_SetObjResult().
- */
- //typedef struct Tcl_Interp {
- // char *result; /* If the last command returned a string
- // * result, this points to it. */
- // void (*freeProc) _ANSI_ARGS_((char *blockPtr));
- // /* Zero means the string result is
- // * statically allocated. TCL_DYNAMIC means
- // * it was allocated with ckalloc and should
- // * be freed with ckfree. Other values give
- // * the address of procedure to invoke to
- // * free the result. Tcl_Eval must free it
- // * before executing next command. */
- // int errorLine; /* When TCL_ERROR is returned, this gives
- // * the line number within the command where
- // * the error occurred (1 if first line). */
- //} Tcl_Interp;
- //typedef struct Tcl_AsyncHandler_ *Tcl_AsyncHandler;
- //typedef struct Tcl_Channel_ *Tcl_Channel;
- //typedef struct Tcl_Command_ *Tcl_Command;
- //typedef struct Tcl_Condition_ *Tcl_Condition;
- //typedef struct Tcl_EncodingState_ *Tcl_EncodingState;
- //typedef struct Tcl_Encoding_ *Tcl_Encoding;
- //typedef struct Tcl_Event Tcl_Event;
- //typedef struct Tcl_Mutex_ *Tcl_Mutex;
- //typedef struct Tcl_Pid_ *Tcl_Pid;
- //typedef struct Tcl_RegExp_ *Tcl_RegExp;
- //typedef struct Tcl_ThreadDataKey_ *Tcl_ThreadDataKey;
- //typedef struct Tcl_ThreadId_ *Tcl_ThreadId;
- //typedef struct Tcl_TimerToken_ *Tcl_TimerToken;
- //typedef struct Tcl_Trace_ *Tcl_Trace;
- //typedef struct Tcl_Var_ *Tcl_Var;
- //typedef struct Tcl_ChannelTypeVersion_ *Tcl_ChannelTypeVersion;
- //typedef struct Tcl_LoadHandle_ *Tcl_LoadHandle;
- /*
- * Definition of the interface to procedures implementing threads.
- * A procedure following this definition is given to each call of
- * 'Tcl_CreateThread' and will be called as the main fuction of
- * the new thread created by that call.
- */
- //#if MAC_TCL
- ////typedef pascal void *(Tcl_ThreadCreateProc) _ANSI_ARGS_((ClientData clientData));
- //#elif defined __WIN32__
- ////typedef unsigned (__stdcall Tcl_ThreadCreateProc) _ANSI_ARGS_((ClientData clientData));
- //#else
- ////typedef void (Tcl_ThreadCreateProc) _ANSI_ARGS_((ClientData clientData));
- //#endif
- /*
- * Threading function return types used for abstracting away platform
- * differences when writing a Tcl_ThreadCreateProc. See the NewThread
- * function in generic/tclThreadTest.c for it's usage.
- */
- //#if MAC_TCL
- //# define Tcl_ThreadCreateType pascal void *
- //# define TCL_THREAD_CREATE_RETURN return NULL
- //#elif defined __WIN32__
- //# define Tcl_ThreadCreateType unsigned __stdcall
- //# define TCL_THREAD_CREATE_RETURN return 0
- //#else
- //# define Tcl_ThreadCreateType void
- //# define TCL_THREAD_CREATE_RETURN
- //#endif
- /*
- * Definition of values for default stacksize and the possible flags to be
- * given to Tcl_CreateThread.
- */
- //#define TCL_THREAD_STACK_DEFAULT (0) /* Use default size for stack */
- //#define TCL_THREAD_NOFLAGS (0000) /* Standard flags, default behavior */
- //#define TCL_THREAD_JOINABLE (0001) /* Mark the thread as joinable */
- /*
- * Flag values passed to Tcl_GetRegExpFromObj.
- */
- //#define TCL_REG_BASIC 000000 /* BREs (convenience) */
- //#define TCL_REG_EXTENDED 000001 /* EREs */
- //#define TCL_REG_ADVF 000002 /* advanced features in EREs */
- //#define TCL_REG_ADVANCED 000003 /* AREs (which are also EREs) */
- //#define TCL_REG_QUOTE 000004 /* no special characters, none */
- //#define TCL_REG_NOCASE 000010 /* ignore case */
- //#define TCL_REG_NOSUB 000020 /* don't care about subexpressions */
- //#define TCL_REG_EXPANDED 000040 /* expanded format, white space &
- // * comments */
- //#define TCL_REG_NLSTOP 000100 /* \n doesn't match . or [^ ] */
- //#define TCL_REG_NLANCH 000200 /* ^ matches after \n, $ before */
- //#define TCL_REG_NEWLINE 000300 /* newlines are line terminators */
- //#define TCL_REG_CANMATCH 001000 /* report details on partial/limited
- // * matches */
- /*
- * The following flag is experimental and only intended for use by Expect. It
- * will probably go away in a later release.
- */
- //#define TCL_REG_BOSONLY 002000 /* prepend \A to pattern so it only
- // * matches at the beginning of the
- // * string. */
- /*
- * Flags values passed to Tcl_RegExpExecObj.
- */
- //#define TCL_REG_NOTBOL 0001 /* Beginning of string does not match ^. */
- //#define TCL_REG_NOTEOL 0002 /* End of string does not match $. */
- /*
- * Structures filled in by Tcl_RegExpInfo. Note that all offset values are
- * relative to the start of the match string, not the beginning of the
- * entire string.
- */
- //typedef struct Tcl_RegExpIndices {
- // long start; /* character offset of first character in match */
- // long end; /* character offset of first character after the
- // * match. */
- //} Tcl_RegExpIndices;
- //typedef struct Tcl_RegExpInfo {
- // int nsubs; /* number of subexpressions in the
- // * compiled expression */
- // Tcl_RegExpIndices *matches; /* array of nsubs match offset
- // * pairs */
- // long extendStart; /* The offset at which a subsequent
- // * match might begin. */
- // long reserved; /* Reserved for later use. */
- //} Tcl_RegExpInfo;
- /*
- * Picky compilers complain if this typdef doesn't appear before the
- * struct's reference in tclDecls.h.
- */
- //typedef Tcl_StatBuf *Tcl_Stat_;
- //typedef struct stat *Tcl_OldStat_;
- /*
- * When a TCL command returns, the interpreter contains a result from the
- * command. Programmers are strongly encouraged to use one of the
- * procedures Tcl_GetObjResult() or Tcl_GetStringResult() to read the
- * interpreter's result. See the SetResult man page for details. Besides
- * this result, the command procedure returns an integer code, which is
- * one of the following:
- *
- * TCL_OK Command completed normally; the interpreter's
- * result contains the command's result.
- * TCL_ERROR The command couldn't be completed successfully;
- * the interpreter's result describes what went wrong.
- * TCL_RETURN The command requests that the current procedure
- * return; the interpreter's result contains the
- * procedure's return value.
- * TCL_BREAK The command requests that the innermost loop
- * be exited; the interpreter's result is meaningless.
- * TCL_CONTINUE Go on to the next iteration of the current loop;
- * the interpreter's result is meaningless.
- */
- public const int TCL_OK = 0;
- public const int TCL_ERROR = 1;
- public const int TCL_RETURN = 2;
- public const int TCL_BREAK = 3;
- public const int TCL_CONTINUE = 4;
- //#define TCL_RESULT_SIZE 200
- /*
- * Flags to control what substitutions are performed by Tcl_SubstObj():
- */
- //#define TCL_SUBST_COMMANDS 001
- //#define TCL_SUBST_VARIABLES 002
- //#define TCL_SUBST_BACKSLASHES 004
- //#define TCL_SUBST_ALL 007
- /*
- * Argument descriptors for math function callbacks in expressions:
- */
- //typedef enum {
- // TCL_INT, TCL.TCL_DOUBLE, TCL.TCL_EITHER, TCL.TCL_WIDE_INT
- //} Tcl_ValueType;
- //typedef struct Tcl_Value {
- // Tcl_ValueType type; /* Indicates intValue or doubleValue is
- // * valid, or both. */
- // long intValue; /* Integer value. */
- // double doubleValue; /* Double-precision floating value. */
- // Tcl_WideInt wideValue; /* Wide (min. 64-bit) integer value. */
- //} Tcl_Value;
- /*
- * Forward declaration of Tcl_Obj to prevent an error when the forward
- * reference to Tcl_Obj is encountered in the procedure types declared
- * below.
- */
- //struct Tcl_Obj;
- /*
- * Procedure types defined by Tcl:
- */
- //typedef int (Tcl_AppInitProc) _ANSI_ARGS_((Tcl_Interp interp));
- //typedef int (Tcl_AsyncProc) _ANSI_ARGS_((ClientData clientData,
- // Tcl_Interp interp, int code));
- //typedef void (Tcl_ChannelProc) _ANSI_ARGS_((ClientData clientData, int mask));
- //typedef void (Tcl_CloseProc) _ANSI_ARGS_((ClientData data));
- //typedef void (Tcl_CmdDeleteProc) _ANSI_ARGS_((ClientData clientData));
- //typedef int (Tcl_CmdProc) _ANSI_ARGS_((ClientData clientData,
- // Tcl_Interp interp, int argc, CONST84 char *argv[]));
- //typedef void (Tcl_CmdTraceProc) _ANSI_ARGS_((ClientData clientData,
- // Tcl_Interp interp, int level, char *command, TCL.TCL_CmdProc proc,
- // ClientData cmdClientData, int argc, CONST84 char *argv[]));
- //typedef int (Tcl_CmdObjTraceProc) _ANSI_ARGS_((ClientData clientData,
- // Tcl_Interp interp, int level, string command,
- // Tcl_Command commandInfo, int objc, struct Tcl_Obj * CONST * objv));
- //typedef void (Tcl_CmdObjTraceDeleteProc) _ANSI_ARGS_((ClientData clientData));
- //typedef void (Tcl_DupInternalRepProc) _ANSI_ARGS_((struct Tcl_Obj *srcPtr,
- // struct Tcl_Obj *dupPtr));
- //typedef int (Tcl_EncodingConvertProc)_ANSI_ARGS_((ClientData clientData,
- // string src, int srcLen, int flags, TCL.TCL_EncodingState *statePtr,
- // char *dst, int dstLen, int *srcReadPtr, int *dstWrotePtr,
- // int *dstCharsPtr));
- //typedef void (Tcl_EncodingFreeProc)_ANSI_ARGS_((ClientData clientData));
- //typedef int (Tcl_EventProc) _ANSI_ARGS_((Tcl_Event *evPtr, int flags));
- //typedef void (Tcl_EventCheckProc) _ANSI_ARGS_((ClientData clientData,
- // int flags));
- //typedef int (Tcl_EventDeleteProc) _ANSI_ARGS_((Tcl_Event *evPtr,
- // ClientData clientData));
- //typedef void (Tcl_EventSetupProc) _ANSI_ARGS_((ClientData clientData,
- // int flags));
- //typedef void (Tcl_ExitProc) _ANSI_ARGS_((ClientData clientData));
- //typedef void (Tcl_FileProc) _ANSI_ARGS_((ClientData clientData, int mask));
- //typedef void (Tcl_FileFreeProc) _ANSI_ARGS_((ClientData clientData));
- //typedef void (Tcl_FreeInternalRepProc) _ANSI_ARGS_((struct Tcl_Obj *objPtr));
- //typedef void (Tcl_FreeProc) _ANSI_ARGS_((char *blockPtr));
- //typedef void (Tcl_IdleProc) _ANSI_ARGS_((ClientData clientData));
- //typedef void (Tcl_InterpDeleteProc) _ANSI_ARGS_((ClientData clientData,
- // Tcl_Interp interp));
- //typedef int (Tcl_MathProc) _ANSI_ARGS_((ClientData clientData,
- // Tcl_Interp interp, TCL.TCL_Value *args, TCL.TCL_Value *resultPtr));
- //typedef void (Tcl_NamespaceDeleteProc) _ANSI_ARGS_((ClientData clientData));
- //typedef int (Tcl_ObjCmdProc) _ANSI_ARGS_((ClientData clientData,
- // Tcl_Interp interp, int objc, struct Tcl_Obj * CONST * objv));
- //typedef int (Tcl_PackageInitProc) _ANSI_ARGS_((Tcl_Interp interp));
- //typedef void (Tcl_PanicProc) _ANSI_ARGS_(TCL_VARARGS(string , format));
- //typedef void (Tcl_TcpAcceptProc) _ANSI_ARGS_((ClientData callbackData,
- // Tcl_Channel chan, char *address, int port));
- //typedef void (Tcl_TimerProc) _ANSI_ARGS_((ClientData clientData));
- //typedef int (Tcl_SetFromAnyProc) _ANSI_ARGS_((Tcl_Interp interp,
- // struct Tcl_Obj *objPtr));
- //typedef void (Tcl_UpdateStringProc) _ANSI_ARGS_((struct Tcl_Obj *objPtr));
- //typedef char *(Tcl_VarTraceProc) _ANSI_ARGS_((ClientData clientData,
- // Tcl_Interp interp, CONST84 char part1, CONST84 char part2, int flags));
- //typedef void (Tcl_CommandTraceProc) _ANSI_ARGS_((ClientData clientData,
- // Tcl_Interp interp, string oldName, string newName,
- // int flags));
- //typedef void (Tcl_CreateFileHandlerProc) _ANSI_ARGS_((int fd, int mask,
- // Tcl_FileProc proc, ClientData clientData));
- //typedef void (Tcl_DeleteFileHandlerProc) _ANSI_ARGS_((int fd));
- //typedef void (Tcl_AlertNotifierProc) _ANSI_ARGS_((ClientData clientData));
- //typedef void (Tcl_ServiceModeHookProc) _ANSI_ARGS_((int mode));
- //typedef ClientData (Tcl_InitNotifierProc) _ANSI_ARGS_((VOID));
- //typedef void (Tcl_FinalizeNotifierProc) _ANSI_ARGS_((ClientData clientData));
- //typedef void (Tcl_MainLoopProc) _ANSI_ARGS_((void));
- /*
- * The following structure represents a type of object, which is a
- * particular internal representation for an object plus a set of
- * procedures that provide standard operations on objects of that type.
- */
- //typedef struct Tcl_ObjType {
- // char *name; /* Name of the type, e.g. "int". */
- // Tcl_FreeInternalRepProc *freeIntRepProc;
- // /* Called to free any storage for the type's
- // * internal rep. NULL if the internal rep
- // * does not need freeing. */
- // Tcl_DupInternalRepProc *dupIntRepProc;
- // /* Called to create a new object as a copy
- // * of an existing object. */
- // Tcl_UpdateStringProc *updateStringProc;
- // /* Called to update the string rep from the
- // * type's internal representation. */
- // Tcl_SetFromAnyProc *setFromAnyProc;
- // /* Called to convert the object's internal
- // * rep to this type. Frees the internal rep
- // * of the old type. Returns TCL_ERROR on
- // * failure. */
- //} Tcl_ObjType;
- /*
- * One of the following structures exists for each object in the Tcl
- * system. An object stores a value as either a string, some internal
- * representation, or both.
- */
- //typedef struct Tcl_Obj {
- // int refCount; /* When 0 the object will be freed. */
- // char *bytes; /* This points to the first byte of the
- // * object's string representation. The array
- // * must be followed by a null byte (i.e., at
- // * offset length) but may also contain
- // * embedded null characters. The array's
- // * storage is allocated by ckalloc. NULL
- // * means the string rep is invalid and must
- // * be regenerated from the internal rep.
- // * Clients should use Tcl_GetStringFromObj
- // * or Tcl_GetString to get a pointer to the
- // * byte array as a readonly value. */
- // int length; /* The number of bytes at *bytes, not
- // * including the terminating null. */
- // Tcl_ObjType *typePtr; /* Denotes the object's type. Always
- // * corresponds to the type of the object's
- // * internal rep. NULL indicates the object
- // * has no internal rep (has no type). */
- // union { /* The internal representation: */
- // long longValue; /* - an long integer value */
- // double doubleValue; /* - a double-precision floating value */
- // VOID *otherValuePtr; /* - another, type-specific value */
- // Tcl_WideInt wideValue; /* - a long long value */
- // struct { /* - internal rep as two pointers */
- // VOID ptr1;
- // VOID ptr2;
- // } twoPtrValue;
- // } internalRep;
- //} Tcl_Obj;
- /*
- * Macros to increment and decrement a Tcl_Obj's reference count, and to
- * test whether an object is shared (i.e. has reference count > 1).
- * Note: clients should use Tcl_DecrRefCount() when they are finished using
- * an object, and should never call TclFreeObj() directly. TclFreeObj() is
- * only defined and made public in tcl.h to support Tcl_DecrRefCount's macro
- * definition. Note also that Tcl_DecrRefCount() refers to the parameter
- * "obj" twice. This means that you should avoid calling it with an
- * expression that is expensive to compute or has side effects.
- */
- //void Tcl_IncrRefCount _ANSI_ARGS_((Tcl_Obj *objPtr));
- //void Tcl_DecrRefCount _ANSI_ARGS_((Tcl_Obj *objPtr));
- //int Tcl_IsShared _ANSI_ARGS_((Tcl_Obj *objPtr));
- //#if TCL_MEM_DEBUG
- //# define Tcl_IncrRefCount(objPtr) \
- //// Tcl_DbIncrRefCount(objPtr, __FILE__, __LINE__)
- //# define Tcl_DecrRefCount(objPtr) \
- //// Tcl_DbDecrRefCount(objPtr, __FILE__, __LINE__)
- //# define Tcl_IsShared(objPtr) \
- //// Tcl_DbIsShared(objPtr, __FILE__, __LINE__)
- //#else
- //# define Tcl_IncrRefCount(objPtr) \
- //// ++(objPtr)->refCount
- //// /*
- //// * Use do/while0 idiom for optimum correctness without compiler warnings
- //// * http://c2.com/cgi/wiki?TrivialDoWhileLoop
- //// */
- //# define Tcl_DecrRefCount(objPtr) \
- //// do { if (--(objPtr)->refCount <= 0) TclFreeObj(objPtr); } while(0)
- //# define Tcl_IsShared(objPtr) \
- //// ((objPtr)->refCount > 1)
- //#endif
- /*
- * Macros and definitions that help to debug the use of Tcl objects.
- * When TCL_MEM_DEBUG is defined, the Tcl_New declarations are
- * overridden to call debugging versions of the object creation procedures.
- */
- //#if TCL_MEM_DEBUG
- //# define Tcl_NewBooleanObj(val) \
- //// Tcl_DbNewBooleanObj(val, __FILE__, __LINE__)
- //# define Tcl_NewByteArrayObj(bytes, len) \
- //// Tcl_DbNewByteArrayObj(bytes, len, __FILE__, __LINE__)
- //# define Tcl_NewDoubleObj(val) \
- //// Tcl_DbNewDoubleObj(val, __FILE__, __LINE__)
- //# define Tcl_NewIntObj(val) \
- //// Tcl_DbNewLongObj(val, __FILE__, __LINE__)
- //# define Tcl_NewListObj(objc, objv) \
- //// Tcl_DbNewListObj(objc, objv, __FILE__, __LINE__)
- //# define Tcl_NewLongObj(val) \
- //// Tcl_DbNewLongObj(val, __FILE__, __LINE__)
- //# define Tcl_NewObj() \
- //// Tcl_DbNewObj(__FILE__, __LINE__)
- //# define Tcl_NewStringObj(bytes, len) \
- //// Tcl_DbNewStringObj(bytes, len, __FILE__, __LINE__)
- //# define Tcl_NewWideIntObj(val) \
- //// Tcl_DbNewWideIntObj(val, __FILE__, __LINE__)
- //#endif // * TCL_MEM_DEBUG */
- /*
- * The following structure contains the state needed by
- * Tcl_SaveResult. No-one outside of Tcl should access any of these
- * fields. This structure is typically allocated on the stack.
- */
- //typedef struct Tcl_SavedResult {
- // char *result;
- // Tcl_FreeProc *freeProc;
- // Tcl_Obj *objResultPtr;
- // char *appendResult;
- // int appendAvl;
- // int appendUsed;
- // char resultSpace[TCL_RESULT_SIZE+1];
- //} Tcl_SavedResult;
- /*
- * The following definitions support Tcl's namespace facility.
- * Note: the first five fields must match exactly the fields in a
- * Namespace structure (see tclInt.h).
- */
- //typedef struct Tcl_Namespace {
- // char *name; /* The namespace's name within its parent
- // * namespace. This contains no ::'s. The
- // * name of the global namespace is ""
- // * although "::" is an synonym. */
- // char *fullName; /* The namespace's fully qualified name.
- // * This starts with ::. */
- // ClientData clientData; /* Arbitrary value associated with this
- // * namespace. */
- // Tcl_NamespaceDeleteProc* deleteProc;
- // /* Procedure invoked when deleting the
- // * namespace to, e.g., free clientData. */
- // struct Tcl_Namespace* parentPtr;
- // /* Points to the namespace that contains
- // * this one. NULL if this is the global
- // * namespace. */
- //} Tcl_Namespace;
- /*
- * The following structure represents a call frame, or activation record.
- * A call frame defines a naming context for a procedure call: its local
- * scope (for local variables) and its namespace scope (used for non-local
- * variables; often the global :: namespace). A call frame can also define
- * the naming context for a namespace eval or namespace inscope command:
- * the namespace in which the command's code should execute. The
- * Tcl_CallFrame structures exist only while procedures or namespace
- * eval/inscope's are being executed, and provide a Tcl call stack.
- *
- * A call frame is initialized and pushed using Tcl_PushCallFrame and
- * popped using Tcl_PopCallFrame. Storage for a Tcl_CallFrame must be
- * provided by the Tcl_PushCallFrame caller, and callers typically allocate
- * them on the C call stack for efficiency. For this reason, TCL.TCL_CallFrame
- * is defined as a structure and not as an opaque token. However, most
- * Tcl_CallFrame fields are hidden since applications should not access
- * them directly; others are declared as "dummyX".
- *
- * WARNING!! The structure definition must be kept consistent with the
- * CallFrame structure in tclInt.h. If you change one, change the other.
- */
- //typedef struct Tcl_CallFrame {
- // Tcl_Namespace *nsPtr;
- // int dummy1;
- // int dummy2;
- // char *dummy3;
- // char *dummy4;
- // char *dummy5;
- // int dummy6;
- // char *dummy7;
- // char *dummy8;
- // int dummy9;
- // char* dummy10;
- //} Tcl_CallFrame;
- /*
- * Information about commands that is returned by Tcl_GetCommandInfo and
- * passed to Tcl_SetCommandInfo. objProc is an objc/objv object-based
- * command procedure while proc is a traditional Tcl argc/argv
- * string-based procedure. Tcl_CreateObjCommand and Tcl_CreateCommand
- * ensure that both objProc and proc are non-NULL and can be called to
- * execute the command. However, it may be faster to call one instead of
- * the other. The member isNativeObjectProc is set to 1 if an
- * object-based procedure was registered by Tcl_CreateObjCommand, and to
- * 0 if a string-based procedure was registered by Tcl_CreateCommand.
- * The other procedure is typically set to a compatibility wrapper that
- * does string-to-object or object-to-string argument conversions then
- * calls the other procedure.
- */
- //typedef struct Tcl_CmdInfo {
- // int isNativeObjectProc; /* 1 if objProc was registered by a call to
- // * Tcl_CreateObjCommand; 0 otherwise.
- // * Tcl_SetCmdInfo does not modify this
- // * field. */
- // Tcl_ObjCmdProc *objProc; /* Command's object-based procedure. */
- // ClientData objClientData; /* ClientData for object proc. */
- // Tcl_CmdProc proc; /* Command's string-based procedure. */
- // ClientData clientData; /* ClientData for string proc. */
- // Tcl_CmdDeleteProc *deleteProc;
- // /* Procedure to call when command is
- // * deleted. */
- // ClientData deleteData; /* Value to pass to deleteProc (usually
- // * the same as clientData). */
- // Tcl_Namespace *namespacePtr; /* Points to the namespace that contains
- // * this command. Note that Tcl_SetCmdInfo
- // * will not change a command's namespace;
- // * use Tcl_RenameCommand to do that. */
- //} Tcl_CmdInfo;
- /*
- * The structure defined below is used to hold dynamic strings. The only
- * field that clients should use is the string field, accessible via the
- * macro Tcl_DStringValue.
- */
- //#define TCL_DSTRING_STATIC_SIZE 200
- //typedef struct Tcl_DString {
- // char *string; /* Points to beginning of string: either
- // * staticSpace below or a malloced array. */
- // int length; /* Number of non-NULL characters in the
- // * string. */
- // int spaceAvl; /* Total number of bytes available for the
- // * string and its terminating NULL char. */
- // char staticSpace[TCL_DSTRING_STATIC_SIZE];
- // /* Space to use in common case where string
- // * is small. */
- //} Tcl_DString;
- //#define Tcl_DStringLength(dsPtr) ((dsPtr)->length)
- //#define Tcl_DStringValue(dsPtr) ((dsPtr)->string)
- //#define Tcl_DStringTrunc Tcl_DStringSetLength
- /*
- * Definitions for the maximum number of digits of precision that may
- * be specified in the "tcl_precision" variable, and the number of
- * bytes of buffer space required by Tcl_PrintDouble.
- */
- //#define TCL_MAX_PREC 17
- //#define TCL_DOUBLE_SPACE (TCL_MAX_PREC+10)
- /*
- * Definition for a number of bytes of buffer space sufficient to hold the
- * string representation of an integer in base 10 (assuming the existence
- * of 64-bit integers).
- */
- //#define TCL_INTEGER_SPACE 24
- /*
- * Flag that may be passed to Tcl_ConvertElement to force it not to
- * output braces (careful! if you change this flag be sure to change
- * the definitions at the front of tclUtil.c).
- */
- //#define TCL_DONT_USE_BRACES 1
- /*
- * Flag that may be passed to Tcl_GetIndexFromObj to force it to disallow
- * abbreviated strings.
- */
- //#define TCL_EXACT 1
- /*
- * Flag values passed to Tcl_RecordAndEval and/or Tcl_EvalObj.
- * WARNING: these bit choices must not conflict with the bit choices
- * for evalFlag bits in tclInt.h!!
- */
- public const int TCL_NO_EVAL = 0x10000;
- public const int TCL_EVAL_GLOBAL = 0x20000;
- public const int TCL_EVAL_DIRECT = 0x40000;
- public const int TCL_EVAL_INVOKE = 0x80000;
- /*
- * Special freeProc values that may be passed to Tcl_SetResult (see
- * the man page for details):
- */
- public const int TCL_VOLATILE = 1;//((Tcl_FreeProc ) 1)
- public const int TCL_STATIC = 2;//((Tcl_FreeProc ) 0)
- public const int TCL_DYNAMIC = 3;//((Tcl_FreeProc ) 3)
- /*
- * Flag values passed to variable-related procedures.
- */
- public const int TCL_GLOBAL_ONLY = 1;
- public const int TCL_NAMESPACE_ONLY = 2;
- public const int TCL_APPEND_VALUE = 4;
- public const int TCL_LIST_ELEMENT = 8;
- public const int TCL_TRACE_READS = 0x10;
- public const int TCL_TRACE_WRITES = 0x20;
- public const int TCL_TRACE_UNSETS = 0x40;
- public const int TCL_TRACE_DESTROYED = 0x80;
- public const int Tcl_Interp_DESTROYED = 0x100;
- public const int TCL_LEAVE_ERR_MSG = 0x200;
- public const int TCL_TRACE_ARRAY = 0x800;
- #if !TCL_REMOVE_OBSOLETE_TRACES
- /* Required to support old variable/vdelete/vinfo traces */
- public const int TCL_TRACE_OLD_STYLE = 0x1000;
- #endif
- /* Indicate the semantics of the result of a trace */
- public const int TCL_TRACE_RESULT_DYNAMIC = 0x8000;
- public const int TCL_TRACE_RESULT_OBJECT = 0x10000;
- /*
- * Flag values passed to command-related procedures.
- */
- //#define TCL_TRACE_RENAME 0x2000
- //#define TCL_TRACE_DELETE 0x4000
- //#define TCL_ALLOW_INLINE_COMPILATION 0x20000
- /*
- * Flag values passed to Tcl_CreateObjTrace, and used internally
- * by command execution traces. Slots 4,8,16 and 32 are
- * used internally by execution traces (see tclCmdMZ.c)
- */
- //#define TCL_TRACE_ENTER_EXEC 1
- //#define TCL_TRACE_LEAVE_EXEC 2
- /*
- * The TCL_PARSE_PART1 flag is deprecated and has no effect.
- * The part1 is now always parsed whenever the part2 is NULL.
- * (This is to avoid a common error when converting code to
- * use the new object based APIs and forgetting to give the
- * flag)
- */
- #if !TCL_NO_DEPRECATED
- //# define TCL_PARSE_PART1 0x400
- #endif
- /*
- * Types for linked variables:
- */
- //const int TCL_LINK_INT = 1;
- //const int TCL_LINK_DOUBLE = 2;
- //const int TCL_LINK_BOOLEAN =3;
- //const int TCL_LINK_STRING = 4;
- //const int TCL_LINK_WIDE_INT= 5;
- //const int TCL_LINK_READ_ONLY= 0x80;
- /*
- * Forward declarations of Tcl_HashTable and related types.
- */
- //typedef struct Tcl_HashKeyType Tcl_HashKeyType;
- //typedef struct Tcl_HashTable Tcl_HashTable;
- //typedef struct Tcl_HashEntry Tcl_HashEntry;
- //typedef unsigned int (Tcl_HashKeyProc) _ANSI_ARGS_((Tcl_HashTable *tablePtr,
- // VOID *keyPtr));
- //typedef int (Tcl_CompareHashKeysProc) _ANSI_ARGS_((VOID *keyPtr,
- // Tcl_HashEntry *hPtr));
- //typedef Tcl_HashEntry *(Tcl_AllocHashEntryProc) _ANSI_ARGS_((
- // Tcl_HashTable *tablePtr, object *keyPtr));
- //typedef void (Tcl_FreeHashEntryProc) _ANSI_ARGS_((Tcl_HashEntry *hPtr));
- /*
- * This flag controls whether the hash table stores the hash of a key, or
- * recalculates it. There should be no reason for turning this flag off
- * as it is completely binary and source compatible unless you directly
- * access the bucketPtr member of the Tcl_HashTableEntry structure. This
- * member has been removed and the space used to store the hash value.
- */
- //#if !TCL_HASH_KEY_STORE_HASH
- //# define TCL_HASH_KEY_STORE_HASH 1
- //#endif
- /*
- * Structure definition for an entry in a hash table. No-one outside
- * Tcl should access any of these fields directly; use the macros
- * defined below.
- */
- //struct Tcl_HashEntry {
- // Tcl_HashEntry *nextPtr; /* Pointer to next entry in this
- // * hash bucket, or NULL for end of
- // * chain. */
- // Tcl_HashTable *tablePtr; /* Pointer to table containing entry. */
- #if TCL_HASH_KEY_STORE_HASH
- # if TCL_PRESERVE_BINARY_COMPATABILITY
- // VOID *hash; /* Hash value, stored as pointer to
- // * ensure that the offsets of the
- // * fields in this structure are not
- // * changed. */
- # else
- // unsigned int hash; /* Hash value. */
- # endif
- #else
- // Tcl_HashEntry **bucketPtr; /* Pointer to bucket that points to
- // * first entry in this entry's chain:
- // * used for deleting the entry. */
- #endif
- // ClientData clientData; /* Application stores something here
- // * with Tcl_SetHashValue. */
- // union { /* Key has one of these forms: */
- // char *oneWordValue; /* One-word value for key. */
- // Tcl_Obj *objPtr; /* Tcl_Obj * key value. */
- // int words[1]; /* Multiple integer words for key.
- // * The actual size will be as large
- // * as necessary for this table's
- // * keys. */
- // char string[4]; /* String for key. The actual size
- // * will be as large as needed to hold
- // * the key. */
- // } key; /* MUST BE LAST FIELD IN RECORD!! */
- //};
- /*
- * Flags used in Tcl_HashKeyType.
- *
- * TCL_HASH_KEY_RANDOMIZE_HASH:
- * There are some things, pointers for example
- * which don't hash well because they do not use
- * the lower bits. If this flag is set then the
- * hash table will attempt to rectify this by
- * randomising the bits and then using the upper
- * N bits as the index into the table.
- */
- //#define TCL_HASH_KEY_RANDOMIZE_HASH 0x1
- /*
- * Structure definition for the methods associated with a hash table
- * key type.
- */
- //#define TCL_HASH_KEY_TYPE_VERSION 1
- //struct Tcl_HashKeyType {
- // int version; /* Version of the table. If this structure is
- // * extended in future then the version can be
- // * used to distinguish between different
- // * structures.
- // */
- // int flags; /* Flags, see above for details. */
- // /* Calculates a hash value for the key. If this is NULL then the pointer
- // * itself is used as a hash value.
- // */
- // Tcl_HashKeyProc *hashKeyProc;
- // /* Compares two keys and returns zero if they do not match, and non-zero
- // * if they do. If this is NULL then the pointers are compared.
- // */
- // Tcl_CompareHashKeysProc *compareKeysProc;
- // /* Called to allocate memory for a new entry, i.e. if the key is a
- // * string then this could allocate a single block which contains enough
- // * space for both the entry and the string. Only the key field of the
- // * allocated Tcl_HashEntry structure needs to be filled in. If something
- // * else needs to be done to the key, i.e. incrementing a reference count
- // * then that should be done by this function. If this is NULL then Tcl_Alloc
- // * is used to allocate enough space for a Tcl_HashEntry and the key pointer
- // * is assigned to key.oneWordValue.
- // */
- // Tcl_AllocHashEntryProc *allocEntryProc;
- // /* Called to free memory associated with an entry. If something else needs
- // * to be done to the key, i.e. decrementing a reference count then that
- // * should be done by this function. If this is NULL then Tcl_Free is used
- // * to free the Tcl_HashEntry.
- // */
- // Tcl_FreeHashEntryProc *freeEntryProc;
- //};
- /*
- * Structure definition for a hash table. Must be in tcl.h so clients
- * can allocate space for these structures, but clients should never
- * access any fields in this structure.
- */
- //#define TCL_SMALL_HASH_TABLE 4
- //struct Tcl_HashTable {
- // Tcl_HashEntry **buckets; /* Pointer to bucket array. Each
- // * element points to first entry in
- // * bucket's hash chain, or NULL. */
- // Tcl_HashEntry *staticBuckets[TCL_SMALL_HASH_TABLE];
- // /* Bucket array used for small tables
- // * (to avoid mallocs and frees). */
- // int numBuckets; /* Total number of buckets allocated
- // * at **bucketPtr. */
- // int numEntries; /* Total number of entries present
- // * in table. */
- // int rebuildSize; /* Enlarge table when numEntries gets
- // * to be this large. */
- // int downShift; /* Shift count used in hashing
- // * function. Designed to use h…
Large files files are truncated, but you can click here to view the full file