Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / perl-5.8.0 / lib / site_perl / 5.8.0 / sun4-solaris / Tk / pTk / Lang.h
CommitLineData
86530b38
AT
1/*
2 * tcl.h --
3 *
4 * This header file describes the externally-visible facilities
5 * of the Tcl interpreter.
6 *
7 * Copyright (c) 1987-1994 The Regents of the University of California.
8 * Copyright (c) 1994-1997 Sun Microsystems, Inc.
9 * Copyright (c) 1993-1996 Lucent Technologies.
10 *
11 * See the file "license.terms" for information on usage and redistribution
12 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
13 *
14 * SCCS: @(#) tcl.h 1.318 97/06/26 13:43:02
15 */
16
17#ifndef _LANG
18#define _LANG
19
20#include "tkConfig.h"
21#include <sys/types.h>
22#ifndef NO_STDLIB_H
23#include <stdlib.h>
24#endif
25
26#if !defined(__GNUC__) && !defined(_AIX)
27#ifdef __STDC__
28#ifndef STRINGIFY
29#define STRINGIFY(x) STRINGIFY1(x)
30#define STRINGIFY1(x) #x
31#endif /* STRINGIFY */
32#define __FUNCTION__ __FILE__ ":" STRINGIFY(__LINE__)
33#else /* STDC */
34#define __FUNCTION__ ""
35#endif /* STDC */
36#endif /* GNUC or AIX */
37
38#define USE_TCLALLOC 1
39
40#ifdef __EMX__
41typedef long fd_mask;
42# define strncasecmp strnicmp
43# define strcasecmp stricmp
44#endif
45
46#ifdef __CYGWIN__
47#include <sys/time.h>
48#define MASK_SIZE howmany(FD_SETSIZE, NFDBITS)
49#endif
50
51/*
52 * When version numbers change here, must also go into the following files
53 * and update the version numbers:
54 *
55 * library/init.tcl
56 * unix/configure.in
57 * unix/pkginfo
58 * win/makefile.bc
59 * win/makefile.vc
60 *
61 * The release level should be 0 for alpha, 1 for beta, and 2 for
62 * final/patch. The release serial value is the number that follows the
63 * "a", "b", or "p" in the patch level; for example, if the patch level
64 * is 7.6b2, TCL_RELEASE_SERIAL is 2. It restarts at 1 whenever the
65 * release level is changed, except for the final release which is 0
66 * (the first patch will start at 1).
67 */
68
69#define TCL_MAJOR_VERSION 8
70#define TCL_MINOR_VERSION 0
71#define TCL_RELEASE_LEVEL 1
72#define TCL_RELEASE_SERIAL 2
73
74#define TCL_VERSION "8.0"
75#define TCL_PATCH_LEVEL "8.0b2"
76
77/*
78 * The following definitions set up the proper options for Windows
79 * compilers. We use this method because there is no autoconf equivalent.
80 */
81
82#ifndef __WIN32__
83# if defined(_WIN32) || defined(WIN32)
84# define __WIN32__
85# endif
86#endif
87
88#ifdef __WIN32__
89# ifndef STRICT
90# define STRICT
91# endif
92# ifndef USE_PROTOTYPE
93# define USE_PROTOTYPE 1
94# endif
95# ifndef HAS_STDARG
96# define HAS_STDARG 1
97# endif
98# ifndef USE_TCLALLOC
99# define USE_TCLALLOC 0
100# endif
101#endif /* __WIN32__ */
102
103/*
104 * The following definitions set up the proper options for Macintosh
105 * compilers. We use this method because there is no autoconf equivalent.
106 */
107
108#ifdef MAC_TCL
109# ifndef HAS_STDARG
110# define HAS_STDARG 1
111# endif
112# ifndef USE_TCLALLOC
113# define USE_TCLALLOC 1
114# endif
115# ifndef NO_STRERROR
116# define NO_STRERROR 1
117# endif
118#endif
119
120/*
121 * A special definition used to allow this header file to be included
122 * in resource files so that they can get obtain version information from
123 * this file. Resource compilers don't like all the C stuff, like typedefs
124 * and procedure declarations, that occur below.
125 */
126
127#ifndef RESOURCE_INCLUDED
128
129/*
130 * Definitions that allow Tcl functions with variable numbers of
131 * arguments to be used with either varargs.h or stdarg.h. TCL_VARARGS
132 * is used in procedure prototypes. TCL_VARARGS_DEF is used to declare
133 * the arguments in a function definiton: it takes the type and name of
134 * the first argument and supplies the appropriate argument declaration
135 * string for use in the function definition. TCL_VARARGS_START
136 * initializes the va_list data structure and returns the first argument.
137 */
138
139#if defined(__STDC__) || defined(HAS_STDARG)
140# define TCL_VARARGS(type, name) (type name, ...)
141# define TCL_VARARGS_DEF(type, name) (type name, ...)
142# define TCL_VARARGS_START(type, name, list) (va_start(list, name), name)
143#else
144# ifdef __cplusplus
145# define TCL_VARARGS(type, name) (type name, ...)
146# define TCL_VARARGS_DEF(type, name) (type va_alist, ...)
147# else
148# define TCL_VARARGS(type, name) ()
149# define TCL_VARARGS_DEF(type, name) (va_alist)
150# endif
151# define TCL_VARARGS_START(type, name, list) (va_start(list), va_arg(list, type))
152#endif
153
154/*
155 * Definitions that allow this header file to be used either with or
156 * without ANSI C features like function prototypes.
157 */
158
159#undef _ANSI_ARGS_
160#undef CONST
161
162#if defined(USE_PROTOTYPE) || ((defined(__STDC__) || defined(SABER)) && !defined(NO_PROTOTYPE)) || defined(__cplusplus)
163# define _USING_PROTOTYPES_ 1
164# define _ANSI_ARGS_(x) x
165# define CONST const
166#else
167# define _ANSI_ARGS_(x) ()
168# define CONST
169#endif
170
171#ifdef __cplusplus
172# define EXTERN extern "C"
173#else
174# define EXTERN extern
175#endif
176#define MOVEXT EXTERN
177#define XFree_arg_t void
178
179/*
180 * Macro to use instead of "void" for arguments that must have
181 * type "void *" in ANSI C; maps them to type "char *" in
182 * non-ANSI systems.
183 */
184#ifndef __WIN32__
185#ifndef VOID
186# ifdef __STDC__
187# define VOID void
188# else
189# define VOID char
190# endif
191#endif
192#else /* __WIN32__ */
193/*
194 * The following code is copied from winnt.h
195 */
196#ifndef VOID
197#define VOID void
198typedef char CHAR;
199typedef short SHORT;
200typedef long LONG;
201#endif
202#endif /* __WIN32__ */
203
204/*
205 * Miscellaneous declarations.
206 */
207
208#include "LangIO.h"
209
210#ifndef NULL
211#define NULL 0
212#endif
213
214#ifndef _CLIENTDATA
215# if defined(__STDC__) || defined(__cplusplus)
216 typedef void *ClientData;
217# else
218 typedef int *ClientData;
219# endif /* __STDC__ */
220#define _CLIENTDATA
221#endif
222
223
224/*
225 * Data structures defined opaquely in this module. The definitions below
226 * just provide dummy types. A few fields are made visible in Tcl_Interp
227 * structures, namely those used for returning a string result from
228 * commands. Direct access to the result field is discouraged in Tcl 8.0.
229 * The interpreter result is either an object or a string, and the two
230 * values are kept consistent unless some C code sets interp->result
231 * directly. Programmers should use either the procedure Tcl_GetObjResult()
232 * or Tcl_GetStringResult() to read the interpreter's result. See the
233 * SetResult man page for details.
234 *
235 * Note: any change to the Tcl_Interp definition below must be mirrored
236 * in the "real" definition in tclInt.h.
237 *
238 * Note: Tcl_ObjCmdProc procedures do not directly set result and freeProc.
239 * Instead, they set a Tcl_Obj member in the "real" structure that can be
240 * accessed with Tcl_GetObjResult() and Tcl_SetObjResult().
241 */
242
243#ifndef Tcl_Interp
244typedef struct Tcl_Interp
245#ifdef USE_TCL_STRUCTS
246{
247 char *result; /* If the last command returned a string
248 * result, this points to it. */
249 void (*freeProc) _ANSI_ARGS_((char *blockPtr));
250 /* Zero means the string result is
251 * statically allocated. TCL_DYNAMIC means
252 * it was allocated with ckalloc and should
253 * be freed with ckfree. Other values give
254 * the address of procedure to invoke to
255 * free the result. Tcl_Eval must free it
256 * before executing next command. */
257 int errorLine; /* When TCL_ERROR is returned, this gives
258 * the line number within the command where
259 * the error occurred (1 if first line). */
260}
261#endif /* USE_TCL_STRUCTS */
262Tcl_Interp;
263#endif /* Tcl_Interp */
264
265typedef struct Tcl_AsyncHandler_ *Tcl_AsyncHandler;
266typedef struct Tcl_Channel_ *Tcl_Channel;
267#ifndef Tcl_Command
268typedef struct Tcl_Command_ *Tcl_Command;
269#endif
270typedef struct Tcl_Event Tcl_Event;
271typedef struct Tcl_Pid_ *Tcl_Pid;
272#ifndef Tcl_RegExp
273typedef struct Tcl_RegExp_ *Tcl_RegExp;
274#endif
275typedef struct Tcl_TimerToken_ *Tcl_TimerToken;
276typedef struct Tcl_Trace_ *Tcl_Trace;
277
278
279#ifndef Var
280typedef struct Var *Var;
281#endif
282typedef struct Tcl_Var_ *Tcl_Var;
283
284#ifndef LangResultSave
285typedef struct LangResultSave LangResultSave;
286#endif
287
288/*
289 * When a TCL command returns, the interpreter contains a result from the
290 * command. Programmers are strongly encouraged to use one of the
291 * procedures Tcl_GetObjResult() or Tcl_GetStringResult() to read the
292 * interpreter's result. See the SetResult man page for details. Besides
293 * this result, the command procedure returns an integer code, which is
294 * one of the following:
295 *
296 * TCL_OK Command completed normally; the interpreter's
297 * result contains the command's result.
298 * TCL_ERROR The command couldn't be completed successfully;
299 * the interpreter's result describes what went wrong.
300 * TCL_RETURN The command requests that the current procedure
301 * return; the interpreter's result contains the
302 * procedure's return value.
303 * TCL_BREAK The command requests that the innermost loop
304 * be exited; the interpreter's result is meaningless.
305 * TCL_CONTINUE Go on to the next iteration of the current loop;
306 * the interpreter's result is meaningless.
307 */
308
309#define TCL_OK 0
310#define TCL_ERROR 1
311#define TCL_RETURN 2
312#define TCL_BREAK 3
313#define TCL_CONTINUE 4
314
315#define TCL_RESULT_SIZE 200
316
317/*
318 * Argument descriptors for math function callbacks in expressions:
319 */
320
321typedef enum {TCL_INT, TCL_DOUBLE, TCL_EITHER} Tcl_ValueType;
322typedef struct Tcl_Value {
323 Tcl_ValueType type; /* Indicates intValue or doubleValue is
324 * valid, or both. */
325 long intValue; /* Integer value. */
326 double doubleValue; /* Double-precision floating value. */
327} Tcl_Value;
328
329/*
330 * Forward declaration of Tcl_Obj to prevent an error when the forward
331 * reference to Tcl_Obj is encountered in the procedure types declared
332 * below.
333 */
334
335#ifndef Tcl_Obj
336typedef struct Tcl_Obj Tcl_Obj;
337#endif
338
339#ifndef Arg
340typedef Tcl_Obj *Arg;
341#endif
342
343/*
344 * Procedure types defined by Tcl:
345 */
346
347typedef int (Tcl_AppInitProc) _ANSI_ARGS_((Tcl_Interp *interp));
348typedef int (Tcl_AsyncProc) _ANSI_ARGS_((ClientData clientData,
349 Tcl_Interp *interp, int code));
350typedef void (Tcl_ChannelProc) _ANSI_ARGS_((ClientData clientData, int mask));
351typedef void (Tcl_CloseProc) _ANSI_ARGS_((ClientData data));
352typedef void (Tcl_CmdDeleteProc) _ANSI_ARGS_((ClientData clientData));
353typedef int (Tcl_CmdProc) _ANSI_ARGS_((ClientData clientData,
354 Tcl_Interp *interp, int argc, Tcl_Obj **argv));
355typedef void (Tcl_CmdTraceProc) _ANSI_ARGS_((ClientData clientData,
356 Tcl_Interp *interp, int level, char *command, Tcl_CmdProc *proc,
357 ClientData cmdClientData, int argc, char *argv[]));
358typedef void (Tcl_DupInternalRepProc) _ANSI_ARGS_((Tcl_Obj *srcPtr,
359 Tcl_Obj *dupPtr));
360typedef int (Tcl_EventProc) _ANSI_ARGS_((Tcl_Event *evPtr, int flags));
361typedef void (Tcl_EventCheckProc) _ANSI_ARGS_((ClientData clientData,
362 int flags));
363typedef int (Tcl_EventDeleteProc) _ANSI_ARGS_((Tcl_Event *evPtr,
364 ClientData clientData));
365typedef void (Tcl_EventSetupProc) _ANSI_ARGS_((ClientData clientData,
366 int flags));
367typedef void (Tcl_ExitProc) _ANSI_ARGS_((ClientData clientData));
368typedef void (Tcl_FileProc) _ANSI_ARGS_((ClientData clientData, int mask));
369typedef void (Tcl_FileFreeProc) _ANSI_ARGS_((ClientData clientData));
370typedef void (Tcl_FreeInternalRepProc) _ANSI_ARGS_((Tcl_Obj *objPtr));
371typedef void (Tcl_FreeProc) _ANSI_ARGS_((char *blockPtr));
372typedef void (Tcl_IdleProc) _ANSI_ARGS_((ClientData clientData));
373typedef void (Tcl_InterpDeleteProc) _ANSI_ARGS_((ClientData clientData,
374 Tcl_Interp *interp));
375typedef int (Tcl_MathProc) _ANSI_ARGS_((ClientData clientData,
376 Tcl_Interp *interp, Tcl_Value *args, Tcl_Value *resultPtr));
377typedef void (Tcl_NamespaceDeleteProc) _ANSI_ARGS_((ClientData clientData));
378typedef int (Tcl_ObjCmdProc) _ANSI_ARGS_((ClientData clientData,
379 Tcl_Interp *interp, int objc, Tcl_Obj * CONST objv[]));
380typedef int (Tcl_PackageInitProc) _ANSI_ARGS_((Tcl_Interp *interp));
381typedef void (Tcl_TcpAcceptProc) _ANSI_ARGS_((ClientData callbackData,
382 Tcl_Channel chan, char *address, int port));
383typedef void (Tcl_TimerProc) _ANSI_ARGS_((ClientData clientData));
384typedef int (Tcl_SetFromAnyProc) _ANSI_ARGS_((Tcl_Interp *interp,
385 Tcl_Obj *objPtr));
386typedef void (Tcl_UpdateStringProc) _ANSI_ARGS_((Tcl_Obj *objPtr));
387typedef char *(Tcl_VarTraceProc) _ANSI_ARGS_((ClientData clientData,
388 Tcl_Interp *interp, Var part1, char *part2, int flags));
389
390/*
391 * The following structure represents a type of object, which is a
392 * particular internal representation for an object plus a set of
393 * procedures that provide standard operations on objects of that type.
394 */
395
396typedef struct Tcl_ObjType
397#ifdef USE_TCL_STRUCTS
398{
399 char *name; /* Name of the type, e.g. "int". */
400 Tcl_FreeInternalRepProc *freeIntRepProc;
401 /* Called to free any storage for the type's
402 * internal rep. NULL if the internal rep
403 * does not need freeing. */
404 Tcl_DupInternalRepProc *dupIntRepProc;
405 /* Called to create a new object as a copy
406 * of an existing object. */
407 Tcl_UpdateStringProc *updateStringProc;
408 /* Called to update the string rep from the
409 * type's internal representation. */
410 Tcl_SetFromAnyProc *setFromAnyProc;
411 /* Called to convert the object's internal
412 * rep to this type. Frees the internal rep
413 * of the old type. Returns TCL_ERROR on
414 * failure. */
415}
416#endif /* USE_TCL_STRUCTS */
417Tcl_ObjType;
418
419/*
420 * One of the following structures exists for each object in the Tcl
421 * system. An object stores a value as either a string, some internal
422 * representation, or both.
423 */
424
425#ifdef USE_TCL_STRUCTS
426struct Tcl_Obj
427{
428 int refCount; /* When 0 the object will be freed. */
429 char *bytes; /* This points to the first byte of the
430 * object's string representation. The array
431 * must be followed by a null byte (i.e., at
432 * offset length) but may also contain
433 * embedded null characters. The array's
434 * storage is allocated by ckalloc. NULL
435 * means the string rep is invalid and must
436 * be regenerated from the internal rep.
437 * Clients should use Tcl_GetStringFromObj
438 * to get a pointer to the byte array as a
439 * readonly value. */
440 int length; /* The number of bytes at *bytes, not
441 * including the terminating null. */
442 Tcl_ObjType *typePtr; /* Denotes the object's type. Always
443 * corresponds to the type of the object's
444 * internal rep. NULL indicates the object
445 * has no internal rep (has no type). */
446 union { /* The internal representation: */
447 long longValue; /* - an long integer value */
448 double doubleValue; /* - a double-precision floating value */
449 VOID *otherValuePtr; /* - another, type-specific value */
450 struct { /* - internal rep as two pointers */
451 VOID *ptr1;
452 VOID *ptr2;
453 } twoPtrValue;
454 } internalRep;
455};
456#endif /* USE_TCL_STRUCTS */
457
458/*
459 * Macros to increment and decrement a Tcl_Obj's reference count, and to
460 * test whether an object is shared (i.e. has reference count > 1).
461 * Note: clients should use Tcl_DecrRefCount() when they are finished using
462 * an object, and should never call TclFreeObj() directly. TclFreeObj() is
463 * only defined and made public in tcl.h to support Tcl_DecrRefCount's macro
464 * definition. Note also that Tcl_DecrRefCount() refers to the parameter
465 * "obj" twice. This means that you should avoid calling it with an
466 * expression that is expensive to compute or has side effects.
467 */
468
469#ifdef USE_TCL_STRUCTS
470#define Tcl_IncrRefCount(objPtr) \
471 ++(objPtr)->refCount
472#define Tcl_DecrRefCount(objPtr) \
473 if (--(objPtr)->refCount <= 0) TclFreeObj(objPtr)
474#define Tcl_IsShared(objPtr) \
475 ((objPtr)->refCount > 1)
476
477#else /* USE_TCL_STRUCTS */
478
479/* Fake Tcl_Obj operations */
480
481EXTERN void Tcl_IncrRefCount _ANSI_ARGS_((Tcl_Obj *objPtr));
482EXTERN void Tcl_DecrRefCount _ANSI_ARGS_((Tcl_Obj *objPtr));
483
484#endif /* USE_TCL_STRUCTS */
485
486
487/*
488 * Macros and definitions that help to debug the use of Tcl objects.
489 * When TCL_MEM_DEBUG is defined, the Tcl_New* declarations are
490 * overridden to call debugging versions of the object creation procedures.
491 */
492
493EXTERN Tcl_Obj * Tcl_NewBooleanObj _ANSI_ARGS_((int boolValue));
494EXTERN Tcl_Obj * Tcl_NewDoubleObj _ANSI_ARGS_((double doubleValue));
495EXTERN Tcl_Obj * Tcl_NewIntObj _ANSI_ARGS_((int intValue));
496EXTERN Tcl_Obj * Tcl_NewListObj _ANSI_ARGS_((int objc,
497 Tcl_Obj *CONST objv[]));
498EXTERN Tcl_Obj * Tcl_NewLongObj _ANSI_ARGS_((long longValue));
499EXTERN Tcl_Obj * Tcl_NewObj _ANSI_ARGS_((void));
500EXTERN Tcl_Obj * Tcl_NewStringObj _ANSI_ARGS_((char *bytes,
501 int length));
502
503#ifdef TCL_MEM_DEBUG
504# define Tcl_NewBooleanObj(val) \
505 Tcl_DbNewBooleanObj(val, __FILE__, __LINE__)
506# define Tcl_NewDoubleObj(val) \
507 Tcl_DbNewDoubleObj(val, __FILE__, __LINE__)
508# define Tcl_NewIntObj(val) \
509 Tcl_DbNewLongObj(val, __FILE__, __LINE__)
510# define Tcl_NewListObj(objc, objv) \
511 Tcl_DbNewListObj(objc, objv, __FILE__, __LINE__)
512# define Tcl_NewLongObj(val) \
513 Tcl_DbNewLongObj(val, __FILE__, __LINE__)
514# define Tcl_NewObj() \
515 Tcl_DbNewObj(__FILE__, __LINE__)
516# define Tcl_NewStringObj(bytes, len) \
517 Tcl_DbNewStringObj(bytes, len, __FILE__, __LINE__)
518#endif /* TCL_MEM_DEBUG */
519
520
521/*
522 * The following definitions support Tcl's namespace facility.
523 * Note: the first five fields must match exactly the fields in a
524 * Namespace structure (see tcl.h).
525 */
526
527typedef struct Tcl_Namespace
528#ifdef USE_TCL_STRUCTS
529{
530 char *name; /* The namespace's name within its parent
531 * namespace. This contains no ::'s. The
532 * name of the global namespace is ""
533 * although "::" is an synonym. */
534 char *fullName; /* The namespace's fully qualified name.
535 * This starts with ::. */
536 ClientData clientData; /* Arbitrary value associated with this
537 * namespace. */
538 Tcl_NamespaceDeleteProc* deleteProc;
539 /* Procedure invoked when deleting the
540 * namespace to, e.g., free clientData. */
541 struct Tcl_Namespace* parentPtr;
542 /* Points to the namespace that contains
543 * this one. NULL if this is the global
544 * namespace. */
545}
546#endif /* USE_TCL_STRUCTS */
547Tcl_Namespace;
548
549/*
550 * The following structure represents a call frame, or activation record.
551 * A call frame defines a naming context for a procedure call: its local
552 * scope (for local variables) and its namespace scope (used for non-local
553 * variables; often the global :: namespace). A call frame can also define
554 * the naming context for a namespace eval or namespace inscope command:
555 * the namespace in which the command's code should execute. The
556 * Tcl_CallFrame structures exist only while procedures or namespace
557 * eval/inscope's are being executed, and provide a Tcl call stack.
558 *
559 * A call frame is initialized and pushed using Tcl_PushCallFrame and
560 * popped using Tcl_PopCallFrame. Storage for a Tcl_CallFrame must be
561 * provided by the Tcl_PushCallFrame caller, and callers typically allocate
562 * them on the C call stack for efficiency. For this reason, Tcl_CallFrame
563 * is defined as a structure and not as an opaque token. However, most
564 * Tcl_CallFrame fields are hidden since applications should not access
565 * them directly; others are declared as "dummyX".
566 *
567 * WARNING!! The structure definition must be kept consistent with the
568 * CallFrame structure in tclInt.h. If you change one, change the other.
569 */
570
571typedef struct Tcl_CallFrame {
572 Tcl_Namespace *nsPtr;
573 int dummy1;
574 int dummy2;
575 char *dummy3;
576 char *dummy4;
577 char *dummy5;
578 int dummy6;
579 char *dummy7;
580 char *dummy8;
581 int dummy9;
582 char* dummy10;
583} Tcl_CallFrame;
584
585/*
586 * Information about commands that is returned by Tcl_GetCmdInfo and passed
587 * to Tcl_SetCmdInfo. objProc is an objc/objv object-based command procedure
588 * while proc is a traditional Tcl argc/argv string-based procedure.
589 * Tcl_CreateObjCommand and Tcl_CreateCommand ensure that both objProc and
590 * proc are non-NULL and can be called to execute the command. However,
591 * it may be faster to call one instead of the other. The member
592 * isNativeObjectProc is set to 1 if an object-based procedure was
593 * registered by Tcl_CreateObjCommand, and to 0 if a string-based procedure
594 * was registered by Tcl_CreateCommand. The other procedure is typically set
595 * to a compatibility wrapper that does string-to-object or object-to-string
596 * argument conversions then calls the other procedure.
597 */
598
599typedef struct Tcl_CmdInfo {
600 int isNativeObjectProc; /* 1 if objProc was registered by a call to
601 * Tcl_CreateObjCommand; 0 otherwise.
602 * Tcl_SetCmdInfo does not modify this
603 * field. */
604 Tcl_ObjCmdProc *objProc; /* Command's object-based procedure. */
605 ClientData objClientData; /* ClientData for object proc. */
606 Tcl_CmdProc *proc; /* Command's string-based procedure. */
607 ClientData clientData; /* ClientData for string proc. */
608 Tcl_CmdDeleteProc *deleteProc;
609 /* Procedure to call when command is
610 * deleted. */
611 ClientData deleteData; /* Value to pass to deleteProc (usually
612 * the same as clientData). */
613 Tcl_Namespace *namespacePtr; /* Points to the namespace that contains
614 * this command. Note that Tcl_SetCmdInfo
615 * will not change a command's namespace;
616 * use Tcl_RenameCommand to do that. */
617
618} Tcl_CmdInfo;
619
620/*
621 * The structure defined below is used to hold dynamic strings. The only
622 * field that clients should use is the string field, and they should
623 * never modify it.
624 */
625
626#ifdef USE_TCL_STRUCTS
627#define TCL_DSTRING_STATIC_SIZE 200
628typedef struct Tcl_DString {
629 char *string; /* Points to beginning of string: either
630 * staticSpace below or a malloced array. */
631 int length; /* Number of non-NULL characters in the
632 * string. */
633 int spaceAvl; /* Total number of bytes available for the
634 * string and its terminating NULL char. */
635 char staticSpace[TCL_DSTRING_STATIC_SIZE];
636 /* Space to use in common case where string
637 * is small. */
638} Tcl_DString;
639
640#define Tcl_DStringLength(dsPtr) ((dsPtr)->length)
641#define Tcl_DStringValue(dsPtr) ((dsPtr)->string)
642#define Tcl_DStringTrunc Tcl_DStringSetLength
643
644#else
645#ifndef Tcl_DString
646typedef struct _Tcl_DString *Tcl_DString;
647#endif
648
649EXTERN int Tcl_DStringLength _ANSI_ARGS_((Tcl_DString *dsPtr));
650EXTERN char *Tcl_DStringValue _ANSI_ARGS_((Tcl_DString *dsPtr));
651#define Tcl_DStringTrunc Tcl_DStringSetLength
652
653#endif /* USE_TCL_STRUCTS */
654/*
655 * Definitions for the maximum number of digits of precision that may
656 * be specified in the "tcl_precision" variable, and the number of
657 * characters of buffer space required by Tcl_PrintDouble.
658 */
659
660#define TCL_MAX_PREC 17
661#define TCL_DOUBLE_SPACE (TCL_MAX_PREC+10)
662
663/*
664 * Flag that may be passed to Tcl_ConvertElement to force it not to
665 * output braces (careful! if you change this flag be sure to change
666 * the definitions at the front of tclUtil.c).
667 */
668
669#define TCL_DONT_USE_BRACES 1
670
671/*
672 * Flag that may be passed to Tcl_GetIndexFromObj to force it to disallow
673 * abbreviated strings.
674 */
675
676#define TCL_EXACT 1
677
678/*
679 * Flag values passed to Tcl_RecordAndEval.
680 * WARNING: these bit choices must not conflict with the bit choices
681 * for evalFlag bits in tclInt.h!!
682 */
683
684#define TCL_NO_EVAL 0x10000
685#define TCL_EVAL_GLOBAL 0x20000
686
687/*
688 * Special freeProc values that may be passed to Tcl_SetResult (see
689 * the man page for details):
690 */
691
692#define TCL_VOLATILE ((Tcl_FreeProc *) 1)
693#define TCL_STATIC ((Tcl_FreeProc *) 0)
694#define TCL_DYNAMIC ((Tcl_FreeProc *) 3)
695
696/*
697 * Flag values passed to variable-related procedures.
698 */
699
700#define TCL_GLOBAL_ONLY 1
701#define TCL_NAMESPACE_ONLY 2
702#define TCL_APPEND_VALUE 4
703#define TCL_LIST_ELEMENT 8
704#define TCL_TRACE_READS 0x10
705#define TCL_TRACE_WRITES 0x20
706#define TCL_TRACE_UNSETS 0x40
707#define TCL_TRACE_DESTROYED 0x80
708#define TCL_INTERP_DESTROYED 0x100
709#define TCL_LEAVE_ERR_MSG 0x200
710#define TCL_PARSE_PART1 0x400
711
712/*
713 * Types for linked variables:
714 */
715
716#define TCL_LINK_INT 1
717#define TCL_LINK_DOUBLE 2
718#define TCL_LINK_BOOLEAN 3
719#define TCL_LINK_STRING 4
720#define TCL_LINK_READ_ONLY 0x80
721
722/*
723 * The following declarations either map ckalloc and ckfree to
724 * malloc and free, or they map them to procedures with all sorts
725 * of debugging hooks defined in tclCkalloc.c.
726 */
727
728EXTERN char * Tcl_Alloc _ANSI_ARGS_((unsigned int size));
729EXTERN void Tcl_Free _ANSI_ARGS_((char *ptr));
730EXTERN char * Tcl_Realloc _ANSI_ARGS_((char *ptr,
731 unsigned int size));
732EXTERN char * Tcl_DbCkalloc _ANSI_ARGS_((unsigned int size,char *file,int line));
733EXTERN void Tcl_DbCkfree _ANSI_ARGS_((char *ptr,char *file,int line));
734EXTERN char * Tcl_DbCkrealloc _ANSI_ARGS_((char *ptr,
735 unsigned int size,char *file,int line));
736
737#define TCL_MEM_DEBUG
738#ifdef TCL_MEM_DEBUG
739
740# define Tcl_Alloc(x) Tcl_DbCkalloc(x, __FILE__, __LINE__)
741# define Tcl_Free(x) Tcl_DbCkfree(x, __FILE__, __LINE__)
742# define Tcl_Realloc(x,y) Tcl_DbCkrealloc((x), (y),__FILE__, __LINE__)
743# define ckalloc(x) Tcl_DbCkalloc(x, __FILE__, __LINE__)
744# define ckfree(x) Tcl_DbCkfree(x, __FILE__, __LINE__)
745# define ckrealloc(x,y) Tcl_DbCkrealloc((x), (y),__FILE__, __LINE__)
746
747EXTERN int Tcl_DumpActiveMemory _ANSI_ARGS_((char *fileName));
748EXTERN void Tcl_ValidateAllMemory _ANSI_ARGS_((char *file,
749 int line));
750#else
751
752# if USE_TCLALLOC
753# define ckalloc(x) Tcl_Alloc(x)
754# define ckfree(x) Tcl_Free(x)
755# define ckrealloc(x,y) Tcl_Realloc(x,y)
756# else
757# define ckalloc(x) malloc(x)
758# define ckfree(x) free(x)
759# define ckrealloc(x,y) realloc(x,y)
760# endif
761# define Tcl_DumpActiveMemory(x)
762# define Tcl_ValidateAllMemory(x,y)
763
764#endif /* TCL_MEM_DEBUG */
765
766/*
767 * Forward declaration of Tcl_HashTable. Needed by some C++ compilers
768 * to prevent errors when the forward reference to Tcl_HashTable is
769 * encountered in the Tcl_HashEntry structure.
770 */
771
772#ifdef __cplusplus
773struct Tcl_HashTable;
774#endif
775
776/*
777 * Structure definition for an entry in a hash table. No-one outside
778 * Tcl should access any of these fields directly; use the macros
779 * defined below.
780 */
781
782typedef struct Tcl_HashEntry {
783 struct Tcl_HashEntry *nextPtr; /* Pointer to next entry in this
784 * hash bucket, or NULL for end of
785 * chain. */
786 struct Tcl_HashTable *tablePtr; /* Pointer to table containing entry. */
787 struct Tcl_HashEntry **bucketPtr; /* Pointer to bucket that points to
788 * first entry in this entry's chain:
789 * used for deleting the entry. */
790 ClientData clientData; /* Application stores something here
791 * with Tcl_SetHashValue. */
792 union { /* Key has one of these forms: */
793 char *oneWordValue; /* One-word value for key. */
794 int words[1]; /* Multiple integer words for key.
795 * The actual size will be as large
796 * as necessary for this table's
797 * keys. */
798 char string[4]; /* String for key. The actual size
799 * will be as large as needed to hold
800 * the key. */
801 } key; /* MUST BE LAST FIELD IN RECORD!! */
802} Tcl_HashEntry;
803
804/*
805 * Structure definition for a hash table. Must be in tcl.h so clients
806 * can allocate space for these structures, but clients should never
807 * access any fields in this structure.
808 */
809
810#define TCL_SMALL_HASH_TABLE 4
811typedef struct Tcl_HashTable {
812 Tcl_HashEntry **buckets; /* Pointer to bucket array. Each
813 * element points to first entry in
814 * bucket's hash chain, or NULL. */
815 Tcl_HashEntry *staticBuckets[TCL_SMALL_HASH_TABLE];
816 /* Bucket array used for small tables
817 * (to avoid mallocs and frees). */
818 int numBuckets; /* Total number of buckets allocated
819 * at **bucketPtr. */
820 int numEntries; /* Total number of entries present
821 * in table. */
822 int rebuildSize; /* Enlarge table when numEntries gets
823 * to be this large. */
824 int downShift; /* Shift count used in hashing
825 * function. Designed to use high-
826 * order bits of randomized keys. */
827 int mask; /* Mask value used in hashing
828 * function. */
829 int keyType; /* Type of keys used in this table.
830 * It's either TCL_STRING_KEYS,
831 * TCL_ONE_WORD_KEYS, or an integer
832 * giving the number of ints that
833 * is the size of the key.
834 */
835 Tcl_HashEntry *(*findProc) _ANSI_ARGS_((struct Tcl_HashTable *tablePtr,
836 CONST char *key));
837 Tcl_HashEntry *(*createProc) _ANSI_ARGS_((struct Tcl_HashTable *tablePtr,
838 CONST char *key, int *newPtr));
839} Tcl_HashTable;
840
841/*
842 * Structure definition for information used to keep track of searches
843 * through hash tables:
844 */
845
846typedef struct Tcl_HashSearch {
847 Tcl_HashTable *tablePtr; /* Table being searched. */
848 int nextIndex; /* Index of next bucket to be
849 * enumerated after present one. */
850 Tcl_HashEntry *nextEntryPtr; /* Next entry to be enumerated in the
851 * the current bucket. */
852} Tcl_HashSearch;
853
854/*
855 * Acceptable key types for hash tables:
856 */
857
858#define TCL_STRING_KEYS 0
859#define TCL_ONE_WORD_KEYS 1
860
861/*
862 * Macros for clients to use to access fields of hash entries:
863 */
864
865#define Tcl_GetHashValue(h) ((h)->clientData)
866#define Tcl_SetHashValue(h, value) ((h)->clientData = (ClientData) (value))
867#define Tcl_GetHashKey(tablePtr, h) \
868 ((char *) (((tablePtr)->keyType == TCL_ONE_WORD_KEYS) ? (h)->key.oneWordValue \
869 : (h)->key.string))
870
871/*
872 * Macros to use for clients to use to invoke find and create procedures
873 * for hash tables:
874 */
875
876#define Tcl_FindHashEntry(tablePtr, key) \
877 (*((tablePtr)->findProc))(tablePtr, key)
878#define Tcl_CreateHashEntry(tablePtr, key, newPtr) \
879 (*((tablePtr)->createProc))(tablePtr, key, newPtr)
880
881/*
882 * Flag values to pass to Tcl_DoOneEvent to disable searches
883 * for some kinds of events:
884 */
885
886#define TCL_DONT_WAIT (1<<1)
887#define TCL_WINDOW_EVENTS (1<<2)
888#define TCL_FILE_EVENTS (1<<3)
889#define TCL_TIMER_EVENTS (1<<4)
890#define TCL_IDLE_EVENTS (1<<5) /* WAS 0x10 ???? */
891#define TCL_ALL_EVENTS (~TCL_DONT_WAIT)
892
893/*
894 * The following structure defines a generic event for the Tcl event
895 * system. These are the things that are queued in calls to Tcl_QueueEvent
896 * and serviced later by Tcl_DoOneEvent. There can be many different
897 * kinds of events with different fields, corresponding to window events,
898 * timer events, etc. The structure for a particular event consists of
899 * a Tcl_Event header followed by additional information specific to that
900 * event.
901 */
902
903#if defined(USE_TCL_STRUCTS) || defined(TCL_EVENT_IMPLEMENT)
904
905struct Tcl_Event {
906 Tcl_EventProc *proc; /* Procedure to call to service this event. */
907 struct Tcl_Event *nextPtr; /* Next in list of pending events, or NULL. */
908};
909
910#else
911struct Tcl_Event {
912 void *(*spaceforproc)(void);
913 void *spaceforlink;
914};
915#endif
916
917/*
918 * Positions to pass to Tcl_QueueEvent:
919 */
920
921typedef enum {
922 TCL_QUEUE_TAIL, TCL_QUEUE_HEAD, TCL_QUEUE_MARK
923} Tcl_QueuePosition;
924
925/*
926 * Values to pass to Tcl_SetServiceMode to specify the behavior of notifier
927 * event routines.
928 */
929
930#define TCL_SERVICE_NONE 0
931#define TCL_SERVICE_ALL 1
932
933/*
934 * The following structure keeps is used to hold a time value, either as
935 * an absolute time (the number of seconds from the epoch) or as an
936 * elapsed time. On Unix systems the epoch is Midnight Jan 1, 1970 GMT.
937 * On Macintosh systems the epoch is Midnight Jan 1, 1904 GMT.
938 */
939
940typedef struct Tcl_Time {
941 long sec; /* Seconds. */
942 long usec; /* Microseconds. */
943} Tcl_Time;
944
945/*
946 * Bits to pass to Tcl_CreateFileHandler and Tcl_CreateChannelHandler
947 * to indicate what sorts of events are of interest:
948 */
949
950#define TCL_READABLE (1<<1)
951#define TCL_WRITABLE (1<<2)
952#define TCL_EXCEPTION (1<<3)
953
954/*
955 * Flag values to pass to Tcl_OpenCommandChannel to indicate the
956 * disposition of the stdio handles. TCL_STDIN, TCL_STDOUT, TCL_STDERR,
957 * are also used in Tcl_GetStdChannel.
958 */
959
960#define TCL_STDIN (1<<1)
961#define TCL_STDOUT (1<<2)
962#define TCL_STDERR (1<<3)
963#define TCL_ENFORCE_MODE (1<<4)
964
965/*
966 * Typedefs for the various operations in a channel type:
967 */
968
969typedef int (Tcl_DriverBlockModeProc) _ANSI_ARGS_((
970 ClientData instanceData, int mode));
971typedef int (Tcl_DriverCloseProc) _ANSI_ARGS_((ClientData instanceData,
972 Tcl_Interp *interp));
973typedef int (Tcl_DriverInputProc) _ANSI_ARGS_((ClientData instanceData,
974 char *buf, int toRead, int *errorCodePtr));
975typedef int (Tcl_DriverOutputProc) _ANSI_ARGS_((ClientData instanceData,
976 char *buf, int toWrite, int *errorCodePtr));
977typedef int (Tcl_DriverSeekProc) _ANSI_ARGS_((ClientData instanceData,
978 long offset, int mode, int *errorCodePtr));
979typedef int (Tcl_DriverSetOptionProc) _ANSI_ARGS_((
980 ClientData instanceData, Tcl_Interp *interp,
981 char *optionName, char *value));
982typedef int (Tcl_DriverGetOptionProc) _ANSI_ARGS_((
983 ClientData instanceData, Tcl_Interp *interp,
984 char *optionName, Tcl_DString *dsPtr));
985typedef void (Tcl_DriverWatchProc) _ANSI_ARGS_((
986 ClientData instanceData, int mask));
987typedef int (Tcl_DriverGetHandleProc) _ANSI_ARGS_((
988 ClientData instanceData, int direction,
989 ClientData *handlePtr));
990
991/*
992 * Enum for different end of line translation and recognition modes.
993 */
994
995typedef enum Tcl_EolTranslation {
996 TCL_TRANSLATE_AUTO, /* Eol == \r, \n and \r\n. */
997 TCL_TRANSLATE_CR, /* Eol == \r. */
998 TCL_TRANSLATE_LF, /* Eol == \n. */
999 TCL_TRANSLATE_CRLF /* Eol == \r\n. */
1000} Tcl_EolTranslation;
1001
1002/*
1003 * struct Tcl_ChannelType:
1004 *
1005 * One such structure exists for each type (kind) of channel.
1006 * It collects together in one place all the functions that are
1007 * part of the specific channel type.
1008 */
1009
1010typedef struct Tcl_ChannelType {
1011 char *typeName; /* The name of the channel type in Tcl
1012 * commands. This storage is owned by
1013 * channel type. */
1014 Tcl_DriverBlockModeProc *blockModeProc;
1015 /* Set blocking mode for the
1016 * raw channel. May be NULL. */
1017 Tcl_DriverCloseProc *closeProc; /* Procedure to call to close
1018 * the channel. */
1019 Tcl_DriverInputProc *inputProc; /* Procedure to call for input
1020 * on channel. */
1021 Tcl_DriverOutputProc *outputProc; /* Procedure to call for output
1022 * on channel. */
1023 Tcl_DriverSeekProc *seekProc; /* Procedure to call to seek
1024 * on the channel. May be NULL. */
1025 Tcl_DriverSetOptionProc *setOptionProc;
1026 /* Set an option on a channel. */
1027 Tcl_DriverGetOptionProc *getOptionProc;
1028 /* Get an option from a channel. */
1029 Tcl_DriverWatchProc *watchProc; /* Set up the notifier to watch
1030 * for events on this channel. */
1031 Tcl_DriverGetHandleProc *getHandleProc;
1032 /* Get an OS handle from the channel
1033 * or NULL if not supported. */
1034} Tcl_ChannelType;
1035
1036/*
1037 * The following flags determine whether the blockModeProc above should
1038 * set the channel into blocking or nonblocking mode. They are passed
1039 * as arguments to the blockModeProc procedure in the above structure.
1040 */
1041
1042#define TCL_MODE_BLOCKING 0 /* Put channel into blocking mode. */
1043#define TCL_MODE_NONBLOCKING 1 /* Put channel into nonblocking
1044 * mode. */
1045
1046/*
1047 * Enum for different types of file paths.
1048 */
1049
1050typedef enum Tcl_PathType {
1051 TCL_PATH_ABSOLUTE,
1052 TCL_PATH_RELATIVE,
1053 TCL_PATH_VOLUME_RELATIVE
1054} Tcl_PathType;
1055
1056/*
1057 * Exported Tcl procedures:
1058 */
1059
1060EXTERN void Tcl_AddErrorInfo _ANSI_ARGS_((Tcl_Interp *interp,
1061 char *message));
1062EXTERN void Tcl_AddObjErrorInfo _ANSI_ARGS_((Tcl_Interp *interp,
1063 char *message, int length));
1064EXTERN void Tcl_AllowExceptions _ANSI_ARGS_((Tcl_Interp *interp));
1065EXTERN int Tcl_AppendAllObjTypes _ANSI_ARGS_((
1066 Tcl_Interp *interp, Tcl_Obj *objPtr));
1067EXTERN void Tcl_AppendElement _ANSI_ARGS_((Tcl_Interp *interp,
1068 char *string));
1069EXTERN void Tcl_AppendResult _ANSI_ARGS_(TCL_VARARGS(Tcl_Interp *,interp));
1070EXTERN void Tcl_AppendToObj _ANSI_ARGS_((Tcl_Obj *objPtr,
1071 char *bytes, int length));
1072EXTERN void Tcl_AppendStringsToObj _ANSI_ARGS_(TCL_VARARGS(Tcl_Obj *,interp));
1073EXTERN int Tcl_AppInit _ANSI_ARGS_((Tcl_Interp *interp));
1074EXTERN Tcl_AsyncHandler Tcl_AsyncCreate _ANSI_ARGS_((Tcl_AsyncProc *proc,
1075 ClientData clientData));
1076EXTERN void Tcl_AsyncDelete _ANSI_ARGS_((Tcl_AsyncHandler async));
1077EXTERN int Tcl_AsyncInvoke _ANSI_ARGS_((Tcl_Interp *interp,
1078 int code));
1079EXTERN void Tcl_AsyncMark _ANSI_ARGS_((Tcl_AsyncHandler async));
1080EXTERN int Tcl_AsyncReady _ANSI_ARGS_((void));
1081EXTERN void Tcl_BackgroundError _ANSI_ARGS_((Tcl_Interp *interp));
1082EXTERN char Tcl_Backslash _ANSI_ARGS_((char *src,
1083 int *readPtr));
1084EXTERN int Tcl_BadChannelOption _ANSI_ARGS_((Tcl_Interp *interp,
1085 char *optionName, char *optionList));
1086EXTERN void Tcl_CallWhenDeleted _ANSI_ARGS_((Tcl_Interp *interp,
1087 Tcl_InterpDeleteProc *proc,
1088 ClientData clientData));
1089EXTERN void Tcl_CancelIdleCall _ANSI_ARGS_((Tcl_IdleProc *idleProc,
1090 ClientData clientData));
1091#define Tcl_Ckalloc Tcl_Alloc
1092#define Tcl_Ckfree Tcl_Free
1093#define Tcl_Ckrealloc Tcl_Realloc
1094EXTERN int Tcl_Close _ANSI_ARGS_((Tcl_Interp *interp,
1095 Tcl_Channel chan));
1096EXTERN int Tcl_CommandComplete _ANSI_ARGS_((char *cmd));
1097EXTERN Tcl_Obj *Tcl_Concat _ANSI_ARGS_((int argc, Tcl_Obj **argv));
1098EXTERN Tcl_Obj * Tcl_ConcatObj _ANSI_ARGS_((int objc,
1099 Tcl_Obj *CONST objv[]));
1100EXTERN int Tcl_ConvertCountedElement _ANSI_ARGS_((char *src,
1101 int length, char *dst, int flags));
1102EXTERN int Tcl_ConvertElement _ANSI_ARGS_((char *src,
1103 char *dst, int flags));
1104EXTERN int Tcl_ConvertToType _ANSI_ARGS_((Tcl_Interp *interp,
1105 Tcl_Obj *objPtr, struct Tcl_ObjType *typePtr));
1106EXTERN int Tcl_CreateAlias _ANSI_ARGS_((Tcl_Interp *slave,
1107 char *slaveCmd, Tcl_Interp *target,
1108 char *targetCmd, int argc, char **argv));
1109EXTERN int Tcl_CreateAliasObj _ANSI_ARGS_((Tcl_Interp *slave,
1110 char *slaveCmd, Tcl_Interp *target,
1111 char *targetCmd, int objc,
1112 Tcl_Obj *CONST objv[]));
1113EXTERN Tcl_Channel Tcl_CreateChannel _ANSI_ARGS_((
1114 Tcl_ChannelType *typePtr, char *chanName,
1115 ClientData instanceData, int mask));
1116EXTERN void Tcl_CreateChannelHandler _ANSI_ARGS_((
1117 Tcl_Channel chan, int mask,
1118 Tcl_ChannelProc *proc, ClientData clientData));
1119EXTERN void Tcl_CreateCloseHandler _ANSI_ARGS_((
1120 Tcl_Channel chan, Tcl_CloseProc *proc,
1121 ClientData clientData));
1122EXTERN Tcl_Command Tcl_CreateCommand _ANSI_ARGS_((Tcl_Interp *interp,
1123 char *cmdName, Tcl_CmdProc *proc,
1124 ClientData clientData,
1125 Tcl_CmdDeleteProc *deleteProc));
1126EXTERN void Tcl_CreateEventSource _ANSI_ARGS_((
1127 Tcl_EventSetupProc *setupProc,
1128 Tcl_EventCheckProc *checkProc,
1129 ClientData clientData));
1130EXTERN void Tcl_CreateExitHandler _ANSI_ARGS_((Tcl_ExitProc *proc,
1131 ClientData clientData));
1132EXTERN void Tcl_CreateFileHandler _ANSI_ARGS_((
1133 int fd, int mask, Tcl_FileProc *proc,
1134 ClientData clientData));
1135EXTERN Tcl_Interp * Tcl_CreateInterp _ANSI_ARGS_((void));
1136EXTERN void Tcl_CreateMathFunc _ANSI_ARGS_((Tcl_Interp *interp,
1137 char *name, int numArgs, Tcl_ValueType *argTypes,
1138 Tcl_MathProc *proc, ClientData clientData));
1139EXTERN Tcl_Command Tcl_CreateObjCommand _ANSI_ARGS_((
1140 Tcl_Interp *interp, char *cmdName,
1141 Tcl_ObjCmdProc *proc, ClientData clientData,
1142 Tcl_CmdDeleteProc *deleteProc));
1143EXTERN Tcl_Interp * Tcl_CreateSlave _ANSI_ARGS_((Tcl_Interp *interp,
1144 char *slaveName, int isSafe));
1145EXTERN Tcl_TimerToken Tcl_CreateTimerHandler _ANSI_ARGS_((int milliseconds,
1146 Tcl_TimerProc *proc, ClientData clientData));
1147EXTERN Tcl_Trace Tcl_CreateTrace _ANSI_ARGS_((Tcl_Interp *interp,
1148 int level, Tcl_CmdTraceProc *proc,
1149 ClientData clientData));
1150EXTERN char * Tcl_DbCkalloc _ANSI_ARGS_((unsigned int size,
1151 char *file, int line));
1152EXTERN void Tcl_DbCkfree _ANSI_ARGS_((char *ptr,
1153 char *file, int line));
1154EXTERN char * Tcl_DbCkrealloc _ANSI_ARGS_((char *ptr,
1155 unsigned int size, char *file, int line));
1156EXTERN Tcl_Obj * Tcl_DbNewBooleanObj _ANSI_ARGS_((int boolValue,
1157 char *file, int line));
1158EXTERN Tcl_Obj * Tcl_DbNewDoubleObj _ANSI_ARGS_((double doubleValue,
1159 char *file, int line));
1160EXTERN Tcl_Obj * Tcl_DbNewListObj _ANSI_ARGS_((int objc,
1161 Tcl_Obj *CONST objv[], char *file, int line));
1162EXTERN Tcl_Obj * Tcl_DbNewLongObj _ANSI_ARGS_((long longValue,
1163 char *file, int line));
1164EXTERN Tcl_Obj * Tcl_DbNewObj _ANSI_ARGS_((char *file, int line));
1165EXTERN Tcl_Obj * Tcl_DbNewStringObj _ANSI_ARGS_((char *bytes,
1166 int length, char *file, int line));
1167EXTERN void Tcl_DeleteAssocData _ANSI_ARGS_((Tcl_Interp *interp,
1168 char *name));
1169EXTERN int Tcl_DeleteCommand _ANSI_ARGS_((Tcl_Interp *interp,
1170 char *cmdName));
1171EXTERN int Tcl_DeleteCommandFromToken _ANSI_ARGS_((
1172 Tcl_Interp *interp, Tcl_Command command));
1173EXTERN void Tcl_DeleteChannelHandler _ANSI_ARGS_((
1174 Tcl_Channel chan, Tcl_ChannelProc *proc,
1175 ClientData clientData));
1176EXTERN void Tcl_DeleteCloseHandler _ANSI_ARGS_((
1177 Tcl_Channel chan, Tcl_CloseProc *proc,
1178 ClientData clientData));
1179EXTERN void Tcl_DeleteEvents _ANSI_ARGS_((
1180 Tcl_EventDeleteProc *proc,
1181 ClientData clientData));
1182EXTERN void Tcl_DeleteEventSource _ANSI_ARGS_((
1183 Tcl_EventSetupProc *setupProc,
1184 Tcl_EventCheckProc *checkProc,
1185 ClientData clientData));
1186EXTERN void Tcl_DeleteExitHandler _ANSI_ARGS_((Tcl_ExitProc *proc,
1187 ClientData clientData));
1188EXTERN void Tcl_DeleteFileHandler _ANSI_ARGS_((int fd));
1189EXTERN void Tcl_DeleteHashEntry _ANSI_ARGS_((
1190 Tcl_HashEntry *entryPtr));
1191EXTERN void Tcl_DeleteHashTable _ANSI_ARGS_((
1192 Tcl_HashTable *tablePtr));
1193EXTERN void Tcl_DeleteInterp _ANSI_ARGS_((Tcl_Interp *interp));
1194EXTERN void Tcl_DeleteTimerHandler _ANSI_ARGS_((
1195 Tcl_TimerToken token));
1196EXTERN void Tcl_DeleteTrace _ANSI_ARGS_((Tcl_Interp *interp,
1197 Tcl_Trace trace));
1198EXTERN void Tcl_DetachPids _ANSI_ARGS_((int numPids, Tcl_Pid *pidPtr));
1199EXTERN void Tcl_DontCallWhenDeleted _ANSI_ARGS_((
1200 Tcl_Interp *interp, Tcl_InterpDeleteProc *proc,
1201 ClientData clientData));
1202EXTERN int Tcl_DoOneEvent _ANSI_ARGS_((int flags));
1203EXTERN void Tcl_DoWhenIdle _ANSI_ARGS_((Tcl_IdleProc *proc,
1204 ClientData clientData));
1205EXTERN char * Tcl_DStringAppend _ANSI_ARGS_((Tcl_DString *dsPtr,
1206 char *string, int length));
1207EXTERN char * Tcl_DStringAppendElement _ANSI_ARGS_((
1208 Tcl_DString *dsPtr, char *string));
1209EXTERN void Tcl_DStringEndSublist _ANSI_ARGS_((Tcl_DString *dsPtr));
1210EXTERN void Tcl_DStringFree _ANSI_ARGS_((Tcl_DString *dsPtr));
1211EXTERN void Tcl_DStringGetResult _ANSI_ARGS_((Tcl_Interp *interp,
1212 Tcl_DString *dsPtr));
1213EXTERN void Tcl_DStringInit _ANSI_ARGS_((Tcl_DString *dsPtr));
1214EXTERN void Tcl_DbDStringInit _ANSI_ARGS_((Tcl_DString *dsPtr,char *file,int line));
1215EXTERN void Tcl_DStringResult _ANSI_ARGS_((Tcl_Interp *interp,
1216 Tcl_DString *dsPtr));
1217EXTERN void Tcl_DStringSetLength _ANSI_ARGS_((Tcl_DString *dsPtr,
1218 int length));
1219EXTERN void Tcl_DStringStartSublist _ANSI_ARGS_((
1220 Tcl_DString *dsPtr));
1221EXTERN Tcl_Obj * Tcl_DuplicateObj _ANSI_ARGS_((Tcl_Obj *objPtr));
1222EXTERN int Tcl_Eof _ANSI_ARGS_((Tcl_Channel chan));
1223EXTERN char * Tcl_ErrnoId _ANSI_ARGS_((void));
1224EXTERN char * Tcl_ErrnoMsg _ANSI_ARGS_((int err));
1225EXTERN int Tcl_Eval _ANSI_ARGS_((Tcl_Interp *interp,
1226 char *string));
1227EXTERN int Tcl_EvalFile _ANSI_ARGS_((Tcl_Interp *interp,
1228 char *fileName));
1229EXTERN void Tcl_EventuallyFree _ANSI_ARGS_((ClientData clientData,
1230 Tcl_FreeProc *freeProc));
1231EXTERN int Tcl_EvalObj _ANSI_ARGS_((Tcl_Interp *interp,
1232 Tcl_Obj *objPtr));
1233EXTERN void Tcl_Exit _ANSI_ARGS_((int status));
1234EXTERN int Tcl_ExposeCommand _ANSI_ARGS_((Tcl_Interp *interp,
1235 char *hiddenCmdName, char *cmdName));
1236EXTERN int Tcl_ExprBoolean _ANSI_ARGS_((Tcl_Interp *interp,
1237 char *string, int *ptr));
1238EXTERN int Tcl_ExprBooleanObj _ANSI_ARGS_((Tcl_Interp *interp,
1239 Tcl_Obj *objPtr, int *ptr));
1240EXTERN int Tcl_ExprDouble _ANSI_ARGS_((Tcl_Interp *interp,
1241 char *string, double *ptr));
1242EXTERN int Tcl_ExprDoubleObj _ANSI_ARGS_((Tcl_Interp *interp,
1243 Tcl_Obj *objPtr, double *ptr));
1244EXTERN int Tcl_ExprLong _ANSI_ARGS_((Tcl_Interp *interp,
1245 char *string, long *ptr));
1246EXTERN int Tcl_ExprLongObj _ANSI_ARGS_((Tcl_Interp *interp,
1247 Tcl_Obj *objPtr, long *ptr));
1248EXTERN int Tcl_ExprObj _ANSI_ARGS_((Tcl_Interp *interp,
1249 Tcl_Obj *objPtr, Tcl_Obj **resultPtrPtr));
1250EXTERN int Tcl_ExprString _ANSI_ARGS_((Tcl_Interp *interp,
1251 char *string));
1252EXTERN void Tcl_Finalize _ANSI_ARGS_((void));
1253EXTERN void Tcl_FindExecutable _ANSI_ARGS_((char *argv0));
1254EXTERN Tcl_HashEntry * Tcl_FirstHashEntry _ANSI_ARGS_((
1255 Tcl_HashTable *tablePtr,
1256 Tcl_HashSearch *searchPtr));
1257EXTERN int Tcl_Flush _ANSI_ARGS_((Tcl_Channel chan));
1258EXTERN void TclFreeObj _ANSI_ARGS_((Tcl_Obj *objPtr));
1259EXTERN void Tcl_FreeResult _ANSI_ARGS_((Tcl_Interp *interp));
1260EXTERN int Tcl_GetAlias _ANSI_ARGS_((Tcl_Interp *interp,
1261 char *slaveCmd, Tcl_Interp **targetInterpPtr,
1262 char **targetCmdPtr, int *argcPtr,
1263 char ***argvPtr));
1264EXTERN int Tcl_GetAliasObj _ANSI_ARGS_((Tcl_Interp *interp,
1265 char *slaveCmd, Tcl_Interp **targetInterpPtr,
1266 char **targetCmdPtr, int *objcPtr,
1267 Tcl_Obj ***objv));
1268EXTERN ClientData Tcl_GetAssocData _ANSI_ARGS_((Tcl_Interp *interp,
1269 char *name, Tcl_InterpDeleteProc **procPtr));
1270EXTERN int Tcl_GetBoolean _ANSI_ARGS_((Tcl_Interp *interp,
1271 Tcl_Obj *string, int *boolPtr));
1272EXTERN int Tcl_GetBooleanFromObj _ANSI_ARGS_((
1273 Tcl_Interp *interp, Tcl_Obj *objPtr,
1274 int *boolPtr));
1275EXTERN Tcl_Channel Tcl_GetChannel _ANSI_ARGS_((Tcl_Interp *interp,
1276 char *chanName, int *modePtr));
1277EXTERN int Tcl_GetChannelBufferSize _ANSI_ARGS_((
1278 Tcl_Channel chan));
1279EXTERN int Tcl_GetChannelHandle _ANSI_ARGS_((Tcl_Channel chan,
1280 int direction, ClientData *handlePtr));
1281EXTERN ClientData Tcl_GetChannelInstanceData _ANSI_ARGS_((
1282 Tcl_Channel chan));
1283EXTERN int Tcl_GetChannelMode _ANSI_ARGS_((Tcl_Channel chan));
1284EXTERN char * Tcl_GetChannelName _ANSI_ARGS_((Tcl_Channel chan));
1285EXTERN int Tcl_GetChannelOption _ANSI_ARGS_((Tcl_Interp *interp,
1286 Tcl_Channel chan, char *optionName,
1287 Tcl_DString *dsPtr));
1288EXTERN Tcl_ChannelType * Tcl_GetChannelType _ANSI_ARGS_((Tcl_Channel chan));
1289EXTERN int Tcl_GetCommandInfo _ANSI_ARGS_((Tcl_Interp *interp,
1290 char *cmdName, Tcl_CmdInfo *infoPtr));
1291EXTERN char * Tcl_GetCommandName _ANSI_ARGS_((Tcl_Interp *interp,
1292 Tcl_Command command));
1293EXTERN char * Tcl_GetCwd _ANSI_ARGS_((char *buf, int len));
1294EXTERN int Tcl_GetDouble _ANSI_ARGS_((Tcl_Interp *interp,
1295 Tcl_Obj *string, double *doublePtr));
1296EXTERN int Tcl_GetDoubleFromObj _ANSI_ARGS_((
1297 Tcl_Interp *interp, Tcl_Obj *objPtr,
1298 double *doublePtr));
1299EXTERN int Tcl_GetErrno _ANSI_ARGS_((void));
1300EXTERN int Tcl_GetErrorLine _ANSI_ARGS_((Tcl_Interp *interp));
1301EXTERN char * Tcl_GetHostName _ANSI_ARGS_((void));
1302EXTERN int Tcl_GetIndexFromObj _ANSI_ARGS_((Tcl_Interp *interp,
1303 Tcl_Obj *objPtr, char **tablePtr, char *msg,
1304 int flags, int *indexPtr));
1305EXTERN int Tcl_GetInt _ANSI_ARGS_((Tcl_Interp *interp,
1306 Tcl_Obj *string, int *intPtr));
1307EXTERN int Tcl_GetInterpPath _ANSI_ARGS_((Tcl_Interp *askInterp,
1308 Tcl_Interp *slaveInterp));
1309EXTERN int Tcl_GetIntFromObj _ANSI_ARGS_((Tcl_Interp *interp,
1310 Tcl_Obj *objPtr, int *intPtr));
1311EXTERN int Tcl_GetLongFromObj _ANSI_ARGS_((Tcl_Interp *interp,
1312 Tcl_Obj *objPtr, long *longPtr));
1313EXTERN Tcl_Interp * Tcl_GetMaster _ANSI_ARGS_((Tcl_Interp *interp));
1314EXTERN Tcl_Obj * Tcl_GetObjResult _ANSI_ARGS_((Tcl_Interp *interp));
1315EXTERN Tcl_ObjType * Tcl_GetObjType _ANSI_ARGS_((char *typeName));
1316EXTERN int Tcl_GetOpenFile _ANSI_ARGS_((Tcl_Interp *interp,
1317 Tcl_Obj *string, int write, int checkUsage,
1318 ClientData *filePtr));
1319EXTERN Tcl_Command Tcl_GetOriginalCommand _ANSI_ARGS_((
1320 Tcl_Command command));
1321EXTERN Tcl_PathType Tcl_GetPathType _ANSI_ARGS_((char *path));
1322EXTERN int Tcl_Gets _ANSI_ARGS_((Tcl_Channel chan,
1323 Tcl_DString *dsPtr));
1324EXTERN int Tcl_GetsObj _ANSI_ARGS_((Tcl_Channel chan,
1325 Tcl_Obj *objPtr));
1326EXTERN int Tcl_GetServiceMode _ANSI_ARGS_((void));
1327EXTERN Tcl_Interp * Tcl_GetSlave _ANSI_ARGS_((Tcl_Interp *interp,
1328 char *slaveName));
1329EXTERN Tcl_Channel Tcl_GetStdChannel _ANSI_ARGS_((int type));
1330EXTERN char * Tcl_GetStringFromObj _ANSI_ARGS_((Tcl_Obj *objPtr,
1331 int *lengthPtr));
1332EXTERN char * Tcl_GetStringResult _ANSI_ARGS_((Tcl_Interp *interp));
1333EXTERN Tcl_Obj *Tcl_GetVar _ANSI_ARGS_((Tcl_Interp *interp,
1334 Var varName, int flags));
1335EXTERN Tcl_Obj *Tcl_GetVar2 _ANSI_ARGS_((Tcl_Interp *interp,
1336 Var part1, char *part2, int flags));
1337EXTERN int Tcl_GlobalEval _ANSI_ARGS_((Tcl_Interp *interp,
1338 char *command));
1339EXTERN int Tcl_GlobalEvalObj _ANSI_ARGS_((Tcl_Interp *interp,
1340 Tcl_Obj *objPtr));
1341EXTERN char * Tcl_HashStats _ANSI_ARGS_((Tcl_HashTable *tablePtr));
1342EXTERN int Tcl_HideCommand _ANSI_ARGS_((Tcl_Interp *interp,
1343 char *cmdName, char *hiddenCmdName));
1344EXTERN int Tcl_Init _ANSI_ARGS_((Tcl_Interp *interp));
1345EXTERN void Tcl_InitHashTable _ANSI_ARGS_((Tcl_HashTable *tablePtr,
1346 int keyType));
1347EXTERN void Tcl_InitMemory _ANSI_ARGS_((Tcl_Interp *interp));
1348EXTERN int Tcl_InputBlocked _ANSI_ARGS_((Tcl_Channel chan));
1349EXTERN int Tcl_InputBuffered _ANSI_ARGS_((Tcl_Channel chan));
1350EXTERN int Tcl_InterpDeleted _ANSI_ARGS_((Tcl_Interp *interp));
1351EXTERN int Tcl_IsSafe _ANSI_ARGS_((Tcl_Interp *interp));
1352EXTERN void Tcl_InvalidateStringRep _ANSI_ARGS_((
1353 Tcl_Obj *objPtr));
1354EXTERN char * Tcl_JoinPath _ANSI_ARGS_((int argc, char **argv,
1355 Tcl_DString *resultPtr));
1356EXTERN int Tcl_LinkVar _ANSI_ARGS_((Tcl_Interp *interp,
1357 char *varName, char *addr, int type));
1358EXTERN int Tcl_ListObjAppendList _ANSI_ARGS_((
1359 Tcl_Interp *interp, Tcl_Obj *listPtr,
1360 Tcl_Obj *elemListPtr));
1361EXTERN int Tcl_ListObjAppendElement _ANSI_ARGS_((
1362 Tcl_Interp *interp, Tcl_Obj *listPtr,
1363 Tcl_Obj *objPtr));
1364EXTERN int Tcl_ListObjGetElements _ANSI_ARGS_((
1365 Tcl_Interp *interp, Tcl_Obj *listPtr,
1366 int *objcPtr, Tcl_Obj ***objvPtr));
1367EXTERN int Tcl_ListObjIndex _ANSI_ARGS_((Tcl_Interp *interp,
1368 Tcl_Obj *listPtr, int index,
1369 Tcl_Obj **objPtrPtr));
1370EXTERN int Tcl_ListObjLength _ANSI_ARGS_((Tcl_Interp *interp,
1371 Tcl_Obj *listPtr, int *intPtr));
1372EXTERN int Tcl_ListObjReplace _ANSI_ARGS_((Tcl_Interp *interp,
1373 Tcl_Obj *listPtr, int first, int count,
1374 int objc, Tcl_Obj *CONST objv[]));
1375EXTERN void Tcl_Main _ANSI_ARGS_((int argc, char **argv,
1376 Tcl_AppInitProc *appInitProc));
1377EXTERN Tcl_Channel Tcl_MakeFileChannel _ANSI_ARGS_((ClientData handle,
1378 int mode));
1379EXTERN int Tcl_MakeSafe _ANSI_ARGS_((Tcl_Interp *interp));
1380EXTERN Tcl_Channel Tcl_MakeTcpClientChannel _ANSI_ARGS_((
1381 ClientData tcpSocket));
1382EXTERN Tcl_Obj *Tcl_Merge _ANSI_ARGS_((int argc, Tcl_Obj **argv));
1383EXTERN Tcl_HashEntry * Tcl_NextHashEntry _ANSI_ARGS_((
1384 Tcl_HashSearch *searchPtr));
1385EXTERN void Tcl_NotifyChannel _ANSI_ARGS_((Tcl_Channel channel,
1386 int mask));
1387EXTERN Tcl_Obj * Tcl_ObjGetVar2 _ANSI_ARGS_((Tcl_Interp *interp,
1388 Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr,
1389 int flags));
1390EXTERN Tcl_Obj * Tcl_ObjSetVar2 _ANSI_ARGS_((Tcl_Interp *interp,
1391 Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr,
1392 Tcl_Obj *newValuePtr, int flags));
1393EXTERN Tcl_Channel Tcl_OpenCommandChannel _ANSI_ARGS_((
1394 Tcl_Interp *interp, int argc, char **argv,
1395 int flags));
1396EXTERN Tcl_Channel Tcl_OpenFileChannel _ANSI_ARGS_((Tcl_Interp *interp,
1397 char *fileName, char *modeString,
1398 int permissions));
1399EXTERN Tcl_Channel Tcl_OpenTcpClient _ANSI_ARGS_((Tcl_Interp *interp,
1400 int port, char *address, char *myaddr,
1401 int myport, int async));
1402EXTERN Tcl_Channel Tcl_OpenTcpServer _ANSI_ARGS_((Tcl_Interp *interp,
1403 int port, char *host,
1404 Tcl_TcpAcceptProc *acceptProc,
1405 ClientData callbackData));
1406EXTERN char * Tcl_ParseVar _ANSI_ARGS_((Tcl_Interp *interp,
1407 char *string, char **termPtr));
1408EXTERN int Tcl_PkgProvide _ANSI_ARGS_((Tcl_Interp *interp,
1409 char *name, char *version));
1410EXTERN char * Tcl_PkgRequire _ANSI_ARGS_((Tcl_Interp *interp,
1411 char *name, char *version, int exact));
1412EXTERN char * Tcl_PosixError _ANSI_ARGS_((Tcl_Interp *interp));
1413EXTERN void Tcl_Preserve _ANSI_ARGS_((ClientData data));
1414EXTERN void Tcl_PrintDouble _ANSI_ARGS_((Tcl_Interp *interp,
1415 double value, char *dst));
1416EXTERN int Tcl_PutEnv _ANSI_ARGS_((CONST char *string));
1417EXTERN void Tcl_QueueEvent _ANSI_ARGS_((Tcl_Event *evPtr,
1418 Tcl_QueuePosition position));
1419EXTERN void Tcl_QueueProcEvent _ANSI_ARGS_((Tcl_EventProc *proc,
1420 Tcl_Event *evPtr,
1421 Tcl_QueuePosition position));
1422EXTERN int Tcl_Read _ANSI_ARGS_((Tcl_Channel chan,
1423 char *bufPtr, int toRead));
1424EXTERN void Tcl_ReapDetachedProcs _ANSI_ARGS_((void));
1425EXTERN int Tcl_RecordAndEval _ANSI_ARGS_((Tcl_Interp *interp,
1426 char *cmd, int flags));
1427EXTERN Tcl_RegExp Tcl_RegExpCompile _ANSI_ARGS_((Tcl_Interp *interp,
1428 char *string));
1429EXTERN int Tcl_RegExpExec _ANSI_ARGS_((Tcl_Interp *interp,
1430 Tcl_RegExp regexp, char *string, char *start));
1431EXTERN int Tcl_RegExpMatch _ANSI_ARGS_((Tcl_Interp *interp,
1432 char *string, char *pattern));
1433EXTERN void Tcl_RegExpRange _ANSI_ARGS_((Tcl_RegExp regexp,
1434 int index, char **startPtr, char **endPtr));
1435EXTERN void Tcl_RegisterChannel _ANSI_ARGS_((Tcl_Interp *interp,
1436 Tcl_Channel chan));
1437EXTERN void Tcl_RegisterObjType _ANSI_ARGS_((
1438 Tcl_ObjType *typePtr));
1439EXTERN void Tcl_Release _ANSI_ARGS_((ClientData clientData));
1440EXTERN void Tcl_RestartIdleTimer _ANSI_ARGS_((void));
1441EXTERN void Tcl_ResetResult _ANSI_ARGS_((Tcl_Interp *interp));
1442#define Tcl_Return Tcl_SetResult
1443EXTERN int Tcl_ScanCountedElement _ANSI_ARGS_((char *string,
1444 int length, int *flagPtr));
1445EXTERN int Tcl_ScanElement _ANSI_ARGS_((char *string,
1446 int *flagPtr));
1447EXTERN int Tcl_Seek _ANSI_ARGS_((Tcl_Channel chan,
1448 int offset, int mode));
1449EXTERN int Tcl_ServiceAll _ANSI_ARGS_((void));
1450EXTERN int Tcl_ServiceEvent _ANSI_ARGS_((int flags));
1451EXTERN void Tcl_SetAssocData _ANSI_ARGS_((Tcl_Interp *interp,
1452 char *name, Tcl_InterpDeleteProc *proc,
1453 ClientData clientData));
1454EXTERN void Tcl_SetBooleanObj _ANSI_ARGS_((Tcl_Obj *objPtr,
1455 int boolValue));
1456EXTERN void Tcl_SetChannelBufferSize _ANSI_ARGS_((
1457 Tcl_Channel chan, int sz));
1458EXTERN int Tcl_SetChannelOption _ANSI_ARGS_((
1459 Tcl_Interp *interp, Tcl_Channel chan,
1460 char *optionName, char *newValue));
1461EXTERN int Tcl_SetCommandInfo _ANSI_ARGS_((Tcl_Interp *interp,
1462 char *cmdName, Tcl_CmdInfo *infoPtr));
1463EXTERN void Tcl_SetDoubleObj _ANSI_ARGS_((Tcl_Obj *objPtr,
1464 double doubleValue));
1465EXTERN void Tcl_SetErrno _ANSI_ARGS_((int err));
1466EXTERN void Tcl_SetErrorCode _ANSI_ARGS_(TCL_VARARGS(Tcl_Interp *,interp));
1467EXTERN void Tcl_SetIntObj _ANSI_ARGS_((Tcl_Obj *objPtr,
1468 int intValue));
1469EXTERN void Tcl_SetListObj _ANSI_ARGS_((Tcl_Obj *objPtr,
1470 int objc, Tcl_Obj *CONST objv[]));
1471EXTERN void Tcl_SetLongObj _ANSI_ARGS_((Tcl_Obj *objPtr,
1472 long longValue));
1473EXTERN void Tcl_SetMaxBlockTime _ANSI_ARGS_((Tcl_Time *timePtr));
1474EXTERN void Tcl_SetObjErrorCode _ANSI_ARGS_((Tcl_Interp *interp,
1475 Tcl_Obj *errorObjPtr));
1476EXTERN void Tcl_SetObjLength _ANSI_ARGS_((Tcl_Obj *objPtr,
1477 int length));
1478EXTERN void Tcl_SetObjResult _ANSI_ARGS_((Tcl_Interp *interp,
1479 Tcl_Obj *resultObjPtr));
1480EXTERN void Tcl_SetPanicProc _ANSI_ARGS_((void (*proc)
1481 _ANSI_ARGS_(TCL_VARARGS(char *, format))));
1482EXTERN int Tcl_SetRecursionLimit _ANSI_ARGS_((Tcl_Interp *interp,
1483 int depth));
1484EXTERN void Tcl_SetResult _ANSI_ARGS_((Tcl_Interp *interp,
1485 char *string, Tcl_FreeProc *freeProc));
1486EXTERN int Tcl_SetServiceMode _ANSI_ARGS_((int mode));
1487EXTERN void Tcl_SetStdChannel _ANSI_ARGS_((Tcl_Channel channel,
1488 int type));
1489EXTERN void Tcl_SetStringObj _ANSI_ARGS_((Tcl_Obj *objPtr,
1490 char *bytes, int length));
1491EXTERN void Tcl_SetTimer _ANSI_ARGS_((Tcl_Time *timePtr));
1492EXTERN char * Tcl_SetVar _ANSI_ARGS_((Tcl_Interp *interp,
1493 Var varName, char *newValue, int flags));
1494EXTERN char * Tcl_SetVarArg _ANSI_ARGS_((Tcl_Interp *interp,
1495 Var varName, Tcl_Obj *newValue, int flags));
1496EXTERN char * Tcl_SetVar2 _ANSI_ARGS_((Tcl_Interp *interp,
1497 Var part1, char *part2, char *newValue,
1498 int flags));
1499EXTERN char * Tcl_SignalId _ANSI_ARGS_((int sig));
1500EXTERN char * Tcl_SignalMsg _ANSI_ARGS_((int sig));
1501EXTERN void Tcl_Sleep _ANSI_ARGS_((int ms));
1502EXTERN void Tcl_SourceRCFile _ANSI_ARGS_((Tcl_Interp *interp));
1503EXTERN int Tcl_SplitList _ANSI_ARGS_((Tcl_Interp *interp,
1504 char *list, int *argcPtr, char ***argvPtr));
1505EXTERN void Tcl_SplitPath _ANSI_ARGS_((char *path,
1506 int *argcPtr, char ***argvPtr));
1507EXTERN void Tcl_StaticPackage _ANSI_ARGS_((Tcl_Interp *interp,
1508 char *pkgName, Tcl_PackageInitProc *initProc,
1509 Tcl_PackageInitProc *safeInitProc));
1510EXTERN int Tcl_StringMatch _ANSI_ARGS_((char *string,
1511 char *pattern));
1512EXTERN int Tcl_Tell _ANSI_ARGS_((Tcl_Channel chan));
1513EXTERN int Tcl_TraceVar _ANSI_ARGS_((Tcl_Interp *interp,
1514 Var varName, int flags, Tcl_VarTraceProc *proc,
1515 ClientData clientData));
1516EXTERN int Tcl_TraceVar2 _ANSI_ARGS_((Tcl_Interp *interp,
1517 Var part1, char *part2, int flags,
1518 Tcl_VarTraceProc *proc, ClientData clientData));
1519EXTERN char * Tcl_TranslateFileName _ANSI_ARGS_((Tcl_Interp *interp,
1520 char *name, Tcl_DString *bufferPtr));
1521EXTERN int Tcl_Ungets _ANSI_ARGS_((Tcl_Channel chan, char *str,
1522 int len, int atHead));
1523EXTERN void Tcl_UnlinkVar _ANSI_ARGS_((Tcl_Interp *interp,
1524 char *varName));
1525EXTERN int Tcl_UnregisterChannel _ANSI_ARGS_((Tcl_Interp *interp,
1526 Tcl_Channel chan));
1527EXTERN int Tcl_UnsetVar _ANSI_ARGS_((Tcl_Interp *interp,
1528 char *varName, int flags));
1529EXTERN int Tcl_UnsetVar2 _ANSI_ARGS_((Tcl_Interp *interp,
1530 char *part1, char *part2, int flags));
1531EXTERN void Tcl_UntraceVar _ANSI_ARGS_((Tcl_Interp *interp,
1532 Var varName, int flags, Tcl_VarTraceProc *proc,
1533 ClientData clientData));
1534EXTERN void Tcl_UntraceVar2 _ANSI_ARGS_((Tcl_Interp *interp,
1535 Var part1, char *part2, int flags,
1536 Tcl_VarTraceProc *proc, ClientData clientData));
1537EXTERN void Tcl_UpdateLinkedVar _ANSI_ARGS_((Tcl_Interp *interp,
1538 char *varName));
1539EXTERN int Tcl_UpVar _ANSI_ARGS_((Tcl_Interp *interp,
1540 char *frameName, char *varName,
1541 char *localName, int flags));
1542EXTERN int Tcl_UpVar2 _ANSI_ARGS_((Tcl_Interp *interp,
1543 char *frameName, char *part1, char *part2,
1544 char *localName, int flags));
1545EXTERN int Tcl_VarEval _ANSI_ARGS_(TCL_VARARGS(Tcl_Interp *,interp));
1546EXTERN ClientData Tcl_VarTraceInfo _ANSI_ARGS_((Tcl_Interp *interp,
1547 char *varName, int flags,
1548 Tcl_VarTraceProc *procPtr,
1549 ClientData prevClientData));
1550EXTERN ClientData Tcl_VarTraceInfo2 _ANSI_ARGS_((Tcl_Interp *interp,
1551 char *part1, char *part2, int flags,
1552 Tcl_VarTraceProc *procPtr,
1553 ClientData prevClientData));
1554EXTERN int Tcl_WaitForEvent _ANSI_ARGS_((Tcl_Time *timePtr));
1555EXTERN Tcl_Pid Tcl_WaitPid _ANSI_ARGS_((Tcl_Pid pid, int *statPtr,
1556 int options));
1557EXTERN int Tcl_Write _ANSI_ARGS_((Tcl_Channel chan,
1558 char *s, int slen));
1559EXTERN void Tcl_AppendArg _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *));
1560EXTERN void Tcl_IntResults _ANSI_ARGS_((Tcl_Interp *interp,int,int,...));
1561EXTERN void Tcl_DoubleResults _ANSI_ARGS_((Tcl_Interp *interp,int,int,...));
1562
1563EXTERN int TclIdlePending _ANSI_ARGS_((void));
1564EXTERN int TclServiceIdle _ANSI_ARGS_((void));
1565EXTERN void TclFinalizeCompExecEnv _ANSI_ARGS_((void));
1566EXTERN void TclFinalizeEnvironment _ANSI_ARGS_((void));
1567EXTERN int Tcl_AfterObjCmd _ANSI_ARGS_((ClientData clientData,
1568 Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
1569
1570
1571#define Tcl_GlobalEval(interp,cmd) LangEval(interp,cmd,1)
1572EXTERN char * LangMergeString _ANSI_ARGS_((int argc, Tcl_Obj **args));
1573
1574EXTERN int LangEval _ANSI_ARGS_((Tcl_Interp *interp, char *cmd, int global));
1575
1576EXTERN char *LangString _ANSI_ARGS_((Tcl_Obj *));
1577EXTERN void LangSetString _ANSI_ARGS_((Tcl_Obj **,char *));
1578EXTERN void LangSetDefault _ANSI_ARGS_((Tcl_Obj **,char *));
1579EXTERN void LangSetInt _ANSI_ARGS_((Tcl_Obj **,int));
1580EXTERN void LangSetDouble _ANSI_ARGS_((Tcl_Obj **,double));
1581EXTERN void LangSetObj _ANSI_ARGS_((Tcl_Obj **,Tcl_Obj *));
1582EXTERN void LangOldSetArg _ANSI_ARGS_((Tcl_Obj **,Tcl_Obj *,char *,int));
1583#define LangSetArg(ap,a) LangOldSetArg(ap,a,__FILE__,__LINE__)
1584EXTERN void LangSetVar _ANSI_ARGS_((Tcl_Obj **,Var));
1585
1586EXTERN int LangCmpArg _ANSI_ARGS_((Tcl_Obj *,Tcl_Obj *));
1587EXTERN int LangCmpOpt _ANSI_ARGS_((char *opt,char *arg,size_t length));
1588EXTERN void Lang_OldArgResult _ANSI_ARGS_ ((Tcl_Interp *,Tcl_Obj *,char *,int));
1589EXTERN Tcl_Obj *LangObjArg _ANSI_ARGS_ ((Tcl_Obj *,char *,int));
1590
1591#define LangStringArg(s) Tcl_NewStringObj(s,-1)
1592#define Tcl_ArgResult(interp,obj) Lang_OldArgResult(interp,obj,__FILE__,__LINE__)
1593
1594/* FIXME:
1595 Tk will set freeProc as for Tcl e.g. NULL for statics & UIDs
1596 and to "free" for Tcl_Merge etc.
1597 Non Tk users *may* be able to use it as a guide,
1598 but it is more likely that they will have to use
1599 their own ref counts.
1600 Perhaps Tcl_Merge should set freeProc and/or Tcl's
1601 LangSetString() deliberately malloc() a copy of the string so we don't need
1602 the freeProc
1603*/
1604EXTERN void LangFreeArg _ANSI_ARGS_((Tcl_Obj *,Tcl_FreeProc *freeProc));
1605EXTERN Tcl_Obj *LangCopyArg _ANSI_ARGS_((Tcl_Obj *));
1606
1607EXTERN void LangRestoreResult _ANSI_ARGS_((Tcl_Interp **,LangResultSave *));
1608EXTERN LangResultSave *LangSaveResult _ANSI_ARGS_((Tcl_Interp **));
1609
1610EXTERN void Tcl_SprintfResult _ANSI_ARGS_((Tcl_Interp *,char *,...));
1611EXTERN char *Tcl_GetResult _ANSI_ARGS_((Tcl_Interp *));
1612EXTERN void Tcl_Panic _ANSI_ARGS_((char *,...));
1613#define panic Tcl_Panic
1614
1615
1616EXTERN int LangNull _ANSI_ARGS_((Tcl_Obj *));
1617
1618/* Used to default Menu variable to the label
1619 TCL just strdup's the string so it can be ckfree'ed
1620*/
1621
1622EXTERN int LangStringMatch _ANSI_ARGS_((char *string, Tcl_Obj *match));
1623
1624EXTERN void LangExit _ANSI_ARGS_((int));
1625
1626EXTERN void Tcl_DStringGetResult _ANSI_ARGS_((Tcl_Interp *interp,
1627 Tcl_DString *dsPtr));
1628EXTERN void Tcl_DStringSetLength _ANSI_ARGS_((Tcl_DString *dsPtr,
1629 int length));
1630
1631EXTERN Tcl_RegExp Lang_RegExpCompile _ANSI_ARGS_((Tcl_Interp *interp,
1632 char *string, int fold));
1633EXTERN int Lang_RegExpExec _ANSI_ARGS_((Tcl_Interp *interp,
1634 Tcl_RegExp regexp, char *string, char *start));
1635EXTERN void Tcl_RegExpRange _ANSI_ARGS_((Tcl_RegExp regexp,
1636 int index, char **startPtr, char **endPtr));
1637
1638EXTERN void TclpGetTime _ANSI_ARGS_((Tcl_Time *time));
1639
1640EXTERN void Lang_SetErrorCode _ANSI_ARGS_((Tcl_Interp *interp,char *code));
1641EXTERN char *Lang_GetErrorCode _ANSI_ARGS_((Tcl_Interp *interp));
1642EXTERN char *Lang_GetErrorInfo _ANSI_ARGS_((Tcl_Interp *interp));
1643
1644EXTERN int LangSaveVar _ANSI_ARGS_((Tcl_Interp *,Tcl_Obj *,Var *,int type));
1645EXTERN void LangFreeVar _ANSI_ARGS_((Var));
1646EXTERN Tcl_Obj *Tcl_ResultArg _ANSI_ARGS_((Tcl_Interp *interp));
1647EXTERN Tcl_Obj *LangScalarResult _ANSI_ARGS_((Tcl_Interp *interp));
1648
1649EXTERN void Tcl_WrongNumArgs _ANSI_ARGS_((Tcl_Interp *interp,
1650 int objc, Tcl_Obj *CONST objv[], char *message));
1651
1652EXTERN int Lang_GetStrInt _ANSI_ARGS_((Tcl_Interp *interp,
1653 char *string, int *intPtr));
1654
1655EXTERN int LangEventHook _ANSI_ARGS_((int flags));
1656EXTERN void LangBadFile _ANSI_ARGS_((int fd));
1657EXTERN void Lang_BuildInImages _ANSI_ARGS_((void));
1658EXTERN void Lang_FreeRegExp _ANSI_ARGS_((Tcl_RegExp regexp));
1659EXTERN void * TclCalloc _ANSI_ARGS_((size_t n,size_t s));
1660EXTERN void LangDebug _ANSI_ARGS_((char *fmt,...));
1661EXTERN void LangDumpVec _ANSI_ARGS_((char *tag, int argc, Tcl_Obj **vec));
1662
1663EXTERN void Lang_DeleteObject _ANSI_ARGS_((Tcl_Interp *,Tcl_Command));
1664EXTERN Tcl_Command Lang_CreateObject _ANSI_ARGS_((Tcl_Interp *interp,
1665 char *cmdName, Tcl_CmdProc *proc,
1666 ClientData clientData,
1667 Tcl_CmdDeleteProc *deleteProc));
1668
1669EXTERN int Lang_CallWithArgs _ANSI_ARGS_ ((Tcl_Interp *interp,
1670 char *sub, int argc, Tcl_Obj **argv));
1671
1672#ifndef LangCallback
1673typedef struct LangCallback *LangCallback;
1674#endif
1675
1676EXTERN int LangDoCallback _ANSI_ARGS_((Tcl_Interp *,LangCallback *,int result,int argc,...));
1677EXTERN int LangMethodCall _ANSI_ARGS_((Tcl_Interp *,Tcl_Obj *,char *,int result,int argc,...));
1678
1679EXTERN char *LangLibraryDir _ANSI_ARGS_((void));
1680EXTERN void Lang_SetBinaryResult _ANSI_ARGS_((Tcl_Interp *interp,
1681 char *string, int len, Tcl_FreeProc *freeProc));
1682EXTERN Tcl_CmdProc *LangOptionCommand;
1683
1684EXTERN long Lang_OSHandle _ANSI_ARGS_((int fd));
1685#define TK_LIBRARY LangLibraryDir()
1686#define TclPlatformExit(status) LangExit(status)
1687
1688#ifdef WIN32
1689#ifdef __BORLANDC__
1690#pragma warn -par /* "parameter 'foo' is never used" */
1691#pragma warn -aus /* "'foo' is assigned a value that is never used" */
1692#pragma warn -use /* "'foo' is declared but never used" */
1693#endif
1694
1695#ifdef _MSC_VER
1696#pragma warning(disable:4101 4102 4244 4018)
1697#pragma warning(disable:4133) /* init incompatible for xlib */
1698#endif
1699#endif
1700
1701#if !defined(TCL_EVENT_IMPLEMENT)
1702#include "tkEvent.h"
1703#include "tkEvent.m"
1704#endif
1705
1706#endif /* RESOURCE_INCLUDED */
1707#endif /* _LANG */
1708