Line data Source code
1 : /* ----------------------------------------------------------------------------
2 : * This file was automatically generated by SWIG (http://www.swig.org).
3 : * Version 3.0.10
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 : /* -----------------------------------------------------------------------------
12 : * This section contains generic SWIG labels for method/variable
13 : * declarations/attributes, and other compiler dependent labels.
14 : * ----------------------------------------------------------------------------- */
15 :
16 : /* template workaround for compilers that cannot correctly implement the C++ standard */
17 : #ifndef SWIGTEMPLATEDISAMBIGUATOR
18 : # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
19 : # define SWIGTEMPLATEDISAMBIGUATOR template
20 : # elif defined(__HP_aCC)
21 : /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
22 : /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
23 : # define SWIGTEMPLATEDISAMBIGUATOR template
24 : # else
25 : # define SWIGTEMPLATEDISAMBIGUATOR
26 : # endif
27 : #endif
28 :
29 : /* inline attribute */
30 : #ifndef SWIGINLINE
31 : # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
32 : # define SWIGINLINE inline
33 : # else
34 : # define SWIGINLINE
35 : # endif
36 : #endif
37 :
38 : /* attribute recognised by some compilers to avoid 'unused' warnings */
39 : #ifndef SWIGUNUSED
40 : # if defined(__GNUC__)
41 : # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
42 : # define SWIGUNUSED __attribute__ ((__unused__))
43 : # else
44 : # define SWIGUNUSED
45 : # endif
46 : # elif defined(__ICC)
47 : # define SWIGUNUSED __attribute__ ((__unused__))
48 : # else
49 : # define SWIGUNUSED
50 : # endif
51 : #endif
52 :
53 : #ifndef SWIG_MSC_UNSUPPRESS_4505
54 : # if defined(_MSC_VER)
55 : # pragma warning(disable : 4505) /* unreferenced local function has been removed */
56 : # endif
57 : #endif
58 :
59 : #ifndef SWIGUNUSEDPARM
60 : # ifdef __cplusplus
61 : # define SWIGUNUSEDPARM(p)
62 : # else
63 : # define SWIGUNUSEDPARM(p) p SWIGUNUSED
64 : # endif
65 : #endif
66 :
67 : /* internal SWIG method */
68 : #ifndef SWIGINTERN
69 : # define SWIGINTERN static SWIGUNUSED
70 : #endif
71 :
72 : /* internal inline SWIG method */
73 : #ifndef SWIGINTERNINLINE
74 : # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
75 : #endif
76 :
77 : /* exporting methods */
78 : #if defined(__GNUC__)
79 : # if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
80 : # ifndef GCC_HASCLASSVISIBILITY
81 : # define GCC_HASCLASSVISIBILITY
82 : # endif
83 : # endif
84 : #endif
85 :
86 : #ifndef SWIGEXPORT
87 : # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
88 : # if defined(STATIC_LINKED)
89 : # define SWIGEXPORT
90 : # else
91 : # define SWIGEXPORT __declspec(dllexport)
92 : # endif
93 : # else
94 : # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
95 : # define SWIGEXPORT __attribute__ ((visibility("default")))
96 : # else
97 : # define SWIGEXPORT
98 : # endif
99 : # endif
100 : #endif
101 :
102 : /* calling conventions for Windows */
103 : #ifndef SWIGSTDCALL
104 : # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
105 : # define SWIGSTDCALL __stdcall
106 : # else
107 : # define SWIGSTDCALL
108 : # endif
109 : #endif
110 :
111 : /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
112 : #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
113 : # define _CRT_SECURE_NO_DEPRECATE
114 : #endif
115 :
116 : /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
117 : #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
118 : # define _SCL_SECURE_NO_DEPRECATE
119 : #endif
120 :
121 : /* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
122 : #if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
123 : # define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
124 : #endif
125 :
126 : /* Intel's compiler complains if a variable which was never initialised is
127 : * cast to void, which is a common idiom which we use to indicate that we
128 : * are aware a variable isn't used. So we just silence that warning.
129 : * See: https://github.com/swig/swig/issues/192 for more discussion.
130 : */
131 : #ifdef __INTEL_COMPILER
132 : # pragma warning disable 592
133 : #endif
134 : /* Errors in SWIG */
135 : #define SWIG_UnknownError -1
136 : #define SWIG_IOError -2
137 : #define SWIG_RuntimeError -3
138 : #define SWIG_IndexError -4
139 : #define SWIG_TypeError -5
140 : #define SWIG_DivisionByZero -6
141 : #define SWIG_OverflowError -7
142 : #define SWIG_SyntaxError -8
143 : #define SWIG_ValueError -9
144 : #define SWIG_SystemError -10
145 : #define SWIG_AttributeError -11
146 : #define SWIG_MemoryError -12
147 : #define SWIG_NullReferenceError -13
148 :
149 :
150 : /* -----------------------------------------------------------------------------
151 : * swigrun.swg
152 : *
153 : * This file contains generic C API SWIG runtime support for pointer
154 : * type checking.
155 : * ----------------------------------------------------------------------------- */
156 :
157 : /* This should only be incremented when either the layout of swig_type_info changes,
158 : or for whatever reason, the runtime changes incompatibly */
159 : #define SWIG_RUNTIME_VERSION "4"
160 :
161 : /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
162 : #ifdef SWIG_TYPE_TABLE
163 : # define SWIG_QUOTE_STRING(x) #x
164 : # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
165 : # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
166 : #else
167 : # define SWIG_TYPE_TABLE_NAME
168 : #endif
169 :
170 : /*
171 : You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
172 : creating a static or dynamic library from the SWIG runtime code.
173 : In 99.9% of the cases, SWIG just needs to declare them as 'static'.
174 :
175 : But only do this if strictly necessary, ie, if you have problems
176 : with your compiler or suchlike.
177 : */
178 :
179 : #ifndef SWIGRUNTIME
180 : # define SWIGRUNTIME SWIGINTERN
181 : #endif
182 :
183 : #ifndef SWIGRUNTIMEINLINE
184 : # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
185 : #endif
186 :
187 : /* Generic buffer size */
188 : #ifndef SWIG_BUFFER_SIZE
189 : # define SWIG_BUFFER_SIZE 1024
190 : #endif
191 :
192 : /* Flags for pointer conversions */
193 : #define SWIG_POINTER_DISOWN 0x1
194 : #define SWIG_CAST_NEW_MEMORY 0x2
195 :
196 : /* Flags for new pointer objects */
197 : #define SWIG_POINTER_OWN 0x1
198 :
199 :
200 : /*
201 : Flags/methods for returning states.
202 :
203 : The SWIG conversion methods, as ConvertPtr, return an integer
204 : that tells if the conversion was successful or not. And if not,
205 : an error code can be returned (see swigerrors.swg for the codes).
206 :
207 : Use the following macros/flags to set or process the returning
208 : states.
209 :
210 : In old versions of SWIG, code such as the following was usually written:
211 :
212 : if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
213 : // success code
214 : } else {
215 : //fail code
216 : }
217 :
218 : Now you can be more explicit:
219 :
220 : int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
221 : if (SWIG_IsOK(res)) {
222 : // success code
223 : } else {
224 : // fail code
225 : }
226 :
227 : which is the same really, but now you can also do
228 :
229 : Type *ptr;
230 : int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
231 : if (SWIG_IsOK(res)) {
232 : // success code
233 : if (SWIG_IsNewObj(res) {
234 : ...
235 : delete *ptr;
236 : } else {
237 : ...
238 : }
239 : } else {
240 : // fail code
241 : }
242 :
243 : I.e., now SWIG_ConvertPtr can return new objects and you can
244 : identify the case and take care of the deallocation. Of course that
245 : also requires SWIG_ConvertPtr to return new result values, such as
246 :
247 : int SWIG_ConvertPtr(obj, ptr,...) {
248 : if (<obj is ok>) {
249 : if (<need new object>) {
250 : *ptr = <ptr to new allocated object>;
251 : return SWIG_NEWOBJ;
252 : } else {
253 : *ptr = <ptr to old object>;
254 : return SWIG_OLDOBJ;
255 : }
256 : } else {
257 : return SWIG_BADOBJ;
258 : }
259 : }
260 :
261 : Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
262 : more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
263 : SWIG errors code.
264 :
265 : Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
266 : allows to return the 'cast rank', for example, if you have this
267 :
268 : int food(double)
269 : int fooi(int);
270 :
271 : and you call
272 :
273 : food(1) // cast rank '1' (1 -> 1.0)
274 : fooi(1) // cast rank '0'
275 :
276 : just use the SWIG_AddCast()/SWIG_CheckState()
277 : */
278 :
279 : #define SWIG_OK (0)
280 : #define SWIG_ERROR (-1)
281 : #define SWIG_IsOK(r) (r >= 0)
282 : #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
283 :
284 : /* The CastRankLimit says how many bits are used for the cast rank */
285 : #define SWIG_CASTRANKLIMIT (1 << 8)
286 : /* The NewMask denotes the object was created (using new/malloc) */
287 : #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
288 : /* The TmpMask is for in/out typemaps that use temporal objects */
289 : #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
290 : /* Simple returning values */
291 : #define SWIG_BADOBJ (SWIG_ERROR)
292 : #define SWIG_OLDOBJ (SWIG_OK)
293 : #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
294 : #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
295 : /* Check, add and del mask methods */
296 : #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
297 : #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
298 : #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
299 : #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
300 : #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
301 : #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
302 :
303 : /* Cast-Rank Mode */
304 : #if defined(SWIG_CASTRANK_MODE)
305 : # ifndef SWIG_TypeRank
306 : # define SWIG_TypeRank unsigned long
307 : # endif
308 : # ifndef SWIG_MAXCASTRANK /* Default cast allowed */
309 : # define SWIG_MAXCASTRANK (2)
310 : # endif
311 : # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
312 : # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
313 : SWIGINTERNINLINE int SWIG_AddCast(int r) {
314 : return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
315 : }
316 : SWIGINTERNINLINE int SWIG_CheckState(int r) {
317 : return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
318 : }
319 : #else /* no cast-rank mode */
320 : # define SWIG_AddCast(r) (r)
321 : # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
322 : #endif
323 :
324 :
325 : #include <string.h>
326 :
327 : #ifdef __cplusplus
328 : extern "C" {
329 : #endif
330 :
331 : typedef void *(*swig_converter_func)(void *, int *);
332 : typedef struct swig_type_info *(*swig_dycast_func)(void **);
333 :
334 : /* Structure to store information on one type */
335 : typedef struct swig_type_info {
336 : const char *name; /* mangled name of this type */
337 : const char *str; /* human readable name of this type */
338 : swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
339 : struct swig_cast_info *cast; /* linked list of types that can cast into this type */
340 : void *clientdata; /* language specific type data */
341 : int owndata; /* flag if the structure owns the clientdata */
342 : } swig_type_info;
343 :
344 : /* Structure to store a type and conversion function used for casting */
345 : typedef struct swig_cast_info {
346 : swig_type_info *type; /* pointer to type that is equivalent to this type */
347 : swig_converter_func converter; /* function to cast the void pointers */
348 : struct swig_cast_info *next; /* pointer to next cast in linked list */
349 : struct swig_cast_info *prev; /* pointer to the previous cast */
350 : } swig_cast_info;
351 :
352 : /* Structure used to store module information
353 : * Each module generates one structure like this, and the runtime collects
354 : * all of these structures and stores them in a circularly linked list.*/
355 : typedef struct swig_module_info {
356 : swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
357 : size_t size; /* Number of types in this module */
358 : struct swig_module_info *next; /* Pointer to next element in circularly linked list */
359 : swig_type_info **type_initial; /* Array of initially generated type structures */
360 : swig_cast_info **cast_initial; /* Array of initially generated casting structures */
361 : void *clientdata; /* Language specific module data */
362 : } swig_module_info;
363 :
364 : /*
365 : Compare two type names skipping the space characters, therefore
366 : "char*" == "char *" and "Class<int>" == "Class<int >", etc.
367 :
368 : Return 0 when the two name types are equivalent, as in
369 : strncmp, but skipping ' '.
370 : */
371 : SWIGRUNTIME int
372 0 : SWIG_TypeNameComp(const char *f1, const char *l1,
373 : const char *f2, const char *l2) {
374 0 : for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
375 0 : while ((*f1 == ' ') && (f1 != l1)) ++f1;
376 0 : while ((*f2 == ' ') && (f2 != l2)) ++f2;
377 0 : if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
378 : }
379 0 : return (int)((l1 - f1) - (l2 - f2));
380 : }
381 :
382 : /*
383 : Check type equivalence in a name list like <name1>|<name2>|...
384 : Return 0 if equal, -1 if nb < tb, 1 if nb > tb
385 : */
386 : SWIGRUNTIME int
387 0 : SWIG_TypeCmp(const char *nb, const char *tb) {
388 0 : int equiv = 1;
389 0 : const char* te = tb + strlen(tb);
390 0 : const char* ne = nb;
391 0 : while (equiv != 0 && *ne) {
392 0 : for (nb = ne; *ne; ++ne) {
393 0 : if (*ne == '|') break;
394 : }
395 0 : equiv = SWIG_TypeNameComp(nb, ne, tb, te);
396 0 : if (*ne) ++ne;
397 : }
398 0 : return equiv;
399 : }
400 :
401 : /*
402 : Check type equivalence in a name list like <name1>|<name2>|...
403 : Return 0 if not equal, 1 if equal
404 : */
405 : SWIGRUNTIME int
406 : SWIG_TypeEquiv(const char *nb, const char *tb) {
407 0 : return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
408 : }
409 :
410 : /*
411 : Check the typename
412 : */
413 : SWIGRUNTIME swig_cast_info *
414 : SWIG_TypeCheck(const char *c, swig_type_info *ty) {
415 : if (ty) {
416 : swig_cast_info *iter = ty->cast;
417 : while (iter) {
418 : if (strcmp(iter->type->name, c) == 0) {
419 : if (iter == ty->cast)
420 : return iter;
421 : /* Move iter to the top of the linked list */
422 : iter->prev->next = iter->next;
423 : if (iter->next)
424 : iter->next->prev = iter->prev;
425 : iter->next = ty->cast;
426 : iter->prev = 0;
427 : if (ty->cast) ty->cast->prev = iter;
428 : ty->cast = iter;
429 : return iter;
430 : }
431 : iter = iter->next;
432 : }
433 : }
434 : return 0;
435 : }
436 :
437 : /*
438 : Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
439 : */
440 : SWIGRUNTIME swig_cast_info *
441 : SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
442 : if (ty) {
443 : swig_cast_info *iter = ty->cast;
444 : while (iter) {
445 : if (iter->type == from) {
446 : if (iter == ty->cast)
447 : return iter;
448 : /* Move iter to the top of the linked list */
449 : iter->prev->next = iter->next;
450 : if (iter->next)
451 : iter->next->prev = iter->prev;
452 : iter->next = ty->cast;
453 : iter->prev = 0;
454 : if (ty->cast) ty->cast->prev = iter;
455 : ty->cast = iter;
456 : return iter;
457 : }
458 : iter = iter->next;
459 : }
460 : }
461 : return 0;
462 : }
463 :
464 : /*
465 : Cast a pointer up an inheritance hierarchy
466 : */
467 : SWIGRUNTIMEINLINE void *
468 : SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
469 : return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
470 : }
471 :
472 : /*
473 : Dynamic pointer casting. Down an inheritance hierarchy
474 : */
475 : SWIGRUNTIME swig_type_info *
476 : SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
477 : swig_type_info *lastty = ty;
478 : if (!ty || !ty->dcast) return ty;
479 : while (ty && (ty->dcast)) {
480 : ty = (*ty->dcast)(ptr);
481 : if (ty) lastty = ty;
482 : }
483 : return lastty;
484 : }
485 :
486 : /*
487 : Return the name associated with this type
488 : */
489 : SWIGRUNTIMEINLINE const char *
490 : SWIG_TypeName(const swig_type_info *ty) {
491 : return ty->name;
492 : }
493 :
494 : /*
495 : Return the pretty name associated with this type,
496 : that is an unmangled type name in a form presentable to the user.
497 : */
498 : SWIGRUNTIME const char *
499 : SWIG_TypePrettyName(const swig_type_info *type) {
500 : /* The "str" field contains the equivalent pretty names of the
501 : type, separated by vertical-bar characters. We choose
502 : to print the last name, as it is often (?) the most
503 : specific. */
504 0 : if (!type) return NULL;
505 0 : if (type->str != NULL) {
506 : const char *last_name = type->str;
507 : const char *s;
508 0 : for (s = type->str; *s; s++)
509 0 : if (*s == '|') last_name = s+1;
510 : return last_name;
511 : }
512 : else
513 0 : return type->name;
514 : }
515 :
516 : /*
517 : Set the clientdata field for a type
518 : */
519 : SWIGRUNTIME void
520 : SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
521 : swig_cast_info *cast = ti->cast;
522 : /* if (ti->clientdata == clientdata) return; */
523 : ti->clientdata = clientdata;
524 :
525 : while (cast) {
526 : if (!cast->converter) {
527 : swig_type_info *tc = cast->type;
528 : if (!tc->clientdata) {
529 : SWIG_TypeClientData(tc, clientdata);
530 : }
531 : }
532 : cast = cast->next;
533 : }
534 : }
535 : SWIGRUNTIME void
536 : SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
537 : SWIG_TypeClientData(ti, clientdata);
538 : ti->owndata = 1;
539 : }
540 :
541 : /*
542 : Search for a swig_type_info structure only by mangled name
543 : Search is a O(log #types)
544 :
545 : We start searching at module start, and finish searching when start == end.
546 : Note: if start == end at the beginning of the function, we go all the way around
547 : the circular list.
548 : */
549 : SWIGRUNTIME swig_type_info *
550 0 : SWIG_MangledTypeQueryModule(swig_module_info *start,
551 : swig_module_info *end,
552 : const char *name) {
553 0 : swig_module_info *iter = start;
554 : do {
555 0 : if (iter->size) {
556 0 : size_t l = 0;
557 0 : size_t r = iter->size - 1;
558 : do {
559 : /* since l+r >= 0, we can (>> 1) instead (/ 2) */
560 0 : size_t i = (l + r) >> 1;
561 0 : const char *iname = iter->types[i]->name;
562 0 : if (iname) {
563 0 : int compare = strcmp(name, iname);
564 0 : if (compare == 0) {
565 : return iter->types[i];
566 0 : } else if (compare < 0) {
567 0 : if (i) {
568 0 : r = i - 1;
569 : } else {
570 : break;
571 : }
572 0 : } else if (compare > 0) {
573 0 : l = i + 1;
574 : }
575 : } else {
576 : break; /* should never happen */
577 : }
578 0 : } while (l <= r);
579 : }
580 0 : iter = iter->next;
581 0 : } while (iter != end);
582 : return 0;
583 : }
584 :
585 : /*
586 : Search for a swig_type_info structure for either a mangled name or a human readable name.
587 : It first searches the mangled names of the types, which is a O(log #types)
588 : If a type is not found it then searches the human readable names, which is O(#types).
589 :
590 : We start searching at module start, and finish searching when start == end.
591 : Note: if start == end at the beginning of the function, we go all the way around
592 : the circular list.
593 : */
594 : SWIGRUNTIME swig_type_info *
595 0 : SWIG_TypeQueryModule(swig_module_info *start,
596 : swig_module_info *end,
597 : const char *name) {
598 : /* STEP 1: Search the name field using binary search */
599 0 : swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
600 0 : if (ret) {
601 : return ret;
602 : } else {
603 : /* STEP 2: If the type hasn't been found, do a complete search
604 : of the str field (the human readable name) */
605 : swig_module_info *iter = start;
606 : do {
607 0 : size_t i = 0;
608 0 : for (; i < iter->size; ++i) {
609 0 : if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
610 : return iter->types[i];
611 : }
612 0 : iter = iter->next;
613 0 : } while (iter != end);
614 : }
615 :
616 : /* neither found a match */
617 : return 0;
618 : }
619 :
620 : /*
621 : Pack binary data into a string
622 : */
623 : SWIGRUNTIME char *
624 : SWIG_PackData(char *c, void *ptr, size_t sz) {
625 : static const char hex[17] = "0123456789abcdef";
626 : const unsigned char *u = (unsigned char *) ptr;
627 : const unsigned char *eu = u + sz;
628 : for (; u != eu; ++u) {
629 : unsigned char uu = *u;
630 : *(c++) = hex[(uu & 0xf0) >> 4];
631 : *(c++) = hex[uu & 0xf];
632 : }
633 : return c;
634 : }
635 :
636 : /*
637 : Unpack binary data from a string
638 : */
639 : SWIGRUNTIME const char *
640 : SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
641 : unsigned char *u = (unsigned char *) ptr;
642 : const unsigned char *eu = u + sz;
643 : for (; u != eu; ++u) {
644 : char d = *(c++);
645 : unsigned char uu;
646 : if ((d >= '0') && (d <= '9'))
647 : uu = (unsigned char)((d - '0') << 4);
648 : else if ((d >= 'a') && (d <= 'f'))
649 : uu = (unsigned char)((d - ('a'-10)) << 4);
650 : else
651 : return (char *) 0;
652 : d = *(c++);
653 : if ((d >= '0') && (d <= '9'))
654 : uu |= (unsigned char)(d - '0');
655 : else if ((d >= 'a') && (d <= 'f'))
656 : uu |= (unsigned char)(d - ('a'-10));
657 : else
658 : return (char *) 0;
659 : *u = uu;
660 : }
661 : return c;
662 : }
663 :
664 : /*
665 : Pack 'void *' into a string buffer.
666 : */
667 : SWIGRUNTIME char *
668 : SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
669 : char *r = buff;
670 : if ((2*sizeof(void *) + 2) > bsz) return 0;
671 : *(r++) = '_';
672 : r = SWIG_PackData(r,&ptr,sizeof(void *));
673 : if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
674 : strcpy(r,name);
675 : return buff;
676 : }
677 :
678 : SWIGRUNTIME const char *
679 : SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
680 : if (*c != '_') {
681 : if (strcmp(c,"NULL") == 0) {
682 : *ptr = (void *) 0;
683 : return name;
684 : } else {
685 : return 0;
686 : }
687 : }
688 : return SWIG_UnpackData(++c,ptr,sizeof(void *));
689 : }
690 :
691 : SWIGRUNTIME char *
692 : SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
693 : char *r = buff;
694 : size_t lname = (name ? strlen(name) : 0);
695 : if ((2*sz + 2 + lname) > bsz) return 0;
696 : *(r++) = '_';
697 : r = SWIG_PackData(r,ptr,sz);
698 : if (lname) {
699 : strncpy(r,name,lname+1);
700 : } else {
701 : *r = 0;
702 : }
703 : return buff;
704 : }
705 :
706 : SWIGRUNTIME const char *
707 : SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
708 : if (*c != '_') {
709 : if (strcmp(c,"NULL") == 0) {
710 : memset(ptr,0,sz);
711 : return name;
712 : } else {
713 : return 0;
714 : }
715 : }
716 : return SWIG_UnpackData(++c,ptr,sz);
717 : }
718 :
719 : #ifdef __cplusplus
720 : }
721 : #endif
722 : /* Compatibility macros for Python 3 */
723 : #if PY_VERSION_HEX >= 0x03000000
724 :
725 : #define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type)
726 : #define PyInt_Check(x) PyLong_Check(x)
727 : #define PyInt_AsLong(x) PyLong_AsLong(x)
728 : #define PyInt_FromLong(x) PyLong_FromLong(x)
729 : #define PyInt_FromSize_t(x) PyLong_FromSize_t(x)
730 : #define PyString_Check(name) PyBytes_Check(name)
731 : #define PyString_FromString(x) PyUnicode_FromString(x)
732 : #define PyString_Format(fmt, args) PyUnicode_Format(fmt, args)
733 : #define PyString_AsString(str) PyBytes_AsString(str)
734 : #define PyString_Size(str) PyBytes_Size(str)
735 : #define PyString_InternFromString(key) PyUnicode_InternFromString(key)
736 : #define Py_TPFLAGS_HAVE_CLASS Py_TPFLAGS_BASETYPE
737 : #define PyString_AS_STRING(x) PyUnicode_AS_STRING(x)
738 : #define _PyLong_FromSsize_t(x) PyLong_FromSsize_t(x)
739 :
740 : #endif
741 :
742 : #ifndef Py_TYPE
743 : # define Py_TYPE(op) ((op)->ob_type)
744 : #endif
745 :
746 : /* SWIG APIs for compatibility of both Python 2 & 3 */
747 :
748 : #if PY_VERSION_HEX >= 0x03000000
749 : # define SWIG_Python_str_FromFormat PyUnicode_FromFormat
750 : #else
751 : # define SWIG_Python_str_FromFormat PyString_FromFormat
752 : #endif
753 :
754 :
755 : /* Warning: This function will allocate a new string in Python 3,
756 : * so please call SWIG_Python_str_DelForPy3(x) to free the space.
757 : */
758 : SWIGINTERN char*
759 : SWIG_Python_str_AsChar(PyObject *str)
760 : {
761 : #if PY_VERSION_HEX >= 0x03000000
762 : char *cstr;
763 : char *newstr;
764 : Py_ssize_t len;
765 : str = PyUnicode_AsUTF8String(str);
766 : PyBytes_AsStringAndSize(str, &cstr, &len);
767 : newstr = (char *) malloc(len+1);
768 : memcpy(newstr, cstr, len+1);
769 : Py_XDECREF(str);
770 : return newstr;
771 : #else
772 : return PyString_AsString(str);
773 : #endif
774 : }
775 :
776 : #if PY_VERSION_HEX >= 0x03000000
777 : # define SWIG_Python_str_DelForPy3(x) free( (void*) (x) )
778 : #else
779 : # define SWIG_Python_str_DelForPy3(x)
780 : #endif
781 :
782 :
783 : SWIGINTERN PyObject*
784 : SWIG_Python_str_FromChar(const char *c)
785 : {
786 : #if PY_VERSION_HEX >= 0x03000000
787 0 : return PyUnicode_FromString(c);
788 : #else
789 : return PyString_FromString(c);
790 : #endif
791 : }
792 :
793 : /* Add PyOS_snprintf for old Pythons */
794 : #if PY_VERSION_HEX < 0x02020000
795 : # if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM)
796 : # define PyOS_snprintf _snprintf
797 : # else
798 : # define PyOS_snprintf snprintf
799 : # endif
800 : #endif
801 :
802 : /* A crude PyString_FromFormat implementation for old Pythons */
803 : #if PY_VERSION_HEX < 0x02020000
804 :
805 : #ifndef SWIG_PYBUFFER_SIZE
806 : # define SWIG_PYBUFFER_SIZE 1024
807 : #endif
808 :
809 : static PyObject *
810 : PyString_FromFormat(const char *fmt, ...) {
811 : va_list ap;
812 : char buf[SWIG_PYBUFFER_SIZE * 2];
813 : int res;
814 : va_start(ap, fmt);
815 : res = vsnprintf(buf, sizeof(buf), fmt, ap);
816 : va_end(ap);
817 : return (res < 0 || res >= (int)sizeof(buf)) ? 0 : PyString_FromString(buf);
818 : }
819 : #endif
820 :
821 : #ifndef PyObject_DEL
822 : # define PyObject_DEL PyObject_Del
823 : #endif
824 :
825 : /* A crude PyExc_StopIteration exception for old Pythons */
826 : #if PY_VERSION_HEX < 0x02020000
827 : # ifndef PyExc_StopIteration
828 : # define PyExc_StopIteration PyExc_RuntimeError
829 : # endif
830 : # ifndef PyObject_GenericGetAttr
831 : # define PyObject_GenericGetAttr 0
832 : # endif
833 : #endif
834 :
835 : /* Py_NotImplemented is defined in 2.1 and up. */
836 : #if PY_VERSION_HEX < 0x02010000
837 : # ifndef Py_NotImplemented
838 : # define Py_NotImplemented PyExc_RuntimeError
839 : # endif
840 : #endif
841 :
842 : /* A crude PyString_AsStringAndSize implementation for old Pythons */
843 : #if PY_VERSION_HEX < 0x02010000
844 : # ifndef PyString_AsStringAndSize
845 : # define PyString_AsStringAndSize(obj, s, len) {*s = PyString_AsString(obj); *len = *s ? strlen(*s) : 0;}
846 : # endif
847 : #endif
848 :
849 : /* PySequence_Size for old Pythons */
850 : #if PY_VERSION_HEX < 0x02000000
851 : # ifndef PySequence_Size
852 : # define PySequence_Size PySequence_Length
853 : # endif
854 : #endif
855 :
856 : /* PyBool_FromLong for old Pythons */
857 : #if PY_VERSION_HEX < 0x02030000
858 : static
859 : PyObject *PyBool_FromLong(long ok)
860 : {
861 : PyObject *result = ok ? Py_True : Py_False;
862 : Py_INCREF(result);
863 : return result;
864 : }
865 : #endif
866 :
867 : /* Py_ssize_t for old Pythons */
868 : /* This code is as recommended by: */
869 : /* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */
870 : #if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
871 : typedef int Py_ssize_t;
872 : # define PY_SSIZE_T_MAX INT_MAX
873 : # define PY_SSIZE_T_MIN INT_MIN
874 : typedef inquiry lenfunc;
875 : typedef intargfunc ssizeargfunc;
876 : typedef intintargfunc ssizessizeargfunc;
877 : typedef intobjargproc ssizeobjargproc;
878 : typedef intintobjargproc ssizessizeobjargproc;
879 : typedef getreadbufferproc readbufferproc;
880 : typedef getwritebufferproc writebufferproc;
881 : typedef getsegcountproc segcountproc;
882 : typedef getcharbufferproc charbufferproc;
883 : static long PyNumber_AsSsize_t (PyObject *x, void *SWIGUNUSEDPARM(exc))
884 : {
885 : long result = 0;
886 : PyObject *i = PyNumber_Int(x);
887 : if (i) {
888 : result = PyInt_AsLong(i);
889 : Py_DECREF(i);
890 : }
891 : return result;
892 : }
893 : #endif
894 :
895 : #if PY_VERSION_HEX < 0x02050000
896 : #define PyInt_FromSize_t(x) PyInt_FromLong((long)x)
897 : #endif
898 :
899 : #if PY_VERSION_HEX < 0x02040000
900 : #define Py_VISIT(op) \
901 : do { \
902 : if (op) { \
903 : int vret = visit((op), arg); \
904 : if (vret) \
905 : return vret; \
906 : } \
907 : } while (0)
908 : #endif
909 :
910 : #if PY_VERSION_HEX < 0x02030000
911 : typedef struct {
912 : PyTypeObject type;
913 : PyNumberMethods as_number;
914 : PyMappingMethods as_mapping;
915 : PySequenceMethods as_sequence;
916 : PyBufferProcs as_buffer;
917 : PyObject *name, *slots;
918 : } PyHeapTypeObject;
919 : #endif
920 :
921 : #if PY_VERSION_HEX < 0x02030000
922 : typedef destructor freefunc;
923 : #endif
924 :
925 : #if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION > 6) || \
926 : (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION > 0) || \
927 : (PY_MAJOR_VERSION > 3))
928 : # define SWIGPY_USE_CAPSULE
929 : # define SWIGPY_CAPSULE_NAME ((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME)
930 : #endif
931 :
932 : #if PY_VERSION_HEX < 0x03020000
933 : #define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type)
934 : #define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name)
935 : #endif
936 : /* -----------------------------------------------------------------------------
937 : * error manipulation
938 : * ----------------------------------------------------------------------------- */
939 :
940 : SWIGRUNTIME PyObject*
941 : SWIG_Python_ErrorType(int code) {
942 : PyObject* type = 0;
943 : switch(code) {
944 : case SWIG_MemoryError:
945 : type = PyExc_MemoryError;
946 : break;
947 : case SWIG_IOError:
948 : type = PyExc_IOError;
949 : break;
950 : case SWIG_RuntimeError:
951 : type = PyExc_RuntimeError;
952 : break;
953 : case SWIG_IndexError:
954 : type = PyExc_IndexError;
955 : break;
956 : case SWIG_TypeError:
957 : type = PyExc_TypeError;
958 : break;
959 : case SWIG_DivisionByZero:
960 : type = PyExc_ZeroDivisionError;
961 : break;
962 : case SWIG_OverflowError:
963 : type = PyExc_OverflowError;
964 : break;
965 : case SWIG_SyntaxError:
966 : type = PyExc_SyntaxError;
967 : break;
968 : case SWIG_ValueError:
969 : type = PyExc_ValueError;
970 : break;
971 : case SWIG_SystemError:
972 : type = PyExc_SystemError;
973 : break;
974 : case SWIG_AttributeError:
975 : type = PyExc_AttributeError;
976 : break;
977 : default:
978 : type = PyExc_RuntimeError;
979 : }
980 : return type;
981 : }
982 :
983 :
984 : SWIGRUNTIME void
985 : SWIG_Python_AddErrorMsg(const char* mesg)
986 : {
987 : PyObject *type = 0;
988 : PyObject *value = 0;
989 : PyObject *traceback = 0;
990 :
991 : if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback);
992 : if (value) {
993 : char *tmp;
994 : PyObject *old_str = PyObject_Str(value);
995 : PyErr_Clear();
996 : Py_XINCREF(type);
997 :
998 : PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
999 : SWIG_Python_str_DelForPy3(tmp);
1000 : Py_DECREF(old_str);
1001 : Py_DECREF(value);
1002 : } else {
1003 : PyErr_SetString(PyExc_RuntimeError, mesg);
1004 : }
1005 : }
1006 : #if defined(SWIG_PYTHON_NO_THREADS)
1007 : # if defined(SWIG_PYTHON_THREADS)
1008 : # undef SWIG_PYTHON_THREADS
1009 : # endif
1010 : #endif
1011 : #if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */
1012 : # if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL)
1013 : # if (PY_VERSION_HEX >= 0x02030000) /* For 2.3 or later, use the PyGILState calls */
1014 : # define SWIG_PYTHON_USE_GIL
1015 : # endif
1016 : # endif
1017 : # if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */
1018 : # ifndef SWIG_PYTHON_INITIALIZE_THREADS
1019 : # define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads()
1020 : # endif
1021 : # ifdef __cplusplus /* C++ code */
1022 : class SWIG_Python_Thread_Block {
1023 : bool status;
1024 : PyGILState_STATE state;
1025 : public:
1026 : void end() { if (status) { PyGILState_Release(state); status = false;} }
1027 : SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {}
1028 : ~SWIG_Python_Thread_Block() { end(); }
1029 : };
1030 : class SWIG_Python_Thread_Allow {
1031 : bool status;
1032 : PyThreadState *save;
1033 : public:
1034 : void end() { if (status) { PyEval_RestoreThread(save); status = false; }}
1035 : SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {}
1036 : ~SWIG_Python_Thread_Allow() { end(); }
1037 : };
1038 : # define SWIG_PYTHON_THREAD_BEGIN_BLOCK SWIG_Python_Thread_Block _swig_thread_block
1039 : # define SWIG_PYTHON_THREAD_END_BLOCK _swig_thread_block.end()
1040 : # define SWIG_PYTHON_THREAD_BEGIN_ALLOW SWIG_Python_Thread_Allow _swig_thread_allow
1041 : # define SWIG_PYTHON_THREAD_END_ALLOW _swig_thread_allow.end()
1042 : # else /* C code */
1043 : # define SWIG_PYTHON_THREAD_BEGIN_BLOCK PyGILState_STATE _swig_thread_block = PyGILState_Ensure()
1044 : # define SWIG_PYTHON_THREAD_END_BLOCK PyGILState_Release(_swig_thread_block)
1045 : # define SWIG_PYTHON_THREAD_BEGIN_ALLOW PyThreadState *_swig_thread_allow = PyEval_SaveThread()
1046 : # define SWIG_PYTHON_THREAD_END_ALLOW PyEval_RestoreThread(_swig_thread_allow)
1047 : # endif
1048 : # else /* Old thread way, not implemented, user must provide it */
1049 : # if !defined(SWIG_PYTHON_INITIALIZE_THREADS)
1050 : # define SWIG_PYTHON_INITIALIZE_THREADS
1051 : # endif
1052 : # if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK)
1053 : # define SWIG_PYTHON_THREAD_BEGIN_BLOCK
1054 : # endif
1055 : # if !defined(SWIG_PYTHON_THREAD_END_BLOCK)
1056 : # define SWIG_PYTHON_THREAD_END_BLOCK
1057 : # endif
1058 : # if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW)
1059 : # define SWIG_PYTHON_THREAD_BEGIN_ALLOW
1060 : # endif
1061 : # if !defined(SWIG_PYTHON_THREAD_END_ALLOW)
1062 : # define SWIG_PYTHON_THREAD_END_ALLOW
1063 : # endif
1064 : # endif
1065 : #else /* No thread support */
1066 : # define SWIG_PYTHON_INITIALIZE_THREADS
1067 : # define SWIG_PYTHON_THREAD_BEGIN_BLOCK
1068 : # define SWIG_PYTHON_THREAD_END_BLOCK
1069 : # define SWIG_PYTHON_THREAD_BEGIN_ALLOW
1070 : # define SWIG_PYTHON_THREAD_END_ALLOW
1071 : #endif
1072 : /* -----------------------------------------------------------------------------
1073 : * Python API portion that goes into the runtime
1074 : * ----------------------------------------------------------------------------- */
1075 :
1076 : #ifdef __cplusplus
1077 : extern "C" {
1078 : #endif
1079 :
1080 : /* -----------------------------------------------------------------------------
1081 : * Constant declarations
1082 : * ----------------------------------------------------------------------------- */
1083 :
1084 : /* Constant Types */
1085 : #define SWIG_PY_POINTER 4
1086 : #define SWIG_PY_BINARY 5
1087 :
1088 : /* Constant information structure */
1089 : typedef struct swig_const_info {
1090 : int type;
1091 : char *name;
1092 : long lvalue;
1093 : double dvalue;
1094 : void *pvalue;
1095 : swig_type_info **ptype;
1096 : } swig_const_info;
1097 :
1098 :
1099 : /* -----------------------------------------------------------------------------
1100 : * Wrapper of PyInstanceMethod_New() used in Python 3
1101 : * It is exported to the generated module, used for -fastproxy
1102 : * ----------------------------------------------------------------------------- */
1103 : #if PY_VERSION_HEX >= 0x03000000
1104 : SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func)
1105 : {
1106 : return PyInstanceMethod_New(func);
1107 : }
1108 : #else
1109 : SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *SWIGUNUSEDPARM(func))
1110 : {
1111 : return NULL;
1112 : }
1113 : #endif
1114 :
1115 : #ifdef __cplusplus
1116 : }
1117 : #endif
1118 :
1119 : /* -----------------------------------------------------------------------------
1120 : * pyrun.swg
1121 : *
1122 : * This file contains the runtime support for Python modules
1123 : * and includes code for managing global variables and pointer
1124 : * type checking.
1125 : *
1126 : * ----------------------------------------------------------------------------- */
1127 :
1128 : /* Common SWIG API */
1129 :
1130 : /* for raw pointers */
1131 : #define SWIG_Python_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
1132 : #define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtr(obj, pptr, type, flags)
1133 : #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own)
1134 :
1135 : #ifdef SWIGPYTHON_BUILTIN
1136 : #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(self, ptr, type, flags)
1137 : #else
1138 : #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
1139 : #endif
1140 :
1141 : #define SWIG_InternalNewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
1142 :
1143 : #define SWIG_CheckImplicit(ty) SWIG_Python_CheckImplicit(ty)
1144 : #define SWIG_AcquirePtr(ptr, src) SWIG_Python_AcquirePtr(ptr, src)
1145 : #define swig_owntype int
1146 :
1147 : /* for raw packed data */
1148 : #define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
1149 : #define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type)
1150 :
1151 : /* for class or struct pointers */
1152 : #define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
1153 : #define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
1154 :
1155 : /* for C or C++ function pointers */
1156 : #define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Python_ConvertFunctionPtr(obj, pptr, type)
1157 : #define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(NULL, ptr, type, 0)
1158 :
1159 : /* for C++ member pointers, ie, member methods */
1160 : #define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
1161 : #define SWIG_NewMemberObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type)
1162 :
1163 :
1164 : /* Runtime API */
1165 :
1166 : #define SWIG_GetModule(clientdata) SWIG_Python_GetModule(clientdata)
1167 : #define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer)
1168 : #define SWIG_NewClientData(obj) SwigPyClientData_New(obj)
1169 :
1170 : #define SWIG_SetErrorObj SWIG_Python_SetErrorObj
1171 : #define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg
1172 : #define SWIG_ErrorType(code) SWIG_Python_ErrorType(code)
1173 : #define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg)
1174 : #define SWIG_fail goto fail
1175 :
1176 :
1177 : /* Runtime API implementation */
1178 :
1179 : /* Error manipulation */
1180 :
1181 : SWIGINTERN void
1182 : SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) {
1183 : SWIG_PYTHON_THREAD_BEGIN_BLOCK;
1184 : PyErr_SetObject(errtype, obj);
1185 : Py_DECREF(obj);
1186 : SWIG_PYTHON_THREAD_END_BLOCK;
1187 : }
1188 :
1189 : SWIGINTERN void
1190 : SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) {
1191 : SWIG_PYTHON_THREAD_BEGIN_BLOCK;
1192 : PyErr_SetString(errtype, msg);
1193 : SWIG_PYTHON_THREAD_END_BLOCK;
1194 : }
1195 :
1196 : #define SWIG_Python_Raise(obj, type, desc) SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj)
1197 :
1198 : /* Set a constant value */
1199 :
1200 : #if defined(SWIGPYTHON_BUILTIN)
1201 :
1202 : SWIGINTERN void
1203 : SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) {
1204 : PyObject *s = PyString_InternFromString(key);
1205 : PyList_Append(seq, s);
1206 : Py_DECREF(s);
1207 : }
1208 :
1209 : SWIGINTERN void
1210 : SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) {
1211 : #if PY_VERSION_HEX < 0x02030000
1212 : PyDict_SetItemString(d, (char *)name, obj);
1213 : #else
1214 : PyDict_SetItemString(d, name, obj);
1215 : #endif
1216 : Py_DECREF(obj);
1217 : if (public_interface)
1218 : SwigPyBuiltin_AddPublicSymbol(public_interface, name);
1219 : }
1220 :
1221 : #else
1222 :
1223 : SWIGINTERN void
1224 : SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) {
1225 : #if PY_VERSION_HEX < 0x02030000
1226 : PyDict_SetItemString(d, (char *)name, obj);
1227 : #else
1228 : PyDict_SetItemString(d, name, obj);
1229 : #endif
1230 : Py_DECREF(obj);
1231 : }
1232 :
1233 : #endif
1234 :
1235 : /* Append a value to the result obj */
1236 :
1237 : SWIGINTERN PyObject*
1238 : SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) {
1239 : #if !defined(SWIG_PYTHON_OUTPUT_TUPLE)
1240 : if (!result) {
1241 : result = obj;
1242 : } else if (result == Py_None) {
1243 : Py_DECREF(result);
1244 : result = obj;
1245 : } else {
1246 : if (!PyList_Check(result)) {
1247 : PyObject *o2 = result;
1248 : result = PyList_New(1);
1249 : PyList_SetItem(result, 0, o2);
1250 : }
1251 : PyList_Append(result,obj);
1252 : Py_DECREF(obj);
1253 : }
1254 : return result;
1255 : #else
1256 : PyObject* o2;
1257 : PyObject* o3;
1258 : if (!result) {
1259 : result = obj;
1260 : } else if (result == Py_None) {
1261 : Py_DECREF(result);
1262 : result = obj;
1263 : } else {
1264 : if (!PyTuple_Check(result)) {
1265 : o2 = result;
1266 : result = PyTuple_New(1);
1267 : PyTuple_SET_ITEM(result, 0, o2);
1268 : }
1269 : o3 = PyTuple_New(1);
1270 : PyTuple_SET_ITEM(o3, 0, obj);
1271 : o2 = result;
1272 : result = PySequence_Concat(o2, o3);
1273 : Py_DECREF(o2);
1274 : Py_DECREF(o3);
1275 : }
1276 : return result;
1277 : #endif
1278 : }
1279 :
1280 : /* Unpack the argument tuple */
1281 :
1282 : SWIGINTERN Py_ssize_t
1283 : SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
1284 : {
1285 : if (!args) {
1286 : if (!min && !max) {
1287 : return 1;
1288 : } else {
1289 : PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none",
1290 : name, (min == max ? "" : "at least "), (int)min);
1291 : return 0;
1292 : }
1293 : }
1294 : if (!PyTuple_Check(args)) {
1295 : if (min <= 1 && max >= 1) {
1296 : Py_ssize_t i;
1297 : objs[0] = args;
1298 : for (i = 1; i < max; ++i) {
1299 : objs[i] = 0;
1300 : }
1301 : return 2;
1302 : }
1303 : PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple");
1304 : return 0;
1305 : } else {
1306 : Py_ssize_t l = PyTuple_GET_SIZE(args);
1307 : if (l < min) {
1308 : PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
1309 : name, (min == max ? "" : "at least "), (int)min, (int)l);
1310 : return 0;
1311 : } else if (l > max) {
1312 : PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
1313 : name, (min == max ? "" : "at most "), (int)max, (int)l);
1314 : return 0;
1315 : } else {
1316 : Py_ssize_t i;
1317 : for (i = 0; i < l; ++i) {
1318 : objs[i] = PyTuple_GET_ITEM(args, i);
1319 : }
1320 : for (; l < max; ++l) {
1321 : objs[l] = 0;
1322 : }
1323 : return i + 1;
1324 : }
1325 : }
1326 : }
1327 :
1328 : /* A functor is a function object with one single object argument */
1329 : #if PY_VERSION_HEX >= 0x02020000
1330 : #define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL);
1331 : #else
1332 : #define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunction(functor, "O", obj);
1333 : #endif
1334 :
1335 : /*
1336 : Helper for static pointer initialization for both C and C++ code, for example
1337 : static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...);
1338 : */
1339 : #ifdef __cplusplus
1340 : #define SWIG_STATIC_POINTER(var) var
1341 : #else
1342 : #define SWIG_STATIC_POINTER(var) var = 0; if (!var) var
1343 : #endif
1344 :
1345 : /* -----------------------------------------------------------------------------
1346 : * Pointer declarations
1347 : * ----------------------------------------------------------------------------- */
1348 :
1349 : /* Flags for new pointer objects */
1350 : #define SWIG_POINTER_NOSHADOW (SWIG_POINTER_OWN << 1)
1351 : #define SWIG_POINTER_NEW (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN)
1352 :
1353 : #define SWIG_POINTER_IMPLICIT_CONV (SWIG_POINTER_DISOWN << 1)
1354 :
1355 : #define SWIG_BUILTIN_TP_INIT (SWIG_POINTER_OWN << 2)
1356 : #define SWIG_BUILTIN_INIT (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN)
1357 :
1358 : #ifdef __cplusplus
1359 : extern "C" {
1360 : #endif
1361 :
1362 : /* How to access Py_None */
1363 : #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
1364 : # ifndef SWIG_PYTHON_NO_BUILD_NONE
1365 : # ifndef SWIG_PYTHON_BUILD_NONE
1366 : # define SWIG_PYTHON_BUILD_NONE
1367 : # endif
1368 : # endif
1369 : #endif
1370 :
1371 : #ifdef SWIG_PYTHON_BUILD_NONE
1372 : # ifdef Py_None
1373 : # undef Py_None
1374 : # define Py_None SWIG_Py_None()
1375 : # endif
1376 : SWIGRUNTIMEINLINE PyObject *
1377 : _SWIG_Py_None(void)
1378 : {
1379 : PyObject *none = Py_BuildValue((char*)"");
1380 : Py_DECREF(none);
1381 : return none;
1382 : }
1383 : SWIGRUNTIME PyObject *
1384 : SWIG_Py_None(void)
1385 : {
1386 : static PyObject *SWIG_STATIC_POINTER(none) = _SWIG_Py_None();
1387 : return none;
1388 : }
1389 : #endif
1390 :
1391 : /* The python void return value */
1392 :
1393 : SWIGRUNTIMEINLINE PyObject *
1394 : SWIG_Py_Void(void)
1395 : {
1396 0 : PyObject *none = Py_None;
1397 0 : Py_INCREF(none);
1398 : return none;
1399 : }
1400 :
1401 : /* SwigPyClientData */
1402 :
1403 : typedef struct {
1404 : PyObject *klass;
1405 : PyObject *newraw;
1406 : PyObject *newargs;
1407 : PyObject *destroy;
1408 : int delargs;
1409 : int implicitconv;
1410 : PyTypeObject *pytype;
1411 : } SwigPyClientData;
1412 :
1413 : SWIGRUNTIMEINLINE int
1414 : SWIG_Python_CheckImplicit(swig_type_info *ty)
1415 : {
1416 : SwigPyClientData *data = (SwigPyClientData *)ty->clientdata;
1417 : return data ? data->implicitconv : 0;
1418 : }
1419 :
1420 : SWIGRUNTIMEINLINE PyObject *
1421 : SWIG_Python_ExceptionType(swig_type_info *desc) {
1422 : SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0;
1423 : PyObject *klass = data ? data->klass : 0;
1424 : return (klass ? klass : PyExc_RuntimeError);
1425 : }
1426 :
1427 :
1428 : SWIGRUNTIME SwigPyClientData *
1429 : SwigPyClientData_New(PyObject* obj)
1430 : {
1431 : if (!obj) {
1432 : return 0;
1433 : } else {
1434 : SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData));
1435 : /* the klass element */
1436 : data->klass = obj;
1437 : Py_INCREF(data->klass);
1438 : /* the newraw method and newargs arguments used to create a new raw instance */
1439 : if (PyClass_Check(obj)) {
1440 : data->newraw = 0;
1441 : data->newargs = obj;
1442 : Py_INCREF(obj);
1443 : } else {
1444 : #if (PY_VERSION_HEX < 0x02020000)
1445 : data->newraw = 0;
1446 : #else
1447 : data->newraw = PyObject_GetAttrString(data->klass, (char *)"__new__");
1448 : #endif
1449 : if (data->newraw) {
1450 : Py_INCREF(data->newraw);
1451 : data->newargs = PyTuple_New(1);
1452 : PyTuple_SetItem(data->newargs, 0, obj);
1453 : } else {
1454 : data->newargs = obj;
1455 : }
1456 : Py_INCREF(data->newargs);
1457 : }
1458 : /* the destroy method, aka as the C++ delete method */
1459 : data->destroy = PyObject_GetAttrString(data->klass, (char *)"__swig_destroy__");
1460 : if (PyErr_Occurred()) {
1461 : PyErr_Clear();
1462 : data->destroy = 0;
1463 : }
1464 : if (data->destroy) {
1465 : int flags;
1466 : Py_INCREF(data->destroy);
1467 : flags = PyCFunction_GET_FLAGS(data->destroy);
1468 : #ifdef METH_O
1469 : data->delargs = !(flags & (METH_O));
1470 : #else
1471 : data->delargs = 0;
1472 : #endif
1473 : } else {
1474 : data->delargs = 0;
1475 : }
1476 : data->implicitconv = 0;
1477 : data->pytype = 0;
1478 : return data;
1479 : }
1480 : }
1481 :
1482 : SWIGRUNTIME void
1483 : SwigPyClientData_Del(SwigPyClientData *data) {
1484 : Py_XDECREF(data->newraw);
1485 : Py_XDECREF(data->newargs);
1486 : Py_XDECREF(data->destroy);
1487 : }
1488 :
1489 : /* =============== SwigPyObject =====================*/
1490 :
1491 : typedef struct {
1492 : PyObject_HEAD
1493 : void *ptr;
1494 : swig_type_info *ty;
1495 : int own;
1496 : PyObject *next;
1497 : #ifdef SWIGPYTHON_BUILTIN
1498 : PyObject *dict;
1499 : #endif
1500 : } SwigPyObject;
1501 :
1502 :
1503 : #ifdef SWIGPYTHON_BUILTIN
1504 :
1505 : SWIGRUNTIME PyObject *
1506 : SwigPyObject_get___dict__(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
1507 : {
1508 : SwigPyObject *sobj = (SwigPyObject *)v;
1509 :
1510 : if (!sobj->dict)
1511 : sobj->dict = PyDict_New();
1512 :
1513 : Py_INCREF(sobj->dict);
1514 : return sobj->dict;
1515 : }
1516 :
1517 : #endif
1518 :
1519 : SWIGRUNTIME PyObject *
1520 0 : SwigPyObject_long(SwigPyObject *v)
1521 : {
1522 0 : return PyLong_FromVoidPtr(v->ptr);
1523 : }
1524 :
1525 : SWIGRUNTIME PyObject *
1526 : SwigPyObject_format(const char* fmt, SwigPyObject *v)
1527 : {
1528 : PyObject *res = NULL;
1529 : PyObject *args = PyTuple_New(1);
1530 : if (args) {
1531 : if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) {
1532 : PyObject *ofmt = SWIG_Python_str_FromChar(fmt);
1533 : if (ofmt) {
1534 : #if PY_VERSION_HEX >= 0x03000000
1535 : res = PyUnicode_Format(ofmt,args);
1536 : #else
1537 : res = PyString_Format(ofmt,args);
1538 : #endif
1539 : Py_DECREF(ofmt);
1540 : }
1541 : Py_DECREF(args);
1542 : }
1543 : }
1544 : return res;
1545 : }
1546 :
1547 : SWIGRUNTIME PyObject *
1548 : SwigPyObject_oct(SwigPyObject *v)
1549 : {
1550 : return SwigPyObject_format("%o",v);
1551 : }
1552 :
1553 : SWIGRUNTIME PyObject *
1554 : SwigPyObject_hex(SwigPyObject *v)
1555 : {
1556 : return SwigPyObject_format("%x",v);
1557 : }
1558 :
1559 : SWIGRUNTIME PyObject *
1560 : #ifdef METH_NOARGS
1561 0 : SwigPyObject_repr(SwigPyObject *v)
1562 : #else
1563 : SwigPyObject_repr(SwigPyObject *v, PyObject *args)
1564 : #endif
1565 : {
1566 0 : const char *name = SWIG_TypePrettyName(v->ty);
1567 0 : PyObject *repr = SWIG_Python_str_FromFormat("<Swig Object of type '%s' at %p>", (name ? name : "unknown"), (void *)v);
1568 0 : if (v->next) {
1569 : # ifdef METH_NOARGS
1570 0 : PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next);
1571 : # else
1572 : PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args);
1573 : # endif
1574 : # if PY_VERSION_HEX >= 0x03000000
1575 0 : PyObject *joined = PyUnicode_Concat(repr, nrep);
1576 0 : Py_DecRef(repr);
1577 0 : Py_DecRef(nrep);
1578 0 : repr = joined;
1579 : # else
1580 : PyString_ConcatAndDel(&repr,nrep);
1581 : # endif
1582 : }
1583 0 : return repr;
1584 : }
1585 :
1586 : SWIGRUNTIME int
1587 : SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w)
1588 : {
1589 0 : void *i = v->ptr;
1590 0 : void *j = w->ptr;
1591 0 : return (i < j) ? -1 : ((i > j) ? 1 : 0);
1592 : }
1593 :
1594 : /* Added for Python 3.x, would it also be useful for Python 2.x? */
1595 : SWIGRUNTIME PyObject*
1596 0 : SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op)
1597 : {
1598 : PyObject* res;
1599 0 : if( op != Py_EQ && op != Py_NE ) {
1600 0 : Py_INCREF(Py_NotImplemented);
1601 0 : return Py_NotImplemented;
1602 : }
1603 0 : res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0);
1604 0 : return res;
1605 : }
1606 :
1607 :
1608 : SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void);
1609 :
1610 : #ifdef SWIGPYTHON_BUILTIN
1611 : static swig_type_info *SwigPyObject_stype = 0;
1612 : SWIGRUNTIME PyTypeObject*
1613 : SwigPyObject_type(void) {
1614 : SwigPyClientData *cd;
1615 : assert(SwigPyObject_stype);
1616 : cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
1617 : assert(cd);
1618 : assert(cd->pytype);
1619 : return cd->pytype;
1620 : }
1621 : #else
1622 : SWIGRUNTIME PyTypeObject*
1623 0 : SwigPyObject_type(void) {
1624 0 : static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce();
1625 0 : return type;
1626 : }
1627 : #endif
1628 :
1629 : SWIGRUNTIMEINLINE int
1630 0 : SwigPyObject_Check(PyObject *op) {
1631 : #ifdef SWIGPYTHON_BUILTIN
1632 : PyTypeObject *target_tp = SwigPyObject_type();
1633 : if (PyType_IsSubtype(op->ob_type, target_tp))
1634 : return 1;
1635 : return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0);
1636 : #else
1637 0 : return (Py_TYPE(op) == SwigPyObject_type())
1638 0 : || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0);
1639 : #endif
1640 : }
1641 :
1642 : SWIGRUNTIME PyObject *
1643 : SwigPyObject_New(void *ptr, swig_type_info *ty, int own);
1644 :
1645 : SWIGRUNTIME void
1646 0 : SwigPyObject_dealloc(PyObject *v)
1647 : {
1648 0 : SwigPyObject *sobj = (SwigPyObject *) v;
1649 0 : PyObject *next = sobj->next;
1650 0 : if (sobj->own == SWIG_POINTER_OWN) {
1651 0 : swig_type_info *ty = sobj->ty;
1652 0 : SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
1653 0 : PyObject *destroy = data ? data->destroy : 0;
1654 0 : if (destroy) {
1655 : /* destroy is always a VARARGS method */
1656 : PyObject *res;
1657 :
1658 : /* PyObject_CallFunction() has the potential to silently drop
1659 : the active active exception. In cases of unnamed temporary
1660 : variable or where we just finished iterating over a generator
1661 : StopIteration will be active right now, and this needs to
1662 : remain true upon return from SwigPyObject_dealloc. So save
1663 : and restore. */
1664 :
1665 0 : PyObject *val = NULL, *type = NULL, *tb = NULL;
1666 0 : PyErr_Fetch(&val, &type, &tb);
1667 :
1668 0 : if (data->delargs) {
1669 : /* we need to create a temporary object to carry the destroy operation */
1670 0 : PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0);
1671 0 : res = SWIG_Python_CallFunctor(destroy, tmp);
1672 0 : Py_DECREF(tmp);
1673 : } else {
1674 0 : PyCFunction meth = PyCFunction_GET_FUNCTION(destroy);
1675 0 : PyObject *mself = PyCFunction_GET_SELF(destroy);
1676 0 : res = ((*meth)(mself, v));
1677 : }
1678 0 : if (!res)
1679 0 : PyErr_WriteUnraisable(destroy);
1680 :
1681 0 : PyErr_Restore(val, type, tb);
1682 :
1683 0 : Py_XDECREF(res);
1684 : }
1685 : #if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
1686 : else {
1687 0 : const char *name = SWIG_TypePrettyName(ty);
1688 0 : printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown"));
1689 : }
1690 : #endif
1691 : }
1692 0 : Py_XDECREF(next);
1693 0 : PyObject_DEL(v);
1694 0 : }
1695 :
1696 : SWIGRUNTIME PyObject*
1697 0 : SwigPyObject_append(PyObject* v, PyObject* next)
1698 : {
1699 0 : SwigPyObject *sobj = (SwigPyObject *) v;
1700 : #ifndef METH_O
1701 : PyObject *tmp = 0;
1702 : if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL;
1703 : next = tmp;
1704 : #endif
1705 0 : if (!SwigPyObject_Check(next)) {
1706 0 : PyErr_SetString(PyExc_TypeError, "Attempt to append a non SwigPyObject");
1707 0 : return NULL;
1708 : }
1709 0 : sobj->next = next;
1710 0 : Py_INCREF(next);
1711 0 : return SWIG_Py_Void();
1712 : }
1713 :
1714 : SWIGRUNTIME PyObject*
1715 : #ifdef METH_NOARGS
1716 0 : SwigPyObject_next(PyObject* v)
1717 : #else
1718 : SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1719 : #endif
1720 : {
1721 0 : SwigPyObject *sobj = (SwigPyObject *) v;
1722 0 : if (sobj->next) {
1723 0 : Py_INCREF(sobj->next);
1724 0 : return sobj->next;
1725 : } else {
1726 0 : return SWIG_Py_Void();
1727 : }
1728 : }
1729 :
1730 : SWIGINTERN PyObject*
1731 : #ifdef METH_NOARGS
1732 0 : SwigPyObject_disown(PyObject *v)
1733 : #else
1734 : SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1735 : #endif
1736 : {
1737 0 : SwigPyObject *sobj = (SwigPyObject *)v;
1738 0 : sobj->own = 0;
1739 0 : return SWIG_Py_Void();
1740 : }
1741 :
1742 : SWIGINTERN PyObject*
1743 : #ifdef METH_NOARGS
1744 0 : SwigPyObject_acquire(PyObject *v)
1745 : #else
1746 : SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1747 : #endif
1748 : {
1749 0 : SwigPyObject *sobj = (SwigPyObject *)v;
1750 0 : sobj->own = SWIG_POINTER_OWN;
1751 0 : return SWIG_Py_Void();
1752 : }
1753 :
1754 : SWIGINTERN PyObject*
1755 0 : SwigPyObject_own(PyObject *v, PyObject *args)
1756 : {
1757 0 : PyObject *val = 0;
1758 : #if (PY_VERSION_HEX < 0x02020000)
1759 : if (!PyArg_ParseTuple(args,(char *)"|O:own",&val))
1760 : #elif (PY_VERSION_HEX < 0x02050000)
1761 : if (!PyArg_UnpackTuple(args, (char *)"own", 0, 1, &val))
1762 : #else
1763 0 : if (!PyArg_UnpackTuple(args, "own", 0, 1, &val))
1764 : #endif
1765 : {
1766 : return NULL;
1767 : }
1768 : else
1769 : {
1770 0 : SwigPyObject *sobj = (SwigPyObject *)v;
1771 0 : PyObject *obj = PyBool_FromLong(sobj->own);
1772 0 : if (val) {
1773 : #ifdef METH_NOARGS
1774 0 : if (PyObject_IsTrue(val)) {
1775 : SwigPyObject_acquire(v);
1776 : } else {
1777 : SwigPyObject_disown(v);
1778 : }
1779 : #else
1780 : if (PyObject_IsTrue(val)) {
1781 : SwigPyObject_acquire(v,args);
1782 : } else {
1783 : SwigPyObject_disown(v,args);
1784 : }
1785 : #endif
1786 : }
1787 : return obj;
1788 : }
1789 : }
1790 :
1791 : #ifdef METH_O
1792 : static PyMethodDef
1793 : swigobject_methods[] = {
1794 : {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"},
1795 : {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS, (char *)"acquires ownership of the pointer"},
1796 : {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
1797 : {(char *)"append", (PyCFunction)SwigPyObject_append, METH_O, (char *)"appends another 'this' object"},
1798 : {(char *)"next", (PyCFunction)SwigPyObject_next, METH_NOARGS, (char *)"returns the next 'this' object"},
1799 : {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_NOARGS, (char *)"returns object representation"},
1800 : {0, 0, 0, 0}
1801 : };
1802 : #else
1803 : static PyMethodDef
1804 : swigobject_methods[] = {
1805 : {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"},
1806 : {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"acquires ownership of the pointer"},
1807 : {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
1808 : {(char *)"append", (PyCFunction)SwigPyObject_append, METH_VARARGS, (char *)"appends another 'this' object"},
1809 : {(char *)"next", (PyCFunction)SwigPyObject_next, METH_VARARGS, (char *)"returns the next 'this' object"},
1810 : {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_VARARGS, (char *)"returns object representation"},
1811 : {0, 0, 0, 0}
1812 : };
1813 : #endif
1814 :
1815 : #if PY_VERSION_HEX < 0x02020000
1816 : SWIGINTERN PyObject *
1817 : SwigPyObject_getattr(SwigPyObject *sobj,char *name)
1818 : {
1819 : return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name);
1820 : }
1821 : #endif
1822 :
1823 : SWIGRUNTIME PyTypeObject*
1824 0 : SwigPyObject_TypeOnce(void) {
1825 : static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer";
1826 :
1827 : static PyNumberMethods SwigPyObject_as_number = {
1828 : (binaryfunc)0, /*nb_add*/
1829 : (binaryfunc)0, /*nb_subtract*/
1830 : (binaryfunc)0, /*nb_multiply*/
1831 : /* nb_divide removed in Python 3 */
1832 : #if PY_VERSION_HEX < 0x03000000
1833 : (binaryfunc)0, /*nb_divide*/
1834 : #endif
1835 : (binaryfunc)0, /*nb_remainder*/
1836 : (binaryfunc)0, /*nb_divmod*/
1837 : (ternaryfunc)0,/*nb_power*/
1838 : (unaryfunc)0, /*nb_negative*/
1839 : (unaryfunc)0, /*nb_positive*/
1840 : (unaryfunc)0, /*nb_absolute*/
1841 : (inquiry)0, /*nb_nonzero*/
1842 : 0, /*nb_invert*/
1843 : 0, /*nb_lshift*/
1844 : 0, /*nb_rshift*/
1845 : 0, /*nb_and*/
1846 : 0, /*nb_xor*/
1847 : 0, /*nb_or*/
1848 : #if PY_VERSION_HEX < 0x03000000
1849 : 0, /*nb_coerce*/
1850 : #endif
1851 : (unaryfunc)SwigPyObject_long, /*nb_int*/
1852 : #if PY_VERSION_HEX < 0x03000000
1853 : (unaryfunc)SwigPyObject_long, /*nb_long*/
1854 : #else
1855 : 0, /*nb_reserved*/
1856 : #endif
1857 : (unaryfunc)0, /*nb_float*/
1858 : #if PY_VERSION_HEX < 0x03000000
1859 : (unaryfunc)SwigPyObject_oct, /*nb_oct*/
1860 : (unaryfunc)SwigPyObject_hex, /*nb_hex*/
1861 : #endif
1862 : #if PY_VERSION_HEX >= 0x03050000 /* 3.5 */
1863 : 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_matrix_multiply */
1864 : #elif PY_VERSION_HEX >= 0x03000000 /* 3.0 */
1865 : 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */
1866 : #elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */
1867 : 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */
1868 : #elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */
1869 : 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */
1870 : #elif PY_VERSION_HEX >= 0x02000000 /* 2.0.0 */
1871 : 0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */
1872 : #endif
1873 : };
1874 :
1875 : static PyTypeObject swigpyobject_type;
1876 : static int type_init = 0;
1877 0 : if (!type_init) {
1878 : const PyTypeObject tmp = {
1879 : /* PyObject header changed in Python 3 */
1880 : #if PY_VERSION_HEX >= 0x03000000
1881 : PyVarObject_HEAD_INIT(NULL, 0)
1882 : #else
1883 : PyObject_HEAD_INIT(NULL)
1884 : 0, /* ob_size */
1885 : #endif
1886 : (char *)"SwigPyObject", /* tp_name */
1887 : sizeof(SwigPyObject), /* tp_basicsize */
1888 : 0, /* tp_itemsize */
1889 : (destructor)SwigPyObject_dealloc, /* tp_dealloc */
1890 : 0, /* tp_print */
1891 : #if PY_VERSION_HEX < 0x02020000
1892 : (getattrfunc)SwigPyObject_getattr, /* tp_getattr */
1893 : #else
1894 : (getattrfunc)0, /* tp_getattr */
1895 : #endif
1896 : (setattrfunc)0, /* tp_setattr */
1897 : #if PY_VERSION_HEX >= 0x03000000
1898 : 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */
1899 : #else
1900 : (cmpfunc)SwigPyObject_compare, /* tp_compare */
1901 : #endif
1902 : (reprfunc)SwigPyObject_repr, /* tp_repr */
1903 : &SwigPyObject_as_number, /* tp_as_number */
1904 : 0, /* tp_as_sequence */
1905 : 0, /* tp_as_mapping */
1906 : (hashfunc)0, /* tp_hash */
1907 : (ternaryfunc)0, /* tp_call */
1908 : 0, /* tp_str */
1909 : PyObject_GenericGetAttr, /* tp_getattro */
1910 : 0, /* tp_setattro */
1911 : 0, /* tp_as_buffer */
1912 : Py_TPFLAGS_DEFAULT, /* tp_flags */
1913 : swigobject_doc, /* tp_doc */
1914 : 0, /* tp_traverse */
1915 : 0, /* tp_clear */
1916 : (richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */
1917 : 0, /* tp_weaklistoffset */
1918 : #if PY_VERSION_HEX >= 0x02020000
1919 : 0, /* tp_iter */
1920 : 0, /* tp_iternext */
1921 : swigobject_methods, /* tp_methods */
1922 : 0, /* tp_members */
1923 : 0, /* tp_getset */
1924 : 0, /* tp_base */
1925 : 0, /* tp_dict */
1926 : 0, /* tp_descr_get */
1927 : 0, /* tp_descr_set */
1928 : 0, /* tp_dictoffset */
1929 : 0, /* tp_init */
1930 : 0, /* tp_alloc */
1931 : 0, /* tp_new */
1932 : 0, /* tp_free */
1933 : 0, /* tp_is_gc */
1934 : 0, /* tp_bases */
1935 : 0, /* tp_mro */
1936 : 0, /* tp_cache */
1937 : 0, /* tp_subclasses */
1938 : 0, /* tp_weaklist */
1939 : #endif
1940 : #if PY_VERSION_HEX >= 0x02030000
1941 : 0, /* tp_del */
1942 : #endif
1943 : #if PY_VERSION_HEX >= 0x02060000
1944 : 0, /* tp_version_tag */
1945 : #endif
1946 : #if PY_VERSION_HEX >= 0x03040000
1947 : 0, /* tp_finalize */
1948 : #endif
1949 : #ifdef COUNT_ALLOCS
1950 : 0, /* tp_allocs */
1951 : 0, /* tp_frees */
1952 : 0, /* tp_maxalloc */
1953 : #if PY_VERSION_HEX >= 0x02050000
1954 : 0, /* tp_prev */
1955 : #endif
1956 : 0 /* tp_next */
1957 : #endif
1958 0 : };
1959 0 : swigpyobject_type = tmp;
1960 0 : type_init = 1;
1961 : #if PY_VERSION_HEX < 0x02020000
1962 : swigpyobject_type.ob_type = &PyType_Type;
1963 : #else
1964 0 : if (PyType_Ready(&swigpyobject_type) < 0)
1965 0 : return NULL;
1966 : #endif
1967 : }
1968 : return &swigpyobject_type;
1969 : }
1970 :
1971 : SWIGRUNTIME PyObject *
1972 0 : SwigPyObject_New(void *ptr, swig_type_info *ty, int own)
1973 : {
1974 0 : SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type());
1975 0 : if (sobj) {
1976 0 : sobj->ptr = ptr;
1977 0 : sobj->ty = ty;
1978 0 : sobj->own = own;
1979 0 : sobj->next = 0;
1980 : }
1981 0 : return (PyObject *)sobj;
1982 : }
1983 :
1984 : /* -----------------------------------------------------------------------------
1985 : * Implements a simple Swig Packed type, and use it instead of string
1986 : * ----------------------------------------------------------------------------- */
1987 :
1988 : typedef struct {
1989 : PyObject_HEAD
1990 : void *pack;
1991 : swig_type_info *ty;
1992 : size_t size;
1993 : } SwigPyPacked;
1994 :
1995 : SWIGRUNTIME int
1996 : SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags))
1997 : {
1998 : char result[SWIG_BUFFER_SIZE];
1999 : fputs("<Swig Packed ", fp);
2000 : if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
2001 : fputs("at ", fp);
2002 : fputs(result, fp);
2003 : }
2004 : fputs(v->ty->name,fp);
2005 : fputs(">", fp);
2006 : return 0;
2007 : }
2008 :
2009 : SWIGRUNTIME PyObject *
2010 : SwigPyPacked_repr(SwigPyPacked *v)
2011 : {
2012 : char result[SWIG_BUFFER_SIZE];
2013 : if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
2014 : return SWIG_Python_str_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);
2015 : } else {
2016 : return SWIG_Python_str_FromFormat("<Swig Packed %s>", v->ty->name);
2017 : }
2018 : }
2019 :
2020 : SWIGRUNTIME PyObject *
2021 : SwigPyPacked_str(SwigPyPacked *v)
2022 : {
2023 : char result[SWIG_BUFFER_SIZE];
2024 : if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){
2025 : return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name);
2026 : } else {
2027 : return SWIG_Python_str_FromChar(v->ty->name);
2028 : }
2029 : }
2030 :
2031 : SWIGRUNTIME int
2032 : SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w)
2033 : {
2034 : size_t i = v->size;
2035 : size_t j = w->size;
2036 : int s = (i < j) ? -1 : ((i > j) ? 1 : 0);
2037 : return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size);
2038 : }
2039 :
2040 : SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void);
2041 :
2042 : SWIGRUNTIME PyTypeObject*
2043 : SwigPyPacked_type(void) {
2044 : static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce();
2045 : return type;
2046 : }
2047 :
2048 : SWIGRUNTIMEINLINE int
2049 : SwigPyPacked_Check(PyObject *op) {
2050 : return ((op)->ob_type == SwigPyPacked_TypeOnce())
2051 : || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0);
2052 : }
2053 :
2054 : SWIGRUNTIME void
2055 : SwigPyPacked_dealloc(PyObject *v)
2056 : {
2057 : if (SwigPyPacked_Check(v)) {
2058 : SwigPyPacked *sobj = (SwigPyPacked *) v;
2059 : free(sobj->pack);
2060 : }
2061 : PyObject_DEL(v);
2062 : }
2063 :
2064 : SWIGRUNTIME PyTypeObject*
2065 : SwigPyPacked_TypeOnce(void) {
2066 : static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer";
2067 : static PyTypeObject swigpypacked_type;
2068 : static int type_init = 0;
2069 : if (!type_init) {
2070 : const PyTypeObject tmp = {
2071 : /* PyObject header changed in Python 3 */
2072 : #if PY_VERSION_HEX>=0x03000000
2073 : PyVarObject_HEAD_INIT(NULL, 0)
2074 : #else
2075 : PyObject_HEAD_INIT(NULL)
2076 : 0, /* ob_size */
2077 : #endif
2078 : (char *)"SwigPyPacked", /* tp_name */
2079 : sizeof(SwigPyPacked), /* tp_basicsize */
2080 : 0, /* tp_itemsize */
2081 : (destructor)SwigPyPacked_dealloc, /* tp_dealloc */
2082 : (printfunc)SwigPyPacked_print, /* tp_print */
2083 : (getattrfunc)0, /* tp_getattr */
2084 : (setattrfunc)0, /* tp_setattr */
2085 : #if PY_VERSION_HEX>=0x03000000
2086 : 0, /* tp_reserved in 3.0.1 */
2087 : #else
2088 : (cmpfunc)SwigPyPacked_compare, /* tp_compare */
2089 : #endif
2090 : (reprfunc)SwigPyPacked_repr, /* tp_repr */
2091 : 0, /* tp_as_number */
2092 : 0, /* tp_as_sequence */
2093 : 0, /* tp_as_mapping */
2094 : (hashfunc)0, /* tp_hash */
2095 : (ternaryfunc)0, /* tp_call */
2096 : (reprfunc)SwigPyPacked_str, /* tp_str */
2097 : PyObject_GenericGetAttr, /* tp_getattro */
2098 : 0, /* tp_setattro */
2099 : 0, /* tp_as_buffer */
2100 : Py_TPFLAGS_DEFAULT, /* tp_flags */
2101 : swigpacked_doc, /* tp_doc */
2102 : 0, /* tp_traverse */
2103 : 0, /* tp_clear */
2104 : 0, /* tp_richcompare */
2105 : 0, /* tp_weaklistoffset */
2106 : #if PY_VERSION_HEX >= 0x02020000
2107 : 0, /* tp_iter */
2108 : 0, /* tp_iternext */
2109 : 0, /* tp_methods */
2110 : 0, /* tp_members */
2111 : 0, /* tp_getset */
2112 : 0, /* tp_base */
2113 : 0, /* tp_dict */
2114 : 0, /* tp_descr_get */
2115 : 0, /* tp_descr_set */
2116 : 0, /* tp_dictoffset */
2117 : 0, /* tp_init */
2118 : 0, /* tp_alloc */
2119 : 0, /* tp_new */
2120 : 0, /* tp_free */
2121 : 0, /* tp_is_gc */
2122 : 0, /* tp_bases */
2123 : 0, /* tp_mro */
2124 : 0, /* tp_cache */
2125 : 0, /* tp_subclasses */
2126 : 0, /* tp_weaklist */
2127 : #endif
2128 : #if PY_VERSION_HEX >= 0x02030000
2129 : 0, /* tp_del */
2130 : #endif
2131 : #if PY_VERSION_HEX >= 0x02060000
2132 : 0, /* tp_version_tag */
2133 : #endif
2134 : #if PY_VERSION_HEX >= 0x03040000
2135 : 0, /* tp_finalize */
2136 : #endif
2137 : #ifdef COUNT_ALLOCS
2138 : 0, /* tp_allocs */
2139 : 0, /* tp_frees */
2140 : 0, /* tp_maxalloc */
2141 : #if PY_VERSION_HEX >= 0x02050000
2142 : 0, /* tp_prev */
2143 : #endif
2144 : 0 /* tp_next */
2145 : #endif
2146 : };
2147 : swigpypacked_type = tmp;
2148 : type_init = 1;
2149 : #if PY_VERSION_HEX < 0x02020000
2150 : swigpypacked_type.ob_type = &PyType_Type;
2151 : #else
2152 : if (PyType_Ready(&swigpypacked_type) < 0)
2153 : return NULL;
2154 : #endif
2155 : }
2156 : return &swigpypacked_type;
2157 : }
2158 :
2159 : SWIGRUNTIME PyObject *
2160 : SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty)
2161 : {
2162 : SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type());
2163 : if (sobj) {
2164 : void *pack = malloc(size);
2165 : if (pack) {
2166 : memcpy(pack, ptr, size);
2167 : sobj->pack = pack;
2168 : sobj->ty = ty;
2169 : sobj->size = size;
2170 : } else {
2171 : PyObject_DEL((PyObject *) sobj);
2172 : sobj = 0;
2173 : }
2174 : }
2175 : return (PyObject *) sobj;
2176 : }
2177 :
2178 : SWIGRUNTIME swig_type_info *
2179 : SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
2180 : {
2181 : if (SwigPyPacked_Check(obj)) {
2182 : SwigPyPacked *sobj = (SwigPyPacked *)obj;
2183 : if (sobj->size != size) return 0;
2184 : memcpy(ptr, sobj->pack, size);
2185 : return sobj->ty;
2186 : } else {
2187 : return 0;
2188 : }
2189 : }
2190 :
2191 : /* -----------------------------------------------------------------------------
2192 : * pointers/data manipulation
2193 : * ----------------------------------------------------------------------------- */
2194 :
2195 : SWIGRUNTIMEINLINE PyObject *
2196 : _SWIG_This(void)
2197 : {
2198 0 : return SWIG_Python_str_FromChar("this");
2199 : }
2200 :
2201 : static PyObject *swig_this = NULL;
2202 :
2203 : SWIGRUNTIME PyObject *
2204 : SWIG_This(void)
2205 : {
2206 0 : if (swig_this == NULL)
2207 0 : swig_this = _SWIG_This();
2208 0 : return swig_this;
2209 : }
2210 :
2211 : /* #define SWIG_PYTHON_SLOW_GETSET_THIS */
2212 :
2213 : /* TODO: I don't know how to implement the fast getset in Python 3 right now */
2214 : #if PY_VERSION_HEX>=0x03000000
2215 : #define SWIG_PYTHON_SLOW_GETSET_THIS
2216 : #endif
2217 :
2218 : SWIGRUNTIME SwigPyObject *
2219 : SWIG_Python_GetSwigThis(PyObject *pyobj)
2220 : {
2221 : PyObject *obj;
2222 :
2223 : if (SwigPyObject_Check(pyobj))
2224 : return (SwigPyObject *) pyobj;
2225 :
2226 : #ifdef SWIGPYTHON_BUILTIN
2227 : (void)obj;
2228 : # ifdef PyWeakref_CheckProxy
2229 : if (PyWeakref_CheckProxy(pyobj)) {
2230 : pyobj = PyWeakref_GET_OBJECT(pyobj);
2231 : if (pyobj && SwigPyObject_Check(pyobj))
2232 : return (SwigPyObject*) pyobj;
2233 : }
2234 : # endif
2235 : return NULL;
2236 : #else
2237 :
2238 : obj = 0;
2239 :
2240 : #if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000))
2241 : if (PyInstance_Check(pyobj)) {
2242 : obj = _PyInstance_Lookup(pyobj, SWIG_This());
2243 : } else {
2244 : PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
2245 : if (dictptr != NULL) {
2246 : PyObject *dict = *dictptr;
2247 : obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0;
2248 : } else {
2249 : #ifdef PyWeakref_CheckProxy
2250 : if (PyWeakref_CheckProxy(pyobj)) {
2251 : PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
2252 : return wobj ? SWIG_Python_GetSwigThis(wobj) : 0;
2253 : }
2254 : #endif
2255 : obj = PyObject_GetAttr(pyobj,SWIG_This());
2256 : if (obj) {
2257 : Py_DECREF(obj);
2258 : } else {
2259 : if (PyErr_Occurred()) PyErr_Clear();
2260 : return 0;
2261 : }
2262 : }
2263 : }
2264 : #else
2265 : obj = PyObject_GetAttr(pyobj,SWIG_This());
2266 : if (obj) {
2267 : Py_DECREF(obj);
2268 : } else {
2269 : if (PyErr_Occurred()) PyErr_Clear();
2270 : return 0;
2271 : }
2272 : #endif
2273 : if (obj && !SwigPyObject_Check(obj)) {
2274 : /* a PyObject is called 'this', try to get the 'real this'
2275 : SwigPyObject from it */
2276 : return SWIG_Python_GetSwigThis(obj);
2277 : }
2278 : return (SwigPyObject *)obj;
2279 : #endif
2280 : }
2281 :
2282 : /* Acquire a pointer value */
2283 :
2284 : SWIGRUNTIME int
2285 : SWIG_Python_AcquirePtr(PyObject *obj, int own) {
2286 : if (own == SWIG_POINTER_OWN) {
2287 : SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj);
2288 : if (sobj) {
2289 : int oldown = sobj->own;
2290 : sobj->own = own;
2291 : return oldown;
2292 : }
2293 : }
2294 : return 0;
2295 : }
2296 :
2297 : /* Convert a pointer value */
2298 :
2299 : SWIGRUNTIME int
2300 : SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) {
2301 : int res;
2302 : SwigPyObject *sobj;
2303 : int implicit_conv = (flags & SWIG_POINTER_IMPLICIT_CONV) != 0;
2304 :
2305 : if (!obj)
2306 : return SWIG_ERROR;
2307 : if (obj == Py_None && !implicit_conv) {
2308 : if (ptr)
2309 : *ptr = 0;
2310 : return SWIG_OK;
2311 : }
2312 :
2313 : res = SWIG_ERROR;
2314 :
2315 : sobj = SWIG_Python_GetSwigThis(obj);
2316 : if (own)
2317 : *own = 0;
2318 : while (sobj) {
2319 : void *vptr = sobj->ptr;
2320 : if (ty) {
2321 : swig_type_info *to = sobj->ty;
2322 : if (to == ty) {
2323 : /* no type cast needed */
2324 : if (ptr) *ptr = vptr;
2325 : break;
2326 : } else {
2327 : swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
2328 : if (!tc) {
2329 : sobj = (SwigPyObject *)sobj->next;
2330 : } else {
2331 : if (ptr) {
2332 : int newmemory = 0;
2333 : *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
2334 : if (newmemory == SWIG_CAST_NEW_MEMORY) {
2335 : assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
2336 : if (own)
2337 : *own = *own | SWIG_CAST_NEW_MEMORY;
2338 : }
2339 : }
2340 : break;
2341 : }
2342 : }
2343 : } else {
2344 : if (ptr) *ptr = vptr;
2345 : break;
2346 : }
2347 : }
2348 : if (sobj) {
2349 : if (own)
2350 : *own = *own | sobj->own;
2351 : if (flags & SWIG_POINTER_DISOWN) {
2352 : sobj->own = 0;
2353 : }
2354 : res = SWIG_OK;
2355 : } else {
2356 : if (implicit_conv) {
2357 : SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
2358 : if (data && !data->implicitconv) {
2359 : PyObject *klass = data->klass;
2360 : if (klass) {
2361 : PyObject *impconv;
2362 : data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/
2363 : impconv = SWIG_Python_CallFunctor(klass, obj);
2364 : data->implicitconv = 0;
2365 : if (PyErr_Occurred()) {
2366 : PyErr_Clear();
2367 : impconv = 0;
2368 : }
2369 : if (impconv) {
2370 : SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv);
2371 : if (iobj) {
2372 : void *vptr;
2373 : res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
2374 : if (SWIG_IsOK(res)) {
2375 : if (ptr) {
2376 : *ptr = vptr;
2377 : /* transfer the ownership to 'ptr' */
2378 : iobj->own = 0;
2379 : res = SWIG_AddCast(res);
2380 : res = SWIG_AddNewMask(res);
2381 : } else {
2382 : res = SWIG_AddCast(res);
2383 : }
2384 : }
2385 : }
2386 : Py_DECREF(impconv);
2387 : }
2388 : }
2389 : }
2390 : }
2391 : if (!SWIG_IsOK(res) && obj == Py_None) {
2392 : if (ptr)
2393 : *ptr = 0;
2394 : if (PyErr_Occurred())
2395 : PyErr_Clear();
2396 : res = SWIG_OK;
2397 : }
2398 : }
2399 : return res;
2400 : }
2401 :
2402 : /* Convert a function ptr value */
2403 :
2404 : SWIGRUNTIME int
2405 : SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
2406 : if (!PyCFunction_Check(obj)) {
2407 : return SWIG_ConvertPtr(obj, ptr, ty, 0);
2408 : } else {
2409 : void *vptr = 0;
2410 :
2411 : /* here we get the method pointer for callbacks */
2412 : const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
2413 : const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
2414 : if (desc)
2415 : desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
2416 : if (!desc)
2417 : return SWIG_ERROR;
2418 : if (ty) {
2419 : swig_cast_info *tc = SWIG_TypeCheck(desc,ty);
2420 : if (tc) {
2421 : int newmemory = 0;
2422 : *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
2423 : assert(!newmemory); /* newmemory handling not yet implemented */
2424 : } else {
2425 : return SWIG_ERROR;
2426 : }
2427 : } else {
2428 : *ptr = vptr;
2429 : }
2430 : return SWIG_OK;
2431 : }
2432 : }
2433 :
2434 : /* Convert a packed value value */
2435 :
2436 : SWIGRUNTIME int
2437 : SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) {
2438 : swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz);
2439 : if (!to) return SWIG_ERROR;
2440 : if (ty) {
2441 : if (to != ty) {
2442 : /* check type cast? */
2443 : swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
2444 : if (!tc) return SWIG_ERROR;
2445 : }
2446 : }
2447 : return SWIG_OK;
2448 : }
2449 :
2450 : /* -----------------------------------------------------------------------------
2451 : * Create a new pointer object
2452 : * ----------------------------------------------------------------------------- */
2453 :
2454 : /*
2455 : Create a new instance object, without calling __init__, and set the
2456 : 'this' attribute.
2457 : */
2458 :
2459 : SWIGRUNTIME PyObject*
2460 0 : SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
2461 : {
2462 : #if (PY_VERSION_HEX >= 0x02020000)
2463 0 : PyObject *inst = 0;
2464 0 : PyObject *newraw = data->newraw;
2465 0 : if (newraw) {
2466 0 : inst = PyObject_Call(newraw, data->newargs, NULL);
2467 0 : if (inst) {
2468 : #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2469 : PyObject **dictptr = _PyObject_GetDictPtr(inst);
2470 : if (dictptr != NULL) {
2471 : PyObject *dict = *dictptr;
2472 : if (dict == NULL) {
2473 : dict = PyDict_New();
2474 : *dictptr = dict;
2475 : PyDict_SetItem(dict, SWIG_This(), swig_this);
2476 : }
2477 : }
2478 : #else
2479 0 : PyObject *key = SWIG_This();
2480 0 : PyObject_SetAttr(inst, key, swig_this);
2481 : #endif
2482 : }
2483 : } else {
2484 : #if PY_VERSION_HEX >= 0x03000000
2485 0 : inst = ((PyTypeObject*) data->newargs)->tp_new((PyTypeObject*) data->newargs, Py_None, Py_None);
2486 0 : if (inst) {
2487 0 : PyObject_SetAttr(inst, SWIG_This(), swig_this);
2488 0 : Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
2489 : }
2490 : #else
2491 : PyObject *dict = PyDict_New();
2492 : if (dict) {
2493 : PyDict_SetItem(dict, SWIG_This(), swig_this);
2494 : inst = PyInstance_NewRaw(data->newargs, dict);
2495 : Py_DECREF(dict);
2496 : }
2497 : #endif
2498 : }
2499 0 : return inst;
2500 : #else
2501 : #if (PY_VERSION_HEX >= 0x02010000)
2502 : PyObject *inst = 0;
2503 : PyObject *dict = PyDict_New();
2504 : if (dict) {
2505 : PyDict_SetItem(dict, SWIG_This(), swig_this);
2506 : inst = PyInstance_NewRaw(data->newargs, dict);
2507 : Py_DECREF(dict);
2508 : }
2509 : return (PyObject *) inst;
2510 : #else
2511 : PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type);
2512 : if (inst == NULL) {
2513 : return NULL;
2514 : }
2515 : inst->in_class = (PyClassObject *)data->newargs;
2516 : Py_INCREF(inst->in_class);
2517 : inst->in_dict = PyDict_New();
2518 : if (inst->in_dict == NULL) {
2519 : Py_DECREF(inst);
2520 : return NULL;
2521 : }
2522 : #ifdef Py_TPFLAGS_HAVE_WEAKREFS
2523 : inst->in_weakreflist = NULL;
2524 : #endif
2525 : #ifdef Py_TPFLAGS_GC
2526 : PyObject_GC_Init(inst);
2527 : #endif
2528 : PyDict_SetItem(inst->in_dict, SWIG_This(), swig_this);
2529 : return (PyObject *) inst;
2530 : #endif
2531 : #endif
2532 : }
2533 :
2534 : SWIGRUNTIME void
2535 : SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this)
2536 : {
2537 : PyObject *dict;
2538 : #if (PY_VERSION_HEX >= 0x02020000) && !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2539 : PyObject **dictptr = _PyObject_GetDictPtr(inst);
2540 : if (dictptr != NULL) {
2541 : dict = *dictptr;
2542 : if (dict == NULL) {
2543 : dict = PyDict_New();
2544 : *dictptr = dict;
2545 : }
2546 : PyDict_SetItem(dict, SWIG_This(), swig_this);
2547 : return;
2548 : }
2549 : #endif
2550 : dict = PyObject_GetAttrString(inst, (char*)"__dict__");
2551 : PyDict_SetItem(dict, SWIG_This(), swig_this);
2552 : Py_DECREF(dict);
2553 : }
2554 :
2555 :
2556 : SWIGINTERN PyObject *
2557 : SWIG_Python_InitShadowInstance(PyObject *args) {
2558 : PyObject *obj[2];
2559 : if (!SWIG_Python_UnpackTuple(args, "swiginit", 2, 2, obj)) {
2560 : return NULL;
2561 : } else {
2562 : SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]);
2563 : if (sthis) {
2564 : SwigPyObject_append((PyObject*) sthis, obj[1]);
2565 : } else {
2566 : SWIG_Python_SetSwigThis(obj[0], obj[1]);
2567 : }
2568 : return SWIG_Py_Void();
2569 : }
2570 : }
2571 :
2572 : /* Create a new pointer object */
2573 :
2574 : SWIGRUNTIME PyObject *
2575 0 : SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags) {
2576 : SwigPyClientData *clientdata;
2577 : PyObject * robj;
2578 : int own;
2579 :
2580 0 : if (!ptr)
2581 0 : return SWIG_Py_Void();
2582 :
2583 0 : clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0;
2584 0 : own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
2585 0 : if (clientdata && clientdata->pytype) {
2586 : SwigPyObject *newobj;
2587 0 : if (flags & SWIG_BUILTIN_TP_INIT) {
2588 0 : newobj = (SwigPyObject*) self;
2589 0 : if (newobj->ptr) {
2590 0 : PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0);
2591 0 : while (newobj->next)
2592 : newobj = (SwigPyObject *) newobj->next;
2593 0 : newobj->next = next_self;
2594 0 : newobj = (SwigPyObject *)next_self;
2595 : #ifdef SWIGPYTHON_BUILTIN
2596 : newobj->dict = 0;
2597 : #endif
2598 : }
2599 : } else {
2600 0 : newobj = PyObject_New(SwigPyObject, clientdata->pytype);
2601 : #ifdef SWIGPYTHON_BUILTIN
2602 : newobj->dict = 0;
2603 : #endif
2604 : }
2605 0 : if (newobj) {
2606 0 : newobj->ptr = ptr;
2607 0 : newobj->ty = type;
2608 0 : newobj->own = own;
2609 0 : newobj->next = 0;
2610 0 : return (PyObject*) newobj;
2611 : }
2612 0 : return SWIG_Py_Void();
2613 : }
2614 :
2615 : assert(!(flags & SWIG_BUILTIN_TP_INIT));
2616 :
2617 0 : robj = SwigPyObject_New(ptr, type, own);
2618 0 : if (robj && clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
2619 0 : PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
2620 0 : Py_DECREF(robj);
2621 : robj = inst;
2622 : }
2623 : return robj;
2624 : }
2625 :
2626 : /* Create a new packed object */
2627 :
2628 : SWIGRUNTIMEINLINE PyObject *
2629 : SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
2630 : return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void();
2631 : }
2632 :
2633 : /* -----------------------------------------------------------------------------*
2634 : * Get type list
2635 : * -----------------------------------------------------------------------------*/
2636 :
2637 : #ifdef SWIG_LINK_RUNTIME
2638 : void *SWIG_ReturnGlobalTypeList(void *);
2639 : #endif
2640 :
2641 : SWIGRUNTIME swig_module_info *
2642 0 : SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) {
2643 : static void *type_pointer = (void *)0;
2644 : /* first check if module already created */
2645 0 : if (!type_pointer) {
2646 : #ifdef SWIG_LINK_RUNTIME
2647 : type_pointer = SWIG_ReturnGlobalTypeList((void *)0);
2648 : #else
2649 : # ifdef SWIGPY_USE_CAPSULE
2650 0 : type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0);
2651 : # else
2652 : type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
2653 : (char*)"type_pointer" SWIG_TYPE_TABLE_NAME);
2654 : # endif
2655 0 : if (PyErr_Occurred()) {
2656 0 : PyErr_Clear();
2657 0 : type_pointer = (void *)0;
2658 : }
2659 : #endif
2660 : }
2661 0 : return (swig_module_info *) type_pointer;
2662 : }
2663 :
2664 : #if PY_MAJOR_VERSION < 2
2665 : /* PyModule_AddObject function was introduced in Python 2.0. The following function
2666 : is copied out of Python/modsupport.c in python version 2.3.4 */
2667 : SWIGINTERN int
2668 : PyModule_AddObject(PyObject *m, char *name, PyObject *o)
2669 : {
2670 : PyObject *dict;
2671 : if (!PyModule_Check(m)) {
2672 : PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs module as first arg");
2673 : return SWIG_ERROR;
2674 : }
2675 : if (!o) {
2676 : PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs non-NULL value");
2677 : return SWIG_ERROR;
2678 : }
2679 :
2680 : dict = PyModule_GetDict(m);
2681 : if (dict == NULL) {
2682 : /* Internal error -- modules must have a dict! */
2683 : PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__",
2684 : PyModule_GetName(m));
2685 : return SWIG_ERROR;
2686 : }
2687 : if (PyDict_SetItemString(dict, name, o))
2688 : return SWIG_ERROR;
2689 : Py_DECREF(o);
2690 : return SWIG_OK;
2691 : }
2692 : #endif
2693 :
2694 : SWIGRUNTIME void
2695 : #ifdef SWIGPY_USE_CAPSULE
2696 : SWIG_Python_DestroyModule(PyObject *obj)
2697 : #else
2698 : SWIG_Python_DestroyModule(void *vptr)
2699 : #endif
2700 : {
2701 : #ifdef SWIGPY_USE_CAPSULE
2702 : swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME);
2703 : #else
2704 : swig_module_info *swig_module = (swig_module_info *) vptr;
2705 : #endif
2706 : swig_type_info **types = swig_module->types;
2707 : size_t i;
2708 : for (i =0; i < swig_module->size; ++i) {
2709 : swig_type_info *ty = types[i];
2710 : if (ty->owndata) {
2711 : SwigPyClientData *data = (SwigPyClientData *) ty->clientdata;
2712 : if (data) SwigPyClientData_Del(data);
2713 : }
2714 : }
2715 : Py_DECREF(SWIG_This());
2716 : swig_this = NULL;
2717 : }
2718 :
2719 : SWIGRUNTIME void
2720 : SWIG_Python_SetModule(swig_module_info *swig_module) {
2721 : #if PY_VERSION_HEX >= 0x03000000
2722 : /* Add a dummy module object into sys.modules */
2723 : PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION);
2724 : #else
2725 : static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */
2726 : PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table);
2727 : #endif
2728 : #ifdef SWIGPY_USE_CAPSULE
2729 : PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule);
2730 : if (pointer && module) {
2731 : PyModule_AddObject(module, (char*)"type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer);
2732 : } else {
2733 : Py_XDECREF(pointer);
2734 : }
2735 : #else
2736 : PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule);
2737 : if (pointer && module) {
2738 : PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer);
2739 : } else {
2740 : Py_XDECREF(pointer);
2741 : }
2742 : #endif
2743 : }
2744 :
2745 : /* The python cached type query */
2746 : SWIGRUNTIME PyObject *
2747 : SWIG_Python_TypeCache(void) {
2748 : static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New();
2749 : return cache;
2750 : }
2751 :
2752 : SWIGRUNTIME swig_type_info *
2753 : SWIG_Python_TypeQuery(const char *type)
2754 : {
2755 : PyObject *cache = SWIG_Python_TypeCache();
2756 : PyObject *key = SWIG_Python_str_FromChar(type);
2757 : PyObject *obj = PyDict_GetItem(cache, key);
2758 : swig_type_info *descriptor;
2759 : if (obj) {
2760 : #ifdef SWIGPY_USE_CAPSULE
2761 : descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL);
2762 : #else
2763 : descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj);
2764 : #endif
2765 : } else {
2766 : swig_module_info *swig_module = SWIG_GetModule(0);
2767 : descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type);
2768 : if (descriptor) {
2769 : #ifdef SWIGPY_USE_CAPSULE
2770 : obj = PyCapsule_New((void*) descriptor, NULL, NULL);
2771 : #else
2772 : obj = PyCObject_FromVoidPtr(descriptor, NULL);
2773 : #endif
2774 : PyDict_SetItem(cache, key, obj);
2775 : Py_DECREF(obj);
2776 : }
2777 : }
2778 : Py_DECREF(key);
2779 : return descriptor;
2780 : }
2781 :
2782 : /*
2783 : For backward compatibility only
2784 : */
2785 : #define SWIG_POINTER_EXCEPTION 0
2786 : #define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg)
2787 : #define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags)
2788 :
2789 : SWIGRUNTIME int
2790 : SWIG_Python_AddErrMesg(const char* mesg, int infront)
2791 : {
2792 : if (PyErr_Occurred()) {
2793 : PyObject *type = 0;
2794 : PyObject *value = 0;
2795 : PyObject *traceback = 0;
2796 : PyErr_Fetch(&type, &value, &traceback);
2797 : if (value) {
2798 : char *tmp;
2799 : PyObject *old_str = PyObject_Str(value);
2800 : Py_XINCREF(type);
2801 : PyErr_Clear();
2802 : if (infront) {
2803 : PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str));
2804 : } else {
2805 : PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
2806 : }
2807 : SWIG_Python_str_DelForPy3(tmp);
2808 : Py_DECREF(old_str);
2809 : }
2810 : return 1;
2811 : } else {
2812 : return 0;
2813 : }
2814 : }
2815 :
2816 : SWIGRUNTIME int
2817 : SWIG_Python_ArgFail(int argnum)
2818 : {
2819 : if (PyErr_Occurred()) {
2820 : /* add information about failing argument */
2821 : char mesg[256];
2822 : PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum);
2823 : return SWIG_Python_AddErrMesg(mesg, 1);
2824 : } else {
2825 : return 0;
2826 : }
2827 : }
2828 :
2829 : SWIGRUNTIMEINLINE const char *
2830 : SwigPyObject_GetDesc(PyObject *self)
2831 : {
2832 : SwigPyObject *v = (SwigPyObject *)self;
2833 : swig_type_info *ty = v ? v->ty : 0;
2834 : return ty ? ty->str : "";
2835 : }
2836 :
2837 : SWIGRUNTIME void
2838 : SWIG_Python_TypeError(const char *type, PyObject *obj)
2839 : {
2840 : if (type) {
2841 : #if defined(SWIG_COBJECT_TYPES)
2842 : if (obj && SwigPyObject_Check(obj)) {
2843 : const char *otype = (const char *) SwigPyObject_GetDesc(obj);
2844 : if (otype) {
2845 : PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received",
2846 : type, otype);
2847 : return;
2848 : }
2849 : } else
2850 : #endif
2851 : {
2852 : const char *otype = (obj ? obj->ob_type->tp_name : 0);
2853 : if (otype) {
2854 : PyObject *str = PyObject_Str(obj);
2855 : const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0;
2856 : if (cstr) {
2857 : PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received",
2858 : type, otype, cstr);
2859 : SWIG_Python_str_DelForPy3(cstr);
2860 : } else {
2861 : PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
2862 : type, otype);
2863 : }
2864 : Py_XDECREF(str);
2865 : return;
2866 : }
2867 : }
2868 : PyErr_Format(PyExc_TypeError, "a '%s' is expected", type);
2869 : } else {
2870 : PyErr_Format(PyExc_TypeError, "unexpected type is received");
2871 : }
2872 : }
2873 :
2874 :
2875 : /* Convert a pointer value, signal an exception on a type mismatch */
2876 : SWIGRUNTIME void *
2877 : SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags) {
2878 : void *result;
2879 : if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
2880 : PyErr_Clear();
2881 : #if SWIG_POINTER_EXCEPTION
2882 : if (flags) {
2883 : SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
2884 : SWIG_Python_ArgFail(argnum);
2885 : }
2886 : #endif
2887 : }
2888 : return result;
2889 : }
2890 :
2891 : #ifdef SWIGPYTHON_BUILTIN
2892 : SWIGRUNTIME int
2893 : SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) {
2894 : PyTypeObject *tp = obj->ob_type;
2895 : PyObject *descr;
2896 : PyObject *encoded_name;
2897 : descrsetfunc f;
2898 : int res = -1;
2899 :
2900 : # ifdef Py_USING_UNICODE
2901 : if (PyString_Check(name)) {
2902 : name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL);
2903 : if (!name)
2904 : return -1;
2905 : } else if (!PyUnicode_Check(name))
2906 : # else
2907 : if (!PyString_Check(name))
2908 : # endif
2909 : {
2910 : PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name);
2911 : return -1;
2912 : } else {
2913 : Py_INCREF(name);
2914 : }
2915 :
2916 : if (!tp->tp_dict) {
2917 : if (PyType_Ready(tp) < 0)
2918 : goto done;
2919 : }
2920 :
2921 : descr = _PyType_Lookup(tp, name);
2922 : f = NULL;
2923 : if (descr != NULL)
2924 : f = descr->ob_type->tp_descr_set;
2925 : if (!f) {
2926 : if (PyString_Check(name)) {
2927 : encoded_name = name;
2928 : Py_INCREF(name);
2929 : } else {
2930 : encoded_name = PyUnicode_AsUTF8String(name);
2931 : }
2932 : PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name));
2933 : Py_DECREF(encoded_name);
2934 : } else {
2935 : res = f(descr, obj, value);
2936 : }
2937 :
2938 : done:
2939 : Py_DECREF(name);
2940 : return res;
2941 : }
2942 : #endif
2943 :
2944 :
2945 : #ifdef __cplusplus
2946 : }
2947 : #endif
2948 : /* -----------------------------------------------------------------------------*
2949 : Standard SWIG API for use inside user code.
2950 :
2951 : Don't include this file directly, run the command
2952 : swig -python -external-runtime
2953 : Also, read the Modules chapter of the SWIG Manual.
2954 :
2955 : * -----------------------------------------------------------------------------*/
2956 :
2957 : #ifdef SWIG_MODULE_CLIENTDATA_TYPE
2958 :
2959 : SWIGRUNTIMEINLINE swig_type_info *
2960 : SWIG_TypeQuery(SWIG_MODULE_CLIENTDATA_TYPE clientdata, const char *name) {
2961 : swig_module_info *module = SWIG_GetModule(clientdata);
2962 : return SWIG_TypeQueryModule(module, module, name);
2963 : }
2964 :
2965 : SWIGRUNTIMEINLINE swig_type_info *
2966 : SWIG_MangledTypeQuery(SWIG_MODULE_CLIENTDATA_TYPE clientdata, const char *name) {
2967 : swig_module_info *module = SWIG_GetModule(clientdata);
2968 : return SWIG_MangledTypeQueryModule(module, module, name);
2969 : }
2970 :
2971 : #else
2972 :
2973 : SWIGRUNTIMEINLINE swig_type_info *
2974 : SWIG_TypeQuery(const char *name) {
2975 0 : swig_module_info *module = SWIG_GetModule(NULL);
2976 0 : return SWIG_TypeQueryModule(module, module, name);
2977 : }
2978 :
2979 : SWIGRUNTIMEINLINE swig_type_info *
2980 : SWIG_MangledTypeQuery(const char *name) {
2981 : swig_module_info *module = SWIG_GetModule(NULL);
2982 : return SWIG_MangledTypeQueryModule(module, module, name);
2983 : }
2984 :
2985 : #endif
|