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