]>
Commit | Line | Data |
---|---|---|
98fb9b71 RD |
1 | /* ---------------------------------------------------------------------------- |
2 | * This file was automatically generated by SWIG (http://www.swig.org). | |
d7f82584 | 3 | * Version 1.3.22 |
98fb9b71 RD |
4 | * |
5 | * This file is not intended to be easily readable and contains a number of | |
6 | * coding conventions designed to improve portability and efficiency. Do not make | |
7 | * changes to this file unless you know what you are doing--modify the SWIG | |
8 | * interface file instead. | |
9 | * ----------------------------------------------------------------------------- */ | |
10 | ||
11 | #define SWIGPYTHON | |
12 | ||
13 | #define SWIG_GLOBAL 1 | |
14 | ||
15 | ||
16 | #include "Python.h" | |
17 | ||
d14a1e28 RD |
18 | /*************************************************************** -*- c -*- |
19 | * python/precommon.swg | |
20 | * | |
21 | * Rename all exported symbols from common.swg, to avoid symbol | |
22 | * clashes if multiple interpreters are included | |
23 | * | |
24 | ************************************************************************/ | |
25 | ||
26 | #define SWIG_TypeRegister SWIG_Python_TypeRegister | |
27 | #define SWIG_TypeCheck SWIG_Python_TypeCheck | |
28 | #define SWIG_TypeCast SWIG_Python_TypeCast | |
29 | #define SWIG_TypeDynamicCast SWIG_Python_TypeDynamicCast | |
30 | #define SWIG_TypeName SWIG_Python_TypeName | |
0190c472 | 31 | #define SWIG_TypePrettyName SWIG_Python_TypePrettyName |
d14a1e28 RD |
32 | #define SWIG_TypeQuery SWIG_Python_TypeQuery |
33 | #define SWIG_TypeClientData SWIG_Python_TypeClientData | |
1de47c7c RD |
34 | #define SWIG_PackData SWIG_Python_PackData |
35 | #define SWIG_UnpackData SWIG_Python_UnpackData | |
36 | ||
d14a1e28 | 37 | |
6bddd8c5 | 38 | /*********************************************************************** |
d14a1e28 RD |
39 | * common.swg |
40 | * | |
41 | * This file contains generic SWIG runtime support for pointer | |
42 | * type checking as well as a few commonly used macros to control | |
43 | * external linkage. | |
6bddd8c5 | 44 | * |
d14a1e28 RD |
45 | * Author : David Beazley (beazley@cs.uchicago.edu) |
46 | * | |
47 | * Copyright (c) 1999-2000, The University of Chicago | |
48 | * | |
49 | * This file may be freely redistributed without license or fee provided | |
50 | * this copyright message remains intact. | |
6bddd8c5 RD |
51 | ************************************************************************/ |
52 | ||
185d7c3e | 53 | #include <string.h> |
d14a1e28 | 54 | |
98fb9b71 RD |
55 | #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) |
56 | # if defined(_MSC_VER) || defined(__GNUC__) | |
57 | # if defined(STATIC_LINKED) | |
58 | # define SWIGEXPORT(a) a | |
59 | # define SWIGIMPORT(a) extern a | |
60 | # else | |
61 | # define SWIGEXPORT(a) __declspec(dllexport) a | |
62 | # define SWIGIMPORT(a) extern a | |
63 | # endif | |
64 | # else | |
65 | # if defined(__BORLANDC__) | |
66 | # define SWIGEXPORT(a) a _export | |
67 | # define SWIGIMPORT(a) a _export | |
68 | # else | |
69 | # define SWIGEXPORT(a) a | |
70 | # define SWIGIMPORT(a) a | |
71 | # endif | |
72 | # endif | |
d14a1e28 | 73 | #else |
98fb9b71 RD |
74 | # define SWIGEXPORT(a) a |
75 | # define SWIGIMPORT(a) a | |
d14a1e28 RD |
76 | #endif |
77 | ||
78 | #ifdef SWIG_GLOBAL | |
98fb9b71 | 79 | # define SWIGRUNTIME(a) SWIGEXPORT(a) |
d14a1e28 | 80 | #else |
98fb9b71 | 81 | # define SWIGRUNTIME(a) static a |
d14a1e28 | 82 | #endif |
185d7c3e | 83 | |
6bddd8c5 RD |
84 | #ifdef __cplusplus |
85 | extern "C" { | |
86 | #endif | |
6bddd8c5 | 87 | |
d14a1e28 RD |
88 | typedef void *(*swig_converter_func)(void *); |
89 | typedef struct swig_type_info *(*swig_dycast_func)(void **); | |
90 | ||
91 | typedef struct swig_type_info { | |
98fb9b71 | 92 | const char *name; |
d14a1e28 RD |
93 | swig_converter_func converter; |
94 | const char *str; | |
98fb9b71 | 95 | void *clientdata; |
d14a1e28 RD |
96 | swig_dycast_func dcast; |
97 | struct swig_type_info *next; | |
98 | struct swig_type_info *prev; | |
99 | } swig_type_info; | |
100 | ||
101 | #ifdef SWIG_NOINCLUDE | |
102 | ||
103 | SWIGIMPORT(swig_type_info *) SWIG_TypeRegister(swig_type_info *); | |
104 | SWIGIMPORT(swig_type_info *) SWIG_TypeCheck(char *c, swig_type_info *); | |
105 | SWIGIMPORT(void *) SWIG_TypeCast(swig_type_info *, void *); | |
106 | SWIGIMPORT(swig_type_info *) SWIG_TypeDynamicCast(swig_type_info *, void **); | |
107 | SWIGIMPORT(const char *) SWIG_TypeName(const swig_type_info *); | |
0190c472 | 108 | SWIGIMPORT(const char *) SWIG_TypePrettyName(const swig_type_info *); |
d14a1e28 RD |
109 | SWIGIMPORT(swig_type_info *) SWIG_TypeQuery(const char *); |
110 | SWIGIMPORT(void) SWIG_TypeClientData(swig_type_info *, void *); | |
98fb9b71 RD |
111 | SWIGIMPORT(char *) SWIG_PackData(char *, void *, int); |
112 | SWIGIMPORT(char *) SWIG_UnpackData(char *, void *, int); | |
d14a1e28 | 113 | |
6bddd8c5 | 114 | #else |
d14a1e28 RD |
115 | |
116 | static swig_type_info *swig_type_list = 0; | |
0190c472 | 117 | static swig_type_info **swig_type_list_handle = &swig_type_list; |
d14a1e28 RD |
118 | |
119 | /* Register a type mapping with the type-checking */ | |
120 | SWIGRUNTIME(swig_type_info *) | |
98fb9b71 | 121 | SWIG_TypeRegister(swig_type_info *ti) { |
d14a1e28 RD |
122 | swig_type_info *tc, *head, *ret, *next; |
123 | /* Check to see if this type has already been registered */ | |
0190c472 | 124 | tc = *swig_type_list_handle; |
d14a1e28 RD |
125 | while (tc) { |
126 | if (strcmp(tc->name, ti->name) == 0) { | |
127 | /* Already exists in the table. Just add additional types to the list */ | |
98fb9b71 | 128 | if (tc->clientdata) ti->clientdata = tc->clientdata; |
d14a1e28 RD |
129 | head = tc; |
130 | next = tc->next; | |
131 | goto l1; | |
132 | } | |
133 | tc = tc->prev; | |
134 | } | |
135 | head = ti; | |
136 | next = 0; | |
137 | ||
138 | /* Place in list */ | |
0190c472 RD |
139 | ti->prev = *swig_type_list_handle; |
140 | *swig_type_list_handle = ti; | |
d14a1e28 RD |
141 | |
142 | /* Build linked lists */ | |
98fb9b71 | 143 | l1: |
d14a1e28 RD |
144 | ret = head; |
145 | tc = ti + 1; | |
146 | /* Patch up the rest of the links */ | |
147 | while (tc->name) { | |
148 | head->next = tc; | |
149 | tc->prev = head; | |
150 | head = tc; | |
151 | tc++; | |
152 | } | |
98fb9b71 | 153 | if (next) next->prev = head; |
d14a1e28 RD |
154 | head->next = next; |
155 | return ret; | |
156 | } | |
157 | ||
158 | /* Check the typename */ | |
159 | SWIGRUNTIME(swig_type_info *) | |
98fb9b71 | 160 | SWIG_TypeCheck(char *c, swig_type_info *ty) { |
d14a1e28 RD |
161 | swig_type_info *s; |
162 | if (!ty) return 0; /* Void pointer */ | |
163 | s = ty->next; /* First element always just a name */ | |
164 | do { | |
165 | if (strcmp(s->name,c) == 0) { | |
166 | if (s == ty->next) return s; | |
167 | /* Move s to the top of the linked list */ | |
168 | s->prev->next = s->next; | |
169 | if (s->next) { | |
98fb9b71 | 170 | s->next->prev = s->prev; |
d14a1e28 RD |
171 | } |
172 | /* Insert s as second element in the list */ | |
173 | s->next = ty->next; | |
174 | if (ty->next) ty->next->prev = s; | |
175 | ty->next = s; | |
98fb9b71 | 176 | s->prev = ty; |
d14a1e28 RD |
177 | return s; |
178 | } | |
179 | s = s->next; | |
180 | } while (s && (s != ty->next)); | |
181 | return 0; | |
182 | } | |
183 | ||
184 | /* Cast a pointer up an inheritance hierarchy */ | |
185 | SWIGRUNTIME(void *) | |
98fb9b71 | 186 | SWIG_TypeCast(swig_type_info *ty, void *ptr) { |
d14a1e28 RD |
187 | if ((!ty) || (!ty->converter)) return ptr; |
188 | return (*ty->converter)(ptr); | |
189 | } | |
190 | ||
191 | /* Dynamic pointer casting. Down an inheritance hierarchy */ | |
192 | SWIGRUNTIME(swig_type_info *) | |
98fb9b71 | 193 | SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { |
d14a1e28 RD |
194 | swig_type_info *lastty = ty; |
195 | if (!ty || !ty->dcast) return ty; | |
196 | while (ty && (ty->dcast)) { | |
98fb9b71 RD |
197 | ty = (*ty->dcast)(ptr); |
198 | if (ty) lastty = ty; | |
d14a1e28 RD |
199 | } |
200 | return lastty; | |
201 | } | |
202 | ||
203 | /* Return the name associated with this type */ | |
204 | SWIGRUNTIME(const char *) | |
205 | SWIG_TypeName(const swig_type_info *ty) { | |
206 | return ty->name; | |
207 | } | |
208 | ||
0190c472 RD |
209 | /* Return the pretty name associated with this type, |
210 | that is an unmangled type name in a form presentable to the user. | |
211 | */ | |
212 | SWIGRUNTIME(const char *) | |
213 | SWIG_TypePrettyName(const swig_type_info *type) { | |
214 | /* The "str" field contains the equivalent pretty names of the | |
215 | type, separated by vertical-bar characters. We choose | |
216 | to print the last name, as it is often (?) the most | |
217 | specific. */ | |
218 | if (type->str != NULL) { | |
219 | const char *last_name = type->str; | |
220 | const char *s; | |
221 | for (s = type->str; *s; s++) | |
222 | if (*s == '|') last_name = s+1; | |
223 | return last_name; | |
224 | } | |
225 | else | |
226 | return type->name; | |
227 | } | |
228 | ||
3a0a61b0 RD |
229 | /* |
230 | Compare two type names skipping the space characters, therefore | |
231 | "char*" == "char *" and "Class<int>" == "Class<int >", etc. | |
232 | ||
233 | Return 0 when the two name types are equivalent, as in | |
234 | strncmp, but skipping ' '. | |
235 | */ | |
236 | static int | |
237 | SWIG_TypeNameComp(const char *f1, const char *l1, | |
238 | const char *f2, const char *l2) { | |
239 | for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) { | |
240 | while ((*f1 == ' ') && (f1 != l1)) ++f1; | |
241 | while ((*f2 == ' ') && (f2 != l2)) ++f2; | |
242 | if (*f1 != *f2) return *f1 - *f2; | |
243 | } | |
244 | return (l1 - f1) - (l2 - f2); | |
245 | } | |
246 | ||
247 | /* | |
248 | Check type equivalence in a name list like <name1>|<name2>|... | |
249 | */ | |
250 | static int | |
251 | SWIG_TypeEquiv(const char *nb, const char *tb) { | |
252 | int equiv = 0; | |
253 | const char* te = tb + strlen(tb); | |
254 | const char* ne = nb; | |
255 | while (!equiv && *ne) { | |
256 | for (nb = ne; *ne; ++ne) { | |
257 | if (*ne == '|') break; | |
258 | } | |
259 | equiv = SWIG_TypeNameComp(nb, ne, tb, te) == 0; | |
260 | if (*ne) ++ne; | |
261 | } | |
262 | return equiv; | |
263 | } | |
264 | ||
265 | ||
d14a1e28 RD |
266 | /* Search for a swig_type_info structure */ |
267 | SWIGRUNTIME(swig_type_info *) | |
268 | SWIG_TypeQuery(const char *name) { | |
0190c472 | 269 | swig_type_info *ty = *swig_type_list_handle; |
d14a1e28 | 270 | while (ty) { |
3a0a61b0 | 271 | if (ty->str && (SWIG_TypeEquiv(ty->str,name))) return ty; |
d14a1e28 RD |
272 | if (ty->name && (strcmp(name,ty->name) == 0)) return ty; |
273 | ty = ty->prev; | |
274 | } | |
275 | return 0; | |
276 | } | |
277 | ||
278 | /* Set the clientdata field for a type */ | |
279 | SWIGRUNTIME(void) | |
280 | SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { | |
281 | swig_type_info *tc, *equiv; | |
282 | if (ti->clientdata == clientdata) return; | |
283 | ti->clientdata = clientdata; | |
284 | equiv = ti->next; | |
285 | while (equiv) { | |
286 | if (!equiv->converter) { | |
0190c472 | 287 | tc = *swig_type_list_handle; |
d14a1e28 | 288 | while (tc) { |
98fb9b71 RD |
289 | if ((strcmp(tc->name, equiv->name) == 0)) |
290 | SWIG_TypeClientData(tc,clientdata); | |
291 | tc = tc->prev; | |
d14a1e28 RD |
292 | } |
293 | } | |
294 | equiv = equiv->next; | |
295 | } | |
296 | } | |
98fb9b71 RD |
297 | |
298 | /* Pack binary data into a string */ | |
299 | SWIGRUNTIME(char *) | |
300 | SWIG_PackData(char *c, void *ptr, int sz) { | |
301 | static char hex[17] = "0123456789abcdef"; | |
98fb9b71 | 302 | unsigned char *u = (unsigned char *) ptr; |
0190c472 | 303 | const unsigned char *eu = u + sz; |
98fb9b71 | 304 | register unsigned char uu; |
0190c472 | 305 | for (; u != eu; ++u) { |
98fb9b71 RD |
306 | uu = *u; |
307 | *(c++) = hex[(uu & 0xf0) >> 4]; | |
308 | *(c++) = hex[uu & 0xf]; | |
309 | } | |
310 | return c; | |
311 | } | |
312 | ||
313 | /* Unpack binary data from a string */ | |
314 | SWIGRUNTIME(char *) | |
315 | SWIG_UnpackData(char *c, void *ptr, int sz) { | |
316 | register unsigned char uu = 0; | |
317 | register int d; | |
318 | unsigned char *u = (unsigned char *) ptr; | |
0190c472 RD |
319 | const unsigned char *eu = u + sz; |
320 | for (; u != eu; ++u) { | |
98fb9b71 RD |
321 | d = *(c++); |
322 | if ((d >= '0') && (d <= '9')) | |
323 | uu = ((d - '0') << 4); | |
324 | else if ((d >= 'a') && (d <= 'f')) | |
325 | uu = ((d - ('a'-10)) << 4); | |
326 | d = *(c++); | |
327 | if ((d >= '0') && (d <= '9')) | |
328 | uu |= (d - '0'); | |
329 | else if ((d >= 'a') && (d <= 'f')) | |
330 | uu |= (d - ('a'-10)); | |
331 | *u = uu; | |
332 | } | |
333 | return c; | |
334 | } | |
335 | ||
6bddd8c5 RD |
336 | #endif |
337 | ||
d14a1e28 RD |
338 | #ifdef __cplusplus |
339 | } | |
d14a1e28 | 340 | #endif |
98fb9b71 | 341 | |
d14a1e28 | 342 | /*********************************************************************** |
0190c472 | 343 | * pyrun.swg |
d14a1e28 RD |
344 | * |
345 | * This file contains the runtime support for Python modules | |
346 | * and includes code for managing global variables and pointer | |
347 | * type checking. | |
348 | * | |
349 | * Author : David Beazley (beazley@cs.uchicago.edu) | |
350 | ************************************************************************/ | |
351 | ||
d14a1e28 RD |
352 | #ifdef __cplusplus |
353 | extern "C" { | |
6bddd8c5 RD |
354 | #endif |
355 | ||
d14a1e28 RD |
356 | #define SWIG_PY_INT 1 |
357 | #define SWIG_PY_FLOAT 2 | |
358 | #define SWIG_PY_STRING 3 | |
359 | #define SWIG_PY_POINTER 4 | |
360 | #define SWIG_PY_BINARY 5 | |
361 | ||
362 | /* Flags for pointer conversion */ | |
363 | ||
364 | #define SWIG_POINTER_EXCEPTION 0x1 | |
365 | #define SWIG_POINTER_DISOWN 0x2 | |
366 | ||
367 | /* Exception handling in wrappers */ | |
368 | #define SWIG_fail goto fail | |
369 | ||
370 | /* Constant information structure */ | |
371 | typedef struct swig_const_info { | |
372 | int type; | |
373 | char *name; | |
374 | long lvalue; | |
375 | double dvalue; | |
376 | void *pvalue; | |
377 | swig_type_info **ptype; | |
378 | } swig_const_info; | |
379 | ||
380 | /* Common SWIG API */ | |
381 | #define SWIG_ConvertPtr(obj, pp, type, flags) \ | |
382 | SWIG_Python_ConvertPtr(obj, pp, type, flags) | |
383 | #define SWIG_NewPointerObj(p, type, flags) \ | |
384 | SWIG_Python_NewPointerObj(p, type, flags) | |
385 | #define SWIG_MustGetPtr(p, type, argnum, flags) \ | |
386 | SWIG_Python_MustGetPtr(p, type, argnum, flags) | |
d7f82584 | 387 | |
d14a1e28 RD |
388 | /* Python-specific SWIG API */ |
389 | #define SWIG_newvarlink() \ | |
390 | SWIG_Python_newvarlink() | |
391 | #define SWIG_addvarlink(p, name, get_attr, set_attr) \ | |
392 | SWIG_Python_addvarlink(p, name, get_attr, set_attr) | |
393 | #define SWIG_ConvertPacked(obj, ptr, sz, ty, flags) \ | |
394 | SWIG_Python_ConvertPacked(obj, ptr, sz, ty, flags) | |
d14a1e28 RD |
395 | #define SWIG_NewPackedObj(ptr, sz, type) \ |
396 | SWIG_Python_NewPackedObj(ptr, sz, type) | |
397 | #define SWIG_InstallConstants(d, constants) \ | |
398 | SWIG_Python_InstallConstants(d, constants) | |
399 | ||
d7f82584 RD |
400 | typedef double (*py_objasdbl_conv)(PyObject *obj); |
401 | ||
d14a1e28 RD |
402 | #ifdef SWIG_NOINCLUDE |
403 | ||
98fb9b71 RD |
404 | SWIGIMPORT(int) SWIG_Python_ConvertPtr(PyObject *, void **, swig_type_info *, int); |
405 | SWIGIMPORT(PyObject *) SWIG_Python_NewPointerObj(void *, swig_type_info *,int own); | |
406 | SWIGIMPORT(void *) SWIG_Python_MustGetPtr(PyObject *, swig_type_info *, int, int); | |
407 | SWIGIMPORT(PyObject *) SWIG_Python_newvarlink(void); | |
408 | SWIGIMPORT(void) SWIG_Python_addvarlink(PyObject *, char *, PyObject *(*)(void), int (*)(PyObject *)); | |
409 | SWIGIMPORT(int) SWIG_Python_ConvertPacked(PyObject *, void *, int sz, swig_type_info *, int); | |
410 | SWIGIMPORT(PyObject *) SWIG_Python_NewPackedObj(void *, int sz, swig_type_info *); | |
411 | SWIGIMPORT(void) SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]); | |
412 | ||
d7f82584 | 413 | |
d14a1e28 RD |
414 | #else |
415 | ||
d7f82584 | 416 | |
d14a1e28 RD |
417 | /* ----------------------------------------------------------------------------- |
418 | * global variable support code. | |
419 | * ----------------------------------------------------------------------------- */ | |
420 | ||
421 | typedef struct swig_globalvar { | |
422 | char *name; /* Name of global variable */ | |
423 | PyObject *(*get_attr)(void); /* Return the current value */ | |
424 | int (*set_attr)(PyObject *); /* Set the value */ | |
425 | struct swig_globalvar *next; | |
6bddd8c5 RD |
426 | } swig_globalvar; |
427 | ||
428 | typedef struct swig_varlinkobject { | |
429 | PyObject_HEAD | |
d14a1e28 | 430 | swig_globalvar *vars; |
6bddd8c5 RD |
431 | } swig_varlinkobject; |
432 | ||
6bddd8c5 | 433 | static PyObject * |
d14a1e28 | 434 | swig_varlink_repr(swig_varlinkobject *v) { |
6bddd8c5 RD |
435 | v = v; |
436 | return PyString_FromString("<Global variables>"); | |
437 | } | |
438 | ||
6bddd8c5 | 439 | static int |
d14a1e28 RD |
440 | swig_varlink_print(swig_varlinkobject *v, FILE *fp, int flags) { |
441 | swig_globalvar *var; | |
6bddd8c5 RD |
442 | flags = flags; |
443 | fprintf(fp,"Global variables { "); | |
d14a1e28 RD |
444 | for (var = v->vars; var; var=var->next) { |
445 | fprintf(fp,"%s", var->name); | |
446 | if (var->next) fprintf(fp,", "); | |
6bddd8c5 RD |
447 | } |
448 | fprintf(fp," }\n"); | |
449 | return 0; | |
450 | } | |
451 | ||
6bddd8c5 | 452 | static PyObject * |
d14a1e28 RD |
453 | swig_varlink_getattr(swig_varlinkobject *v, char *n) { |
454 | swig_globalvar *var = v->vars; | |
455 | while (var) { | |
456 | if (strcmp(var->name,n) == 0) { | |
457 | return (*var->get_attr)(); | |
6bddd8c5 | 458 | } |
d14a1e28 | 459 | var = var->next; |
6bddd8c5 | 460 | } |
d14a1e28 | 461 | PyErr_SetString(PyExc_NameError,"Unknown C global variable"); |
6bddd8c5 RD |
462 | return NULL; |
463 | } | |
464 | ||
6bddd8c5 | 465 | static int |
d14a1e28 RD |
466 | swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) { |
467 | swig_globalvar *var = v->vars; | |
468 | while (var) { | |
469 | if (strcmp(var->name,n) == 0) { | |
470 | return (*var->set_attr)(p); | |
6bddd8c5 | 471 | } |
d14a1e28 | 472 | var = var->next; |
6bddd8c5 | 473 | } |
d14a1e28 | 474 | PyErr_SetString(PyExc_NameError,"Unknown C global variable"); |
6bddd8c5 RD |
475 | return 1; |
476 | } | |
477 | ||
478 | statichere PyTypeObject varlinktype = { | |
d14a1e28 | 479 | PyObject_HEAD_INIT(0) |
3a0a61b0 RD |
480 | 0, /* Number of items in variable part (ob_size) */ |
481 | (char *)"swigvarlink", /* Type name (tp_name) */ | |
482 | sizeof(swig_varlinkobject), /* Basic size (tp_basicsize) */ | |
483 | 0, /* Itemsize (tp_itemsize) */ | |
484 | 0, /* Deallocator (tp_dealloc) */ | |
485 | (printfunc) swig_varlink_print, /* Print (tp_print) */ | |
486 | (getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */ | |
487 | (setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */ | |
488 | 0, /* tp_compare */ | |
489 | (reprfunc) swig_varlink_repr, /* tp_repr */ | |
6bddd8c5 | 490 | 0, /* tp_as_number */ |
3a0a61b0 RD |
491 | 0, /* tp_as_sequence */ |
492 | 0, /* tp_as_mapping */ | |
493 | 0, /* tp_hash */ | |
494 | 0, /* tp_call */ | |
495 | 0, /* tp_str */ | |
496 | 0, /* tp_getattro */ | |
497 | 0, /* tp_setattro */ | |
498 | 0, /* tp_as_buffer */ | |
499 | 0, /* tp_flags */ | |
500 | 0, /* tp_doc */ | |
501 | 0, /* tp_traverse */ | |
502 | 0, /* tp_clear */ | |
503 | 0, /* tp_richcompare */ | |
504 | 0, /* tp_weaklistoffset */ | |
0190c472 | 505 | #if PY_VERSION_HEX >= 0x02020000 |
3a0a61b0 RD |
506 | 0, /* tp_iter */ |
507 | 0, /* tp_iternext */ | |
508 | 0, /* tp_methods */ | |
509 | 0, /* tp_members */ | |
510 | 0, /* tp_getset */ | |
511 | 0, /* tp_base */ | |
512 | 0, /* tp_dict */ | |
513 | 0, /* tp_descr_get */ | |
514 | 0, /* tp_descr_set */ | |
515 | 0, /* tp_dictoffset */ | |
516 | 0, /* tp_init */ | |
517 | 0, /* tp_alloc */ | |
518 | 0, /* tp_new */ | |
519 | 0, /* tp_free */ | |
520 | 0, /* tp_is_gc */ | |
521 | 0, /* tp_bases */ | |
522 | 0, /* tp_mro */ | |
523 | 0, /* tp_cache */ | |
524 | 0, /* tp_subclasses */ | |
525 | 0, /* tp_weaklist */ | |
0190c472 RD |
526 | #endif |
527 | #if PY_VERSION_HEX >= 0x02030200 | |
528 | 0, /* tp_del */ | |
529 | #endif | |
530 | #ifdef COUNT_ALLOCS | |
531 | /* these must be last */ | |
532 | 0, /* tp_alloc */ | |
533 | 0, /* tp_free */ | |
534 | 0, /* tp_maxalloc */ | |
535 | 0, /* tp_next */ | |
536 | #endif | |
6bddd8c5 RD |
537 | }; |
538 | ||
539 | /* Create a variable linking object for use later */ | |
d14a1e28 RD |
540 | SWIGRUNTIME(PyObject *) |
541 | SWIG_Python_newvarlink(void) { | |
6bddd8c5 RD |
542 | swig_varlinkobject *result = 0; |
543 | result = PyMem_NEW(swig_varlinkobject,1); | |
544 | varlinktype.ob_type = &PyType_Type; /* Patch varlinktype into a PyType */ | |
545 | result->ob_type = &varlinktype; | |
d14a1e28 | 546 | result->vars = 0; |
6bddd8c5 RD |
547 | result->ob_refcnt = 0; |
548 | Py_XINCREF((PyObject *) result); | |
549 | return ((PyObject*) result); | |
550 | } | |
551 | ||
d14a1e28 | 552 | SWIGRUNTIME(void) |
98fb9b71 | 553 | SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) { |
6bddd8c5 | 554 | swig_varlinkobject *v; |
d14a1e28 | 555 | swig_globalvar *gv; |
6bddd8c5 | 556 | v= (swig_varlinkobject *) p; |
d14a1e28 RD |
557 | gv = (swig_globalvar *) malloc(sizeof(swig_globalvar)); |
558 | gv->name = (char *) malloc(strlen(name)+1); | |
559 | strcpy(gv->name,name); | |
560 | gv->get_attr = get_attr; | |
561 | gv->set_attr = set_attr; | |
562 | gv->next = v->vars; | |
563 | v->vars = gv; | |
6bddd8c5 RD |
564 | } |
565 | ||
d14a1e28 RD |
566 | /* Convert a pointer value */ |
567 | SWIGRUNTIME(int) | |
568 | SWIG_Python_ConvertPtr(PyObject *obj, void **ptr, swig_type_info *ty, int flags) { | |
569 | swig_type_info *tc; | |
570 | char *c = 0; | |
571 | static PyObject *SWIG_this = 0; | |
572 | int newref = 0; | |
573 | PyObject *pyobj = 0; | |
574 | ||
575 | if (!obj) return 0; | |
576 | if (obj == Py_None) { | |
577 | *ptr = 0; | |
578 | return 0; | |
1d99702e | 579 | } |
d14a1e28 RD |
580 | #ifdef SWIG_COBJECT_TYPES |
581 | if (!(PyCObject_Check(obj))) { | |
582 | if (!SWIG_this) | |
583 | SWIG_this = PyString_FromString("this"); | |
584 | pyobj = obj; | |
585 | obj = PyObject_GetAttr(obj,SWIG_this); | |
586 | newref = 1; | |
587 | if (!obj) goto type_error; | |
588 | if (!PyCObject_Check(obj)) { | |
589 | Py_DECREF(obj); | |
590 | goto type_error; | |
591 | } | |
592 | } | |
593 | *ptr = PyCObject_AsVoidPtr(obj); | |
594 | c = (char *) PyCObject_GetDesc(obj); | |
595 | if (newref) Py_DECREF(obj); | |
596 | goto cobject; | |
597 | #else | |
598 | if (!(PyString_Check(obj))) { | |
599 | if (!SWIG_this) | |
600 | SWIG_this = PyString_FromString("this"); | |
601 | pyobj = obj; | |
602 | obj = PyObject_GetAttr(obj,SWIG_this); | |
603 | newref = 1; | |
604 | if (!obj) goto type_error; | |
605 | if (!PyString_Check(obj)) { | |
606 | Py_DECREF(obj); | |
607 | goto type_error; | |
608 | } | |
609 | } | |
0190c472 | 610 | c = PyString_AS_STRING(obj); |
d14a1e28 RD |
611 | /* Pointer values must start with leading underscore */ |
612 | if (*c != '_') { | |
613 | *ptr = (void *) 0; | |
614 | if (strcmp(c,"NULL") == 0) { | |
615 | if (newref) { Py_DECREF(obj); } | |
616 | return 0; | |
617 | } else { | |
618 | if (newref) { Py_DECREF(obj); } | |
619 | goto type_error; | |
1d99702e RD |
620 | } |
621 | } | |
d14a1e28 RD |
622 | c++; |
623 | c = SWIG_UnpackData(c,ptr,sizeof(void *)); | |
624 | if (newref) { Py_DECREF(obj); } | |
625 | #endif | |
626 | ||
627 | #ifdef SWIG_COBJECT_TYPES | |
628 | cobject: | |
629 | #endif | |
630 | ||
631 | if (ty) { | |
632 | tc = SWIG_TypeCheck(c,ty); | |
633 | if (!tc) goto type_error; | |
634 | *ptr = SWIG_TypeCast(tc,(void*) *ptr); | |
1d99702e RD |
635 | } |
636 | ||
d14a1e28 | 637 | if ((pyobj) && (flags & SWIG_POINTER_DISOWN)) { |
0190c472 | 638 | PyObject_SetAttrString(pyobj,(char*)"thisown",Py_False); |
1d99702e | 639 | } |
d14a1e28 | 640 | return 0; |
1d99702e | 641 | |
d14a1e28 | 642 | type_error: |
0190c472 | 643 | PyErr_Clear(); |
d14a1e28 RD |
644 | if (flags & SWIG_POINTER_EXCEPTION) { |
645 | if (ty && c) { | |
0190c472 RD |
646 | PyErr_Format(PyExc_TypeError, |
647 | "Type error. Got %s, expected %s", | |
648 | c, ty->name); | |
d14a1e28 RD |
649 | } else { |
650 | PyErr_SetString(PyExc_TypeError,"Expected a pointer"); | |
1d99702e | 651 | } |
1d99702e | 652 | } |
d14a1e28 | 653 | return -1; |
1d99702e RD |
654 | } |
655 | ||
d14a1e28 RD |
656 | /* Convert a pointer value, signal an exception on a type mismatch */ |
657 | SWIGRUNTIME(void *) | |
98fb9b71 | 658 | SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) { |
d14a1e28 RD |
659 | void *result; |
660 | SWIG_Python_ConvertPtr(obj, &result, ty, flags | SWIG_POINTER_EXCEPTION); | |
661 | return result; | |
662 | } | |
1d99702e | 663 | |
d14a1e28 RD |
664 | /* Convert a packed value value */ |
665 | SWIGRUNTIME(int) | |
666 | SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, int sz, swig_type_info *ty, int flags) { | |
667 | swig_type_info *tc; | |
668 | char *c = 0; | |
669 | ||
670 | if ((!obj) || (!PyString_Check(obj))) goto type_error; | |
0190c472 | 671 | c = PyString_AS_STRING(obj); |
1d99702e | 672 | /* Pointer values must start with leading underscore */ |
d14a1e28 | 673 | if (*c != '_') goto type_error; |
1d99702e | 674 | c++; |
d14a1e28 RD |
675 | c = SWIG_UnpackData(c,ptr,sz); |
676 | if (ty) { | |
677 | tc = SWIG_TypeCheck(c,ty); | |
678 | if (!tc) goto type_error; | |
1d99702e | 679 | } |
d14a1e28 RD |
680 | return 0; |
681 | ||
682 | type_error: | |
683 | ||
684 | if (flags) { | |
685 | if (ty && c) { | |
0190c472 RD |
686 | PyErr_Format(PyExc_TypeError, |
687 | "Type error. Got %s, expected %s", | |
688 | c, ty->name); | |
d14a1e28 RD |
689 | } else { |
690 | PyErr_SetString(PyExc_TypeError,"Expected a pointer"); | |
1d99702e | 691 | } |
1d99702e | 692 | } |
d14a1e28 RD |
693 | return -1; |
694 | } | |
695 | ||
696 | /* Create a new pointer object */ | |
697 | SWIGRUNTIME(PyObject *) | |
698 | SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int own) { | |
699 | PyObject *robj; | |
700 | if (!ptr) { | |
701 | Py_INCREF(Py_None); | |
702 | return Py_None; | |
1d99702e | 703 | } |
d14a1e28 RD |
704 | #ifdef SWIG_COBJECT_TYPES |
705 | robj = PyCObject_FromVoidPtrAndDesc((void *) ptr, (char *) type->name, NULL); | |
706 | #else | |
707 | { | |
708 | char result[1024]; | |
709 | char *r = result; | |
710 | *(r++) = '_'; | |
711 | r = SWIG_PackData(r,&ptr,sizeof(void *)); | |
712 | strcpy(r,type->name); | |
713 | robj = PyString_FromString(result); | |
714 | } | |
715 | #endif | |
716 | if (!robj || (robj == Py_None)) return robj; | |
717 | if (type->clientdata) { | |
718 | PyObject *inst; | |
719 | PyObject *args = Py_BuildValue((char*)"(O)", robj); | |
720 | Py_DECREF(robj); | |
721 | inst = PyObject_CallObject((PyObject *) type->clientdata, args); | |
722 | Py_DECREF(args); | |
723 | if (inst) { | |
724 | if (own) { | |
0190c472 | 725 | PyObject_SetAttrString(inst,(char*)"thisown",Py_True); |
1d99702e | 726 | } |
d14a1e28 | 727 | robj = inst; |
1d99702e | 728 | } |
1d99702e | 729 | } |
d14a1e28 | 730 | return robj; |
1afc06c2 | 731 | } |
1d99702e | 732 | |
d14a1e28 RD |
733 | SWIGRUNTIME(PyObject *) |
734 | SWIG_Python_NewPackedObj(void *ptr, int sz, swig_type_info *type) { | |
735 | char result[1024]; | |
736 | char *r = result; | |
737 | if ((2*sz + 1 + strlen(type->name)) > 1000) return 0; | |
738 | *(r++) = '_'; | |
739 | r = SWIG_PackData(r,ptr,sz); | |
740 | strcpy(r,type->name); | |
741 | return PyString_FromString(result); | |
742 | } | |
3628e088 | 743 | |
d14a1e28 RD |
744 | /* Install Constants */ |
745 | SWIGRUNTIME(void) | |
746 | SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) { | |
747 | int i; | |
748 | PyObject *obj; | |
749 | for (i = 0; constants[i].type; i++) { | |
750 | switch(constants[i].type) { | |
751 | case SWIG_PY_INT: | |
752 | obj = PyInt_FromLong(constants[i].lvalue); | |
753 | break; | |
754 | case SWIG_PY_FLOAT: | |
755 | obj = PyFloat_FromDouble(constants[i].dvalue); | |
756 | break; | |
757 | case SWIG_PY_STRING: | |
3a0a61b0 RD |
758 | if (constants[i].pvalue) { |
759 | obj = PyString_FromString((char *) constants[i].pvalue); | |
760 | } else { | |
761 | Py_INCREF(Py_None); | |
762 | obj = Py_None; | |
763 | } | |
d14a1e28 RD |
764 | break; |
765 | case SWIG_PY_POINTER: | |
766 | obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0); | |
767 | break; | |
768 | case SWIG_PY_BINARY: | |
769 | obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype)); | |
770 | break; | |
771 | default: | |
772 | obj = 0; | |
773 | break; | |
774 | } | |
775 | if (obj) { | |
776 | PyDict_SetItemString(d,constants[i].name,obj); | |
777 | Py_DECREF(obj); | |
778 | } | |
1d99702e | 779 | } |
1d99702e RD |
780 | } |
781 | ||
1d99702e | 782 | #endif |
6bddd8c5 | 783 | |
d14a1e28 | 784 | /* Contract support */ |
6bddd8c5 | 785 | |
11188b02 | 786 | #define SWIG_contract_assert(expr, msg) if (!(expr)) { PyErr_SetString(PyExc_RuntimeError, (char *) msg ); goto fail; } else |
1b62f00d | 787 | |
d14a1e28 RD |
788 | #ifdef __cplusplus |
789 | } | |
790 | #endif | |
98fb9b71 RD |
791 | |
792 | ||
793 | /* -------- TYPES TABLE (BEGIN) -------- */ | |
794 | ||
d7f82584 RD |
795 | #define SWIGTYPE_p_char swig_types[0] |
796 | static swig_type_info *swig_types[2]; | |
98fb9b71 RD |
797 | |
798 | /* -------- TYPES TABLE (END) -------- */ | |
799 | ||
0190c472 | 800 | #define SWIG_init initswigrun |
98fb9b71 | 801 | |
0190c472 | 802 | #define SWIG_name "swigrun" |
98fb9b71 | 803 | |
0190c472 | 804 | /* Auxiliar swig macros that appear in the header */ |
d7f82584 | 805 | |
0190c472 RD |
806 | #define SWIG_OLDOBJ 1 |
807 | #define SWIG_NEWOBJ SWIG_OLDOBJ + 1 | |
808 | #define SWIG_PYSTR SWIG_NEWOBJ + 1 | |
d7f82584 | 809 | |
d7f82584 | 810 | #ifdef __cplusplus |
3a0a61b0 | 811 | #define SWIGSTATICINLINE(a) static inline a |
d7f82584 | 812 | #define SWIGSTATIC(a) static a |
0190c472 RD |
813 | #define swig_new_array(size,Type) (new Type[(size)]) |
814 | #define swig_delete(cptr) delete cptr | |
3a0a61b0 | 815 | #define swig_delete_array(cptr) delete[] cptr |
0190c472 RD |
816 | #define swig_const_cast(a,Type) const_cast<Type >(a) |
817 | #define swig_static_cast(a,Type) static_cast<Type >(a) | |
818 | #define swig_reinterpret_cast(a,Type) reinterpret_cast<Type >(a) | |
819 | #define swig_new_copy(ptr,Type) (new Type(*ptr)) | |
820 | #define swig_numeric_cast(a,Type) static_cast<Type >(a) | |
d7f82584 | 821 | |
3a0a61b0 | 822 | #else /* C case */ |
d7f82584 | 823 | |
3a0a61b0 RD |
824 | #define SWIGSTATICINLINE(a) static a |
825 | #define SWIGSTATIC(a) static a | |
0190c472 RD |
826 | #define swig_new_array(size,Type) ((Type*) malloc((size)*sizeof(Type))) |
827 | #define swig_delete(cptr) free((char*)cptr) | |
3a0a61b0 | 828 | #define swig_delete_array(cptr) free((char*)cptr) |
0190c472 RD |
829 | #define swig_const_cast(a,Type) (Type)(a) |
830 | #define swig_static_cast(a,Type) (Type)(a) | |
831 | #define swig_reinterpret_cast(a,Type) (Type)(a) | |
832 | #define swig_numeric_cast(a,Type) (Type)(a) | |
833 | #define swig_new_copy(ptr,Type) ((Type*)memcpy(malloc(sizeof(Type)),ptr,sizeof(Type))) | |
3a0a61b0 RD |
834 | |
835 | #endif /* __cplusplus */ | |
836 | ||
837 | ||
0190c472 RD |
838 | /*@/opt/swig/share/swig/1.3.22/python/pymacros.swg,63,SWIG_define@*/ |
839 | #define SWIG_From_signed_SS_char PyInt_FromLong | |
840 | /*@@*/ | |
841 | /*@/opt/swig/share/swig/1.3.22/python/pymacros.swg,63,SWIG_define@*/ | |
842 | #define SWIG_From_unsigned_SS_char PyInt_FromLong | |
843 | /*@@*/ | |
844 | /*@/opt/swig/share/swig/1.3.22/python/pymacros.swg,63,SWIG_define@*/ | |
845 | #define SWIG_From_short PyInt_FromLong | |
846 | /*@@*/ | |
847 | /*@/opt/swig/share/swig/1.3.22/python/pymacros.swg,63,SWIG_define@*/ | |
848 | #define SWIG_From_unsigned_SS_short PyInt_FromLong | |
849 | /*@@*/ | |
850 | /*@/opt/swig/share/swig/1.3.22/python/pymacros.swg,63,SWIG_define@*/ | |
851 | #define SWIG_From_int PyInt_FromLong | |
852 | /*@@*/ | |
853 | /*@/opt/swig/share/swig/1.3.22/python/pymacros.swg,63,SWIG_define@*/ | |
854 | #define SWIG_From_long PyInt_FromLong | |
855 | /*@@*/ | |
856 | /*@/opt/swig/share/swig/1.3.22/python/pymacros.swg,63,SWIG_define@*/ | |
857 | #define SWIG_From_float PyFloat_FromDouble | |
858 | /*@@*/ | |
859 | /*@/opt/swig/share/swig/1.3.22/python/pymacros.swg,63,SWIG_define@*/ | |
860 | #define SWIG_From_double PyFloat_FromDouble | |
861 | /*@@*/ | |
d7f82584 | 862 | |
98fb9b71 RD |
863 | #ifdef __cplusplus |
864 | extern "C" { | |
865 | #endif | |
866 | static PyMethodDef SwigMethods[] = { | |
0190c472 | 867 | { NULL, NULL, 0, NULL } |
98fb9b71 RD |
868 | }; |
869 | ||
870 | ||
871 | /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ | |
872 | ||
3a0a61b0 | 873 | static swig_type_info _swigt__p_char[] = {{"_p_char", 0, "char *", 0, 0, 0, 0},{"_p_char", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; |
98fb9b71 RD |
874 | |
875 | static swig_type_info *swig_types_initial[] = { | |
d7f82584 | 876 | _swigt__p_char, |
98fb9b71 RD |
877 | 0 |
878 | }; | |
879 | ||
880 | ||
881 | /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */ | |
882 | ||
883 | static swig_const_info swig_const_table[] = { | |
0190c472 | 884 | {0, 0, 0, 0.0, 0, 0}}; |
98fb9b71 RD |
885 | |
886 | #ifdef __cplusplus | |
887 | } | |
888 | #endif | |
889 | ||
890 | #ifdef __cplusplus | |
891 | extern "C" | |
892 | #endif | |
893 | SWIGEXPORT(void) SWIG_init(void) { | |
894 | static PyObject *SWIG_globals = 0; | |
895 | static int typeinit = 0; | |
896 | PyObject *m, *d; | |
897 | int i; | |
898 | if (!SWIG_globals) SWIG_globals = SWIG_newvarlink(); | |
899 | m = Py_InitModule((char *) SWIG_name, SwigMethods); | |
900 | d = PyModule_GetDict(m); | |
901 | ||
902 | if (!typeinit) { | |
903 | for (i = 0; swig_types_initial[i]; i++) { | |
904 | swig_types[i] = SWIG_TypeRegister(swig_types_initial[i]); | |
905 | } | |
906 | typeinit = 1; | |
907 | } | |
908 | SWIG_InstallConstants(d,swig_const_table); | |
909 | ||
910 | } | |
911 |