📄 tcl7.6.h
字号:
/* * 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) 1994-1996 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * * SCCS: @(#) tcl.h 1.283 96/10/02 17:17:39 */#ifndef _TCL#define _TCL/* * When version numbers change here, must also go into the following files * and update the version numbers: * * library/init.tcl * unix/configure.in * unix/Makefile.in * unix/pkginfo * win/makefile.bc * win/makefile.vc * * The release level should be 0 for alpha, 1 for beta, and 2 for * final/patch. The release serial value is the number that follows the * "a", "b", or "p" in the patch level; for example, if the patch level * is 7.6b2, TCL_RELEASE_SERIAL is 2. It restarts at 1 whenever the * release level is changed, except for the final release which is 0 * (the first patch will start at 1). */#define TCL_MAJOR_VERSION 7#define TCL_MINOR_VERSION 6#define TCL_RELEASE_LEVEL 2#define TCL_RELEASE_SERIAL 0#define TCL_VERSION "7.6"#define TCL_PATCH_LEVEL "7.6"/* * The following definitions set up the proper options for Windows * compilers. We use this method because there is no autoconf equivalent. */#ifndef __WIN32__# if defined(_WIN32) || defined(WIN32)# define __WIN32__# endif#endif#ifdef __WIN32__# ifndef STRICT# define STRICT# endif# ifndef USE_PROTOTYPE# define USE_PROTOTYPE 1# endif# ifndef HAS_STDARG# define HAS_STDARG 1# endif# ifndef USE_PROTOTYPE# define USE_PROTOTYPE 1# endif# ifndef USE_TCLALLOC# define USE_TCLALLOC 1# endif# ifndef STRINGIFY# define STRINGIFY(x) STRINGIFY1(x)# define STRINGIFY1(x) #x# endif#endif /* __WIN32__ *//* * The following definitions set up the proper options for Macintosh * compilers. We use this method because there is no autoconf equivalent. */#ifdef MAC_TCL# ifndef HAS_STDARG# define HAS_STDARG 1# endif# ifndef USE_TCLALLOC# define USE_TCLALLOC 1# endif# ifndef NO_STRERROR# define NO_STRERROR 1# endif#endif/* * A special definition used to allow this header file to be included * in resource files so that they can get obtain version information from * this file. Resource compilers don't like all the C stuff, like typedefs * and procedure declarations, that occur below. */#ifndef RESOURCE_INCLUDED#ifndef 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 defined(__STDC__) || defined(HAS_STDARG)# 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# ifdef __cplusplus# define TCL_VARARGS(type, name) (type name, ...)# define TCL_VARARGS_DEF(type, name) (type va_alist, ...)# else# define TCL_VARARGS(type, name) ()# define TCL_VARARGS_DEF(type, name) (va_alist)# endif# define TCL_VARARGS_START(type, name, list) \ (va_start(list), va_arg(list, type))#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 ((defined(__STDC__) || defined(SABER)) && !defined(NO_PROTOTYPE)) || defined(__cplusplus) || defined(USE_PROTOTYPE)# define _USING_PROTOTYPES_ 1# define _ANSI_ARGS_(x) x# define CONST const#else# define _ANSI_ARGS_(x) ()# define CONST#endif#ifdef __cplusplus# define EXTERN extern "C"#else# define EXTERN extern#endif/* * 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. */#ifndef __WIN32__#ifndef VOID# ifdef __STDC__# define VOID void# else# define VOID char# endif#endif#else /* __WIN32__ *//* * The following code is copied from winnt.h */#ifndef VOID#define VOID voidtypedef char CHAR;typedef short SHORT;typedef long LONG;#endif#endif /* __WIN32__ *//* * Miscellaneous declarations. */#ifndef NULL#define NULL 0#endif#ifndef _CLIENTDATA# if defined(__STDC__) || defined(__cplusplus) typedef void *ClientData;# else typedef int *ClientData;# endif /* __STDC__ */#define _CLIENTDATA#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 for returning string values. * Note: any change to the Tcl_Interp definition below must be mirrored * in the "real" definition in tclInt.h. */typedef struct Tcl_Interp{ char *result; /* Points to result string returned by last * command. */ void (*freeProc) _ANSI_ARGS_((char *blockPtr)); /* Zero means result is statically allocated. * TCL_DYNAMIC means result was allocated with * ckalloc and should be freed with ckfree. * Other values give address of procedure * to invoke to free the result. Must be * freed by Tcl_Eval before executing next * command. */ int errorLine; /* When TCL_ERROR is returned, this gives * the line number within the command where * the error occurred (1 means first line). */} Tcl_Interp;typedef struct Tcl_AsyncHandler_ *Tcl_AsyncHandler;typedef struct Tcl_Command_ *Tcl_Command;typedef struct Tcl_Event Tcl_Event;typedef struct Tcl_File_ *Tcl_File;typedef struct Tcl_Channel_ *Tcl_Channel;typedef struct Tcl_RegExp_ *Tcl_RegExp;typedef struct Tcl_TimerToken_ *Tcl_TimerToken;typedef struct Tcl_Trace_ *Tcl_Trace;/* * When a TCL command returns, the string pointer interp->result points to * a string containing return information from the command. In addition, * the command procedure returns an integer value, which is one of the * following: * * TCL_OK Command completed normally; interp->result contains * the command's result. * TCL_ERROR The command couldn't be completed successfully; * interp->result describes what went wrong. * TCL_RETURN The command requests that the current procedure * return; interp->result contains the procedure's * return value. * TCL_BREAK The command requests that the innermost loop * be exited; interp->result is meaningless. * TCL_CONTINUE Go on to the next iteration of the current loop; * interp->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/* SIMOS CHANGES */#define USE_LONGLONG_EXPR#ifdef USE_LONGLONG_EXPR#define LONGLONG_MIN (-9223372036854775807LL-1LL) /* min "int64 int" */#define LONGLONG_MAX 9223372036854775807LL /* max "int64 int" */#define TCL_INTVALUE_MIN LONGLONG_MIN#define TCL_INTVALUE_MAX LONGLONG_MAXtypedef int64 Tcl_IntValueType;#ifdef __alpha#define STRTOINT strtoul#define LLD_STRING "%ld"#else#define STRTOINT strtoull#define LLD_STRING "%lld"#endif#else /* USE_LONGLONG_EXPR */#define TCL_INTVALUE_MIN LONG_MIN#define TCL_INTVALUE_MAX LONG_MAXtypedef long Tcl_IntValueType;#define STRTOINT strtoul#endif /* USE_LONGLONG_EXPR *//* * Argument descriptors for math function callbacks in expressions: */typedef enum {TCL_INT, TCL_DOUBLE, TCL_EITHER} Tcl_ValueType;typedef struct Tcl_Value { Tcl_ValueType type; /* Indicates intValue or doubleValue is * valid, or both. */ Tcl_IntValueType intValue; /* Integer value. */ double doubleValue; /* Double-precision floating value. */} Tcl_Value;/* * 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, char *argv[]));typedef void (Tcl_CmdTraceProc) _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, int level, char *command, Tcl_CmdProc *proc, ClientData cmdClientData, int argc, char *argv[]));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_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 int (Tcl_PackageInitProc) _ANSI_ARGS_((Tcl_Interp *interp));typedef void (Tcl_TcpAcceptProc) _ANSI_ARGS_((ClientData callbackData, Tcl_Channel chan, char *address, int port));typedef void (Tcl_TimerProc) _ANSI_ARGS_((ClientData clientData));typedef char *(Tcl_VarTraceProc) _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, char *part1, char *part2, int flags));/* * The structure returned by Tcl_GetCmdInfo and passed into * Tcl_SetCmdInfo: */typedef struct Tcl_CmdInfo { Tcl_CmdProc *proc; /* Procedure to implement command. */ ClientData clientData; /* ClientData passed to proc. */ Tcl_CmdDeleteProc *deleteProc; /* Procedure to call when command * is deleted. */ ClientData deleteData; /* Value to pass to deleteProc (usually * the same as clientData). */} Tcl_CmdInfo;/* * The structure defined below is used to hold dynamic strings. The only * field that clients should use is the string field, and they should * never modify it. */#define TCL_DSTRING_STATIC_SIZE 200typedef struct Tcl_DString { char *string; /* Points to beginning of string: either * staticSpace below or a malloc'ed 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 * characters of buffer space required by Tcl_PrintDouble. */#define TCL_MAX_PREC 17#define TCL_DOUBLE_SPACE (TCL_MAX_PREC+10)/* * 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 values passed to Tcl_RecordAndEval. * WARNING: these bit choices must not conflict with the bit choices
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -