1 /* ----------------------------------------------------------------------------
2  * This file was automatically generated by SWIG (http://www.swig.org).
3  * Version 4.0.2
4  *
5  * This file is not intended to be easily readable and contains a number of
6  * coding conventions designed to improve portability and efficiency. Do not make
7  * changes to this file unless you know what you are doing--modify the SWIG
8  * interface file instead.
9  * ----------------------------------------------------------------------------- */
10 
11 
12 #ifndef SWIGPYTHON
13 #define SWIGPYTHON
14 #endif
15 
16 #define SWIG_PYTHON_DIRECTOR_NO_VTABLE
17 
18 /* -----------------------------------------------------------------------------
19  *  This section contains generic SWIG labels for method/variable
20  *  declarations/attributes, and other compiler dependent labels.
21  * ----------------------------------------------------------------------------- */
22 
23 /* template workaround for compilers that cannot correctly implement the C++ standard */
24 #ifndef SWIGTEMPLATEDISAMBIGUATOR
25 # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
26 #  define SWIGTEMPLATEDISAMBIGUATOR template
27 # elif defined(__HP_aCC)
28 /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
29 /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
30 #  define SWIGTEMPLATEDISAMBIGUATOR template
31 # else
32 #  define SWIGTEMPLATEDISAMBIGUATOR
33 # endif
34 #endif
35 
36 /* inline attribute */
37 #ifndef SWIGINLINE
38 # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
39 #   define SWIGINLINE inline
40 # else
41 #   define SWIGINLINE
42 # endif
43 #endif
44 
45 /* attribute recognised by some compilers to avoid 'unused' warnings */
46 #ifndef SWIGUNUSED
47 # if defined(__GNUC__)
48 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
49 #     define SWIGUNUSED __attribute__ ((__unused__))
50 #   else
51 #     define SWIGUNUSED
52 #   endif
53 # elif defined(__ICC)
54 #   define SWIGUNUSED __attribute__ ((__unused__))
55 # else
56 #   define SWIGUNUSED
57 # endif
58 #endif
59 
60 #ifndef SWIG_MSC_UNSUPPRESS_4505
61 # if defined(_MSC_VER)
62 #   pragma warning(disable : 4505) /* unreferenced local function has been removed */
63 # endif
64 #endif
65 
66 #ifndef SWIGUNUSEDPARM
67 # ifdef __cplusplus
68 #   define SWIGUNUSEDPARM(p)
69 # else
70 #   define SWIGUNUSEDPARM(p) p SWIGUNUSED
71 # endif
72 #endif
73 
74 /* internal SWIG method */
75 #ifndef SWIGINTERN
76 # define SWIGINTERN static SWIGUNUSED
77 #endif
78 
79 /* internal inline SWIG method */
80 #ifndef SWIGINTERNINLINE
81 # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
82 #endif
83 
84 /* exporting methods */
85 #if defined(__GNUC__)
86 #  if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
87 #    ifndef GCC_HASCLASSVISIBILITY
88 #      define GCC_HASCLASSVISIBILITY
89 #    endif
90 #  endif
91 #endif
92 
93 #ifndef SWIGEXPORT
94 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
95 #   if defined(STATIC_LINKED)
96 #     define SWIGEXPORT
97 #   else
98 #     define SWIGEXPORT __declspec(dllexport)
99 #   endif
100 # else
101 #   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
102 #     define SWIGEXPORT __attribute__ ((visibility("default")))
103 #   else
104 #     define SWIGEXPORT
105 #   endif
106 # endif
107 #endif
108 
109 /* calling conventions for Windows */
110 #ifndef SWIGSTDCALL
111 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
112 #   define SWIGSTDCALL __stdcall
113 # else
114 #   define SWIGSTDCALL
115 # endif
116 #endif
117 
118 /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
119 #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
120 # define _CRT_SECURE_NO_DEPRECATE
121 #endif
122 
123 /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
124 #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
125 # define _SCL_SECURE_NO_DEPRECATE
126 #endif
127 
128 /* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
129 #if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
130 # define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
131 #endif
132 
133 /* Intel's compiler complains if a variable which was never initialised is
134  * cast to void, which is a common idiom which we use to indicate that we
135  * are aware a variable isn't used.  So we just silence that warning.
136  * See: https://github.com/swig/swig/issues/192 for more discussion.
137  */
138 #ifdef __INTEL_COMPILER
139 # pragma warning disable 592
140 #endif
141 
142 
143 #if defined(__GNUC__) && defined(_WIN32) && !defined(SWIG_PYTHON_NO_HYPOT_WORKAROUND)
144 /* Workaround for '::hypot' has not been declared', see https://bugs.python.org/issue11566 */
145 # include <math.h>
146 #endif
147 
148 #if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG)
149 /* Use debug wrappers with the Python release dll */
150 # undef _DEBUG
151 # include <Python.h>
152 # define _DEBUG 1
153 #else
154 # include <Python.h>
155 #endif
156 
157 /* -----------------------------------------------------------------------------
158  * swigrun.swg
159  *
160  * This file contains generic C API SWIG runtime support for pointer
161  * type checking.
162  * ----------------------------------------------------------------------------- */
163 
164 /* This should only be incremented when either the layout of swig_type_info changes,
165    or for whatever reason, the runtime changes incompatibly */
166 #define SWIG_RUNTIME_VERSION "4"
167 
168 /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
169 #ifdef SWIG_TYPE_TABLE
170 # define SWIG_QUOTE_STRING(x) #x
171 # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
172 # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
173 #else
174 # define SWIG_TYPE_TABLE_NAME
175 #endif
176 
177 /*
178   You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
179   creating a static or dynamic library from the SWIG runtime code.
180   In 99.9% of the cases, SWIG just needs to declare them as 'static'.
181 
182   But only do this if strictly necessary, ie, if you have problems
183   with your compiler or suchlike.
184 */
185 
186 #ifndef SWIGRUNTIME
187 # define SWIGRUNTIME SWIGINTERN
188 #endif
189 
190 #ifndef SWIGRUNTIMEINLINE
191 # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
192 #endif
193 
194 /*  Generic buffer size */
195 #ifndef SWIG_BUFFER_SIZE
196 # define SWIG_BUFFER_SIZE 1024
197 #endif
198 
199 /* Flags for pointer conversions */
200 #define SWIG_POINTER_DISOWN        0x1
201 #define SWIG_CAST_NEW_MEMORY       0x2
202 #define SWIG_POINTER_NO_NULL       0x4
203 
204 /* Flags for new pointer objects */
205 #define SWIG_POINTER_OWN           0x1
206 
207 
208 /*
209    Flags/methods for returning states.
210 
211    The SWIG conversion methods, as ConvertPtr, return an integer
212    that tells if the conversion was successful or not. And if not,
213    an error code can be returned (see swigerrors.swg for the codes).
214 
215    Use the following macros/flags to set or process the returning
216    states.
217 
218    In old versions of SWIG, code such as the following was usually written:
219 
220      if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
221        // success code
222      } else {
223        //fail code
224      }
225 
226    Now you can be more explicit:
227 
228     int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
229     if (SWIG_IsOK(res)) {
230       // success code
231     } else {
232       // fail code
233     }
234 
235    which is the same really, but now you can also do
236 
237     Type *ptr;
238     int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
239     if (SWIG_IsOK(res)) {
240       // success code
241       if (SWIG_IsNewObj(res) {
242         ...
243 	delete *ptr;
244       } else {
245         ...
246       }
247     } else {
248       // fail code
249     }
250 
251    I.e., now SWIG_ConvertPtr can return new objects and you can
252    identify the case and take care of the deallocation. Of course that
253    also requires SWIG_ConvertPtr to return new result values, such as
254 
255       int SWIG_ConvertPtr(obj, ptr,...) {
256         if (<obj is ok>) {
257           if (<need new object>) {
258             *ptr = <ptr to new allocated object>;
259             return SWIG_NEWOBJ;
260           } else {
261             *ptr = <ptr to old object>;
262             return SWIG_OLDOBJ;
263           }
264         } else {
265           return SWIG_BADOBJ;
266         }
267       }
268 
269    Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
270    more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
271    SWIG errors code.
272 
273    Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
274    allows to return the 'cast rank', for example, if you have this
275 
276        int food(double)
277        int fooi(int);
278 
279    and you call
280 
281       food(1)   // cast rank '1'  (1 -> 1.0)
282       fooi(1)   // cast rank '0'
283 
284    just use the SWIG_AddCast()/SWIG_CheckState()
285 */
286 
287 #define SWIG_OK                    (0)
288 #define SWIG_ERROR                 (-1)
289 #define SWIG_IsOK(r)               (r >= 0)
290 #define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)
291 
292 /* The CastRankLimit says how many bits are used for the cast rank */
293 #define SWIG_CASTRANKLIMIT         (1 << 8)
294 /* The NewMask denotes the object was created (using new/malloc) */
295 #define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
296 /* The TmpMask is for in/out typemaps that use temporal objects */
297 #define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
298 /* Simple returning values */
299 #define SWIG_BADOBJ                (SWIG_ERROR)
300 #define SWIG_OLDOBJ                (SWIG_OK)
301 #define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
302 #define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
303 /* Check, add and del mask methods */
304 #define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
305 #define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
306 #define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
307 #define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
308 #define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
309 #define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
310 
311 /* Cast-Rank Mode */
312 #if defined(SWIG_CASTRANK_MODE)
313 #  ifndef SWIG_TypeRank
314 #    define SWIG_TypeRank             unsigned long
315 #  endif
316 #  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
317 #    define SWIG_MAXCASTRANK          (2)
318 #  endif
319 #  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
320 #  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
SWIG_AddCast(int r)321 SWIGINTERNINLINE int SWIG_AddCast(int r) {
322   return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
323 }
SWIG_CheckState(int r)324 SWIGINTERNINLINE int SWIG_CheckState(int r) {
325   return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
326 }
327 #else /* no cast-rank mode */
328 #  define SWIG_AddCast(r) (r)
329 #  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
330 #endif
331 
332 
333 #include <string.h>
334 
335 #ifdef __cplusplus
336 extern "C" {
337 #endif
338 
339 typedef void *(*swig_converter_func)(void *, int *);
340 typedef struct swig_type_info *(*swig_dycast_func)(void **);
341 
342 /* Structure to store information on one type */
343 typedef struct swig_type_info {
344   const char             *name;			/* mangled name of this type */
345   const char             *str;			/* human readable name of this type */
346   swig_dycast_func        dcast;		/* dynamic cast function down a hierarchy */
347   struct swig_cast_info  *cast;			/* linked list of types that can cast into this type */
348   void                   *clientdata;		/* language specific type data */
349   int                    owndata;		/* flag if the structure owns the clientdata */
350 } swig_type_info;
351 
352 /* Structure to store a type and conversion function used for casting */
353 typedef struct swig_cast_info {
354   swig_type_info         *type;			/* pointer to type that is equivalent to this type */
355   swig_converter_func     converter;		/* function to cast the void pointers */
356   struct swig_cast_info  *next;			/* pointer to next cast in linked list */
357   struct swig_cast_info  *prev;			/* pointer to the previous cast */
358 } swig_cast_info;
359 
360 /* Structure used to store module information
361  * Each module generates one structure like this, and the runtime collects
362  * all of these structures and stores them in a circularly linked list.*/
363 typedef struct swig_module_info {
364   swig_type_info         **types;		/* Array of pointers to swig_type_info structures that are in this module */
365   size_t                 size;		        /* Number of types in this module */
366   struct swig_module_info *next;		/* Pointer to next element in circularly linked list */
367   swig_type_info         **type_initial;	/* Array of initially generated type structures */
368   swig_cast_info         **cast_initial;	/* Array of initially generated casting structures */
369   void                    *clientdata;		/* Language specific module data */
370 } swig_module_info;
371 
372 /*
373   Compare two type names skipping the space characters, therefore
374   "char*" == "char *" and "Class<int>" == "Class<int >", etc.
375 
376   Return 0 when the two name types are equivalent, as in
377   strncmp, but skipping ' '.
378 */
379 SWIGRUNTIME int
SWIG_TypeNameComp(const char * f1,const char * l1,const char * f2,const char * l2)380 SWIG_TypeNameComp(const char *f1, const char *l1,
381 		  const char *f2, const char *l2) {
382   for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
383     while ((*f1 == ' ') && (f1 != l1)) ++f1;
384     while ((*f2 == ' ') && (f2 != l2)) ++f2;
385     if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
386   }
387   return (int)((l1 - f1) - (l2 - f2));
388 }
389 
390 /*
391   Check type equivalence in a name list like <name1>|<name2>|...
392   Return 0 if equal, -1 if nb < tb, 1 if nb > tb
393 */
394 SWIGRUNTIME int
SWIG_TypeCmp(const char * nb,const char * tb)395 SWIG_TypeCmp(const char *nb, const char *tb) {
396   int equiv = 1;
397   const char* te = tb + strlen(tb);
398   const char* ne = nb;
399   while (equiv != 0 && *ne) {
400     for (nb = ne; *ne; ++ne) {
401       if (*ne == '|') break;
402     }
403     equiv = SWIG_TypeNameComp(nb, ne, tb, te);
404     if (*ne) ++ne;
405   }
406   return equiv;
407 }
408 
409 /*
410   Check type equivalence in a name list like <name1>|<name2>|...
411   Return 0 if not equal, 1 if equal
412 */
413 SWIGRUNTIME int
SWIG_TypeEquiv(const char * nb,const char * tb)414 SWIG_TypeEquiv(const char *nb, const char *tb) {
415   return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
416 }
417 
418 /*
419   Check the typename
420 */
421 SWIGRUNTIME swig_cast_info *
SWIG_TypeCheck(const char * c,swig_type_info * ty)422 SWIG_TypeCheck(const char *c, swig_type_info *ty) {
423   if (ty) {
424     swig_cast_info *iter = ty->cast;
425     while (iter) {
426       if (strcmp(iter->type->name, c) == 0) {
427         if (iter == ty->cast)
428           return iter;
429         /* Move iter to the top of the linked list */
430         iter->prev->next = iter->next;
431         if (iter->next)
432           iter->next->prev = iter->prev;
433         iter->next = ty->cast;
434         iter->prev = 0;
435         if (ty->cast) ty->cast->prev = iter;
436         ty->cast = iter;
437         return iter;
438       }
439       iter = iter->next;
440     }
441   }
442   return 0;
443 }
444 
445 /*
446   Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
447 */
448 SWIGRUNTIME swig_cast_info *
SWIG_TypeCheckStruct(swig_type_info * from,swig_type_info * ty)449 SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
450   if (ty) {
451     swig_cast_info *iter = ty->cast;
452     while (iter) {
453       if (iter->type == from) {
454         if (iter == ty->cast)
455           return iter;
456         /* Move iter to the top of the linked list */
457         iter->prev->next = iter->next;
458         if (iter->next)
459           iter->next->prev = iter->prev;
460         iter->next = ty->cast;
461         iter->prev = 0;
462         if (ty->cast) ty->cast->prev = iter;
463         ty->cast = iter;
464         return iter;
465       }
466       iter = iter->next;
467     }
468   }
469   return 0;
470 }
471 
472 /*
473   Cast a pointer up an inheritance hierarchy
474 */
475 SWIGRUNTIMEINLINE void *
SWIG_TypeCast(swig_cast_info * ty,void * ptr,int * newmemory)476 SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
477   return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
478 }
479 
480 /*
481    Dynamic pointer casting. Down an inheritance hierarchy
482 */
483 SWIGRUNTIME swig_type_info *
SWIG_TypeDynamicCast(swig_type_info * ty,void ** ptr)484 SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
485   swig_type_info *lastty = ty;
486   if (!ty || !ty->dcast) return ty;
487   while (ty && (ty->dcast)) {
488     ty = (*ty->dcast)(ptr);
489     if (ty) lastty = ty;
490   }
491   return lastty;
492 }
493 
494 /*
495   Return the name associated with this type
496 */
497 SWIGRUNTIMEINLINE const char *
SWIG_TypeName(const swig_type_info * ty)498 SWIG_TypeName(const swig_type_info *ty) {
499   return ty->name;
500 }
501 
502 /*
503   Return the pretty name associated with this type,
504   that is an unmangled type name in a form presentable to the user.
505 */
506 SWIGRUNTIME const char *
SWIG_TypePrettyName(const swig_type_info * type)507 SWIG_TypePrettyName(const swig_type_info *type) {
508   /* The "str" field contains the equivalent pretty names of the
509      type, separated by vertical-bar characters.  We choose
510      to print the last name, as it is often (?) the most
511      specific. */
512   if (!type) return NULL;
513   if (type->str != NULL) {
514     const char *last_name = type->str;
515     const char *s;
516     for (s = type->str; *s; s++)
517       if (*s == '|') last_name = s+1;
518     return last_name;
519   }
520   else
521     return type->name;
522 }
523 
524 /*
525    Set the clientdata field for a type
526 */
527 SWIGRUNTIME void
SWIG_TypeClientData(swig_type_info * ti,void * clientdata)528 SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
529   swig_cast_info *cast = ti->cast;
530   /* if (ti->clientdata == clientdata) return; */
531   ti->clientdata = clientdata;
532 
533   while (cast) {
534     if (!cast->converter) {
535       swig_type_info *tc = cast->type;
536       if (!tc->clientdata) {
537 	SWIG_TypeClientData(tc, clientdata);
538       }
539     }
540     cast = cast->next;
541   }
542 }
543 SWIGRUNTIME void
SWIG_TypeNewClientData(swig_type_info * ti,void * clientdata)544 SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
545   SWIG_TypeClientData(ti, clientdata);
546   ti->owndata = 1;
547 }
548 
549 /*
550   Search for a swig_type_info structure only by mangled name
551   Search is a O(log #types)
552 
553   We start searching at module start, and finish searching when start == end.
554   Note: if start == end at the beginning of the function, we go all the way around
555   the circular list.
556 */
557 SWIGRUNTIME swig_type_info *
SWIG_MangledTypeQueryModule(swig_module_info * start,swig_module_info * end,const char * name)558 SWIG_MangledTypeQueryModule(swig_module_info *start,
559                             swig_module_info *end,
560 		            const char *name) {
561   swig_module_info *iter = start;
562   do {
563     if (iter->size) {
564       size_t l = 0;
565       size_t r = iter->size - 1;
566       do {
567 	/* since l+r >= 0, we can (>> 1) instead (/ 2) */
568 	size_t i = (l + r) >> 1;
569 	const char *iname = iter->types[i]->name;
570 	if (iname) {
571 	  int compare = strcmp(name, iname);
572 	  if (compare == 0) {
573 	    return iter->types[i];
574 	  } else if (compare < 0) {
575 	    if (i) {
576 	      r = i - 1;
577 	    } else {
578 	      break;
579 	    }
580 	  } else if (compare > 0) {
581 	    l = i + 1;
582 	  }
583 	} else {
584 	  break; /* should never happen */
585 	}
586       } while (l <= r);
587     }
588     iter = iter->next;
589   } while (iter != end);
590   return 0;
591 }
592 
593 /*
594   Search for a swig_type_info structure for either a mangled name or a human readable name.
595   It first searches the mangled names of the types, which is a O(log #types)
596   If a type is not found it then searches the human readable names, which is O(#types).
597 
598   We start searching at module start, and finish searching when start == end.
599   Note: if start == end at the beginning of the function, we go all the way around
600   the circular list.
601 */
602 SWIGRUNTIME swig_type_info *
SWIG_TypeQueryModule(swig_module_info * start,swig_module_info * end,const char * name)603 SWIG_TypeQueryModule(swig_module_info *start,
604                      swig_module_info *end,
605 		     const char *name) {
606   /* STEP 1: Search the name field using binary search */
607   swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
608   if (ret) {
609     return ret;
610   } else {
611     /* STEP 2: If the type hasn't been found, do a complete search
612        of the str field (the human readable name) */
613     swig_module_info *iter = start;
614     do {
615       size_t i = 0;
616       for (; i < iter->size; ++i) {
617 	if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
618 	  return iter->types[i];
619       }
620       iter = iter->next;
621     } while (iter != end);
622   }
623 
624   /* neither found a match */
625   return 0;
626 }
627 
628 /*
629    Pack binary data into a string
630 */
631 SWIGRUNTIME char *
SWIG_PackData(char * c,void * ptr,size_t sz)632 SWIG_PackData(char *c, void *ptr, size_t sz) {
633   static const char hex[17] = "0123456789abcdef";
634   const unsigned char *u = (unsigned char *) ptr;
635   const unsigned char *eu =  u + sz;
636   for (; u != eu; ++u) {
637     unsigned char uu = *u;
638     *(c++) = hex[(uu & 0xf0) >> 4];
639     *(c++) = hex[uu & 0xf];
640   }
641   return c;
642 }
643 
644 /*
645    Unpack binary data from a string
646 */
647 SWIGRUNTIME const char *
SWIG_UnpackData(const char * c,void * ptr,size_t sz)648 SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
649   unsigned char *u = (unsigned char *) ptr;
650   const unsigned char *eu = u + sz;
651   for (; u != eu; ++u) {
652     char d = *(c++);
653     unsigned char uu;
654     if ((d >= '0') && (d <= '9'))
655       uu = (unsigned char)((d - '0') << 4);
656     else if ((d >= 'a') && (d <= 'f'))
657       uu = (unsigned char)((d - ('a'-10)) << 4);
658     else
659       return (char *) 0;
660     d = *(c++);
661     if ((d >= '0') && (d <= '9'))
662       uu |= (unsigned char)(d - '0');
663     else if ((d >= 'a') && (d <= 'f'))
664       uu |= (unsigned char)(d - ('a'-10));
665     else
666       return (char *) 0;
667     *u = uu;
668   }
669   return c;
670 }
671 
672 /*
673    Pack 'void *' into a string buffer.
674 */
675 SWIGRUNTIME char *
SWIG_PackVoidPtr(char * buff,void * ptr,const char * name,size_t bsz)676 SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
677   char *r = buff;
678   if ((2*sizeof(void *) + 2) > bsz) return 0;
679   *(r++) = '_';
680   r = SWIG_PackData(r,&ptr,sizeof(void *));
681   if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
682   strcpy(r,name);
683   return buff;
684 }
685 
686 SWIGRUNTIME const char *
SWIG_UnpackVoidPtr(const char * c,void ** ptr,const char * name)687 SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
688   if (*c != '_') {
689     if (strcmp(c,"NULL") == 0) {
690       *ptr = (void *) 0;
691       return name;
692     } else {
693       return 0;
694     }
695   }
696   return SWIG_UnpackData(++c,ptr,sizeof(void *));
697 }
698 
699 SWIGRUNTIME char *
SWIG_PackDataName(char * buff,void * ptr,size_t sz,const char * name,size_t bsz)700 SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
701   char *r = buff;
702   size_t lname = (name ? strlen(name) : 0);
703   if ((2*sz + 2 + lname) > bsz) return 0;
704   *(r++) = '_';
705   r = SWIG_PackData(r,ptr,sz);
706   if (lname) {
707     strncpy(r,name,lname+1);
708   } else {
709     *r = 0;
710   }
711   return buff;
712 }
713 
714 SWIGRUNTIME const char *
SWIG_UnpackDataName(const char * c,void * ptr,size_t sz,const char * name)715 SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
716   if (*c != '_') {
717     if (strcmp(c,"NULL") == 0) {
718       memset(ptr,0,sz);
719       return name;
720     } else {
721       return 0;
722     }
723   }
724   return SWIG_UnpackData(++c,ptr,sz);
725 }
726 
727 #ifdef __cplusplus
728 }
729 #endif
730 
731 /*  Errors in SWIG */
732 #define  SWIG_UnknownError    	   -1
733 #define  SWIG_IOError        	   -2
734 #define  SWIG_RuntimeError   	   -3
735 #define  SWIG_IndexError     	   -4
736 #define  SWIG_TypeError      	   -5
737 #define  SWIG_DivisionByZero 	   -6
738 #define  SWIG_OverflowError  	   -7
739 #define  SWIG_SyntaxError    	   -8
740 #define  SWIG_ValueError     	   -9
741 #define  SWIG_SystemError    	   -10
742 #define  SWIG_AttributeError 	   -11
743 #define  SWIG_MemoryError    	   -12
744 #define  SWIG_NullReferenceError   -13
745 
746 
747 
748 /* Compatibility macros for Python 3 */
749 #if PY_VERSION_HEX >= 0x03000000
750 
751 #define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type)
752 #define PyInt_Check(x) PyLong_Check(x)
753 #define PyInt_AsLong(x) PyLong_AsLong(x)
754 #define PyInt_FromLong(x) PyLong_FromLong(x)
755 #define PyInt_FromSize_t(x) PyLong_FromSize_t(x)
756 #define PyString_Check(name) PyBytes_Check(name)
757 #define PyString_FromString(x) PyUnicode_FromString(x)
758 #define PyString_Format(fmt, args)  PyUnicode_Format(fmt, args)
759 #define PyString_AsString(str) PyBytes_AsString(str)
760 #define PyString_Size(str) PyBytes_Size(str)
761 #define PyString_InternFromString(key) PyUnicode_InternFromString(key)
762 #define Py_TPFLAGS_HAVE_CLASS Py_TPFLAGS_BASETYPE
763 #define PyString_AS_STRING(x) PyUnicode_AS_STRING(x)
764 #define _PyLong_FromSsize_t(x) PyLong_FromSsize_t(x)
765 
766 #endif
767 
768 #ifndef Py_TYPE
769 #  define Py_TYPE(op) ((op)->ob_type)
770 #endif
771 
772 /* SWIG APIs for compatibility of both Python 2 & 3 */
773 
774 #if PY_VERSION_HEX >= 0x03000000
775 #  define SWIG_Python_str_FromFormat PyUnicode_FromFormat
776 #else
777 #  define SWIG_Python_str_FromFormat PyString_FromFormat
778 #endif
779 
780 
781 /* Warning: This function will allocate a new string in Python 3,
782  * so please call SWIG_Python_str_DelForPy3(x) to free the space.
783  */
784 SWIGINTERN char*
SWIG_Python_str_AsChar(PyObject * str)785 SWIG_Python_str_AsChar(PyObject *str)
786 {
787 #if PY_VERSION_HEX >= 0x03030000
788   return (char *)PyUnicode_AsUTF8(str);
789 #elif PY_VERSION_HEX >= 0x03000000
790   char *newstr = 0;
791   str = PyUnicode_AsUTF8String(str);
792   if (str) {
793     char *cstr;
794     Py_ssize_t len;
795     if (PyBytes_AsStringAndSize(str, &cstr, &len) != -1) {
796       newstr = (char *) malloc(len+1);
797       if (newstr)
798         memcpy(newstr, cstr, len+1);
799     }
800     Py_XDECREF(str);
801   }
802   return newstr;
803 #else
804   return PyString_AsString(str);
805 #endif
806 }
807 
808 #if PY_VERSION_HEX >= 0x03030000 || PY_VERSION_HEX < 0x03000000
809 #  define SWIG_Python_str_DelForPy3(x)
810 #else
811 #  define SWIG_Python_str_DelForPy3(x) free( (void*) (x) )
812 #endif
813 
814 
815 SWIGINTERN PyObject*
SWIG_Python_str_FromChar(const char * c)816 SWIG_Python_str_FromChar(const char *c)
817 {
818 #if PY_VERSION_HEX >= 0x03000000
819   return PyUnicode_FromString(c);
820 #else
821   return PyString_FromString(c);
822 #endif
823 }
824 
825 #ifndef PyObject_DEL
826 # define PyObject_DEL PyObject_Del
827 #endif
828 
829 // SWIGPY_USE_CAPSULE is no longer used within SWIG itself, but some user
830 // interface files check for it.
831 # define SWIGPY_USE_CAPSULE
832 # define SWIGPY_CAPSULE_NAME ("swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME)
833 
834 #if PY_VERSION_HEX < 0x03020000
835 #define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type)
836 #define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name)
837 #define Py_hash_t long
838 #endif
839 
840 /* -----------------------------------------------------------------------------
841  * error manipulation
842  * ----------------------------------------------------------------------------- */
843 
844 SWIGRUNTIME PyObject*
SWIG_Python_ErrorType(int code)845 SWIG_Python_ErrorType(int code) {
846   PyObject* type = 0;
847   switch(code) {
848   case SWIG_MemoryError:
849     type = PyExc_MemoryError;
850     break;
851   case SWIG_IOError:
852     type = PyExc_IOError;
853     break;
854   case SWIG_RuntimeError:
855     type = PyExc_RuntimeError;
856     break;
857   case SWIG_IndexError:
858     type = PyExc_IndexError;
859     break;
860   case SWIG_TypeError:
861     type = PyExc_TypeError;
862     break;
863   case SWIG_DivisionByZero:
864     type = PyExc_ZeroDivisionError;
865     break;
866   case SWIG_OverflowError:
867     type = PyExc_OverflowError;
868     break;
869   case SWIG_SyntaxError:
870     type = PyExc_SyntaxError;
871     break;
872   case SWIG_ValueError:
873     type = PyExc_ValueError;
874     break;
875   case SWIG_SystemError:
876     type = PyExc_SystemError;
877     break;
878   case SWIG_AttributeError:
879     type = PyExc_AttributeError;
880     break;
881   default:
882     type = PyExc_RuntimeError;
883   }
884   return type;
885 }
886 
887 
888 SWIGRUNTIME void
SWIG_Python_AddErrorMsg(const char * mesg)889 SWIG_Python_AddErrorMsg(const char* mesg)
890 {
891   PyObject *type = 0;
892   PyObject *value = 0;
893   PyObject *traceback = 0;
894 
895   if (PyErr_Occurred())
896     PyErr_Fetch(&type, &value, &traceback);
897   if (value) {
898     PyObject *old_str = PyObject_Str(value);
899     const char *tmp = SWIG_Python_str_AsChar(old_str);
900     PyErr_Clear();
901     Py_XINCREF(type);
902     if (tmp)
903       PyErr_Format(type, "%s %s", tmp, mesg);
904     else
905       PyErr_Format(type, "%s", mesg);
906     SWIG_Python_str_DelForPy3(tmp);
907     Py_DECREF(old_str);
908     Py_DECREF(value);
909   } else {
910     PyErr_SetString(PyExc_RuntimeError, mesg);
911   }
912 }
913 
914 SWIGRUNTIME int
SWIG_Python_TypeErrorOccurred(PyObject * obj)915 SWIG_Python_TypeErrorOccurred(PyObject *obj)
916 {
917   PyObject *error;
918   if (obj)
919     return 0;
920   error = PyErr_Occurred();
921   return error && PyErr_GivenExceptionMatches(error, PyExc_TypeError);
922 }
923 
924 SWIGRUNTIME void
SWIG_Python_RaiseOrModifyTypeError(const char * message)925 SWIG_Python_RaiseOrModifyTypeError(const char *message)
926 {
927   if (SWIG_Python_TypeErrorOccurred(NULL)) {
928     /* Use existing TypeError to preserve stacktrace and enhance with given message */
929     PyObject *newvalue;
930     PyObject *type = NULL, *value = NULL, *traceback = NULL;
931     PyErr_Fetch(&type, &value, &traceback);
932 #if PY_VERSION_HEX >= 0x03000000
933     newvalue = PyUnicode_FromFormat("%S\nAdditional information:\n%s", value, message);
934 #else
935     newvalue = PyString_FromFormat("%s\nAdditional information:\n%s", PyString_AsString(value), message);
936 #endif
937     Py_XDECREF(value);
938     PyErr_Restore(type, newvalue, traceback);
939   } else {
940     /* Raise TypeError using given message */
941     PyErr_SetString(PyExc_TypeError, message);
942   }
943 }
944 
945 #if defined(SWIG_PYTHON_NO_THREADS)
946 #  if defined(SWIG_PYTHON_THREADS)
947 #    undef SWIG_PYTHON_THREADS
948 #  endif
949 #endif
950 #if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */
951 #  if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL)
952 #    define SWIG_PYTHON_USE_GIL
953 #  endif
954 #  if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */
955 #    ifndef SWIG_PYTHON_INITIALIZE_THREADS
956 #     define SWIG_PYTHON_INITIALIZE_THREADS  PyEval_InitThreads()
957 #    endif
958 #    ifdef __cplusplus /* C++ code */
959        class SWIG_Python_Thread_Block {
960          bool status;
961          PyGILState_STATE state;
962        public:
end()963          void end() { if (status) { PyGILState_Release(state); status = false;} }
SWIG_Python_Thread_Block()964          SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {}
~SWIG_Python_Thread_Block()965          ~SWIG_Python_Thread_Block() { end(); }
966        };
967        class SWIG_Python_Thread_Allow {
968          bool status;
969          PyThreadState *save;
970        public:
end()971          void end() { if (status) { PyEval_RestoreThread(save); status = false; }}
SWIG_Python_Thread_Allow()972          SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {}
~SWIG_Python_Thread_Allow()973          ~SWIG_Python_Thread_Allow() { end(); }
974        };
975 #      define SWIG_PYTHON_THREAD_BEGIN_BLOCK   SWIG_Python_Thread_Block _swig_thread_block
976 #      define SWIG_PYTHON_THREAD_END_BLOCK     _swig_thread_block.end()
977 #      define SWIG_PYTHON_THREAD_BEGIN_ALLOW   SWIG_Python_Thread_Allow _swig_thread_allow
978 #      define SWIG_PYTHON_THREAD_END_ALLOW     _swig_thread_allow.end()
979 #    else /* C code */
980 #      define SWIG_PYTHON_THREAD_BEGIN_BLOCK   PyGILState_STATE _swig_thread_block = PyGILState_Ensure()
981 #      define SWIG_PYTHON_THREAD_END_BLOCK     PyGILState_Release(_swig_thread_block)
982 #      define SWIG_PYTHON_THREAD_BEGIN_ALLOW   PyThreadState *_swig_thread_allow = PyEval_SaveThread()
983 #      define SWIG_PYTHON_THREAD_END_ALLOW     PyEval_RestoreThread(_swig_thread_allow)
984 #    endif
985 #  else /* Old thread way, not implemented, user must provide it */
986 #    if !defined(SWIG_PYTHON_INITIALIZE_THREADS)
987 #      define SWIG_PYTHON_INITIALIZE_THREADS
988 #    endif
989 #    if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK)
990 #      define SWIG_PYTHON_THREAD_BEGIN_BLOCK
991 #    endif
992 #    if !defined(SWIG_PYTHON_THREAD_END_BLOCK)
993 #      define SWIG_PYTHON_THREAD_END_BLOCK
994 #    endif
995 #    if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW)
996 #      define SWIG_PYTHON_THREAD_BEGIN_ALLOW
997 #    endif
998 #    if !defined(SWIG_PYTHON_THREAD_END_ALLOW)
999 #      define SWIG_PYTHON_THREAD_END_ALLOW
1000 #    endif
1001 #  endif
1002 #else /* No thread support */
1003 #  define SWIG_PYTHON_INITIALIZE_THREADS
1004 #  define SWIG_PYTHON_THREAD_BEGIN_BLOCK
1005 #  define SWIG_PYTHON_THREAD_END_BLOCK
1006 #  define SWIG_PYTHON_THREAD_BEGIN_ALLOW
1007 #  define SWIG_PYTHON_THREAD_END_ALLOW
1008 #endif
1009 
1010 /* -----------------------------------------------------------------------------
1011  * Python API portion that goes into the runtime
1012  * ----------------------------------------------------------------------------- */
1013 
1014 #ifdef __cplusplus
1015 extern "C" {
1016 #endif
1017 
1018 /* -----------------------------------------------------------------------------
1019  * Constant declarations
1020  * ----------------------------------------------------------------------------- */
1021 
1022 /* Constant Types */
1023 #define SWIG_PY_POINTER 4
1024 #define SWIG_PY_BINARY  5
1025 
1026 /* Constant information structure */
1027 typedef struct swig_const_info {
1028   int type;
1029   const char *name;
1030   long lvalue;
1031   double dvalue;
1032   void   *pvalue;
1033   swig_type_info **ptype;
1034 } swig_const_info;
1035 
1036 #ifdef __cplusplus
1037 }
1038 #endif
1039 
1040 
1041 /* -----------------------------------------------------------------------------
1042  * pyrun.swg
1043  *
1044  * This file contains the runtime support for Python modules
1045  * and includes code for managing global variables and pointer
1046  * type checking.
1047  *
1048  * ----------------------------------------------------------------------------- */
1049 
1050 #if PY_VERSION_HEX < 0x02070000 /* 2.7.0 */
1051 # error "This version of SWIG only supports Python >= 2.7"
1052 #endif
1053 
1054 #if PY_VERSION_HEX >= 0x03000000 && PY_VERSION_HEX < 0x03020000
1055 # error "This version of SWIG only supports Python 3 >= 3.2"
1056 #endif
1057 
1058 /* Common SWIG API */
1059 
1060 /* for raw pointers */
1061 #define SWIG_Python_ConvertPtr(obj, pptr, type, flags)  SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
1062 #define SWIG_ConvertPtr(obj, pptr, type, flags)         SWIG_Python_ConvertPtr(obj, pptr, type, flags)
1063 #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own)  SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own)
1064 
1065 #ifdef SWIGPYTHON_BUILTIN
1066 #define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Python_NewPointerObj(self, ptr, type, flags)
1067 #else
1068 #define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
1069 #endif
1070 
1071 #define SWIG_InternalNewPointerObj(ptr, type, flags)	SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
1072 
1073 #define SWIG_CheckImplicit(ty)                          SWIG_Python_CheckImplicit(ty)
1074 #define SWIG_AcquirePtr(ptr, src)                       SWIG_Python_AcquirePtr(ptr, src)
1075 #define swig_owntype                                    int
1076 
1077 /* for raw packed data */
1078 #define SWIG_ConvertPacked(obj, ptr, sz, ty)            SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
1079 #define SWIG_NewPackedObj(ptr, sz, type)                SWIG_Python_NewPackedObj(ptr, sz, type)
1080 
1081 /* for class or struct pointers */
1082 #define SWIG_ConvertInstance(obj, pptr, type, flags)    SWIG_ConvertPtr(obj, pptr, type, flags)
1083 #define SWIG_NewInstanceObj(ptr, type, flags)           SWIG_NewPointerObj(ptr, type, flags)
1084 
1085 /* for C or C++ function pointers */
1086 #define SWIG_ConvertFunctionPtr(obj, pptr, type)        SWIG_Python_ConvertFunctionPtr(obj, pptr, type)
1087 #define SWIG_NewFunctionPtrObj(ptr, type)               SWIG_Python_NewPointerObj(NULL, ptr, type, 0)
1088 
1089 /* for C++ member pointers, ie, member methods */
1090 #define SWIG_ConvertMember(obj, ptr, sz, ty)            SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
1091 #define SWIG_NewMemberObj(ptr, sz, type)                SWIG_Python_NewPackedObj(ptr, sz, type)
1092 
1093 
1094 /* Runtime API */
1095 
1096 #define SWIG_GetModule(clientdata)                      SWIG_Python_GetModule(clientdata)
1097 #define SWIG_SetModule(clientdata, pointer)             SWIG_Python_SetModule(pointer)
1098 #define SWIG_NewClientData(obj)                         SwigPyClientData_New(obj)
1099 
1100 #define SWIG_SetErrorObj                                SWIG_Python_SetErrorObj
1101 #define SWIG_SetErrorMsg                        	SWIG_Python_SetErrorMsg
1102 #define SWIG_ErrorType(code)                    	SWIG_Python_ErrorType(code)
1103 #define SWIG_Error(code, msg)            		SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg)
1104 #define SWIG_fail                        		goto fail
1105 
1106 
1107 /* Runtime API implementation */
1108 
1109 /* Error manipulation */
1110 
1111 SWIGINTERN void
SWIG_Python_SetErrorObj(PyObject * errtype,PyObject * obj)1112 SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) {
1113   SWIG_PYTHON_THREAD_BEGIN_BLOCK;
1114   PyErr_SetObject(errtype, obj);
1115   Py_DECREF(obj);
1116   SWIG_PYTHON_THREAD_END_BLOCK;
1117 }
1118 
1119 SWIGINTERN void
SWIG_Python_SetErrorMsg(PyObject * errtype,const char * msg)1120 SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) {
1121   SWIG_PYTHON_THREAD_BEGIN_BLOCK;
1122   PyErr_SetString(errtype, msg);
1123   SWIG_PYTHON_THREAD_END_BLOCK;
1124 }
1125 
1126 #define SWIG_Python_Raise(obj, type, desc)  SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj)
1127 
1128 /* Set a constant value */
1129 
1130 #if defined(SWIGPYTHON_BUILTIN)
1131 
1132 SWIGINTERN void
SwigPyBuiltin_AddPublicSymbol(PyObject * seq,const char * key)1133 SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) {
1134   PyObject *s = PyString_InternFromString(key);
1135   PyList_Append(seq, s);
1136   Py_DECREF(s);
1137 }
1138 
1139 SWIGINTERN void
SWIG_Python_SetConstant(PyObject * d,PyObject * public_interface,const char * name,PyObject * obj)1140 SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) {
1141   PyDict_SetItemString(d, name, obj);
1142   Py_DECREF(obj);
1143   if (public_interface)
1144     SwigPyBuiltin_AddPublicSymbol(public_interface, name);
1145 }
1146 
1147 #else
1148 
1149 SWIGINTERN void
SWIG_Python_SetConstant(PyObject * d,const char * name,PyObject * obj)1150 SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) {
1151   PyDict_SetItemString(d, name, obj);
1152   Py_DECREF(obj);
1153 }
1154 
1155 #endif
1156 
1157 /* Append a value to the result obj */
1158 
1159 SWIGINTERN PyObject*
SWIG_Python_AppendOutput(PyObject * result,PyObject * obj)1160 SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) {
1161   if (!result) {
1162     result = obj;
1163   } else if (result == Py_None) {
1164     Py_DECREF(result);
1165     result = obj;
1166   } else {
1167     if (!PyList_Check(result)) {
1168       PyObject *o2 = result;
1169       result = PyList_New(1);
1170       PyList_SetItem(result, 0, o2);
1171     }
1172     PyList_Append(result,obj);
1173     Py_DECREF(obj);
1174   }
1175   return result;
1176 }
1177 
1178 /* Unpack the argument tuple */
1179 
1180 SWIGINTERN Py_ssize_t
SWIG_Python_UnpackTuple(PyObject * args,const char * name,Py_ssize_t min,Py_ssize_t max,PyObject ** objs)1181 SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
1182 {
1183   if (!args) {
1184     if (!min && !max) {
1185       return 1;
1186     } else {
1187       PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none",
1188 		   name, (min == max ? "" : "at least "), (int)min);
1189       return 0;
1190     }
1191   }
1192   if (!PyTuple_Check(args)) {
1193     if (min <= 1 && max >= 1) {
1194       Py_ssize_t i;
1195       objs[0] = args;
1196       for (i = 1; i < max; ++i) {
1197 	objs[i] = 0;
1198       }
1199       return 2;
1200     }
1201     PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple");
1202     return 0;
1203   } else {
1204     Py_ssize_t l = PyTuple_GET_SIZE(args);
1205     if (l < min) {
1206       PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
1207 		   name, (min == max ? "" : "at least "), (int)min, (int)l);
1208       return 0;
1209     } else if (l > max) {
1210       PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
1211 		   name, (min == max ? "" : "at most "), (int)max, (int)l);
1212       return 0;
1213     } else {
1214       Py_ssize_t i;
1215       for (i = 0; i < l; ++i) {
1216 	objs[i] = PyTuple_GET_ITEM(args, i);
1217       }
1218       for (; l < max; ++l) {
1219 	objs[l] = 0;
1220       }
1221       return i + 1;
1222     }
1223   }
1224 }
1225 
1226 SWIGINTERN int
SWIG_Python_CheckNoKeywords(PyObject * kwargs,const char * name)1227 SWIG_Python_CheckNoKeywords(PyObject *kwargs, const char *name) {
1228   int no_kwargs = 1;
1229   if (kwargs) {
1230     assert(PyDict_Check(kwargs));
1231     if (PyDict_Size(kwargs) > 0) {
1232       PyErr_Format(PyExc_TypeError, "%s() does not take keyword arguments", name);
1233       no_kwargs = 0;
1234     }
1235   }
1236   return no_kwargs;
1237 }
1238 
1239 /* A functor is a function object with one single object argument */
1240 #define SWIG_Python_CallFunctor(functor, obj)	        PyObject_CallFunctionObjArgs(functor, obj, NULL);
1241 
1242 /*
1243   Helper for static pointer initialization for both C and C++ code, for example
1244   static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...);
1245 */
1246 #ifdef __cplusplus
1247 #define SWIG_STATIC_POINTER(var)  var
1248 #else
1249 #define SWIG_STATIC_POINTER(var)  var = 0; if (!var) var
1250 #endif
1251 
1252 /* -----------------------------------------------------------------------------
1253  * Pointer declarations
1254  * ----------------------------------------------------------------------------- */
1255 
1256 /* Flags for new pointer objects */
1257 #define SWIG_POINTER_NOSHADOW       (SWIG_POINTER_OWN      << 1)
1258 #define SWIG_POINTER_NEW            (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN)
1259 
1260 #define SWIG_POINTER_IMPLICIT_CONV  (SWIG_POINTER_DISOWN   << 1)
1261 
1262 #define SWIG_BUILTIN_TP_INIT	    (SWIG_POINTER_OWN << 2)
1263 #define SWIG_BUILTIN_INIT	    (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN)
1264 
1265 #ifdef __cplusplus
1266 extern "C" {
1267 #endif
1268 
1269 /* The python void return value */
1270 
1271 SWIGRUNTIMEINLINE PyObject *
SWIG_Py_Void(void)1272 SWIG_Py_Void(void)
1273 {
1274   PyObject *none = Py_None;
1275   Py_INCREF(none);
1276   return none;
1277 }
1278 
1279 /* SwigPyClientData */
1280 
1281 typedef struct {
1282   PyObject *klass;
1283   PyObject *newraw;
1284   PyObject *newargs;
1285   PyObject *destroy;
1286   int delargs;
1287   int implicitconv;
1288   PyTypeObject *pytype;
1289 } SwigPyClientData;
1290 
1291 SWIGRUNTIMEINLINE int
SWIG_Python_CheckImplicit(swig_type_info * ty)1292 SWIG_Python_CheckImplicit(swig_type_info *ty)
1293 {
1294   SwigPyClientData *data = (SwigPyClientData *)ty->clientdata;
1295   int fail = data ? data->implicitconv : 0;
1296   if (fail)
1297     PyErr_SetString(PyExc_TypeError, "Implicit conversion is prohibited for explicit constructors.");
1298   return fail;
1299 }
1300 
1301 SWIGRUNTIMEINLINE PyObject *
SWIG_Python_ExceptionType(swig_type_info * desc)1302 SWIG_Python_ExceptionType(swig_type_info *desc) {
1303   SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0;
1304   PyObject *klass = data ? data->klass : 0;
1305   return (klass ? klass : PyExc_RuntimeError);
1306 }
1307 
1308 
1309 SWIGRUNTIME SwigPyClientData *
SwigPyClientData_New(PyObject * obj)1310 SwigPyClientData_New(PyObject* obj)
1311 {
1312   if (!obj) {
1313     return 0;
1314   } else {
1315     SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData));
1316     /* the klass element */
1317     data->klass = obj;
1318     Py_INCREF(data->klass);
1319     /* the newraw method and newargs arguments used to create a new raw instance */
1320     if (PyClass_Check(obj)) {
1321       data->newraw = 0;
1322       data->newargs = obj;
1323       Py_INCREF(obj);
1324     } else {
1325       data->newraw = PyObject_GetAttrString(data->klass, "__new__");
1326       if (data->newraw) {
1327 	Py_INCREF(data->newraw);
1328 	data->newargs = PyTuple_New(1);
1329 	PyTuple_SetItem(data->newargs, 0, obj);
1330       } else {
1331 	data->newargs = obj;
1332       }
1333       Py_INCREF(data->newargs);
1334     }
1335     /* the destroy method, aka as the C++ delete method */
1336     data->destroy = PyObject_GetAttrString(data->klass, "__swig_destroy__");
1337     if (PyErr_Occurred()) {
1338       PyErr_Clear();
1339       data->destroy = 0;
1340     }
1341     if (data->destroy) {
1342       int flags;
1343       Py_INCREF(data->destroy);
1344       flags = PyCFunction_GET_FLAGS(data->destroy);
1345       data->delargs = !(flags & (METH_O));
1346     } else {
1347       data->delargs = 0;
1348     }
1349     data->implicitconv = 0;
1350     data->pytype = 0;
1351     return data;
1352   }
1353 }
1354 
1355 SWIGRUNTIME void
SwigPyClientData_Del(SwigPyClientData * data)1356 SwigPyClientData_Del(SwigPyClientData *data) {
1357   Py_XDECREF(data->newraw);
1358   Py_XDECREF(data->newargs);
1359   Py_XDECREF(data->destroy);
1360 }
1361 
1362 /* =============== SwigPyObject =====================*/
1363 
1364 typedef struct {
1365   PyObject_HEAD
1366   void *ptr;
1367   swig_type_info *ty;
1368   int own;
1369   PyObject *next;
1370 #ifdef SWIGPYTHON_BUILTIN
1371   PyObject *dict;
1372 #endif
1373 } SwigPyObject;
1374 
1375 
1376 #ifdef SWIGPYTHON_BUILTIN
1377 
1378 SWIGRUNTIME PyObject *
SwigPyObject_get___dict__(PyObject * v,PyObject * SWIGUNUSEDPARM (args))1379 SwigPyObject_get___dict__(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
1380 {
1381   SwigPyObject *sobj = (SwigPyObject *)v;
1382 
1383   if (!sobj->dict)
1384     sobj->dict = PyDict_New();
1385 
1386   Py_INCREF(sobj->dict);
1387   return sobj->dict;
1388 }
1389 
1390 #endif
1391 
1392 SWIGRUNTIME PyObject *
SwigPyObject_long(SwigPyObject * v)1393 SwigPyObject_long(SwigPyObject *v)
1394 {
1395   return PyLong_FromVoidPtr(v->ptr);
1396 }
1397 
1398 SWIGRUNTIME PyObject *
SwigPyObject_format(const char * fmt,SwigPyObject * v)1399 SwigPyObject_format(const char* fmt, SwigPyObject *v)
1400 {
1401   PyObject *res = NULL;
1402   PyObject *args = PyTuple_New(1);
1403   if (args) {
1404     if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) {
1405       PyObject *ofmt = SWIG_Python_str_FromChar(fmt);
1406       if (ofmt) {
1407 #if PY_VERSION_HEX >= 0x03000000
1408 	res = PyUnicode_Format(ofmt,args);
1409 #else
1410 	res = PyString_Format(ofmt,args);
1411 #endif
1412 	Py_DECREF(ofmt);
1413       }
1414       Py_DECREF(args);
1415     }
1416   }
1417   return res;
1418 }
1419 
1420 SWIGRUNTIME PyObject *
SwigPyObject_oct(SwigPyObject * v)1421 SwigPyObject_oct(SwigPyObject *v)
1422 {
1423   return SwigPyObject_format("%o",v);
1424 }
1425 
1426 SWIGRUNTIME PyObject *
SwigPyObject_hex(SwigPyObject * v)1427 SwigPyObject_hex(SwigPyObject *v)
1428 {
1429   return SwigPyObject_format("%x",v);
1430 }
1431 
1432 SWIGRUNTIME PyObject *
SwigPyObject_repr(SwigPyObject * v)1433 SwigPyObject_repr(SwigPyObject *v)
1434 {
1435   const char *name = SWIG_TypePrettyName(v->ty);
1436   PyObject *repr = SWIG_Python_str_FromFormat("<Swig Object of type '%s' at %p>", (name ? name : "unknown"), (void *)v);
1437   if (v->next) {
1438     PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next);
1439 # if PY_VERSION_HEX >= 0x03000000
1440     PyObject *joined = PyUnicode_Concat(repr, nrep);
1441     Py_DecRef(repr);
1442     Py_DecRef(nrep);
1443     repr = joined;
1444 # else
1445     PyString_ConcatAndDel(&repr,nrep);
1446 # endif
1447   }
1448   return repr;
1449 }
1450 
1451 /* We need a version taking two PyObject* parameters so it's a valid
1452  * PyCFunction to use in swigobject_methods[]. */
1453 SWIGRUNTIME PyObject *
SwigPyObject_repr2(PyObject * v,PyObject * SWIGUNUSEDPARM (args))1454 SwigPyObject_repr2(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
1455 {
1456   return SwigPyObject_repr((SwigPyObject*)v);
1457 }
1458 
1459 SWIGRUNTIME int
SwigPyObject_compare(SwigPyObject * v,SwigPyObject * w)1460 SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w)
1461 {
1462   void *i = v->ptr;
1463   void *j = w->ptr;
1464   return (i < j) ? -1 : ((i > j) ? 1 : 0);
1465 }
1466 
1467 /* Added for Python 3.x, would it also be useful for Python 2.x? */
1468 SWIGRUNTIME PyObject*
SwigPyObject_richcompare(SwigPyObject * v,SwigPyObject * w,int op)1469 SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op)
1470 {
1471   PyObject* res;
1472   if( op != Py_EQ && op != Py_NE ) {
1473     Py_INCREF(Py_NotImplemented);
1474     return Py_NotImplemented;
1475   }
1476   res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0);
1477   return res;
1478 }
1479 
1480 
1481 SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void);
1482 
1483 #ifdef SWIGPYTHON_BUILTIN
1484 static swig_type_info *SwigPyObject_stype = 0;
1485 SWIGRUNTIME PyTypeObject*
SwigPyObject_type(void)1486 SwigPyObject_type(void) {
1487     SwigPyClientData *cd;
1488     assert(SwigPyObject_stype);
1489     cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
1490     assert(cd);
1491     assert(cd->pytype);
1492     return cd->pytype;
1493 }
1494 #else
1495 SWIGRUNTIME PyTypeObject*
SwigPyObject_type(void)1496 SwigPyObject_type(void) {
1497   static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce();
1498   return type;
1499 }
1500 #endif
1501 
1502 SWIGRUNTIMEINLINE int
SwigPyObject_Check(PyObject * op)1503 SwigPyObject_Check(PyObject *op) {
1504 #ifdef SWIGPYTHON_BUILTIN
1505   PyTypeObject *target_tp = SwigPyObject_type();
1506   if (PyType_IsSubtype(op->ob_type, target_tp))
1507     return 1;
1508   return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0);
1509 #else
1510   return (Py_TYPE(op) == SwigPyObject_type())
1511     || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0);
1512 #endif
1513 }
1514 
1515 SWIGRUNTIME PyObject *
1516 SwigPyObject_New(void *ptr, swig_type_info *ty, int own);
1517 
1518 SWIGRUNTIME void
SwigPyObject_dealloc(PyObject * v)1519 SwigPyObject_dealloc(PyObject *v)
1520 {
1521   SwigPyObject *sobj = (SwigPyObject *) v;
1522   PyObject *next = sobj->next;
1523   if (sobj->own == SWIG_POINTER_OWN) {
1524     swig_type_info *ty = sobj->ty;
1525     SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
1526     PyObject *destroy = data ? data->destroy : 0;
1527     if (destroy) {
1528       /* destroy is always a VARARGS method */
1529       PyObject *res;
1530 
1531       /* PyObject_CallFunction() has the potential to silently drop
1532          the active exception.  In cases of unnamed temporary
1533          variable or where we just finished iterating over a generator
1534          StopIteration will be active right now, and this needs to
1535          remain true upon return from SwigPyObject_dealloc.  So save
1536          and restore. */
1537 
1538       PyObject *type = NULL, *value = NULL, *traceback = NULL;
1539       PyErr_Fetch(&type, &value, &traceback);
1540 
1541       if (data->delargs) {
1542         /* we need to create a temporary object to carry the destroy operation */
1543         PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0);
1544         res = SWIG_Python_CallFunctor(destroy, tmp);
1545         Py_DECREF(tmp);
1546       } else {
1547         PyCFunction meth = PyCFunction_GET_FUNCTION(destroy);
1548         PyObject *mself = PyCFunction_GET_SELF(destroy);
1549         res = ((*meth)(mself, v));
1550       }
1551       if (!res)
1552         PyErr_WriteUnraisable(destroy);
1553 
1554       PyErr_Restore(type, value, traceback);
1555 
1556       Py_XDECREF(res);
1557     }
1558 #if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
1559     else {
1560       const char *name = SWIG_TypePrettyName(ty);
1561       printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown"));
1562     }
1563 #endif
1564   }
1565   Py_XDECREF(next);
1566   PyObject_DEL(v);
1567 }
1568 
1569 SWIGRUNTIME PyObject*
SwigPyObject_append(PyObject * v,PyObject * next)1570 SwigPyObject_append(PyObject* v, PyObject* next)
1571 {
1572   SwigPyObject *sobj = (SwigPyObject *) v;
1573   if (!SwigPyObject_Check(next)) {
1574     PyErr_SetString(PyExc_TypeError, "Attempt to append a non SwigPyObject");
1575     return NULL;
1576   }
1577   sobj->next = next;
1578   Py_INCREF(next);
1579   return SWIG_Py_Void();
1580 }
1581 
1582 SWIGRUNTIME PyObject*
SwigPyObject_next(PyObject * v,PyObject * SWIGUNUSEDPARM (args))1583 SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1584 {
1585   SwigPyObject *sobj = (SwigPyObject *) v;
1586   if (sobj->next) {
1587     Py_INCREF(sobj->next);
1588     return sobj->next;
1589   } else {
1590     return SWIG_Py_Void();
1591   }
1592 }
1593 
1594 SWIGINTERN PyObject*
SwigPyObject_disown(PyObject * v,PyObject * SWIGUNUSEDPARM (args))1595 SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1596 {
1597   SwigPyObject *sobj = (SwigPyObject *)v;
1598   sobj->own = 0;
1599   return SWIG_Py_Void();
1600 }
1601 
1602 SWIGINTERN PyObject*
SwigPyObject_acquire(PyObject * v,PyObject * SWIGUNUSEDPARM (args))1603 SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1604 {
1605   SwigPyObject *sobj = (SwigPyObject *)v;
1606   sobj->own = SWIG_POINTER_OWN;
1607   return SWIG_Py_Void();
1608 }
1609 
1610 SWIGINTERN PyObject*
SwigPyObject_own(PyObject * v,PyObject * args)1611 SwigPyObject_own(PyObject *v, PyObject *args)
1612 {
1613   PyObject *val = 0;
1614   if (!PyArg_UnpackTuple(args, "own", 0, 1, &val)) {
1615     return NULL;
1616   } else {
1617     SwigPyObject *sobj = (SwigPyObject *)v;
1618     PyObject *obj = PyBool_FromLong(sobj->own);
1619     if (val) {
1620       if (PyObject_IsTrue(val)) {
1621         SwigPyObject_acquire(v,args);
1622       } else {
1623         SwigPyObject_disown(v,args);
1624       }
1625     }
1626     return obj;
1627   }
1628 }
1629 
1630 static PyMethodDef
1631 swigobject_methods[] = {
1632   {"disown",  SwigPyObject_disown,  METH_NOARGS,  "releases ownership of the pointer"},
1633   {"acquire", SwigPyObject_acquire, METH_NOARGS,  "acquires ownership of the pointer"},
1634   {"own",     SwigPyObject_own,     METH_VARARGS, "returns/sets ownership of the pointer"},
1635   {"append",  SwigPyObject_append,  METH_O,       "appends another 'this' object"},
1636   {"next",    SwigPyObject_next,    METH_NOARGS,  "returns the next 'this' object"},
1637   {"__repr__",SwigPyObject_repr2,   METH_NOARGS,  "returns object representation"},
1638   {0, 0, 0, 0}
1639 };
1640 
1641 SWIGRUNTIME PyTypeObject*
SwigPyObject_TypeOnce(void)1642 SwigPyObject_TypeOnce(void) {
1643   static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer";
1644 
1645   static PyNumberMethods SwigPyObject_as_number = {
1646     (binaryfunc)0, /*nb_add*/
1647     (binaryfunc)0, /*nb_subtract*/
1648     (binaryfunc)0, /*nb_multiply*/
1649     /* nb_divide removed in Python 3 */
1650 #if PY_VERSION_HEX < 0x03000000
1651     (binaryfunc)0, /*nb_divide*/
1652 #endif
1653     (binaryfunc)0, /*nb_remainder*/
1654     (binaryfunc)0, /*nb_divmod*/
1655     (ternaryfunc)0,/*nb_power*/
1656     (unaryfunc)0,  /*nb_negative*/
1657     (unaryfunc)0,  /*nb_positive*/
1658     (unaryfunc)0,  /*nb_absolute*/
1659     (inquiry)0,    /*nb_nonzero*/
1660     0,		   /*nb_invert*/
1661     0,		   /*nb_lshift*/
1662     0,		   /*nb_rshift*/
1663     0,		   /*nb_and*/
1664     0,		   /*nb_xor*/
1665     0,		   /*nb_or*/
1666 #if PY_VERSION_HEX < 0x03000000
1667     0,   /*nb_coerce*/
1668 #endif
1669     (unaryfunc)SwigPyObject_long, /*nb_int*/
1670 #if PY_VERSION_HEX < 0x03000000
1671     (unaryfunc)SwigPyObject_long, /*nb_long*/
1672 #else
1673     0, /*nb_reserved*/
1674 #endif
1675     (unaryfunc)0,                 /*nb_float*/
1676 #if PY_VERSION_HEX < 0x03000000
1677     (unaryfunc)SwigPyObject_oct,  /*nb_oct*/
1678     (unaryfunc)SwigPyObject_hex,  /*nb_hex*/
1679 #endif
1680 #if PY_VERSION_HEX >= 0x03050000 /* 3.5 */
1681     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_matrix_multiply */
1682 #elif PY_VERSION_HEX >= 0x03000000 /* 3.0 */
1683     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */
1684 #else
1685     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */
1686 #endif
1687   };
1688 
1689   static PyTypeObject swigpyobject_type;
1690   static int type_init = 0;
1691   if (!type_init) {
1692     const PyTypeObject tmp = {
1693 #if PY_VERSION_HEX >= 0x03000000
1694       PyVarObject_HEAD_INIT(NULL, 0)
1695 #else
1696       PyObject_HEAD_INIT(NULL)
1697       0,                                    /* ob_size */
1698 #endif
1699       "SwigPyObject",                       /* tp_name */
1700       sizeof(SwigPyObject),                 /* tp_basicsize */
1701       0,                                    /* tp_itemsize */
1702       (destructor)SwigPyObject_dealloc,     /* tp_dealloc */
1703       0,                                    /* tp_print */
1704       (getattrfunc)0,                       /* tp_getattr */
1705       (setattrfunc)0,                       /* tp_setattr */
1706 #if PY_VERSION_HEX >= 0x03000000
1707       0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */
1708 #else
1709       (cmpfunc)SwigPyObject_compare,        /* tp_compare */
1710 #endif
1711       (reprfunc)SwigPyObject_repr,          /* tp_repr */
1712       &SwigPyObject_as_number,              /* tp_as_number */
1713       0,                                    /* tp_as_sequence */
1714       0,                                    /* tp_as_mapping */
1715       (hashfunc)0,                          /* tp_hash */
1716       (ternaryfunc)0,                       /* tp_call */
1717       0,                                    /* tp_str */
1718       PyObject_GenericGetAttr,              /* tp_getattro */
1719       0,                                    /* tp_setattro */
1720       0,                                    /* tp_as_buffer */
1721       Py_TPFLAGS_DEFAULT,                   /* tp_flags */
1722       swigobject_doc,                       /* tp_doc */
1723       0,                                    /* tp_traverse */
1724       0,                                    /* tp_clear */
1725       (richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */
1726       0,                                    /* tp_weaklistoffset */
1727       0,                                    /* tp_iter */
1728       0,                                    /* tp_iternext */
1729       swigobject_methods,                   /* tp_methods */
1730       0,                                    /* tp_members */
1731       0,                                    /* tp_getset */
1732       0,                                    /* tp_base */
1733       0,                                    /* tp_dict */
1734       0,                                    /* tp_descr_get */
1735       0,                                    /* tp_descr_set */
1736       0,                                    /* tp_dictoffset */
1737       0,                                    /* tp_init */
1738       0,                                    /* tp_alloc */
1739       0,                                    /* tp_new */
1740       0,                                    /* tp_free */
1741       0,                                    /* tp_is_gc */
1742       0,                                    /* tp_bases */
1743       0,                                    /* tp_mro */
1744       0,                                    /* tp_cache */
1745       0,                                    /* tp_subclasses */
1746       0,                                    /* tp_weaklist */
1747       0,                                    /* tp_del */
1748       0,                                    /* tp_version_tag */
1749 #if PY_VERSION_HEX >= 0x03040000
1750       0,                                    /* tp_finalize */
1751 #endif
1752 #if PY_VERSION_HEX >= 0x03080000
1753       0,                                    /* tp_vectorcall */
1754 #endif
1755 #if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
1756       0,                                    /* tp_print */
1757 #endif
1758 #ifdef COUNT_ALLOCS
1759       0,                                    /* tp_allocs */
1760       0,                                    /* tp_frees */
1761       0,                                    /* tp_maxalloc */
1762       0,                                    /* tp_prev */
1763       0                                     /* tp_next */
1764 #endif
1765     };
1766     swigpyobject_type = tmp;
1767     type_init = 1;
1768     if (PyType_Ready(&swigpyobject_type) < 0)
1769       return NULL;
1770   }
1771   return &swigpyobject_type;
1772 }
1773 
1774 SWIGRUNTIME PyObject *
SwigPyObject_New(void * ptr,swig_type_info * ty,int own)1775 SwigPyObject_New(void *ptr, swig_type_info *ty, int own)
1776 {
1777   SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type());
1778   if (sobj) {
1779     sobj->ptr  = ptr;
1780     sobj->ty   = ty;
1781     sobj->own  = own;
1782     sobj->next = 0;
1783   }
1784   return (PyObject *)sobj;
1785 }
1786 
1787 /* -----------------------------------------------------------------------------
1788  * Implements a simple Swig Packed type, and use it instead of string
1789  * ----------------------------------------------------------------------------- */
1790 
1791 typedef struct {
1792   PyObject_HEAD
1793   void *pack;
1794   swig_type_info *ty;
1795   size_t size;
1796 } SwigPyPacked;
1797 
1798 SWIGRUNTIME PyObject *
SwigPyPacked_repr(SwigPyPacked * v)1799 SwigPyPacked_repr(SwigPyPacked *v)
1800 {
1801   char result[SWIG_BUFFER_SIZE];
1802   if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
1803     return SWIG_Python_str_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);
1804   } else {
1805     return SWIG_Python_str_FromFormat("<Swig Packed %s>", v->ty->name);
1806   }
1807 }
1808 
1809 SWIGRUNTIME PyObject *
SwigPyPacked_str(SwigPyPacked * v)1810 SwigPyPacked_str(SwigPyPacked *v)
1811 {
1812   char result[SWIG_BUFFER_SIZE];
1813   if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){
1814     return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name);
1815   } else {
1816     return SWIG_Python_str_FromChar(v->ty->name);
1817   }
1818 }
1819 
1820 SWIGRUNTIME int
SwigPyPacked_compare(SwigPyPacked * v,SwigPyPacked * w)1821 SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w)
1822 {
1823   size_t i = v->size;
1824   size_t j = w->size;
1825   int s = (i < j) ? -1 : ((i > j) ? 1 : 0);
1826   return s ? s : strncmp((const char *)v->pack, (const char *)w->pack, 2*v->size);
1827 }
1828 
1829 SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void);
1830 
1831 SWIGRUNTIME PyTypeObject*
SwigPyPacked_type(void)1832 SwigPyPacked_type(void) {
1833   static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce();
1834   return type;
1835 }
1836 
1837 SWIGRUNTIMEINLINE int
SwigPyPacked_Check(PyObject * op)1838 SwigPyPacked_Check(PyObject *op) {
1839   return ((op)->ob_type == SwigPyPacked_TypeOnce())
1840     || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0);
1841 }
1842 
1843 SWIGRUNTIME void
SwigPyPacked_dealloc(PyObject * v)1844 SwigPyPacked_dealloc(PyObject *v)
1845 {
1846   if (SwigPyPacked_Check(v)) {
1847     SwigPyPacked *sobj = (SwigPyPacked *) v;
1848     free(sobj->pack);
1849   }
1850   PyObject_DEL(v);
1851 }
1852 
1853 SWIGRUNTIME PyTypeObject*
SwigPyPacked_TypeOnce(void)1854 SwigPyPacked_TypeOnce(void) {
1855   static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer";
1856   static PyTypeObject swigpypacked_type;
1857   static int type_init = 0;
1858   if (!type_init) {
1859     const PyTypeObject tmp = {
1860 #if PY_VERSION_HEX>=0x03000000
1861       PyVarObject_HEAD_INIT(NULL, 0)
1862 #else
1863       PyObject_HEAD_INIT(NULL)
1864       0,                                    /* ob_size */
1865 #endif
1866       "SwigPyPacked",                       /* tp_name */
1867       sizeof(SwigPyPacked),                 /* tp_basicsize */
1868       0,                                    /* tp_itemsize */
1869       (destructor)SwigPyPacked_dealloc,     /* tp_dealloc */
1870       0,                                    /* tp_print */
1871       (getattrfunc)0,                       /* tp_getattr */
1872       (setattrfunc)0,                       /* tp_setattr */
1873 #if PY_VERSION_HEX>=0x03000000
1874       0, /* tp_reserved in 3.0.1 */
1875 #else
1876       (cmpfunc)SwigPyPacked_compare,        /* tp_compare */
1877 #endif
1878       (reprfunc)SwigPyPacked_repr,          /* tp_repr */
1879       0,                                    /* tp_as_number */
1880       0,                                    /* tp_as_sequence */
1881       0,                                    /* tp_as_mapping */
1882       (hashfunc)0,                          /* tp_hash */
1883       (ternaryfunc)0,                       /* tp_call */
1884       (reprfunc)SwigPyPacked_str,           /* tp_str */
1885       PyObject_GenericGetAttr,              /* tp_getattro */
1886       0,                                    /* tp_setattro */
1887       0,                                    /* tp_as_buffer */
1888       Py_TPFLAGS_DEFAULT,                   /* tp_flags */
1889       swigpacked_doc,                       /* tp_doc */
1890       0,                                    /* tp_traverse */
1891       0,                                    /* tp_clear */
1892       0,                                    /* tp_richcompare */
1893       0,                                    /* tp_weaklistoffset */
1894       0,                                    /* tp_iter */
1895       0,                                    /* tp_iternext */
1896       0,                                    /* tp_methods */
1897       0,                                    /* tp_members */
1898       0,                                    /* tp_getset */
1899       0,                                    /* tp_base */
1900       0,                                    /* tp_dict */
1901       0,                                    /* tp_descr_get */
1902       0,                                    /* tp_descr_set */
1903       0,                                    /* tp_dictoffset */
1904       0,                                    /* tp_init */
1905       0,                                    /* tp_alloc */
1906       0,                                    /* tp_new */
1907       0,                                    /* tp_free */
1908       0,                                    /* tp_is_gc */
1909       0,                                    /* tp_bases */
1910       0,                                    /* tp_mro */
1911       0,                                    /* tp_cache */
1912       0,                                    /* tp_subclasses */
1913       0,                                    /* tp_weaklist */
1914       0,                                    /* tp_del */
1915       0,                                    /* tp_version_tag */
1916 #if PY_VERSION_HEX >= 0x03040000
1917       0,                                    /* tp_finalize */
1918 #endif
1919 #if PY_VERSION_HEX >= 0x03080000
1920       0,                                    /* tp_vectorcall */
1921 #endif
1922 #if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
1923       0,                                    /* tp_print */
1924 #endif
1925 #ifdef COUNT_ALLOCS
1926       0,                                    /* tp_allocs */
1927       0,                                    /* tp_frees */
1928       0,                                    /* tp_maxalloc */
1929       0,                                    /* tp_prev */
1930       0                                     /* tp_next */
1931 #endif
1932     };
1933     swigpypacked_type = tmp;
1934     type_init = 1;
1935     if (PyType_Ready(&swigpypacked_type) < 0)
1936       return NULL;
1937   }
1938   return &swigpypacked_type;
1939 }
1940 
1941 SWIGRUNTIME PyObject *
SwigPyPacked_New(void * ptr,size_t size,swig_type_info * ty)1942 SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty)
1943 {
1944   SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type());
1945   if (sobj) {
1946     void *pack = malloc(size);
1947     if (pack) {
1948       memcpy(pack, ptr, size);
1949       sobj->pack = pack;
1950       sobj->ty   = ty;
1951       sobj->size = size;
1952     } else {
1953       PyObject_DEL((PyObject *) sobj);
1954       sobj = 0;
1955     }
1956   }
1957   return (PyObject *) sobj;
1958 }
1959 
1960 SWIGRUNTIME swig_type_info *
SwigPyPacked_UnpackData(PyObject * obj,void * ptr,size_t size)1961 SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
1962 {
1963   if (SwigPyPacked_Check(obj)) {
1964     SwigPyPacked *sobj = (SwigPyPacked *)obj;
1965     if (sobj->size != size) return 0;
1966     memcpy(ptr, sobj->pack, size);
1967     return sobj->ty;
1968   } else {
1969     return 0;
1970   }
1971 }
1972 
1973 /* -----------------------------------------------------------------------------
1974  * pointers/data manipulation
1975  * ----------------------------------------------------------------------------- */
1976 
1977 static PyObject *Swig_This_global = NULL;
1978 
1979 SWIGRUNTIME PyObject *
SWIG_This(void)1980 SWIG_This(void)
1981 {
1982   if (Swig_This_global == NULL)
1983     Swig_This_global = SWIG_Python_str_FromChar("this");
1984   return Swig_This_global;
1985 }
1986 
1987 /* #define SWIG_PYTHON_SLOW_GETSET_THIS */
1988 
1989 /* TODO: I don't know how to implement the fast getset in Python 3 right now */
1990 #if PY_VERSION_HEX>=0x03000000
1991 #define SWIG_PYTHON_SLOW_GETSET_THIS
1992 #endif
1993 
1994 SWIGRUNTIME SwigPyObject *
SWIG_Python_GetSwigThis(PyObject * pyobj)1995 SWIG_Python_GetSwigThis(PyObject *pyobj)
1996 {
1997   PyObject *obj;
1998 
1999   if (SwigPyObject_Check(pyobj))
2000     return (SwigPyObject *) pyobj;
2001 
2002 #ifdef SWIGPYTHON_BUILTIN
2003   (void)obj;
2004 # ifdef PyWeakref_CheckProxy
2005   if (PyWeakref_CheckProxy(pyobj)) {
2006     pyobj = PyWeakref_GET_OBJECT(pyobj);
2007     if (pyobj && SwigPyObject_Check(pyobj))
2008       return (SwigPyObject*) pyobj;
2009   }
2010 # endif
2011   return NULL;
2012 #else
2013 
2014   obj = 0;
2015 
2016 #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2017   if (PyInstance_Check(pyobj)) {
2018     obj = _PyInstance_Lookup(pyobj, SWIG_This());
2019   } else {
2020     PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
2021     if (dictptr != NULL) {
2022       PyObject *dict = *dictptr;
2023       obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0;
2024     } else {
2025 #ifdef PyWeakref_CheckProxy
2026       if (PyWeakref_CheckProxy(pyobj)) {
2027 	PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
2028 	return wobj ? SWIG_Python_GetSwigThis(wobj) : 0;
2029       }
2030 #endif
2031       obj = PyObject_GetAttr(pyobj,SWIG_This());
2032       if (obj) {
2033 	Py_DECREF(obj);
2034       } else {
2035 	if (PyErr_Occurred()) PyErr_Clear();
2036 	return 0;
2037       }
2038     }
2039   }
2040 #else
2041   obj = PyObject_GetAttr(pyobj,SWIG_This());
2042   if (obj) {
2043     Py_DECREF(obj);
2044   } else {
2045     if (PyErr_Occurred()) PyErr_Clear();
2046     return 0;
2047   }
2048 #endif
2049   if (obj && !SwigPyObject_Check(obj)) {
2050     /* a PyObject is called 'this', try to get the 'real this'
2051        SwigPyObject from it */
2052     return SWIG_Python_GetSwigThis(obj);
2053   }
2054   return (SwigPyObject *)obj;
2055 #endif
2056 }
2057 
2058 /* Acquire a pointer value */
2059 
2060 SWIGRUNTIME int
SWIG_Python_AcquirePtr(PyObject * obj,int own)2061 SWIG_Python_AcquirePtr(PyObject *obj, int own) {
2062   if (own == SWIG_POINTER_OWN) {
2063     SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj);
2064     if (sobj) {
2065       int oldown = sobj->own;
2066       sobj->own = own;
2067       return oldown;
2068     }
2069   }
2070   return 0;
2071 }
2072 
2073 /* Convert a pointer value */
2074 
2075 SWIGRUNTIME int
SWIG_Python_ConvertPtrAndOwn(PyObject * obj,void ** ptr,swig_type_info * ty,int flags,int * own)2076 SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) {
2077   int res;
2078   SwigPyObject *sobj;
2079   int implicit_conv = (flags & SWIG_POINTER_IMPLICIT_CONV) != 0;
2080 
2081   if (!obj)
2082     return SWIG_ERROR;
2083   if (obj == Py_None && !implicit_conv) {
2084     if (ptr)
2085       *ptr = 0;
2086     return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK;
2087   }
2088 
2089   res = SWIG_ERROR;
2090 
2091   sobj = SWIG_Python_GetSwigThis(obj);
2092   if (own)
2093     *own = 0;
2094   while (sobj) {
2095     void *vptr = sobj->ptr;
2096     if (ty) {
2097       swig_type_info *to = sobj->ty;
2098       if (to == ty) {
2099         /* no type cast needed */
2100         if (ptr) *ptr = vptr;
2101         break;
2102       } else {
2103         swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
2104         if (!tc) {
2105           sobj = (SwigPyObject *)sobj->next;
2106         } else {
2107           if (ptr) {
2108             int newmemory = 0;
2109             *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
2110             if (newmemory == SWIG_CAST_NEW_MEMORY) {
2111               assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
2112               if (own)
2113                 *own = *own | SWIG_CAST_NEW_MEMORY;
2114             }
2115           }
2116           break;
2117         }
2118       }
2119     } else {
2120       if (ptr) *ptr = vptr;
2121       break;
2122     }
2123   }
2124   if (sobj) {
2125     if (own)
2126       *own = *own | sobj->own;
2127     if (flags & SWIG_POINTER_DISOWN) {
2128       sobj->own = 0;
2129     }
2130     res = SWIG_OK;
2131   } else {
2132     if (implicit_conv) {
2133       SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
2134       if (data && !data->implicitconv) {
2135         PyObject *klass = data->klass;
2136         if (klass) {
2137           PyObject *impconv;
2138           data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/
2139           impconv = SWIG_Python_CallFunctor(klass, obj);
2140           data->implicitconv = 0;
2141           if (PyErr_Occurred()) {
2142             PyErr_Clear();
2143             impconv = 0;
2144           }
2145           if (impconv) {
2146             SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv);
2147             if (iobj) {
2148               void *vptr;
2149               res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
2150               if (SWIG_IsOK(res)) {
2151                 if (ptr) {
2152                   *ptr = vptr;
2153                   /* transfer the ownership to 'ptr' */
2154                   iobj->own = 0;
2155                   res = SWIG_AddCast(res);
2156                   res = SWIG_AddNewMask(res);
2157                 } else {
2158                   res = SWIG_AddCast(res);
2159                 }
2160               }
2161             }
2162             Py_DECREF(impconv);
2163           }
2164         }
2165       }
2166       if (!SWIG_IsOK(res) && obj == Py_None) {
2167         if (ptr)
2168           *ptr = 0;
2169         if (PyErr_Occurred())
2170           PyErr_Clear();
2171         res = SWIG_OK;
2172       }
2173     }
2174   }
2175   return res;
2176 }
2177 
2178 /* Convert a function ptr value */
2179 
2180 SWIGRUNTIME int
SWIG_Python_ConvertFunctionPtr(PyObject * obj,void ** ptr,swig_type_info * ty)2181 SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
2182   if (!PyCFunction_Check(obj)) {
2183     return SWIG_ConvertPtr(obj, ptr, ty, 0);
2184   } else {
2185     void *vptr = 0;
2186     swig_cast_info *tc;
2187 
2188     /* here we get the method pointer for callbacks */
2189     const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
2190     const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
2191     if (desc)
2192       desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
2193     if (!desc)
2194       return SWIG_ERROR;
2195     tc = SWIG_TypeCheck(desc,ty);
2196     if (tc) {
2197       int newmemory = 0;
2198       *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
2199       assert(!newmemory); /* newmemory handling not yet implemented */
2200     } else {
2201       return SWIG_ERROR;
2202     }
2203     return SWIG_OK;
2204   }
2205 }
2206 
2207 /* Convert a packed pointer value */
2208 
2209 SWIGRUNTIME int
SWIG_Python_ConvertPacked(PyObject * obj,void * ptr,size_t sz,swig_type_info * ty)2210 SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) {
2211   swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz);
2212   if (!to) return SWIG_ERROR;
2213   if (ty) {
2214     if (to != ty) {
2215       /* check type cast? */
2216       swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
2217       if (!tc) return SWIG_ERROR;
2218     }
2219   }
2220   return SWIG_OK;
2221 }
2222 
2223 /* -----------------------------------------------------------------------------
2224  * Create a new pointer object
2225  * ----------------------------------------------------------------------------- */
2226 
2227 /*
2228   Create a new instance object, without calling __init__, and set the
2229   'this' attribute.
2230 */
2231 
2232 SWIGRUNTIME PyObject*
SWIG_Python_NewShadowInstance(SwigPyClientData * data,PyObject * swig_this)2233 SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
2234 {
2235   PyObject *inst = 0;
2236   PyObject *newraw = data->newraw;
2237   if (newraw) {
2238     inst = PyObject_Call(newraw, data->newargs, NULL);
2239     if (inst) {
2240 #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2241       PyObject **dictptr = _PyObject_GetDictPtr(inst);
2242       if (dictptr != NULL) {
2243 	PyObject *dict = *dictptr;
2244 	if (dict == NULL) {
2245 	  dict = PyDict_New();
2246 	  *dictptr = dict;
2247 	  PyDict_SetItem(dict, SWIG_This(), swig_this);
2248 	}
2249       }
2250 #else
2251       if (PyObject_SetAttr(inst, SWIG_This(), swig_this) == -1) {
2252         Py_DECREF(inst);
2253         inst = 0;
2254       }
2255 #endif
2256     }
2257   } else {
2258 #if PY_VERSION_HEX >= 0x03000000
2259     PyObject *empty_args = PyTuple_New(0);
2260     if (empty_args) {
2261       PyObject *empty_kwargs = PyDict_New();
2262       if (empty_kwargs) {
2263         inst = ((PyTypeObject *)data->newargs)->tp_new((PyTypeObject *)data->newargs, empty_args, empty_kwargs);
2264         Py_DECREF(empty_kwargs);
2265         if (inst) {
2266           if (PyObject_SetAttr(inst, SWIG_This(), swig_this) == -1) {
2267             Py_DECREF(inst);
2268             inst = 0;
2269           } else {
2270             Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
2271           }
2272         }
2273       }
2274       Py_DECREF(empty_args);
2275     }
2276 #else
2277     PyObject *dict = PyDict_New();
2278     if (dict) {
2279       PyDict_SetItem(dict, SWIG_This(), swig_this);
2280       inst = PyInstance_NewRaw(data->newargs, dict);
2281       Py_DECREF(dict);
2282     }
2283 #endif
2284   }
2285   return inst;
2286 }
2287 
2288 SWIGRUNTIME int
SWIG_Python_SetSwigThis(PyObject * inst,PyObject * swig_this)2289 SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this)
2290 {
2291 #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2292   PyObject **dictptr = _PyObject_GetDictPtr(inst);
2293   if (dictptr != NULL) {
2294     PyObject *dict = *dictptr;
2295     if (dict == NULL) {
2296       dict = PyDict_New();
2297       *dictptr = dict;
2298     }
2299     return PyDict_SetItem(dict, SWIG_This(), swig_this);
2300   }
2301 #endif
2302   return PyObject_SetAttr(inst, SWIG_This(), swig_this);
2303 }
2304 
2305 
2306 SWIGINTERN PyObject *
SWIG_Python_InitShadowInstance(PyObject * args)2307 SWIG_Python_InitShadowInstance(PyObject *args) {
2308   PyObject *obj[2];
2309   if (!SWIG_Python_UnpackTuple(args, "swiginit", 2, 2, obj)) {
2310     return NULL;
2311   } else {
2312     SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]);
2313     if (sthis) {
2314       SwigPyObject_append((PyObject*) sthis, obj[1]);
2315     } else {
2316       if (SWIG_Python_SetSwigThis(obj[0], obj[1]) != 0)
2317         return NULL;
2318     }
2319     return SWIG_Py_Void();
2320   }
2321 }
2322 
2323 /* Create a new pointer object */
2324 
2325 SWIGRUNTIME PyObject *
SWIG_Python_NewPointerObj(PyObject * self,void * ptr,swig_type_info * type,int flags)2326 SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags) {
2327   SwigPyClientData *clientdata;
2328   PyObject * robj;
2329   int own;
2330 
2331   if (!ptr)
2332     return SWIG_Py_Void();
2333 
2334   clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0;
2335   own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
2336   if (clientdata && clientdata->pytype) {
2337     SwigPyObject *newobj;
2338     if (flags & SWIG_BUILTIN_TP_INIT) {
2339       newobj = (SwigPyObject*) self;
2340       if (newobj->ptr) {
2341         PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0);
2342         while (newobj->next)
2343 	  newobj = (SwigPyObject *) newobj->next;
2344         newobj->next = next_self;
2345         newobj = (SwigPyObject *)next_self;
2346 #ifdef SWIGPYTHON_BUILTIN
2347         newobj->dict = 0;
2348 #endif
2349       }
2350     } else {
2351       newobj = PyObject_New(SwigPyObject, clientdata->pytype);
2352 #ifdef SWIGPYTHON_BUILTIN
2353       newobj->dict = 0;
2354 #endif
2355     }
2356     if (newobj) {
2357       newobj->ptr = ptr;
2358       newobj->ty = type;
2359       newobj->own = own;
2360       newobj->next = 0;
2361       return (PyObject*) newobj;
2362     }
2363     return SWIG_Py_Void();
2364   }
2365 
2366   assert(!(flags & SWIG_BUILTIN_TP_INIT));
2367 
2368   robj = SwigPyObject_New(ptr, type, own);
2369   if (robj && clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
2370     PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
2371     Py_DECREF(robj);
2372     robj = inst;
2373   }
2374   return robj;
2375 }
2376 
2377 /* Create a new packed object */
2378 
2379 SWIGRUNTIMEINLINE PyObject *
SWIG_Python_NewPackedObj(void * ptr,size_t sz,swig_type_info * type)2380 SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
2381   return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void();
2382 }
2383 
2384 /* -----------------------------------------------------------------------------*
2385  *  Get type list
2386  * -----------------------------------------------------------------------------*/
2387 
2388 #ifdef SWIG_LINK_RUNTIME
2389 void *SWIG_ReturnGlobalTypeList(void *);
2390 #endif
2391 
2392 SWIGRUNTIME swig_module_info *
SWIG_Python_GetModule(void * SWIGUNUSEDPARM (clientdata))2393 SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) {
2394   static void *type_pointer = (void *)0;
2395   /* first check if module already created */
2396   if (!type_pointer) {
2397 #ifdef SWIG_LINK_RUNTIME
2398     type_pointer = SWIG_ReturnGlobalTypeList((void *)0);
2399 #else
2400     type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0);
2401     if (PyErr_Occurred()) {
2402       PyErr_Clear();
2403       type_pointer = (void *)0;
2404     }
2405 #endif
2406   }
2407   return (swig_module_info *) type_pointer;
2408 }
2409 
2410 SWIGRUNTIME void
SWIG_Python_DestroyModule(PyObject * obj)2411 SWIG_Python_DestroyModule(PyObject *obj)
2412 {
2413   swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME);
2414   swig_type_info **types = swig_module->types;
2415   size_t i;
2416   for (i =0; i < swig_module->size; ++i) {
2417     swig_type_info *ty = types[i];
2418     if (ty->owndata) {
2419       SwigPyClientData *data = (SwigPyClientData *) ty->clientdata;
2420       if (data) SwigPyClientData_Del(data);
2421     }
2422   }
2423   Py_DECREF(SWIG_This());
2424   Swig_This_global = NULL;
2425 }
2426 
2427 SWIGRUNTIME void
SWIG_Python_SetModule(swig_module_info * swig_module)2428 SWIG_Python_SetModule(swig_module_info *swig_module) {
2429 #if PY_VERSION_HEX >= 0x03000000
2430  /* Add a dummy module object into sys.modules */
2431   PyObject *module = PyImport_AddModule("swig_runtime_data" SWIG_RUNTIME_VERSION);
2432 #else
2433   static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */
2434   PyObject *module = Py_InitModule("swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table);
2435 #endif
2436   PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule);
2437   if (pointer && module) {
2438     PyModule_AddObject(module, "type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer);
2439   } else {
2440     Py_XDECREF(pointer);
2441   }
2442 }
2443 
2444 /* The python cached type query */
2445 SWIGRUNTIME PyObject *
SWIG_Python_TypeCache(void)2446 SWIG_Python_TypeCache(void) {
2447   static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New();
2448   return cache;
2449 }
2450 
2451 SWIGRUNTIME swig_type_info *
SWIG_Python_TypeQuery(const char * type)2452 SWIG_Python_TypeQuery(const char *type)
2453 {
2454   PyObject *cache = SWIG_Python_TypeCache();
2455   PyObject *key = SWIG_Python_str_FromChar(type);
2456   PyObject *obj = PyDict_GetItem(cache, key);
2457   swig_type_info *descriptor;
2458   if (obj) {
2459     descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL);
2460   } else {
2461     swig_module_info *swig_module = SWIG_GetModule(0);
2462     descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type);
2463     if (descriptor) {
2464       obj = PyCapsule_New((void*) descriptor, NULL, NULL);
2465       PyDict_SetItem(cache, key, obj);
2466       Py_DECREF(obj);
2467     }
2468   }
2469   Py_DECREF(key);
2470   return descriptor;
2471 }
2472 
2473 /*
2474    For backward compatibility only
2475 */
2476 #define SWIG_POINTER_EXCEPTION  0
2477 #define SWIG_arg_fail(arg)      SWIG_Python_ArgFail(arg)
2478 #define SWIG_MustGetPtr(p, type, argnum, flags)  SWIG_Python_MustGetPtr(p, type, argnum, flags)
2479 
2480 SWIGRUNTIME int
SWIG_Python_AddErrMesg(const char * mesg,int infront)2481 SWIG_Python_AddErrMesg(const char* mesg, int infront)
2482 {
2483   if (PyErr_Occurred()) {
2484     PyObject *type = 0;
2485     PyObject *value = 0;
2486     PyObject *traceback = 0;
2487     PyErr_Fetch(&type, &value, &traceback);
2488     if (value) {
2489       PyObject *old_str = PyObject_Str(value);
2490       const char *tmp = SWIG_Python_str_AsChar(old_str);
2491       const char *errmesg = tmp ? tmp : "Invalid error message";
2492       Py_XINCREF(type);
2493       PyErr_Clear();
2494       if (infront) {
2495 	PyErr_Format(type, "%s %s", mesg, errmesg);
2496       } else {
2497 	PyErr_Format(type, "%s %s", errmesg, mesg);
2498       }
2499       SWIG_Python_str_DelForPy3(tmp);
2500       Py_DECREF(old_str);
2501     }
2502     return 1;
2503   } else {
2504     return 0;
2505   }
2506 }
2507 
2508 SWIGRUNTIME int
SWIG_Python_ArgFail(int argnum)2509 SWIG_Python_ArgFail(int argnum)
2510 {
2511   if (PyErr_Occurred()) {
2512     /* add information about failing argument */
2513     char mesg[256];
2514     PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum);
2515     return SWIG_Python_AddErrMesg(mesg, 1);
2516   } else {
2517     return 0;
2518   }
2519 }
2520 
2521 SWIGRUNTIMEINLINE const char *
SwigPyObject_GetDesc(PyObject * self)2522 SwigPyObject_GetDesc(PyObject *self)
2523 {
2524   SwigPyObject *v = (SwigPyObject *)self;
2525   swig_type_info *ty = v ? v->ty : 0;
2526   return ty ? ty->str : "";
2527 }
2528 
2529 SWIGRUNTIME void
SWIG_Python_TypeError(const char * type,PyObject * obj)2530 SWIG_Python_TypeError(const char *type, PyObject *obj)
2531 {
2532   if (type) {
2533 #if defined(SWIG_COBJECT_TYPES)
2534     if (obj && SwigPyObject_Check(obj)) {
2535       const char *otype = (const char *) SwigPyObject_GetDesc(obj);
2536       if (otype) {
2537 	PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received",
2538 		     type, otype);
2539 	return;
2540       }
2541     } else
2542 #endif
2543     {
2544       const char *otype = (obj ? obj->ob_type->tp_name : 0);
2545       if (otype) {
2546 	PyObject *str = PyObject_Str(obj);
2547 	const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0;
2548 	if (cstr) {
2549 	  PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received",
2550 		       type, otype, cstr);
2551           SWIG_Python_str_DelForPy3(cstr);
2552 	} else {
2553 	  PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
2554 		       type, otype);
2555 	}
2556 	Py_XDECREF(str);
2557 	return;
2558       }
2559     }
2560     PyErr_Format(PyExc_TypeError, "a '%s' is expected", type);
2561   } else {
2562     PyErr_Format(PyExc_TypeError, "unexpected type is received");
2563   }
2564 }
2565 
2566 
2567 /* Convert a pointer value, signal an exception on a type mismatch */
2568 SWIGRUNTIME void *
SWIG_Python_MustGetPtr(PyObject * obj,swig_type_info * ty,int SWIGUNUSEDPARM (argnum),int flags)2569 SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags) {
2570   void *result;
2571   if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
2572     PyErr_Clear();
2573 #if SWIG_POINTER_EXCEPTION
2574     if (flags) {
2575       SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
2576       SWIG_Python_ArgFail(argnum);
2577     }
2578 #endif
2579   }
2580   return result;
2581 }
2582 
2583 #ifdef SWIGPYTHON_BUILTIN
2584 SWIGRUNTIME int
SWIG_Python_NonDynamicSetAttr(PyObject * obj,PyObject * name,PyObject * value)2585 SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) {
2586   PyTypeObject *tp = obj->ob_type;
2587   PyObject *descr;
2588   PyObject *encoded_name;
2589   descrsetfunc f;
2590   int res = -1;
2591 
2592 # ifdef Py_USING_UNICODE
2593   if (PyString_Check(name)) {
2594     name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL);
2595     if (!name)
2596       return -1;
2597   } else if (!PyUnicode_Check(name))
2598 # else
2599   if (!PyString_Check(name))
2600 # endif
2601   {
2602     PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name);
2603     return -1;
2604   } else {
2605     Py_INCREF(name);
2606   }
2607 
2608   if (!tp->tp_dict) {
2609     if (PyType_Ready(tp) < 0)
2610       goto done;
2611   }
2612 
2613   descr = _PyType_Lookup(tp, name);
2614   f = NULL;
2615   if (descr != NULL)
2616     f = descr->ob_type->tp_descr_set;
2617   if (!f) {
2618     if (PyString_Check(name)) {
2619       encoded_name = name;
2620       Py_INCREF(name);
2621     } else {
2622       encoded_name = PyUnicode_AsUTF8String(name);
2623       if (!encoded_name)
2624         return -1;
2625     }
2626     PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name));
2627     Py_DECREF(encoded_name);
2628   } else {
2629     res = f(descr, obj, value);
2630   }
2631 
2632   done:
2633   Py_DECREF(name);
2634   return res;
2635 }
2636 #endif
2637 
2638 
2639 #ifdef __cplusplus
2640 }
2641 #endif
2642 
2643 
2644 
2645 #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
2646 
2647 #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
2648 
2649 
2650 
2651 #ifdef __cplusplus
2652 extern "C" {
2653 #endif
2654 
2655 /* Method creation and docstring support functions */
2656 
2657 SWIGINTERN PyMethodDef *SWIG_PythonGetProxyDoc(const char *name);
2658 SWIGINTERN PyObject *SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func);
2659 SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func);
2660 
2661 #ifdef __cplusplus
2662 }
2663 #endif
2664 
2665 
2666 /* -------- TYPES TABLE (BEGIN) -------- */
2667 
2668 #define SWIGTYPE_p_CameraAbilities swig_types[0]
2669 #define SWIGTYPE_p_CameraCaptureType swig_types[1]
2670 #define SWIGTYPE_p_CameraDriverStatus swig_types[2]
2671 #define SWIGTYPE_p_CameraEventType swig_types[3]
2672 #define SWIGTYPE_p_CameraFileAccessType swig_types[4]
2673 #define SWIGTYPE_p_CameraFileInfoFields swig_types[5]
2674 #define SWIGTYPE_p_CameraFileOperation swig_types[6]
2675 #define SWIGTYPE_p_CameraFilePath swig_types[7]
2676 #define SWIGTYPE_p_CameraFilePermissions swig_types[8]
2677 #define SWIGTYPE_p_CameraFileStatus swig_types[9]
2678 #define SWIGTYPE_p_CameraFileType swig_types[10]
2679 #define SWIGTYPE_p_CameraFolderOperation swig_types[11]
2680 #define SWIGTYPE_p_CameraOperation swig_types[12]
2681 #define SWIGTYPE_p_CameraStorageAccessType swig_types[13]
2682 #define SWIGTYPE_p_CameraStorageFilesystemType swig_types[14]
2683 #define SWIGTYPE_p_CameraStorageInfoFields swig_types[15]
2684 #define SWIGTYPE_p_CameraStorageType swig_types[16]
2685 #define SWIGTYPE_p_CameraText swig_types[17]
2686 #define SWIGTYPE_p_CameraWidgetType swig_types[18]
2687 #define SWIGTYPE_p_GPLogLevel swig_types[19]
2688 #define SWIGTYPE_p_GPPortType swig_types[20]
2689 #define SWIGTYPE_p_GPVersionVerbosity swig_types[21]
2690 #define SWIGTYPE_p_GphotoDeviceType swig_types[22]
2691 #define SWIGTYPE_p_LogFuncItem swig_types[23]
2692 #define SWIGTYPE_p__Camera swig_types[24]
2693 #define SWIGTYPE_p__CameraAbilitiesList swig_types[25]
2694 #define SWIGTYPE_p__CameraFile swig_types[26]
2695 #define SWIGTYPE_p__CameraFileHandler swig_types[27]
2696 #define SWIGTYPE_p__CameraFileInfo swig_types[28]
2697 #define SWIGTYPE_p__CameraFileInfoAudio swig_types[29]
2698 #define SWIGTYPE_p__CameraFileInfoFile swig_types[30]
2699 #define SWIGTYPE_p__CameraFileInfoPreview swig_types[31]
2700 #define SWIGTYPE_p__CameraFilesystem swig_types[32]
2701 #define SWIGTYPE_p__CameraFilesystemFuncs swig_types[33]
2702 #define SWIGTYPE_p__CameraFunctions swig_types[34]
2703 #define SWIGTYPE_p__CameraList swig_types[35]
2704 #define SWIGTYPE_p__CameraPrivateCore swig_types[36]
2705 #define SWIGTYPE_p__CameraPrivateLibrary swig_types[37]
2706 #define SWIGTYPE_p__CameraStorageInformation swig_types[38]
2707 #define SWIGTYPE_p__CameraWidget swig_types[39]
2708 #define SWIGTYPE_p__GPContext swig_types[40]
2709 #define SWIGTYPE_p__GPContextFeedback swig_types[41]
2710 #define SWIGTYPE_p__GPPortInfoList swig_types[42]
2711 #define SWIGTYPE_p_char swig_types[43]
2712 #define SWIGTYPE_p_f_enum_GPLogLevel_p_q_const__char_p_q_const__char_p_void__void swig_types[44]
2713 #define SWIGTYPE_p_int swig_types[45]
2714 #define SWIGTYPE_p_long swig_types[46]
2715 #define SWIGTYPE_p_long_long swig_types[47]
2716 #define SWIGTYPE_p_short swig_types[48]
2717 #define SWIGTYPE_p_signed_char swig_types[49]
2718 #define SWIGTYPE_p_unsigned_char swig_types[50]
2719 #define SWIGTYPE_p_unsigned_int swig_types[51]
2720 #define SWIGTYPE_p_unsigned_long_long swig_types[52]
2721 #define SWIGTYPE_p_unsigned_short swig_types[53]
2722 static swig_type_info *swig_types[55];
2723 static swig_module_info swig_module = {swig_types, 54, 0, 0, 0, 0};
2724 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
2725 #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
2726 
2727 /* -------- TYPES TABLE (END) -------- */
2728 
2729 #ifdef SWIG_TypeQuery
2730 # undef SWIG_TypeQuery
2731 #endif
2732 #define SWIG_TypeQuery SWIG_Python_TypeQuery
2733 
2734 /*-----------------------------------------------
2735               @(target):= _port_log.so
2736   ------------------------------------------------*/
2737 #if PY_VERSION_HEX >= 0x03000000
2738 #  define SWIG_init    PyInit__port_log
2739 
2740 #else
2741 #  define SWIG_init    init_port_log
2742 
2743 #endif
2744 #define SWIG_name    "_port_log"
2745 
2746 #define SWIGVERSION 0x040002
2747 #define SWIG_VERSION SWIGVERSION
2748 
2749 
2750 #define SWIG_as_voidptr(a) (void *)((const void *)(a))
2751 #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a))
2752 
2753 
2754 #include "gphoto2/gphoto2.h"
2755 
2756 
2757 PyObject *PyExc_GPhoto2Error = NULL;
2758 
2759 
2760 typedef struct LogFuncItem {
2761     int      id;
2762     PyObject *func;
2763     PyObject *data;
2764 } LogFuncItem;
2765 
2766 // call gp_log_remove_func when LogFuncItem object is deleted
del_LogFuncItem(struct LogFuncItem * this)2767 static int del_LogFuncItem(struct LogFuncItem *this) {
2768     int error = GP_OK;
2769     if (this->id >= 0)
2770         error = gp_log_remove_func(this->id);
2771     Py_XDECREF(this->func);
2772     Py_XDECREF(this->data);
2773     free(this);
2774     return error;
2775 };
2776 
delete_LogFuncItem(struct LogFuncItem * self)2777 SWIGINTERN void delete_LogFuncItem(struct LogFuncItem *self){
2778     int error = del_LogFuncItem(self);
2779     if (error < 0) /*@SWIG:src/gphoto2/common/macros.i,18,GPHOTO2_ERROR@*/
2780 PyErr_SetObject(PyExc_GPhoto2Error, PyInt_FromLong(error));
2781 /*@SWIG@*/
2782   }
2783 
gp_log_call_python(GPLogLevel level,const char * domain,const char * str,void * data)2784 static void gp_log_call_python(GPLogLevel level, const char *domain,
2785                                const char *str, void *data) {
2786     if (!Py_IsInitialized()) {
2787         return;
2788     }
2789     PyGILState_STATE gstate = PyGILState_Ensure();
2790     LogFuncItem *this = data;
2791     PyObject *result = NULL;
2792     PyObject *arglist = NULL;
2793 #if PY_VERSION_HEX >= 0x03000000
2794     if (this->data) {
2795         arglist = Py_BuildValue("(iyyO)", level, domain, str, this->data);
2796     } else {
2797         arglist = Py_BuildValue("(iyy)", level, domain, str);
2798     }
2799 #else
2800     if (this->data) {
2801         arglist = Py_BuildValue("(issO)", level, domain, str, this->data);
2802     } else {
2803         arglist = Py_BuildValue("(iss)", level, domain, str);
2804     }
2805 #endif
2806     if (arglist == NULL) {
2807         PyErr_Print();
2808     } else {
2809         result = PyObject_CallObject(this->func, arglist);
2810         Py_DECREF(arglist);
2811         if (result == NULL) {
2812             PyErr_Print();
2813         } else {
2814             Py_DECREF(result);
2815         }
2816     }
2817     PyGILState_Release(gstate);
2818 };
2819 
2820 
2821 SWIGINTERNINLINE PyObject*
SWIG_From_int(int value)2822   SWIG_From_int  (int value)
2823 {
2824   return PyInt_FromLong((long) value);
2825 }
2826 
2827 
2828 #include <limits.h>
2829 #if !defined(SWIG_NO_LLONG_MAX)
2830 # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
2831 #   define LLONG_MAX __LONG_LONG_MAX__
2832 #   define LLONG_MIN (-LLONG_MAX - 1LL)
2833 #   define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
2834 # endif
2835 #endif
2836 
2837 
2838 SWIGINTERN int
SWIG_AsVal_double(PyObject * obj,double * val)2839 SWIG_AsVal_double (PyObject *obj, double *val)
2840 {
2841   int res = SWIG_TypeError;
2842   if (PyFloat_Check(obj)) {
2843     if (val) *val = PyFloat_AsDouble(obj);
2844     return SWIG_OK;
2845 #if PY_VERSION_HEX < 0x03000000
2846   } else if (PyInt_Check(obj)) {
2847     if (val) *val = (double) PyInt_AsLong(obj);
2848     return SWIG_OK;
2849 #endif
2850   } else if (PyLong_Check(obj)) {
2851     double v = PyLong_AsDouble(obj);
2852     if (!PyErr_Occurred()) {
2853       if (val) *val = v;
2854       return SWIG_OK;
2855     } else {
2856       PyErr_Clear();
2857     }
2858   }
2859 #ifdef SWIG_PYTHON_CAST_MODE
2860   {
2861     int dispatch = 0;
2862     double d = PyFloat_AsDouble(obj);
2863     if (!PyErr_Occurred()) {
2864       if (val) *val = d;
2865       return SWIG_AddCast(SWIG_OK);
2866     } else {
2867       PyErr_Clear();
2868     }
2869     if (!dispatch) {
2870       long v = PyLong_AsLong(obj);
2871       if (!PyErr_Occurred()) {
2872 	if (val) *val = v;
2873 	return SWIG_AddCast(SWIG_AddCast(SWIG_OK));
2874       } else {
2875 	PyErr_Clear();
2876       }
2877     }
2878   }
2879 #endif
2880   return res;
2881 }
2882 
2883 
2884 #include <float.h>
2885 
2886 
2887 #include <math.h>
2888 
2889 
2890 SWIGINTERNINLINE int
SWIG_CanCastAsInteger(double * d,double min,double max)2891 SWIG_CanCastAsInteger(double *d, double min, double max) {
2892   double x = *d;
2893   if ((min <= x && x <= max)) {
2894    double fx = floor(x);
2895    double cx = ceil(x);
2896    double rd =  ((x - fx) < 0.5) ? fx : cx; /* simple rint */
2897    if ((errno == EDOM) || (errno == ERANGE)) {
2898      errno = 0;
2899    } else {
2900      double summ, reps, diff;
2901      if (rd < x) {
2902        diff = x - rd;
2903      } else if (rd > x) {
2904        diff = rd - x;
2905      } else {
2906        return 1;
2907      }
2908      summ = rd + x;
2909      reps = diff/summ;
2910      if (reps < 8*DBL_EPSILON) {
2911        *d = rd;
2912        return 1;
2913      }
2914    }
2915   }
2916   return 0;
2917 }
2918 
2919 
2920 SWIGINTERN int
SWIG_AsVal_long(PyObject * obj,long * val)2921 SWIG_AsVal_long (PyObject *obj, long* val)
2922 {
2923 #if PY_VERSION_HEX < 0x03000000
2924   if (PyInt_Check(obj)) {
2925     if (val) *val = PyInt_AsLong(obj);
2926     return SWIG_OK;
2927   } else
2928 #endif
2929   if (PyLong_Check(obj)) {
2930     long v = PyLong_AsLong(obj);
2931     if (!PyErr_Occurred()) {
2932       if (val) *val = v;
2933       return SWIG_OK;
2934     } else {
2935       PyErr_Clear();
2936       return SWIG_OverflowError;
2937     }
2938   }
2939 #ifdef SWIG_PYTHON_CAST_MODE
2940   {
2941     int dispatch = 0;
2942     long v = PyInt_AsLong(obj);
2943     if (!PyErr_Occurred()) {
2944       if (val) *val = v;
2945       return SWIG_AddCast(SWIG_OK);
2946     } else {
2947       PyErr_Clear();
2948     }
2949     if (!dispatch) {
2950       double d;
2951       int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
2952       if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
2953 	if (val) *val = (long)(d);
2954 	return res;
2955       }
2956     }
2957   }
2958 #endif
2959   return SWIG_TypeError;
2960 }
2961 
2962 
2963 SWIGINTERN int
SWIG_AsVal_int(PyObject * obj,int * val)2964 SWIG_AsVal_int (PyObject * obj, int *val)
2965 {
2966   long v;
2967   int res = SWIG_AsVal_long (obj, &v);
2968   if (SWIG_IsOK(res)) {
2969     if ((v < INT_MIN || v > INT_MAX)) {
2970       return SWIG_OverflowError;
2971     } else {
2972       if (val) *val = (int)(v);
2973     }
2974   }
2975   return res;
2976 }
2977 
2978 
2979 SWIGINTERN swig_type_info*
SWIG_pchar_descriptor(void)2980 SWIG_pchar_descriptor(void)
2981 {
2982   static int init = 0;
2983   static swig_type_info* info = 0;
2984   if (!init) {
2985     info = SWIG_TypeQuery("_p_char");
2986     init = 1;
2987   }
2988   return info;
2989 }
2990 
2991 
2992 SWIGINTERN int
SWIG_AsCharPtrAndSize(PyObject * obj,char ** cptr,size_t * psize,int * alloc)2993 SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
2994 {
2995 #if PY_VERSION_HEX>=0x03000000
2996 #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
2997   if (PyBytes_Check(obj))
2998 #else
2999   if (PyUnicode_Check(obj))
3000 #endif
3001 #else
3002   if (PyString_Check(obj))
3003 #endif
3004   {
3005     char *cstr; Py_ssize_t len;
3006     int ret = SWIG_OK;
3007 #if PY_VERSION_HEX>=0x03000000
3008 #if !defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3009     if (!alloc && cptr) {
3010         /* We can't allow converting without allocation, since the internal
3011            representation of string in Python 3 is UCS-2/UCS-4 but we require
3012            a UTF-8 representation.
3013            TODO(bhy) More detailed explanation */
3014         return SWIG_RuntimeError;
3015     }
3016     obj = PyUnicode_AsUTF8String(obj);
3017     if (!obj)
3018       return SWIG_TypeError;
3019     if (alloc)
3020       *alloc = SWIG_NEWOBJ;
3021 #endif
3022     if (PyBytes_AsStringAndSize(obj, &cstr, &len) == -1)
3023       return SWIG_TypeError;
3024 #else
3025     if (PyString_AsStringAndSize(obj, &cstr, &len) == -1)
3026       return SWIG_TypeError;
3027 #endif
3028     if (cptr) {
3029       if (alloc) {
3030 	if (*alloc == SWIG_NEWOBJ) {
3031 	  *cptr = (char *)memcpy(malloc((len + 1)*sizeof(char)), cstr, sizeof(char)*(len + 1));
3032 	  *alloc = SWIG_NEWOBJ;
3033 	} else {
3034 	  *cptr = cstr;
3035 	  *alloc = SWIG_OLDOBJ;
3036 	}
3037       } else {
3038 #if PY_VERSION_HEX>=0x03000000
3039 #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3040 	*cptr = PyBytes_AsString(obj);
3041 #else
3042 	assert(0); /* Should never reach here with Unicode strings in Python 3 */
3043 #endif
3044 #else
3045 	*cptr = SWIG_Python_str_AsChar(obj);
3046         if (!*cptr)
3047           ret = SWIG_TypeError;
3048 #endif
3049       }
3050     }
3051     if (psize) *psize = len + 1;
3052 #if PY_VERSION_HEX>=0x03000000 && !defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3053     Py_XDECREF(obj);
3054 #endif
3055     return ret;
3056   } else {
3057 #if defined(SWIG_PYTHON_2_UNICODE)
3058 #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3059 #error "Cannot use both SWIG_PYTHON_2_UNICODE and SWIG_PYTHON_STRICT_BYTE_CHAR at once"
3060 #endif
3061 #if PY_VERSION_HEX<0x03000000
3062     if (PyUnicode_Check(obj)) {
3063       char *cstr; Py_ssize_t len;
3064       if (!alloc && cptr) {
3065         return SWIG_RuntimeError;
3066       }
3067       obj = PyUnicode_AsUTF8String(obj);
3068       if (!obj)
3069         return SWIG_TypeError;
3070       if (PyString_AsStringAndSize(obj, &cstr, &len) != -1) {
3071         if (cptr) {
3072           if (alloc) *alloc = SWIG_NEWOBJ;
3073           *cptr = (char *)memcpy(malloc((len + 1)*sizeof(char)), cstr, sizeof(char)*(len + 1));
3074         }
3075         if (psize) *psize = len + 1;
3076 
3077         Py_XDECREF(obj);
3078         return SWIG_OK;
3079       } else {
3080         Py_XDECREF(obj);
3081       }
3082     }
3083 #endif
3084 #endif
3085 
3086     swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
3087     if (pchar_descriptor) {
3088       void* vptr = 0;
3089       if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
3090 	if (cptr) *cptr = (char *) vptr;
3091 	if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0;
3092 	if (alloc) *alloc = SWIG_OLDOBJ;
3093 	return SWIG_OK;
3094       }
3095     }
3096   }
3097   return SWIG_TypeError;
3098 }
3099 
3100 
3101 
3102 
3103 #ifdef __cplusplus
3104 extern "C" {
3105 #endif
_wrap_delete_LogFuncItem(PyObject * SWIGUNUSEDPARM (self),PyObject * args)3106 SWIGINTERN PyObject *_wrap_delete_LogFuncItem(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3107   PyObject *resultobj = 0;
3108   struct LogFuncItem *arg1 = (struct LogFuncItem *) 0 ;
3109   void *argp1 = 0 ;
3110   int res1 = 0 ;
3111   PyObject *swig_obj[1] ;
3112 
3113   if (!args) SWIG_fail;
3114   swig_obj[0] = args;
3115   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_LogFuncItem, SWIG_POINTER_DISOWN |  0 );
3116   if (!SWIG_IsOK(res1)) {
3117     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_LogFuncItem" "', argument " "1"" of type '" "struct LogFuncItem *""'");
3118   }
3119   arg1 = (struct LogFuncItem *)(argp1);
3120   {
3121     delete_LogFuncItem(arg1);
3122     if (PyErr_Occurred() != NULL) SWIG_fail;
3123   }
3124   resultobj = SWIG_Py_Void();
3125   return resultobj;
3126 fail:
3127   return NULL;
3128 }
3129 
3130 
LogFuncItem_swigregister(PyObject * SWIGUNUSEDPARM (self),PyObject * args)3131 SWIGINTERN PyObject *LogFuncItem_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3132   PyObject *obj;
3133   if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL;
3134   SWIG_TypeNewClientData(SWIGTYPE_p_LogFuncItem, SWIG_NewClientData(obj));
3135   return SWIG_Py_Void();
3136 }
3137 
_wrap_gp_log_add_func(PyObject * SWIGUNUSEDPARM (self),PyObject * args)3138 SWIGINTERN PyObject *_wrap_gp_log_add_func(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3139   PyObject *resultobj = 0;
3140   GPLogLevel arg1 ;
3141   GPLogFunc arg2 = (GPLogFunc) 0 ;
3142   void *arg3 = (void *) 0 ;
3143   LogFuncItem *_global_callback ;
3144   int val1 ;
3145   int ecode1 = 0 ;
3146   PyObject *swig_obj[3] ;
3147   int result;
3148 
3149   {
3150     _global_callback = malloc(sizeof(LogFuncItem));
3151     if (!_global_callback) {
3152       PyErr_SetNone(PyExc_MemoryError);
3153       SWIG_fail;
3154     }
3155     _global_callback->id = -1;
3156     _global_callback->func = NULL;
3157     _global_callback->data = NULL;
3158   }
3159   {
3160     arg3 = _global_callback;
3161   }
3162   if (!SWIG_Python_UnpackTuple(args, "gp_log_add_func", 2, 3, swig_obj)) SWIG_fail;
3163   ecode1 = SWIG_AsVal_int(swig_obj[0], &val1);
3164   if (!SWIG_IsOK(ecode1)) {
3165     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gp_log_add_func" "', argument " "1"" of type '" "GPLogLevel""'");
3166   }
3167   arg1 = (GPLogLevel)(val1);
3168   {
3169     if (!PyCallable_Check(swig_obj[1])) {
3170       SWIG_exception_fail(SWIG_TypeError, "in method '" "gp_log_add_func" "', argument " "2" " is not callable");
3171     }
3172     _global_callback->func = swig_obj[1];
3173     Py_INCREF(_global_callback->func);
3174     arg2 = gp_log_call_python;
3175   }
3176   if (swig_obj[2]) {
3177     {
3178       _global_callback->data = swig_obj[2];
3179       Py_INCREF(_global_callback->data);
3180     }
3181   }
3182   result = (int)gp_log_add_func(arg1,arg2,arg3);
3183   resultobj = SWIG_From_int((int)(result));
3184   {
3185     _global_callback->id = result;
3186     resultobj = SWIG_Python_AppendOutput(resultobj,
3187       SWIG_NewPointerObj(_global_callback, SWIGTYPE_p_LogFuncItem, SWIG_POINTER_OWN));
3188     _global_callback = NULL;
3189   }
3190   {
3191     if (_global_callback)
3192     del_LogFuncItem(_global_callback);
3193   }
3194   return resultobj;
3195 fail:
3196   {
3197     if (_global_callback)
3198     del_LogFuncItem(_global_callback);
3199   }
3200   return NULL;
3201 }
3202 
3203 
_wrap_gp_log__varargs__(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * varargs)3204 SWIGINTERN PyObject *_wrap_gp_log__varargs__(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *varargs) {
3205   PyObject *resultobj = 0;
3206   GPLogLevel arg1 ;
3207   char *arg2 = (char *) 0 ;
3208   char *arg3 = (char *) 0 ;
3209   void *arg4 = 0 ;
3210   int val1 ;
3211   int ecode1 = 0 ;
3212   int res2 ;
3213   char *buf2 = 0 ;
3214   int alloc2 = 0 ;
3215   int res3 ;
3216   char *buf3 = 0 ;
3217   int alloc3 = 0 ;
3218   PyObject * obj0 = 0 ;
3219   PyObject * obj1 = 0 ;
3220   PyObject * obj2 = 0 ;
3221 
3222   if (!PyArg_UnpackTuple(args, "gp_log", 3, 3, &obj0, &obj1, &obj2)) SWIG_fail;
3223   ecode1 = SWIG_AsVal_int(obj0, &val1);
3224   if (!SWIG_IsOK(ecode1)) {
3225     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gp_log" "', argument " "1"" of type '" "GPLogLevel""'");
3226   }
3227   arg1 = (GPLogLevel)(val1);
3228   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
3229   if (!SWIG_IsOK(res2)) {
3230     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gp_log" "', argument " "2"" of type '" "char const *""'");
3231   }
3232   arg2 = (char *)(buf2);
3233   res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
3234   if (!SWIG_IsOK(res3)) {
3235     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "gp_log" "', argument " "3"" of type '" "char const *""'");
3236   }
3237   arg3 = (char *)(buf3);
3238   gp_log(arg1,(char const *)arg2,(char const *)arg3,arg4);
3239   resultobj = SWIG_Py_Void();
3240   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3241   if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
3242   return resultobj;
3243 fail:
3244   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3245   if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
3246   return NULL;
3247 }
3248 
3249 
_wrap_gp_log(PyObject * SWIGUNUSEDPARM (self),PyObject * args)3250 SWIGINTERN PyObject *_wrap_gp_log(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3251   PyObject *resultobj;
3252   PyObject *varargs;
3253   PyObject *newargs;
3254 
3255   newargs = PyTuple_GetSlice(args,0,3);
3256   varargs = PyTuple_GetSlice(args,3,PyTuple_Size(args));
3257   resultobj = _wrap_gp_log__varargs__(NULL,newargs,varargs);
3258   Py_XDECREF(newargs);
3259   Py_XDECREF(varargs);
3260   return resultobj;
3261 }
3262 
3263 
3264 static PyMethodDef SwigMethods[] = {
3265 	 { "SWIG_PyInstanceMethod_New", SWIG_PyInstanceMethod_New, METH_O, NULL},
3266 	 { "SWIG_PyStaticMethod_New", SWIG_PyStaticMethod_New, METH_O, NULL},
3267 	 { "delete_LogFuncItem", _wrap_delete_LogFuncItem, METH_O, "delete_LogFuncItem(self)"},
3268 	 { "LogFuncItem_swigregister", LogFuncItem_swigregister, METH_O, NULL},
3269 	 { "gp_log_add_func", _wrap_gp_log_add_func, METH_VARARGS, "\n"
3270 		"gp_log_add_func(level, func, data) -> int\n"
3271 		"\n"
3272 		"Parameters\n"
3273 		"----------\n"
3274 		"level: GPLogLevel (gphoto2.GP_LOG_ERROR etc.)\n"
3275 		"func: callable function\n"
3276 		"data: object (default=None)\n"
3277 		"\n"
3278 		"Add a function to get logging information.  \n"
3279 		"\n"
3280 		"Parameters\n"
3281 		"----------\n"
3282 		"* `level` :  \n"
3283 		"    the maximum level of logging it will get, up to and including the\n"
3284 		"    passed value  \n"
3285 		"* `func` :  \n"
3286 		"    a GPLogFunc  \n"
3287 		"* `data` :  \n"
3288 		"    data  \n"
3289 		"\n"
3290 		"Adds a log function that will be called for each log message that is\n"
3291 		"flagged with a log level that appears in given log level. This function\n"
3292 		"returns an id that you can use for removing the log function again\n"
3293 		"(using gp_log_remove_func).  \n"
3294 		"\n"
3295 		"Returns\n"
3296 		"-------\n"
3297 		"an id or a gphoto2 error code\n"
3298 		""},
3299 	 { "gp_log", _wrap_gp_log, METH_VARARGS, "\n"
3300 		"gp_log(level, domain, format)\n"
3301 		"\n"
3302 		"Parameters\n"
3303 		"----------\n"
3304 		"level: GPLogLevel (gphoto2.GP_LOG_ERROR etc.)\n"
3305 		"domain: str\n"
3306 		"format: str\n"
3307 		"\n"
3308 		"Log a debug or error message.  \n"
3309 		"\n"
3310 		"Parameters\n"
3311 		"----------\n"
3312 		"* `level` :  \n"
3313 		"    gphoto2 log level  \n"
3314 		"* `domain` :  \n"
3315 		"    the log domain  \n"
3316 		"* `format` :  \n"
3317 		"    a printf style format string  \n"
3318 		"* `...` :  \n"
3319 		"    the variable argumentlist for above format string  \n"
3320 		"\n"
3321 		"Logs a message at the given log level. You would normally use this\n"
3322 		"function to log general debug output in a printf way.\n"
3323 		""},
3324 	 { NULL, NULL, 0, NULL }
3325 };
3326 
3327 static PyMethodDef SwigMethods_proxydocs[] = {
3328 	 { "SWIG_PyInstanceMethod_New", SWIG_PyInstanceMethod_New, METH_O, NULL},
3329 	 { "SWIG_PyStaticMethod_New", SWIG_PyStaticMethod_New, METH_O, NULL},
3330 	 { "delete_LogFuncItem", _wrap_delete_LogFuncItem, METH_O, "delete_LogFuncItem(self)"},
3331 	 { "LogFuncItem_swigregister", LogFuncItem_swigregister, METH_O, NULL},
3332 	 { "gp_log_add_func", _wrap_gp_log_add_func, METH_VARARGS, "\n"
3333 		"gp_log_add_func(level, func, data) -> int\n"
3334 		"\n"
3335 		"Parameters\n"
3336 		"----------\n"
3337 		"level: GPLogLevel (gphoto2.GP_LOG_ERROR etc.)\n"
3338 		"func: callable function\n"
3339 		"data: object (default=None)\n"
3340 		"\n"
3341 		"Add a function to get logging information.  \n"
3342 		"\n"
3343 		"Parameters\n"
3344 		"----------\n"
3345 		"* `level` :  \n"
3346 		"    the maximum level of logging it will get, up to and including the\n"
3347 		"    passed value  \n"
3348 		"* `func` :  \n"
3349 		"    a GPLogFunc  \n"
3350 		"* `data` :  \n"
3351 		"    data  \n"
3352 		"\n"
3353 		"Adds a log function that will be called for each log message that is\n"
3354 		"flagged with a log level that appears in given log level. This function\n"
3355 		"returns an id that you can use for removing the log function again\n"
3356 		"(using gp_log_remove_func).  \n"
3357 		"\n"
3358 		"Returns\n"
3359 		"-------\n"
3360 		"an id or a gphoto2 error code\n"
3361 		""},
3362 	 { "gp_log", _wrap_gp_log, METH_VARARGS, "\n"
3363 		"gp_log(level, domain, format)\n"
3364 		"\n"
3365 		"Parameters\n"
3366 		"----------\n"
3367 		"level: GPLogLevel (gphoto2.GP_LOG_ERROR etc.)\n"
3368 		"domain: str\n"
3369 		"format: str\n"
3370 		"\n"
3371 		"Log a debug or error message.  \n"
3372 		"\n"
3373 		"Parameters\n"
3374 		"----------\n"
3375 		"* `level` :  \n"
3376 		"    gphoto2 log level  \n"
3377 		"* `domain` :  \n"
3378 		"    the log domain  \n"
3379 		"* `format` :  \n"
3380 		"    a printf style format string  \n"
3381 		"* `...` :  \n"
3382 		"    the variable argumentlist for above format string  \n"
3383 		"\n"
3384 		"Logs a message at the given log level. You would normally use this\n"
3385 		"function to log general debug output in a printf way.\n"
3386 		""},
3387 	 { NULL, NULL, 0, NULL }
3388 };
3389 
3390 
3391 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
3392 
3393 static swig_type_info _swigt__p_CameraAbilities = {"_p_CameraAbilities", "CameraAbilities *", 0, 0, (void*)0, 0};
3394 static swig_type_info _swigt__p_CameraCaptureType = {"_p_CameraCaptureType", "enum CameraCaptureType *|CameraCaptureType *", 0, 0, (void*)0, 0};
3395 static swig_type_info _swigt__p_CameraDriverStatus = {"_p_CameraDriverStatus", "enum CameraDriverStatus *|CameraDriverStatus *", 0, 0, (void*)0, 0};
3396 static swig_type_info _swigt__p_CameraEventType = {"_p_CameraEventType", "enum CameraEventType *|CameraEventType *", 0, 0, (void*)0, 0};
3397 static swig_type_info _swigt__p_CameraFileAccessType = {"_p_CameraFileAccessType", "enum CameraFileAccessType *|CameraFileAccessType *", 0, 0, (void*)0, 0};
3398 static swig_type_info _swigt__p_CameraFileInfoFields = {"_p_CameraFileInfoFields", "enum CameraFileInfoFields *|CameraFileInfoFields *", 0, 0, (void*)0, 0};
3399 static swig_type_info _swigt__p_CameraFileOperation = {"_p_CameraFileOperation", "enum CameraFileOperation *|CameraFileOperation *", 0, 0, (void*)0, 0};
3400 static swig_type_info _swigt__p_CameraFilePath = {"_p_CameraFilePath", "CameraFilePath *", 0, 0, (void*)0, 0};
3401 static swig_type_info _swigt__p_CameraFilePermissions = {"_p_CameraFilePermissions", "enum CameraFilePermissions *|CameraFilePermissions *", 0, 0, (void*)0, 0};
3402 static swig_type_info _swigt__p_CameraFileStatus = {"_p_CameraFileStatus", "enum CameraFileStatus *|CameraFileStatus *", 0, 0, (void*)0, 0};
3403 static swig_type_info _swigt__p_CameraFileType = {"_p_CameraFileType", "enum CameraFileType *|CameraFileType *", 0, 0, (void*)0, 0};
3404 static swig_type_info _swigt__p_CameraFolderOperation = {"_p_CameraFolderOperation", "enum CameraFolderOperation *|CameraFolderOperation *", 0, 0, (void*)0, 0};
3405 static swig_type_info _swigt__p_CameraOperation = {"_p_CameraOperation", "enum CameraOperation *|CameraOperation *", 0, 0, (void*)0, 0};
3406 static swig_type_info _swigt__p_CameraStorageAccessType = {"_p_CameraStorageAccessType", "enum CameraStorageAccessType *|CameraStorageAccessType *", 0, 0, (void*)0, 0};
3407 static swig_type_info _swigt__p_CameraStorageFilesystemType = {"_p_CameraStorageFilesystemType", "enum CameraStorageFilesystemType *|CameraStorageFilesystemType *", 0, 0, (void*)0, 0};
3408 static swig_type_info _swigt__p_CameraStorageInfoFields = {"_p_CameraStorageInfoFields", "enum CameraStorageInfoFields *|CameraStorageInfoFields *", 0, 0, (void*)0, 0};
3409 static swig_type_info _swigt__p_CameraStorageType = {"_p_CameraStorageType", "enum CameraStorageType *|CameraStorageType *", 0, 0, (void*)0, 0};
3410 static swig_type_info _swigt__p_CameraText = {"_p_CameraText", "CameraText *", 0, 0, (void*)0, 0};
3411 static swig_type_info _swigt__p_CameraWidgetType = {"_p_CameraWidgetType", "enum CameraWidgetType *|CameraWidgetType *", 0, 0, (void*)0, 0};
3412 static swig_type_info _swigt__p_GPLogLevel = {"_p_GPLogLevel", "enum GPLogLevel *|GPLogLevel *", 0, 0, (void*)0, 0};
3413 static swig_type_info _swigt__p_GPPortType = {"_p_GPPortType", "enum GPPortType *|GPPortType *", 0, 0, (void*)0, 0};
3414 static swig_type_info _swigt__p_GPVersionVerbosity = {"_p_GPVersionVerbosity", "enum GPVersionVerbosity *|GPVersionVerbosity *", 0, 0, (void*)0, 0};
3415 static swig_type_info _swigt__p_GphotoDeviceType = {"_p_GphotoDeviceType", "enum GphotoDeviceType *|GphotoDeviceType *", 0, 0, (void*)0, 0};
3416 static swig_type_info _swigt__p_LogFuncItem = {"_p_LogFuncItem", "struct LogFuncItem *|LogFuncItem *", 0, 0, (void*)0, 0};
3417 static swig_type_info _swigt__p__Camera = {"_p__Camera", "struct _Camera *|Camera *", 0, 0, (void*)0, 0};
3418 static swig_type_info _swigt__p__CameraAbilitiesList = {"_p__CameraAbilitiesList", "struct _CameraAbilitiesList *|CameraAbilitiesList *", 0, 0, (void*)0, 0};
3419 static swig_type_info _swigt__p__CameraFile = {"_p__CameraFile", "struct _CameraFile *|CameraFile *", 0, 0, (void*)0, 0};
3420 static swig_type_info _swigt__p__CameraFileHandler = {"_p__CameraFileHandler", "struct _CameraFileHandler *|CameraFileHandler *", 0, 0, (void*)0, 0};
3421 static swig_type_info _swigt__p__CameraFileInfo = {"_p__CameraFileInfo", "struct _CameraFileInfo *|CameraFileInfo *", 0, 0, (void*)0, 0};
3422 static swig_type_info _swigt__p__CameraFileInfoAudio = {"_p__CameraFileInfoAudio", "struct _CameraFileInfoAudio *|CameraFileInfoAudio *", 0, 0, (void*)0, 0};
3423 static swig_type_info _swigt__p__CameraFileInfoFile = {"_p__CameraFileInfoFile", "struct _CameraFileInfoFile *|CameraFileInfoFile *", 0, 0, (void*)0, 0};
3424 static swig_type_info _swigt__p__CameraFileInfoPreview = {"_p__CameraFileInfoPreview", "struct _CameraFileInfoPreview *|CameraFileInfoPreview *", 0, 0, (void*)0, 0};
3425 static swig_type_info _swigt__p__CameraFilesystem = {"_p__CameraFilesystem", "struct _CameraFilesystem *|CameraFilesystem *", 0, 0, (void*)0, 0};
3426 static swig_type_info _swigt__p__CameraFilesystemFuncs = {"_p__CameraFilesystemFuncs", "struct _CameraFilesystemFuncs *|CameraFilesystemFuncs *", 0, 0, (void*)0, 0};
3427 static swig_type_info _swigt__p__CameraFunctions = {"_p__CameraFunctions", "struct _CameraFunctions *|CameraFunctions *", 0, 0, (void*)0, 0};
3428 static swig_type_info _swigt__p__CameraList = {"_p__CameraList", "struct _CameraList *|CameraList *", 0, 0, (void*)0, 0};
3429 static swig_type_info _swigt__p__CameraPrivateCore = {"_p__CameraPrivateCore", "struct _CameraPrivateCore *|CameraPrivateCore *", 0, 0, (void*)0, 0};
3430 static swig_type_info _swigt__p__CameraPrivateLibrary = {"_p__CameraPrivateLibrary", "struct _CameraPrivateLibrary *|CameraPrivateLibrary *", 0, 0, (void*)0, 0};
3431 static swig_type_info _swigt__p__CameraStorageInformation = {"_p__CameraStorageInformation", "struct _CameraStorageInformation *|CameraStorageInformation *", 0, 0, (void*)0, 0};
3432 static swig_type_info _swigt__p__CameraWidget = {"_p__CameraWidget", "struct _CameraWidget *|CameraWidget *", 0, 0, (void*)0, 0};
3433 static swig_type_info _swigt__p__GPContext = {"_p__GPContext", "struct _GPContext *|GPContext *", 0, 0, (void*)0, 0};
3434 static swig_type_info _swigt__p__GPContextFeedback = {"_p__GPContextFeedback", "enum _GPContextFeedback *|GPContextFeedback *", 0, 0, (void*)0, 0};
3435 static swig_type_info _swigt__p__GPPortInfoList = {"_p__GPPortInfoList", "struct _GPPortInfoList *|GPPortInfoList *", 0, 0, (void*)0, 0};
3436 static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
3437 static swig_type_info _swigt__p_f_enum_GPLogLevel_p_q_const__char_p_q_const__char_p_void__void = {"_p_f_enum_GPLogLevel_p_q_const__char_p_q_const__char_p_void__void", "void (*)(enum GPLogLevel,char const *,char const *,void *)|GPLogFunc", 0, 0, (void*)0, 0};
3438 static swig_type_info _swigt__p_int = {"_p_int", "intptr_t *|int *|int_least32_t *|int_fast32_t *|int32_t *|int_fast16_t *", 0, 0, (void*)0, 0};
3439 static swig_type_info _swigt__p_long = {"_p_long", "long *|time_t *", 0, 0, (void*)0, 0};
3440 static swig_type_info _swigt__p_long_long = {"_p_long_long", "int_least64_t *|int_fast64_t *|int64_t *|long long *|intmax_t *", 0, 0, (void*)0, 0};
3441 static swig_type_info _swigt__p_short = {"_p_short", "short *|int_least16_t *|int16_t *", 0, 0, (void*)0, 0};
3442 static swig_type_info _swigt__p_signed_char = {"_p_signed_char", "signed char *|int_least8_t *|int_fast8_t *|int8_t *", 0, 0, (void*)0, 0};
3443 static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "unsigned char *|uint_least8_t *|uint_fast8_t *|uint8_t *", 0, 0, (void*)0, 0};
3444 static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "uintptr_t *|uint_least32_t *|uint_fast32_t *|uint32_t *|unsigned int *|uint_fast16_t *", 0, 0, (void*)0, 0};
3445 static swig_type_info _swigt__p_unsigned_long_long = {"_p_unsigned_long_long", "uint_least64_t *|uint_fast64_t *|uint64_t *|unsigned long long *|uintmax_t *", 0, 0, (void*)0, 0};
3446 static swig_type_info _swigt__p_unsigned_short = {"_p_unsigned_short", "unsigned short *|uint_least16_t *|uint16_t *", 0, 0, (void*)0, 0};
3447 
3448 static swig_type_info *swig_type_initial[] = {
3449   &_swigt__p_CameraAbilities,
3450   &_swigt__p_CameraCaptureType,
3451   &_swigt__p_CameraDriverStatus,
3452   &_swigt__p_CameraEventType,
3453   &_swigt__p_CameraFileAccessType,
3454   &_swigt__p_CameraFileInfoFields,
3455   &_swigt__p_CameraFileOperation,
3456   &_swigt__p_CameraFilePath,
3457   &_swigt__p_CameraFilePermissions,
3458   &_swigt__p_CameraFileStatus,
3459   &_swigt__p_CameraFileType,
3460   &_swigt__p_CameraFolderOperation,
3461   &_swigt__p_CameraOperation,
3462   &_swigt__p_CameraStorageAccessType,
3463   &_swigt__p_CameraStorageFilesystemType,
3464   &_swigt__p_CameraStorageInfoFields,
3465   &_swigt__p_CameraStorageType,
3466   &_swigt__p_CameraText,
3467   &_swigt__p_CameraWidgetType,
3468   &_swigt__p_GPLogLevel,
3469   &_swigt__p_GPPortType,
3470   &_swigt__p_GPVersionVerbosity,
3471   &_swigt__p_GphotoDeviceType,
3472   &_swigt__p_LogFuncItem,
3473   &_swigt__p__Camera,
3474   &_swigt__p__CameraAbilitiesList,
3475   &_swigt__p__CameraFile,
3476   &_swigt__p__CameraFileHandler,
3477   &_swigt__p__CameraFileInfo,
3478   &_swigt__p__CameraFileInfoAudio,
3479   &_swigt__p__CameraFileInfoFile,
3480   &_swigt__p__CameraFileInfoPreview,
3481   &_swigt__p__CameraFilesystem,
3482   &_swigt__p__CameraFilesystemFuncs,
3483   &_swigt__p__CameraFunctions,
3484   &_swigt__p__CameraList,
3485   &_swigt__p__CameraPrivateCore,
3486   &_swigt__p__CameraPrivateLibrary,
3487   &_swigt__p__CameraStorageInformation,
3488   &_swigt__p__CameraWidget,
3489   &_swigt__p__GPContext,
3490   &_swigt__p__GPContextFeedback,
3491   &_swigt__p__GPPortInfoList,
3492   &_swigt__p_char,
3493   &_swigt__p_f_enum_GPLogLevel_p_q_const__char_p_q_const__char_p_void__void,
3494   &_swigt__p_int,
3495   &_swigt__p_long,
3496   &_swigt__p_long_long,
3497   &_swigt__p_short,
3498   &_swigt__p_signed_char,
3499   &_swigt__p_unsigned_char,
3500   &_swigt__p_unsigned_int,
3501   &_swigt__p_unsigned_long_long,
3502   &_swigt__p_unsigned_short,
3503 };
3504 
3505 static swig_cast_info _swigc__p_CameraAbilities[] = {  {&_swigt__p_CameraAbilities, 0, 0, 0},{0, 0, 0, 0}};
3506 static swig_cast_info _swigc__p_CameraCaptureType[] = {  {&_swigt__p_CameraCaptureType, 0, 0, 0},{0, 0, 0, 0}};
3507 static swig_cast_info _swigc__p_CameraDriverStatus[] = {  {&_swigt__p_CameraDriverStatus, 0, 0, 0},{0, 0, 0, 0}};
3508 static swig_cast_info _swigc__p_CameraEventType[] = {  {&_swigt__p_CameraEventType, 0, 0, 0},{0, 0, 0, 0}};
3509 static swig_cast_info _swigc__p_CameraFileAccessType[] = {  {&_swigt__p_CameraFileAccessType, 0, 0, 0},{0, 0, 0, 0}};
3510 static swig_cast_info _swigc__p_CameraFileInfoFields[] = {  {&_swigt__p_CameraFileInfoFields, 0, 0, 0},{0, 0, 0, 0}};
3511 static swig_cast_info _swigc__p_CameraFileOperation[] = {  {&_swigt__p_CameraFileOperation, 0, 0, 0},{0, 0, 0, 0}};
3512 static swig_cast_info _swigc__p_CameraFilePath[] = {  {&_swigt__p_CameraFilePath, 0, 0, 0},{0, 0, 0, 0}};
3513 static swig_cast_info _swigc__p_CameraFilePermissions[] = {  {&_swigt__p_CameraFilePermissions, 0, 0, 0},{0, 0, 0, 0}};
3514 static swig_cast_info _swigc__p_CameraFileStatus[] = {  {&_swigt__p_CameraFileStatus, 0, 0, 0},{0, 0, 0, 0}};
3515 static swig_cast_info _swigc__p_CameraFileType[] = {  {&_swigt__p_CameraFileType, 0, 0, 0},{0, 0, 0, 0}};
3516 static swig_cast_info _swigc__p_CameraFolderOperation[] = {  {&_swigt__p_CameraFolderOperation, 0, 0, 0},{0, 0, 0, 0}};
3517 static swig_cast_info _swigc__p_CameraOperation[] = {  {&_swigt__p_CameraOperation, 0, 0, 0},{0, 0, 0, 0}};
3518 static swig_cast_info _swigc__p_CameraStorageAccessType[] = {  {&_swigt__p_CameraStorageAccessType, 0, 0, 0},{0, 0, 0, 0}};
3519 static swig_cast_info _swigc__p_CameraStorageFilesystemType[] = {  {&_swigt__p_CameraStorageFilesystemType, 0, 0, 0},{0, 0, 0, 0}};
3520 static swig_cast_info _swigc__p_CameraStorageInfoFields[] = {  {&_swigt__p_CameraStorageInfoFields, 0, 0, 0},{0, 0, 0, 0}};
3521 static swig_cast_info _swigc__p_CameraStorageType[] = {  {&_swigt__p_CameraStorageType, 0, 0, 0},{0, 0, 0, 0}};
3522 static swig_cast_info _swigc__p_CameraText[] = {  {&_swigt__p_CameraText, 0, 0, 0},{0, 0, 0, 0}};
3523 static swig_cast_info _swigc__p_CameraWidgetType[] = {  {&_swigt__p_CameraWidgetType, 0, 0, 0},{0, 0, 0, 0}};
3524 static swig_cast_info _swigc__p_GPLogLevel[] = {  {&_swigt__p_GPLogLevel, 0, 0, 0},{0, 0, 0, 0}};
3525 static swig_cast_info _swigc__p_GPPortType[] = {  {&_swigt__p_GPPortType, 0, 0, 0},{0, 0, 0, 0}};
3526 static swig_cast_info _swigc__p_GPVersionVerbosity[] = {  {&_swigt__p_GPVersionVerbosity, 0, 0, 0},{0, 0, 0, 0}};
3527 static swig_cast_info _swigc__p_GphotoDeviceType[] = {  {&_swigt__p_GphotoDeviceType, 0, 0, 0},{0, 0, 0, 0}};
3528 static swig_cast_info _swigc__p_LogFuncItem[] = {  {&_swigt__p_LogFuncItem, 0, 0, 0},{0, 0, 0, 0}};
3529 static swig_cast_info _swigc__p__Camera[] = {  {&_swigt__p__Camera, 0, 0, 0},{0, 0, 0, 0}};
3530 static swig_cast_info _swigc__p__CameraAbilitiesList[] = {  {&_swigt__p__CameraAbilitiesList, 0, 0, 0},{0, 0, 0, 0}};
3531 static swig_cast_info _swigc__p__CameraFile[] = {  {&_swigt__p__CameraFile, 0, 0, 0},{0, 0, 0, 0}};
3532 static swig_cast_info _swigc__p__CameraFileHandler[] = {  {&_swigt__p__CameraFileHandler, 0, 0, 0},{0, 0, 0, 0}};
3533 static swig_cast_info _swigc__p__CameraFileInfo[] = {  {&_swigt__p__CameraFileInfo, 0, 0, 0},{0, 0, 0, 0}};
3534 static swig_cast_info _swigc__p__CameraFileInfoAudio[] = {  {&_swigt__p__CameraFileInfoAudio, 0, 0, 0},{0, 0, 0, 0}};
3535 static swig_cast_info _swigc__p__CameraFileInfoFile[] = {  {&_swigt__p__CameraFileInfoFile, 0, 0, 0},{0, 0, 0, 0}};
3536 static swig_cast_info _swigc__p__CameraFileInfoPreview[] = {  {&_swigt__p__CameraFileInfoPreview, 0, 0, 0},{0, 0, 0, 0}};
3537 static swig_cast_info _swigc__p__CameraFilesystem[] = {  {&_swigt__p__CameraFilesystem, 0, 0, 0},{0, 0, 0, 0}};
3538 static swig_cast_info _swigc__p__CameraFilesystemFuncs[] = {  {&_swigt__p__CameraFilesystemFuncs, 0, 0, 0},{0, 0, 0, 0}};
3539 static swig_cast_info _swigc__p__CameraFunctions[] = {  {&_swigt__p__CameraFunctions, 0, 0, 0},{0, 0, 0, 0}};
3540 static swig_cast_info _swigc__p__CameraList[] = {  {&_swigt__p__CameraList, 0, 0, 0},{0, 0, 0, 0}};
3541 static swig_cast_info _swigc__p__CameraPrivateCore[] = {  {&_swigt__p__CameraPrivateCore, 0, 0, 0},{0, 0, 0, 0}};
3542 static swig_cast_info _swigc__p__CameraPrivateLibrary[] = {  {&_swigt__p__CameraPrivateLibrary, 0, 0, 0},{0, 0, 0, 0}};
3543 static swig_cast_info _swigc__p__CameraStorageInformation[] = {  {&_swigt__p__CameraStorageInformation, 0, 0, 0},{0, 0, 0, 0}};
3544 static swig_cast_info _swigc__p__CameraWidget[] = {  {&_swigt__p__CameraWidget, 0, 0, 0},{0, 0, 0, 0}};
3545 static swig_cast_info _swigc__p__GPContext[] = {  {&_swigt__p__GPContext, 0, 0, 0},{0, 0, 0, 0}};
3546 static swig_cast_info _swigc__p__GPContextFeedback[] = {  {&_swigt__p__GPContextFeedback, 0, 0, 0},{0, 0, 0, 0}};
3547 static swig_cast_info _swigc__p__GPPortInfoList[] = {  {&_swigt__p__GPPortInfoList, 0, 0, 0},{0, 0, 0, 0}};
3548 static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
3549 static swig_cast_info _swigc__p_f_enum_GPLogLevel_p_q_const__char_p_q_const__char_p_void__void[] = {  {&_swigt__p_f_enum_GPLogLevel_p_q_const__char_p_q_const__char_p_void__void, 0, 0, 0},{0, 0, 0, 0}};
3550 static swig_cast_info _swigc__p_int[] = {  {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
3551 static swig_cast_info _swigc__p_long[] = {  {&_swigt__p_long, 0, 0, 0},{0, 0, 0, 0}};
3552 static swig_cast_info _swigc__p_long_long[] = {  {&_swigt__p_long_long, 0, 0, 0},{0, 0, 0, 0}};
3553 static swig_cast_info _swigc__p_short[] = {  {&_swigt__p_short, 0, 0, 0},{0, 0, 0, 0}};
3554 static swig_cast_info _swigc__p_signed_char[] = {  {&_swigt__p_signed_char, 0, 0, 0},{0, 0, 0, 0}};
3555 static swig_cast_info _swigc__p_unsigned_char[] = {  {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
3556 static swig_cast_info _swigc__p_unsigned_int[] = {  {&_swigt__p_unsigned_int, 0, 0, 0},{0, 0, 0, 0}};
3557 static swig_cast_info _swigc__p_unsigned_long_long[] = {  {&_swigt__p_unsigned_long_long, 0, 0, 0},{0, 0, 0, 0}};
3558 static swig_cast_info _swigc__p_unsigned_short[] = {  {&_swigt__p_unsigned_short, 0, 0, 0},{0, 0, 0, 0}};
3559 
3560 static swig_cast_info *swig_cast_initial[] = {
3561   _swigc__p_CameraAbilities,
3562   _swigc__p_CameraCaptureType,
3563   _swigc__p_CameraDriverStatus,
3564   _swigc__p_CameraEventType,
3565   _swigc__p_CameraFileAccessType,
3566   _swigc__p_CameraFileInfoFields,
3567   _swigc__p_CameraFileOperation,
3568   _swigc__p_CameraFilePath,
3569   _swigc__p_CameraFilePermissions,
3570   _swigc__p_CameraFileStatus,
3571   _swigc__p_CameraFileType,
3572   _swigc__p_CameraFolderOperation,
3573   _swigc__p_CameraOperation,
3574   _swigc__p_CameraStorageAccessType,
3575   _swigc__p_CameraStorageFilesystemType,
3576   _swigc__p_CameraStorageInfoFields,
3577   _swigc__p_CameraStorageType,
3578   _swigc__p_CameraText,
3579   _swigc__p_CameraWidgetType,
3580   _swigc__p_GPLogLevel,
3581   _swigc__p_GPPortType,
3582   _swigc__p_GPVersionVerbosity,
3583   _swigc__p_GphotoDeviceType,
3584   _swigc__p_LogFuncItem,
3585   _swigc__p__Camera,
3586   _swigc__p__CameraAbilitiesList,
3587   _swigc__p__CameraFile,
3588   _swigc__p__CameraFileHandler,
3589   _swigc__p__CameraFileInfo,
3590   _swigc__p__CameraFileInfoAudio,
3591   _swigc__p__CameraFileInfoFile,
3592   _swigc__p__CameraFileInfoPreview,
3593   _swigc__p__CameraFilesystem,
3594   _swigc__p__CameraFilesystemFuncs,
3595   _swigc__p__CameraFunctions,
3596   _swigc__p__CameraList,
3597   _swigc__p__CameraPrivateCore,
3598   _swigc__p__CameraPrivateLibrary,
3599   _swigc__p__CameraStorageInformation,
3600   _swigc__p__CameraWidget,
3601   _swigc__p__GPContext,
3602   _swigc__p__GPContextFeedback,
3603   _swigc__p__GPPortInfoList,
3604   _swigc__p_char,
3605   _swigc__p_f_enum_GPLogLevel_p_q_const__char_p_q_const__char_p_void__void,
3606   _swigc__p_int,
3607   _swigc__p_long,
3608   _swigc__p_long_long,
3609   _swigc__p_short,
3610   _swigc__p_signed_char,
3611   _swigc__p_unsigned_char,
3612   _swigc__p_unsigned_int,
3613   _swigc__p_unsigned_long_long,
3614   _swigc__p_unsigned_short,
3615 };
3616 
3617 
3618 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
3619 
3620 static swig_const_info swig_const_table[] = {
3621 {0, 0, 0, 0.0, 0, 0}};
3622 
3623 #ifdef __cplusplus
3624 }
3625 #endif
3626 /* -----------------------------------------------------------------------------
3627  * Type initialization:
3628  * This problem is tough by the requirement that no dynamic
3629  * memory is used. Also, since swig_type_info structures store pointers to
3630  * swig_cast_info structures and swig_cast_info structures store pointers back
3631  * to swig_type_info structures, we need some lookup code at initialization.
3632  * The idea is that swig generates all the structures that are needed.
3633  * The runtime then collects these partially filled structures.
3634  * The SWIG_InitializeModule function takes these initial arrays out of
3635  * swig_module, and does all the lookup, filling in the swig_module.types
3636  * array with the correct data and linking the correct swig_cast_info
3637  * structures together.
3638  *
3639  * The generated swig_type_info structures are assigned statically to an initial
3640  * array. We just loop through that array, and handle each type individually.
3641  * First we lookup if this type has been already loaded, and if so, use the
3642  * loaded structure instead of the generated one. Then we have to fill in the
3643  * cast linked list. The cast data is initially stored in something like a
3644  * two-dimensional array. Each row corresponds to a type (there are the same
3645  * number of rows as there are in the swig_type_initial array). Each entry in
3646  * a column is one of the swig_cast_info structures for that type.
3647  * The cast_initial array is actually an array of arrays, because each row has
3648  * a variable number of columns. So to actually build the cast linked list,
3649  * we find the array of casts associated with the type, and loop through it
3650  * adding the casts to the list. The one last trick we need to do is making
3651  * sure the type pointer in the swig_cast_info struct is correct.
3652  *
3653  * First off, we lookup the cast->type name to see if it is already loaded.
3654  * There are three cases to handle:
3655  *  1) If the cast->type has already been loaded AND the type we are adding
3656  *     casting info to has not been loaded (it is in this module), THEN we
3657  *     replace the cast->type pointer with the type pointer that has already
3658  *     been loaded.
3659  *  2) If BOTH types (the one we are adding casting info to, and the
3660  *     cast->type) are loaded, THEN the cast info has already been loaded by
3661  *     the previous module so we just ignore it.
3662  *  3) Finally, if cast->type has not already been loaded, then we add that
3663  *     swig_cast_info to the linked list (because the cast->type) pointer will
3664  *     be correct.
3665  * ----------------------------------------------------------------------------- */
3666 
3667 #ifdef __cplusplus
3668 extern "C" {
3669 #if 0
3670 } /* c-mode */
3671 #endif
3672 #endif
3673 
3674 #if 0
3675 #define SWIGRUNTIME_DEBUG
3676 #endif
3677 
3678 
3679 SWIGRUNTIME void
SWIG_InitializeModule(void * clientdata)3680 SWIG_InitializeModule(void *clientdata) {
3681   size_t i;
3682   swig_module_info *module_head, *iter;
3683   int init;
3684 
3685   /* check to see if the circular list has been setup, if not, set it up */
3686   if (swig_module.next==0) {
3687     /* Initialize the swig_module */
3688     swig_module.type_initial = swig_type_initial;
3689     swig_module.cast_initial = swig_cast_initial;
3690     swig_module.next = &swig_module;
3691     init = 1;
3692   } else {
3693     init = 0;
3694   }
3695 
3696   /* Try and load any already created modules */
3697   module_head = SWIG_GetModule(clientdata);
3698   if (!module_head) {
3699     /* This is the first module loaded for this interpreter */
3700     /* so set the swig module into the interpreter */
3701     SWIG_SetModule(clientdata, &swig_module);
3702   } else {
3703     /* the interpreter has loaded a SWIG module, but has it loaded this one? */
3704     iter=module_head;
3705     do {
3706       if (iter==&swig_module) {
3707         /* Our module is already in the list, so there's nothing more to do. */
3708         return;
3709       }
3710       iter=iter->next;
3711     } while (iter!= module_head);
3712 
3713     /* otherwise we must add our module into the list */
3714     swig_module.next = module_head->next;
3715     module_head->next = &swig_module;
3716   }
3717 
3718   /* When multiple interpreters are used, a module could have already been initialized in
3719        a different interpreter, but not yet have a pointer in this interpreter.
3720        In this case, we do not want to continue adding types... everything should be
3721        set up already */
3722   if (init == 0) return;
3723 
3724   /* Now work on filling in swig_module.types */
3725 #ifdef SWIGRUNTIME_DEBUG
3726   printf("SWIG_InitializeModule: size %lu\n", (unsigned long)swig_module.size);
3727 #endif
3728   for (i = 0; i < swig_module.size; ++i) {
3729     swig_type_info *type = 0;
3730     swig_type_info *ret;
3731     swig_cast_info *cast;
3732 
3733 #ifdef SWIGRUNTIME_DEBUG
3734     printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name);
3735 #endif
3736 
3737     /* if there is another module already loaded */
3738     if (swig_module.next != &swig_module) {
3739       type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
3740     }
3741     if (type) {
3742       /* Overwrite clientdata field */
3743 #ifdef SWIGRUNTIME_DEBUG
3744       printf("SWIG_InitializeModule: found type %s\n", type->name);
3745 #endif
3746       if (swig_module.type_initial[i]->clientdata) {
3747         type->clientdata = swig_module.type_initial[i]->clientdata;
3748 #ifdef SWIGRUNTIME_DEBUG
3749         printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
3750 #endif
3751       }
3752     } else {
3753       type = swig_module.type_initial[i];
3754     }
3755 
3756     /* Insert casting types */
3757     cast = swig_module.cast_initial[i];
3758     while (cast->type) {
3759       /* Don't need to add information already in the list */
3760       ret = 0;
3761 #ifdef SWIGRUNTIME_DEBUG
3762       printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
3763 #endif
3764       if (swig_module.next != &swig_module) {
3765         ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
3766 #ifdef SWIGRUNTIME_DEBUG
3767         if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
3768 #endif
3769       }
3770       if (ret) {
3771         if (type == swig_module.type_initial[i]) {
3772 #ifdef SWIGRUNTIME_DEBUG
3773           printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
3774 #endif
3775           cast->type = ret;
3776           ret = 0;
3777         } else {
3778           /* Check for casting already in the list */
3779           swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
3780 #ifdef SWIGRUNTIME_DEBUG
3781           if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
3782 #endif
3783           if (!ocast) ret = 0;
3784         }
3785       }
3786 
3787       if (!ret) {
3788 #ifdef SWIGRUNTIME_DEBUG
3789         printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
3790 #endif
3791         if (type->cast) {
3792           type->cast->prev = cast;
3793           cast->next = type->cast;
3794         }
3795         type->cast = cast;
3796       }
3797       cast++;
3798     }
3799     /* Set entry in modules->types array equal to the type */
3800     swig_module.types[i] = type;
3801   }
3802   swig_module.types[i] = 0;
3803 
3804 #ifdef SWIGRUNTIME_DEBUG
3805   printf("**** SWIG_InitializeModule: Cast List ******\n");
3806   for (i = 0; i < swig_module.size; ++i) {
3807     int j = 0;
3808     swig_cast_info *cast = swig_module.cast_initial[i];
3809     printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name);
3810     while (cast->type) {
3811       printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
3812       cast++;
3813       ++j;
3814     }
3815     printf("---- Total casts: %d\n",j);
3816   }
3817   printf("**** SWIG_InitializeModule: Cast List ******\n");
3818 #endif
3819 }
3820 
3821 /* This function will propagate the clientdata field of type to
3822 * any new swig_type_info structures that have been added into the list
3823 * of equivalent types.  It is like calling
3824 * SWIG_TypeClientData(type, clientdata) a second time.
3825 */
3826 SWIGRUNTIME void
SWIG_PropagateClientData(void)3827 SWIG_PropagateClientData(void) {
3828   size_t i;
3829   swig_cast_info *equiv;
3830   static int init_run = 0;
3831 
3832   if (init_run) return;
3833   init_run = 1;
3834 
3835   for (i = 0; i < swig_module.size; i++) {
3836     if (swig_module.types[i]->clientdata) {
3837       equiv = swig_module.types[i]->cast;
3838       while (equiv) {
3839         if (!equiv->converter) {
3840           if (equiv->type && !equiv->type->clientdata)
3841           SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
3842         }
3843         equiv = equiv->next;
3844       }
3845     }
3846   }
3847 }
3848 
3849 #ifdef __cplusplus
3850 #if 0
3851 {
3852   /* c-mode */
3853 #endif
3854 }
3855 #endif
3856 
3857 
3858 
3859 #ifdef __cplusplus
3860 extern "C" {
3861 #endif
3862 
3863   /* Python-specific SWIG API */
3864 #define SWIG_newvarlink()                             SWIG_Python_newvarlink()
3865 #define SWIG_addvarlink(p, name, get_attr, set_attr)  SWIG_Python_addvarlink(p, name, get_attr, set_attr)
3866 #define SWIG_InstallConstants(d, constants)           SWIG_Python_InstallConstants(d, constants)
3867 
3868   /* -----------------------------------------------------------------------------
3869    * global variable support code.
3870    * ----------------------------------------------------------------------------- */
3871 
3872   typedef struct swig_globalvar {
3873     char       *name;                  /* Name of global variable */
3874     PyObject *(*get_attr)(void);       /* Return the current value */
3875     int       (*set_attr)(PyObject *); /* Set the value */
3876     struct swig_globalvar *next;
3877   } swig_globalvar;
3878 
3879   typedef struct swig_varlinkobject {
3880     PyObject_HEAD
3881     swig_globalvar *vars;
3882   } swig_varlinkobject;
3883 
3884   SWIGINTERN PyObject *
swig_varlink_repr(swig_varlinkobject * SWIGUNUSEDPARM (v))3885   swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) {
3886 #if PY_VERSION_HEX >= 0x03000000
3887     return PyUnicode_InternFromString("<Swig global variables>");
3888 #else
3889     return PyString_FromString("<Swig global variables>");
3890 #endif
3891   }
3892 
3893   SWIGINTERN PyObject *
swig_varlink_str(swig_varlinkobject * v)3894   swig_varlink_str(swig_varlinkobject *v) {
3895 #if PY_VERSION_HEX >= 0x03000000
3896     PyObject *str = PyUnicode_InternFromString("(");
3897     PyObject *tail;
3898     PyObject *joined;
3899     swig_globalvar *var;
3900     for (var = v->vars; var; var=var->next) {
3901       tail = PyUnicode_FromString(var->name);
3902       joined = PyUnicode_Concat(str, tail);
3903       Py_DecRef(str);
3904       Py_DecRef(tail);
3905       str = joined;
3906       if (var->next) {
3907         tail = PyUnicode_InternFromString(", ");
3908         joined = PyUnicode_Concat(str, tail);
3909         Py_DecRef(str);
3910         Py_DecRef(tail);
3911         str = joined;
3912       }
3913     }
3914     tail = PyUnicode_InternFromString(")");
3915     joined = PyUnicode_Concat(str, tail);
3916     Py_DecRef(str);
3917     Py_DecRef(tail);
3918     str = joined;
3919 #else
3920     PyObject *str = PyString_FromString("(");
3921     swig_globalvar *var;
3922     for (var = v->vars; var; var=var->next) {
3923       PyString_ConcatAndDel(&str,PyString_FromString(var->name));
3924       if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", "));
3925     }
3926     PyString_ConcatAndDel(&str,PyString_FromString(")"));
3927 #endif
3928     return str;
3929   }
3930 
3931   SWIGINTERN void
swig_varlink_dealloc(swig_varlinkobject * v)3932   swig_varlink_dealloc(swig_varlinkobject *v) {
3933     swig_globalvar *var = v->vars;
3934     while (var) {
3935       swig_globalvar *n = var->next;
3936       free(var->name);
3937       free(var);
3938       var = n;
3939     }
3940   }
3941 
3942   SWIGINTERN PyObject *
swig_varlink_getattr(swig_varlinkobject * v,char * n)3943   swig_varlink_getattr(swig_varlinkobject *v, char *n) {
3944     PyObject *res = NULL;
3945     swig_globalvar *var = v->vars;
3946     while (var) {
3947       if (strcmp(var->name,n) == 0) {
3948         res = (*var->get_attr)();
3949         break;
3950       }
3951       var = var->next;
3952     }
3953     if (res == NULL && !PyErr_Occurred()) {
3954       PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n);
3955     }
3956     return res;
3957   }
3958 
3959   SWIGINTERN int
swig_varlink_setattr(swig_varlinkobject * v,char * n,PyObject * p)3960   swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
3961     int res = 1;
3962     swig_globalvar *var = v->vars;
3963     while (var) {
3964       if (strcmp(var->name,n) == 0) {
3965         res = (*var->set_attr)(p);
3966         break;
3967       }
3968       var = var->next;
3969     }
3970     if (res == 1 && !PyErr_Occurred()) {
3971       PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n);
3972     }
3973     return res;
3974   }
3975 
3976   SWIGINTERN PyTypeObject*
swig_varlink_type(void)3977   swig_varlink_type(void) {
3978     static char varlink__doc__[] = "Swig var link object";
3979     static PyTypeObject varlink_type;
3980     static int type_init = 0;
3981     if (!type_init) {
3982       const PyTypeObject tmp = {
3983 #if PY_VERSION_HEX >= 0x03000000
3984         PyVarObject_HEAD_INIT(NULL, 0)
3985 #else
3986         PyObject_HEAD_INIT(NULL)
3987         0,                                  /* ob_size */
3988 #endif
3989         "swigvarlink",                      /* tp_name */
3990         sizeof(swig_varlinkobject),         /* tp_basicsize */
3991         0,                                  /* tp_itemsize */
3992         (destructor) swig_varlink_dealloc,  /* tp_dealloc */
3993         0,                                  /* tp_print */
3994         (getattrfunc) swig_varlink_getattr, /* tp_getattr */
3995         (setattrfunc) swig_varlink_setattr, /* tp_setattr */
3996         0,                                  /* tp_compare */
3997         (reprfunc) swig_varlink_repr,       /* tp_repr */
3998         0,                                  /* tp_as_number */
3999         0,                                  /* tp_as_sequence */
4000         0,                                  /* tp_as_mapping */
4001         0,                                  /* tp_hash */
4002         0,                                  /* tp_call */
4003         (reprfunc) swig_varlink_str,        /* tp_str */
4004         0,                                  /* tp_getattro */
4005         0,                                  /* tp_setattro */
4006         0,                                  /* tp_as_buffer */
4007         0,                                  /* tp_flags */
4008         varlink__doc__,                     /* tp_doc */
4009         0,                                  /* tp_traverse */
4010         0,                                  /* tp_clear */
4011         0,                                  /* tp_richcompare */
4012         0,                                  /* tp_weaklistoffset */
4013         0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
4014         0,                                  /* tp_del */
4015         0,                                  /* tp_version_tag */
4016 #if PY_VERSION_HEX >= 0x03040000
4017         0,                                  /* tp_finalize */
4018 #endif
4019 #if PY_VERSION_HEX >= 0x03080000
4020         0,                                  /* tp_vectorcall */
4021 #endif
4022 #if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
4023         0,                                  /* tp_print */
4024 #endif
4025 #ifdef COUNT_ALLOCS
4026         0,                                  /* tp_allocs */
4027         0,                                  /* tp_frees */
4028         0,                                  /* tp_maxalloc */
4029         0,                                  /* tp_prev */
4030         0                                   /* tp_next */
4031 #endif
4032       };
4033       varlink_type = tmp;
4034       type_init = 1;
4035       if (PyType_Ready(&varlink_type) < 0)
4036       return NULL;
4037     }
4038     return &varlink_type;
4039   }
4040 
4041   /* Create a variable linking object for use later */
4042   SWIGINTERN PyObject *
SWIG_Python_newvarlink(void)4043   SWIG_Python_newvarlink(void) {
4044     swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type());
4045     if (result) {
4046       result->vars = 0;
4047     }
4048     return ((PyObject*) result);
4049   }
4050 
4051   SWIGINTERN void
SWIG_Python_addvarlink(PyObject * p,const char * name,PyObject * (* get_attr)(void),int (* set_attr)(PyObject * p))4052   SWIG_Python_addvarlink(PyObject *p, const char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
4053     swig_varlinkobject *v = (swig_varlinkobject *) p;
4054     swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar));
4055     if (gv) {
4056       size_t size = strlen(name)+1;
4057       gv->name = (char *)malloc(size);
4058       if (gv->name) {
4059         memcpy(gv->name, name, size);
4060         gv->get_attr = get_attr;
4061         gv->set_attr = set_attr;
4062         gv->next = v->vars;
4063       }
4064     }
4065     v->vars = gv;
4066   }
4067 
4068   SWIGINTERN PyObject *
SWIG_globals(void)4069   SWIG_globals(void) {
4070     static PyObject *globals = 0;
4071     if (!globals) {
4072       globals = SWIG_newvarlink();
4073     }
4074     return globals;
4075   }
4076 
4077   /* -----------------------------------------------------------------------------
4078    * constants/methods manipulation
4079    * ----------------------------------------------------------------------------- */
4080 
4081   /* Install Constants */
4082   SWIGINTERN void
SWIG_Python_InstallConstants(PyObject * d,swig_const_info constants[])4083   SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
4084     PyObject *obj = 0;
4085     size_t i;
4086     for (i = 0; constants[i].type; ++i) {
4087       switch(constants[i].type) {
4088       case SWIG_PY_POINTER:
4089         obj = SWIG_InternalNewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
4090         break;
4091       case SWIG_PY_BINARY:
4092         obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
4093         break;
4094       default:
4095         obj = 0;
4096         break;
4097       }
4098       if (obj) {
4099         PyDict_SetItemString(d, constants[i].name, obj);
4100         Py_DECREF(obj);
4101       }
4102     }
4103   }
4104 
4105   /* -----------------------------------------------------------------------------*/
4106   /* Fix SwigMethods to carry the callback ptrs when needed */
4107   /* -----------------------------------------------------------------------------*/
4108 
4109   SWIGINTERN void
SWIG_Python_FixMethods(PyMethodDef * methods,swig_const_info * const_table,swig_type_info ** types,swig_type_info ** types_initial)4110   SWIG_Python_FixMethods(PyMethodDef *methods,
4111     swig_const_info *const_table,
4112     swig_type_info **types,
4113     swig_type_info **types_initial) {
4114     size_t i;
4115     for (i = 0; methods[i].ml_name; ++i) {
4116       const char *c = methods[i].ml_doc;
4117       if (!c) continue;
4118       c = strstr(c, "swig_ptr: ");
4119       if (c) {
4120         int j;
4121         swig_const_info *ci = 0;
4122         const char *name = c + 10;
4123         for (j = 0; const_table[j].type; ++j) {
4124           if (strncmp(const_table[j].name, name,
4125               strlen(const_table[j].name)) == 0) {
4126             ci = &(const_table[j]);
4127             break;
4128           }
4129         }
4130         if (ci) {
4131           void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
4132           if (ptr) {
4133             size_t shift = (ci->ptype) - types;
4134             swig_type_info *ty = types_initial[shift];
4135             size_t ldoc = (c - methods[i].ml_doc);
4136             size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
4137             char *ndoc = (char*)malloc(ldoc + lptr + 10);
4138             if (ndoc) {
4139               char *buff = ndoc;
4140               memcpy(buff, methods[i].ml_doc, ldoc);
4141               buff += ldoc;
4142               memcpy(buff, "swig_ptr: ", 10);
4143               buff += 10;
4144               SWIG_PackVoidPtr(buff, ptr, ty->name, lptr);
4145               methods[i].ml_doc = ndoc;
4146             }
4147           }
4148         }
4149       }
4150     }
4151   }
4152 
4153   /* -----------------------------------------------------------------------------
4154    * Method creation and docstring support functions
4155    * ----------------------------------------------------------------------------- */
4156 
4157   /* -----------------------------------------------------------------------------
4158    * Function to find the method definition with the correct docstring for the
4159    * proxy module as opposed to the low-level API
4160    * ----------------------------------------------------------------------------- */
4161 
SWIG_PythonGetProxyDoc(const char * name)4162   SWIGINTERN PyMethodDef *SWIG_PythonGetProxyDoc(const char *name) {
4163     /* Find the function in the modified method table */
4164     size_t offset = 0;
4165     int found = 0;
4166     while (SwigMethods_proxydocs[offset].ml_meth != NULL) {
4167       if (strcmp(SwigMethods_proxydocs[offset].ml_name, name) == 0) {
4168         found = 1;
4169         break;
4170       }
4171       offset++;
4172     }
4173     /* Use the copy with the modified docstring if available */
4174     return found ? &SwigMethods_proxydocs[offset] : NULL;
4175   }
4176 
4177   /* -----------------------------------------------------------------------------
4178    * Wrapper of PyInstanceMethod_New() used in Python 3
4179    * It is exported to the generated module, used for -fastproxy
4180    * ----------------------------------------------------------------------------- */
4181 
SWIG_PyInstanceMethod_New(PyObject * SWIGUNUSEDPARM (self),PyObject * func)4182   SWIGINTERN PyObject *SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) {
4183     if (PyCFunction_Check(func)) {
4184       PyCFunctionObject *funcobj = (PyCFunctionObject *)func;
4185       PyMethodDef *ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name);
4186       if (ml)
4187       func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module);
4188     }
4189 #if PY_VERSION_HEX >= 0x03000000
4190     return PyInstanceMethod_New(func);
4191 #else
4192     return PyMethod_New(func, NULL, NULL);
4193 #endif
4194   }
4195 
4196   /* -----------------------------------------------------------------------------
4197    * Wrapper of PyStaticMethod_New()
4198    * It is exported to the generated module, used for -fastproxy
4199    * ----------------------------------------------------------------------------- */
4200 
SWIG_PyStaticMethod_New(PyObject * SWIGUNUSEDPARM (self),PyObject * func)4201   SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) {
4202     if (PyCFunction_Check(func)) {
4203       PyCFunctionObject *funcobj = (PyCFunctionObject *)func;
4204       PyMethodDef *ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name);
4205       if (ml)
4206       func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module);
4207     }
4208     return PyStaticMethod_New(func);
4209   }
4210 
4211 #ifdef __cplusplus
4212 }
4213 #endif
4214 
4215 /* -----------------------------------------------------------------------------*
4216  *  Partial Init method
4217  * -----------------------------------------------------------------------------*/
4218 
4219 #ifdef __cplusplus
4220 extern "C"
4221 #endif
4222 
4223 SWIGEXPORT
4224 #if PY_VERSION_HEX >= 0x03000000
4225 PyObject*
4226 #else
4227 void
4228 #endif
SWIG_init(void)4229 SWIG_init(void) {
4230   PyObject *m, *d, *md, *globals;
4231 
4232 #if PY_VERSION_HEX >= 0x03000000
4233   static struct PyModuleDef SWIG_module = {
4234     PyModuleDef_HEAD_INIT,
4235     SWIG_name,
4236     NULL,
4237     -1,
4238     SwigMethods,
4239     NULL,
4240     NULL,
4241     NULL,
4242     NULL
4243   };
4244 #endif
4245 
4246 #if defined(SWIGPYTHON_BUILTIN)
4247   static SwigPyClientData SwigPyObject_clientdata = {
4248     0, 0, 0, 0, 0, 0, 0
4249   };
4250   static PyGetSetDef this_getset_def = {
4251     (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL
4252   };
4253   static SwigPyGetSet thisown_getset_closure = {
4254     SwigPyObject_own,
4255     SwigPyObject_own
4256   };
4257   static PyGetSetDef thisown_getset_def = {
4258     (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure
4259   };
4260   PyTypeObject *builtin_pytype;
4261   int builtin_base_count;
4262   swig_type_info *builtin_basetype;
4263   PyObject *tuple;
4264   PyGetSetDescrObject *static_getset;
4265   PyTypeObject *metatype;
4266   PyTypeObject *swigpyobject;
4267   SwigPyClientData *cd;
4268   PyObject *public_interface, *public_symbol;
4269   PyObject *this_descr;
4270   PyObject *thisown_descr;
4271   PyObject *self = 0;
4272   int i;
4273 
4274   (void)builtin_pytype;
4275   (void)builtin_base_count;
4276   (void)builtin_basetype;
4277   (void)tuple;
4278   (void)static_getset;
4279   (void)self;
4280 
4281   /* Metaclass is used to implement static member variables */
4282   metatype = SwigPyObjectType();
4283   assert(metatype);
4284 #endif
4285 
4286   (void)globals;
4287 
4288   /* Create singletons now to avoid potential deadlocks with multi-threaded usage after module initialization */
4289   SWIG_This();
4290   SWIG_Python_TypeCache();
4291   SwigPyPacked_type();
4292 #ifndef SWIGPYTHON_BUILTIN
4293   SwigPyObject_type();
4294 #endif
4295 
4296   /* Fix SwigMethods to carry the callback ptrs when needed */
4297   SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial);
4298 
4299 #if PY_VERSION_HEX >= 0x03000000
4300   m = PyModule_Create(&SWIG_module);
4301 #else
4302   m = Py_InitModule(SWIG_name, SwigMethods);
4303 #endif
4304 
4305   md = d = PyModule_GetDict(m);
4306   (void)md;
4307 
4308   SWIG_InitializeModule(0);
4309 
4310 #ifdef SWIGPYTHON_BUILTIN
4311   swigpyobject = SwigPyObject_TypeOnce();
4312 
4313   SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject");
4314   assert(SwigPyObject_stype);
4315   cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
4316   if (!cd) {
4317     SwigPyObject_stype->clientdata = &SwigPyObject_clientdata;
4318     SwigPyObject_clientdata.pytype = swigpyobject;
4319   } else if (swigpyobject->tp_basicsize != cd->pytype->tp_basicsize) {
4320     PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules.");
4321 # if PY_VERSION_HEX >= 0x03000000
4322     return NULL;
4323 # else
4324     return;
4325 # endif
4326   }
4327 
4328   /* All objects have a 'this' attribute */
4329   this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def);
4330   (void)this_descr;
4331 
4332   /* All objects have a 'thisown' attribute */
4333   thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def);
4334   (void)thisown_descr;
4335 
4336   public_interface = PyList_New(0);
4337   public_symbol = 0;
4338   (void)public_symbol;
4339 
4340   PyDict_SetItemString(md, "__all__", public_interface);
4341   Py_DECREF(public_interface);
4342   for (i = 0; SwigMethods[i].ml_name != NULL; ++i)
4343   SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name);
4344   for (i = 0; swig_const_table[i].name != 0; ++i)
4345   SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name);
4346 #endif
4347 
4348   SWIG_InstallConstants(d,swig_const_table);
4349 
4350 
4351   {
4352     PyObject *module = PyImport_ImportModule("gphoto2");
4353     if (module != NULL) {
4354       PyExc_GPhoto2Error = PyObject_GetAttrString(module, "GPhoto2Error");
4355       Py_DECREF(module);
4356     }
4357     if (PyExc_GPhoto2Error == NULL)
4358 #if PY_VERSION_HEX >= 0x03000000
4359     return NULL;
4360 #else
4361     return;
4362 #endif
4363   }
4364 
4365   SWIG_Python_SetConstant(d, "GP_LOG_ERROR",SWIG_From_int((int)(GP_LOG_ERROR)));
4366   SWIG_Python_SetConstant(d, "GP_LOG_VERBOSE",SWIG_From_int((int)(GP_LOG_VERBOSE)));
4367   SWIG_Python_SetConstant(d, "GP_LOG_DEBUG",SWIG_From_int((int)(GP_LOG_DEBUG)));
4368   SWIG_Python_SetConstant(d, "GP_LOG_DATA",SWIG_From_int((int)(GP_LOG_DATA)));
4369 #if PY_VERSION_HEX >= 0x03000000
4370   return m;
4371 #else
4372   return;
4373 #endif
4374 }
4375 
4376