annotate lib/swig/swigwin-2.0.11/Lib/swigrun.swg @ 2174:5ca3251ea543

autosave continue
author Ritor1
date Tue, 21 Jan 2014 16:37:23 +0600
parents b3009adc0e2f
children
rev   line source
1899
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
1 /* -----------------------------------------------------------------------------
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
2 * swigrun.swg
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
3 *
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
4 * This file contains generic C API SWIG runtime support for pointer
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
5 * type checking.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
6 * ----------------------------------------------------------------------------- */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
7
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
8 /* This should only be incremented when either the layout of swig_type_info changes,
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
9 or for whatever reason, the runtime changes incompatibly */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
10 #define SWIG_RUNTIME_VERSION "4"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
11
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
12 /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
13 #ifdef SWIG_TYPE_TABLE
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
14 # define SWIG_QUOTE_STRING(x) #x
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
15 # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
16 # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
17 #else
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
18 # define SWIG_TYPE_TABLE_NAME
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
19 #endif
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
20
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
21 /*
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
22 You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
23 creating a static or dynamic library from the SWIG runtime code.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
24 In 99.9% of the cases, SWIG just needs to declare them as 'static'.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
25
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
26 But only do this if strictly necessary, ie, if you have problems
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
27 with your compiler or suchlike.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
28 */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
29
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
30 #ifndef SWIGRUNTIME
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
31 # define SWIGRUNTIME SWIGINTERN
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
32 #endif
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
33
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
34 #ifndef SWIGRUNTIMEINLINE
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
35 # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
36 #endif
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
37
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
38 /* Generic buffer size */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
39 #ifndef SWIG_BUFFER_SIZE
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
40 # define SWIG_BUFFER_SIZE 1024
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
41 #endif
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
42
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
43 /* Flags for pointer conversions */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
44 #define SWIG_POINTER_DISOWN 0x1
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
45 #define SWIG_CAST_NEW_MEMORY 0x2
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
46
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
47 /* Flags for new pointer objects */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
48 #define SWIG_POINTER_OWN 0x1
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
49
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
50
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
51 /*
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
52 Flags/methods for returning states.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
53
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
54 The SWIG conversion methods, as ConvertPtr, return an integer
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
55 that tells if the conversion was successful or not. And if not,
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
56 an error code can be returned (see swigerrors.swg for the codes).
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
57
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
58 Use the following macros/flags to set or process the returning
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
59 states.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
60
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
61 In old versions of SWIG, code such as the following was usually written:
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
62
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
63 if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
64 // success code
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
65 } else {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
66 //fail code
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
67 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
68
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
69 Now you can be more explicit:
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
70
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
71 int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
72 if (SWIG_IsOK(res)) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
73 // success code
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
74 } else {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
75 // fail code
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
76 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
77
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
78 which is the same really, but now you can also do
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
79
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
80 Type *ptr;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
81 int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
82 if (SWIG_IsOK(res)) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
83 // success code
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
84 if (SWIG_IsNewObj(res) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
85 ...
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
86 delete *ptr;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
87 } else {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
88 ...
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
89 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
90 } else {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
91 // fail code
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
92 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
93
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
94 I.e., now SWIG_ConvertPtr can return new objects and you can
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
95 identify the case and take care of the deallocation. Of course that
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
96 also requires SWIG_ConvertPtr to return new result values, such as
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
97
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
98 int SWIG_ConvertPtr(obj, ptr,...) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
99 if (<obj is ok>) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
100 if (<need new object>) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
101 *ptr = <ptr to new allocated object>;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
102 return SWIG_NEWOBJ;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
103 } else {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
104 *ptr = <ptr to old object>;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
105 return SWIG_OLDOBJ;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
106 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
107 } else {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
108 return SWIG_BADOBJ;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
109 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
110 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
111
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
112 Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
113 more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
114 SWIG errors code.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
115
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
116 Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
117 allows to return the 'cast rank', for example, if you have this
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
118
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
119 int food(double)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
120 int fooi(int);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
121
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
122 and you call
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
123
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
124 food(1) // cast rank '1' (1 -> 1.0)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
125 fooi(1) // cast rank '0'
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
126
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
127 just use the SWIG_AddCast()/SWIG_CheckState()
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
128 */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
129
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
130 #define SWIG_OK (0)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
131 #define SWIG_ERROR (-1)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
132 #define SWIG_IsOK(r) (r >= 0)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
133 #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
134
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
135 /* The CastRankLimit says how many bits are used for the cast rank */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
136 #define SWIG_CASTRANKLIMIT (1 << 8)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
137 /* The NewMask denotes the object was created (using new/malloc) */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
138 #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
139 /* The TmpMask is for in/out typemaps that use temporal objects */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
140 #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
141 /* Simple returning values */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
142 #define SWIG_BADOBJ (SWIG_ERROR)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
143 #define SWIG_OLDOBJ (SWIG_OK)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
144 #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
145 #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
146 /* Check, add and del mask methods */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
147 #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
148 #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
149 #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
150 #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
151 #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
152 #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
153
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
154 /* Cast-Rank Mode */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
155 #if defined(SWIG_CASTRANK_MODE)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
156 # ifndef SWIG_TypeRank
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
157 # define SWIG_TypeRank unsigned long
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
158 # endif
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
159 # ifndef SWIG_MAXCASTRANK /* Default cast allowed */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
160 # define SWIG_MAXCASTRANK (2)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
161 # endif
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
162 # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
163 # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
164 SWIGINTERNINLINE int SWIG_AddCast(int r) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
165 return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
166 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
167 SWIGINTERNINLINE int SWIG_CheckState(int r) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
168 return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
169 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
170 #else /* no cast-rank mode */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
171 # define SWIG_AddCast(r) (r)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
172 # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
173 #endif
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
174
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
175
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
176 #include <string.h>
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
177
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
178 #ifdef __cplusplus
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
179 extern "C" {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
180 #endif
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
181
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
182 typedef void *(*swig_converter_func)(void *, int *);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
183 typedef struct swig_type_info *(*swig_dycast_func)(void **);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
184
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
185 /* Structure to store information on one type */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
186 typedef struct swig_type_info {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
187 const char *name; /* mangled name of this type */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
188 const char *str; /* human readable name of this type */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
189 swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
190 struct swig_cast_info *cast; /* linked list of types that can cast into this type */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
191 void *clientdata; /* language specific type data */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
192 int owndata; /* flag if the structure owns the clientdata */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
193 } swig_type_info;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
194
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
195 /* Structure to store a type and conversion function used for casting */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
196 typedef struct swig_cast_info {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
197 swig_type_info *type; /* pointer to type that is equivalent to this type */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
198 swig_converter_func converter; /* function to cast the void pointers */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
199 struct swig_cast_info *next; /* pointer to next cast in linked list */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
200 struct swig_cast_info *prev; /* pointer to the previous cast */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
201 } swig_cast_info;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
202
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
203 /* Structure used to store module information
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
204 * Each module generates one structure like this, and the runtime collects
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
205 * all of these structures and stores them in a circularly linked list.*/
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
206 typedef struct swig_module_info {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
207 swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
208 size_t size; /* Number of types in this module */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
209 struct swig_module_info *next; /* Pointer to next element in circularly linked list */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
210 swig_type_info **type_initial; /* Array of initially generated type structures */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
211 swig_cast_info **cast_initial; /* Array of initially generated casting structures */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
212 void *clientdata; /* Language specific module data */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
213 } swig_module_info;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
214
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
215 /*
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
216 Compare two type names skipping the space characters, therefore
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
217 "char*" == "char *" and "Class<int>" == "Class<int >", etc.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
218
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
219 Return 0 when the two name types are equivalent, as in
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
220 strncmp, but skipping ' '.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
221 */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
222 SWIGRUNTIME int
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
223 SWIG_TypeNameComp(const char *f1, const char *l1,
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
224 const char *f2, const char *l2) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
225 for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
226 while ((*f1 == ' ') && (f1 != l1)) ++f1;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
227 while ((*f2 == ' ') && (f2 != l2)) ++f2;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
228 if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
229 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
230 return (int)((l1 - f1) - (l2 - f2));
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
231 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
232
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
233 /*
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
234 Check type equivalence in a name list like <name1>|<name2>|...
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
235 Return 0 if equal, -1 if nb < tb, 1 if nb > tb
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
236 */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
237 SWIGRUNTIME int
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
238 SWIG_TypeCmp(const char *nb, const char *tb) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
239 int equiv = 1;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
240 const char* te = tb + strlen(tb);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
241 const char* ne = nb;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
242 while (equiv != 0 && *ne) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
243 for (nb = ne; *ne; ++ne) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
244 if (*ne == '|') break;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
245 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
246 equiv = SWIG_TypeNameComp(nb, ne, tb, te);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
247 if (*ne) ++ne;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
248 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
249 return equiv;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
250 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
251
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
252 /*
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
253 Check type equivalence in a name list like <name1>|<name2>|...
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
254 Return 0 if not equal, 1 if equal
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
255 */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
256 SWIGRUNTIME int
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
257 SWIG_TypeEquiv(const char *nb, const char *tb) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
258 return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
259 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
260
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
261 /*
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
262 Check the typename
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
263 */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
264 SWIGRUNTIME swig_cast_info *
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
265 SWIG_TypeCheck(const char *c, swig_type_info *ty) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
266 if (ty) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
267 swig_cast_info *iter = ty->cast;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
268 while (iter) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
269 if (strcmp(iter->type->name, c) == 0) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
270 if (iter == ty->cast)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
271 return iter;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
272 /* Move iter to the top of the linked list */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
273 iter->prev->next = iter->next;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
274 if (iter->next)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
275 iter->next->prev = iter->prev;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
276 iter->next = ty->cast;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
277 iter->prev = 0;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
278 if (ty->cast) ty->cast->prev = iter;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
279 ty->cast = iter;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
280 return iter;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
281 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
282 iter = iter->next;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
283 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
284 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
285 return 0;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
286 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
287
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
288 /*
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
289 Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
290 */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
291 SWIGRUNTIME swig_cast_info *
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
292 SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
293 if (ty) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
294 swig_cast_info *iter = ty->cast;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
295 while (iter) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
296 if (iter->type == from) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
297 if (iter == ty->cast)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
298 return iter;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
299 /* Move iter to the top of the linked list */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
300 iter->prev->next = iter->next;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
301 if (iter->next)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
302 iter->next->prev = iter->prev;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
303 iter->next = ty->cast;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
304 iter->prev = 0;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
305 if (ty->cast) ty->cast->prev = iter;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
306 ty->cast = iter;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
307 return iter;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
308 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
309 iter = iter->next;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
310 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
311 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
312 return 0;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
313 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
314
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
315 /*
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
316 Cast a pointer up an inheritance hierarchy
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
317 */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
318 SWIGRUNTIMEINLINE void *
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
319 SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
320 return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
321 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
322
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
323 /*
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
324 Dynamic pointer casting. Down an inheritance hierarchy
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
325 */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
326 SWIGRUNTIME swig_type_info *
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
327 SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
328 swig_type_info *lastty = ty;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
329 if (!ty || !ty->dcast) return ty;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
330 while (ty && (ty->dcast)) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
331 ty = (*ty->dcast)(ptr);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
332 if (ty) lastty = ty;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
333 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
334 return lastty;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
335 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
336
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
337 /*
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
338 Return the name associated with this type
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
339 */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
340 SWIGRUNTIMEINLINE const char *
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
341 SWIG_TypeName(const swig_type_info *ty) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
342 return ty->name;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
343 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
344
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
345 /*
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
346 Return the pretty name associated with this type,
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
347 that is an unmangled type name in a form presentable to the user.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
348 */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
349 SWIGRUNTIME const char *
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
350 SWIG_TypePrettyName(const swig_type_info *type) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
351 /* The "str" field contains the equivalent pretty names of the
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
352 type, separated by vertical-bar characters. We choose
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
353 to print the last name, as it is often (?) the most
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
354 specific. */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
355 if (!type) return NULL;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
356 if (type->str != NULL) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
357 const char *last_name = type->str;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
358 const char *s;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
359 for (s = type->str; *s; s++)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
360 if (*s == '|') last_name = s+1;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
361 return last_name;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
362 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
363 else
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
364 return type->name;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
365 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
366
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
367 /*
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
368 Set the clientdata field for a type
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
369 */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
370 SWIGRUNTIME void
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
371 SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
372 swig_cast_info *cast = ti->cast;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
373 /* if (ti->clientdata == clientdata) return; */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
374 ti->clientdata = clientdata;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
375
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
376 while (cast) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
377 if (!cast->converter) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
378 swig_type_info *tc = cast->type;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
379 if (!tc->clientdata) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
380 SWIG_TypeClientData(tc, clientdata);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
381 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
382 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
383 cast = cast->next;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
384 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
385 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
386 SWIGRUNTIME void
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
387 SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
388 SWIG_TypeClientData(ti, clientdata);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
389 ti->owndata = 1;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
390 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
391
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
392 /*
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
393 Search for a swig_type_info structure only by mangled name
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
394 Search is a O(log #types)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
395
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
396 We start searching at module start, and finish searching when start == end.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
397 Note: if start == end at the beginning of the function, we go all the way around
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
398 the circular list.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
399 */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
400 SWIGRUNTIME swig_type_info *
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
401 SWIG_MangledTypeQueryModule(swig_module_info *start,
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
402 swig_module_info *end,
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
403 const char *name) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
404 swig_module_info *iter = start;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
405 do {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
406 if (iter->size) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
407 register size_t l = 0;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
408 register size_t r = iter->size - 1;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
409 do {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
410 /* since l+r >= 0, we can (>> 1) instead (/ 2) */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
411 register size_t i = (l + r) >> 1;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
412 const char *iname = iter->types[i]->name;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
413 if (iname) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
414 register int compare = strcmp(name, iname);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
415 if (compare == 0) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
416 return iter->types[i];
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
417 } else if (compare < 0) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
418 if (i) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
419 r = i - 1;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
420 } else {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
421 break;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
422 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
423 } else if (compare > 0) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
424 l = i + 1;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
425 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
426 } else {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
427 break; /* should never happen */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
428 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
429 } while (l <= r);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
430 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
431 iter = iter->next;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
432 } while (iter != end);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
433 return 0;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
434 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
435
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
436 /*
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
437 Search for a swig_type_info structure for either a mangled name or a human readable name.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
438 It first searches the mangled names of the types, which is a O(log #types)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
439 If a type is not found it then searches the human readable names, which is O(#types).
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
440
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
441 We start searching at module start, and finish searching when start == end.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
442 Note: if start == end at the beginning of the function, we go all the way around
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
443 the circular list.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
444 */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
445 SWIGRUNTIME swig_type_info *
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
446 SWIG_TypeQueryModule(swig_module_info *start,
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
447 swig_module_info *end,
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
448 const char *name) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
449 /* STEP 1: Search the name field using binary search */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
450 swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
451 if (ret) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
452 return ret;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
453 } else {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
454 /* STEP 2: If the type hasn't been found, do a complete search
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
455 of the str field (the human readable name) */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
456 swig_module_info *iter = start;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
457 do {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
458 register size_t i = 0;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
459 for (; i < iter->size; ++i) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
460 if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
461 return iter->types[i];
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
462 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
463 iter = iter->next;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
464 } while (iter != end);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
465 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
466
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
467 /* neither found a match */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
468 return 0;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
469 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
470
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
471 /*
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
472 Pack binary data into a string
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
473 */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
474 SWIGRUNTIME char *
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
475 SWIG_PackData(char *c, void *ptr, size_t sz) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
476 static const char hex[17] = "0123456789abcdef";
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
477 register const unsigned char *u = (unsigned char *) ptr;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
478 register const unsigned char *eu = u + sz;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
479 for (; u != eu; ++u) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
480 register unsigned char uu = *u;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
481 *(c++) = hex[(uu & 0xf0) >> 4];
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
482 *(c++) = hex[uu & 0xf];
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
483 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
484 return c;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
485 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
486
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
487 /*
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
488 Unpack binary data from a string
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
489 */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
490 SWIGRUNTIME const char *
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
491 SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
492 register unsigned char *u = (unsigned char *) ptr;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
493 register const unsigned char *eu = u + sz;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
494 for (; u != eu; ++u) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
495 register char d = *(c++);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
496 register unsigned char uu;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
497 if ((d >= '0') && (d <= '9'))
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
498 uu = ((d - '0') << 4);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
499 else if ((d >= 'a') && (d <= 'f'))
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
500 uu = ((d - ('a'-10)) << 4);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
501 else
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
502 return (char *) 0;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
503 d = *(c++);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
504 if ((d >= '0') && (d <= '9'))
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
505 uu |= (d - '0');
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
506 else if ((d >= 'a') && (d <= 'f'))
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
507 uu |= (d - ('a'-10));
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
508 else
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
509 return (char *) 0;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
510 *u = uu;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
511 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
512 return c;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
513 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
514
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
515 /*
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
516 Pack 'void *' into a string buffer.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
517 */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
518 SWIGRUNTIME char *
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
519 SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
520 char *r = buff;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
521 if ((2*sizeof(void *) + 2) > bsz) return 0;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
522 *(r++) = '_';
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
523 r = SWIG_PackData(r,&ptr,sizeof(void *));
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
524 if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
525 strcpy(r,name);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
526 return buff;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
527 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
528
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
529 SWIGRUNTIME const char *
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
530 SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
531 if (*c != '_') {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
532 if (strcmp(c,"NULL") == 0) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
533 *ptr = (void *) 0;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
534 return name;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
535 } else {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
536 return 0;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
537 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
538 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
539 return SWIG_UnpackData(++c,ptr,sizeof(void *));
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
540 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
541
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
542 SWIGRUNTIME char *
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
543 SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
544 char *r = buff;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
545 size_t lname = (name ? strlen(name) : 0);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
546 if ((2*sz + 2 + lname) > bsz) return 0;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
547 *(r++) = '_';
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
548 r = SWIG_PackData(r,ptr,sz);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
549 if (lname) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
550 strncpy(r,name,lname+1);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
551 } else {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
552 *r = 0;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
553 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
554 return buff;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
555 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
556
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
557 SWIGRUNTIME const char *
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
558 SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
559 if (*c != '_') {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
560 if (strcmp(c,"NULL") == 0) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
561 memset(ptr,0,sz);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
562 return name;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
563 } else {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
564 return 0;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
565 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
566 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
567 return SWIG_UnpackData(++c,ptr,sz);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
568 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
569
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
570 #ifdef __cplusplus
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
571 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
572 #endif