📄 tcl.h
字号:
# define TCL_LL_MODIFIER_SIZE 1# else /* __BORLANDC__ */typedef struct _stati64 Tcl_StatBuf;# 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 */#ifdef 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_WideUInt;#ifdef TCL_WIDE_INT_IS_LONGtypedef 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_STAT64typedef struct stat64 Tcl_StatBuf;# elsetypedef 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. */#ifndef 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. */#ifdef MAC_TCLtypedef pascal void *(Tcl_ThreadCreateProc) _ANSI_ARGS_((ClientData clientData));#elif defined __WIN32__typedef unsigned (__stdcall Tcl_ThreadCreateProc) _ANSI_ARGS_((ClientData clientData));#elsetypedef 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. */#ifdef 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 behaviour */#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. */#define TCL_OK 0#define TCL_ERROR 1#define TCL_RETURN 2#define TCL_BREAK 3#define 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_DOUBLE, TCL_EITHER, 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_CmdProc *proc, ClientData cmdClientData, int argc, CONST84 char *argv[]));typedef int (Tcl_CmdObjTraceProc) _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, int level, CONST char *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, CONST char *src, int srcLen, int flags, Tcl_EncodingState *statePtr, char *dst, int dstLen, int *srcReadPtr, int *dstWrotePtr, int *dstCharsPtr));typedef void (Tcl_EncodingFreeProc)_ANSI_ARGS_((ClientData clientData));typedef int (Tcl_EventProc) _ANSI_ARGS_((Tcl_Event *evPtr, int flags));typedef 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_Value *args, 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(CONST char *, 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, CONST char *oldName, CONST char *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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -