PageRenderTime 91ms CodeModel.GetById 45ms RepoModel.GetById 7ms app.codeStats 1ms

/TCL/src/tcl_h.cs

https://bitbucket.org/eumario/csharp-sqlite
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

  1. namespace tcl.lang
  2. {
  3. public partial class TCL
  4. {
  5. /*
  6. * tcl.h --
  7. *
  8. * This header file describes the externally-visible facilities
  9. * of the Tcl interpreter.
  10. *
  11. * Copyright (c) 1987-1994 The Regents of the University of California.
  12. * Copyright (c) 1993-1996 Lucent Technologies.
  13. * Copyright (c) 1994-1998 Sun Microsystems, Inc.
  14. * Copyright (c) 1998-2000 by Scriptics Corporation.
  15. * Copyright (c) 2002 by Kevin B. Kenny. All rights reserved.
  16. *
  17. * See the file "license.terms" for information on usage and redistribution
  18. * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  19. *
  20. * Included in SQLite3 port to C# for use in testharness only; 2008 Noah B Hart
  21. *
  22. * RCS @(#) $Id: tcl.h,v 1.153.2.34 2008/02/06 15:25:15 dgp Exp $
  23. */
  24. #if !_TCL
  25. //#define _TCL
  26. /*
  27. * For C++ compilers, use extern "C"
  28. */
  29. #if __cplusplus
  30. //extern "C" {
  31. #endif
  32. /*
  33. * The following defines are used to indicate the various release levels.
  34. */
  35. //#define TCL_ALPHA_RELEASE 0
  36. //#define TCL_BETA_RELEASE 1
  37. //#define TCL_FINAL_RELEASE 2
  38. /*
  39. * When version numbers change here, must also go into the following files
  40. * and update the version numbers:
  41. *
  42. * library/init.tcl (only if Major.minor changes, not patchlevel) 1 LOC
  43. * unix/configure.in (2 LOC Major, 2 LOC minor, 1 LOC patch)
  44. * win/configure.in (as above)
  45. * win/tcl.m4 (not patchlevel)
  46. * win/makefile.vc (not patchlevel) 2 LOC
  47. * README (sections 0 and 2)
  48. * mac/README (2 LOC, not patchlevel)
  49. * macosx/Tcl.pbproj/project.pbxproj (not patchlevel) 1 LOC
  50. * macosx/Tcl.pbproj/default.pbxuser (not patchlevel) 1 LOC
  51. * win/README.binary (sections 0-4)
  52. * win/README (not patchlevel) (sections 0 and 2)
  53. * unix/tcl.spec (2 LOC Major/Minor, 1 LOC patch)
  54. * tests/basic.test (1 LOC M/M, not patchlevel)
  55. * tools/tcl.hpj.in (not patchlevel, for windows installer)
  56. * tools/tcl.wse.in (for windows installer)
  57. * tools/tclSplash.bmp (not patchlevel)
  58. */
  59. //#define TCL_MAJOR_VERSION 8
  60. //#define TCL_MINOR_VERSION 4
  61. //#define TCL_RELEASE_LEVEL TCL_FINAL_RELEASE
  62. //#define TCL_RELEASE_SERIAL 18
  63. //#define TCL_VERSION "8.4"
  64. //#define TCL_PATCH_LEVEL "8.4.18"
  65. /*
  66. * The following definitions set up the proper options for Windows
  67. * compilers. We use this method because there is no autoconf equivalent.
  68. */
  69. //#if !__WIN32__
  70. //# if defined(_WIN32) || defined(WIN32) || defined(__MINGW32__) || defined(__BORLANDC__)
  71. //# define __WIN32__
  72. //# ifndef WIN32
  73. //# define WIN32
  74. //# endif
  75. //# endif
  76. //#endif
  77. /*
  78. * STRICT: See MSDN Article Q83456
  79. */
  80. //#if __WIN32__
  81. //# ifndef STRICT
  82. //# define STRICT
  83. //# endif
  84. //#endif // * __WIN32__ */
  85. /*
  86. * The following definitions set up the proper options for Macintosh
  87. * compilers. We use this method because there is no autoconf equivalent.
  88. */
  89. //#if MAC_TCL
  90. //#include <ConditionalMacros.h>
  91. //# ifndef USE_TCLALLOC
  92. //# define USE_TCLALLOC 1
  93. //# endif
  94. //# ifndef NO_STRERROR
  95. //# define NO_STRERROR 1
  96. //# endif
  97. //# define INLINE
  98. //#endif
  99. /*
  100. * Utility macros: STRINGIFY takes an argument and wraps it in "" (double
  101. * quotation marks), JOIN joins two arguments.
  102. */
  103. //#if !STRINGIFY
  104. //# define STRINGIFY(x) STRINGIFY1(x)
  105. //# define STRINGIFY1(x) #x
  106. //#endif
  107. //#if !JOIN
  108. //# define JOIN(a,b) JOIN1(a,b)
  109. //# define JOIN1(a,b) a##b
  110. //#endif
  111. /*
  112. * A special definition used to allow this header file to be included
  113. * from windows or mac resource files so that they can obtain version
  114. * information. RC_INVOKED is defined by default by the windows RC tool
  115. * and manually set for macintosh.
  116. *
  117. * Resource compilers don't like all the C stuff, like typedefs and
  118. * procedure declarations, that occur below, so block them out.
  119. */
  120. #if !RC_INVOKED
  121. /*
  122. * Special macro to define mutexes, that doesn't do anything
  123. * if we are not using threads.
  124. */
  125. #if TCL_THREADS
  126. //#define TCL_DECLARE_MUTEX(name) static Tcl_Mutex name;
  127. #else
  128. //#define TCL_DECLARE_MUTEX(name)
  129. #endif
  130. /*
  131. * Macros that eliminate the overhead of the thread synchronization
  132. * functions when compiling without thread support.
  133. */
  134. #if !TCL_THREADS
  135. //#define Tcl_MutexLock(mutexPtr)
  136. //#define Tcl_MutexUnlock(mutexPtr)
  137. //#define Tcl_MutexFinalize(mutexPtr)
  138. //#define Tcl_ConditionNotify(condPtr)
  139. //#define Tcl_ConditionWait(condPtr, mutexPtr, timePtr)
  140. //#define Tcl_ConditionFinalize(condPtr)
  141. #endif // * TCL_THREADS */
  142. //#if !BUFSIZ
  143. //# include <stdio.h>
  144. //#endif
  145. /*
  146. * Definitions that allow Tcl functions with variable numbers of
  147. * arguments to be used with either varargs.h or stdarg.h. TCL_VARARGS
  148. * is used in procedure prototypes. TCL_VARARGS_DEF is used to declare
  149. * the arguments in a function definiton: it takes the type and name of
  150. * the first argument and supplies the appropriate argument declaration
  151. * string for use in the function definition. TCL_VARARGS_START
  152. * initializes the va_list data structure and returns the first argument.
  153. */
  154. //#if !(NO_STDARG)
  155. //# include <stdarg.h>
  156. //# define TCL_VARARGS(type, name) (type name, ...)
  157. //# define TCL_VARARGS_DEF(type, name) (type name, ...)
  158. //# define TCL_VARARGS_START(type, name, list) (va_start(list, name), name)
  159. //#else
  160. //# include <varargs.h>
  161. //# define TCL_VARARGS(type, name) ()
  162. //# define TCL_VARARGS_DEF(type, name) (va_alist)
  163. //# define TCL_VARARGS_START(type, name, list) \
  164. // (va_start(list), va_arg(list, type))
  165. //#endif
  166. /*
  167. * Macros used to declare a function to be exported by a DLL.
  168. * Used by Windows, maps to no-op declarations on non-Windows systems.
  169. * The default build on windows is for a DLL, which causes the DLLIMPORT
  170. * and DLLEXPORT macros to be nonempty. To build a static library, the
  171. * macro STATIC_BUILD should be defined.
  172. */
  173. //#if STATIC_BUILD
  174. //# define DLLIMPORT
  175. //# define DLLEXPORT
  176. //#else
  177. //# if (defined(__WIN32__) && (defined(_MSC_VER) || (__BORLANDC__ >= 0x0550) || (defined(__GNUC__) && defined(__declspec)))) || (defined(MAC_TCL) && FUNCTION_DECLSPEC)
  178. //# define DLLIMPORT __declspec(dllimport)
  179. //# define DLLEXPORT __declspec(dllexport)
  180. //# else
  181. //# define DLLIMPORT
  182. //# define DLLEXPORT
  183. //# endif
  184. //#endif
  185. /*
  186. * These macros are used to control whether functions are being declared for
  187. * import or export. If a function is being declared while it is being built
  188. * to be included in a shared library, then it should have the DLLEXPORT
  189. * storage class. If is being declared for use by a module that is going to
  190. * link against the shared library, then it should have the DLLIMPORT storage
  191. * class. If the symbol is beind declared for a static build or for use from a
  192. * stub library, then the storage class should be empty.
  193. *
  194. * The convention is that a macro called BUILD_xxxx, where xxxx is the
  195. * name of a library we are building, is set on the compile line for sources
  196. * that are to be placed in the library. When this macro is set, the
  197. * storage class will be set to DLLEXPORT. At the end of the header file, the
  198. * storage class will be reset to DLLIMPORT.
  199. */
  200. //#undef TCL_STORAGE_CLASS
  201. //#if BUILD_tcl
  202. //# define TCL_STORAGE_CLASS DLLEXPORT
  203. //#else
  204. //# ifdef USE_TCL_STUBS
  205. //# define TCL_STORAGE_CLASS
  206. //# else
  207. //# define TCL_STORAGE_CLASS DLLIMPORT
  208. //# endif
  209. //#endif
  210. /*
  211. * Definitions that allow this header file to be used either with or
  212. * without ANSI C features like function prototypes.
  213. */
  214. //#undef _ANSI_ARGS_
  215. //#undef CONST
  216. //#if !INLINE
  217. //# define INLINE
  218. //#endif
  219. //#if !NO_CONST
  220. //# define CONST const
  221. //#else
  222. //# define CONST
  223. //#endif
  224. //#if !NO_PROTOTYPES
  225. //# define _ANSI_ARGS_(x) x
  226. //#else
  227. //# define _ANSI_ARGS_(x) ()
  228. //#endif
  229. //#if USE_NON_CONST
  230. //# ifdef USE_COMPAT_CONST
  231. //# error define at most one of USE_NON_CONST and USE_COMPAT_CONST
  232. //# endif
  233. //# define CONST84
  234. //# define CONST84_RETURN
  235. //#else
  236. //# ifdef USE_COMPAT_CONST
  237. //# define CONST84
  238. //# define CONST84_RETURN CONST
  239. //# else
  240. //# define CONST84 CONST
  241. //# define CONST84_RETURN CONST
  242. //# endif
  243. //#endif
  244. /*
  245. * Make sure EXTERN isn't defined elsewhere
  246. */
  247. //#if EXTERN
  248. //# undef EXTERN
  249. //#endif // * EXTERN */
  250. //#if __cplusplus
  251. //# define EXTERN extern "C" TCL_STORAGE_CLASS
  252. //#else
  253. //# define EXTERN extern TCL_STORAGE_CLASS
  254. //#endif
  255. /*
  256. * The following code is copied from winnt.h.
  257. * If we don't replicate it here, then <windows.h> can't be included
  258. * after tcl.h, since tcl.h also defines VOID.
  259. * This block is skipped under Cygwin and Mingw.
  260. *
  261. *
  262. */
  263. //#if (__WIN32__) && !HAVE_WINNT_IGNORE_VOID)
  264. //#if !VOID
  265. ////#define VOID void
  266. ////typedef char CHAR;
  267. ////typedef short SHORT;
  268. ////typedef long LONG;
  269. //#endif
  270. //#endif // * __WIN32__ && !HAVE_WINNT_IGNORE_VOID */
  271. /*
  272. * Macro to use instead of "void" for arguments that must have
  273. * type "void *" in ANSI C; maps them to type "char *" in
  274. * non-ANSI systems.
  275. */
  276. //#if !NO_VOID
  277. //# define VOID void
  278. //#else
  279. //# define VOID char
  280. //#endif
  281. ///*
  282. //* Miscellaneous declarations.
  283. //*/
  284. //#if !_CLIENTDATA
  285. //# ifndef NO_VOID
  286. //// typedef void *ClientData;
  287. //# else
  288. //// typedef int *ClientData;
  289. //# endif
  290. //# define _CLIENTDATA
  291. //#endif
  292. /*
  293. * Darwin specifc configure overrides (to support fat compiles, where
  294. * configure runs only once for multiple architectures):
  295. */
  296. //#if __APPLE__
  297. //# ifdef __LP64__
  298. //# undef TCL_WIDE_INT_TYPE
  299. //# define TCL_WIDE_INT_IS_LONG 1
  300. //# else /* !__LP64__ */
  301. //# define TCL_WIDE_INT_TYPE long long
  302. //# undef TCL_WIDE_INT_IS_LONG
  303. //# endif /* __LP64__ */
  304. //# undef HAVE_STRUCT_STAT64
  305. //#endif // * __APPLE__ */
  306. /*
  307. * Define Tcl_WideInt to be a type that is (at least) 64-bits wide,
  308. * and define Tcl_Wideu32 to be the unsigned variant of that type
  309. * (assuming that where we have one, we can have the other.)
  310. *
  311. * Also defines the following macros:
  312. * TCL_WIDE_INT_IS_LONG - if wide ints are really longs (i.e. we're on
  313. * a real 64-bit system.)
  314. * Tcl_WideAsLong - forgetful converter from wideInt to long.
  315. * Tcl_LongAsWide - sign-extending converter from long to wideInt.
  316. * Tcl_WideAsDouble - converter from wideInt to double.
  317. * Tcl_DoubleAsWide - converter from double to wideInt.
  318. *
  319. * The following invariant should hold for any long value 'longVal':
  320. * longVal == TCL.Tcl_WideAsLong(Tcl_LongAsWide(longVal))
  321. *
  322. * Note on converting between Tcl_WideInt and strings. This
  323. * implementation (in tclObj.c) depends on the functions strtoull()
  324. * and sprintf(...,"%" TCL_LL_MODIFIER "d",...). TCL_LL_MODIFIER_SIZE
  325. * is the length of the modifier string, which is "ll" on most 32-bit
  326. * Unix systems. It has to be split up like this to allow for the more
  327. * complex formats sometimes needed (e.g. in the format(n) command.)
  328. */
  329. //#if !(TCL_WIDE_INT_TYPE)&&!TCL_WIDE_INT_IS_LONG)
  330. //# if defined(__GNUC__)
  331. //# define TCL_WIDE_INT_TYPE long long
  332. //# if defined(__WIN32__) && !__CYGWIN__)
  333. //# define TCL_LL_MODIFIER "I64"
  334. //# define TCL_LL_MODIFIER_SIZE 3
  335. //# else
  336. //# define TCL_LL_MODIFIER "L"
  337. //# define TCL_LL_MODIFIER_SIZE 1
  338. //# endif
  339. ////typedef struct stat Tcl_StatBuf;
  340. //# elif defined(__WIN32__)
  341. //# define TCL_WIDE_INT_TYPE __int64
  342. //# ifdef __BORLANDC__
  343. ////typedef struct stati64 Tcl_StatBuf;
  344. //# define TCL_LL_MODIFIER "L"
  345. //# define TCL_LL_MODIFIER_SIZE 1
  346. //# else /* __BORLANDC__ */
  347. //# if _MSC_VER < 1400 || !_M_IX86)
  348. ////typedef struct _stati64 Tcl_StatBuf;
  349. //# else
  350. ////typedef struct _stat64 Tcl_StatBuf;
  351. //# endif /* _MSC_VER < 1400 */
  352. //# define TCL_LL_MODIFIER "I64"
  353. //# define TCL_LL_MODIFIER_SIZE 3
  354. //# endif /* __BORLANDC__ */
  355. //# else /* __WIN32__ */
  356. ///*
  357. //* Don't know what platform it is and configure hasn't discovered what
  358. //* is going on for us. Try to guess...
  359. //*/
  360. //# ifdef NO_LIMITS_H
  361. //# error please define either TCL_WIDE_INT_TYPE or TCL_WIDE_INT_IS_LONG
  362. //# else /* !NO_LIMITS_H */
  363. //# include <limits.h>
  364. //# if (INT_MAX < LONG_MAX)
  365. //# define TCL_WIDE_INT_IS_LONG 1
  366. //# else
  367. //# define TCL_WIDE_INT_TYPE long long
  368. //# endif
  369. //# endif /* NO_LIMITS_H */
  370. //# endif /* __WIN32__ */
  371. //#endif // * !TCL_WIDE_INT_TYPE & !TCL_WIDE_INT_IS_LONG */
  372. //#if TCL_WIDE_INT_IS_LONG
  373. //# undef TCL_WIDE_INT_TYPE
  374. //# define TCL_WIDE_INT_TYPE long
  375. //#endif // * TCL_WIDE_INT_IS_LONG */
  376. ////typedef TCL_WIDE_INT_TYPE Tcl_WideInt;
  377. ////typedef unsigned TCL_WIDE_INT_TYPE Tcl_Wideu32;
  378. //#if TCL_WIDE_INT_IS_LONG
  379. ////typedef struct stat Tcl_StatBuf;
  380. //# define Tcl_WideAsLong(val) ((long)(val))
  381. //# define Tcl_LongAsWide(val) ((long)(val))
  382. //# define Tcl_WideAsDouble(val) ((double)((long)(val)))
  383. //# define Tcl_DoubleAsWide(val) ((long)((double)(val)))
  384. //# ifndef TCL_LL_MODIFIER
  385. //# define TCL_LL_MODIFIER "l"
  386. //# define TCL_LL_MODIFIER_SIZE 1
  387. //# endif /* !TCL_LL_MODIFIER */
  388. //#else /* TCL_WIDE_INT_IS_LONG */
  389. ///*
  390. //* The next short section of defines are only done when not running on
  391. //* Windows or some other strange platform.
  392. //*/
  393. //# ifndef TCL_LL_MODIFIER
  394. //# ifdef HAVE_STRUCT_STAT64
  395. ////typedef struct stat64 Tcl_StatBuf;
  396. //# else
  397. ////typedef struct stat Tcl_StatBuf;
  398. //# endif /* HAVE_STRUCT_STAT64 */
  399. //# define TCL_LL_MODIFIER "ll"
  400. //# define TCL_LL_MODIFIER_SIZE 2
  401. //# endif /* !TCL_LL_MODIFIER */
  402. //# define Tcl_WideAsLong(val) ((long)((Tcl_WideInt)(val)))
  403. //# define Tcl_LongAsWide(val) ((Tcl_WideInt)((long)(val)))
  404. //# define Tcl_WideAsDouble(val) ((double)((Tcl_WideInt)(val)))
  405. //# define Tcl_DoubleAsWide(val) ((Tcl_WideInt)((double)(val)))
  406. //#endif // * TCL_WIDE_INT_IS_LONG */
  407. /*
  408. * This flag controls whether binary compatability is maintained with
  409. * extensions built against a previous version of Tcl. This is true
  410. * by default.
  411. */
  412. //#if !TCL_PRESERVE_BINARY_COMPATABILITY
  413. //# define TCL_PRESERVE_BINARY_COMPATABILITY 1
  414. //#endif
  415. /*
  416. * Data structures defined opaquely in this module. The definitions below
  417. * just provide dummy types. A few fields are made visible in Tcl_Interp
  418. * structures, namely those used for returning a string result from
  419. * commands. Direct access to the result field is discouraged in Tcl 8.0.
  420. * The interpreter result is either an object or a string, and the two
  421. * values are kept consistent unless some C code sets interp.result
  422. * directly. Programmers should use either the procedure Tcl_GetObjResult()
  423. * or Tcl_GetStringResult() to read the interpreter's result. See the
  424. * SetResult man page for details.
  425. *
  426. * Note: any change to the Tcl_Interp definition below must be mirrored
  427. * in the "real" definition in tclInt.h.
  428. *
  429. * Note: Tcl_ObjCmdProc procedures do not directly set result and freeProc.
  430. * Instead, they set a Tcl_Obj member in the "real" structure that can be
  431. * accessed with Tcl_GetObjResult() and Tcl_SetObjResult().
  432. */
  433. //typedef struct Tcl_Interp {
  434. // char *result; /* If the last command returned a string
  435. // * result, this points to it. */
  436. // void (*freeProc) _ANSI_ARGS_((char *blockPtr));
  437. // /* Zero means the string result is
  438. // * statically allocated. TCL_DYNAMIC means
  439. // * it was allocated with ckalloc and should
  440. // * be freed with ckfree. Other values give
  441. // * the address of procedure to invoke to
  442. // * free the result. Tcl_Eval must free it
  443. // * before executing next command. */
  444. // int errorLine; /* When TCL_ERROR is returned, this gives
  445. // * the line number within the command where
  446. // * the error occurred (1 if first line). */
  447. //} Tcl_Interp;
  448. //typedef struct Tcl_AsyncHandler_ *Tcl_AsyncHandler;
  449. //typedef struct Tcl_Channel_ *Tcl_Channel;
  450. //typedef struct Tcl_Command_ *Tcl_Command;
  451. //typedef struct Tcl_Condition_ *Tcl_Condition;
  452. //typedef struct Tcl_EncodingState_ *Tcl_EncodingState;
  453. //typedef struct Tcl_Encoding_ *Tcl_Encoding;
  454. //typedef struct Tcl_Event Tcl_Event;
  455. //typedef struct Tcl_Mutex_ *Tcl_Mutex;
  456. //typedef struct Tcl_Pid_ *Tcl_Pid;
  457. //typedef struct Tcl_RegExp_ *Tcl_RegExp;
  458. //typedef struct Tcl_ThreadDataKey_ *Tcl_ThreadDataKey;
  459. //typedef struct Tcl_ThreadId_ *Tcl_ThreadId;
  460. //typedef struct Tcl_TimerToken_ *Tcl_TimerToken;
  461. //typedef struct Tcl_Trace_ *Tcl_Trace;
  462. //typedef struct Tcl_Var_ *Tcl_Var;
  463. //typedef struct Tcl_ChannelTypeVersion_ *Tcl_ChannelTypeVersion;
  464. //typedef struct Tcl_LoadHandle_ *Tcl_LoadHandle;
  465. /*
  466. * Definition of the interface to procedures implementing threads.
  467. * A procedure following this definition is given to each call of
  468. * 'Tcl_CreateThread' and will be called as the main fuction of
  469. * the new thread created by that call.
  470. */
  471. //#if MAC_TCL
  472. ////typedef pascal void *(Tcl_ThreadCreateProc) _ANSI_ARGS_((ClientData clientData));
  473. //#elif defined __WIN32__
  474. ////typedef unsigned (__stdcall Tcl_ThreadCreateProc) _ANSI_ARGS_((ClientData clientData));
  475. //#else
  476. ////typedef void (Tcl_ThreadCreateProc) _ANSI_ARGS_((ClientData clientData));
  477. //#endif
  478. /*
  479. * Threading function return types used for abstracting away platform
  480. * differences when writing a Tcl_ThreadCreateProc. See the NewThread
  481. * function in generic/tclThreadTest.c for it's usage.
  482. */
  483. //#if MAC_TCL
  484. //# define Tcl_ThreadCreateType pascal void *
  485. //# define TCL_THREAD_CREATE_RETURN return NULL
  486. //#elif defined __WIN32__
  487. //# define Tcl_ThreadCreateType unsigned __stdcall
  488. //# define TCL_THREAD_CREATE_RETURN return 0
  489. //#else
  490. //# define Tcl_ThreadCreateType void
  491. //# define TCL_THREAD_CREATE_RETURN
  492. //#endif
  493. /*
  494. * Definition of values for default stacksize and the possible flags to be
  495. * given to Tcl_CreateThread.
  496. */
  497. //#define TCL_THREAD_STACK_DEFAULT (0) /* Use default size for stack */
  498. //#define TCL_THREAD_NOFLAGS (0000) /* Standard flags, default behavior */
  499. //#define TCL_THREAD_JOINABLE (0001) /* Mark the thread as joinable */
  500. /*
  501. * Flag values passed to Tcl_GetRegExpFromObj.
  502. */
  503. //#define TCL_REG_BASIC 000000 /* BREs (convenience) */
  504. //#define TCL_REG_EXTENDED 000001 /* EREs */
  505. //#define TCL_REG_ADVF 000002 /* advanced features in EREs */
  506. //#define TCL_REG_ADVANCED 000003 /* AREs (which are also EREs) */
  507. //#define TCL_REG_QUOTE 000004 /* no special characters, none */
  508. //#define TCL_REG_NOCASE 000010 /* ignore case */
  509. //#define TCL_REG_NOSUB 000020 /* don't care about subexpressions */
  510. //#define TCL_REG_EXPANDED 000040 /* expanded format, white space &
  511. // * comments */
  512. //#define TCL_REG_NLSTOP 000100 /* \n doesn't match . or [^ ] */
  513. //#define TCL_REG_NLANCH 000200 /* ^ matches after \n, $ before */
  514. //#define TCL_REG_NEWLINE 000300 /* newlines are line terminators */
  515. //#define TCL_REG_CANMATCH 001000 /* report details on partial/limited
  516. // * matches */
  517. /*
  518. * The following flag is experimental and only intended for use by Expect. It
  519. * will probably go away in a later release.
  520. */
  521. //#define TCL_REG_BOSONLY 002000 /* prepend \A to pattern so it only
  522. // * matches at the beginning of the
  523. // * string. */
  524. /*
  525. * Flags values passed to Tcl_RegExpExecObj.
  526. */
  527. //#define TCL_REG_NOTBOL 0001 /* Beginning of string does not match ^. */
  528. //#define TCL_REG_NOTEOL 0002 /* End of string does not match $. */
  529. /*
  530. * Structures filled in by Tcl_RegExpInfo. Note that all offset values are
  531. * relative to the start of the match string, not the beginning of the
  532. * entire string.
  533. */
  534. //typedef struct Tcl_RegExpIndices {
  535. // long start; /* character offset of first character in match */
  536. // long end; /* character offset of first character after the
  537. // * match. */
  538. //} Tcl_RegExpIndices;
  539. //typedef struct Tcl_RegExpInfo {
  540. // int nsubs; /* number of subexpressions in the
  541. // * compiled expression */
  542. // Tcl_RegExpIndices *matches; /* array of nsubs match offset
  543. // * pairs */
  544. // long extendStart; /* The offset at which a subsequent
  545. // * match might begin. */
  546. // long reserved; /* Reserved for later use. */
  547. //} Tcl_RegExpInfo;
  548. /*
  549. * Picky compilers complain if this typdef doesn't appear before the
  550. * struct's reference in tclDecls.h.
  551. */
  552. //typedef Tcl_StatBuf *Tcl_Stat_;
  553. //typedef struct stat *Tcl_OldStat_;
  554. /*
  555. * When a TCL command returns, the interpreter contains a result from the
  556. * command. Programmers are strongly encouraged to use one of the
  557. * procedures Tcl_GetObjResult() or Tcl_GetStringResult() to read the
  558. * interpreter's result. See the SetResult man page for details. Besides
  559. * this result, the command procedure returns an integer code, which is
  560. * one of the following:
  561. *
  562. * TCL_OK Command completed normally; the interpreter's
  563. * result contains the command's result.
  564. * TCL_ERROR The command couldn't be completed successfully;
  565. * the interpreter's result describes what went wrong.
  566. * TCL_RETURN The command requests that the current procedure
  567. * return; the interpreter's result contains the
  568. * procedure's return value.
  569. * TCL_BREAK The command requests that the innermost loop
  570. * be exited; the interpreter's result is meaningless.
  571. * TCL_CONTINUE Go on to the next iteration of the current loop;
  572. * the interpreter's result is meaningless.
  573. */
  574. public const int TCL_OK = 0;
  575. public const int TCL_ERROR = 1;
  576. public const int TCL_RETURN = 2;
  577. public const int TCL_BREAK = 3;
  578. public const int TCL_CONTINUE = 4;
  579. //#define TCL_RESULT_SIZE 200
  580. /*
  581. * Flags to control what substitutions are performed by Tcl_SubstObj():
  582. */
  583. //#define TCL_SUBST_COMMANDS 001
  584. //#define TCL_SUBST_VARIABLES 002
  585. //#define TCL_SUBST_BACKSLASHES 004
  586. //#define TCL_SUBST_ALL 007
  587. /*
  588. * Argument descriptors for math function callbacks in expressions:
  589. */
  590. //typedef enum {
  591. // TCL_INT, TCL.TCL_DOUBLE, TCL.TCL_EITHER, TCL.TCL_WIDE_INT
  592. //} Tcl_ValueType;
  593. //typedef struct Tcl_Value {
  594. // Tcl_ValueType type; /* Indicates intValue or doubleValue is
  595. // * valid, or both. */
  596. // long intValue; /* Integer value. */
  597. // double doubleValue; /* Double-precision floating value. */
  598. // Tcl_WideInt wideValue; /* Wide (min. 64-bit) integer value. */
  599. //} Tcl_Value;
  600. /*
  601. * Forward declaration of Tcl_Obj to prevent an error when the forward
  602. * reference to Tcl_Obj is encountered in the procedure types declared
  603. * below.
  604. */
  605. //struct Tcl_Obj;
  606. /*
  607. * Procedure types defined by Tcl:
  608. */
  609. //typedef int (Tcl_AppInitProc) _ANSI_ARGS_((Tcl_Interp interp));
  610. //typedef int (Tcl_AsyncProc) _ANSI_ARGS_((ClientData clientData,
  611. // Tcl_Interp interp, int code));
  612. //typedef void (Tcl_ChannelProc) _ANSI_ARGS_((ClientData clientData, int mask));
  613. //typedef void (Tcl_CloseProc) _ANSI_ARGS_((ClientData data));
  614. //typedef void (Tcl_CmdDeleteProc) _ANSI_ARGS_((ClientData clientData));
  615. //typedef int (Tcl_CmdProc) _ANSI_ARGS_((ClientData clientData,
  616. // Tcl_Interp interp, int argc, CONST84 char *argv[]));
  617. //typedef void (Tcl_CmdTraceProc) _ANSI_ARGS_((ClientData clientData,
  618. // Tcl_Interp interp, int level, char *command, TCL.TCL_CmdProc proc,
  619. // ClientData cmdClientData, int argc, CONST84 char *argv[]));
  620. //typedef int (Tcl_CmdObjTraceProc) _ANSI_ARGS_((ClientData clientData,
  621. // Tcl_Interp interp, int level, string command,
  622. // Tcl_Command commandInfo, int objc, struct Tcl_Obj * CONST * objv));
  623. //typedef void (Tcl_CmdObjTraceDeleteProc) _ANSI_ARGS_((ClientData clientData));
  624. //typedef void (Tcl_DupInternalRepProc) _ANSI_ARGS_((struct Tcl_Obj *srcPtr,
  625. // struct Tcl_Obj *dupPtr));
  626. //typedef int (Tcl_EncodingConvertProc)_ANSI_ARGS_((ClientData clientData,
  627. // string src, int srcLen, int flags, TCL.TCL_EncodingState *statePtr,
  628. // char *dst, int dstLen, int *srcReadPtr, int *dstWrotePtr,
  629. // int *dstCharsPtr));
  630. //typedef void (Tcl_EncodingFreeProc)_ANSI_ARGS_((ClientData clientData));
  631. //typedef int (Tcl_EventProc) _ANSI_ARGS_((Tcl_Event *evPtr, int flags));
  632. //typedef void (Tcl_EventCheckProc) _ANSI_ARGS_((ClientData clientData,
  633. // int flags));
  634. //typedef int (Tcl_EventDeleteProc) _ANSI_ARGS_((Tcl_Event *evPtr,
  635. // ClientData clientData));
  636. //typedef void (Tcl_EventSetupProc) _ANSI_ARGS_((ClientData clientData,
  637. // int flags));
  638. //typedef void (Tcl_ExitProc) _ANSI_ARGS_((ClientData clientData));
  639. //typedef void (Tcl_FileProc) _ANSI_ARGS_((ClientData clientData, int mask));
  640. //typedef void (Tcl_FileFreeProc) _ANSI_ARGS_((ClientData clientData));
  641. //typedef void (Tcl_FreeInternalRepProc) _ANSI_ARGS_((struct Tcl_Obj *objPtr));
  642. //typedef void (Tcl_FreeProc) _ANSI_ARGS_((char *blockPtr));
  643. //typedef void (Tcl_IdleProc) _ANSI_ARGS_((ClientData clientData));
  644. //typedef void (Tcl_InterpDeleteProc) _ANSI_ARGS_((ClientData clientData,
  645. // Tcl_Interp interp));
  646. //typedef int (Tcl_MathProc) _ANSI_ARGS_((ClientData clientData,
  647. // Tcl_Interp interp, TCL.TCL_Value *args, TCL.TCL_Value *resultPtr));
  648. //typedef void (Tcl_NamespaceDeleteProc) _ANSI_ARGS_((ClientData clientData));
  649. //typedef int (Tcl_ObjCmdProc) _ANSI_ARGS_((ClientData clientData,
  650. // Tcl_Interp interp, int objc, struct Tcl_Obj * CONST * objv));
  651. //typedef int (Tcl_PackageInitProc) _ANSI_ARGS_((Tcl_Interp interp));
  652. //typedef void (Tcl_PanicProc) _ANSI_ARGS_(TCL_VARARGS(string , format));
  653. //typedef void (Tcl_TcpAcceptProc) _ANSI_ARGS_((ClientData callbackData,
  654. // Tcl_Channel chan, char *address, int port));
  655. //typedef void (Tcl_TimerProc) _ANSI_ARGS_((ClientData clientData));
  656. //typedef int (Tcl_SetFromAnyProc) _ANSI_ARGS_((Tcl_Interp interp,
  657. // struct Tcl_Obj *objPtr));
  658. //typedef void (Tcl_UpdateStringProc) _ANSI_ARGS_((struct Tcl_Obj *objPtr));
  659. //typedef char *(Tcl_VarTraceProc) _ANSI_ARGS_((ClientData clientData,
  660. // Tcl_Interp interp, CONST84 char part1, CONST84 char part2, int flags));
  661. //typedef void (Tcl_CommandTraceProc) _ANSI_ARGS_((ClientData clientData,
  662. // Tcl_Interp interp, string oldName, string newName,
  663. // int flags));
  664. //typedef void (Tcl_CreateFileHandlerProc) _ANSI_ARGS_((int fd, int mask,
  665. // Tcl_FileProc proc, ClientData clientData));
  666. //typedef void (Tcl_DeleteFileHandlerProc) _ANSI_ARGS_((int fd));
  667. //typedef void (Tcl_AlertNotifierProc) _ANSI_ARGS_((ClientData clientData));
  668. //typedef void (Tcl_ServiceModeHookProc) _ANSI_ARGS_((int mode));
  669. //typedef ClientData (Tcl_InitNotifierProc) _ANSI_ARGS_((VOID));
  670. //typedef void (Tcl_FinalizeNotifierProc) _ANSI_ARGS_((ClientData clientData));
  671. //typedef void (Tcl_MainLoopProc) _ANSI_ARGS_((void));
  672. /*
  673. * The following structure represents a type of object, which is a
  674. * particular internal representation for an object plus a set of
  675. * procedures that provide standard operations on objects of that type.
  676. */
  677. //typedef struct Tcl_ObjType {
  678. // char *name; /* Name of the type, e.g. "int". */
  679. // Tcl_FreeInternalRepProc *freeIntRepProc;
  680. // /* Called to free any storage for the type's
  681. // * internal rep. NULL if the internal rep
  682. // * does not need freeing. */
  683. // Tcl_DupInternalRepProc *dupIntRepProc;
  684. // /* Called to create a new object as a copy
  685. // * of an existing object. */
  686. // Tcl_UpdateStringProc *updateStringProc;
  687. // /* Called to update the string rep from the
  688. // * type's internal representation. */
  689. // Tcl_SetFromAnyProc *setFromAnyProc;
  690. // /* Called to convert the object's internal
  691. // * rep to this type. Frees the internal rep
  692. // * of the old type. Returns TCL_ERROR on
  693. // * failure. */
  694. //} Tcl_ObjType;
  695. /*
  696. * One of the following structures exists for each object in the Tcl
  697. * system. An object stores a value as either a string, some internal
  698. * representation, or both.
  699. */
  700. //typedef struct Tcl_Obj {
  701. // int refCount; /* When 0 the object will be freed. */
  702. // char *bytes; /* This points to the first byte of the
  703. // * object's string representation. The array
  704. // * must be followed by a null byte (i.e., at
  705. // * offset length) but may also contain
  706. // * embedded null characters. The array's
  707. // * storage is allocated by ckalloc. NULL
  708. // * means the string rep is invalid and must
  709. // * be regenerated from the internal rep.
  710. // * Clients should use Tcl_GetStringFromObj
  711. // * or Tcl_GetString to get a pointer to the
  712. // * byte array as a readonly value. */
  713. // int length; /* The number of bytes at *bytes, not
  714. // * including the terminating null. */
  715. // Tcl_ObjType *typePtr; /* Denotes the object's type. Always
  716. // * corresponds to the type of the object's
  717. // * internal rep. NULL indicates the object
  718. // * has no internal rep (has no type). */
  719. // union { /* The internal representation: */
  720. // long longValue; /* - an long integer value */
  721. // double doubleValue; /* - a double-precision floating value */
  722. // VOID *otherValuePtr; /* - another, type-specific value */
  723. // Tcl_WideInt wideValue; /* - a long long value */
  724. // struct { /* - internal rep as two pointers */
  725. // VOID ptr1;
  726. // VOID ptr2;
  727. // } twoPtrValue;
  728. // } internalRep;
  729. //} Tcl_Obj;
  730. /*
  731. * Macros to increment and decrement a Tcl_Obj's reference count, and to
  732. * test whether an object is shared (i.e. has reference count > 1).
  733. * Note: clients should use Tcl_DecrRefCount() when they are finished using
  734. * an object, and should never call TclFreeObj() directly. TclFreeObj() is
  735. * only defined and made public in tcl.h to support Tcl_DecrRefCount's macro
  736. * definition. Note also that Tcl_DecrRefCount() refers to the parameter
  737. * "obj" twice. This means that you should avoid calling it with an
  738. * expression that is expensive to compute or has side effects.
  739. */
  740. //void Tcl_IncrRefCount _ANSI_ARGS_((Tcl_Obj *objPtr));
  741. //void Tcl_DecrRefCount _ANSI_ARGS_((Tcl_Obj *objPtr));
  742. //int Tcl_IsShared _ANSI_ARGS_((Tcl_Obj *objPtr));
  743. //#if TCL_MEM_DEBUG
  744. //# define Tcl_IncrRefCount(objPtr) \
  745. //// Tcl_DbIncrRefCount(objPtr, __FILE__, __LINE__)
  746. //# define Tcl_DecrRefCount(objPtr) \
  747. //// Tcl_DbDecrRefCount(objPtr, __FILE__, __LINE__)
  748. //# define Tcl_IsShared(objPtr) \
  749. //// Tcl_DbIsShared(objPtr, __FILE__, __LINE__)
  750. //#else
  751. //# define Tcl_IncrRefCount(objPtr) \
  752. //// ++(objPtr)->refCount
  753. //// /*
  754. //// * Use do/while0 idiom for optimum correctness without compiler warnings
  755. //// * http://c2.com/cgi/wiki?TrivialDoWhileLoop
  756. //// */
  757. //# define Tcl_DecrRefCount(objPtr) \
  758. //// do { if (--(objPtr)->refCount <= 0) TclFreeObj(objPtr); } while(0)
  759. //# define Tcl_IsShared(objPtr) \
  760. //// ((objPtr)->refCount > 1)
  761. //#endif
  762. /*
  763. * Macros and definitions that help to debug the use of Tcl objects.
  764. * When TCL_MEM_DEBUG is defined, the Tcl_New declarations are
  765. * overridden to call debugging versions of the object creation procedures.
  766. */
  767. //#if TCL_MEM_DEBUG
  768. //# define Tcl_NewBooleanObj(val) \
  769. //// Tcl_DbNewBooleanObj(val, __FILE__, __LINE__)
  770. //# define Tcl_NewByteArrayObj(bytes, len) \
  771. //// Tcl_DbNewByteArrayObj(bytes, len, __FILE__, __LINE__)
  772. //# define Tcl_NewDoubleObj(val) \
  773. //// Tcl_DbNewDoubleObj(val, __FILE__, __LINE__)
  774. //# define Tcl_NewIntObj(val) \
  775. //// Tcl_DbNewLongObj(val, __FILE__, __LINE__)
  776. //# define Tcl_NewListObj(objc, objv) \
  777. //// Tcl_DbNewListObj(objc, objv, __FILE__, __LINE__)
  778. //# define Tcl_NewLongObj(val) \
  779. //// Tcl_DbNewLongObj(val, __FILE__, __LINE__)
  780. //# define Tcl_NewObj() \
  781. //// Tcl_DbNewObj(__FILE__, __LINE__)
  782. //# define Tcl_NewStringObj(bytes, len) \
  783. //// Tcl_DbNewStringObj(bytes, len, __FILE__, __LINE__)
  784. //# define Tcl_NewWideIntObj(val) \
  785. //// Tcl_DbNewWideIntObj(val, __FILE__, __LINE__)
  786. //#endif // * TCL_MEM_DEBUG */
  787. /*
  788. * The following structure contains the state needed by
  789. * Tcl_SaveResult. No-one outside of Tcl should access any of these
  790. * fields. This structure is typically allocated on the stack.
  791. */
  792. //typedef struct Tcl_SavedResult {
  793. // char *result;
  794. // Tcl_FreeProc *freeProc;
  795. // Tcl_Obj *objResultPtr;
  796. // char *appendResult;
  797. // int appendAvl;
  798. // int appendUsed;
  799. // char resultSpace[TCL_RESULT_SIZE+1];
  800. //} Tcl_SavedResult;
  801. /*
  802. * The following definitions support Tcl's namespace facility.
  803. * Note: the first five fields must match exactly the fields in a
  804. * Namespace structure (see tclInt.h).
  805. */
  806. //typedef struct Tcl_Namespace {
  807. // char *name; /* The namespace's name within its parent
  808. // * namespace. This contains no ::'s. The
  809. // * name of the global namespace is ""
  810. // * although "::" is an synonym. */
  811. // char *fullName; /* The namespace's fully qualified name.
  812. // * This starts with ::. */
  813. // ClientData clientData; /* Arbitrary value associated with this
  814. // * namespace. */
  815. // Tcl_NamespaceDeleteProc* deleteProc;
  816. // /* Procedure invoked when deleting the
  817. // * namespace to, e.g., free clientData. */
  818. // struct Tcl_Namespace* parentPtr;
  819. // /* Points to the namespace that contains
  820. // * this one. NULL if this is the global
  821. // * namespace. */
  822. //} Tcl_Namespace;
  823. /*
  824. * The following structure represents a call frame, or activation record.
  825. * A call frame defines a naming context for a procedure call: its local
  826. * scope (for local variables) and its namespace scope (used for non-local
  827. * variables; often the global :: namespace). A call frame can also define
  828. * the naming context for a namespace eval or namespace inscope command:
  829. * the namespace in which the command's code should execute. The
  830. * Tcl_CallFrame structures exist only while procedures or namespace
  831. * eval/inscope's are being executed, and provide a Tcl call stack.
  832. *
  833. * A call frame is initialized and pushed using Tcl_PushCallFrame and
  834. * popped using Tcl_PopCallFrame. Storage for a Tcl_CallFrame must be
  835. * provided by the Tcl_PushCallFrame caller, and callers typically allocate
  836. * them on the C call stack for efficiency. For this reason, TCL.TCL_CallFrame
  837. * is defined as a structure and not as an opaque token. However, most
  838. * Tcl_CallFrame fields are hidden since applications should not access
  839. * them directly; others are declared as "dummyX".
  840. *
  841. * WARNING!! The structure definition must be kept consistent with the
  842. * CallFrame structure in tclInt.h. If you change one, change the other.
  843. */
  844. //typedef struct Tcl_CallFrame {
  845. // Tcl_Namespace *nsPtr;
  846. // int dummy1;
  847. // int dummy2;
  848. // char *dummy3;
  849. // char *dummy4;
  850. // char *dummy5;
  851. // int dummy6;
  852. // char *dummy7;
  853. // char *dummy8;
  854. // int dummy9;
  855. // char* dummy10;
  856. //} Tcl_CallFrame;
  857. /*
  858. * Information about commands that is returned by Tcl_GetCommandInfo and
  859. * passed to Tcl_SetCommandInfo. objProc is an objc/objv object-based
  860. * command procedure while proc is a traditional Tcl argc/argv
  861. * string-based procedure. Tcl_CreateObjCommand and Tcl_CreateCommand
  862. * ensure that both objProc and proc are non-NULL and can be called to
  863. * execute the command. However, it may be faster to call one instead of
  864. * the other. The member isNativeObjectProc is set to 1 if an
  865. * object-based procedure was registered by Tcl_CreateObjCommand, and to
  866. * 0 if a string-based procedure was registered by Tcl_CreateCommand.
  867. * The other procedure is typically set to a compatibility wrapper that
  868. * does string-to-object or object-to-string argument conversions then
  869. * calls the other procedure.
  870. */
  871. //typedef struct Tcl_CmdInfo {
  872. // int isNativeObjectProc; /* 1 if objProc was registered by a call to
  873. // * Tcl_CreateObjCommand; 0 otherwise.
  874. // * Tcl_SetCmdInfo does not modify this
  875. // * field. */
  876. // Tcl_ObjCmdProc *objProc; /* Command's object-based procedure. */
  877. // ClientData objClientData; /* ClientData for object proc. */
  878. // Tcl_CmdProc proc; /* Command's string-based procedure. */
  879. // ClientData clientData; /* ClientData for string proc. */
  880. // Tcl_CmdDeleteProc *deleteProc;
  881. // /* Procedure to call when command is
  882. // * deleted. */
  883. // ClientData deleteData; /* Value to pass to deleteProc (usually
  884. // * the same as clientData). */
  885. // Tcl_Namespace *namespacePtr; /* Points to the namespace that contains
  886. // * this command. Note that Tcl_SetCmdInfo
  887. // * will not change a command's namespace;
  888. // * use Tcl_RenameCommand to do that. */
  889. //} Tcl_CmdInfo;
  890. /*
  891. * The structure defined below is used to hold dynamic strings. The only
  892. * field that clients should use is the string field, accessible via the
  893. * macro Tcl_DStringValue.
  894. */
  895. //#define TCL_DSTRING_STATIC_SIZE 200
  896. //typedef struct Tcl_DString {
  897. // char *string; /* Points to beginning of string: either
  898. // * staticSpace below or a malloced array. */
  899. // int length; /* Number of non-NULL characters in the
  900. // * string. */
  901. // int spaceAvl; /* Total number of bytes available for the
  902. // * string and its terminating NULL char. */
  903. // char staticSpace[TCL_DSTRING_STATIC_SIZE];
  904. // /* Space to use in common case where string
  905. // * is small. */
  906. //} Tcl_DString;
  907. //#define Tcl_DStringLength(dsPtr) ((dsPtr)->length)
  908. //#define Tcl_DStringValue(dsPtr) ((dsPtr)->string)
  909. //#define Tcl_DStringTrunc Tcl_DStringSetLength
  910. /*
  911. * Definitions for the maximum number of digits of precision that may
  912. * be specified in the "tcl_precision" variable, and the number of
  913. * bytes of buffer space required by Tcl_PrintDouble.
  914. */
  915. //#define TCL_MAX_PREC 17
  916. //#define TCL_DOUBLE_SPACE (TCL_MAX_PREC+10)
  917. /*
  918. * Definition for a number of bytes of buffer space sufficient to hold the
  919. * string representation of an integer in base 10 (assuming the existence
  920. * of 64-bit integers).
  921. */
  922. //#define TCL_INTEGER_SPACE 24
  923. /*
  924. * Flag that may be passed to Tcl_ConvertElement to force it not to
  925. * output braces (careful! if you change this flag be sure to change
  926. * the definitions at the front of tclUtil.c).
  927. */
  928. //#define TCL_DONT_USE_BRACES 1
  929. /*
  930. * Flag that may be passed to Tcl_GetIndexFromObj to force it to disallow
  931. * abbreviated strings.
  932. */
  933. //#define TCL_EXACT 1
  934. /*
  935. * Flag values passed to Tcl_RecordAndEval and/or Tcl_EvalObj.
  936. * WARNING: these bit choices must not conflict with the bit choices
  937. * for evalFlag bits in tclInt.h!!
  938. */
  939. public const int TCL_NO_EVAL = 0x10000;
  940. public const int TCL_EVAL_GLOBAL = 0x20000;
  941. public const int TCL_EVAL_DIRECT = 0x40000;
  942. public const int TCL_EVAL_INVOKE = 0x80000;
  943. /*
  944. * Special freeProc values that may be passed to Tcl_SetResult (see
  945. * the man page for details):
  946. */
  947. public const int TCL_VOLATILE = 1;//((Tcl_FreeProc ) 1)
  948. public const int TCL_STATIC = 2;//((Tcl_FreeProc ) 0)
  949. public const int TCL_DYNAMIC = 3;//((Tcl_FreeProc ) 3)
  950. /*
  951. * Flag values passed to variable-related procedures.
  952. */
  953. public const int TCL_GLOBAL_ONLY = 1;
  954. public const int TCL_NAMESPACE_ONLY = 2;
  955. public const int TCL_APPEND_VALUE = 4;
  956. public const int TCL_LIST_ELEMENT = 8;
  957. public const int TCL_TRACE_READS = 0x10;
  958. public const int TCL_TRACE_WRITES = 0x20;
  959. public const int TCL_TRACE_UNSETS = 0x40;
  960. public const int TCL_TRACE_DESTROYED = 0x80;
  961. public const int Tcl_Interp_DESTROYED = 0x100;
  962. public const int TCL_LEAVE_ERR_MSG = 0x200;
  963. public const int TCL_TRACE_ARRAY = 0x800;
  964. #if !TCL_REMOVE_OBSOLETE_TRACES
  965. /* Required to support old variable/vdelete/vinfo traces */
  966. public const int TCL_TRACE_OLD_STYLE = 0x1000;
  967. #endif
  968. /* Indicate the semantics of the result of a trace */
  969. public const int TCL_TRACE_RESULT_DYNAMIC = 0x8000;
  970. public const int TCL_TRACE_RESULT_OBJECT = 0x10000;
  971. /*
  972. * Flag values passed to command-related procedures.
  973. */
  974. //#define TCL_TRACE_RENAME 0x2000
  975. //#define TCL_TRACE_DELETE 0x4000
  976. //#define TCL_ALLOW_INLINE_COMPILATION 0x20000
  977. /*
  978. * Flag values passed to Tcl_CreateObjTrace, and used internally
  979. * by command execution traces. Slots 4,8,16 and 32 are
  980. * used internally by execution traces (see tclCmdMZ.c)
  981. */
  982. //#define TCL_TRACE_ENTER_EXEC 1
  983. //#define TCL_TRACE_LEAVE_EXEC 2
  984. /*
  985. * The TCL_PARSE_PART1 flag is deprecated and has no effect.
  986. * The part1 is now always parsed whenever the part2 is NULL.
  987. * (This is to avoid a common error when converting code to
  988. * use the new object based APIs and forgetting to give the
  989. * flag)
  990. */
  991. #if !TCL_NO_DEPRECATED
  992. //# define TCL_PARSE_PART1 0x400
  993. #endif
  994. /*
  995. * Types for linked variables:
  996. */
  997. //const int TCL_LINK_INT = 1;
  998. //const int TCL_LINK_DOUBLE = 2;
  999. //const int TCL_LINK_BOOLEAN =3;
  1000. //const int TCL_LINK_STRING = 4;
  1001. //const int TCL_LINK_WIDE_INT= 5;
  1002. //const int TCL_LINK_READ_ONLY= 0x80;
  1003. /*
  1004. * Forward declarations of Tcl_HashTable and related types.
  1005. */
  1006. //typedef struct Tcl_HashKeyType Tcl_HashKeyType;
  1007. //typedef struct Tcl_HashTable Tcl_HashTable;
  1008. //typedef struct Tcl_HashEntry Tcl_HashEntry;
  1009. //typedef unsigned int (Tcl_HashKeyProc) _ANSI_ARGS_((Tcl_HashTable *tablePtr,
  1010. // VOID *keyPtr));
  1011. //typedef int (Tcl_CompareHashKeysProc) _ANSI_ARGS_((VOID *keyPtr,
  1012. // Tcl_HashEntry *hPtr));
  1013. //typedef Tcl_HashEntry *(Tcl_AllocHashEntryProc) _ANSI_ARGS_((
  1014. // Tcl_HashTable *tablePtr, object *keyPtr));
  1015. //typedef void (Tcl_FreeHashEntryProc) _ANSI_ARGS_((Tcl_HashEntry *hPtr));
  1016. /*
  1017. * This flag controls whether the hash table stores the hash of a key, or
  1018. * recalculates it. There should be no reason for turning this flag off
  1019. * as it is completely binary and source compatible unless you directly
  1020. * access the bucketPtr member of the Tcl_HashTableEntry structure. This
  1021. * member has been removed and the space used to store the hash value.
  1022. */
  1023. //#if !TCL_HASH_KEY_STORE_HASH
  1024. //# define TCL_HASH_KEY_STORE_HASH 1
  1025. //#endif
  1026. /*
  1027. * Structure definition for an entry in a hash table. No-one outside
  1028. * Tcl should access any of these fields directly; use the macros
  1029. * defined below.
  1030. */
  1031. //struct Tcl_HashEntry {
  1032. // Tcl_HashEntry *nextPtr; /* Pointer to next entry in this
  1033. // * hash bucket, or NULL for end of
  1034. // * chain. */
  1035. // Tcl_HashTable *tablePtr; /* Pointer to table containing entry. */
  1036. #if TCL_HASH_KEY_STORE_HASH
  1037. # if TCL_PRESERVE_BINARY_COMPATABILITY
  1038. // VOID *hash; /* Hash value, stored as pointer to
  1039. // * ensure that the offsets of the
  1040. // * fields in this structure are not
  1041. // * changed. */
  1042. # else
  1043. // unsigned int hash; /* Hash value. */
  1044. # endif
  1045. #else
  1046. // Tcl_HashEntry **bucketPtr; /* Pointer to bucket that points to
  1047. // * first entry in this entry's chain:
  1048. // * used for deleting the entry. */
  1049. #endif
  1050. // ClientData clientData; /* Application stores something here
  1051. // * with Tcl_SetHashValue. */
  1052. // union { /* Key has one of these forms: */
  1053. // char *oneWordValue; /* One-word value for key. */
  1054. // Tcl_Obj *objPtr; /* Tcl_Obj * key value. */
  1055. // int words[1]; /* Multiple integer words for key.
  1056. // * The actual size will be as large
  1057. // * as necessary for this table's
  1058. // * keys. */
  1059. // char string[4]; /* String for key. The actual size
  1060. // * will be as large as needed to hold
  1061. // * the key. */
  1062. // } key; /* MUST BE LAST FIELD IN RECORD!! */
  1063. //};
  1064. /*
  1065. * Flags used in Tcl_HashKeyType.
  1066. *
  1067. * TCL_HASH_KEY_RANDOMIZE_HASH:
  1068. * There are some things, pointers for example
  1069. * which don't hash well because they do not use
  1070. * the lower bits. If this flag is set then the
  1071. * hash table will attempt to rectify this by
  1072. * randomising the bits and then using the upper
  1073. * N bits as the index into the table.
  1074. */
  1075. //#define TCL_HASH_KEY_RANDOMIZE_HASH 0x1
  1076. /*
  1077. * Structure definition for the methods associated with a hash table
  1078. * key type.
  1079. */
  1080. //#define TCL_HASH_KEY_TYPE_VERSION 1
  1081. //struct Tcl_HashKeyType {
  1082. // int version; /* Version of the table. If this structure is
  1083. // * extended in future then the version can be
  1084. // * used to distinguish between different
  1085. // * structures.
  1086. // */
  1087. // int flags; /* Flags, see above for details. */
  1088. // /* Calculates a hash value for the key. If this is NULL then the pointer
  1089. // * itself is used as a hash value.
  1090. // */
  1091. // Tcl_HashKeyProc *hashKeyProc;
  1092. // /* Compares two keys and returns zero if they do not match, and non-zero
  1093. // * if they do. If this is NULL then the pointers are compared.
  1094. // */
  1095. // Tcl_CompareHashKeysProc *compareKeysProc;
  1096. // /* Called to allocate memory for a new entry, i.e. if the key is a
  1097. // * string then this could allocate a single block which contains enough
  1098. // * space for both the entry and the string. Only the key field of the
  1099. // * allocated Tcl_HashEntry structure needs to be filled in. If something
  1100. // * else needs to be done to the key, i.e. incrementing a reference count
  1101. // * then that should be done by this function. If this is NULL then Tcl_Alloc
  1102. // * is used to allocate enough space for a Tcl_HashEntry and the key pointer
  1103. // * is assigned to key.oneWordValue.
  1104. // */
  1105. // Tcl_AllocHashEntryProc *allocEntryProc;
  1106. // /* Called to free memory associated with an entry. If something else needs
  1107. // * to be done to the key, i.e. decrementing a reference count then that
  1108. // * should be done by this function. If this is NULL then Tcl_Free is used
  1109. // * to free the Tcl_HashEntry.
  1110. // */
  1111. // Tcl_FreeHashEntryProc *freeEntryProc;
  1112. //};
  1113. /*
  1114. * Structure definition for a hash table. Must be in tcl.h so clients
  1115. * can allocate space for these structures, but clients should never
  1116. * access any fields in this structure.
  1117. */
  1118. //#define TCL_SMALL_HASH_TABLE 4
  1119. //struct Tcl_HashTable {
  1120. // Tcl_HashEntry **buckets; /* Pointer to bucket array. Each
  1121. // * element points to first entry in
  1122. // * bucket's hash chain, or NULL. */
  1123. // Tcl_HashEntry *staticBuckets[TCL_SMALL_HASH_TABLE];
  1124. // /* Bucket array used for small tables
  1125. // * (to avoid mallocs and frees). */
  1126. // int numBuckets; /* Total number of buckets allocated
  1127. // * at **bucketPtr. */
  1128. // int numEntries; /* Total number of entries present
  1129. // * in table. */
  1130. // int rebuildSize; /* Enlarge table when numEntries gets
  1131. // * to be this large. */
  1132. // int downShift; /* Shift count used in hashing
  1133. // * function. Designed to use h…

Large files files are truncated, but you can click here to view the full file