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