1 |
578 |
markom |
/*
|
2 |
|
|
* ------------------------------------------------------------------------
|
3 |
|
|
* PACKAGE: [incr Tcl]
|
4 |
|
|
* DESCRIPTION: Object-Oriented Extensions to Tcl
|
5 |
|
|
*
|
6 |
|
|
* [incr Tcl] provides object-oriented extensions to Tcl, much as
|
7 |
|
|
* C++ provides object-oriented extensions to C. It provides a means
|
8 |
|
|
* of encapsulating related procedures together with their shared data
|
9 |
|
|
* in a local namespace that is hidden from the outside world. It
|
10 |
|
|
* promotes code re-use through inheritance. More than anything else,
|
11 |
|
|
* it encourages better organization of Tcl applications through the
|
12 |
|
|
* object-oriented paradigm, leading to code that is easier to
|
13 |
|
|
* understand and maintain.
|
14 |
|
|
*
|
15 |
|
|
* ADDING [incr Tcl] TO A Tcl-BASED APPLICATION:
|
16 |
|
|
*
|
17 |
|
|
* To add [incr Tcl] facilities to a Tcl application, modify the
|
18 |
|
|
* Tcl_AppInit() routine as follows:
|
19 |
|
|
*
|
20 |
|
|
* 1) Include this header file near the top of the file containing
|
21 |
|
|
* Tcl_AppInit():
|
22 |
|
|
*
|
23 |
|
|
* #include "itcl.h"
|
24 |
|
|
*
|
25 |
|
|
* 2) Within the body of Tcl_AppInit(), add the following lines:
|
26 |
|
|
*
|
27 |
|
|
* if (Itcl_Init(interp) == TCL_ERROR) {
|
28 |
|
|
* return TCL_ERROR;
|
29 |
|
|
* }
|
30 |
|
|
*
|
31 |
|
|
* 3) Link your application with libitcl.a
|
32 |
|
|
*
|
33 |
|
|
* NOTE: An example file "tclAppInit.c" containing the changes shown
|
34 |
|
|
* above is included in this distribution.
|
35 |
|
|
*
|
36 |
|
|
* ========================================================================
|
37 |
|
|
* AUTHOR: Michael J. McLennan
|
38 |
|
|
* Bell Labs Innovations for Lucent Technologies
|
39 |
|
|
* mmclennan@lucent.com
|
40 |
|
|
* http://www.tcltk.com/itcl
|
41 |
|
|
*
|
42 |
|
|
* RCS: $Id: itclInt.h,v 1.1.1.1 2002-01-16 10:24:46 markom Exp $
|
43 |
|
|
* ========================================================================
|
44 |
|
|
* Copyright (c) 1993-1998 Lucent Technologies, Inc.
|
45 |
|
|
* ------------------------------------------------------------------------
|
46 |
|
|
* See the file "license.terms" for information on usage and redistribution
|
47 |
|
|
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
48 |
|
|
*/
|
49 |
|
|
#ifndef ITCLINT_H
|
50 |
|
|
#define ITCLINT_H
|
51 |
|
|
|
52 |
|
|
#include "itcl.h"
|
53 |
|
|
#include "tclInt.h"
|
54 |
|
|
|
55 |
|
|
#ifdef BUILD_itcl
|
56 |
|
|
# undef TCL_STORAGE_CLASS
|
57 |
|
|
# define TCL_STORAGE_CLASS DLLEXPORT
|
58 |
|
|
#endif
|
59 |
|
|
|
60 |
|
|
/*
|
61 |
|
|
* Since the Tcl/Tk distribution doesn't perform any asserts,
|
62 |
|
|
* dynamic loading can fail to find the __assert function.
|
63 |
|
|
* As a workaround, we'll include our own.
|
64 |
|
|
*/
|
65 |
|
|
#undef assert
|
66 |
|
|
#ifdef NDEBUG
|
67 |
|
|
#define assert(EX) ((void)0)
|
68 |
|
|
#else
|
69 |
|
|
EXTERN void Itcl_Assert _ANSI_ARGS_((char *testExpr, char *fileName, int lineNum)
|
70 |
|
|
);
|
71 |
|
|
#if defined(__STDC__)
|
72 |
|
|
#define assert(EX) (void)((EX) || (Itcl_Assert(#EX, __FILE__, __LINE__), 0))
|
73 |
|
|
#else
|
74 |
|
|
#define assert(EX) (void)((EX) || (Itcl_Assert("EX", __FILE__, __LINE__), 0))
|
75 |
|
|
#endif /* __STDC__ */
|
76 |
|
|
#endif /* NDEBUG */
|
77 |
|
|
|
78 |
|
|
|
79 |
|
|
/*
|
80 |
|
|
* Common info for managing all known objects.
|
81 |
|
|
* Each interpreter has one of these data structures stored as
|
82 |
|
|
* clientData in the "itcl" namespace. It is also accessible
|
83 |
|
|
* as associated data via the key ITCL_INTERP_DATA.
|
84 |
|
|
*/
|
85 |
|
|
struct ItclObject;
|
86 |
|
|
typedef struct ItclObjectInfo {
|
87 |
|
|
Tcl_Interp *interp; /* interpreter that manages this info */
|
88 |
|
|
Tcl_HashTable objects; /* list of all known objects */
|
89 |
|
|
|
90 |
|
|
Itcl_Stack transparentFrames; /* stack of call frames that should be
|
91 |
|
|
* treated transparently. When
|
92 |
|
|
* Itcl_EvalMemberCode is invoked in
|
93 |
|
|
* one of these contexts, it does an
|
94 |
|
|
* "uplevel" to get past the transparent
|
95 |
|
|
* frame and back to the calling context. */
|
96 |
|
|
Tcl_HashTable contextFrames; /* object contexts for active call frames */
|
97 |
|
|
|
98 |
|
|
int protection; /* protection level currently in effect */
|
99 |
|
|
|
100 |
|
|
Itcl_Stack cdefnStack; /* stack of class definitions currently
|
101 |
|
|
* being parsed */
|
102 |
|
|
} ItclObjectInfo;
|
103 |
|
|
|
104 |
|
|
#define ITCL_INTERP_DATA "itcl_data"
|
105 |
|
|
|
106 |
|
|
/*
|
107 |
|
|
* Representation for each [incr Tcl] class.
|
108 |
|
|
*/
|
109 |
|
|
typedef struct ItclClass {
|
110 |
|
|
char *name; /* class name */
|
111 |
|
|
char *fullname; /* fully qualified class name */
|
112 |
|
|
Tcl_Interp *interp; /* interpreter that manages this info */
|
113 |
|
|
Tcl_Namespace *namesp; /* namespace representing class scope */
|
114 |
|
|
Tcl_Command accessCmd; /* access command for creating instances */
|
115 |
|
|
|
116 |
|
|
struct ItclObjectInfo *info; /* info about all known objects */
|
117 |
|
|
Itcl_List bases; /* list of base classes */
|
118 |
|
|
Itcl_List derived; /* list of all derived classes */
|
119 |
|
|
Tcl_HashTable heritage; /* table of all base classes. Look up
|
120 |
|
|
* by pointer to class definition. This
|
121 |
|
|
* provides fast lookup for inheritance
|
122 |
|
|
* tests. */
|
123 |
|
|
Tcl_Obj *initCode; /* initialization code for new objs */
|
124 |
|
|
Tcl_HashTable variables; /* definitions for all data members
|
125 |
|
|
in this class. Look up simple string
|
126 |
|
|
names and get back ItclVarDefn* ptrs */
|
127 |
|
|
Tcl_HashTable functions; /* definitions for all member functions
|
128 |
|
|
in this class. Look up simple string
|
129 |
|
|
names and get back ItclMemberFunc* ptrs */
|
130 |
|
|
int numInstanceVars; /* number of instance vars in variables
|
131 |
|
|
table */
|
132 |
|
|
Tcl_HashTable resolveVars; /* all possible names for variables in
|
133 |
|
|
* this class (e.g., x, foo::x, etc.) */
|
134 |
|
|
Tcl_HashTable resolveCmds; /* all possible names for functions in
|
135 |
|
|
* this class (e.g., x, foo::x, etc.) */
|
136 |
|
|
int unique; /* unique number for #auto generation */
|
137 |
|
|
int flags; /* maintains class status */
|
138 |
|
|
} ItclClass;
|
139 |
|
|
|
140 |
|
|
typedef struct ItclHierIter {
|
141 |
|
|
ItclClass *current; /* current position in hierarchy */
|
142 |
|
|
Itcl_Stack stack; /* stack used for traversal */
|
143 |
|
|
} ItclHierIter;
|
144 |
|
|
|
145 |
|
|
/*
|
146 |
|
|
* Representation for each [incr Tcl] object.
|
147 |
|
|
*/
|
148 |
|
|
typedef struct ItclObject {
|
149 |
|
|
ItclClass *classDefn; /* most-specific class */
|
150 |
|
|
Tcl_Command accessCmd; /* object access command */
|
151 |
|
|
|
152 |
|
|
int dataSize; /* number of elements in data array */
|
153 |
|
|
Var** data; /* all object-specific data members */
|
154 |
|
|
Tcl_HashTable* constructed; /* temp storage used during construction */
|
155 |
|
|
Tcl_HashTable* destructed; /* temp storage used during destruction */
|
156 |
|
|
} ItclObject;
|
157 |
|
|
|
158 |
|
|
#define ITCL_IGNORE_ERRS 0x002 /* useful for construction/destruction */
|
159 |
|
|
|
160 |
|
|
/*
|
161 |
|
|
* Implementation for any code body in an [incr Tcl] class.
|
162 |
|
|
*/
|
163 |
|
|
typedef struct ItclMemberCode {
|
164 |
|
|
int flags; /* flags describing implementation */
|
165 |
|
|
CompiledLocal *arglist; /* list of arg names and initial values */
|
166 |
|
|
int argcount; /* number of args in arglist */
|
167 |
|
|
Proc *procPtr; /* Tcl proc representation (needed to
|
168 |
|
|
* handle compiled locals) */
|
169 |
|
|
union {
|
170 |
|
|
Tcl_CmdProc *argCmd; /* (argc,argv) C implementation */
|
171 |
|
|
Tcl_ObjCmdProc *objCmd; /* (objc,objv) C implementation */
|
172 |
|
|
} cfunc;
|
173 |
|
|
|
174 |
|
|
ClientData clientData; /* client data for C implementations */
|
175 |
|
|
|
176 |
|
|
} ItclMemberCode;
|
177 |
|
|
|
178 |
|
|
/*
|
179 |
|
|
* Basic representation for class members (commands/variables)
|
180 |
|
|
*/
|
181 |
|
|
typedef struct ItclMember {
|
182 |
|
|
Tcl_Interp* interp; /* interpreter containing the class */
|
183 |
|
|
ItclClass* classDefn; /* class containing this member */
|
184 |
|
|
char* name; /* member name */
|
185 |
|
|
char* fullname; /* member name with "class::" qualifier */
|
186 |
|
|
int protection; /* protection level */
|
187 |
|
|
int flags; /* flags describing member (see below) */
|
188 |
|
|
ItclMemberCode *code; /* code associated with member */
|
189 |
|
|
} ItclMember;
|
190 |
|
|
|
191 |
|
|
/*
|
192 |
|
|
* Flag bits for ItclMemberCode and ItclMember:
|
193 |
|
|
*/
|
194 |
|
|
#define ITCL_IMPLEMENT_NONE 0x001 /* no implementation */
|
195 |
|
|
#define ITCL_IMPLEMENT_TCL 0x002 /* Tcl implementation */
|
196 |
|
|
#define ITCL_IMPLEMENT_ARGCMD 0x004 /* (argc,argv) C implementation */
|
197 |
|
|
#define ITCL_IMPLEMENT_OBJCMD 0x008 /* (objc,objv) C implementation */
|
198 |
|
|
#define ITCL_IMPLEMENT_C 0x00c /* either kind of C implementation */
|
199 |
|
|
#define ITCL_CONSTRUCTOR 0x010 /* non-zero => is a constructor */
|
200 |
|
|
#define ITCL_DESTRUCTOR 0x020 /* non-zero => is a destructor */
|
201 |
|
|
#define ITCL_COMMON 0x040 /* non-zero => is a "proc" */
|
202 |
|
|
#define ITCL_ARG_SPEC 0x080 /* non-zero => has an argument spec */
|
203 |
|
|
|
204 |
|
|
#define ITCL_OLD_STYLE 0x100 /* non-zero => old-style method
|
205 |
|
|
* (process "config" argument) */
|
206 |
|
|
|
207 |
|
|
#define ITCL_THIS_VAR 0x200 /* non-zero => built-in "this" variable */
|
208 |
|
|
|
209 |
|
|
/*
|
210 |
|
|
* Representation of member functions in an [incr Tcl] class.
|
211 |
|
|
*/
|
212 |
|
|
typedef struct ItclMemberFunc {
|
213 |
|
|
ItclMember *member; /* basic member info */
|
214 |
|
|
Tcl_Command accessCmd; /* Tcl command installed for this function */
|
215 |
|
|
CompiledLocal *arglist; /* list of arg names and initial values */
|
216 |
|
|
int argcount; /* number of args in arglist */
|
217 |
|
|
} ItclMemberFunc;
|
218 |
|
|
|
219 |
|
|
/*
|
220 |
|
|
* Instance variables.
|
221 |
|
|
*/
|
222 |
|
|
typedef struct ItclVarDefn {
|
223 |
|
|
ItclMember *member; /* basic member info */
|
224 |
|
|
char* init; /* initial value */
|
225 |
|
|
} ItclVarDefn;
|
226 |
|
|
|
227 |
|
|
/*
|
228 |
|
|
* Instance variable lookup entry.
|
229 |
|
|
*/
|
230 |
|
|
typedef struct ItclVarLookup {
|
231 |
|
|
ItclVarDefn* vdefn; /* variable definition */
|
232 |
|
|
int usage; /* number of uses for this record */
|
233 |
|
|
int accessible; /* non-zero => accessible from class with
|
234 |
|
|
* this lookup record in its resolveVars */
|
235 |
|
|
char *leastQualName; /* simplist name for this variable, with
|
236 |
|
|
* the fewest qualifiers. This string is
|
237 |
|
|
* taken from the resolveVars table, so
|
238 |
|
|
* it shouldn't be freed. */
|
239 |
|
|
union {
|
240 |
|
|
int index; /* index into virtual table (instance data) */
|
241 |
|
|
Tcl_Var common; /* variable (common data) */
|
242 |
|
|
} var;
|
243 |
|
|
} ItclVarLookup;
|
244 |
|
|
|
245 |
|
|
/*
|
246 |
|
|
* Representation for the context in which a body of [incr Tcl]
|
247 |
|
|
* code executes. In ordinary Tcl, this is a CallFrame. But for
|
248 |
|
|
* [incr Tcl] code bodies, we must be careful to set up the
|
249 |
|
|
* CallFrame properly, to plug in instance variables before
|
250 |
|
|
* executing the code body.
|
251 |
|
|
*/
|
252 |
|
|
typedef struct ItclContext {
|
253 |
|
|
ItclClass *classDefn; /* class definition */
|
254 |
|
|
CallFrame frame; /* call frame for object context */
|
255 |
|
|
Var *compiledLocals; /* points to storage for compiled locals */
|
256 |
|
|
Var localStorage[20]; /* default storage for compiled locals */
|
257 |
|
|
} ItclContext;
|
258 |
|
|
|
259 |
|
|
|
260 |
|
|
/*
|
261 |
|
|
* Functions used within the package, but not considered "public"
|
262 |
|
|
*/
|
263 |
|
|
|
264 |
|
|
EXTERN int Itcl_IsClassNamespace _ANSI_ARGS_((Tcl_Namespace *namesp));
|
265 |
|
|
EXTERN int Itcl_IsClass _ANSI_ARGS_((Tcl_Command cmd));
|
266 |
|
|
EXTERN ItclClass* Itcl_FindClass _ANSI_ARGS_((Tcl_Interp* interp,
|
267 |
|
|
char* path, int autoload));
|
268 |
|
|
|
269 |
|
|
EXTERN int Itcl_FindObject _ANSI_ARGS_((Tcl_Interp *interp,
|
270 |
|
|
char *name, ItclObject **roPtr));
|
271 |
|
|
EXTERN int Itcl_IsObject _ANSI_ARGS_((Tcl_Command cmd));
|
272 |
|
|
EXTERN int Itcl_ObjectIsa _ANSI_ARGS_((ItclObject *contextObj,
|
273 |
|
|
ItclClass *cdefn));
|
274 |
|
|
|
275 |
|
|
|
276 |
|
|
EXTERN int Itcl_Protection _ANSI_ARGS_((Tcl_Interp *interp,
|
277 |
|
|
int newLevel));
|
278 |
|
|
EXTERN char* Itcl_ProtectionStr _ANSI_ARGS_((int pLevel));
|
279 |
|
|
EXTERN int Itcl_CanAccess _ANSI_ARGS_((ItclMember* memberPtr,
|
280 |
|
|
Tcl_Namespace* fromNsPtr));
|
281 |
|
|
EXTERN int Itcl_CanAccessFunc _ANSI_ARGS_((ItclMemberFunc* mfunc,
|
282 |
|
|
Tcl_Namespace* fromNsPtr));
|
283 |
|
|
EXTERN Tcl_Namespace* Itcl_GetTrueNamespace _ANSI_ARGS_((Tcl_Interp *interp,
|
284 |
|
|
ItclObjectInfo *info));
|
285 |
|
|
|
286 |
|
|
EXTERN void Itcl_ParseNamespPath _ANSI_ARGS_((char *name,
|
287 |
|
|
Tcl_DString *buffer, char **head, char **tail));
|
288 |
|
|
EXTERN int Itcl_DecodeScopedCommand _ANSI_ARGS_((Tcl_Interp *interp,
|
289 |
|
|
char *name, Tcl_Namespace **rNsPtr, char **rCmdPtr));
|
290 |
|
|
EXTERN int Itcl_EvalArgs _ANSI_ARGS_((Tcl_Interp *interp, int objc,
|
291 |
|
|
Tcl_Obj *CONST objv[]));
|
292 |
|
|
EXTERN Tcl_Obj* Itcl_CreateArgs _ANSI_ARGS_((Tcl_Interp *interp,
|
293 |
|
|
char *string, int objc, Tcl_Obj *CONST objv[]));
|
294 |
|
|
|
295 |
|
|
EXTERN int Itcl_PushContext _ANSI_ARGS_((Tcl_Interp *interp,
|
296 |
|
|
ItclMember *member, ItclClass *contextClass, ItclObject *contextObj,
|
297 |
|
|
ItclContext *contextPtr));
|
298 |
|
|
EXTERN void Itcl_PopContext _ANSI_ARGS_((Tcl_Interp *interp,
|
299 |
|
|
ItclContext *contextPtr));
|
300 |
|
|
EXTERN int Itcl_GetContext _ANSI_ARGS_((Tcl_Interp *interp,
|
301 |
|
|
ItclClass **cdefnPtr, ItclObject **odefnPtr));
|
302 |
|
|
|
303 |
|
|
EXTERN void Itcl_InitHierIter _ANSI_ARGS_((ItclHierIter *iter,
|
304 |
|
|
ItclClass *cdefn));
|
305 |
|
|
EXTERN void Itcl_DeleteHierIter _ANSI_ARGS_((ItclHierIter *iter));
|
306 |
|
|
EXTERN ItclClass* Itcl_AdvanceHierIter _ANSI_ARGS_((ItclHierIter *iter));
|
307 |
|
|
|
308 |
|
|
EXTERN int Itcl_FindClassesCmd _ANSI_ARGS_((ClientData clientData,
|
309 |
|
|
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
310 |
|
|
EXTERN int Itcl_FindObjectsCmd _ANSI_ARGS_((ClientData clientData,
|
311 |
|
|
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
312 |
|
|
EXTERN int Itcl_ProtectionCmd _ANSI_ARGS_((ClientData clientData,
|
313 |
|
|
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
314 |
|
|
EXTERN int Itcl_DelClassCmd _ANSI_ARGS_((ClientData clientData,
|
315 |
|
|
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
316 |
|
|
EXTERN int Itcl_DelObjectCmd _ANSI_ARGS_((ClientData clientData,
|
317 |
|
|
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
318 |
|
|
EXTERN int Itcl_ScopeCmd _ANSI_ARGS_((ClientData clientData,
|
319 |
|
|
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
320 |
|
|
EXTERN int Itcl_CodeCmd _ANSI_ARGS_((ClientData clientData,
|
321 |
|
|
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
322 |
|
|
EXTERN int Itcl_StubCreateCmd _ANSI_ARGS_((ClientData clientData,
|
323 |
|
|
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
324 |
|
|
EXTERN int Itcl_StubExistsCmd _ANSI_ARGS_((ClientData clientData,
|
325 |
|
|
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
326 |
|
|
EXTERN int Itcl_IsStub _ANSI_ARGS_((Tcl_Command cmd));
|
327 |
|
|
|
328 |
|
|
|
329 |
|
|
/*
|
330 |
|
|
* Functions for manipulating classes
|
331 |
|
|
*/
|
332 |
|
|
EXTERN int Itcl_CreateClass _ANSI_ARGS_((Tcl_Interp* interp, char* path,
|
333 |
|
|
ItclObjectInfo *info, ItclClass **rPtr));
|
334 |
|
|
EXTERN int Itcl_DeleteClass _ANSI_ARGS_((Tcl_Interp *interp,
|
335 |
|
|
ItclClass *cdefnPtr));
|
336 |
|
|
EXTERN Tcl_Namespace* Itcl_FindClassNamespace _ANSI_ARGS_((Tcl_Interp* interp,
|
337 |
|
|
char* path));
|
338 |
|
|
EXTERN int Itcl_HandleClass _ANSI_ARGS_((ClientData clientData,
|
339 |
|
|
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
340 |
|
|
EXTERN int Itcl_ClassCmdResolver _ANSI_ARGS_((Tcl_Interp *interp,
|
341 |
|
|
char* name, Tcl_Namespace *context, int flags, Tcl_Command *rPtr));
|
342 |
|
|
EXTERN int Itcl_ClassVarResolver _ANSI_ARGS_((Tcl_Interp *interp,
|
343 |
|
|
char* name, Tcl_Namespace *context, int flags, Tcl_Var *rPtr));
|
344 |
|
|
EXTERN int Itcl_ClassCompiledVarResolver _ANSI_ARGS_((Tcl_Interp *interp,
|
345 |
|
|
char* name, int length, Tcl_Namespace *context, Tcl_ResolvedVarInfo **rPtr));
|
346 |
|
|
EXTERN void Itcl_BuildVirtualTables _ANSI_ARGS_((ItclClass* cdefnPtr));
|
347 |
|
|
EXTERN int Itcl_CreateVarDefn _ANSI_ARGS_((Tcl_Interp *interp,
|
348 |
|
|
ItclClass* cdefn, char* name, char* init, char* config,
|
349 |
|
|
ItclVarDefn** vdefnPtr));
|
350 |
|
|
EXTERN void Itcl_DeleteVarDefn _ANSI_ARGS_((ItclVarDefn *vdefn));
|
351 |
|
|
EXTERN char* Itcl_GetCommonVar _ANSI_ARGS_((Tcl_Interp *interp,
|
352 |
|
|
char *name, ItclClass *contextClass));
|
353 |
|
|
EXTERN ItclMember* Itcl_CreateMember _ANSI_ARGS_((Tcl_Interp* interp,
|
354 |
|
|
ItclClass *cdefn, char* name));
|
355 |
|
|
EXTERN void Itcl_DeleteMember _ANSI_ARGS_((ItclMember *memPtr));
|
356 |
|
|
|
357 |
|
|
|
358 |
|
|
/*
|
359 |
|
|
* Functions for manipulating objects
|
360 |
|
|
*/
|
361 |
|
|
EXTERN int Itcl_CreateObject _ANSI_ARGS_((Tcl_Interp *interp,
|
362 |
|
|
char* name, ItclClass *cdefn, int objc, Tcl_Obj *CONST objv[],
|
363 |
|
|
ItclObject **roPtr));
|
364 |
|
|
EXTERN int Itcl_DeleteObject _ANSI_ARGS_((Tcl_Interp *interp,
|
365 |
|
|
ItclObject *contextObj));
|
366 |
|
|
EXTERN int Itcl_DestructObject _ANSI_ARGS_((Tcl_Interp *interp,
|
367 |
|
|
ItclObject *contextObj, int flags));
|
368 |
|
|
EXTERN int Itcl_HandleInstance _ANSI_ARGS_((ClientData clientData,
|
369 |
|
|
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
370 |
|
|
EXTERN char* Itcl_GetInstanceVar _ANSI_ARGS_((Tcl_Interp *interp,
|
371 |
|
|
char *name, ItclObject *contextObj, ItclClass *contextClass));
|
372 |
|
|
EXTERN int Itcl_ScopedVarResolver _ANSI_ARGS_((Tcl_Interp *interp,
|
373 |
|
|
char *name, Tcl_Namespace *contextNs, int flags, Tcl_Var *rPtr));
|
374 |
|
|
|
375 |
|
|
|
376 |
|
|
/*
|
377 |
|
|
* Functions for manipulating methods and procs
|
378 |
|
|
*/
|
379 |
|
|
EXTERN int Itcl_BodyCmd _ANSI_ARGS_((ClientData dummy,
|
380 |
|
|
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
381 |
|
|
EXTERN int Itcl_ConfigBodyCmd _ANSI_ARGS_((ClientData dummy,
|
382 |
|
|
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
383 |
|
|
EXTERN int Itcl_CreateMethod _ANSI_ARGS_((Tcl_Interp* interp,
|
384 |
|
|
ItclClass *cdefn, char* name, char* arglist, char* body));
|
385 |
|
|
EXTERN int Itcl_CreateProc _ANSI_ARGS_((Tcl_Interp* interp,
|
386 |
|
|
ItclClass *cdefn, char* name, char* arglist, char* body));
|
387 |
|
|
EXTERN int Itcl_CreateMemberFunc _ANSI_ARGS_((Tcl_Interp* interp,
|
388 |
|
|
ItclClass *cdefn, char* name, char* arglist, char* body,
|
389 |
|
|
ItclMemberFunc** mfuncPtr));
|
390 |
|
|
EXTERN int Itcl_ChangeMemberFunc _ANSI_ARGS_((Tcl_Interp* interp,
|
391 |
|
|
ItclMemberFunc* mfunc, char* arglist, char* body));
|
392 |
|
|
EXTERN void Itcl_DeleteMemberFunc _ANSI_ARGS_((char* cdata));
|
393 |
|
|
EXTERN int Itcl_CreateMemberCode _ANSI_ARGS_((Tcl_Interp* interp,
|
394 |
|
|
ItclClass *cdefn, char* arglist, char* body, ItclMemberCode** mcodePtr));
|
395 |
|
|
EXTERN void Itcl_DeleteMemberCode _ANSI_ARGS_((char* cdata));
|
396 |
|
|
EXTERN int Itcl_GetMemberCode _ANSI_ARGS_((Tcl_Interp* interp,
|
397 |
|
|
ItclMember* member));
|
398 |
|
|
EXTERN int Itcl_CompileMemberCodeBody _ANSI_ARGS_((Tcl_Interp *interp,
|
399 |
|
|
ItclMember *member, char *desc, Tcl_Obj *bodyPtr));
|
400 |
|
|
EXTERN int Itcl_EvalMemberCode _ANSI_ARGS_((Tcl_Interp *interp,
|
401 |
|
|
ItclMemberFunc *mfunc, ItclMember *member, ItclObject *contextObj,
|
402 |
|
|
int objc, Tcl_Obj *CONST objv[]));
|
403 |
|
|
EXTERN int Itcl_CreateArgList _ANSI_ARGS_((Tcl_Interp* interp,
|
404 |
|
|
char* decl, int* argcPtr, CompiledLocal** argPtr));
|
405 |
|
|
EXTERN CompiledLocal* Itcl_CreateArg _ANSI_ARGS_((char* name,
|
406 |
|
|
char* init));
|
407 |
|
|
EXTERN void Itcl_DeleteArgList _ANSI_ARGS_((CompiledLocal *arglist));
|
408 |
|
|
EXTERN Tcl_Obj* Itcl_ArgList _ANSI_ARGS_((int argc, CompiledLocal* arglist));
|
409 |
|
|
EXTERN int Itcl_EquivArgLists _ANSI_ARGS_((CompiledLocal* arg1, int arg1c,
|
410 |
|
|
CompiledLocal* arg2, int arg2c));
|
411 |
|
|
EXTERN void Itcl_GetMemberFuncUsage _ANSI_ARGS_((ItclMemberFunc *mfunc,
|
412 |
|
|
ItclObject *contextObj, Tcl_Obj *objPtr));
|
413 |
|
|
EXTERN int Itcl_ExecMethod _ANSI_ARGS_((ClientData clientData,
|
414 |
|
|
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
415 |
|
|
EXTERN int Itcl_ExecProc _ANSI_ARGS_((ClientData clientData,
|
416 |
|
|
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
417 |
|
|
EXTERN int Itcl_AssignArgs _ANSI_ARGS_((Tcl_Interp *interp,
|
418 |
|
|
int objc, Tcl_Obj *CONST objv[], ItclMemberFunc *mfunc));
|
419 |
|
|
EXTERN int Itcl_ConstructBase _ANSI_ARGS_((Tcl_Interp *interp,
|
420 |
|
|
ItclObject *contextObj, ItclClass *contextClass));
|
421 |
|
|
EXTERN int Itcl_InvokeMethodIfExists _ANSI_ARGS_((Tcl_Interp *interp,
|
422 |
|
|
char *name, ItclClass *contextClass, ItclObject *contextObj,
|
423 |
|
|
int objc, Tcl_Obj *CONST objv[]));
|
424 |
|
|
EXTERN int Itcl_EvalBody _ANSI_ARGS_((Tcl_Interp *interp,
|
425 |
|
|
Tcl_Obj *bodyPtr));
|
426 |
|
|
EXTERN int Itcl_ReportFuncErrors _ANSI_ARGS_((Tcl_Interp* interp,
|
427 |
|
|
ItclMemberFunc *mfunc, ItclObject *contextObj, int result));
|
428 |
|
|
|
429 |
|
|
|
430 |
|
|
/*
|
431 |
|
|
* Commands for parsing class definitions
|
432 |
|
|
*/
|
433 |
|
|
EXTERN int Itcl_ParseInit _ANSI_ARGS_((Tcl_Interp *interp,
|
434 |
|
|
ItclObjectInfo *info));
|
435 |
|
|
EXTERN int Itcl_ClassCmd _ANSI_ARGS_((ClientData clientData,
|
436 |
|
|
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
437 |
|
|
EXTERN int Itcl_ClassInheritCmd _ANSI_ARGS_((ClientData clientData,
|
438 |
|
|
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
439 |
|
|
EXTERN int Itcl_ClassProtectionCmd _ANSI_ARGS_((ClientData clientData,
|
440 |
|
|
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
441 |
|
|
EXTERN int Itcl_ClassConstructorCmd _ANSI_ARGS_((ClientData clientData,
|
442 |
|
|
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
443 |
|
|
EXTERN int Itcl_ClassDestructorCmd _ANSI_ARGS_((ClientData clientData,
|
444 |
|
|
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
445 |
|
|
EXTERN int Itcl_ClassMethodCmd _ANSI_ARGS_((ClientData clientData,
|
446 |
|
|
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
447 |
|
|
EXTERN int Itcl_ClassProcCmd _ANSI_ARGS_((ClientData clientData,
|
448 |
|
|
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
449 |
|
|
EXTERN int Itcl_ClassVariableCmd _ANSI_ARGS_((ClientData clientData,
|
450 |
|
|
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
451 |
|
|
EXTERN int Itcl_ClassCommonCmd _ANSI_ARGS_((ClientData clientData,
|
452 |
|
|
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
453 |
|
|
EXTERN int Itcl_ParseVarResolver _ANSI_ARGS_((Tcl_Interp *interp,
|
454 |
|
|
char* name, Tcl_Namespace *contextNs, int flags, Tcl_Var* rPtr));
|
455 |
|
|
|
456 |
|
|
|
457 |
|
|
/*
|
458 |
|
|
* Commands in the "builtin" namespace
|
459 |
|
|
*/
|
460 |
|
|
EXTERN int Itcl_BiInit _ANSI_ARGS_((Tcl_Interp *interp));
|
461 |
|
|
EXTERN int Itcl_InstallBiMethods _ANSI_ARGS_((Tcl_Interp *interp,
|
462 |
|
|
ItclClass *cdefn));
|
463 |
|
|
EXTERN int Itcl_BiIsaCmd _ANSI_ARGS_((ClientData clientData,
|
464 |
|
|
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
465 |
|
|
EXTERN int Itcl_BiConfigureCmd _ANSI_ARGS_((ClientData clientData,
|
466 |
|
|
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
467 |
|
|
EXTERN int Itcl_BiCgetCmd _ANSI_ARGS_((ClientData clientData,
|
468 |
|
|
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
469 |
|
|
EXTERN int Itcl_BiChainCmd _ANSI_ARGS_((ClientData dummy,
|
470 |
|
|
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
471 |
|
|
EXTERN int Itcl_BiInfoClassCmd _ANSI_ARGS_((ClientData dummy,
|
472 |
|
|
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
473 |
|
|
EXTERN int Itcl_BiInfoInheritCmd _ANSI_ARGS_((ClientData dummy,
|
474 |
|
|
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
475 |
|
|
EXTERN int Itcl_BiInfoHeritageCmd _ANSI_ARGS_((ClientData dummy,
|
476 |
|
|
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
477 |
|
|
EXTERN int Itcl_BiInfoFunctionCmd _ANSI_ARGS_((ClientData dummy,
|
478 |
|
|
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
479 |
|
|
EXTERN int Itcl_BiInfoVariableCmd _ANSI_ARGS_((ClientData dummy,
|
480 |
|
|
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
481 |
|
|
EXTERN int Itcl_BiInfoBodyCmd _ANSI_ARGS_((ClientData dummy,
|
482 |
|
|
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
483 |
|
|
EXTERN int Itcl_BiInfoArgsCmd _ANSI_ARGS_((ClientData dummy,
|
484 |
|
|
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
485 |
|
|
EXTERN int Itcl_DefaultInfoCmd _ANSI_ARGS_((ClientData dummy,
|
486 |
|
|
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
487 |
|
|
|
488 |
|
|
|
489 |
|
|
/*
|
490 |
|
|
* Ensembles
|
491 |
|
|
*/
|
492 |
|
|
EXTERN int Itcl_EnsembleInit _ANSI_ARGS_((Tcl_Interp *interp));
|
493 |
|
|
EXTERN int Itcl_CreateEnsemble _ANSI_ARGS_((Tcl_Interp *interp,
|
494 |
|
|
char* ensName));
|
495 |
|
|
EXTERN int Itcl_AddEnsemblePart _ANSI_ARGS_((Tcl_Interp *interp,
|
496 |
|
|
char* ensName, char* partName, char* usageInfo,
|
497 |
|
|
Tcl_ObjCmdProc *objProc, ClientData clientData,
|
498 |
|
|
Tcl_CmdDeleteProc *deleteProc));
|
499 |
|
|
EXTERN int Itcl_GetEnsemblePart _ANSI_ARGS_((Tcl_Interp *interp,
|
500 |
|
|
char *ensName, char *partName, Tcl_CmdInfo *infoPtr));
|
501 |
|
|
EXTERN int Itcl_IsEnsemble _ANSI_ARGS_((Tcl_CmdInfo* infoPtr));
|
502 |
|
|
EXTERN int Itcl_GetEnsembleUsage _ANSI_ARGS_((Tcl_Interp *interp,
|
503 |
|
|
char *ensName, Tcl_Obj *objPtr));
|
504 |
|
|
EXTERN int Itcl_GetEnsembleUsageForObj _ANSI_ARGS_((Tcl_Interp *interp,
|
505 |
|
|
Tcl_Obj *ensObjPtr, Tcl_Obj *objPtr));
|
506 |
|
|
EXTERN int Itcl_EnsembleCmd _ANSI_ARGS_((ClientData clientData,
|
507 |
|
|
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
508 |
|
|
EXTERN int Itcl_EnsPartCmd _ANSI_ARGS_((ClientData clientData,
|
509 |
|
|
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
510 |
|
|
EXTERN int Itcl_EnsembleErrorCmd _ANSI_ARGS_((ClientData clientData,
|
511 |
|
|
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
512 |
|
|
|
513 |
|
|
|
514 |
|
|
/*
|
515 |
|
|
* Commands provided for backward compatibility
|
516 |
|
|
*/
|
517 |
|
|
EXTERN int Itcl_OldInit _ANSI_ARGS_((Tcl_Interp* interp,
|
518 |
|
|
ItclObjectInfo* info));
|
519 |
|
|
EXTERN int Itcl_InstallOldBiMethods _ANSI_ARGS_((Tcl_Interp *interp,
|
520 |
|
|
ItclClass *cdefn));
|
521 |
|
|
|
522 |
|
|
|
523 |
|
|
/*
|
524 |
|
|
* Things that should be in the Tcl core.
|
525 |
|
|
*/
|
526 |
|
|
EXTERN Tcl_CallFrame* _Tcl_GetCallFrame _ANSI_ARGS_((Tcl_Interp *interp,
|
527 |
|
|
int level));
|
528 |
|
|
EXTERN Tcl_CallFrame* _Tcl_ActivateCallFrame _ANSI_ARGS_((Tcl_Interp *interp,
|
529 |
|
|
Tcl_CallFrame *framePtr));
|
530 |
|
|
EXTERN Var* _TclNewVar _ANSI_ARGS_((void));
|
531 |
|
|
|
532 |
|
|
#undef TCL_STORAGE_CLASS
|
533 |
|
|
#define TCL_STORAGE_CLASS DLLIMPORT
|
534 |
|
|
|
535 |
|
|
#endif /* ITCLINT_H */
|