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

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML