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