PageRenderTime 53ms CodeModel.GetById 14ms RepoModel.GetById 0ms 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
  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 high-
  1134. // * order bits of randomized keys. */
  1135. // int mask; /* Mask value used in hashing
  1136. // * function. */
  1137. // int keyType; /* Type of keys used in this table.
  1138. // * It's either TCL_CUSTOM_KEYS,
  1139. // * TCL_STRING_KEYS, TCL.TCL_ONE_WORD_KEYS,
  1140. // * or an integer giving the number of
  1141. // * ints that is the size of the key.
  1142. // */
  1143. #if TCL_PRESERVE_BINARY_COMPATABILITY
  1144. // Tcl_HashEntry *(*findProc) _ANSI_ARGS_((Tcl_HashTable *tablePtr,
  1145. // string key));
  1146. // Tcl_HashEntry *(*createProc) _ANSI_ARGS_((Tcl_HashTable *tablePtr,
  1147. // string key, int *newPtr));
  1148. #endif
  1149. // Tcl_HashKeyType *typePtr; /* Type of the keys used in the
  1150. // * Tcl_HashTable. */
  1151. //};
  1152. /*
  1153. * Structure definition for information used to keep track of searches
  1154. * through hash tables:
  1155. */
  1156. //typedef struct Tcl_HashSearch {
  1157. // Tcl_HashTable *tablePtr; /* Table being searched. */
  1158. // int nextIndex; /* Index of next bucket to be
  1159. // * enumerated after present one. */
  1160. // Tcl_HashEntry *nextEntryPtr; /* Next entry to be enumerated in the
  1161. // * the current bucket. */
  1162. //} Tcl_HashSearch;
  1163. /*
  1164. * Acceptable key types for hash tables:
  1165. *
  1166. * TCL_STRING_KEYS: The keys are strings, they are copied into
  1167. * the entry.
  1168. * TCL_ONE_WORD_KEYS: The keys are pointers, the pointer is stored
  1169. * in the entry.
  1170. * TCL_CUSTOM_TYPE_KEYS: The keys are arbitrary types which are copied
  1171. * into the entry.
  1172. * TCL_CUSTOM_PTR_KEYS: The keys are pointers to arbitrary types, the
  1173. * pointer is stored in the entry.
  1174. *
  1175. * While maintaining binary compatability the above have to be distinct
  1176. * values as they are used to differentiate between old versions of the
  1177. * hash table which don't have a typePtr and new ones which do. Once binary
  1178. * compatability is discarded in favour of making more wide spread changes
  1179. * TCL_STRING_KEYS can be the same as TCL_CUSTOM_TYPE_KEYS, and
  1180. * TCL_ONE_WORD_KEYS can be the same as TCL_CUSTOM_PTR_KEYS because they
  1181. * simply determine how the key is accessed from the entry and not the
  1182. * behavior.
  1183. */
  1184. //#define TCL_STRING_KEYS 0
  1185. //#define TCL_ONE_WORD_KEYS 1
  1186. //#if TCL_PRESERVE_BINARY_COMPATABILITY
  1187. //# define TCL_CUSTOM_TYPE_KEYS -2
  1188. //# define TCL_CUSTOM_PTR_KEYS -1
  1189. //#else
  1190. //# define TCL_CUSTOM_TYPE_KEYS TCL_STRING_KEYS
  1191. //# define TCL_CUSTOM_PTR_KEYS TCL_ONE_WORD_KEYS
  1192. //#endif
  1193. /*
  1194. * Macros for clients to use to access fields of hash entries:
  1195. */
  1196. //#define Tcl_GetHashValue(h) ((h)->clientData)
  1197. //#define Tcl_SetHashValue(h, value) ((h)->clientData = (ClientData) (value))
  1198. #if TCL_PRESERVE_BINARY_COMPATABILITY
  1199. //# define Tcl_GetHashKey(vtablePtr, h) \
  1200. // ((char ) (((vtablePtr)->keyType == TCL.Tcl_ONE_WORD_KEYS || \
  1201. // (vtablePtr)->keyType == TCL.Tcl_CUSTOM_PTR_KEYS) \
  1202. // ? (h)->key.oneWordValue \
  1203. // : (h)->key.string))
  1204. #else
  1205. //# define Tcl_GetHashKey(vtablePtr, h) \
  1206. // ((char ) (((vtablePtr)->keyType == TCL.Tcl_ONE_WORD_KEYS) \
  1207. // ? (h)->key.oneWordValue \
  1208. // : (h)->key.string))
  1209. #endif
  1210. /*
  1211. * Macros to use for clients to use to invoke find and create procedures
  1212. * for hash tables:
  1213. */
  1214. #if TCL_PRESERVE_BINARY_COMPATABILITY
  1215. //# define Tcl_FindHashEntry(vtablePtr, key) \
  1216. // (*((vtablePtr)->findProc))(vtablePtr, key)
  1217. //# define Tcl_CreateHashEntry(vtablePtr, key, newPtr) \
  1218. // (*((vtablePtr)->createProc))(vtablePtr, key, newPtr)
  1219. #else //* !TCL_PRESERVE_BINARY_COMPATABILITY */
  1220. /*
  1221. * Macro to use new extended version of Tcl_InitHashTable.
  1222. */
  1223. //# define Tcl_InitHashTable(vtablePtr, keyType) \
  1224. // Tcl_InitHashTableEx(vtablePtr, keyType, NULL)
  1225. #endif // * TCL_PRESERVE_BINARY_COMPATABILITY */
  1226. /*
  1227. * Flag values to pass to Tcl_DoOneEvent to disable searches
  1228. * for some kinds of events:
  1229. */
  1230. //#define TCL_DONT_WAIT (1<<1)
  1231. //#define TCL_WINDOW_EVENTS (1<<2)
  1232. //#define TCL_FILE_EVENTS (1<<3)
  1233. //#define TCL_TIMER_EVENTS (1<<4)
  1234. //#define TCL_IDLE_EVENTS (1<<5) /* WAS 0x10 ???? */
  1235. //#define TCL_ALL_EVENTS (~TCL_DONT_WAIT)
  1236. /*
  1237. * The following structure defines a generic event for the Tcl event
  1238. * system. These are the things that are queued in calls to Tcl_QueueEvent
  1239. * and serviced later by Tcl_DoOneEvent. There can be many different
  1240. * kinds of events with different fields, corresponding to window events,
  1241. * timer events, etc. The structure for a particular event consists of
  1242. * a Tcl_Event header followed by additional information specific to that
  1243. * event.
  1244. */
  1245. //struct Tcl_Event {
  1246. // Tcl_EventProc proc; /* Procedure to call to service this event. */
  1247. // struct Tcl_Event *nextPtr; /* Next in list of pending events, or NULL. */
  1248. //};
  1249. /*
  1250. * Positions to pass to Tcl_QueueEvent:
  1251. */
  1252. //typedef enum {
  1253. // TCL_QUEUE_TAIL, TCL.TCL_QUEUE_HEAD, TCL.TCL_QUEUE_MARK
  1254. //} Tcl_QueuePosition;
  1255. /*
  1256. * Values to pass to Tcl_SetServiceMode to specify the behavior of notifier
  1257. * event routines.
  1258. */
  1259. //#define TCL_SERVICE_NONE 0
  1260. //#define TCL_SERVICE_ALL 1
  1261. /*
  1262. * The following structure keeps is used to hold a time value, either as
  1263. * an absolute time (the number of seconds from the epoch) or as an
  1264. * elapsed time. On Unix systems the epoch is Midnight Jan 1, 1970 GMT.
  1265. * On Macintosh systems the epoch is Midnight Jan 1, 1904 GMT.
  1266. */
  1267. //typedef struct Tcl_Time {
  1268. // long sec; /* Seconds. */
  1269. // long usec; /* Microseconds. */
  1270. //} Tcl_Time;
  1271. //typedef void (Tcl_SetTimerProc) _ANSI_ARGS_((Tcl_Time *timePtr));
  1272. //typedef int (Tcl_WaitForEventProc) _ANSI_ARGS_((Tcl_Time *timePtr));
  1273. /*
  1274. * Bits to pass to Tcl_CreateFileHandler and Tcl_CreateChannelHandler
  1275. * to indicate what sorts of events are of interest:
  1276. */
  1277. //#define TCL_READABLE (1<<1)
  1278. //#define TCL_WRITABLE (1<<2)
  1279. //#define TCL_EXCEPTION (1<<3)
  1280. /*
  1281. * Flag values to pass to Tcl_OpenCommandChannel to indicate the
  1282. * disposition of the stdio handles. TCL_STDIN, TCL.TCL_STDOUT, TCL.TCL_STDERR,
  1283. * are also used in Tcl_GetStdChannel.
  1284. */
  1285. //#define TCL_STDIN (1<<1)
  1286. //#define TCL_STDOUT (1<<2)
  1287. //#define TCL_STDERR (1<<3)
  1288. //#define TCL_ENFORCE_MODE (1<<4)
  1289. /*
  1290. * Bits passed to Tcl_DriverClose2Proc to indicate which side of a channel
  1291. * should be closed.
  1292. */
  1293. //#define TCL_CLOSE_READ (1<<1)
  1294. //#define TCL_CLOSE_WRITE (1<<2)
  1295. /*
  1296. * Value to use as the closeProc for a channel that supports the
  1297. * close2Proc interface.
  1298. */
  1299. //#define TCL_CLOSE2PROC ((Tcl_DriverCloseProc )1)
  1300. /*
  1301. * Channel version tag. This was introduced in 8.3.2/8.4.
  1302. */
  1303. //#define TCL_CHANNEL_VERSION_1 ((Tcl_ChannelTypeVersion) 0x1)
  1304. //#define TCL_CHANNEL_VERSION_2 ((Tcl_ChannelTypeVersion) 0x2)
  1305. //#define TCL_CHANNEL_VERSION_3 ((Tcl_ChannelTypeVersion) 0x3)
  1306. //#define TCL_CHANNEL_VERSION_4 ((Tcl_ChannelTypeVersion) 0x4)
  1307. /*
  1308. * TIP #218: Channel Actions, Ids for Tcl_DriverThreadActionProc
  1309. */
  1310. //#define TCL_CHANNEL_THREAD_INSERT (0)
  1311. //#define TCL_CHANNEL_THREAD_REMOVE (1)
  1312. /*
  1313. * Typedefs for the various operations in a channel type:
  1314. */
  1315. //typedef int (Tcl_DriverBlockModeProc) _ANSI_ARGS_((
  1316. // ClientData instanceData, int mode));
  1317. //typedef int (Tcl_DriverCloseProc) _ANSI_ARGS_((ClientData instanceData,
  1318. // Tcl_Interp interp));
  1319. //typedef int (Tcl_DriverClose2Proc) _ANSI_ARGS_((ClientData instanceData,
  1320. // Tcl_Interp interp, int flags));
  1321. //typedef int (Tcl_DriverInputProc) _ANSI_ARGS_((ClientData instanceData,
  1322. // char *buf, int toRead, int *errorCodePtr));
  1323. //typedef int (Tcl_DriverOutputProc) _ANSI_ARGS_((ClientData instanceData,
  1324. // CONST84 char *buf, int toWrite, int *errorCodePtr));
  1325. //typedef int (Tcl_DriverSeekProc) _ANSI_ARGS_((ClientData instanceData,
  1326. // long offset, int mode, int *errorCodePtr));
  1327. //typedef int (Tcl_DriverSetOptionProc) _ANSI_ARGS_((
  1328. // ClientData instanceData, TCL.TCL_Interp interp,
  1329. // string optionName, string value));
  1330. //typedef int (Tcl_DriverGetOptionProc) _ANSI_ARGS_((
  1331. // ClientData instanceData, TCL.TCL_Interp interp,
  1332. // CONST84 char *optionName, TCL.TCL_DString *dsPtr));
  1333. //typedef void (Tcl_DriverWatchProc) _ANSI_ARGS_((
  1334. // ClientData instanceData, int mask));
  1335. //typedef int (Tcl_DriverGetHandleProc) _ANSI_ARGS_((
  1336. // ClientData instanceData, int direction,
  1337. // ClientData *handlePtr));
  1338. //typedef int (Tcl_DriverFlushProc) _ANSI_ARGS_((
  1339. // ClientData instanceData));
  1340. //typedef int (Tcl_DriverHandlerProc) _ANSI_ARGS_((
  1341. // ClientData instanceData, int interestMask));
  1342. //typedef Tcl_WideInt (Tcl_DriverWideSeekProc) _ANSI_ARGS_((
  1343. // ClientData instanceData, TCL.TCL_WideInt offset,
  1344. // int mode, int *errorCodePtr));
  1345. // /* TIP #218, Channel Thread Actions */
  1346. //typedef void (Tcl_DriverThreadActionProc) _ANSI_ARGS_ ((
  1347. // ClientData instanceData, int action));
  1348. /*
  1349. * The following declarations either map ckalloc and ckfree to
  1350. * malloc and free, or they map them to procedures with all sorts
  1351. * of debugging hooks defined in tclCkalloc.c.
  1352. */
  1353. #if TCL_MEM_DEBUG
  1354. //# define ckalloc(x) Tcl_DbCkalloc(x, __FILE__, __LINE__)
  1355. //# define ckfree(x) Tcl_DbCkfree(x, __FILE__, __LINE__)
  1356. //# define ckrealloc(x,y) Tcl_DbCkrealloc((x), (y),__FILE__, __LINE__)
  1357. //# define attemptckalloc(x) Tcl_AttemptDbCkalloc(x, __FILE__, __LINE__)
  1358. //# define attemptckrealloc(x,y) Tcl_AttemptDbCkrealloc((x), (y), __FILE__, __LINE__)
  1359. #else // * !TCL_MEM_DEBUG */
  1360. /*
  1361. * If we are not using the debugging allocator, we should call the
  1362. * Tcl_Alloc, et al. routines in order to guarantee that every module
  1363. * is using the same memory allocator both inside and outside of the
  1364. * Tcl library.
  1365. */
  1366. //# define ckalloc(x) Tcl_Alloc(x)
  1367. //# define ckfree(x) Tcl_Free(x)
  1368. //# define ckrealloc(x,y) Tcl_Realloc(x,y)
  1369. //# define attemptckalloc(x) Tcl_AttemptAlloc(x)
  1370. //# define attemptckrealloc(x,y) Tcl_AttemptRealloc(x,y)
  1371. //# define Tcl_InitMemory(x)
  1372. //# define Tcl_DumpActiveMemory(x)
  1373. //# define Tcl_ValidateAllMemory(x,y)
  1374. #endif // * !TCL_MEM_DEBUG */
  1375. /*
  1376. * struct Tcl_ChannelType:
  1377. *
  1378. * One such structure exists for each type (kind) of channel.
  1379. * It collects together in one place all the functions that are
  1380. * part of the specific channel type.
  1381. *
  1382. * It is recommend that the Tcl_Channel* functions are used to access
  1383. * elements of this structure, instead of direct accessing.
  1384. */
  1385. //typedef struct Tcl_ChannelType {
  1386. // char *typeName; /* The name of the channel type in Tcl
  1387. // * commands. This storage is owned by
  1388. // * channel type. */
  1389. // Tcl_ChannelTypeVersion version; /* Version of the channel type. */
  1390. // Tcl_DriverCloseProc *closeProc; /* Procedure to call to close the
  1391. // * channel, or TCL_CLOSE2PROC if the
  1392. // * close2Proc should be used
  1393. // * instead. */
  1394. // Tcl_DriverInputProc *inputProc; /* Procedure to call for input
  1395. // * on channel. */
  1396. // Tcl_DriverOutputProc *outputProc; /* Procedure to call for output
  1397. // * on channel. */
  1398. // Tcl_DriverSeekProc *seekProc; /* Procedure to call to seek
  1399. // * on the channel. May be NULL. */
  1400. // Tcl_DriverSetOptionProc *setOptionProc;
  1401. // /* Set an option on a channel. */
  1402. // Tcl_DriverGetOptionProc *getOptionProc;
  1403. // /* Get an option from a channel. */
  1404. // Tcl_DriverWatchProc *watchProc; /* Set up the notifier to watch
  1405. // * for events on this channel. */
  1406. // Tcl_DriverGetHandleProc *getHandleProc;
  1407. // /* Get an OS handle from the channel
  1408. // * or NULL if not supported. */
  1409. // Tcl_DriverClose2Proc *close2Proc; /* Procedure to call to close the
  1410. // * channel if the device supports
  1411. // * closing the read & write sides
  1412. // * independently. */
  1413. // Tcl_DriverBlockModeProc *blockModeProc;
  1414. // /* Set blocking mode for the
  1415. // * raw channel. May be NULL. */
  1416. // /*
  1417. // * Only valid in TCL_CHANNEL_VERSION_2 channels or later
  1418. // */
  1419. // Tcl_DriverFlushProc *flushProc; /* Procedure to call to flush a
  1420. // * channel. May be NULL. */
  1421. // Tcl_DriverHandlerProc *handlerProc; /* Procedure to call to handle a
  1422. // * channel event. This will be passed
  1423. // * up the stacked channel chain. */
  1424. // /*
  1425. // * Only valid in TCL_CHANNEL_VERSION_3 channels or later
  1426. // */
  1427. // Tcl_DriverWideSeekProc *wideSeekProc;
  1428. // /* Procedure to call to seek
  1429. // * on the channel which can
  1430. // * handle 64-bit offsets. May be
  1431. // * NULL, and must be NULL if
  1432. // * seekProc is NULL. */
  1433. // /*
  1434. // * Only valid in TCL_CHANNEL_VERSION_4 channels or later
  1435. // * TIP #218, Channel Thread Actions
  1436. // */
  1437. // Tcl_DriverThreadActionProc *threadActionProc;
  1438. // /* Procedure to call to notify
  1439. // * the driver of thread specific
  1440. // * activity for a channel.
  1441. // * May be NULL. */
  1442. //} Tcl_ChannelType;
  1443. /*
  1444. * The following flags determine whether the blockModeProc above should
  1445. * set the channel into blocking or nonblocking mode. They are passed
  1446. * as arguments to the blockModeProc procedure in the above structure.
  1447. */
  1448. //#define TCL_MODE_BLOCKING 0 /* Put channel into blocking mode. */
  1449. //#define TCL_MODE_NONBLOCKING 1 /* Put channel into nonblocking
  1450. // * mode. */
  1451. /*
  1452. * Enum for different types of file paths.
  1453. */
  1454. //typedef enum Tcl_PathType {
  1455. // TCL_PATH_ABSOLUTE,
  1456. // TCL_PATH_RELATIVE,
  1457. // TCL_PATH_VOLUME_RELATIVE
  1458. //} Tcl_PathType;
  1459. /*
  1460. * The following structure is used to pass glob type data amongst
  1461. * the various glob routines and Tcl_FSMatchInDirectory.
  1462. */
  1463. //typedef struct Tcl_GlobTypeData {
  1464. // /* Corresponds to bcdpfls as in 'find -t' */
  1465. // int type;
  1466. // /* Corresponds to file permissions */
  1467. // int perm;
  1468. // /* Acceptable mac type */
  1469. // Tcl_Obj* macType;
  1470. // /* Acceptable mac creator */
  1471. // Tcl_Obj* macCreator;
  1472. //} Tcl_GlobTypeData;
  1473. /*
  1474. * type and permission definitions for glob command
  1475. */
  1476. //#define TCL_GLOB_TYPE_BLOCK (1<<0)
  1477. //#define TCL_GLOB_TYPE_CHAR (1<<1)
  1478. //#define TCL_GLOB_TYPE_DIR (1<<2)
  1479. //#define TCL_GLOB_TYPE_PIPE (1<<3)
  1480. //#define TCL_GLOB_TYPE_FILE (1<<4)
  1481. //#define TCL_GLOB_TYPE_LINK (1<<5)
  1482. //#define TCL_GLOB_TYPE_SOCK (1<<6)
  1483. //#define TCL_GLOB_TYPE_MOUNT (1<<7)
  1484. //#define TCL_GLOB_PERM_RONLY (1<<0)
  1485. //#define TCL_GLOB_PERM_HIDDEN (1<<1)
  1486. //#define TCL_GLOB_PERM_R (1<<2)
  1487. //#define TCL_GLOB_PERM_W (1<<3)
  1488. //#define TCL_GLOB_PERM_X (1<<4)
  1489. /*
  1490. * Typedefs for the various filesystem operations:
  1491. */
  1492. //typedef int (Tcl_FSStatProc) _ANSI_ARGS_((Tcl_Obj pathPtr, TCL.TCL_StatBuf *buf));
  1493. //typedef int (Tcl_FSAccessProc) _ANSI_ARGS_((Tcl_Obj pathPtr, int mode));
  1494. //typedef Tcl_Channel (Tcl_FSOpenFileChannelProc)
  1495. // _ANSI_ARGS_((Tcl_Interp interp, TCL.TCL_Obj pathPtr,
  1496. // int mode, int permissions));
  1497. //typedef int (Tcl_FSMatchInDirectoryProc) _ANSI_ARGS_((Tcl_Interp* interp,
  1498. // Tcl_Obj *result, TCL.TCL_Obj pathPtr, CONST char pattern,
  1499. // Tcl_GlobTypeData * types));
  1500. //typedef Tcl_Obj* (Tcl_FSGetCwdProc) _ANSI_ARGS_((Tcl_Interp interp));
  1501. //typedef int (Tcl_FSChdirProc) _ANSI_ARGS_((Tcl_Obj pathPtr));
  1502. //typedef int (Tcl_FSLstatProc) _ANSI_ARGS_((Tcl_Obj pathPtr,
  1503. // Tcl_StatBuf *buf));
  1504. //typedef int (Tcl_FSCreateDirectoryProc) _ANSI_ARGS_((Tcl_Obj pathPtr));
  1505. //typedef int (Tcl_FSDeleteFileProc) _ANSI_ARGS_((Tcl_Obj pathPtr));
  1506. //typedef int (Tcl_FSCopyDirectoryProc) _ANSI_ARGS_((Tcl_Obj *srcPathPtr,
  1507. // Tcl_Obj *destPathPtr, TCL.TCL_Obj **errorPtr));
  1508. //typedef int (Tcl_FSCopyFileProc) _ANSI_ARGS_((Tcl_Obj *srcPathPtr,
  1509. // Tcl_Obj *destPathPtr));
  1510. //typedef int (Tcl_FSRemoveDirectoryProc) _ANSI_ARGS_((Tcl_Obj pathPtr,
  1511. // int recursive, TCL.TCL_Obj **errorPtr));
  1512. //typedef int (Tcl_FSRenameFileProc) _ANSI_ARGS_((Tcl_Obj *srcPathPtr,
  1513. // Tcl_Obj *destPathPtr));
  1514. //typedef void (Tcl_FSUnloadFileProc) _ANSI_ARGS_((Tcl_LoadHandle loadHandle));
  1515. //typedef Tcl_Obj* (Tcl_FSListVolumesProc) _ANSI_ARGS_((void));
  1516. /* We have to declare the utime structure here. */
  1517. //struct utimbuf;
  1518. //typedef int (Tcl_FSUtimeProc) _ANSI_ARGS_((Tcl_Obj pathPtr,
  1519. // struct utimbuf *tval));
  1520. //typedef int (Tcl_FSNormalizePathProc) _ANSI_ARGS_((Tcl_Interp interp,
  1521. // Tcl_Obj pathPtr, int nextCheckpoint));
  1522. //typedef int (Tcl_FSFileAttrsGetProc) _ANSI_ARGS_((Tcl_Interp interp,
  1523. // int index, TCL.TCL_Obj pathPtr,
  1524. // Tcl_Obj **objPtrRef));
  1525. //typedef CONST char** (Tcl_FSFileAttrStringsProc) _ANSI_ARGS_((Tcl_Obj pathPtr,
  1526. // Tcl_Obj** objPtrRef));
  1527. //typedef int (Tcl_FSFileAttrsSetProc) _ANSI_ARGS_((Tcl_Interp interp,
  1528. // int index, TCL.TCL_Obj pathPtr,
  1529. // Tcl_Obj *objPtr));
  1530. //typedef Tcl_Obj* (Tcl_FSLinkProc) _ANSI_ARGS_((Tcl_Obj pathPtr,
  1531. // Tcl_Obj *toPtr, int linkType));
  1532. //typedef int (Tcl_FSLoadFileProc) _ANSI_ARGS_((Tcl_Interp * interp,
  1533. // Tcl_Obj pathPtr,
  1534. // Tcl_LoadHandle *handlePtr,
  1535. // Tcl_FSUnloadFileProc **unloadProcPtr));
  1536. //typedef int (Tcl_FSPathInFilesystemProc) _ANSI_ARGS_((Tcl_Obj pathPtr,
  1537. // ClientData *clientDataPtr));
  1538. //typedef Tcl_Obj* (Tcl_FSFilesystemPathTypeProc)
  1539. // _ANSI_ARGS_((Tcl_Obj pathPtr));
  1540. //typedef Tcl_Obj* (Tcl_FSFilesystemSeparatorProc)
  1541. // _ANSI_ARGS_((Tcl_Obj pathPtr));
  1542. //typedef void (Tcl_FSFreeInternalRepProc) _ANSI_ARGS_((ClientData clientData));
  1543. //typedef ClientData (Tcl_FSDupInternalRepProc)
  1544. // _ANSI_ARGS_((ClientData clientData));
  1545. //typedef Tcl_Obj* (Tcl_FSInternalToNormalizedProc)
  1546. // _ANSI_ARGS_((ClientData clientData));
  1547. //typedef ClientData (Tcl_FSCreateInternalRepProc) _ANSI_ARGS_((Tcl_Obj pathPtr));
  1548. //typedef struct Tcl_FSVersion_ *Tcl_FSVersion;
  1549. /*
  1550. *----------------------------------------------------------------
  1551. * Data structures related to hooking into the filesystem
  1552. *----------------------------------------------------------------
  1553. */
  1554. /*
  1555. * Filesystem version tag. This was introduced in 8.4.
  1556. */
  1557. //#define TCL_FILESYSTEM_VERSION_1 ((Tcl_FSVersion) 0x1)
  1558. /*
  1559. * struct Tcl_Filesystem:
  1560. *
  1561. * One such structure exists for each type (kind) of filesystem.
  1562. * It collects together in one place all the functions that are
  1563. * part of the specific filesystem. Tcl always accesses the
  1564. * filesystem through one of these structures.
  1565. *
  1566. * Not all entries need be non-NULL; any which are NULL are simply
  1567. * ignored. However, a complete filesystem should provide all of
  1568. * these functions. The explanations in the structure show
  1569. * the importance of each function.
  1570. */
  1571. //typedef struct Tcl_Filesystem {
  1572. // string typeName; /* The name of the filesystem. */
  1573. // int structureLength; /* Length of this structure, so future
  1574. // * binary compatibility can be assured. */
  1575. // Tcl_FSVersion version;
  1576. // /* Version of the filesystem type. */
  1577. // Tcl_FSPathInFilesystemProc pathInFilesystemProc;
  1578. // /* Function to check whether a path is in
  1579. // * this filesystem. This is the most
  1580. // * important filesystem procedure. */
  1581. // Tcl_FSDupInternalRepProc *dupInternalRepProc;
  1582. // /* Function to duplicate internal fs rep. May
  1583. // * be NULL (but then fs is less efficient). */
  1584. // Tcl_FSFreeInternalRepProc *freeInternalRepProc;
  1585. // /* Function to free internal fs rep. Must
  1586. // * be implemented, if internal representations
  1587. // * need freeing, otherwise it can be NULL. */
  1588. // Tcl_FSInternalToNormalizedProc *internalToNormalizedProc;
  1589. // /* Function to convert internal representation
  1590. // * to a normalized path. Only required if
  1591. // * the fs creates pure path objects with no
  1592. // * string/path representation. */
  1593. // Tcl_FSCreateInternalRepProc *createInternalRepProc;
  1594. // /* Function to create a filesystem-specific
  1595. // * internal representation. May be NULL
  1596. // * if paths have no internal representation,
  1597. // * or if the Tcl_FSPathInFilesystemProc
  1598. // * for this filesystem always immediately
  1599. // * creates an internal representation for
  1600. // * paths it accepts. */
  1601. // Tcl_FSNormalizePathProc *normalizePathProc;
  1602. // /* Function to normalize a path. Should
  1603. // * be implemented for all filesystems
  1604. // * which can have multiple string
  1605. // * representations for the same path
  1606. // * object. */
  1607. // Tcl_FSFilesystemPathTypeProc *filesystemPathTypeProc;
  1608. // /* Function to determine the type of a
  1609. // * path in this filesystem. May be NULL. */
  1610. // Tcl_FSFilesystemSeparatorProc *filesystemSeparatorProc;
  1611. // /* Function to return the separator
  1612. // * character(s) for this filesystem. Must
  1613. // * be implemented. */
  1614. // Tcl_FSStatProc *statProc;
  1615. // /*
  1616. // * Function to process a 'Tcl_FSStat()'
  1617. // * call. Must be implemented for any
  1618. // * reasonable filesystem.
  1619. // */
  1620. // Tcl_FSAccessProc *accessProc;
  1621. // /*
  1622. // * Function to process a 'Tcl_FSAccess()'
  1623. // * call. Must be implemented for any
  1624. // * reasonable filesystem.
  1625. // */
  1626. // Tcl_FSOpenFileChannelProc *openFileChannelProc;
  1627. // /*
  1628. // * Function to process a
  1629. // * 'Tcl_FSOpenFileChannel()' call. Must be
  1630. // * implemented for any reasonable
  1631. // * filesystem.
  1632. // */
  1633. // Tcl_FSMatchInDirectoryProc *matchInDirectoryProc;
  1634. // /* Function to process a
  1635. // * 'Tcl_FSMatchInDirectory()'. If not
  1636. // * implemented, then glob and recursive
  1637. // * copy functionality will be lacking in
  1638. // * the filesystem. */
  1639. // Tcl_FSUtimeProc *utimeProc;
  1640. // /* Function to process a
  1641. // * 'Tcl_FSUtime()' call. Required to
  1642. // * allow setting (not reading) of times
  1643. // * with 'file mtime', 'file atime' and
  1644. // * the open-r/open-w/fcopy implementation
  1645. // * of 'file copy'. */
  1646. // Tcl_FSLinkProc *linkProc;
  1647. // /* Function to process a
  1648. // * 'Tcl_FSLink()' call. Should be
  1649. // * implemented only if the filesystem supports
  1650. // * links (reading or creating). */
  1651. // Tcl_FSListVolumesProc *listVolumesProc;
  1652. // /* Function to list any filesystem volumes
  1653. // * added by this filesystem. Should be
  1654. // * implemented only if the filesystem adds
  1655. // * volumes at the head of the filesystem. */
  1656. // Tcl_FSFileAttrStringsProc *fileAttrStringsProc;
  1657. // /* Function to list all attributes strings
  1658. // * which are valid for this filesystem.
  1659. // * If not implemented the filesystem will
  1660. // * not support the 'file attributes' command.
  1661. // * This allows arbitrary additional information
  1662. // * to be attached to files in the filesystem. */
  1663. // Tcl_FSFileAttrsGetProc *fileAttrsGetProc;
  1664. // /* Function to process a
  1665. // * 'Tcl_FSFileAttrsGet()' call, used by
  1666. // * 'file attributes'. */
  1667. // Tcl_FSFileAttrsSetProc *fileAttrsSetProc;
  1668. // /* Function to process a
  1669. // * 'Tcl_FSFileAttrsSet()' call, used by
  1670. // * 'file attributes'. */
  1671. // Tcl_FSCreateDirectoryProc *createDirectoryProc;
  1672. // /* Function to process a
  1673. // * 'Tcl_FSCreateDirectory()' call. Should
  1674. // * be implemented unless the FS is
  1675. // * read-only. */
  1676. // Tcl_FSRemoveDirectoryProc *removeDirectoryProc;
  1677. // /* Function to process a
  1678. // * 'Tcl_FSRemoveDirectory()' call. Should
  1679. // * be implemented unless the FS is
  1680. // * read-only. */
  1681. // Tcl_FSDeleteFileProc *deleteFileProc;
  1682. // /* Function to process a
  1683. // * 'Tcl_FSDeleteFile()' call. Should
  1684. // * be implemented unless the FS is
  1685. // * read-only. */
  1686. // Tcl_FSCopyFileProc *copyFileProc;
  1687. // /* Function to process a
  1688. // * 'Tcl_FSCopyFile()' call. If not
  1689. // * implemented Tcl will fall back
  1690. // * on open-r, open-w and fcopy as
  1691. // * a copying mechanism, for copying
  1692. // * actions initiated in Tcl (not C). */
  1693. // Tcl_FSRenameFileProc *renameFileProc;
  1694. // /* Function to process a
  1695. // * 'Tcl_FSRenameFile()' call. If not
  1696. // * implemented, Tcl will fall back on
  1697. // * a copy and delete mechanism, for
  1698. // * rename actions initiated in Tcl (not C). */
  1699. // Tcl_FSCopyDirectoryProc *copyDirectoryProc;
  1700. // /* Function to process a
  1701. // * 'Tcl_FSCopyDirectory()' call. If
  1702. // * not implemented, Tcl will fall back
  1703. // * on a recursive create-dir, file copy
  1704. // * mechanism, for copying actions
  1705. // * initiated in Tcl (not C). */
  1706. // Tcl_FSLstatProc *lstatProc;
  1707. // /* Function to process a
  1708. // * 'Tcl_FSLstat()' call. If not implemented,
  1709. // * Tcl will attempt to use the 'statProc'
  1710. // * defined above instead. */
  1711. // Tcl_FSLoadFileProc *loadFileProc;
  1712. // /* Function to process a
  1713. // * 'Tcl_FSLoadFile()' call. If not
  1714. // * implemented, Tcl will fall back on
  1715. // * a copy to native-temp followed by a
  1716. // * Tcl_FSLoadFile on that temporary copy. */
  1717. // Tcl_FSGetCwdProc *getCwdProc;
  1718. // /*
  1719. // * Function to process a 'Tcl_FSGetCwd()'
  1720. // * call. Most filesystems need not
  1721. // * implement this. It will usually only be
  1722. // * called once, if 'getcwd' is called
  1723. // * before 'chdir'. May be NULL.
  1724. // */
  1725. // Tcl_FSChdirProc *chdirProc;
  1726. // /*
  1727. // * Function to process a 'Tcl_FSChdir()'
  1728. // * call. If filesystems do not implement
  1729. // * this, it will be emulated by a series of
  1730. // * directory access checks. Otherwise,
  1731. // * virtual filesystems which do implement
  1732. // * it need only respond with a positive
  1733. // * return result if the dirName is a valid
  1734. // * directory in their filesystem. They
  1735. // * need not remember the result, since that
  1736. // * will be automatically remembered for use
  1737. // * by GetCwd. Real filesystems should
  1738. // * carry out the correct action (i.e. call
  1739. // * the correct system 'chdir' api). If not
  1740. // * implemented, then 'cd' and 'pwd' will
  1741. // * fail inside the filesystem.
  1742. // */
  1743. //} Tcl_Filesystem;
  1744. /*
  1745. * The following definitions are used as values for the 'linkAction' flag
  1746. * to Tcl_FSLink, or the linkProc of any filesystem. Any combination
  1747. * of flags can be given. For link creation, the linkProc should create
  1748. * a link which matches any of the types given.
  1749. *
  1750. * TCL_CREATE_SYMBOLIC_LINK: Create a symbolic or soft link.
  1751. * TCL_CREATE_HARD_LINK: Create a hard link.
  1752. */
  1753. //#define TCL_CREATE_SYMBOLIC_LINK 0x01
  1754. //#define TCL_CREATE_HARD_LINK 0x02
  1755. /*
  1756. * The following structure represents the Notifier functions that
  1757. * you can override with the Tcl_SetNotifier call.
  1758. */
  1759. //typedef struct Tcl_NotifierProcs {
  1760. // Tcl_SetTimerProc *setTimerProc;
  1761. // Tcl_WaitForEventProc *waitForEventProc;
  1762. // Tcl_CreateFileHandlerProc *createFileHandlerProc;
  1763. // Tcl_DeleteFileHandlerProc *deleteFileHandlerProc;
  1764. // Tcl_InitNotifierProc *initNotifierProc;
  1765. // Tcl_FinalizeNotifierProc *finalizeNotifierProc;
  1766. // Tcl_AlertNotifierProc *alertNotifierProc;
  1767. // Tcl_ServiceModeHookProc *serviceModeHookProc;
  1768. //} Tcl_NotifierProcs;
  1769. /*
  1770. * The following structure represents a user-defined encoding. It collects
  1771. * together all the functions that are used by the specific encoding.
  1772. */
  1773. //typedef struct Tcl_EncodingType {
  1774. // string encodingName; /* The name of the encoding, e.g. "euc-jp".
  1775. // * This name is the unique key for this
  1776. // * encoding type. */
  1777. // Tcl_EncodingConvertProc *toUtfProc;
  1778. // /* Procedure to convert from external
  1779. // * encoding into UTF-8. */
  1780. // Tcl_EncodingConvertProc *fromUtfProc;
  1781. // /* Procedure to convert from UTF-8 into
  1782. // * external encoding. */
  1783. // Tcl_EncodingFreeProc *freeProc;
  1784. // /* If non-NULL, procedure to call when this
  1785. // * encoding is deleted. */
  1786. // ClientData clientData; /* Arbitrary value associated with encoding
  1787. // * type. Passed to conversion procedures. */
  1788. // int nullSize; /* Number of zero bytes that signify
  1789. // * end-of-string in this encoding. This
  1790. // * number is used to determine the source
  1791. // * string length when the srcLen argument is
  1792. // * negative. Must be 1 or 2. */
  1793. //} Tcl_EncodingType;
  1794. /*
  1795. * The following definitions are used as values for the conversion control
  1796. * flags argument when converting text from one character set to another:
  1797. *
  1798. * TCL_ENCODING_START: Signifies that the source buffer is the first
  1799. * block in a (potentially multi-block) input
  1800. * stream. Tells the conversion procedure to
  1801. * reset to an initial state and perform any
  1802. * initialization that needs to occur before the
  1803. * first byte is converted. If the source
  1804. * buffer contains the entire input stream to be
  1805. * converted, this flag should be set.
  1806. *
  1807. * TCL_ENCODING_END: Signifies that the source buffer is the last
  1808. * block in a (potentially multi-block) input
  1809. * stream. Tells the conversion routine to
  1810. * perform any finalization that needs to occur
  1811. * after the last byte is converted and then to
  1812. * reset to an initial state. If the source
  1813. * buffer contains the entire input stream to be
  1814. * converted, this flag should be set.
  1815. *
  1816. * TCL_ENCODING_STOPONERROR: If set, then the converter will return
  1817. * immediately upon encountering an invalid
  1818. * byte sequence or a source character that has
  1819. * no mapping in the target encoding. If clear,
  1820. * then the converter will skip the problem,
  1821. * substituting one or more "close" characters
  1822. * in the destination buffer and then continue
  1823. * to sonvert the source.
  1824. */
  1825. //#define TCL_ENCODING_START 0x01
  1826. //#define TCL_ENCODING_END 0x02
  1827. //#define TCL_ENCODING_STOPONERROR 0x04
  1828. /*
  1829. * The following data structures and declarations are for the new Tcl
  1830. * parser.
  1831. */
  1832. /*
  1833. * For each word of a command, and for each piece of a word such as a
  1834. * variable reference, one of the following structures is created to
  1835. * describe the token.
  1836. */
  1837. //typedef struct Tcl_Token {
  1838. // int type; /* Type of token, such as TCL_TOKEN_WORD;
  1839. // * see below for valid types. */
  1840. // string start; /* First character in token. */
  1841. // int size; /* Number of bytes in token. */
  1842. // int numComponents; /* If this token is composed of other
  1843. // * tokens, this field tells how many of
  1844. // * them there are (including components of
  1845. // * components, etc.). The component tokens
  1846. // * immediately follow this one. */
  1847. //} Tcl_Token;
  1848. /*
  1849. * Type values defined for Tcl_Token structures. These values are
  1850. * defined as mask bits so that it's easy to check for collections of
  1851. * types.
  1852. *
  1853. * TCL_TOKEN_WORD - The token describes one word of a command,
  1854. * from the first non-blank character of
  1855. * the word (which may be " or {) up to but
  1856. * not including the space, semicolon, or
  1857. * bracket that terminates the word.
  1858. * NumComponents counts the total number of
  1859. * sub-tokens that make up the word. This
  1860. * includes, for example, sub-tokens of
  1861. * TCL_TOKEN_VARIABLE tokens.
  1862. * TCL_TOKEN_SIMPLE_WORD - This token is just like TCL_TOKEN_WORD
  1863. * except that the word is guaranteed to
  1864. * consist of a single TCL_TOKEN_TEXT
  1865. * sub-token.
  1866. * TCL_TOKEN_TEXT - The token describes a range of literal
  1867. * text that is part of a word.
  1868. * NumComponents is always 0.
  1869. * TCL_TOKEN_BS - The token describes a backslash sequence
  1870. * that must be collapsed. NumComponents
  1871. * is always 0.
  1872. * TCL_TOKEN_COMMAND - The token describes a command whose result
  1873. * must be substituted into the word. The
  1874. * token includes the enclosing brackets.
  1875. * NumComponents is always 0.
  1876. * TCL_TOKEN_VARIABLE - The token describes a variable
  1877. * substitution, including the dollar sign,
  1878. * variable name, and array index (if there
  1879. * is one) up through the right
  1880. * parentheses. NumComponents tells how
  1881. * many additional tokens follow to
  1882. * represent the variable name. The first
  1883. * token will be a TCL_TOKEN_TEXT token
  1884. * that describes the variable name. If
  1885. * the variable is an array reference then
  1886. * there will be one or more additional
  1887. * tokens, of type TCL_TOKEN_TEXT,
  1888. * TCL_TOKEN_BS, TCL.TCL_TOKEN_COMMAND, and
  1889. * TCL_TOKEN_VARIABLE, that describe the
  1890. * array index; numComponents counts the
  1891. * total number of nested tokens that make
  1892. * up the variable reference, including
  1893. * sub-tokens of TCL_TOKEN_VARIABLE tokens.
  1894. * TCL_TOKEN_SUB_EXPR - The token describes one subexpression of a
  1895. * expression, from the first non-blank
  1896. * character of the subexpression up to but not
  1897. * including the space, brace, or bracket
  1898. * that terminates the subexpression.
  1899. * NumComponents counts the total number of
  1900. * following subtokens that make up the
  1901. * subexpression; this includes all subtokens
  1902. * for any nested TCL_TOKEN_SUB_EXPR tokens.
  1903. * For example, a numeric value used as a
  1904. * primitive operand is described by a
  1905. * TCL_TOKEN_SUB_EXPR token followed by a
  1906. * TCL_TOKEN_TEXT token. A binary subexpression
  1907. * is described by a TCL_TOKEN_SUB_EXPR token
  1908. * followed by the TCL_TOKEN_OPERATOR token
  1909. * for the operator, then TCL_TOKEN_SUB_EXPR
  1910. * tokens for the left then the right operands.
  1911. * TCL_TOKEN_OPERATOR - The token describes one expression operator.
  1912. * An operator might be the name of a math
  1913. * function such as "abs". A TCL_TOKEN_OPERATOR
  1914. * token is always preceeded by one
  1915. * TCL_TOKEN_SUB_EXPR token for the operator's
  1916. * subexpression, and is followed by zero or
  1917. * more TCL_TOKEN_SUB_EXPR tokens for the
  1918. * operator's operands. NumComponents is
  1919. * always 0.
  1920. */
  1921. //#define TCL_TOKEN_WORD 1
  1922. //#define TCL_TOKEN_SIMPLE_WORD 2
  1923. //#define TCL_TOKEN_TEXT 4
  1924. //#define TCL_TOKEN_BS 8
  1925. //#define TCL_TOKEN_COMMAND 16
  1926. //#define TCL_TOKEN_VARIABLE 32
  1927. //#define TCL_TOKEN_SUB_EXPR 64
  1928. //#define TCL_TOKEN_OPERATOR 128
  1929. /*
  1930. * Parsing error types. On any parsing error, one of these values
  1931. * will be stored in the error field of the Tcl_Parse structure
  1932. * defined below.
  1933. */
  1934. //#define TCL_PARSE_SUCCESS 0
  1935. //#define TCL_PARSE_QUOTE_EXTRA 1
  1936. //#define TCL_PARSE_BRACE_EXTRA 2
  1937. //#define TCL_PARSE_MISSING_BRACE 3
  1938. //#define TCL_PARSE_MISSING_BRACKET 4
  1939. //#define TCL_PARSE_MISSING_PAREN 5
  1940. //#define TCL_PARSE_MISSING_QUOTE 6
  1941. //#define TCL_PARSE_MISSING_VAR_BRACE 7
  1942. //#define TCL_PARSE_SYNTAX 8
  1943. //#define TCL_PARSE_BAD_NUMBER 9
  1944. /*
  1945. * A structure of the following type is filled in by Tcl_ParseCommand.
  1946. * It describes a single command parsed from an input string.
  1947. */
  1948. //#define NUM_STATIC_TOKENS 20
  1949. //typedef struct Tcl_Parse {
  1950. // string commentStart; /* Pointer to # that begins the first of
  1951. // * one or more comments preceding the
  1952. // * command. */
  1953. // int commentSize; /* Number of bytes in comments (up through
  1954. // * newline character that terminates the
  1955. // * last comment). If there were no
  1956. // * comments, this field is 0. */
  1957. // string commandStart; /* First character in first word of command. */
  1958. // int commandSize; /* Number of bytes in command, including
  1959. // * first character of first word, up
  1960. // * through the terminating newline,
  1961. // * close bracket, or semicolon. */
  1962. // int numWords; /* Total number of words in command. May
  1963. // * be 0. */
  1964. // Tcl_Token *tokenPtr; /* Pointer to first token representing
  1965. // * the words of the command. Initially
  1966. // * points to staticTokens, but may change
  1967. // * to point to malloc-ed space if command
  1968. // * exceeds space in staticTokens. */
  1969. // int numTokens; /* Total number of tokens in command. */
  1970. // int tokensAvailable; /* Total number of tokens available at
  1971. // * *tokenPtr. */
  1972. // int errorType; /* One of the parsing error types defined
  1973. // * above. */
  1974. // /*
  1975. // * The fields below are intended only for the private use of the
  1976. // * parser. They should not be used by procedures that invoke
  1977. // * Tcl_ParseCommand.
  1978. // */
  1979. // string string; /* The original command string passed to
  1980. // * Tcl_ParseCommand. */
  1981. // string end; /* Points to the character just after the
  1982. // * last one in the command string. */
  1983. // Tcl_Interp interp; /* Interpreter to use for error reporting,
  1984. // * or NULL. */
  1985. // string term; /* Points to character in string that
  1986. // * terminated most recent token. Filled in
  1987. // * by ParseTokens. If an error occurs,
  1988. // * points to beginning of region where the
  1989. // * error occurred (e.g. the open brace if
  1990. // * the close brace is missing). */
  1991. // int incomplete; /* This field is set to 1 by Tcl_ParseCommand
  1992. // * if the command appears to be incomplete.
  1993. // * This information is used by
  1994. // * Tcl_CommandComplete. */
  1995. // Tcl_Token staticTokens[NUM_STATIC_TOKENS];
  1996. // /* Initial space for tokens for command.
  1997. // * This space should be large enough to
  1998. // * accommodate most commands; dynamic
  1999. // * space is allocated for very large
  2000. // * commands that don't fit here. */
  2001. //} Tcl_Parse;
  2002. /*
  2003. * The following definitions are the error codes returned by the conversion
  2004. * routines:
  2005. *
  2006. * TCL_OK: All characters were converted.
  2007. *
  2008. * TCL_CONVERT_NOSPACE: The output buffer would not have been large
  2009. * enough for all of the converted data; as many
  2010. * characters as could fit were converted though.
  2011. *
  2012. * TCL_CONVERT_MULTIBYTE: The last few bytes in the source string were
  2013. * the beginning of a multibyte sequence, but
  2014. * more bytes were needed to complete this
  2015. * sequence. A subsequent call to the conversion
  2016. * routine should pass the beginning of this
  2017. * unconverted sequence plus additional bytes
  2018. * from the source stream to properly convert
  2019. * the formerly split-up multibyte sequence.
  2020. *
  2021. * TCL_CONVERT_SYNTAX: The source stream contained an invalid
  2022. * character sequence. This may occur if the
  2023. * input stream has been damaged or if the input
  2024. * encoding method was misidentified. This error
  2025. * is reported only if TCL_ENCODING_STOPONERROR
  2026. * was specified.
  2027. *
  2028. * TCL_CONVERT_UNKNOWN: The source string contained a character
  2029. * that could not be represented in the target
  2030. * encoding. This error is reported only if
  2031. * TCL_ENCODING_STOPONERROR was specified.
  2032. */
  2033. //#define TCL_CONVERT_MULTIBYTE -1
  2034. //#define TCL_CONVERT_SYNTAX -2
  2035. //#define TCL_CONVERT_UNKNOWN -3
  2036. //#define TCL_CONVERT_NOSPACE -4
  2037. /*
  2038. * The maximum number of bytes that are necessary to represent a single
  2039. * Unicode character in UTF-8. The valid values should be 3 or 6 (or
  2040. * perhaps 1 if we want to support a non-unicode enabled core).
  2041. * If 3, then Tcl_UniChar must be 2-bytes in size (UCS-2). (default)
  2042. * If 6, then Tcl_UniChar must be 4-bytes in size (UCS-4).
  2043. * At this time UCS-2 mode is the default and recommended mode.
  2044. * UCS-4 is experimental and not recommended. It works for the core,
  2045. * but most extensions expect UCS-2.
  2046. */
  2047. #if !TCL_UTF_MAX
  2048. //#define TCL_UTF_MAX 3
  2049. #endif
  2050. /*
  2051. * This represents a Unicode character. Any changes to this should
  2052. * also be reflected in regcustom.h.
  2053. */
  2054. //#if TCL_UTF_MAX > 3
  2055. // /*
  2056. // * unsigned int isn't 100% accurate as it should be a strict 4-byte
  2057. // * value (perhaps wchar_t). 64-bit systems may have troubles. The
  2058. // * size of this value must be reflected correctly in regcustom.h and
  2059. // * in tclEncoding.c.
  2060. // * XXX: Tcl is currently UCS-2 and planning UTF-16 for the Unicode
  2061. // * XXX: string rep that Tcl_UniChar represents. Changing the size
  2062. // * XXX: of Tcl_UniChar is /not/ supported.
  2063. // */
  2064. //typedef unsigned int Tcl_UniChar;
  2065. //#else
  2066. //typedef unsigned short Tcl_UniChar;
  2067. //#endif
  2068. /*
  2069. * Deprecated Tcl procedures:
  2070. */
  2071. #if !TCL_NO_DEPRECATED
  2072. //# define Tcl_EvalObj(interp,objPtr) \
  2073. // Tcl_EvalObjEx((interp),(objPtr),0)
  2074. //# define Tcl_GlobalEvalObj(interp,objPtr) \
  2075. // Tcl_EvalObjEx((interp),(objPtr),TCL_EVAL_GLOBAL)
  2076. #endif
  2077. /*
  2078. * These function have been renamed. The old names are deprecated, but we
  2079. * define these macros for backwards compatibilty.
  2080. */
  2081. //#define Tcl_Ckalloc Tcl_Alloc
  2082. //#define Tcl_Ckfree Tcl_Free
  2083. //#define Tcl_Ckrealloc Tcl_Realloc
  2084. //#define Tcl_return TCL.TCL_SetResult
  2085. //#define Tcl_TildeSubst Tcl_TranslateFileName
  2086. //#define panic Tcl_Panic
  2087. //#define panicVA Tcl_PanicVA
  2088. /*
  2089. * The following constant is used to test for older versions of Tcl
  2090. * in the stubs tables.
  2091. *
  2092. * Jan Nijtman's plus patch uses 0xFCA1BACF, so we need to pick a different
  2093. * value since the stubs tables don't match.
  2094. */
  2095. //#define TCL_STUB_MAGIC ((int)0xFCA3BACF)
  2096. /*
  2097. * The following function is required to be defined in all stubs aware
  2098. * extensions. The function is actually implemented in the stub
  2099. * library, not the main Tcl library, although there is a trivial
  2100. * implementation in the main library in case an extension is statically
  2101. * linked into an application.
  2102. */
  2103. //EXTERN string Tcl_InitStubs _ANSI_ARGS_((Tcl_Interp interp,
  2104. // string version, int exact));
  2105. #if !USE_TCL_STUBS
  2106. /*
  2107. * When not using stubs, make it a macro.
  2108. */
  2109. //#define Tcl_InitStubs(interp, version, exact) \
  2110. // Tcl_PkgRequire(interp, "Tcl", version, exact)
  2111. #endif
  2112. /*
  2113. * Include the public function declarations that are accessible via
  2114. * the stubs table.
  2115. */
  2116. //#include "tclDecls.h"
  2117. /*
  2118. * Include platform specific public function declarations that are
  2119. * accessible via the stubs table.
  2120. */
  2121. /*
  2122. * tclPlatDecls.h can't be included here on the Mac, as we need
  2123. * Mac specific headers to define the Mac types used in this file,
  2124. * but these Mac haders conflict with a number of tk types
  2125. * and thus can't be included in the globally read tcl.h
  2126. * This header was originally added here as a fix for bug 5241
  2127. * (stub link error for symbols in TclPlatStubs table), as a work-
  2128. * around for the bug on the mac, tclMac.h is included immediately
  2129. * after tcl.h in the tcl precompiled header (with DLLEXPORT set).
  2130. */
  2131. //#if !(MAC_TCL)
  2132. //#include "tclPlatDecls.h"
  2133. //#endif
  2134. /*
  2135. * Public functions that are not accessible via the stubs table.
  2136. */
  2137. //EXTERN void Tcl_Main _ANSI_ARGS_((int argc, char **argv,
  2138. // Tcl_AppInitProc *appInitProc));
  2139. /*
  2140. * Convenience declaration of Tcl_AppInit for backwards compatibility.
  2141. * This function is not *implemented* by the tcl library, so the storage
  2142. * class is neither DLLEXPORT nor DLLIMPORT
  2143. */
  2144. //#undef TCL_STORAGE_CLASS
  2145. //#define TCL_STORAGE_CLASS
  2146. //EXTERN int Tcl_AppInit _ANSI_ARGS_((Tcl_Interp interp));
  2147. //#undef TCL_STORAGE_CLASS
  2148. //#define TCL_STORAGE_CLASS DLLIMPORT
  2149. #endif // * RC_INVOKED */
  2150. /*
  2151. * end block for C++
  2152. */
  2153. #if __cplusplus
  2154. //}
  2155. #endif
  2156. #endif // * _TCL */
  2157. }
  2158. }