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 #define SWIGPYTHON_BUILTIN
18 
19 /* -----------------------------------------------------------------------------
20  *  This section contains generic SWIG labels for method/variable
21  *  declarations/attributes, and other compiler dependent labels.
22  * ----------------------------------------------------------------------------- */
23 
24 /* template workaround for compilers that cannot correctly implement the C++ standard */
25 #ifndef SWIGTEMPLATEDISAMBIGUATOR
26 # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
27 #  define SWIGTEMPLATEDISAMBIGUATOR template
28 # elif defined(__HP_aCC)
29 /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
30 /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
31 #  define SWIGTEMPLATEDISAMBIGUATOR template
32 # else
33 #  define SWIGTEMPLATEDISAMBIGUATOR
34 # endif
35 #endif
36 
37 /* inline attribute */
38 #ifndef SWIGINLINE
39 # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
40 #   define SWIGINLINE inline
41 # else
42 #   define SWIGINLINE
43 # endif
44 #endif
45 
46 /* attribute recognised by some compilers to avoid 'unused' warnings */
47 #ifndef SWIGUNUSED
48 # if defined(__GNUC__)
49 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
50 #     define SWIGUNUSED __attribute__ ((__unused__))
51 #   else
52 #     define SWIGUNUSED
53 #   endif
54 # elif defined(__ICC)
55 #   define SWIGUNUSED __attribute__ ((__unused__))
56 # else
57 #   define SWIGUNUSED
58 # endif
59 #endif
60 
61 #ifndef SWIG_MSC_UNSUPPRESS_4505
62 # if defined(_MSC_VER)
63 #   pragma warning(disable : 4505) /* unreferenced local function has been removed */
64 # endif
65 #endif
66 
67 #ifndef SWIGUNUSEDPARM
68 # ifdef __cplusplus
69 #   define SWIGUNUSEDPARM(p)
70 # else
71 #   define SWIGUNUSEDPARM(p) p SWIGUNUSED
72 # endif
73 #endif
74 
75 /* internal SWIG method */
76 #ifndef SWIGINTERN
77 # define SWIGINTERN static SWIGUNUSED
78 #endif
79 
80 /* internal inline SWIG method */
81 #ifndef SWIGINTERNINLINE
82 # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
83 #endif
84 
85 /* exporting methods */
86 #if defined(__GNUC__)
87 #  if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
88 #    ifndef GCC_HASCLASSVISIBILITY
89 #      define GCC_HASCLASSVISIBILITY
90 #    endif
91 #  endif
92 #endif
93 
94 #ifndef SWIGEXPORT
95 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
96 #   if defined(STATIC_LINKED)
97 #     define SWIGEXPORT
98 #   else
99 #     define SWIGEXPORT __declspec(dllexport)
100 #   endif
101 # else
102 #   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
103 #     define SWIGEXPORT __attribute__ ((visibility("default")))
104 #   else
105 #     define SWIGEXPORT
106 #   endif
107 # endif
108 #endif
109 
110 /* calling conventions for Windows */
111 #ifndef SWIGSTDCALL
112 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
113 #   define SWIGSTDCALL __stdcall
114 # else
115 #   define SWIGSTDCALL
116 # endif
117 #endif
118 
119 /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
120 #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
121 # define _CRT_SECURE_NO_DEPRECATE
122 #endif
123 
124 /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
125 #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
126 # define _SCL_SECURE_NO_DEPRECATE
127 #endif
128 
129 /* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
130 #if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
131 # define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
132 #endif
133 
134 /* Intel's compiler complains if a variable which was never initialised is
135  * cast to void, which is a common idiom which we use to indicate that we
136  * are aware a variable isn't used.  So we just silence that warning.
137  * See: https://github.com/swig/swig/issues/192 for more discussion.
138  */
139 #ifdef __INTEL_COMPILER
140 # pragma warning disable 592
141 #endif
142 
143 
144 #if defined(__GNUC__) && defined(_WIN32) && !defined(SWIG_PYTHON_NO_HYPOT_WORKAROUND)
145 /* Workaround for '::hypot' has not been declared', see https://bugs.python.org/issue11566 */
146 # include <math.h>
147 #endif
148 
149 #if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG)
150 /* Use debug wrappers with the Python release dll */
151 # undef _DEBUG
152 # include <Python.h>
153 # define _DEBUG 1
154 #else
155 # include <Python.h>
156 #endif
157 
158 /* -----------------------------------------------------------------------------
159  * swigrun.swg
160  *
161  * This file contains generic C API SWIG runtime support for pointer
162  * type checking.
163  * ----------------------------------------------------------------------------- */
164 
165 /* This should only be incremented when either the layout of swig_type_info changes,
166    or for whatever reason, the runtime changes incompatibly */
167 #define SWIG_RUNTIME_VERSION "4"
168 
169 /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
170 #ifdef SWIG_TYPE_TABLE
171 # define SWIG_QUOTE_STRING(x) #x
172 # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
173 # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
174 #else
175 # define SWIG_TYPE_TABLE_NAME
176 #endif
177 
178 /*
179   You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
180   creating a static or dynamic library from the SWIG runtime code.
181   In 99.9% of the cases, SWIG just needs to declare them as 'static'.
182 
183   But only do this if strictly necessary, ie, if you have problems
184   with your compiler or suchlike.
185 */
186 
187 #ifndef SWIGRUNTIME
188 # define SWIGRUNTIME SWIGINTERN
189 #endif
190 
191 #ifndef SWIGRUNTIMEINLINE
192 # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
193 #endif
194 
195 /*  Generic buffer size */
196 #ifndef SWIG_BUFFER_SIZE
197 # define SWIG_BUFFER_SIZE 1024
198 #endif
199 
200 /* Flags for pointer conversions */
201 #define SWIG_POINTER_DISOWN        0x1
202 #define SWIG_CAST_NEW_MEMORY       0x2
203 #define SWIG_POINTER_NO_NULL       0x4
204 
205 /* Flags for new pointer objects */
206 #define SWIG_POINTER_OWN           0x1
207 
208 
209 /*
210    Flags/methods for returning states.
211 
212    The SWIG conversion methods, as ConvertPtr, return an integer
213    that tells if the conversion was successful or not. And if not,
214    an error code can be returned (see swigerrors.swg for the codes).
215 
216    Use the following macros/flags to set or process the returning
217    states.
218 
219    In old versions of SWIG, code such as the following was usually written:
220 
221      if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
222        // success code
223      } else {
224        //fail code
225      }
226 
227    Now you can be more explicit:
228 
229     int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
230     if (SWIG_IsOK(res)) {
231       // success code
232     } else {
233       // fail code
234     }
235 
236    which is the same really, but now you can also do
237 
238     Type *ptr;
239     int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
240     if (SWIG_IsOK(res)) {
241       // success code
242       if (SWIG_IsNewObj(res) {
243         ...
244 	delete *ptr;
245       } else {
246         ...
247       }
248     } else {
249       // fail code
250     }
251 
252    I.e., now SWIG_ConvertPtr can return new objects and you can
253    identify the case and take care of the deallocation. Of course that
254    also requires SWIG_ConvertPtr to return new result values, such as
255 
256       int SWIG_ConvertPtr(obj, ptr,...) {
257         if (<obj is ok>) {
258           if (<need new object>) {
259             *ptr = <ptr to new allocated object>;
260             return SWIG_NEWOBJ;
261           } else {
262             *ptr = <ptr to old object>;
263             return SWIG_OLDOBJ;
264           }
265         } else {
266           return SWIG_BADOBJ;
267         }
268       }
269 
270    Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
271    more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
272    SWIG errors code.
273 
274    Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
275    allows to return the 'cast rank', for example, if you have this
276 
277        int food(double)
278        int fooi(int);
279 
280    and you call
281 
282       food(1)   // cast rank '1'  (1 -> 1.0)
283       fooi(1)   // cast rank '0'
284 
285    just use the SWIG_AddCast()/SWIG_CheckState()
286 */
287 
288 #define SWIG_OK                    (0)
289 #define SWIG_ERROR                 (-1)
290 #define SWIG_IsOK(r)               (r >= 0)
291 #define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)
292 
293 /* The CastRankLimit says how many bits are used for the cast rank */
294 #define SWIG_CASTRANKLIMIT         (1 << 8)
295 /* The NewMask denotes the object was created (using new/malloc) */
296 #define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
297 /* The TmpMask is for in/out typemaps that use temporal objects */
298 #define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
299 /* Simple returning values */
300 #define SWIG_BADOBJ                (SWIG_ERROR)
301 #define SWIG_OLDOBJ                (SWIG_OK)
302 #define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
303 #define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
304 /* Check, add and del mask methods */
305 #define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
306 #define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
307 #define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
308 #define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
309 #define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
310 #define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
311 
312 /* Cast-Rank Mode */
313 #if defined(SWIG_CASTRANK_MODE)
314 #  ifndef SWIG_TypeRank
315 #    define SWIG_TypeRank             unsigned long
316 #  endif
317 #  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
318 #    define SWIG_MAXCASTRANK          (2)
319 #  endif
320 #  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
321 #  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
SWIG_AddCast(int r)322 SWIGINTERNINLINE int SWIG_AddCast(int r) {
323   return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
324 }
SWIG_CheckState(int r)325 SWIGINTERNINLINE int SWIG_CheckState(int r) {
326   return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
327 }
328 #else /* no cast-rank mode */
329 #  define SWIG_AddCast(r) (r)
330 #  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
331 #endif
332 
333 
334 #include <string.h>
335 
336 #ifdef __cplusplus
337 extern "C" {
338 #endif
339 
340 typedef void *(*swig_converter_func)(void *, int *);
341 typedef struct swig_type_info *(*swig_dycast_func)(void **);
342 
343 /* Structure to store information on one type */
344 typedef struct swig_type_info {
345   const char             *name;			/* mangled name of this type */
346   const char             *str;			/* human readable name of this type */
347   swig_dycast_func        dcast;		/* dynamic cast function down a hierarchy */
348   struct swig_cast_info  *cast;			/* linked list of types that can cast into this type */
349   void                   *clientdata;		/* language specific type data */
350   int                    owndata;		/* flag if the structure owns the clientdata */
351 } swig_type_info;
352 
353 /* Structure to store a type and conversion function used for casting */
354 typedef struct swig_cast_info {
355   swig_type_info         *type;			/* pointer to type that is equivalent to this type */
356   swig_converter_func     converter;		/* function to cast the void pointers */
357   struct swig_cast_info  *next;			/* pointer to next cast in linked list */
358   struct swig_cast_info  *prev;			/* pointer to the previous cast */
359 } swig_cast_info;
360 
361 /* Structure used to store module information
362  * Each module generates one structure like this, and the runtime collects
363  * all of these structures and stores them in a circularly linked list.*/
364 typedef struct swig_module_info {
365   swig_type_info         **types;		/* Array of pointers to swig_type_info structures that are in this module */
366   size_t                 size;		        /* Number of types in this module */
367   struct swig_module_info *next;		/* Pointer to next element in circularly linked list */
368   swig_type_info         **type_initial;	/* Array of initially generated type structures */
369   swig_cast_info         **cast_initial;	/* Array of initially generated casting structures */
370   void                    *clientdata;		/* Language specific module data */
371 } swig_module_info;
372 
373 /*
374   Compare two type names skipping the space characters, therefore
375   "char*" == "char *" and "Class<int>" == "Class<int >", etc.
376 
377   Return 0 when the two name types are equivalent, as in
378   strncmp, but skipping ' '.
379 */
380 SWIGRUNTIME int
SWIG_TypeNameComp(const char * f1,const char * l1,const char * f2,const char * l2)381 SWIG_TypeNameComp(const char *f1, const char *l1,
382 		  const char *f2, const char *l2) {
383   for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
384     while ((*f1 == ' ') && (f1 != l1)) ++f1;
385     while ((*f2 == ' ') && (f2 != l2)) ++f2;
386     if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
387   }
388   return (int)((l1 - f1) - (l2 - f2));
389 }
390 
391 /*
392   Check type equivalence in a name list like <name1>|<name2>|...
393   Return 0 if equal, -1 if nb < tb, 1 if nb > tb
394 */
395 SWIGRUNTIME int
SWIG_TypeCmp(const char * nb,const char * tb)396 SWIG_TypeCmp(const char *nb, const char *tb) {
397   int equiv = 1;
398   const char* te = tb + strlen(tb);
399   const char* ne = nb;
400   while (equiv != 0 && *ne) {
401     for (nb = ne; *ne; ++ne) {
402       if (*ne == '|') break;
403     }
404     equiv = SWIG_TypeNameComp(nb, ne, tb, te);
405     if (*ne) ++ne;
406   }
407   return equiv;
408 }
409 
410 /*
411   Check type equivalence in a name list like <name1>|<name2>|...
412   Return 0 if not equal, 1 if equal
413 */
414 SWIGRUNTIME int
SWIG_TypeEquiv(const char * nb,const char * tb)415 SWIG_TypeEquiv(const char *nb, const char *tb) {
416   return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
417 }
418 
419 /*
420   Check the typename
421 */
422 SWIGRUNTIME swig_cast_info *
SWIG_TypeCheck(const char * c,swig_type_info * ty)423 SWIG_TypeCheck(const char *c, swig_type_info *ty) {
424   if (ty) {
425     swig_cast_info *iter = ty->cast;
426     while (iter) {
427       if (strcmp(iter->type->name, c) == 0) {
428         if (iter == ty->cast)
429           return iter;
430         /* Move iter to the top of the linked list */
431         iter->prev->next = iter->next;
432         if (iter->next)
433           iter->next->prev = iter->prev;
434         iter->next = ty->cast;
435         iter->prev = 0;
436         if (ty->cast) ty->cast->prev = iter;
437         ty->cast = iter;
438         return iter;
439       }
440       iter = iter->next;
441     }
442   }
443   return 0;
444 }
445 
446 /*
447   Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
448 */
449 SWIGRUNTIME swig_cast_info *
SWIG_TypeCheckStruct(swig_type_info * from,swig_type_info * ty)450 SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
451   if (ty) {
452     swig_cast_info *iter = ty->cast;
453     while (iter) {
454       if (iter->type == from) {
455         if (iter == ty->cast)
456           return iter;
457         /* Move iter to the top of the linked list */
458         iter->prev->next = iter->next;
459         if (iter->next)
460           iter->next->prev = iter->prev;
461         iter->next = ty->cast;
462         iter->prev = 0;
463         if (ty->cast) ty->cast->prev = iter;
464         ty->cast = iter;
465         return iter;
466       }
467       iter = iter->next;
468     }
469   }
470   return 0;
471 }
472 
473 /*
474   Cast a pointer up an inheritance hierarchy
475 */
476 SWIGRUNTIMEINLINE void *
SWIG_TypeCast(swig_cast_info * ty,void * ptr,int * newmemory)477 SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
478   return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
479 }
480 
481 /*
482    Dynamic pointer casting. Down an inheritance hierarchy
483 */
484 SWIGRUNTIME swig_type_info *
SWIG_TypeDynamicCast(swig_type_info * ty,void ** ptr)485 SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
486   swig_type_info *lastty = ty;
487   if (!ty || !ty->dcast) return ty;
488   while (ty && (ty->dcast)) {
489     ty = (*ty->dcast)(ptr);
490     if (ty) lastty = ty;
491   }
492   return lastty;
493 }
494 
495 /*
496   Return the name associated with this type
497 */
498 SWIGRUNTIMEINLINE const char *
SWIG_TypeName(const swig_type_info * ty)499 SWIG_TypeName(const swig_type_info *ty) {
500   return ty->name;
501 }
502 
503 /*
504   Return the pretty name associated with this type,
505   that is an unmangled type name in a form presentable to the user.
506 */
507 SWIGRUNTIME const char *
SWIG_TypePrettyName(const swig_type_info * type)508 SWIG_TypePrettyName(const swig_type_info *type) {
509   /* The "str" field contains the equivalent pretty names of the
510      type, separated by vertical-bar characters.  We choose
511      to print the last name, as it is often (?) the most
512      specific. */
513   if (!type) return NULL;
514   if (type->str != NULL) {
515     const char *last_name = type->str;
516     const char *s;
517     for (s = type->str; *s; s++)
518       if (*s == '|') last_name = s+1;
519     return last_name;
520   }
521   else
522     return type->name;
523 }
524 
525 /*
526    Set the clientdata field for a type
527 */
528 SWIGRUNTIME void
SWIG_TypeClientData(swig_type_info * ti,void * clientdata)529 SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
530   swig_cast_info *cast = ti->cast;
531   /* if (ti->clientdata == clientdata) return; */
532   ti->clientdata = clientdata;
533 
534   while (cast) {
535     if (!cast->converter) {
536       swig_type_info *tc = cast->type;
537       if (!tc->clientdata) {
538 	SWIG_TypeClientData(tc, clientdata);
539       }
540     }
541     cast = cast->next;
542   }
543 }
544 SWIGRUNTIME void
SWIG_TypeNewClientData(swig_type_info * ti,void * clientdata)545 SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
546   SWIG_TypeClientData(ti, clientdata);
547   ti->owndata = 1;
548 }
549 
550 /*
551   Search for a swig_type_info structure only by mangled name
552   Search is a O(log #types)
553 
554   We start searching at module start, and finish searching when start == end.
555   Note: if start == end at the beginning of the function, we go all the way around
556   the circular list.
557 */
558 SWIGRUNTIME swig_type_info *
SWIG_MangledTypeQueryModule(swig_module_info * start,swig_module_info * end,const char * name)559 SWIG_MangledTypeQueryModule(swig_module_info *start,
560                             swig_module_info *end,
561 		            const char *name) {
562   swig_module_info *iter = start;
563   do {
564     if (iter->size) {
565       size_t l = 0;
566       size_t r = iter->size - 1;
567       do {
568 	/* since l+r >= 0, we can (>> 1) instead (/ 2) */
569 	size_t i = (l + r) >> 1;
570 	const char *iname = iter->types[i]->name;
571 	if (iname) {
572 	  int compare = strcmp(name, iname);
573 	  if (compare == 0) {
574 	    return iter->types[i];
575 	  } else if (compare < 0) {
576 	    if (i) {
577 	      r = i - 1;
578 	    } else {
579 	      break;
580 	    }
581 	  } else if (compare > 0) {
582 	    l = i + 1;
583 	  }
584 	} else {
585 	  break; /* should never happen */
586 	}
587       } while (l <= r);
588     }
589     iter = iter->next;
590   } while (iter != end);
591   return 0;
592 }
593 
594 /*
595   Search for a swig_type_info structure for either a mangled name or a human readable name.
596   It first searches the mangled names of the types, which is a O(log #types)
597   If a type is not found it then searches the human readable names, which is O(#types).
598 
599   We start searching at module start, and finish searching when start == end.
600   Note: if start == end at the beginning of the function, we go all the way around
601   the circular list.
602 */
603 SWIGRUNTIME swig_type_info *
SWIG_TypeQueryModule(swig_module_info * start,swig_module_info * end,const char * name)604 SWIG_TypeQueryModule(swig_module_info *start,
605                      swig_module_info *end,
606 		     const char *name) {
607   /* STEP 1: Search the name field using binary search */
608   swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
609   if (ret) {
610     return ret;
611   } else {
612     /* STEP 2: If the type hasn't been found, do a complete search
613        of the str field (the human readable name) */
614     swig_module_info *iter = start;
615     do {
616       size_t i = 0;
617       for (; i < iter->size; ++i) {
618 	if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
619 	  return iter->types[i];
620       }
621       iter = iter->next;
622     } while (iter != end);
623   }
624 
625   /* neither found a match */
626   return 0;
627 }
628 
629 /*
630    Pack binary data into a string
631 */
632 SWIGRUNTIME char *
SWIG_PackData(char * c,void * ptr,size_t sz)633 SWIG_PackData(char *c, void *ptr, size_t sz) {
634   static const char hex[17] = "0123456789abcdef";
635   const unsigned char *u = (unsigned char *) ptr;
636   const unsigned char *eu =  u + sz;
637   for (; u != eu; ++u) {
638     unsigned char uu = *u;
639     *(c++) = hex[(uu & 0xf0) >> 4];
640     *(c++) = hex[uu & 0xf];
641   }
642   return c;
643 }
644 
645 /*
646    Unpack binary data from a string
647 */
648 SWIGRUNTIME const char *
SWIG_UnpackData(const char * c,void * ptr,size_t sz)649 SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
650   unsigned char *u = (unsigned char *) ptr;
651   const unsigned char *eu = u + sz;
652   for (; u != eu; ++u) {
653     char d = *(c++);
654     unsigned char uu;
655     if ((d >= '0') && (d <= '9'))
656       uu = (unsigned char)((d - '0') << 4);
657     else if ((d >= 'a') && (d <= 'f'))
658       uu = (unsigned char)((d - ('a'-10)) << 4);
659     else
660       return (char *) 0;
661     d = *(c++);
662     if ((d >= '0') && (d <= '9'))
663       uu |= (unsigned char)(d - '0');
664     else if ((d >= 'a') && (d <= 'f'))
665       uu |= (unsigned char)(d - ('a'-10));
666     else
667       return (char *) 0;
668     *u = uu;
669   }
670   return c;
671 }
672 
673 /*
674    Pack 'void *' into a string buffer.
675 */
676 SWIGRUNTIME char *
SWIG_PackVoidPtr(char * buff,void * ptr,const char * name,size_t bsz)677 SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
678   char *r = buff;
679   if ((2*sizeof(void *) + 2) > bsz) return 0;
680   *(r++) = '_';
681   r = SWIG_PackData(r,&ptr,sizeof(void *));
682   if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
683   strcpy(r,name);
684   return buff;
685 }
686 
687 SWIGRUNTIME const char *
SWIG_UnpackVoidPtr(const char * c,void ** ptr,const char * name)688 SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
689   if (*c != '_') {
690     if (strcmp(c,"NULL") == 0) {
691       *ptr = (void *) 0;
692       return name;
693     } else {
694       return 0;
695     }
696   }
697   return SWIG_UnpackData(++c,ptr,sizeof(void *));
698 }
699 
700 SWIGRUNTIME char *
SWIG_PackDataName(char * buff,void * ptr,size_t sz,const char * name,size_t bsz)701 SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
702   char *r = buff;
703   size_t lname = (name ? strlen(name) : 0);
704   if ((2*sz + 2 + lname) > bsz) return 0;
705   *(r++) = '_';
706   r = SWIG_PackData(r,ptr,sz);
707   if (lname) {
708     strncpy(r,name,lname+1);
709   } else {
710     *r = 0;
711   }
712   return buff;
713 }
714 
715 SWIGRUNTIME const char *
SWIG_UnpackDataName(const char * c,void * ptr,size_t sz,const char * name)716 SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
717   if (*c != '_') {
718     if (strcmp(c,"NULL") == 0) {
719       memset(ptr,0,sz);
720       return name;
721     } else {
722       return 0;
723     }
724   }
725   return SWIG_UnpackData(++c,ptr,sz);
726 }
727 
728 #ifdef __cplusplus
729 }
730 #endif
731 
732 /*  Errors in SWIG */
733 #define  SWIG_UnknownError    	   -1
734 #define  SWIG_IOError        	   -2
735 #define  SWIG_RuntimeError   	   -3
736 #define  SWIG_IndexError     	   -4
737 #define  SWIG_TypeError      	   -5
738 #define  SWIG_DivisionByZero 	   -6
739 #define  SWIG_OverflowError  	   -7
740 #define  SWIG_SyntaxError    	   -8
741 #define  SWIG_ValueError     	   -9
742 #define  SWIG_SystemError    	   -10
743 #define  SWIG_AttributeError 	   -11
744 #define  SWIG_MemoryError    	   -12
745 #define  SWIG_NullReferenceError   -13
746 
747 
748 
749 /* Compatibility macros for Python 3 */
750 #if PY_VERSION_HEX >= 0x03000000
751 
752 #define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type)
753 #define PyInt_Check(x) PyLong_Check(x)
754 #define PyInt_AsLong(x) PyLong_AsLong(x)
755 #define PyInt_FromLong(x) PyLong_FromLong(x)
756 #define PyInt_FromSize_t(x) PyLong_FromSize_t(x)
757 #define PyString_Check(name) PyBytes_Check(name)
758 #define PyString_FromString(x) PyUnicode_FromString(x)
759 #define PyString_Format(fmt, args)  PyUnicode_Format(fmt, args)
760 #define PyString_AsString(str) PyBytes_AsString(str)
761 #define PyString_Size(str) PyBytes_Size(str)
762 #define PyString_InternFromString(key) PyUnicode_InternFromString(key)
763 #define Py_TPFLAGS_HAVE_CLASS Py_TPFLAGS_BASETYPE
764 #define PyString_AS_STRING(x) PyUnicode_AS_STRING(x)
765 #define _PyLong_FromSsize_t(x) PyLong_FromSsize_t(x)
766 
767 #endif
768 
769 #ifndef Py_TYPE
770 #  define Py_TYPE(op) ((op)->ob_type)
771 #endif
772 
773 /* SWIG APIs for compatibility of both Python 2 & 3 */
774 
775 #if PY_VERSION_HEX >= 0x03000000
776 #  define SWIG_Python_str_FromFormat PyUnicode_FromFormat
777 #else
778 #  define SWIG_Python_str_FromFormat PyString_FromFormat
779 #endif
780 
781 
782 /* Warning: This function will allocate a new string in Python 3,
783  * so please call SWIG_Python_str_DelForPy3(x) to free the space.
784  */
785 SWIGINTERN char*
SWIG_Python_str_AsChar(PyObject * str)786 SWIG_Python_str_AsChar(PyObject *str)
787 {
788 #if PY_VERSION_HEX >= 0x03030000
789   return (char *)PyUnicode_AsUTF8(str);
790 #elif PY_VERSION_HEX >= 0x03000000
791   char *newstr = 0;
792   str = PyUnicode_AsUTF8String(str);
793   if (str) {
794     char *cstr;
795     Py_ssize_t len;
796     if (PyBytes_AsStringAndSize(str, &cstr, &len) != -1) {
797       newstr = (char *) malloc(len+1);
798       if (newstr)
799         memcpy(newstr, cstr, len+1);
800     }
801     Py_XDECREF(str);
802   }
803   return newstr;
804 #else
805   return PyString_AsString(str);
806 #endif
807 }
808 
809 #if PY_VERSION_HEX >= 0x03030000 || PY_VERSION_HEX < 0x03000000
810 #  define SWIG_Python_str_DelForPy3(x)
811 #else
812 #  define SWIG_Python_str_DelForPy3(x) free( (void*) (x) )
813 #endif
814 
815 
816 SWIGINTERN PyObject*
SWIG_Python_str_FromChar(const char * c)817 SWIG_Python_str_FromChar(const char *c)
818 {
819 #if PY_VERSION_HEX >= 0x03000000
820   return PyUnicode_FromString(c);
821 #else
822   return PyString_FromString(c);
823 #endif
824 }
825 
826 #ifndef PyObject_DEL
827 # define PyObject_DEL PyObject_Del
828 #endif
829 
830 // SWIGPY_USE_CAPSULE is no longer used within SWIG itself, but some user
831 // interface files check for it.
832 # define SWIGPY_USE_CAPSULE
833 # define SWIGPY_CAPSULE_NAME ("swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME)
834 
835 #if PY_VERSION_HEX < 0x03020000
836 #define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type)
837 #define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name)
838 #define Py_hash_t long
839 #endif
840 
841 /* -----------------------------------------------------------------------------
842  * error manipulation
843  * ----------------------------------------------------------------------------- */
844 
845 SWIGRUNTIME PyObject*
SWIG_Python_ErrorType(int code)846 SWIG_Python_ErrorType(int code) {
847   PyObject* type = 0;
848   switch(code) {
849   case SWIG_MemoryError:
850     type = PyExc_MemoryError;
851     break;
852   case SWIG_IOError:
853     type = PyExc_IOError;
854     break;
855   case SWIG_RuntimeError:
856     type = PyExc_RuntimeError;
857     break;
858   case SWIG_IndexError:
859     type = PyExc_IndexError;
860     break;
861   case SWIG_TypeError:
862     type = PyExc_TypeError;
863     break;
864   case SWIG_DivisionByZero:
865     type = PyExc_ZeroDivisionError;
866     break;
867   case SWIG_OverflowError:
868     type = PyExc_OverflowError;
869     break;
870   case SWIG_SyntaxError:
871     type = PyExc_SyntaxError;
872     break;
873   case SWIG_ValueError:
874     type = PyExc_ValueError;
875     break;
876   case SWIG_SystemError:
877     type = PyExc_SystemError;
878     break;
879   case SWIG_AttributeError:
880     type = PyExc_AttributeError;
881     break;
882   default:
883     type = PyExc_RuntimeError;
884   }
885   return type;
886 }
887 
888 
889 SWIGRUNTIME void
SWIG_Python_AddErrorMsg(const char * mesg)890 SWIG_Python_AddErrorMsg(const char* mesg)
891 {
892   PyObject *type = 0;
893   PyObject *value = 0;
894   PyObject *traceback = 0;
895 
896   if (PyErr_Occurred())
897     PyErr_Fetch(&type, &value, &traceback);
898   if (value) {
899     PyObject *old_str = PyObject_Str(value);
900     const char *tmp = SWIG_Python_str_AsChar(old_str);
901     PyErr_Clear();
902     Py_XINCREF(type);
903     if (tmp)
904       PyErr_Format(type, "%s %s", tmp, mesg);
905     else
906       PyErr_Format(type, "%s", mesg);
907     SWIG_Python_str_DelForPy3(tmp);
908     Py_DECREF(old_str);
909     Py_DECREF(value);
910   } else {
911     PyErr_SetString(PyExc_RuntimeError, mesg);
912   }
913 }
914 
915 SWIGRUNTIME int
SWIG_Python_TypeErrorOccurred(PyObject * obj)916 SWIG_Python_TypeErrorOccurred(PyObject *obj)
917 {
918   PyObject *error;
919   if (obj)
920     return 0;
921   error = PyErr_Occurred();
922   return error && PyErr_GivenExceptionMatches(error, PyExc_TypeError);
923 }
924 
925 SWIGRUNTIME void
SWIG_Python_RaiseOrModifyTypeError(const char * message)926 SWIG_Python_RaiseOrModifyTypeError(const char *message)
927 {
928   if (SWIG_Python_TypeErrorOccurred(NULL)) {
929     /* Use existing TypeError to preserve stacktrace and enhance with given message */
930     PyObject *newvalue;
931     PyObject *type = NULL, *value = NULL, *traceback = NULL;
932     PyErr_Fetch(&type, &value, &traceback);
933 #if PY_VERSION_HEX >= 0x03000000
934     newvalue = PyUnicode_FromFormat("%S\nAdditional information:\n%s", value, message);
935 #else
936     newvalue = PyString_FromFormat("%s\nAdditional information:\n%s", PyString_AsString(value), message);
937 #endif
938     Py_XDECREF(value);
939     PyErr_Restore(type, newvalue, traceback);
940   } else {
941     /* Raise TypeError using given message */
942     PyErr_SetString(PyExc_TypeError, message);
943   }
944 }
945 
946 #if defined(SWIG_PYTHON_NO_THREADS)
947 #  if defined(SWIG_PYTHON_THREADS)
948 #    undef SWIG_PYTHON_THREADS
949 #  endif
950 #endif
951 #if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */
952 #  if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL)
953 #    define SWIG_PYTHON_USE_GIL
954 #  endif
955 #  if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */
956 #    ifndef SWIG_PYTHON_INITIALIZE_THREADS
957 #     define SWIG_PYTHON_INITIALIZE_THREADS  PyEval_InitThreads()
958 #    endif
959 #    ifdef __cplusplus /* C++ code */
960        class SWIG_Python_Thread_Block {
961          bool status;
962          PyGILState_STATE state;
963        public:
end()964          void end() { if (status) { PyGILState_Release(state); status = false;} }
SWIG_Python_Thread_Block()965          SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {}
~SWIG_Python_Thread_Block()966          ~SWIG_Python_Thread_Block() { end(); }
967        };
968        class SWIG_Python_Thread_Allow {
969          bool status;
970          PyThreadState *save;
971        public:
end()972          void end() { if (status) { PyEval_RestoreThread(save); status = false; }}
SWIG_Python_Thread_Allow()973          SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {}
~SWIG_Python_Thread_Allow()974          ~SWIG_Python_Thread_Allow() { end(); }
975        };
976 #      define SWIG_PYTHON_THREAD_BEGIN_BLOCK   SWIG_Python_Thread_Block _swig_thread_block
977 #      define SWIG_PYTHON_THREAD_END_BLOCK     _swig_thread_block.end()
978 #      define SWIG_PYTHON_THREAD_BEGIN_ALLOW   SWIG_Python_Thread_Allow _swig_thread_allow
979 #      define SWIG_PYTHON_THREAD_END_ALLOW     _swig_thread_allow.end()
980 #    else /* C code */
981 #      define SWIG_PYTHON_THREAD_BEGIN_BLOCK   PyGILState_STATE _swig_thread_block = PyGILState_Ensure()
982 #      define SWIG_PYTHON_THREAD_END_BLOCK     PyGILState_Release(_swig_thread_block)
983 #      define SWIG_PYTHON_THREAD_BEGIN_ALLOW   PyThreadState *_swig_thread_allow = PyEval_SaveThread()
984 #      define SWIG_PYTHON_THREAD_END_ALLOW     PyEval_RestoreThread(_swig_thread_allow)
985 #    endif
986 #  else /* Old thread way, not implemented, user must provide it */
987 #    if !defined(SWIG_PYTHON_INITIALIZE_THREADS)
988 #      define SWIG_PYTHON_INITIALIZE_THREADS
989 #    endif
990 #    if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK)
991 #      define SWIG_PYTHON_THREAD_BEGIN_BLOCK
992 #    endif
993 #    if !defined(SWIG_PYTHON_THREAD_END_BLOCK)
994 #      define SWIG_PYTHON_THREAD_END_BLOCK
995 #    endif
996 #    if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW)
997 #      define SWIG_PYTHON_THREAD_BEGIN_ALLOW
998 #    endif
999 #    if !defined(SWIG_PYTHON_THREAD_END_ALLOW)
1000 #      define SWIG_PYTHON_THREAD_END_ALLOW
1001 #    endif
1002 #  endif
1003 #else /* No thread support */
1004 #  define SWIG_PYTHON_INITIALIZE_THREADS
1005 #  define SWIG_PYTHON_THREAD_BEGIN_BLOCK
1006 #  define SWIG_PYTHON_THREAD_END_BLOCK
1007 #  define SWIG_PYTHON_THREAD_BEGIN_ALLOW
1008 #  define SWIG_PYTHON_THREAD_END_ALLOW
1009 #endif
1010 
1011 /* -----------------------------------------------------------------------------
1012  * Python API portion that goes into the runtime
1013  * ----------------------------------------------------------------------------- */
1014 
1015 #ifdef __cplusplus
1016 extern "C" {
1017 #endif
1018 
1019 /* -----------------------------------------------------------------------------
1020  * Constant declarations
1021  * ----------------------------------------------------------------------------- */
1022 
1023 /* Constant Types */
1024 #define SWIG_PY_POINTER 4
1025 #define SWIG_PY_BINARY  5
1026 
1027 /* Constant information structure */
1028 typedef struct swig_const_info {
1029   int type;
1030   const char *name;
1031   long lvalue;
1032   double dvalue;
1033   void   *pvalue;
1034   swig_type_info **ptype;
1035 } swig_const_info;
1036 
1037 #ifdef __cplusplus
1038 }
1039 #endif
1040 
1041 
1042 /* -----------------------------------------------------------------------------
1043  * pyrun.swg
1044  *
1045  * This file contains the runtime support for Python modules
1046  * and includes code for managing global variables and pointer
1047  * type checking.
1048  *
1049  * ----------------------------------------------------------------------------- */
1050 
1051 #if PY_VERSION_HEX < 0x02070000 /* 2.7.0 */
1052 # error "This version of SWIG only supports Python >= 2.7"
1053 #endif
1054 
1055 #if PY_VERSION_HEX >= 0x03000000 && PY_VERSION_HEX < 0x03020000
1056 # error "This version of SWIG only supports Python 3 >= 3.2"
1057 #endif
1058 
1059 /* Common SWIG API */
1060 
1061 /* for raw pointers */
1062 #define SWIG_Python_ConvertPtr(obj, pptr, type, flags)  SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
1063 #define SWIG_ConvertPtr(obj, pptr, type, flags)         SWIG_Python_ConvertPtr(obj, pptr, type, flags)
1064 #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own)  SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own)
1065 
1066 #ifdef SWIGPYTHON_BUILTIN
1067 #define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Python_NewPointerObj(self, ptr, type, flags)
1068 #else
1069 #define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
1070 #endif
1071 
1072 #define SWIG_InternalNewPointerObj(ptr, type, flags)	SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
1073 
1074 #define SWIG_CheckImplicit(ty)                          SWIG_Python_CheckImplicit(ty)
1075 #define SWIG_AcquirePtr(ptr, src)                       SWIG_Python_AcquirePtr(ptr, src)
1076 #define swig_owntype                                    int
1077 
1078 /* for raw packed data */
1079 #define SWIG_ConvertPacked(obj, ptr, sz, ty)            SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
1080 #define SWIG_NewPackedObj(ptr, sz, type)                SWIG_Python_NewPackedObj(ptr, sz, type)
1081 
1082 /* for class or struct pointers */
1083 #define SWIG_ConvertInstance(obj, pptr, type, flags)    SWIG_ConvertPtr(obj, pptr, type, flags)
1084 #define SWIG_NewInstanceObj(ptr, type, flags)           SWIG_NewPointerObj(ptr, type, flags)
1085 
1086 /* for C or C++ function pointers */
1087 #define SWIG_ConvertFunctionPtr(obj, pptr, type)        SWIG_Python_ConvertFunctionPtr(obj, pptr, type)
1088 #define SWIG_NewFunctionPtrObj(ptr, type)               SWIG_Python_NewPointerObj(NULL, ptr, type, 0)
1089 
1090 /* for C++ member pointers, ie, member methods */
1091 #define SWIG_ConvertMember(obj, ptr, sz, ty)            SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
1092 #define SWIG_NewMemberObj(ptr, sz, type)                SWIG_Python_NewPackedObj(ptr, sz, type)
1093 
1094 
1095 /* Runtime API */
1096 
1097 #define SWIG_GetModule(clientdata)                      SWIG_Python_GetModule(clientdata)
1098 #define SWIG_SetModule(clientdata, pointer)             SWIG_Python_SetModule(pointer)
1099 #define SWIG_NewClientData(obj)                         SwigPyClientData_New(obj)
1100 
1101 #define SWIG_SetErrorObj                                SWIG_Python_SetErrorObj
1102 #define SWIG_SetErrorMsg                        	SWIG_Python_SetErrorMsg
1103 #define SWIG_ErrorType(code)                    	SWIG_Python_ErrorType(code)
1104 #define SWIG_Error(code, msg)            		SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg)
1105 #define SWIG_fail                        		goto fail
1106 
1107 
1108 /* Runtime API implementation */
1109 
1110 /* Error manipulation */
1111 
1112 SWIGINTERN void
SWIG_Python_SetErrorObj(PyObject * errtype,PyObject * obj)1113 SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) {
1114   SWIG_PYTHON_THREAD_BEGIN_BLOCK;
1115   PyErr_SetObject(errtype, obj);
1116   Py_DECREF(obj);
1117   SWIG_PYTHON_THREAD_END_BLOCK;
1118 }
1119 
1120 SWIGINTERN void
SWIG_Python_SetErrorMsg(PyObject * errtype,const char * msg)1121 SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) {
1122   SWIG_PYTHON_THREAD_BEGIN_BLOCK;
1123   PyErr_SetString(errtype, msg);
1124   SWIG_PYTHON_THREAD_END_BLOCK;
1125 }
1126 
1127 #define SWIG_Python_Raise(obj, type, desc)  SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj)
1128 
1129 /* Set a constant value */
1130 
1131 #if defined(SWIGPYTHON_BUILTIN)
1132 
1133 SWIGINTERN void
SwigPyBuiltin_AddPublicSymbol(PyObject * seq,const char * key)1134 SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) {
1135   PyObject *s = PyString_InternFromString(key);
1136   PyList_Append(seq, s);
1137   Py_DECREF(s);
1138 }
1139 
1140 SWIGINTERN void
SWIG_Python_SetConstant(PyObject * d,PyObject * public_interface,const char * name,PyObject * obj)1141 SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) {
1142   PyDict_SetItemString(d, name, obj);
1143   Py_DECREF(obj);
1144   if (public_interface)
1145     SwigPyBuiltin_AddPublicSymbol(public_interface, name);
1146 }
1147 
1148 #else
1149 
1150 SWIGINTERN void
SWIG_Python_SetConstant(PyObject * d,const char * name,PyObject * obj)1151 SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) {
1152   PyDict_SetItemString(d, name, obj);
1153   Py_DECREF(obj);
1154 }
1155 
1156 #endif
1157 
1158 /* Append a value to the result obj */
1159 
1160 SWIGINTERN PyObject*
SWIG_Python_AppendOutput(PyObject * result,PyObject * obj)1161 SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) {
1162   if (!result) {
1163     result = obj;
1164   } else if (result == Py_None) {
1165     Py_DECREF(result);
1166     result = obj;
1167   } else {
1168     if (!PyList_Check(result)) {
1169       PyObject *o2 = result;
1170       result = PyList_New(1);
1171       PyList_SetItem(result, 0, o2);
1172     }
1173     PyList_Append(result,obj);
1174     Py_DECREF(obj);
1175   }
1176   return result;
1177 }
1178 
1179 /* Unpack the argument tuple */
1180 
1181 SWIGINTERN Py_ssize_t
SWIG_Python_UnpackTuple(PyObject * args,const char * name,Py_ssize_t min,Py_ssize_t max,PyObject ** objs)1182 SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
1183 {
1184   if (!args) {
1185     if (!min && !max) {
1186       return 1;
1187     } else {
1188       PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none",
1189 		   name, (min == max ? "" : "at least "), (int)min);
1190       return 0;
1191     }
1192   }
1193   if (!PyTuple_Check(args)) {
1194     if (min <= 1 && max >= 1) {
1195       Py_ssize_t i;
1196       objs[0] = args;
1197       for (i = 1; i < max; ++i) {
1198 	objs[i] = 0;
1199       }
1200       return 2;
1201     }
1202     PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple");
1203     return 0;
1204   } else {
1205     Py_ssize_t l = PyTuple_GET_SIZE(args);
1206     if (l < min) {
1207       PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
1208 		   name, (min == max ? "" : "at least "), (int)min, (int)l);
1209       return 0;
1210     } else if (l > max) {
1211       PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
1212 		   name, (min == max ? "" : "at most "), (int)max, (int)l);
1213       return 0;
1214     } else {
1215       Py_ssize_t i;
1216       for (i = 0; i < l; ++i) {
1217 	objs[i] = PyTuple_GET_ITEM(args, i);
1218       }
1219       for (; l < max; ++l) {
1220 	objs[l] = 0;
1221       }
1222       return i + 1;
1223     }
1224   }
1225 }
1226 
1227 SWIGINTERN int
SWIG_Python_CheckNoKeywords(PyObject * kwargs,const char * name)1228 SWIG_Python_CheckNoKeywords(PyObject *kwargs, const char *name) {
1229   int no_kwargs = 1;
1230   if (kwargs) {
1231     assert(PyDict_Check(kwargs));
1232     if (PyDict_Size(kwargs) > 0) {
1233       PyErr_Format(PyExc_TypeError, "%s() does not take keyword arguments", name);
1234       no_kwargs = 0;
1235     }
1236   }
1237   return no_kwargs;
1238 }
1239 
1240 /* A functor is a function object with one single object argument */
1241 #define SWIG_Python_CallFunctor(functor, obj)	        PyObject_CallFunctionObjArgs(functor, obj, NULL);
1242 
1243 /*
1244   Helper for static pointer initialization for both C and C++ code, for example
1245   static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...);
1246 */
1247 #ifdef __cplusplus
1248 #define SWIG_STATIC_POINTER(var)  var
1249 #else
1250 #define SWIG_STATIC_POINTER(var)  var = 0; if (!var) var
1251 #endif
1252 
1253 /* -----------------------------------------------------------------------------
1254  * Pointer declarations
1255  * ----------------------------------------------------------------------------- */
1256 
1257 /* Flags for new pointer objects */
1258 #define SWIG_POINTER_NOSHADOW       (SWIG_POINTER_OWN      << 1)
1259 #define SWIG_POINTER_NEW            (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN)
1260 
1261 #define SWIG_POINTER_IMPLICIT_CONV  (SWIG_POINTER_DISOWN   << 1)
1262 
1263 #define SWIG_BUILTIN_TP_INIT	    (SWIG_POINTER_OWN << 2)
1264 #define SWIG_BUILTIN_INIT	    (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN)
1265 
1266 #ifdef __cplusplus
1267 extern "C" {
1268 #endif
1269 
1270 /* The python void return value */
1271 
1272 SWIGRUNTIMEINLINE PyObject *
SWIG_Py_Void(void)1273 SWIG_Py_Void(void)
1274 {
1275   PyObject *none = Py_None;
1276   Py_INCREF(none);
1277   return none;
1278 }
1279 
1280 /* SwigPyClientData */
1281 
1282 typedef struct {
1283   PyObject *klass;
1284   PyObject *newraw;
1285   PyObject *newargs;
1286   PyObject *destroy;
1287   int delargs;
1288   int implicitconv;
1289   PyTypeObject *pytype;
1290 } SwigPyClientData;
1291 
1292 SWIGRUNTIMEINLINE int
SWIG_Python_CheckImplicit(swig_type_info * ty)1293 SWIG_Python_CheckImplicit(swig_type_info *ty)
1294 {
1295   SwigPyClientData *data = (SwigPyClientData *)ty->clientdata;
1296   int fail = data ? data->implicitconv : 0;
1297   if (fail)
1298     PyErr_SetString(PyExc_TypeError, "Implicit conversion is prohibited for explicit constructors.");
1299   return fail;
1300 }
1301 
1302 SWIGRUNTIMEINLINE PyObject *
SWIG_Python_ExceptionType(swig_type_info * desc)1303 SWIG_Python_ExceptionType(swig_type_info *desc) {
1304   SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0;
1305   PyObject *klass = data ? data->klass : 0;
1306   return (klass ? klass : PyExc_RuntimeError);
1307 }
1308 
1309 
1310 SWIGRUNTIME SwigPyClientData *
SwigPyClientData_New(PyObject * obj)1311 SwigPyClientData_New(PyObject* obj)
1312 {
1313   if (!obj) {
1314     return 0;
1315   } else {
1316     SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData));
1317     /* the klass element */
1318     data->klass = obj;
1319     Py_INCREF(data->klass);
1320     /* the newraw method and newargs arguments used to create a new raw instance */
1321     if (PyClass_Check(obj)) {
1322       data->newraw = 0;
1323       data->newargs = obj;
1324       Py_INCREF(obj);
1325     } else {
1326       data->newraw = PyObject_GetAttrString(data->klass, "__new__");
1327       if (data->newraw) {
1328 	Py_INCREF(data->newraw);
1329 	data->newargs = PyTuple_New(1);
1330 	PyTuple_SetItem(data->newargs, 0, obj);
1331       } else {
1332 	data->newargs = obj;
1333       }
1334       Py_INCREF(data->newargs);
1335     }
1336     /* the destroy method, aka as the C++ delete method */
1337     data->destroy = PyObject_GetAttrString(data->klass, "__swig_destroy__");
1338     if (PyErr_Occurred()) {
1339       PyErr_Clear();
1340       data->destroy = 0;
1341     }
1342     if (data->destroy) {
1343       int flags;
1344       Py_INCREF(data->destroy);
1345       flags = PyCFunction_GET_FLAGS(data->destroy);
1346       data->delargs = !(flags & (METH_O));
1347     } else {
1348       data->delargs = 0;
1349     }
1350     data->implicitconv = 0;
1351     data->pytype = 0;
1352     return data;
1353   }
1354 }
1355 
1356 SWIGRUNTIME void
SwigPyClientData_Del(SwigPyClientData * data)1357 SwigPyClientData_Del(SwigPyClientData *data) {
1358   Py_XDECREF(data->newraw);
1359   Py_XDECREF(data->newargs);
1360   Py_XDECREF(data->destroy);
1361 }
1362 
1363 /* =============== SwigPyObject =====================*/
1364 
1365 typedef struct {
1366   PyObject_HEAD
1367   void *ptr;
1368   swig_type_info *ty;
1369   int own;
1370   PyObject *next;
1371 #ifdef SWIGPYTHON_BUILTIN
1372   PyObject *dict;
1373 #endif
1374 } SwigPyObject;
1375 
1376 
1377 #ifdef SWIGPYTHON_BUILTIN
1378 
1379 SWIGRUNTIME PyObject *
SwigPyObject_get___dict__(PyObject * v,PyObject * SWIGUNUSEDPARM (args))1380 SwigPyObject_get___dict__(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
1381 {
1382   SwigPyObject *sobj = (SwigPyObject *)v;
1383 
1384   if (!sobj->dict)
1385     sobj->dict = PyDict_New();
1386 
1387   Py_INCREF(sobj->dict);
1388   return sobj->dict;
1389 }
1390 
1391 #endif
1392 
1393 SWIGRUNTIME PyObject *
SwigPyObject_long(SwigPyObject * v)1394 SwigPyObject_long(SwigPyObject *v)
1395 {
1396   return PyLong_FromVoidPtr(v->ptr);
1397 }
1398 
1399 SWIGRUNTIME PyObject *
SwigPyObject_format(const char * fmt,SwigPyObject * v)1400 SwigPyObject_format(const char* fmt, SwigPyObject *v)
1401 {
1402   PyObject *res = NULL;
1403   PyObject *args = PyTuple_New(1);
1404   if (args) {
1405     if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) {
1406       PyObject *ofmt = SWIG_Python_str_FromChar(fmt);
1407       if (ofmt) {
1408 #if PY_VERSION_HEX >= 0x03000000
1409 	res = PyUnicode_Format(ofmt,args);
1410 #else
1411 	res = PyString_Format(ofmt,args);
1412 #endif
1413 	Py_DECREF(ofmt);
1414       }
1415       Py_DECREF(args);
1416     }
1417   }
1418   return res;
1419 }
1420 
1421 SWIGRUNTIME PyObject *
SwigPyObject_oct(SwigPyObject * v)1422 SwigPyObject_oct(SwigPyObject *v)
1423 {
1424   return SwigPyObject_format("%o",v);
1425 }
1426 
1427 SWIGRUNTIME PyObject *
SwigPyObject_hex(SwigPyObject * v)1428 SwigPyObject_hex(SwigPyObject *v)
1429 {
1430   return SwigPyObject_format("%x",v);
1431 }
1432 
1433 SWIGRUNTIME PyObject *
SwigPyObject_repr(SwigPyObject * v)1434 SwigPyObject_repr(SwigPyObject *v)
1435 {
1436   const char *name = SWIG_TypePrettyName(v->ty);
1437   PyObject *repr = SWIG_Python_str_FromFormat("<Swig Object of type '%s' at %p>", (name ? name : "unknown"), (void *)v);
1438   if (v->next) {
1439     PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next);
1440 # if PY_VERSION_HEX >= 0x03000000
1441     PyObject *joined = PyUnicode_Concat(repr, nrep);
1442     Py_DecRef(repr);
1443     Py_DecRef(nrep);
1444     repr = joined;
1445 # else
1446     PyString_ConcatAndDel(&repr,nrep);
1447 # endif
1448   }
1449   return repr;
1450 }
1451 
1452 /* We need a version taking two PyObject* parameters so it's a valid
1453  * PyCFunction to use in swigobject_methods[]. */
1454 SWIGRUNTIME PyObject *
SwigPyObject_repr2(PyObject * v,PyObject * SWIGUNUSEDPARM (args))1455 SwigPyObject_repr2(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
1456 {
1457   return SwigPyObject_repr((SwigPyObject*)v);
1458 }
1459 
1460 SWIGRUNTIME int
SwigPyObject_compare(SwigPyObject * v,SwigPyObject * w)1461 SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w)
1462 {
1463   void *i = v->ptr;
1464   void *j = w->ptr;
1465   return (i < j) ? -1 : ((i > j) ? 1 : 0);
1466 }
1467 
1468 /* Added for Python 3.x, would it also be useful for Python 2.x? */
1469 SWIGRUNTIME PyObject*
SwigPyObject_richcompare(SwigPyObject * v,SwigPyObject * w,int op)1470 SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op)
1471 {
1472   PyObject* res;
1473   if( op != Py_EQ && op != Py_NE ) {
1474     Py_INCREF(Py_NotImplemented);
1475     return Py_NotImplemented;
1476   }
1477   res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0);
1478   return res;
1479 }
1480 
1481 
1482 SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void);
1483 
1484 #ifdef SWIGPYTHON_BUILTIN
1485 static swig_type_info *SwigPyObject_stype = 0;
1486 SWIGRUNTIME PyTypeObject*
SwigPyObject_type(void)1487 SwigPyObject_type(void) {
1488     SwigPyClientData *cd;
1489     assert(SwigPyObject_stype);
1490     cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
1491     assert(cd);
1492     assert(cd->pytype);
1493     return cd->pytype;
1494 }
1495 #else
1496 SWIGRUNTIME PyTypeObject*
SwigPyObject_type(void)1497 SwigPyObject_type(void) {
1498   static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce();
1499   return type;
1500 }
1501 #endif
1502 
1503 SWIGRUNTIMEINLINE int
SwigPyObject_Check(PyObject * op)1504 SwigPyObject_Check(PyObject *op) {
1505 #ifdef SWIGPYTHON_BUILTIN
1506   PyTypeObject *target_tp = SwigPyObject_type();
1507   if (PyType_IsSubtype(op->ob_type, target_tp))
1508     return 1;
1509   return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0);
1510 #else
1511   return (Py_TYPE(op) == SwigPyObject_type())
1512     || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0);
1513 #endif
1514 }
1515 
1516 SWIGRUNTIME PyObject *
1517 SwigPyObject_New(void *ptr, swig_type_info *ty, int own);
1518 
1519 SWIGRUNTIME void
SwigPyObject_dealloc(PyObject * v)1520 SwigPyObject_dealloc(PyObject *v)
1521 {
1522   SwigPyObject *sobj = (SwigPyObject *) v;
1523   PyObject *next = sobj->next;
1524   if (sobj->own == SWIG_POINTER_OWN) {
1525     swig_type_info *ty = sobj->ty;
1526     SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
1527     PyObject *destroy = data ? data->destroy : 0;
1528     if (destroy) {
1529       /* destroy is always a VARARGS method */
1530       PyObject *res;
1531 
1532       /* PyObject_CallFunction() has the potential to silently drop
1533          the active exception.  In cases of unnamed temporary
1534          variable or where we just finished iterating over a generator
1535          StopIteration will be active right now, and this needs to
1536          remain true upon return from SwigPyObject_dealloc.  So save
1537          and restore. */
1538 
1539       PyObject *type = NULL, *value = NULL, *traceback = NULL;
1540       PyErr_Fetch(&type, &value, &traceback);
1541 
1542       if (data->delargs) {
1543         /* we need to create a temporary object to carry the destroy operation */
1544         PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0);
1545         res = SWIG_Python_CallFunctor(destroy, tmp);
1546         Py_DECREF(tmp);
1547       } else {
1548         PyCFunction meth = PyCFunction_GET_FUNCTION(destroy);
1549         PyObject *mself = PyCFunction_GET_SELF(destroy);
1550         res = ((*meth)(mself, v));
1551       }
1552       if (!res)
1553         PyErr_WriteUnraisable(destroy);
1554 
1555       PyErr_Restore(type, value, traceback);
1556 
1557       Py_XDECREF(res);
1558     }
1559 #if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
1560     else {
1561       const char *name = SWIG_TypePrettyName(ty);
1562       printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown"));
1563     }
1564 #endif
1565   }
1566   Py_XDECREF(next);
1567   PyObject_DEL(v);
1568 }
1569 
1570 SWIGRUNTIME PyObject*
SwigPyObject_append(PyObject * v,PyObject * next)1571 SwigPyObject_append(PyObject* v, PyObject* next)
1572 {
1573   SwigPyObject *sobj = (SwigPyObject *) v;
1574   if (!SwigPyObject_Check(next)) {
1575     PyErr_SetString(PyExc_TypeError, "Attempt to append a non SwigPyObject");
1576     return NULL;
1577   }
1578   sobj->next = next;
1579   Py_INCREF(next);
1580   return SWIG_Py_Void();
1581 }
1582 
1583 SWIGRUNTIME PyObject*
SwigPyObject_next(PyObject * v,PyObject * SWIGUNUSEDPARM (args))1584 SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1585 {
1586   SwigPyObject *sobj = (SwigPyObject *) v;
1587   if (sobj->next) {
1588     Py_INCREF(sobj->next);
1589     return sobj->next;
1590   } else {
1591     return SWIG_Py_Void();
1592   }
1593 }
1594 
1595 SWIGINTERN PyObject*
SwigPyObject_disown(PyObject * v,PyObject * SWIGUNUSEDPARM (args))1596 SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1597 {
1598   SwigPyObject *sobj = (SwigPyObject *)v;
1599   sobj->own = 0;
1600   return SWIG_Py_Void();
1601 }
1602 
1603 SWIGINTERN PyObject*
SwigPyObject_acquire(PyObject * v,PyObject * SWIGUNUSEDPARM (args))1604 SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1605 {
1606   SwigPyObject *sobj = (SwigPyObject *)v;
1607   sobj->own = SWIG_POINTER_OWN;
1608   return SWIG_Py_Void();
1609 }
1610 
1611 SWIGINTERN PyObject*
SwigPyObject_own(PyObject * v,PyObject * args)1612 SwigPyObject_own(PyObject *v, PyObject *args)
1613 {
1614   PyObject *val = 0;
1615   if (!PyArg_UnpackTuple(args, "own", 0, 1, &val)) {
1616     return NULL;
1617   } else {
1618     SwigPyObject *sobj = (SwigPyObject *)v;
1619     PyObject *obj = PyBool_FromLong(sobj->own);
1620     if (val) {
1621       if (PyObject_IsTrue(val)) {
1622         SwigPyObject_acquire(v,args);
1623       } else {
1624         SwigPyObject_disown(v,args);
1625       }
1626     }
1627     return obj;
1628   }
1629 }
1630 
1631 static PyMethodDef
1632 swigobject_methods[] = {
1633   {"disown",  SwigPyObject_disown,  METH_NOARGS,  "releases ownership of the pointer"},
1634   {"acquire", SwigPyObject_acquire, METH_NOARGS,  "acquires ownership of the pointer"},
1635   {"own",     SwigPyObject_own,     METH_VARARGS, "returns/sets ownership of the pointer"},
1636   {"append",  SwigPyObject_append,  METH_O,       "appends another 'this' object"},
1637   {"next",    SwigPyObject_next,    METH_NOARGS,  "returns the next 'this' object"},
1638   {"__repr__",SwigPyObject_repr2,   METH_NOARGS,  "returns object representation"},
1639   {0, 0, 0, 0}
1640 };
1641 
1642 SWIGRUNTIME PyTypeObject*
SwigPyObject_TypeOnce(void)1643 SwigPyObject_TypeOnce(void) {
1644   static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer";
1645 
1646   static PyNumberMethods SwigPyObject_as_number = {
1647     (binaryfunc)0, /*nb_add*/
1648     (binaryfunc)0, /*nb_subtract*/
1649     (binaryfunc)0, /*nb_multiply*/
1650     /* nb_divide removed in Python 3 */
1651 #if PY_VERSION_HEX < 0x03000000
1652     (binaryfunc)0, /*nb_divide*/
1653 #endif
1654     (binaryfunc)0, /*nb_remainder*/
1655     (binaryfunc)0, /*nb_divmod*/
1656     (ternaryfunc)0,/*nb_power*/
1657     (unaryfunc)0,  /*nb_negative*/
1658     (unaryfunc)0,  /*nb_positive*/
1659     (unaryfunc)0,  /*nb_absolute*/
1660     (inquiry)0,    /*nb_nonzero*/
1661     0,		   /*nb_invert*/
1662     0,		   /*nb_lshift*/
1663     0,		   /*nb_rshift*/
1664     0,		   /*nb_and*/
1665     0,		   /*nb_xor*/
1666     0,		   /*nb_or*/
1667 #if PY_VERSION_HEX < 0x03000000
1668     0,   /*nb_coerce*/
1669 #endif
1670     (unaryfunc)SwigPyObject_long, /*nb_int*/
1671 #if PY_VERSION_HEX < 0x03000000
1672     (unaryfunc)SwigPyObject_long, /*nb_long*/
1673 #else
1674     0, /*nb_reserved*/
1675 #endif
1676     (unaryfunc)0,                 /*nb_float*/
1677 #if PY_VERSION_HEX < 0x03000000
1678     (unaryfunc)SwigPyObject_oct,  /*nb_oct*/
1679     (unaryfunc)SwigPyObject_hex,  /*nb_hex*/
1680 #endif
1681 #if PY_VERSION_HEX >= 0x03050000 /* 3.5 */
1682     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_matrix_multiply */
1683 #elif PY_VERSION_HEX >= 0x03000000 /* 3.0 */
1684     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */
1685 #else
1686     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */
1687 #endif
1688   };
1689 
1690   static PyTypeObject swigpyobject_type;
1691   static int type_init = 0;
1692   if (!type_init) {
1693     const PyTypeObject tmp = {
1694 #if PY_VERSION_HEX >= 0x03000000
1695       PyVarObject_HEAD_INIT(NULL, 0)
1696 #else
1697       PyObject_HEAD_INIT(NULL)
1698       0,                                    /* ob_size */
1699 #endif
1700       "SwigPyObject",                       /* tp_name */
1701       sizeof(SwigPyObject),                 /* tp_basicsize */
1702       0,                                    /* tp_itemsize */
1703       (destructor)SwigPyObject_dealloc,     /* tp_dealloc */
1704       0,                                    /* tp_print */
1705       (getattrfunc)0,                       /* tp_getattr */
1706       (setattrfunc)0,                       /* tp_setattr */
1707 #if PY_VERSION_HEX >= 0x03000000
1708       0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */
1709 #else
1710       (cmpfunc)SwigPyObject_compare,        /* tp_compare */
1711 #endif
1712       (reprfunc)SwigPyObject_repr,          /* tp_repr */
1713       &SwigPyObject_as_number,              /* tp_as_number */
1714       0,                                    /* tp_as_sequence */
1715       0,                                    /* tp_as_mapping */
1716       (hashfunc)0,                          /* tp_hash */
1717       (ternaryfunc)0,                       /* tp_call */
1718       0,                                    /* tp_str */
1719       PyObject_GenericGetAttr,              /* tp_getattro */
1720       0,                                    /* tp_setattro */
1721       0,                                    /* tp_as_buffer */
1722       Py_TPFLAGS_DEFAULT,                   /* tp_flags */
1723       swigobject_doc,                       /* tp_doc */
1724       0,                                    /* tp_traverse */
1725       0,                                    /* tp_clear */
1726       (richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */
1727       0,                                    /* tp_weaklistoffset */
1728       0,                                    /* tp_iter */
1729       0,                                    /* tp_iternext */
1730       swigobject_methods,                   /* tp_methods */
1731       0,                                    /* tp_members */
1732       0,                                    /* tp_getset */
1733       0,                                    /* tp_base */
1734       0,                                    /* tp_dict */
1735       0,                                    /* tp_descr_get */
1736       0,                                    /* tp_descr_set */
1737       0,                                    /* tp_dictoffset */
1738       0,                                    /* tp_init */
1739       0,                                    /* tp_alloc */
1740       0,                                    /* tp_new */
1741       0,                                    /* tp_free */
1742       0,                                    /* tp_is_gc */
1743       0,                                    /* tp_bases */
1744       0,                                    /* tp_mro */
1745       0,                                    /* tp_cache */
1746       0,                                    /* tp_subclasses */
1747       0,                                    /* tp_weaklist */
1748       0,                                    /* tp_del */
1749       0,                                    /* tp_version_tag */
1750 #if PY_VERSION_HEX >= 0x03040000
1751       0,                                    /* tp_finalize */
1752 #endif
1753 #if PY_VERSION_HEX >= 0x03080000
1754       0,                                    /* tp_vectorcall */
1755 #endif
1756 #if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
1757       0,                                    /* tp_print */
1758 #endif
1759 #ifdef COUNT_ALLOCS
1760       0,                                    /* tp_allocs */
1761       0,                                    /* tp_frees */
1762       0,                                    /* tp_maxalloc */
1763       0,                                    /* tp_prev */
1764       0                                     /* tp_next */
1765 #endif
1766     };
1767     swigpyobject_type = tmp;
1768     type_init = 1;
1769     if (PyType_Ready(&swigpyobject_type) < 0)
1770       return NULL;
1771   }
1772   return &swigpyobject_type;
1773 }
1774 
1775 SWIGRUNTIME PyObject *
SwigPyObject_New(void * ptr,swig_type_info * ty,int own)1776 SwigPyObject_New(void *ptr, swig_type_info *ty, int own)
1777 {
1778   SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type());
1779   if (sobj) {
1780     sobj->ptr  = ptr;
1781     sobj->ty   = ty;
1782     sobj->own  = own;
1783     sobj->next = 0;
1784   }
1785   return (PyObject *)sobj;
1786 }
1787 
1788 /* -----------------------------------------------------------------------------
1789  * Implements a simple Swig Packed type, and use it instead of string
1790  * ----------------------------------------------------------------------------- */
1791 
1792 typedef struct {
1793   PyObject_HEAD
1794   void *pack;
1795   swig_type_info *ty;
1796   size_t size;
1797 } SwigPyPacked;
1798 
1799 SWIGRUNTIME PyObject *
SwigPyPacked_repr(SwigPyPacked * v)1800 SwigPyPacked_repr(SwigPyPacked *v)
1801 {
1802   char result[SWIG_BUFFER_SIZE];
1803   if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
1804     return SWIG_Python_str_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);
1805   } else {
1806     return SWIG_Python_str_FromFormat("<Swig Packed %s>", v->ty->name);
1807   }
1808 }
1809 
1810 SWIGRUNTIME PyObject *
SwigPyPacked_str(SwigPyPacked * v)1811 SwigPyPacked_str(SwigPyPacked *v)
1812 {
1813   char result[SWIG_BUFFER_SIZE];
1814   if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){
1815     return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name);
1816   } else {
1817     return SWIG_Python_str_FromChar(v->ty->name);
1818   }
1819 }
1820 
1821 SWIGRUNTIME int
SwigPyPacked_compare(SwigPyPacked * v,SwigPyPacked * w)1822 SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w)
1823 {
1824   size_t i = v->size;
1825   size_t j = w->size;
1826   int s = (i < j) ? -1 : ((i > j) ? 1 : 0);
1827   return s ? s : strncmp((const char *)v->pack, (const char *)w->pack, 2*v->size);
1828 }
1829 
1830 SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void);
1831 
1832 SWIGRUNTIME PyTypeObject*
SwigPyPacked_type(void)1833 SwigPyPacked_type(void) {
1834   static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce();
1835   return type;
1836 }
1837 
1838 SWIGRUNTIMEINLINE int
SwigPyPacked_Check(PyObject * op)1839 SwigPyPacked_Check(PyObject *op) {
1840   return ((op)->ob_type == SwigPyPacked_TypeOnce())
1841     || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0);
1842 }
1843 
1844 SWIGRUNTIME void
SwigPyPacked_dealloc(PyObject * v)1845 SwigPyPacked_dealloc(PyObject *v)
1846 {
1847   if (SwigPyPacked_Check(v)) {
1848     SwigPyPacked *sobj = (SwigPyPacked *) v;
1849     free(sobj->pack);
1850   }
1851   PyObject_DEL(v);
1852 }
1853 
1854 SWIGRUNTIME PyTypeObject*
SwigPyPacked_TypeOnce(void)1855 SwigPyPacked_TypeOnce(void) {
1856   static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer";
1857   static PyTypeObject swigpypacked_type;
1858   static int type_init = 0;
1859   if (!type_init) {
1860     const PyTypeObject tmp = {
1861 #if PY_VERSION_HEX>=0x03000000
1862       PyVarObject_HEAD_INIT(NULL, 0)
1863 #else
1864       PyObject_HEAD_INIT(NULL)
1865       0,                                    /* ob_size */
1866 #endif
1867       "SwigPyPacked",                       /* tp_name */
1868       sizeof(SwigPyPacked),                 /* tp_basicsize */
1869       0,                                    /* tp_itemsize */
1870       (destructor)SwigPyPacked_dealloc,     /* tp_dealloc */
1871       0,                                    /* tp_print */
1872       (getattrfunc)0,                       /* tp_getattr */
1873       (setattrfunc)0,                       /* tp_setattr */
1874 #if PY_VERSION_HEX>=0x03000000
1875       0, /* tp_reserved in 3.0.1 */
1876 #else
1877       (cmpfunc)SwigPyPacked_compare,        /* tp_compare */
1878 #endif
1879       (reprfunc)SwigPyPacked_repr,          /* tp_repr */
1880       0,                                    /* tp_as_number */
1881       0,                                    /* tp_as_sequence */
1882       0,                                    /* tp_as_mapping */
1883       (hashfunc)0,                          /* tp_hash */
1884       (ternaryfunc)0,                       /* tp_call */
1885       (reprfunc)SwigPyPacked_str,           /* tp_str */
1886       PyObject_GenericGetAttr,              /* tp_getattro */
1887       0,                                    /* tp_setattro */
1888       0,                                    /* tp_as_buffer */
1889       Py_TPFLAGS_DEFAULT,                   /* tp_flags */
1890       swigpacked_doc,                       /* tp_doc */
1891       0,                                    /* tp_traverse */
1892       0,                                    /* tp_clear */
1893       0,                                    /* tp_richcompare */
1894       0,                                    /* tp_weaklistoffset */
1895       0,                                    /* tp_iter */
1896       0,                                    /* tp_iternext */
1897       0,                                    /* tp_methods */
1898       0,                                    /* tp_members */
1899       0,                                    /* tp_getset */
1900       0,                                    /* tp_base */
1901       0,                                    /* tp_dict */
1902       0,                                    /* tp_descr_get */
1903       0,                                    /* tp_descr_set */
1904       0,                                    /* tp_dictoffset */
1905       0,                                    /* tp_init */
1906       0,                                    /* tp_alloc */
1907       0,                                    /* tp_new */
1908       0,                                    /* tp_free */
1909       0,                                    /* tp_is_gc */
1910       0,                                    /* tp_bases */
1911       0,                                    /* tp_mro */
1912       0,                                    /* tp_cache */
1913       0,                                    /* tp_subclasses */
1914       0,                                    /* tp_weaklist */
1915       0,                                    /* tp_del */
1916       0,                                    /* tp_version_tag */
1917 #if PY_VERSION_HEX >= 0x03040000
1918       0,                                    /* tp_finalize */
1919 #endif
1920 #if PY_VERSION_HEX >= 0x03080000
1921       0,                                    /* tp_vectorcall */
1922 #endif
1923 #if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
1924       0,                                    /* tp_print */
1925 #endif
1926 #ifdef COUNT_ALLOCS
1927       0,                                    /* tp_allocs */
1928       0,                                    /* tp_frees */
1929       0,                                    /* tp_maxalloc */
1930       0,                                    /* tp_prev */
1931       0                                     /* tp_next */
1932 #endif
1933     };
1934     swigpypacked_type = tmp;
1935     type_init = 1;
1936     if (PyType_Ready(&swigpypacked_type) < 0)
1937       return NULL;
1938   }
1939   return &swigpypacked_type;
1940 }
1941 
1942 SWIGRUNTIME PyObject *
SwigPyPacked_New(void * ptr,size_t size,swig_type_info * ty)1943 SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty)
1944 {
1945   SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type());
1946   if (sobj) {
1947     void *pack = malloc(size);
1948     if (pack) {
1949       memcpy(pack, ptr, size);
1950       sobj->pack = pack;
1951       sobj->ty   = ty;
1952       sobj->size = size;
1953     } else {
1954       PyObject_DEL((PyObject *) sobj);
1955       sobj = 0;
1956     }
1957   }
1958   return (PyObject *) sobj;
1959 }
1960 
1961 SWIGRUNTIME swig_type_info *
SwigPyPacked_UnpackData(PyObject * obj,void * ptr,size_t size)1962 SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
1963 {
1964   if (SwigPyPacked_Check(obj)) {
1965     SwigPyPacked *sobj = (SwigPyPacked *)obj;
1966     if (sobj->size != size) return 0;
1967     memcpy(ptr, sobj->pack, size);
1968     return sobj->ty;
1969   } else {
1970     return 0;
1971   }
1972 }
1973 
1974 /* -----------------------------------------------------------------------------
1975  * pointers/data manipulation
1976  * ----------------------------------------------------------------------------- */
1977 
1978 static PyObject *Swig_This_global = NULL;
1979 
1980 SWIGRUNTIME PyObject *
SWIG_This(void)1981 SWIG_This(void)
1982 {
1983   if (Swig_This_global == NULL)
1984     Swig_This_global = SWIG_Python_str_FromChar("this");
1985   return Swig_This_global;
1986 }
1987 
1988 /* #define SWIG_PYTHON_SLOW_GETSET_THIS */
1989 
1990 /* TODO: I don't know how to implement the fast getset in Python 3 right now */
1991 #if PY_VERSION_HEX>=0x03000000
1992 #define SWIG_PYTHON_SLOW_GETSET_THIS
1993 #endif
1994 
1995 SWIGRUNTIME SwigPyObject *
SWIG_Python_GetSwigThis(PyObject * pyobj)1996 SWIG_Python_GetSwigThis(PyObject *pyobj)
1997 {
1998   PyObject *obj;
1999 
2000   if (SwigPyObject_Check(pyobj))
2001     return (SwigPyObject *) pyobj;
2002 
2003 #ifdef SWIGPYTHON_BUILTIN
2004   (void)obj;
2005 # ifdef PyWeakref_CheckProxy
2006   if (PyWeakref_CheckProxy(pyobj)) {
2007     pyobj = PyWeakref_GET_OBJECT(pyobj);
2008     if (pyobj && SwigPyObject_Check(pyobj))
2009       return (SwigPyObject*) pyobj;
2010   }
2011 # endif
2012   return NULL;
2013 #else
2014 
2015   obj = 0;
2016 
2017 #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2018   if (PyInstance_Check(pyobj)) {
2019     obj = _PyInstance_Lookup(pyobj, SWIG_This());
2020   } else {
2021     PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
2022     if (dictptr != NULL) {
2023       PyObject *dict = *dictptr;
2024       obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0;
2025     } else {
2026 #ifdef PyWeakref_CheckProxy
2027       if (PyWeakref_CheckProxy(pyobj)) {
2028 	PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
2029 	return wobj ? SWIG_Python_GetSwigThis(wobj) : 0;
2030       }
2031 #endif
2032       obj = PyObject_GetAttr(pyobj,SWIG_This());
2033       if (obj) {
2034 	Py_DECREF(obj);
2035       } else {
2036 	if (PyErr_Occurred()) PyErr_Clear();
2037 	return 0;
2038       }
2039     }
2040   }
2041 #else
2042   obj = PyObject_GetAttr(pyobj,SWIG_This());
2043   if (obj) {
2044     Py_DECREF(obj);
2045   } else {
2046     if (PyErr_Occurred()) PyErr_Clear();
2047     return 0;
2048   }
2049 #endif
2050   if (obj && !SwigPyObject_Check(obj)) {
2051     /* a PyObject is called 'this', try to get the 'real this'
2052        SwigPyObject from it */
2053     return SWIG_Python_GetSwigThis(obj);
2054   }
2055   return (SwigPyObject *)obj;
2056 #endif
2057 }
2058 
2059 /* Acquire a pointer value */
2060 
2061 SWIGRUNTIME int
SWIG_Python_AcquirePtr(PyObject * obj,int own)2062 SWIG_Python_AcquirePtr(PyObject *obj, int own) {
2063   if (own == SWIG_POINTER_OWN) {
2064     SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj);
2065     if (sobj) {
2066       int oldown = sobj->own;
2067       sobj->own = own;
2068       return oldown;
2069     }
2070   }
2071   return 0;
2072 }
2073 
2074 /* Convert a pointer value */
2075 
2076 SWIGRUNTIME int
SWIG_Python_ConvertPtrAndOwn(PyObject * obj,void ** ptr,swig_type_info * ty,int flags,int * own)2077 SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) {
2078   int res;
2079   SwigPyObject *sobj;
2080   int implicit_conv = (flags & SWIG_POINTER_IMPLICIT_CONV) != 0;
2081 
2082   if (!obj)
2083     return SWIG_ERROR;
2084   if (obj == Py_None && !implicit_conv) {
2085     if (ptr)
2086       *ptr = 0;
2087     return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK;
2088   }
2089 
2090   res = SWIG_ERROR;
2091 
2092   sobj = SWIG_Python_GetSwigThis(obj);
2093   if (own)
2094     *own = 0;
2095   while (sobj) {
2096     void *vptr = sobj->ptr;
2097     if (ty) {
2098       swig_type_info *to = sobj->ty;
2099       if (to == ty) {
2100         /* no type cast needed */
2101         if (ptr) *ptr = vptr;
2102         break;
2103       } else {
2104         swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
2105         if (!tc) {
2106           sobj = (SwigPyObject *)sobj->next;
2107         } else {
2108           if (ptr) {
2109             int newmemory = 0;
2110             *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
2111             if (newmemory == SWIG_CAST_NEW_MEMORY) {
2112               assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
2113               if (own)
2114                 *own = *own | SWIG_CAST_NEW_MEMORY;
2115             }
2116           }
2117           break;
2118         }
2119       }
2120     } else {
2121       if (ptr) *ptr = vptr;
2122       break;
2123     }
2124   }
2125   if (sobj) {
2126     if (own)
2127       *own = *own | sobj->own;
2128     if (flags & SWIG_POINTER_DISOWN) {
2129       sobj->own = 0;
2130     }
2131     res = SWIG_OK;
2132   } else {
2133     if (implicit_conv) {
2134       SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
2135       if (data && !data->implicitconv) {
2136         PyObject *klass = data->klass;
2137         if (klass) {
2138           PyObject *impconv;
2139           data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/
2140           impconv = SWIG_Python_CallFunctor(klass, obj);
2141           data->implicitconv = 0;
2142           if (PyErr_Occurred()) {
2143             PyErr_Clear();
2144             impconv = 0;
2145           }
2146           if (impconv) {
2147             SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv);
2148             if (iobj) {
2149               void *vptr;
2150               res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
2151               if (SWIG_IsOK(res)) {
2152                 if (ptr) {
2153                   *ptr = vptr;
2154                   /* transfer the ownership to 'ptr' */
2155                   iobj->own = 0;
2156                   res = SWIG_AddCast(res);
2157                   res = SWIG_AddNewMask(res);
2158                 } else {
2159                   res = SWIG_AddCast(res);
2160                 }
2161               }
2162             }
2163             Py_DECREF(impconv);
2164           }
2165         }
2166       }
2167       if (!SWIG_IsOK(res) && obj == Py_None) {
2168         if (ptr)
2169           *ptr = 0;
2170         if (PyErr_Occurred())
2171           PyErr_Clear();
2172         res = SWIG_OK;
2173       }
2174     }
2175   }
2176   return res;
2177 }
2178 
2179 /* Convert a function ptr value */
2180 
2181 SWIGRUNTIME int
SWIG_Python_ConvertFunctionPtr(PyObject * obj,void ** ptr,swig_type_info * ty)2182 SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
2183   if (!PyCFunction_Check(obj)) {
2184     return SWIG_ConvertPtr(obj, ptr, ty, 0);
2185   } else {
2186     void *vptr = 0;
2187     swig_cast_info *tc;
2188 
2189     /* here we get the method pointer for callbacks */
2190     const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
2191     const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
2192     if (desc)
2193       desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
2194     if (!desc)
2195       return SWIG_ERROR;
2196     tc = SWIG_TypeCheck(desc,ty);
2197     if (tc) {
2198       int newmemory = 0;
2199       *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
2200       assert(!newmemory); /* newmemory handling not yet implemented */
2201     } else {
2202       return SWIG_ERROR;
2203     }
2204     return SWIG_OK;
2205   }
2206 }
2207 
2208 /* Convert a packed pointer value */
2209 
2210 SWIGRUNTIME int
SWIG_Python_ConvertPacked(PyObject * obj,void * ptr,size_t sz,swig_type_info * ty)2211 SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) {
2212   swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz);
2213   if (!to) return SWIG_ERROR;
2214   if (ty) {
2215     if (to != ty) {
2216       /* check type cast? */
2217       swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
2218       if (!tc) return SWIG_ERROR;
2219     }
2220   }
2221   return SWIG_OK;
2222 }
2223 
2224 /* -----------------------------------------------------------------------------
2225  * Create a new pointer object
2226  * ----------------------------------------------------------------------------- */
2227 
2228 /*
2229   Create a new instance object, without calling __init__, and set the
2230   'this' attribute.
2231 */
2232 
2233 SWIGRUNTIME PyObject*
SWIG_Python_NewShadowInstance(SwigPyClientData * data,PyObject * swig_this)2234 SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
2235 {
2236   PyObject *inst = 0;
2237   PyObject *newraw = data->newraw;
2238   if (newraw) {
2239     inst = PyObject_Call(newraw, data->newargs, NULL);
2240     if (inst) {
2241 #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2242       PyObject **dictptr = _PyObject_GetDictPtr(inst);
2243       if (dictptr != NULL) {
2244 	PyObject *dict = *dictptr;
2245 	if (dict == NULL) {
2246 	  dict = PyDict_New();
2247 	  *dictptr = dict;
2248 	  PyDict_SetItem(dict, SWIG_This(), swig_this);
2249 	}
2250       }
2251 #else
2252       if (PyObject_SetAttr(inst, SWIG_This(), swig_this) == -1) {
2253         Py_DECREF(inst);
2254         inst = 0;
2255       }
2256 #endif
2257     }
2258   } else {
2259 #if PY_VERSION_HEX >= 0x03000000
2260     PyObject *empty_args = PyTuple_New(0);
2261     if (empty_args) {
2262       PyObject *empty_kwargs = PyDict_New();
2263       if (empty_kwargs) {
2264         inst = ((PyTypeObject *)data->newargs)->tp_new((PyTypeObject *)data->newargs, empty_args, empty_kwargs);
2265         Py_DECREF(empty_kwargs);
2266         if (inst) {
2267           if (PyObject_SetAttr(inst, SWIG_This(), swig_this) == -1) {
2268             Py_DECREF(inst);
2269             inst = 0;
2270           } else {
2271             Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
2272           }
2273         }
2274       }
2275       Py_DECREF(empty_args);
2276     }
2277 #else
2278     PyObject *dict = PyDict_New();
2279     if (dict) {
2280       PyDict_SetItem(dict, SWIG_This(), swig_this);
2281       inst = PyInstance_NewRaw(data->newargs, dict);
2282       Py_DECREF(dict);
2283     }
2284 #endif
2285   }
2286   return inst;
2287 }
2288 
2289 SWIGRUNTIME int
SWIG_Python_SetSwigThis(PyObject * inst,PyObject * swig_this)2290 SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this)
2291 {
2292 #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2293   PyObject **dictptr = _PyObject_GetDictPtr(inst);
2294   if (dictptr != NULL) {
2295     PyObject *dict = *dictptr;
2296     if (dict == NULL) {
2297       dict = PyDict_New();
2298       *dictptr = dict;
2299     }
2300     return PyDict_SetItem(dict, SWIG_This(), swig_this);
2301   }
2302 #endif
2303   return PyObject_SetAttr(inst, SWIG_This(), swig_this);
2304 }
2305 
2306 
2307 SWIGINTERN PyObject *
SWIG_Python_InitShadowInstance(PyObject * args)2308 SWIG_Python_InitShadowInstance(PyObject *args) {
2309   PyObject *obj[2];
2310   if (!SWIG_Python_UnpackTuple(args, "swiginit", 2, 2, obj)) {
2311     return NULL;
2312   } else {
2313     SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]);
2314     if (sthis) {
2315       SwigPyObject_append((PyObject*) sthis, obj[1]);
2316     } else {
2317       if (SWIG_Python_SetSwigThis(obj[0], obj[1]) != 0)
2318         return NULL;
2319     }
2320     return SWIG_Py_Void();
2321   }
2322 }
2323 
2324 /* Create a new pointer object */
2325 
2326 SWIGRUNTIME PyObject *
SWIG_Python_NewPointerObj(PyObject * self,void * ptr,swig_type_info * type,int flags)2327 SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags) {
2328   SwigPyClientData *clientdata;
2329   PyObject * robj;
2330   int own;
2331 
2332   if (!ptr)
2333     return SWIG_Py_Void();
2334 
2335   clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0;
2336   own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
2337   if (clientdata && clientdata->pytype) {
2338     SwigPyObject *newobj;
2339     if (flags & SWIG_BUILTIN_TP_INIT) {
2340       newobj = (SwigPyObject*) self;
2341       if (newobj->ptr) {
2342         PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0);
2343         while (newobj->next)
2344 	  newobj = (SwigPyObject *) newobj->next;
2345         newobj->next = next_self;
2346         newobj = (SwigPyObject *)next_self;
2347 #ifdef SWIGPYTHON_BUILTIN
2348         newobj->dict = 0;
2349 #endif
2350       }
2351     } else {
2352       newobj = PyObject_New(SwigPyObject, clientdata->pytype);
2353 #ifdef SWIGPYTHON_BUILTIN
2354       newobj->dict = 0;
2355 #endif
2356     }
2357     if (newobj) {
2358       newobj->ptr = ptr;
2359       newobj->ty = type;
2360       newobj->own = own;
2361       newobj->next = 0;
2362       return (PyObject*) newobj;
2363     }
2364     return SWIG_Py_Void();
2365   }
2366 
2367   assert(!(flags & SWIG_BUILTIN_TP_INIT));
2368 
2369   robj = SwigPyObject_New(ptr, type, own);
2370   if (robj && clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
2371     PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
2372     Py_DECREF(robj);
2373     robj = inst;
2374   }
2375   return robj;
2376 }
2377 
2378 /* Create a new packed object */
2379 
2380 SWIGRUNTIMEINLINE PyObject *
SWIG_Python_NewPackedObj(void * ptr,size_t sz,swig_type_info * type)2381 SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
2382   return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void();
2383 }
2384 
2385 /* -----------------------------------------------------------------------------*
2386  *  Get type list
2387  * -----------------------------------------------------------------------------*/
2388 
2389 #ifdef SWIG_LINK_RUNTIME
2390 void *SWIG_ReturnGlobalTypeList(void *);
2391 #endif
2392 
2393 SWIGRUNTIME swig_module_info *
SWIG_Python_GetModule(void * SWIGUNUSEDPARM (clientdata))2394 SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) {
2395   static void *type_pointer = (void *)0;
2396   /* first check if module already created */
2397   if (!type_pointer) {
2398 #ifdef SWIG_LINK_RUNTIME
2399     type_pointer = SWIG_ReturnGlobalTypeList((void *)0);
2400 #else
2401     type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0);
2402     if (PyErr_Occurred()) {
2403       PyErr_Clear();
2404       type_pointer = (void *)0;
2405     }
2406 #endif
2407   }
2408   return (swig_module_info *) type_pointer;
2409 }
2410 
2411 SWIGRUNTIME void
SWIG_Python_DestroyModule(PyObject * obj)2412 SWIG_Python_DestroyModule(PyObject *obj)
2413 {
2414   swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME);
2415   swig_type_info **types = swig_module->types;
2416   size_t i;
2417   for (i =0; i < swig_module->size; ++i) {
2418     swig_type_info *ty = types[i];
2419     if (ty->owndata) {
2420       SwigPyClientData *data = (SwigPyClientData *) ty->clientdata;
2421       if (data) SwigPyClientData_Del(data);
2422     }
2423   }
2424   Py_DECREF(SWIG_This());
2425   Swig_This_global = NULL;
2426 }
2427 
2428 SWIGRUNTIME void
SWIG_Python_SetModule(swig_module_info * swig_module)2429 SWIG_Python_SetModule(swig_module_info *swig_module) {
2430 #if PY_VERSION_HEX >= 0x03000000
2431  /* Add a dummy module object into sys.modules */
2432   PyObject *module = PyImport_AddModule("swig_runtime_data" SWIG_RUNTIME_VERSION);
2433 #else
2434   static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */
2435   PyObject *module = Py_InitModule("swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table);
2436 #endif
2437   PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule);
2438   if (pointer && module) {
2439     PyModule_AddObject(module, "type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer);
2440   } else {
2441     Py_XDECREF(pointer);
2442   }
2443 }
2444 
2445 /* The python cached type query */
2446 SWIGRUNTIME PyObject *
SWIG_Python_TypeCache(void)2447 SWIG_Python_TypeCache(void) {
2448   static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New();
2449   return cache;
2450 }
2451 
2452 SWIGRUNTIME swig_type_info *
SWIG_Python_TypeQuery(const char * type)2453 SWIG_Python_TypeQuery(const char *type)
2454 {
2455   PyObject *cache = SWIG_Python_TypeCache();
2456   PyObject *key = SWIG_Python_str_FromChar(type);
2457   PyObject *obj = PyDict_GetItem(cache, key);
2458   swig_type_info *descriptor;
2459   if (obj) {
2460     descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL);
2461   } else {
2462     swig_module_info *swig_module = SWIG_GetModule(0);
2463     descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type);
2464     if (descriptor) {
2465       obj = PyCapsule_New((void*) descriptor, NULL, NULL);
2466       PyDict_SetItem(cache, key, obj);
2467       Py_DECREF(obj);
2468     }
2469   }
2470   Py_DECREF(key);
2471   return descriptor;
2472 }
2473 
2474 /*
2475    For backward compatibility only
2476 */
2477 #define SWIG_POINTER_EXCEPTION  0
2478 #define SWIG_arg_fail(arg)      SWIG_Python_ArgFail(arg)
2479 #define SWIG_MustGetPtr(p, type, argnum, flags)  SWIG_Python_MustGetPtr(p, type, argnum, flags)
2480 
2481 SWIGRUNTIME int
SWIG_Python_AddErrMesg(const char * mesg,int infront)2482 SWIG_Python_AddErrMesg(const char* mesg, int infront)
2483 {
2484   if (PyErr_Occurred()) {
2485     PyObject *type = 0;
2486     PyObject *value = 0;
2487     PyObject *traceback = 0;
2488     PyErr_Fetch(&type, &value, &traceback);
2489     if (value) {
2490       PyObject *old_str = PyObject_Str(value);
2491       const char *tmp = SWIG_Python_str_AsChar(old_str);
2492       const char *errmesg = tmp ? tmp : "Invalid error message";
2493       Py_XINCREF(type);
2494       PyErr_Clear();
2495       if (infront) {
2496 	PyErr_Format(type, "%s %s", mesg, errmesg);
2497       } else {
2498 	PyErr_Format(type, "%s %s", errmesg, mesg);
2499       }
2500       SWIG_Python_str_DelForPy3(tmp);
2501       Py_DECREF(old_str);
2502     }
2503     return 1;
2504   } else {
2505     return 0;
2506   }
2507 }
2508 
2509 SWIGRUNTIME int
SWIG_Python_ArgFail(int argnum)2510 SWIG_Python_ArgFail(int argnum)
2511 {
2512   if (PyErr_Occurred()) {
2513     /* add information about failing argument */
2514     char mesg[256];
2515     PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum);
2516     return SWIG_Python_AddErrMesg(mesg, 1);
2517   } else {
2518     return 0;
2519   }
2520 }
2521 
2522 SWIGRUNTIMEINLINE const char *
SwigPyObject_GetDesc(PyObject * self)2523 SwigPyObject_GetDesc(PyObject *self)
2524 {
2525   SwigPyObject *v = (SwigPyObject *)self;
2526   swig_type_info *ty = v ? v->ty : 0;
2527   return ty ? ty->str : "";
2528 }
2529 
2530 SWIGRUNTIME void
SWIG_Python_TypeError(const char * type,PyObject * obj)2531 SWIG_Python_TypeError(const char *type, PyObject *obj)
2532 {
2533   if (type) {
2534 #if defined(SWIG_COBJECT_TYPES)
2535     if (obj && SwigPyObject_Check(obj)) {
2536       const char *otype = (const char *) SwigPyObject_GetDesc(obj);
2537       if (otype) {
2538 	PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received",
2539 		     type, otype);
2540 	return;
2541       }
2542     } else
2543 #endif
2544     {
2545       const char *otype = (obj ? obj->ob_type->tp_name : 0);
2546       if (otype) {
2547 	PyObject *str = PyObject_Str(obj);
2548 	const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0;
2549 	if (cstr) {
2550 	  PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received",
2551 		       type, otype, cstr);
2552           SWIG_Python_str_DelForPy3(cstr);
2553 	} else {
2554 	  PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
2555 		       type, otype);
2556 	}
2557 	Py_XDECREF(str);
2558 	return;
2559       }
2560     }
2561     PyErr_Format(PyExc_TypeError, "a '%s' is expected", type);
2562   } else {
2563     PyErr_Format(PyExc_TypeError, "unexpected type is received");
2564   }
2565 }
2566 
2567 
2568 /* Convert a pointer value, signal an exception on a type mismatch */
2569 SWIGRUNTIME void *
SWIG_Python_MustGetPtr(PyObject * obj,swig_type_info * ty,int SWIGUNUSEDPARM (argnum),int flags)2570 SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags) {
2571   void *result;
2572   if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
2573     PyErr_Clear();
2574 #if SWIG_POINTER_EXCEPTION
2575     if (flags) {
2576       SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
2577       SWIG_Python_ArgFail(argnum);
2578     }
2579 #endif
2580   }
2581   return result;
2582 }
2583 
2584 #ifdef SWIGPYTHON_BUILTIN
2585 SWIGRUNTIME int
SWIG_Python_NonDynamicSetAttr(PyObject * obj,PyObject * name,PyObject * value)2586 SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) {
2587   PyTypeObject *tp = obj->ob_type;
2588   PyObject *descr;
2589   PyObject *encoded_name;
2590   descrsetfunc f;
2591   int res = -1;
2592 
2593 # ifdef Py_USING_UNICODE
2594   if (PyString_Check(name)) {
2595     name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL);
2596     if (!name)
2597       return -1;
2598   } else if (!PyUnicode_Check(name))
2599 # else
2600   if (!PyString_Check(name))
2601 # endif
2602   {
2603     PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name);
2604     return -1;
2605   } else {
2606     Py_INCREF(name);
2607   }
2608 
2609   if (!tp->tp_dict) {
2610     if (PyType_Ready(tp) < 0)
2611       goto done;
2612   }
2613 
2614   descr = _PyType_Lookup(tp, name);
2615   f = NULL;
2616   if (descr != NULL)
2617     f = descr->ob_type->tp_descr_set;
2618   if (!f) {
2619     if (PyString_Check(name)) {
2620       encoded_name = name;
2621       Py_INCREF(name);
2622     } else {
2623       encoded_name = PyUnicode_AsUTF8String(name);
2624       if (!encoded_name)
2625         return -1;
2626     }
2627     PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name));
2628     Py_DECREF(encoded_name);
2629   } else {
2630     res = f(descr, obj, value);
2631   }
2632 
2633   done:
2634   Py_DECREF(name);
2635   return res;
2636 }
2637 #endif
2638 
2639 
2640 #ifdef __cplusplus
2641 }
2642 #endif
2643 
2644 #ifdef __cplusplus
2645 extern "C" {
2646 #endif
2647 
2648 SWIGINTERN Py_hash_t
SwigPyObject_hash(PyObject * obj)2649 SwigPyObject_hash(PyObject *obj) {
2650   SwigPyObject *sobj = (SwigPyObject *)obj;
2651   void *ptr = sobj->ptr;
2652   return (Py_hash_t)ptr;
2653 }
2654 
2655 SWIGINTERN Py_hash_t
SWIG_PyNumber_AsPyHash(PyObject * obj)2656 SWIG_PyNumber_AsPyHash(PyObject *obj) {
2657   Py_hash_t result = -1;
2658 #if PY_VERSION_HEX < 0x03020000
2659   if (PyInt_Check(obj))
2660     result = PyInt_AsLong(obj);
2661   else if (PyLong_Check(obj))
2662     result = PyLong_AsLong(obj);
2663 #else
2664   if (PyNumber_Check(obj))
2665     result = PyNumber_AsSsize_t(obj, NULL);
2666 #endif
2667   else
2668     PyErr_Format(PyExc_TypeError, "Wrong type for hash function");
2669   return PyErr_Occurred() ? -1 : result;
2670 }
2671 
2672 SWIGINTERN int
SwigPyBuiltin_BadInit(PyObject * self,PyObject * SWIGUNUSEDPARM (args),PyObject * SWIGUNUSEDPARM (kwds))2673 SwigPyBuiltin_BadInit(PyObject *self, PyObject *SWIGUNUSEDPARM(args), PyObject *SWIGUNUSEDPARM(kwds)) {
2674   PyErr_Format(PyExc_TypeError, "Cannot create new instances of type '%.300s'", self->ob_type->tp_name);
2675   return -1;
2676 }
2677 
2678 SWIGINTERN void
SwigPyBuiltin_BadDealloc(PyObject * obj)2679 SwigPyBuiltin_BadDealloc(PyObject *obj) {
2680   SwigPyObject *sobj = (SwigPyObject *)obj;
2681   if (sobj->own) {
2682     PyErr_Format(PyExc_TypeError, "Swig detected a memory leak in type '%.300s': no callable destructor found.", obj->ob_type->tp_name);
2683   }
2684 }
2685 
2686 typedef struct {
2687   PyCFunction get;
2688   PyCFunction set;
2689 } SwigPyGetSet;
2690 
2691 SWIGINTERN PyObject *
SwigPyBuiltin_GetterClosure(PyObject * obj,void * closure)2692 SwigPyBuiltin_GetterClosure (PyObject *obj, void *closure) {
2693   SwigPyGetSet *getset;
2694   PyObject *tuple, *result;
2695   if (!closure)
2696     return SWIG_Py_Void();
2697   getset = (SwigPyGetSet *)closure;
2698   if (!getset->get)
2699     return SWIG_Py_Void();
2700   tuple = PyTuple_New(0);
2701   assert(tuple);
2702   result = (*getset->get)(obj, tuple);
2703   Py_DECREF(tuple);
2704   return result;
2705 }
2706 
2707 SWIGINTERN PyObject *
SwigPyBuiltin_FunpackGetterClosure(PyObject * obj,void * closure)2708 SwigPyBuiltin_FunpackGetterClosure (PyObject *obj, void *closure) {
2709   SwigPyGetSet *getset;
2710   PyObject *result;
2711   if (!closure)
2712     return SWIG_Py_Void();
2713   getset = (SwigPyGetSet *)closure;
2714   if (!getset->get)
2715     return SWIG_Py_Void();
2716   result = (*getset->get)(obj, NULL);
2717   return result;
2718 }
2719 
2720 SWIGINTERN int
SwigPyBuiltin_SetterClosure(PyObject * obj,PyObject * val,void * closure)2721 SwigPyBuiltin_SetterClosure (PyObject *obj, PyObject *val, void *closure) {
2722   SwigPyGetSet *getset;
2723   PyObject *tuple, *result;
2724   if (!closure) {
2725     PyErr_Format(PyExc_TypeError, "Missing getset closure");
2726     return -1;
2727   }
2728   getset = (SwigPyGetSet *)closure;
2729   if (!getset->set) {
2730     PyErr_Format(PyExc_TypeError, "Illegal member variable assignment in type '%.300s'", obj->ob_type->tp_name);
2731     return -1;
2732   }
2733   tuple = PyTuple_New(1);
2734   assert(tuple);
2735   Py_INCREF(val);
2736   PyTuple_SET_ITEM(tuple, 0, val);
2737   result = (*getset->set)(obj, tuple);
2738   Py_DECREF(tuple);
2739   Py_XDECREF(result);
2740   return result ? 0 : -1;
2741 }
2742 
2743 SWIGINTERN int
SwigPyBuiltin_FunpackSetterClosure(PyObject * obj,PyObject * val,void * closure)2744 SwigPyBuiltin_FunpackSetterClosure (PyObject *obj, PyObject *val, void *closure) {
2745   SwigPyGetSet *getset;
2746   PyObject *result;
2747   if (!closure) {
2748     PyErr_Format(PyExc_TypeError, "Missing getset closure");
2749     return -1;
2750   }
2751   getset = (SwigPyGetSet *)closure;
2752   if (!getset->set) {
2753     PyErr_Format(PyExc_TypeError, "Illegal member variable assignment in type '%.300s'", obj->ob_type->tp_name);
2754     return -1;
2755   }
2756   result = (*getset->set)(obj, val);
2757   Py_XDECREF(result);
2758   return result ? 0 : -1;
2759 }
2760 
2761 SWIGINTERN void
SwigPyStaticVar_dealloc(PyDescrObject * descr)2762 SwigPyStaticVar_dealloc(PyDescrObject *descr) {
2763   PyObject_GC_UnTrack(descr);
2764   Py_XDECREF(PyDescr_TYPE(descr));
2765   Py_XDECREF(PyDescr_NAME(descr));
2766   PyObject_GC_Del(descr);
2767 }
2768 
2769 SWIGINTERN PyObject *
SwigPyStaticVar_repr(PyGetSetDescrObject * descr)2770 SwigPyStaticVar_repr(PyGetSetDescrObject *descr) {
2771 #if PY_VERSION_HEX >= 0x03000000
2772 
2773   return PyUnicode_FromFormat("<class attribute '%S' of type '%s'>", PyDescr_NAME(descr), PyDescr_TYPE(descr)->tp_name);
2774 #else
2775   return PyString_FromFormat("<class attribute '%s' of type '%s'>", PyString_AsString(PyDescr_NAME(descr)), PyDescr_TYPE(descr)->tp_name);
2776 #endif
2777 }
2778 
2779 SWIGINTERN int
SwigPyStaticVar_traverse(PyObject * self,visitproc visit,void * arg)2780 SwigPyStaticVar_traverse(PyObject *self, visitproc visit, void *arg) {
2781   PyDescrObject *descr;
2782   descr = (PyDescrObject *)self;
2783   Py_VISIT((PyObject*) PyDescr_TYPE(descr));
2784   return 0;
2785 }
2786 
2787 SWIGINTERN PyObject *
SwigPyStaticVar_get(PyGetSetDescrObject * descr,PyObject * obj,PyObject * SWIGUNUSEDPARM (type))2788 SwigPyStaticVar_get(PyGetSetDescrObject *descr, PyObject *obj, PyObject *SWIGUNUSEDPARM(type)) {
2789   if (descr->d_getset->get != NULL)
2790     return descr->d_getset->get(obj, descr->d_getset->closure);
2791 #if PY_VERSION_HEX >= 0x03000000
2792   PyErr_Format(PyExc_AttributeError, "attribute '%.300S' of '%.100s' objects is not readable", PyDescr_NAME(descr), PyDescr_TYPE(descr)->tp_name);
2793 #else
2794   PyErr_Format(PyExc_AttributeError, "attribute '%.300s' of '%.100s' objects is not readable", PyString_AsString(PyDescr_NAME(descr)), PyDescr_TYPE(descr)->tp_name);
2795 #endif
2796   return NULL;
2797 }
2798 
2799 SWIGINTERN int
SwigPyStaticVar_set(PyGetSetDescrObject * descr,PyObject * obj,PyObject * value)2800 SwigPyStaticVar_set(PyGetSetDescrObject *descr, PyObject *obj, PyObject *value) {
2801   if (descr->d_getset->set != NULL)
2802     return descr->d_getset->set(obj, value, descr->d_getset->closure);
2803 #if PY_VERSION_HEX >= 0x03000000
2804   PyErr_Format(PyExc_AttributeError, "attribute '%.300S' of '%.100s' objects is not writable", PyDescr_NAME(descr), PyDescr_TYPE(descr)->tp_name);
2805 #else
2806   PyErr_Format(PyExc_AttributeError, "attribute '%.300s' of '%.100s' objects is not writable", PyString_AsString(PyDescr_NAME(descr)), PyDescr_TYPE(descr)->tp_name);
2807 #endif
2808   return -1;
2809 }
2810 
2811 SWIGINTERN int
SwigPyObjectType_setattro(PyObject * typeobject,PyObject * name,PyObject * value)2812 SwigPyObjectType_setattro(PyObject *typeobject, PyObject *name, PyObject *value) {
2813   PyObject *attribute;
2814   PyTypeObject *type;
2815   descrsetfunc local_set;
2816 
2817   assert(PyType_Check(typeobject));
2818   type = (PyTypeObject *)typeobject;
2819   attribute = _PyType_Lookup(type, name);
2820   if (attribute != NULL) {
2821     /* Implement descriptor functionality, if any */
2822     local_set = attribute->ob_type->tp_descr_set;
2823     if (local_set != NULL)
2824       return local_set(attribute, (PyObject *)type, value);
2825 #if PY_VERSION_HEX >= 0x03000000
2826     PyErr_Format(PyExc_AttributeError, "cannot modify read-only attribute '%.50s.%.400S'", type->tp_name, name);
2827 #else
2828     PyErr_Format(PyExc_AttributeError, "cannot modify read-only attribute '%.50s.%.400s'", type->tp_name, PyString_AS_STRING(name));
2829 #endif
2830   } else {
2831 #if PY_VERSION_HEX >= 0x03000000
2832     PyErr_Format(PyExc_AttributeError, "type '%.50s' has no attribute '%.400S'", type->tp_name, name);
2833 #else
2834     PyErr_Format(PyExc_AttributeError, "type '%.50s' has no attribute '%.400s'", type->tp_name, PyString_AS_STRING(name));
2835 #endif
2836   }
2837 
2838   return -1;
2839 }
2840 
2841 SWIGINTERN PyTypeObject*
SwigPyStaticVar_Type(void)2842 SwigPyStaticVar_Type(void) {
2843   static PyTypeObject staticvar_type;
2844   static int type_init = 0;
2845   if (!type_init) {
2846     const PyTypeObject tmp = {
2847 #if PY_VERSION_HEX >= 0x03000000
2848       PyVarObject_HEAD_INIT(&PyType_Type, 0)
2849 #else
2850       PyObject_HEAD_INIT(&PyType_Type)
2851       0,                                        /* ob_size */
2852 #endif
2853       "swig_static_var_getset_descriptor",      /* tp_name */
2854       sizeof(PyGetSetDescrObject),              /* tp_basicsize */
2855       0,                                        /* tp_itemsize */
2856       (destructor)SwigPyStaticVar_dealloc,      /* tp_dealloc */
2857       0,                                        /* tp_print */
2858       0,                                        /* tp_getattr */
2859       0,                                        /* tp_setattr */
2860       0,                                        /* tp_compare */
2861       (reprfunc)SwigPyStaticVar_repr,           /* tp_repr */
2862       0,                                        /* tp_as_number */
2863       0,                                        /* tp_as_sequence */
2864       0,                                        /* tp_as_mapping */
2865       0,                                        /* tp_hash */
2866       0,                                        /* tp_call */
2867       0,                                        /* tp_str */
2868       PyObject_GenericGetAttr,                  /* tp_getattro */
2869       0,                                        /* tp_setattro */
2870       0,                                        /* tp_as_buffer */
2871       Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_CLASS, /* tp_flags */
2872       0,                                        /* tp_doc */
2873       SwigPyStaticVar_traverse,                 /* tp_traverse */
2874       0,                                        /* tp_clear */
2875       0,                                        /* tp_richcompare */
2876       0,                                        /* tp_weaklistoffset */
2877       0,                                        /* tp_iter */
2878       0,                                        /* tp_iternext */
2879       0,                                        /* tp_methods */
2880       0,                                        /* tp_members */
2881       0,                                        /* tp_getset */
2882       0,                                        /* tp_base */
2883       0,                                        /* tp_dict */
2884       (descrgetfunc)SwigPyStaticVar_get,        /* tp_descr_get */
2885       (descrsetfunc)SwigPyStaticVar_set,        /* tp_descr_set */
2886       0,                                        /* tp_dictoffset */
2887       0,                                        /* tp_init */
2888       0,                                        /* tp_alloc */
2889       0,                                        /* tp_new */
2890       0,                                        /* tp_free */
2891       0,                                        /* tp_is_gc */
2892       0,                                        /* tp_bases */
2893       0,                                        /* tp_mro */
2894       0,                                        /* tp_cache */
2895       0,                                        /* tp_subclasses */
2896       0,                                        /* tp_weaklist */
2897       0,                                        /* tp_del */
2898       0,                                        /* tp_version_tag */
2899 #if PY_VERSION_HEX >= 0x03040000
2900       0,                                        /* tp_finalize */
2901 #endif
2902 #if PY_VERSION_HEX >= 0x03080000
2903       0,                                        /* tp_vectorcall */
2904 #endif
2905 #if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
2906       0,                                        /* tp_print */
2907 #endif
2908 #ifdef COUNT_ALLOCS
2909       0,                                        /* tp_allocs */
2910       0,                                        /* tp_frees */
2911       0,                                        /* tp_maxalloc */
2912       0,                                        /* tp_prev */
2913       0                                         /* tp_next */
2914 #endif
2915     };
2916     staticvar_type = tmp;
2917     type_init = 1;
2918     if (PyType_Ready(&staticvar_type) < 0)
2919       return NULL;
2920   }
2921   return &staticvar_type;
2922 }
2923 
2924 SWIGINTERN PyTypeObject*
SwigPyObjectType(void)2925 SwigPyObjectType(void) {
2926   static char swigpyobjecttype_doc[] = "Metaclass for SWIG wrapped types";
2927   static PyTypeObject swigpyobjecttype_type;
2928   static int type_init = 0;
2929   if (!type_init) {
2930     const PyTypeObject tmp = {
2931 #if PY_VERSION_HEX >= 0x03000000
2932       PyVarObject_HEAD_INIT(&PyType_Type, 0)
2933 #else
2934       PyObject_HEAD_INIT(&PyType_Type)
2935       0,                                        /* ob_size */
2936 #endif
2937       "SwigPyObjectType",                       /* tp_name */
2938       PyType_Type.tp_basicsize,                 /* tp_basicsize */
2939       0,                                        /* tp_itemsize */
2940       0,                                        /* tp_dealloc */
2941       0,                                        /* tp_print */
2942       0,                                        /* tp_getattr */
2943       0,                                        /* tp_setattr */
2944       0,                                        /* tp_compare */
2945       0,                                        /* tp_repr */
2946       0,                                        /* tp_as_number */
2947       0,                                        /* tp_as_sequence */
2948       0,                                        /* tp_as_mapping */
2949       0,                                        /* tp_hash */
2950       0,                                        /* tp_call */
2951       0,                                        /* tp_str */
2952       0,                                        /* tp_getattro */
2953       SwigPyObjectType_setattro,                /* tp_setattro */
2954       0,                                        /* tp_as_buffer */
2955       Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_CLASS, /* tp_flags */
2956       swigpyobjecttype_doc,                     /* tp_doc */
2957       0,                                        /* tp_traverse */
2958       0,                                        /* tp_clear */
2959       0,                                        /* tp_richcompare */
2960       0,                                        /* tp_weaklistoffset */
2961       0,                                        /* tp_iter */
2962       0,                                        /* tp_iternext */
2963       0,                                        /* tp_methods */
2964       0,                                        /* tp_members */
2965       0,                                        /* tp_getset */
2966       0,                                        /* tp_base */
2967       0,                                        /* tp_dict */
2968       0,                                        /* tp_descr_get */
2969       0,                                        /* tp_descr_set */
2970       0,                                        /* tp_dictoffset */
2971       0,                                        /* tp_init */
2972       0,                                        /* tp_alloc */
2973       0,                                        /* tp_new */
2974       0,                                        /* tp_free */
2975       0,                                        /* tp_is_gc */
2976       0,                                        /* tp_bases */
2977       0,                                        /* tp_mro */
2978       0,                                        /* tp_cache */
2979       0,                                        /* tp_subclasses */
2980       0,                                        /* tp_weaklist */
2981       0,                                        /* tp_del */
2982       0,                                        /* tp_version_tag */
2983 #if PY_VERSION_HEX >= 0x03040000
2984       0,                                        /* tp_finalize */
2985 #endif
2986 #if PY_VERSION_HEX >= 0x03080000
2987       0,                                        /* tp_vectorcall */
2988 #endif
2989 #if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
2990       0,                                        /* tp_print */
2991 #endif
2992 #ifdef COUNT_ALLOCS
2993       0,                                        /* tp_allocs */
2994       0,                                        /* tp_frees */
2995       0,                                        /* tp_maxalloc */
2996       0,                                        /* tp_prev */
2997       0                                         /* tp_next */
2998 #endif
2999     };
3000     swigpyobjecttype_type = tmp;
3001     type_init = 1;
3002     swigpyobjecttype_type.tp_base = &PyType_Type;
3003     if (PyType_Ready(&swigpyobjecttype_type) < 0)
3004       return NULL;
3005   }
3006   return &swigpyobjecttype_type;
3007 }
3008 
3009 SWIGINTERN PyGetSetDescrObject *
SwigPyStaticVar_new_getset(PyTypeObject * type,PyGetSetDef * getset)3010 SwigPyStaticVar_new_getset(PyTypeObject *type, PyGetSetDef *getset) {
3011 
3012   PyGetSetDescrObject *descr;
3013   descr = (PyGetSetDescrObject *)PyType_GenericAlloc(SwigPyStaticVar_Type(), 0);
3014   assert(descr);
3015   Py_XINCREF(type);
3016   PyDescr_TYPE(descr) = type;
3017   PyDescr_NAME(descr) = PyString_InternFromString(getset->name);
3018   descr->d_getset = getset;
3019   if (PyDescr_NAME(descr) == NULL) {
3020     Py_DECREF(descr);
3021     descr = NULL;
3022   }
3023   return descr;
3024 }
3025 
3026 SWIGINTERN void
SwigPyBuiltin_InitBases(PyTypeObject * type,PyTypeObject ** bases)3027 SwigPyBuiltin_InitBases (PyTypeObject *type, PyTypeObject **bases) {
3028   Py_ssize_t base_count = 0;
3029   PyTypeObject **b;
3030   PyObject *tuple;
3031   Py_ssize_t i;
3032 
3033   if (!bases[0]) {
3034     bases[0] = SwigPyObject_type();
3035     bases[1] = NULL;
3036   }
3037   type->tp_base = bases[0];
3038   Py_INCREF((PyObject *)bases[0]);
3039   for (b = bases; *b != NULL; ++b)
3040     ++base_count;
3041   tuple = PyTuple_New(base_count);
3042   for (i = 0; i < base_count; ++i) {
3043     Py_INCREF((PyObject *)bases[i]);
3044     PyTuple_SET_ITEM(tuple, i, (PyObject *)bases[i]);
3045   }
3046   type->tp_bases = tuple;
3047 }
3048 
3049 SWIGINTERN PyObject *
SwigPyBuiltin_ThisClosure(PyObject * self,void * SWIGUNUSEDPARM (closure))3050 SwigPyBuiltin_ThisClosure (PyObject *self, void *SWIGUNUSEDPARM(closure)) {
3051   PyObject *result;
3052   result = (PyObject *)SWIG_Python_GetSwigThis(self);
3053   Py_XINCREF(result);
3054   return result;
3055 }
3056 
3057 SWIGINTERN void
SwigPyBuiltin_SetMetaType(PyTypeObject * type,PyTypeObject * metatype)3058 SwigPyBuiltin_SetMetaType (PyTypeObject *type, PyTypeObject *metatype)
3059 {
3060 #if PY_VERSION_HEX >= 0x03000000
3061     type->ob_base.ob_base.ob_type = metatype;
3062 #else
3063     type->ob_type = metatype;
3064 #endif
3065 }
3066 
3067 
3068 /* Start of callback function macros for use in PyTypeObject */
3069 
3070 typedef PyObject *(*SwigPyWrapperFunction)(PyObject *, PyObject *);
3071 
3072 #define SWIGPY_UNARYFUNC_CLOSURE(wrapper)		\
3073 SWIGINTERN PyObject *					\
3074 wrapper##_unaryfunc_closure(PyObject *a) {		\
3075   return SwigPyBuiltin_unaryfunc_closure(wrapper, a);	\
3076 }
3077 SWIGINTERN PyObject *
SwigPyBuiltin_unaryfunc_closure(SwigPyWrapperFunction wrapper,PyObject * a)3078 SwigPyBuiltin_unaryfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) {
3079   return wrapper(a, NULL);
3080 }
3081 
3082 #define SWIGPY_DESTRUCTOR_CLOSURE(wrapper)			\
3083 SWIGINTERN void							\
3084 wrapper##_destructor_closure(PyObject *a) {			\
3085     SwigPyBuiltin_destructor_closure(wrapper, #wrapper, a);	\
3086 }
3087 SWIGINTERN void
SwigPyBuiltin_destructor_closure(SwigPyWrapperFunction wrapper,const char * wrappername,PyObject * a)3088 SwigPyBuiltin_destructor_closure(SwigPyWrapperFunction wrapper, const char *wrappername, PyObject *a) {
3089   SwigPyObject *sobj;
3090   sobj = (SwigPyObject *)a;
3091   Py_XDECREF(sobj->dict);
3092   if (sobj->own) {
3093     PyObject *o;
3094     PyObject *type = 0, *value = 0, *traceback = 0;
3095     PyErr_Fetch(&type, &value, &traceback);
3096     o = wrapper(a, NULL);
3097     if (!o) {
3098       PyObject *deallocname = PyString_FromString(wrappername);
3099       PyErr_WriteUnraisable(deallocname);
3100       Py_DECREF(deallocname);
3101     }
3102     PyErr_Restore(type, value, traceback);
3103     Py_XDECREF(o);
3104   }
3105   if (PyType_IS_GC(a->ob_type)) {
3106     PyObject_GC_Del(a);
3107   } else {
3108     PyObject_Del(a);
3109   }
3110 }
3111 
3112 #define SWIGPY_INQUIRY_CLOSURE(wrapper)			\
3113 SWIGINTERN int						\
3114 wrapper##_inquiry_closure(PyObject *a) {		\
3115   return SwigPyBuiltin_inquiry_closure(wrapper, a);	\
3116 }
3117 SWIGINTERN int
SwigPyBuiltin_inquiry_closure(SwigPyWrapperFunction wrapper,PyObject * a)3118 SwigPyBuiltin_inquiry_closure(SwigPyWrapperFunction wrapper, PyObject *a) {
3119   PyObject *pyresult;
3120   int result;
3121   pyresult = wrapper(a, NULL);
3122   result = pyresult && PyObject_IsTrue(pyresult) ? 1 : 0;
3123   Py_XDECREF(pyresult);
3124   return result;
3125 }
3126 
3127 #define SWIGPY_GETITERFUNC_CLOSURE(wrapper)		\
3128 SWIGINTERN PyObject *					\
3129 wrapper##_getiterfunc_closure(PyObject *a) {		\
3130   return SwigPyBuiltin_getiterfunc_closure(wrapper, a);	\
3131 }
3132 SWIGINTERN PyObject *
SwigPyBuiltin_getiterfunc_closure(SwigPyWrapperFunction wrapper,PyObject * a)3133 SwigPyBuiltin_getiterfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) {
3134   return wrapper(a, NULL);
3135 }
3136 
3137 #define SWIGPY_BINARYFUNC_CLOSURE(wrapper)			\
3138 SWIGINTERN PyObject *						\
3139 wrapper##_binaryfunc_closure(PyObject *a, PyObject *b) {	\
3140   return SwigPyBuiltin_binaryfunc_closure(wrapper, a, b);	\
3141 }
3142 SWIGINTERN PyObject *
SwigPyBuiltin_binaryfunc_closure(SwigPyWrapperFunction wrapper,PyObject * a,PyObject * b)3143 SwigPyBuiltin_binaryfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a, PyObject *b) {
3144   PyObject *tuple, *result;
3145   tuple = PyTuple_New(1);
3146   assert(tuple);
3147   Py_INCREF(b);
3148   PyTuple_SET_ITEM(tuple, 0, b);
3149   result = wrapper(a, tuple);
3150   Py_DECREF(tuple);
3151   return result;
3152 }
3153 
3154 typedef ternaryfunc ternarycallfunc;
3155 
3156 #define SWIGPY_TERNARYFUNC_CLOSURE(wrapper)				\
3157 SWIGINTERN PyObject *							\
3158 wrapper##_ternaryfunc_closure(PyObject *a, PyObject *b, PyObject *c) {	\
3159   return SwigPyBuiltin_ternaryfunc_closure(wrapper, a, b, c);		\
3160 }
3161 SWIGINTERN PyObject *
SwigPyBuiltin_ternaryfunc_closure(SwigPyWrapperFunction wrapper,PyObject * a,PyObject * b,PyObject * c)3162 SwigPyBuiltin_ternaryfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a, PyObject *b, PyObject *c) {
3163   PyObject *tuple, *result;
3164   tuple = PyTuple_New(2);
3165   assert(tuple);
3166   Py_INCREF(b);
3167   PyTuple_SET_ITEM(tuple, 0, b);
3168   Py_INCREF(c);
3169   PyTuple_SET_ITEM(tuple, 1, c);
3170   result = wrapper(a, tuple);
3171   Py_DECREF(tuple);
3172   return result;
3173 }
3174 
3175 #define SWIGPY_TERNARYCALLFUNC_CLOSURE(wrapper)					\
3176 SWIGINTERN PyObject *								\
3177 wrapper##_ternarycallfunc_closure(PyObject *a, PyObject *b, PyObject *c) {	\
3178   return SwigPyBuiltin_ternarycallfunc_closure(wrapper, a, b, c);		\
3179 }
3180 SWIGINTERN PyObject *
SwigPyBuiltin_ternarycallfunc_closure(SwigPyWrapperFunction wrapper,PyObject * a,PyObject * b,PyObject * c)3181 SwigPyBuiltin_ternarycallfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a, PyObject *b, PyObject *c) {
3182   (void) c;
3183   return wrapper(a, b);
3184 }
3185 
3186 #define SWIGPY_LENFUNC_CLOSURE(wrapper)			\
3187 SWIGINTERN Py_ssize_t					\
3188 wrapper##_lenfunc_closure(PyObject *a) {		\
3189   return SwigPyBuiltin_lenfunc_closure(wrapper, a);	\
3190 }
3191 SWIGINTERN Py_ssize_t
SwigPyBuiltin_lenfunc_closure(SwigPyWrapperFunction wrapper,PyObject * a)3192 SwigPyBuiltin_lenfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) {
3193   PyObject *resultobj;
3194   Py_ssize_t result;
3195   resultobj = wrapper(a, NULL);
3196   result = PyNumber_AsSsize_t(resultobj, NULL);
3197   Py_DECREF(resultobj);
3198   return result;
3199 }
3200 
3201 #define SWIGPY_SSIZESSIZEARGFUNC_CLOSURE(wrapper)				\
3202 SWIGINTERN PyObject *								\
3203 wrapper##_ssizessizeargfunc_closure(PyObject *a, Py_ssize_t b, Py_ssize_t c) {	\
3204   return SwigPyBuiltin_ssizessizeargfunc_closure(wrapper, a, b, c);		\
3205 }
3206 SWIGINTERN PyObject *
SwigPyBuiltin_ssizessizeargfunc_closure(SwigPyWrapperFunction wrapper,PyObject * a,Py_ssize_t b,Py_ssize_t c)3207 SwigPyBuiltin_ssizessizeargfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a, Py_ssize_t b, Py_ssize_t c) {
3208   PyObject *tuple, *result;
3209   tuple = PyTuple_New(2);
3210   assert(tuple);
3211   PyTuple_SET_ITEM(tuple, 0, _PyLong_FromSsize_t(b));
3212   PyTuple_SET_ITEM(tuple, 1, _PyLong_FromSsize_t(c));
3213   result = wrapper(a, tuple);
3214   Py_DECREF(tuple);
3215   return result;
3216 }
3217 
3218 #define SWIGPY_SSIZESSIZEOBJARGPROC_CLOSURE(wrapper)						\
3219 SWIGINTERN int											\
3220 wrapper##_ssizessizeobjargproc_closure(PyObject *a, Py_ssize_t b, Py_ssize_t c, PyObject *d) {	\
3221   return SwigPyBuiltin_ssizessizeobjargproc_closure(wrapper, a, b, c, d);			\
3222 }
3223 SWIGINTERN int
SwigPyBuiltin_ssizessizeobjargproc_closure(SwigPyWrapperFunction wrapper,PyObject * a,Py_ssize_t b,Py_ssize_t c,PyObject * d)3224 SwigPyBuiltin_ssizessizeobjargproc_closure(SwigPyWrapperFunction wrapper, PyObject *a, Py_ssize_t b, Py_ssize_t c, PyObject *d) {
3225   PyObject *tuple, *resultobj;
3226   int result;
3227   tuple = PyTuple_New(d ? 3 : 2);
3228   assert(tuple);
3229   PyTuple_SET_ITEM(tuple, 0, _PyLong_FromSsize_t(b));
3230   PyTuple_SET_ITEM(tuple, 1, _PyLong_FromSsize_t(c));
3231   if (d) {
3232     Py_INCREF(d);
3233     PyTuple_SET_ITEM(tuple, 2, d);
3234   }
3235   resultobj = wrapper(a, tuple);
3236   result = resultobj ? 0 : -1;
3237   Py_DECREF(tuple);
3238   Py_XDECREF(resultobj);
3239   return result;
3240 }
3241 
3242 #define SWIGPY_SSIZEARGFUNC_CLOSURE(wrapper)				\
3243 SWIGINTERN PyObject *							\
3244 wrapper##_ssizeargfunc_closure(PyObject *a, Py_ssize_t b) {		\
3245   return SwigPyBuiltin_funpack_ssizeargfunc_closure(wrapper, a, b);	\
3246 }
3247 SWIGINTERN PyObject *
SwigPyBuiltin_funpack_ssizeargfunc_closure(SwigPyWrapperFunction wrapper,PyObject * a,Py_ssize_t b)3248 SwigPyBuiltin_funpack_ssizeargfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a, Py_ssize_t b) {
3249   PyObject *tuple, *result;
3250   tuple = PyTuple_New(1);
3251   assert(tuple);
3252   PyTuple_SET_ITEM(tuple, 0, _PyLong_FromSsize_t(b));
3253   result = wrapper(a, tuple);
3254   Py_DECREF(tuple);
3255   return result;
3256 }
3257 
3258 #define SWIGPY_FUNPACK_SSIZEARGFUNC_CLOSURE(wrapper)			\
3259 SWIGINTERN PyObject *							\
3260 wrapper##_ssizeargfunc_closure(PyObject *a, Py_ssize_t b) {		\
3261   return SwigPyBuiltin_ssizeargfunc_closure(wrapper, a, b);		\
3262 }
3263 SWIGINTERN PyObject *
SwigPyBuiltin_ssizeargfunc_closure(SwigPyWrapperFunction wrapper,PyObject * a,Py_ssize_t b)3264 SwigPyBuiltin_ssizeargfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a, Py_ssize_t b) {
3265   PyObject *arg, *result;
3266   arg = _PyLong_FromSsize_t(b);
3267   result = wrapper(a, arg);
3268   Py_DECREF(arg);
3269   return result;
3270 }
3271 
3272 #define SWIGPY_SSIZEOBJARGPROC_CLOSURE(wrapper)					\
3273 SWIGINTERN int									\
3274 wrapper##_ssizeobjargproc_closure(PyObject *a, Py_ssize_t b, PyObject *c) {	\
3275   return SwigPyBuiltin_ssizeobjargproc_closure(wrapper, a, b, c);		\
3276 }
3277 SWIGINTERN int
SwigPyBuiltin_ssizeobjargproc_closure(SwigPyWrapperFunction wrapper,PyObject * a,Py_ssize_t b,PyObject * c)3278 SwigPyBuiltin_ssizeobjargproc_closure(SwigPyWrapperFunction wrapper, PyObject *a, Py_ssize_t b, PyObject *c) {
3279   PyObject *tuple, *resultobj;
3280   int result;
3281   tuple = PyTuple_New(2);
3282   assert(tuple);
3283   PyTuple_SET_ITEM(tuple, 0, _PyLong_FromSsize_t(b));
3284   Py_INCREF(c);
3285   PyTuple_SET_ITEM(tuple, 1, c);
3286   resultobj = wrapper(a, tuple);
3287   result = resultobj ? 0 : -1;
3288   Py_XDECREF(resultobj);
3289   Py_DECREF(tuple);
3290   return result;
3291 }
3292 
3293 #define SWIGPY_OBJOBJPROC_CLOSURE(wrapper)			\
3294 SWIGINTERN int							\
3295 wrapper##_objobjproc_closure(PyObject *a, PyObject *b) {	\
3296   return SwigPyBuiltin_objobjproc_closure(wrapper, a, b);	\
3297 }
3298 SWIGINTERN int
SwigPyBuiltin_objobjproc_closure(SwigPyWrapperFunction wrapper,PyObject * a,PyObject * b)3299 SwigPyBuiltin_objobjproc_closure(SwigPyWrapperFunction wrapper, PyObject *a, PyObject *b) {
3300   int result;
3301   PyObject *pyresult;
3302   PyObject *tuple;
3303   tuple = PyTuple_New(1);
3304   assert(tuple);
3305   Py_INCREF(b);
3306   PyTuple_SET_ITEM(tuple, 0, b);
3307   pyresult = wrapper(a, tuple);
3308   result = pyresult ? (PyObject_IsTrue(pyresult) ? 1 : 0) : -1;
3309   Py_XDECREF(pyresult);
3310   Py_DECREF(tuple);
3311   return result;
3312 }
3313 
3314 #define SWIGPY_FUNPACK_OBJOBJPROC_CLOSURE(wrapper)			\
3315 SWIGINTERN int								\
3316 wrapper##_objobjproc_closure(PyObject *a, PyObject *b) {		\
3317   return SwigPyBuiltin_funpack_objobjproc_closure(wrapper, a, b);	\
3318 }
3319 SWIGINTERN int
SwigPyBuiltin_funpack_objobjproc_closure(SwigPyWrapperFunction wrapper,PyObject * a,PyObject * b)3320 SwigPyBuiltin_funpack_objobjproc_closure(SwigPyWrapperFunction wrapper, PyObject *a, PyObject *b) {
3321   int result;
3322   PyObject *pyresult;
3323   pyresult = wrapper(a, b);
3324   result = pyresult ? (PyObject_IsTrue(pyresult) ? 1 : 0) : -1;
3325   Py_XDECREF(pyresult);
3326   return result;
3327 }
3328 
3329 #define SWIGPY_OBJOBJARGPROC_CLOSURE(wrapper)					\
3330 SWIGINTERN int									\
3331 wrapper##_objobjargproc_closure(PyObject *a, PyObject *b, PyObject *c) {	\
3332   return SwigPyBuiltin_objobjargproc_closure(wrapper, a, b, c);			\
3333 }
3334 SWIGINTERN int
SwigPyBuiltin_objobjargproc_closure(SwigPyWrapperFunction wrapper,PyObject * a,PyObject * b,PyObject * c)3335 SwigPyBuiltin_objobjargproc_closure(SwigPyWrapperFunction wrapper, PyObject *a, PyObject *b, PyObject *c) {
3336   PyObject *tuple, *resultobj;
3337   int result;
3338   tuple = PyTuple_New(c ? 2 : 1);
3339   assert(tuple);
3340   Py_INCREF(b);
3341   PyTuple_SET_ITEM(tuple, 0, b);
3342   if (c) {
3343     Py_INCREF(c);
3344     PyTuple_SET_ITEM(tuple, 1, c);
3345   }
3346   resultobj = wrapper(a, tuple);
3347   result = resultobj ? 0 : -1;
3348   Py_XDECREF(resultobj);
3349   Py_DECREF(tuple);
3350   return result;
3351 }
3352 
3353 #define SWIGPY_REPRFUNC_CLOSURE(wrapper)		\
3354 SWIGINTERN PyObject *					\
3355 wrapper##_reprfunc_closure(PyObject *a) {		\
3356   return SwigPyBuiltin_reprfunc_closure(wrapper, a);	\
3357 }
3358 SWIGINTERN PyObject *
SwigPyBuiltin_reprfunc_closure(SwigPyWrapperFunction wrapper,PyObject * a)3359 SwigPyBuiltin_reprfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) {
3360   return wrapper(a, NULL);
3361 }
3362 
3363 #define SWIGPY_HASHFUNC_CLOSURE(wrapper)		\
3364 SWIGINTERN Py_hash_t					\
3365 wrapper##_hashfunc_closure(PyObject *a) {		\
3366   return SwigPyBuiltin_hashfunc_closure(wrapper, a);	\
3367 }
3368 SWIGINTERN Py_hash_t
SwigPyBuiltin_hashfunc_closure(SwigPyWrapperFunction wrapper,PyObject * a)3369 SwigPyBuiltin_hashfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) {
3370   PyObject *pyresult;
3371   Py_hash_t result;
3372   pyresult = wrapper(a, NULL);
3373   if (!pyresult)
3374     return -1;
3375   result = SWIG_PyNumber_AsPyHash(pyresult);
3376   Py_DECREF(pyresult);
3377   return result;
3378 }
3379 
3380 #define SWIGPY_ITERNEXTFUNC_CLOSURE(wrapper)		\
3381 SWIGINTERN PyObject *					\
3382 wrapper##_iternextfunc_closure(PyObject *a) {		\
3383   return SwigPyBuiltin_iternextfunc_closure(wrapper, a);\
3384 }
3385 SWIGINTERN PyObject *
SwigPyBuiltin_iternextfunc_closure(SwigPyWrapperFunction wrapper,PyObject * a)3386 SwigPyBuiltin_iternextfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) {
3387   return wrapper(a, NULL);
3388 }
3389 
3390 /* End of callback function macros for use in PyTypeObject */
3391 
3392 #ifdef __cplusplus
3393 }
3394 #endif
3395 
3396 
3397 
3398 
3399 #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
3400 
3401 #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
3402 
3403 
3404 
3405 #ifdef __cplusplus
3406 extern "C" {
3407 #endif
3408 
3409 /* Method creation and docstring support functions */
3410 
3411 SWIGINTERN PyMethodDef *SWIG_PythonGetProxyDoc(const char *name);
3412 SWIGINTERN PyObject *SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func);
3413 SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func);
3414 
3415 #ifdef __cplusplus
3416 }
3417 #endif
3418 
3419 
3420 /* -------- TYPES TABLE (BEGIN) -------- */
3421 
3422 #define SWIGTYPE_p_CallbackDetails swig_types[0]
3423 #define SWIGTYPE_p_CameraAbilities swig_types[1]
3424 #define SWIGTYPE_p_CameraCaptureType swig_types[2]
3425 #define SWIGTYPE_p_CameraDriverStatus swig_types[3]
3426 #define SWIGTYPE_p_CameraEventType swig_types[4]
3427 #define SWIGTYPE_p_CameraFileAccessType swig_types[5]
3428 #define SWIGTYPE_p_CameraFileInfoFields swig_types[6]
3429 #define SWIGTYPE_p_CameraFileOperation swig_types[7]
3430 #define SWIGTYPE_p_CameraFilePath swig_types[8]
3431 #define SWIGTYPE_p_CameraFilePermissions swig_types[9]
3432 #define SWIGTYPE_p_CameraFileStatus swig_types[10]
3433 #define SWIGTYPE_p_CameraFileType swig_types[11]
3434 #define SWIGTYPE_p_CameraFolderOperation swig_types[12]
3435 #define SWIGTYPE_p_CameraOperation swig_types[13]
3436 #define SWIGTYPE_p_CameraStorageAccessType swig_types[14]
3437 #define SWIGTYPE_p_CameraStorageFilesystemType swig_types[15]
3438 #define SWIGTYPE_p_CameraStorageInfoFields swig_types[16]
3439 #define SWIGTYPE_p_CameraStorageType swig_types[17]
3440 #define SWIGTYPE_p_CameraText swig_types[18]
3441 #define SWIGTYPE_p_CameraWidgetType swig_types[19]
3442 #define SWIGTYPE_p_GPLogLevel swig_types[20]
3443 #define SWIGTYPE_p_GPPortType swig_types[21]
3444 #define SWIGTYPE_p_GPVersionVerbosity swig_types[22]
3445 #define SWIGTYPE_p_GphotoDeviceType swig_types[23]
3446 #define SWIGTYPE_p_SwigPyObject swig_types[24]
3447 #define SWIGTYPE_p__Camera swig_types[25]
3448 #define SWIGTYPE_p__CameraAbilitiesList swig_types[26]
3449 #define SWIGTYPE_p__CameraFile swig_types[27]
3450 #define SWIGTYPE_p__CameraFileHandler swig_types[28]
3451 #define SWIGTYPE_p__CameraFileInfo swig_types[29]
3452 #define SWIGTYPE_p__CameraFileInfoAudio swig_types[30]
3453 #define SWIGTYPE_p__CameraFileInfoFile swig_types[31]
3454 #define SWIGTYPE_p__CameraFileInfoPreview swig_types[32]
3455 #define SWIGTYPE_p__CameraFilesystem swig_types[33]
3456 #define SWIGTYPE_p__CameraFilesystemFuncs swig_types[34]
3457 #define SWIGTYPE_p__CameraFunctions swig_types[35]
3458 #define SWIGTYPE_p__CameraList swig_types[36]
3459 #define SWIGTYPE_p__CameraPrivateCore swig_types[37]
3460 #define SWIGTYPE_p__CameraPrivateLibrary swig_types[38]
3461 #define SWIGTYPE_p__CameraStorageInformation swig_types[39]
3462 #define SWIGTYPE_p__CameraWidget swig_types[40]
3463 #define SWIGTYPE_p__GPContext swig_types[41]
3464 #define SWIGTYPE_p__GPContextFeedback swig_types[42]
3465 #define SWIGTYPE_p__GPPortInfoList swig_types[43]
3466 #define SWIGTYPE_p_char swig_types[44]
3467 #define SWIGTYPE_p_f_p_struct__GPContext_float_p_q_const__char_p_void__unsigned_int swig_types[45]
3468 #define SWIGTYPE_p_f_p_struct__GPContext_p_q_const__char_p_void___GPContextFeedback swig_types[46]
3469 #define SWIGTYPE_p_f_p_struct__GPContext_p_q_const__char_p_void__void swig_types[47]
3470 #define SWIGTYPE_p_f_p_struct__GPContext_p_void___GPContextFeedback swig_types[48]
3471 #define SWIGTYPE_p_f_p_struct__GPContext_p_void__void swig_types[49]
3472 #define SWIGTYPE_p_f_p_struct__GPContext_unsigned_int_float_p_void__void swig_types[50]
3473 #define SWIGTYPE_p_f_p_struct__GPContext_unsigned_int_p_void__void swig_types[51]
3474 #define SWIGTYPE_p_int swig_types[52]
3475 #define SWIGTYPE_p_long swig_types[53]
3476 #define SWIGTYPE_p_long_long swig_types[54]
3477 #define SWIGTYPE_p_short swig_types[55]
3478 #define SWIGTYPE_p_signed_char swig_types[56]
3479 #define SWIGTYPE_p_unsigned_char swig_types[57]
3480 #define SWIGTYPE_p_unsigned_int swig_types[58]
3481 #define SWIGTYPE_p_unsigned_long_long swig_types[59]
3482 #define SWIGTYPE_p_unsigned_short swig_types[60]
3483 static swig_type_info *swig_types[62];
3484 static swig_module_info swig_module = {swig_types, 61, 0, 0, 0, 0};
3485 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
3486 #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
3487 
3488 /* -------- TYPES TABLE (END) -------- */
3489 
3490 #ifdef SWIG_TypeQuery
3491 # undef SWIG_TypeQuery
3492 #endif
3493 #define SWIG_TypeQuery SWIG_Python_TypeQuery
3494 
3495 /*-----------------------------------------------
3496               @(target):= _context.so
3497   ------------------------------------------------*/
3498 #if PY_VERSION_HEX >= 0x03000000
3499 #  define SWIG_init    PyInit__context
3500 
3501 #else
3502 #  define SWIG_init    init_context
3503 
3504 #endif
3505 #define SWIG_name    "_context"
3506 
3507 #define SWIGVERSION 0x040002
3508 #define SWIG_VERSION SWIGVERSION
3509 
3510 
3511 #define SWIG_as_voidptr(a) (void *)((const void *)(a))
3512 #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a))
3513 
3514 
3515 #include <stddef.h>
3516 
3517 
3518 #include "gphoto2/gphoto2.h"
3519 
3520 
3521 PyObject *PyExc_GPhoto2Error = NULL;
3522 
3523 
3524 typedef void (*RemoveFunc) (GPContext *context, void *func, void *data);
3525 
3526 typedef struct CallbackDetails {
3527     GPContext   *context;
3528     PyObject    *func_1;
3529     PyObject    *func_2;
3530     PyObject    *func_3;
3531     PyObject    *data;
3532     RemoveFunc  remove;
3533 } CallbackDetails;
3534 
3535 // Function to remove progress callbacks, compatible with RemoveFunc
unset_progress_funcs(GPContext * context,GPContextProgressStartFunc start_func,void * data)3536 static void unset_progress_funcs(GPContext *context,
3537                                  GPContextProgressStartFunc start_func,
3538                                  void *data) {
3539     gp_context_set_progress_funcs(context, NULL, NULL, NULL, NULL);
3540 };
3541 
3542 // Destructor
del_CallbackDetails(struct CallbackDetails * this)3543 static int del_CallbackDetails(struct CallbackDetails *this) {
3544     if (this->context)
3545         this->remove(this->context, NULL, NULL);
3546     Py_XDECREF(this->func_1);
3547     Py_XDECREF(this->func_2);
3548     Py_XDECREF(this->func_3);
3549     Py_XDECREF(this->data);
3550     free(this);
3551     return GP_OK;
3552 };
3553 
delete_CallbackDetails(struct CallbackDetails * self)3554 SWIGINTERN void delete_CallbackDetails(struct CallbackDetails *self){
3555     int error = del_CallbackDetails(self);
3556     if (error < 0) /*@SWIG:src/gphoto2/common/macros.i,18,GPHOTO2_ERROR@*/
3557 PyErr_SetObject(PyExc_GPhoto2Error, PyInt_FromLong(error));
3558 /*@SWIG@*/
3559   }
3560 
wrap_idle_func(GPContext * context,void * data)3561 static void wrap_idle_func (GPContext *context, void *data) {
3562     PyGILState_STATE gstate = PyGILState_Ensure();
3563     CallbackDetails *this = data;
3564     PyObject *result = NULL;
3565     PyObject *arglist = NULL;
3566     PyObject *self = NULL;
3567 
3568 
3569     PyObject *py_context = SWIG_NewPointerObj(
3570         SWIG_as_voidptr(context), SWIGTYPE_p__GPContext, 0);
3571 #if PY_VERSION_HEX >= 0x03000000
3572     arglist = Py_BuildValue ("(OO)", py_context, this->data);
3573 #else
3574     arglist = Py_BuildValue ("(OO)", py_context, this->data);
3575 #endif
3576     if (arglist == NULL) {
3577         PyErr_Print();
3578         goto fail;
3579     }
3580     result = PyObject_CallObject(this->func_1, arglist);
3581     Py_DECREF(arglist);
3582     if (result == NULL) {
3583         PyErr_Print();
3584         goto fail;
3585     }
3586 
3587 
3588     Py_DECREF(result);
3589 fail:
3590     PyGILState_Release(gstate);
3591 
3592 
3593 };
3594 
3595 
wrap_error_func(GPContext * context,const char * text,void * data)3596 static void wrap_error_func (GPContext *context, const char *text, void *data) {
3597     PyGILState_STATE gstate = PyGILState_Ensure();
3598     CallbackDetails *this = data;
3599     PyObject *result = NULL;
3600     PyObject *arglist = NULL;
3601     PyObject *self = NULL;
3602 
3603 
3604     PyObject *py_context = SWIG_NewPointerObj(
3605         SWIG_as_voidptr(context), SWIGTYPE_p__GPContext, 0);
3606 #if PY_VERSION_HEX >= 0x03000000
3607     arglist = Py_BuildValue ("(OyO)", py_context, text, this->data);
3608 #else
3609     arglist = Py_BuildValue ("(OsO)", py_context, text, this->data);
3610 #endif
3611     if (arglist == NULL) {
3612         PyErr_Print();
3613         goto fail;
3614     }
3615     result = PyObject_CallObject(this->func_1, arglist);
3616     Py_DECREF(arglist);
3617     if (result == NULL) {
3618         PyErr_Print();
3619         goto fail;
3620     }
3621 
3622 
3623     Py_DECREF(result);
3624 fail:
3625     PyGILState_Release(gstate);
3626 
3627 
3628 };
3629 
3630 
wrap_status_func(GPContext * context,const char * text,void * data)3631 static void wrap_status_func (GPContext *context, const char *text, void *data) {
3632     PyGILState_STATE gstate = PyGILState_Ensure();
3633     CallbackDetails *this = data;
3634     PyObject *result = NULL;
3635     PyObject *arglist = NULL;
3636     PyObject *self = NULL;
3637 
3638 
3639     PyObject *py_context = SWIG_NewPointerObj(
3640         SWIG_as_voidptr(context), SWIGTYPE_p__GPContext, 0);
3641 #if PY_VERSION_HEX >= 0x03000000
3642     arglist = Py_BuildValue ("(OyO)", py_context, text, this->data);
3643 #else
3644     arglist = Py_BuildValue ("(OsO)", py_context, text, this->data);
3645 #endif
3646     if (arglist == NULL) {
3647         PyErr_Print();
3648         goto fail;
3649     }
3650     result = PyObject_CallObject(this->func_1, arglist);
3651     Py_DECREF(arglist);
3652     if (result == NULL) {
3653         PyErr_Print();
3654         goto fail;
3655     }
3656 
3657 
3658     Py_DECREF(result);
3659 fail:
3660     PyGILState_Release(gstate);
3661 
3662 
3663 };
3664 
3665 
wrap_message_func(GPContext * context,const char * text,void * data)3666 static void wrap_message_func (GPContext *context, const char *text, void *data) {
3667     PyGILState_STATE gstate = PyGILState_Ensure();
3668     CallbackDetails *this = data;
3669     PyObject *result = NULL;
3670     PyObject *arglist = NULL;
3671     PyObject *self = NULL;
3672 
3673 
3674     PyObject *py_context = SWIG_NewPointerObj(
3675         SWIG_as_voidptr(context), SWIGTYPE_p__GPContext, 0);
3676 #if PY_VERSION_HEX >= 0x03000000
3677     arglist = Py_BuildValue ("(OyO)", py_context, text, this->data);
3678 #else
3679     arglist = Py_BuildValue ("(OsO)", py_context, text, this->data);
3680 #endif
3681     if (arglist == NULL) {
3682         PyErr_Print();
3683         goto fail;
3684     }
3685     result = PyObject_CallObject(this->func_1, arglist);
3686     Py_DECREF(arglist);
3687     if (result == NULL) {
3688         PyErr_Print();
3689         goto fail;
3690     }
3691 
3692 
3693     Py_DECREF(result);
3694 fail:
3695     PyGILState_Release(gstate);
3696 
3697 
3698 };
3699 
3700 
wrap_question_func(GPContext * context,const char * text,void * data)3701 static GPContextFeedback wrap_question_func (GPContext *context, const char *text, void *data) {
3702     PyGILState_STATE gstate = PyGILState_Ensure();
3703     CallbackDetails *this = data;
3704     PyObject *result = NULL;
3705     PyObject *arglist = NULL;
3706     PyObject *self = NULL;
3707 
3708 
3709     GPContextFeedback c_result = GP_CONTEXT_FEEDBACK_OK;
3710 
3711 
3712     PyObject *py_context = SWIG_NewPointerObj(
3713         SWIG_as_voidptr(context), SWIGTYPE_p__GPContext, 0);
3714 #if PY_VERSION_HEX >= 0x03000000
3715     arglist = Py_BuildValue ("(OyO)", py_context, text, this->data);
3716 #else
3717     arglist = Py_BuildValue ("(OsO)", py_context, text, this->data);
3718 #endif
3719     if (arglist == NULL) {
3720         PyErr_Print();
3721         goto fail;
3722     }
3723     result = PyObject_CallObject(this->func_1, arglist);
3724     Py_DECREF(arglist);
3725     if (result == NULL) {
3726         PyErr_Print();
3727         goto fail;
3728     }
3729 
3730 
3731     c_result = PyInt_AsLong(result);
3732 
3733 
3734     Py_DECREF(result);
3735 fail:
3736     PyGILState_Release(gstate);
3737 
3738 
3739     return c_result;
3740 
3741 
3742 };
3743 
3744 
wrap_cancel_func(GPContext * context,void * data)3745 static GPContextFeedback wrap_cancel_func (GPContext *context, void *data) {
3746     PyGILState_STATE gstate = PyGILState_Ensure();
3747     CallbackDetails *this = data;
3748     PyObject *result = NULL;
3749     PyObject *arglist = NULL;
3750     PyObject *self = NULL;
3751 
3752 
3753     GPContextFeedback c_result = GP_CONTEXT_FEEDBACK_OK;
3754 
3755 
3756     PyObject *py_context = SWIG_NewPointerObj(
3757         SWIG_as_voidptr(context), SWIGTYPE_p__GPContext, 0);
3758 #if PY_VERSION_HEX >= 0x03000000
3759     arglist = Py_BuildValue ("(OO)", py_context, this->data);
3760 #else
3761     arglist = Py_BuildValue ("(OO)", py_context, this->data);
3762 #endif
3763     if (arglist == NULL) {
3764         PyErr_Print();
3765         goto fail;
3766     }
3767     result = PyObject_CallObject(this->func_1, arglist);
3768     Py_DECREF(arglist);
3769     if (result == NULL) {
3770         PyErr_Print();
3771         goto fail;
3772     }
3773 
3774 
3775     c_result = PyInt_AsLong(result);
3776 
3777 
3778     Py_DECREF(result);
3779 fail:
3780     PyGILState_Release(gstate);
3781 
3782 
3783     return c_result;
3784 
3785 
3786 };
3787 
3788 
py_progress_start(GPContext * context,float target,const char * text,void * data)3789 static int py_progress_start (GPContext *context, float target, const char *text, void *data) {
3790     PyGILState_STATE gstate = PyGILState_Ensure();
3791     CallbackDetails *this = data;
3792     PyObject *result = NULL;
3793     PyObject *arglist = NULL;
3794     PyObject *self = NULL;
3795 
3796 
3797     int c_result = 0;
3798 
3799 
3800     PyObject *py_context = SWIG_NewPointerObj(
3801         SWIG_as_voidptr(context), SWIGTYPE_p__GPContext, 0);
3802 #if PY_VERSION_HEX >= 0x03000000
3803     arglist = Py_BuildValue ("(OfyO)", py_context, target, text, this->data);
3804 #else
3805     arglist = Py_BuildValue ("(OfsO)", py_context, target, text, this->data);
3806 #endif
3807     if (arglist == NULL) {
3808         PyErr_Print();
3809         goto fail;
3810     }
3811     result = PyObject_CallObject(this->func_1, arglist);
3812     Py_DECREF(arglist);
3813     if (result == NULL) {
3814         PyErr_Print();
3815         goto fail;
3816     }
3817 
3818 
3819     c_result = PyInt_AsLong(result);
3820 
3821 
3822     Py_DECREF(result);
3823 fail:
3824     PyGILState_Release(gstate);
3825 
3826 
3827     return c_result;
3828 
3829 
3830 };
3831 
3832 
py_progress_update(GPContext * context,unsigned int id,float current,void * data)3833 static void py_progress_update (GPContext *context, unsigned int id, float current, void *data) {
3834     PyGILState_STATE gstate = PyGILState_Ensure();
3835     CallbackDetails *this = data;
3836     PyObject *result = NULL;
3837     PyObject *arglist = NULL;
3838     PyObject *self = NULL;
3839 
3840 
3841     PyObject *py_context = SWIG_NewPointerObj(
3842         SWIG_as_voidptr(context), SWIGTYPE_p__GPContext, 0);
3843 #if PY_VERSION_HEX >= 0x03000000
3844     arglist = Py_BuildValue ("(OifO)", py_context, id, current, this->data);
3845 #else
3846     arglist = Py_BuildValue ("(OifO)", py_context, id, current, this->data);
3847 #endif
3848     if (arglist == NULL) {
3849         PyErr_Print();
3850         goto fail;
3851     }
3852     result = PyObject_CallObject(this->func_2, arglist);
3853     Py_DECREF(arglist);
3854     if (result == NULL) {
3855         PyErr_Print();
3856         goto fail;
3857     }
3858 
3859 
3860     Py_DECREF(result);
3861 fail:
3862     PyGILState_Release(gstate);
3863 
3864 
3865 };
3866 
3867 
py_progress_stop(GPContext * context,unsigned int id,void * data)3868 static void py_progress_stop (GPContext *context, unsigned int id, void *data) {
3869     PyGILState_STATE gstate = PyGILState_Ensure();
3870     CallbackDetails *this = data;
3871     PyObject *result = NULL;
3872     PyObject *arglist = NULL;
3873     PyObject *self = NULL;
3874 
3875 
3876     PyObject *py_context = SWIG_NewPointerObj(
3877         SWIG_as_voidptr(context), SWIGTYPE_p__GPContext, 0);
3878 #if PY_VERSION_HEX >= 0x03000000
3879     arglist = Py_BuildValue ("(OiO)", py_context, id, this->data);
3880 #else
3881     arglist = Py_BuildValue ("(OiO)", py_context, id, this->data);
3882 #endif
3883     if (arglist == NULL) {
3884         PyErr_Print();
3885         goto fail;
3886     }
3887     result = PyObject_CallObject(this->func_3, arglist);
3888     Py_DECREF(arglist);
3889     if (result == NULL) {
3890         PyErr_Print();
3891         goto fail;
3892     }
3893 
3894 
3895     Py_DECREF(result);
3896 fail:
3897     PyGILState_Release(gstate);
3898 
3899 
3900 };
3901 
_GPContext_camera_autodetect(struct _GPContext * self,CameraList * list)3902 SWIGINTERN void _GPContext_camera_autodetect(struct _GPContext *self,CameraList *list){
3903     int error = gp_camera_autodetect(list, self);
3904     if (error < 0) /*@SWIG:src/gphoto2/common/macros.i,18,GPHOTO2_ERROR@*/
3905 PyErr_SetObject(PyExc_GPhoto2Error, PyInt_FromLong(error));
3906 /*@SWIG@*/
3907   }
_GPContext_set_idle_func(struct _GPContext * self,GPContextIdleFunc func,void * data)3908 SWIGINTERN void _GPContext_set_idle_func(struct _GPContext *self,GPContextIdleFunc func,void *data){
3909     gp_context_set_idle_func (self, func, data);
3910   }
_GPContext_set_error_func(struct _GPContext * self,GPContextErrorFunc func,void * data)3911 SWIGINTERN void _GPContext_set_error_func(struct _GPContext *self,GPContextErrorFunc func,void *data){
3912     gp_context_set_error_func (self, func, data);
3913   }
_GPContext_set_message_func(struct _GPContext * self,GPContextMessageFunc func,void * data)3914 SWIGINTERN void _GPContext_set_message_func(struct _GPContext *self,GPContextMessageFunc func,void *data){
3915     gp_context_set_message_func (self, func, data);
3916   }
_GPContext_set_question_func(struct _GPContext * self,GPContextQuestionFunc func,void * data)3917 SWIGINTERN void _GPContext_set_question_func(struct _GPContext *self,GPContextQuestionFunc func,void *data){
3918     gp_context_set_question_func (self, func, data);
3919   }
_GPContext_set_cancel_func(struct _GPContext * self,GPContextCancelFunc func,void * data)3920 SWIGINTERN void _GPContext_set_cancel_func(struct _GPContext *self,GPContextCancelFunc func,void *data){
3921     gp_context_set_cancel_func (self, func, data);
3922   }
_GPContext_set_progress_funcs(struct _GPContext * self,GPContextProgressStartFunc start_func,GPContextProgressUpdateFunc update_func,GPContextProgressStopFunc stop_func,void * data)3923 SWIGINTERN void _GPContext_set_progress_funcs(struct _GPContext *self,GPContextProgressStartFunc start_func,GPContextProgressUpdateFunc update_func,GPContextProgressStopFunc stop_func,void *data){
3924     gp_context_set_progress_funcs (self, start_func, update_func, stop_func, data);
3925   }
_GPContext_set_status_func(struct _GPContext * self,GPContextStatusFunc func,void * data)3926 SWIGINTERN void _GPContext_set_status_func(struct _GPContext *self,GPContextStatusFunc func,void *data){
3927     gp_context_set_status_func (self, func, data);
3928   }
new__GPContext(void)3929 SWIGINTERN struct _GPContext *new__GPContext(void){
3930     return gp_context_new();
3931   }
delete__GPContext(struct _GPContext * self)3932 SWIGINTERN void delete__GPContext(struct _GPContext *self){
3933     gp_context_unref(self);
3934   }
3935 
3936 SWIGINTERNINLINE PyObject*
SWIG_From_int(int value)3937   SWIG_From_int  (int value)
3938 {
3939   return PyInt_FromLong((long) value);
3940 }
3941 
3942 #ifdef __cplusplus
3943 extern "C" {
3944 #endif
_wrap_CallbackDetails_func_1_set(PyObject * self,PyObject * args)3945 SWIGINTERN PyObject *_wrap_CallbackDetails_func_1_set(PyObject *self, PyObject *args) {
3946   PyObject *resultobj = 0;
3947   struct CallbackDetails *arg1 = (struct CallbackDetails *) 0 ;
3948   PyObject *arg2 = (PyObject *) 0 ;
3949   void *argp1 = 0 ;
3950   int res1 = 0 ;
3951   PyObject * obj1 = 0 ;
3952 
3953   if (!PyArg_UnpackTuple(args, "CallbackDetails_func_1_set", 1, 1, &obj1)) SWIG_fail;
3954   res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CallbackDetails, 0 |  0 );
3955   if (!SWIG_IsOK(res1)) {
3956     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CallbackDetails_func_1_set" "', argument " "1"" of type '" "struct CallbackDetails *""'");
3957   }
3958   arg1 = (struct CallbackDetails *)(argp1);
3959   arg2 = obj1;
3960   if (arg1) (arg1)->func_1 = arg2;
3961   resultobj = SWIG_Py_Void();
3962   return resultobj;
3963 fail:
3964   return NULL;
3965 }
3966 
3967 
_wrap_CallbackDetails_func_1_get(PyObject * self,PyObject * args)3968 SWIGINTERN PyObject *_wrap_CallbackDetails_func_1_get(PyObject *self, PyObject *args) {
3969   PyObject *resultobj = 0;
3970   struct CallbackDetails *arg1 = (struct CallbackDetails *) 0 ;
3971   void *argp1 = 0 ;
3972   int res1 = 0 ;
3973   PyObject *result = 0 ;
3974 
3975   if (args && PyTuple_Check(args) && PyTuple_GET_SIZE(args) > 0) SWIG_exception_fail(SWIG_TypeError, "CallbackDetails_func_1_get takes no arguments");
3976   res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CallbackDetails, 0 |  0 );
3977   if (!SWIG_IsOK(res1)) {
3978     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CallbackDetails_func_1_get" "', argument " "1"" of type '" "struct CallbackDetails *""'");
3979   }
3980   arg1 = (struct CallbackDetails *)(argp1);
3981   result = (PyObject *) ((arg1)->func_1);
3982   resultobj = result;
3983   return resultobj;
3984 fail:
3985   return NULL;
3986 }
3987 
3988 
_wrap_CallbackDetails_func_2_set(PyObject * self,PyObject * args)3989 SWIGINTERN PyObject *_wrap_CallbackDetails_func_2_set(PyObject *self, PyObject *args) {
3990   PyObject *resultobj = 0;
3991   struct CallbackDetails *arg1 = (struct CallbackDetails *) 0 ;
3992   PyObject *arg2 = (PyObject *) 0 ;
3993   void *argp1 = 0 ;
3994   int res1 = 0 ;
3995   PyObject * obj1 = 0 ;
3996 
3997   if (!PyArg_UnpackTuple(args, "CallbackDetails_func_2_set", 1, 1, &obj1)) SWIG_fail;
3998   res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CallbackDetails, 0 |  0 );
3999   if (!SWIG_IsOK(res1)) {
4000     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CallbackDetails_func_2_set" "', argument " "1"" of type '" "struct CallbackDetails *""'");
4001   }
4002   arg1 = (struct CallbackDetails *)(argp1);
4003   arg2 = obj1;
4004   if (arg1) (arg1)->func_2 = arg2;
4005   resultobj = SWIG_Py_Void();
4006   return resultobj;
4007 fail:
4008   return NULL;
4009 }
4010 
4011 
_wrap_CallbackDetails_func_2_get(PyObject * self,PyObject * args)4012 SWIGINTERN PyObject *_wrap_CallbackDetails_func_2_get(PyObject *self, PyObject *args) {
4013   PyObject *resultobj = 0;
4014   struct CallbackDetails *arg1 = (struct CallbackDetails *) 0 ;
4015   void *argp1 = 0 ;
4016   int res1 = 0 ;
4017   PyObject *result = 0 ;
4018 
4019   if (args && PyTuple_Check(args) && PyTuple_GET_SIZE(args) > 0) SWIG_exception_fail(SWIG_TypeError, "CallbackDetails_func_2_get takes no arguments");
4020   res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CallbackDetails, 0 |  0 );
4021   if (!SWIG_IsOK(res1)) {
4022     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CallbackDetails_func_2_get" "', argument " "1"" of type '" "struct CallbackDetails *""'");
4023   }
4024   arg1 = (struct CallbackDetails *)(argp1);
4025   result = (PyObject *) ((arg1)->func_2);
4026   resultobj = result;
4027   return resultobj;
4028 fail:
4029   return NULL;
4030 }
4031 
4032 
_wrap_CallbackDetails_func_3_set(PyObject * self,PyObject * args)4033 SWIGINTERN PyObject *_wrap_CallbackDetails_func_3_set(PyObject *self, PyObject *args) {
4034   PyObject *resultobj = 0;
4035   struct CallbackDetails *arg1 = (struct CallbackDetails *) 0 ;
4036   PyObject *arg2 = (PyObject *) 0 ;
4037   void *argp1 = 0 ;
4038   int res1 = 0 ;
4039   PyObject * obj1 = 0 ;
4040 
4041   if (!PyArg_UnpackTuple(args, "CallbackDetails_func_3_set", 1, 1, &obj1)) SWIG_fail;
4042   res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CallbackDetails, 0 |  0 );
4043   if (!SWIG_IsOK(res1)) {
4044     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CallbackDetails_func_3_set" "', argument " "1"" of type '" "struct CallbackDetails *""'");
4045   }
4046   arg1 = (struct CallbackDetails *)(argp1);
4047   arg2 = obj1;
4048   if (arg1) (arg1)->func_3 = arg2;
4049   resultobj = SWIG_Py_Void();
4050   return resultobj;
4051 fail:
4052   return NULL;
4053 }
4054 
4055 
_wrap_CallbackDetails_func_3_get(PyObject * self,PyObject * args)4056 SWIGINTERN PyObject *_wrap_CallbackDetails_func_3_get(PyObject *self, PyObject *args) {
4057   PyObject *resultobj = 0;
4058   struct CallbackDetails *arg1 = (struct CallbackDetails *) 0 ;
4059   void *argp1 = 0 ;
4060   int res1 = 0 ;
4061   PyObject *result = 0 ;
4062 
4063   if (args && PyTuple_Check(args) && PyTuple_GET_SIZE(args) > 0) SWIG_exception_fail(SWIG_TypeError, "CallbackDetails_func_3_get takes no arguments");
4064   res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CallbackDetails, 0 |  0 );
4065   if (!SWIG_IsOK(res1)) {
4066     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CallbackDetails_func_3_get" "', argument " "1"" of type '" "struct CallbackDetails *""'");
4067   }
4068   arg1 = (struct CallbackDetails *)(argp1);
4069   result = (PyObject *) ((arg1)->func_3);
4070   resultobj = result;
4071   return resultobj;
4072 fail:
4073   return NULL;
4074 }
4075 
4076 
_wrap_delete_CallbackDetails(PyObject * self,PyObject * args)4077 SWIGINTERN PyObject *_wrap_delete_CallbackDetails(PyObject *self, PyObject *args) {
4078   PyObject *resultobj = 0;
4079   struct CallbackDetails *arg1 = (struct CallbackDetails *) 0 ;
4080   void *argp1 = 0 ;
4081   int res1 = 0 ;
4082 
4083   if (args && PyTuple_Check(args) && PyTuple_GET_SIZE(args) > 0) SWIG_exception_fail(SWIG_TypeError, "delete_CallbackDetails takes no arguments");
4084   res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CallbackDetails, SWIG_POINTER_DISOWN |  0 );
4085   if (!SWIG_IsOK(res1)) {
4086     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CallbackDetails" "', argument " "1"" of type '" "struct CallbackDetails *""'");
4087   }
4088   arg1 = (struct CallbackDetails *)(argp1);
4089   {
4090     delete_CallbackDetails(arg1);
4091     if (PyErr_Occurred() != NULL) SWIG_fail;
4092   }
4093   resultobj = SWIG_Py_Void();
4094   return resultobj;
4095 fail:
4096   return NULL;
4097 }
4098 
4099 
SWIGPY_DESTRUCTOR_CLOSURE(_wrap_delete_CallbackDetails)4100 SWIGPY_DESTRUCTOR_CLOSURE(_wrap_delete_CallbackDetails) /* defines _wrap_delete_CallbackDetails_destructor_closure */
4101 
4102 SWIGINTERN PyObject *_wrap_unset_progress_funcs(PyObject *self, PyObject *args) {
4103   PyObject *resultobj = 0;
4104   GPContext *arg1 = (GPContext *) 0 ;
4105   GPContextProgressStartFunc arg2 = (GPContextProgressStartFunc) 0 ;
4106   void *arg3 = (void *) 0 ;
4107   void *argp1 = 0 ;
4108   int res1 = 0 ;
4109   int res3 ;
4110   PyObject * obj0 = 0 ;
4111   PyObject * obj1 = 0 ;
4112   PyObject * obj2 = 0 ;
4113 
4114   if (!PyArg_UnpackTuple(args, "unset_progress_funcs", 3, 3, &obj0, &obj1, &obj2)) SWIG_fail;
4115   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p__GPContext, 0 |  0 );
4116   if (!SWIG_IsOK(res1)) {
4117     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "unset_progress_funcs" "', argument " "1"" of type '" "GPContext *""'");
4118   }
4119   arg1 = (GPContext *)(argp1);
4120   {
4121     int res = SWIG_ConvertFunctionPtr(obj1, (void**)(&arg2), SWIGTYPE_p_f_p_struct__GPContext_float_p_q_const__char_p_void__unsigned_int);
4122     if (!SWIG_IsOK(res)) {
4123       SWIG_exception_fail(SWIG_ArgError(res), "in method '" "unset_progress_funcs" "', argument " "2"" of type '" "GPContextProgressStartFunc""'");
4124     }
4125   }
4126   res3 = SWIG_ConvertPtr(obj2,SWIG_as_voidptrptr(&arg3), 0, 0);
4127   if (!SWIG_IsOK(res3)) {
4128     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "unset_progress_funcs" "', argument " "3"" of type '" "void *""'");
4129   }
4130   unset_progress_funcs(arg1,arg2,arg3);
4131   resultobj = SWIG_Py_Void();
4132   return resultobj;
4133 fail:
4134   return NULL;
4135 }
4136 
4137 
_wrap_Context_camera_autodetect(PyObject * self,PyObject * args)4138 SWIGINTERN PyObject *_wrap_Context_camera_autodetect(PyObject *self, PyObject *args) {
4139   PyObject *resultobj = 0;
4140   struct _GPContext *arg1 = (struct _GPContext *) 0 ;
4141   CameraList *arg2 = (CameraList *) 0 ;
4142   void *argp1 = 0 ;
4143   int res1 = 0 ;
4144 
4145   {
4146     int error = gp_list_new(&arg2);
4147     if (error < 0) {
4148       arg2 = NULL;
4149       /*@SWIG:src/gphoto2/common/macros.i,18,GPHOTO2_ERROR@*/
4150       PyErr_SetObject(PyExc_GPhoto2Error, PyInt_FromLong(error));
4151       /*@SWIG@*/
4152       SWIG_fail;
4153     }
4154   }
4155   if (args && PyTuple_Check(args) && PyTuple_GET_SIZE(args) > 0) SWIG_exception_fail(SWIG_TypeError, "Context_camera_autodetect takes no arguments");
4156   res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p__GPContext, 0 |  0 );
4157   if (!SWIG_IsOK(res1)) {
4158     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Context_camera_autodetect" "', argument " "1"" of type '" "struct _GPContext *""'");
4159   }
4160   arg1 = (struct _GPContext *)(argp1);
4161   {
4162     if (PyErr_WarnEx(PyExc_DeprecationWarning,
4163         "Camera.autodetect replaces Context().camera_autodetect", 1) < 0) SWIG_fail;
4164     _GPContext_camera_autodetect(arg1,arg2);
4165     if (PyErr_Occurred() != NULL) SWIG_fail;
4166   }
4167   resultobj = SWIG_Py_Void();
4168   {
4169     resultobj = SWIG_Python_AppendOutput(
4170       resultobj, SWIG_NewPointerObj(arg2, SWIGTYPE_p__CameraList, SWIG_POINTER_OWN));
4171     arg2 = NULL;
4172   }
4173   {
4174     if (arg2 != NULL) {
4175       gp_list_unref(arg2);
4176     }
4177   }
4178   return resultobj;
4179 fail:
4180   {
4181     if (arg2 != NULL) {
4182       gp_list_unref(arg2);
4183     }
4184   }
4185   return NULL;
4186 }
4187 
4188 
_wrap_Context_set_idle_func(PyObject * self,PyObject * args)4189 SWIGINTERN PyObject *_wrap_Context_set_idle_func(PyObject *self, PyObject *args) {
4190   PyObject *resultobj = 0;
4191   struct _GPContext *arg1 = (struct _GPContext *) 0 ;
4192   GPContextIdleFunc arg2 = (GPContextIdleFunc) 0 ;
4193   void *arg3 = (void *) 0 ;
4194   CallbackDetails *_global_callbacks ;
4195   void *argp1 = 0 ;
4196   int res1 = 0 ;
4197   PyObject * obj1 = 0 ;
4198   PyObject * obj2 = 0 ;
4199 
4200   {
4201     _global_callbacks = malloc(sizeof(CallbackDetails));
4202     if (!_global_callbacks) {
4203       PyErr_SetNone(PyExc_MemoryError);
4204       SWIG_fail;
4205     }
4206     _global_callbacks->context = NULL;
4207     _global_callbacks->func_1 = NULL;
4208     _global_callbacks->func_2 = NULL;
4209     _global_callbacks->func_3 = NULL;
4210     _global_callbacks->data = NULL;
4211     _global_callbacks->remove = (RemoveFunc) gp_context_set_idle_func;
4212   }
4213   if (!PyArg_UnpackTuple(args, "Context_set_idle_func", 2, 2, &obj1, &obj2)) SWIG_fail;
4214   res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p__GPContext, 0 |  0 );
4215   if (!SWIG_IsOK(res1)) {
4216     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Context_set_idle_func" "', argument " "1"" of type '" "struct _GPContext *""'");
4217   }
4218   arg1 = (struct _GPContext *)(argp1);
4219   {
4220     if (!PyCallable_Check(obj1)) {
4221       SWIG_exception_fail(SWIG_TypeError, "in method '" "Context_set_idle_func" "', argument " "2" " is not callable");
4222     }
4223     _global_callbacks->func_1 = obj1;
4224     Py_INCREF(_global_callbacks->func_1);
4225     arg2 = (GPContextIdleFunc) wrap_idle_func;
4226   }
4227   {
4228     _global_callbacks->data = obj2;
4229     Py_INCREF(_global_callbacks->data);
4230     arg3 = _global_callbacks;
4231   }
4232   _GPContext_set_idle_func(arg1,arg2,arg3);
4233   resultobj = SWIG_Py_Void();
4234   {
4235     resultobj = SWIG_Python_AppendOutput(resultobj,
4236       SWIG_NewPointerObj(_global_callbacks, SWIGTYPE_p_CallbackDetails, SWIG_POINTER_OWN));
4237     _global_callbacks = NULL;
4238   }
4239   {
4240     if (_global_callbacks)
4241     del_CallbackDetails(_global_callbacks);
4242   }
4243   return resultobj;
4244 fail:
4245   {
4246     if (_global_callbacks)
4247     del_CallbackDetails(_global_callbacks);
4248   }
4249   return NULL;
4250 }
4251 
4252 
_wrap_Context_set_error_func(PyObject * self,PyObject * args)4253 SWIGINTERN PyObject *_wrap_Context_set_error_func(PyObject *self, PyObject *args) {
4254   PyObject *resultobj = 0;
4255   struct _GPContext *arg1 = (struct _GPContext *) 0 ;
4256   GPContextErrorFunc arg2 = (GPContextErrorFunc) 0 ;
4257   void *arg3 = (void *) 0 ;
4258   CallbackDetails *_global_callbacks ;
4259   void *argp1 = 0 ;
4260   int res1 = 0 ;
4261   PyObject * obj1 = 0 ;
4262   PyObject * obj2 = 0 ;
4263 
4264   {
4265     _global_callbacks = malloc(sizeof(CallbackDetails));
4266     if (!_global_callbacks) {
4267       PyErr_SetNone(PyExc_MemoryError);
4268       SWIG_fail;
4269     }
4270     _global_callbacks->context = NULL;
4271     _global_callbacks->func_1 = NULL;
4272     _global_callbacks->func_2 = NULL;
4273     _global_callbacks->func_3 = NULL;
4274     _global_callbacks->data = NULL;
4275     _global_callbacks->remove = (RemoveFunc) gp_context_set_error_func;
4276   }
4277   if (!PyArg_UnpackTuple(args, "Context_set_error_func", 2, 2, &obj1, &obj2)) SWIG_fail;
4278   res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p__GPContext, 0 |  0 );
4279   if (!SWIG_IsOK(res1)) {
4280     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Context_set_error_func" "', argument " "1"" of type '" "struct _GPContext *""'");
4281   }
4282   arg1 = (struct _GPContext *)(argp1);
4283   {
4284     if (!PyCallable_Check(obj1)) {
4285       SWIG_exception_fail(SWIG_TypeError, "in method '" "Context_set_error_func" "', argument " "2" " is not callable");
4286     }
4287     _global_callbacks->func_1 = obj1;
4288     Py_INCREF(_global_callbacks->func_1);
4289     arg2 = (GPContextErrorFunc) wrap_error_func;
4290   }
4291   {
4292     _global_callbacks->data = obj2;
4293     Py_INCREF(_global_callbacks->data);
4294     arg3 = _global_callbacks;
4295   }
4296   _GPContext_set_error_func(arg1,arg2,arg3);
4297   resultobj = SWIG_Py_Void();
4298   {
4299     resultobj = SWIG_Python_AppendOutput(resultobj,
4300       SWIG_NewPointerObj(_global_callbacks, SWIGTYPE_p_CallbackDetails, SWIG_POINTER_OWN));
4301     _global_callbacks = NULL;
4302   }
4303   {
4304     if (_global_callbacks)
4305     del_CallbackDetails(_global_callbacks);
4306   }
4307   return resultobj;
4308 fail:
4309   {
4310     if (_global_callbacks)
4311     del_CallbackDetails(_global_callbacks);
4312   }
4313   return NULL;
4314 }
4315 
4316 
_wrap_Context_set_message_func(PyObject * self,PyObject * args)4317 SWIGINTERN PyObject *_wrap_Context_set_message_func(PyObject *self, PyObject *args) {
4318   PyObject *resultobj = 0;
4319   struct _GPContext *arg1 = (struct _GPContext *) 0 ;
4320   GPContextMessageFunc arg2 = (GPContextMessageFunc) 0 ;
4321   void *arg3 = (void *) 0 ;
4322   CallbackDetails *_global_callbacks ;
4323   void *argp1 = 0 ;
4324   int res1 = 0 ;
4325   PyObject * obj1 = 0 ;
4326   PyObject * obj2 = 0 ;
4327 
4328   {
4329     _global_callbacks = malloc(sizeof(CallbackDetails));
4330     if (!_global_callbacks) {
4331       PyErr_SetNone(PyExc_MemoryError);
4332       SWIG_fail;
4333     }
4334     _global_callbacks->context = NULL;
4335     _global_callbacks->func_1 = NULL;
4336     _global_callbacks->func_2 = NULL;
4337     _global_callbacks->func_3 = NULL;
4338     _global_callbacks->data = NULL;
4339     _global_callbacks->remove = (RemoveFunc) gp_context_set_message_func;
4340   }
4341   if (!PyArg_UnpackTuple(args, "Context_set_message_func", 2, 2, &obj1, &obj2)) SWIG_fail;
4342   res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p__GPContext, 0 |  0 );
4343   if (!SWIG_IsOK(res1)) {
4344     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Context_set_message_func" "', argument " "1"" of type '" "struct _GPContext *""'");
4345   }
4346   arg1 = (struct _GPContext *)(argp1);
4347   {
4348     if (!PyCallable_Check(obj1)) {
4349       SWIG_exception_fail(SWIG_TypeError, "in method '" "Context_set_message_func" "', argument " "2" " is not callable");
4350     }
4351     _global_callbacks->func_1 = obj1;
4352     Py_INCREF(_global_callbacks->func_1);
4353     arg2 = (GPContextMessageFunc) wrap_message_func;
4354   }
4355   {
4356     _global_callbacks->data = obj2;
4357     Py_INCREF(_global_callbacks->data);
4358     arg3 = _global_callbacks;
4359   }
4360   _GPContext_set_message_func(arg1,arg2,arg3);
4361   resultobj = SWIG_Py_Void();
4362   {
4363     resultobj = SWIG_Python_AppendOutput(resultobj,
4364       SWIG_NewPointerObj(_global_callbacks, SWIGTYPE_p_CallbackDetails, SWIG_POINTER_OWN));
4365     _global_callbacks = NULL;
4366   }
4367   {
4368     if (_global_callbacks)
4369     del_CallbackDetails(_global_callbacks);
4370   }
4371   return resultobj;
4372 fail:
4373   {
4374     if (_global_callbacks)
4375     del_CallbackDetails(_global_callbacks);
4376   }
4377   return NULL;
4378 }
4379 
4380 
_wrap_Context_set_question_func(PyObject * self,PyObject * args)4381 SWIGINTERN PyObject *_wrap_Context_set_question_func(PyObject *self, PyObject *args) {
4382   PyObject *resultobj = 0;
4383   struct _GPContext *arg1 = (struct _GPContext *) 0 ;
4384   GPContextQuestionFunc arg2 = (GPContextQuestionFunc) 0 ;
4385   void *arg3 = (void *) 0 ;
4386   CallbackDetails *_global_callbacks ;
4387   void *argp1 = 0 ;
4388   int res1 = 0 ;
4389   PyObject * obj1 = 0 ;
4390   PyObject * obj2 = 0 ;
4391 
4392   {
4393     _global_callbacks = malloc(sizeof(CallbackDetails));
4394     if (!_global_callbacks) {
4395       PyErr_SetNone(PyExc_MemoryError);
4396       SWIG_fail;
4397     }
4398     _global_callbacks->context = NULL;
4399     _global_callbacks->func_1 = NULL;
4400     _global_callbacks->func_2 = NULL;
4401     _global_callbacks->func_3 = NULL;
4402     _global_callbacks->data = NULL;
4403     _global_callbacks->remove = (RemoveFunc) gp_context_set_question_func;
4404   }
4405   if (!PyArg_UnpackTuple(args, "Context_set_question_func", 2, 2, &obj1, &obj2)) SWIG_fail;
4406   res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p__GPContext, 0 |  0 );
4407   if (!SWIG_IsOK(res1)) {
4408     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Context_set_question_func" "', argument " "1"" of type '" "struct _GPContext *""'");
4409   }
4410   arg1 = (struct _GPContext *)(argp1);
4411   {
4412     if (!PyCallable_Check(obj1)) {
4413       SWIG_exception_fail(SWIG_TypeError, "in method '" "Context_set_question_func" "', argument " "2" " is not callable");
4414     }
4415     _global_callbacks->func_1 = obj1;
4416     Py_INCREF(_global_callbacks->func_1);
4417     arg2 = (GPContextQuestionFunc) wrap_question_func;
4418   }
4419   {
4420     _global_callbacks->data = obj2;
4421     Py_INCREF(_global_callbacks->data);
4422     arg3 = _global_callbacks;
4423   }
4424   _GPContext_set_question_func(arg1,arg2,arg3);
4425   resultobj = SWIG_Py_Void();
4426   {
4427     resultobj = SWIG_Python_AppendOutput(resultobj,
4428       SWIG_NewPointerObj(_global_callbacks, SWIGTYPE_p_CallbackDetails, SWIG_POINTER_OWN));
4429     _global_callbacks = NULL;
4430   }
4431   {
4432     if (_global_callbacks)
4433     del_CallbackDetails(_global_callbacks);
4434   }
4435   return resultobj;
4436 fail:
4437   {
4438     if (_global_callbacks)
4439     del_CallbackDetails(_global_callbacks);
4440   }
4441   return NULL;
4442 }
4443 
4444 
_wrap_Context_set_cancel_func(PyObject * self,PyObject * args)4445 SWIGINTERN PyObject *_wrap_Context_set_cancel_func(PyObject *self, PyObject *args) {
4446   PyObject *resultobj = 0;
4447   struct _GPContext *arg1 = (struct _GPContext *) 0 ;
4448   GPContextCancelFunc arg2 = (GPContextCancelFunc) 0 ;
4449   void *arg3 = (void *) 0 ;
4450   CallbackDetails *_global_callbacks ;
4451   void *argp1 = 0 ;
4452   int res1 = 0 ;
4453   PyObject * obj1 = 0 ;
4454   PyObject * obj2 = 0 ;
4455 
4456   {
4457     _global_callbacks = malloc(sizeof(CallbackDetails));
4458     if (!_global_callbacks) {
4459       PyErr_SetNone(PyExc_MemoryError);
4460       SWIG_fail;
4461     }
4462     _global_callbacks->context = NULL;
4463     _global_callbacks->func_1 = NULL;
4464     _global_callbacks->func_2 = NULL;
4465     _global_callbacks->func_3 = NULL;
4466     _global_callbacks->data = NULL;
4467     _global_callbacks->remove = (RemoveFunc) gp_context_set_cancel_func;
4468   }
4469   if (!PyArg_UnpackTuple(args, "Context_set_cancel_func", 2, 2, &obj1, &obj2)) SWIG_fail;
4470   res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p__GPContext, 0 |  0 );
4471   if (!SWIG_IsOK(res1)) {
4472     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Context_set_cancel_func" "', argument " "1"" of type '" "struct _GPContext *""'");
4473   }
4474   arg1 = (struct _GPContext *)(argp1);
4475   {
4476     if (!PyCallable_Check(obj1)) {
4477       SWIG_exception_fail(SWIG_TypeError, "in method '" "Context_set_cancel_func" "', argument " "2" " is not callable");
4478     }
4479     _global_callbacks->func_1 = obj1;
4480     Py_INCREF(_global_callbacks->func_1);
4481     arg2 = (GPContextCancelFunc) wrap_cancel_func;
4482   }
4483   {
4484     _global_callbacks->data = obj2;
4485     Py_INCREF(_global_callbacks->data);
4486     arg3 = _global_callbacks;
4487   }
4488   _GPContext_set_cancel_func(arg1,arg2,arg3);
4489   resultobj = SWIG_Py_Void();
4490   {
4491     resultobj = SWIG_Python_AppendOutput(resultobj,
4492       SWIG_NewPointerObj(_global_callbacks, SWIGTYPE_p_CallbackDetails, SWIG_POINTER_OWN));
4493     _global_callbacks = NULL;
4494   }
4495   {
4496     if (_global_callbacks)
4497     del_CallbackDetails(_global_callbacks);
4498   }
4499   return resultobj;
4500 fail:
4501   {
4502     if (_global_callbacks)
4503     del_CallbackDetails(_global_callbacks);
4504   }
4505   return NULL;
4506 }
4507 
4508 
_wrap_Context_set_progress_funcs(PyObject * self,PyObject * args)4509 SWIGINTERN PyObject *_wrap_Context_set_progress_funcs(PyObject *self, PyObject *args) {
4510   PyObject *resultobj = 0;
4511   struct _GPContext *arg1 = (struct _GPContext *) 0 ;
4512   GPContextProgressStartFunc arg2 = (GPContextProgressStartFunc) 0 ;
4513   GPContextProgressUpdateFunc arg3 = (GPContextProgressUpdateFunc) 0 ;
4514   GPContextProgressStopFunc arg4 = (GPContextProgressStopFunc) 0 ;
4515   void *arg5 = (void *) 0 ;
4516   CallbackDetails *_global_callbacks ;
4517   void *argp1 = 0 ;
4518   int res1 = 0 ;
4519   PyObject * obj1 = 0 ;
4520   PyObject * obj2 = 0 ;
4521   PyObject * obj3 = 0 ;
4522   PyObject * obj4 = 0 ;
4523 
4524   {
4525     _global_callbacks = malloc(sizeof(CallbackDetails));
4526     if (!_global_callbacks) {
4527       PyErr_SetNone(PyExc_MemoryError);
4528       SWIG_fail;
4529     }
4530     _global_callbacks->context = NULL;
4531     _global_callbacks->func_1 = NULL;
4532     _global_callbacks->func_2 = NULL;
4533     _global_callbacks->func_3 = NULL;
4534     _global_callbacks->data = NULL;
4535     _global_callbacks->remove = (RemoveFunc) unset_progress_funcs;
4536   }
4537   if (!PyArg_UnpackTuple(args, "Context_set_progress_funcs", 4, 4, &obj1, &obj2, &obj3, &obj4)) SWIG_fail;
4538   res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p__GPContext, 0 |  0 );
4539   if (!SWIG_IsOK(res1)) {
4540     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Context_set_progress_funcs" "', argument " "1"" of type '" "struct _GPContext *""'");
4541   }
4542   arg1 = (struct _GPContext *)(argp1);
4543   {
4544     if (!PyCallable_Check(obj1)) {
4545       SWIG_exception_fail(SWIG_TypeError, "in method '" "Context_set_progress_funcs" "', argument " "2" " is not callable");
4546     }
4547     _global_callbacks->func_1 = obj1;
4548     Py_INCREF(_global_callbacks->func_1);
4549     arg2 = (GPContextProgressStartFunc) py_progress_start;
4550   }
4551   {
4552     if (!PyCallable_Check(obj2)) {
4553       SWIG_exception_fail(SWIG_TypeError, "in method '" "Context_set_progress_funcs" "', argument " "3" " is not callable");
4554     }
4555     _global_callbacks->func_2 = obj2;
4556     Py_INCREF(_global_callbacks->func_2);
4557     arg3 = (GPContextProgressUpdateFunc) py_progress_update;
4558   }
4559   {
4560     if (!PyCallable_Check(obj3)) {
4561       SWIG_exception_fail(SWIG_TypeError, "in method '" "Context_set_progress_funcs" "', argument " "4" " is not callable");
4562     }
4563     _global_callbacks->func_3 = obj3;
4564     Py_INCREF(_global_callbacks->func_3);
4565     arg4 = (GPContextProgressStopFunc) py_progress_stop;
4566   }
4567   {
4568     _global_callbacks->data = obj4;
4569     Py_INCREF(_global_callbacks->data);
4570     arg5 = _global_callbacks;
4571   }
4572   _GPContext_set_progress_funcs(arg1,arg2,arg3,arg4,arg5);
4573   resultobj = SWIG_Py_Void();
4574   {
4575     resultobj = SWIG_Python_AppendOutput(resultobj,
4576       SWIG_NewPointerObj(_global_callbacks, SWIGTYPE_p_CallbackDetails, SWIG_POINTER_OWN));
4577     _global_callbacks = NULL;
4578   }
4579   {
4580     if (_global_callbacks)
4581     del_CallbackDetails(_global_callbacks);
4582   }
4583   return resultobj;
4584 fail:
4585   {
4586     if (_global_callbacks)
4587     del_CallbackDetails(_global_callbacks);
4588   }
4589   return NULL;
4590 }
4591 
4592 
_wrap_Context_set_status_func(PyObject * self,PyObject * args)4593 SWIGINTERN PyObject *_wrap_Context_set_status_func(PyObject *self, PyObject *args) {
4594   PyObject *resultobj = 0;
4595   struct _GPContext *arg1 = (struct _GPContext *) 0 ;
4596   GPContextStatusFunc arg2 = (GPContextStatusFunc) 0 ;
4597   void *arg3 = (void *) 0 ;
4598   CallbackDetails *_global_callbacks ;
4599   void *argp1 = 0 ;
4600   int res1 = 0 ;
4601   PyObject * obj1 = 0 ;
4602   PyObject * obj2 = 0 ;
4603 
4604   {
4605     _global_callbacks = malloc(sizeof(CallbackDetails));
4606     if (!_global_callbacks) {
4607       PyErr_SetNone(PyExc_MemoryError);
4608       SWIG_fail;
4609     }
4610     _global_callbacks->context = NULL;
4611     _global_callbacks->func_1 = NULL;
4612     _global_callbacks->func_2 = NULL;
4613     _global_callbacks->func_3 = NULL;
4614     _global_callbacks->data = NULL;
4615     _global_callbacks->remove = (RemoveFunc) gp_context_set_status_func;
4616   }
4617   if (!PyArg_UnpackTuple(args, "Context_set_status_func", 2, 2, &obj1, &obj2)) SWIG_fail;
4618   res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p__GPContext, 0 |  0 );
4619   if (!SWIG_IsOK(res1)) {
4620     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Context_set_status_func" "', argument " "1"" of type '" "struct _GPContext *""'");
4621   }
4622   arg1 = (struct _GPContext *)(argp1);
4623   {
4624     if (!PyCallable_Check(obj1)) {
4625       SWIG_exception_fail(SWIG_TypeError, "in method '" "Context_set_status_func" "', argument " "2" " is not callable");
4626     }
4627     _global_callbacks->func_1 = obj1;
4628     Py_INCREF(_global_callbacks->func_1);
4629     arg2 = (GPContextStatusFunc) wrap_status_func;
4630   }
4631   {
4632     _global_callbacks->data = obj2;
4633     Py_INCREF(_global_callbacks->data);
4634     arg3 = _global_callbacks;
4635   }
4636   _GPContext_set_status_func(arg1,arg2,arg3);
4637   resultobj = SWIG_Py_Void();
4638   {
4639     resultobj = SWIG_Python_AppendOutput(resultobj,
4640       SWIG_NewPointerObj(_global_callbacks, SWIGTYPE_p_CallbackDetails, SWIG_POINTER_OWN));
4641     _global_callbacks = NULL;
4642   }
4643   {
4644     if (_global_callbacks)
4645     del_CallbackDetails(_global_callbacks);
4646   }
4647   return resultobj;
4648 fail:
4649   {
4650     if (_global_callbacks)
4651     del_CallbackDetails(_global_callbacks);
4652   }
4653   return NULL;
4654 }
4655 
4656 
_wrap_new_Context(PyObject * self,PyObject * args,PyObject * kwargs)4657 SWIGINTERN int _wrap_new_Context(PyObject *self, PyObject *args, PyObject *kwargs) {
4658   PyObject *resultobj = 0;
4659   struct _GPContext *result = 0 ;
4660 
4661   if (!SWIG_Python_CheckNoKeywords(kwargs, "new_Context")) SWIG_fail;
4662   if (args && PyTuple_Check(args) && PyTuple_GET_SIZE(args) > 0) SWIG_exception_fail(SWIG_TypeError, "new_Context takes no arguments");
4663   result = (struct _GPContext *)new__GPContext();
4664   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p__GPContext, SWIG_BUILTIN_INIT |  0 );
4665   return resultobj == Py_None ? -1 : 0;
4666 fail:
4667   return -1;
4668 }
4669 
4670 
_wrap_delete_Context(PyObject * self,PyObject * args)4671 SWIGINTERN PyObject *_wrap_delete_Context(PyObject *self, PyObject *args) {
4672   PyObject *resultobj = 0;
4673   struct _GPContext *arg1 = (struct _GPContext *) 0 ;
4674   void *argp1 = 0 ;
4675   int res1 = 0 ;
4676 
4677   if (args && PyTuple_Check(args) && PyTuple_GET_SIZE(args) > 0) SWIG_exception_fail(SWIG_TypeError, "delete_Context takes no arguments");
4678   res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p__GPContext, SWIG_POINTER_DISOWN |  0 );
4679   if (!SWIG_IsOK(res1)) {
4680     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Context" "', argument " "1"" of type '" "struct _GPContext *""'");
4681   }
4682   arg1 = (struct _GPContext *)(argp1);
4683   delete__GPContext(arg1);
4684   resultobj = SWIG_Py_Void();
4685   return resultobj;
4686 fail:
4687   return NULL;
4688 }
4689 
4690 
SWIGPY_DESTRUCTOR_CLOSURE(_wrap_delete_Context)4691 SWIGPY_DESTRUCTOR_CLOSURE(_wrap_delete_Context) /* defines _wrap_delete_Context_destructor_closure */
4692 
4693 SWIGINTERN PyObject *_wrap_gp_context_new(PyObject *self, PyObject *args) {
4694   PyObject *resultobj = 0;
4695   GPContext *result = 0 ;
4696 
4697   if (!PyArg_UnpackTuple(args, "gp_context_new", 0, 0)) SWIG_fail;
4698   result = (GPContext *)gp_context_new();
4699   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p__GPContext, SWIG_POINTER_OWN |  0 );
4700   return resultobj;
4701 fail:
4702   return NULL;
4703 }
4704 
4705 
_wrap_gp_context_set_idle_func(PyObject * self,PyObject * args)4706 SWIGINTERN PyObject *_wrap_gp_context_set_idle_func(PyObject *self, PyObject *args) {
4707   PyObject *resultobj = 0;
4708   GPContext *arg1 = (GPContext *) 0 ;
4709   GPContextIdleFunc arg2 = (GPContextIdleFunc) 0 ;
4710   void *arg3 = (void *) 0 ;
4711   CallbackDetails *_global_callbacks ;
4712   void *argp1 = 0 ;
4713   int res1 = 0 ;
4714   PyObject * obj0 = 0 ;
4715   PyObject * obj1 = 0 ;
4716   PyObject * obj2 = 0 ;
4717 
4718   {
4719     _global_callbacks = malloc(sizeof(CallbackDetails));
4720     if (!_global_callbacks) {
4721       PyErr_SetNone(PyExc_MemoryError);
4722       SWIG_fail;
4723     }
4724     _global_callbacks->context = NULL;
4725     _global_callbacks->func_1 = NULL;
4726     _global_callbacks->func_2 = NULL;
4727     _global_callbacks->func_3 = NULL;
4728     _global_callbacks->data = NULL;
4729     _global_callbacks->remove = (RemoveFunc) gp_context_set_idle_func;
4730   }
4731   if (!PyArg_UnpackTuple(args, "gp_context_set_idle_func", 3, 3, &obj0, &obj1, &obj2)) SWIG_fail;
4732   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p__GPContext, 0 |  0 );
4733   if (!SWIG_IsOK(res1)) {
4734     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gp_context_set_idle_func" "', argument " "1"" of type '" "GPContext *""'");
4735   }
4736   arg1 = (GPContext *)(argp1);
4737   {
4738     if (!PyCallable_Check(obj1)) {
4739       SWIG_exception_fail(SWIG_TypeError, "in method '" "gp_context_set_idle_func" "', argument " "2" " is not callable");
4740     }
4741     _global_callbacks->func_1 = obj1;
4742     Py_INCREF(_global_callbacks->func_1);
4743     arg2 = (GPContextIdleFunc) wrap_idle_func;
4744   }
4745   {
4746     _global_callbacks->data = obj2;
4747     Py_INCREF(_global_callbacks->data);
4748     arg3 = _global_callbacks;
4749   }
4750   {
4751     _global_callbacks->context = arg1;
4752   }
4753   gp_context_set_idle_func(arg1,arg2,arg3);
4754   resultobj = SWIG_Py_Void();
4755   {
4756     resultobj = SWIG_Python_AppendOutput(resultobj,
4757       SWIG_NewPointerObj(_global_callbacks, SWIGTYPE_p_CallbackDetails, SWIG_POINTER_OWN));
4758     _global_callbacks = NULL;
4759   }
4760   {
4761     if (_global_callbacks)
4762     del_CallbackDetails(_global_callbacks);
4763   }
4764   return resultobj;
4765 fail:
4766   {
4767     if (_global_callbacks)
4768     del_CallbackDetails(_global_callbacks);
4769   }
4770   return NULL;
4771 }
4772 
4773 
_wrap_gp_context_set_progress_funcs(PyObject * self,PyObject * args)4774 SWIGINTERN PyObject *_wrap_gp_context_set_progress_funcs(PyObject *self, PyObject *args) {
4775   PyObject *resultobj = 0;
4776   GPContext *arg1 = (GPContext *) 0 ;
4777   GPContextProgressStartFunc arg2 = (GPContextProgressStartFunc) 0 ;
4778   GPContextProgressUpdateFunc arg3 = (GPContextProgressUpdateFunc) 0 ;
4779   GPContextProgressStopFunc arg4 = (GPContextProgressStopFunc) 0 ;
4780   void *arg5 = (void *) 0 ;
4781   CallbackDetails *_global_callbacks ;
4782   void *argp1 = 0 ;
4783   int res1 = 0 ;
4784   PyObject * obj0 = 0 ;
4785   PyObject * obj1 = 0 ;
4786   PyObject * obj2 = 0 ;
4787   PyObject * obj3 = 0 ;
4788   PyObject * obj4 = 0 ;
4789 
4790   {
4791     _global_callbacks = malloc(sizeof(CallbackDetails));
4792     if (!_global_callbacks) {
4793       PyErr_SetNone(PyExc_MemoryError);
4794       SWIG_fail;
4795     }
4796     _global_callbacks->context = NULL;
4797     _global_callbacks->func_1 = NULL;
4798     _global_callbacks->func_2 = NULL;
4799     _global_callbacks->func_3 = NULL;
4800     _global_callbacks->data = NULL;
4801     _global_callbacks->remove = (RemoveFunc) unset_progress_funcs;
4802   }
4803   if (!PyArg_UnpackTuple(args, "gp_context_set_progress_funcs", 5, 5, &obj0, &obj1, &obj2, &obj3, &obj4)) SWIG_fail;
4804   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p__GPContext, 0 |  0 );
4805   if (!SWIG_IsOK(res1)) {
4806     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gp_context_set_progress_funcs" "', argument " "1"" of type '" "GPContext *""'");
4807   }
4808   arg1 = (GPContext *)(argp1);
4809   {
4810     if (!PyCallable_Check(obj1)) {
4811       SWIG_exception_fail(SWIG_TypeError, "in method '" "gp_context_set_progress_funcs" "', argument " "2" " is not callable");
4812     }
4813     _global_callbacks->func_1 = obj1;
4814     Py_INCREF(_global_callbacks->func_1);
4815     arg2 = (GPContextProgressStartFunc) py_progress_start;
4816   }
4817   {
4818     if (!PyCallable_Check(obj2)) {
4819       SWIG_exception_fail(SWIG_TypeError, "in method '" "gp_context_set_progress_funcs" "', argument " "3" " is not callable");
4820     }
4821     _global_callbacks->func_2 = obj2;
4822     Py_INCREF(_global_callbacks->func_2);
4823     arg3 = (GPContextProgressUpdateFunc) py_progress_update;
4824   }
4825   {
4826     if (!PyCallable_Check(obj3)) {
4827       SWIG_exception_fail(SWIG_TypeError, "in method '" "gp_context_set_progress_funcs" "', argument " "4" " is not callable");
4828     }
4829     _global_callbacks->func_3 = obj3;
4830     Py_INCREF(_global_callbacks->func_3);
4831     arg4 = (GPContextProgressStopFunc) py_progress_stop;
4832   }
4833   {
4834     _global_callbacks->data = obj4;
4835     Py_INCREF(_global_callbacks->data);
4836     arg5 = _global_callbacks;
4837   }
4838   {
4839     _global_callbacks->context = arg1;
4840   }
4841   gp_context_set_progress_funcs(arg1,arg2,arg3,arg4,arg5);
4842   resultobj = SWIG_Py_Void();
4843   {
4844     resultobj = SWIG_Python_AppendOutput(resultobj,
4845       SWIG_NewPointerObj(_global_callbacks, SWIGTYPE_p_CallbackDetails, SWIG_POINTER_OWN));
4846     _global_callbacks = NULL;
4847   }
4848   {
4849     if (_global_callbacks)
4850     del_CallbackDetails(_global_callbacks);
4851   }
4852   return resultobj;
4853 fail:
4854   {
4855     if (_global_callbacks)
4856     del_CallbackDetails(_global_callbacks);
4857   }
4858   return NULL;
4859 }
4860 
4861 
_wrap_gp_context_set_error_func(PyObject * self,PyObject * args)4862 SWIGINTERN PyObject *_wrap_gp_context_set_error_func(PyObject *self, PyObject *args) {
4863   PyObject *resultobj = 0;
4864   GPContext *arg1 = (GPContext *) 0 ;
4865   GPContextErrorFunc arg2 = (GPContextErrorFunc) 0 ;
4866   void *arg3 = (void *) 0 ;
4867   CallbackDetails *_global_callbacks ;
4868   void *argp1 = 0 ;
4869   int res1 = 0 ;
4870   PyObject * obj0 = 0 ;
4871   PyObject * obj1 = 0 ;
4872   PyObject * obj2 = 0 ;
4873 
4874   {
4875     _global_callbacks = malloc(sizeof(CallbackDetails));
4876     if (!_global_callbacks) {
4877       PyErr_SetNone(PyExc_MemoryError);
4878       SWIG_fail;
4879     }
4880     _global_callbacks->context = NULL;
4881     _global_callbacks->func_1 = NULL;
4882     _global_callbacks->func_2 = NULL;
4883     _global_callbacks->func_3 = NULL;
4884     _global_callbacks->data = NULL;
4885     _global_callbacks->remove = (RemoveFunc) gp_context_set_error_func;
4886   }
4887   if (!PyArg_UnpackTuple(args, "gp_context_set_error_func", 3, 3, &obj0, &obj1, &obj2)) SWIG_fail;
4888   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p__GPContext, 0 |  0 );
4889   if (!SWIG_IsOK(res1)) {
4890     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gp_context_set_error_func" "', argument " "1"" of type '" "GPContext *""'");
4891   }
4892   arg1 = (GPContext *)(argp1);
4893   {
4894     if (!PyCallable_Check(obj1)) {
4895       SWIG_exception_fail(SWIG_TypeError, "in method '" "gp_context_set_error_func" "', argument " "2" " is not callable");
4896     }
4897     _global_callbacks->func_1 = obj1;
4898     Py_INCREF(_global_callbacks->func_1);
4899     arg2 = (GPContextErrorFunc) wrap_error_func;
4900   }
4901   {
4902     _global_callbacks->data = obj2;
4903     Py_INCREF(_global_callbacks->data);
4904     arg3 = _global_callbacks;
4905   }
4906   {
4907     _global_callbacks->context = arg1;
4908   }
4909   gp_context_set_error_func(arg1,arg2,arg3);
4910   resultobj = SWIG_Py_Void();
4911   {
4912     resultobj = SWIG_Python_AppendOutput(resultobj,
4913       SWIG_NewPointerObj(_global_callbacks, SWIGTYPE_p_CallbackDetails, SWIG_POINTER_OWN));
4914     _global_callbacks = NULL;
4915   }
4916   {
4917     if (_global_callbacks)
4918     del_CallbackDetails(_global_callbacks);
4919   }
4920   return resultobj;
4921 fail:
4922   {
4923     if (_global_callbacks)
4924     del_CallbackDetails(_global_callbacks);
4925   }
4926   return NULL;
4927 }
4928 
4929 
_wrap_gp_context_set_status_func(PyObject * self,PyObject * args)4930 SWIGINTERN PyObject *_wrap_gp_context_set_status_func(PyObject *self, PyObject *args) {
4931   PyObject *resultobj = 0;
4932   GPContext *arg1 = (GPContext *) 0 ;
4933   GPContextStatusFunc arg2 = (GPContextStatusFunc) 0 ;
4934   void *arg3 = (void *) 0 ;
4935   CallbackDetails *_global_callbacks ;
4936   void *argp1 = 0 ;
4937   int res1 = 0 ;
4938   PyObject * obj0 = 0 ;
4939   PyObject * obj1 = 0 ;
4940   PyObject * obj2 = 0 ;
4941 
4942   {
4943     _global_callbacks = malloc(sizeof(CallbackDetails));
4944     if (!_global_callbacks) {
4945       PyErr_SetNone(PyExc_MemoryError);
4946       SWIG_fail;
4947     }
4948     _global_callbacks->context = NULL;
4949     _global_callbacks->func_1 = NULL;
4950     _global_callbacks->func_2 = NULL;
4951     _global_callbacks->func_3 = NULL;
4952     _global_callbacks->data = NULL;
4953     _global_callbacks->remove = (RemoveFunc) gp_context_set_status_func;
4954   }
4955   if (!PyArg_UnpackTuple(args, "gp_context_set_status_func", 3, 3, &obj0, &obj1, &obj2)) SWIG_fail;
4956   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p__GPContext, 0 |  0 );
4957   if (!SWIG_IsOK(res1)) {
4958     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gp_context_set_status_func" "', argument " "1"" of type '" "GPContext *""'");
4959   }
4960   arg1 = (GPContext *)(argp1);
4961   {
4962     if (!PyCallable_Check(obj1)) {
4963       SWIG_exception_fail(SWIG_TypeError, "in method '" "gp_context_set_status_func" "', argument " "2" " is not callable");
4964     }
4965     _global_callbacks->func_1 = obj1;
4966     Py_INCREF(_global_callbacks->func_1);
4967     arg2 = (GPContextStatusFunc) wrap_status_func;
4968   }
4969   {
4970     _global_callbacks->data = obj2;
4971     Py_INCREF(_global_callbacks->data);
4972     arg3 = _global_callbacks;
4973   }
4974   {
4975     _global_callbacks->context = arg1;
4976   }
4977   gp_context_set_status_func(arg1,arg2,arg3);
4978   resultobj = SWIG_Py_Void();
4979   {
4980     resultobj = SWIG_Python_AppendOutput(resultobj,
4981       SWIG_NewPointerObj(_global_callbacks, SWIGTYPE_p_CallbackDetails, SWIG_POINTER_OWN));
4982     _global_callbacks = NULL;
4983   }
4984   {
4985     if (_global_callbacks)
4986     del_CallbackDetails(_global_callbacks);
4987   }
4988   return resultobj;
4989 fail:
4990   {
4991     if (_global_callbacks)
4992     del_CallbackDetails(_global_callbacks);
4993   }
4994   return NULL;
4995 }
4996 
4997 
_wrap_gp_context_set_question_func(PyObject * self,PyObject * args)4998 SWIGINTERN PyObject *_wrap_gp_context_set_question_func(PyObject *self, PyObject *args) {
4999   PyObject *resultobj = 0;
5000   GPContext *arg1 = (GPContext *) 0 ;
5001   GPContextQuestionFunc arg2 = (GPContextQuestionFunc) 0 ;
5002   void *arg3 = (void *) 0 ;
5003   CallbackDetails *_global_callbacks ;
5004   void *argp1 = 0 ;
5005   int res1 = 0 ;
5006   PyObject * obj0 = 0 ;
5007   PyObject * obj1 = 0 ;
5008   PyObject * obj2 = 0 ;
5009 
5010   {
5011     _global_callbacks = malloc(sizeof(CallbackDetails));
5012     if (!_global_callbacks) {
5013       PyErr_SetNone(PyExc_MemoryError);
5014       SWIG_fail;
5015     }
5016     _global_callbacks->context = NULL;
5017     _global_callbacks->func_1 = NULL;
5018     _global_callbacks->func_2 = NULL;
5019     _global_callbacks->func_3 = NULL;
5020     _global_callbacks->data = NULL;
5021     _global_callbacks->remove = (RemoveFunc) gp_context_set_question_func;
5022   }
5023   if (!PyArg_UnpackTuple(args, "gp_context_set_question_func", 3, 3, &obj0, &obj1, &obj2)) SWIG_fail;
5024   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p__GPContext, 0 |  0 );
5025   if (!SWIG_IsOK(res1)) {
5026     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gp_context_set_question_func" "', argument " "1"" of type '" "GPContext *""'");
5027   }
5028   arg1 = (GPContext *)(argp1);
5029   {
5030     if (!PyCallable_Check(obj1)) {
5031       SWIG_exception_fail(SWIG_TypeError, "in method '" "gp_context_set_question_func" "', argument " "2" " is not callable");
5032     }
5033     _global_callbacks->func_1 = obj1;
5034     Py_INCREF(_global_callbacks->func_1);
5035     arg2 = (GPContextQuestionFunc) wrap_question_func;
5036   }
5037   {
5038     _global_callbacks->data = obj2;
5039     Py_INCREF(_global_callbacks->data);
5040     arg3 = _global_callbacks;
5041   }
5042   {
5043     _global_callbacks->context = arg1;
5044   }
5045   gp_context_set_question_func(arg1,arg2,arg3);
5046   resultobj = SWIG_Py_Void();
5047   {
5048     resultobj = SWIG_Python_AppendOutput(resultobj,
5049       SWIG_NewPointerObj(_global_callbacks, SWIGTYPE_p_CallbackDetails, SWIG_POINTER_OWN));
5050     _global_callbacks = NULL;
5051   }
5052   {
5053     if (_global_callbacks)
5054     del_CallbackDetails(_global_callbacks);
5055   }
5056   return resultobj;
5057 fail:
5058   {
5059     if (_global_callbacks)
5060     del_CallbackDetails(_global_callbacks);
5061   }
5062   return NULL;
5063 }
5064 
5065 
_wrap_gp_context_set_cancel_func(PyObject * self,PyObject * args)5066 SWIGINTERN PyObject *_wrap_gp_context_set_cancel_func(PyObject *self, PyObject *args) {
5067   PyObject *resultobj = 0;
5068   GPContext *arg1 = (GPContext *) 0 ;
5069   GPContextCancelFunc arg2 = (GPContextCancelFunc) 0 ;
5070   void *arg3 = (void *) 0 ;
5071   CallbackDetails *_global_callbacks ;
5072   void *argp1 = 0 ;
5073   int res1 = 0 ;
5074   PyObject * obj0 = 0 ;
5075   PyObject * obj1 = 0 ;
5076   PyObject * obj2 = 0 ;
5077 
5078   {
5079     _global_callbacks = malloc(sizeof(CallbackDetails));
5080     if (!_global_callbacks) {
5081       PyErr_SetNone(PyExc_MemoryError);
5082       SWIG_fail;
5083     }
5084     _global_callbacks->context = NULL;
5085     _global_callbacks->func_1 = NULL;
5086     _global_callbacks->func_2 = NULL;
5087     _global_callbacks->func_3 = NULL;
5088     _global_callbacks->data = NULL;
5089     _global_callbacks->remove = (RemoveFunc) gp_context_set_cancel_func;
5090   }
5091   if (!PyArg_UnpackTuple(args, "gp_context_set_cancel_func", 3, 3, &obj0, &obj1, &obj2)) SWIG_fail;
5092   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p__GPContext, 0 |  0 );
5093   if (!SWIG_IsOK(res1)) {
5094     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gp_context_set_cancel_func" "', argument " "1"" of type '" "GPContext *""'");
5095   }
5096   arg1 = (GPContext *)(argp1);
5097   {
5098     if (!PyCallable_Check(obj1)) {
5099       SWIG_exception_fail(SWIG_TypeError, "in method '" "gp_context_set_cancel_func" "', argument " "2" " is not callable");
5100     }
5101     _global_callbacks->func_1 = obj1;
5102     Py_INCREF(_global_callbacks->func_1);
5103     arg2 = (GPContextCancelFunc) wrap_cancel_func;
5104   }
5105   {
5106     _global_callbacks->data = obj2;
5107     Py_INCREF(_global_callbacks->data);
5108     arg3 = _global_callbacks;
5109   }
5110   {
5111     _global_callbacks->context = arg1;
5112   }
5113   gp_context_set_cancel_func(arg1,arg2,arg3);
5114   resultobj = SWIG_Py_Void();
5115   {
5116     resultobj = SWIG_Python_AppendOutput(resultobj,
5117       SWIG_NewPointerObj(_global_callbacks, SWIGTYPE_p_CallbackDetails, SWIG_POINTER_OWN));
5118     _global_callbacks = NULL;
5119   }
5120   {
5121     if (_global_callbacks)
5122     del_CallbackDetails(_global_callbacks);
5123   }
5124   return resultobj;
5125 fail:
5126   {
5127     if (_global_callbacks)
5128     del_CallbackDetails(_global_callbacks);
5129   }
5130   return NULL;
5131 }
5132 
5133 
_wrap_gp_context_set_message_func(PyObject * self,PyObject * args)5134 SWIGINTERN PyObject *_wrap_gp_context_set_message_func(PyObject *self, PyObject *args) {
5135   PyObject *resultobj = 0;
5136   GPContext *arg1 = (GPContext *) 0 ;
5137   GPContextMessageFunc arg2 = (GPContextMessageFunc) 0 ;
5138   void *arg3 = (void *) 0 ;
5139   CallbackDetails *_global_callbacks ;
5140   void *argp1 = 0 ;
5141   int res1 = 0 ;
5142   PyObject * obj0 = 0 ;
5143   PyObject * obj1 = 0 ;
5144   PyObject * obj2 = 0 ;
5145 
5146   {
5147     _global_callbacks = malloc(sizeof(CallbackDetails));
5148     if (!_global_callbacks) {
5149       PyErr_SetNone(PyExc_MemoryError);
5150       SWIG_fail;
5151     }
5152     _global_callbacks->context = NULL;
5153     _global_callbacks->func_1 = NULL;
5154     _global_callbacks->func_2 = NULL;
5155     _global_callbacks->func_3 = NULL;
5156     _global_callbacks->data = NULL;
5157     _global_callbacks->remove = (RemoveFunc) gp_context_set_message_func;
5158   }
5159   if (!PyArg_UnpackTuple(args, "gp_context_set_message_func", 3, 3, &obj0, &obj1, &obj2)) SWIG_fail;
5160   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p__GPContext, 0 |  0 );
5161   if (!SWIG_IsOK(res1)) {
5162     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gp_context_set_message_func" "', argument " "1"" of type '" "GPContext *""'");
5163   }
5164   arg1 = (GPContext *)(argp1);
5165   {
5166     if (!PyCallable_Check(obj1)) {
5167       SWIG_exception_fail(SWIG_TypeError, "in method '" "gp_context_set_message_func" "', argument " "2" " is not callable");
5168     }
5169     _global_callbacks->func_1 = obj1;
5170     Py_INCREF(_global_callbacks->func_1);
5171     arg2 = (GPContextMessageFunc) wrap_message_func;
5172   }
5173   {
5174     _global_callbacks->data = obj2;
5175     Py_INCREF(_global_callbacks->data);
5176     arg3 = _global_callbacks;
5177   }
5178   {
5179     _global_callbacks->context = arg1;
5180   }
5181   gp_context_set_message_func(arg1,arg2,arg3);
5182   resultobj = SWIG_Py_Void();
5183   {
5184     resultobj = SWIG_Python_AppendOutput(resultobj,
5185       SWIG_NewPointerObj(_global_callbacks, SWIGTYPE_p_CallbackDetails, SWIG_POINTER_OWN));
5186     _global_callbacks = NULL;
5187   }
5188   {
5189     if (_global_callbacks)
5190     del_CallbackDetails(_global_callbacks);
5191   }
5192   return resultobj;
5193 fail:
5194   {
5195     if (_global_callbacks)
5196     del_CallbackDetails(_global_callbacks);
5197   }
5198   return NULL;
5199 }
5200 
5201 
5202 static PyMethodDef SwigMethods[] = {
5203 	 { "SWIG_PyInstanceMethod_New", SWIG_PyInstanceMethod_New, METH_O, NULL},
5204 	 { "SWIG_PyStaticMethod_New", SWIG_PyStaticMethod_New, METH_O, NULL},
5205 	 { "unset_progress_funcs", _wrap_unset_progress_funcs, METH_VARARGS, "\n"
5206 		"unset_progress_funcs(context, start_func, data)\n"
5207 		"\n"
5208 		"Parameters\n"
5209 		"----------\n"
5210 		"context: gphoto2.GPContext\n"
5211 		"start_func: GPContextProgressStartFunc\n"
5212 		"data: void *\n"
5213 		"\n"
5214 		""},
5215 	 { "gp_context_new", _wrap_gp_context_new, METH_VARARGS, "\n"
5216 		"gp_context_new() -> Context\n"
5217 		"Creates a new context.  \n"
5218 		"\n"
5219 		"To be used by the frontend.  \n"
5220 		"\n"
5221 		"Returns\n"
5222 		"-------\n"
5223 		"a GPContext.\n"
5224 		"\n"
5225 		"See also gphoto2.Context\n"
5226 		""},
5227 	 { "gp_context_set_idle_func", _wrap_gp_context_set_idle_func, METH_VARARGS, "\n"
5228 		"gp_context_set_idle_func(context, func, data)\n"
5229 		"\n"
5230 		"Parameters\n"
5231 		"----------\n"
5232 		"context: gphoto2.GPContext\n"
5233 		"func: callable function\n"
5234 		"data: object\n"
5235 		"\n"
5236 		""},
5237 	 { "gp_context_set_progress_funcs", _wrap_gp_context_set_progress_funcs, METH_VARARGS, "\n"
5238 		"gp_context_set_progress_funcs(context, start_func, update_func, stop_func, data)\n"
5239 		"\n"
5240 		"Parameters\n"
5241 		"----------\n"
5242 		"context: gphoto2.GPContext\n"
5243 		"start_func: callable function\n"
5244 		"update_func: callable function\n"
5245 		"stop_func: callable function\n"
5246 		"data: object\n"
5247 		"\n"
5248 		""},
5249 	 { "gp_context_set_error_func", _wrap_gp_context_set_error_func, METH_VARARGS, "\n"
5250 		"gp_context_set_error_func(context, func, data)\n"
5251 		"\n"
5252 		"Parameters\n"
5253 		"----------\n"
5254 		"context: gphoto2.GPContext\n"
5255 		"func: callable function\n"
5256 		"data: object\n"
5257 		"\n"
5258 		""},
5259 	 { "gp_context_set_status_func", _wrap_gp_context_set_status_func, METH_VARARGS, "\n"
5260 		"gp_context_set_status_func(context, func, data)\n"
5261 		"\n"
5262 		"Parameters\n"
5263 		"----------\n"
5264 		"context: gphoto2.GPContext\n"
5265 		"func: callable function\n"
5266 		"data: object\n"
5267 		"\n"
5268 		""},
5269 	 { "gp_context_set_question_func", _wrap_gp_context_set_question_func, METH_VARARGS, "\n"
5270 		"gp_context_set_question_func(context, func, data)\n"
5271 		"\n"
5272 		"Parameters\n"
5273 		"----------\n"
5274 		"context: gphoto2.GPContext\n"
5275 		"func: callable function\n"
5276 		"data: object\n"
5277 		"\n"
5278 		""},
5279 	 { "gp_context_set_cancel_func", _wrap_gp_context_set_cancel_func, METH_VARARGS, "\n"
5280 		"gp_context_set_cancel_func(context, func, data)\n"
5281 		"\n"
5282 		"Parameters\n"
5283 		"----------\n"
5284 		"context: gphoto2.GPContext\n"
5285 		"func: callable function\n"
5286 		"data: object\n"
5287 		"\n"
5288 		""},
5289 	 { "gp_context_set_message_func", _wrap_gp_context_set_message_func, METH_VARARGS, "\n"
5290 		"gp_context_set_message_func(context, func, data)\n"
5291 		"\n"
5292 		"Parameters\n"
5293 		"----------\n"
5294 		"context: gphoto2.GPContext\n"
5295 		"func: callable function\n"
5296 		"data: object\n"
5297 		"\n"
5298 		""},
5299 	 { NULL, NULL, 0, NULL }
5300 };
5301 
5302 static PyMethodDef SwigMethods_proxydocs[] = {
5303 	 { "SWIG_PyInstanceMethod_New", SWIG_PyInstanceMethod_New, METH_O, NULL},
5304 	 { "SWIG_PyStaticMethod_New", SWIG_PyStaticMethod_New, METH_O, NULL},
5305 	 { "unset_progress_funcs", _wrap_unset_progress_funcs, METH_VARARGS, "\n"
5306 		"unset_progress_funcs(context, start_func, data)\n"
5307 		"\n"
5308 		"Parameters\n"
5309 		"----------\n"
5310 		"context: gphoto2.GPContext\n"
5311 		"start_func: GPContextProgressStartFunc\n"
5312 		"data: void *\n"
5313 		"\n"
5314 		""},
5315 	 { "gp_context_new", _wrap_gp_context_new, METH_VARARGS, "\n"
5316 		"gp_context_new() -> Context\n"
5317 		"Creates a new context.  \n"
5318 		"\n"
5319 		"To be used by the frontend.  \n"
5320 		"\n"
5321 		"Returns\n"
5322 		"-------\n"
5323 		"a GPContext.\n"
5324 		"\n"
5325 		"See also gphoto2.Context\n"
5326 		""},
5327 	 { "gp_context_set_idle_func", _wrap_gp_context_set_idle_func, METH_VARARGS, "\n"
5328 		"gp_context_set_idle_func(context, func, data)\n"
5329 		"\n"
5330 		"Parameters\n"
5331 		"----------\n"
5332 		"context: gphoto2.GPContext\n"
5333 		"func: callable function\n"
5334 		"data: object\n"
5335 		"\n"
5336 		""},
5337 	 { "gp_context_set_progress_funcs", _wrap_gp_context_set_progress_funcs, METH_VARARGS, "\n"
5338 		"gp_context_set_progress_funcs(context, start_func, update_func, stop_func, data)\n"
5339 		"\n"
5340 		"Parameters\n"
5341 		"----------\n"
5342 		"context: gphoto2.GPContext\n"
5343 		"start_func: callable function\n"
5344 		"update_func: callable function\n"
5345 		"stop_func: callable function\n"
5346 		"data: object\n"
5347 		"\n"
5348 		""},
5349 	 { "gp_context_set_error_func", _wrap_gp_context_set_error_func, METH_VARARGS, "\n"
5350 		"gp_context_set_error_func(context, func, data)\n"
5351 		"\n"
5352 		"Parameters\n"
5353 		"----------\n"
5354 		"context: gphoto2.GPContext\n"
5355 		"func: callable function\n"
5356 		"data: object\n"
5357 		"\n"
5358 		""},
5359 	 { "gp_context_set_status_func", _wrap_gp_context_set_status_func, METH_VARARGS, "\n"
5360 		"gp_context_set_status_func(context, func, data)\n"
5361 		"\n"
5362 		"Parameters\n"
5363 		"----------\n"
5364 		"context: gphoto2.GPContext\n"
5365 		"func: callable function\n"
5366 		"data: object\n"
5367 		"\n"
5368 		""},
5369 	 { "gp_context_set_question_func", _wrap_gp_context_set_question_func, METH_VARARGS, "\n"
5370 		"gp_context_set_question_func(context, func, data)\n"
5371 		"\n"
5372 		"Parameters\n"
5373 		"----------\n"
5374 		"context: gphoto2.GPContext\n"
5375 		"func: callable function\n"
5376 		"data: object\n"
5377 		"\n"
5378 		""},
5379 	 { "gp_context_set_cancel_func", _wrap_gp_context_set_cancel_func, METH_VARARGS, "\n"
5380 		"gp_context_set_cancel_func(context, func, data)\n"
5381 		"\n"
5382 		"Parameters\n"
5383 		"----------\n"
5384 		"context: gphoto2.GPContext\n"
5385 		"func: callable function\n"
5386 		"data: object\n"
5387 		"\n"
5388 		""},
5389 	 { "gp_context_set_message_func", _wrap_gp_context_set_message_func, METH_VARARGS, "\n"
5390 		"gp_context_set_message_func(context, func, data)\n"
5391 		"\n"
5392 		"Parameters\n"
5393 		"----------\n"
5394 		"context: gphoto2.GPContext\n"
5395 		"func: callable function\n"
5396 		"data: object\n"
5397 		"\n"
5398 		""},
5399 	 { NULL, NULL, 0, NULL }
5400 };
5401 
5402 static SwigPyGetSet CallbackDetails_func_1_getset = { _wrap_CallbackDetails_func_1_get, _wrap_CallbackDetails_func_1_set };
5403 static SwigPyGetSet CallbackDetails_func_2_getset = { _wrap_CallbackDetails_func_2_get, _wrap_CallbackDetails_func_2_set };
5404 static SwigPyGetSet CallbackDetails___dict___getset = { SwigPyObject_get___dict__, 0 };
5405 static SwigPyGetSet CallbackDetails_func_3_getset = { _wrap_CallbackDetails_func_3_get, _wrap_CallbackDetails_func_3_set };
5406 SWIGINTERN PyGetSetDef SwigPyBuiltin__CallbackDetails_getset[] = {
5407     { (char *)"func_1", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, (char *)"func_1", &CallbackDetails_func_1_getset },
5408     { (char *)"func_2", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, (char *)"func_2", &CallbackDetails_func_2_getset },
5409     { (char *)"__dict__", SwigPyBuiltin_GetterClosure, 0, (char *)"func_1", &CallbackDetails___dict___getset },
5410     { (char *)"func_3", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, (char *)"func_3", &CallbackDetails_func_3_getset },
5411     { NULL, NULL, NULL, NULL, NULL } /* Sentinel */
5412 };
5413 
5414 SWIGINTERN PyObject *
SwigPyBuiltin__CallbackDetails_richcompare(PyObject * self,PyObject * other,int op)5415 SwigPyBuiltin__CallbackDetails_richcompare(PyObject *self, PyObject *other, int op) {
5416   PyObject *result = NULL;
5417   PyObject *tuple = PyTuple_New(1);
5418   assert(tuple);
5419   PyTuple_SET_ITEM(tuple, 0, other);
5420   Py_XINCREF(other);
5421   if (!result) {
5422     if (SwigPyObject_Check(self) && SwigPyObject_Check(other)) {
5423       result = SwigPyObject_richcompare((SwigPyObject *)self, (SwigPyObject *)other, op);
5424     } else {
5425       result = Py_NotImplemented;
5426       Py_INCREF(result);
5427     }
5428   }
5429   Py_DECREF(tuple);
5430   return result;
5431 }
5432 
5433 SWIGINTERN PyMethodDef SwigPyBuiltin__CallbackDetails_methods[] = {
5434   { NULL, NULL, 0, NULL } /* Sentinel */
5435 };
5436 
5437 static PyHeapTypeObject SwigPyBuiltin__CallbackDetails_type = {
5438   {
5439 #if PY_VERSION_HEX >= 0x03000000
5440     PyVarObject_HEAD_INIT(NULL, 0)
5441 #else
5442     PyObject_HEAD_INIT(NULL)
5443     0,                                        /* ob_size */
5444 #endif
5445     "gphoto2.context.CallbackDetails",        /* tp_name */
5446     sizeof(SwigPyObject),                     /* tp_basicsize */
5447     0,                                        /* tp_itemsize */
5448     _wrap_delete_CallbackDetails_destructor_closure,              /* tp_dealloc */
5449     (printfunc) 0,                            /* tp_print */
5450     (getattrfunc) 0,                          /* tp_getattr */
5451     (setattrfunc) 0,                          /* tp_setattr */
5452 #if PY_VERSION_HEX >= 0x03000000
5453     0,                                        /* tp_compare */
5454 #else
5455     (cmpfunc) 0,                              /* tp_compare */
5456 #endif
5457     (reprfunc) 0,                             /* tp_repr */
5458     &SwigPyBuiltin__CallbackDetails_type.as_number,               /* tp_as_number */
5459     &SwigPyBuiltin__CallbackDetails_type.as_sequence,             /* tp_as_sequence */
5460     &SwigPyBuiltin__CallbackDetails_type.as_mapping,              /* tp_as_mapping */
5461     SwigPyObject_hash,                        /* tp_hash */
5462     (ternaryfunc) 0,                          /* tp_call */
5463     (reprfunc) 0,                             /* tp_str */
5464     (getattrofunc) 0,                         /* tp_getattro */
5465     (setattrofunc) 0,                         /* tp_setattro */
5466     &SwigPyBuiltin__CallbackDetails_type.as_buffer,               /* tp_as_buffer */
5467 #if PY_VERSION_HEX >= 0x03000000
5468     Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,   /* tp_flags */
5469 #else
5470     Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES, /* tp_flags */
5471 #endif
5472     "::CallbackDetails",                      /* tp_doc */
5473     (traverseproc) 0,                         /* tp_traverse */
5474     (inquiry) 0,                              /* tp_clear */
5475     SwigPyBuiltin__CallbackDetails_richcompare,                   /* tp_richcompare */
5476     0,                                        /* tp_weaklistoffset */
5477     (getiterfunc) 0,                          /* tp_iter */
5478     (iternextfunc) 0,                         /* tp_iternext */
5479     SwigPyBuiltin__CallbackDetails_methods,   /* tp_methods */
5480     0,                                        /* tp_members */
5481     SwigPyBuiltin__CallbackDetails_getset,    /* tp_getset */
5482     0,                                        /* tp_base */
5483     0,                                        /* tp_dict */
5484     (descrgetfunc) 0,                         /* tp_descr_get */
5485     (descrsetfunc) 0,                         /* tp_descr_set */
5486     offsetof(SwigPyObject, dict),             /* tp_dictoffset */
5487     SwigPyBuiltin_BadInit,                    /* tp_init */
5488     (allocfunc) 0,                            /* tp_alloc */
5489     (newfunc) 0,                              /* tp_new */
5490     (freefunc) 0,                             /* tp_free */
5491     (inquiry) 0,                              /* tp_is_gc */
5492     (PyObject *) 0,                           /* tp_bases */
5493     (PyObject *) 0,                           /* tp_mro */
5494     (PyObject *) 0,                           /* tp_cache */
5495     (PyObject *) 0,                           /* tp_subclasses */
5496     (PyObject *) 0,                           /* tp_weaklist */
5497     (destructor) 0,                           /* tp_del */
5498     (int) 0,                                  /* tp_version_tag */
5499 #if PY_VERSION_HEX >= 0x03040000
5500     (destructor) 0,                           /* tp_finalize */
5501 #endif
5502 #if PY_VERSION_HEX >= 0x03080000
5503     (vectorcallfunc) 0,                       /* tp_vectorcall */
5504 #endif
5505 #if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
5506     0,                                        /* tp_print */
5507 #endif
5508 #ifdef COUNT_ALLOCS
5509     (Py_ssize_t) 0,                           /* tp_allocs */
5510     (Py_ssize_t) 0,                           /* tp_frees */
5511     (Py_ssize_t) 0,                           /* tp_maxalloc */
5512     0,                                        /* tp_prev */
5513     0,                                        /* tp_next */
5514 #endif
5515   },
5516 #if PY_VERSION_HEX >= 0x03050000
5517   {
5518     (unaryfunc) 0,                            /* am_await */
5519     (unaryfunc) 0,                            /* am_aiter */
5520     (unaryfunc) 0,                            /* am_anext */
5521   },
5522 #endif
5523   {
5524     (binaryfunc) 0,                           /* nb_add */
5525     (binaryfunc) 0,                           /* nb_subtract */
5526     (binaryfunc) 0,                           /* nb_multiply */
5527 #if PY_VERSION_HEX < 0x03000000
5528     (binaryfunc) 0,                           /* nb_divide */
5529 #endif
5530     (binaryfunc) 0,                           /* nb_remainder */
5531     (binaryfunc) 0,                           /* nb_divmod */
5532     (ternaryfunc) 0,                          /* nb_power */
5533     (unaryfunc) 0,                            /* nb_negative */
5534     (unaryfunc) 0,                            /* nb_positive */
5535     (unaryfunc) 0,                            /* nb_absolute */
5536     (inquiry) 0,                              /* nb_nonzero */
5537     (unaryfunc) 0,                            /* nb_invert */
5538     (binaryfunc) 0,                           /* nb_lshift */
5539     (binaryfunc) 0,                           /* nb_rshift */
5540     (binaryfunc) 0,                           /* nb_and */
5541     (binaryfunc) 0,                           /* nb_xor */
5542     (binaryfunc) 0,                           /* nb_or */
5543 #if PY_VERSION_HEX < 0x03000000
5544     (coercion) 0,                             /* nb_coerce */
5545 #endif
5546     (unaryfunc) 0,                            /* nb_int */
5547 #if PY_VERSION_HEX >= 0x03000000
5548     (void *) 0,                               /* nb_reserved */
5549 #else
5550     (unaryfunc) 0,                            /* nb_long */
5551 #endif
5552     (unaryfunc) 0,                            /* nb_float */
5553 #if PY_VERSION_HEX < 0x03000000
5554     (unaryfunc) 0,                            /* nb_oct */
5555     (unaryfunc) 0,                            /* nb_hex */
5556 #endif
5557     (binaryfunc) 0,                           /* nb_inplace_add */
5558     (binaryfunc) 0,                           /* nb_inplace_subtract */
5559     (binaryfunc) 0,                           /* nb_inplace_multiply */
5560 #if PY_VERSION_HEX < 0x03000000
5561     (binaryfunc) 0,                           /* nb_inplace_divide */
5562 #endif
5563     (binaryfunc) 0,                           /* nb_inplace_remainder */
5564     (ternaryfunc) 0,                          /* nb_inplace_power */
5565     (binaryfunc) 0,                           /* nb_inplace_lshift */
5566     (binaryfunc) 0,                           /* nb_inplace_rshift */
5567     (binaryfunc) 0,                           /* nb_inplace_and */
5568     (binaryfunc) 0,                           /* nb_inplace_xor */
5569     (binaryfunc) 0,                           /* nb_inplace_or */
5570     (binaryfunc) 0,                           /* nb_floor_divide */
5571     (binaryfunc) 0,                           /* nb_true_divide */
5572     (binaryfunc) 0,                           /* nb_inplace_floor_divide */
5573     (binaryfunc) 0,                           /* nb_inplace_true_divide */
5574     (unaryfunc) 0,                            /* nb_index */
5575 #if PY_VERSION_HEX >= 0x03050000
5576     (binaryfunc) 0,                           /* nb_matrix_multiply */
5577     (binaryfunc) 0,                           /* nb_inplace_matrix_multiply */
5578 #endif
5579   },
5580   {
5581     (lenfunc) 0,                              /* mp_length */
5582     (binaryfunc) 0,                           /* mp_subscript */
5583     (objobjargproc) 0,                        /* mp_ass_subscript */
5584   },
5585   {
5586     (lenfunc) 0,                              /* sq_length */
5587     (binaryfunc) 0,                           /* sq_concat */
5588     (ssizeargfunc) 0,                         /* sq_repeat */
5589     (ssizeargfunc) 0,                         /* sq_item */
5590 #if PY_VERSION_HEX >= 0x03000000
5591     (void *) 0,                               /* was_sq_slice */
5592 #else
5593     (ssizessizeargfunc) 0,                    /* sq_slice */
5594 #endif
5595     (ssizeobjargproc) 0,                      /* sq_ass_item */
5596 #if PY_VERSION_HEX >= 0x03000000
5597     (void *) 0,                               /* was_sq_ass_slice */
5598 #else
5599     (ssizessizeobjargproc) 0,                 /* sq_ass_slice */
5600 #endif
5601     (objobjproc) 0,                           /* sq_contains */
5602     (binaryfunc) 0,                           /* sq_inplace_concat */
5603     (ssizeargfunc) 0,                         /* sq_inplace_repeat */
5604   },
5605   {
5606 #if PY_VERSION_HEX < 0x03000000
5607     (readbufferproc) 0,                       /* bf_getreadbuffer */
5608     (writebufferproc) 0,                      /* bf_getwritebuffer */
5609     (segcountproc) 0,                         /* bf_getsegcount */
5610     (charbufferproc) 0,                       /* bf_getcharbuffer */
5611 #endif
5612     (getbufferproc) 0,                        /* bf_getbuffer */
5613     (releasebufferproc) 0,                    /* bf_releasebuffer */
5614   },
5615     (PyObject *) 0,                           /* ht_name */
5616     (PyObject *) 0,                           /* ht_slots */
5617 #if PY_VERSION_HEX >= 0x03030000
5618     (PyObject *) 0,                           /* ht_qualname */
5619     0,                                        /* ht_cached_keys */
5620 #endif
5621 };
5622 
5623 SWIGINTERN SwigPyClientData SwigPyBuiltin__CallbackDetails_clientdata = {0, 0, 0, 0, 0, 0, (PyTypeObject *)&SwigPyBuiltin__CallbackDetails_type};
5624 
5625 static SwigPyGetSet Context___dict___getset = { SwigPyObject_get___dict__, 0 };
5626 SWIGINTERN PyGetSetDef SwigPyBuiltin___GPContext_getset[] = {
5627     { (char *)"__dict__", SwigPyBuiltin_GetterClosure, 0, (char *)"unset_progress_funcs", &Context___dict___getset },
5628     { NULL, NULL, NULL, NULL, NULL } /* Sentinel */
5629 };
5630 
5631 SWIGINTERN PyObject *
SwigPyBuiltin___GPContext_richcompare(PyObject * self,PyObject * other,int op)5632 SwigPyBuiltin___GPContext_richcompare(PyObject *self, PyObject *other, int op) {
5633   PyObject *result = NULL;
5634   PyObject *tuple = PyTuple_New(1);
5635   assert(tuple);
5636   PyTuple_SET_ITEM(tuple, 0, other);
5637   Py_XINCREF(other);
5638   if (!result) {
5639     if (SwigPyObject_Check(self) && SwigPyObject_Check(other)) {
5640       result = SwigPyObject_richcompare((SwigPyObject *)self, (SwigPyObject *)other, op);
5641     } else {
5642       result = Py_NotImplemented;
5643       Py_INCREF(result);
5644     }
5645   }
5646   Py_DECREF(tuple);
5647   return result;
5648 }
5649 
5650 SWIGINTERN PyMethodDef SwigPyBuiltin___GPContext_methods[] = {
5651   { "camera_autodetect", _wrap_Context_camera_autodetect, METH_VARARGS, "camera_autodetect(self)" },
5652   { "set_idle_func", _wrap_Context_set_idle_func, METH_VARARGS, "\n"
5653 		"set_idle_func(self, func, data)\n"
5654 		"\n"
5655 		"Parameters\n"
5656 		"----------\n"
5657 		"func: callable function\n"
5658 		"data: object\n"
5659 		"\n"
5660 		"" },
5661   { "set_error_func", _wrap_Context_set_error_func, METH_VARARGS, "\n"
5662 		"set_error_func(self, func, data)\n"
5663 		"\n"
5664 		"Parameters\n"
5665 		"----------\n"
5666 		"func: callable function\n"
5667 		"data: object\n"
5668 		"\n"
5669 		"" },
5670   { "set_message_func", _wrap_Context_set_message_func, METH_VARARGS, "\n"
5671 		"set_message_func(self, func, data)\n"
5672 		"\n"
5673 		"Parameters\n"
5674 		"----------\n"
5675 		"func: callable function\n"
5676 		"data: object\n"
5677 		"\n"
5678 		"" },
5679   { "set_question_func", _wrap_Context_set_question_func, METH_VARARGS, "\n"
5680 		"set_question_func(self, func, data)\n"
5681 		"\n"
5682 		"Parameters\n"
5683 		"----------\n"
5684 		"func: callable function\n"
5685 		"data: object\n"
5686 		"\n"
5687 		"" },
5688   { "set_cancel_func", _wrap_Context_set_cancel_func, METH_VARARGS, "\n"
5689 		"set_cancel_func(self, func, data)\n"
5690 		"\n"
5691 		"Parameters\n"
5692 		"----------\n"
5693 		"func: callable function\n"
5694 		"data: object\n"
5695 		"\n"
5696 		"" },
5697   { "set_progress_funcs", _wrap_Context_set_progress_funcs, METH_VARARGS, "\n"
5698 		"set_progress_funcs(self, start_func, update_func, stop_func, data)\n"
5699 		"\n"
5700 		"Parameters\n"
5701 		"----------\n"
5702 		"start_func: callable function\n"
5703 		"update_func: callable function\n"
5704 		"stop_func: callable function\n"
5705 		"data: object\n"
5706 		"\n"
5707 		"" },
5708   { "set_status_func", _wrap_Context_set_status_func, METH_VARARGS, "\n"
5709 		"set_status_func(self, func, data)\n"
5710 		"\n"
5711 		"Parameters\n"
5712 		"----------\n"
5713 		"func: callable function\n"
5714 		"data: object\n"
5715 		"\n"
5716 		"" },
5717   { NULL, NULL, 0, NULL } /* Sentinel */
5718 };
5719 
5720 static PyHeapTypeObject SwigPyBuiltin___GPContext_type = {
5721   {
5722 #if PY_VERSION_HEX >= 0x03000000
5723     PyVarObject_HEAD_INIT(NULL, 0)
5724 #else
5725     PyObject_HEAD_INIT(NULL)
5726     0,                                        /* ob_size */
5727 #endif
5728     "gphoto2.context.Context",                /* tp_name */
5729     sizeof(SwigPyObject),                     /* tp_basicsize */
5730     0,                                        /* tp_itemsize */
5731     _wrap_delete_Context_destructor_closure,  /* tp_dealloc */
5732     (printfunc) 0,                            /* tp_print */
5733     (getattrfunc) 0,                          /* tp_getattr */
5734     (setattrfunc) 0,                          /* tp_setattr */
5735 #if PY_VERSION_HEX >= 0x03000000
5736     0,                                        /* tp_compare */
5737 #else
5738     (cmpfunc) 0,                              /* tp_compare */
5739 #endif
5740     (reprfunc) 0,                             /* tp_repr */
5741     &SwigPyBuiltin___GPContext_type.as_number,/* tp_as_number */
5742     &SwigPyBuiltin___GPContext_type.as_sequence,                  /* tp_as_sequence */
5743     &SwigPyBuiltin___GPContext_type.as_mapping,                   /* tp_as_mapping */
5744     SwigPyObject_hash,                        /* tp_hash */
5745     (ternaryfunc) 0,                          /* tp_call */
5746     (reprfunc) 0,                             /* tp_str */
5747     (getattrofunc) 0,                         /* tp_getattro */
5748     (setattrofunc) 0,                         /* tp_setattro */
5749     &SwigPyBuiltin___GPContext_type.as_buffer,/* tp_as_buffer */
5750 #if PY_VERSION_HEX >= 0x03000000
5751     Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,   /* tp_flags */
5752 #else
5753     Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES, /* tp_flags */
5754 #endif
5755     "::_GPContext",                           /* tp_doc */
5756     (traverseproc) 0,                         /* tp_traverse */
5757     (inquiry) 0,                              /* tp_clear */
5758     SwigPyBuiltin___GPContext_richcompare,    /* tp_richcompare */
5759     0,                                        /* tp_weaklistoffset */
5760     (getiterfunc) 0,                          /* tp_iter */
5761     (iternextfunc) 0,                         /* tp_iternext */
5762     SwigPyBuiltin___GPContext_methods,        /* tp_methods */
5763     0,                                        /* tp_members */
5764     SwigPyBuiltin___GPContext_getset,         /* tp_getset */
5765     0,                                        /* tp_base */
5766     0,                                        /* tp_dict */
5767     (descrgetfunc) 0,                         /* tp_descr_get */
5768     (descrsetfunc) 0,                         /* tp_descr_set */
5769     offsetof(SwigPyObject, dict),             /* tp_dictoffset */
5770     _wrap_new_Context,                        /* tp_init */
5771     (allocfunc) 0,                            /* tp_alloc */
5772     (newfunc) 0,                              /* tp_new */
5773     (freefunc) 0,                             /* tp_free */
5774     (inquiry) 0,                              /* tp_is_gc */
5775     (PyObject *) 0,                           /* tp_bases */
5776     (PyObject *) 0,                           /* tp_mro */
5777     (PyObject *) 0,                           /* tp_cache */
5778     (PyObject *) 0,                           /* tp_subclasses */
5779     (PyObject *) 0,                           /* tp_weaklist */
5780     (destructor) 0,                           /* tp_del */
5781     (int) 0,                                  /* tp_version_tag */
5782 #if PY_VERSION_HEX >= 0x03040000
5783     (destructor) 0,                           /* tp_finalize */
5784 #endif
5785 #if PY_VERSION_HEX >= 0x03080000
5786     (vectorcallfunc) 0,                       /* tp_vectorcall */
5787 #endif
5788 #if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
5789     0,                                        /* tp_print */
5790 #endif
5791 #ifdef COUNT_ALLOCS
5792     (Py_ssize_t) 0,                           /* tp_allocs */
5793     (Py_ssize_t) 0,                           /* tp_frees */
5794     (Py_ssize_t) 0,                           /* tp_maxalloc */
5795     0,                                        /* tp_prev */
5796     0,                                        /* tp_next */
5797 #endif
5798   },
5799 #if PY_VERSION_HEX >= 0x03050000
5800   {
5801     (unaryfunc) 0,                            /* am_await */
5802     (unaryfunc) 0,                            /* am_aiter */
5803     (unaryfunc) 0,                            /* am_anext */
5804   },
5805 #endif
5806   {
5807     (binaryfunc) 0,                           /* nb_add */
5808     (binaryfunc) 0,                           /* nb_subtract */
5809     (binaryfunc) 0,                           /* nb_multiply */
5810 #if PY_VERSION_HEX < 0x03000000
5811     (binaryfunc) 0,                           /* nb_divide */
5812 #endif
5813     (binaryfunc) 0,                           /* nb_remainder */
5814     (binaryfunc) 0,                           /* nb_divmod */
5815     (ternaryfunc) 0,                          /* nb_power */
5816     (unaryfunc) 0,                            /* nb_negative */
5817     (unaryfunc) 0,                            /* nb_positive */
5818     (unaryfunc) 0,                            /* nb_absolute */
5819     (inquiry) 0,                              /* nb_nonzero */
5820     (unaryfunc) 0,                            /* nb_invert */
5821     (binaryfunc) 0,                           /* nb_lshift */
5822     (binaryfunc) 0,                           /* nb_rshift */
5823     (binaryfunc) 0,                           /* nb_and */
5824     (binaryfunc) 0,                           /* nb_xor */
5825     (binaryfunc) 0,                           /* nb_or */
5826 #if PY_VERSION_HEX < 0x03000000
5827     (coercion) 0,                             /* nb_coerce */
5828 #endif
5829     (unaryfunc) 0,                            /* nb_int */
5830 #if PY_VERSION_HEX >= 0x03000000
5831     (void *) 0,                               /* nb_reserved */
5832 #else
5833     (unaryfunc) 0,                            /* nb_long */
5834 #endif
5835     (unaryfunc) 0,                            /* nb_float */
5836 #if PY_VERSION_HEX < 0x03000000
5837     (unaryfunc) 0,                            /* nb_oct */
5838     (unaryfunc) 0,                            /* nb_hex */
5839 #endif
5840     (binaryfunc) 0,                           /* nb_inplace_add */
5841     (binaryfunc) 0,                           /* nb_inplace_subtract */
5842     (binaryfunc) 0,                           /* nb_inplace_multiply */
5843 #if PY_VERSION_HEX < 0x03000000
5844     (binaryfunc) 0,                           /* nb_inplace_divide */
5845 #endif
5846     (binaryfunc) 0,                           /* nb_inplace_remainder */
5847     (ternaryfunc) 0,                          /* nb_inplace_power */
5848     (binaryfunc) 0,                           /* nb_inplace_lshift */
5849     (binaryfunc) 0,                           /* nb_inplace_rshift */
5850     (binaryfunc) 0,                           /* nb_inplace_and */
5851     (binaryfunc) 0,                           /* nb_inplace_xor */
5852     (binaryfunc) 0,                           /* nb_inplace_or */
5853     (binaryfunc) 0,                           /* nb_floor_divide */
5854     (binaryfunc) 0,                           /* nb_true_divide */
5855     (binaryfunc) 0,                           /* nb_inplace_floor_divide */
5856     (binaryfunc) 0,                           /* nb_inplace_true_divide */
5857     (unaryfunc) 0,                            /* nb_index */
5858 #if PY_VERSION_HEX >= 0x03050000
5859     (binaryfunc) 0,                           /* nb_matrix_multiply */
5860     (binaryfunc) 0,                           /* nb_inplace_matrix_multiply */
5861 #endif
5862   },
5863   {
5864     (lenfunc) 0,                              /* mp_length */
5865     (binaryfunc) 0,                           /* mp_subscript */
5866     (objobjargproc) 0,                        /* mp_ass_subscript */
5867   },
5868   {
5869     (lenfunc) 0,                              /* sq_length */
5870     (binaryfunc) 0,                           /* sq_concat */
5871     (ssizeargfunc) 0,                         /* sq_repeat */
5872     (ssizeargfunc) 0,                         /* sq_item */
5873 #if PY_VERSION_HEX >= 0x03000000
5874     (void *) 0,                               /* was_sq_slice */
5875 #else
5876     (ssizessizeargfunc) 0,                    /* sq_slice */
5877 #endif
5878     (ssizeobjargproc) 0,                      /* sq_ass_item */
5879 #if PY_VERSION_HEX >= 0x03000000
5880     (void *) 0,                               /* was_sq_ass_slice */
5881 #else
5882     (ssizessizeobjargproc) 0,                 /* sq_ass_slice */
5883 #endif
5884     (objobjproc) 0,                           /* sq_contains */
5885     (binaryfunc) 0,                           /* sq_inplace_concat */
5886     (ssizeargfunc) 0,                         /* sq_inplace_repeat */
5887   },
5888   {
5889 #if PY_VERSION_HEX < 0x03000000
5890     (readbufferproc) 0,                       /* bf_getreadbuffer */
5891     (writebufferproc) 0,                      /* bf_getwritebuffer */
5892     (segcountproc) 0,                         /* bf_getsegcount */
5893     (charbufferproc) 0,                       /* bf_getcharbuffer */
5894 #endif
5895     (getbufferproc) 0,                        /* bf_getbuffer */
5896     (releasebufferproc) 0,                    /* bf_releasebuffer */
5897   },
5898     (PyObject *) 0,                           /* ht_name */
5899     (PyObject *) 0,                           /* ht_slots */
5900 #if PY_VERSION_HEX >= 0x03030000
5901     (PyObject *) 0,                           /* ht_qualname */
5902     0,                                        /* ht_cached_keys */
5903 #endif
5904 };
5905 
5906 SWIGINTERN SwigPyClientData SwigPyBuiltin___GPContext_clientdata = {0, 0, 0, 0, 0, 0, (PyTypeObject *)&SwigPyBuiltin___GPContext_type};
5907 
5908 
5909 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
5910 
5911 static swig_type_info _swigt__p_CallbackDetails = {"_p_CallbackDetails", "struct CallbackDetails *|CallbackDetails *", 0, 0, (void*)&SwigPyBuiltin__CallbackDetails_clientdata, 0};
5912 static swig_type_info _swigt__p_CameraAbilities = {"_p_CameraAbilities", "CameraAbilities *", 0, 0, (void*)0, 0};
5913 static swig_type_info _swigt__p_CameraCaptureType = {"_p_CameraCaptureType", "enum CameraCaptureType *|CameraCaptureType *", 0, 0, (void*)0, 0};
5914 static swig_type_info _swigt__p_CameraDriverStatus = {"_p_CameraDriverStatus", "enum CameraDriverStatus *|CameraDriverStatus *", 0, 0, (void*)0, 0};
5915 static swig_type_info _swigt__p_CameraEventType = {"_p_CameraEventType", "enum CameraEventType *|CameraEventType *", 0, 0, (void*)0, 0};
5916 static swig_type_info _swigt__p_CameraFileAccessType = {"_p_CameraFileAccessType", "enum CameraFileAccessType *|CameraFileAccessType *", 0, 0, (void*)0, 0};
5917 static swig_type_info _swigt__p_CameraFileInfoFields = {"_p_CameraFileInfoFields", "enum CameraFileInfoFields *|CameraFileInfoFields *", 0, 0, (void*)0, 0};
5918 static swig_type_info _swigt__p_CameraFileOperation = {"_p_CameraFileOperation", "enum CameraFileOperation *|CameraFileOperation *", 0, 0, (void*)0, 0};
5919 static swig_type_info _swigt__p_CameraFilePath = {"_p_CameraFilePath", "CameraFilePath *", 0, 0, (void*)0, 0};
5920 static swig_type_info _swigt__p_CameraFilePermissions = {"_p_CameraFilePermissions", "enum CameraFilePermissions *|CameraFilePermissions *", 0, 0, (void*)0, 0};
5921 static swig_type_info _swigt__p_CameraFileStatus = {"_p_CameraFileStatus", "enum CameraFileStatus *|CameraFileStatus *", 0, 0, (void*)0, 0};
5922 static swig_type_info _swigt__p_CameraFileType = {"_p_CameraFileType", "enum CameraFileType *|CameraFileType *", 0, 0, (void*)0, 0};
5923 static swig_type_info _swigt__p_CameraFolderOperation = {"_p_CameraFolderOperation", "enum CameraFolderOperation *|CameraFolderOperation *", 0, 0, (void*)0, 0};
5924 static swig_type_info _swigt__p_CameraOperation = {"_p_CameraOperation", "enum CameraOperation *|CameraOperation *", 0, 0, (void*)0, 0};
5925 static swig_type_info _swigt__p_CameraStorageAccessType = {"_p_CameraStorageAccessType", "enum CameraStorageAccessType *|CameraStorageAccessType *", 0, 0, (void*)0, 0};
5926 static swig_type_info _swigt__p_CameraStorageFilesystemType = {"_p_CameraStorageFilesystemType", "enum CameraStorageFilesystemType *|CameraStorageFilesystemType *", 0, 0, (void*)0, 0};
5927 static swig_type_info _swigt__p_CameraStorageInfoFields = {"_p_CameraStorageInfoFields", "enum CameraStorageInfoFields *|CameraStorageInfoFields *", 0, 0, (void*)0, 0};
5928 static swig_type_info _swigt__p_CameraStorageType = {"_p_CameraStorageType", "enum CameraStorageType *|CameraStorageType *", 0, 0, (void*)0, 0};
5929 static swig_type_info _swigt__p_CameraText = {"_p_CameraText", "CameraText *", 0, 0, (void*)0, 0};
5930 static swig_type_info _swigt__p_CameraWidgetType = {"_p_CameraWidgetType", "enum CameraWidgetType *|CameraWidgetType *", 0, 0, (void*)0, 0};
5931 static swig_type_info _swigt__p_GPLogLevel = {"_p_GPLogLevel", "enum GPLogLevel *|GPLogLevel *", 0, 0, (void*)0, 0};
5932 static swig_type_info _swigt__p_GPPortType = {"_p_GPPortType", "enum GPPortType *|GPPortType *", 0, 0, (void*)0, 0};
5933 static swig_type_info _swigt__p_GPVersionVerbosity = {"_p_GPVersionVerbosity", "enum GPVersionVerbosity *|GPVersionVerbosity *", 0, 0, (void*)0, 0};
5934 static swig_type_info _swigt__p_GphotoDeviceType = {"_p_GphotoDeviceType", "enum GphotoDeviceType *|GphotoDeviceType *", 0, 0, (void*)0, 0};
5935 static swig_type_info _swigt__p_SwigPyObject = {"_p_SwigPyObject", "SwigPyObject *", 0, 0, (void*)0, 0};
5936 static swig_type_info _swigt__p__Camera = {"_p__Camera", "struct _Camera *|Camera *", 0, 0, (void*)0, 0};
5937 static swig_type_info _swigt__p__CameraAbilitiesList = {"_p__CameraAbilitiesList", "struct _CameraAbilitiesList *|CameraAbilitiesList *", 0, 0, (void*)0, 0};
5938 static swig_type_info _swigt__p__CameraFile = {"_p__CameraFile", "struct _CameraFile *|CameraFile *", 0, 0, (void*)0, 0};
5939 static swig_type_info _swigt__p__CameraFileHandler = {"_p__CameraFileHandler", "struct _CameraFileHandler *|CameraFileHandler *", 0, 0, (void*)0, 0};
5940 static swig_type_info _swigt__p__CameraFileInfo = {"_p__CameraFileInfo", "struct _CameraFileInfo *|CameraFileInfo *", 0, 0, (void*)0, 0};
5941 static swig_type_info _swigt__p__CameraFileInfoAudio = {"_p__CameraFileInfoAudio", "struct _CameraFileInfoAudio *|CameraFileInfoAudio *", 0, 0, (void*)0, 0};
5942 static swig_type_info _swigt__p__CameraFileInfoFile = {"_p__CameraFileInfoFile", "struct _CameraFileInfoFile *|CameraFileInfoFile *", 0, 0, (void*)0, 0};
5943 static swig_type_info _swigt__p__CameraFileInfoPreview = {"_p__CameraFileInfoPreview", "struct _CameraFileInfoPreview *|CameraFileInfoPreview *", 0, 0, (void*)0, 0};
5944 static swig_type_info _swigt__p__CameraFilesystem = {"_p__CameraFilesystem", "struct _CameraFilesystem *|CameraFilesystem *", 0, 0, (void*)0, 0};
5945 static swig_type_info _swigt__p__CameraFilesystemFuncs = {"_p__CameraFilesystemFuncs", "struct _CameraFilesystemFuncs *|CameraFilesystemFuncs *", 0, 0, (void*)0, 0};
5946 static swig_type_info _swigt__p__CameraFunctions = {"_p__CameraFunctions", "struct _CameraFunctions *|CameraFunctions *", 0, 0, (void*)0, 0};
5947 static swig_type_info _swigt__p__CameraList = {"_p__CameraList", "struct _CameraList *|CameraList *", 0, 0, (void*)0, 0};
5948 static swig_type_info _swigt__p__CameraPrivateCore = {"_p__CameraPrivateCore", "struct _CameraPrivateCore *|CameraPrivateCore *", 0, 0, (void*)0, 0};
5949 static swig_type_info _swigt__p__CameraPrivateLibrary = {"_p__CameraPrivateLibrary", "struct _CameraPrivateLibrary *|CameraPrivateLibrary *", 0, 0, (void*)0, 0};
5950 static swig_type_info _swigt__p__CameraStorageInformation = {"_p__CameraStorageInformation", "struct _CameraStorageInformation *|CameraStorageInformation *", 0, 0, (void*)0, 0};
5951 static swig_type_info _swigt__p__CameraWidget = {"_p__CameraWidget", "struct _CameraWidget *|CameraWidget *", 0, 0, (void*)0, 0};
5952 static swig_type_info _swigt__p__GPContext = {"_p__GPContext", "struct _GPContext *|GPContext *|_GPContext *", 0, 0, (void*)&SwigPyBuiltin___GPContext_clientdata, 0};
5953 static swig_type_info _swigt__p__GPContextFeedback = {"_p__GPContextFeedback", "enum _GPContextFeedback *|GPContextFeedback *", 0, 0, (void*)0, 0};
5954 static swig_type_info _swigt__p__GPPortInfoList = {"_p__GPPortInfoList", "struct _GPPortInfoList *|GPPortInfoList *", 0, 0, (void*)0, 0};
5955 static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
5956 static swig_type_info _swigt__p_f_p_struct__GPContext_float_p_q_const__char_p_void__unsigned_int = {"_p_f_p_struct__GPContext_float_p_q_const__char_p_void__unsigned_int", "unsigned int (*)(struct _GPContext *,float,char const *,void *)|GPContextProgressStartFunc", 0, 0, (void*)0, 0};
5957 static swig_type_info _swigt__p_f_p_struct__GPContext_p_q_const__char_p_void___GPContextFeedback = {"_p_f_p_struct__GPContext_p_q_const__char_p_void___GPContextFeedback", "enum _GPContextFeedback (*)(struct _GPContext *,char const *,void *)|GPContextQuestionFunc", 0, 0, (void*)0, 0};
5958 static swig_type_info _swigt__p_f_p_struct__GPContext_p_q_const__char_p_void__void = {"_p_f_p_struct__GPContext_p_q_const__char_p_void__void", "GPContextErrorFunc|GPContextMessageFunc|GPContextStatusFunc|void (*)(struct _GPContext *,char const *,void *)", 0, 0, (void*)0, 0};
5959 static swig_type_info _swigt__p_f_p_struct__GPContext_p_void___GPContextFeedback = {"_p_f_p_struct__GPContext_p_void___GPContextFeedback", "enum _GPContextFeedback (*)(struct _GPContext *,void *)|GPContextCancelFunc", 0, 0, (void*)0, 0};
5960 static swig_type_info _swigt__p_f_p_struct__GPContext_p_void__void = {"_p_f_p_struct__GPContext_p_void__void", "void (*)(struct _GPContext *,void *)|GPContextIdleFunc", 0, 0, (void*)0, 0};
5961 static swig_type_info _swigt__p_f_p_struct__GPContext_unsigned_int_float_p_void__void = {"_p_f_p_struct__GPContext_unsigned_int_float_p_void__void", "void (*)(struct _GPContext *,unsigned int,float,void *)|GPContextProgressUpdateFunc", 0, 0, (void*)0, 0};
5962 static swig_type_info _swigt__p_f_p_struct__GPContext_unsigned_int_p_void__void = {"_p_f_p_struct__GPContext_unsigned_int_p_void__void", "void (*)(struct _GPContext *,unsigned int,void *)|GPContextProgressStopFunc", 0, 0, (void*)0, 0};
5963 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};
5964 static swig_type_info _swigt__p_long = {"_p_long", "long *|time_t *", 0, 0, (void*)0, 0};
5965 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};
5966 static swig_type_info _swigt__p_short = {"_p_short", "short *|int_least16_t *|int16_t *", 0, 0, (void*)0, 0};
5967 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};
5968 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};
5969 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};
5970 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};
5971 static swig_type_info _swigt__p_unsigned_short = {"_p_unsigned_short", "unsigned short *|uint_least16_t *|uint16_t *", 0, 0, (void*)0, 0};
5972 
5973 static swig_type_info *swig_type_initial[] = {
5974   &_swigt__p_CallbackDetails,
5975   &_swigt__p_CameraAbilities,
5976   &_swigt__p_CameraCaptureType,
5977   &_swigt__p_CameraDriverStatus,
5978   &_swigt__p_CameraEventType,
5979   &_swigt__p_CameraFileAccessType,
5980   &_swigt__p_CameraFileInfoFields,
5981   &_swigt__p_CameraFileOperation,
5982   &_swigt__p_CameraFilePath,
5983   &_swigt__p_CameraFilePermissions,
5984   &_swigt__p_CameraFileStatus,
5985   &_swigt__p_CameraFileType,
5986   &_swigt__p_CameraFolderOperation,
5987   &_swigt__p_CameraOperation,
5988   &_swigt__p_CameraStorageAccessType,
5989   &_swigt__p_CameraStorageFilesystemType,
5990   &_swigt__p_CameraStorageInfoFields,
5991   &_swigt__p_CameraStorageType,
5992   &_swigt__p_CameraText,
5993   &_swigt__p_CameraWidgetType,
5994   &_swigt__p_GPLogLevel,
5995   &_swigt__p_GPPortType,
5996   &_swigt__p_GPVersionVerbosity,
5997   &_swigt__p_GphotoDeviceType,
5998   &_swigt__p_SwigPyObject,
5999   &_swigt__p__Camera,
6000   &_swigt__p__CameraAbilitiesList,
6001   &_swigt__p__CameraFile,
6002   &_swigt__p__CameraFileHandler,
6003   &_swigt__p__CameraFileInfo,
6004   &_swigt__p__CameraFileInfoAudio,
6005   &_swigt__p__CameraFileInfoFile,
6006   &_swigt__p__CameraFileInfoPreview,
6007   &_swigt__p__CameraFilesystem,
6008   &_swigt__p__CameraFilesystemFuncs,
6009   &_swigt__p__CameraFunctions,
6010   &_swigt__p__CameraList,
6011   &_swigt__p__CameraPrivateCore,
6012   &_swigt__p__CameraPrivateLibrary,
6013   &_swigt__p__CameraStorageInformation,
6014   &_swigt__p__CameraWidget,
6015   &_swigt__p__GPContext,
6016   &_swigt__p__GPContextFeedback,
6017   &_swigt__p__GPPortInfoList,
6018   &_swigt__p_char,
6019   &_swigt__p_f_p_struct__GPContext_float_p_q_const__char_p_void__unsigned_int,
6020   &_swigt__p_f_p_struct__GPContext_p_q_const__char_p_void___GPContextFeedback,
6021   &_swigt__p_f_p_struct__GPContext_p_q_const__char_p_void__void,
6022   &_swigt__p_f_p_struct__GPContext_p_void___GPContextFeedback,
6023   &_swigt__p_f_p_struct__GPContext_p_void__void,
6024   &_swigt__p_f_p_struct__GPContext_unsigned_int_float_p_void__void,
6025   &_swigt__p_f_p_struct__GPContext_unsigned_int_p_void__void,
6026   &_swigt__p_int,
6027   &_swigt__p_long,
6028   &_swigt__p_long_long,
6029   &_swigt__p_short,
6030   &_swigt__p_signed_char,
6031   &_swigt__p_unsigned_char,
6032   &_swigt__p_unsigned_int,
6033   &_swigt__p_unsigned_long_long,
6034   &_swigt__p_unsigned_short,
6035 };
6036 
6037 static swig_cast_info _swigc__p_CallbackDetails[] = {  {&_swigt__p_CallbackDetails, 0, 0, 0},{0, 0, 0, 0}};
6038 static swig_cast_info _swigc__p_CameraAbilities[] = {  {&_swigt__p_CameraAbilities, 0, 0, 0},{0, 0, 0, 0}};
6039 static swig_cast_info _swigc__p_CameraCaptureType[] = {  {&_swigt__p_CameraCaptureType, 0, 0, 0},{0, 0, 0, 0}};
6040 static swig_cast_info _swigc__p_CameraDriverStatus[] = {  {&_swigt__p_CameraDriverStatus, 0, 0, 0},{0, 0, 0, 0}};
6041 static swig_cast_info _swigc__p_CameraEventType[] = {  {&_swigt__p_CameraEventType, 0, 0, 0},{0, 0, 0, 0}};
6042 static swig_cast_info _swigc__p_CameraFileAccessType[] = {  {&_swigt__p_CameraFileAccessType, 0, 0, 0},{0, 0, 0, 0}};
6043 static swig_cast_info _swigc__p_CameraFileInfoFields[] = {  {&_swigt__p_CameraFileInfoFields, 0, 0, 0},{0, 0, 0, 0}};
6044 static swig_cast_info _swigc__p_CameraFileOperation[] = {  {&_swigt__p_CameraFileOperation, 0, 0, 0},{0, 0, 0, 0}};
6045 static swig_cast_info _swigc__p_CameraFilePath[] = {  {&_swigt__p_CameraFilePath, 0, 0, 0},{0, 0, 0, 0}};
6046 static swig_cast_info _swigc__p_CameraFilePermissions[] = {  {&_swigt__p_CameraFilePermissions, 0, 0, 0},{0, 0, 0, 0}};
6047 static swig_cast_info _swigc__p_CameraFileStatus[] = {  {&_swigt__p_CameraFileStatus, 0, 0, 0},{0, 0, 0, 0}};
6048 static swig_cast_info _swigc__p_CameraFileType[] = {  {&_swigt__p_CameraFileType, 0, 0, 0},{0, 0, 0, 0}};
6049 static swig_cast_info _swigc__p_CameraFolderOperation[] = {  {&_swigt__p_CameraFolderOperation, 0, 0, 0},{0, 0, 0, 0}};
6050 static swig_cast_info _swigc__p_CameraOperation[] = {  {&_swigt__p_CameraOperation, 0, 0, 0},{0, 0, 0, 0}};
6051 static swig_cast_info _swigc__p_CameraStorageAccessType[] = {  {&_swigt__p_CameraStorageAccessType, 0, 0, 0},{0, 0, 0, 0}};
6052 static swig_cast_info _swigc__p_CameraStorageFilesystemType[] = {  {&_swigt__p_CameraStorageFilesystemType, 0, 0, 0},{0, 0, 0, 0}};
6053 static swig_cast_info _swigc__p_CameraStorageInfoFields[] = {  {&_swigt__p_CameraStorageInfoFields, 0, 0, 0},{0, 0, 0, 0}};
6054 static swig_cast_info _swigc__p_CameraStorageType[] = {  {&_swigt__p_CameraStorageType, 0, 0, 0},{0, 0, 0, 0}};
6055 static swig_cast_info _swigc__p_CameraText[] = {  {&_swigt__p_CameraText, 0, 0, 0},{0, 0, 0, 0}};
6056 static swig_cast_info _swigc__p_CameraWidgetType[] = {  {&_swigt__p_CameraWidgetType, 0, 0, 0},{0, 0, 0, 0}};
6057 static swig_cast_info _swigc__p_GPLogLevel[] = {  {&_swigt__p_GPLogLevel, 0, 0, 0},{0, 0, 0, 0}};
6058 static swig_cast_info _swigc__p_GPPortType[] = {  {&_swigt__p_GPPortType, 0, 0, 0},{0, 0, 0, 0}};
6059 static swig_cast_info _swigc__p_GPVersionVerbosity[] = {  {&_swigt__p_GPVersionVerbosity, 0, 0, 0},{0, 0, 0, 0}};
6060 static swig_cast_info _swigc__p_GphotoDeviceType[] = {  {&_swigt__p_GphotoDeviceType, 0, 0, 0},{0, 0, 0, 0}};
6061 static swig_cast_info _swigc__p_SwigPyObject[] = {  {&_swigt__p_SwigPyObject, 0, 0, 0},{0, 0, 0, 0}};
6062 static swig_cast_info _swigc__p__Camera[] = {  {&_swigt__p__Camera, 0, 0, 0},{0, 0, 0, 0}};
6063 static swig_cast_info _swigc__p__CameraAbilitiesList[] = {  {&_swigt__p__CameraAbilitiesList, 0, 0, 0},{0, 0, 0, 0}};
6064 static swig_cast_info _swigc__p__CameraFile[] = {  {&_swigt__p__CameraFile, 0, 0, 0},{0, 0, 0, 0}};
6065 static swig_cast_info _swigc__p__CameraFileHandler[] = {  {&_swigt__p__CameraFileHandler, 0, 0, 0},{0, 0, 0, 0}};
6066 static swig_cast_info _swigc__p__CameraFileInfo[] = {  {&_swigt__p__CameraFileInfo, 0, 0, 0},{0, 0, 0, 0}};
6067 static swig_cast_info _swigc__p__CameraFileInfoAudio[] = {  {&_swigt__p__CameraFileInfoAudio, 0, 0, 0},{0, 0, 0, 0}};
6068 static swig_cast_info _swigc__p__CameraFileInfoFile[] = {  {&_swigt__p__CameraFileInfoFile, 0, 0, 0},{0, 0, 0, 0}};
6069 static swig_cast_info _swigc__p__CameraFileInfoPreview[] = {  {&_swigt__p__CameraFileInfoPreview, 0, 0, 0},{0, 0, 0, 0}};
6070 static swig_cast_info _swigc__p__CameraFilesystem[] = {  {&_swigt__p__CameraFilesystem, 0, 0, 0},{0, 0, 0, 0}};
6071 static swig_cast_info _swigc__p__CameraFilesystemFuncs[] = {  {&_swigt__p__CameraFilesystemFuncs, 0, 0, 0},{0, 0, 0, 0}};
6072 static swig_cast_info _swigc__p__CameraFunctions[] = {  {&_swigt__p__CameraFunctions, 0, 0, 0},{0, 0, 0, 0}};
6073 static swig_cast_info _swigc__p__CameraList[] = {  {&_swigt__p__CameraList, 0, 0, 0},{0, 0, 0, 0}};
6074 static swig_cast_info _swigc__p__CameraPrivateCore[] = {  {&_swigt__p__CameraPrivateCore, 0, 0, 0},{0, 0, 0, 0}};
6075 static swig_cast_info _swigc__p__CameraPrivateLibrary[] = {  {&_swigt__p__CameraPrivateLibrary, 0, 0, 0},{0, 0, 0, 0}};
6076 static swig_cast_info _swigc__p__CameraStorageInformation[] = {  {&_swigt__p__CameraStorageInformation, 0, 0, 0},{0, 0, 0, 0}};
6077 static swig_cast_info _swigc__p__CameraWidget[] = {  {&_swigt__p__CameraWidget, 0, 0, 0},{0, 0, 0, 0}};
6078 static swig_cast_info _swigc__p__GPContext[] = {  {&_swigt__p__GPContext, 0, 0, 0},{0, 0, 0, 0}};
6079 static swig_cast_info _swigc__p__GPContextFeedback[] = {  {&_swigt__p__GPContextFeedback, 0, 0, 0},{0, 0, 0, 0}};
6080 static swig_cast_info _swigc__p__GPPortInfoList[] = {  {&_swigt__p__GPPortInfoList, 0, 0, 0},{0, 0, 0, 0}};
6081 static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
6082 static swig_cast_info _swigc__p_f_p_struct__GPContext_float_p_q_const__char_p_void__unsigned_int[] = {  {&_swigt__p_f_p_struct__GPContext_float_p_q_const__char_p_void__unsigned_int, 0, 0, 0},{0, 0, 0, 0}};
6083 static swig_cast_info _swigc__p_f_p_struct__GPContext_p_q_const__char_p_void___GPContextFeedback[] = {  {&_swigt__p_f_p_struct__GPContext_p_q_const__char_p_void___GPContextFeedback, 0, 0, 0},{0, 0, 0, 0}};
6084 static swig_cast_info _swigc__p_f_p_struct__GPContext_p_q_const__char_p_void__void[] = {  {&_swigt__p_f_p_struct__GPContext_p_q_const__char_p_void__void, 0, 0, 0},{0, 0, 0, 0}};
6085 static swig_cast_info _swigc__p_f_p_struct__GPContext_p_void___GPContextFeedback[] = {  {&_swigt__p_f_p_struct__GPContext_p_void___GPContextFeedback, 0, 0, 0},{0, 0, 0, 0}};
6086 static swig_cast_info _swigc__p_f_p_struct__GPContext_p_void__void[] = {  {&_swigt__p_f_p_struct__GPContext_p_void__void, 0, 0, 0},{0, 0, 0, 0}};
6087 static swig_cast_info _swigc__p_f_p_struct__GPContext_unsigned_int_float_p_void__void[] = {  {&_swigt__p_f_p_struct__GPContext_unsigned_int_float_p_void__void, 0, 0, 0},{0, 0, 0, 0}};
6088 static swig_cast_info _swigc__p_f_p_struct__GPContext_unsigned_int_p_void__void[] = {  {&_swigt__p_f_p_struct__GPContext_unsigned_int_p_void__void, 0, 0, 0},{0, 0, 0, 0}};
6089 static swig_cast_info _swigc__p_int[] = {  {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
6090 static swig_cast_info _swigc__p_long[] = {  {&_swigt__p_long, 0, 0, 0},{0, 0, 0, 0}};
6091 static swig_cast_info _swigc__p_long_long[] = {  {&_swigt__p_long_long, 0, 0, 0},{0, 0, 0, 0}};
6092 static swig_cast_info _swigc__p_short[] = {  {&_swigt__p_short, 0, 0, 0},{0, 0, 0, 0}};
6093 static swig_cast_info _swigc__p_signed_char[] = {  {&_swigt__p_signed_char, 0, 0, 0},{0, 0, 0, 0}};
6094 static swig_cast_info _swigc__p_unsigned_char[] = {  {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
6095 static swig_cast_info _swigc__p_unsigned_int[] = {  {&_swigt__p_unsigned_int, 0, 0, 0},{0, 0, 0, 0}};
6096 static swig_cast_info _swigc__p_unsigned_long_long[] = {  {&_swigt__p_unsigned_long_long, 0, 0, 0},{0, 0, 0, 0}};
6097 static swig_cast_info _swigc__p_unsigned_short[] = {  {&_swigt__p_unsigned_short, 0, 0, 0},{0, 0, 0, 0}};
6098 
6099 static swig_cast_info *swig_cast_initial[] = {
6100   _swigc__p_CallbackDetails,
6101   _swigc__p_CameraAbilities,
6102   _swigc__p_CameraCaptureType,
6103   _swigc__p_CameraDriverStatus,
6104   _swigc__p_CameraEventType,
6105   _swigc__p_CameraFileAccessType,
6106   _swigc__p_CameraFileInfoFields,
6107   _swigc__p_CameraFileOperation,
6108   _swigc__p_CameraFilePath,
6109   _swigc__p_CameraFilePermissions,
6110   _swigc__p_CameraFileStatus,
6111   _swigc__p_CameraFileType,
6112   _swigc__p_CameraFolderOperation,
6113   _swigc__p_CameraOperation,
6114   _swigc__p_CameraStorageAccessType,
6115   _swigc__p_CameraStorageFilesystemType,
6116   _swigc__p_CameraStorageInfoFields,
6117   _swigc__p_CameraStorageType,
6118   _swigc__p_CameraText,
6119   _swigc__p_CameraWidgetType,
6120   _swigc__p_GPLogLevel,
6121   _swigc__p_GPPortType,
6122   _swigc__p_GPVersionVerbosity,
6123   _swigc__p_GphotoDeviceType,
6124   _swigc__p_SwigPyObject,
6125   _swigc__p__Camera,
6126   _swigc__p__CameraAbilitiesList,
6127   _swigc__p__CameraFile,
6128   _swigc__p__CameraFileHandler,
6129   _swigc__p__CameraFileInfo,
6130   _swigc__p__CameraFileInfoAudio,
6131   _swigc__p__CameraFileInfoFile,
6132   _swigc__p__CameraFileInfoPreview,
6133   _swigc__p__CameraFilesystem,
6134   _swigc__p__CameraFilesystemFuncs,
6135   _swigc__p__CameraFunctions,
6136   _swigc__p__CameraList,
6137   _swigc__p__CameraPrivateCore,
6138   _swigc__p__CameraPrivateLibrary,
6139   _swigc__p__CameraStorageInformation,
6140   _swigc__p__CameraWidget,
6141   _swigc__p__GPContext,
6142   _swigc__p__GPContextFeedback,
6143   _swigc__p__GPPortInfoList,
6144   _swigc__p_char,
6145   _swigc__p_f_p_struct__GPContext_float_p_q_const__char_p_void__unsigned_int,
6146   _swigc__p_f_p_struct__GPContext_p_q_const__char_p_void___GPContextFeedback,
6147   _swigc__p_f_p_struct__GPContext_p_q_const__char_p_void__void,
6148   _swigc__p_f_p_struct__GPContext_p_void___GPContextFeedback,
6149   _swigc__p_f_p_struct__GPContext_p_void__void,
6150   _swigc__p_f_p_struct__GPContext_unsigned_int_float_p_void__void,
6151   _swigc__p_f_p_struct__GPContext_unsigned_int_p_void__void,
6152   _swigc__p_int,
6153   _swigc__p_long,
6154   _swigc__p_long_long,
6155   _swigc__p_short,
6156   _swigc__p_signed_char,
6157   _swigc__p_unsigned_char,
6158   _swigc__p_unsigned_int,
6159   _swigc__p_unsigned_long_long,
6160   _swigc__p_unsigned_short,
6161 };
6162 
6163 
6164 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
6165 
6166 static swig_const_info swig_const_table[] = {
6167 {0, 0, 0, 0.0, 0, 0}};
6168 
6169 #ifdef __cplusplus
6170 }
6171 #endif
6172 static PyTypeObject *builtin_bases[2];
6173 
6174 /* -----------------------------------------------------------------------------
6175  * Type initialization:
6176  * This problem is tough by the requirement that no dynamic
6177  * memory is used. Also, since swig_type_info structures store pointers to
6178  * swig_cast_info structures and swig_cast_info structures store pointers back
6179  * to swig_type_info structures, we need some lookup code at initialization.
6180  * The idea is that swig generates all the structures that are needed.
6181  * The runtime then collects these partially filled structures.
6182  * The SWIG_InitializeModule function takes these initial arrays out of
6183  * swig_module, and does all the lookup, filling in the swig_module.types
6184  * array with the correct data and linking the correct swig_cast_info
6185  * structures together.
6186  *
6187  * The generated swig_type_info structures are assigned statically to an initial
6188  * array. We just loop through that array, and handle each type individually.
6189  * First we lookup if this type has been already loaded, and if so, use the
6190  * loaded structure instead of the generated one. Then we have to fill in the
6191  * cast linked list. The cast data is initially stored in something like a
6192  * two-dimensional array. Each row corresponds to a type (there are the same
6193  * number of rows as there are in the swig_type_initial array). Each entry in
6194  * a column is one of the swig_cast_info structures for that type.
6195  * The cast_initial array is actually an array of arrays, because each row has
6196  * a variable number of columns. So to actually build the cast linked list,
6197  * we find the array of casts associated with the type, and loop through it
6198  * adding the casts to the list. The one last trick we need to do is making
6199  * sure the type pointer in the swig_cast_info struct is correct.
6200  *
6201  * First off, we lookup the cast->type name to see if it is already loaded.
6202  * There are three cases to handle:
6203  *  1) If the cast->type has already been loaded AND the type we are adding
6204  *     casting info to has not been loaded (it is in this module), THEN we
6205  *     replace the cast->type pointer with the type pointer that has already
6206  *     been loaded.
6207  *  2) If BOTH types (the one we are adding casting info to, and the
6208  *     cast->type) are loaded, THEN the cast info has already been loaded by
6209  *     the previous module so we just ignore it.
6210  *  3) Finally, if cast->type has not already been loaded, then we add that
6211  *     swig_cast_info to the linked list (because the cast->type) pointer will
6212  *     be correct.
6213  * ----------------------------------------------------------------------------- */
6214 
6215 #ifdef __cplusplus
6216 extern "C" {
6217 #if 0
6218 } /* c-mode */
6219 #endif
6220 #endif
6221 
6222 #if 0
6223 #define SWIGRUNTIME_DEBUG
6224 #endif
6225 
6226 
6227 SWIGRUNTIME void
SWIG_InitializeModule(void * clientdata)6228 SWIG_InitializeModule(void *clientdata) {
6229   size_t i;
6230   swig_module_info *module_head, *iter;
6231   int init;
6232 
6233   /* check to see if the circular list has been setup, if not, set it up */
6234   if (swig_module.next==0) {
6235     /* Initialize the swig_module */
6236     swig_module.type_initial = swig_type_initial;
6237     swig_module.cast_initial = swig_cast_initial;
6238     swig_module.next = &swig_module;
6239     init = 1;
6240   } else {
6241     init = 0;
6242   }
6243 
6244   /* Try and load any already created modules */
6245   module_head = SWIG_GetModule(clientdata);
6246   if (!module_head) {
6247     /* This is the first module loaded for this interpreter */
6248     /* so set the swig module into the interpreter */
6249     SWIG_SetModule(clientdata, &swig_module);
6250   } else {
6251     /* the interpreter has loaded a SWIG module, but has it loaded this one? */
6252     iter=module_head;
6253     do {
6254       if (iter==&swig_module) {
6255         /* Our module is already in the list, so there's nothing more to do. */
6256         return;
6257       }
6258       iter=iter->next;
6259     } while (iter!= module_head);
6260 
6261     /* otherwise we must add our module into the list */
6262     swig_module.next = module_head->next;
6263     module_head->next = &swig_module;
6264   }
6265 
6266   /* When multiple interpreters are used, a module could have already been initialized in
6267        a different interpreter, but not yet have a pointer in this interpreter.
6268        In this case, we do not want to continue adding types... everything should be
6269        set up already */
6270   if (init == 0) return;
6271 
6272   /* Now work on filling in swig_module.types */
6273 #ifdef SWIGRUNTIME_DEBUG
6274   printf("SWIG_InitializeModule: size %lu\n", (unsigned long)swig_module.size);
6275 #endif
6276   for (i = 0; i < swig_module.size; ++i) {
6277     swig_type_info *type = 0;
6278     swig_type_info *ret;
6279     swig_cast_info *cast;
6280 
6281 #ifdef SWIGRUNTIME_DEBUG
6282     printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name);
6283 #endif
6284 
6285     /* if there is another module already loaded */
6286     if (swig_module.next != &swig_module) {
6287       type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
6288     }
6289     if (type) {
6290       /* Overwrite clientdata field */
6291 #ifdef SWIGRUNTIME_DEBUG
6292       printf("SWIG_InitializeModule: found type %s\n", type->name);
6293 #endif
6294       if (swig_module.type_initial[i]->clientdata) {
6295         type->clientdata = swig_module.type_initial[i]->clientdata;
6296 #ifdef SWIGRUNTIME_DEBUG
6297         printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
6298 #endif
6299       }
6300     } else {
6301       type = swig_module.type_initial[i];
6302     }
6303 
6304     /* Insert casting types */
6305     cast = swig_module.cast_initial[i];
6306     while (cast->type) {
6307       /* Don't need to add information already in the list */
6308       ret = 0;
6309 #ifdef SWIGRUNTIME_DEBUG
6310       printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
6311 #endif
6312       if (swig_module.next != &swig_module) {
6313         ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
6314 #ifdef SWIGRUNTIME_DEBUG
6315         if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
6316 #endif
6317       }
6318       if (ret) {
6319         if (type == swig_module.type_initial[i]) {
6320 #ifdef SWIGRUNTIME_DEBUG
6321           printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
6322 #endif
6323           cast->type = ret;
6324           ret = 0;
6325         } else {
6326           /* Check for casting already in the list */
6327           swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
6328 #ifdef SWIGRUNTIME_DEBUG
6329           if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
6330 #endif
6331           if (!ocast) ret = 0;
6332         }
6333       }
6334 
6335       if (!ret) {
6336 #ifdef SWIGRUNTIME_DEBUG
6337         printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
6338 #endif
6339         if (type->cast) {
6340           type->cast->prev = cast;
6341           cast->next = type->cast;
6342         }
6343         type->cast = cast;
6344       }
6345       cast++;
6346     }
6347     /* Set entry in modules->types array equal to the type */
6348     swig_module.types[i] = type;
6349   }
6350   swig_module.types[i] = 0;
6351 
6352 #ifdef SWIGRUNTIME_DEBUG
6353   printf("**** SWIG_InitializeModule: Cast List ******\n");
6354   for (i = 0; i < swig_module.size; ++i) {
6355     int j = 0;
6356     swig_cast_info *cast = swig_module.cast_initial[i];
6357     printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name);
6358     while (cast->type) {
6359       printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
6360       cast++;
6361       ++j;
6362     }
6363     printf("---- Total casts: %d\n",j);
6364   }
6365   printf("**** SWIG_InitializeModule: Cast List ******\n");
6366 #endif
6367 }
6368 
6369 /* This function will propagate the clientdata field of type to
6370 * any new swig_type_info structures that have been added into the list
6371 * of equivalent types.  It is like calling
6372 * SWIG_TypeClientData(type, clientdata) a second time.
6373 */
6374 SWIGRUNTIME void
SWIG_PropagateClientData(void)6375 SWIG_PropagateClientData(void) {
6376   size_t i;
6377   swig_cast_info *equiv;
6378   static int init_run = 0;
6379 
6380   if (init_run) return;
6381   init_run = 1;
6382 
6383   for (i = 0; i < swig_module.size; i++) {
6384     if (swig_module.types[i]->clientdata) {
6385       equiv = swig_module.types[i]->cast;
6386       while (equiv) {
6387         if (!equiv->converter) {
6388           if (equiv->type && !equiv->type->clientdata)
6389           SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
6390         }
6391         equiv = equiv->next;
6392       }
6393     }
6394   }
6395 }
6396 
6397 #ifdef __cplusplus
6398 #if 0
6399 {
6400   /* c-mode */
6401 #endif
6402 }
6403 #endif
6404 
6405 
6406 
6407 #ifdef __cplusplus
6408 extern "C" {
6409 #endif
6410 
6411   /* Python-specific SWIG API */
6412 #define SWIG_newvarlink()                             SWIG_Python_newvarlink()
6413 #define SWIG_addvarlink(p, name, get_attr, set_attr)  SWIG_Python_addvarlink(p, name, get_attr, set_attr)
6414 #define SWIG_InstallConstants(d, constants)           SWIG_Python_InstallConstants(d, constants)
6415 
6416   /* -----------------------------------------------------------------------------
6417    * global variable support code.
6418    * ----------------------------------------------------------------------------- */
6419 
6420   typedef struct swig_globalvar {
6421     char       *name;                  /* Name of global variable */
6422     PyObject *(*get_attr)(void);       /* Return the current value */
6423     int       (*set_attr)(PyObject *); /* Set the value */
6424     struct swig_globalvar *next;
6425   } swig_globalvar;
6426 
6427   typedef struct swig_varlinkobject {
6428     PyObject_HEAD
6429     swig_globalvar *vars;
6430   } swig_varlinkobject;
6431 
6432   SWIGINTERN PyObject *
swig_varlink_repr(swig_varlinkobject * SWIGUNUSEDPARM (v))6433   swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) {
6434 #if PY_VERSION_HEX >= 0x03000000
6435     return PyUnicode_InternFromString("<Swig global variables>");
6436 #else
6437     return PyString_FromString("<Swig global variables>");
6438 #endif
6439   }
6440 
6441   SWIGINTERN PyObject *
swig_varlink_str(swig_varlinkobject * v)6442   swig_varlink_str(swig_varlinkobject *v) {
6443 #if PY_VERSION_HEX >= 0x03000000
6444     PyObject *str = PyUnicode_InternFromString("(");
6445     PyObject *tail;
6446     PyObject *joined;
6447     swig_globalvar *var;
6448     for (var = v->vars; var; var=var->next) {
6449       tail = PyUnicode_FromString(var->name);
6450       joined = PyUnicode_Concat(str, tail);
6451       Py_DecRef(str);
6452       Py_DecRef(tail);
6453       str = joined;
6454       if (var->next) {
6455         tail = PyUnicode_InternFromString(", ");
6456         joined = PyUnicode_Concat(str, tail);
6457         Py_DecRef(str);
6458         Py_DecRef(tail);
6459         str = joined;
6460       }
6461     }
6462     tail = PyUnicode_InternFromString(")");
6463     joined = PyUnicode_Concat(str, tail);
6464     Py_DecRef(str);
6465     Py_DecRef(tail);
6466     str = joined;
6467 #else
6468     PyObject *str = PyString_FromString("(");
6469     swig_globalvar *var;
6470     for (var = v->vars; var; var=var->next) {
6471       PyString_ConcatAndDel(&str,PyString_FromString(var->name));
6472       if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", "));
6473     }
6474     PyString_ConcatAndDel(&str,PyString_FromString(")"));
6475 #endif
6476     return str;
6477   }
6478 
6479   SWIGINTERN void
swig_varlink_dealloc(swig_varlinkobject * v)6480   swig_varlink_dealloc(swig_varlinkobject *v) {
6481     swig_globalvar *var = v->vars;
6482     while (var) {
6483       swig_globalvar *n = var->next;
6484       free(var->name);
6485       free(var);
6486       var = n;
6487     }
6488   }
6489 
6490   SWIGINTERN PyObject *
swig_varlink_getattr(swig_varlinkobject * v,char * n)6491   swig_varlink_getattr(swig_varlinkobject *v, char *n) {
6492     PyObject *res = NULL;
6493     swig_globalvar *var = v->vars;
6494     while (var) {
6495       if (strcmp(var->name,n) == 0) {
6496         res = (*var->get_attr)();
6497         break;
6498       }
6499       var = var->next;
6500     }
6501     if (res == NULL && !PyErr_Occurred()) {
6502       PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n);
6503     }
6504     return res;
6505   }
6506 
6507   SWIGINTERN int
swig_varlink_setattr(swig_varlinkobject * v,char * n,PyObject * p)6508   swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
6509     int res = 1;
6510     swig_globalvar *var = v->vars;
6511     while (var) {
6512       if (strcmp(var->name,n) == 0) {
6513         res = (*var->set_attr)(p);
6514         break;
6515       }
6516       var = var->next;
6517     }
6518     if (res == 1 && !PyErr_Occurred()) {
6519       PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n);
6520     }
6521     return res;
6522   }
6523 
6524   SWIGINTERN PyTypeObject*
swig_varlink_type(void)6525   swig_varlink_type(void) {
6526     static char varlink__doc__[] = "Swig var link object";
6527     static PyTypeObject varlink_type;
6528     static int type_init = 0;
6529     if (!type_init) {
6530       const PyTypeObject tmp = {
6531 #if PY_VERSION_HEX >= 0x03000000
6532         PyVarObject_HEAD_INIT(NULL, 0)
6533 #else
6534         PyObject_HEAD_INIT(NULL)
6535         0,                                  /* ob_size */
6536 #endif
6537         "swigvarlink",                      /* tp_name */
6538         sizeof(swig_varlinkobject),         /* tp_basicsize */
6539         0,                                  /* tp_itemsize */
6540         (destructor) swig_varlink_dealloc,  /* tp_dealloc */
6541         0,                                  /* tp_print */
6542         (getattrfunc) swig_varlink_getattr, /* tp_getattr */
6543         (setattrfunc) swig_varlink_setattr, /* tp_setattr */
6544         0,                                  /* tp_compare */
6545         (reprfunc) swig_varlink_repr,       /* tp_repr */
6546         0,                                  /* tp_as_number */
6547         0,                                  /* tp_as_sequence */
6548         0,                                  /* tp_as_mapping */
6549         0,                                  /* tp_hash */
6550         0,                                  /* tp_call */
6551         (reprfunc) swig_varlink_str,        /* tp_str */
6552         0,                                  /* tp_getattro */
6553         0,                                  /* tp_setattro */
6554         0,                                  /* tp_as_buffer */
6555         0,                                  /* tp_flags */
6556         varlink__doc__,                     /* tp_doc */
6557         0,                                  /* tp_traverse */
6558         0,                                  /* tp_clear */
6559         0,                                  /* tp_richcompare */
6560         0,                                  /* tp_weaklistoffset */
6561         0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
6562         0,                                  /* tp_del */
6563         0,                                  /* tp_version_tag */
6564 #if PY_VERSION_HEX >= 0x03040000
6565         0,                                  /* tp_finalize */
6566 #endif
6567 #if PY_VERSION_HEX >= 0x03080000
6568         0,                                  /* tp_vectorcall */
6569 #endif
6570 #if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
6571         0,                                  /* tp_print */
6572 #endif
6573 #ifdef COUNT_ALLOCS
6574         0,                                  /* tp_allocs */
6575         0,                                  /* tp_frees */
6576         0,                                  /* tp_maxalloc */
6577         0,                                  /* tp_prev */
6578         0                                   /* tp_next */
6579 #endif
6580       };
6581       varlink_type = tmp;
6582       type_init = 1;
6583       if (PyType_Ready(&varlink_type) < 0)
6584       return NULL;
6585     }
6586     return &varlink_type;
6587   }
6588 
6589   /* Create a variable linking object for use later */
6590   SWIGINTERN PyObject *
SWIG_Python_newvarlink(void)6591   SWIG_Python_newvarlink(void) {
6592     swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type());
6593     if (result) {
6594       result->vars = 0;
6595     }
6596     return ((PyObject*) result);
6597   }
6598 
6599   SWIGINTERN void
SWIG_Python_addvarlink(PyObject * p,const char * name,PyObject * (* get_attr)(void),int (* set_attr)(PyObject * p))6600   SWIG_Python_addvarlink(PyObject *p, const char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
6601     swig_varlinkobject *v = (swig_varlinkobject *) p;
6602     swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar));
6603     if (gv) {
6604       size_t size = strlen(name)+1;
6605       gv->name = (char *)malloc(size);
6606       if (gv->name) {
6607         memcpy(gv->name, name, size);
6608         gv->get_attr = get_attr;
6609         gv->set_attr = set_attr;
6610         gv->next = v->vars;
6611       }
6612     }
6613     v->vars = gv;
6614   }
6615 
6616   SWIGINTERN PyObject *
SWIG_globals(void)6617   SWIG_globals(void) {
6618     static PyObject *globals = 0;
6619     if (!globals) {
6620       globals = SWIG_newvarlink();
6621     }
6622     return globals;
6623   }
6624 
6625   /* -----------------------------------------------------------------------------
6626    * constants/methods manipulation
6627    * ----------------------------------------------------------------------------- */
6628 
6629   /* Install Constants */
6630   SWIGINTERN void
SWIG_Python_InstallConstants(PyObject * d,swig_const_info constants[])6631   SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
6632     PyObject *obj = 0;
6633     size_t i;
6634     for (i = 0; constants[i].type; ++i) {
6635       switch(constants[i].type) {
6636       case SWIG_PY_POINTER:
6637         obj = SWIG_InternalNewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
6638         break;
6639       case SWIG_PY_BINARY:
6640         obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
6641         break;
6642       default:
6643         obj = 0;
6644         break;
6645       }
6646       if (obj) {
6647         PyDict_SetItemString(d, constants[i].name, obj);
6648         Py_DECREF(obj);
6649       }
6650     }
6651   }
6652 
6653   /* -----------------------------------------------------------------------------*/
6654   /* Fix SwigMethods to carry the callback ptrs when needed */
6655   /* -----------------------------------------------------------------------------*/
6656 
6657   SWIGINTERN void
SWIG_Python_FixMethods(PyMethodDef * methods,swig_const_info * const_table,swig_type_info ** types,swig_type_info ** types_initial)6658   SWIG_Python_FixMethods(PyMethodDef *methods,
6659     swig_const_info *const_table,
6660     swig_type_info **types,
6661     swig_type_info **types_initial) {
6662     size_t i;
6663     for (i = 0; methods[i].ml_name; ++i) {
6664       const char *c = methods[i].ml_doc;
6665       if (!c) continue;
6666       c = strstr(c, "swig_ptr: ");
6667       if (c) {
6668         int j;
6669         swig_const_info *ci = 0;
6670         const char *name = c + 10;
6671         for (j = 0; const_table[j].type; ++j) {
6672           if (strncmp(const_table[j].name, name,
6673               strlen(const_table[j].name)) == 0) {
6674             ci = &(const_table[j]);
6675             break;
6676           }
6677         }
6678         if (ci) {
6679           void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
6680           if (ptr) {
6681             size_t shift = (ci->ptype) - types;
6682             swig_type_info *ty = types_initial[shift];
6683             size_t ldoc = (c - methods[i].ml_doc);
6684             size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
6685             char *ndoc = (char*)malloc(ldoc + lptr + 10);
6686             if (ndoc) {
6687               char *buff = ndoc;
6688               memcpy(buff, methods[i].ml_doc, ldoc);
6689               buff += ldoc;
6690               memcpy(buff, "swig_ptr: ", 10);
6691               buff += 10;
6692               SWIG_PackVoidPtr(buff, ptr, ty->name, lptr);
6693               methods[i].ml_doc = ndoc;
6694             }
6695           }
6696         }
6697       }
6698     }
6699   }
6700 
6701   /* -----------------------------------------------------------------------------
6702    * Method creation and docstring support functions
6703    * ----------------------------------------------------------------------------- */
6704 
6705   /* -----------------------------------------------------------------------------
6706    * Function to find the method definition with the correct docstring for the
6707    * proxy module as opposed to the low-level API
6708    * ----------------------------------------------------------------------------- */
6709 
SWIG_PythonGetProxyDoc(const char * name)6710   SWIGINTERN PyMethodDef *SWIG_PythonGetProxyDoc(const char *name) {
6711     /* Find the function in the modified method table */
6712     size_t offset = 0;
6713     int found = 0;
6714     while (SwigMethods_proxydocs[offset].ml_meth != NULL) {
6715       if (strcmp(SwigMethods_proxydocs[offset].ml_name, name) == 0) {
6716         found = 1;
6717         break;
6718       }
6719       offset++;
6720     }
6721     /* Use the copy with the modified docstring if available */
6722     return found ? &SwigMethods_proxydocs[offset] : NULL;
6723   }
6724 
6725   /* -----------------------------------------------------------------------------
6726    * Wrapper of PyInstanceMethod_New() used in Python 3
6727    * It is exported to the generated module, used for -fastproxy
6728    * ----------------------------------------------------------------------------- */
6729 
SWIG_PyInstanceMethod_New(PyObject * SWIGUNUSEDPARM (self),PyObject * func)6730   SWIGINTERN PyObject *SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) {
6731     if (PyCFunction_Check(func)) {
6732       PyCFunctionObject *funcobj = (PyCFunctionObject *)func;
6733       PyMethodDef *ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name);
6734       if (ml)
6735       func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module);
6736     }
6737 #if PY_VERSION_HEX >= 0x03000000
6738     return PyInstanceMethod_New(func);
6739 #else
6740     return PyMethod_New(func, NULL, NULL);
6741 #endif
6742   }
6743 
6744   /* -----------------------------------------------------------------------------
6745    * Wrapper of PyStaticMethod_New()
6746    * It is exported to the generated module, used for -fastproxy
6747    * ----------------------------------------------------------------------------- */
6748 
SWIG_PyStaticMethod_New(PyObject * SWIGUNUSEDPARM (self),PyObject * func)6749   SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) {
6750     if (PyCFunction_Check(func)) {
6751       PyCFunctionObject *funcobj = (PyCFunctionObject *)func;
6752       PyMethodDef *ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name);
6753       if (ml)
6754       func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module);
6755     }
6756     return PyStaticMethod_New(func);
6757   }
6758 
6759 #ifdef __cplusplus
6760 }
6761 #endif
6762 
6763 /* -----------------------------------------------------------------------------*
6764  *  Partial Init method
6765  * -----------------------------------------------------------------------------*/
6766 
6767 #ifdef __cplusplus
6768 extern "C"
6769 #endif
6770 
6771 SWIGEXPORT
6772 #if PY_VERSION_HEX >= 0x03000000
6773 PyObject*
6774 #else
6775 void
6776 #endif
SWIG_init(void)6777 SWIG_init(void) {
6778   PyObject *m, *d, *md, *globals;
6779 
6780 #if PY_VERSION_HEX >= 0x03000000
6781   static struct PyModuleDef SWIG_module = {
6782     PyModuleDef_HEAD_INIT,
6783     SWIG_name,
6784     NULL,
6785     -1,
6786     SwigMethods,
6787     NULL,
6788     NULL,
6789     NULL,
6790     NULL
6791   };
6792 #endif
6793 
6794 #if defined(SWIGPYTHON_BUILTIN)
6795   static SwigPyClientData SwigPyObject_clientdata = {
6796     0, 0, 0, 0, 0, 0, 0
6797   };
6798   static PyGetSetDef this_getset_def = {
6799     (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL
6800   };
6801   static SwigPyGetSet thisown_getset_closure = {
6802     SwigPyObject_own,
6803     SwigPyObject_own
6804   };
6805   static PyGetSetDef thisown_getset_def = {
6806     (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure
6807   };
6808   PyTypeObject *builtin_pytype;
6809   int builtin_base_count;
6810   swig_type_info *builtin_basetype;
6811   PyObject *tuple;
6812   PyGetSetDescrObject *static_getset;
6813   PyTypeObject *metatype;
6814   PyTypeObject *swigpyobject;
6815   SwigPyClientData *cd;
6816   PyObject *public_interface, *public_symbol;
6817   PyObject *this_descr;
6818   PyObject *thisown_descr;
6819   PyObject *self = 0;
6820   int i;
6821 
6822   (void)builtin_pytype;
6823   (void)builtin_base_count;
6824   (void)builtin_basetype;
6825   (void)tuple;
6826   (void)static_getset;
6827   (void)self;
6828 
6829   /* Metaclass is used to implement static member variables */
6830   metatype = SwigPyObjectType();
6831   assert(metatype);
6832 #endif
6833 
6834   (void)globals;
6835 
6836   /* Create singletons now to avoid potential deadlocks with multi-threaded usage after module initialization */
6837   SWIG_This();
6838   SWIG_Python_TypeCache();
6839   SwigPyPacked_type();
6840 #ifndef SWIGPYTHON_BUILTIN
6841   SwigPyObject_type();
6842 #endif
6843 
6844   /* Fix SwigMethods to carry the callback ptrs when needed */
6845   SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial);
6846 
6847 #if PY_VERSION_HEX >= 0x03000000
6848   m = PyModule_Create(&SWIG_module);
6849 #else
6850   m = Py_InitModule(SWIG_name, SwigMethods);
6851 #endif
6852 
6853   md = d = PyModule_GetDict(m);
6854   (void)md;
6855 
6856   SWIG_InitializeModule(0);
6857 
6858 #ifdef SWIGPYTHON_BUILTIN
6859   swigpyobject = SwigPyObject_TypeOnce();
6860 
6861   SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject");
6862   assert(SwigPyObject_stype);
6863   cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
6864   if (!cd) {
6865     SwigPyObject_stype->clientdata = &SwigPyObject_clientdata;
6866     SwigPyObject_clientdata.pytype = swigpyobject;
6867   } else if (swigpyobject->tp_basicsize != cd->pytype->tp_basicsize) {
6868     PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules.");
6869 # if PY_VERSION_HEX >= 0x03000000
6870     return NULL;
6871 # else
6872     return;
6873 # endif
6874   }
6875 
6876   /* All objects have a 'this' attribute */
6877   this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def);
6878   (void)this_descr;
6879 
6880   /* All objects have a 'thisown' attribute */
6881   thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def);
6882   (void)thisown_descr;
6883 
6884   public_interface = PyList_New(0);
6885   public_symbol = 0;
6886   (void)public_symbol;
6887 
6888   PyDict_SetItemString(md, "__all__", public_interface);
6889   Py_DECREF(public_interface);
6890   for (i = 0; SwigMethods[i].ml_name != NULL; ++i)
6891   SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name);
6892   for (i = 0; swig_const_table[i].name != 0; ++i)
6893   SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name);
6894 #endif
6895 
6896   SWIG_InstallConstants(d,swig_const_table);
6897 
6898 
6899   {
6900     PyObject *module = PyImport_ImportModule("gphoto2");
6901     if (module != NULL) {
6902       PyExc_GPhoto2Error = PyObject_GetAttrString(module, "GPhoto2Error");
6903       Py_DECREF(module);
6904     }
6905     if (PyExc_GPhoto2Error == NULL)
6906 #if PY_VERSION_HEX >= 0x03000000
6907     return NULL;
6908 #else
6909     return;
6910 #endif
6911   }
6912 
6913 
6914   /* type '::CallbackDetails' */
6915   builtin_pytype = (PyTypeObject *)&SwigPyBuiltin__CallbackDetails_type;
6916   builtin_pytype->tp_dict = d = PyDict_New();
6917   SwigPyBuiltin_SetMetaType(builtin_pytype, metatype);
6918   builtin_pytype->tp_new = PyType_GenericNew;
6919   builtin_base_count = 0;
6920   builtin_bases[builtin_base_count] = NULL;
6921   SwigPyBuiltin_InitBases(builtin_pytype, builtin_bases);
6922   PyDict_SetItemString(d, "this", this_descr);
6923   PyDict_SetItemString(d, "thisown", thisown_descr);
6924   if (PyType_Ready(builtin_pytype) < 0) {
6925     PyErr_SetString(PyExc_TypeError, "Could not create type 'CallbackDetails'.");
6926 #if PY_VERSION_HEX >= 0x03000000
6927     return NULL;
6928 #else
6929     return;
6930 #endif
6931   }
6932   Py_INCREF(builtin_pytype);
6933   PyModule_AddObject(m, "CallbackDetails", (PyObject *)builtin_pytype);
6934   SwigPyBuiltin_AddPublicSymbol(public_interface, "CallbackDetails");
6935   d = md;
6936 
6937   /* type '::_GPContext' */
6938   builtin_pytype = (PyTypeObject *)&SwigPyBuiltin___GPContext_type;
6939   builtin_pytype->tp_dict = d = PyDict_New();
6940   SwigPyBuiltin_SetMetaType(builtin_pytype, metatype);
6941   builtin_pytype->tp_new = PyType_GenericNew;
6942   builtin_base_count = 0;
6943   builtin_bases[builtin_base_count] = NULL;
6944   SwigPyBuiltin_InitBases(builtin_pytype, builtin_bases);
6945   PyDict_SetItemString(d, "this", this_descr);
6946   PyDict_SetItemString(d, "thisown", thisown_descr);
6947   if (PyType_Ready(builtin_pytype) < 0) {
6948     PyErr_SetString(PyExc_TypeError, "Could not create type 'Context'.");
6949 #if PY_VERSION_HEX >= 0x03000000
6950     return NULL;
6951 #else
6952     return;
6953 #endif
6954   }
6955   Py_INCREF(builtin_pytype);
6956   PyModule_AddObject(m, "Context", (PyObject *)builtin_pytype);
6957   SwigPyBuiltin_AddPublicSymbol(public_interface, "Context");
6958   d = md;
6959   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "GP_CONTEXT_FEEDBACK_OK",SWIG_From_int((int)(GP_CONTEXT_FEEDBACK_OK)));
6960   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "GP_CONTEXT_FEEDBACK_CANCEL",SWIG_From_int((int)(GP_CONTEXT_FEEDBACK_CANCEL)));
6961 #if PY_VERSION_HEX >= 0x03000000
6962   return m;
6963 #else
6964   return;
6965 #endif
6966 }
6967 
6968