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