wasCSharpSQLite – Blame information for rev
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | namespace tcl.lang |
2 | { |
||
3 | public partial class TCL |
||
4 | { |
||
5 | |||
6 | /* |
||
7 | * tcl.h -- |
||
8 | * |
||
9 | * This header file describes the externally-visible facilities |
||
10 | * of the Tcl interpreter. |
||
11 | * |
||
12 | * Copyright (c) 1987-1994 The Regents of the University of California. |
||
13 | * Copyright (c) 1993-1996 Lucent Technologies. |
||
14 | * Copyright (c) 1994-1998 Sun Microsystems, Inc. |
||
15 | * Copyright (c) 1998-2000 by Scriptics Corporation. |
||
16 | * Copyright (c) 2002 by Kevin B. Kenny. All rights reserved. |
||
17 | * |
||
18 | * See the file "license.terms" for information on usage and redistribution |
||
19 | * of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
||
20 | * |
||
21 | * Included in SQLite3 port to C# for use in testharness only; 2008 Noah B Hart |
||
22 | * |
||
23 | * RCS @(#) $Id: tcl.h,v 1.153.2.34 2008/02/06 15:25:15 dgp Exp $ |
||
24 | */ |
||
25 | |||
26 | #if !_TCL |
||
27 | //#define _TCL |
||
28 | |||
29 | /* |
||
30 | * For C++ compilers, use extern "C" |
||
31 | */ |
||
32 | |||
33 | #if __cplusplus |
||
34 | //extern "C" { |
||
35 | #endif |
||
36 | |||
37 | /* |
||
38 | * The following defines are used to indicate the various release levels. |
||
39 | */ |
||
40 | |||
41 | //#define TCL_ALPHA_RELEASE 0 |
||
42 | //#define TCL_BETA_RELEASE 1 |
||
43 | //#define TCL_FINAL_RELEASE 2 |
||
44 | |||
45 | /* |
||
46 | * When version numbers change here, must also go into the following files |
||
47 | * and update the version numbers: |
||
48 | * |
||
49 | * library/init.tcl (only if Major.minor changes, not patchlevel) 1 LOC |
||
50 | * unix/configure.in (2 LOC Major, 2 LOC minor, 1 LOC patch) |
||
51 | * win/configure.in (as above) |
||
52 | * win/tcl.m4 (not patchlevel) |
||
53 | * win/makefile.vc (not patchlevel) 2 LOC |
||
54 | * README (sections 0 and 2) |
||
55 | * mac/README (2 LOC, not patchlevel) |
||
56 | * macosx/Tcl.pbproj/project.pbxproj (not patchlevel) 1 LOC |
||
57 | * macosx/Tcl.pbproj/default.pbxuser (not patchlevel) 1 LOC |
||
58 | * win/README.binary (sections 0-4) |
||
59 | * win/README (not patchlevel) (sections 0 and 2) |
||
60 | * unix/tcl.spec (2 LOC Major/Minor, 1 LOC patch) |
||
61 | * tests/basic.test (1 LOC M/M, not patchlevel) |
||
62 | * tools/tcl.hpj.in (not patchlevel, for windows installer) |
||
63 | * tools/tcl.wse.in (for windows installer) |
||
64 | * tools/tclSplash.bmp (not patchlevel) |
||
65 | */ |
||
66 | //#define TCL_MAJOR_VERSION 8 |
||
67 | //#define TCL_MINOR_VERSION 4 |
||
68 | //#define TCL_RELEASE_LEVEL TCL_FINAL_RELEASE |
||
69 | //#define TCL_RELEASE_SERIAL 18 |
||
70 | |||
71 | //#define TCL_VERSION "8.4" |
||
72 | //#define TCL_PATCH_LEVEL "8.4.18" |
||
73 | |||
74 | /* |
||
75 | * The following definitions set up the proper options for Windows |
||
76 | * compilers. We use this method because there is no autoconf equivalent. |
||
77 | */ |
||
78 | |||
79 | //#if !__WIN32__ |
||
80 | //# if defined(_WIN32) || defined(WIN32) || defined(__MINGW32__) || defined(__BORLANDC__) |
||
81 | //# define __WIN32__ |
||
82 | //# ifndef WIN32 |
||
83 | //# define WIN32 |
||
84 | //# endif |
||
85 | //# endif |
||
86 | //#endif |
||
87 | |||
88 | /* |
||
89 | * STRICT: See MSDN Article Q83456 |
||
90 | */ |
||
91 | //#if __WIN32__ |
||
92 | //# ifndef STRICT |
||
93 | //# define STRICT |
||
94 | //# endif |
||
95 | //#endif // * __WIN32__ */ |
||
96 | |||
97 | /* |
||
98 | * The following definitions set up the proper options for Macintosh |
||
99 | * compilers. We use this method because there is no autoconf equivalent. |
||
100 | */ |
||
101 | |||
102 | //#if MAC_TCL |
||
103 | //#include <ConditionalMacros.h> |
||
104 | //# ifndef USE_TCLALLOC |
||
105 | //# define USE_TCLALLOC 1 |
||
106 | //# endif |
||
107 | //# ifndef NO_STRERROR |
||
108 | //# define NO_STRERROR 1 |
||
109 | //# endif |
||
110 | //# define INLINE |
||
111 | //#endif |
||
112 | |||
113 | |||
114 | /* |
||
115 | * Utility macros: STRINGIFY takes an argument and wraps it in "" (double |
||
116 | * quotation marks), JOIN joins two arguments. |
||
117 | */ |
||
118 | //#if !STRINGIFY |
||
119 | //# define STRINGIFY(x) STRINGIFY1(x) |
||
120 | //# define STRINGIFY1(x) #x |
||
121 | //#endif |
||
122 | //#if !JOIN |
||
123 | //# define JOIN(a,b) JOIN1(a,b) |
||
124 | //# define JOIN1(a,b) a##b |
||
125 | //#endif |
||
126 | |||
127 | /* |
||
128 | * A special definition used to allow this header file to be included |
||
129 | * from windows or mac resource files so that they can obtain version |
||
130 | * information. RC_INVOKED is defined by default by the windows RC tool |
||
131 | * and manually set for macintosh. |
||
132 | * |
||
133 | * Resource compilers don't like all the C stuff, like typedefs and |
||
134 | * procedure declarations, that occur below, so block them out. |
||
135 | */ |
||
136 | |||
137 | #if !RC_INVOKED |
||
138 | |||
139 | /* |
||
140 | * Special macro to define mutexes, that doesn't do anything |
||
141 | * if we are not using threads. |
||
142 | */ |
||
143 | |||
144 | #if TCL_THREADS |
||
145 | //#define TCL_DECLARE_MUTEX(name) static Tcl_Mutex name; |
||
146 | #else |
||
147 | //#define TCL_DECLARE_MUTEX(name) |
||
148 | #endif |
||
149 | |||
150 | /* |
||
151 | * Macros that eliminate the overhead of the thread synchronization |
||
152 | * functions when compiling without thread support. |
||
153 | */ |
||
154 | |||
155 | #if !TCL_THREADS |
||
156 | //#define Tcl_MutexLock(mutexPtr) |
||
157 | //#define Tcl_MutexUnlock(mutexPtr) |
||
158 | //#define Tcl_MutexFinalize(mutexPtr) |
||
159 | //#define Tcl_ConditionNotify(condPtr) |
||
160 | //#define Tcl_ConditionWait(condPtr, mutexPtr, timePtr) |
||
161 | //#define Tcl_ConditionFinalize(condPtr) |
||
162 | #endif // * TCL_THREADS */ |
||
163 | |||
164 | |||
165 | //#if !BUFSIZ |
||
166 | //# include <stdio.h> |
||
167 | //#endif |
||
168 | |||
169 | |||
170 | /* |
||
171 | * Definitions that allow Tcl functions with variable numbers of |
||
172 | * arguments to be used with either varargs.h or stdarg.h. TCL_VARARGS |
||
173 | * is used in procedure prototypes. TCL_VARARGS_DEF is used to declare |
||
174 | * the arguments in a function definiton: it takes the type and name of |
||
175 | * the first argument and supplies the appropriate argument declaration |
||
176 | * string for use in the function definition. TCL_VARARGS_START |
||
177 | * initializes the va_list data structure and returns the first argument. |
||
178 | */ |
||
179 | //#if !(NO_STDARG) |
||
180 | //# include <stdarg.h> |
||
181 | //# define TCL_VARARGS(type, name) (type name, ...) |
||
182 | //# define TCL_VARARGS_DEF(type, name) (type name, ...) |
||
183 | //# define TCL_VARARGS_START(type, name, list) (va_start(list, name), name) |
||
184 | //#else |
||
185 | //# include <varargs.h> |
||
186 | //# define TCL_VARARGS(type, name) () |
||
187 | //# define TCL_VARARGS_DEF(type, name) (va_alist) |
||
188 | //# define TCL_VARARGS_START(type, name, list) \ |
||
189 | // (va_start(list), va_arg(list, type)) |
||
190 | //#endif |
||
191 | |||
192 | /* |
||
193 | * Macros used to declare a function to be exported by a DLL. |
||
194 | * Used by Windows, maps to no-op declarations on non-Windows systems. |
||
195 | * The default build on windows is for a DLL, which causes the DLLIMPORT |
||
196 | * and DLLEXPORT macros to be nonempty. To build a static library, the |
||
197 | * macro STATIC_BUILD should be defined. |
||
198 | */ |
||
199 | |||
200 | //#if STATIC_BUILD |
||
201 | //# define DLLIMPORT |
||
202 | //# define DLLEXPORT |
||
203 | //#else |
||
204 | //# if (defined(__WIN32__) && (defined(_MSC_VER) || (__BORLANDC__ >= 0x0550) || (defined(__GNUC__) && defined(__declspec)))) || (defined(MAC_TCL) && FUNCTION_DECLSPEC) |
||
205 | //# define DLLIMPORT __declspec(dllimport) |
||
206 | //# define DLLEXPORT __declspec(dllexport) |
||
207 | //# else |
||
208 | //# define DLLIMPORT |
||
209 | //# define DLLEXPORT |
||
210 | //# endif |
||
211 | //#endif |
||
212 | |||
213 | /* |
||
214 | * These macros are used to control whether functions are being declared for |
||
215 | * import or export. If a function is being declared while it is being built |
||
216 | * to be included in a shared library, then it should have the DLLEXPORT |
||
217 | * storage class. If is being declared for use by a module that is going to |
||
218 | * link against the shared library, then it should have the DLLIMPORT storage |
||
219 | * class. If the symbol is beind declared for a static build or for use from a |
||
220 | * stub library, then the storage class should be empty. |
||
221 | * |
||
222 | * The convention is that a macro called BUILD_xxxx, where xxxx is the |
||
223 | * name of a library we are building, is set on the compile line for sources |
||
224 | * that are to be placed in the library. When this macro is set, the |
||
225 | * storage class will be set to DLLEXPORT. At the end of the header file, the |
||
226 | * storage class will be reset to DLLIMPORT. |
||
227 | */ |
||
228 | //#undef TCL_STORAGE_CLASS |
||
229 | //#if BUILD_tcl |
||
230 | //# define TCL_STORAGE_CLASS DLLEXPORT |
||
231 | //#else |
||
232 | //# ifdef USE_TCL_STUBS |
||
233 | //# define TCL_STORAGE_CLASS |
||
234 | //# else |
||
235 | //# define TCL_STORAGE_CLASS DLLIMPORT |
||
236 | //# endif |
||
237 | //#endif |
||
238 | |||
239 | |||
240 | /* |
||
241 | * Definitions that allow this header file to be used either with or |
||
242 | * without ANSI C features like function prototypes. |
||
243 | */ |
||
244 | //#undef _ANSI_ARGS_ |
||
245 | //#undef CONST |
||
246 | //#if !INLINE |
||
247 | //# define INLINE |
||
248 | //#endif |
||
249 | |||
250 | //#if !NO_CONST |
||
251 | //# define CONST const |
||
252 | //#else |
||
253 | //# define CONST |
||
254 | //#endif |
||
255 | |||
256 | //#if !NO_PROTOTYPES |
||
257 | //# define _ANSI_ARGS_(x) x |
||
258 | //#else |
||
259 | //# define _ANSI_ARGS_(x) () |
||
260 | //#endif |
||
261 | |||
262 | //#if USE_NON_CONST |
||
263 | //# ifdef USE_COMPAT_CONST |
||
264 | //# error define at most one of USE_NON_CONST and USE_COMPAT_CONST |
||
265 | //# endif |
||
266 | //# define CONST84 |
||
267 | //# define CONST84_RETURN |
||
268 | //#else |
||
269 | //# ifdef USE_COMPAT_CONST |
||
270 | //# define CONST84 |
||
271 | //# define CONST84_RETURN CONST |
||
272 | //# else |
||
273 | //# define CONST84 CONST |
||
274 | //# define CONST84_RETURN CONST |
||
275 | //# endif |
||
276 | //#endif |
||
277 | |||
278 | |||
279 | /* |
||
280 | * Make sure EXTERN isn't defined elsewhere |
||
281 | */ |
||
282 | //#if EXTERN |
||
283 | //# undef EXTERN |
||
284 | //#endif // * EXTERN */ |
||
285 | |||
286 | //#if __cplusplus |
||
287 | //# define EXTERN extern "C" TCL_STORAGE_CLASS |
||
288 | //#else |
||
289 | //# define EXTERN extern TCL_STORAGE_CLASS |
||
290 | //#endif |
||
291 | |||
292 | |||
293 | /* |
||
294 | * The following code is copied from winnt.h. |
||
295 | * If we don't replicate it here, then <windows.h> can't be included |
||
296 | * after tcl.h, since tcl.h also defines VOID. |
||
297 | * This block is skipped under Cygwin and Mingw. |
||
298 | * |
||
299 | * |
||
300 | */ |
||
301 | //#if (__WIN32__) && !HAVE_WINNT_IGNORE_VOID) |
||
302 | //#if !VOID |
||
303 | ////#define VOID void |
||
304 | ////typedef char CHAR; |
||
305 | ////typedef short SHORT; |
||
306 | ////typedef long LONG; |
||
307 | //#endif |
||
308 | //#endif // * __WIN32__ && !HAVE_WINNT_IGNORE_VOID */ |
||
309 | |||
310 | /* |
||
311 | * Macro to use instead of "void" for arguments that must have |
||
312 | * type "void *" in ANSI C; maps them to type "char *" in |
||
313 | * non-ANSI systems. |
||
314 | */ |
||
315 | |||
316 | //#if !NO_VOID |
||
317 | //# define VOID void |
||
318 | //#else |
||
319 | //# define VOID char |
||
320 | //#endif |
||
321 | |||
322 | ///* |
||
323 | //* Miscellaneous declarations. |
||
324 | //*/ |
||
325 | |||
326 | //#if !_CLIENTDATA |
||
327 | //# ifndef NO_VOID |
||
328 | //// typedef void *ClientData; |
||
329 | //# else |
||
330 | //// typedef int *ClientData; |
||
331 | //# endif |
||
332 | //# define _CLIENTDATA |
||
333 | //#endif |
||
334 | |||
335 | /* |
||
336 | * Darwin specifc configure overrides (to support fat compiles, where |
||
337 | * configure runs only once for multiple architectures): |
||
338 | */ |
||
339 | |||
340 | //#if __APPLE__ |
||
341 | //# ifdef __LP64__ |
||
342 | //# undef TCL_WIDE_INT_TYPE |
||
343 | //# define TCL_WIDE_INT_IS_LONG 1 |
||
344 | //# else /* !__LP64__ */ |
||
345 | //# define TCL_WIDE_INT_TYPE long long |
||
346 | //# undef TCL_WIDE_INT_IS_LONG |
||
347 | //# endif /* __LP64__ */ |
||
348 | //# undef HAVE_STRUCT_STAT64 |
||
349 | //#endif // * __APPLE__ */ |
||
350 | |||
351 | /* |
||
352 | * Define Tcl_WideInt to be a type that is (at least) 64-bits wide, |
||
353 | * and define Tcl_Wideu32 to be the unsigned variant of that type |
||
354 | * (assuming that where we have one, we can have the other.) |
||
355 | * |
||
356 | * Also defines the following macros: |
||
357 | * TCL_WIDE_INT_IS_LONG - if wide ints are really longs (i.e. we're on |
||
358 | * a real 64-bit system.) |
||
359 | * Tcl_WideAsLong - forgetful converter from wideInt to long. |
||
360 | * Tcl_LongAsWide - sign-extending converter from long to wideInt. |
||
361 | * Tcl_WideAsDouble - converter from wideInt to double. |
||
362 | * Tcl_DoubleAsWide - converter from double to wideInt. |
||
363 | * |
||
364 | * The following invariant should hold for any long value 'longVal': |
||
365 | * longVal == TCL.Tcl_WideAsLong(Tcl_LongAsWide(longVal)) |
||
366 | * |
||
367 | * Note on converting between Tcl_WideInt and strings. This |
||
368 | * implementation (in tclObj.c) depends on the functions strtoull() |
||
369 | * and sprintf(...,"%" TCL_LL_MODIFIER "d",...). TCL_LL_MODIFIER_SIZE |
||
370 | * is the length of the modifier string, which is "ll" on most 32-bit |
||
371 | * Unix systems. It has to be split up like this to allow for the more |
||
372 | * complex formats sometimes needed (e.g. in the format(n) command.) |
||
373 | */ |
||
374 | |||
375 | //#if !(TCL_WIDE_INT_TYPE)&&!TCL_WIDE_INT_IS_LONG) |
||
376 | //# if defined(__GNUC__) |
||
377 | //# define TCL_WIDE_INT_TYPE long long |
||
378 | //# if defined(__WIN32__) && !__CYGWIN__) |
||
379 | //# define TCL_LL_MODIFIER "I64" |
||
380 | //# define TCL_LL_MODIFIER_SIZE 3 |
||
381 | //# else |
||
382 | //# define TCL_LL_MODIFIER "L" |
||
383 | //# define TCL_LL_MODIFIER_SIZE 1 |
||
384 | //# endif |
||
385 | ////typedef struct stat Tcl_StatBuf; |
||
386 | //# elif defined(__WIN32__) |
||
387 | //# define TCL_WIDE_INT_TYPE __int64 |
||
388 | //# ifdef __BORLANDC__ |
||
389 | ////typedef struct stati64 Tcl_StatBuf; |
||
390 | //# define TCL_LL_MODIFIER "L" |
||
391 | //# define TCL_LL_MODIFIER_SIZE 1 |
||
392 | //# else /* __BORLANDC__ */ |
||
393 | //# if _MSC_VER < 1400 || !_M_IX86) |
||
394 | ////typedef struct _stati64 Tcl_StatBuf; |
||
395 | //# else |
||
396 | ////typedef struct _stat64 Tcl_StatBuf; |
||
397 | //# endif /* _MSC_VER < 1400 */ |
||
398 | //# define TCL_LL_MODIFIER "I64" |
||
399 | //# define TCL_LL_MODIFIER_SIZE 3 |
||
400 | //# endif /* __BORLANDC__ */ |
||
401 | //# else /* __WIN32__ */ |
||
402 | ///* |
||
403 | //* Don't know what platform it is and configure hasn't discovered what |
||
404 | //* is going on for us. Try to guess... |
||
405 | //*/ |
||
406 | //# ifdef NO_LIMITS_H |
||
407 | //# error please define either TCL_WIDE_INT_TYPE or TCL_WIDE_INT_IS_LONG |
||
408 | //# else /* !NO_LIMITS_H */ |
||
409 | //# include <limits.h> |
||
410 | //# if (INT_MAX < LONG_MAX) |
||
411 | //# define TCL_WIDE_INT_IS_LONG 1 |
||
412 | //# else |
||
413 | //# define TCL_WIDE_INT_TYPE long long |
||
414 | //# endif |
||
415 | //# endif /* NO_LIMITS_H */ |
||
416 | //# endif /* __WIN32__ */ |
||
417 | //#endif // * !TCL_WIDE_INT_TYPE & !TCL_WIDE_INT_IS_LONG */ |
||
418 | //#if TCL_WIDE_INT_IS_LONG |
||
419 | //# undef TCL_WIDE_INT_TYPE |
||
420 | //# define TCL_WIDE_INT_TYPE long |
||
421 | //#endif // * TCL_WIDE_INT_IS_LONG */ |
||
422 | |||
423 | ////typedef TCL_WIDE_INT_TYPE Tcl_WideInt; |
||
424 | ////typedef unsigned TCL_WIDE_INT_TYPE Tcl_Wideu32; |
||
425 | |||
426 | //#if TCL_WIDE_INT_IS_LONG |
||
427 | ////typedef struct stat Tcl_StatBuf; |
||
428 | //# define Tcl_WideAsLong(val) ((long)(val)) |
||
429 | //# define Tcl_LongAsWide(val) ((long)(val)) |
||
430 | //# define Tcl_WideAsDouble(val) ((double)((long)(val))) |
||
431 | //# define Tcl_DoubleAsWide(val) ((long)((double)(val))) |
||
432 | //# ifndef TCL_LL_MODIFIER |
||
433 | //# define TCL_LL_MODIFIER "l" |
||
434 | //# define TCL_LL_MODIFIER_SIZE 1 |
||
435 | //# endif /* !TCL_LL_MODIFIER */ |
||
436 | //#else /* TCL_WIDE_INT_IS_LONG */ |
||
437 | ///* |
||
438 | //* The next short section of defines are only done when not running on |
||
439 | //* Windows or some other strange platform. |
||
440 | //*/ |
||
441 | //# ifndef TCL_LL_MODIFIER |
||
442 | //# ifdef HAVE_STRUCT_STAT64 |
||
443 | ////typedef struct stat64 Tcl_StatBuf; |
||
444 | //# else |
||
445 | ////typedef struct stat Tcl_StatBuf; |
||
446 | //# endif /* HAVE_STRUCT_STAT64 */ |
||
447 | //# define TCL_LL_MODIFIER "ll" |
||
448 | //# define TCL_LL_MODIFIER_SIZE 2 |
||
449 | //# endif /* !TCL_LL_MODIFIER */ |
||
450 | //# define Tcl_WideAsLong(val) ((long)((Tcl_WideInt)(val))) |
||
451 | //# define Tcl_LongAsWide(val) ((Tcl_WideInt)((long)(val))) |
||
452 | //# define Tcl_WideAsDouble(val) ((double)((Tcl_WideInt)(val))) |
||
453 | //# define Tcl_DoubleAsWide(val) ((Tcl_WideInt)((double)(val))) |
||
454 | //#endif // * TCL_WIDE_INT_IS_LONG */ |
||
455 | |||
456 | |||
457 | /* |
||
458 | * This flag controls whether binary compatability is maintained with |
||
459 | * extensions built against a previous version of Tcl. This is true |
||
460 | * by default. |
||
461 | */ |
||
462 | //#if !TCL_PRESERVE_BINARY_COMPATABILITY |
||
463 | //# define TCL_PRESERVE_BINARY_COMPATABILITY 1 |
||
464 | //#endif |
||
465 | |||
466 | |||
467 | /* |
||
468 | * Data structures defined opaquely in this module. The definitions below |
||
469 | * just provide dummy types. A few fields are made visible in Tcl_Interp |
||
470 | * structures, namely those used for returning a string result from |
||
471 | * commands. Direct access to the result field is discouraged in Tcl 8.0. |
||
472 | * The interpreter result is either an object or a string, and the two |
||
473 | * values are kept consistent unless some C code sets interp.result |
||
474 | * directly. Programmers should use either the procedure Tcl_GetObjResult() |
||
475 | * or Tcl_GetStringResult() to read the interpreter's result. See the |
||
476 | * SetResult man page for details. |
||
477 | * |
||
478 | * Note: any change to the Tcl_Interp definition below must be mirrored |
||
479 | * in the "real" definition in tclInt.h. |
||
480 | * |
||
481 | * Note: Tcl_ObjCmdProc procedures do not directly set result and freeProc. |
||
482 | * Instead, they set a Tcl_Obj member in the "real" structure that can be |
||
483 | * accessed with Tcl_GetObjResult() and Tcl_SetObjResult(). |
||
484 | */ |
||
485 | |||
486 | //typedef struct Tcl_Interp { |
||
487 | // char *result; /* If the last command returned a string |
||
488 | // * result, this points to it. */ |
||
489 | // void (*freeProc) _ANSI_ARGS_((char *blockPtr)); |
||
490 | // /* Zero means the string result is |
||
491 | // * statically allocated. TCL_DYNAMIC means |
||
492 | // * it was allocated with ckalloc and should |
||
493 | // * be freed with ckfree. Other values give |
||
494 | // * the address of procedure to invoke to |
||
495 | // * free the result. Tcl_Eval must free it |
||
496 | // * before executing next command. */ |
||
497 | // int errorLine; /* When TCL_ERROR is returned, this gives |
||
498 | // * the line number within the command where |
||
499 | // * the error occurred (1 if first line). */ |
||
500 | //} Tcl_Interp; |
||
501 | |||
502 | //typedef struct Tcl_AsyncHandler_ *Tcl_AsyncHandler; |
||
503 | //typedef struct Tcl_Channel_ *Tcl_Channel; |
||
504 | //typedef struct Tcl_Command_ *Tcl_Command; |
||
505 | //typedef struct Tcl_Condition_ *Tcl_Condition; |
||
506 | //typedef struct Tcl_EncodingState_ *Tcl_EncodingState; |
||
507 | //typedef struct Tcl_Encoding_ *Tcl_Encoding; |
||
508 | //typedef struct Tcl_Event Tcl_Event; |
||
509 | //typedef struct Tcl_Mutex_ *Tcl_Mutex; |
||
510 | //typedef struct Tcl_Pid_ *Tcl_Pid; |
||
511 | //typedef struct Tcl_RegExp_ *Tcl_RegExp; |
||
512 | //typedef struct Tcl_ThreadDataKey_ *Tcl_ThreadDataKey; |
||
513 | //typedef struct Tcl_ThreadId_ *Tcl_ThreadId; |
||
514 | //typedef struct Tcl_TimerToken_ *Tcl_TimerToken; |
||
515 | //typedef struct Tcl_Trace_ *Tcl_Trace; |
||
516 | //typedef struct Tcl_Var_ *Tcl_Var; |
||
517 | //typedef struct Tcl_ChannelTypeVersion_ *Tcl_ChannelTypeVersion; |
||
518 | //typedef struct Tcl_LoadHandle_ *Tcl_LoadHandle; |
||
519 | |||
520 | /* |
||
521 | * Definition of the interface to procedures implementing threads. |
||
522 | * A procedure following this definition is given to each call of |
||
523 | * 'Tcl_CreateThread' and will be called as the main fuction of |
||
524 | * the new thread created by that call. |
||
525 | */ |
||
526 | //#if MAC_TCL |
||
527 | ////typedef pascal void *(Tcl_ThreadCreateProc) _ANSI_ARGS_((ClientData clientData)); |
||
528 | //#elif defined __WIN32__ |
||
529 | ////typedef unsigned (__stdcall Tcl_ThreadCreateProc) _ANSI_ARGS_((ClientData clientData)); |
||
530 | //#else |
||
531 | ////typedef void (Tcl_ThreadCreateProc) _ANSI_ARGS_((ClientData clientData)); |
||
532 | //#endif |
||
533 | |||
534 | |||
535 | /* |
||
536 | * Threading function return types used for abstracting away platform |
||
537 | * differences when writing a Tcl_ThreadCreateProc. See the NewThread |
||
538 | * function in generic/tclThreadTest.c for it's usage. |
||
539 | */ |
||
540 | //#if MAC_TCL |
||
541 | //# define Tcl_ThreadCreateType pascal void * |
||
542 | //# define TCL_THREAD_CREATE_RETURN return NULL |
||
543 | //#elif defined __WIN32__ |
||
544 | //# define Tcl_ThreadCreateType unsigned __stdcall |
||
545 | //# define TCL_THREAD_CREATE_RETURN return 0 |
||
546 | //#else |
||
547 | //# define Tcl_ThreadCreateType void |
||
548 | //# define TCL_THREAD_CREATE_RETURN |
||
549 | //#endif |
||
550 | |||
551 | |||
552 | /* |
||
553 | * Definition of values for default stacksize and the possible flags to be |
||
554 | * given to Tcl_CreateThread. |
||
555 | */ |
||
556 | //#define TCL_THREAD_STACK_DEFAULT (0) /* Use default size for stack */ |
||
557 | //#define TCL_THREAD_NOFLAGS (0000) /* Standard flags, default behavior */ |
||
558 | //#define TCL_THREAD_JOINABLE (0001) /* Mark the thread as joinable */ |
||
559 | |||
560 | /* |
||
561 | * Flag values passed to Tcl_GetRegExpFromObj. |
||
562 | */ |
||
563 | //#define TCL_REG_BASIC 000000 /* BREs (convenience) */ |
||
564 | //#define TCL_REG_EXTENDED 000001 /* EREs */ |
||
565 | //#define TCL_REG_ADVF 000002 /* advanced features in EREs */ |
||
566 | //#define TCL_REG_ADVANCED 000003 /* AREs (which are also EREs) */ |
||
567 | //#define TCL_REG_QUOTE 000004 /* no special characters, none */ |
||
568 | //#define TCL_REG_NOCASE 000010 /* ignore case */ |
||
569 | //#define TCL_REG_NOSUB 000020 /* don't care about subexpressions */ |
||
570 | //#define TCL_REG_EXPANDED 000040 /* expanded format, white space & |
||
571 | // * comments */ |
||
572 | //#define TCL_REG_NLSTOP 000100 /* \n doesn't match . or [^ ] */ |
||
573 | //#define TCL_REG_NLANCH 000200 /* ^ matches after \n, $ before */ |
||
574 | //#define TCL_REG_NEWLINE 000300 /* newlines are line terminators */ |
||
575 | //#define TCL_REG_CANMATCH 001000 /* report details on partial/limited |
||
576 | // * matches */ |
||
577 | |||
578 | /* |
||
579 | * The following flag is experimental and only intended for use by Expect. It |
||
580 | * will probably go away in a later release. |
||
581 | */ |
||
582 | //#define TCL_REG_BOSONLY 002000 /* prepend \A to pattern so it only |
||
583 | // * matches at the beginning of the |
||
584 | // * string. */ |
||
585 | |||
586 | /* |
||
587 | * Flags values passed to Tcl_RegExpExecObj. |
||
588 | */ |
||
589 | //#define TCL_REG_NOTBOL 0001 /* Beginning of string does not match ^. */ |
||
590 | //#define TCL_REG_NOTEOL 0002 /* End of string does not match $. */ |
||
591 | |||
592 | /* |
||
593 | * Structures filled in by Tcl_RegExpInfo. Note that all offset values are |
||
594 | * relative to the start of the match string, not the beginning of the |
||
595 | * entire string. |
||
596 | */ |
||
597 | //typedef struct Tcl_RegExpIndices { |
||
598 | // long start; /* character offset of first character in match */ |
||
599 | // long end; /* character offset of first character after the |
||
600 | // * match. */ |
||
601 | //} Tcl_RegExpIndices; |
||
602 | |||
603 | //typedef struct Tcl_RegExpInfo { |
||
604 | // int nsubs; /* number of subexpressions in the |
||
605 | // * compiled expression */ |
||
606 | // Tcl_RegExpIndices *matches; /* array of nsubs match offset |
||
607 | // * pairs */ |
||
608 | // long extendStart; /* The offset at which a subsequent |
||
609 | // * match might begin. */ |
||
610 | // long reserved; /* Reserved for later use. */ |
||
611 | //} Tcl_RegExpInfo; |
||
612 | |||
613 | /* |
||
614 | * Picky compilers complain if this typdef doesn't appear before the |
||
615 | * struct's reference in tclDecls.h. |
||
616 | */ |
||
617 | //typedef Tcl_StatBuf *Tcl_Stat_; |
||
618 | //typedef struct stat *Tcl_OldStat_; |
||
619 | |||
620 | /* |
||
621 | * When a TCL command returns, the interpreter contains a result from the |
||
622 | * command. Programmers are strongly encouraged to use one of the |
||
623 | * procedures Tcl_GetObjResult() or Tcl_GetStringResult() to read the |
||
624 | * interpreter's result. See the SetResult man page for details. Besides |
||
625 | * this result, the command procedure returns an integer code, which is |
||
626 | * one of the following: |
||
627 | * |
||
628 | * TCL_OK Command completed normally; the interpreter's |
||
629 | * result contains the command's result. |
||
630 | * TCL_ERROR The command couldn't be completed successfully; |
||
631 | * the interpreter's result describes what went wrong. |
||
632 | * TCL_RETURN The command requests that the current procedure |
||
633 | * return; the interpreter's result contains the |
||
634 | * procedure's return value. |
||
635 | * TCL_BREAK The command requests that the innermost loop |
||
636 | * be exited; the interpreter's result is meaningless. |
||
637 | * TCL_CONTINUE Go on to the next iteration of the current loop; |
||
638 | * the interpreter's result is meaningless. |
||
639 | */ |
||
640 | public const int TCL_OK = 0; |
||
641 | public const int TCL_ERROR = 1; |
||
642 | public const int TCL_RETURN = 2; |
||
643 | public const int TCL_BREAK = 3; |
||
644 | public const int TCL_CONTINUE = 4; |
||
645 | |||
646 | //#define TCL_RESULT_SIZE 200 |
||
647 | |||
648 | /* |
||
649 | * Flags to control what substitutions are performed by Tcl_SubstObj(): |
||
650 | */ |
||
651 | //#define TCL_SUBST_COMMANDS 001 |
||
652 | //#define TCL_SUBST_VARIABLES 002 |
||
653 | //#define TCL_SUBST_BACKSLASHES 004 |
||
654 | //#define TCL_SUBST_ALL 007 |
||
655 | |||
656 | |||
657 | /* |
||
658 | * Argument descriptors for math function callbacks in expressions: |
||
659 | */ |
||
660 | //typedef enum { |
||
661 | // TCL_INT, TCL.TCL_DOUBLE, TCL.TCL_EITHER, TCL.TCL_WIDE_INT |
||
662 | //} Tcl_ValueType; |
||
663 | //typedef struct Tcl_Value { |
||
664 | // Tcl_ValueType type; /* Indicates intValue or doubleValue is |
||
665 | // * valid, or both. */ |
||
666 | // long intValue; /* Integer value. */ |
||
667 | // double doubleValue; /* Double-precision floating value. */ |
||
668 | // Tcl_WideInt wideValue; /* Wide (min. 64-bit) integer value. */ |
||
669 | //} Tcl_Value; |
||
670 | |||
671 | /* |
||
672 | * Forward declaration of Tcl_Obj to prevent an error when the forward |
||
673 | * reference to Tcl_Obj is encountered in the procedure types declared |
||
674 | * below. |
||
675 | */ |
||
676 | //struct Tcl_Obj; |
||
677 | |||
678 | |||
679 | /* |
||
680 | * Procedure types defined by Tcl: |
||
681 | */ |
||
682 | |||
683 | //typedef int (Tcl_AppInitProc) _ANSI_ARGS_((Tcl_Interp interp)); |
||
684 | //typedef int (Tcl_AsyncProc) _ANSI_ARGS_((ClientData clientData, |
||
685 | // Tcl_Interp interp, int code)); |
||
686 | //typedef void (Tcl_ChannelProc) _ANSI_ARGS_((ClientData clientData, int mask)); |
||
687 | //typedef void (Tcl_CloseProc) _ANSI_ARGS_((ClientData data)); |
||
688 | //typedef void (Tcl_CmdDeleteProc) _ANSI_ARGS_((ClientData clientData)); |
||
689 | //typedef int (Tcl_CmdProc) _ANSI_ARGS_((ClientData clientData, |
||
690 | // Tcl_Interp interp, int argc, CONST84 char *argv[])); |
||
691 | //typedef void (Tcl_CmdTraceProc) _ANSI_ARGS_((ClientData clientData, |
||
692 | // Tcl_Interp interp, int level, char *command, TCL.TCL_CmdProc proc, |
||
693 | // ClientData cmdClientData, int argc, CONST84 char *argv[])); |
||
694 | //typedef int (Tcl_CmdObjTraceProc) _ANSI_ARGS_((ClientData clientData, |
||
695 | // Tcl_Interp interp, int level, string command, |
||
696 | // Tcl_Command commandInfo, int objc, struct Tcl_Obj * CONST * objv)); |
||
697 | //typedef void (Tcl_CmdObjTraceDeleteProc) _ANSI_ARGS_((ClientData clientData)); |
||
698 | //typedef void (Tcl_DupInternalRepProc) _ANSI_ARGS_((struct Tcl_Obj *srcPtr, |
||
699 | // struct Tcl_Obj *dupPtr)); |
||
700 | //typedef int (Tcl_EncodingConvertProc)_ANSI_ARGS_((ClientData clientData, |
||
701 | // string src, int srcLen, int flags, TCL.TCL_EncodingState *statePtr, |
||
702 | // char *dst, int dstLen, int *srcReadPtr, int *dstWrotePtr, |
||
703 | // int *dstCharsPtr)); |
||
704 | //typedef void (Tcl_EncodingFreeProc)_ANSI_ARGS_((ClientData clientData)); |
||
705 | //typedef int (Tcl_EventProc) _ANSI_ARGS_((Tcl_Event *evPtr, int flags)); |
||
706 | //typedef void (Tcl_EventCheckProc) _ANSI_ARGS_((ClientData clientData, |
||
707 | // int flags)); |
||
708 | //typedef int (Tcl_EventDeleteProc) _ANSI_ARGS_((Tcl_Event *evPtr, |
||
709 | // ClientData clientData)); |
||
710 | //typedef void (Tcl_EventSetupProc) _ANSI_ARGS_((ClientData clientData, |
||
711 | // int flags)); |
||
712 | //typedef void (Tcl_ExitProc) _ANSI_ARGS_((ClientData clientData)); |
||
713 | //typedef void (Tcl_FileProc) _ANSI_ARGS_((ClientData clientData, int mask)); |
||
714 | //typedef void (Tcl_FileFreeProc) _ANSI_ARGS_((ClientData clientData)); |
||
715 | //typedef void (Tcl_FreeInternalRepProc) _ANSI_ARGS_((struct Tcl_Obj *objPtr)); |
||
716 | //typedef void (Tcl_FreeProc) _ANSI_ARGS_((char *blockPtr)); |
||
717 | //typedef void (Tcl_IdleProc) _ANSI_ARGS_((ClientData clientData)); |
||
718 | //typedef void (Tcl_InterpDeleteProc) _ANSI_ARGS_((ClientData clientData, |
||
719 | // Tcl_Interp interp)); |
||
720 | //typedef int (Tcl_MathProc) _ANSI_ARGS_((ClientData clientData, |
||
721 | // Tcl_Interp interp, TCL.TCL_Value *args, TCL.TCL_Value *resultPtr)); |
||
722 | //typedef void (Tcl_NamespaceDeleteProc) _ANSI_ARGS_((ClientData clientData)); |
||
723 | //typedef int (Tcl_ObjCmdProc) _ANSI_ARGS_((ClientData clientData, |
||
724 | // Tcl_Interp interp, int objc, struct Tcl_Obj * CONST * objv)); |
||
725 | //typedef int (Tcl_PackageInitProc) _ANSI_ARGS_((Tcl_Interp interp)); |
||
726 | //typedef void (Tcl_PanicProc) _ANSI_ARGS_(TCL_VARARGS(string , format)); |
||
727 | //typedef void (Tcl_TcpAcceptProc) _ANSI_ARGS_((ClientData callbackData, |
||
728 | // Tcl_Channel chan, char *address, int port)); |
||
729 | //typedef void (Tcl_TimerProc) _ANSI_ARGS_((ClientData clientData)); |
||
730 | //typedef int (Tcl_SetFromAnyProc) _ANSI_ARGS_((Tcl_Interp interp, |
||
731 | // struct Tcl_Obj *objPtr)); |
||
732 | //typedef void (Tcl_UpdateStringProc) _ANSI_ARGS_((struct Tcl_Obj *objPtr)); |
||
733 | //typedef char *(Tcl_VarTraceProc) _ANSI_ARGS_((ClientData clientData, |
||
734 | // Tcl_Interp interp, CONST84 char part1, CONST84 char part2, int flags)); |
||
735 | //typedef void (Tcl_CommandTraceProc) _ANSI_ARGS_((ClientData clientData, |
||
736 | // Tcl_Interp interp, string oldName, string newName, |
||
737 | // int flags)); |
||
738 | //typedef void (Tcl_CreateFileHandlerProc) _ANSI_ARGS_((int fd, int mask, |
||
739 | // Tcl_FileProc proc, ClientData clientData)); |
||
740 | //typedef void (Tcl_DeleteFileHandlerProc) _ANSI_ARGS_((int fd)); |
||
741 | //typedef void (Tcl_AlertNotifierProc) _ANSI_ARGS_((ClientData clientData)); |
||
742 | //typedef void (Tcl_ServiceModeHookProc) _ANSI_ARGS_((int mode)); |
||
743 | //typedef ClientData (Tcl_InitNotifierProc) _ANSI_ARGS_((VOID)); |
||
744 | //typedef void (Tcl_FinalizeNotifierProc) _ANSI_ARGS_((ClientData clientData)); |
||
745 | //typedef void (Tcl_MainLoopProc) _ANSI_ARGS_((void)); |
||
746 | |||
747 | |||
748 | /* |
||
749 | * The following structure represents a type of object, which is a |
||
750 | * particular internal representation for an object plus a set of |
||
751 | * procedures that provide standard operations on objects of that type. |
||
752 | */ |
||
753 | |||
754 | //typedef struct Tcl_ObjType { |
||
755 | // char *name; /* Name of the type, e.g. "int". */ |
||
756 | // Tcl_FreeInternalRepProc *freeIntRepProc; |
||
757 | // /* Called to free any storage for the type's |
||
758 | // * internal rep. NULL if the internal rep |
||
759 | // * does not need freeing. */ |
||
760 | // Tcl_DupInternalRepProc *dupIntRepProc; |
||
761 | // /* Called to create a new object as a copy |
||
762 | // * of an existing object. */ |
||
763 | // Tcl_UpdateStringProc *updateStringProc; |
||
764 | // /* Called to update the string rep from the |
||
765 | // * type's internal representation. */ |
||
766 | // Tcl_SetFromAnyProc *setFromAnyProc; |
||
767 | // /* Called to convert the object's internal |
||
768 | // * rep to this type. Frees the internal rep |
||
769 | // * of the old type. Returns TCL_ERROR on |
||
770 | // * failure. */ |
||
771 | //} Tcl_ObjType; |
||
772 | |||
773 | |||
774 | /* |
||
775 | * One of the following structures exists for each object in the Tcl |
||
776 | * system. An object stores a value as either a string, some internal |
||
777 | * representation, or both. |
||
778 | */ |
||
779 | |||
780 | //typedef struct Tcl_Obj { |
||
781 | // int refCount; /* When 0 the object will be freed. */ |
||
782 | // char *bytes; /* This points to the first byte of the |
||
783 | // * object's string representation. The array |
||
784 | // * must be followed by a null byte (i.e., at |
||
785 | // * offset length) but may also contain |
||
786 | // * embedded null characters. The array's |
||
787 | // * storage is allocated by ckalloc. NULL |
||
788 | // * means the string rep is invalid and must |
||
789 | // * be regenerated from the internal rep. |
||
790 | // * Clients should use Tcl_GetStringFromObj |
||
791 | // * or Tcl_GetString to get a pointer to the |
||
792 | // * byte array as a readonly value. */ |
||
793 | // int length; /* The number of bytes at *bytes, not |
||
794 | // * including the terminating null. */ |
||
795 | // Tcl_ObjType *typePtr; /* Denotes the object's type. Always |
||
796 | // * corresponds to the type of the object's |
||
797 | // * internal rep. NULL indicates the object |
||
798 | // * has no internal rep (has no type). */ |
||
799 | // union { /* The internal representation: */ |
||
800 | // long longValue; /* - an long integer value */ |
||
801 | // double doubleValue; /* - a double-precision floating value */ |
||
802 | // VOID *otherValuePtr; /* - another, type-specific value */ |
||
803 | // Tcl_WideInt wideValue; /* - a long long value */ |
||
804 | // struct { /* - internal rep as two pointers */ |
||
805 | // VOID ptr1; |
||
806 | // VOID ptr2; |
||
807 | // } twoPtrValue; |
||
808 | // } internalRep; |
||
809 | //} Tcl_Obj; |
||
810 | |||
811 | |||
812 | /* |
||
813 | * Macros to increment and decrement a Tcl_Obj's reference count, and to |
||
814 | * test whether an object is shared (i.e. has reference count > 1). |
||
815 | * Note: clients should use Tcl_DecrRefCount() when they are finished using |
||
816 | * an object, and should never call TclFreeObj() directly. TclFreeObj() is |
||
817 | * only defined and made public in tcl.h to support Tcl_DecrRefCount's macro |
||
818 | * definition. Note also that Tcl_DecrRefCount() refers to the parameter |
||
819 | * "obj" twice. This means that you should avoid calling it with an |
||
820 | * expression that is expensive to compute or has side effects. |
||
821 | */ |
||
822 | //void Tcl_IncrRefCount _ANSI_ARGS_((Tcl_Obj *objPtr)); |
||
823 | //void Tcl_DecrRefCount _ANSI_ARGS_((Tcl_Obj *objPtr)); |
||
824 | //int Tcl_IsShared _ANSI_ARGS_((Tcl_Obj *objPtr)); |
||
825 | |||
826 | //#if TCL_MEM_DEBUG |
||
827 | //# define Tcl_IncrRefCount(objPtr) \ |
||
828 | //// Tcl_DbIncrRefCount(objPtr, __FILE__, __LINE__) |
||
829 | //# define Tcl_DecrRefCount(objPtr) \ |
||
830 | //// Tcl_DbDecrRefCount(objPtr, __FILE__, __LINE__) |
||
831 | //# define Tcl_IsShared(objPtr) \ |
||
832 | //// Tcl_DbIsShared(objPtr, __FILE__, __LINE__) |
||
833 | //#else |
||
834 | //# define Tcl_IncrRefCount(objPtr) \ |
||
835 | //// ++(objPtr)->refCount |
||
836 | //// /* |
||
837 | //// * Use do/while0 idiom for optimum correctness without compiler warnings |
||
838 | //// * http://c2.com/cgi/wiki?TrivialDoWhileLoop |
||
839 | //// */ |
||
840 | //# define Tcl_DecrRefCount(objPtr) \ |
||
841 | //// do { if (--(objPtr)->refCount <= 0) TclFreeObj(objPtr); } while(0) |
||
842 | //# define Tcl_IsShared(objPtr) \ |
||
843 | //// ((objPtr)->refCount > 1) |
||
844 | //#endif |
||
845 | |||
846 | /* |
||
847 | * Macros and definitions that help to debug the use of Tcl objects. |
||
848 | * When TCL_MEM_DEBUG is defined, the Tcl_New declarations are |
||
849 | * overridden to call debugging versions of the object creation procedures. |
||
850 | */ |
||
851 | |||
852 | //#if TCL_MEM_DEBUG |
||
853 | //# define Tcl_NewBooleanObj(val) \ |
||
854 | //// Tcl_DbNewBooleanObj(val, __FILE__, __LINE__) |
||
855 | //# define Tcl_NewByteArrayObj(bytes, len) \ |
||
856 | //// Tcl_DbNewByteArrayObj(bytes, len, __FILE__, __LINE__) |
||
857 | //# define Tcl_NewDoubleObj(val) \ |
||
858 | //// Tcl_DbNewDoubleObj(val, __FILE__, __LINE__) |
||
859 | //# define Tcl_NewIntObj(val) \ |
||
860 | //// Tcl_DbNewLongObj(val, __FILE__, __LINE__) |
||
861 | //# define Tcl_NewListObj(objc, objv) \ |
||
862 | //// Tcl_DbNewListObj(objc, objv, __FILE__, __LINE__) |
||
863 | //# define Tcl_NewLongObj(val) \ |
||
864 | //// Tcl_DbNewLongObj(val, __FILE__, __LINE__) |
||
865 | //# define Tcl_NewObj() \ |
||
866 | //// Tcl_DbNewObj(__FILE__, __LINE__) |
||
867 | //# define Tcl_NewStringObj(bytes, len) \ |
||
868 | //// Tcl_DbNewStringObj(bytes, len, __FILE__, __LINE__) |
||
869 | //# define Tcl_NewWideIntObj(val) \ |
||
870 | //// Tcl_DbNewWideIntObj(val, __FILE__, __LINE__) |
||
871 | //#endif // * TCL_MEM_DEBUG */ |
||
872 | |||
873 | |||
874 | /* |
||
875 | * The following structure contains the state needed by |
||
876 | * Tcl_SaveResult. No-one outside of Tcl should access any of these |
||
877 | * fields. This structure is typically allocated on the stack. |
||
878 | */ |
||
879 | //typedef struct Tcl_SavedResult { |
||
880 | // char *result; |
||
881 | // Tcl_FreeProc *freeProc; |
||
882 | // Tcl_Obj *objResultPtr; |
||
883 | // char *appendResult; |
||
884 | // int appendAvl; |
||
885 | // int appendUsed; |
||
886 | // char resultSpace[TCL_RESULT_SIZE+1]; |
||
887 | //} Tcl_SavedResult; |
||
888 | |||
889 | |||
890 | /* |
||
891 | * The following definitions support Tcl's namespace facility. |
||
892 | * Note: the first five fields must match exactly the fields in a |
||
893 | * Namespace structure (see tclInt.h). |
||
894 | */ |
||
895 | |||
896 | //typedef struct Tcl_Namespace { |
||
897 | // char *name; /* The namespace's name within its parent |
||
898 | // * namespace. This contains no ::'s. The |
||
899 | // * name of the global namespace is "" |
||
900 | // * although "::" is an synonym. */ |
||
901 | // char *fullName; /* The namespace's fully qualified name. |
||
902 | // * This starts with ::. */ |
||
903 | // ClientData clientData; /* Arbitrary value associated with this |
||
904 | // * namespace. */ |
||
905 | // Tcl_NamespaceDeleteProc* deleteProc; |
||
906 | // /* Procedure invoked when deleting the |
||
907 | // * namespace to, e.g., free clientData. */ |
||
908 | // struct Tcl_Namespace* parentPtr; |
||
909 | // /* Points to the namespace that contains |
||
910 | // * this one. NULL if this is the global |
||
911 | // * namespace. */ |
||
912 | //} Tcl_Namespace; |
||
913 | |||
914 | |||
915 | /* |
||
916 | * The following structure represents a call frame, or activation record. |
||
917 | * A call frame defines a naming context for a procedure call: its local |
||
918 | * scope (for local variables) and its namespace scope (used for non-local |
||
919 | * variables; often the global :: namespace). A call frame can also define |
||
920 | * the naming context for a namespace eval or namespace inscope command: |
||
921 | * the namespace in which the command's code should execute. The |
||
922 | * Tcl_CallFrame structures exist only while procedures or namespace |
||
923 | * eval/inscope's are being executed, and provide a Tcl call stack. |
||
924 | * |
||
925 | * A call frame is initialized and pushed using Tcl_PushCallFrame and |
||
926 | * popped using Tcl_PopCallFrame. Storage for a Tcl_CallFrame must be |
||
927 | * provided by the Tcl_PushCallFrame caller, and callers typically allocate |
||
928 | * them on the C call stack for efficiency. For this reason, TCL.TCL_CallFrame |
||
929 | * is defined as a structure and not as an opaque token. However, most |
||
930 | * Tcl_CallFrame fields are hidden since applications should not access |
||
931 | * them directly; others are declared as "dummyX". |
||
932 | * |
||
933 | * WARNING!! The structure definition must be kept consistent with the |
||
934 | * CallFrame structure in tclInt.h. If you change one, change the other. |
||
935 | */ |
||
936 | |||
937 | //typedef struct Tcl_CallFrame { |
||
938 | // Tcl_Namespace *nsPtr; |
||
939 | // int dummy1; |
||
940 | // int dummy2; |
||
941 | // char *dummy3; |
||
942 | // char *dummy4; |
||
943 | // char *dummy5; |
||
944 | // int dummy6; |
||
945 | // char *dummy7; |
||
946 | // char *dummy8; |
||
947 | // int dummy9; |
||
948 | // char* dummy10; |
||
949 | //} Tcl_CallFrame; |
||
950 | |||
951 | |||
952 | /* |
||
953 | * Information about commands that is returned by Tcl_GetCommandInfo and |
||
954 | * passed to Tcl_SetCommandInfo. objProc is an objc/objv object-based |
||
955 | * command procedure while proc is a traditional Tcl argc/argv |
||
956 | * string-based procedure. Tcl_CreateObjCommand and Tcl_CreateCommand |
||
957 | * ensure that both objProc and proc are non-NULL and can be called to |
||
958 | * execute the command. However, it may be faster to call one instead of |
||
959 | * the other. The member isNativeObjectProc is set to 1 if an |
||
960 | * object-based procedure was registered by Tcl_CreateObjCommand, and to |
||
961 | * 0 if a string-based procedure was registered by Tcl_CreateCommand. |
||
962 | * The other procedure is typically set to a compatibility wrapper that |
||
963 | * does string-to-object or object-to-string argument conversions then |
||
964 | * calls the other procedure. |
||
965 | */ |
||
966 | |||
967 | //typedef struct Tcl_CmdInfo { |
||
968 | // int isNativeObjectProc; /* 1 if objProc was registered by a call to |
||
969 | // * Tcl_CreateObjCommand; 0 otherwise. |
||
970 | // * Tcl_SetCmdInfo does not modify this |
||
971 | // * field. */ |
||
972 | // Tcl_ObjCmdProc *objProc; /* Command's object-based procedure. */ |
||
973 | // ClientData objClientData; /* ClientData for object proc. */ |
||
974 | // Tcl_CmdProc proc; /* Command's string-based procedure. */ |
||
975 | // ClientData clientData; /* ClientData for string proc. */ |
||
976 | // Tcl_CmdDeleteProc *deleteProc; |
||
977 | // /* Procedure to call when command is |
||
978 | // * deleted. */ |
||
979 | // ClientData deleteData; /* Value to pass to deleteProc (usually |
||
980 | // * the same as clientData). */ |
||
981 | // Tcl_Namespace *namespacePtr; /* Points to the namespace that contains |
||
982 | // * this command. Note that Tcl_SetCmdInfo |
||
983 | // * will not change a command's namespace; |
||
984 | // * use Tcl_RenameCommand to do that. */ |
||
985 | |||
986 | //} Tcl_CmdInfo; |
||
987 | |||
988 | /* |
||
989 | * The structure defined below is used to hold dynamic strings. The only |
||
990 | * field that clients should use is the string field, accessible via the |
||
991 | * macro Tcl_DStringValue. |
||
992 | */ |
||
993 | //#define TCL_DSTRING_STATIC_SIZE 200 |
||
994 | //typedef struct Tcl_DString { |
||
995 | // char *string; /* Points to beginning of string: either |
||
996 | // * staticSpace below or a malloced array. */ |
||
997 | // int length; /* Number of non-NULL characters in the |
||
998 | // * string. */ |
||
999 | // int spaceAvl; /* Total number of bytes available for the |
||
1000 | // * string and its terminating NULL char. */ |
||
1001 | // char staticSpace[TCL_DSTRING_STATIC_SIZE]; |
||
1002 | // /* Space to use in common case where string |
||
1003 | // * is small. */ |
||
1004 | //} Tcl_DString; |
||
1005 | |||
1006 | //#define Tcl_DStringLength(dsPtr) ((dsPtr)->length) |
||
1007 | //#define Tcl_DStringValue(dsPtr) ((dsPtr)->string) |
||
1008 | //#define Tcl_DStringTrunc Tcl_DStringSetLength |
||
1009 | |||
1010 | /* |
||
1011 | * Definitions for the maximum number of digits of precision that may |
||
1012 | * be specified in the "tcl_precision" variable, and the number of |
||
1013 | * bytes of buffer space required by Tcl_PrintDouble. |
||
1014 | */ |
||
1015 | //#define TCL_MAX_PREC 17 |
||
1016 | //#define TCL_DOUBLE_SPACE (TCL_MAX_PREC+10) |
||
1017 | |||
1018 | /* |
||
1019 | * Definition for a number of bytes of buffer space sufficient to hold the |
||
1020 | * string representation of an integer in base 10 (assuming the existence |
||
1021 | * of 64-bit integers). |
||
1022 | */ |
||
1023 | //#define TCL_INTEGER_SPACE 24 |
||
1024 | |||
1025 | /* |
||
1026 | * Flag that may be passed to Tcl_ConvertElement to force it not to |
||
1027 | * output braces (careful! if you change this flag be sure to change |
||
1028 | * the definitions at the front of tclUtil.c). |
||
1029 | */ |
||
1030 | //#define TCL_DONT_USE_BRACES 1 |
||
1031 | |||
1032 | /* |
||
1033 | * Flag that may be passed to Tcl_GetIndexFromObj to force it to disallow |
||
1034 | * abbreviated strings. |
||
1035 | */ |
||
1036 | //#define TCL_EXACT 1 |
||
1037 | |||
1038 | /* |
||
1039 | * Flag values passed to Tcl_RecordAndEval and/or Tcl_EvalObj. |
||
1040 | * WARNING: these bit choices must not conflict with the bit choices |
||
1041 | * for evalFlag bits in tclInt.h!! |
||
1042 | */ |
||
1043 | public const int TCL_NO_EVAL = 0x10000; |
||
1044 | public const int TCL_EVAL_GLOBAL = 0x20000; |
||
1045 | public const int TCL_EVAL_DIRECT = 0x40000; |
||
1046 | public const int TCL_EVAL_INVOKE = 0x80000; |
||
1047 | |||
1048 | /* |
||
1049 | * Special freeProc values that may be passed to Tcl_SetResult (see |
||
1050 | * the man page for details): |
||
1051 | */ |
||
1052 | public const int TCL_VOLATILE = 1;//((Tcl_FreeProc ) 1) |
||
1053 | public const int TCL_STATIC = 2;//((Tcl_FreeProc ) 0) |
||
1054 | public const int TCL_DYNAMIC = 3;//((Tcl_FreeProc ) 3) |
||
1055 | |||
1056 | /* |
||
1057 | * Flag values passed to variable-related procedures. |
||
1058 | */ |
||
1059 | public const int TCL_GLOBAL_ONLY = 1; |
||
1060 | public const int TCL_NAMESPACE_ONLY = 2; |
||
1061 | public const int TCL_APPEND_VALUE = 4; |
||
1062 | public const int TCL_LIST_ELEMENT = 8; |
||
1063 | public const int TCL_TRACE_READS = 0x10; |
||
1064 | public const int TCL_TRACE_WRITES = 0x20; |
||
1065 | public const int TCL_TRACE_UNSETS = 0x40; |
||
1066 | public const int TCL_TRACE_DESTROYED = 0x80; |
||
1067 | public const int Tcl_Interp_DESTROYED = 0x100; |
||
1068 | public const int TCL_LEAVE_ERR_MSG = 0x200; |
||
1069 | public const int TCL_TRACE_ARRAY = 0x800; |
||
1070 | #if !TCL_REMOVE_OBSOLETE_TRACES |
||
1071 | /* Required to support old variable/vdelete/vinfo traces */ |
||
1072 | public const int TCL_TRACE_OLD_STYLE = 0x1000; |
||
1073 | #endif |
||
1074 | /* Indicate the semantics of the result of a trace */ |
||
1075 | public const int TCL_TRACE_RESULT_DYNAMIC = 0x8000; |
||
1076 | public const int TCL_TRACE_RESULT_OBJECT = 0x10000; |
||
1077 | |||
1078 | /* |
||
1079 | * Flag values passed to command-related procedures. |
||
1080 | */ |
||
1081 | |||
1082 | //#define TCL_TRACE_RENAME 0x2000 |
||
1083 | //#define TCL_TRACE_DELETE 0x4000 |
||
1084 | |||
1085 | //#define TCL_ALLOW_INLINE_COMPILATION 0x20000 |
||
1086 | |||
1087 | /* |
||
1088 | * Flag values passed to Tcl_CreateObjTrace, and used internally |
||
1089 | * by command execution traces. Slots 4,8,16 and 32 are |
||
1090 | * used internally by execution traces (see tclCmdMZ.c) |
||
1091 | */ |
||
1092 | //#define TCL_TRACE_ENTER_EXEC 1 |
||
1093 | //#define TCL_TRACE_LEAVE_EXEC 2 |
||
1094 | |||
1095 | /* |
||
1096 | * The TCL_PARSE_PART1 flag is deprecated and has no effect. |
||
1097 | * The part1 is now always parsed whenever the part2 is NULL. |
||
1098 | * (This is to avoid a common error when converting code to |
||
1099 | * use the new object based APIs and forgetting to give the |
||
1100 | * flag) |
||
1101 | */ |
||
1102 | #if !TCL_NO_DEPRECATED |
||
1103 | //# define TCL_PARSE_PART1 0x400 |
||
1104 | #endif |
||
1105 | |||
1106 | |||
1107 | /* |
||
1108 | * Types for linked variables: |
||
1109 | */ |
||
1110 | //const int TCL_LINK_INT = 1; |
||
1111 | //const int TCL_LINK_DOUBLE = 2; |
||
1112 | //const int TCL_LINK_BOOLEAN =3; |
||
1113 | //const int TCL_LINK_STRING = 4; |
||
1114 | //const int TCL_LINK_WIDE_INT= 5; |
||
1115 | //const int TCL_LINK_READ_ONLY= 0x80; |
||
1116 | |||
1117 | |||
1118 | /* |
||
1119 | * Forward declarations of Tcl_HashTable and related types. |
||
1120 | */ |
||
1121 | //typedef struct Tcl_HashKeyType Tcl_HashKeyType; |
||
1122 | //typedef struct Tcl_HashTable Tcl_HashTable; |
||
1123 | //typedef struct Tcl_HashEntry Tcl_HashEntry; |
||
1124 | |||
1125 | //typedef unsigned int (Tcl_HashKeyProc) _ANSI_ARGS_((Tcl_HashTable *tablePtr, |
||
1126 | // VOID *keyPtr)); |
||
1127 | //typedef int (Tcl_CompareHashKeysProc) _ANSI_ARGS_((VOID *keyPtr, |
||
1128 | // Tcl_HashEntry *hPtr)); |
||
1129 | //typedef Tcl_HashEntry *(Tcl_AllocHashEntryProc) _ANSI_ARGS_(( |
||
1130 | // Tcl_HashTable *tablePtr, object *keyPtr)); |
||
1131 | //typedef void (Tcl_FreeHashEntryProc) _ANSI_ARGS_((Tcl_HashEntry *hPtr)); |
||
1132 | |||
1133 | /* |
||
1134 | * This flag controls whether the hash table stores the hash of a key, or |
||
1135 | * recalculates it. There should be no reason for turning this flag off |
||
1136 | * as it is completely binary and source compatible unless you directly |
||
1137 | * access the bucketPtr member of the Tcl_HashTableEntry structure. This |
||
1138 | * member has been removed and the space used to store the hash value. |
||
1139 | */ |
||
1140 | //#if !TCL_HASH_KEY_STORE_HASH |
||
1141 | //# define TCL_HASH_KEY_STORE_HASH 1 |
||
1142 | //#endif |
||
1143 | |||
1144 | /* |
||
1145 | * Structure definition for an entry in a hash table. No-one outside |
||
1146 | * Tcl should access any of these fields directly; use the macros |
||
1147 | * defined below. |
||
1148 | */ |
||
1149 | |||
1150 | //struct Tcl_HashEntry { |
||
1151 | // Tcl_HashEntry *nextPtr; /* Pointer to next entry in this |
||
1152 | // * hash bucket, or NULL for end of |
||
1153 | // * chain. */ |
||
1154 | // Tcl_HashTable *tablePtr; /* Pointer to table containing entry. */ |
||
1155 | #if TCL_HASH_KEY_STORE_HASH |
||
1156 | # if TCL_PRESERVE_BINARY_COMPATABILITY |
||
1157 | // VOID *hash; /* Hash value, stored as pointer to |
||
1158 | // * ensure that the offsets of the |
||
1159 | // * fields in this structure are not |
||
1160 | // * changed. */ |
||
1161 | # else |
||
1162 | // unsigned int hash; /* Hash value. */ |
||
1163 | # endif |
||
1164 | #else |
||
1165 | // Tcl_HashEntry **bucketPtr; /* Pointer to bucket that points to |
||
1166 | // * first entry in this entry's chain: |
||
1167 | // * used for deleting the entry. */ |
||
1168 | #endif |
||
1169 | // ClientData clientData; /* Application stores something here |
||
1170 | // * with Tcl_SetHashValue. */ |
||
1171 | // union { /* Key has one of these forms: */ |
||
1172 | // char *oneWordValue; /* One-word value for key. */ |
||
1173 | // Tcl_Obj *objPtr; /* Tcl_Obj * key value. */ |
||
1174 | // int words[1]; /* Multiple integer words for key. |
||
1175 | // * The actual size will be as large |
||
1176 | // * as necessary for this table's |
||
1177 | // * keys. */ |
||
1178 | // char string[4]; /* String for key. The actual size |
||
1179 | // * will be as large as needed to hold |
||
1180 | // * the key. */ |
||
1181 | // } key; /* MUST BE LAST FIELD IN RECORD!! */ |
||
1182 | //}; |
||
1183 | |||
1184 | /* |
||
1185 | * Flags used in Tcl_HashKeyType. |
||
1186 | * |
||
1187 | * TCL_HASH_KEY_RANDOMIZE_HASH: |
||
1188 | * There are some things, pointers for example |
||
1189 | * which don't hash well because they do not use |
||
1190 | * the lower bits. If this flag is set then the |
||
1191 | * hash table will attempt to rectify this by |
||
1192 | * randomising the bits and then using the upper |
||
1193 | * N bits as the index into the table. |
||
1194 | */ |
||
1195 | //#define TCL_HASH_KEY_RANDOMIZE_HASH 0x1 |
||
1196 | |||
1197 | /* |
||
1198 | * Structure definition for the methods associated with a hash table |
||
1199 | * key type. |
||
1200 | */ |
||
1201 | //#define TCL_HASH_KEY_TYPE_VERSION 1 |
||
1202 | //struct Tcl_HashKeyType { |
||
1203 | // int version; /* Version of the table. If this structure is |
||
1204 | // * extended in future then the version can be |
||
1205 | // * used to distinguish between different |
||
1206 | // * structures. |
||
1207 | // */ |
||
1208 | |||
1209 | // int flags; /* Flags, see above for details. */ |
||
1210 | |||
1211 | // /* Calculates a hash value for the key. If this is NULL then the pointer |
||
1212 | // * itself is used as a hash value. |
||
1213 | // */ |
||
1214 | // Tcl_HashKeyProc *hashKeyProc; |
||
1215 | |||
1216 | // /* Compares two keys and returns zero if they do not match, and non-zero |
||
1217 | // * if they do. If this is NULL then the pointers are compared. |
||
1218 | // */ |
||
1219 | // Tcl_CompareHashKeysProc *compareKeysProc; |
||
1220 | |||
1221 | // /* Called to allocate memory for a new entry, i.e. if the key is a |
||
1222 | // * string then this could allocate a single block which contains enough |
||
1223 | // * space for both the entry and the string. Only the key field of the |
||
1224 | // * allocated Tcl_HashEntry structure needs to be filled in. If something |
||
1225 | // * else needs to be done to the key, i.e. incrementing a reference count |
||
1226 | // * then that should be done by this function. If this is NULL then Tcl_Alloc |
||
1227 | // * is used to allocate enough space for a Tcl_HashEntry and the key pointer |
||
1228 | // * is assigned to key.oneWordValue. |
||
1229 | // */ |
||
1230 | // Tcl_AllocHashEntryProc *allocEntryProc; |
||
1231 | |||
1232 | // /* Called to free memory associated with an entry. If something else needs |
||
1233 | // * to be done to the key, i.e. decrementing a reference count then that |
||
1234 | // * should be done by this function. If this is NULL then Tcl_Free is used |
||
1235 | // * to free the Tcl_HashEntry. |
||
1236 | // */ |
||
1237 | // Tcl_FreeHashEntryProc *freeEntryProc; |
||
1238 | //}; |
||
1239 | |||
1240 | /* |
||
1241 | * Structure definition for a hash table. Must be in tcl.h so clients |
||
1242 | * can allocate space for these structures, but clients should never |
||
1243 | * access any fields in this structure. |
||
1244 | */ |
||
1245 | |||
1246 | //#define TCL_SMALL_HASH_TABLE 4 |
||
1247 | //struct Tcl_HashTable { |
||
1248 | // Tcl_HashEntry **buckets; /* Pointer to bucket array. Each |
||
1249 | // * element points to first entry in |
||
1250 | // * bucket's hash chain, or NULL. */ |
||
1251 | // Tcl_HashEntry *staticBuckets[TCL_SMALL_HASH_TABLE]; |
||
1252 | // /* Bucket array used for small tables |
||
1253 | // * (to avoid mallocs and frees). */ |
||
1254 | // int numBuckets; /* Total number of buckets allocated |
||
1255 | // * at **bucketPtr. */ |
||
1256 | // int numEntries; /* Total number of entries present |
||
1257 | // * in table. */ |
||
1258 | // int rebuildSize; /* Enlarge table when numEntries gets |
||
1259 | // * to be this large. */ |
||
1260 | // int downShift; /* Shift count used in hashing |
||
1261 | // * function. Designed to use high- |
||
1262 | // * order bits of randomized keys. */ |
||
1263 | // int mask; /* Mask value used in hashing |
||
1264 | // * function. */ |
||
1265 | // int keyType; /* Type of keys used in this table. |
||
1266 | // * It's either TCL_CUSTOM_KEYS, |
||
1267 | // * TCL_STRING_KEYS, TCL.TCL_ONE_WORD_KEYS, |
||
1268 | // * or an integer giving the number of |
||
1269 | // * ints that is the size of the key. |
||
1270 | // */ |
||
1271 | #if TCL_PRESERVE_BINARY_COMPATABILITY |
||
1272 | // Tcl_HashEntry *(*findProc) _ANSI_ARGS_((Tcl_HashTable *tablePtr, |
||
1273 | // string key)); |
||
1274 | // Tcl_HashEntry *(*createProc) _ANSI_ARGS_((Tcl_HashTable *tablePtr, |
||
1275 | // string key, int *newPtr)); |
||
1276 | #endif |
||
1277 | // Tcl_HashKeyType *typePtr; /* Type of the keys used in the |
||
1278 | // * Tcl_HashTable. */ |
||
1279 | //}; |
||
1280 | |||
1281 | /* |
||
1282 | * Structure definition for information used to keep track of searches |
||
1283 | * through hash tables: |
||
1284 | */ |
||
1285 | |||
1286 | //typedef struct Tcl_HashSearch { |
||
1287 | // Tcl_HashTable *tablePtr; /* Table being searched. */ |
||
1288 | // int nextIndex; /* Index of next bucket to be |
||
1289 | // * enumerated after present one. */ |
||
1290 | // Tcl_HashEntry *nextEntryPtr; /* Next entry to be enumerated in the |
||
1291 | // * the current bucket. */ |
||
1292 | //} Tcl_HashSearch; |
||
1293 | |||
1294 | /* |
||
1295 | * Acceptable key types for hash tables: |
||
1296 | * |
||
1297 | * TCL_STRING_KEYS: The keys are strings, they are copied into |
||
1298 | * the entry. |
||
1299 | * TCL_ONE_WORD_KEYS: The keys are pointers, the pointer is stored |
||
1300 | * in the entry. |
||
1301 | * TCL_CUSTOM_TYPE_KEYS: The keys are arbitrary types which are copied |
||
1302 | * into the entry. |
||
1303 | * TCL_CUSTOM_PTR_KEYS: The keys are pointers to arbitrary types, the |
||
1304 | * pointer is stored in the entry. |
||
1305 | * |
||
1306 | * While maintaining binary compatability the above have to be distinct |
||
1307 | * values as they are used to differentiate between old versions of the |
||
1308 | * hash table which don't have a typePtr and new ones which do. Once binary |
||
1309 | * compatability is discarded in favour of making more wide spread changes |
||
1310 | * TCL_STRING_KEYS can be the same as TCL_CUSTOM_TYPE_KEYS, and |
||
1311 | * TCL_ONE_WORD_KEYS can be the same as TCL_CUSTOM_PTR_KEYS because they |
||
1312 | * simply determine how the key is accessed from the entry and not the |
||
1313 | * behavior. |
||
1314 | */ |
||
1315 | |||
1316 | //#define TCL_STRING_KEYS 0 |
||
1317 | //#define TCL_ONE_WORD_KEYS 1 |
||
1318 | |||
1319 | //#if TCL_PRESERVE_BINARY_COMPATABILITY |
||
1320 | //# define TCL_CUSTOM_TYPE_KEYS -2 |
||
1321 | //# define TCL_CUSTOM_PTR_KEYS -1 |
||
1322 | //#else |
||
1323 | //# define TCL_CUSTOM_TYPE_KEYS TCL_STRING_KEYS |
||
1324 | //# define TCL_CUSTOM_PTR_KEYS TCL_ONE_WORD_KEYS |
||
1325 | //#endif |
||
1326 | |||
1327 | /* |
||
1328 | * Macros for clients to use to access fields of hash entries: |
||
1329 | */ |
||
1330 | |||
1331 | //#define Tcl_GetHashValue(h) ((h)->clientData) |
||
1332 | //#define Tcl_SetHashValue(h, value) ((h)->clientData = (ClientData) (value)) |
||
1333 | #if TCL_PRESERVE_BINARY_COMPATABILITY |
||
1334 | //# define Tcl_GetHashKey(vtablePtr, h) \ |
||
1335 | // ((char ) (((vtablePtr)->keyType == TCL.Tcl_ONE_WORD_KEYS || \ |
||
1336 | // (vtablePtr)->keyType == TCL.Tcl_CUSTOM_PTR_KEYS) \ |
||
1337 | // ? (h)->key.oneWordValue \ |
||
1338 | // : (h)->key.string)) |
||
1339 | #else |
||
1340 | //# define Tcl_GetHashKey(vtablePtr, h) \ |
||
1341 | // ((char ) (((vtablePtr)->keyType == TCL.Tcl_ONE_WORD_KEYS) \ |
||
1342 | // ? (h)->key.oneWordValue \ |
||
1343 | // : (h)->key.string)) |
||
1344 | #endif |
||
1345 | |||
1346 | /* |
||
1347 | * Macros to use for clients to use to invoke find and create procedures |
||
1348 | * for hash tables: |
||
1349 | */ |
||
1350 | |||
1351 | #if TCL_PRESERVE_BINARY_COMPATABILITY |
||
1352 | //# define Tcl_FindHashEntry(vtablePtr, key) \ |
||
1353 | // (*((vtablePtr)->findProc))(vtablePtr, key) |
||
1354 | //# define Tcl_CreateHashEntry(vtablePtr, key, newPtr) \ |
||
1355 | // (*((vtablePtr)->createProc))(vtablePtr, key, newPtr) |
||
1356 | #else //* !TCL_PRESERVE_BINARY_COMPATABILITY */ |
||
1357 | /* |
||
1358 | * Macro to use new extended version of Tcl_InitHashTable. |
||
1359 | */ |
||
1360 | //# define Tcl_InitHashTable(vtablePtr, keyType) \ |
||
1361 | // Tcl_InitHashTableEx(vtablePtr, keyType, NULL) |
||
1362 | #endif // * TCL_PRESERVE_BINARY_COMPATABILITY */ |
||
1363 | |||
1364 | |||
1365 | /* |
||
1366 | * Flag values to pass to Tcl_DoOneEvent to disable searches |
||
1367 | * for some kinds of events: |
||
1368 | */ |
||
1369 | //#define TCL_DONT_WAIT (1<<1) |
||
1370 | //#define TCL_WINDOW_EVENTS (1<<2) |
||
1371 | //#define TCL_FILE_EVENTS (1<<3) |
||
1372 | //#define TCL_TIMER_EVENTS (1<<4) |
||
1373 | //#define TCL_IDLE_EVENTS (1<<5) /* WAS 0x10 ???? */ |
||
1374 | //#define TCL_ALL_EVENTS (~TCL_DONT_WAIT) |
||
1375 | |||
1376 | /* |
||
1377 | * The following structure defines a generic event for the Tcl event |
||
1378 | * system. These are the things that are queued in calls to Tcl_QueueEvent |
||
1379 | * and serviced later by Tcl_DoOneEvent. There can be many different |
||
1380 | * kinds of events with different fields, corresponding to window events, |
||
1381 | * timer events, etc. The structure for a particular event consists of |
||
1382 | * a Tcl_Event header followed by additional information specific to that |
||
1383 | * event. |
||
1384 | */ |
||
1385 | //struct Tcl_Event { |
||
1386 | // Tcl_EventProc proc; /* Procedure to call to service this event. */ |
||
1387 | // struct Tcl_Event *nextPtr; /* Next in list of pending events, or NULL. */ |
||
1388 | //}; |
||
1389 | |||
1390 | /* |
||
1391 | * Positions to pass to Tcl_QueueEvent: |
||
1392 | */ |
||
1393 | //typedef enum { |
||
1394 | // TCL_QUEUE_TAIL, TCL.TCL_QUEUE_HEAD, TCL.TCL_QUEUE_MARK |
||
1395 | //} Tcl_QueuePosition; |
||
1396 | |||
1397 | /* |
||
1398 | * Values to pass to Tcl_SetServiceMode to specify the behavior of notifier |
||
1399 | * event routines. |
||
1400 | */ |
||
1401 | //#define TCL_SERVICE_NONE 0 |
||
1402 | //#define TCL_SERVICE_ALL 1 |
||
1403 | |||
1404 | |||
1405 | /* |
||
1406 | * The following structure keeps is used to hold a time value, either as |
||
1407 | * an absolute time (the number of seconds from the epoch) or as an |
||
1408 | * elapsed time. On Unix systems the epoch is Midnight Jan 1, 1970 GMT. |
||
1409 | * On Macintosh systems the epoch is Midnight Jan 1, 1904 GMT. |
||
1410 | */ |
||
1411 | //typedef struct Tcl_Time { |
||
1412 | // long sec; /* Seconds. */ |
||
1413 | // long usec; /* Microseconds. */ |
||
1414 | //} Tcl_Time; |
||
1415 | |||
1416 | //typedef void (Tcl_SetTimerProc) _ANSI_ARGS_((Tcl_Time *timePtr)); |
||
1417 | //typedef int (Tcl_WaitForEventProc) _ANSI_ARGS_((Tcl_Time *timePtr)); |
||
1418 | |||
1419 | |||
1420 | /* |
||
1421 | * Bits to pass to Tcl_CreateFileHandler and Tcl_CreateChannelHandler |
||
1422 | * to indicate what sorts of events are of interest: |
||
1423 | */ |
||
1424 | //#define TCL_READABLE (1<<1) |
||
1425 | //#define TCL_WRITABLE (1<<2) |
||
1426 | //#define TCL_EXCEPTION (1<<3) |
||
1427 | |||
1428 | /* |
||
1429 | * Flag values to pass to Tcl_OpenCommandChannel to indicate the |
||
1430 | * disposition of the stdio handles. TCL_STDIN, TCL.TCL_STDOUT, TCL.TCL_STDERR, |
||
1431 | * are also used in Tcl_GetStdChannel. |
||
1432 | */ |
||
1433 | //#define TCL_STDIN (1<<1) |
||
1434 | //#define TCL_STDOUT (1<<2) |
||
1435 | //#define TCL_STDERR (1<<3) |
||
1436 | //#define TCL_ENFORCE_MODE (1<<4) |
||
1437 | |||
1438 | /* |
||
1439 | * Bits passed to Tcl_DriverClose2Proc to indicate which side of a channel |
||
1440 | * should be closed. |
||
1441 | */ |
||
1442 | //#define TCL_CLOSE_READ (1<<1) |
||
1443 | //#define TCL_CLOSE_WRITE (1<<2) |
||
1444 | |||
1445 | /* |
||
1446 | * Value to use as the closeProc for a channel that supports the |
||
1447 | * close2Proc interface. |
||
1448 | */ |
||
1449 | //#define TCL_CLOSE2PROC ((Tcl_DriverCloseProc )1) |
||
1450 | |||
1451 | /* |
||
1452 | * Channel version tag. This was introduced in 8.3.2/8.4. |
||
1453 | */ |
||
1454 | //#define TCL_CHANNEL_VERSION_1 ((Tcl_ChannelTypeVersion) 0x1) |
||
1455 | //#define TCL_CHANNEL_VERSION_2 ((Tcl_ChannelTypeVersion) 0x2) |
||
1456 | //#define TCL_CHANNEL_VERSION_3 ((Tcl_ChannelTypeVersion) 0x3) |
||
1457 | //#define TCL_CHANNEL_VERSION_4 ((Tcl_ChannelTypeVersion) 0x4) |
||
1458 | |||
1459 | /* |
||
1460 | * TIP #218: Channel Actions, Ids for Tcl_DriverThreadActionProc |
||
1461 | */ |
||
1462 | |||
1463 | //#define TCL_CHANNEL_THREAD_INSERT (0) |
||
1464 | //#define TCL_CHANNEL_THREAD_REMOVE (1) |
||
1465 | |||
1466 | /* |
||
1467 | * Typedefs for the various operations in a channel type: |
||
1468 | */ |
||
1469 | //typedef int (Tcl_DriverBlockModeProc) _ANSI_ARGS_(( |
||
1470 | // ClientData instanceData, int mode)); |
||
1471 | //typedef int (Tcl_DriverCloseProc) _ANSI_ARGS_((ClientData instanceData, |
||
1472 | // Tcl_Interp interp)); |
||
1473 | //typedef int (Tcl_DriverClose2Proc) _ANSI_ARGS_((ClientData instanceData, |
||
1474 | // Tcl_Interp interp, int flags)); |
||
1475 | //typedef int (Tcl_DriverInputProc) _ANSI_ARGS_((ClientData instanceData, |
||
1476 | // char *buf, int toRead, int *errorCodePtr)); |
||
1477 | //typedef int (Tcl_DriverOutputProc) _ANSI_ARGS_((ClientData instanceData, |
||
1478 | // CONST84 char *buf, int toWrite, int *errorCodePtr)); |
||
1479 | //typedef int (Tcl_DriverSeekProc) _ANSI_ARGS_((ClientData instanceData, |
||
1480 | // long offset, int mode, int *errorCodePtr)); |
||
1481 | //typedef int (Tcl_DriverSetOptionProc) _ANSI_ARGS_(( |
||
1482 | // ClientData instanceData, TCL.TCL_Interp interp, |
||
1483 | // string optionName, string value)); |
||
1484 | //typedef int (Tcl_DriverGetOptionProc) _ANSI_ARGS_(( |
||
1485 | // ClientData instanceData, TCL.TCL_Interp interp, |
||
1486 | // CONST84 char *optionName, TCL.TCL_DString *dsPtr)); |
||
1487 | //typedef void (Tcl_DriverWatchProc) _ANSI_ARGS_(( |
||
1488 | // ClientData instanceData, int mask)); |
||
1489 | //typedef int (Tcl_DriverGetHandleProc) _ANSI_ARGS_(( |
||
1490 | // ClientData instanceData, int direction, |
||
1491 | // ClientData *handlePtr)); |
||
1492 | //typedef int (Tcl_DriverFlushProc) _ANSI_ARGS_(( |
||
1493 | // ClientData instanceData)); |
||
1494 | //typedef int (Tcl_DriverHandlerProc) _ANSI_ARGS_(( |
||
1495 | // ClientData instanceData, int interestMask)); |
||
1496 | //typedef Tcl_WideInt (Tcl_DriverWideSeekProc) _ANSI_ARGS_(( |
||
1497 | // ClientData instanceData, TCL.TCL_WideInt offset, |
||
1498 | // int mode, int *errorCodePtr)); |
||
1499 | |||
1500 | // /* TIP #218, Channel Thread Actions */ |
||
1501 | //typedef void (Tcl_DriverThreadActionProc) _ANSI_ARGS_ (( |
||
1502 | // ClientData instanceData, int action)); |
||
1503 | |||
1504 | /* |
||
1505 | * The following declarations either map ckalloc and ckfree to |
||
1506 | * malloc and free, or they map them to procedures with all sorts |
||
1507 | * of debugging hooks defined in tclCkalloc.c. |
||
1508 | */ |
||
1509 | #if TCL_MEM_DEBUG |
||
1510 | |||
1511 | //# define ckalloc(x) Tcl_DbCkalloc(x, __FILE__, __LINE__) |
||
1512 | //# define ckfree(x) Tcl_DbCkfree(x, __FILE__, __LINE__) |
||
1513 | //# define ckrealloc(x,y) Tcl_DbCkrealloc((x), (y),__FILE__, __LINE__) |
||
1514 | //# define attemptckalloc(x) Tcl_AttemptDbCkalloc(x, __FILE__, __LINE__) |
||
1515 | //# define attemptckrealloc(x,y) Tcl_AttemptDbCkrealloc((x), (y), __FILE__, __LINE__) |
||
1516 | #else // * !TCL_MEM_DEBUG */ |
||
1517 | |||
1518 | /* |
||
1519 | * If we are not using the debugging allocator, we should call the |
||
1520 | * Tcl_Alloc, et al. routines in order to guarantee that every module |
||
1521 | * is using the same memory allocator both inside and outside of the |
||
1522 | * Tcl library. |
||
1523 | */ |
||
1524 | //# define ckalloc(x) Tcl_Alloc(x) |
||
1525 | //# define ckfree(x) Tcl_Free(x) |
||
1526 | //# define ckrealloc(x,y) Tcl_Realloc(x,y) |
||
1527 | //# define attemptckalloc(x) Tcl_AttemptAlloc(x) |
||
1528 | //# define attemptckrealloc(x,y) Tcl_AttemptRealloc(x,y) |
||
1529 | //# define Tcl_InitMemory(x) |
||
1530 | //# define Tcl_DumpActiveMemory(x) |
||
1531 | //# define Tcl_ValidateAllMemory(x,y) |
||
1532 | |||
1533 | #endif // * !TCL_MEM_DEBUG */ |
||
1534 | |||
1535 | /* |
||
1536 | * struct Tcl_ChannelType: |
||
1537 | * |
||
1538 | * One such structure exists for each type (kind) of channel. |
||
1539 | * It collects together in one place all the functions that are |
||
1540 | * part of the specific channel type. |
||
1541 | * |
||
1542 | * It is recommend that the Tcl_Channel* functions are used to access |
||
1543 | * elements of this structure, instead of direct accessing. |
||
1544 | */ |
||
1545 | //typedef struct Tcl_ChannelType { |
||
1546 | // char *typeName; /* The name of the channel type in Tcl |
||
1547 | // * commands. This storage is owned by |
||
1548 | // * channel type. */ |
||
1549 | // Tcl_ChannelTypeVersion version; /* Version of the channel type. */ |
||
1550 | // Tcl_DriverCloseProc *closeProc; /* Procedure to call to close the |
||
1551 | // * channel, or TCL_CLOSE2PROC if the |
||
1552 | // * close2Proc should be used |
||
1553 | // * instead. */ |
||
1554 | // Tcl_DriverInputProc *inputProc; /* Procedure to call for input |
||
1555 | // * on channel. */ |
||
1556 | // Tcl_DriverOutputProc *outputProc; /* Procedure to call for output |
||
1557 | // * on channel. */ |
||
1558 | // Tcl_DriverSeekProc *seekProc; /* Procedure to call to seek |
||
1559 | // * on the channel. May be NULL. */ |
||
1560 | // Tcl_DriverSetOptionProc *setOptionProc; |
||
1561 | // /* Set an option on a channel. */ |
||
1562 | // Tcl_DriverGetOptionProc *getOptionProc; |
||
1563 | // /* Get an option from a channel. */ |
||
1564 | // Tcl_DriverWatchProc *watchProc; /* Set up the notifier to watch |
||
1565 | // * for events on this channel. */ |
||
1566 | // Tcl_DriverGetHandleProc *getHandleProc; |
||
1567 | // /* Get an OS handle from the channel |
||
1568 | // * or NULL if not supported. */ |
||
1569 | // Tcl_DriverClose2Proc *close2Proc; /* Procedure to call to close the |
||
1570 | // * channel if the device supports |
||
1571 | // * closing the read & write sides |
||
1572 | // * independently. */ |
||
1573 | // Tcl_DriverBlockModeProc *blockModeProc; |
||
1574 | // /* Set blocking mode for the |
||
1575 | // * raw channel. May be NULL. */ |
||
1576 | // /* |
||
1577 | // * Only valid in TCL_CHANNEL_VERSION_2 channels or later |
||
1578 | // */ |
||
1579 | // Tcl_DriverFlushProc *flushProc; /* Procedure to call to flush a |
||
1580 | // * channel. May be NULL. */ |
||
1581 | // Tcl_DriverHandlerProc *handlerProc; /* Procedure to call to handle a |
||
1582 | // * channel event. This will be passed |
||
1583 | // * up the stacked channel chain. */ |
||
1584 | // /* |
||
1585 | // * Only valid in TCL_CHANNEL_VERSION_3 channels or later |
||
1586 | // */ |
||
1587 | // Tcl_DriverWideSeekProc *wideSeekProc; |
||
1588 | // /* Procedure to call to seek |
||
1589 | // * on the channel which can |
||
1590 | // * handle 64-bit offsets. May be |
||
1591 | // * NULL, and must be NULL if |
||
1592 | // * seekProc is NULL. */ |
||
1593 | |||
1594 | // /* |
||
1595 | // * Only valid in TCL_CHANNEL_VERSION_4 channels or later |
||
1596 | // * TIP #218, Channel Thread Actions |
||
1597 | // */ |
||
1598 | // Tcl_DriverThreadActionProc *threadActionProc; |
||
1599 | // /* Procedure to call to notify |
||
1600 | // * the driver of thread specific |
||
1601 | // * activity for a channel. |
||
1602 | // * May be NULL. */ |
||
1603 | //} Tcl_ChannelType; |
||
1604 | |||
1605 | /* |
||
1606 | * The following flags determine whether the blockModeProc above should |
||
1607 | * set the channel into blocking or nonblocking mode. They are passed |
||
1608 | * as arguments to the blockModeProc procedure in the above structure. |
||
1609 | */ |
||
1610 | //#define TCL_MODE_BLOCKING 0 /* Put channel into blocking mode. */ |
||
1611 | //#define TCL_MODE_NONBLOCKING 1 /* Put channel into nonblocking |
||
1612 | // * mode. */ |
||
1613 | |||
1614 | /* |
||
1615 | * Enum for different types of file paths. |
||
1616 | */ |
||
1617 | //typedef enum Tcl_PathType { |
||
1618 | // TCL_PATH_ABSOLUTE, |
||
1619 | // TCL_PATH_RELATIVE, |
||
1620 | // TCL_PATH_VOLUME_RELATIVE |
||
1621 | //} Tcl_PathType; |
||
1622 | |||
1623 | |||
1624 | /* |
||
1625 | * The following structure is used to pass glob type data amongst |
||
1626 | * the various glob routines and Tcl_FSMatchInDirectory. |
||
1627 | */ |
||
1628 | //typedef struct Tcl_GlobTypeData { |
||
1629 | // /* Corresponds to bcdpfls as in 'find -t' */ |
||
1630 | // int type; |
||
1631 | // /* Corresponds to file permissions */ |
||
1632 | // int perm; |
||
1633 | // /* Acceptable mac type */ |
||
1634 | // Tcl_Obj* macType; |
||
1635 | // /* Acceptable mac creator */ |
||
1636 | // Tcl_Obj* macCreator; |
||
1637 | //} Tcl_GlobTypeData; |
||
1638 | |||
1639 | /* |
||
1640 | * type and permission definitions for glob command |
||
1641 | */ |
||
1642 | //#define TCL_GLOB_TYPE_BLOCK (1<<0) |
||
1643 | //#define TCL_GLOB_TYPE_CHAR (1<<1) |
||
1644 | //#define TCL_GLOB_TYPE_DIR (1<<2) |
||
1645 | //#define TCL_GLOB_TYPE_PIPE (1<<3) |
||
1646 | //#define TCL_GLOB_TYPE_FILE (1<<4) |
||
1647 | //#define TCL_GLOB_TYPE_LINK (1<<5) |
||
1648 | //#define TCL_GLOB_TYPE_SOCK (1<<6) |
||
1649 | //#define TCL_GLOB_TYPE_MOUNT (1<<7) |
||
1650 | |||
1651 | //#define TCL_GLOB_PERM_RONLY (1<<0) |
||
1652 | //#define TCL_GLOB_PERM_HIDDEN (1<<1) |
||
1653 | //#define TCL_GLOB_PERM_R (1<<2) |
||
1654 | //#define TCL_GLOB_PERM_W (1<<3) |
||
1655 | //#define TCL_GLOB_PERM_X (1<<4) |
||
1656 | |||
1657 | |||
1658 | /* |
||
1659 | * Typedefs for the various filesystem operations: |
||
1660 | */ |
||
1661 | //typedef int (Tcl_FSStatProc) _ANSI_ARGS_((Tcl_Obj pathPtr, TCL.TCL_StatBuf *buf)); |
||
1662 | //typedef int (Tcl_FSAccessProc) _ANSI_ARGS_((Tcl_Obj pathPtr, int mode)); |
||
1663 | //typedef Tcl_Channel (Tcl_FSOpenFileChannelProc) |
||
1664 | // _ANSI_ARGS_((Tcl_Interp interp, TCL.TCL_Obj pathPtr, |
||
1665 | // int mode, int permissions)); |
||
1666 | //typedef int (Tcl_FSMatchInDirectoryProc) _ANSI_ARGS_((Tcl_Interp* interp, |
||
1667 | // Tcl_Obj *result, TCL.TCL_Obj pathPtr, CONST char pattern, |
||
1668 | // Tcl_GlobTypeData * types)); |
||
1669 | //typedef Tcl_Obj* (Tcl_FSGetCwdProc) _ANSI_ARGS_((Tcl_Interp interp)); |
||
1670 | //typedef int (Tcl_FSChdirProc) _ANSI_ARGS_((Tcl_Obj pathPtr)); |
||
1671 | //typedef int (Tcl_FSLstatProc) _ANSI_ARGS_((Tcl_Obj pathPtr, |
||
1672 | // Tcl_StatBuf *buf)); |
||
1673 | //typedef int (Tcl_FSCreateDirectoryProc) _ANSI_ARGS_((Tcl_Obj pathPtr)); |
||
1674 | //typedef int (Tcl_FSDeleteFileProc) _ANSI_ARGS_((Tcl_Obj pathPtr)); |
||
1675 | //typedef int (Tcl_FSCopyDirectoryProc) _ANSI_ARGS_((Tcl_Obj *srcPathPtr, |
||
1676 | // Tcl_Obj *destPathPtr, TCL.TCL_Obj **errorPtr)); |
||
1677 | //typedef int (Tcl_FSCopyFileProc) _ANSI_ARGS_((Tcl_Obj *srcPathPtr, |
||
1678 | // Tcl_Obj *destPathPtr)); |
||
1679 | //typedef int (Tcl_FSRemoveDirectoryProc) _ANSI_ARGS_((Tcl_Obj pathPtr, |
||
1680 | // int recursive, TCL.TCL_Obj **errorPtr)); |
||
1681 | //typedef int (Tcl_FSRenameFileProc) _ANSI_ARGS_((Tcl_Obj *srcPathPtr, |
||
1682 | // Tcl_Obj *destPathPtr)); |
||
1683 | //typedef void (Tcl_FSUnloadFileProc) _ANSI_ARGS_((Tcl_LoadHandle loadHandle)); |
||
1684 | //typedef Tcl_Obj* (Tcl_FSListVolumesProc) _ANSI_ARGS_((void)); |
||
1685 | /* We have to declare the utime structure here. */ |
||
1686 | //struct utimbuf; |
||
1687 | //typedef int (Tcl_FSUtimeProc) _ANSI_ARGS_((Tcl_Obj pathPtr, |
||
1688 | // struct utimbuf *tval)); |
||
1689 | //typedef int (Tcl_FSNormalizePathProc) _ANSI_ARGS_((Tcl_Interp interp, |
||
1690 | // Tcl_Obj pathPtr, int nextCheckpoint)); |
||
1691 | //typedef int (Tcl_FSFileAttrsGetProc) _ANSI_ARGS_((Tcl_Interp interp, |
||
1692 | // int index, TCL.TCL_Obj pathPtr, |
||
1693 | // Tcl_Obj **objPtrRef)); |
||
1694 | //typedef CONST char** (Tcl_FSFileAttrStringsProc) _ANSI_ARGS_((Tcl_Obj pathPtr, |
||
1695 | // Tcl_Obj** objPtrRef)); |
||
1696 | //typedef int (Tcl_FSFileAttrsSetProc) _ANSI_ARGS_((Tcl_Interp interp, |
||
1697 | // int index, TCL.TCL_Obj pathPtr, |
||
1698 | // Tcl_Obj *objPtr)); |
||
1699 | //typedef Tcl_Obj* (Tcl_FSLinkProc) _ANSI_ARGS_((Tcl_Obj pathPtr, |
||
1700 | // Tcl_Obj *toPtr, int linkType)); |
||
1701 | //typedef int (Tcl_FSLoadFileProc) _ANSI_ARGS_((Tcl_Interp * interp, |
||
1702 | // Tcl_Obj pathPtr, |
||
1703 | // Tcl_LoadHandle *handlePtr, |
||
1704 | // Tcl_FSUnloadFileProc **unloadProcPtr)); |
||
1705 | //typedef int (Tcl_FSPathInFilesystemProc) _ANSI_ARGS_((Tcl_Obj pathPtr, |
||
1706 | // ClientData *clientDataPtr)); |
||
1707 | //typedef Tcl_Obj* (Tcl_FSFilesystemPathTypeProc) |
||
1708 | // _ANSI_ARGS_((Tcl_Obj pathPtr)); |
||
1709 | //typedef Tcl_Obj* (Tcl_FSFilesystemSeparatorProc) |
||
1710 | // _ANSI_ARGS_((Tcl_Obj pathPtr)); |
||
1711 | //typedef void (Tcl_FSFreeInternalRepProc) _ANSI_ARGS_((ClientData clientData)); |
||
1712 | //typedef ClientData (Tcl_FSDupInternalRepProc) |
||
1713 | // _ANSI_ARGS_((ClientData clientData)); |
||
1714 | //typedef Tcl_Obj* (Tcl_FSInternalToNormalizedProc) |
||
1715 | // _ANSI_ARGS_((ClientData clientData)); |
||
1716 | //typedef ClientData (Tcl_FSCreateInternalRepProc) _ANSI_ARGS_((Tcl_Obj pathPtr)); |
||
1717 | |||
1718 | //typedef struct Tcl_FSVersion_ *Tcl_FSVersion; |
||
1719 | |||
1720 | /* |
||
1721 | *---------------------------------------------------------------- |
||
1722 | * Data structures related to hooking into the filesystem |
||
1723 | *---------------------------------------------------------------- |
||
1724 | */ |
||
1725 | |||
1726 | /* |
||
1727 | * Filesystem version tag. This was introduced in 8.4. |
||
1728 | */ |
||
1729 | //#define TCL_FILESYSTEM_VERSION_1 ((Tcl_FSVersion) 0x1) |
||
1730 | |||
1731 | /* |
||
1732 | * struct Tcl_Filesystem: |
||
1733 | * |
||
1734 | * One such structure exists for each type (kind) of filesystem. |
||
1735 | * It collects together in one place all the functions that are |
||
1736 | * part of the specific filesystem. Tcl always accesses the |
||
1737 | * filesystem through one of these structures. |
||
1738 | * |
||
1739 | * Not all entries need be non-NULL; any which are NULL are simply |
||
1740 | * ignored. However, a complete filesystem should provide all of |
||
1741 | * these functions. The explanations in the structure show |
||
1742 | * the importance of each function. |
||
1743 | */ |
||
1744 | |||
1745 | //typedef struct Tcl_Filesystem { |
||
1746 | // string typeName; /* The name of the filesystem. */ |
||
1747 | // int structureLength; /* Length of this structure, so future |
||
1748 | // * binary compatibility can be assured. */ |
||
1749 | // Tcl_FSVersion version; |
||
1750 | // /* Version of the filesystem type. */ |
||
1751 | // Tcl_FSPathInFilesystemProc pathInFilesystemProc; |
||
1752 | // /* Function to check whether a path is in |
||
1753 | // * this filesystem. This is the most |
||
1754 | // * important filesystem procedure. */ |
||
1755 | // Tcl_FSDupInternalRepProc *dupInternalRepProc; |
||
1756 | // /* Function to duplicate internal fs rep. May |
||
1757 | // * be NULL (but then fs is less efficient). */ |
||
1758 | // Tcl_FSFreeInternalRepProc *freeInternalRepProc; |
||
1759 | // /* Function to free internal fs rep. Must |
||
1760 | // * be implemented, if internal representations |
||
1761 | // * need freeing, otherwise it can be NULL. */ |
||
1762 | // Tcl_FSInternalToNormalizedProc *internalToNormalizedProc; |
||
1763 | // /* Function to convert internal representation |
||
1764 | // * to a normalized path. Only required if |
||
1765 | // * the fs creates pure path objects with no |
||
1766 | // * string/path representation. */ |
||
1767 | // Tcl_FSCreateInternalRepProc *createInternalRepProc; |
||
1768 | // /* Function to create a filesystem-specific |
||
1769 | // * internal representation. May be NULL |
||
1770 | // * if paths have no internal representation, |
||
1771 | // * or if the Tcl_FSPathInFilesystemProc |
||
1772 | // * for this filesystem always immediately |
||
1773 | // * creates an internal representation for |
||
1774 | // * paths it accepts. */ |
||
1775 | // Tcl_FSNormalizePathProc *normalizePathProc; |
||
1776 | // /* Function to normalize a path. Should |
||
1777 | // * be implemented for all filesystems |
||
1778 | // * which can have multiple string |
||
1779 | // * representations for the same path |
||
1780 | // * object. */ |
||
1781 | // Tcl_FSFilesystemPathTypeProc *filesystemPathTypeProc; |
||
1782 | // /* Function to determine the type of a |
||
1783 | // * path in this filesystem. May be NULL. */ |
||
1784 | // Tcl_FSFilesystemSeparatorProc *filesystemSeparatorProc; |
||
1785 | // /* Function to return the separator |
||
1786 | // * character(s) for this filesystem. Must |
||
1787 | // * be implemented. */ |
||
1788 | // Tcl_FSStatProc *statProc; |
||
1789 | // /* |
||
1790 | // * Function to process a 'Tcl_FSStat()' |
||
1791 | // * call. Must be implemented for any |
||
1792 | // * reasonable filesystem. |
||
1793 | // */ |
||
1794 | // Tcl_FSAccessProc *accessProc; |
||
1795 | // /* |
||
1796 | // * Function to process a 'Tcl_FSAccess()' |
||
1797 | // * call. Must be implemented for any |
||
1798 | // * reasonable filesystem. |
||
1799 | // */ |
||
1800 | // Tcl_FSOpenFileChannelProc *openFileChannelProc; |
||
1801 | // /* |
||
1802 | // * Function to process a |
||
1803 | // * 'Tcl_FSOpenFileChannel()' call. Must be |
||
1804 | // * implemented for any reasonable |
||
1805 | // * filesystem. |
||
1806 | // */ |
||
1807 | // Tcl_FSMatchInDirectoryProc *matchInDirectoryProc; |
||
1808 | // /* Function to process a |
||
1809 | // * 'Tcl_FSMatchInDirectory()'. If not |
||
1810 | // * implemented, then glob and recursive |
||
1811 | // * copy functionality will be lacking in |
||
1812 | // * the filesystem. */ |
||
1813 | // Tcl_FSUtimeProc *utimeProc; |
||
1814 | // /* Function to process a |
||
1815 | // * 'Tcl_FSUtime()' call. Required to |
||
1816 | // * allow setting (not reading) of times |
||
1817 | // * with 'file mtime', 'file atime' and |
||
1818 | // * the open-r/open-w/fcopy implementation |
||
1819 | // * of 'file copy'. */ |
||
1820 | // Tcl_FSLinkProc *linkProc; |
||
1821 | // /* Function to process a |
||
1822 | // * 'Tcl_FSLink()' call. Should be |
||
1823 | // * implemented only if the filesystem supports |
||
1824 | // * links (reading or creating). */ |
||
1825 | // Tcl_FSListVolumesProc *listVolumesProc; |
||
1826 | // /* Function to list any filesystem volumes |
||
1827 | // * added by this filesystem. Should be |
||
1828 | // * implemented only if the filesystem adds |
||
1829 | // * volumes at the head of the filesystem. */ |
||
1830 | // Tcl_FSFileAttrStringsProc *fileAttrStringsProc; |
||
1831 | // /* Function to list all attributes strings |
||
1832 | // * which are valid for this filesystem. |
||
1833 | // * If not implemented the filesystem will |
||
1834 | // * not support the 'file attributes' command. |
||
1835 | // * This allows arbitrary additional information |
||
1836 | // * to be attached to files in the filesystem. */ |
||
1837 | // Tcl_FSFileAttrsGetProc *fileAttrsGetProc; |
||
1838 | // /* Function to process a |
||
1839 | // * 'Tcl_FSFileAttrsGet()' call, used by |
||
1840 | // * 'file attributes'. */ |
||
1841 | // Tcl_FSFileAttrsSetProc *fileAttrsSetProc; |
||
1842 | // /* Function to process a |
||
1843 | // * 'Tcl_FSFileAttrsSet()' call, used by |
||
1844 | // * 'file attributes'. */ |
||
1845 | // Tcl_FSCreateDirectoryProc *createDirectoryProc; |
||
1846 | // /* Function to process a |
||
1847 | // * 'Tcl_FSCreateDirectory()' call. Should |
||
1848 | // * be implemented unless the FS is |
||
1849 | // * read-only. */ |
||
1850 | // Tcl_FSRemoveDirectoryProc *removeDirectoryProc; |
||
1851 | // /* Function to process a |
||
1852 | // * 'Tcl_FSRemoveDirectory()' call. Should |
||
1853 | // * be implemented unless the FS is |
||
1854 | // * read-only. */ |
||
1855 | // Tcl_FSDeleteFileProc *deleteFileProc; |
||
1856 | // /* Function to process a |
||
1857 | // * 'Tcl_FSDeleteFile()' call. Should |
||
1858 | // * be implemented unless the FS is |
||
1859 | // * read-only. */ |
||
1860 | // Tcl_FSCopyFileProc *copyFileProc; |
||
1861 | // /* Function to process a |
||
1862 | // * 'Tcl_FSCopyFile()' call. If not |
||
1863 | // * implemented Tcl will fall back |
||
1864 | // * on open-r, open-w and fcopy as |
||
1865 | // * a copying mechanism, for copying |
||
1866 | // * actions initiated in Tcl (not C). */ |
||
1867 | // Tcl_FSRenameFileProc *renameFileProc; |
||
1868 | // /* Function to process a |
||
1869 | // * 'Tcl_FSRenameFile()' call. If not |
||
1870 | // * implemented, Tcl will fall back on |
||
1871 | // * a copy and delete mechanism, for |
||
1872 | // * rename actions initiated in Tcl (not C). */ |
||
1873 | // Tcl_FSCopyDirectoryProc *copyDirectoryProc; |
||
1874 | // /* Function to process a |
||
1875 | // * 'Tcl_FSCopyDirectory()' call. If |
||
1876 | // * not implemented, Tcl will fall back |
||
1877 | // * on a recursive create-dir, file copy |
||
1878 | // * mechanism, for copying actions |
||
1879 | // * initiated in Tcl (not C). */ |
||
1880 | // Tcl_FSLstatProc *lstatProc; |
||
1881 | // /* Function to process a |
||
1882 | // * 'Tcl_FSLstat()' call. If not implemented, |
||
1883 | // * Tcl will attempt to use the 'statProc' |
||
1884 | // * defined above instead. */ |
||
1885 | // Tcl_FSLoadFileProc *loadFileProc; |
||
1886 | // /* Function to process a |
||
1887 | // * 'Tcl_FSLoadFile()' call. If not |
||
1888 | // * implemented, Tcl will fall back on |
||
1889 | // * a copy to native-temp followed by a |
||
1890 | // * Tcl_FSLoadFile on that temporary copy. */ |
||
1891 | // Tcl_FSGetCwdProc *getCwdProc; |
||
1892 | // /* |
||
1893 | // * Function to process a 'Tcl_FSGetCwd()' |
||
1894 | // * call. Most filesystems need not |
||
1895 | // * implement this. It will usually only be |
||
1896 | // * called once, if 'getcwd' is called |
||
1897 | // * before 'chdir'. May be NULL. |
||
1898 | // */ |
||
1899 | // Tcl_FSChdirProc *chdirProc; |
||
1900 | // /* |
||
1901 | // * Function to process a 'Tcl_FSChdir()' |
||
1902 | // * call. If filesystems do not implement |
||
1903 | // * this, it will be emulated by a series of |
||
1904 | // * directory access checks. Otherwise, |
||
1905 | // * virtual filesystems which do implement |
||
1906 | // * it need only respond with a positive |
||
1907 | // * return result if the dirName is a valid |
||
1908 | // * directory in their filesystem. They |
||
1909 | // * need not remember the result, since that |
||
1910 | // * will be automatically remembered for use |
||
1911 | // * by GetCwd. Real filesystems should |
||
1912 | // * carry out the correct action (i.e. call |
||
1913 | // * the correct system 'chdir' api). If not |
||
1914 | // * implemented, then 'cd' and 'pwd' will |
||
1915 | // * fail inside the filesystem. |
||
1916 | // */ |
||
1917 | //} Tcl_Filesystem; |
||
1918 | |||
1919 | /* |
||
1920 | * The following definitions are used as values for the 'linkAction' flag |
||
1921 | * to Tcl_FSLink, or the linkProc of any filesystem. Any combination |
||
1922 | * of flags can be given. For link creation, the linkProc should create |
||
1923 | * a link which matches any of the types given. |
||
1924 | * |
||
1925 | * TCL_CREATE_SYMBOLIC_LINK: Create a symbolic or soft link. |
||
1926 | * TCL_CREATE_HARD_LINK: Create a hard link. |
||
1927 | */ |
||
1928 | //#define TCL_CREATE_SYMBOLIC_LINK 0x01 |
||
1929 | //#define TCL_CREATE_HARD_LINK 0x02 |
||
1930 | |||
1931 | /* |
||
1932 | * The following structure represents the Notifier functions that |
||
1933 | * you can override with the Tcl_SetNotifier call. |
||
1934 | */ |
||
1935 | //typedef struct Tcl_NotifierProcs { |
||
1936 | // Tcl_SetTimerProc *setTimerProc; |
||
1937 | // Tcl_WaitForEventProc *waitForEventProc; |
||
1938 | // Tcl_CreateFileHandlerProc *createFileHandlerProc; |
||
1939 | // Tcl_DeleteFileHandlerProc *deleteFileHandlerProc; |
||
1940 | // Tcl_InitNotifierProc *initNotifierProc; |
||
1941 | // Tcl_FinalizeNotifierProc *finalizeNotifierProc; |
||
1942 | // Tcl_AlertNotifierProc *alertNotifierProc; |
||
1943 | // Tcl_ServiceModeHookProc *serviceModeHookProc; |
||
1944 | //} Tcl_NotifierProcs; |
||
1945 | |||
1946 | |||
1947 | /* |
||
1948 | * The following structure represents a user-defined encoding. It collects |
||
1949 | * together all the functions that are used by the specific encoding. |
||
1950 | */ |
||
1951 | //typedef struct Tcl_EncodingType { |
||
1952 | // string encodingName; /* The name of the encoding, e.g. "euc-jp". |
||
1953 | // * This name is the unique key for this |
||
1954 | // * encoding type. */ |
||
1955 | // Tcl_EncodingConvertProc *toUtfProc; |
||
1956 | // /* Procedure to convert from external |
||
1957 | // * encoding into UTF-8. */ |
||
1958 | // Tcl_EncodingConvertProc *fromUtfProc; |
||
1959 | // /* Procedure to convert from UTF-8 into |
||
1960 | // * external encoding. */ |
||
1961 | // Tcl_EncodingFreeProc *freeProc; |
||
1962 | // /* If non-NULL, procedure to call when this |
||
1963 | // * encoding is deleted. */ |
||
1964 | // ClientData clientData; /* Arbitrary value associated with encoding |
||
1965 | // * type. Passed to conversion procedures. */ |
||
1966 | // int nullSize; /* Number of zero bytes that signify |
||
1967 | // * end-of-string in this encoding. This |
||
1968 | // * number is used to determine the source |
||
1969 | // * string length when the srcLen argument is |
||
1970 | // * negative. Must be 1 or 2. */ |
||
1971 | //} Tcl_EncodingType; |
||
1972 | |||
1973 | /* |
||
1974 | * The following definitions are used as values for the conversion control |
||
1975 | * flags argument when converting text from one character set to another: |
||
1976 | * |
||
1977 | * TCL_ENCODING_START: Signifies that the source buffer is the first |
||
1978 | * block in a (potentially multi-block) input |
||
1979 | * stream. Tells the conversion procedure to |
||
1980 | * reset to an initial state and perform any |
||
1981 | * initialization that needs to occur before the |
||
1982 | * first byte is converted. If the source |
||
1983 | * buffer contains the entire input stream to be |
||
1984 | * converted, this flag should be set. |
||
1985 | * |
||
1986 | * TCL_ENCODING_END: Signifies that the source buffer is the last |
||
1987 | * block in a (potentially multi-block) input |
||
1988 | * stream. Tells the conversion routine to |
||
1989 | * perform any finalization that needs to occur |
||
1990 | * after the last byte is converted and then to |
||
1991 | * reset to an initial state. If the source |
||
1992 | * buffer contains the entire input stream to be |
||
1993 | * converted, this flag should be set. |
||
1994 | * |
||
1995 | * TCL_ENCODING_STOPONERROR: If set, then the converter will return |
||
1996 | * immediately upon encountering an invalid |
||
1997 | * byte sequence or a source character that has |
||
1998 | * no mapping in the target encoding. If clear, |
||
1999 | * then the converter will skip the problem, |
||
2000 | * substituting one or more "close" characters |
||
2001 | * in the destination buffer and then continue |
||
2002 | * to sonvert the source. |
||
2003 | */ |
||
2004 | //#define TCL_ENCODING_START 0x01 |
||
2005 | //#define TCL_ENCODING_END 0x02 |
||
2006 | //#define TCL_ENCODING_STOPONERROR 0x04 |
||
2007 | |||
2008 | |||
2009 | /* |
||
2010 | * The following data structures and declarations are for the new Tcl |
||
2011 | * parser. |
||
2012 | */ |
||
2013 | |||
2014 | /* |
||
2015 | * For each word of a command, and for each piece of a word such as a |
||
2016 | * variable reference, one of the following structures is created to |
||
2017 | * describe the token. |
||
2018 | */ |
||
2019 | //typedef struct Tcl_Token { |
||
2020 | // int type; /* Type of token, such as TCL_TOKEN_WORD; |
||
2021 | // * see below for valid types. */ |
||
2022 | // string start; /* First character in token. */ |
||
2023 | // int size; /* Number of bytes in token. */ |
||
2024 | // int numComponents; /* If this token is composed of other |
||
2025 | // * tokens, this field tells how many of |
||
2026 | // * them there are (including components of |
||
2027 | // * components, etc.). The component tokens |
||
2028 | // * immediately follow this one. */ |
||
2029 | //} Tcl_Token; |
||
2030 | |||
2031 | /* |
||
2032 | * Type values defined for Tcl_Token structures. These values are |
||
2033 | * defined as mask bits so that it's easy to check for collections of |
||
2034 | * types. |
||
2035 | * |
||
2036 | * TCL_TOKEN_WORD - The token describes one word of a command, |
||
2037 | * from the first non-blank character of |
||
2038 | * the word (which may be " or {) up to but |
||
2039 | * not including the space, semicolon, or |
||
2040 | * bracket that terminates the word. |
||
2041 | * NumComponents counts the total number of |
||
2042 | * sub-tokens that make up the word. This |
||
2043 | * includes, for example, sub-tokens of |
||
2044 | * TCL_TOKEN_VARIABLE tokens. |
||
2045 | * TCL_TOKEN_SIMPLE_WORD - This token is just like TCL_TOKEN_WORD |
||
2046 | * except that the word is guaranteed to |
||
2047 | * consist of a single TCL_TOKEN_TEXT |
||
2048 | * sub-token. |
||
2049 | * TCL_TOKEN_TEXT - The token describes a range of literal |
||
2050 | * text that is part of a word. |
||
2051 | * NumComponents is always 0. |
||
2052 | * TCL_TOKEN_BS - The token describes a backslash sequence |
||
2053 | * that must be collapsed. NumComponents |
||
2054 | * is always 0. |
||
2055 | * TCL_TOKEN_COMMAND - The token describes a command whose result |
||
2056 | * must be substituted into the word. The |
||
2057 | * token includes the enclosing brackets. |
||
2058 | * NumComponents is always 0. |
||
2059 | * TCL_TOKEN_VARIABLE - The token describes a variable |
||
2060 | * substitution, including the dollar sign, |
||
2061 | * variable name, and array index (if there |
||
2062 | * is one) up through the right |
||
2063 | * parentheses. NumComponents tells how |
||
2064 | * many additional tokens follow to |
||
2065 | * represent the variable name. The first |
||
2066 | * token will be a TCL_TOKEN_TEXT token |
||
2067 | * that describes the variable name. If |
||
2068 | * the variable is an array reference then |
||
2069 | * there will be one or more additional |
||
2070 | * tokens, of type TCL_TOKEN_TEXT, |
||
2071 | * TCL_TOKEN_BS, TCL.TCL_TOKEN_COMMAND, and |
||
2072 | * TCL_TOKEN_VARIABLE, that describe the |
||
2073 | * array index; numComponents counts the |
||
2074 | * total number of nested tokens that make |
||
2075 | * up the variable reference, including |
||
2076 | * sub-tokens of TCL_TOKEN_VARIABLE tokens. |
||
2077 | * TCL_TOKEN_SUB_EXPR - The token describes one subexpression of a |
||
2078 | * expression, from the first non-blank |
||
2079 | * character of the subexpression up to but not |
||
2080 | * including the space, brace, or bracket |
||
2081 | * that terminates the subexpression. |
||
2082 | * NumComponents counts the total number of |
||
2083 | * following subtokens that make up the |
||
2084 | * subexpression; this includes all subtokens |
||
2085 | * for any nested TCL_TOKEN_SUB_EXPR tokens. |
||
2086 | * For example, a numeric value used as a |
||
2087 | * primitive operand is described by a |
||
2088 | * TCL_TOKEN_SUB_EXPR token followed by a |
||
2089 | * TCL_TOKEN_TEXT token. A binary subexpression |
||
2090 | * is described by a TCL_TOKEN_SUB_EXPR token |
||
2091 | * followed by the TCL_TOKEN_OPERATOR token |
||
2092 | * for the operator, then TCL_TOKEN_SUB_EXPR |
||
2093 | * tokens for the left then the right operands. |
||
2094 | * TCL_TOKEN_OPERATOR - The token describes one expression operator. |
||
2095 | * An operator might be the name of a math |
||
2096 | * function such as "abs". A TCL_TOKEN_OPERATOR |
||
2097 | * token is always preceeded by one |
||
2098 | * TCL_TOKEN_SUB_EXPR token for the operator's |
||
2099 | * subexpression, and is followed by zero or |
||
2100 | * more TCL_TOKEN_SUB_EXPR tokens for the |
||
2101 | * operator's operands. NumComponents is |
||
2102 | * always 0. |
||
2103 | */ |
||
2104 | //#define TCL_TOKEN_WORD 1 |
||
2105 | //#define TCL_TOKEN_SIMPLE_WORD 2 |
||
2106 | //#define TCL_TOKEN_TEXT 4 |
||
2107 | //#define TCL_TOKEN_BS 8 |
||
2108 | //#define TCL_TOKEN_COMMAND 16 |
||
2109 | //#define TCL_TOKEN_VARIABLE 32 |
||
2110 | //#define TCL_TOKEN_SUB_EXPR 64 |
||
2111 | //#define TCL_TOKEN_OPERATOR 128 |
||
2112 | |||
2113 | /* |
||
2114 | * Parsing error types. On any parsing error, one of these values |
||
2115 | * will be stored in the error field of the Tcl_Parse structure |
||
2116 | * defined below. |
||
2117 | */ |
||
2118 | //#define TCL_PARSE_SUCCESS 0 |
||
2119 | //#define TCL_PARSE_QUOTE_EXTRA 1 |
||
2120 | //#define TCL_PARSE_BRACE_EXTRA 2 |
||
2121 | //#define TCL_PARSE_MISSING_BRACE 3 |
||
2122 | //#define TCL_PARSE_MISSING_BRACKET 4 |
||
2123 | //#define TCL_PARSE_MISSING_PAREN 5 |
||
2124 | //#define TCL_PARSE_MISSING_QUOTE 6 |
||
2125 | //#define TCL_PARSE_MISSING_VAR_BRACE 7 |
||
2126 | //#define TCL_PARSE_SYNTAX 8 |
||
2127 | //#define TCL_PARSE_BAD_NUMBER 9 |
||
2128 | |||
2129 | /* |
||
2130 | * A structure of the following type is filled in by Tcl_ParseCommand. |
||
2131 | * It describes a single command parsed from an input string. |
||
2132 | */ |
||
2133 | //#define NUM_STATIC_TOKENS 20 |
||
2134 | |||
2135 | //typedef struct Tcl_Parse { |
||
2136 | // string commentStart; /* Pointer to # that begins the first of |
||
2137 | // * one or more comments preceding the |
||
2138 | // * command. */ |
||
2139 | // int commentSize; /* Number of bytes in comments (up through |
||
2140 | // * newline character that terminates the |
||
2141 | // * last comment). If there were no |
||
2142 | // * comments, this field is 0. */ |
||
2143 | // string commandStart; /* First character in first word of command. */ |
||
2144 | // int commandSize; /* Number of bytes in command, including |
||
2145 | // * first character of first word, up |
||
2146 | // * through the terminating newline, |
||
2147 | // * close bracket, or semicolon. */ |
||
2148 | // int numWords; /* Total number of words in command. May |
||
2149 | // * be 0. */ |
||
2150 | // Tcl_Token *tokenPtr; /* Pointer to first token representing |
||
2151 | // * the words of the command. Initially |
||
2152 | // * points to staticTokens, but may change |
||
2153 | // * to point to malloc-ed space if command |
||
2154 | // * exceeds space in staticTokens. */ |
||
2155 | // int numTokens; /* Total number of tokens in command. */ |
||
2156 | // int tokensAvailable; /* Total number of tokens available at |
||
2157 | // * *tokenPtr. */ |
||
2158 | // int errorType; /* One of the parsing error types defined |
||
2159 | // * above. */ |
||
2160 | |||
2161 | // /* |
||
2162 | // * The fields below are intended only for the private use of the |
||
2163 | // * parser. They should not be used by procedures that invoke |
||
2164 | // * Tcl_ParseCommand. |
||
2165 | // */ |
||
2166 | |||
2167 | // string string; /* The original command string passed to |
||
2168 | // * Tcl_ParseCommand. */ |
||
2169 | // string end; /* Points to the character just after the |
||
2170 | // * last one in the command string. */ |
||
2171 | // Tcl_Interp interp; /* Interpreter to use for error reporting, |
||
2172 | // * or NULL. */ |
||
2173 | // string term; /* Points to character in string that |
||
2174 | // * terminated most recent token. Filled in |
||
2175 | // * by ParseTokens. If an error occurs, |
||
2176 | // * points to beginning of region where the |
||
2177 | // * error occurred (e.g. the open brace if |
||
2178 | // * the close brace is missing). */ |
||
2179 | // int incomplete; /* This field is set to 1 by Tcl_ParseCommand |
||
2180 | // * if the command appears to be incomplete. |
||
2181 | // * This information is used by |
||
2182 | // * Tcl_CommandComplete. */ |
||
2183 | // Tcl_Token staticTokens[NUM_STATIC_TOKENS]; |
||
2184 | // /* Initial space for tokens for command. |
||
2185 | // * This space should be large enough to |
||
2186 | // * accommodate most commands; dynamic |
||
2187 | // * space is allocated for very large |
||
2188 | // * commands that don't fit here. */ |
||
2189 | //} Tcl_Parse; |
||
2190 | |||
2191 | /* |
||
2192 | * The following definitions are the error codes returned by the conversion |
||
2193 | * routines: |
||
2194 | * |
||
2195 | * TCL_OK: All characters were converted. |
||
2196 | * |
||
2197 | * TCL_CONVERT_NOSPACE: The output buffer would not have been large |
||
2198 | * enough for all of the converted data; as many |
||
2199 | * characters as could fit were converted though. |
||
2200 | * |
||
2201 | * TCL_CONVERT_MULTIBYTE: The last few bytes in the source string were |
||
2202 | * the beginning of a multibyte sequence, but |
||
2203 | * more bytes were needed to complete this |
||
2204 | * sequence. A subsequent call to the conversion |
||
2205 | * routine should pass the beginning of this |
||
2206 | * unconverted sequence plus additional bytes |
||
2207 | * from the source stream to properly convert |
||
2208 | * the formerly split-up multibyte sequence. |
||
2209 | * |
||
2210 | * TCL_CONVERT_SYNTAX: The source stream contained an invalid |
||
2211 | * character sequence. This may occur if the |
||
2212 | * input stream has been damaged or if the input |
||
2213 | * encoding method was misidentified. This error |
||
2214 | * is reported only if TCL_ENCODING_STOPONERROR |
||
2215 | * was specified. |
||
2216 | * |
||
2217 | * TCL_CONVERT_UNKNOWN: The source string contained a character |
||
2218 | * that could not be represented in the target |
||
2219 | * encoding. This error is reported only if |
||
2220 | * TCL_ENCODING_STOPONERROR was specified. |
||
2221 | */ |
||
2222 | //#define TCL_CONVERT_MULTIBYTE -1 |
||
2223 | //#define TCL_CONVERT_SYNTAX -2 |
||
2224 | //#define TCL_CONVERT_UNKNOWN -3 |
||
2225 | //#define TCL_CONVERT_NOSPACE -4 |
||
2226 | |||
2227 | /* |
||
2228 | * The maximum number of bytes that are necessary to represent a single |
||
2229 | * Unicode character in UTF-8. The valid values should be 3 or 6 (or |
||
2230 | * perhaps 1 if we want to support a non-unicode enabled core). |
||
2231 | * If 3, then Tcl_UniChar must be 2-bytes in size (UCS-2). (default) |
||
2232 | * If 6, then Tcl_UniChar must be 4-bytes in size (UCS-4). |
||
2233 | * At this time UCS-2 mode is the default and recommended mode. |
||
2234 | * UCS-4 is experimental and not recommended. It works for the core, |
||
2235 | * but most extensions expect UCS-2. |
||
2236 | */ |
||
2237 | #if !TCL_UTF_MAX |
||
2238 | //#define TCL_UTF_MAX 3 |
||
2239 | #endif |
||
2240 | |||
2241 | /* |
||
2242 | * This represents a Unicode character. Any changes to this should |
||
2243 | * also be reflected in regcustom.h. |
||
2244 | */ |
||
2245 | //#if TCL_UTF_MAX > 3 |
||
2246 | // /* |
||
2247 | // * unsigned int isn't 100% accurate as it should be a strict 4-byte |
||
2248 | // * value (perhaps wchar_t). 64-bit systems may have troubles. The |
||
2249 | // * size of this value must be reflected correctly in regcustom.h and |
||
2250 | // * in tclEncoding.c. |
||
2251 | // * XXX: Tcl is currently UCS-2 and planning UTF-16 for the Unicode |
||
2252 | // * XXX: string rep that Tcl_UniChar represents. Changing the size |
||
2253 | // * XXX: of Tcl_UniChar is /not/ supported. |
||
2254 | // */ |
||
2255 | //typedef unsigned int Tcl_UniChar; |
||
2256 | //#else |
||
2257 | //typedef unsigned short Tcl_UniChar; |
||
2258 | //#endif |
||
2259 | |||
2260 | |||
2261 | /* |
||
2262 | * Deprecated Tcl procedures: |
||
2263 | */ |
||
2264 | #if !TCL_NO_DEPRECATED |
||
2265 | //# define Tcl_EvalObj(interp,objPtr) \ |
||
2266 | // Tcl_EvalObjEx((interp),(objPtr),0) |
||
2267 | //# define Tcl_GlobalEvalObj(interp,objPtr) \ |
||
2268 | // Tcl_EvalObjEx((interp),(objPtr),TCL_EVAL_GLOBAL) |
||
2269 | #endif |
||
2270 | |||
2271 | |||
2272 | /* |
||
2273 | * These function have been renamed. The old names are deprecated, but we |
||
2274 | * define these macros for backwards compatibilty. |
||
2275 | */ |
||
2276 | //#define Tcl_Ckalloc Tcl_Alloc |
||
2277 | //#define Tcl_Ckfree Tcl_Free |
||
2278 | //#define Tcl_Ckrealloc Tcl_Realloc |
||
2279 | //#define Tcl_return TCL.TCL_SetResult |
||
2280 | //#define Tcl_TildeSubst Tcl_TranslateFileName |
||
2281 | //#define panic Tcl_Panic |
||
2282 | //#define panicVA Tcl_PanicVA |
||
2283 | |||
2284 | |||
2285 | /* |
||
2286 | * The following constant is used to test for older versions of Tcl |
||
2287 | * in the stubs tables. |
||
2288 | * |
||
2289 | * Jan Nijtman's plus patch uses 0xFCA1BACF, so we need to pick a different |
||
2290 | * value since the stubs tables don't match. |
||
2291 | */ |
||
2292 | |||
2293 | //#define TCL_STUB_MAGIC ((int)0xFCA3BACF) |
||
2294 | |||
2295 | /* |
||
2296 | * The following function is required to be defined in all stubs aware |
||
2297 | * extensions. The function is actually implemented in the stub |
||
2298 | * library, not the main Tcl library, although there is a trivial |
||
2299 | * implementation in the main library in case an extension is statically |
||
2300 | * linked into an application. |
||
2301 | */ |
||
2302 | |||
2303 | //EXTERN string Tcl_InitStubs _ANSI_ARGS_((Tcl_Interp interp, |
||
2304 | // string version, int exact)); |
||
2305 | |||
2306 | #if !USE_TCL_STUBS |
||
2307 | |||
2308 | /* |
||
2309 | * When not using stubs, make it a macro. |
||
2310 | */ |
||
2311 | |||
2312 | //#define Tcl_InitStubs(interp, version, exact) \ |
||
2313 | // Tcl_PkgRequire(interp, "Tcl", version, exact) |
||
2314 | |||
2315 | #endif |
||
2316 | |||
2317 | |||
2318 | /* |
||
2319 | * Include the public function declarations that are accessible via |
||
2320 | * the stubs table. |
||
2321 | */ |
||
2322 | |||
2323 | //#include "tclDecls.h" |
||
2324 | |||
2325 | /* |
||
2326 | * Include platform specific public function declarations that are |
||
2327 | * accessible via the stubs table. |
||
2328 | */ |
||
2329 | |||
2330 | /* |
||
2331 | * tclPlatDecls.h can't be included here on the Mac, as we need |
||
2332 | * Mac specific headers to define the Mac types used in this file, |
||
2333 | * but these Mac haders conflict with a number of tk types |
||
2334 | * and thus can't be included in the globally read tcl.h |
||
2335 | * This header was originally added here as a fix for bug 5241 |
||
2336 | * (stub link error for symbols in TclPlatStubs table), as a work- |
||
2337 | * around for the bug on the mac, tclMac.h is included immediately |
||
2338 | * after tcl.h in the tcl precompiled header (with DLLEXPORT set). |
||
2339 | */ |
||
2340 | |||
2341 | //#if !(MAC_TCL) |
||
2342 | //#include "tclPlatDecls.h" |
||
2343 | //#endif |
||
2344 | |||
2345 | /* |
||
2346 | * Public functions that are not accessible via the stubs table. |
||
2347 | */ |
||
2348 | |||
2349 | //EXTERN void Tcl_Main _ANSI_ARGS_((int argc, char **argv, |
||
2350 | // Tcl_AppInitProc *appInitProc)); |
||
2351 | |||
2352 | /* |
||
2353 | * Convenience declaration of Tcl_AppInit for backwards compatibility. |
||
2354 | * This function is not *implemented* by the tcl library, so the storage |
||
2355 | * class is neither DLLEXPORT nor DLLIMPORT |
||
2356 | */ |
||
2357 | //#undef TCL_STORAGE_CLASS |
||
2358 | //#define TCL_STORAGE_CLASS |
||
2359 | |||
2360 | //EXTERN int Tcl_AppInit _ANSI_ARGS_((Tcl_Interp interp)); |
||
2361 | |||
2362 | //#undef TCL_STORAGE_CLASS |
||
2363 | //#define TCL_STORAGE_CLASS DLLIMPORT |
||
2364 | |||
2365 | #endif // * RC_INVOKED */ |
||
2366 | |||
2367 | /* |
||
2368 | * end block for C++ |
||
2369 | */ |
||
2370 | #if __cplusplus |
||
2371 | //} |
||
2372 | #endif |
||
2373 | |||
2374 | #endif // * _TCL */ |
||
2375 | } |
||
2376 | } |