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