1/* -----------------------------------------------------------------------------
2 * SWIG API. Portion that goes into the runtime
3 * ----------------------------------------------------------------------------- */
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8/* -----------------------------------------------------------------------------
9 * Constant declarations
10 * ----------------------------------------------------------------------------- */
11
12/* Constant Types */
13#define SWIG_TCL_POINTER 4
14#define SWIG_TCL_BINARY  5
15
16/* Constant information structure */
17typedef struct swig_const_info {
18    int type;
19    char *name;
20    long lvalue;
21    double dvalue;
22    void   *pvalue;
23    swig_type_info **ptype;
24} swig_const_info;
25
26typedef int   (*swig_wrapper)(ClientData, Tcl_Interp *, int, Tcl_Obj *CONST []);
27typedef int   (*swig_wrapper_func)(ClientData, Tcl_Interp *, int, Tcl_Obj *CONST []);
28typedef char *(*swig_variable_func)(ClientData, Tcl_Interp *, char *, char *, int);
29typedef void  (*swig_delete_func)(ClientData);
30
31typedef struct swig_method {
32  const char     *name;
33  swig_wrapper   method;
34} swig_method;
35
36typedef struct swig_attribute {
37  const char     *name;
38  swig_wrapper   getmethod;
39  swig_wrapper   setmethod;
40} swig_attribute;
41
42typedef struct swig_class {
43  const char         *name;
44  swig_type_info   **type;
45  swig_wrapper       constructor;
46  void              (*destructor)(void *);
47  swig_method        *methods;
48  swig_attribute     *attributes;
49  struct swig_class **bases;
50  const char              **base_names;
51  swig_module_info   *module;
52} swig_class;
53
54typedef struct swig_instance {
55  Tcl_Obj       *thisptr;
56  void          *thisvalue;
57  swig_class   *classptr;
58  int            destroy;
59  Tcl_Command    cmdtok;
60} swig_instance;
61
62/* Structure for command table */
63typedef struct {
64  const char *name;
65  int       (*wrapper)(ClientData, Tcl_Interp *, int, Tcl_Obj *CONST []);
66  ClientData  clientdata;
67} swig_command_info;
68
69/* Structure for variable linking table */
70typedef struct {
71  const char *name;
72  void *addr;
73  char * (*get)(ClientData, Tcl_Interp *, char *, char *, int);
74  char * (*set)(ClientData, Tcl_Interp *, char *, char *, int);
75} swig_var_info;
76
77
78/* -----------------------------------------------------------------------------*
79 *  Install a constant object
80 * -----------------------------------------------------------------------------*/
81
82static Tcl_HashTable   swigconstTable;
83static int             swigconstTableinit = 0;
84
85SWIGINTERN void
86SWIG_Tcl_SetConstantObj(Tcl_Interp *interp, const char* name, Tcl_Obj *obj) {
87  int newobj;
88  Tcl_ObjSetVar2(interp,Tcl_NewStringObj(name,-1), NULL, obj, TCL_GLOBAL_ONLY);
89  Tcl_SetHashValue(Tcl_CreateHashEntry(&swigconstTable, name, &newobj), (ClientData) obj);
90}
91
92SWIGINTERN Tcl_Obj *
93SWIG_Tcl_GetConstantObj(const char *key) {
94  Tcl_HashEntry *entryPtr;
95  if (!swigconstTableinit) return 0;
96  entryPtr = Tcl_FindHashEntry(&swigconstTable, key);
97  if (entryPtr) {
98    return (Tcl_Obj *) Tcl_GetHashValue(entryPtr);
99  }
100  return 0;
101}
102
103#ifdef __cplusplus
104}
105#endif
106
107
108