OR-Tools  9.1
rcpsp_python_wrap.cc
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2  * This file was automatically generated by SWIG (http://www.swig.org).
3  * Version 4.0.1
4  *
5  * This file is not intended to be easily readable and contains a number of
6  * coding conventions designed to improve portability and efficiency. Do not make
7  * changes to this file unless you know what you are doing--modify the SWIG
8  * interface file instead.
9  * ----------------------------------------------------------------------------- */
10 
11 
12 #ifndef SWIGPYTHON
13 #define SWIGPYTHON
14 #endif
15 
16 #define SWIG_PYTHON_DIRECTOR_NO_VTABLE
17 
18 
19 #ifdef __cplusplus
20 /* SwigValueWrapper is described in swig.swg */
21 template<typename T> class SwigValueWrapper {
22  struct SwigMovePointer {
23  T *ptr;
24  SwigMovePointer(T *p) : ptr(p) { }
25  ~SwigMovePointer() { delete ptr; }
26  SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
27  } pointer;
28  SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
29  SwigValueWrapper(const SwigValueWrapper<T>& rhs);
30 public:
31  SwigValueWrapper() : pointer(0) { }
32  SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
33  operator T&() const { return *pointer.ptr; }
34  T *operator&() { return pointer.ptr; }
35 };
36 
37 template <typename T> T SwigValueInit() {
38  return T();
39 }
40 #endif
41 
42 /* -----------------------------------------------------------------------------
43  * This section contains generic SWIG labels for method/variable
44  * declarations/attributes, and other compiler dependent labels.
45  * ----------------------------------------------------------------------------- */
46 
47 /* template workaround for compilers that cannot correctly implement the C++ standard */
48 #ifndef SWIGTEMPLATEDISAMBIGUATOR
49 # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
50 # define SWIGTEMPLATEDISAMBIGUATOR template
51 # elif defined(__HP_aCC)
52 /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
53 /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
54 # define SWIGTEMPLATEDISAMBIGUATOR template
55 # else
56 # define SWIGTEMPLATEDISAMBIGUATOR
57 # endif
58 #endif
59 
60 /* inline attribute */
61 #ifndef SWIGINLINE
62 # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
63 # define SWIGINLINE inline
64 # else
65 # define SWIGINLINE
66 # endif
67 #endif
68 
69 /* attribute recognised by some compilers to avoid 'unused' warnings */
70 #ifndef SWIGUNUSED
71 # if defined(__GNUC__)
72 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
73 # define SWIGUNUSED __attribute__ ((__unused__))
74 # else
75 # define SWIGUNUSED
76 # endif
77 # elif defined(__ICC)
78 # define SWIGUNUSED __attribute__ ((__unused__))
79 # else
80 # define SWIGUNUSED
81 # endif
82 #endif
83 
84 #ifndef SWIG_MSC_UNSUPPRESS_4505
85 # if defined(_MSC_VER)
86 # pragma warning(disable : 4505) /* unreferenced local function has been removed */
87 # endif
88 #endif
89 
90 #ifndef SWIGUNUSEDPARM
91 # ifdef __cplusplus
92 # define SWIGUNUSEDPARM(p)
93 # else
94 # define SWIGUNUSEDPARM(p) p SWIGUNUSED
95 # endif
96 #endif
97 
98 /* internal SWIG method */
99 #ifndef SWIGINTERN
100 # define SWIGINTERN static SWIGUNUSED
101 #endif
102 
103 /* internal inline SWIG method */
104 #ifndef SWIGINTERNINLINE
105 # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
106 #endif
107 
108 /* exporting methods */
109 #if defined(__GNUC__)
110 # if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
111 # ifndef GCC_HASCLASSVISIBILITY
112 # define GCC_HASCLASSVISIBILITY
113 # endif
114 # endif
115 #endif
116 
117 #ifndef SWIGEXPORT
118 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
119 # if defined(STATIC_LINKED)
120 # define SWIGEXPORT
121 # else
122 # define SWIGEXPORT __declspec(dllexport)
123 # endif
124 # else
125 # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
126 # define SWIGEXPORT __attribute__ ((visibility("default")))
127 # else
128 # define SWIGEXPORT
129 # endif
130 # endif
131 #endif
132 
133 /* calling conventions for Windows */
134 #ifndef SWIGSTDCALL
135 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
136 # define SWIGSTDCALL __stdcall
137 # else
138 # define SWIGSTDCALL
139 # endif
140 #endif
141 
142 /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
143 #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
144 # define _CRT_SECURE_NO_DEPRECATE
145 #endif
146 
147 /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
148 #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
149 # define _SCL_SECURE_NO_DEPRECATE
150 #endif
151 
152 /* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
153 #if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
154 # define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
155 #endif
156 
157 /* Intel's compiler complains if a variable which was never initialised is
158  * cast to void, which is a common idiom which we use to indicate that we
159  * are aware a variable isn't used. So we just silence that warning.
160  * See: https://github.com/swig/swig/issues/192 for more discussion.
161  */
162 #ifdef __INTEL_COMPILER
163 # pragma warning disable 592
164 #endif
165 
166 
167 #if defined(__GNUC__) && defined(_WIN32) && !defined(SWIG_PYTHON_NO_HYPOT_WORKAROUND)
168 /* Workaround for '::hypot' has not been declared', see https://bugs.python.org/issue11566 */
169 # include <math.h>
170 #endif
171 
172 #if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG)
173 /* Use debug wrappers with the Python release dll */
174 # undef _DEBUG
175 # include <Python.h>
176 # define _DEBUG 1
177 #else
178 # include <Python.h>
179 #endif
180 
181 /* -----------------------------------------------------------------------------
182  * swigrun.swg
183  *
184  * This file contains generic C API SWIG runtime support for pointer
185  * type checking.
186  * ----------------------------------------------------------------------------- */
187 
188 /* This should only be incremented when either the layout of swig_type_info changes,
189  or for whatever reason, the runtime changes incompatibly */
190 #define SWIG_RUNTIME_VERSION "4"
191 
192 /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
193 #ifdef SWIG_TYPE_TABLE
194 # define SWIG_QUOTE_STRING(x) #x
195 # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
196 # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
197 #else
198 # define SWIG_TYPE_TABLE_NAME
199 #endif
200 
201 /*
202  You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
203  creating a static or dynamic library from the SWIG runtime code.
204  In 99.9% of the cases, SWIG just needs to declare them as 'static'.
205 
206  But only do this if strictly necessary, ie, if you have problems
207  with your compiler or suchlike.
208 */
209 
210 #ifndef SWIGRUNTIME
211 # define SWIGRUNTIME SWIGINTERN
212 #endif
213 
214 #ifndef SWIGRUNTIMEINLINE
215 # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
216 #endif
217 
218 /* Generic buffer size */
219 #ifndef SWIG_BUFFER_SIZE
220 # define SWIG_BUFFER_SIZE 1024
221 #endif
222 
223 /* Flags for pointer conversions */
224 #define SWIG_POINTER_DISOWN 0x1
225 #define SWIG_CAST_NEW_MEMORY 0x2
226 #define SWIG_POINTER_NO_NULL 0x4
227 
228 /* Flags for new pointer objects */
229 #define SWIG_POINTER_OWN 0x1
230 
231 
232 /*
233  Flags/methods for returning states.
234 
235  The SWIG conversion methods, as ConvertPtr, return an integer
236  that tells if the conversion was successful or not. And if not,
237  an error code can be returned (see swigerrors.swg for the codes).
238 
239  Use the following macros/flags to set or process the returning
240  states.
241 
242  In old versions of SWIG, code such as the following was usually written:
243 
244  if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
245  // success code
246  } else {
247  //fail code
248  }
249 
250  Now you can be more explicit:
251 
252  int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
253  if (SWIG_IsOK(res)) {
254  // success code
255  } else {
256  // fail code
257  }
258 
259  which is the same really, but now you can also do
260 
261  Type *ptr;
262  int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
263  if (SWIG_IsOK(res)) {
264  // success code
265  if (SWIG_IsNewObj(res) {
266  ...
267  delete *ptr;
268  } else {
269  ...
270  }
271  } else {
272  // fail code
273  }
274 
275  I.e., now SWIG_ConvertPtr can return new objects and you can
276  identify the case and take care of the deallocation. Of course that
277  also requires SWIG_ConvertPtr to return new result values, such as
278 
279  int SWIG_ConvertPtr(obj, ptr,...) {
280  if (<obj is ok>) {
281  if (<need new object>) {
282  *ptr = <ptr to new allocated object>;
283  return SWIG_NEWOBJ;
284  } else {
285  *ptr = <ptr to old object>;
286  return SWIG_OLDOBJ;
287  }
288  } else {
289  return SWIG_BADOBJ;
290  }
291  }
292 
293  Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
294  more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
295  SWIG errors code.
296 
297  Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
298  allows to return the 'cast rank', for example, if you have this
299 
300  int food(double)
301  int fooi(int);
302 
303  and you call
304 
305  food(1) // cast rank '1' (1 -> 1.0)
306  fooi(1) // cast rank '0'
307 
308  just use the SWIG_AddCast()/SWIG_CheckState()
309 */
310 
311 #define SWIG_OK (0)
312 #define SWIG_ERROR (-1)
313 #define SWIG_IsOK(r) (r >= 0)
314 #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
315 
316 /* The CastRankLimit says how many bits are used for the cast rank */
317 #define SWIG_CASTRANKLIMIT (1 << 8)
318 /* The NewMask denotes the object was created (using new/malloc) */
319 #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
320 /* The TmpMask is for in/out typemaps that use temporal objects */
321 #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
322 /* Simple returning values */
323 #define SWIG_BADOBJ (SWIG_ERROR)
324 #define SWIG_OLDOBJ (SWIG_OK)
325 #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
326 #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
327 /* Check, add and del mask methods */
328 #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
329 #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
330 #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
331 #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
332 #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
333 #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
334 
335 /* Cast-Rank Mode */
336 #if defined(SWIG_CASTRANK_MODE)
337 # ifndef SWIG_TypeRank
338 # define SWIG_TypeRank unsigned long
339 # endif
340 # ifndef SWIG_MAXCASTRANK /* Default cast allowed */
341 # define SWIG_MAXCASTRANK (2)
342 # endif
343 # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
344 # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
345 SWIGINTERNINLINE int SWIG_AddCast(int r) {
346  return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
347 }
349  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
350 }
351 #else /* no cast-rank mode */
352 # define SWIG_AddCast(r) (r)
353 # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
354 #endif
355 
356 
357 #include <string.h>
358 
359 #ifdef __cplusplus
360 extern "C" {
361 #endif
362 
363 typedef void *(*swig_converter_func)(void *, int *);
364 typedef struct swig_type_info *(*swig_dycast_func)(void **);
365 
366 /* Structure to store information on one type */
367 typedef struct swig_type_info {
368  const char *name; /* mangled name of this type */
369  const char *str; /* human readable name of this type */
370  swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
371  struct swig_cast_info *cast; /* linked list of types that can cast into this type */
372  void *clientdata; /* language specific type data */
373  int owndata; /* flag if the structure owns the clientdata */
375 
376 /* Structure to store a type and conversion function used for casting */
377 typedef struct swig_cast_info {
378  swig_type_info *type; /* pointer to type that is equivalent to this type */
379  swig_converter_func converter; /* function to cast the void pointers */
380  struct swig_cast_info *next; /* pointer to next cast in linked list */
381  struct swig_cast_info *prev; /* pointer to the previous cast */
383 
384 /* Structure used to store module information
385  * Each module generates one structure like this, and the runtime collects
386  * all of these structures and stores them in a circularly linked list.*/
387 typedef struct swig_module_info {
388  swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
389  size_t size; /* Number of types in this module */
390  struct swig_module_info *next; /* Pointer to next element in circularly linked list */
391  swig_type_info **type_initial; /* Array of initially generated type structures */
392  swig_cast_info **cast_initial; /* Array of initially generated casting structures */
393  void *clientdata; /* Language specific module data */
395 
396 /*
397  Compare two type names skipping the space characters, therefore
398  "char*" == "char *" and "Class<int>" == "Class<int >", etc.
399 
400  Return 0 when the two name types are equivalent, as in
401  strncmp, but skipping ' '.
402 */
403 SWIGRUNTIME int
404 SWIG_TypeNameComp(const char *f1, const char *l1,
405  const char *f2, const char *l2) {
406  for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
407  while ((*f1 == ' ') && (f1 != l1)) ++f1;
408  while ((*f2 == ' ') && (f2 != l2)) ++f2;
409  if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
410  }
411  return (int)((l1 - f1) - (l2 - f2));
412 }
413 
414 /*
415  Check type equivalence in a name list like <name1>|<name2>|...
416  Return 0 if equal, -1 if nb < tb, 1 if nb > tb
417 */
418 SWIGRUNTIME int
419 SWIG_TypeCmp(const char *nb, const char *tb) {
420  int equiv = 1;
421  const char* te = tb + strlen(tb);
422  const char* ne = nb;
423  while (equiv != 0 && *ne) {
424  for (nb = ne; *ne; ++ne) {
425  if (*ne == '|') break;
426  }
427  equiv = SWIG_TypeNameComp(nb, ne, tb, te);
428  if (*ne) ++ne;
429  }
430  return equiv;
431 }
432 
433 /*
434  Check type equivalence in a name list like <name1>|<name2>|...
435  Return 0 if not equal, 1 if equal
436 */
437 SWIGRUNTIME int
438 SWIG_TypeEquiv(const char *nb, const char *tb) {
439  return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
440 }
441 
442 /*
443  Check the typename
444 */
446 SWIG_TypeCheck(const char *c, swig_type_info *ty) {
447  if (ty) {
448  swig_cast_info *iter = ty->cast;
449  while (iter) {
450  if (strcmp(iter->type->name, c) == 0) {
451  if (iter == ty->cast)
452  return iter;
453  /* Move iter to the top of the linked list */
454  iter->prev->next = iter->next;
455  if (iter->next)
456  iter->next->prev = iter->prev;
457  iter->next = ty->cast;
458  iter->prev = 0;
459  if (ty->cast) ty->cast->prev = iter;
460  ty->cast = iter;
461  return iter;
462  }
463  iter = iter->next;
464  }
465  }
466  return 0;
467 }
468 
469 /*
470  Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
471 */
474  if (ty) {
475  swig_cast_info *iter = ty->cast;
476  while (iter) {
477  if (iter->type == from) {
478  if (iter == ty->cast)
479  return iter;
480  /* Move iter to the top of the linked list */
481  iter->prev->next = iter->next;
482  if (iter->next)
483  iter->next->prev = iter->prev;
484  iter->next = ty->cast;
485  iter->prev = 0;
486  if (ty->cast) ty->cast->prev = iter;
487  ty->cast = iter;
488  return iter;
489  }
490  iter = iter->next;
491  }
492  }
493  return 0;
494 }
495 
496 /*
497  Cast a pointer up an inheritance hierarchy
498 */
499 SWIGRUNTIMEINLINE void *
500 SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
501  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
502 }
503 
504 /*
505  Dynamic pointer casting. Down an inheritance hierarchy
506 */
509  swig_type_info *lastty = ty;
510  if (!ty || !ty->dcast) return ty;
511  while (ty && (ty->dcast)) {
512  ty = (*ty->dcast)(ptr);
513  if (ty) lastty = ty;
514  }
515  return lastty;
516 }
517 
518 /*
519  Return the name associated with this type
520 */
521 SWIGRUNTIMEINLINE const char *
523  return ty->name;
524 }
525 
526 /*
527  Return the pretty name associated with this type,
528  that is an unmangled type name in a form presentable to the user.
529 */
530 SWIGRUNTIME const char *
532  /* The "str" field contains the equivalent pretty names of the
533  type, separated by vertical-bar characters. We choose
534  to print the last name, as it is often (?) the most
535  specific. */
536  if (!type) return NULL;
537  if (type->str != NULL) {
538  const char *last_name = type->str;
539  const char *s;
540  for (s = type->str; *s; s++)
541  if (*s == '|') last_name = s+1;
542  return last_name;
543  }
544  else
545  return type->name;
546 }
547 
548 /*
549  Set the clientdata field for a type
550 */
551 SWIGRUNTIME void
553  swig_cast_info *cast = ti->cast;
554  /* if (ti->clientdata == clientdata) return; */
555  ti->clientdata = clientdata;
556 
557  while (cast) {
558  if (!cast->converter) {
559  swig_type_info *tc = cast->type;
560  if (!tc->clientdata) {
562  }
563  }
564  cast = cast->next;
565  }
566 }
567 SWIGRUNTIME void
570  ti->owndata = 1;
571 }
572 
573 /*
574  Search for a swig_type_info structure only by mangled name
575  Search is a O(log #types)
576 
577  We start searching at module start, and finish searching when start == end.
578  Note: if start == end at the beginning of the function, we go all the way around
579  the circular list.
580 */
583  swig_module_info *end,
584  const char *name) {
585  swig_module_info *iter = start;
586  do {
587  if (iter->size) {
588  size_t l = 0;
589  size_t r = iter->size - 1;
590  do {
591  /* since l+r >= 0, we can (>> 1) instead (/ 2) */
592  size_t i = (l + r) >> 1;
593  const char *iname = iter->types[i]->name;
594  if (iname) {
595  int compare = strcmp(name, iname);
596  if (compare == 0) {
597  return iter->types[i];
598  } else if (compare < 0) {
599  if (i) {
600  r = i - 1;
601  } else {
602  break;
603  }
604  } else if (compare > 0) {
605  l = i + 1;
606  }
607  } else {
608  break; /* should never happen */
609  }
610  } while (l <= r);
611  }
612  iter = iter->next;
613  } while (iter != end);
614  return 0;
615 }
616 
617 /*
618  Search for a swig_type_info structure for either a mangled name or a human readable name.
619  It first searches the mangled names of the types, which is a O(log #types)
620  If a type is not found it then searches the human readable names, which is O(#types).
621 
622  We start searching at module start, and finish searching when start == end.
623  Note: if start == end at the beginning of the function, we go all the way around
624  the circular list.
625 */
628  swig_module_info *end,
629  const char *name) {
630  /* STEP 1: Search the name field using binary search */
631  swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
632  if (ret) {
633  return ret;
634  } else {
635  /* STEP 2: If the type hasn't been found, do a complete search
636  of the str field (the human readable name) */
637  swig_module_info *iter = start;
638  do {
639  size_t i = 0;
640  for (; i < iter->size; ++i) {
641  if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
642  return iter->types[i];
643  }
644  iter = iter->next;
645  } while (iter != end);
646  }
647 
648  /* neither found a match */
649  return 0;
650 }
651 
652 /*
653  Pack binary data into a string
654 */
655 SWIGRUNTIME char *
656 SWIG_PackData(char *c, void *ptr, size_t sz) {
657  static const char hex[17] = "0123456789abcdef";
658  const unsigned char *u = (unsigned char *) ptr;
659  const unsigned char *eu = u + sz;
660  for (; u != eu; ++u) {
661  unsigned char uu = *u;
662  *(c++) = hex[(uu & 0xf0) >> 4];
663  *(c++) = hex[uu & 0xf];
664  }
665  return c;
666 }
667 
668 /*
669  Unpack binary data from a string
670 */
671 SWIGRUNTIME const char *
672 SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
673  unsigned char *u = (unsigned char *) ptr;
674  const unsigned char *eu = u + sz;
675  for (; u != eu; ++u) {
676  char d = *(c++);
677  unsigned char uu;
678  if ((d >= '0') && (d <= '9'))
679  uu = (unsigned char)((d - '0') << 4);
680  else if ((d >= 'a') && (d <= 'f'))
681  uu = (unsigned char)((d - ('a'-10)) << 4);
682  else
683  return (char *) 0;
684  d = *(c++);
685  if ((d >= '0') && (d <= '9'))
686  uu |= (unsigned char)(d - '0');
687  else if ((d >= 'a') && (d <= 'f'))
688  uu |= (unsigned char)(d - ('a'-10));
689  else
690  return (char *) 0;
691  *u = uu;
692  }
693  return c;
694 }
695 
696 /*
697  Pack 'void *' into a string buffer.
698 */
699 SWIGRUNTIME char *
700 SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
701  char *r = buff;
702  if ((2*sizeof(void *) + 2) > bsz) return 0;
703  *(r++) = '_';
704  r = SWIG_PackData(r,&ptr,sizeof(void *));
705  if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
706  strcpy(r,name);
707  return buff;
708 }
709 
710 SWIGRUNTIME const char *
711 SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
712  if (*c != '_') {
713  if (strcmp(c,"NULL") == 0) {
714  *ptr = (void *) 0;
715  return name;
716  } else {
717  return 0;
718  }
719  }
720  return SWIG_UnpackData(++c,ptr,sizeof(void *));
721 }
722 
723 SWIGRUNTIME char *
724 SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
725  char *r = buff;
726  size_t lname = (name ? strlen(name) : 0);
727  if ((2*sz + 2 + lname) > bsz) return 0;
728  *(r++) = '_';
729  r = SWIG_PackData(r,ptr,sz);
730  if (lname) {
731  strncpy(r,name,lname+1);
732  } else {
733  *r = 0;
734  }
735  return buff;
736 }
737 
738 SWIGRUNTIME const char *
739 SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
740  if (*c != '_') {
741  if (strcmp(c,"NULL") == 0) {
742  memset(ptr,0,sz);
743  return name;
744  } else {
745  return 0;
746  }
747  }
748  return SWIG_UnpackData(++c,ptr,sz);
749 }
750 
751 #ifdef __cplusplus
752 }
753 #endif
754 
755 /* Errors in SWIG */
756 #define SWIG_UnknownError -1
757 #define SWIG_IOError -2
758 #define SWIG_RuntimeError -3
759 #define SWIG_IndexError -4
760 #define SWIG_TypeError -5
761 #define SWIG_DivisionByZero -6
762 #define SWIG_OverflowError -7
763 #define SWIG_SyntaxError -8
764 #define SWIG_ValueError -9
765 #define SWIG_SystemError -10
766 #define SWIG_AttributeError -11
767 #define SWIG_MemoryError -12
768 #define SWIG_NullReferenceError -13
769 
770 
771 
772 /* Compatibility macros for Python 3 */
773 #if PY_VERSION_HEX >= 0x03000000
774 
775 #define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type)
776 #define PyInt_Check(x) PyLong_Check(x)
777 #define PyInt_AsLong(x) PyLong_AsLong(x)
778 #define PyInt_FromLong(x) PyLong_FromLong(x)
779 #define PyInt_FromSize_t(x) PyLong_FromSize_t(x)
780 #define PyString_Check(name) PyBytes_Check(name)
781 #define PyString_FromString(x) PyUnicode_FromString(x)
782 #define PyString_Format(fmt, args) PyUnicode_Format(fmt, args)
783 #define PyString_AsString(str) PyBytes_AsString(str)
784 #define PyString_Size(str) PyBytes_Size(str)
785 #define PyString_InternFromString(key) PyUnicode_InternFromString(key)
786 #define Py_TPFLAGS_HAVE_CLASS Py_TPFLAGS_BASETYPE
787 #define PyString_AS_STRING(x) PyUnicode_AS_STRING(x)
788 #define _PyLong_FromSsize_t(x) PyLong_FromSsize_t(x)
789 
790 #endif
791 
792 #ifndef Py_TYPE
793 # define Py_TYPE(op) ((op)->ob_type)
794 #endif
795 
796 /* SWIG APIs for compatibility of both Python 2 & 3 */
797 
798 #if PY_VERSION_HEX >= 0x03000000
799 # define SWIG_Python_str_FromFormat PyUnicode_FromFormat
800 #else
801 # define SWIG_Python_str_FromFormat PyString_FromFormat
802 #endif
803 
804 
805 /* Warning: This function will allocate a new string in Python 3,
806  * so please call SWIG_Python_str_DelForPy3(x) to free the space.
807  */
808 SWIGINTERN char*
810 {
811 #if PY_VERSION_HEX >= 0x03000000
812  char *newstr = 0;
813  str = PyUnicode_AsUTF8String(str);
814  if (str) {
815  char *cstr;
816  Py_ssize_t len;
817  PyBytes_AsStringAndSize(str, &cstr, &len);
818  newstr = (char *) malloc(len+1);
819  memcpy(newstr, cstr, len+1);
820  Py_XDECREF(str);
821  }
822  return newstr;
823 #else
824  return PyString_AsString(str);
825 #endif
826 }
827 
828 #if PY_VERSION_HEX >= 0x03000000
829 # define SWIG_Python_str_DelForPy3(x) free( (void*) (x) )
830 #else
831 # define SWIG_Python_str_DelForPy3(x)
832 #endif
833 
834 
835 SWIGINTERN PyObject*
837 {
838 #if PY_VERSION_HEX >= 0x03000000
839  return PyUnicode_FromString(c);
840 #else
841  return PyString_FromString(c);
842 #endif
843 }
844 
845 #ifndef PyObject_DEL
846 # define PyObject_DEL PyObject_Del
847 #endif
848 
849 // SWIGPY_USE_CAPSULE is no longer used within SWIG itself, but some user
850 // interface files check for it.
851 # define SWIGPY_USE_CAPSULE
852 # define SWIGPY_CAPSULE_NAME ("swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME)
853 
854 #if PY_VERSION_HEX < 0x03020000
855 #define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type)
856 #define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name)
857 #define Py_hash_t long
858 #endif
859 
860 /* -----------------------------------------------------------------------------
861  * error manipulation
862  * ----------------------------------------------------------------------------- */
863 
864 SWIGRUNTIME PyObject*
866  PyObject* type = 0;
867  switch(code) {
868  case SWIG_MemoryError:
869  type = PyExc_MemoryError;
870  break;
871  case SWIG_IOError:
872  type = PyExc_IOError;
873  break;
874  case SWIG_RuntimeError:
875  type = PyExc_RuntimeError;
876  break;
877  case SWIG_IndexError:
878  type = PyExc_IndexError;
879  break;
880  case SWIG_TypeError:
881  type = PyExc_TypeError;
882  break;
883  case SWIG_DivisionByZero:
884  type = PyExc_ZeroDivisionError;
885  break;
886  case SWIG_OverflowError:
887  type = PyExc_OverflowError;
888  break;
889  case SWIG_SyntaxError:
890  type = PyExc_SyntaxError;
891  break;
892  case SWIG_ValueError:
893  type = PyExc_ValueError;
894  break;
895  case SWIG_SystemError:
896  type = PyExc_SystemError;
897  break;
898  case SWIG_AttributeError:
899  type = PyExc_AttributeError;
900  break;
901  default:
902  type = PyExc_RuntimeError;
903  }
904  return type;
905 }
906 
907 
908 SWIGRUNTIME void
909 SWIG_Python_AddErrorMsg(const char* mesg)
910 {
911  PyObject *type = 0;
912  PyObject *value = 0;
913  PyObject *traceback = 0;
914 
915  if (PyErr_Occurred())
916  PyErr_Fetch(&type, &value, &traceback);
917  if (value) {
918  PyObject *old_str = PyObject_Str(value);
919  const char *tmp = SWIG_Python_str_AsChar(old_str);
920  PyErr_Clear();
921  Py_XINCREF(type);
922  if (tmp)
923  PyErr_Format(type, "%s %s", tmp, mesg);
924  else
925  PyErr_Format(type, "%s", mesg);
927  Py_DECREF(old_str);
928  Py_DECREF(value);
929  } else {
930  PyErr_SetString(PyExc_RuntimeError, mesg);
931  }
932 }
933 
934 SWIGRUNTIME int
936 {
937  PyObject *error;
938  if (obj)
939  return 0;
940  error = PyErr_Occurred();
941  return error && PyErr_GivenExceptionMatches(error, PyExc_TypeError);
942 }
943 
944 SWIGRUNTIME void
946 {
947  if (SWIG_Python_TypeErrorOccurred(NULL)) {
948  /* Use existing TypeError to preserve stacktrace and enhance with given message */
949  PyObject *newvalue;
950  PyObject *type = NULL, *value = NULL, *traceback = NULL;
951  PyErr_Fetch(&type, &value, &traceback);
952 #if PY_VERSION_HEX >= 0x03000000
953  newvalue = PyUnicode_FromFormat("%S\nAdditional information:\n%s", value, message);
954 #else
955  newvalue = PyString_FromFormat("%s\nAdditional information:\n%s", PyString_AsString(value), message);
956 #endif
957  Py_XDECREF(value);
958  PyErr_Restore(type, newvalue, traceback);
959  } else {
960  /* Raise TypeError using given message */
961  PyErr_SetString(PyExc_TypeError, message);
962  }
963 }
964 
965 #if defined(SWIG_PYTHON_NO_THREADS)
966 # if defined(SWIG_PYTHON_THREADS)
967 # undef SWIG_PYTHON_THREADS
968 # endif
969 #endif
970 #if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */
971 # if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL)
972 # define SWIG_PYTHON_USE_GIL
973 # endif
974 # if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */
975 # ifndef SWIG_PYTHON_INITIALIZE_THREADS
976 # define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads()
977 # endif
978 # ifdef __cplusplus /* C++ code */
979  class SWIG_Python_Thread_Block {
980  bool status;
981  PyGILState_STATE state;
982  public:
983  void end() { if (status) { PyGILState_Release(state); status = false;} }
984  SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {}
985  ~SWIG_Python_Thread_Block() { end(); }
986  };
987  class SWIG_Python_Thread_Allow {
988  bool status;
989  PyThreadState *save;
990  public:
991  void end() { if (status) { PyEval_RestoreThread(save); status = false; }}
992  SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {}
993  ~SWIG_Python_Thread_Allow() { end(); }
994  };
995 # define SWIG_PYTHON_THREAD_BEGIN_BLOCK SWIG_Python_Thread_Block _swig_thread_block
996 # define SWIG_PYTHON_THREAD_END_BLOCK _swig_thread_block.end()
997 # define SWIG_PYTHON_THREAD_BEGIN_ALLOW SWIG_Python_Thread_Allow _swig_thread_allow
998 # define SWIG_PYTHON_THREAD_END_ALLOW _swig_thread_allow.end()
999 # else /* C code */
1000 # define SWIG_PYTHON_THREAD_BEGIN_BLOCK PyGILState_STATE _swig_thread_block = PyGILState_Ensure()
1001 # define SWIG_PYTHON_THREAD_END_BLOCK PyGILState_Release(_swig_thread_block)
1002 # define SWIG_PYTHON_THREAD_BEGIN_ALLOW PyThreadState *_swig_thread_allow = PyEval_SaveThread()
1003 # define SWIG_PYTHON_THREAD_END_ALLOW PyEval_RestoreThread(_swig_thread_allow)
1004 # endif
1005 # else /* Old thread way, not implemented, user must provide it */
1006 # if !defined(SWIG_PYTHON_INITIALIZE_THREADS)
1007 # define SWIG_PYTHON_INITIALIZE_THREADS
1008 # endif
1009 # if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK)
1010 # define SWIG_PYTHON_THREAD_BEGIN_BLOCK
1011 # endif
1012 # if !defined(SWIG_PYTHON_THREAD_END_BLOCK)
1013 # define SWIG_PYTHON_THREAD_END_BLOCK
1014 # endif
1015 # if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW)
1016 # define SWIG_PYTHON_THREAD_BEGIN_ALLOW
1017 # endif
1018 # if !defined(SWIG_PYTHON_THREAD_END_ALLOW)
1019 # define SWIG_PYTHON_THREAD_END_ALLOW
1020 # endif
1021 # endif
1022 #else /* No thread support */
1023 # define SWIG_PYTHON_INITIALIZE_THREADS
1024 # define SWIG_PYTHON_THREAD_BEGIN_BLOCK
1025 # define SWIG_PYTHON_THREAD_END_BLOCK
1026 # define SWIG_PYTHON_THREAD_BEGIN_ALLOW
1027 # define SWIG_PYTHON_THREAD_END_ALLOW
1028 #endif
1029 
1030 /* -----------------------------------------------------------------------------
1031  * Python API portion that goes into the runtime
1032  * ----------------------------------------------------------------------------- */
1033 
1034 #ifdef __cplusplus
1035 extern "C" {
1036 #endif
1037 
1038 /* -----------------------------------------------------------------------------
1039  * Constant declarations
1040  * ----------------------------------------------------------------------------- */
1041 
1042 /* Constant Types */
1043 #define SWIG_PY_POINTER 4
1044 #define SWIG_PY_BINARY 5
1045 
1046 /* Constant information structure */
1047 typedef struct swig_const_info {
1048  int type;
1049  const char *name;
1050  long lvalue;
1051  double dvalue;
1052  void *pvalue;
1054 } swig_const_info;
1055 
1056 #ifdef __cplusplus
1057 }
1058 #endif
1059 
1060 
1061 /* -----------------------------------------------------------------------------
1062  * pyrun.swg
1063  *
1064  * This file contains the runtime support for Python modules
1065  * and includes code for managing global variables and pointer
1066  * type checking.
1067  *
1068  * ----------------------------------------------------------------------------- */
1069 
1070 #if PY_VERSION_HEX < 0x02070000 /* 2.7.0 */
1071 # error "This version of SWIG only supports Python >= 2.7"
1072 #endif
1073 
1074 #if PY_VERSION_HEX >= 0x03000000 && PY_VERSION_HEX < 0x03020000
1075 # error "This version of SWIG only supports Python 3 >= 3.2"
1076 #endif
1077 
1078 /* Common SWIG API */
1079 
1080 /* for raw pointers */
1081 #define SWIG_Python_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
1082 #define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtr(obj, pptr, type, flags)
1083 #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own)
1084 
1085 #ifdef SWIGPYTHON_BUILTIN
1086 #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(self, ptr, type, flags)
1087 #else
1088 #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
1089 #endif
1090 
1091 #define SWIG_InternalNewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
1092 
1093 #define SWIG_CheckImplicit(ty) SWIG_Python_CheckImplicit(ty)
1094 #define SWIG_AcquirePtr(ptr, src) SWIG_Python_AcquirePtr(ptr, src)
1095 #define swig_owntype int
1096 
1097 /* for raw packed data */
1098 #define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
1099 #define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type)
1100 
1101 /* for class or struct pointers */
1102 #define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
1103 #define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
1104 
1105 /* for C or C++ function pointers */
1106 #define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Python_ConvertFunctionPtr(obj, pptr, type)
1107 #define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(NULL, ptr, type, 0)
1108 
1109 /* for C++ member pointers, ie, member methods */
1110 #define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
1111 #define SWIG_NewMemberObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type)
1112 
1113 
1114 /* Runtime API */
1115 
1116 #define SWIG_GetModule(clientdata) SWIG_Python_GetModule(clientdata)
1117 #define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer)
1118 #define SWIG_NewClientData(obj) SwigPyClientData_New(obj)
1119 
1120 #define SWIG_SetErrorObj SWIG_Python_SetErrorObj
1121 #define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg
1122 #define SWIG_ErrorType(code) SWIG_Python_ErrorType(code)
1123 #define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg)
1124 #define SWIG_fail goto fail
1125 
1126 
1127 /* Runtime API implementation */
1128 
1129 /* Error manipulation */
1130 
1131 SWIGINTERN void
1132 SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) {
1134  PyErr_SetObject(errtype, obj);
1135  Py_DECREF(obj);
1137 }
1138 
1139 SWIGINTERN void
1140 SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) {
1142  PyErr_SetString(errtype, msg);
1144 }
1145 
1146 #define SWIG_Python_Raise(obj, type, desc) SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj)
1147 
1148 /* Set a constant value */
1149 
1150 #if defined(SWIGPYTHON_BUILTIN)
1151 
1152 SWIGINTERN void
1153 SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) {
1154  PyObject *s = PyString_InternFromString(key);
1155  PyList_Append(seq, s);
1156  Py_DECREF(s);
1157 }
1158 
1159 SWIGINTERN void
1160 SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) {
1161  PyDict_SetItemString(d, name, obj);
1162  Py_DECREF(obj);
1163  if (public_interface)
1164  SwigPyBuiltin_AddPublicSymbol(public_interface, name);
1165 }
1166 
1167 #else
1168 
1169 SWIGINTERN void
1170 SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) {
1171  PyDict_SetItemString(d, name, obj);
1172  Py_DECREF(obj);
1173 }
1174 
1175 #endif
1176 
1177 /* Append a value to the result obj */
1178 
1179 SWIGINTERN PyObject*
1180 SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) {
1181  if (!result) {
1182  result = obj;
1183  } else if (result == Py_None) {
1184  Py_DECREF(result);
1185  result = obj;
1186  } else {
1187  if (!PyList_Check(result)) {
1188  PyObject *o2 = result;
1189  result = PyList_New(1);
1190  PyList_SetItem(result, 0, o2);
1191  }
1192  PyList_Append(result,obj);
1193  Py_DECREF(obj);
1194  }
1195  return result;
1196 }
1197 
1198 /* Unpack the argument tuple */
1199 
1200 SWIGINTERN Py_ssize_t
1201 SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
1202 {
1203  if (!args) {
1204  if (!min && !max) {
1205  return 1;
1206  } else {
1207  PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none",
1208  name, (min == max ? "" : "at least "), (int)min);
1209  return 0;
1210  }
1211  }
1212  if (!PyTuple_Check(args)) {
1213  if (min <= 1 && max >= 1) {
1214  Py_ssize_t i;
1215  objs[0] = args;
1216  for (i = 1; i < max; ++i) {
1217  objs[i] = 0;
1218  }
1219  return 2;
1220  }
1221  PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple");
1222  return 0;
1223  } else {
1224  Py_ssize_t l = PyTuple_GET_SIZE(args);
1225  if (l < min) {
1226  PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
1227  name, (min == max ? "" : "at least "), (int)min, (int)l);
1228  return 0;
1229  } else if (l > max) {
1230  PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
1231  name, (min == max ? "" : "at most "), (int)max, (int)l);
1232  return 0;
1233  } else {
1234  Py_ssize_t i;
1235  for (i = 0; i < l; ++i) {
1236  objs[i] = PyTuple_GET_ITEM(args, i);
1237  }
1238  for (; l < max; ++l) {
1239  objs[l] = 0;
1240  }
1241  return i + 1;
1242  }
1243  }
1244 }
1245 
1246 /* A functor is a function object with one single object argument */
1247 #define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL);
1248 
1249 /*
1250  Helper for static pointer initialization for both C and C++ code, for example
1251  static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...);
1252 */
1253 #ifdef __cplusplus
1254 #define SWIG_STATIC_POINTER(var) var
1255 #else
1256 #define SWIG_STATIC_POINTER(var) var = 0; if (!var) var
1257 #endif
1258 
1259 /* -----------------------------------------------------------------------------
1260  * Pointer declarations
1261  * ----------------------------------------------------------------------------- */
1262 
1263 /* Flags for new pointer objects */
1264 #define SWIG_POINTER_NOSHADOW (SWIG_POINTER_OWN << 1)
1265 #define SWIG_POINTER_NEW (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN)
1266 
1267 #define SWIG_POINTER_IMPLICIT_CONV (SWIG_POINTER_DISOWN << 1)
1268 
1269 #define SWIG_BUILTIN_TP_INIT (SWIG_POINTER_OWN << 2)
1270 #define SWIG_BUILTIN_INIT (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN)
1271 
1272 #ifdef __cplusplus
1273 extern "C" {
1274 #endif
1275 
1276 /* The python void return value */
1277 
1278 SWIGRUNTIMEINLINE PyObject *
1280 {
1281  PyObject *none = Py_None;
1282  Py_INCREF(none);
1283  return none;
1284 }
1285 
1286 /* SwigPyClientData */
1287 
1288 typedef struct {
1289  PyObject *klass;
1290  PyObject *newraw;
1291  PyObject *newargs;
1292  PyObject *destroy;
1293  int delargs;
1294  int implicitconv;
1295  PyTypeObject *pytype;
1297 
1298 SWIGRUNTIMEINLINE int
1300 {
1302  int fail = data ? data->implicitconv : 0;
1303  if (fail)
1304  PyErr_SetString(PyExc_TypeError, "Implicit conversion is prohibited for explicit constructors.");
1305  return fail;
1306 }
1307 
1308 SWIGRUNTIMEINLINE PyObject *
1310  SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0;
1311  PyObject *klass = data ? data->klass : 0;
1312  return (klass ? klass : PyExc_RuntimeError);
1313 }
1314 
1315 
1317 SwigPyClientData_New(PyObject* obj)
1318 {
1319  if (!obj) {
1320  return 0;
1321  } else {
1323  /* the klass element */
1324  data->klass = obj;
1325  Py_INCREF(data->klass);
1326  /* the newraw method and newargs arguments used to create a new raw instance */
1327  if (PyClass_Check(obj)) {
1328  data->newraw = 0;
1329  data->newargs = obj;
1330  Py_INCREF(obj);
1331  } else {
1332  data->newraw = PyObject_GetAttrString(data->klass, "__new__");
1333  if (data->newraw) {
1334  Py_INCREF(data->newraw);
1335  data->newargs = PyTuple_New(1);
1336  PyTuple_SetItem(data->newargs, 0, obj);
1337  } else {
1338  data->newargs = obj;
1339  }
1340  Py_INCREF(data->newargs);
1341  }
1342  /* the destroy method, aka as the C++ delete method */
1343  data->destroy = PyObject_GetAttrString(data->klass, "__swig_destroy__");
1344  if (PyErr_Occurred()) {
1345  PyErr_Clear();
1346  data->destroy = 0;
1347  }
1348  if (data->destroy) {
1349  int flags;
1350  Py_INCREF(data->destroy);
1351  flags = PyCFunction_GET_FLAGS(data->destroy);
1352  data->delargs = !(flags & (METH_O));
1353  } else {
1354  data->delargs = 0;
1355  }
1356  data->implicitconv = 0;
1357  data->pytype = 0;
1358  return data;
1359  }
1360 }
1361 
1362 SWIGRUNTIME void
1364  Py_XDECREF(data->newraw);
1365  Py_XDECREF(data->newargs);
1366  Py_XDECREF(data->destroy);
1367 }
1368 
1369 /* =============== SwigPyObject =====================*/
1370 
1371 typedef struct {
1372  PyObject_HEAD
1373  void *ptr;
1374  swig_type_info *ty;
1375  int own;
1376  PyObject *next;
1377 #ifdef SWIGPYTHON_BUILTIN
1378  PyObject *dict;
1379 #endif
1380 } SwigPyObject;
1381 
1382 
1383 #ifdef SWIGPYTHON_BUILTIN
1384 
1385 SWIGRUNTIME PyObject *
1386 SwigPyObject_get___dict__(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
1387 {
1388  SwigPyObject *sobj = (SwigPyObject *)v;
1389 
1390  if (!sobj->dict)
1391  sobj->dict = PyDict_New();
1392 
1393  Py_INCREF(sobj->dict);
1394  return sobj->dict;
1395 }
1396 
1397 #endif
1398 
1399 SWIGRUNTIME PyObject *
1401 {
1402  return PyLong_FromVoidPtr(v->ptr);
1403 }
1404 
1405 SWIGRUNTIME PyObject *
1406 SwigPyObject_format(const char* fmt, SwigPyObject *v)
1407 {
1408  PyObject *res = NULL;
1409  PyObject *args = PyTuple_New(1);
1410  if (args) {
1411  if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) {
1412  PyObject *ofmt = SWIG_Python_str_FromChar(fmt);
1413  if (ofmt) {
1414 #if PY_VERSION_HEX >= 0x03000000
1415  res = PyUnicode_Format(ofmt,args);
1416 #else
1417  res = PyString_Format(ofmt,args);
1418 #endif
1419  Py_DECREF(ofmt);
1420  }
1421  Py_DECREF(args);
1422  }
1423  }
1424  return res;
1425 }
1426 
1427 SWIGRUNTIME PyObject *
1429 {
1430  return SwigPyObject_format("%o",v);
1431 }
1432 
1433 SWIGRUNTIME PyObject *
1435 {
1436  return SwigPyObject_format("%x",v);
1437 }
1438 
1439 SWIGRUNTIME PyObject *
1441 {
1442  const char *name = SWIG_TypePrettyName(v->ty);
1443  PyObject *repr = SWIG_Python_str_FromFormat("<Swig Object of type '%s' at %p>", (name ? name : "unknown"), (void *)v);
1444  if (v->next) {
1445  PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next);
1446 # if PY_VERSION_HEX >= 0x03000000
1447  PyObject *joined = PyUnicode_Concat(repr, nrep);
1448  Py_DecRef(repr);
1449  Py_DecRef(nrep);
1450  repr = joined;
1451 # else
1452  PyString_ConcatAndDel(&repr,nrep);
1453 # endif
1454  }
1455  return repr;
1456 }
1457 
1458 /* We need a version taking two PyObject* parameters so it's a valid
1459  * PyCFunction to use in swigobject_methods[]. */
1460 SWIGRUNTIME PyObject *
1461 SwigPyObject_repr2(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
1462 {
1463  return SwigPyObject_repr((SwigPyObject*)v);
1464 }
1465 
1466 SWIGRUNTIME int
1468 {
1469  void *i = v->ptr;
1470  void *j = w->ptr;
1471  return (i < j) ? -1 : ((i > j) ? 1 : 0);
1472 }
1473 
1474 /* Added for Python 3.x, would it also be useful for Python 2.x? */
1475 SWIGRUNTIME PyObject*
1477 {
1478  PyObject* res;
1479  if( op != Py_EQ && op != Py_NE ) {
1480  Py_INCREF(Py_NotImplemented);
1481  return Py_NotImplemented;
1482  }
1483  res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0);
1484  return res;
1485 }
1486 
1487 
1488 SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void);
1489 
1490 #ifdef SWIGPYTHON_BUILTIN
1491 static swig_type_info *SwigPyObject_stype = 0;
1492 SWIGRUNTIME PyTypeObject*
1493 SwigPyObject_type(void) {
1494  SwigPyClientData *cd;
1495  assert(SwigPyObject_stype);
1496  cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
1497  assert(cd);
1498  assert(cd->pytype);
1499  return cd->pytype;
1500 }
1501 #else
1502 SWIGRUNTIME PyTypeObject*
1504  static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce();
1505  return type;
1506 }
1507 #endif
1508 
1510 SwigPyObject_Check(PyObject *op) {
1511 #ifdef SWIGPYTHON_BUILTIN
1512  PyTypeObject *target_tp = SwigPyObject_type();
1513  if (PyType_IsSubtype(op->ob_type, target_tp))
1514  return 1;
1515  return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0);
1516 #else
1517  return (Py_TYPE(op) == SwigPyObject_type())
1518  || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0);
1519 #endif
1520 }
1521 
1522 SWIGRUNTIME PyObject *
1523 SwigPyObject_New(void *ptr, swig_type_info *ty, int own);
1524 
1525 SWIGRUNTIME void
1527 {
1528  SwigPyObject *sobj = (SwigPyObject *) v;
1529  PyObject *next = sobj->next;
1530  if (sobj->own == SWIG_POINTER_OWN) {
1531  swig_type_info *ty = sobj->ty;
1532  SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
1533  PyObject *destroy = data ? data->destroy : 0;
1534  if (destroy) {
1535  /* destroy is always a VARARGS method */
1536  PyObject *res;
1537 
1538  /* PyObject_CallFunction() has the potential to silently drop
1539  the active exception. In cases of unnamed temporary
1540  variable or where we just finished iterating over a generator
1541  StopIteration will be active right now, and this needs to
1542  remain true upon return from SwigPyObject_dealloc. So save
1543  and restore. */
1544 
1545  PyObject *type = NULL, *value = NULL, *traceback = NULL;
1546  PyErr_Fetch(&type, &value, &traceback);
1547 
1548  if (data->delargs) {
1549  /* we need to create a temporary object to carry the destroy operation */
1550  PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0);
1551  res = SWIG_Python_CallFunctor(destroy, tmp);
1552  Py_DECREF(tmp);
1553  } else {
1554  PyCFunction meth = PyCFunction_GET_FUNCTION(destroy);
1555  PyObject *mself = PyCFunction_GET_SELF(destroy);
1556  res = ((*meth)(mself, v));
1557  }
1558  if (!res)
1559  PyErr_WriteUnraisable(destroy);
1560 
1561  PyErr_Restore(type, value, traceback);
1562 
1563  Py_XDECREF(res);
1564  }
1565 #if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
1566  else {
1567  const char *name = SWIG_TypePrettyName(ty);
1568  printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown"));
1569  }
1570 #endif
1571  }
1572  Py_XDECREF(next);
1573  PyObject_DEL(v);
1574 }
1575 
1576 SWIGRUNTIME PyObject*
1577 SwigPyObject_append(PyObject* v, PyObject* next)
1578 {
1579  SwigPyObject *sobj = (SwigPyObject *) v;
1580  if (!SwigPyObject_Check(next)) {
1581  PyErr_SetString(PyExc_TypeError, "Attempt to append a non SwigPyObject");
1582  return NULL;
1583  }
1584  sobj->next = next;
1585  Py_INCREF(next);
1586  return SWIG_Py_Void();
1587 }
1588 
1589 SWIGRUNTIME PyObject*
1590 SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1591 {
1592  SwigPyObject *sobj = (SwigPyObject *) v;
1593  if (sobj->next) {
1594  Py_INCREF(sobj->next);
1595  return sobj->next;
1596  } else {
1597  return SWIG_Py_Void();
1598  }
1599 }
1600 
1601 SWIGINTERN PyObject*
1602 SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1603 {
1604  SwigPyObject *sobj = (SwigPyObject *)v;
1605  sobj->own = 0;
1606  return SWIG_Py_Void();
1607 }
1608 
1609 SWIGINTERN PyObject*
1610 SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1611 {
1612  SwigPyObject *sobj = (SwigPyObject *)v;
1613  sobj->own = SWIG_POINTER_OWN;
1614  return SWIG_Py_Void();
1615 }
1616 
1617 SWIGINTERN PyObject*
1618 SwigPyObject_own(PyObject *v, PyObject *args)
1619 {
1620  PyObject *val = 0;
1621  if (!PyArg_UnpackTuple(args, "own", 0, 1, &val)) {
1622  return NULL;
1623  } else {
1624  SwigPyObject *sobj = (SwigPyObject *)v;
1625  PyObject *obj = PyBool_FromLong(sobj->own);
1626  if (val) {
1627  if (PyObject_IsTrue(val)) {
1628  SwigPyObject_acquire(v,args);
1629  } else {
1630  SwigPyObject_disown(v,args);
1631  }
1632  }
1633  return obj;
1634  }
1635 }
1636 
1637 static PyMethodDef
1639  {"disown", SwigPyObject_disown, METH_NOARGS, "releases ownership of the pointer"},
1640  {"acquire", SwigPyObject_acquire, METH_NOARGS, "acquires ownership of the pointer"},
1641  {"own", SwigPyObject_own, METH_VARARGS, "returns/sets ownership of the pointer"},
1642  {"append", SwigPyObject_append, METH_O, "appends another 'this' object"},
1643  {"next", SwigPyObject_next, METH_NOARGS, "returns the next 'this' object"},
1644  {"__repr__",SwigPyObject_repr2, METH_NOARGS, "returns object representation"},
1645  {0, 0, 0, 0}
1646 };
1647 
1648 SWIGRUNTIME PyTypeObject*
1650  static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer";
1651 
1652  static PyNumberMethods SwigPyObject_as_number = {
1653  (binaryfunc)0, /*nb_add*/
1654  (binaryfunc)0, /*nb_subtract*/
1655  (binaryfunc)0, /*nb_multiply*/
1656  /* nb_divide removed in Python 3 */
1657 #if PY_VERSION_HEX < 0x03000000
1658  (binaryfunc)0, /*nb_divide*/
1659 #endif
1660  (binaryfunc)0, /*nb_remainder*/
1661  (binaryfunc)0, /*nb_divmod*/
1662  (ternaryfunc)0,/*nb_power*/
1663  (unaryfunc)0, /*nb_negative*/
1664  (unaryfunc)0, /*nb_positive*/
1665  (unaryfunc)0, /*nb_absolute*/
1666  (inquiry)0, /*nb_nonzero*/
1667  0, /*nb_invert*/
1668  0, /*nb_lshift*/
1669  0, /*nb_rshift*/
1670  0, /*nb_and*/
1671  0, /*nb_xor*/
1672  0, /*nb_or*/
1673 #if PY_VERSION_HEX < 0x03000000
1674  0, /*nb_coerce*/
1675 #endif
1676  (unaryfunc)SwigPyObject_long, /*nb_int*/
1677 #if PY_VERSION_HEX < 0x03000000
1678  (unaryfunc)SwigPyObject_long, /*nb_long*/
1679 #else
1680  0, /*nb_reserved*/
1681 #endif
1682  (unaryfunc)0, /*nb_float*/
1683 #if PY_VERSION_HEX < 0x03000000
1684  (unaryfunc)SwigPyObject_oct, /*nb_oct*/
1685  (unaryfunc)SwigPyObject_hex, /*nb_hex*/
1686 #endif
1687 #if PY_VERSION_HEX >= 0x03050000 /* 3.5 */
1688  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_matrix_multiply */
1689 #elif PY_VERSION_HEX >= 0x03000000 /* 3.0 */
1690  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */
1691 #else
1692  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */
1693 #endif
1694  };
1695 
1696  static PyTypeObject swigpyobject_type;
1697  static int type_init = 0;
1698  if (!type_init) {
1699  const PyTypeObject tmp = {
1700 #if PY_VERSION_HEX >= 0x03000000
1701  PyVarObject_HEAD_INIT(NULL, 0)
1702 #else
1703  PyObject_HEAD_INIT(NULL)
1704  0, /* ob_size */
1705 #endif
1706  "SwigPyObject", /* tp_name */
1707  sizeof(SwigPyObject), /* tp_basicsize */
1708  0, /* tp_itemsize */
1709  (destructor)SwigPyObject_dealloc, /* tp_dealloc */
1710  0, /* tp_print */
1711  (getattrfunc)0, /* tp_getattr */
1712  (setattrfunc)0, /* tp_setattr */
1713 #if PY_VERSION_HEX >= 0x03000000
1714  0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */
1715 #else
1716  (cmpfunc)SwigPyObject_compare, /* tp_compare */
1717 #endif
1718  (reprfunc)SwigPyObject_repr, /* tp_repr */
1719  &SwigPyObject_as_number, /* tp_as_number */
1720  0, /* tp_as_sequence */
1721  0, /* tp_as_mapping */
1722  (hashfunc)0, /* tp_hash */
1723  (ternaryfunc)0, /* tp_call */
1724  0, /* tp_str */
1725  PyObject_GenericGetAttr, /* tp_getattro */
1726  0, /* tp_setattro */
1727  0, /* tp_as_buffer */
1728  Py_TPFLAGS_DEFAULT, /* tp_flags */
1729  swigobject_doc, /* tp_doc */
1730  0, /* tp_traverse */
1731  0, /* tp_clear */
1732  (richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */
1733  0, /* tp_weaklistoffset */
1734  0, /* tp_iter */
1735  0, /* tp_iternext */
1736  swigobject_methods, /* tp_methods */
1737  0, /* tp_members */
1738  0, /* tp_getset */
1739  0, /* tp_base */
1740  0, /* tp_dict */
1741  0, /* tp_descr_get */
1742  0, /* tp_descr_set */
1743  0, /* tp_dictoffset */
1744  0, /* tp_init */
1745  0, /* tp_alloc */
1746  0, /* tp_new */
1747  0, /* tp_free */
1748  0, /* tp_is_gc */
1749  0, /* tp_bases */
1750  0, /* tp_mro */
1751  0, /* tp_cache */
1752  0, /* tp_subclasses */
1753  0, /* tp_weaklist */
1754  0, /* tp_del */
1755  0, /* tp_version_tag */
1756 #if PY_VERSION_HEX >= 0x03040000
1757  0, /* tp_finalize */
1758 #endif
1759 #ifdef COUNT_ALLOCS
1760  0, /* tp_allocs */
1761  0, /* tp_frees */
1762  0, /* tp_maxalloc */
1763  0, /* tp_prev */
1764  0 /* tp_next */
1765 #endif
1766  };
1767  swigpyobject_type = tmp;
1768  type_init = 1;
1769  if (PyType_Ready(&swigpyobject_type) < 0)
1770  return NULL;
1771  }
1772  return &swigpyobject_type;
1773 }
1774 
1775 SWIGRUNTIME PyObject *
1776 SwigPyObject_New(void *ptr, swig_type_info *ty, int own)
1777 {
1778  SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type());
1779  if (sobj) {
1780  sobj->ptr = ptr;
1781  sobj->ty = ty;
1782  sobj->own = own;
1783  sobj->next = 0;
1784  }
1785  return (PyObject *)sobj;
1786 }
1787 
1788 /* -----------------------------------------------------------------------------
1789  * Implements a simple Swig Packed type, and use it instead of string
1790  * ----------------------------------------------------------------------------- */
1791 
1792 typedef struct {
1793  PyObject_HEAD
1794  void *pack;
1795  swig_type_info *ty;
1796  size_t size;
1797 } SwigPyPacked;
1798 
1799 SWIGRUNTIME PyObject *
1801 {
1802  char result[SWIG_BUFFER_SIZE];
1803  if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
1804  return SWIG_Python_str_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);
1805  } else {
1806  return SWIG_Python_str_FromFormat("<Swig Packed %s>", v->ty->name);
1807  }
1808 }
1809 
1810 SWIGRUNTIME PyObject *
1812 {
1813  char result[SWIG_BUFFER_SIZE];
1814  if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){
1815  return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name);
1816  } else {
1817  return SWIG_Python_str_FromChar(v->ty->name);
1818  }
1819 }
1820 
1821 SWIGRUNTIME int
1823 {
1824  size_t i = v->size;
1825  size_t j = w->size;
1826  int s = (i < j) ? -1 : ((i > j) ? 1 : 0);
1827  return s ? s : strncmp((const char *)v->pack, (const char *)w->pack, 2*v->size);
1828 }
1829 
1830 SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void);
1831 
1832 SWIGRUNTIME PyTypeObject*
1834  static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce();
1835  return type;
1836 }
1837 
1839 SwigPyPacked_Check(PyObject *op) {
1840  return ((op)->ob_type == SwigPyPacked_TypeOnce())
1841  || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0);
1842 }
1843 
1844 SWIGRUNTIME void
1846 {
1847  if (SwigPyPacked_Check(v)) {
1848  SwigPyPacked *sobj = (SwigPyPacked *) v;
1849  free(sobj->pack);
1850  }
1851  PyObject_DEL(v);
1852 }
1853 
1854 SWIGRUNTIME PyTypeObject*
1856  static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer";
1857  static PyTypeObject swigpypacked_type;
1858  static int type_init = 0;
1859  if (!type_init) {
1860  const PyTypeObject tmp = {
1861 #if PY_VERSION_HEX>=0x03000000
1862  PyVarObject_HEAD_INIT(NULL, 0)
1863 #else
1864  PyObject_HEAD_INIT(NULL)
1865  0, /* ob_size */
1866 #endif
1867  "SwigPyPacked", /* tp_name */
1868  sizeof(SwigPyPacked), /* tp_basicsize */
1869  0, /* tp_itemsize */
1870  (destructor)SwigPyPacked_dealloc, /* tp_dealloc */
1871  0, /* tp_print */
1872  (getattrfunc)0, /* tp_getattr */
1873  (setattrfunc)0, /* tp_setattr */
1874 #if PY_VERSION_HEX>=0x03000000
1875  0, /* tp_reserved in 3.0.1 */
1876 #else
1877  (cmpfunc)SwigPyPacked_compare, /* tp_compare */
1878 #endif
1879  (reprfunc)SwigPyPacked_repr, /* tp_repr */
1880  0, /* tp_as_number */
1881  0, /* tp_as_sequence */
1882  0, /* tp_as_mapping */
1883  (hashfunc)0, /* tp_hash */
1884  (ternaryfunc)0, /* tp_call */
1885  (reprfunc)SwigPyPacked_str, /* tp_str */
1886  PyObject_GenericGetAttr, /* tp_getattro */
1887  0, /* tp_setattro */
1888  0, /* tp_as_buffer */
1889  Py_TPFLAGS_DEFAULT, /* tp_flags */
1890  swigpacked_doc, /* tp_doc */
1891  0, /* tp_traverse */
1892  0, /* tp_clear */
1893  0, /* tp_richcompare */
1894  0, /* tp_weaklistoffset */
1895  0, /* tp_iter */
1896  0, /* tp_iternext */
1897  0, /* tp_methods */
1898  0, /* tp_members */
1899  0, /* tp_getset */
1900  0, /* tp_base */
1901  0, /* tp_dict */
1902  0, /* tp_descr_get */
1903  0, /* tp_descr_set */
1904  0, /* tp_dictoffset */
1905  0, /* tp_init */
1906  0, /* tp_alloc */
1907  0, /* tp_new */
1908  0, /* tp_free */
1909  0, /* tp_is_gc */
1910  0, /* tp_bases */
1911  0, /* tp_mro */
1912  0, /* tp_cache */
1913  0, /* tp_subclasses */
1914  0, /* tp_weaklist */
1915  0, /* tp_del */
1916  0, /* tp_version_tag */
1917 #if PY_VERSION_HEX >= 0x03040000
1918  0, /* tp_finalize */
1919 #endif
1920 #ifdef COUNT_ALLOCS
1921  0, /* tp_allocs */
1922  0, /* tp_frees */
1923  0, /* tp_maxalloc */
1924  0, /* tp_prev */
1925  0 /* tp_next */
1926 #endif
1927  };
1928  swigpypacked_type = tmp;
1929  type_init = 1;
1930  if (PyType_Ready(&swigpypacked_type) < 0)
1931  return NULL;
1932  }
1933  return &swigpypacked_type;
1934 }
1935 
1936 SWIGRUNTIME PyObject *
1937 SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty)
1938 {
1939  SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type());
1940  if (sobj) {
1941  void *pack = malloc(size);
1942  if (pack) {
1943  memcpy(pack, ptr, size);
1944  sobj->pack = pack;
1945  sobj->ty = ty;
1946  sobj->size = size;
1947  } else {
1948  PyObject_DEL((PyObject *) sobj);
1949  sobj = 0;
1950  }
1951  }
1952  return (PyObject *) sobj;
1953 }
1954 
1956 SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
1957 {
1958  if (SwigPyPacked_Check(obj)) {
1959  SwigPyPacked *sobj = (SwigPyPacked *)obj;
1960  if (sobj->size != size) return 0;
1961  memcpy(ptr, sobj->pack, size);
1962  return sobj->ty;
1963  } else {
1964  return 0;
1965  }
1966 }
1967 
1968 /* -----------------------------------------------------------------------------
1969  * pointers/data manipulation
1970  * ----------------------------------------------------------------------------- */
1971 
1972 static PyObject *Swig_This_global = NULL;
1973 
1974 SWIGRUNTIME PyObject *
1976 {
1977  if (Swig_This_global == NULL)
1979  return Swig_This_global;
1980 }
1981 
1982 /* #define SWIG_PYTHON_SLOW_GETSET_THIS */
1983 
1984 /* TODO: I don't know how to implement the fast getset in Python 3 right now */
1985 #if PY_VERSION_HEX>=0x03000000
1986 #define SWIG_PYTHON_SLOW_GETSET_THIS
1987 #endif
1988 
1990 SWIG_Python_GetSwigThis(PyObject *pyobj)
1991 {
1992  PyObject *obj;
1993 
1994  if (SwigPyObject_Check(pyobj))
1995  return (SwigPyObject *) pyobj;
1996 
1997 #ifdef SWIGPYTHON_BUILTIN
1998  (void)obj;
1999 # ifdef PyWeakref_CheckProxy
2000  if (PyWeakref_CheckProxy(pyobj)) {
2001  pyobj = PyWeakref_GET_OBJECT(pyobj);
2002  if (pyobj && SwigPyObject_Check(pyobj))
2003  return (SwigPyObject*) pyobj;
2004  }
2005 # endif
2006  return NULL;
2007 #else
2008 
2009  obj = 0;
2010 
2011 #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2012  if (PyInstance_Check(pyobj)) {
2013  obj = _PyInstance_Lookup(pyobj, SWIG_This());
2014  } else {
2015  PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
2016  if (dictptr != NULL) {
2017  PyObject *dict = *dictptr;
2018  obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0;
2019  } else {
2020 #ifdef PyWeakref_CheckProxy
2021  if (PyWeakref_CheckProxy(pyobj)) {
2022  PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
2023  return wobj ? SWIG_Python_GetSwigThis(wobj) : 0;
2024  }
2025 #endif
2026  obj = PyObject_GetAttr(pyobj,SWIG_This());
2027  if (obj) {
2028  Py_DECREF(obj);
2029  } else {
2030  if (PyErr_Occurred()) PyErr_Clear();
2031  return 0;
2032  }
2033  }
2034  }
2035 #else
2036  obj = PyObject_GetAttr(pyobj,SWIG_This());
2037  if (obj) {
2038  Py_DECREF(obj);
2039  } else {
2040  if (PyErr_Occurred()) PyErr_Clear();
2041  return 0;
2042  }
2043 #endif
2044  if (obj && !SwigPyObject_Check(obj)) {
2045  /* a PyObject is called 'this', try to get the 'real this'
2046  SwigPyObject from it */
2047  return SWIG_Python_GetSwigThis(obj);
2048  }
2049  return (SwigPyObject *)obj;
2050 #endif
2051 }
2052 
2053 /* Acquire a pointer value */
2054 
2055 SWIGRUNTIME int
2056 SWIG_Python_AcquirePtr(PyObject *obj, int own) {
2057  if (own == SWIG_POINTER_OWN) {
2059  if (sobj) {
2060  int oldown = sobj->own;
2061  sobj->own = own;
2062  return oldown;
2063  }
2064  }
2065  return 0;
2066 }
2067 
2068 /* Convert a pointer value */
2069 
2070 SWIGRUNTIME int
2071 SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) {
2072  int res;
2073  SwigPyObject *sobj;
2074  int implicit_conv = (flags & SWIG_POINTER_IMPLICIT_CONV) != 0;
2075 
2076  if (!obj)
2077  return SWIG_ERROR;
2078  if (obj == Py_None && !implicit_conv) {
2079  if (ptr)
2080  *ptr = 0;
2082  }
2083 
2084  res = SWIG_ERROR;
2085 
2086  sobj = SWIG_Python_GetSwigThis(obj);
2087  if (own)
2088  *own = 0;
2089  while (sobj) {
2090  void *vptr = sobj->ptr;
2091  if (ty) {
2092  swig_type_info *to = sobj->ty;
2093  if (to == ty) {
2094  /* no type cast needed */
2095  if (ptr) *ptr = vptr;
2096  break;
2097  } else {
2098  swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
2099  if (!tc) {
2100  sobj = (SwigPyObject *)sobj->next;
2101  } else {
2102  if (ptr) {
2103  int newmemory = 0;
2104  *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
2105  if (newmemory == SWIG_CAST_NEW_MEMORY) {
2106  assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
2107  if (own)
2108  *own = *own | SWIG_CAST_NEW_MEMORY;
2109  }
2110  }
2111  break;
2112  }
2113  }
2114  } else {
2115  if (ptr) *ptr = vptr;
2116  break;
2117  }
2118  }
2119  if (sobj) {
2120  if (own)
2121  *own = *own | sobj->own;
2122  if (flags & SWIG_POINTER_DISOWN) {
2123  sobj->own = 0;
2124  }
2125  res = SWIG_OK;
2126  } else {
2127  if (implicit_conv) {
2128  SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
2129  if (data && !data->implicitconv) {
2130  PyObject *klass = data->klass;
2131  if (klass) {
2132  PyObject *impconv;
2133  data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/
2134  impconv = SWIG_Python_CallFunctor(klass, obj);
2135  data->implicitconv = 0;
2136  if (PyErr_Occurred()) {
2137  PyErr_Clear();
2138  impconv = 0;
2139  }
2140  if (impconv) {
2141  SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv);
2142  if (iobj) {
2143  void *vptr;
2144  res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
2145  if (SWIG_IsOK(res)) {
2146  if (ptr) {
2147  *ptr = vptr;
2148  /* transfer the ownership to 'ptr' */
2149  iobj->own = 0;
2150  res = SWIG_AddCast(res);
2151  res = SWIG_AddNewMask(res);
2152  } else {
2153  res = SWIG_AddCast(res);
2154  }
2155  }
2156  }
2157  Py_DECREF(impconv);
2158  }
2159  }
2160  }
2161  if (!SWIG_IsOK(res) && obj == Py_None) {
2162  if (ptr)
2163  *ptr = 0;
2164  if (PyErr_Occurred())
2165  PyErr_Clear();
2166  res = SWIG_OK;
2167  }
2168  }
2169  }
2170  return res;
2171 }
2172 
2173 /* Convert a function ptr value */
2174 
2175 SWIGRUNTIME int
2176 SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
2177  if (!PyCFunction_Check(obj)) {
2178  return SWIG_ConvertPtr(obj, ptr, ty, 0);
2179  } else {
2180  void *vptr = 0;
2181  swig_cast_info *tc;
2182 
2183  /* here we get the method pointer for callbacks */
2184  const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
2185  const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
2186  if (desc)
2187  desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
2188  if (!desc)
2189  return SWIG_ERROR;
2190  tc = SWIG_TypeCheck(desc,ty);
2191  if (tc) {
2192  int newmemory = 0;
2193  *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
2194  assert(!newmemory); /* newmemory handling not yet implemented */
2195  } else {
2196  return SWIG_ERROR;
2197  }
2198  return SWIG_OK;
2199  }
2200 }
2201 
2202 /* Convert a packed pointer value */
2203 
2204 SWIGRUNTIME int
2205 SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) {
2206  swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz);
2207  if (!to) return SWIG_ERROR;
2208  if (ty) {
2209  if (to != ty) {
2210  /* check type cast? */
2211  swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
2212  if (!tc) return SWIG_ERROR;
2213  }
2214  }
2215  return SWIG_OK;
2216 }
2217 
2218 /* -----------------------------------------------------------------------------
2219  * Create a new pointer object
2220  * ----------------------------------------------------------------------------- */
2221 
2222 /*
2223  Create a new instance object, without calling __init__, and set the
2224  'this' attribute.
2225 */
2226 
2227 SWIGRUNTIME PyObject*
2229 {
2230  PyObject *inst = 0;
2231  PyObject *newraw = data->newraw;
2232  if (newraw) {
2233  inst = PyObject_Call(newraw, data->newargs, NULL);
2234  if (inst) {
2235 #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2236  PyObject **dictptr = _PyObject_GetDictPtr(inst);
2237  if (dictptr != NULL) {
2238  PyObject *dict = *dictptr;
2239  if (dict == NULL) {
2240  dict = PyDict_New();
2241  *dictptr = dict;
2242  PyDict_SetItem(dict, SWIG_This(), swig_this);
2243  }
2244  }
2245 #else
2246  PyObject *key = SWIG_This();
2247  PyObject_SetAttr(inst, key, swig_this);
2248 #endif
2249  }
2250  } else {
2251 #if PY_VERSION_HEX >= 0x03000000
2252  PyObject *empty_args = PyTuple_New(0);
2253  if (empty_args) {
2254  PyObject *empty_kwargs = PyDict_New();
2255  if (empty_kwargs) {
2256  inst = ((PyTypeObject *)data->newargs)->tp_new((PyTypeObject *)data->newargs, empty_args, empty_kwargs);
2257  Py_DECREF(empty_kwargs);
2258  if (inst) {
2259  PyObject_SetAttr(inst, SWIG_This(), swig_this);
2260  Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
2261  }
2262  }
2263  Py_DECREF(empty_args);
2264  }
2265 #else
2266  PyObject *dict = PyDict_New();
2267  if (dict) {
2268  PyDict_SetItem(dict, SWIG_This(), swig_this);
2269  inst = PyInstance_NewRaw(data->newargs, dict);
2270  Py_DECREF(dict);
2271  }
2272 #endif
2273  }
2274  return inst;
2275 }
2276 
2277 SWIGRUNTIME void
2278 SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this)
2279 {
2280  PyObject *dict;
2281 #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2282  PyObject **dictptr = _PyObject_GetDictPtr(inst);
2283  if (dictptr != NULL) {
2284  dict = *dictptr;
2285  if (dict == NULL) {
2286  dict = PyDict_New();
2287  *dictptr = dict;
2288  }
2289  PyDict_SetItem(dict, SWIG_This(), swig_this);
2290  return;
2291  }
2292 #endif
2293  dict = PyObject_GetAttrString(inst, "__dict__");
2294  PyDict_SetItem(dict, SWIG_This(), swig_this);
2295  Py_DECREF(dict);
2296 }
2297 
2298 
2299 SWIGINTERN PyObject *
2301  PyObject *obj[2];
2302  if (!SWIG_Python_UnpackTuple(args, "swiginit", 2, 2, obj)) {
2303  return NULL;
2304  } else {
2305  SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]);
2306  if (sthis) {
2307  SwigPyObject_append((PyObject*) sthis, obj[1]);
2308  } else {
2309  SWIG_Python_SetSwigThis(obj[0], obj[1]);
2310  }
2311  return SWIG_Py_Void();
2312  }
2313 }
2314 
2315 /* Create a new pointer object */
2316 
2317 SWIGRUNTIME PyObject *
2318 SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags) {
2319  SwigPyClientData *clientdata;
2320  PyObject * robj;
2321  int own;
2322 
2323  if (!ptr)
2324  return SWIG_Py_Void();
2325 
2326  clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0;
2327  own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
2328  if (clientdata && clientdata->pytype) {
2329  SwigPyObject *newobj;
2330  if (flags & SWIG_BUILTIN_TP_INIT) {
2331  newobj = (SwigPyObject*) self;
2332  if (newobj->ptr) {
2333  PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0);
2334  while (newobj->next)
2335  newobj = (SwigPyObject *) newobj->next;
2336  newobj->next = next_self;
2337  newobj = (SwigPyObject *)next_self;
2338 #ifdef SWIGPYTHON_BUILTIN
2339  newobj->dict = 0;
2340 #endif
2341  }
2342  } else {
2343  newobj = PyObject_New(SwigPyObject, clientdata->pytype);
2344 #ifdef SWIGPYTHON_BUILTIN
2345  newobj->dict = 0;
2346 #endif
2347  }
2348  if (newobj) {
2349  newobj->ptr = ptr;
2350  newobj->ty = type;
2351  newobj->own = own;
2352  newobj->next = 0;
2353  return (PyObject*) newobj;
2354  }
2355  return SWIG_Py_Void();
2356  }
2357 
2358  assert(!(flags & SWIG_BUILTIN_TP_INIT));
2359 
2360  robj = SwigPyObject_New(ptr, type, own);
2361  if (robj && clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
2362  PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
2363  Py_DECREF(robj);
2364  robj = inst;
2365  }
2366  return robj;
2367 }
2368 
2369 /* Create a new packed object */
2370 
2371 SWIGRUNTIMEINLINE PyObject *
2372 SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
2373  return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void();
2374 }
2375 
2376 /* -----------------------------------------------------------------------------*
2377  * Get type list
2378  * -----------------------------------------------------------------------------*/
2379 
2380 #ifdef SWIG_LINK_RUNTIME
2381 void *SWIG_ReturnGlobalTypeList(void *);
2382 #endif
2383 
2386  static void *type_pointer = (void *)0;
2387  /* first check if module already created */
2388  if (!type_pointer) {
2389 #ifdef SWIG_LINK_RUNTIME
2390  type_pointer = SWIG_ReturnGlobalTypeList((void *)0);
2391 #else
2392  type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0);
2393  if (PyErr_Occurred()) {
2394  PyErr_Clear();
2395  type_pointer = (void *)0;
2396  }
2397 #endif
2398  }
2399  return (swig_module_info *) type_pointer;
2400 }
2401 
2402 SWIGRUNTIME void
2404 {
2405  swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME);
2406  swig_type_info **types = swig_module->types;
2407  size_t i;
2408  for (i =0; i < swig_module->size; ++i) {
2409  swig_type_info *ty = types[i];
2410  if (ty->owndata) {
2412  if (data) SwigPyClientData_Del(data);
2413  }
2414  }
2415  Py_DECREF(SWIG_This());
2416  Swig_This_global = NULL;
2417 }
2418 
2419 SWIGRUNTIME void
2421 #if PY_VERSION_HEX >= 0x03000000
2422  /* Add a dummy module object into sys.modules */
2423  PyObject *module = PyImport_AddModule("swig_runtime_data" SWIG_RUNTIME_VERSION);
2424 #else
2425  static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */
2426  PyObject *module = Py_InitModule("swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table);
2427 #endif
2428  PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule);
2429  if (pointer && module) {
2430  PyModule_AddObject(module, "type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer);
2431  } else {
2432  Py_XDECREF(pointer);
2433  }
2434 }
2435 
2436 /* The python cached type query */
2437 SWIGRUNTIME PyObject *
2439  static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New();
2440  return cache;
2441 }
2442 
2444 SWIG_Python_TypeQuery(const char *type)
2445 {
2446  PyObject *cache = SWIG_Python_TypeCache();
2447  PyObject *key = SWIG_Python_str_FromChar(type);
2448  PyObject *obj = PyDict_GetItem(cache, key);
2449  swig_type_info *descriptor;
2450  if (obj) {
2451  descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL);
2452  } else {
2454  descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type);
2455  if (descriptor) {
2456  obj = PyCapsule_New((void*) descriptor, NULL, NULL);
2457  PyDict_SetItem(cache, key, obj);
2458  Py_DECREF(obj);
2459  }
2460  }
2461  Py_DECREF(key);
2462  return descriptor;
2463 }
2464 
2465 /*
2466  For backward compatibility only
2467 */
2468 #define SWIG_POINTER_EXCEPTION 0
2469 #define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg)
2470 #define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags)
2471 
2472 SWIGRUNTIME int
2473 SWIG_Python_AddErrMesg(const char* mesg, int infront)
2474 {
2475  if (PyErr_Occurred()) {
2476  PyObject *type = 0;
2477  PyObject *value = 0;
2478  PyObject *traceback = 0;
2479  PyErr_Fetch(&type, &value, &traceback);
2480  if (value) {
2481  PyObject *old_str = PyObject_Str(value);
2482  const char *tmp = SWIG_Python_str_AsChar(old_str);
2483  const char *errmesg = tmp ? tmp : "Invalid error message";
2484  Py_XINCREF(type);
2485  PyErr_Clear();
2486  if (infront) {
2487  PyErr_Format(type, "%s %s", mesg, errmesg);
2488  } else {
2489  PyErr_Format(type, "%s %s", errmesg, mesg);
2490  }
2492  Py_DECREF(old_str);
2493  }
2494  return 1;
2495  } else {
2496  return 0;
2497  }
2498 }
2499 
2500 SWIGRUNTIME int
2502 {
2503  if (PyErr_Occurred()) {
2504  /* add information about failing argument */
2505  char mesg[256];
2506  PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum);
2507  return SWIG_Python_AddErrMesg(mesg, 1);
2508  } else {
2509  return 0;
2510  }
2511 }
2512 
2513 SWIGRUNTIMEINLINE const char *
2514 SwigPyObject_GetDesc(PyObject *self)
2515 {
2516  SwigPyObject *v = (SwigPyObject *)self;
2517  swig_type_info *ty = v ? v->ty : 0;
2518  return ty ? ty->str : "";
2519 }
2520 
2521 SWIGRUNTIME void
2522 SWIG_Python_TypeError(const char *type, PyObject *obj)
2523 {
2524  if (type) {
2525 #if defined(SWIG_COBJECT_TYPES)
2526  if (obj && SwigPyObject_Check(obj)) {
2527  const char *otype = (const char *) SwigPyObject_GetDesc(obj);
2528  if (otype) {
2529  PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received",
2530  type, otype);
2531  return;
2532  }
2533  } else
2534 #endif
2535  {
2536  const char *otype = (obj ? obj->ob_type->tp_name : 0);
2537  if (otype) {
2538  PyObject *str = PyObject_Str(obj);
2539  const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0;
2540  if (cstr) {
2541  PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received",
2542  type, otype, cstr);
2544  } else {
2545  PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
2546  type, otype);
2547  }
2548  Py_XDECREF(str);
2549  return;
2550  }
2551  }
2552  PyErr_Format(PyExc_TypeError, "a '%s' is expected", type);
2553  } else {
2554  PyErr_Format(PyExc_TypeError, "unexpected type is received");
2555  }
2556 }
2557 
2558 
2559 /* Convert a pointer value, signal an exception on a type mismatch */
2560 SWIGRUNTIME void *
2561 SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags) {
2562  void *result;
2563  if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
2564  PyErr_Clear();
2565 #if SWIG_POINTER_EXCEPTION
2566  if (flags) {
2568  SWIG_Python_ArgFail(argnum);
2569  }
2570 #endif
2571  }
2572  return result;
2573 }
2574 
2575 #ifdef SWIGPYTHON_BUILTIN
2576 SWIGRUNTIME int
2577 SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) {
2578  PyTypeObject *tp = obj->ob_type;
2579  PyObject *descr;
2580  PyObject *encoded_name;
2581  descrsetfunc f;
2582  int res = -1;
2583 
2584 # ifdef Py_USING_UNICODE
2585  if (PyString_Check(name)) {
2586  name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL);
2587  if (!name)
2588  return -1;
2589  } else if (!PyUnicode_Check(name))
2590 # else
2591  if (!PyString_Check(name))
2592 # endif
2593  {
2594  PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name);
2595  return -1;
2596  } else {
2597  Py_INCREF(name);
2598  }
2599 
2600  if (!tp->tp_dict) {
2601  if (PyType_Ready(tp) < 0)
2602  goto done;
2603  }
2604 
2605  descr = _PyType_Lookup(tp, name);
2606  f = NULL;
2607  if (descr != NULL)
2608  f = descr->ob_type->tp_descr_set;
2609  if (!f) {
2610  if (PyString_Check(name)) {
2611  encoded_name = name;
2612  Py_INCREF(name);
2613  } else {
2614  encoded_name = PyUnicode_AsUTF8String(name);
2615  if (!encoded_name)
2616  return -1;
2617  }
2618  PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name));
2619  Py_DECREF(encoded_name);
2620  } else {
2621  res = f(descr, obj, value);
2622  }
2623 
2624  done:
2625  Py_DECREF(name);
2626  return res;
2627 }
2628 #endif
2629 
2630 
2631 #ifdef __cplusplus
2632 }
2633 #endif
2634 
2635 
2636 
2637 #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
2638 
2639 #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
2640 
2641 
2642 
2643 #ifdef __cplusplus
2644 extern "C" {
2645 #endif
2646 
2647 /* Method creation and docstring support functions */
2648 
2649 SWIGINTERN PyMethodDef *SWIG_PythonGetProxyDoc(const char *name);
2650 SWIGINTERN PyObject *SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func);
2651 SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func);
2652 
2653 #ifdef __cplusplus
2654 }
2655 #endif
2656 
2657 
2658  #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0)
2659 
2660 
2661 /* -------- TYPES TABLE (BEGIN) -------- */
2662 
2663 #define SWIGTYPE_p_char swig_types[0]
2664 #define SWIGTYPE_p_int swig_types[1]
2665 #define SWIGTYPE_p_long swig_types[2]
2666 #define SWIGTYPE_p_operations_research__data__rcpsp__RcpspParser swig_types[3]
2667 #define SWIGTYPE_p_short swig_types[4]
2668 #define SWIGTYPE_p_signed_char swig_types[5]
2669 #define SWIGTYPE_p_unsigned_char swig_types[6]
2670 #define SWIGTYPE_p_unsigned_int swig_types[7]
2671 #define SWIGTYPE_p_unsigned_long swig_types[8]
2672 #define SWIGTYPE_p_unsigned_short swig_types[9]
2674 static swig_module_info swig_module = {swig_types, 10, 0, 0, 0, 0};
2675 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
2676 #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
2677 
2678 /* -------- TYPES TABLE (END) -------- */
2679 
2680 #ifdef SWIG_TypeQuery
2681 # undef SWIG_TypeQuery
2682 #endif
2683 #define SWIG_TypeQuery SWIG_Python_TypeQuery
2684 
2685 /*-----------------------------------------------
2686  @(target):= _pywraprcpsp.so
2687  ------------------------------------------------*/
2688 #if PY_VERSION_HEX >= 0x03000000
2689 # define SWIG_init PyInit__pywraprcpsp
2690 
2691 #else
2692 # define SWIG_init init_pywraprcpsp
2693 
2694 #endif
2695 #define SWIG_name "_pywraprcpsp"
2696 
2697 #define SWIGVERSION 0x040001
2698 #define SWIG_VERSION SWIGVERSION
2699 
2700 
2701 #define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
2702 #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))
2703 
2704 
2705 #include <stdexcept>
2706 
2707 
2708 namespace swig {
2709  class SwigPtr_PyObject {
2710  protected:
2711  PyObject *_obj;
2712 
2713  public:
2715  {
2716  }
2717 
2719  {
2721  Py_XINCREF(_obj);
2723  }
2724 
2725  SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj)
2726  {
2727  if (initial_ref) {
2729  Py_XINCREF(_obj);
2731  }
2732  }
2733 
2735  {
2737  Py_XINCREF(item._obj);
2738  Py_XDECREF(_obj);
2739  _obj = item._obj;
2741  return *this;
2742  }
2743 
2745  {
2747  Py_XDECREF(_obj);
2749  }
2750 
2751  operator PyObject *() const
2752  {
2753  return _obj;
2754  }
2755 
2756  PyObject *operator->() const
2757  {
2758  return _obj;
2759  }
2760  };
2761 }
2762 
2763 
2764 namespace swig {
2765  struct SwigVar_PyObject : SwigPtr_PyObject {
2766  SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { }
2767 
2769  {
2770  Py_XDECREF(_obj);
2771  _obj = obj;
2772  return *this;
2773  }
2774  };
2775 }
2776 
2777 
2778 #include <cstdint>
2779 #include <string>
2780 #include <vector>
2781 
2782 #include "ortools/base/basictypes.h"
2783 
2784 
2785 #include <stdint.h> // Use the C99 official header
2786 
2787 
2788 #define SWIGWORDSIZE64
2789 #ifndef LONG_MAX
2790 #include <limits.h>
2791 #endif
2792 #if (__WORDSIZE == 32) || (LONG_MAX == INT_MAX)
2793 # error "SWIG wrapped code invalid in 32 bit architecture, regenerate code using -DSWIGWORDSIZE32"
2794 #endif
2795 
2796 
2797 #include <string>
2798 
2799 
2800 #include "ortools/base/python-swig.h"
2801 
2802 
2803 #include "ortools/data/rcpsp_parser.h"
2804 #include "ortools/data/rcpsp.pb.h"
2805 
2806 
2809 {
2810  static int init = 0;
2811  static swig_type_info* info = 0;
2812  if (!init) {
2813  info = SWIG_TypeQuery("_p_char");
2814  init = 1;
2815  }
2816  return info;
2817 }
2818 
2819 
2820 SWIGINTERN int
2821 SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
2822 {
2823 #if PY_VERSION_HEX>=0x03000000
2824 #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
2825  if (PyBytes_Check(obj))
2826 #else
2827  if (PyUnicode_Check(obj))
2828 #endif
2829 #else
2830  if (PyString_Check(obj))
2831 #endif
2832  {
2833  char *cstr; Py_ssize_t len;
2834  int ret = SWIG_OK;
2835 #if PY_VERSION_HEX>=0x03000000
2836 #if !defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
2837  if (!alloc && cptr) {
2838  /* We can't allow converting without allocation, since the internal
2839  representation of string in Python 3 is UCS-2/UCS-4 but we require
2840  a UTF-8 representation.
2841  TODO(bhy) More detailed explanation */
2842  return SWIG_RuntimeError;
2843  }
2844  obj = PyUnicode_AsUTF8String(obj);
2845  if (!obj)
2846  return SWIG_TypeError;
2847  if (alloc)
2848  *alloc = SWIG_NEWOBJ;
2849 #endif
2850  PyBytes_AsStringAndSize(obj, &cstr, &len);
2851 #else
2852  PyString_AsStringAndSize(obj, &cstr, &len);
2853 #endif
2854  if (cptr) {
2855  if (alloc) {
2856  if (*alloc == SWIG_NEWOBJ) {
2857  *cptr = reinterpret_cast< char* >(memcpy(new char[len + 1], cstr, sizeof(char)*(len + 1)));
2858  *alloc = SWIG_NEWOBJ;
2859  } else {
2860  *cptr = cstr;
2861  *alloc = SWIG_OLDOBJ;
2862  }
2863  } else {
2864 #if PY_VERSION_HEX>=0x03000000
2865 #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
2866  *cptr = PyBytes_AsString(obj);
2867 #else
2868  assert(0); /* Should never reach here with Unicode strings in Python 3 */
2869 #endif
2870 #else
2871  *cptr = SWIG_Python_str_AsChar(obj);
2872  if (!*cptr)
2873  ret = SWIG_TypeError;
2874 #endif
2875  }
2876  }
2877  if (psize) *psize = len + 1;
2878 #if PY_VERSION_HEX>=0x03000000 && !defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
2879  Py_XDECREF(obj);
2880 #endif
2881  return ret;
2882  } else {
2883 #if defined(SWIG_PYTHON_2_UNICODE)
2884 #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
2885 #error "Cannot use both SWIG_PYTHON_2_UNICODE and SWIG_PYTHON_STRICT_BYTE_CHAR at once"
2886 #endif
2887 #if PY_VERSION_HEX<0x03000000
2888  if (PyUnicode_Check(obj)) {
2889  char *cstr; Py_ssize_t len;
2890  if (!alloc && cptr) {
2891  return SWIG_RuntimeError;
2892  }
2893  obj = PyUnicode_AsUTF8String(obj);
2894  if (!obj)
2895  return SWIG_TypeError;
2896  if (PyString_AsStringAndSize(obj, &cstr, &len) != -1) {
2897  if (cptr) {
2898  if (alloc) *alloc = SWIG_NEWOBJ;
2899  *cptr = reinterpret_cast< char* >(memcpy(new char[len + 1], cstr, sizeof(char)*(len + 1)));
2900  }
2901  if (psize) *psize = len + 1;
2902 
2903  Py_XDECREF(obj);
2904  return SWIG_OK;
2905  } else {
2906  Py_XDECREF(obj);
2907  }
2908  }
2909 #endif
2910 #endif
2911 
2912  swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
2913  if (pchar_descriptor) {
2914  void* vptr = 0;
2915  if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
2916  if (cptr) *cptr = (char *) vptr;
2917  if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0;
2918  if (alloc) *alloc = SWIG_OLDOBJ;
2919  return SWIG_OK;
2920  }
2921  }
2922  }
2923  return SWIG_TypeError;
2924 }
2925 
2926 
2927 SWIGINTERN int
2928 SWIG_AsPtr_std_string (PyObject * obj, std::string **val)
2929 {
2930  char* buf = 0 ; size_t size = 0; int alloc = SWIG_OLDOBJ;
2931  if (SWIG_IsOK((SWIG_AsCharPtrAndSize(obj, &buf, &size, &alloc)))) {
2932  if (buf) {
2933  if (val) *val = new std::string(buf, size - 1);
2934  if (alloc == SWIG_NEWOBJ) delete[] buf;
2935  return SWIG_NEWOBJ;
2936  } else {
2937  if (val) *val = 0;
2938  return SWIG_OLDOBJ;
2939  }
2940  } else {
2941  static int init = 0;
2942  static swig_type_info* descriptor = 0;
2943  if (!init) {
2944  descriptor = SWIG_TypeQuery("std::string" " *");
2945  init = 1;
2946  }
2947  if (descriptor) {
2948  std::string *vptr;
2949  int res = SWIG_ConvertPtr(obj, (void**)&vptr, descriptor, 0);
2950  if (SWIG_IsOK(res) && val) *val = vptr;
2951  return res;
2952  }
2953  }
2954  return SWIG_ERROR;
2955 }
2956 
2957 
2958 SWIGINTERNINLINE PyObject*
2960 {
2961  return PyBool_FromLong(value ? 1 : 0);
2962 }
2963 
2964 #ifdef __cplusplus
2965 extern "C" {
2966 #endif
2967 SWIGINTERN PyObject *_wrap_new_RcpspParser(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
2968  PyObject *resultobj = 0;
2970 
2971  if (!SWIG_Python_UnpackTuple(args, "new_RcpspParser", 0, 0, 0)) SWIG_fail;
2974  return resultobj;
2975 fail:
2976  return NULL;
2977 }
2978 
2979 
2980 SWIGINTERN PyObject *_wrap_RcpspParser_Problem(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
2981  PyObject *resultobj = 0;
2983  void *argp1 = 0 ;
2984  int res1 = 0 ;
2985  PyObject *swig_obj[1] ;
2987 
2988  if (!args) SWIG_fail;
2989  swig_obj[0] = args;
2991  if (!SWIG_IsOK(res1)) {
2992  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RcpspParser_Problem" "', argument " "1"" of type '" "operations_research::data::rcpsp::RcpspParser const *""'");
2993  }
2994  arg1 = reinterpret_cast< operations_research::data::rcpsp::RcpspParser * >(argp1);
2995  result = ((operations_research::data::rcpsp::RcpspParser const *)arg1)->problem();
2996  {
2997  PyObject* const module = PyImport_ImportModule("ortools.data.rcpsp_pb2");
2998  if (module != nullptr) {
2999  PyObject* const dict = PyModule_GetDict(module);
3000  if (dict != nullptr) {
3001  PyObject* const clss = PyDict_GetItemString(dict, "RcpspProblem");
3002  if (clss != nullptr) {
3003  std::string encoded_protobuf;
3004  (&result)->SerializeToString(&encoded_protobuf);
3005 
3006  PyObject* const python_encoded_protobuf = PyBytes_FromStringAndSize(
3007  encoded_protobuf.c_str(), encoded_protobuf.size());
3008 
3009 
3010 
3011 
3012  PyObject* const result = PyObject_CallMethod(
3013  clss, const_cast<char*>("FromString"),
3014  const_cast<char*>("(O)"),
3015  python_encoded_protobuf);
3016  Py_DECREF(python_encoded_protobuf);
3017  resultobj = result;
3018  }
3019  }
3020  Py_DECREF(module);
3021  }
3022  }
3023  return resultobj;
3024 fail:
3025  return NULL;
3026 }
3027 
3028 
3029 SWIGINTERN PyObject *_wrap_RcpspParser_ParseFile(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3030  PyObject *resultobj = 0;
3032  std::string *arg2 = 0 ;
3033  void *argp1 = 0 ;
3034  int res1 = 0 ;
3035  int res2 = SWIG_OLDOBJ ;
3036  PyObject *swig_obj[2] ;
3037  bool result;
3038 
3039  if (!SWIG_Python_UnpackTuple(args, "RcpspParser_ParseFile", 2, 2, swig_obj)) SWIG_fail;
3041  if (!SWIG_IsOK(res1)) {
3042  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RcpspParser_ParseFile" "', argument " "1"" of type '" "operations_research::data::rcpsp::RcpspParser *""'");
3043  }
3044  arg1 = reinterpret_cast< operations_research::data::rcpsp::RcpspParser * >(argp1);
3045  {
3046  std::string *ptr = (std::string *)0;
3047  res2 = SWIG_AsPtr_std_string(swig_obj[1], &ptr);
3048  if (!SWIG_IsOK(res2)) {
3049  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "RcpspParser_ParseFile" "', argument " "2"" of type '" "std::string const &""'");
3050  }
3051  if (!ptr) {
3052  SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "RcpspParser_ParseFile" "', argument " "2"" of type '" "std::string const &""'");
3053  }
3054  arg2 = ptr;
3055  }
3056  result = (bool)(arg1)->ParseFile((std::string const &)*arg2);
3057  resultobj = SWIG_From_bool(static_cast< bool >(result));
3058  if (SWIG_IsNewObj(res2)) delete arg2;
3059  return resultobj;
3060 fail:
3061  if (SWIG_IsNewObj(res2)) delete arg2;
3062  return NULL;
3063 }
3064 
3065 
3066 SWIGINTERN PyObject *_wrap_delete_RcpspParser(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3067  PyObject *resultobj = 0;
3069  void *argp1 = 0 ;
3070  int res1 = 0 ;
3071  PyObject *swig_obj[1] ;
3072 
3073  if (!args) SWIG_fail;
3074  swig_obj[0] = args;
3076  if (!SWIG_IsOK(res1)) {
3077  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_RcpspParser" "', argument " "1"" of type '" "operations_research::data::rcpsp::RcpspParser *""'");
3078  }
3079  arg1 = reinterpret_cast< operations_research::data::rcpsp::RcpspParser * >(argp1);
3080  delete arg1;
3081  resultobj = SWIG_Py_Void();
3082  return resultobj;
3083 fail:
3084  return NULL;
3085 }
3086 
3087 
3088 SWIGINTERN PyObject *RcpspParser_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3089  PyObject *obj;
3090  if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL;
3092  return SWIG_Py_Void();
3093 }
3094 
3095 SWIGINTERN PyObject *RcpspParser_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3096  return SWIG_Python_InitShadowInstance(args);
3097 }
3098 
3099 static PyMethodDef SwigMethods[] = {
3100  { "SWIG_PyInstanceMethod_New", SWIG_PyInstanceMethod_New, METH_O, NULL},
3101  { "new_RcpspParser", _wrap_new_RcpspParser, METH_NOARGS, NULL},
3102  { "RcpspParser_Problem", _wrap_RcpspParser_Problem, METH_O, NULL},
3103  { "RcpspParser_ParseFile", _wrap_RcpspParser_ParseFile, METH_VARARGS, NULL},
3104  { "delete_RcpspParser", _wrap_delete_RcpspParser, METH_O, NULL},
3105  { "RcpspParser_swigregister", RcpspParser_swigregister, METH_O, NULL},
3106  { "RcpspParser_swiginit", RcpspParser_swiginit, METH_VARARGS, NULL},
3107  { NULL, NULL, 0, NULL }
3108 };
3109 
3110 static PyMethodDef SwigMethods_proxydocs[] = {
3111  { NULL, NULL, 0, NULL }
3112 };
3113 
3114 
3115 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
3116 
3117 static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
3118 static swig_type_info _swigt__p_int = {"_p_int", "int *|int_least32_t *|int32_t *", 0, 0, (void*)0, 0};
3119 static swig_type_info _swigt__p_long = {"_p_long", "intptr_t *|int_least64_t *|int_fast32_t *|int_fast64_t *|int64_t *|long *|int_fast16_t *|intmax_t *", 0, 0, (void*)0, 0};
3120 static swig_type_info _swigt__p_operations_research__data__rcpsp__RcpspParser = {"_p_operations_research__data__rcpsp__RcpspParser", "operations_research::data::rcpsp::RcpspParser *", 0, 0, (void*)0, 0};
3121 static swig_type_info _swigt__p_short = {"_p_short", "short *|int_least16_t *|int16_t *", 0, 0, (void*)0, 0};
3122 static swig_type_info _swigt__p_signed_char = {"_p_signed_char", "signed char *|int_least8_t *|int_fast8_t *|int8_t *", 0, 0, (void*)0, 0};
3123 static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "unsigned char *|uint_least8_t *|uint_fast8_t *|uint8_t *", 0, 0, (void*)0, 0};
3124 static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "uint_least32_t *|uint32_t *|unsigned int *", 0, 0, (void*)0, 0};
3125 static swig_type_info _swigt__p_unsigned_long = {"_p_unsigned_long", "uintptr_t *|uint_least64_t *|uint_fast32_t *|uint_fast64_t *|uint64_t *|unsigned long *|uint_fast16_t *|uintmax_t *", 0, 0, (void*)0, 0};
3126 static swig_type_info _swigt__p_unsigned_short = {"_p_unsigned_short", "unsigned short *|uint_least16_t *|uint16_t *", 0, 0, (void*)0, 0};
3127 
3129  &_swigt__p_char,
3130  &_swigt__p_int,
3131  &_swigt__p_long,
3133  &_swigt__p_short,
3139 };
3140 
3141 static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
3142 static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
3143 static swig_cast_info _swigc__p_long[] = { {&_swigt__p_long, 0, 0, 0},{0, 0, 0, 0}};
3145 static swig_cast_info _swigc__p_short[] = { {&_swigt__p_short, 0, 0, 0},{0, 0, 0, 0}};
3146 static swig_cast_info _swigc__p_signed_char[] = { {&_swigt__p_signed_char, 0, 0, 0},{0, 0, 0, 0}};
3147 static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
3148 static swig_cast_info _swigc__p_unsigned_int[] = { {&_swigt__p_unsigned_int, 0, 0, 0},{0, 0, 0, 0}};
3149 static swig_cast_info _swigc__p_unsigned_long[] = { {&_swigt__p_unsigned_long, 0, 0, 0},{0, 0, 0, 0}};
3151 
3154  _swigc__p_int,
3163 };
3164 
3165 
3166 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
3167 
3169 {0, 0, 0, 0.0, 0, 0}};
3170 
3171 #ifdef __cplusplus
3172 }
3173 #endif
3174 /* -----------------------------------------------------------------------------
3175  * Type initialization:
3176  * This problem is tough by the requirement that no dynamic
3177  * memory is used. Also, since swig_type_info structures store pointers to
3178  * swig_cast_info structures and swig_cast_info structures store pointers back
3179  * to swig_type_info structures, we need some lookup code at initialization.
3180  * The idea is that swig generates all the structures that are needed.
3181  * The runtime then collects these partially filled structures.
3182  * The SWIG_InitializeModule function takes these initial arrays out of
3183  * swig_module, and does all the lookup, filling in the swig_module.types
3184  * array with the correct data and linking the correct swig_cast_info
3185  * structures together.
3186  *
3187  * The generated swig_type_info structures are assigned statically to an initial
3188  * array. We just loop through that array, and handle each type individually.
3189  * First we lookup if this type has been already loaded, and if so, use the
3190  * loaded structure instead of the generated one. Then we have to fill in the
3191  * cast linked list. The cast data is initially stored in something like a
3192  * two-dimensional array. Each row corresponds to a type (there are the same
3193  * number of rows as there are in the swig_type_initial array). Each entry in
3194  * a column is one of the swig_cast_info structures for that type.
3195  * The cast_initial array is actually an array of arrays, because each row has
3196  * a variable number of columns. So to actually build the cast linked list,
3197  * we find the array of casts associated with the type, and loop through it
3198  * adding the casts to the list. The one last trick we need to do is making
3199  * sure the type pointer in the swig_cast_info struct is correct.
3200  *
3201  * First off, we lookup the cast->type name to see if it is already loaded.
3202  * There are three cases to handle:
3203  * 1) If the cast->type has already been loaded AND the type we are adding
3204  * casting info to has not been loaded (it is in this module), THEN we
3205  * replace the cast->type pointer with the type pointer that has already
3206  * been loaded.
3207  * 2) If BOTH types (the one we are adding casting info to, and the
3208  * cast->type) are loaded, THEN the cast info has already been loaded by
3209  * the previous module so we just ignore it.
3210  * 3) Finally, if cast->type has not already been loaded, then we add that
3211  * swig_cast_info to the linked list (because the cast->type) pointer will
3212  * be correct.
3213  * ----------------------------------------------------------------------------- */
3214 
3215 #ifdef __cplusplus
3216 extern "C" {
3217 #if 0
3218 } /* c-mode */
3219 #endif
3220 #endif
3221 
3222 #if 0
3223 #define SWIGRUNTIME_DEBUG
3224 #endif
3225 
3226 
3227 SWIGRUNTIME void
3228 SWIG_InitializeModule(void *clientdata) {
3229  size_t i;
3230  swig_module_info *module_head, *iter;
3231  int init;
3232 
3233  /* check to see if the circular list has been setup, if not, set it up */
3234  if (swig_module.next==0) {
3235  /* Initialize the swig_module */
3239  init = 1;
3240  } else {
3241  init = 0;
3242  }
3243 
3244  /* Try and load any already created modules */
3245  module_head = SWIG_GetModule(clientdata);
3246  if (!module_head) {
3247  /* This is the first module loaded for this interpreter */
3248  /* so set the swig module into the interpreter */
3249  SWIG_SetModule(clientdata, &swig_module);
3250  } else {
3251  /* the interpreter has loaded a SWIG module, but has it loaded this one? */
3252  iter=module_head;
3253  do {
3254  if (iter==&swig_module) {
3255  /* Our module is already in the list, so there's nothing more to do. */
3256  return;
3257  }
3258  iter=iter->next;
3259  } while (iter!= module_head);
3260 
3261  /* otherwise we must add our module into the list */
3262  swig_module.next = module_head->next;
3263  module_head->next = &swig_module;
3264  }
3265 
3266  /* When multiple interpreters are used, a module could have already been initialized in
3267  a different interpreter, but not yet have a pointer in this interpreter.
3268  In this case, we do not want to continue adding types... everything should be
3269  set up already */
3270  if (init == 0) return;
3271 
3272  /* Now work on filling in swig_module.types */
3273 #ifdef SWIGRUNTIME_DEBUG
3274  printf("SWIG_InitializeModule: size %lu\n", (unsigned long)swig_module.size);
3275 #endif
3276  for (i = 0; i < swig_module.size; ++i) {
3277  swig_type_info *type = 0;
3278  swig_type_info *ret;
3279  swig_cast_info *cast;
3280 
3281 #ifdef SWIGRUNTIME_DEBUG
3282  printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name);
3283 #endif
3284 
3285  /* if there is another module already loaded */
3286  if (swig_module.next != &swig_module) {
3288  }
3289  if (type) {
3290  /* Overwrite clientdata field */
3291 #ifdef SWIGRUNTIME_DEBUG
3292  printf("SWIG_InitializeModule: found type %s\n", type->name);
3293 #endif
3296 #ifdef SWIGRUNTIME_DEBUG
3297  printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
3298 #endif
3299  }
3300  } else {
3301  type = swig_module.type_initial[i];
3302  }
3303 
3304  /* Insert casting types */
3305  cast = swig_module.cast_initial[i];
3306  while (cast->type) {
3307  /* Don't need to add information already in the list */
3308  ret = 0;
3309 #ifdef SWIGRUNTIME_DEBUG
3310  printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
3311 #endif
3312  if (swig_module.next != &swig_module) {
3314 #ifdef SWIGRUNTIME_DEBUG
3315  if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
3316 #endif
3317  }
3318  if (ret) {
3319  if (type == swig_module.type_initial[i]) {
3320 #ifdef SWIGRUNTIME_DEBUG
3321  printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
3322 #endif
3323  cast->type = ret;
3324  ret = 0;
3325  } else {
3326  /* Check for casting already in the list */
3327  swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
3328 #ifdef SWIGRUNTIME_DEBUG
3329  if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
3330 #endif
3331  if (!ocast) ret = 0;
3332  }
3333  }
3334 
3335  if (!ret) {
3336 #ifdef SWIGRUNTIME_DEBUG
3337  printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
3338 #endif
3339  if (type->cast) {
3340  type->cast->prev = cast;
3341  cast->next = type->cast;
3342  }
3343  type->cast = cast;
3344  }
3345  cast++;
3346  }
3347  /* Set entry in modules->types array equal to the type */
3348  swig_module.types[i] = type;
3349  }
3350  swig_module.types[i] = 0;
3351 
3352 #ifdef SWIGRUNTIME_DEBUG
3353  printf("**** SWIG_InitializeModule: Cast List ******\n");
3354  for (i = 0; i < swig_module.size; ++i) {
3355  int j = 0;
3357  printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name);
3358  while (cast->type) {
3359  printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
3360  cast++;
3361  ++j;
3362  }
3363  printf("---- Total casts: %d\n",j);
3364  }
3365  printf("**** SWIG_InitializeModule: Cast List ******\n");
3366 #endif
3367 }
3368 
3369 /* This function will propagate the clientdata field of type to
3370 * any new swig_type_info structures that have been added into the list
3371 * of equivalent types. It is like calling
3372 * SWIG_TypeClientData(type, clientdata) a second time.
3373 */
3374 SWIGRUNTIME void
3376  size_t i;
3377  swig_cast_info *equiv;
3378  static int init_run = 0;
3379 
3380  if (init_run) return;
3381  init_run = 1;
3382 
3383  for (i = 0; i < swig_module.size; i++) {
3384  if (swig_module.types[i]->clientdata) {
3385  equiv = swig_module.types[i]->cast;
3386  while (equiv) {
3387  if (!equiv->converter) {
3388  if (equiv->type && !equiv->type->clientdata)
3390  }
3391  equiv = equiv->next;
3392  }
3393  }
3394  }
3395 }
3396 
3397 #ifdef __cplusplus
3398 #if 0
3399 {
3400  /* c-mode */
3401 #endif
3402 }
3403 #endif
3404 
3405 
3406 
3407 #ifdef __cplusplus
3408 extern "C" {
3409 #endif
3410 
3411  /* Python-specific SWIG API */
3412 #define SWIG_newvarlink() SWIG_Python_newvarlink()
3413 #define SWIG_addvarlink(p, name, get_attr, set_attr) SWIG_Python_addvarlink(p, name, get_attr, set_attr)
3414 #define SWIG_InstallConstants(d, constants) SWIG_Python_InstallConstants(d, constants)
3415 
3416  /* -----------------------------------------------------------------------------
3417  * global variable support code.
3418  * ----------------------------------------------------------------------------- */
3419 
3420  typedef struct swig_globalvar {
3421  char *name; /* Name of global variable */
3422  PyObject *(*get_attr)(void); /* Return the current value */
3423  int (*set_attr)(PyObject *); /* Set the value */
3424  struct swig_globalvar *next;
3425  } swig_globalvar;
3426 
3427  typedef struct swig_varlinkobject {
3428  PyObject_HEAD
3431 
3432  SWIGINTERN PyObject *
3434 #if PY_VERSION_HEX >= 0x03000000
3435  return PyUnicode_InternFromString("<Swig global variables>");
3436 #else
3437  return PyString_FromString("<Swig global variables>");
3438 #endif
3439  }
3440 
3441  SWIGINTERN PyObject *
3443 #if PY_VERSION_HEX >= 0x03000000
3444  PyObject *str = PyUnicode_InternFromString("(");
3445  PyObject *tail;
3446  PyObject *joined;
3448  for (var = v->vars; var; var=var->next) {
3449  tail = PyUnicode_FromString(var->name);
3450  joined = PyUnicode_Concat(str, tail);
3451  Py_DecRef(str);
3452  Py_DecRef(tail);
3453  str = joined;
3454  if (var->next) {
3455  tail = PyUnicode_InternFromString(", ");
3456  joined = PyUnicode_Concat(str, tail);
3457  Py_DecRef(str);
3458  Py_DecRef(tail);
3459  str = joined;
3460  }
3461  }
3462  tail = PyUnicode_InternFromString(")");
3463  joined = PyUnicode_Concat(str, tail);
3464  Py_DecRef(str);
3465  Py_DecRef(tail);
3466  str = joined;
3467 #else
3468  PyObject *str = PyString_FromString("(");
3470  for (var = v->vars; var; var=var->next) {
3471  PyString_ConcatAndDel(&str,PyString_FromString(var->name));
3472  if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", "));
3473  }
3474  PyString_ConcatAndDel(&str,PyString_FromString(")"));
3475 #endif
3476  return str;
3477  }
3478 
3479  SWIGINTERN void
3481  swig_globalvar *var = v->vars;
3482  while (var) {
3483  swig_globalvar *n = var->next;
3484  free(var->name);
3485  free(var);
3486  var = n;
3487  }
3488  }
3489 
3490  SWIGINTERN PyObject *
3492  PyObject *res = NULL;
3493  swig_globalvar *var = v->vars;
3494  while (var) {
3495  if (strcmp(var->name,n) == 0) {
3496  res = (*var->get_attr)();
3497  break;
3498  }
3499  var = var->next;
3500  }
3501  if (res == NULL && !PyErr_Occurred()) {
3502  PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n);
3503  }
3504  return res;
3505  }
3506 
3507  SWIGINTERN int
3508  swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
3509  int res = 1;
3510  swig_globalvar *var = v->vars;
3511  while (var) {
3512  if (strcmp(var->name,n) == 0) {
3513  res = (*var->set_attr)(p);
3514  break;
3515  }
3516  var = var->next;
3517  }
3518  if (res == 1 && !PyErr_Occurred()) {
3519  PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n);
3520  }
3521  return res;
3522  }
3523 
3524  SWIGINTERN PyTypeObject*
3526  static char varlink__doc__[] = "Swig var link object";
3527  static PyTypeObject varlink_type;
3528  static int type_init = 0;
3529  if (!type_init) {
3530  const PyTypeObject tmp = {
3531 #if PY_VERSION_HEX >= 0x03000000
3532  PyVarObject_HEAD_INIT(NULL, 0)
3533 #else
3534  PyObject_HEAD_INIT(NULL)
3535  0, /* ob_size */
3536 #endif
3537  "swigvarlink", /* tp_name */
3538  sizeof(swig_varlinkobject), /* tp_basicsize */
3539  0, /* tp_itemsize */
3540  (destructor) swig_varlink_dealloc, /* tp_dealloc */
3541  0, /* tp_print */
3542  (getattrfunc) swig_varlink_getattr, /* tp_getattr */
3543  (setattrfunc) swig_varlink_setattr, /* tp_setattr */
3544  0, /* tp_compare */
3545  (reprfunc) swig_varlink_repr, /* tp_repr */
3546  0, /* tp_as_number */
3547  0, /* tp_as_sequence */
3548  0, /* tp_as_mapping */
3549  0, /* tp_hash */
3550  0, /* tp_call */
3551  (reprfunc) swig_varlink_str, /* tp_str */
3552  0, /* tp_getattro */
3553  0, /* tp_setattro */
3554  0, /* tp_as_buffer */
3555  0, /* tp_flags */
3556  varlink__doc__, /* tp_doc */
3557  0, /* tp_traverse */
3558  0, /* tp_clear */
3559  0, /* tp_richcompare */
3560  0, /* tp_weaklistoffset */
3561  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
3562  0, /* tp_del */
3563  0, /* tp_version_tag */
3564 #if PY_VERSION_HEX >= 0x03040000
3565  0, /* tp_finalize */
3566 #endif
3567 #ifdef COUNT_ALLOCS
3568  0, /* tp_allocs */
3569  0, /* tp_frees */
3570  0, /* tp_maxalloc */
3571  0, /* tp_prev */
3572  0 /* tp_next */
3573 #endif
3574  };
3575  varlink_type = tmp;
3576  type_init = 1;
3577  if (PyType_Ready(&varlink_type) < 0)
3578  return NULL;
3579  }
3580  return &varlink_type;
3581  }
3582 
3583  /* Create a variable linking object for use later */
3584  SWIGINTERN PyObject *
3586  swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type());
3587  if (result) {
3588  result->vars = 0;
3589  }
3590  return ((PyObject*) result);
3591  }
3592 
3593  SWIGINTERN void
3594  SWIG_Python_addvarlink(PyObject *p, const char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
3597  if (gv) {
3598  size_t size = strlen(name)+1;
3599  gv->name = (char *)malloc(size);
3600  if (gv->name) {
3601  memcpy(gv->name, name, size);
3602  gv->get_attr = get_attr;
3603  gv->set_attr = set_attr;
3604  gv->next = v->vars;
3605  }
3606  }
3607  v->vars = gv;
3608  }
3609 
3610  SWIGINTERN PyObject *
3612  static PyObject *globals = 0;
3613  if (!globals) {
3614  globals = SWIG_newvarlink();
3615  }
3616  return globals;
3617  }
3618 
3619  /* -----------------------------------------------------------------------------
3620  * constants/methods manipulation
3621  * ----------------------------------------------------------------------------- */
3622 
3623  /* Install Constants */
3624  SWIGINTERN void
3625  SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
3626  PyObject *obj = 0;
3627  size_t i;
3628  for (i = 0; constants[i].type; ++i) {
3629  switch(constants[i].type) {
3630  case SWIG_PY_POINTER:
3631  obj = SWIG_InternalNewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
3632  break;
3633  case SWIG_PY_BINARY:
3634  obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
3635  break;
3636  default:
3637  obj = 0;
3638  break;
3639  }
3640  if (obj) {
3641  PyDict_SetItemString(d, constants[i].name, obj);
3642  Py_DECREF(obj);
3643  }
3644  }
3645  }
3646 
3647  /* -----------------------------------------------------------------------------*/
3648  /* Fix SwigMethods to carry the callback ptrs when needed */
3649  /* -----------------------------------------------------------------------------*/
3650 
3651  SWIGINTERN void
3652  SWIG_Python_FixMethods(PyMethodDef *methods,
3653  swig_const_info *const_table,
3654  swig_type_info **types,
3655  swig_type_info **types_initial) {
3656  size_t i;
3657  for (i = 0; methods[i].ml_name; ++i) {
3658  const char *c = methods[i].ml_doc;
3659  if (!c) continue;
3660  c = strstr(c, "swig_ptr: ");
3661  if (c) {
3662  int j;
3663  swig_const_info *ci = 0;
3664  const char *name = c + 10;
3665  for (j = 0; const_table[j].type; ++j) {
3666  if (strncmp(const_table[j].name, name,
3667  strlen(const_table[j].name)) == 0) {
3668  ci = &(const_table[j]);
3669  break;
3670  }
3671  }
3672  if (ci) {
3673  void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
3674  if (ptr) {
3675  size_t shift = (ci->ptype) - types;
3676  swig_type_info *ty = types_initial[shift];
3677  size_t ldoc = (c - methods[i].ml_doc);
3678  size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
3679  char *ndoc = (char*)malloc(ldoc + lptr + 10);
3680  if (ndoc) {
3681  char *buff = ndoc;
3682  memcpy(buff, methods[i].ml_doc, ldoc);
3683  buff += ldoc;
3684  memcpy(buff, "swig_ptr: ", 10);
3685  buff += 10;
3686  SWIG_PackVoidPtr(buff, ptr, ty->name, lptr);
3687  methods[i].ml_doc = ndoc;
3688  }
3689  }
3690  }
3691  }
3692  }
3693  }
3694 
3695  /* -----------------------------------------------------------------------------
3696  * Method creation and docstring support functions
3697  * ----------------------------------------------------------------------------- */
3698 
3699  /* -----------------------------------------------------------------------------
3700  * Function to find the method definition with the correct docstring for the
3701  * proxy module as opposed to the low-level API
3702  * ----------------------------------------------------------------------------- */
3703 
3704  SWIGINTERN PyMethodDef *SWIG_PythonGetProxyDoc(const char *name) {
3705  /* Find the function in the modified method table */
3706  size_t offset = 0;
3707  int found = 0;
3708  while (SwigMethods_proxydocs[offset].ml_meth != NULL) {
3709  if (strcmp(SwigMethods_proxydocs[offset].ml_name, name) == 0) {
3710  found = 1;
3711  break;
3712  }
3713  offset++;
3714  }
3715  /* Use the copy with the modified docstring if available */
3716  return found ? &SwigMethods_proxydocs[offset] : NULL;
3717  }
3718 
3719  /* -----------------------------------------------------------------------------
3720  * Wrapper of PyInstanceMethod_New() used in Python 3
3721  * It is exported to the generated module, used for -fastproxy
3722  * ----------------------------------------------------------------------------- */
3723 
3724  SWIGINTERN PyObject *SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) {
3725  if (PyCFunction_Check(func)) {
3726  PyCFunctionObject *funcobj = (PyCFunctionObject *)func;
3727  PyMethodDef *ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name);
3728  if (ml)
3729  func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module);
3730  }
3731 #if PY_VERSION_HEX >= 0x03000000
3732  return PyInstanceMethod_New(func);
3733 #else
3734  return PyMethod_New(func, NULL, NULL);
3735 #endif
3736  }
3737 
3738  /* -----------------------------------------------------------------------------
3739  * Wrapper of PyStaticMethod_New()
3740  * It is exported to the generated module, used for -fastproxy
3741  * ----------------------------------------------------------------------------- */
3742 
3743  SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) {
3744  if (PyCFunction_Check(func)) {
3745  PyCFunctionObject *funcobj = (PyCFunctionObject *)func;
3746  PyMethodDef *ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name);
3747  if (ml)
3748  func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module);
3749  }
3750  return PyStaticMethod_New(func);
3751  }
3752 
3753 #ifdef __cplusplus
3754 }
3755 #endif
3756 
3757 /* -----------------------------------------------------------------------------*
3758  * Partial Init method
3759  * -----------------------------------------------------------------------------*/
3760 
3761 #ifdef __cplusplus
3762 extern "C"
3763 #endif
3764 
3765 SWIGEXPORT
3766 #if PY_VERSION_HEX >= 0x03000000
3767 PyObject*
3768 #else
3769 void
3770 #endif
3771 SWIG_init(void) {
3772  PyObject *m, *d, *md, *globals;
3773 
3774 #if PY_VERSION_HEX >= 0x03000000
3775  static struct PyModuleDef SWIG_module = {
3776  PyModuleDef_HEAD_INIT,
3777  SWIG_name,
3778  NULL,
3779  -1,
3780  SwigMethods,
3781  NULL,
3782  NULL,
3783  NULL,
3784  NULL
3785  };
3786 #endif
3787 
3788 #if defined(SWIGPYTHON_BUILTIN)
3789  static SwigPyClientData SwigPyObject_clientdata = {
3790  0, 0, 0, 0, 0, 0, 0
3791  };
3792  static PyGetSetDef this_getset_def = {
3793  (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL
3794  };
3795  static SwigPyGetSet thisown_getset_closure = {
3798  };
3799  static PyGetSetDef thisown_getset_def = {
3800  (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure
3801  };
3802  PyTypeObject *builtin_pytype;
3803  int builtin_base_count;
3804  swig_type_info *builtin_basetype;
3805  PyObject *tuple;
3806  PyGetSetDescrObject *static_getset;
3807  PyTypeObject *metatype;
3808  PyTypeObject *swigpyobject;
3809  SwigPyClientData *cd;
3810  PyObject *public_interface, *public_symbol;
3811  PyObject *this_descr;
3812  PyObject *thisown_descr;
3813  PyObject *self = 0;
3814  int i;
3815 
3816  (void)builtin_pytype;
3817  (void)builtin_base_count;
3818  (void)builtin_basetype;
3819  (void)tuple;
3820  (void)static_getset;
3821  (void)self;
3822 
3823  /* Metaclass is used to implement static member variables */
3824  metatype = SwigPyObjectType();
3825  assert(metatype);
3826 #endif
3827 
3828  (void)globals;
3829 
3830  /* Create singletons now to avoid potential deadlocks with multi-threaded usage after module initialization */
3831  SWIG_This();
3834 #ifndef SWIGPYTHON_BUILTIN
3836 #endif
3837 
3838  /* Fix SwigMethods to carry the callback ptrs when needed */
3840 
3841 #if PY_VERSION_HEX >= 0x03000000
3842  m = PyModule_Create(&SWIG_module);
3843 #else
3844  m = Py_InitModule(SWIG_name, SwigMethods);
3845 #endif
3846 
3847  md = d = PyModule_GetDict(m);
3848  (void)md;
3849 
3851 
3852 #ifdef SWIGPYTHON_BUILTIN
3853  swigpyobject = SwigPyObject_TypeOnce();
3854 
3855  SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject");
3856  assert(SwigPyObject_stype);
3857  cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
3858  if (!cd) {
3859  SwigPyObject_stype->clientdata = &SwigPyObject_clientdata;
3860  SwigPyObject_clientdata.pytype = swigpyobject;
3861  } else if (swigpyobject->tp_basicsize != cd->pytype->tp_basicsize) {
3862  PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules.");
3863 # if PY_VERSION_HEX >= 0x03000000
3864  return NULL;
3865 # else
3866  return;
3867 # endif
3868  }
3869 
3870  /* All objects have a 'this' attribute */
3871  this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def);
3872  (void)this_descr;
3873 
3874  /* All objects have a 'thisown' attribute */
3875  thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def);
3876  (void)thisown_descr;
3877 
3878  public_interface = PyList_New(0);
3879  public_symbol = 0;
3880  (void)public_symbol;
3881 
3882  PyDict_SetItemString(md, "__all__", public_interface);
3883  Py_DECREF(public_interface);
3884  for (i = 0; SwigMethods[i].ml_name != NULL; ++i)
3885  SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name);
3886  for (i = 0; swig_const_table[i].name != 0; ++i)
3887  SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name);
3888 #endif
3889 
3891 
3892 #if PY_VERSION_HEX >= 0x03000000
3893  return m;
3894 #else
3895  return;
3896 #endif
3897 }
3898 
void *(* swig_converter_func)(void *, int *)
SWIGRUNTIME PyObject * SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op)
#define SWIG_ConvertPtr(obj, pptr, type, flags)
#define SWIG_SetModule(clientdata, pointer)
SWIGRUNTIME const char * SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name)
SWIGINTERN PyObject * _wrap_delete_RcpspParser(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_type_info * swig_type_initial[]
#define SWIG_POINTER_NEW
static swig_type_info _swigt__p_unsigned_short
static PyMethodDef SwigMethods[]
struct swig_cast_info * cast
SWIGRUNTIME PyObject * SwigPyObject_oct(SwigPyObject *v)
SWIGRUNTIME PyObject * SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty)
static PyObject * Swig_This_global
static swig_type_info _swigt__p_int
struct swig_cast_info * next
SWIGRUNTIME SwigPyClientData * SwigPyClientData_New(PyObject *obj)
#define SWIG_as_voidptr(a)
int64_t min
Definition: alldiff_cst.cc:139
#define SWIG_RUNTIME_VERSION
static swig_module_info swig_module
struct swig_type_info *(* swig_dycast_func)(void **)
SWIGRUNTIMEINLINE void * SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory)
#define SWIGPY_CAPSULE_NAME
static swig_cast_info _swigc__p_char[]
#define SWIGINTERN
static swig_cast_info _swigc__p_long[]
#define SWIG_POINTER_NOSHADOW
#define SWIG_InstallConstants(d, constants)
SWIGINTERN void SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg)
static swig_type_info _swigt__p_unsigned_char
SWIGRUNTIME char * SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz)
SWIGINTERN void SWIG_Python_FixMethods(PyMethodDef *methods, swig_const_info *const_table, swig_type_info **types, swig_type_info **types_initial)
static swig_cast_info _swigc__p_unsigned_short[]
SWIGINTERN PyObject * swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v))
#define SWIGEXPORT
SWIGRUNTIME char * SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz)
#define SWIG_CheckState(r)
#define SWIG_NEWOBJ
SWIGRUNTIME void SWIG_PropagateClientData(void)
SWIGINTERN void SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[])
const std::string name
PyObject * operator->() const
SWIGINTERN PyObject * SWIG_Python_InitShadowInstance(PyObject *args)
SwigPtr_PyObject & operator=(const SwigPtr_PyObject &item)
#define SWIG_OK
SWIGRUNTIME PyObject * SWIG_Python_TypeCache(void)
SWIGRUNTIME SwigPyObject * SWIG_Python_GetSwigThis(PyObject *pyobj)
SWIGINTERN PyObject * RcpspParser_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
SWIGRUNTIME swig_cast_info * SWIG_TypeCheck(const char *c, swig_type_info *ty)
SWIGRUNTIME PyTypeObject * SwigPyObject_type(void)
SWIGINTERN int swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p)
SWIGRUNTIME PyObject * SWIG_This(void)
SWIGINTERN PyObject * SWIG_Python_AppendOutput(PyObject *result, PyObject *obj)
SWIGINTERN PyObject * SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func)
SWIGRUNTIME void SWIG_Python_RaiseOrModifyTypeError(const char *message)
SWIGINTERN char * SWIG_Python_str_AsChar(PyObject *str)
SWIGRUNTIME PyObject * SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
SWIGRUNTIME PyTypeObject * SwigPyPacked_type(void)
SWIGRUNTIME PyObject * SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags)
SWIGRUNTIME void SWIG_Python_DestroyModule(PyObject *obj)
#define SWIG_PY_POINTER
struct swig_const_info swig_const_info
SWIGRUNTIMEINLINE PyObject * SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type)
#define SWIG_MemoryError
static swig_cast_info _swigc__p_signed_char[]
#define SWIG_PYTHON_THREAD_BEGIN_BLOCK
SWIGRUNTIME PyObject * SwigPyObject_New(void *ptr, swig_type_info *ty, int own)
struct swig_type_info swig_type_info
static swig_cast_info * swig_cast_initial[]
SWIGRUNTIMEINLINE PyObject * SWIG_Python_ExceptionType(swig_type_info *desc)
#define SWIG_NullReferenceError
int64_t tail
SWIGINTERN swig_type_info * SWIG_pchar_descriptor(void)
static swig_const_info swig_const_table[]
PyObject_HEAD void * pack
SWIGRUNTIME void SWIG_TypeClientData(swig_type_info *ti, void *clientdata)
SWIGRUNTIME PyObject * SwigPyObject_format(const char *fmt, SwigPyObject *v)
SWIGRUNTIME PyTypeObject * SwigPyObject_TypeOnce(void)
SWIGRUNTIME void * SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags)
PyObject *(* get_attr)(void)
#define SWIG_IndexError
PyObject_HEAD swig_globalvar * vars
SWIGRUNTIME swig_type_info * SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
struct swig_globalvar swig_globalvar
#define SWIG_ArgError(r)
SWIGRUNTIME int SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty)
SWIGRUNTIME char * SWIG_PackData(char *c, void *ptr, size_t sz)
SWIGRUNTIME PyObject * SwigPyObject_hex(SwigPyObject *v)
SWIGINTERN PyObject * SwigPyObject_acquire(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
SWIGRUNTIME PyObject * SwigPyObject_repr2(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
static swig_type_info _swigt__p_signed_char
SWIGRUNTIME PyObject * SwigPyObject_long(SwigPyObject *v)
SWIGINTERN void swig_varlink_dealloc(swig_varlinkobject *v)
#define SWIG_IsNewObj(r)
#define SWIG_GetModule(clientdata)
SWIGRUNTIMEINLINE int SwigPyPacked_Check(PyObject *op)
SWIGINTERN PyObject * _wrap_new_RcpspParser(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
static swig_cast_info _swigc__p_unsigned_long[]
static swig_cast_info _swigc__p_unsigned_int[]
static PyMethodDef swigobject_methods[]
#define SWIG_DivisionByZero
#define PyObject_DEL
static swig_type_info * swig_types[11]
struct swig_globalvar * next
int64_t max
Definition: alldiff_cst.cc:140
Block * next
#define SWIG_PY_BINARY
#define SWIG_Python_str_FromFormat
SWIGRUNTIME swig_module_info * SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata))
#define SWIG_Python_ConvertPtr(obj, pptr, type, flags)
struct swig_cast_info * prev
SWIGRUNTIMEINLINE const char * SwigPyObject_GetDesc(PyObject *self)
#define SWIG_TypeQuery(name)
SWIGINTERN Py_ssize_t SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
SWIGINTERN PyObject * RcpspParser_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_AddCast(r)
#define SWIG_ERROR
SWIGRUNTIME PyObject * SwigPyObject_append(PyObject *v, PyObject *next)
#define SWIG_TypeError
SWIGINTERN PyObject * _wrap_RcpspParser_ParseFile(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
#define SWIG_AttributeError
#define SWIG_NewPackedObj(ptr, sz, type)
static swig_cast_info _swigc__p_operations_research__data__rcpsp__RcpspParser[]
SWIGRUNTIME int SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own)
#define SWIG_RuntimeError
#define SWIG_BUFFER_SIZE
SWIGRUNTIME void SWIG_Python_SetModule(swig_module_info *swig_module)
SWIGINTERN int SWIG_AsCharPtrAndSize(PyObject *obj, char **cptr, size_t *psize, int *alloc)
#define SWIG_STATIC_POINTER(var)
static swig_cast_info _swigc__p_int[]
SWIGRUNTIME int SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty)
#define SWIGRUNTIMEINLINE
SWIGRUNTIME int SWIG_Python_TypeErrorOccurred(PyObject *obj)
SWIGRUNTIME PyObject * SWIG_Python_ErrorType(int code)
struct swig_module_info swig_module_info
static swig_type_info _swigt__p_unsigned_int
SWIGRUNTIME int SWIG_Python_AcquirePtr(PyObject *obj, int own)
SWIGRUNTIME swig_type_info * SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr)
SWIGRUNTIME void SwigPyClientData_Del(SwigPyClientData *data)
#define SWIG_POINTER_OWN
#define SWIG_SystemError
SWIGRUNTIME int SWIG_Python_ArgFail(int argnum)
SWIGRUNTIME int SWIG_TypeNameComp(const char *f1, const char *l1, const char *f2, const char *l2)
SWIGINTERN void SWIG_Python_addvarlink(PyObject *p, const char *name, PyObject *(*get_attr)(void), int(*set_attr)(PyObject *p))
SwigVar_PyObject(PyObject *obj=0)
SWIGRUNTIME swig_type_info * SWIG_TypeQueryModule(swig_module_info *start, swig_module_info *end, const char *name)
struct swig_module_info * next
#define SWIG_InternalNewPointerObj(ptr, type, flags)
SWIGRUNTIME const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz)
static PyMethodDef SwigMethods_proxydocs[]
std::string message
Definition: trace.cc:398
SWIGRUNTIME PyObject * SwigPyObject_next(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
SWIGRUNTIME PyObject * SwigPyPacked_str(SwigPyPacked *v)
#define SWIG_POINTER_NO_NULL
SWIGINTERN PyObject * SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func)
SWIGINTERN PyMethodDef * SWIG_PythonGetProxyDoc(const char *name)
SWIGRUNTIME void SWIG_InitializeModule(void *clientdata)
static swig_cast_info _swigc__p_short[]
static swig_type_info _swigt__p_long
SWIGINTERNINLINE PyObject * SWIG_From_bool(bool value)
SWIGINTERN PyObject * SwigPyObject_disown(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
#define SWIG_newvarlink()
SWIGINTERN PyObject * swig_varlink_getattr(swig_varlinkobject *v, char *n)
SwigVar_PyObject & operator=(PyObject *obj)
SWIGINTERN PyObject * SWIG_Python_newvarlink(void)
SWIGRUNTIME swig_type_info * SWIG_Python_TypeQuery(const char *type)
#define SWIG_ValueError
SWIGRUNTIME PyObject * SwigPyObject_repr(SwigPyObject *v)
SWIGRUNTIME int SWIG_TypeCmp(const char *nb, const char *tb)
SWIGINTERN PyObject * _wrap_RcpspParser_Problem(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
PyObject_HEAD void * ptr
struct swig_varlinkobject swig_varlinkobject
SWIGRUNTIMEINLINE int SwigPyObject_Check(PyObject *op)
#define SWIG_fail
SWIGRUNTIME void SwigPyPacked_dealloc(PyObject *v)
SWIGRUNTIME void SWIG_Python_AddErrorMsg(const char *mesg)
static swig_type_info _swigt__p_char
SWIGRUNTIME PyTypeObject * SwigPyPacked_TypeOnce(void)
SWIGRUNTIME swig_cast_info * SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty)
#define SWIG_SyntaxError
#define SWIG_PYTHON_THREAD_END_BLOCK
#define SWIG_OLDOBJ
void * malloc(YYSIZE_T)
SWIGRUNTIME void SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata)
#define Py_TYPE(op)
#define SWIGRUNTIME
#define SWIG_init
#define SWIG_BUILTIN_TP_INIT
SWIGRUNTIME void SwigPyObject_dealloc(PyObject *v)
#define SWIG_MangledTypeQuery(name)
#define SWIG_name
SWIGINTERN int SWIG_AsPtr_std_string(PyObject *obj, std::string **val)
SWIGRUNTIMEINLINE const char * SWIG_TypeName(const swig_type_info *ty)
#define SWIGUNUSEDPARM(p)
SWIGINTERN PyObject * swig_varlink_str(swig_varlinkobject *v)
#define SWIG_exception_fail(code, msg)
SWIGINTERN void SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj)
static swig_type_info _swigt__p_unsigned_long
#define SWIG_NewClientData(obj)
SwigPtr_PyObject(PyObject *obj, bool initial_ref=true)
SWIGRUNTIME PyObject * SwigPyPacked_repr(SwigPyPacked *v)
SWIGINTERN PyTypeObject * swig_varlink_type(void)
#define SWIG_IsOK(r)
SWIGRUNTIMEINLINE int SWIG_Python_CheckImplicit(swig_type_info *ty)
#define SWIG_OverflowError
SWIGINTERN PyObject * SWIG_Python_str_FromChar(const char *c)
IntVar * var
Definition: expr_array.cc:1874
SWIGRUNTIME const char * SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name)
SWIGRUNTIME int SWIG_TypeEquiv(const char *nb, const char *tb)
void free(void *)
#define SWIG_TYPE_TABLE_NAME
swig_converter_func converter
#define SWIGINTERNINLINE
SWIGRUNTIME const char * SWIG_TypePrettyName(const swig_type_info *type)
SWIGRUNTIMEINLINE PyObject * SWIG_Py_Void(void)
#define SWIGTYPE_p_operations_research__data__rcpsp__RcpspParser
SWIGINTERN PyObject * SWIG_globals(void)
static swig_type_info _swigt__p_short
SWIGRUNTIME int SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w)
static swig_type_info _swigt__p_operations_research__data__rcpsp__RcpspParser
#define SWIG_POINTER_DISOWN
#define SWIG_CAST_NEW_MEMORY
SWIGRUNTIME void SWIG_Python_TypeError(const char *type, PyObject *obj)
#define SWIG_AddNewMask(r)
struct swig_cast_info swig_cast_info
if(!yyg->yy_init)
Definition: parser.yy.cc:965
int64_t value
#define SWIG_POINTER_IMPLICIT_CONV
#define SWIG_IOError
SWIGRUNTIME int SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w)
#define SWIG_Python_str_DelForPy3(x)
#define SWIG_NewPointerObj(ptr, type, flags)
SWIGRUNTIME swig_type_info * SWIG_MangledTypeQueryModule(swig_module_info *start, swig_module_info *end, const char *name)
SWIGRUNTIME void SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this)
SWIGINTERN PyObject * SwigPyObject_own(PyObject *v, PyObject *args)
#define SWIG_Python_CallFunctor(functor, obj)
SWIGINTERN void SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj)
static swig_cast_info _swigc__p_unsigned_char[]
SWIGRUNTIME int SWIG_Python_AddErrMesg(const char *mesg, int infront)
SwigPtr_PyObject(const SwigPtr_PyObject &item)