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