1 /* ----------------------------------------------------------------------------
2  * This file was automatically generated by SWIG (http://www.swig.org).
3  * Version 3.0.2
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 #define SWIGPYTHON
12 #define SWIG_PYTHON_DIRECTOR_NO_VTABLE
13 
14 
15 #ifdef __cplusplus
16 /* SwigValueWrapper is described in swig.swg */
17 template<typename T> class SwigValueWrapper {
18   struct SwigMovePointer {
19     T *ptr;
SwigMovePointerSwigValueWrapper::SwigMovePointer20     SwigMovePointer(T *p) : ptr(p) { }
~SwigMovePointerSwigValueWrapper::SwigMovePointer21     ~SwigMovePointer() { delete ptr; }
operator =SwigValueWrapper::SwigMovePointer22     SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
23   } pointer;
24   SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
25   SwigValueWrapper(const SwigValueWrapper<T>& rhs);
26 public:
SwigValueWrapper()27   SwigValueWrapper() : pointer(0) { }
operator =(const T & t)28   SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
operator T&() const29   operator T&() const { return *pointer.ptr; }
operator &()30   T *operator&() { return pointer.ptr; }
31 };
32 
SwigValueInit()33 template <typename T> T SwigValueInit() {
34   return T();
35 }
36 #endif
37 
38 /* -----------------------------------------------------------------------------
39  *  This section contains generic SWIG labels for method/variable
40  *  declarations/attributes, and other compiler dependent labels.
41  * ----------------------------------------------------------------------------- */
42 
43 /* template workaround for compilers that cannot correctly implement the C++ standard */
44 #ifndef SWIGTEMPLATEDISAMBIGUATOR
45 # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
46 #  define SWIGTEMPLATEDISAMBIGUATOR template
47 # elif defined(__HP_aCC)
48 /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
49 /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
50 #  define SWIGTEMPLATEDISAMBIGUATOR template
51 # else
52 #  define SWIGTEMPLATEDISAMBIGUATOR
53 # endif
54 #endif
55 
56 /* inline attribute */
57 #ifndef SWIGINLINE
58 # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
59 #   define SWIGINLINE inline
60 # else
61 #   define SWIGINLINE
62 # endif
63 #endif
64 
65 /* attribute recognised by some compilers to avoid 'unused' warnings */
66 #ifndef SWIGUNUSED
67 # if defined(__GNUC__)
68 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
69 #     define SWIGUNUSED __attribute__ ((__unused__))
70 #   else
71 #     define SWIGUNUSED
72 #   endif
73 # elif defined(__ICC)
74 #   define SWIGUNUSED __attribute__ ((__unused__))
75 # else
76 #   define SWIGUNUSED
77 # endif
78 #endif
79 
80 #ifndef SWIG_MSC_UNSUPPRESS_4505
81 # if defined(_MSC_VER)
82 #   pragma warning(disable : 4505) /* unreferenced local function has been removed */
83 # endif
84 #endif
85 
86 #ifndef SWIGUNUSEDPARM
87 # ifdef __cplusplus
88 #   define SWIGUNUSEDPARM(p)
89 # else
90 #   define SWIGUNUSEDPARM(p) p SWIGUNUSED
91 # endif
92 #endif
93 
94 /* internal SWIG method */
95 #ifndef SWIGINTERN
96 # define SWIGINTERN static SWIGUNUSED
97 #endif
98 
99 /* internal inline SWIG method */
100 #ifndef SWIGINTERNINLINE
101 # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
102 #endif
103 
104 /* exporting methods */
105 #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
106 #  ifndef GCC_HASCLASSVISIBILITY
107 #    define GCC_HASCLASSVISIBILITY
108 #  endif
109 #endif
110 
111 #ifndef SWIGEXPORT
112 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
113 #   if defined(STATIC_LINKED)
114 #     define SWIGEXPORT
115 #   else
116 #     define SWIGEXPORT __declspec(dllexport)
117 #   endif
118 # else
119 #   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
120 #     define SWIGEXPORT __attribute__ ((visibility("default")))
121 #   else
122 #     define SWIGEXPORT
123 #   endif
124 # endif
125 #endif
126 
127 /* calling conventions for Windows */
128 #ifndef SWIGSTDCALL
129 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
130 #   define SWIGSTDCALL __stdcall
131 # else
132 #   define SWIGSTDCALL
133 # endif
134 #endif
135 
136 /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
137 #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
138 # define _CRT_SECURE_NO_DEPRECATE
139 #endif
140 
141 /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
142 #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
143 # define _SCL_SECURE_NO_DEPRECATE
144 #endif
145 
146 
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
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 
203 /* Flags for new pointer objects */
204 #define SWIG_POINTER_OWN           0x1
205 
206 
207 /*
208    Flags/methods for returning states.
209 
210    The SWIG conversion methods, as ConvertPtr, return an integer
211    that tells if the conversion was successful or not. And if not,
212    an error code can be returned (see swigerrors.swg for the codes).
213 
214    Use the following macros/flags to set or process the returning
215    states.
216 
217    In old versions of SWIG, code such as the following was usually written:
218 
219      if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
220        // success code
221      } else {
222        //fail code
223      }
224 
225    Now you can be more explicit:
226 
227     int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
228     if (SWIG_IsOK(res)) {
229       // success code
230     } else {
231       // fail code
232     }
233 
234    which is the same really, but now you can also do
235 
236     Type *ptr;
237     int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
238     if (SWIG_IsOK(res)) {
239       // success code
240       if (SWIG_IsNewObj(res) {
241         ...
242 	delete *ptr;
243       } else {
244         ...
245       }
246     } else {
247       // fail code
248     }
249 
250    I.e., now SWIG_ConvertPtr can return new objects and you can
251    identify the case and take care of the deallocation. Of course that
252    also requires SWIG_ConvertPtr to return new result values, such as
253 
254       int SWIG_ConvertPtr(obj, ptr,...) {
255         if (<obj is ok>) {
256           if (<need new object>) {
257             *ptr = <ptr to new allocated object>;
258             return SWIG_NEWOBJ;
259           } else {
260             *ptr = <ptr to old object>;
261             return SWIG_OLDOBJ;
262           }
263         } else {
264           return SWIG_BADOBJ;
265         }
266       }
267 
268    Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
269    more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
270    SWIG errors code.
271 
272    Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
273    allows to return the 'cast rank', for example, if you have this
274 
275        int food(double)
276        int fooi(int);
277 
278    and you call
279 
280       food(1)   // cast rank '1'  (1 -> 1.0)
281       fooi(1)   // cast rank '0'
282 
283    just use the SWIG_AddCast()/SWIG_CheckState()
284 */
285 
286 #define SWIG_OK                    (0)
287 #define SWIG_ERROR                 (-1)
288 #define SWIG_IsOK(r)               (r >= 0)
289 #define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)
290 
291 /* The CastRankLimit says how many bits are used for the cast rank */
292 #define SWIG_CASTRANKLIMIT         (1 << 8)
293 /* The NewMask denotes the object was created (using new/malloc) */
294 #define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
295 /* The TmpMask is for in/out typemaps that use temporal objects */
296 #define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
297 /* Simple returning values */
298 #define SWIG_BADOBJ                (SWIG_ERROR)
299 #define SWIG_OLDOBJ                (SWIG_OK)
300 #define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
301 #define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
302 /* Check, add and del mask methods */
303 #define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
304 #define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
305 #define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
306 #define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
307 #define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
308 #define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
309 
310 /* Cast-Rank Mode */
311 #if defined(SWIG_CASTRANK_MODE)
312 #  ifndef SWIG_TypeRank
313 #    define SWIG_TypeRank             unsigned long
314 #  endif
315 #  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
316 #    define SWIG_MAXCASTRANK          (2)
317 #  endif
318 #  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
319 #  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
SWIG_AddCast(int r)320 SWIGINTERNINLINE int SWIG_AddCast(int r) {
321   return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
322 }
SWIG_CheckState(int r)323 SWIGINTERNINLINE int SWIG_CheckState(int r) {
324   return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
325 }
326 #else /* no cast-rank mode */
327 #  define SWIG_AddCast(r) (r)
328 #  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
329 #endif
330 
331 
332 #include <string.h>
333 
334 #ifdef __cplusplus
335 extern "C" {
336 #endif
337 
338 typedef void *(*swig_converter_func)(void *, int *);
339 typedef struct swig_type_info *(*swig_dycast_func)(void **);
340 
341 /* Structure to store information on one type */
342 typedef struct swig_type_info {
343   const char             *name;			/* mangled name of this type */
344   const char             *str;			/* human readable name of this type */
345   swig_dycast_func        dcast;		/* dynamic cast function down a hierarchy */
346   struct swig_cast_info  *cast;			/* linked list of types that can cast into this type */
347   void                   *clientdata;		/* language specific type data */
348   int                    owndata;		/* flag if the structure owns the clientdata */
349 } swig_type_info;
350 
351 /* Structure to store a type and conversion function used for casting */
352 typedef struct swig_cast_info {
353   swig_type_info         *type;			/* pointer to type that is equivalent to this type */
354   swig_converter_func     converter;		/* function to cast the void pointers */
355   struct swig_cast_info  *next;			/* pointer to next cast in linked list */
356   struct swig_cast_info  *prev;			/* pointer to the previous cast */
357 } swig_cast_info;
358 
359 /* Structure used to store module information
360  * Each module generates one structure like this, and the runtime collects
361  * all of these structures and stores them in a circularly linked list.*/
362 typedef struct swig_module_info {
363   swig_type_info         **types;		/* Array of pointers to swig_type_info structures that are in this module */
364   size_t                 size;		        /* Number of types in this module */
365   struct swig_module_info *next;		/* Pointer to next element in circularly linked list */
366   swig_type_info         **type_initial;	/* Array of initially generated type structures */
367   swig_cast_info         **cast_initial;	/* Array of initially generated casting structures */
368   void                    *clientdata;		/* Language specific module data */
369 } swig_module_info;
370 
371 /*
372   Compare two type names skipping the space characters, therefore
373   "char*" == "char *" and "Class<int>" == "Class<int >", etc.
374 
375   Return 0 when the two name types are equivalent, as in
376   strncmp, but skipping ' '.
377 */
378 SWIGRUNTIME int
SWIG_TypeNameComp(const char * f1,const char * l1,const char * f2,const char * l2)379 SWIG_TypeNameComp(const char *f1, const char *l1,
380 		  const char *f2, const char *l2) {
381   for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
382     while ((*f1 == ' ') && (f1 != l1)) ++f1;
383     while ((*f2 == ' ') && (f2 != l2)) ++f2;
384     if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
385   }
386   return (int)((l1 - f1) - (l2 - f2));
387 }
388 
389 /*
390   Check type equivalence in a name list like <name1>|<name2>|...
391   Return 0 if equal, -1 if nb < tb, 1 if nb > tb
392 */
393 SWIGRUNTIME int
SWIG_TypeCmp(const char * nb,const char * tb)394 SWIG_TypeCmp(const char *nb, const char *tb) {
395   int equiv = 1;
396   const char* te = tb + strlen(tb);
397   const char* ne = nb;
398   while (equiv != 0 && *ne) {
399     for (nb = ne; *ne; ++ne) {
400       if (*ne == '|') break;
401     }
402     equiv = SWIG_TypeNameComp(nb, ne, tb, te);
403     if (*ne) ++ne;
404   }
405   return equiv;
406 }
407 
408 /*
409   Check type equivalence in a name list like <name1>|<name2>|...
410   Return 0 if not equal, 1 if equal
411 */
412 SWIGRUNTIME int
SWIG_TypeEquiv(const char * nb,const char * tb)413 SWIG_TypeEquiv(const char *nb, const char *tb) {
414   return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
415 }
416 
417 /*
418   Check the typename
419 */
420 SWIGRUNTIME swig_cast_info *
SWIG_TypeCheck(const char * c,swig_type_info * ty)421 SWIG_TypeCheck(const char *c, swig_type_info *ty) {
422   if (ty) {
423     swig_cast_info *iter = ty->cast;
424     while (iter) {
425       if (strcmp(iter->type->name, c) == 0) {
426         if (iter == ty->cast)
427           return iter;
428         /* Move iter to the top of the linked list */
429         iter->prev->next = iter->next;
430         if (iter->next)
431           iter->next->prev = iter->prev;
432         iter->next = ty->cast;
433         iter->prev = 0;
434         if (ty->cast) ty->cast->prev = iter;
435         ty->cast = iter;
436         return iter;
437       }
438       iter = iter->next;
439     }
440   }
441   return 0;
442 }
443 
444 /*
445   Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
446 */
447 SWIGRUNTIME swig_cast_info *
SWIG_TypeCheckStruct(swig_type_info * from,swig_type_info * ty)448 SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
449   if (ty) {
450     swig_cast_info *iter = ty->cast;
451     while (iter) {
452       if (iter->type == from) {
453         if (iter == ty->cast)
454           return iter;
455         /* Move iter to the top of the linked list */
456         iter->prev->next = iter->next;
457         if (iter->next)
458           iter->next->prev = iter->prev;
459         iter->next = ty->cast;
460         iter->prev = 0;
461         if (ty->cast) ty->cast->prev = iter;
462         ty->cast = iter;
463         return iter;
464       }
465       iter = iter->next;
466     }
467   }
468   return 0;
469 }
470 
471 /*
472   Cast a pointer up an inheritance hierarchy
473 */
474 SWIGRUNTIMEINLINE void *
SWIG_TypeCast(swig_cast_info * ty,void * ptr,int * newmemory)475 SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
476   return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
477 }
478 
479 /*
480    Dynamic pointer casting. Down an inheritance hierarchy
481 */
482 SWIGRUNTIME swig_type_info *
SWIG_TypeDynamicCast(swig_type_info * ty,void ** ptr)483 SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
484   swig_type_info *lastty = ty;
485   if (!ty || !ty->dcast) return ty;
486   while (ty && (ty->dcast)) {
487     ty = (*ty->dcast)(ptr);
488     if (ty) lastty = ty;
489   }
490   return lastty;
491 }
492 
493 /*
494   Return the name associated with this type
495 */
496 SWIGRUNTIMEINLINE const char *
SWIG_TypeName(const swig_type_info * ty)497 SWIG_TypeName(const swig_type_info *ty) {
498   return ty->name;
499 }
500 
501 /*
502   Return the pretty name associated with this type,
503   that is an unmangled type name in a form presentable to the user.
504 */
505 SWIGRUNTIME const char *
SWIG_TypePrettyName(const swig_type_info * type)506 SWIG_TypePrettyName(const swig_type_info *type) {
507   /* The "str" field contains the equivalent pretty names of the
508      type, separated by vertical-bar characters.  We choose
509      to print the last name, as it is often (?) the most
510      specific. */
511   if (!type) return NULL;
512   if (type->str != NULL) {
513     const char *last_name = type->str;
514     const char *s;
515     for (s = type->str; *s; s++)
516       if (*s == '|') last_name = s+1;
517     return last_name;
518   }
519   else
520     return type->name;
521 }
522 
523 /*
524    Set the clientdata field for a type
525 */
526 SWIGRUNTIME void
SWIG_TypeClientData(swig_type_info * ti,void * clientdata)527 SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
528   swig_cast_info *cast = ti->cast;
529   /* if (ti->clientdata == clientdata) return; */
530   ti->clientdata = clientdata;
531 
532   while (cast) {
533     if (!cast->converter) {
534       swig_type_info *tc = cast->type;
535       if (!tc->clientdata) {
536 	SWIG_TypeClientData(tc, clientdata);
537       }
538     }
539     cast = cast->next;
540   }
541 }
542 SWIGRUNTIME void
SWIG_TypeNewClientData(swig_type_info * ti,void * clientdata)543 SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
544   SWIG_TypeClientData(ti, clientdata);
545   ti->owndata = 1;
546 }
547 
548 /*
549   Search for a swig_type_info structure only by mangled name
550   Search is a O(log #types)
551 
552   We start searching at module start, and finish searching when start == end.
553   Note: if start == end at the beginning of the function, we go all the way around
554   the circular list.
555 */
556 SWIGRUNTIME swig_type_info *
SWIG_MangledTypeQueryModule(swig_module_info * start,swig_module_info * end,const char * name)557 SWIG_MangledTypeQueryModule(swig_module_info *start,
558                             swig_module_info *end,
559 		            const char *name) {
560   swig_module_info *iter = start;
561   do {
562     if (iter->size) {
563       size_t l = 0;
564       size_t r = iter->size - 1;
565       do {
566 	/* since l+r >= 0, we can (>> 1) instead (/ 2) */
567 	size_t i = (l + r) >> 1;
568 	const char *iname = iter->types[i]->name;
569 	if (iname) {
570 	  int compare = strcmp(name, iname);
571 	  if (compare == 0) {
572 	    return iter->types[i];
573 	  } else if (compare < 0) {
574 	    if (i) {
575 	      r = i - 1;
576 	    } else {
577 	      break;
578 	    }
579 	  } else if (compare > 0) {
580 	    l = i + 1;
581 	  }
582 	} else {
583 	  break; /* should never happen */
584 	}
585       } while (l <= r);
586     }
587     iter = iter->next;
588   } while (iter != end);
589   return 0;
590 }
591 
592 /*
593   Search for a swig_type_info structure for either a mangled name or a human readable name.
594   It first searches the mangled names of the types, which is a O(log #types)
595   If a type is not found it then searches the human readable names, which is O(#types).
596 
597   We start searching at module start, and finish searching when start == end.
598   Note: if start == end at the beginning of the function, we go all the way around
599   the circular list.
600 */
601 SWIGRUNTIME swig_type_info *
SWIG_TypeQueryModule(swig_module_info * start,swig_module_info * end,const char * name)602 SWIG_TypeQueryModule(swig_module_info *start,
603                      swig_module_info *end,
604 		     const char *name) {
605   /* STEP 1: Search the name field using binary search */
606   swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
607   if (ret) {
608     return ret;
609   } else {
610     /* STEP 2: If the type hasn't been found, do a complete search
611        of the str field (the human readable name) */
612     swig_module_info *iter = start;
613     do {
614       size_t i = 0;
615       for (; i < iter->size; ++i) {
616 	if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
617 	  return iter->types[i];
618       }
619       iter = iter->next;
620     } while (iter != end);
621   }
622 
623   /* neither found a match */
624   return 0;
625 }
626 
627 /*
628    Pack binary data into a string
629 */
630 SWIGRUNTIME char *
SWIG_PackData(char * c,void * ptr,size_t sz)631 SWIG_PackData(char *c, void *ptr, size_t sz) {
632   static const char hex[17] = "0123456789abcdef";
633   const unsigned char *u = (unsigned char *) ptr;
634   const unsigned char *eu =  u + sz;
635   for (; u != eu; ++u) {
636     unsigned char uu = *u;
637     *(c++) = hex[(uu & 0xf0) >> 4];
638     *(c++) = hex[uu & 0xf];
639   }
640   return c;
641 }
642 
643 /*
644    Unpack binary data from a string
645 */
646 SWIGRUNTIME const char *
SWIG_UnpackData(const char * c,void * ptr,size_t sz)647 SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
648   unsigned char *u = (unsigned char *) ptr;
649   const unsigned char *eu = u + sz;
650   for (; u != eu; ++u) {
651     char d = *(c++);
652     unsigned char uu;
653     if ((d >= '0') && (d <= '9'))
654       uu = ((d - '0') << 4);
655     else if ((d >= 'a') && (d <= 'f'))
656       uu = ((d - ('a'-10)) << 4);
657     else
658       return (char *) 0;
659     d = *(c++);
660     if ((d >= '0') && (d <= '9'))
661       uu |= (d - '0');
662     else if ((d >= 'a') && (d <= 'f'))
663       uu |= (d - ('a'-10));
664     else
665       return (char *) 0;
666     *u = uu;
667   }
668   return c;
669 }
670 
671 /*
672    Pack 'void *' into a string buffer.
673 */
674 SWIGRUNTIME char *
SWIG_PackVoidPtr(char * buff,void * ptr,const char * name,size_t bsz)675 SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
676   char *r = buff;
677   if ((2*sizeof(void *) + 2) > bsz) return 0;
678   *(r++) = '_';
679   r = SWIG_PackData(r,&ptr,sizeof(void *));
680   if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
681   strcpy(r,name);
682   return buff;
683 }
684 
685 SWIGRUNTIME const char *
SWIG_UnpackVoidPtr(const char * c,void ** ptr,const char * name)686 SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
687   if (*c != '_') {
688     if (strcmp(c,"NULL") == 0) {
689       *ptr = (void *) 0;
690       return name;
691     } else {
692       return 0;
693     }
694   }
695   return SWIG_UnpackData(++c,ptr,sizeof(void *));
696 }
697 
698 SWIGRUNTIME char *
SWIG_PackDataName(char * buff,void * ptr,size_t sz,const char * name,size_t bsz)699 SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
700   char *r = buff;
701   size_t lname = (name ? strlen(name) : 0);
702   if ((2*sz + 2 + lname) > bsz) return 0;
703   *(r++) = '_';
704   r = SWIG_PackData(r,ptr,sz);
705   if (lname) {
706     strncpy(r,name,lname+1);
707   } else {
708     *r = 0;
709   }
710   return buff;
711 }
712 
713 SWIGRUNTIME const char *
SWIG_UnpackDataName(const char * c,void * ptr,size_t sz,const char * name)714 SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
715   if (*c != '_') {
716     if (strcmp(c,"NULL") == 0) {
717       memset(ptr,0,sz);
718       return name;
719     } else {
720       return 0;
721     }
722   }
723   return SWIG_UnpackData(++c,ptr,sz);
724 }
725 
726 #ifdef __cplusplus
727 }
728 #endif
729 
730 /*  Errors in SWIG */
731 #define  SWIG_UnknownError    	   -1
732 #define  SWIG_IOError        	   -2
733 #define  SWIG_RuntimeError   	   -3
734 #define  SWIG_IndexError     	   -4
735 #define  SWIG_TypeError      	   -5
736 #define  SWIG_DivisionByZero 	   -6
737 #define  SWIG_OverflowError  	   -7
738 #define  SWIG_SyntaxError    	   -8
739 #define  SWIG_ValueError     	   -9
740 #define  SWIG_SystemError    	   -10
741 #define  SWIG_AttributeError 	   -11
742 #define  SWIG_MemoryError    	   -12
743 #define  SWIG_NullReferenceError   -13
744 
745 
746 
747 /* Compatibility macros for Python 3 */
748 #if PY_VERSION_HEX >= 0x03000000
749 
750 #define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type)
751 #define PyInt_Check(x) PyLong_Check(x)
752 #define PyInt_AsLong(x) PyLong_AsLong(x)
753 #define PyInt_FromLong(x) PyLong_FromLong(x)
754 #define PyInt_FromSize_t(x) PyLong_FromSize_t(x)
755 #define PyString_Check(name) PyBytes_Check(name)
756 #define PyString_FromString(x) PyUnicode_FromString(x)
757 #define PyString_Format(fmt, args)  PyUnicode_Format(fmt, args)
758 #define PyString_AsString(str) PyBytes_AsString(str)
759 #define PyString_Size(str) PyBytes_Size(str)
760 #define PyString_InternFromString(key) PyUnicode_InternFromString(key)
761 #define Py_TPFLAGS_HAVE_CLASS Py_TPFLAGS_BASETYPE
762 #define PyString_AS_STRING(x) PyUnicode_AS_STRING(x)
763 #define _PyLong_FromSsize_t(x) PyLong_FromSsize_t(x)
764 
765 #endif
766 
767 #ifndef Py_TYPE
768 #  define Py_TYPE(op) ((op)->ob_type)
769 #endif
770 
771 /* SWIG APIs for compatibility of both Python 2 & 3 */
772 
773 #if PY_VERSION_HEX >= 0x03000000
774 #  define SWIG_Python_str_FromFormat PyUnicode_FromFormat
775 #else
776 #  define SWIG_Python_str_FromFormat PyString_FromFormat
777 #endif
778 
779 
780 /* Warning: This function will allocate a new string in Python 3,
781  * so please call SWIG_Python_str_DelForPy3(x) to free the space.
782  */
783 SWIGINTERN char*
SWIG_Python_str_AsChar(PyObject * str)784 SWIG_Python_str_AsChar(PyObject *str)
785 {
786 #if PY_VERSION_HEX >= 0x03000000
787   char *cstr;
788   char *newstr;
789   Py_ssize_t len;
790   str = PyUnicode_AsUTF8String(str);
791   PyBytes_AsStringAndSize(str, &cstr, &len);
792   newstr = (char *) malloc(len+1);
793   memcpy(newstr, cstr, len+1);
794   Py_XDECREF(str);
795   return newstr;
796 #else
797   return PyString_AsString(str);
798 #endif
799 }
800 
801 #if PY_VERSION_HEX >= 0x03000000
802 #  define SWIG_Python_str_DelForPy3(x) free( (void*) (x) )
803 #else
804 #  define SWIG_Python_str_DelForPy3(x)
805 #endif
806 
807 
808 SWIGINTERN PyObject*
SWIG_Python_str_FromChar(const char * c)809 SWIG_Python_str_FromChar(const char *c)
810 {
811 #if PY_VERSION_HEX >= 0x03000000
812   return PyUnicode_FromString(c);
813 #else
814   return PyString_FromString(c);
815 #endif
816 }
817 
818 /* Add PyOS_snprintf for old Pythons */
819 #if PY_VERSION_HEX < 0x02020000
820 # if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM)
821 #  define PyOS_snprintf _snprintf
822 # else
823 #  define PyOS_snprintf snprintf
824 # endif
825 #endif
826 
827 /* A crude PyString_FromFormat implementation for old Pythons */
828 #if PY_VERSION_HEX < 0x02020000
829 
830 #ifndef SWIG_PYBUFFER_SIZE
831 # define SWIG_PYBUFFER_SIZE 1024
832 #endif
833 
834 static PyObject *
PyString_FromFormat(const char * fmt,...)835 PyString_FromFormat(const char *fmt, ...) {
836   va_list ap;
837   char buf[SWIG_PYBUFFER_SIZE * 2];
838   int res;
839   va_start(ap, fmt);
840   res = vsnprintf(buf, sizeof(buf), fmt, ap);
841   va_end(ap);
842   return (res < 0 || res >= (int)sizeof(buf)) ? 0 : PyString_FromString(buf);
843 }
844 #endif
845 
846 /* Add PyObject_Del for old Pythons */
847 #if PY_VERSION_HEX < 0x01060000
848 # define PyObject_Del(op) PyMem_DEL((op))
849 #endif
850 #ifndef PyObject_DEL
851 # define PyObject_DEL PyObject_Del
852 #endif
853 
854 /* A crude PyExc_StopIteration exception for old Pythons */
855 #if PY_VERSION_HEX < 0x02020000
856 # ifndef PyExc_StopIteration
857 #  define PyExc_StopIteration PyExc_RuntimeError
858 # endif
859 # ifndef PyObject_GenericGetAttr
860 #  define PyObject_GenericGetAttr 0
861 # endif
862 #endif
863 
864 /* Py_NotImplemented is defined in 2.1 and up. */
865 #if PY_VERSION_HEX < 0x02010000
866 # ifndef Py_NotImplemented
867 #  define Py_NotImplemented PyExc_RuntimeError
868 # endif
869 #endif
870 
871 /* A crude PyString_AsStringAndSize implementation for old Pythons */
872 #if PY_VERSION_HEX < 0x02010000
873 # ifndef PyString_AsStringAndSize
874 #  define PyString_AsStringAndSize(obj, s, len) {*s = PyString_AsString(obj); *len = *s ? strlen(*s) : 0;}
875 # endif
876 #endif
877 
878 /* PySequence_Size for old Pythons */
879 #if PY_VERSION_HEX < 0x02000000
880 # ifndef PySequence_Size
881 #  define PySequence_Size PySequence_Length
882 # endif
883 #endif
884 
885 /* PyBool_FromLong for old Pythons */
886 #if PY_VERSION_HEX < 0x02030000
887 static
PyBool_FromLong(long ok)888 PyObject *PyBool_FromLong(long ok)
889 {
890   PyObject *result = ok ? Py_True : Py_False;
891   Py_INCREF(result);
892   return result;
893 }
894 #endif
895 
896 /* Py_ssize_t for old Pythons */
897 /* This code is as recommended by: */
898 /* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */
899 #if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
900 typedef int Py_ssize_t;
901 # define PY_SSIZE_T_MAX INT_MAX
902 # define PY_SSIZE_T_MIN INT_MIN
903 typedef inquiry lenfunc;
904 typedef intargfunc ssizeargfunc;
905 typedef intintargfunc ssizessizeargfunc;
906 typedef intobjargproc ssizeobjargproc;
907 typedef intintobjargproc ssizessizeobjargproc;
908 typedef getreadbufferproc readbufferproc;
909 typedef getwritebufferproc writebufferproc;
910 typedef getsegcountproc segcountproc;
911 typedef getcharbufferproc charbufferproc;
PyNumber_AsSsize_t(PyObject * x,void * SWIGUNUSEDPARM (exc))912 static long PyNumber_AsSsize_t (PyObject *x, void *SWIGUNUSEDPARM(exc))
913 {
914   long result = 0;
915   PyObject *i = PyNumber_Int(x);
916   if (i) {
917     result = PyInt_AsLong(i);
918     Py_DECREF(i);
919   }
920   return result;
921 }
922 #endif
923 
924 #if PY_VERSION_HEX < 0x02050000
925 #define PyInt_FromSize_t(x) PyInt_FromLong((long)x)
926 #endif
927 
928 #if PY_VERSION_HEX < 0x02040000
929 #define Py_VISIT(op)				\
930   do { 						\
931     if (op) {					\
932       int vret = visit((op), arg);		\
933       if (vret)					\
934         return vret;				\
935     }						\
936   } while (0)
937 #endif
938 
939 #if PY_VERSION_HEX < 0x02030000
940 typedef struct {
941   PyTypeObject type;
942   PyNumberMethods as_number;
943   PyMappingMethods as_mapping;
944   PySequenceMethods as_sequence;
945   PyBufferProcs as_buffer;
946   PyObject *name, *slots;
947 } PyHeapTypeObject;
948 #endif
949 
950 #if PY_VERSION_HEX < 0x02030000
951 typedef destructor freefunc;
952 #endif
953 
954 #if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION > 6) || \
955      (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION > 0) || \
956      (PY_MAJOR_VERSION > 3))
957 # define SWIGPY_USE_CAPSULE
958 # define SWIGPY_CAPSULE_NAME ((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME)
959 #endif
960 
961 #if PY_VERSION_HEX < 0x03020000
962 #define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type)
963 #define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name)
964 #endif
965 
966 /* -----------------------------------------------------------------------------
967  * error manipulation
968  * ----------------------------------------------------------------------------- */
969 
970 SWIGRUNTIME PyObject*
SWIG_Python_ErrorType(int code)971 SWIG_Python_ErrorType(int code) {
972   PyObject* type = 0;
973   switch(code) {
974   case SWIG_MemoryError:
975     type = PyExc_MemoryError;
976     break;
977   case SWIG_IOError:
978     type = PyExc_IOError;
979     break;
980   case SWIG_RuntimeError:
981     type = PyExc_RuntimeError;
982     break;
983   case SWIG_IndexError:
984     type = PyExc_IndexError;
985     break;
986   case SWIG_TypeError:
987     type = PyExc_TypeError;
988     break;
989   case SWIG_DivisionByZero:
990     type = PyExc_ZeroDivisionError;
991     break;
992   case SWIG_OverflowError:
993     type = PyExc_OverflowError;
994     break;
995   case SWIG_SyntaxError:
996     type = PyExc_SyntaxError;
997     break;
998   case SWIG_ValueError:
999     type = PyExc_ValueError;
1000     break;
1001   case SWIG_SystemError:
1002     type = PyExc_SystemError;
1003     break;
1004   case SWIG_AttributeError:
1005     type = PyExc_AttributeError;
1006     break;
1007   default:
1008     type = PyExc_RuntimeError;
1009   }
1010   return type;
1011 }
1012 
1013 
1014 SWIGRUNTIME void
SWIG_Python_AddErrorMsg(const char * mesg)1015 SWIG_Python_AddErrorMsg(const char* mesg)
1016 {
1017   PyObject *type = 0;
1018   PyObject *value = 0;
1019   PyObject *traceback = 0;
1020 
1021   if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback);
1022   if (value) {
1023     char *tmp;
1024     PyObject *old_str = PyObject_Str(value);
1025     PyErr_Clear();
1026     Py_XINCREF(type);
1027 
1028     PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
1029     SWIG_Python_str_DelForPy3(tmp);
1030     Py_DECREF(old_str);
1031     Py_DECREF(value);
1032   } else {
1033     PyErr_SetString(PyExc_RuntimeError, mesg);
1034   }
1035 }
1036 
1037 #if defined(SWIG_PYTHON_NO_THREADS)
1038 #  if defined(SWIG_PYTHON_THREADS)
1039 #    undef SWIG_PYTHON_THREADS
1040 #  endif
1041 #endif
1042 #if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */
1043 #  if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL)
1044 #    if (PY_VERSION_HEX >= 0x02030000) /* For 2.3 or later, use the PyGILState calls */
1045 #      define SWIG_PYTHON_USE_GIL
1046 #    endif
1047 #  endif
1048 #  if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */
1049 #    ifndef SWIG_PYTHON_INITIALIZE_THREADS
1050 #     define SWIG_PYTHON_INITIALIZE_THREADS  PyEval_InitThreads()
1051 #    endif
1052 #    ifdef __cplusplus /* C++ code */
1053        class SWIG_Python_Thread_Block {
1054          bool status;
1055          PyGILState_STATE state;
1056        public:
end()1057          void end() { if (status) { PyGILState_Release(state); status = false;} }
SWIG_Python_Thread_Block()1058          SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {}
~SWIG_Python_Thread_Block()1059          ~SWIG_Python_Thread_Block() { end(); }
1060        };
1061        class SWIG_Python_Thread_Allow {
1062          bool status;
1063          PyThreadState *save;
1064        public:
end()1065          void end() { if (status) { PyEval_RestoreThread(save); status = false; }}
SWIG_Python_Thread_Allow()1066          SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {}
~SWIG_Python_Thread_Allow()1067          ~SWIG_Python_Thread_Allow() { end(); }
1068        };
1069 #      define SWIG_PYTHON_THREAD_BEGIN_BLOCK   SWIG_Python_Thread_Block _swig_thread_block
1070 #      define SWIG_PYTHON_THREAD_END_BLOCK     _swig_thread_block.end()
1071 #      define SWIG_PYTHON_THREAD_BEGIN_ALLOW   SWIG_Python_Thread_Allow _swig_thread_allow
1072 #      define SWIG_PYTHON_THREAD_END_ALLOW     _swig_thread_allow.end()
1073 #    else /* C code */
1074 #      define SWIG_PYTHON_THREAD_BEGIN_BLOCK   PyGILState_STATE _swig_thread_block = PyGILState_Ensure()
1075 #      define SWIG_PYTHON_THREAD_END_BLOCK     PyGILState_Release(_swig_thread_block)
1076 #      define SWIG_PYTHON_THREAD_BEGIN_ALLOW   PyThreadState *_swig_thread_allow = PyEval_SaveThread()
1077 #      define SWIG_PYTHON_THREAD_END_ALLOW     PyEval_RestoreThread(_swig_thread_allow)
1078 #    endif
1079 #  else /* Old thread way, not implemented, user must provide it */
1080 #    if !defined(SWIG_PYTHON_INITIALIZE_THREADS)
1081 #      define SWIG_PYTHON_INITIALIZE_THREADS
1082 #    endif
1083 #    if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK)
1084 #      define SWIG_PYTHON_THREAD_BEGIN_BLOCK
1085 #    endif
1086 #    if !defined(SWIG_PYTHON_THREAD_END_BLOCK)
1087 #      define SWIG_PYTHON_THREAD_END_BLOCK
1088 #    endif
1089 #    if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW)
1090 #      define SWIG_PYTHON_THREAD_BEGIN_ALLOW
1091 #    endif
1092 #    if !defined(SWIG_PYTHON_THREAD_END_ALLOW)
1093 #      define SWIG_PYTHON_THREAD_END_ALLOW
1094 #    endif
1095 #  endif
1096 #else /* No thread support */
1097 #  define SWIG_PYTHON_INITIALIZE_THREADS
1098 #  define SWIG_PYTHON_THREAD_BEGIN_BLOCK
1099 #  define SWIG_PYTHON_THREAD_END_BLOCK
1100 #  define SWIG_PYTHON_THREAD_BEGIN_ALLOW
1101 #  define SWIG_PYTHON_THREAD_END_ALLOW
1102 #endif
1103 
1104 /* -----------------------------------------------------------------------------
1105  * Python API portion that goes into the runtime
1106  * ----------------------------------------------------------------------------- */
1107 
1108 #ifdef __cplusplus
1109 extern "C" {
1110 #endif
1111 
1112 /* -----------------------------------------------------------------------------
1113  * Constant declarations
1114  * ----------------------------------------------------------------------------- */
1115 
1116 /* Constant Types */
1117 #define SWIG_PY_POINTER 4
1118 #define SWIG_PY_BINARY  5
1119 
1120 /* Constant information structure */
1121 typedef struct swig_const_info {
1122   int type;
1123   char *name;
1124   long lvalue;
1125   double dvalue;
1126   void   *pvalue;
1127   swig_type_info **ptype;
1128 } swig_const_info;
1129 
1130 
1131 /* -----------------------------------------------------------------------------
1132  * Wrapper of PyInstanceMethod_New() used in Python 3
1133  * It is exported to the generated module, used for -fastproxy
1134  * ----------------------------------------------------------------------------- */
1135 #if PY_VERSION_HEX >= 0x03000000
SWIG_PyInstanceMethod_New(PyObject * SWIGUNUSEDPARM (self),PyObject * func)1136 SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func)
1137 {
1138   return PyInstanceMethod_New(func);
1139 }
1140 #else
SWIG_PyInstanceMethod_New(PyObject * SWIGUNUSEDPARM (self),PyObject * SWIGUNUSEDPARM (func))1141 SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *SWIGUNUSEDPARM(func))
1142 {
1143   return NULL;
1144 }
1145 #endif
1146 
1147 #ifdef __cplusplus
1148 }
1149 #endif
1150 
1151 
1152 /* -----------------------------------------------------------------------------
1153  * pyrun.swg
1154  *
1155  * This file contains the runtime support for Python modules
1156  * and includes code for managing global variables and pointer
1157  * type checking.
1158  *
1159  * ----------------------------------------------------------------------------- */
1160 
1161 /* Common SWIG API */
1162 
1163 /* for raw pointers */
1164 #define SWIG_Python_ConvertPtr(obj, pptr, type, flags)  SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
1165 #define SWIG_ConvertPtr(obj, pptr, type, flags)         SWIG_Python_ConvertPtr(obj, pptr, type, flags)
1166 #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own)  SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own)
1167 
1168 #ifdef SWIGPYTHON_BUILTIN
1169 #define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Python_NewPointerObj(self, ptr, type, flags)
1170 #else
1171 #define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
1172 #endif
1173 
1174 #define SWIG_InternalNewPointerObj(ptr, type, flags)	SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
1175 
1176 #define SWIG_CheckImplicit(ty)                          SWIG_Python_CheckImplicit(ty)
1177 #define SWIG_AcquirePtr(ptr, src)                       SWIG_Python_AcquirePtr(ptr, src)
1178 #define swig_owntype                                    int
1179 
1180 /* for raw packed data */
1181 #define SWIG_ConvertPacked(obj, ptr, sz, ty)            SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
1182 #define SWIG_NewPackedObj(ptr, sz, type)                SWIG_Python_NewPackedObj(ptr, sz, type)
1183 
1184 /* for class or struct pointers */
1185 #define SWIG_ConvertInstance(obj, pptr, type, flags)    SWIG_ConvertPtr(obj, pptr, type, flags)
1186 #define SWIG_NewInstanceObj(ptr, type, flags)           SWIG_NewPointerObj(ptr, type, flags)
1187 
1188 /* for C or C++ function pointers */
1189 #define SWIG_ConvertFunctionPtr(obj, pptr, type)        SWIG_Python_ConvertFunctionPtr(obj, pptr, type)
1190 #define SWIG_NewFunctionPtrObj(ptr, type)               SWIG_Python_NewPointerObj(NULL, ptr, type, 0)
1191 
1192 /* for C++ member pointers, ie, member methods */
1193 #define SWIG_ConvertMember(obj, ptr, sz, ty)            SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
1194 #define SWIG_NewMemberObj(ptr, sz, type)                SWIG_Python_NewPackedObj(ptr, sz, type)
1195 
1196 
1197 /* Runtime API */
1198 
1199 #define SWIG_GetModule(clientdata)                      SWIG_Python_GetModule(clientdata)
1200 #define SWIG_SetModule(clientdata, pointer)             SWIG_Python_SetModule(pointer)
1201 #define SWIG_NewClientData(obj)                         SwigPyClientData_New(obj)
1202 
1203 #define SWIG_SetErrorObj                                SWIG_Python_SetErrorObj
1204 #define SWIG_SetErrorMsg                        	SWIG_Python_SetErrorMsg
1205 #define SWIG_ErrorType(code)                    	SWIG_Python_ErrorType(code)
1206 #define SWIG_Error(code, msg)            		SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg)
1207 #define SWIG_fail                        		goto fail
1208 
1209 
1210 /* Runtime API implementation */
1211 
1212 /* Error manipulation */
1213 
1214 SWIGINTERN void
SWIG_Python_SetErrorObj(PyObject * errtype,PyObject * obj)1215 SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) {
1216   SWIG_PYTHON_THREAD_BEGIN_BLOCK;
1217   PyErr_SetObject(errtype, obj);
1218   Py_DECREF(obj);
1219   SWIG_PYTHON_THREAD_END_BLOCK;
1220 }
1221 
1222 SWIGINTERN void
SWIG_Python_SetErrorMsg(PyObject * errtype,const char * msg)1223 SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) {
1224   SWIG_PYTHON_THREAD_BEGIN_BLOCK;
1225   PyErr_SetString(errtype, msg);
1226   SWIG_PYTHON_THREAD_END_BLOCK;
1227 }
1228 
1229 #define SWIG_Python_Raise(obj, type, desc)  SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj)
1230 
1231 /* Set a constant value */
1232 
1233 #if defined(SWIGPYTHON_BUILTIN)
1234 
1235 SWIGINTERN void
SwigPyBuiltin_AddPublicSymbol(PyObject * seq,const char * key)1236 SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) {
1237   PyObject *s = PyString_InternFromString(key);
1238   PyList_Append(seq, s);
1239   Py_DECREF(s);
1240 }
1241 
1242 SWIGINTERN void
SWIG_Python_SetConstant(PyObject * d,PyObject * public_interface,const char * name,PyObject * obj)1243 SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) {
1244 #if PY_VERSION_HEX < 0x02030000
1245   PyDict_SetItemString(d, (char *)name, obj);
1246 #else
1247   PyDict_SetItemString(d, name, obj);
1248 #endif
1249   Py_DECREF(obj);
1250   if (public_interface)
1251     SwigPyBuiltin_AddPublicSymbol(public_interface, name);
1252 }
1253 
1254 #else
1255 
1256 SWIGINTERN void
SWIG_Python_SetConstant(PyObject * d,const char * name,PyObject * obj)1257 SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) {
1258 #if PY_VERSION_HEX < 0x02030000
1259   PyDict_SetItemString(d, (char *)name, obj);
1260 #else
1261   PyDict_SetItemString(d, name, obj);
1262 #endif
1263   Py_DECREF(obj);
1264 }
1265 
1266 #endif
1267 
1268 /* Append a value to the result obj */
1269 
1270 SWIGINTERN PyObject*
SWIG_Python_AppendOutput(PyObject * result,PyObject * obj)1271 SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) {
1272 #if !defined(SWIG_PYTHON_OUTPUT_TUPLE)
1273   if (!result) {
1274     result = obj;
1275   } else if (result == Py_None) {
1276     Py_DECREF(result);
1277     result = obj;
1278   } else {
1279     if (!PyList_Check(result)) {
1280       PyObject *o2 = result;
1281       result = PyList_New(1);
1282       PyList_SetItem(result, 0, o2);
1283     }
1284     PyList_Append(result,obj);
1285     Py_DECREF(obj);
1286   }
1287   return result;
1288 #else
1289   PyObject*   o2;
1290   PyObject*   o3;
1291   if (!result) {
1292     result = obj;
1293   } else if (result == Py_None) {
1294     Py_DECREF(result);
1295     result = obj;
1296   } else {
1297     if (!PyTuple_Check(result)) {
1298       o2 = result;
1299       result = PyTuple_New(1);
1300       PyTuple_SET_ITEM(result, 0, o2);
1301     }
1302     o3 = PyTuple_New(1);
1303     PyTuple_SET_ITEM(o3, 0, obj);
1304     o2 = result;
1305     result = PySequence_Concat(o2, o3);
1306     Py_DECREF(o2);
1307     Py_DECREF(o3);
1308   }
1309   return result;
1310 #endif
1311 }
1312 
1313 /* Unpack the argument tuple */
1314 
1315 SWIGINTERN int
SWIG_Python_UnpackTuple(PyObject * args,const char * name,Py_ssize_t min,Py_ssize_t max,PyObject ** objs)1316 SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
1317 {
1318   if (!args) {
1319     if (!min && !max) {
1320       return 1;
1321     } else {
1322       PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none",
1323 		   name, (min == max ? "" : "at least "), (int)min);
1324       return 0;
1325     }
1326   }
1327   if (!PyTuple_Check(args)) {
1328     if (min <= 1 && max >= 1) {
1329       int i;
1330       objs[0] = args;
1331       for (i = 1; i < max; ++i) {
1332 	objs[i] = 0;
1333       }
1334       return 2;
1335     }
1336     PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple");
1337     return 0;
1338   } else {
1339     Py_ssize_t l = PyTuple_GET_SIZE(args);
1340     if (l < min) {
1341       PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
1342 		   name, (min == max ? "" : "at least "), (int)min, (int)l);
1343       return 0;
1344     } else if (l > max) {
1345       PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
1346 		   name, (min == max ? "" : "at most "), (int)max, (int)l);
1347       return 0;
1348     } else {
1349       int i;
1350       for (i = 0; i < l; ++i) {
1351 	objs[i] = PyTuple_GET_ITEM(args, i);
1352       }
1353       for (; l < max; ++l) {
1354 	objs[l] = 0;
1355       }
1356       return i + 1;
1357     }
1358   }
1359 }
1360 
1361 /* A functor is a function object with one single object argument */
1362 #if PY_VERSION_HEX >= 0x02020000
1363 #define SWIG_Python_CallFunctor(functor, obj)	        PyObject_CallFunctionObjArgs(functor, obj, NULL);
1364 #else
1365 #define SWIG_Python_CallFunctor(functor, obj)	        PyObject_CallFunction(functor, "O", obj);
1366 #endif
1367 
1368 /*
1369   Helper for static pointer initialization for both C and C++ code, for example
1370   static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...);
1371 */
1372 #ifdef __cplusplus
1373 #define SWIG_STATIC_POINTER(var)  var
1374 #else
1375 #define SWIG_STATIC_POINTER(var)  var = 0; if (!var) var
1376 #endif
1377 
1378 /* -----------------------------------------------------------------------------
1379  * Pointer declarations
1380  * ----------------------------------------------------------------------------- */
1381 
1382 /* Flags for new pointer objects */
1383 #define SWIG_POINTER_NOSHADOW       (SWIG_POINTER_OWN      << 1)
1384 #define SWIG_POINTER_NEW            (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN)
1385 
1386 #define SWIG_POINTER_IMPLICIT_CONV  (SWIG_POINTER_DISOWN   << 1)
1387 
1388 #define SWIG_BUILTIN_TP_INIT	    (SWIG_POINTER_OWN << 2)
1389 #define SWIG_BUILTIN_INIT	    (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN)
1390 
1391 #ifdef __cplusplus
1392 extern "C" {
1393 #endif
1394 
1395 /*  How to access Py_None */
1396 #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
1397 #  ifndef SWIG_PYTHON_NO_BUILD_NONE
1398 #    ifndef SWIG_PYTHON_BUILD_NONE
1399 #      define SWIG_PYTHON_BUILD_NONE
1400 #    endif
1401 #  endif
1402 #endif
1403 
1404 #ifdef SWIG_PYTHON_BUILD_NONE
1405 #  ifdef Py_None
1406 #   undef Py_None
1407 #   define Py_None SWIG_Py_None()
1408 #  endif
1409 SWIGRUNTIMEINLINE PyObject *
_SWIG_Py_None(void)1410 _SWIG_Py_None(void)
1411 {
1412   PyObject *none = Py_BuildValue((char*)"");
1413   Py_DECREF(none);
1414   return none;
1415 }
1416 SWIGRUNTIME PyObject *
SWIG_Py_None(void)1417 SWIG_Py_None(void)
1418 {
1419   static PyObject *SWIG_STATIC_POINTER(none) = _SWIG_Py_None();
1420   return none;
1421 }
1422 #endif
1423 
1424 /* The python void return value */
1425 
1426 SWIGRUNTIMEINLINE PyObject *
SWIG_Py_Void(void)1427 SWIG_Py_Void(void)
1428 {
1429   PyObject *none = Py_None;
1430   Py_INCREF(none);
1431   return none;
1432 }
1433 
1434 /* SwigPyClientData */
1435 
1436 typedef struct {
1437   PyObject *klass;
1438   PyObject *newraw;
1439   PyObject *newargs;
1440   PyObject *destroy;
1441   int delargs;
1442   int implicitconv;
1443   PyTypeObject *pytype;
1444 } SwigPyClientData;
1445 
1446 SWIGRUNTIMEINLINE int
SWIG_Python_CheckImplicit(swig_type_info * ty)1447 SWIG_Python_CheckImplicit(swig_type_info *ty)
1448 {
1449   SwigPyClientData *data = (SwigPyClientData *)ty->clientdata;
1450   return data ? data->implicitconv : 0;
1451 }
1452 
1453 SWIGRUNTIMEINLINE PyObject *
SWIG_Python_ExceptionType(swig_type_info * desc)1454 SWIG_Python_ExceptionType(swig_type_info *desc) {
1455   SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0;
1456   PyObject *klass = data ? data->klass : 0;
1457   return (klass ? klass : PyExc_RuntimeError);
1458 }
1459 
1460 
1461 SWIGRUNTIME SwigPyClientData *
SwigPyClientData_New(PyObject * obj)1462 SwigPyClientData_New(PyObject* obj)
1463 {
1464   if (!obj) {
1465     return 0;
1466   } else {
1467     SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData));
1468     /* the klass element */
1469     data->klass = obj;
1470     Py_INCREF(data->klass);
1471     /* the newraw method and newargs arguments used to create a new raw instance */
1472     if (PyClass_Check(obj)) {
1473       data->newraw = 0;
1474       data->newargs = obj;
1475       Py_INCREF(obj);
1476     } else {
1477 #if (PY_VERSION_HEX < 0x02020000)
1478       data->newraw = 0;
1479 #else
1480       data->newraw = PyObject_GetAttrString(data->klass, (char *)"__new__");
1481 #endif
1482       if (data->newraw) {
1483 	Py_INCREF(data->newraw);
1484 	data->newargs = PyTuple_New(1);
1485 	PyTuple_SetItem(data->newargs, 0, obj);
1486       } else {
1487 	data->newargs = obj;
1488       }
1489       Py_INCREF(data->newargs);
1490     }
1491     /* the destroy method, aka as the C++ delete method */
1492     data->destroy = PyObject_GetAttrString(data->klass, (char *)"__swig_destroy__");
1493     if (PyErr_Occurred()) {
1494       PyErr_Clear();
1495       data->destroy = 0;
1496     }
1497     if (data->destroy) {
1498       int flags;
1499       Py_INCREF(data->destroy);
1500       flags = PyCFunction_GET_FLAGS(data->destroy);
1501 #ifdef METH_O
1502       data->delargs = !(flags & (METH_O));
1503 #else
1504       data->delargs = 0;
1505 #endif
1506     } else {
1507       data->delargs = 0;
1508     }
1509     data->implicitconv = 0;
1510     data->pytype = 0;
1511     return data;
1512   }
1513 }
1514 
1515 SWIGRUNTIME void
SwigPyClientData_Del(SwigPyClientData * data)1516 SwigPyClientData_Del(SwigPyClientData *data) {
1517   Py_XDECREF(data->newraw);
1518   Py_XDECREF(data->newargs);
1519   Py_XDECREF(data->destroy);
1520 }
1521 
1522 /* =============== SwigPyObject =====================*/
1523 
1524 typedef struct {
1525   PyObject_HEAD
1526   void *ptr;
1527   swig_type_info *ty;
1528   int own;
1529   PyObject *next;
1530 #ifdef SWIGPYTHON_BUILTIN
1531   PyObject *dict;
1532 #endif
1533 } SwigPyObject;
1534 
1535 SWIGRUNTIME PyObject *
SwigPyObject_long(SwigPyObject * v)1536 SwigPyObject_long(SwigPyObject *v)
1537 {
1538   return PyLong_FromVoidPtr(v->ptr);
1539 }
1540 
1541 SWIGRUNTIME PyObject *
SwigPyObject_format(const char * fmt,SwigPyObject * v)1542 SwigPyObject_format(const char* fmt, SwigPyObject *v)
1543 {
1544   PyObject *res = NULL;
1545   PyObject *args = PyTuple_New(1);
1546   if (args) {
1547     if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) {
1548       PyObject *ofmt = SWIG_Python_str_FromChar(fmt);
1549       if (ofmt) {
1550 #if PY_VERSION_HEX >= 0x03000000
1551 	res = PyUnicode_Format(ofmt,args);
1552 #else
1553 	res = PyString_Format(ofmt,args);
1554 #endif
1555 	Py_DECREF(ofmt);
1556       }
1557       Py_DECREF(args);
1558     }
1559   }
1560   return res;
1561 }
1562 
1563 SWIGRUNTIME PyObject *
SwigPyObject_oct(SwigPyObject * v)1564 SwigPyObject_oct(SwigPyObject *v)
1565 {
1566   return SwigPyObject_format("%o",v);
1567 }
1568 
1569 SWIGRUNTIME PyObject *
SwigPyObject_hex(SwigPyObject * v)1570 SwigPyObject_hex(SwigPyObject *v)
1571 {
1572   return SwigPyObject_format("%x",v);
1573 }
1574 
1575 SWIGRUNTIME PyObject *
1576 #ifdef METH_NOARGS
SwigPyObject_repr(SwigPyObject * v)1577 SwigPyObject_repr(SwigPyObject *v)
1578 #else
1579 SwigPyObject_repr(SwigPyObject *v, PyObject *args)
1580 #endif
1581 {
1582   const char *name = SWIG_TypePrettyName(v->ty);
1583   PyObject *repr = SWIG_Python_str_FromFormat("<Swig Object of type '%s' at %p>", (name ? name : "unknown"), (void *)v);
1584   if (v->next) {
1585 # ifdef METH_NOARGS
1586     PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next);
1587 # else
1588     PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args);
1589 # endif
1590 # if PY_VERSION_HEX >= 0x03000000
1591     PyObject *joined = PyUnicode_Concat(repr, nrep);
1592     Py_DecRef(repr);
1593     Py_DecRef(nrep);
1594     repr = joined;
1595 # else
1596     PyString_ConcatAndDel(&repr,nrep);
1597 # endif
1598   }
1599   return repr;
1600 }
1601 
1602 SWIGRUNTIME int
SwigPyObject_compare(SwigPyObject * v,SwigPyObject * w)1603 SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w)
1604 {
1605   void *i = v->ptr;
1606   void *j = w->ptr;
1607   return (i < j) ? -1 : ((i > j) ? 1 : 0);
1608 }
1609 
1610 /* Added for Python 3.x, would it also be useful for Python 2.x? */
1611 SWIGRUNTIME PyObject*
SwigPyObject_richcompare(SwigPyObject * v,SwigPyObject * w,int op)1612 SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op)
1613 {
1614   PyObject* res;
1615   if( op != Py_EQ && op != Py_NE ) {
1616     Py_INCREF(Py_NotImplemented);
1617     return Py_NotImplemented;
1618   }
1619   res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0);
1620   return res;
1621 }
1622 
1623 
1624 SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void);
1625 
1626 #ifdef SWIGPYTHON_BUILTIN
1627 static swig_type_info *SwigPyObject_stype = 0;
1628 SWIGRUNTIME PyTypeObject*
SwigPyObject_type(void)1629 SwigPyObject_type(void) {
1630     SwigPyClientData *cd;
1631     assert(SwigPyObject_stype);
1632     cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
1633     assert(cd);
1634     assert(cd->pytype);
1635     return cd->pytype;
1636 }
1637 #else
1638 SWIGRUNTIME PyTypeObject*
SwigPyObject_type(void)1639 SwigPyObject_type(void) {
1640   static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce();
1641   return type;
1642 }
1643 #endif
1644 
1645 SWIGRUNTIMEINLINE int
SwigPyObject_Check(PyObject * op)1646 SwigPyObject_Check(PyObject *op) {
1647 #ifdef SWIGPYTHON_BUILTIN
1648   PyTypeObject *target_tp = SwigPyObject_type();
1649   if (PyType_IsSubtype(op->ob_type, target_tp))
1650     return 1;
1651   return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0);
1652 #else
1653   return (Py_TYPE(op) == SwigPyObject_type())
1654     || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0);
1655 #endif
1656 }
1657 
1658 SWIGRUNTIME PyObject *
1659 SwigPyObject_New(void *ptr, swig_type_info *ty, int own);
1660 
1661 SWIGRUNTIME void
SwigPyObject_dealloc(PyObject * v)1662 SwigPyObject_dealloc(PyObject *v)
1663 {
1664   SwigPyObject *sobj = (SwigPyObject *) v;
1665   PyObject *next = sobj->next;
1666   if (sobj->own == SWIG_POINTER_OWN) {
1667     swig_type_info *ty = sobj->ty;
1668     SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
1669     PyObject *destroy = data ? data->destroy : 0;
1670     if (destroy) {
1671       /* destroy is always a VARARGS method */
1672       PyObject *res;
1673       if (data->delargs) {
1674 	/* we need to create a temporary object to carry the destroy operation */
1675 	PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0);
1676 	res = SWIG_Python_CallFunctor(destroy, tmp);
1677 	Py_DECREF(tmp);
1678       } else {
1679 	PyCFunction meth = PyCFunction_GET_FUNCTION(destroy);
1680 	PyObject *mself = PyCFunction_GET_SELF(destroy);
1681 	res = ((*meth)(mself, v));
1682       }
1683       Py_XDECREF(res);
1684     }
1685 #if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
1686     else {
1687       const char *name = SWIG_TypePrettyName(ty);
1688       printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown"));
1689     }
1690 #endif
1691   }
1692   Py_XDECREF(next);
1693   PyObject_DEL(v);
1694 }
1695 
1696 SWIGRUNTIME PyObject*
SwigPyObject_append(PyObject * v,PyObject * next)1697 SwigPyObject_append(PyObject* v, PyObject* next)
1698 {
1699   SwigPyObject *sobj = (SwigPyObject *) v;
1700 #ifndef METH_O
1701   PyObject *tmp = 0;
1702   if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL;
1703   next = tmp;
1704 #endif
1705   if (!SwigPyObject_Check(next)) {
1706     return NULL;
1707   }
1708   sobj->next = next;
1709   Py_INCREF(next);
1710   return SWIG_Py_Void();
1711 }
1712 
1713 SWIGRUNTIME PyObject*
1714 #ifdef METH_NOARGS
SwigPyObject_next(PyObject * v)1715 SwigPyObject_next(PyObject* v)
1716 #else
1717 SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1718 #endif
1719 {
1720   SwigPyObject *sobj = (SwigPyObject *) v;
1721   if (sobj->next) {
1722     Py_INCREF(sobj->next);
1723     return sobj->next;
1724   } else {
1725     return SWIG_Py_Void();
1726   }
1727 }
1728 
1729 SWIGINTERN PyObject*
1730 #ifdef METH_NOARGS
SwigPyObject_disown(PyObject * v)1731 SwigPyObject_disown(PyObject *v)
1732 #else
1733 SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1734 #endif
1735 {
1736   SwigPyObject *sobj = (SwigPyObject *)v;
1737   sobj->own = 0;
1738   return SWIG_Py_Void();
1739 }
1740 
1741 SWIGINTERN PyObject*
1742 #ifdef METH_NOARGS
SwigPyObject_acquire(PyObject * v)1743 SwigPyObject_acquire(PyObject *v)
1744 #else
1745 SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1746 #endif
1747 {
1748   SwigPyObject *sobj = (SwigPyObject *)v;
1749   sobj->own = SWIG_POINTER_OWN;
1750   return SWIG_Py_Void();
1751 }
1752 
1753 SWIGINTERN PyObject*
SwigPyObject_own(PyObject * v,PyObject * args)1754 SwigPyObject_own(PyObject *v, PyObject *args)
1755 {
1756   PyObject *val = 0;
1757 #if (PY_VERSION_HEX < 0x02020000)
1758   if (!PyArg_ParseTuple(args,(char *)"|O:own",&val))
1759 #elif (PY_VERSION_HEX < 0x02050000)
1760   if (!PyArg_UnpackTuple(args, (char *)"own", 0, 1, &val))
1761 #else
1762   if (!PyArg_UnpackTuple(args, "own", 0, 1, &val))
1763 #endif
1764     {
1765       return NULL;
1766     }
1767   else
1768     {
1769       SwigPyObject *sobj = (SwigPyObject *)v;
1770       PyObject *obj = PyBool_FromLong(sobj->own);
1771       if (val) {
1772 #ifdef METH_NOARGS
1773 	if (PyObject_IsTrue(val)) {
1774 	  SwigPyObject_acquire(v);
1775 	} else {
1776 	  SwigPyObject_disown(v);
1777 	}
1778 #else
1779 	if (PyObject_IsTrue(val)) {
1780 	  SwigPyObject_acquire(v,args);
1781 	} else {
1782 	  SwigPyObject_disown(v,args);
1783 	}
1784 #endif
1785       }
1786       return obj;
1787     }
1788 }
1789 
1790 #ifdef METH_O
1791 static PyMethodDef
1792 swigobject_methods[] = {
1793   {(char *)"disown",  (PyCFunction)SwigPyObject_disown,  METH_NOARGS,  (char *)"releases ownership of the pointer"},
1794   {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS,  (char *)"acquires ownership of the pointer"},
1795   {(char *)"own",     (PyCFunction)SwigPyObject_own,     METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
1796   {(char *)"append",  (PyCFunction)SwigPyObject_append,  METH_O,       (char *)"appends another 'this' object"},
1797   {(char *)"next",    (PyCFunction)SwigPyObject_next,    METH_NOARGS,  (char *)"returns the next 'this' object"},
1798   {(char *)"__repr__",(PyCFunction)SwigPyObject_repr,    METH_NOARGS,  (char *)"returns object representation"},
1799   {0, 0, 0, 0}
1800 };
1801 #else
1802 static PyMethodDef
1803 swigobject_methods[] = {
1804   {(char *)"disown",  (PyCFunction)SwigPyObject_disown,  METH_VARARGS,  (char *)"releases ownership of the pointer"},
1805   {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS,  (char *)"aquires ownership of the pointer"},
1806   {(char *)"own",     (PyCFunction)SwigPyObject_own,     METH_VARARGS,  (char *)"returns/sets ownership of the pointer"},
1807   {(char *)"append",  (PyCFunction)SwigPyObject_append,  METH_VARARGS,  (char *)"appends another 'this' object"},
1808   {(char *)"next",    (PyCFunction)SwigPyObject_next,    METH_VARARGS,  (char *)"returns the next 'this' object"},
1809   {(char *)"__repr__",(PyCFunction)SwigPyObject_repr,   METH_VARARGS,  (char *)"returns object representation"},
1810   {0, 0, 0, 0}
1811 };
1812 #endif
1813 
1814 #if PY_VERSION_HEX < 0x02020000
1815 SWIGINTERN PyObject *
SwigPyObject_getattr(SwigPyObject * sobj,char * name)1816 SwigPyObject_getattr(SwigPyObject *sobj,char *name)
1817 {
1818   return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name);
1819 }
1820 #endif
1821 
1822 SWIGRUNTIME PyTypeObject*
SwigPyObject_TypeOnce(void)1823 SwigPyObject_TypeOnce(void) {
1824   static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer";
1825 
1826   static PyNumberMethods SwigPyObject_as_number = {
1827     (binaryfunc)0, /*nb_add*/
1828     (binaryfunc)0, /*nb_subtract*/
1829     (binaryfunc)0, /*nb_multiply*/
1830     /* nb_divide removed in Python 3 */
1831 #if PY_VERSION_HEX < 0x03000000
1832     (binaryfunc)0, /*nb_divide*/
1833 #endif
1834     (binaryfunc)0, /*nb_remainder*/
1835     (binaryfunc)0, /*nb_divmod*/
1836     (ternaryfunc)0,/*nb_power*/
1837     (unaryfunc)0,  /*nb_negative*/
1838     (unaryfunc)0,  /*nb_positive*/
1839     (unaryfunc)0,  /*nb_absolute*/
1840     (inquiry)0,    /*nb_nonzero*/
1841     0,		   /*nb_invert*/
1842     0,		   /*nb_lshift*/
1843     0,		   /*nb_rshift*/
1844     0,		   /*nb_and*/
1845     0,		   /*nb_xor*/
1846     0,		   /*nb_or*/
1847 #if PY_VERSION_HEX < 0x03000000
1848     0,   /*nb_coerce*/
1849 #endif
1850     (unaryfunc)SwigPyObject_long, /*nb_int*/
1851 #if PY_VERSION_HEX < 0x03000000
1852     (unaryfunc)SwigPyObject_long, /*nb_long*/
1853 #else
1854     0, /*nb_reserved*/
1855 #endif
1856     (unaryfunc)0,                 /*nb_float*/
1857 #if PY_VERSION_HEX < 0x03000000
1858     (unaryfunc)SwigPyObject_oct,  /*nb_oct*/
1859     (unaryfunc)SwigPyObject_hex,  /*nb_hex*/
1860 #endif
1861 #if PY_VERSION_HEX >= 0x03000000 /* 3.0 */
1862     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */
1863 #elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */
1864     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */
1865 #elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */
1866     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */
1867 #elif PY_VERSION_HEX >= 0x02000000 /* 2.0.0 */
1868     0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */
1869 #endif
1870   };
1871 
1872   static PyTypeObject swigpyobject_type;
1873   static int type_init = 0;
1874   if (!type_init) {
1875     const PyTypeObject tmp = {
1876       /* PyObject header changed in Python 3 */
1877 #if PY_VERSION_HEX >= 0x03000000
1878       PyVarObject_HEAD_INIT(NULL, 0)
1879 #else
1880       PyObject_HEAD_INIT(NULL)
1881       0,                                    /* ob_size */
1882 #endif
1883       (char *)"SwigPyObject",               /* tp_name */
1884       sizeof(SwigPyObject),                 /* tp_basicsize */
1885       0,                                    /* tp_itemsize */
1886       (destructor)SwigPyObject_dealloc,     /* tp_dealloc */
1887       0,				    /* tp_print */
1888 #if PY_VERSION_HEX < 0x02020000
1889       (getattrfunc)SwigPyObject_getattr,    /* tp_getattr */
1890 #else
1891       (getattrfunc)0,                       /* tp_getattr */
1892 #endif
1893       (setattrfunc)0,                       /* tp_setattr */
1894 #if PY_VERSION_HEX >= 0x03000000
1895     0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */
1896 #else
1897       (cmpfunc)SwigPyObject_compare,        /* tp_compare */
1898 #endif
1899       (reprfunc)SwigPyObject_repr,          /* tp_repr */
1900       &SwigPyObject_as_number,              /* tp_as_number */
1901       0,                                    /* tp_as_sequence */
1902       0,                                    /* tp_as_mapping */
1903       (hashfunc)0,                          /* tp_hash */
1904       (ternaryfunc)0,                       /* tp_call */
1905       0,				    /* tp_str */
1906       PyObject_GenericGetAttr,              /* tp_getattro */
1907       0,                                    /* tp_setattro */
1908       0,                                    /* tp_as_buffer */
1909       Py_TPFLAGS_DEFAULT,                   /* tp_flags */
1910       swigobject_doc,                       /* tp_doc */
1911       0,                                    /* tp_traverse */
1912       0,                                    /* tp_clear */
1913       (richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */
1914       0,                                    /* tp_weaklistoffset */
1915 #if PY_VERSION_HEX >= 0x02020000
1916       0,                                    /* tp_iter */
1917       0,                                    /* tp_iternext */
1918       swigobject_methods,                   /* tp_methods */
1919       0,                                    /* tp_members */
1920       0,                                    /* tp_getset */
1921       0,                                    /* tp_base */
1922       0,                                    /* tp_dict */
1923       0,                                    /* tp_descr_get */
1924       0,                                    /* tp_descr_set */
1925       0,                                    /* tp_dictoffset */
1926       0,                                    /* tp_init */
1927       0,                                    /* tp_alloc */
1928       0,                                    /* tp_new */
1929       0,                                    /* tp_free */
1930       0,                                    /* tp_is_gc */
1931       0,                                    /* tp_bases */
1932       0,                                    /* tp_mro */
1933       0,                                    /* tp_cache */
1934       0,                                    /* tp_subclasses */
1935       0,                                    /* tp_weaklist */
1936 #endif
1937 #if PY_VERSION_HEX >= 0x02030000
1938       0,                                    /* tp_del */
1939 #endif
1940 #if PY_VERSION_HEX >= 0x02060000
1941       0,                                    /* tp_version */
1942 #endif
1943 #ifdef COUNT_ALLOCS
1944       0,0,0,0                               /* tp_alloc -> tp_next */
1945 #endif
1946     };
1947     swigpyobject_type = tmp;
1948     type_init = 1;
1949 #if PY_VERSION_HEX < 0x02020000
1950     swigpyobject_type.ob_type = &PyType_Type;
1951 #else
1952     if (PyType_Ready(&swigpyobject_type) < 0)
1953       return NULL;
1954 #endif
1955   }
1956   return &swigpyobject_type;
1957 }
1958 
1959 SWIGRUNTIME PyObject *
SwigPyObject_New(void * ptr,swig_type_info * ty,int own)1960 SwigPyObject_New(void *ptr, swig_type_info *ty, int own)
1961 {
1962   SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type());
1963   if (sobj) {
1964     sobj->ptr  = ptr;
1965     sobj->ty   = ty;
1966     sobj->own  = own;
1967     sobj->next = 0;
1968   }
1969   return (PyObject *)sobj;
1970 }
1971 
1972 /* -----------------------------------------------------------------------------
1973  * Implements a simple Swig Packed type, and use it instead of string
1974  * ----------------------------------------------------------------------------- */
1975 
1976 typedef struct {
1977   PyObject_HEAD
1978   void *pack;
1979   swig_type_info *ty;
1980   size_t size;
1981 } SwigPyPacked;
1982 
1983 SWIGRUNTIME int
SwigPyPacked_print(SwigPyPacked * v,FILE * fp,int SWIGUNUSEDPARM (flags))1984 SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags))
1985 {
1986   char result[SWIG_BUFFER_SIZE];
1987   fputs("<Swig Packed ", fp);
1988   if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
1989     fputs("at ", fp);
1990     fputs(result, fp);
1991   }
1992   fputs(v->ty->name,fp);
1993   fputs(">", fp);
1994   return 0;
1995 }
1996 
1997 SWIGRUNTIME PyObject *
SwigPyPacked_repr(SwigPyPacked * v)1998 SwigPyPacked_repr(SwigPyPacked *v)
1999 {
2000   char result[SWIG_BUFFER_SIZE];
2001   if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
2002     return SWIG_Python_str_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);
2003   } else {
2004     return SWIG_Python_str_FromFormat("<Swig Packed %s>", v->ty->name);
2005   }
2006 }
2007 
2008 SWIGRUNTIME PyObject *
SwigPyPacked_str(SwigPyPacked * v)2009 SwigPyPacked_str(SwigPyPacked *v)
2010 {
2011   char result[SWIG_BUFFER_SIZE];
2012   if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){
2013     return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name);
2014   } else {
2015     return SWIG_Python_str_FromChar(v->ty->name);
2016   }
2017 }
2018 
2019 SWIGRUNTIME int
SwigPyPacked_compare(SwigPyPacked * v,SwigPyPacked * w)2020 SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w)
2021 {
2022   size_t i = v->size;
2023   size_t j = w->size;
2024   int s = (i < j) ? -1 : ((i > j) ? 1 : 0);
2025   return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size);
2026 }
2027 
2028 SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void);
2029 
2030 SWIGRUNTIME PyTypeObject*
SwigPyPacked_type(void)2031 SwigPyPacked_type(void) {
2032   static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce();
2033   return type;
2034 }
2035 
2036 SWIGRUNTIMEINLINE int
SwigPyPacked_Check(PyObject * op)2037 SwigPyPacked_Check(PyObject *op) {
2038   return ((op)->ob_type == SwigPyPacked_TypeOnce())
2039     || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0);
2040 }
2041 
2042 SWIGRUNTIME void
SwigPyPacked_dealloc(PyObject * v)2043 SwigPyPacked_dealloc(PyObject *v)
2044 {
2045   if (SwigPyPacked_Check(v)) {
2046     SwigPyPacked *sobj = (SwigPyPacked *) v;
2047     free(sobj->pack);
2048   }
2049   PyObject_DEL(v);
2050 }
2051 
2052 SWIGRUNTIME PyTypeObject*
SwigPyPacked_TypeOnce(void)2053 SwigPyPacked_TypeOnce(void) {
2054   static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer";
2055   static PyTypeObject swigpypacked_type;
2056   static int type_init = 0;
2057   if (!type_init) {
2058     const PyTypeObject tmp = {
2059       /* PyObject header changed in Python 3 */
2060 #if PY_VERSION_HEX>=0x03000000
2061       PyVarObject_HEAD_INIT(NULL, 0)
2062 #else
2063       PyObject_HEAD_INIT(NULL)
2064       0,                                    /* ob_size */
2065 #endif
2066       (char *)"SwigPyPacked",               /* tp_name */
2067       sizeof(SwigPyPacked),                 /* tp_basicsize */
2068       0,                                    /* tp_itemsize */
2069       (destructor)SwigPyPacked_dealloc,     /* tp_dealloc */
2070       (printfunc)SwigPyPacked_print,        /* tp_print */
2071       (getattrfunc)0,                       /* tp_getattr */
2072       (setattrfunc)0,                       /* tp_setattr */
2073 #if PY_VERSION_HEX>=0x03000000
2074       0, /* tp_reserved in 3.0.1 */
2075 #else
2076       (cmpfunc)SwigPyPacked_compare,        /* tp_compare */
2077 #endif
2078       (reprfunc)SwigPyPacked_repr,          /* tp_repr */
2079       0,                                    /* tp_as_number */
2080       0,                                    /* tp_as_sequence */
2081       0,                                    /* tp_as_mapping */
2082       (hashfunc)0,                          /* tp_hash */
2083       (ternaryfunc)0,                       /* tp_call */
2084       (reprfunc)SwigPyPacked_str,           /* tp_str */
2085       PyObject_GenericGetAttr,              /* tp_getattro */
2086       0,                                    /* tp_setattro */
2087       0,                                    /* tp_as_buffer */
2088       Py_TPFLAGS_DEFAULT,                   /* tp_flags */
2089       swigpacked_doc,                       /* tp_doc */
2090       0,                                    /* tp_traverse */
2091       0,                                    /* tp_clear */
2092       0,                                    /* tp_richcompare */
2093       0,                                    /* tp_weaklistoffset */
2094 #if PY_VERSION_HEX >= 0x02020000
2095       0,                                    /* tp_iter */
2096       0,                                    /* tp_iternext */
2097       0,                                    /* tp_methods */
2098       0,                                    /* tp_members */
2099       0,                                    /* tp_getset */
2100       0,                                    /* tp_base */
2101       0,                                    /* tp_dict */
2102       0,                                    /* tp_descr_get */
2103       0,                                    /* tp_descr_set */
2104       0,                                    /* tp_dictoffset */
2105       0,                                    /* tp_init */
2106       0,                                    /* tp_alloc */
2107       0,                                    /* tp_new */
2108       0,                                    /* tp_free */
2109       0,                                    /* tp_is_gc */
2110       0,                                    /* tp_bases */
2111       0,                                    /* tp_mro */
2112       0,                                    /* tp_cache */
2113       0,                                    /* tp_subclasses */
2114       0,                                    /* tp_weaklist */
2115 #endif
2116 #if PY_VERSION_HEX >= 0x02030000
2117       0,                                    /* tp_del */
2118 #endif
2119 #if PY_VERSION_HEX >= 0x02060000
2120       0,                                    /* tp_version */
2121 #endif
2122 #ifdef COUNT_ALLOCS
2123       0,0,0,0                               /* tp_alloc -> tp_next */
2124 #endif
2125     };
2126     swigpypacked_type = tmp;
2127     type_init = 1;
2128 #if PY_VERSION_HEX < 0x02020000
2129     swigpypacked_type.ob_type = &PyType_Type;
2130 #else
2131     if (PyType_Ready(&swigpypacked_type) < 0)
2132       return NULL;
2133 #endif
2134   }
2135   return &swigpypacked_type;
2136 }
2137 
2138 SWIGRUNTIME PyObject *
SwigPyPacked_New(void * ptr,size_t size,swig_type_info * ty)2139 SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty)
2140 {
2141   SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type());
2142   if (sobj) {
2143     void *pack = malloc(size);
2144     if (pack) {
2145       memcpy(pack, ptr, size);
2146       sobj->pack = pack;
2147       sobj->ty   = ty;
2148       sobj->size = size;
2149     } else {
2150       PyObject_DEL((PyObject *) sobj);
2151       sobj = 0;
2152     }
2153   }
2154   return (PyObject *) sobj;
2155 }
2156 
2157 SWIGRUNTIME swig_type_info *
SwigPyPacked_UnpackData(PyObject * obj,void * ptr,size_t size)2158 SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
2159 {
2160   if (SwigPyPacked_Check(obj)) {
2161     SwigPyPacked *sobj = (SwigPyPacked *)obj;
2162     if (sobj->size != size) return 0;
2163     memcpy(ptr, sobj->pack, size);
2164     return sobj->ty;
2165   } else {
2166     return 0;
2167   }
2168 }
2169 
2170 /* -----------------------------------------------------------------------------
2171  * pointers/data manipulation
2172  * ----------------------------------------------------------------------------- */
2173 
2174 SWIGRUNTIMEINLINE PyObject *
_SWIG_This(void)2175 _SWIG_This(void)
2176 {
2177     return SWIG_Python_str_FromChar("this");
2178 }
2179 
2180 static PyObject *swig_this = NULL;
2181 
2182 SWIGRUNTIME PyObject *
SWIG_This(void)2183 SWIG_This(void)
2184 {
2185   if (swig_this == NULL)
2186     swig_this = _SWIG_This();
2187   return swig_this;
2188 }
2189 
2190 /* #define SWIG_PYTHON_SLOW_GETSET_THIS */
2191 
2192 /* TODO: I don't know how to implement the fast getset in Python 3 right now */
2193 #if PY_VERSION_HEX>=0x03000000
2194 #define SWIG_PYTHON_SLOW_GETSET_THIS
2195 #endif
2196 
2197 SWIGRUNTIME SwigPyObject *
SWIG_Python_GetSwigThis(PyObject * pyobj)2198 SWIG_Python_GetSwigThis(PyObject *pyobj)
2199 {
2200   PyObject *obj;
2201 
2202   if (SwigPyObject_Check(pyobj))
2203     return (SwigPyObject *) pyobj;
2204 
2205 #ifdef SWIGPYTHON_BUILTIN
2206   (void)obj;
2207 # ifdef PyWeakref_CheckProxy
2208   if (PyWeakref_CheckProxy(pyobj)) {
2209     pyobj = PyWeakref_GET_OBJECT(pyobj);
2210     if (pyobj && SwigPyObject_Check(pyobj))
2211       return (SwigPyObject*) pyobj;
2212   }
2213 # endif
2214   return NULL;
2215 #else
2216 
2217   obj = 0;
2218 
2219 #if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000))
2220   if (PyInstance_Check(pyobj)) {
2221     obj = _PyInstance_Lookup(pyobj, SWIG_This());
2222   } else {
2223     PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
2224     if (dictptr != NULL) {
2225       PyObject *dict = *dictptr;
2226       obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0;
2227     } else {
2228 #ifdef PyWeakref_CheckProxy
2229       if (PyWeakref_CheckProxy(pyobj)) {
2230 	PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
2231 	return wobj ? SWIG_Python_GetSwigThis(wobj) : 0;
2232       }
2233 #endif
2234       obj = PyObject_GetAttr(pyobj,SWIG_This());
2235       if (obj) {
2236 	Py_DECREF(obj);
2237       } else {
2238 	if (PyErr_Occurred()) PyErr_Clear();
2239 	return 0;
2240       }
2241     }
2242   }
2243 #else
2244   obj = PyObject_GetAttr(pyobj,SWIG_This());
2245   if (obj) {
2246     Py_DECREF(obj);
2247   } else {
2248     if (PyErr_Occurred()) PyErr_Clear();
2249     return 0;
2250   }
2251 #endif
2252   if (obj && !SwigPyObject_Check(obj)) {
2253     /* a PyObject is called 'this', try to get the 'real this'
2254        SwigPyObject from it */
2255     return SWIG_Python_GetSwigThis(obj);
2256   }
2257   return (SwigPyObject *)obj;
2258 #endif
2259 }
2260 
2261 /* Acquire a pointer value */
2262 
2263 SWIGRUNTIME int
SWIG_Python_AcquirePtr(PyObject * obj,int own)2264 SWIG_Python_AcquirePtr(PyObject *obj, int own) {
2265   if (own == SWIG_POINTER_OWN) {
2266     SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj);
2267     if (sobj) {
2268       int oldown = sobj->own;
2269       sobj->own = own;
2270       return oldown;
2271     }
2272   }
2273   return 0;
2274 }
2275 
2276 /* Convert a pointer value */
2277 
2278 SWIGRUNTIME int
SWIG_Python_ConvertPtrAndOwn(PyObject * obj,void ** ptr,swig_type_info * ty,int flags,int * own)2279 SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) {
2280   int res;
2281   SwigPyObject *sobj;
2282   int implicit_conv = (flags & SWIG_POINTER_IMPLICIT_CONV) != 0;
2283 
2284   if (!obj)
2285     return SWIG_ERROR;
2286   if (obj == Py_None && !implicit_conv) {
2287     if (ptr)
2288       *ptr = 0;
2289     return SWIG_OK;
2290   }
2291 
2292   res = SWIG_ERROR;
2293 
2294   sobj = SWIG_Python_GetSwigThis(obj);
2295   if (own)
2296     *own = 0;
2297   while (sobj) {
2298     void *vptr = sobj->ptr;
2299     if (ty) {
2300       swig_type_info *to = sobj->ty;
2301       if (to == ty) {
2302         /* no type cast needed */
2303         if (ptr) *ptr = vptr;
2304         break;
2305       } else {
2306         swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
2307         if (!tc) {
2308           sobj = (SwigPyObject *)sobj->next;
2309         } else {
2310           if (ptr) {
2311             int newmemory = 0;
2312             *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
2313             if (newmemory == SWIG_CAST_NEW_MEMORY) {
2314               assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
2315               if (own)
2316                 *own = *own | SWIG_CAST_NEW_MEMORY;
2317             }
2318           }
2319           break;
2320         }
2321       }
2322     } else {
2323       if (ptr) *ptr = vptr;
2324       break;
2325     }
2326   }
2327   if (sobj) {
2328     if (own)
2329       *own = *own | sobj->own;
2330     if (flags & SWIG_POINTER_DISOWN) {
2331       sobj->own = 0;
2332     }
2333     res = SWIG_OK;
2334   } else {
2335     if (implicit_conv) {
2336       SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
2337       if (data && !data->implicitconv) {
2338         PyObject *klass = data->klass;
2339         if (klass) {
2340           PyObject *impconv;
2341           data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/
2342           impconv = SWIG_Python_CallFunctor(klass, obj);
2343           data->implicitconv = 0;
2344           if (PyErr_Occurred()) {
2345             PyErr_Clear();
2346             impconv = 0;
2347           }
2348           if (impconv) {
2349             SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv);
2350             if (iobj) {
2351               void *vptr;
2352               res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
2353               if (SWIG_IsOK(res)) {
2354                 if (ptr) {
2355                   *ptr = vptr;
2356                   /* transfer the ownership to 'ptr' */
2357                   iobj->own = 0;
2358                   res = SWIG_AddCast(res);
2359                   res = SWIG_AddNewMask(res);
2360                 } else {
2361                   res = SWIG_AddCast(res);
2362                 }
2363               }
2364             }
2365             Py_DECREF(impconv);
2366           }
2367         }
2368       }
2369     }
2370     if (!SWIG_IsOK(res) && obj == Py_None) {
2371       if (ptr)
2372         *ptr = 0;
2373       if (PyErr_Occurred())
2374         PyErr_Clear();
2375       res = SWIG_OK;
2376     }
2377   }
2378   return res;
2379 }
2380 
2381 /* Convert a function ptr value */
2382 
2383 SWIGRUNTIME int
SWIG_Python_ConvertFunctionPtr(PyObject * obj,void ** ptr,swig_type_info * ty)2384 SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
2385   if (!PyCFunction_Check(obj)) {
2386     return SWIG_ConvertPtr(obj, ptr, ty, 0);
2387   } else {
2388     void *vptr = 0;
2389 
2390     /* here we get the method pointer for callbacks */
2391     const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
2392     const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
2393     if (desc)
2394       desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
2395     if (!desc)
2396       return SWIG_ERROR;
2397     if (ty) {
2398       swig_cast_info *tc = SWIG_TypeCheck(desc,ty);
2399       if (tc) {
2400         int newmemory = 0;
2401         *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
2402         assert(!newmemory); /* newmemory handling not yet implemented */
2403       } else {
2404         return SWIG_ERROR;
2405       }
2406     } else {
2407       *ptr = vptr;
2408     }
2409     return SWIG_OK;
2410   }
2411 }
2412 
2413 /* Convert a packed value value */
2414 
2415 SWIGRUNTIME int
SWIG_Python_ConvertPacked(PyObject * obj,void * ptr,size_t sz,swig_type_info * ty)2416 SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) {
2417   swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz);
2418   if (!to) return SWIG_ERROR;
2419   if (ty) {
2420     if (to != ty) {
2421       /* check type cast? */
2422       swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
2423       if (!tc) return SWIG_ERROR;
2424     }
2425   }
2426   return SWIG_OK;
2427 }
2428 
2429 /* -----------------------------------------------------------------------------
2430  * Create a new pointer object
2431  * ----------------------------------------------------------------------------- */
2432 
2433 /*
2434   Create a new instance object, without calling __init__, and set the
2435   'this' attribute.
2436 */
2437 
2438 SWIGRUNTIME PyObject*
SWIG_Python_NewShadowInstance(SwigPyClientData * data,PyObject * swig_this)2439 SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
2440 {
2441 #if (PY_VERSION_HEX >= 0x02020000)
2442   PyObject *inst = 0;
2443   PyObject *newraw = data->newraw;
2444   if (newraw) {
2445     inst = PyObject_Call(newraw, data->newargs, NULL);
2446     if (inst) {
2447 #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2448       PyObject **dictptr = _PyObject_GetDictPtr(inst);
2449       if (dictptr != NULL) {
2450 	PyObject *dict = *dictptr;
2451 	if (dict == NULL) {
2452 	  dict = PyDict_New();
2453 	  *dictptr = dict;
2454 	  PyDict_SetItem(dict, SWIG_This(), swig_this);
2455 	}
2456       }
2457 #else
2458       PyObject *key = SWIG_This();
2459       PyObject_SetAttr(inst, key, swig_this);
2460 #endif
2461     }
2462   } else {
2463 #if PY_VERSION_HEX >= 0x03000000
2464     inst = ((PyTypeObject*) data->newargs)->tp_new((PyTypeObject*) data->newargs, Py_None, Py_None);
2465     if (inst) {
2466       PyObject_SetAttr(inst, SWIG_This(), swig_this);
2467       Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
2468     }
2469 #else
2470     PyObject *dict = PyDict_New();
2471     if (dict) {
2472       PyDict_SetItem(dict, SWIG_This(), swig_this);
2473       inst = PyInstance_NewRaw(data->newargs, dict);
2474       Py_DECREF(dict);
2475     }
2476 #endif
2477   }
2478   return inst;
2479 #else
2480 #if (PY_VERSION_HEX >= 0x02010000)
2481   PyObject *inst = 0;
2482   PyObject *dict = PyDict_New();
2483   if (dict) {
2484     PyDict_SetItem(dict, SWIG_This(), swig_this);
2485     inst = PyInstance_NewRaw(data->newargs, dict);
2486     Py_DECREF(dict);
2487   }
2488   return (PyObject *) inst;
2489 #else
2490   PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type);
2491   if (inst == NULL) {
2492     return NULL;
2493   }
2494   inst->in_class = (PyClassObject *)data->newargs;
2495   Py_INCREF(inst->in_class);
2496   inst->in_dict = PyDict_New();
2497   if (inst->in_dict == NULL) {
2498     Py_DECREF(inst);
2499     return NULL;
2500   }
2501 #ifdef Py_TPFLAGS_HAVE_WEAKREFS
2502   inst->in_weakreflist = NULL;
2503 #endif
2504 #ifdef Py_TPFLAGS_GC
2505   PyObject_GC_Init(inst);
2506 #endif
2507   PyDict_SetItem(inst->in_dict, SWIG_This(), swig_this);
2508   return (PyObject *) inst;
2509 #endif
2510 #endif
2511 }
2512 
2513 SWIGRUNTIME void
SWIG_Python_SetSwigThis(PyObject * inst,PyObject * swig_this)2514 SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this)
2515 {
2516  PyObject *dict;
2517 #if (PY_VERSION_HEX >= 0x02020000) && !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2518  PyObject **dictptr = _PyObject_GetDictPtr(inst);
2519  if (dictptr != NULL) {
2520    dict = *dictptr;
2521    if (dict == NULL) {
2522      dict = PyDict_New();
2523      *dictptr = dict;
2524    }
2525    PyDict_SetItem(dict, SWIG_This(), swig_this);
2526    return;
2527  }
2528 #endif
2529  dict = PyObject_GetAttrString(inst, (char*)"__dict__");
2530  PyDict_SetItem(dict, SWIG_This(), swig_this);
2531  Py_DECREF(dict);
2532 }
2533 
2534 
2535 SWIGINTERN PyObject *
SWIG_Python_InitShadowInstance(PyObject * args)2536 SWIG_Python_InitShadowInstance(PyObject *args) {
2537   PyObject *obj[2];
2538   if (!SWIG_Python_UnpackTuple(args, "swiginit", 2, 2, obj)) {
2539     return NULL;
2540   } else {
2541     SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]);
2542     if (sthis) {
2543       SwigPyObject_append((PyObject*) sthis, obj[1]);
2544     } else {
2545       SWIG_Python_SetSwigThis(obj[0], obj[1]);
2546     }
2547     return SWIG_Py_Void();
2548   }
2549 }
2550 
2551 /* Create a new pointer object */
2552 
2553 SWIGRUNTIME PyObject *
SWIG_Python_NewPointerObj(PyObject * self,void * ptr,swig_type_info * type,int flags)2554 SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags) {
2555   SwigPyClientData *clientdata;
2556   PyObject * robj;
2557   int own;
2558 
2559   if (!ptr)
2560     return SWIG_Py_Void();
2561 
2562   clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0;
2563   own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
2564   if (clientdata && clientdata->pytype) {
2565     SwigPyObject *newobj;
2566     if (flags & SWIG_BUILTIN_TP_INIT) {
2567       newobj = (SwigPyObject*) self;
2568       if (newobj->ptr) {
2569         PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0);
2570         while (newobj->next)
2571 	  newobj = (SwigPyObject *) newobj->next;
2572         newobj->next = next_self;
2573         newobj = (SwigPyObject *)next_self;
2574       }
2575     } else {
2576       newobj = PyObject_New(SwigPyObject, clientdata->pytype);
2577     }
2578     if (newobj) {
2579       newobj->ptr = ptr;
2580       newobj->ty = type;
2581       newobj->own = own;
2582       newobj->next = 0;
2583 #ifdef SWIGPYTHON_BUILTIN
2584       newobj->dict = 0;
2585 #endif
2586       return (PyObject*) newobj;
2587     }
2588     return SWIG_Py_Void();
2589   }
2590 
2591   assert(!(flags & SWIG_BUILTIN_TP_INIT));
2592 
2593   robj = SwigPyObject_New(ptr, type, own);
2594   if (robj && clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
2595     PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
2596     Py_DECREF(robj);
2597     robj = inst;
2598   }
2599   return robj;
2600 }
2601 
2602 /* Create a new packed object */
2603 
2604 SWIGRUNTIMEINLINE PyObject *
SWIG_Python_NewPackedObj(void * ptr,size_t sz,swig_type_info * type)2605 SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
2606   return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void();
2607 }
2608 
2609 /* -----------------------------------------------------------------------------*
2610  *  Get type list
2611  * -----------------------------------------------------------------------------*/
2612 
2613 #ifdef SWIG_LINK_RUNTIME
2614 void *SWIG_ReturnGlobalTypeList(void *);
2615 #endif
2616 
2617 SWIGRUNTIME swig_module_info *
SWIG_Python_GetModule(void * SWIGUNUSEDPARM (clientdata))2618 SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) {
2619   static void *type_pointer = (void *)0;
2620   /* first check if module already created */
2621   if (!type_pointer) {
2622 #ifdef SWIG_LINK_RUNTIME
2623     type_pointer = SWIG_ReturnGlobalTypeList((void *)0);
2624 #else
2625 # ifdef SWIGPY_USE_CAPSULE
2626     type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0);
2627 # else
2628     type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
2629 				    (char*)"type_pointer" SWIG_TYPE_TABLE_NAME);
2630 # endif
2631     if (PyErr_Occurred()) {
2632       PyErr_Clear();
2633       type_pointer = (void *)0;
2634     }
2635 #endif
2636   }
2637   return (swig_module_info *) type_pointer;
2638 }
2639 
2640 #if PY_MAJOR_VERSION < 2
2641 /* PyModule_AddObject function was introduced in Python 2.0.  The following function
2642    is copied out of Python/modsupport.c in python version 2.3.4 */
2643 SWIGINTERN int
PyModule_AddObject(PyObject * m,char * name,PyObject * o)2644 PyModule_AddObject(PyObject *m, char *name, PyObject *o)
2645 {
2646   PyObject *dict;
2647   if (!PyModule_Check(m)) {
2648     PyErr_SetString(PyExc_TypeError,
2649 		    "PyModule_AddObject() needs module as first arg");
2650     return SWIG_ERROR;
2651   }
2652   if (!o) {
2653     PyErr_SetString(PyExc_TypeError,
2654 		    "PyModule_AddObject() needs non-NULL value");
2655     return SWIG_ERROR;
2656   }
2657 
2658   dict = PyModule_GetDict(m);
2659   if (dict == NULL) {
2660     /* Internal error -- modules must have a dict! */
2661     PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__",
2662 		 PyModule_GetName(m));
2663     return SWIG_ERROR;
2664   }
2665   if (PyDict_SetItemString(dict, name, o))
2666     return SWIG_ERROR;
2667   Py_DECREF(o);
2668   return SWIG_OK;
2669 }
2670 #endif
2671 
2672 SWIGRUNTIME void
2673 #ifdef SWIGPY_USE_CAPSULE
SWIG_Python_DestroyModule(PyObject * obj)2674 SWIG_Python_DestroyModule(PyObject *obj)
2675 #else
2676 SWIG_Python_DestroyModule(void *vptr)
2677 #endif
2678 {
2679 #ifdef SWIGPY_USE_CAPSULE
2680   swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME);
2681 #else
2682   swig_module_info *swig_module = (swig_module_info *) vptr;
2683 #endif
2684   swig_type_info **types = swig_module->types;
2685   size_t i;
2686   for (i =0; i < swig_module->size; ++i) {
2687     swig_type_info *ty = types[i];
2688     if (ty->owndata) {
2689       SwigPyClientData *data = (SwigPyClientData *) ty->clientdata;
2690       if (data) SwigPyClientData_Del(data);
2691     }
2692   }
2693   Py_DECREF(SWIG_This());
2694   swig_this = NULL;
2695 }
2696 
2697 SWIGRUNTIME void
SWIG_Python_SetModule(swig_module_info * swig_module)2698 SWIG_Python_SetModule(swig_module_info *swig_module) {
2699 #if PY_VERSION_HEX >= 0x03000000
2700  /* Add a dummy module object into sys.modules */
2701   PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION);
2702 #else
2703   static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */
2704   PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table);
2705 #endif
2706 #ifdef SWIGPY_USE_CAPSULE
2707   PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule);
2708   if (pointer && module) {
2709     PyModule_AddObject(module, (char*)"type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer);
2710   } else {
2711     Py_XDECREF(pointer);
2712   }
2713 #else
2714   PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule);
2715   if (pointer && module) {
2716     PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer);
2717   } else {
2718     Py_XDECREF(pointer);
2719   }
2720 #endif
2721 }
2722 
2723 /* The python cached type query */
2724 SWIGRUNTIME PyObject *
SWIG_Python_TypeCache(void)2725 SWIG_Python_TypeCache(void) {
2726   static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New();
2727   return cache;
2728 }
2729 
2730 SWIGRUNTIME swig_type_info *
SWIG_Python_TypeQuery(const char * type)2731 SWIG_Python_TypeQuery(const char *type)
2732 {
2733   PyObject *cache = SWIG_Python_TypeCache();
2734   PyObject *key = SWIG_Python_str_FromChar(type);
2735   PyObject *obj = PyDict_GetItem(cache, key);
2736   swig_type_info *descriptor;
2737   if (obj) {
2738 #ifdef SWIGPY_USE_CAPSULE
2739     descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL);
2740 #else
2741     descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj);
2742 #endif
2743   } else {
2744     swig_module_info *swig_module = SWIG_GetModule(0);
2745     descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type);
2746     if (descriptor) {
2747 #ifdef SWIGPY_USE_CAPSULE
2748       obj = PyCapsule_New((void*) descriptor, NULL, NULL);
2749 #else
2750       obj = PyCObject_FromVoidPtr(descriptor, NULL);
2751 #endif
2752       PyDict_SetItem(cache, key, obj);
2753       Py_DECREF(obj);
2754     }
2755   }
2756   Py_DECREF(key);
2757   return descriptor;
2758 }
2759 
2760 /*
2761    For backward compatibility only
2762 */
2763 #define SWIG_POINTER_EXCEPTION  0
2764 #define SWIG_arg_fail(arg)      SWIG_Python_ArgFail(arg)
2765 #define SWIG_MustGetPtr(p, type, argnum, flags)  SWIG_Python_MustGetPtr(p, type, argnum, flags)
2766 
2767 SWIGRUNTIME int
SWIG_Python_AddErrMesg(const char * mesg,int infront)2768 SWIG_Python_AddErrMesg(const char* mesg, int infront)
2769 {
2770   if (PyErr_Occurred()) {
2771     PyObject *type = 0;
2772     PyObject *value = 0;
2773     PyObject *traceback = 0;
2774     PyErr_Fetch(&type, &value, &traceback);
2775     if (value) {
2776       char *tmp;
2777       PyObject *old_str = PyObject_Str(value);
2778       Py_XINCREF(type);
2779       PyErr_Clear();
2780       if (infront) {
2781 	PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str));
2782       } else {
2783 	PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
2784       }
2785       SWIG_Python_str_DelForPy3(tmp);
2786       Py_DECREF(old_str);
2787     }
2788     return 1;
2789   } else {
2790     return 0;
2791   }
2792 }
2793 
2794 SWIGRUNTIME int
SWIG_Python_ArgFail(int argnum)2795 SWIG_Python_ArgFail(int argnum)
2796 {
2797   if (PyErr_Occurred()) {
2798     /* add information about failing argument */
2799     char mesg[256];
2800     PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum);
2801     return SWIG_Python_AddErrMesg(mesg, 1);
2802   } else {
2803     return 0;
2804   }
2805 }
2806 
2807 SWIGRUNTIMEINLINE const char *
SwigPyObject_GetDesc(PyObject * self)2808 SwigPyObject_GetDesc(PyObject *self)
2809 {
2810   SwigPyObject *v = (SwigPyObject *)self;
2811   swig_type_info *ty = v ? v->ty : 0;
2812   return ty ? ty->str : "";
2813 }
2814 
2815 SWIGRUNTIME void
SWIG_Python_TypeError(const char * type,PyObject * obj)2816 SWIG_Python_TypeError(const char *type, PyObject *obj)
2817 {
2818   if (type) {
2819 #if defined(SWIG_COBJECT_TYPES)
2820     if (obj && SwigPyObject_Check(obj)) {
2821       const char *otype = (const char *) SwigPyObject_GetDesc(obj);
2822       if (otype) {
2823 	PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received",
2824 		     type, otype);
2825 	return;
2826       }
2827     } else
2828 #endif
2829     {
2830       const char *otype = (obj ? obj->ob_type->tp_name : 0);
2831       if (otype) {
2832 	PyObject *str = PyObject_Str(obj);
2833 	const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0;
2834 	if (cstr) {
2835 	  PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received",
2836 		       type, otype, cstr);
2837           SWIG_Python_str_DelForPy3(cstr);
2838 	} else {
2839 	  PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
2840 		       type, otype);
2841 	}
2842 	Py_XDECREF(str);
2843 	return;
2844       }
2845     }
2846     PyErr_Format(PyExc_TypeError, "a '%s' is expected", type);
2847   } else {
2848     PyErr_Format(PyExc_TypeError, "unexpected type is received");
2849   }
2850 }
2851 
2852 
2853 /* Convert a pointer value, signal an exception on a type mismatch */
2854 SWIGRUNTIME void *
SWIG_Python_MustGetPtr(PyObject * obj,swig_type_info * ty,int SWIGUNUSEDPARM (argnum),int flags)2855 SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags) {
2856   void *result;
2857   if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
2858     PyErr_Clear();
2859 #if SWIG_POINTER_EXCEPTION
2860     if (flags) {
2861       SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
2862       SWIG_Python_ArgFail(argnum);
2863     }
2864 #endif
2865   }
2866   return result;
2867 }
2868 
2869 #ifdef SWIGPYTHON_BUILTIN
2870 SWIGRUNTIME int
SWIG_Python_NonDynamicSetAttr(PyObject * obj,PyObject * name,PyObject * value)2871 SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) {
2872   PyTypeObject *tp = obj->ob_type;
2873   PyObject *descr;
2874   PyObject *encoded_name;
2875   descrsetfunc f;
2876   int res = -1;
2877 
2878 # ifdef Py_USING_UNICODE
2879   if (PyString_Check(name)) {
2880     name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL);
2881     if (!name)
2882       return -1;
2883   } else if (!PyUnicode_Check(name))
2884 # else
2885   if (!PyString_Check(name))
2886 # endif
2887   {
2888     PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name);
2889     return -1;
2890   } else {
2891     Py_INCREF(name);
2892   }
2893 
2894   if (!tp->tp_dict) {
2895     if (PyType_Ready(tp) < 0)
2896       goto done;
2897   }
2898 
2899   descr = _PyType_Lookup(tp, name);
2900   f = NULL;
2901   if (descr != NULL)
2902     f = descr->ob_type->tp_descr_set;
2903   if (!f) {
2904     if (PyString_Check(name)) {
2905       encoded_name = name;
2906       Py_INCREF(name);
2907     } else {
2908       encoded_name = PyUnicode_AsUTF8String(name);
2909     }
2910     PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name));
2911     Py_DECREF(encoded_name);
2912   } else {
2913     res = f(descr, obj, value);
2914   }
2915 
2916   done:
2917   Py_DECREF(name);
2918   return res;
2919 }
2920 #endif
2921 
2922 
2923 #ifdef __cplusplus
2924 }
2925 #endif
2926 
2927 
2928 
2929 #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
2930 
2931 #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
2932 
2933 
2934 
2935   #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0)
2936 
2937 
2938 /* -------- TYPES TABLE (BEGIN) -------- */
2939 
2940 #define SWIGTYPE_p_HashCounter swig_types[0]
2941 #define SWIGTYPE_p_HashSet swig_types[1]
2942 #define SWIGTYPE_p_MerDNA swig_types[2]
2943 #define SWIGTYPE_p_QueryMerFile swig_types[3]
2944 #define SWIGTYPE_p_ReadMerFile swig_types[4]
2945 #define SWIGTYPE_p_StringMers swig_types[5]
2946 #define SWIGTYPE_p_char swig_types[6]
2947 #define SWIGTYPE_p_std__pairT_bool_uint64_t_t swig_types[7]
2948 static swig_type_info *swig_types[9];
2949 static swig_module_info swig_module = {swig_types, 8, 0, 0, 0, 0};
2950 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
2951 #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
2952 
2953 /* -------- TYPES TABLE (END) -------- */
2954 
2955 #if (PY_VERSION_HEX <= 0x02000000)
2956 # if !defined(SWIG_PYTHON_CLASSIC)
2957 #  error "This python version requires swig to be run with the '-classic' option"
2958 # endif
2959 #endif
2960 
2961 /*-----------------------------------------------
2962               @(target):= _jellyfish.so
2963   ------------------------------------------------*/
2964 #if PY_VERSION_HEX >= 0x03000000
2965 #  define SWIG_init    PyInit__jellyfish
2966 
2967 #else
2968 #  define SWIG_init    init_jellyfish
2969 
2970 #endif
2971 #define SWIG_name    "_jellyfish"
2972 
2973 #define SWIGVERSION 0x030002
2974 #define SWIG_VERSION SWIGVERSION
2975 
2976 
2977 #define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
2978 #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))
2979 
2980 
2981 #include <stdexcept>
2982 
2983 
2984 namespace swig {
2985   class SwigPtr_PyObject {
2986   protected:
2987     PyObject *_obj;
2988 
2989   public:
SwigPtr_PyObject()2990     SwigPtr_PyObject() :_obj(0)
2991     {
2992     }
2993 
SwigPtr_PyObject(const SwigPtr_PyObject & item)2994     SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj)
2995     {
2996       Py_XINCREF(_obj);
2997     }
2998 
SwigPtr_PyObject(PyObject * obj,bool initial_ref=true)2999     SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj)
3000     {
3001       if (initial_ref) {
3002         Py_XINCREF(_obj);
3003       }
3004     }
3005 
operator =(const SwigPtr_PyObject & item)3006     SwigPtr_PyObject & operator=(const SwigPtr_PyObject& item)
3007     {
3008       Py_XINCREF(item._obj);
3009       Py_XDECREF(_obj);
3010       _obj = item._obj;
3011       return *this;
3012     }
3013 
~SwigPtr_PyObject()3014     ~SwigPtr_PyObject()
3015     {
3016       Py_XDECREF(_obj);
3017     }
3018 
operator PyObject*() const3019     operator PyObject *() const
3020     {
3021       return _obj;
3022     }
3023 
operator ->() const3024     PyObject *operator->() const
3025     {
3026       return _obj;
3027     }
3028   };
3029 }
3030 
3031 
3032 namespace swig {
3033   struct SwigVar_PyObject : SwigPtr_PyObject {
SwigVar_PyObjectswig::SwigVar_PyObject3034     SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { }
3035 
operator =swig::SwigVar_PyObject3036     SwigVar_PyObject & operator = (PyObject* obj)
3037     {
3038       Py_XDECREF(_obj);
3039       _obj = obj;
3040       return *this;
3041     }
3042   };
3043 }
3044 
3045 
3046 #include <string>
3047 
3048 
3049 #include <stdexcept>
3050 
3051 
3052 #ifdef SWIGPYTHON
3053 #define SWIG_FILE_WITH_INIT
3054 #endif
3055 
3056 #ifdef SWIGPERL
3057 #undef seed
3058 #undef random
3059 #endif
3060 
3061 #include <fstream>
3062 #include <stdexcept>
3063 #undef die
3064 #include <jellyfish/mer_dna.hpp>
3065 #include <jellyfish/file_header.hpp>
3066 #include <jellyfish/mer_dna_bloom_counter.hpp>
3067 #include <jellyfish/hash_counter.hpp>
3068 #include <jellyfish/jellyfish.hpp>
3069 #undef die
3070 
3071 
3072   class MerDNA : public jellyfish::mer_dna {
3073   public:
3074     MerDNA() = default;
MerDNA(const char * s)3075     MerDNA(const char* s) : jellyfish::mer_dna(s) { }
MerDNA(const MerDNA & m)3076     MerDNA(const MerDNA& m) : jellyfish::mer_dna(m) { }
operator =(const jellyfish::mer_dna & m)3077     MerDNA& operator=(const jellyfish::mer_dna& m) { *static_cast<jellyfish::mer_dna*>(this) = m; return *this; }
3078   };
3079 
3080 
3081 SWIGINTERN swig_type_info*
SWIG_pchar_descriptor(void)3082 SWIG_pchar_descriptor(void)
3083 {
3084   static int init = 0;
3085   static swig_type_info* info = 0;
3086   if (!init) {
3087     info = SWIG_TypeQuery("_p_char");
3088     init = 1;
3089   }
3090   return info;
3091 }
3092 
3093 
3094 SWIGINTERN int
SWIG_AsCharPtrAndSize(PyObject * obj,char ** cptr,size_t * psize,int * alloc)3095 SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
3096 {
3097 #if PY_VERSION_HEX>=0x03000000
3098   if (PyUnicode_Check(obj))
3099 #else
3100   if (PyString_Check(obj))
3101 #endif
3102   {
3103     char *cstr; Py_ssize_t len;
3104 #if PY_VERSION_HEX>=0x03000000
3105     if (!alloc && cptr) {
3106         /* We can't allow converting without allocation, since the internal
3107            representation of string in Python 3 is UCS-2/UCS-4 but we require
3108            a UTF-8 representation.
3109            TODO(bhy) More detailed explanation */
3110         return SWIG_RuntimeError;
3111     }
3112     obj = PyUnicode_AsUTF8String(obj);
3113     PyBytes_AsStringAndSize(obj, &cstr, &len);
3114     if(alloc) *alloc = SWIG_NEWOBJ;
3115 #else
3116     PyString_AsStringAndSize(obj, &cstr, &len);
3117 #endif
3118     if (cptr) {
3119       if (alloc) {
3120 	/*
3121 	   In python the user should not be able to modify the inner
3122 	   string representation. To warranty that, if you define
3123 	   SWIG_PYTHON_SAFE_CSTRINGS, a new/copy of the python string
3124 	   buffer is always returned.
3125 
3126 	   The default behavior is just to return the pointer value,
3127 	   so, be careful.
3128 	*/
3129 #if defined(SWIG_PYTHON_SAFE_CSTRINGS)
3130 	if (*alloc != SWIG_OLDOBJ)
3131 #else
3132 	if (*alloc == SWIG_NEWOBJ)
3133 #endif
3134 	  {
3135 	    *cptr = reinterpret_cast< char* >(memcpy((new char[len + 1]), cstr, sizeof(char)*(len + 1)));
3136 	    *alloc = SWIG_NEWOBJ;
3137 	  }
3138 	else {
3139 	  *cptr = cstr;
3140 	  *alloc = SWIG_OLDOBJ;
3141 	}
3142       } else {
3143         #if PY_VERSION_HEX>=0x03000000
3144         assert(0); /* Should never reach here in Python 3 */
3145         #endif
3146 	*cptr = SWIG_Python_str_AsChar(obj);
3147       }
3148     }
3149     if (psize) *psize = len + 1;
3150 #if PY_VERSION_HEX>=0x03000000
3151     Py_XDECREF(obj);
3152 #endif
3153     return SWIG_OK;
3154   } else {
3155     swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
3156     if (pchar_descriptor) {
3157       void* vptr = 0;
3158       if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
3159 	if (cptr) *cptr = (char *) vptr;
3160 	if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0;
3161 	if (alloc) *alloc = SWIG_OLDOBJ;
3162 	return SWIG_OK;
3163       }
3164     }
3165   }
3166   return SWIG_TypeError;
3167 }
3168 
3169 
3170 
3171 
3172 
3173 SWIGINTERNINLINE PyObject*
SWIG_From_unsigned_SS_int(unsigned int value)3174   SWIG_From_unsigned_SS_int  (unsigned int value)
3175 {
3176   return PyInt_FromSize_t((size_t) value);
3177 }
3178 
3179 
3180 #include <limits.h>
3181 #if !defined(SWIG_NO_LLONG_MAX)
3182 # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
3183 #   define LLONG_MAX __LONG_LONG_MAX__
3184 #   define LLONG_MIN (-LLONG_MAX - 1LL)
3185 #   define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
3186 # endif
3187 #endif
3188 
3189 
3190 SWIGINTERN int
SWIG_AsVal_double(PyObject * obj,double * val)3191 SWIG_AsVal_double (PyObject *obj, double *val)
3192 {
3193   int res = SWIG_TypeError;
3194   if (PyFloat_Check(obj)) {
3195     if (val) *val = PyFloat_AsDouble(obj);
3196     return SWIG_OK;
3197   } else if (PyInt_Check(obj)) {
3198     if (val) *val = PyInt_AsLong(obj);
3199     return SWIG_OK;
3200   } else if (PyLong_Check(obj)) {
3201     double v = PyLong_AsDouble(obj);
3202     if (!PyErr_Occurred()) {
3203       if (val) *val = v;
3204       return SWIG_OK;
3205     } else {
3206       PyErr_Clear();
3207     }
3208   }
3209 #ifdef SWIG_PYTHON_CAST_MODE
3210   {
3211     int dispatch = 0;
3212     double d = PyFloat_AsDouble(obj);
3213     if (!PyErr_Occurred()) {
3214       if (val) *val = d;
3215       return SWIG_AddCast(SWIG_OK);
3216     } else {
3217       PyErr_Clear();
3218     }
3219     if (!dispatch) {
3220       long v = PyLong_AsLong(obj);
3221       if (!PyErr_Occurred()) {
3222 	if (val) *val = v;
3223 	return SWIG_AddCast(SWIG_AddCast(SWIG_OK));
3224       } else {
3225 	PyErr_Clear();
3226       }
3227     }
3228   }
3229 #endif
3230   return res;
3231 }
3232 
3233 
3234 #include <float.h>
3235 
3236 
3237 #include <math.h>
3238 
3239 
3240 SWIGINTERNINLINE int
SWIG_CanCastAsInteger(double * d,double min,double max)3241 SWIG_CanCastAsInteger(double *d, double min, double max) {
3242   double x = *d;
3243   if ((min <= x && x <= max)) {
3244    double fx = floor(x);
3245    double cx = ceil(x);
3246    double rd =  ((x - fx) < 0.5) ? fx : cx; /* simple rint */
3247    if ((errno == EDOM) || (errno == ERANGE)) {
3248      errno = 0;
3249    } else {
3250      double summ, reps, diff;
3251      if (rd < x) {
3252        diff = x - rd;
3253      } else if (rd > x) {
3254        diff = rd - x;
3255      } else {
3256        return 1;
3257      }
3258      summ = rd + x;
3259      reps = diff/summ;
3260      if (reps < 8*DBL_EPSILON) {
3261        *d = rd;
3262        return 1;
3263      }
3264    }
3265   }
3266   return 0;
3267 }
3268 
3269 
3270 SWIGINTERN int
SWIG_AsVal_unsigned_SS_long(PyObject * obj,unsigned long * val)3271 SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val)
3272 {
3273 #if PY_VERSION_HEX < 0x03000000
3274   if (PyInt_Check(obj)) {
3275     long v = PyInt_AsLong(obj);
3276     if (v >= 0) {
3277       if (val) *val = v;
3278       return SWIG_OK;
3279     } else {
3280       return SWIG_OverflowError;
3281     }
3282   } else
3283 #endif
3284   if (PyLong_Check(obj)) {
3285     unsigned long v = PyLong_AsUnsignedLong(obj);
3286     if (!PyErr_Occurred()) {
3287       if (val) *val = v;
3288       return SWIG_OK;
3289     } else {
3290       PyErr_Clear();
3291 #if PY_VERSION_HEX >= 0x03000000
3292       {
3293         long v = PyLong_AsLong(obj);
3294         if (!PyErr_Occurred()) {
3295           if (v < 0) {
3296             return SWIG_OverflowError;
3297           }
3298         } else {
3299           PyErr_Clear();
3300         }
3301       }
3302 #endif
3303     }
3304   }
3305 #ifdef SWIG_PYTHON_CAST_MODE
3306   {
3307     int dispatch = 0;
3308     unsigned long v = PyLong_AsUnsignedLong(obj);
3309     if (!PyErr_Occurred()) {
3310       if (val) *val = v;
3311       return SWIG_AddCast(SWIG_OK);
3312     } else {
3313       PyErr_Clear();
3314     }
3315     if (!dispatch) {
3316       double d;
3317       int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
3318       if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) {
3319 	if (val) *val = (unsigned long)(d);
3320 	return res;
3321       }
3322     }
3323   }
3324 #endif
3325   return SWIG_TypeError;
3326 }
3327 
3328 
3329 SWIGINTERN int
SWIG_AsVal_unsigned_SS_int(PyObject * obj,unsigned int * val)3330 SWIG_AsVal_unsigned_SS_int (PyObject * obj, unsigned int *val)
3331 {
3332   unsigned long v;
3333   int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
3334   if (SWIG_IsOK(res)) {
3335     if ((v > UINT_MAX)) {
3336       return SWIG_OverflowError;
3337     } else {
3338       if (val) *val = static_cast< unsigned int >(v);
3339     }
3340   }
3341   return res;
3342 }
3343 
3344 
3345 SWIGINTERNINLINE PyObject*
SWIG_From_bool(bool value)3346   SWIG_From_bool  (bool value)
3347 {
3348   return PyBool_FromLong(value ? 1 : 0);
3349 }
3350 
3351 
3352 SWIGINTERN int
SWIG_AsCharArray(PyObject * obj,char * val,size_t size)3353 SWIG_AsCharArray(PyObject * obj, char *val, size_t size)
3354 {
3355   char* cptr = 0; size_t csize = 0; int alloc = SWIG_OLDOBJ;
3356   int res = SWIG_AsCharPtrAndSize(obj, &cptr, &csize, &alloc);
3357   if (SWIG_IsOK(res)) {
3358     /* special case of single char conversion when we don't need space for NUL */
3359     if (size == 1 && csize == 2 && cptr && !cptr[1]) --csize;
3360     if (csize <= size) {
3361       if (val) {
3362 	if (csize) memcpy(val, cptr, csize*sizeof(char));
3363 	if (csize < size) memset(val + csize, 0, (size - csize)*sizeof(char));
3364       }
3365       if (alloc == SWIG_NEWOBJ) {
3366 	delete[] cptr;
3367 	res = SWIG_DelNewMask(res);
3368       }
3369       return res;
3370     }
3371     if (alloc == SWIG_NEWOBJ) delete[] cptr;
3372   }
3373   return SWIG_TypeError;
3374 }
3375 
3376 
3377 SWIGINTERN int
SWIG_AsVal_long(PyObject * obj,long * val)3378 SWIG_AsVal_long (PyObject *obj, long* val)
3379 {
3380   if (PyInt_Check(obj)) {
3381     if (val) *val = PyInt_AsLong(obj);
3382     return SWIG_OK;
3383   } else if (PyLong_Check(obj)) {
3384     long v = PyLong_AsLong(obj);
3385     if (!PyErr_Occurred()) {
3386       if (val) *val = v;
3387       return SWIG_OK;
3388     } else {
3389       PyErr_Clear();
3390     }
3391   }
3392 #ifdef SWIG_PYTHON_CAST_MODE
3393   {
3394     int dispatch = 0;
3395     long v = PyInt_AsLong(obj);
3396     if (!PyErr_Occurred()) {
3397       if (val) *val = v;
3398       return SWIG_AddCast(SWIG_OK);
3399     } else {
3400       PyErr_Clear();
3401     }
3402     if (!dispatch) {
3403       double d;
3404       int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
3405       if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
3406 	if (val) *val = (long)(d);
3407 	return res;
3408       }
3409     }
3410   }
3411 #endif
3412   return SWIG_TypeError;
3413 }
3414 
3415 
3416 SWIGINTERN int
SWIG_AsVal_char(PyObject * obj,char * val)3417 SWIG_AsVal_char (PyObject * obj, char *val)
3418 {
3419   int res = SWIG_AsCharArray(obj, val, 1);
3420   if (!SWIG_IsOK(res)) {
3421     long v;
3422     res = SWIG_AddCast(SWIG_AsVal_long (obj, &v));
3423     if (SWIG_IsOK(res)) {
3424       if ((CHAR_MIN <= v) && (v <= CHAR_MAX)) {
3425 	if (val) *val = static_cast< char >(v);
3426       } else {
3427 	res = SWIG_OverflowError;
3428       }
3429     }
3430   }
3431   return res;
3432 }
3433 
3434 
3435 SWIGINTERNINLINE PyObject *
SWIG_FromCharPtrAndSize(const char * carray,size_t size)3436 SWIG_FromCharPtrAndSize(const char* carray, size_t size)
3437 {
3438   if (carray) {
3439     if (size > INT_MAX) {
3440       swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
3441       return pchar_descriptor ?
3442 	SWIG_InternalNewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void();
3443     } else {
3444 #if PY_VERSION_HEX >= 0x03000000
3445 #if PY_VERSION_HEX >= 0x03010000
3446       return PyUnicode_DecodeUTF8(carray, static_cast< int >(size), "surrogateescape");
3447 #else
3448       return PyUnicode_FromStringAndSize(carray, static_cast< int >(size));
3449 #endif
3450 #else
3451       return PyString_FromStringAndSize(carray, static_cast< int >(size));
3452 #endif
3453     }
3454   } else {
3455     return SWIG_Py_Void();
3456   }
3457 }
3458 
3459 
3460 SWIGINTERNINLINE PyObject *
SWIG_From_char(char c)3461 SWIG_From_char  (char c)
3462 {
3463   return SWIG_FromCharPtrAndSize(&c,1);
3464 }
3465 
MerDNA_dup(MerDNA const * self)3466 SWIGINTERN MerDNA MerDNA_dup(MerDNA const *self){ return MerDNA(*self); }
MerDNA___str__(MerDNA * self)3467 SWIGINTERN std::string MerDNA___str__(MerDNA *self){ return self->to_str(); }
3468 
3469 SWIGINTERNINLINE PyObject *
SWIG_From_std_string(const std::string & s)3470 SWIG_From_std_string  (const std::string& s)
3471 {
3472   return SWIG_FromCharPtrAndSize(s.data(), s.size());
3473 }
3474 
MerDNA_set(MerDNA * self,char const * s)3475 SWIGINTERN void MerDNA_set(MerDNA *self,char const *s){ *static_cast<jellyfish::mer_dna*>(self) = s; }
MerDNA___getitem__(MerDNA * self,unsigned int i)3476 SWIGINTERN char MerDNA___getitem__(MerDNA *self,unsigned int i){ return (char)self->base(i); }
MerDNA___setitem__(MerDNA * self,unsigned int i,char b)3477 SWIGINTERN void MerDNA___setitem__(MerDNA *self,unsigned int i,char b){ self->base(i) = b; }
MerDNA___lshift__(MerDNA * self,char b)3478 SWIGINTERN MerDNA &MerDNA___lshift__(MerDNA *self,char b){ self->shift_left(b); return *self; }
MerDNA___rshift__(MerDNA * self,char b)3479 SWIGINTERN MerDNA &MerDNA___rshift__(MerDNA *self,char b){ self->shift_right(b); return *self; }
3480 
3481   class QueryMerFile {
3482     std::unique_ptr<jellyfish::mer_dna_bloom_filter> bf;
3483     jellyfish::mapped_file                           binary_map;
3484     std::unique_ptr<binary_query>                    jf;
3485 
3486   public:
QueryMerFile(const char * path)3487     QueryMerFile(const char* path) throw(std::runtime_error) {
3488       std::ifstream in(path);
3489       if(!in.good())
3490         throw std::runtime_error(std::string("Can't open file '") + path + "'");
3491       jellyfish::file_header header(in);
3492       jellyfish::mer_dna::k(header.key_len() / 2);
3493       if(header.format() == "bloomcounter") {
3494         jellyfish::hash_pair<jellyfish::mer_dna> fns(header.matrix(1), header.matrix(2));
3495         bf.reset(new jellyfish::mer_dna_bloom_filter(header.size(), header.nb_hashes(), in, fns));
3496         if(!in.good())
3497           throw std::runtime_error("Bloom filter file is truncated");
3498       } else if(header.format() == "binary/sorted") {
3499         binary_map.map(path);
3500         jf.reset(new binary_query(binary_map.base() + header.offset(), header.key_len(), header.counter_len(), header.matrix(),
3501                                   header.size() - 1, binary_map.length() - header.offset()));
3502       } else {
3503         throw std::runtime_error(std::string("Unsupported format '") + header.format() + "'");
3504       }
3505     }
3506 
3507 #ifdef SWIGPERL
get(const MerDNA & m)3508     unsigned int get(const MerDNA& m) { return jf ? jf->check(m) : bf->check(m); }
3509 #else
__getitem__(const MerDNA & m)3510     unsigned int __getitem__(const MerDNA& m) { return jf ? jf->check(m) : bf->check(m); }
3511 #endif
3512   };
3513 
3514 
3515   class ReadMerFile {
3516     std::ifstream                  in;
3517     std::unique_ptr<binary_reader> binary;
3518     std::unique_ptr<text_reader>   text;
3519 
next_mer__()3520     std::pair<const MerDNA*, uint64_t> next_mer__() {
3521       std::pair<const MerDNA*, uint64_t> res((const MerDNA*)0, 0);
3522       if(next_mer()) {
3523         res.first  = mer();
3524         res.second = count();
3525       }
3526       return res;
3527     }
3528 
3529   public:
ReadMerFile(const char * path)3530     ReadMerFile(const char* path) throw(std::runtime_error) :
3531       in(path)
3532     {
3533       if(!in.good())
3534         throw std::runtime_error(std::string("Can't open file '") + path + "'");
3535       jellyfish::file_header header(in);
3536       jellyfish::mer_dna::k(header.key_len() / 2);
3537       if(header.format() == binary_dumper::format)
3538         binary.reset(new binary_reader(in, &header));
3539       else if(header.format() == text_dumper::format)
3540         text.reset(new text_reader(in, &header));
3541       else
3542         throw std::runtime_error(std::string("Unsupported format '") + header.format() + "'");
3543     }
3544 
next_mer()3545     bool next_mer() {
3546       if(binary) {
3547         if(binary->next()) return true;
3548         binary.reset();
3549       } else if(text) {
3550         if(text->next()) return true;
3551         text.reset();
3552       }
3553       return false;
3554     }
3555 
mer() const3556     const MerDNA* mer() const { return static_cast<const MerDNA*>(binary ? &binary->key() : &text->key()); }
count() const3557     unsigned long count() const { return binary ? binary->val() : text->val(); }
3558 
3559 #ifdef SWIGRUBY
each()3560     void each() {
3561       if(!rb_block_given_p()) return;
3562       while(next_mer()) {
3563         auto m = SWIG_NewPointerObj(const_cast<MerDNA*>(mer()), SWIGTYPE_p_MerDNA, 0);
3564         auto c = SWIG_From_unsigned_SS_long(count());
3565         rb_yield(rb_ary_new3(2, m, c));
3566       }
3567     }
3568 #endif
3569 
3570 #ifdef SWIGPERL
each()3571     std::pair<const MerDNA*, uint64_t> each() { return next_mer__(); }
3572 #endif
3573 
3574 #ifdef SWIGPYTHON
__iter__()3575     ReadMerFile* __iter__() { return this; }
__next__()3576     std::pair<const MerDNA*, uint64_t> __next__() { return next_mer__(); }
next()3577     std::pair<const MerDNA*, uint64_t> next() { return next_mer__(); }
3578 #endif
3579   };
3580 
3581 
3582   #define SWIG_From_long   PyLong_FromLong
3583 
3584 
3585 SWIGINTERNINLINE PyObject*
SWIG_From_unsigned_SS_long(unsigned long value)3586 SWIG_From_unsigned_SS_long  (unsigned long value)
3587 {
3588   return (value > LONG_MAX) ?
3589     PyLong_FromUnsignedLong(value) : PyLong_FromLong(static_cast< long >(value));
3590 }
3591 
3592 
3593   class HashCounter : public jellyfish::cooperative::hash_counter<jellyfish::mer_dna> {
3594     typedef jellyfish::cooperative::hash_counter<jellyfish::mer_dna> super;
3595   public:
HashCounter(size_t size,unsigned int val_len,unsigned int nb_threads=1)3596     HashCounter(size_t size, unsigned int val_len, unsigned int nb_threads = 1) : \
3597     super(size, jellyfish::mer_dna::k() * 2, val_len, nb_threads)
3598       { }
3599 
add(const MerDNA & m,const int & x)3600     bool add(const MerDNA& m, const int& x) {
3601       bool res;
3602       size_t id;
3603       super::add(m, x, &res, &id);
3604       return res;
3605     }
3606 
3607   };
3608 
3609 
3610 SWIGINTERNINLINE int
SWIG_AsVal_size_t(PyObject * obj,size_t * val)3611 SWIG_AsVal_size_t (PyObject * obj, size_t *val)
3612 {
3613   unsigned long v;
3614   int res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0);
3615   if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v);
3616   return res;
3617 }
3618 
3619 
3620 SWIGINTERNINLINE PyObject *
SWIG_From_size_t(size_t value)3621 SWIG_From_size_t  (size_t value)
3622 {
3623   return SWIG_From_unsigned_SS_long  (static_cast< unsigned long >(value));
3624 }
3625 
3626 
3627 SWIGINTERN int
SWIG_AsVal_int(PyObject * obj,int * val)3628 SWIG_AsVal_int (PyObject * obj, int *val)
3629 {
3630   long v;
3631   int res = SWIG_AsVal_long (obj, &v);
3632   if (SWIG_IsOK(res)) {
3633     if ((v < INT_MIN || v > INT_MAX)) {
3634       return SWIG_OverflowError;
3635     } else {
3636       if (val) *val = static_cast< int >(v);
3637     }
3638   }
3639   return res;
3640 }
3641 
HashCounter_get(HashCounter const * self,MerDNA const & m,std::pair<bool,uint64_t> * COUNT)3642 SWIGINTERN void HashCounter_get(HashCounter const *self,MerDNA const &m,std::pair< bool,uint64_t > *COUNT){
3643       COUNT->first = self->ary()->get_val_for_key(m, &COUNT->second);
3644     }
HashCounter___getitem__(HashCounter const * self,MerDNA const & m,std::pair<bool,uint64_t> * COUNT)3645 SWIGINTERN void HashCounter___getitem__(HashCounter const *self,MerDNA const &m,std::pair< bool,uint64_t > *COUNT){
3646       COUNT->first = self->ary()->get_val_for_key(m, &COUNT->second);
3647     }
3648 
3649   class HashSet : public jellyfish::cooperative::hash_counter<jellyfish::mer_dna> {
3650     typedef jellyfish::cooperative::hash_counter<jellyfish::mer_dna> super;
3651   public:
HashSet(size_t size,unsigned int nb_threads=1)3652     HashSet(size_t size, unsigned int nb_threads = 1) : \
3653     super(size, jellyfish::mer_dna::k() * 2, 0, nb_threads)
3654       { }
3655 
add(const MerDNA & m)3656     bool add(const MerDNA& m) {
3657       bool res;
3658       size_t id;
3659       super::set(m, &res, &id);
3660       return res;
3661     }
3662   };
3663 
HashSet_get(HashSet const * self,MerDNA const & m)3664 SWIGINTERN bool HashSet_get(HashSet const *self,MerDNA const &m){ return self->ary()->has_key(m); }
HashSet___getitem__(HashSet const * self,MerDNA const & m)3665 SWIGINTERN bool HashSet___getitem__(HashSet const *self,MerDNA const &m){ return self->ary()->has_key(m); }
3666 
3667   class StringMers {
3668     const char*       m_current;
3669     const char* const m_last;
3670     const bool        m_canonical;
3671     MerDNA            m_m, m_rcm;
3672     unsigned int      m_filled;
3673 
3674   public:
StringMers(const char * str,int len,bool canonical)3675     StringMers(const char* str, int len, bool canonical)
3676       : m_current(str)
3677       , m_last(str + len)
3678       , m_canonical(canonical)
3679       , m_filled(0)
3680     { }
3681 
next_mer()3682     bool next_mer() {
3683       if(m_current == m_last)
3684         return false;
3685 
3686       do {
3687         int code = jellyfish::mer_dna::code(*m_current);
3688         ++m_current;
3689         if(code >= 0) {
3690           m_m.shift_left(code);
3691           if(m_canonical)
3692             m_rcm.shift_right(m_rcm.complement(code));
3693           m_filled = std::min(m_filled + 1, m_m.k());
3694         } else
3695           m_filled = 0;
3696       } while(m_filled < m_m.k() && m_current != m_last);
3697       return m_filled == m_m.k();
3698     }
3699 
mer() const3700     const MerDNA* mer() const { return !m_canonical || m_m < m_rcm ? &m_m : &m_rcm; }
3701 
next_mer__()3702     const MerDNA* next_mer__() {
3703       return next_mer() ? mer() : nullptr;
3704     }
3705 
3706 
3707 #ifdef SWIGRUBY
each()3708     void each() {
3709       if(!rb_block_given_p()) return;
3710       while(next_mer()) {
3711         auto m = SWIG_NewPointerObj(const_cast<MerDNA*>(mer()), SWIGTYPE_p_MerDNA, 0);
3712         rb_yield(m);
3713       }
3714     }
3715 #endif
3716 
3717 #ifdef SWIGPYTHON
__iter__()3718     StringMers* __iter__() { return this; }
__next__()3719     const MerDNA* __next__() { return next_mer__(); }
next()3720     const MerDNA* next() { return next_mer__(); }
3721 #endif
3722 
3723 #ifdef SWIGPERL
each()3724     const MerDNA* each() { return next_mer__(); }
3725 #endif
3726 
3727   };
3728 
string_mers(char * str,int length)3729   StringMers* string_mers(char* str, int length) { return new StringMers(str, length, false); }
string_canonicals(char * str,int length)3730   StringMers* string_canonicals(char* str, int length) { return new StringMers(str, length, true); }
3731 
3732 
3733 SWIGINTERN int
SWIG_AsVal_bool(PyObject * obj,bool * val)3734 SWIG_AsVal_bool (PyObject *obj, bool *val)
3735 {
3736   int r;
3737   if (!PyBool_Check(obj))
3738     return SWIG_ERROR;
3739   r = PyObject_IsTrue(obj);
3740   if (r == -1)
3741     return SWIG_ERROR;
3742   if (val) *val = r ? true : false;
3743   return SWIG_OK;
3744 }
3745 
3746 #ifdef __cplusplus
3747 extern "C" {
3748 #endif
_wrap_new_MerDNA__SWIG_0(PyObject * SWIGUNUSEDPARM (self),PyObject * args)3749 SWIGINTERN PyObject *_wrap_new_MerDNA__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3750   PyObject *resultobj = 0;
3751   MerDNA *result = 0 ;
3752 
3753   if (!PyArg_ParseTuple(args,(char *)":new_MerDNA")) SWIG_fail;
3754   result = (MerDNA *)new MerDNA();
3755   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MerDNA, SWIG_POINTER_NEW |  0 );
3756   return resultobj;
3757 fail:
3758   return NULL;
3759 }
3760 
3761 
_wrap_new_MerDNA__SWIG_1(PyObject * SWIGUNUSEDPARM (self),PyObject * args)3762 SWIGINTERN PyObject *_wrap_new_MerDNA__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3763   PyObject *resultobj = 0;
3764   char *arg1 = (char *) 0 ;
3765   int res1 ;
3766   char *buf1 = 0 ;
3767   int alloc1 = 0 ;
3768   PyObject * obj0 = 0 ;
3769   MerDNA *result = 0 ;
3770 
3771   if (!PyArg_ParseTuple(args,(char *)"O:new_MerDNA",&obj0)) SWIG_fail;
3772   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
3773   if (!SWIG_IsOK(res1)) {
3774     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_MerDNA" "', argument " "1"" of type '" "char const *""'");
3775   }
3776   arg1 = reinterpret_cast< char * >(buf1);
3777   result = (MerDNA *)new MerDNA((char const *)arg1);
3778   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MerDNA, SWIG_POINTER_NEW |  0 );
3779   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
3780   return resultobj;
3781 fail:
3782   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
3783   return NULL;
3784 }
3785 
3786 
_wrap_new_MerDNA__SWIG_2(PyObject * SWIGUNUSEDPARM (self),PyObject * args)3787 SWIGINTERN PyObject *_wrap_new_MerDNA__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3788   PyObject *resultobj = 0;
3789   MerDNA *arg1 = 0 ;
3790   void *argp1 = 0 ;
3791   int res1 = 0 ;
3792   PyObject * obj0 = 0 ;
3793   MerDNA *result = 0 ;
3794 
3795   if (!PyArg_ParseTuple(args,(char *)"O:new_MerDNA",&obj0)) SWIG_fail;
3796   res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_MerDNA,  0  | 0);
3797   if (!SWIG_IsOK(res1)) {
3798     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_MerDNA" "', argument " "1"" of type '" "MerDNA const &""'");
3799   }
3800   if (!argp1) {
3801     SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_MerDNA" "', argument " "1"" of type '" "MerDNA const &""'");
3802   }
3803   arg1 = reinterpret_cast< MerDNA * >(argp1);
3804   result = (MerDNA *)new MerDNA((MerDNA const &)*arg1);
3805   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MerDNA, SWIG_POINTER_NEW |  0 );
3806   return resultobj;
3807 fail:
3808   return NULL;
3809 }
3810 
3811 
_wrap_new_MerDNA(PyObject * self,PyObject * args)3812 SWIGINTERN PyObject *_wrap_new_MerDNA(PyObject *self, PyObject *args) {
3813   int argc;
3814   PyObject *argv[2];
3815   int ii;
3816 
3817   if (!PyTuple_Check(args)) SWIG_fail;
3818   argc = args ? (int)PyObject_Length(args) : 0;
3819   for (ii = 0; (ii < 1) && (ii < argc); ii++) {
3820     argv[ii] = PyTuple_GET_ITEM(args,ii);
3821   }
3822   if (argc == 0) {
3823     return _wrap_new_MerDNA__SWIG_0(self, args);
3824   }
3825   if (argc == 1) {
3826     int _v;
3827     int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_MerDNA, 0);
3828     _v = SWIG_CheckState(res);
3829     if (_v) {
3830       return _wrap_new_MerDNA__SWIG_2(self, args);
3831     }
3832   }
3833   if (argc == 1) {
3834     int _v;
3835     int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
3836     _v = SWIG_CheckState(res);
3837     if (_v) {
3838       return _wrap_new_MerDNA__SWIG_1(self, args);
3839     }
3840   }
3841 
3842 fail:
3843   SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_MerDNA'.\n"
3844     "  Possible C/C++ prototypes are:\n"
3845     "    MerDNA::MerDNA()\n"
3846     "    MerDNA::MerDNA(char const *)\n"
3847     "    MerDNA::MerDNA(MerDNA const &)\n");
3848   return 0;
3849 }
3850 
3851 
_wrap_MerDNA_k__SWIG_0(PyObject * SWIGUNUSEDPARM (self),PyObject * args)3852 SWIGINTERN PyObject *_wrap_MerDNA_k__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3853   PyObject *resultobj = 0;
3854   unsigned int result;
3855 
3856   if (!PyArg_ParseTuple(args,(char *)":MerDNA_k")) SWIG_fail;
3857   result = (unsigned int)MerDNA::k();
3858   resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
3859   return resultobj;
3860 fail:
3861   return NULL;
3862 }
3863 
3864 
_wrap_MerDNA_k__SWIG_1(PyObject * SWIGUNUSEDPARM (self),PyObject * args)3865 SWIGINTERN PyObject *_wrap_MerDNA_k__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3866   PyObject *resultobj = 0;
3867   unsigned int arg1 ;
3868   unsigned int val1 ;
3869   int ecode1 = 0 ;
3870   PyObject * obj0 = 0 ;
3871   unsigned int result;
3872 
3873   if (!PyArg_ParseTuple(args,(char *)"O:MerDNA_k",&obj0)) SWIG_fail;
3874   ecode1 = SWIG_AsVal_unsigned_SS_int(obj0, &val1);
3875   if (!SWIG_IsOK(ecode1)) {
3876     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "MerDNA_k" "', argument " "1"" of type '" "unsigned int""'");
3877   }
3878   arg1 = static_cast< unsigned int >(val1);
3879   result = (unsigned int)MerDNA::k(arg1);
3880   resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
3881   return resultobj;
3882 fail:
3883   return NULL;
3884 }
3885 
3886 
_wrap_MerDNA_k(PyObject * self,PyObject * args)3887 SWIGINTERN PyObject *_wrap_MerDNA_k(PyObject *self, PyObject *args) {
3888   int argc;
3889   PyObject *argv[2];
3890   int ii;
3891 
3892   if (!PyTuple_Check(args)) SWIG_fail;
3893   argc = args ? (int)PyObject_Length(args) : 0;
3894   for (ii = 0; (ii < 1) && (ii < argc); ii++) {
3895     argv[ii] = PyTuple_GET_ITEM(args,ii);
3896   }
3897   if (argc == 0) {
3898     return _wrap_MerDNA_k__SWIG_0(self, args);
3899   }
3900   if (argc == 1) {
3901     int _v;
3902     {
3903       int res = SWIG_AsVal_unsigned_SS_int(argv[0], NULL);
3904       _v = SWIG_CheckState(res);
3905     }
3906     if (_v) {
3907       return _wrap_MerDNA_k__SWIG_1(self, args);
3908     }
3909   }
3910 
3911 fail:
3912   SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'MerDNA_k'.\n"
3913     "  Possible C/C++ prototypes are:\n"
3914     "    MerDNA::k()\n"
3915     "    MerDNA::k(unsigned int)\n");
3916   return 0;
3917 }
3918 
3919 
_wrap_MerDNA_polyA(PyObject * SWIGUNUSEDPARM (self),PyObject * args)3920 SWIGINTERN PyObject *_wrap_MerDNA_polyA(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3921   PyObject *resultobj = 0;
3922   MerDNA *arg1 = (MerDNA *) 0 ;
3923   void *argp1 = 0 ;
3924   int res1 = 0 ;
3925   PyObject * obj0 = 0 ;
3926 
3927   if (!PyArg_ParseTuple(args,(char *)"O:MerDNA_polyA",&obj0)) SWIG_fail;
3928   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MerDNA, 0 |  0 );
3929   if (!SWIG_IsOK(res1)) {
3930     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA_polyA" "', argument " "1"" of type '" "MerDNA *""'");
3931   }
3932   arg1 = reinterpret_cast< MerDNA * >(argp1);
3933   (arg1)->polyA();
3934   resultobj = SWIG_Py_Void();
3935   return resultobj;
3936 fail:
3937   return NULL;
3938 }
3939 
3940 
_wrap_MerDNA_polyC(PyObject * SWIGUNUSEDPARM (self),PyObject * args)3941 SWIGINTERN PyObject *_wrap_MerDNA_polyC(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3942   PyObject *resultobj = 0;
3943   MerDNA *arg1 = (MerDNA *) 0 ;
3944   void *argp1 = 0 ;
3945   int res1 = 0 ;
3946   PyObject * obj0 = 0 ;
3947 
3948   if (!PyArg_ParseTuple(args,(char *)"O:MerDNA_polyC",&obj0)) SWIG_fail;
3949   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MerDNA, 0 |  0 );
3950   if (!SWIG_IsOK(res1)) {
3951     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA_polyC" "', argument " "1"" of type '" "MerDNA *""'");
3952   }
3953   arg1 = reinterpret_cast< MerDNA * >(argp1);
3954   (arg1)->polyC();
3955   resultobj = SWIG_Py_Void();
3956   return resultobj;
3957 fail:
3958   return NULL;
3959 }
3960 
3961 
_wrap_MerDNA_polyG(PyObject * SWIGUNUSEDPARM (self),PyObject * args)3962 SWIGINTERN PyObject *_wrap_MerDNA_polyG(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3963   PyObject *resultobj = 0;
3964   MerDNA *arg1 = (MerDNA *) 0 ;
3965   void *argp1 = 0 ;
3966   int res1 = 0 ;
3967   PyObject * obj0 = 0 ;
3968 
3969   if (!PyArg_ParseTuple(args,(char *)"O:MerDNA_polyG",&obj0)) SWIG_fail;
3970   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MerDNA, 0 |  0 );
3971   if (!SWIG_IsOK(res1)) {
3972     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA_polyG" "', argument " "1"" of type '" "MerDNA *""'");
3973   }
3974   arg1 = reinterpret_cast< MerDNA * >(argp1);
3975   (arg1)->polyG();
3976   resultobj = SWIG_Py_Void();
3977   return resultobj;
3978 fail:
3979   return NULL;
3980 }
3981 
3982 
_wrap_MerDNA_polyT(PyObject * SWIGUNUSEDPARM (self),PyObject * args)3983 SWIGINTERN PyObject *_wrap_MerDNA_polyT(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3984   PyObject *resultobj = 0;
3985   MerDNA *arg1 = (MerDNA *) 0 ;
3986   void *argp1 = 0 ;
3987   int res1 = 0 ;
3988   PyObject * obj0 = 0 ;
3989 
3990   if (!PyArg_ParseTuple(args,(char *)"O:MerDNA_polyT",&obj0)) SWIG_fail;
3991   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MerDNA, 0 |  0 );
3992   if (!SWIG_IsOK(res1)) {
3993     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA_polyT" "', argument " "1"" of type '" "MerDNA *""'");
3994   }
3995   arg1 = reinterpret_cast< MerDNA * >(argp1);
3996   (arg1)->polyT();
3997   resultobj = SWIG_Py_Void();
3998   return resultobj;
3999 fail:
4000   return NULL;
4001 }
4002 
4003 
_wrap_MerDNA_randomize(PyObject * SWIGUNUSEDPARM (self),PyObject * args)4004 SWIGINTERN PyObject *_wrap_MerDNA_randomize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4005   PyObject *resultobj = 0;
4006   MerDNA *arg1 = (MerDNA *) 0 ;
4007   void *argp1 = 0 ;
4008   int res1 = 0 ;
4009   PyObject * obj0 = 0 ;
4010 
4011   if (!PyArg_ParseTuple(args,(char *)"O:MerDNA_randomize",&obj0)) SWIG_fail;
4012   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MerDNA, 0 |  0 );
4013   if (!SWIG_IsOK(res1)) {
4014     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA_randomize" "', argument " "1"" of type '" "MerDNA *""'");
4015   }
4016   arg1 = reinterpret_cast< MerDNA * >(argp1);
4017   (arg1)->randomize();
4018   resultobj = SWIG_Py_Void();
4019   return resultobj;
4020 fail:
4021   return NULL;
4022 }
4023 
4024 
_wrap_MerDNA_is_homopolymer(PyObject * SWIGUNUSEDPARM (self),PyObject * args)4025 SWIGINTERN PyObject *_wrap_MerDNA_is_homopolymer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4026   PyObject *resultobj = 0;
4027   MerDNA *arg1 = (MerDNA *) 0 ;
4028   void *argp1 = 0 ;
4029   int res1 = 0 ;
4030   PyObject * obj0 = 0 ;
4031   bool result;
4032 
4033   if (!PyArg_ParseTuple(args,(char *)"O:MerDNA_is_homopolymer",&obj0)) SWIG_fail;
4034   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MerDNA, 0 |  0 );
4035   if (!SWIG_IsOK(res1)) {
4036     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA_is_homopolymer" "', argument " "1"" of type '" "MerDNA const *""'");
4037   }
4038   arg1 = reinterpret_cast< MerDNA * >(argp1);
4039   result = (bool)((MerDNA const *)arg1)->is_homopolymer();
4040   resultobj = SWIG_From_bool(static_cast< bool >(result));
4041   return resultobj;
4042 fail:
4043   return NULL;
4044 }
4045 
4046 
_wrap_MerDNA_shift_left(PyObject * SWIGUNUSEDPARM (self),PyObject * args)4047 SWIGINTERN PyObject *_wrap_MerDNA_shift_left(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4048   PyObject *resultobj = 0;
4049   MerDNA *arg1 = (MerDNA *) 0 ;
4050   char arg2 ;
4051   void *argp1 = 0 ;
4052   int res1 = 0 ;
4053   char val2 ;
4054   int ecode2 = 0 ;
4055   PyObject * obj0 = 0 ;
4056   PyObject * obj1 = 0 ;
4057   char result;
4058 
4059   if (!PyArg_ParseTuple(args,(char *)"OO:MerDNA_shift_left",&obj0,&obj1)) SWIG_fail;
4060   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MerDNA, 0 |  0 );
4061   if (!SWIG_IsOK(res1)) {
4062     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA_shift_left" "', argument " "1"" of type '" "MerDNA *""'");
4063   }
4064   arg1 = reinterpret_cast< MerDNA * >(argp1);
4065   ecode2 = SWIG_AsVal_char(obj1, &val2);
4066   if (!SWIG_IsOK(ecode2)) {
4067     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MerDNA_shift_left" "', argument " "2"" of type '" "char""'");
4068   }
4069   arg2 = static_cast< char >(val2);
4070   result = (char)(arg1)->shift_left(arg2);
4071   resultobj = SWIG_From_char(static_cast< char >(result));
4072   return resultobj;
4073 fail:
4074   return NULL;
4075 }
4076 
4077 
_wrap_MerDNA_shift_right(PyObject * SWIGUNUSEDPARM (self),PyObject * args)4078 SWIGINTERN PyObject *_wrap_MerDNA_shift_right(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4079   PyObject *resultobj = 0;
4080   MerDNA *arg1 = (MerDNA *) 0 ;
4081   char arg2 ;
4082   void *argp1 = 0 ;
4083   int res1 = 0 ;
4084   char val2 ;
4085   int ecode2 = 0 ;
4086   PyObject * obj0 = 0 ;
4087   PyObject * obj1 = 0 ;
4088   char result;
4089 
4090   if (!PyArg_ParseTuple(args,(char *)"OO:MerDNA_shift_right",&obj0,&obj1)) SWIG_fail;
4091   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MerDNA, 0 |  0 );
4092   if (!SWIG_IsOK(res1)) {
4093     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA_shift_right" "', argument " "1"" of type '" "MerDNA *""'");
4094   }
4095   arg1 = reinterpret_cast< MerDNA * >(argp1);
4096   ecode2 = SWIG_AsVal_char(obj1, &val2);
4097   if (!SWIG_IsOK(ecode2)) {
4098     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MerDNA_shift_right" "', argument " "2"" of type '" "char""'");
4099   }
4100   arg2 = static_cast< char >(val2);
4101   result = (char)(arg1)->shift_right(arg2);
4102   resultobj = SWIG_From_char(static_cast< char >(result));
4103   return resultobj;
4104 fail:
4105   return NULL;
4106 }
4107 
4108 
_wrap_MerDNA_canonicalize(PyObject * SWIGUNUSEDPARM (self),PyObject * args)4109 SWIGINTERN PyObject *_wrap_MerDNA_canonicalize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4110   PyObject *resultobj = 0;
4111   MerDNA *arg1 = (MerDNA *) 0 ;
4112   void *argp1 = 0 ;
4113   int res1 = 0 ;
4114   PyObject * obj0 = 0 ;
4115 
4116   if (!PyArg_ParseTuple(args,(char *)"O:MerDNA_canonicalize",&obj0)) SWIG_fail;
4117   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MerDNA, 0 |  0 );
4118   if (!SWIG_IsOK(res1)) {
4119     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA_canonicalize" "', argument " "1"" of type '" "MerDNA *""'");
4120   }
4121   arg1 = reinterpret_cast< MerDNA * >(argp1);
4122   (arg1)->canonicalize();
4123   resultobj = SWIG_Py_Void();
4124   return resultobj;
4125 fail:
4126   return NULL;
4127 }
4128 
4129 
_wrap_MerDNA_reverse_complement(PyObject * SWIGUNUSEDPARM (self),PyObject * args)4130 SWIGINTERN PyObject *_wrap_MerDNA_reverse_complement(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4131   PyObject *resultobj = 0;
4132   MerDNA *arg1 = (MerDNA *) 0 ;
4133   void *argp1 = 0 ;
4134   int res1 = 0 ;
4135   PyObject * obj0 = 0 ;
4136 
4137   if (!PyArg_ParseTuple(args,(char *)"O:MerDNA_reverse_complement",&obj0)) SWIG_fail;
4138   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MerDNA, 0 |  0 );
4139   if (!SWIG_IsOK(res1)) {
4140     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA_reverse_complement" "', argument " "1"" of type '" "MerDNA *""'");
4141   }
4142   arg1 = reinterpret_cast< MerDNA * >(argp1);
4143   (arg1)->reverse_complement();
4144   resultobj = SWIG_Py_Void();
4145   return resultobj;
4146 fail:
4147   return NULL;
4148 }
4149 
4150 
_wrap_MerDNA_get_canonical(PyObject * SWIGUNUSEDPARM (self),PyObject * args)4151 SWIGINTERN PyObject *_wrap_MerDNA_get_canonical(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4152   PyObject *resultobj = 0;
4153   MerDNA *arg1 = (MerDNA *) 0 ;
4154   void *argp1 = 0 ;
4155   int res1 = 0 ;
4156   PyObject * obj0 = 0 ;
4157   MerDNA result;
4158 
4159   if (!PyArg_ParseTuple(args,(char *)"O:MerDNA_get_canonical",&obj0)) SWIG_fail;
4160   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MerDNA, 0 |  0 );
4161   if (!SWIG_IsOK(res1)) {
4162     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA_get_canonical" "', argument " "1"" of type '" "MerDNA const *""'");
4163   }
4164   arg1 = reinterpret_cast< MerDNA * >(argp1);
4165   result = ((MerDNA const *)arg1)->get_canonical();
4166   resultobj = SWIG_NewPointerObj((new MerDNA(static_cast< const MerDNA& >(result))), SWIGTYPE_p_MerDNA, SWIG_POINTER_OWN |  0 );
4167   return resultobj;
4168 fail:
4169   return NULL;
4170 }
4171 
4172 
_wrap_MerDNA_get_reverse_complement(PyObject * SWIGUNUSEDPARM (self),PyObject * args)4173 SWIGINTERN PyObject *_wrap_MerDNA_get_reverse_complement(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4174   PyObject *resultobj = 0;
4175   MerDNA *arg1 = (MerDNA *) 0 ;
4176   void *argp1 = 0 ;
4177   int res1 = 0 ;
4178   PyObject * obj0 = 0 ;
4179   MerDNA result;
4180 
4181   if (!PyArg_ParseTuple(args,(char *)"O:MerDNA_get_reverse_complement",&obj0)) SWIG_fail;
4182   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MerDNA, 0 |  0 );
4183   if (!SWIG_IsOK(res1)) {
4184     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA_get_reverse_complement" "', argument " "1"" of type '" "MerDNA const *""'");
4185   }
4186   arg1 = reinterpret_cast< MerDNA * >(argp1);
4187   result = ((MerDNA const *)arg1)->get_reverse_complement();
4188   resultobj = SWIG_NewPointerObj((new MerDNA(static_cast< const MerDNA& >(result))), SWIGTYPE_p_MerDNA, SWIG_POINTER_OWN |  0 );
4189   return resultobj;
4190 fail:
4191   return NULL;
4192 }
4193 
4194 
_wrap_MerDNA___eq__(PyObject * SWIGUNUSEDPARM (self),PyObject * args)4195 SWIGINTERN PyObject *_wrap_MerDNA___eq__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4196   PyObject *resultobj = 0;
4197   MerDNA *arg1 = (MerDNA *) 0 ;
4198   MerDNA *arg2 = 0 ;
4199   void *argp1 = 0 ;
4200   int res1 = 0 ;
4201   void *argp2 = 0 ;
4202   int res2 = 0 ;
4203   PyObject * obj0 = 0 ;
4204   PyObject * obj1 = 0 ;
4205   bool result;
4206 
4207   if (!PyArg_ParseTuple(args,(char *)"OO:MerDNA___eq__",&obj0,&obj1)) SWIG_fail;
4208   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MerDNA, 0 |  0 );
4209   if (!SWIG_IsOK(res1)) {
4210     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA___eq__" "', argument " "1"" of type '" "MerDNA const *""'");
4211   }
4212   arg1 = reinterpret_cast< MerDNA * >(argp1);
4213   res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_MerDNA,  0  | 0);
4214   if (!SWIG_IsOK(res2)) {
4215     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MerDNA___eq__" "', argument " "2"" of type '" "MerDNA const &""'");
4216   }
4217   if (!argp2) {
4218     SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "MerDNA___eq__" "', argument " "2"" of type '" "MerDNA const &""'");
4219   }
4220   arg2 = reinterpret_cast< MerDNA * >(argp2);
4221   result = (bool)((MerDNA const *)arg1)->operator ==((MerDNA const &)*arg2);
4222   resultobj = SWIG_From_bool(static_cast< bool >(result));
4223   return resultobj;
4224 fail:
4225   return NULL;
4226 }
4227 
4228 
_wrap_MerDNA___lt__(PyObject * SWIGUNUSEDPARM (self),PyObject * args)4229 SWIGINTERN PyObject *_wrap_MerDNA___lt__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4230   PyObject *resultobj = 0;
4231   MerDNA *arg1 = (MerDNA *) 0 ;
4232   MerDNA *arg2 = 0 ;
4233   void *argp1 = 0 ;
4234   int res1 = 0 ;
4235   void *argp2 = 0 ;
4236   int res2 = 0 ;
4237   PyObject * obj0 = 0 ;
4238   PyObject * obj1 = 0 ;
4239   bool result;
4240 
4241   if (!PyArg_ParseTuple(args,(char *)"OO:MerDNA___lt__",&obj0,&obj1)) SWIG_fail;
4242   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MerDNA, 0 |  0 );
4243   if (!SWIG_IsOK(res1)) {
4244     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA___lt__" "', argument " "1"" of type '" "MerDNA const *""'");
4245   }
4246   arg1 = reinterpret_cast< MerDNA * >(argp1);
4247   res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_MerDNA,  0  | 0);
4248   if (!SWIG_IsOK(res2)) {
4249     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MerDNA___lt__" "', argument " "2"" of type '" "MerDNA const &""'");
4250   }
4251   if (!argp2) {
4252     SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "MerDNA___lt__" "', argument " "2"" of type '" "MerDNA const &""'");
4253   }
4254   arg2 = reinterpret_cast< MerDNA * >(argp2);
4255   result = (bool)((MerDNA const *)arg1)->operator <((MerDNA const &)*arg2);
4256   resultobj = SWIG_From_bool(static_cast< bool >(result));
4257   return resultobj;
4258 fail:
4259   return NULL;
4260 }
4261 
4262 
_wrap_MerDNA___gt__(PyObject * SWIGUNUSEDPARM (self),PyObject * args)4263 SWIGINTERN PyObject *_wrap_MerDNA___gt__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4264   PyObject *resultobj = 0;
4265   MerDNA *arg1 = (MerDNA *) 0 ;
4266   MerDNA *arg2 = 0 ;
4267   void *argp1 = 0 ;
4268   int res1 = 0 ;
4269   void *argp2 = 0 ;
4270   int res2 = 0 ;
4271   PyObject * obj0 = 0 ;
4272   PyObject * obj1 = 0 ;
4273   bool result;
4274 
4275   if (!PyArg_ParseTuple(args,(char *)"OO:MerDNA___gt__",&obj0,&obj1)) SWIG_fail;
4276   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MerDNA, 0 |  0 );
4277   if (!SWIG_IsOK(res1)) {
4278     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA___gt__" "', argument " "1"" of type '" "MerDNA const *""'");
4279   }
4280   arg1 = reinterpret_cast< MerDNA * >(argp1);
4281   res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_MerDNA,  0  | 0);
4282   if (!SWIG_IsOK(res2)) {
4283     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MerDNA___gt__" "', argument " "2"" of type '" "MerDNA const &""'");
4284   }
4285   if (!argp2) {
4286     SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "MerDNA___gt__" "', argument " "2"" of type '" "MerDNA const &""'");
4287   }
4288   arg2 = reinterpret_cast< MerDNA * >(argp2);
4289   result = (bool)((MerDNA const *)arg1)->operator >((MerDNA const &)*arg2);
4290   resultobj = SWIG_From_bool(static_cast< bool >(result));
4291   return resultobj;
4292 fail:
4293   return NULL;
4294 }
4295 
4296 
_wrap_MerDNA_dup(PyObject * SWIGUNUSEDPARM (self),PyObject * args)4297 SWIGINTERN PyObject *_wrap_MerDNA_dup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4298   PyObject *resultobj = 0;
4299   MerDNA *arg1 = (MerDNA *) 0 ;
4300   void *argp1 = 0 ;
4301   int res1 = 0 ;
4302   PyObject * obj0 = 0 ;
4303   MerDNA result;
4304 
4305   if (!PyArg_ParseTuple(args,(char *)"O:MerDNA_dup",&obj0)) SWIG_fail;
4306   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MerDNA, 0 |  0 );
4307   if (!SWIG_IsOK(res1)) {
4308     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA_dup" "', argument " "1"" of type '" "MerDNA const *""'");
4309   }
4310   arg1 = reinterpret_cast< MerDNA * >(argp1);
4311   result = MerDNA_dup((MerDNA const *)arg1);
4312   resultobj = SWIG_NewPointerObj((new MerDNA(static_cast< const MerDNA& >(result))), SWIGTYPE_p_MerDNA, SWIG_POINTER_OWN |  0 );
4313   return resultobj;
4314 fail:
4315   return NULL;
4316 }
4317 
4318 
_wrap_MerDNA___str__(PyObject * SWIGUNUSEDPARM (self),PyObject * args)4319 SWIGINTERN PyObject *_wrap_MerDNA___str__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4320   PyObject *resultobj = 0;
4321   MerDNA *arg1 = (MerDNA *) 0 ;
4322   void *argp1 = 0 ;
4323   int res1 = 0 ;
4324   PyObject * obj0 = 0 ;
4325   std::string result;
4326 
4327   if (!PyArg_ParseTuple(args,(char *)"O:MerDNA___str__",&obj0)) SWIG_fail;
4328   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MerDNA, 0 |  0 );
4329   if (!SWIG_IsOK(res1)) {
4330     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA___str__" "', argument " "1"" of type '" "MerDNA *""'");
4331   }
4332   arg1 = reinterpret_cast< MerDNA * >(argp1);
4333   result = MerDNA___str__(arg1);
4334   resultobj = SWIG_From_std_string(static_cast< std::string >(result));
4335   return resultobj;
4336 fail:
4337   return NULL;
4338 }
4339 
4340 
_wrap_MerDNA_set(PyObject * SWIGUNUSEDPARM (self),PyObject * args)4341 SWIGINTERN PyObject *_wrap_MerDNA_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4342   PyObject *resultobj = 0;
4343   MerDNA *arg1 = (MerDNA *) 0 ;
4344   char *arg2 = (char *) 0 ;
4345   void *argp1 = 0 ;
4346   int res1 = 0 ;
4347   int res2 ;
4348   char *buf2 = 0 ;
4349   int alloc2 = 0 ;
4350   PyObject * obj0 = 0 ;
4351   PyObject * obj1 = 0 ;
4352 
4353   if (!PyArg_ParseTuple(args,(char *)"OO:MerDNA_set",&obj0,&obj1)) SWIG_fail;
4354   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MerDNA, 0 |  0 );
4355   if (!SWIG_IsOK(res1)) {
4356     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA_set" "', argument " "1"" of type '" "MerDNA *""'");
4357   }
4358   arg1 = reinterpret_cast< MerDNA * >(argp1);
4359   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
4360   if (!SWIG_IsOK(res2)) {
4361     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MerDNA_set" "', argument " "2"" of type '" "char const *""'");
4362   }
4363   arg2 = reinterpret_cast< char * >(buf2);
4364   try {
4365     MerDNA_set(arg1,(char const *)arg2);
4366   }
4367   catch(std::length_error &_e) {
4368     SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
4369   }
4370 
4371   resultobj = SWIG_Py_Void();
4372   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
4373   return resultobj;
4374 fail:
4375   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
4376   return NULL;
4377 }
4378 
4379 
_wrap_MerDNA___getitem__(PyObject * SWIGUNUSEDPARM (self),PyObject * args)4380 SWIGINTERN PyObject *_wrap_MerDNA___getitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4381   PyObject *resultobj = 0;
4382   MerDNA *arg1 = (MerDNA *) 0 ;
4383   unsigned int arg2 ;
4384   void *argp1 = 0 ;
4385   int res1 = 0 ;
4386   unsigned int val2 ;
4387   int ecode2 = 0 ;
4388   PyObject * obj0 = 0 ;
4389   PyObject * obj1 = 0 ;
4390   char result;
4391 
4392   if (!PyArg_ParseTuple(args,(char *)"OO:MerDNA___getitem__",&obj0,&obj1)) SWIG_fail;
4393   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MerDNA, 0 |  0 );
4394   if (!SWIG_IsOK(res1)) {
4395     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA___getitem__" "', argument " "1"" of type '" "MerDNA *""'");
4396   }
4397   arg1 = reinterpret_cast< MerDNA * >(argp1);
4398   ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2);
4399   if (!SWIG_IsOK(ecode2)) {
4400     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MerDNA___getitem__" "', argument " "2"" of type '" "unsigned int""'");
4401   }
4402   arg2 = static_cast< unsigned int >(val2);
4403   result = (char)MerDNA___getitem__(arg1,arg2);
4404   resultobj = SWIG_From_char(static_cast< char >(result));
4405   return resultobj;
4406 fail:
4407   return NULL;
4408 }
4409 
4410 
_wrap_MerDNA___setitem__(PyObject * SWIGUNUSEDPARM (self),PyObject * args)4411 SWIGINTERN PyObject *_wrap_MerDNA___setitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4412   PyObject *resultobj = 0;
4413   MerDNA *arg1 = (MerDNA *) 0 ;
4414   unsigned int arg2 ;
4415   char arg3 ;
4416   void *argp1 = 0 ;
4417   int res1 = 0 ;
4418   unsigned int val2 ;
4419   int ecode2 = 0 ;
4420   char val3 ;
4421   int ecode3 = 0 ;
4422   PyObject * obj0 = 0 ;
4423   PyObject * obj1 = 0 ;
4424   PyObject * obj2 = 0 ;
4425 
4426   if (!PyArg_ParseTuple(args,(char *)"OOO:MerDNA___setitem__",&obj0,&obj1,&obj2)) SWIG_fail;
4427   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MerDNA, 0 |  0 );
4428   if (!SWIG_IsOK(res1)) {
4429     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA___setitem__" "', argument " "1"" of type '" "MerDNA *""'");
4430   }
4431   arg1 = reinterpret_cast< MerDNA * >(argp1);
4432   ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2);
4433   if (!SWIG_IsOK(ecode2)) {
4434     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MerDNA___setitem__" "', argument " "2"" of type '" "unsigned int""'");
4435   }
4436   arg2 = static_cast< unsigned int >(val2);
4437   ecode3 = SWIG_AsVal_char(obj2, &val3);
4438   if (!SWIG_IsOK(ecode3)) {
4439     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "MerDNA___setitem__" "', argument " "3"" of type '" "char""'");
4440   }
4441   arg3 = static_cast< char >(val3);
4442   MerDNA___setitem__(arg1,arg2,arg3);
4443   resultobj = SWIG_Py_Void();
4444   return resultobj;
4445 fail:
4446   return NULL;
4447 }
4448 
4449 
_wrap_MerDNA___lshift__(PyObject * SWIGUNUSEDPARM (self),PyObject * args)4450 SWIGINTERN PyObject *_wrap_MerDNA___lshift__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4451   PyObject *resultobj = 0;
4452   MerDNA *arg1 = (MerDNA *) 0 ;
4453   char arg2 ;
4454   void *argp1 = 0 ;
4455   int res1 = 0 ;
4456   char val2 ;
4457   int ecode2 = 0 ;
4458   PyObject * obj0 = 0 ;
4459   PyObject * obj1 = 0 ;
4460   MerDNA *result = 0 ;
4461 
4462   if (!PyArg_ParseTuple(args,(char *)"OO:MerDNA___lshift__",&obj0,&obj1)) SWIG_fail;
4463   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MerDNA, 0 |  0 );
4464   if (!SWIG_IsOK(res1)) {
4465     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA___lshift__" "', argument " "1"" of type '" "MerDNA *""'");
4466   }
4467   arg1 = reinterpret_cast< MerDNA * >(argp1);
4468   ecode2 = SWIG_AsVal_char(obj1, &val2);
4469   if (!SWIG_IsOK(ecode2)) {
4470     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MerDNA___lshift__" "', argument " "2"" of type '" "char""'");
4471   }
4472   arg2 = static_cast< char >(val2);
4473   result = (MerDNA *) &MerDNA___lshift__(arg1,arg2);
4474   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MerDNA, 0 |  0 );
4475   return resultobj;
4476 fail:
4477   return NULL;
4478 }
4479 
4480 
_wrap_MerDNA___rshift__(PyObject * SWIGUNUSEDPARM (self),PyObject * args)4481 SWIGINTERN PyObject *_wrap_MerDNA___rshift__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4482   PyObject *resultobj = 0;
4483   MerDNA *arg1 = (MerDNA *) 0 ;
4484   char arg2 ;
4485   void *argp1 = 0 ;
4486   int res1 = 0 ;
4487   char val2 ;
4488   int ecode2 = 0 ;
4489   PyObject * obj0 = 0 ;
4490   PyObject * obj1 = 0 ;
4491   MerDNA *result = 0 ;
4492 
4493   if (!PyArg_ParseTuple(args,(char *)"OO:MerDNA___rshift__",&obj0,&obj1)) SWIG_fail;
4494   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MerDNA, 0 |  0 );
4495   if (!SWIG_IsOK(res1)) {
4496     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA___rshift__" "', argument " "1"" of type '" "MerDNA *""'");
4497   }
4498   arg1 = reinterpret_cast< MerDNA * >(argp1);
4499   ecode2 = SWIG_AsVal_char(obj1, &val2);
4500   if (!SWIG_IsOK(ecode2)) {
4501     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MerDNA___rshift__" "', argument " "2"" of type '" "char""'");
4502   }
4503   arg2 = static_cast< char >(val2);
4504   result = (MerDNA *) &MerDNA___rshift__(arg1,arg2);
4505   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MerDNA, 0 |  0 );
4506   return resultobj;
4507 fail:
4508   return NULL;
4509 }
4510 
4511 
_wrap_delete_MerDNA(PyObject * SWIGUNUSEDPARM (self),PyObject * args)4512 SWIGINTERN PyObject *_wrap_delete_MerDNA(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4513   PyObject *resultobj = 0;
4514   MerDNA *arg1 = (MerDNA *) 0 ;
4515   void *argp1 = 0 ;
4516   int res1 = 0 ;
4517   PyObject * obj0 = 0 ;
4518 
4519   if (!PyArg_ParseTuple(args,(char *)"O:delete_MerDNA",&obj0)) SWIG_fail;
4520   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MerDNA, SWIG_POINTER_DISOWN |  0 );
4521   if (!SWIG_IsOK(res1)) {
4522     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_MerDNA" "', argument " "1"" of type '" "MerDNA *""'");
4523   }
4524   arg1 = reinterpret_cast< MerDNA * >(argp1);
4525   delete arg1;
4526   resultobj = SWIG_Py_Void();
4527   return resultobj;
4528 fail:
4529   return NULL;
4530 }
4531 
4532 
MerDNA_swigregister(PyObject * SWIGUNUSEDPARM (self),PyObject * args)4533 SWIGINTERN PyObject *MerDNA_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4534   PyObject *obj;
4535   if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
4536   SWIG_TypeNewClientData(SWIGTYPE_p_MerDNA, SWIG_NewClientData(obj));
4537   return SWIG_Py_Void();
4538 }
4539 
_wrap_new_QueryMerFile(PyObject * SWIGUNUSEDPARM (self),PyObject * args)4540 SWIGINTERN PyObject *_wrap_new_QueryMerFile(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4541   PyObject *resultobj = 0;
4542   char *arg1 = (char *) 0 ;
4543   int res1 ;
4544   char *buf1 = 0 ;
4545   int alloc1 = 0 ;
4546   PyObject * obj0 = 0 ;
4547   QueryMerFile *result = 0 ;
4548 
4549   if (!PyArg_ParseTuple(args,(char *)"O:new_QueryMerFile",&obj0)) SWIG_fail;
4550   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
4551   if (!SWIG_IsOK(res1)) {
4552     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_QueryMerFile" "', argument " "1"" of type '" "char const *""'");
4553   }
4554   arg1 = reinterpret_cast< char * >(buf1);
4555   try {
4556     result = (QueryMerFile *)new QueryMerFile((char const *)arg1);
4557   }
4558   catch(std::runtime_error &_e) {
4559     SWIG_exception_fail(SWIG_RuntimeError, (&_e)->what());
4560   }
4561 
4562   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_QueryMerFile, SWIG_POINTER_NEW |  0 );
4563   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
4564   return resultobj;
4565 fail:
4566   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
4567   return NULL;
4568 }
4569 
4570 
_wrap_QueryMerFile___getitem__(PyObject * SWIGUNUSEDPARM (self),PyObject * args)4571 SWIGINTERN PyObject *_wrap_QueryMerFile___getitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4572   PyObject *resultobj = 0;
4573   QueryMerFile *arg1 = (QueryMerFile *) 0 ;
4574   MerDNA *arg2 = 0 ;
4575   void *argp1 = 0 ;
4576   int res1 = 0 ;
4577   void *argp2 = 0 ;
4578   int res2 = 0 ;
4579   PyObject * obj0 = 0 ;
4580   PyObject * obj1 = 0 ;
4581   unsigned int result;
4582 
4583   if (!PyArg_ParseTuple(args,(char *)"OO:QueryMerFile___getitem__",&obj0,&obj1)) SWIG_fail;
4584   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QueryMerFile, 0 |  0 );
4585   if (!SWIG_IsOK(res1)) {
4586     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QueryMerFile___getitem__" "', argument " "1"" of type '" "QueryMerFile *""'");
4587   }
4588   arg1 = reinterpret_cast< QueryMerFile * >(argp1);
4589   res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_MerDNA,  0  | 0);
4590   if (!SWIG_IsOK(res2)) {
4591     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "QueryMerFile___getitem__" "', argument " "2"" of type '" "MerDNA const &""'");
4592   }
4593   if (!argp2) {
4594     SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "QueryMerFile___getitem__" "', argument " "2"" of type '" "MerDNA const &""'");
4595   }
4596   arg2 = reinterpret_cast< MerDNA * >(argp2);
4597   result = (unsigned int)(arg1)->__getitem__((MerDNA const &)*arg2);
4598   resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
4599   return resultobj;
4600 fail:
4601   return NULL;
4602 }
4603 
4604 
_wrap_delete_QueryMerFile(PyObject * SWIGUNUSEDPARM (self),PyObject * args)4605 SWIGINTERN PyObject *_wrap_delete_QueryMerFile(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4606   PyObject *resultobj = 0;
4607   QueryMerFile *arg1 = (QueryMerFile *) 0 ;
4608   void *argp1 = 0 ;
4609   int res1 = 0 ;
4610   PyObject * obj0 = 0 ;
4611 
4612   if (!PyArg_ParseTuple(args,(char *)"O:delete_QueryMerFile",&obj0)) SWIG_fail;
4613   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QueryMerFile, SWIG_POINTER_DISOWN |  0 );
4614   if (!SWIG_IsOK(res1)) {
4615     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_QueryMerFile" "', argument " "1"" of type '" "QueryMerFile *""'");
4616   }
4617   arg1 = reinterpret_cast< QueryMerFile * >(argp1);
4618   delete arg1;
4619   resultobj = SWIG_Py_Void();
4620   return resultobj;
4621 fail:
4622   return NULL;
4623 }
4624 
4625 
QueryMerFile_swigregister(PyObject * SWIGUNUSEDPARM (self),PyObject * args)4626 SWIGINTERN PyObject *QueryMerFile_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4627   PyObject *obj;
4628   if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
4629   SWIG_TypeNewClientData(SWIGTYPE_p_QueryMerFile, SWIG_NewClientData(obj));
4630   return SWIG_Py_Void();
4631 }
4632 
_wrap_new_ReadMerFile(PyObject * SWIGUNUSEDPARM (self),PyObject * args)4633 SWIGINTERN PyObject *_wrap_new_ReadMerFile(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4634   PyObject *resultobj = 0;
4635   char *arg1 = (char *) 0 ;
4636   int res1 ;
4637   char *buf1 = 0 ;
4638   int alloc1 = 0 ;
4639   PyObject * obj0 = 0 ;
4640   ReadMerFile *result = 0 ;
4641 
4642   if (!PyArg_ParseTuple(args,(char *)"O:new_ReadMerFile",&obj0)) SWIG_fail;
4643   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
4644   if (!SWIG_IsOK(res1)) {
4645     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_ReadMerFile" "', argument " "1"" of type '" "char const *""'");
4646   }
4647   arg1 = reinterpret_cast< char * >(buf1);
4648   try {
4649     result = (ReadMerFile *)new ReadMerFile((char const *)arg1);
4650   }
4651   catch(std::runtime_error &_e) {
4652     SWIG_exception_fail(SWIG_RuntimeError, (&_e)->what());
4653   }
4654 
4655   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ReadMerFile, SWIG_POINTER_NEW |  0 );
4656   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
4657   return resultobj;
4658 fail:
4659   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
4660   return NULL;
4661 }
4662 
4663 
_wrap_ReadMerFile_next_mer(PyObject * SWIGUNUSEDPARM (self),PyObject * args)4664 SWIGINTERN PyObject *_wrap_ReadMerFile_next_mer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4665   PyObject *resultobj = 0;
4666   ReadMerFile *arg1 = (ReadMerFile *) 0 ;
4667   void *argp1 = 0 ;
4668   int res1 = 0 ;
4669   PyObject * obj0 = 0 ;
4670   bool result;
4671 
4672   if (!PyArg_ParseTuple(args,(char *)"O:ReadMerFile_next_mer",&obj0)) SWIG_fail;
4673   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ReadMerFile, 0 |  0 );
4674   if (!SWIG_IsOK(res1)) {
4675     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReadMerFile_next_mer" "', argument " "1"" of type '" "ReadMerFile *""'");
4676   }
4677   arg1 = reinterpret_cast< ReadMerFile * >(argp1);
4678   result = (bool)(arg1)->next_mer();
4679   resultobj = SWIG_From_bool(static_cast< bool >(result));
4680   return resultobj;
4681 fail:
4682   return NULL;
4683 }
4684 
4685 
_wrap_ReadMerFile_mer(PyObject * SWIGUNUSEDPARM (self),PyObject * args)4686 SWIGINTERN PyObject *_wrap_ReadMerFile_mer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4687   PyObject *resultobj = 0;
4688   ReadMerFile *arg1 = (ReadMerFile *) 0 ;
4689   void *argp1 = 0 ;
4690   int res1 = 0 ;
4691   PyObject * obj0 = 0 ;
4692   MerDNA *result = 0 ;
4693 
4694   if (!PyArg_ParseTuple(args,(char *)"O:ReadMerFile_mer",&obj0)) SWIG_fail;
4695   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ReadMerFile, 0 |  0 );
4696   if (!SWIG_IsOK(res1)) {
4697     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReadMerFile_mer" "', argument " "1"" of type '" "ReadMerFile const *""'");
4698   }
4699   arg1 = reinterpret_cast< ReadMerFile * >(argp1);
4700   result = (MerDNA *)((ReadMerFile const *)arg1)->mer();
4701   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MerDNA, 0 |  0 );
4702   return resultobj;
4703 fail:
4704   return NULL;
4705 }
4706 
4707 
_wrap_ReadMerFile_count(PyObject * SWIGUNUSEDPARM (self),PyObject * args)4708 SWIGINTERN PyObject *_wrap_ReadMerFile_count(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4709   PyObject *resultobj = 0;
4710   ReadMerFile *arg1 = (ReadMerFile *) 0 ;
4711   void *argp1 = 0 ;
4712   int res1 = 0 ;
4713   PyObject * obj0 = 0 ;
4714   unsigned long result;
4715 
4716   if (!PyArg_ParseTuple(args,(char *)"O:ReadMerFile_count",&obj0)) SWIG_fail;
4717   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ReadMerFile, 0 |  0 );
4718   if (!SWIG_IsOK(res1)) {
4719     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReadMerFile_count" "', argument " "1"" of type '" "ReadMerFile const *""'");
4720   }
4721   arg1 = reinterpret_cast< ReadMerFile * >(argp1);
4722   result = (unsigned long)((ReadMerFile const *)arg1)->count();
4723   resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result));
4724   return resultobj;
4725 fail:
4726   return NULL;
4727 }
4728 
4729 
_wrap_ReadMerFile___iter__(PyObject * SWIGUNUSEDPARM (self),PyObject * args)4730 SWIGINTERN PyObject *_wrap_ReadMerFile___iter__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4731   PyObject *resultobj = 0;
4732   ReadMerFile *arg1 = (ReadMerFile *) 0 ;
4733   void *argp1 = 0 ;
4734   int res1 = 0 ;
4735   PyObject * obj0 = 0 ;
4736   ReadMerFile *result = 0 ;
4737 
4738   if (!PyArg_ParseTuple(args,(char *)"O:ReadMerFile___iter__",&obj0)) SWIG_fail;
4739   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ReadMerFile, 0 |  0 );
4740   if (!SWIG_IsOK(res1)) {
4741     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReadMerFile___iter__" "', argument " "1"" of type '" "ReadMerFile *""'");
4742   }
4743   arg1 = reinterpret_cast< ReadMerFile * >(argp1);
4744   result = (ReadMerFile *)(arg1)->__iter__();
4745   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ReadMerFile, 0 |  0 );
4746   return resultobj;
4747 fail:
4748   return NULL;
4749 }
4750 
4751 
_wrap_ReadMerFile___next__(PyObject * SWIGUNUSEDPARM (self),PyObject * args)4752 SWIGINTERN PyObject *_wrap_ReadMerFile___next__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4753   PyObject *resultobj = 0;
4754   ReadMerFile *arg1 = (ReadMerFile *) 0 ;
4755   void *argp1 = 0 ;
4756   int res1 = 0 ;
4757   PyObject * obj0 = 0 ;
4758   std::pair< MerDNA const *,uint64_t > result;
4759 
4760   if (!PyArg_ParseTuple(args,(char *)"O:ReadMerFile___next__",&obj0)) SWIG_fail;
4761   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ReadMerFile, 0 |  0 );
4762   if (!SWIG_IsOK(res1)) {
4763     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReadMerFile___next__" "', argument " "1"" of type '" "ReadMerFile *""'");
4764   }
4765   arg1 = reinterpret_cast< ReadMerFile * >(argp1);
4766   {
4767     result = (arg1)->__next__();;
4768     if(!result.first) {
4769       PyErr_SetString(PyExc_StopIteration, "Done");
4770       SWIG_fail;
4771     }
4772   }
4773   {
4774     PyObject * m = SWIG_NewPointerObj(const_cast<MerDNA*>((result).first), SWIGTYPE_p_MerDNA, 0);
4775     PyObject * c = SWIG_From_unsigned_SS_long  ((result).second);
4776     resultobj = SWIG_Python_AppendOutput(resultobj, m);
4777     resultobj = SWIG_Python_AppendOutput(resultobj, c);
4778   }
4779   return resultobj;
4780 fail:
4781   return NULL;
4782 }
4783 
4784 
_wrap_ReadMerFile_next(PyObject * SWIGUNUSEDPARM (self),PyObject * args)4785 SWIGINTERN PyObject *_wrap_ReadMerFile_next(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4786   PyObject *resultobj = 0;
4787   ReadMerFile *arg1 = (ReadMerFile *) 0 ;
4788   void *argp1 = 0 ;
4789   int res1 = 0 ;
4790   PyObject * obj0 = 0 ;
4791   std::pair< MerDNA const *,uint64_t > result;
4792 
4793   if (!PyArg_ParseTuple(args,(char *)"O:ReadMerFile_next",&obj0)) SWIG_fail;
4794   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ReadMerFile, 0 |  0 );
4795   if (!SWIG_IsOK(res1)) {
4796     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReadMerFile_next" "', argument " "1"" of type '" "ReadMerFile *""'");
4797   }
4798   arg1 = reinterpret_cast< ReadMerFile * >(argp1);
4799   {
4800     result = (arg1)->next();;
4801     if(!result.first) {
4802       PyErr_SetString(PyExc_StopIteration, "Done");
4803       SWIG_fail;
4804     }
4805   }
4806   {
4807     PyObject * m = SWIG_NewPointerObj(const_cast<MerDNA*>((result).first), SWIGTYPE_p_MerDNA, 0);
4808     PyObject * c = SWIG_From_unsigned_SS_long  ((result).second);
4809     resultobj = SWIG_Python_AppendOutput(resultobj, m);
4810     resultobj = SWIG_Python_AppendOutput(resultobj, c);
4811   }
4812   return resultobj;
4813 fail:
4814   return NULL;
4815 }
4816 
4817 
_wrap_delete_ReadMerFile(PyObject * SWIGUNUSEDPARM (self),PyObject * args)4818 SWIGINTERN PyObject *_wrap_delete_ReadMerFile(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4819   PyObject *resultobj = 0;
4820   ReadMerFile *arg1 = (ReadMerFile *) 0 ;
4821   void *argp1 = 0 ;
4822   int res1 = 0 ;
4823   PyObject * obj0 = 0 ;
4824 
4825   if (!PyArg_ParseTuple(args,(char *)"O:delete_ReadMerFile",&obj0)) SWIG_fail;
4826   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ReadMerFile, SWIG_POINTER_DISOWN |  0 );
4827   if (!SWIG_IsOK(res1)) {
4828     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ReadMerFile" "', argument " "1"" of type '" "ReadMerFile *""'");
4829   }
4830   arg1 = reinterpret_cast< ReadMerFile * >(argp1);
4831   delete arg1;
4832   resultobj = SWIG_Py_Void();
4833   return resultobj;
4834 fail:
4835   return NULL;
4836 }
4837 
4838 
ReadMerFile_swigregister(PyObject * SWIGUNUSEDPARM (self),PyObject * args)4839 SWIGINTERN PyObject *ReadMerFile_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4840   PyObject *obj;
4841   if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
4842   SWIG_TypeNewClientData(SWIGTYPE_p_ReadMerFile, SWIG_NewClientData(obj));
4843   return SWIG_Py_Void();
4844 }
4845 
_wrap_new_HashCounter__SWIG_0(PyObject * SWIGUNUSEDPARM (self),PyObject * args)4846 SWIGINTERN PyObject *_wrap_new_HashCounter__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4847   PyObject *resultobj = 0;
4848   size_t arg1 ;
4849   unsigned int arg2 ;
4850   unsigned int arg3 ;
4851   size_t val1 ;
4852   int ecode1 = 0 ;
4853   unsigned int val2 ;
4854   int ecode2 = 0 ;
4855   unsigned int val3 ;
4856   int ecode3 = 0 ;
4857   PyObject * obj0 = 0 ;
4858   PyObject * obj1 = 0 ;
4859   PyObject * obj2 = 0 ;
4860   HashCounter *result = 0 ;
4861 
4862   if (!PyArg_ParseTuple(args,(char *)"OOO:new_HashCounter",&obj0,&obj1,&obj2)) SWIG_fail;
4863   ecode1 = SWIG_AsVal_size_t(obj0, &val1);
4864   if (!SWIG_IsOK(ecode1)) {
4865     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_HashCounter" "', argument " "1"" of type '" "size_t""'");
4866   }
4867   arg1 = static_cast< size_t >(val1);
4868   ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2);
4869   if (!SWIG_IsOK(ecode2)) {
4870     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_HashCounter" "', argument " "2"" of type '" "unsigned int""'");
4871   }
4872   arg2 = static_cast< unsigned int >(val2);
4873   ecode3 = SWIG_AsVal_unsigned_SS_int(obj2, &val3);
4874   if (!SWIG_IsOK(ecode3)) {
4875     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_HashCounter" "', argument " "3"" of type '" "unsigned int""'");
4876   }
4877   arg3 = static_cast< unsigned int >(val3);
4878   result = (HashCounter *)new HashCounter(arg1,arg2,arg3);
4879   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_HashCounter, SWIG_POINTER_NEW |  0 );
4880   return resultobj;
4881 fail:
4882   return NULL;
4883 }
4884 
4885 
_wrap_new_HashCounter__SWIG_1(PyObject * SWIGUNUSEDPARM (self),PyObject * args)4886 SWIGINTERN PyObject *_wrap_new_HashCounter__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4887   PyObject *resultobj = 0;
4888   size_t arg1 ;
4889   unsigned int arg2 ;
4890   size_t val1 ;
4891   int ecode1 = 0 ;
4892   unsigned int val2 ;
4893   int ecode2 = 0 ;
4894   PyObject * obj0 = 0 ;
4895   PyObject * obj1 = 0 ;
4896   HashCounter *result = 0 ;
4897 
4898   if (!PyArg_ParseTuple(args,(char *)"OO:new_HashCounter",&obj0,&obj1)) SWIG_fail;
4899   ecode1 = SWIG_AsVal_size_t(obj0, &val1);
4900   if (!SWIG_IsOK(ecode1)) {
4901     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_HashCounter" "', argument " "1"" of type '" "size_t""'");
4902   }
4903   arg1 = static_cast< size_t >(val1);
4904   ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2);
4905   if (!SWIG_IsOK(ecode2)) {
4906     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_HashCounter" "', argument " "2"" of type '" "unsigned int""'");
4907   }
4908   arg2 = static_cast< unsigned int >(val2);
4909   result = (HashCounter *)new HashCounter(arg1,arg2);
4910   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_HashCounter, SWIG_POINTER_NEW |  0 );
4911   return resultobj;
4912 fail:
4913   return NULL;
4914 }
4915 
4916 
_wrap_new_HashCounter(PyObject * self,PyObject * args)4917 SWIGINTERN PyObject *_wrap_new_HashCounter(PyObject *self, PyObject *args) {
4918   int argc;
4919   PyObject *argv[4];
4920   int ii;
4921 
4922   if (!PyTuple_Check(args)) SWIG_fail;
4923   argc = args ? (int)PyObject_Length(args) : 0;
4924   for (ii = 0; (ii < 3) && (ii < argc); ii++) {
4925     argv[ii] = PyTuple_GET_ITEM(args,ii);
4926   }
4927   if (argc == 2) {
4928     int _v;
4929     {
4930       int res = SWIG_AsVal_size_t(argv[0], NULL);
4931       _v = SWIG_CheckState(res);
4932     }
4933     if (_v) {
4934       {
4935         int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
4936         _v = SWIG_CheckState(res);
4937       }
4938       if (_v) {
4939         return _wrap_new_HashCounter__SWIG_1(self, args);
4940       }
4941     }
4942   }
4943   if (argc == 3) {
4944     int _v;
4945     {
4946       int res = SWIG_AsVal_size_t(argv[0], NULL);
4947       _v = SWIG_CheckState(res);
4948     }
4949     if (_v) {
4950       {
4951         int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
4952         _v = SWIG_CheckState(res);
4953       }
4954       if (_v) {
4955         {
4956           int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
4957           _v = SWIG_CheckState(res);
4958         }
4959         if (_v) {
4960           return _wrap_new_HashCounter__SWIG_0(self, args);
4961         }
4962       }
4963     }
4964   }
4965 
4966 fail:
4967   SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_HashCounter'.\n"
4968     "  Possible C/C++ prototypes are:\n"
4969     "    HashCounter::HashCounter(size_t,unsigned int,unsigned int)\n"
4970     "    HashCounter::HashCounter(size_t,unsigned int)\n");
4971   return 0;
4972 }
4973 
4974 
_wrap_HashCounter_size(PyObject * SWIGUNUSEDPARM (self),PyObject * args)4975 SWIGINTERN PyObject *_wrap_HashCounter_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4976   PyObject *resultobj = 0;
4977   HashCounter *arg1 = (HashCounter *) 0 ;
4978   void *argp1 = 0 ;
4979   int res1 = 0 ;
4980   PyObject * obj0 = 0 ;
4981   size_t result;
4982 
4983   if (!PyArg_ParseTuple(args,(char *)"O:HashCounter_size",&obj0)) SWIG_fail;
4984   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_HashCounter, 0 |  0 );
4985   if (!SWIG_IsOK(res1)) {
4986     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HashCounter_size" "', argument " "1"" of type '" "HashCounter const *""'");
4987   }
4988   arg1 = reinterpret_cast< HashCounter * >(argp1);
4989   result = ((HashCounter const *)arg1)->size();
4990   resultobj = SWIG_From_size_t(static_cast< size_t >(result));
4991   return resultobj;
4992 fail:
4993   return NULL;
4994 }
4995 
4996 
_wrap_HashCounter_val_len(PyObject * SWIGUNUSEDPARM (self),PyObject * args)4997 SWIGINTERN PyObject *_wrap_HashCounter_val_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4998   PyObject *resultobj = 0;
4999   HashCounter *arg1 = (HashCounter *) 0 ;
5000   void *argp1 = 0 ;
5001   int res1 = 0 ;
5002   PyObject * obj0 = 0 ;
5003   unsigned int result;
5004 
5005   if (!PyArg_ParseTuple(args,(char *)"O:HashCounter_val_len",&obj0)) SWIG_fail;
5006   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_HashCounter, 0 |  0 );
5007   if (!SWIG_IsOK(res1)) {
5008     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HashCounter_val_len" "', argument " "1"" of type '" "HashCounter const *""'");
5009   }
5010   arg1 = reinterpret_cast< HashCounter * >(argp1);
5011   result = (unsigned int)((HashCounter const *)arg1)->val_len();
5012   resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
5013   return resultobj;
5014 fail:
5015   return NULL;
5016 }
5017 
5018 
_wrap_HashCounter_add(PyObject * SWIGUNUSEDPARM (self),PyObject * args)5019 SWIGINTERN PyObject *_wrap_HashCounter_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5020   PyObject *resultobj = 0;
5021   HashCounter *arg1 = (HashCounter *) 0 ;
5022   MerDNA *arg2 = 0 ;
5023   int *arg3 = 0 ;
5024   void *argp1 = 0 ;
5025   int res1 = 0 ;
5026   void *argp2 = 0 ;
5027   int res2 = 0 ;
5028   int temp3 ;
5029   int val3 ;
5030   int ecode3 = 0 ;
5031   PyObject * obj0 = 0 ;
5032   PyObject * obj1 = 0 ;
5033   PyObject * obj2 = 0 ;
5034   bool result;
5035 
5036   if (!PyArg_ParseTuple(args,(char *)"OOO:HashCounter_add",&obj0,&obj1,&obj2)) SWIG_fail;
5037   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_HashCounter, 0 |  0 );
5038   if (!SWIG_IsOK(res1)) {
5039     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HashCounter_add" "', argument " "1"" of type '" "HashCounter *""'");
5040   }
5041   arg1 = reinterpret_cast< HashCounter * >(argp1);
5042   res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_MerDNA,  0  | 0);
5043   if (!SWIG_IsOK(res2)) {
5044     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HashCounter_add" "', argument " "2"" of type '" "MerDNA const &""'");
5045   }
5046   if (!argp2) {
5047     SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HashCounter_add" "', argument " "2"" of type '" "MerDNA const &""'");
5048   }
5049   arg2 = reinterpret_cast< MerDNA * >(argp2);
5050   ecode3 = SWIG_AsVal_int(obj2, &val3);
5051   if (!SWIG_IsOK(ecode3)) {
5052     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HashCounter_add" "', argument " "3"" of type '" "int""'");
5053   }
5054   temp3 = static_cast< int >(val3);
5055   arg3 = &temp3;
5056   result = (bool)(arg1)->add((MerDNA const &)*arg2,(int const &)*arg3);
5057   resultobj = SWIG_From_bool(static_cast< bool >(result));
5058   return resultobj;
5059 fail:
5060   return NULL;
5061 }
5062 
5063 
_wrap_HashCounter_update_add(PyObject * SWIGUNUSEDPARM (self),PyObject * args)5064 SWIGINTERN PyObject *_wrap_HashCounter_update_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5065   PyObject *resultobj = 0;
5066   HashCounter *arg1 = (HashCounter *) 0 ;
5067   MerDNA *arg2 = 0 ;
5068   int *arg3 = 0 ;
5069   void *argp1 = 0 ;
5070   int res1 = 0 ;
5071   void *argp2 = 0 ;
5072   int res2 = 0 ;
5073   int temp3 ;
5074   int val3 ;
5075   int ecode3 = 0 ;
5076   PyObject * obj0 = 0 ;
5077   PyObject * obj1 = 0 ;
5078   PyObject * obj2 = 0 ;
5079   bool result;
5080 
5081   if (!PyArg_ParseTuple(args,(char *)"OOO:HashCounter_update_add",&obj0,&obj1,&obj2)) SWIG_fail;
5082   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_HashCounter, 0 |  0 );
5083   if (!SWIG_IsOK(res1)) {
5084     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HashCounter_update_add" "', argument " "1"" of type '" "HashCounter *""'");
5085   }
5086   arg1 = reinterpret_cast< HashCounter * >(argp1);
5087   res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_MerDNA,  0  | 0);
5088   if (!SWIG_IsOK(res2)) {
5089     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HashCounter_update_add" "', argument " "2"" of type '" "MerDNA const &""'");
5090   }
5091   if (!argp2) {
5092     SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HashCounter_update_add" "', argument " "2"" of type '" "MerDNA const &""'");
5093   }
5094   arg2 = reinterpret_cast< MerDNA * >(argp2);
5095   ecode3 = SWIG_AsVal_int(obj2, &val3);
5096   if (!SWIG_IsOK(ecode3)) {
5097     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HashCounter_update_add" "', argument " "3"" of type '" "int""'");
5098   }
5099   temp3 = static_cast< int >(val3);
5100   arg3 = &temp3;
5101   result = (bool)(arg1)->update_add((MerDNA const &)*arg2,(int const &)*arg3);
5102   resultobj = SWIG_From_bool(static_cast< bool >(result));
5103   return resultobj;
5104 fail:
5105   return NULL;
5106 }
5107 
5108 
_wrap_HashCounter_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)5109 SWIGINTERN PyObject *_wrap_HashCounter_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5110   PyObject *resultobj = 0;
5111   HashCounter *arg1 = (HashCounter *) 0 ;
5112   MerDNA *arg2 = 0 ;
5113   std::pair< bool,uint64_t > *arg3 = (std::pair< bool,uint64_t > *) 0 ;
5114   void *argp1 = 0 ;
5115   int res1 = 0 ;
5116   void *argp2 = 0 ;
5117   int res2 = 0 ;
5118   std::pair< bool,uint64_t > tmp3 ;
5119   PyObject * obj0 = 0 ;
5120   PyObject * obj1 = 0 ;
5121 
5122   {
5123     arg3 = &tmp3;
5124   }
5125   if (!PyArg_ParseTuple(args,(char *)"OO:HashCounter_get",&obj0,&obj1)) SWIG_fail;
5126   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_HashCounter, 0 |  0 );
5127   if (!SWIG_IsOK(res1)) {
5128     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HashCounter_get" "', argument " "1"" of type '" "HashCounter const *""'");
5129   }
5130   arg1 = reinterpret_cast< HashCounter * >(argp1);
5131   res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_MerDNA,  0  | 0);
5132   if (!SWIG_IsOK(res2)) {
5133     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HashCounter_get" "', argument " "2"" of type '" "MerDNA const &""'");
5134   }
5135   if (!argp2) {
5136     SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HashCounter_get" "', argument " "2"" of type '" "MerDNA const &""'");
5137   }
5138   arg2 = reinterpret_cast< MerDNA * >(argp2);
5139   HashCounter_get((HashCounter const *)arg1,(MerDNA const &)*arg2,arg3);
5140   resultobj = SWIG_Py_Void();
5141   {
5142     if((arg3)->first) {
5143       PyObject * o = SWIG_From_unsigned_SS_long  ((arg3)->second);
5144       resultobj = SWIG_Python_AppendOutput(resultobj, o);
5145     } else {
5146       resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_Py_Void());
5147     }
5148   }
5149   return resultobj;
5150 fail:
5151   return NULL;
5152 }
5153 
5154 
_wrap_HashCounter___getitem__(PyObject * SWIGUNUSEDPARM (self),PyObject * args)5155 SWIGINTERN PyObject *_wrap_HashCounter___getitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5156   PyObject *resultobj = 0;
5157   HashCounter *arg1 = (HashCounter *) 0 ;
5158   MerDNA *arg2 = 0 ;
5159   std::pair< bool,uint64_t > *arg3 = (std::pair< bool,uint64_t > *) 0 ;
5160   void *argp1 = 0 ;
5161   int res1 = 0 ;
5162   void *argp2 = 0 ;
5163   int res2 = 0 ;
5164   std::pair< bool,uint64_t > tmp3 ;
5165   PyObject * obj0 = 0 ;
5166   PyObject * obj1 = 0 ;
5167 
5168   {
5169     arg3 = &tmp3;
5170   }
5171   if (!PyArg_ParseTuple(args,(char *)"OO:HashCounter___getitem__",&obj0,&obj1)) SWIG_fail;
5172   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_HashCounter, 0 |  0 );
5173   if (!SWIG_IsOK(res1)) {
5174     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HashCounter___getitem__" "', argument " "1"" of type '" "HashCounter const *""'");
5175   }
5176   arg1 = reinterpret_cast< HashCounter * >(argp1);
5177   res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_MerDNA,  0  | 0);
5178   if (!SWIG_IsOK(res2)) {
5179     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HashCounter___getitem__" "', argument " "2"" of type '" "MerDNA const &""'");
5180   }
5181   if (!argp2) {
5182     SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HashCounter___getitem__" "', argument " "2"" of type '" "MerDNA const &""'");
5183   }
5184   arg2 = reinterpret_cast< MerDNA * >(argp2);
5185   HashCounter___getitem__((HashCounter const *)arg1,(MerDNA const &)*arg2,arg3);
5186   resultobj = SWIG_Py_Void();
5187   {
5188     if((arg3)->first) {
5189       PyObject * o = SWIG_From_unsigned_SS_long  ((arg3)->second);
5190       resultobj = SWIG_Python_AppendOutput(resultobj, o);
5191     } else {
5192       resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_Py_Void());
5193     }
5194   }
5195   return resultobj;
5196 fail:
5197   return NULL;
5198 }
5199 
5200 
_wrap_delete_HashCounter(PyObject * SWIGUNUSEDPARM (self),PyObject * args)5201 SWIGINTERN PyObject *_wrap_delete_HashCounter(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5202   PyObject *resultobj = 0;
5203   HashCounter *arg1 = (HashCounter *) 0 ;
5204   void *argp1 = 0 ;
5205   int res1 = 0 ;
5206   PyObject * obj0 = 0 ;
5207 
5208   if (!PyArg_ParseTuple(args,(char *)"O:delete_HashCounter",&obj0)) SWIG_fail;
5209   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_HashCounter, SWIG_POINTER_DISOWN |  0 );
5210   if (!SWIG_IsOK(res1)) {
5211     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_HashCounter" "', argument " "1"" of type '" "HashCounter *""'");
5212   }
5213   arg1 = reinterpret_cast< HashCounter * >(argp1);
5214   delete arg1;
5215   resultobj = SWIG_Py_Void();
5216   return resultobj;
5217 fail:
5218   return NULL;
5219 }
5220 
5221 
HashCounter_swigregister(PyObject * SWIGUNUSEDPARM (self),PyObject * args)5222 SWIGINTERN PyObject *HashCounter_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5223   PyObject *obj;
5224   if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
5225   SWIG_TypeNewClientData(SWIGTYPE_p_HashCounter, SWIG_NewClientData(obj));
5226   return SWIG_Py_Void();
5227 }
5228 
_wrap_new_HashSet__SWIG_0(PyObject * SWIGUNUSEDPARM (self),PyObject * args)5229 SWIGINTERN PyObject *_wrap_new_HashSet__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5230   PyObject *resultobj = 0;
5231   size_t arg1 ;
5232   unsigned int arg2 ;
5233   size_t val1 ;
5234   int ecode1 = 0 ;
5235   unsigned int val2 ;
5236   int ecode2 = 0 ;
5237   PyObject * obj0 = 0 ;
5238   PyObject * obj1 = 0 ;
5239   HashSet *result = 0 ;
5240 
5241   if (!PyArg_ParseTuple(args,(char *)"OO:new_HashSet",&obj0,&obj1)) SWIG_fail;
5242   ecode1 = SWIG_AsVal_size_t(obj0, &val1);
5243   if (!SWIG_IsOK(ecode1)) {
5244     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_HashSet" "', argument " "1"" of type '" "size_t""'");
5245   }
5246   arg1 = static_cast< size_t >(val1);
5247   ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2);
5248   if (!SWIG_IsOK(ecode2)) {
5249     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_HashSet" "', argument " "2"" of type '" "unsigned int""'");
5250   }
5251   arg2 = static_cast< unsigned int >(val2);
5252   result = (HashSet *)new HashSet(arg1,arg2);
5253   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_HashSet, SWIG_POINTER_NEW |  0 );
5254   return resultobj;
5255 fail:
5256   return NULL;
5257 }
5258 
5259 
_wrap_new_HashSet__SWIG_1(PyObject * SWIGUNUSEDPARM (self),PyObject * args)5260 SWIGINTERN PyObject *_wrap_new_HashSet__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5261   PyObject *resultobj = 0;
5262   size_t arg1 ;
5263   size_t val1 ;
5264   int ecode1 = 0 ;
5265   PyObject * obj0 = 0 ;
5266   HashSet *result = 0 ;
5267 
5268   if (!PyArg_ParseTuple(args,(char *)"O:new_HashSet",&obj0)) SWIG_fail;
5269   ecode1 = SWIG_AsVal_size_t(obj0, &val1);
5270   if (!SWIG_IsOK(ecode1)) {
5271     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_HashSet" "', argument " "1"" of type '" "size_t""'");
5272   }
5273   arg1 = static_cast< size_t >(val1);
5274   result = (HashSet *)new HashSet(arg1);
5275   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_HashSet, SWIG_POINTER_NEW |  0 );
5276   return resultobj;
5277 fail:
5278   return NULL;
5279 }
5280 
5281 
_wrap_new_HashSet(PyObject * self,PyObject * args)5282 SWIGINTERN PyObject *_wrap_new_HashSet(PyObject *self, PyObject *args) {
5283   int argc;
5284   PyObject *argv[3];
5285   int ii;
5286 
5287   if (!PyTuple_Check(args)) SWIG_fail;
5288   argc = args ? (int)PyObject_Length(args) : 0;
5289   for (ii = 0; (ii < 2) && (ii < argc); ii++) {
5290     argv[ii] = PyTuple_GET_ITEM(args,ii);
5291   }
5292   if (argc == 1) {
5293     int _v;
5294     {
5295       int res = SWIG_AsVal_size_t(argv[0], NULL);
5296       _v = SWIG_CheckState(res);
5297     }
5298     if (_v) {
5299       return _wrap_new_HashSet__SWIG_1(self, args);
5300     }
5301   }
5302   if (argc == 2) {
5303     int _v;
5304     {
5305       int res = SWIG_AsVal_size_t(argv[0], NULL);
5306       _v = SWIG_CheckState(res);
5307     }
5308     if (_v) {
5309       {
5310         int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
5311         _v = SWIG_CheckState(res);
5312       }
5313       if (_v) {
5314         return _wrap_new_HashSet__SWIG_0(self, args);
5315       }
5316     }
5317   }
5318 
5319 fail:
5320   SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_HashSet'.\n"
5321     "  Possible C/C++ prototypes are:\n"
5322     "    HashSet::HashSet(size_t,unsigned int)\n"
5323     "    HashSet::HashSet(size_t)\n");
5324   return 0;
5325 }
5326 
5327 
_wrap_HashSet_size(PyObject * SWIGUNUSEDPARM (self),PyObject * args)5328 SWIGINTERN PyObject *_wrap_HashSet_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5329   PyObject *resultobj = 0;
5330   HashSet *arg1 = (HashSet *) 0 ;
5331   void *argp1 = 0 ;
5332   int res1 = 0 ;
5333   PyObject * obj0 = 0 ;
5334   size_t result;
5335 
5336   if (!PyArg_ParseTuple(args,(char *)"O:HashSet_size",&obj0)) SWIG_fail;
5337   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_HashSet, 0 |  0 );
5338   if (!SWIG_IsOK(res1)) {
5339     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HashSet_size" "', argument " "1"" of type '" "HashSet const *""'");
5340   }
5341   arg1 = reinterpret_cast< HashSet * >(argp1);
5342   result = ((HashSet const *)arg1)->size();
5343   resultobj = SWIG_From_size_t(static_cast< size_t >(result));
5344   return resultobj;
5345 fail:
5346   return NULL;
5347 }
5348 
5349 
_wrap_HashSet_add(PyObject * SWIGUNUSEDPARM (self),PyObject * args)5350 SWIGINTERN PyObject *_wrap_HashSet_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5351   PyObject *resultobj = 0;
5352   HashSet *arg1 = (HashSet *) 0 ;
5353   MerDNA *arg2 = 0 ;
5354   void *argp1 = 0 ;
5355   int res1 = 0 ;
5356   void *argp2 = 0 ;
5357   int res2 = 0 ;
5358   PyObject * obj0 = 0 ;
5359   PyObject * obj1 = 0 ;
5360   bool result;
5361 
5362   if (!PyArg_ParseTuple(args,(char *)"OO:HashSet_add",&obj0,&obj1)) SWIG_fail;
5363   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_HashSet, 0 |  0 );
5364   if (!SWIG_IsOK(res1)) {
5365     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HashSet_add" "', argument " "1"" of type '" "HashSet *""'");
5366   }
5367   arg1 = reinterpret_cast< HashSet * >(argp1);
5368   res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_MerDNA,  0  | 0);
5369   if (!SWIG_IsOK(res2)) {
5370     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HashSet_add" "', argument " "2"" of type '" "MerDNA const &""'");
5371   }
5372   if (!argp2) {
5373     SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HashSet_add" "', argument " "2"" of type '" "MerDNA const &""'");
5374   }
5375   arg2 = reinterpret_cast< MerDNA * >(argp2);
5376   result = (bool)(arg1)->add((MerDNA const &)*arg2);
5377   resultobj = SWIG_From_bool(static_cast< bool >(result));
5378   return resultobj;
5379 fail:
5380   return NULL;
5381 }
5382 
5383 
_wrap_HashSet_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)5384 SWIGINTERN PyObject *_wrap_HashSet_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5385   PyObject *resultobj = 0;
5386   HashSet *arg1 = (HashSet *) 0 ;
5387   MerDNA *arg2 = 0 ;
5388   void *argp1 = 0 ;
5389   int res1 = 0 ;
5390   void *argp2 = 0 ;
5391   int res2 = 0 ;
5392   PyObject * obj0 = 0 ;
5393   PyObject * obj1 = 0 ;
5394   bool result;
5395 
5396   if (!PyArg_ParseTuple(args,(char *)"OO:HashSet_get",&obj0,&obj1)) SWIG_fail;
5397   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_HashSet, 0 |  0 );
5398   if (!SWIG_IsOK(res1)) {
5399     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HashSet_get" "', argument " "1"" of type '" "HashSet const *""'");
5400   }
5401   arg1 = reinterpret_cast< HashSet * >(argp1);
5402   res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_MerDNA,  0  | 0);
5403   if (!SWIG_IsOK(res2)) {
5404     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HashSet_get" "', argument " "2"" of type '" "MerDNA const &""'");
5405   }
5406   if (!argp2) {
5407     SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HashSet_get" "', argument " "2"" of type '" "MerDNA const &""'");
5408   }
5409   arg2 = reinterpret_cast< MerDNA * >(argp2);
5410   result = (bool)HashSet_get((HashSet const *)arg1,(MerDNA const &)*arg2);
5411   resultobj = SWIG_From_bool(static_cast< bool >(result));
5412   return resultobj;
5413 fail:
5414   return NULL;
5415 }
5416 
5417 
_wrap_HashSet___getitem__(PyObject * SWIGUNUSEDPARM (self),PyObject * args)5418 SWIGINTERN PyObject *_wrap_HashSet___getitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5419   PyObject *resultobj = 0;
5420   HashSet *arg1 = (HashSet *) 0 ;
5421   MerDNA *arg2 = 0 ;
5422   void *argp1 = 0 ;
5423   int res1 = 0 ;
5424   void *argp2 = 0 ;
5425   int res2 = 0 ;
5426   PyObject * obj0 = 0 ;
5427   PyObject * obj1 = 0 ;
5428   bool result;
5429 
5430   if (!PyArg_ParseTuple(args,(char *)"OO:HashSet___getitem__",&obj0,&obj1)) SWIG_fail;
5431   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_HashSet, 0 |  0 );
5432   if (!SWIG_IsOK(res1)) {
5433     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HashSet___getitem__" "', argument " "1"" of type '" "HashSet const *""'");
5434   }
5435   arg1 = reinterpret_cast< HashSet * >(argp1);
5436   res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_MerDNA,  0  | 0);
5437   if (!SWIG_IsOK(res2)) {
5438     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HashSet___getitem__" "', argument " "2"" of type '" "MerDNA const &""'");
5439   }
5440   if (!argp2) {
5441     SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HashSet___getitem__" "', argument " "2"" of type '" "MerDNA const &""'");
5442   }
5443   arg2 = reinterpret_cast< MerDNA * >(argp2);
5444   result = (bool)HashSet___getitem__((HashSet const *)arg1,(MerDNA const &)*arg2);
5445   resultobj = SWIG_From_bool(static_cast< bool >(result));
5446   return resultobj;
5447 fail:
5448   return NULL;
5449 }
5450 
5451 
_wrap_delete_HashSet(PyObject * SWIGUNUSEDPARM (self),PyObject * args)5452 SWIGINTERN PyObject *_wrap_delete_HashSet(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5453   PyObject *resultobj = 0;
5454   HashSet *arg1 = (HashSet *) 0 ;
5455   void *argp1 = 0 ;
5456   int res1 = 0 ;
5457   PyObject * obj0 = 0 ;
5458 
5459   if (!PyArg_ParseTuple(args,(char *)"O:delete_HashSet",&obj0)) SWIG_fail;
5460   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_HashSet, SWIG_POINTER_DISOWN |  0 );
5461   if (!SWIG_IsOK(res1)) {
5462     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_HashSet" "', argument " "1"" of type '" "HashSet *""'");
5463   }
5464   arg1 = reinterpret_cast< HashSet * >(argp1);
5465   delete arg1;
5466   resultobj = SWIG_Py_Void();
5467   return resultobj;
5468 fail:
5469   return NULL;
5470 }
5471 
5472 
HashSet_swigregister(PyObject * SWIGUNUSEDPARM (self),PyObject * args)5473 SWIGINTERN PyObject *HashSet_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5474   PyObject *obj;
5475   if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
5476   SWIG_TypeNewClientData(SWIGTYPE_p_HashSet, SWIG_NewClientData(obj));
5477   return SWIG_Py_Void();
5478 }
5479 
_wrap_string_mers(PyObject * SWIGUNUSEDPARM (self),PyObject * args)5480 SWIGINTERN PyObject *_wrap_string_mers(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5481   PyObject *resultobj = 0;
5482   char *arg1 = (char *) 0 ;
5483   int arg2 ;
5484   int res1 ;
5485   char *buf1 = 0 ;
5486   size_t size1 = 0 ;
5487   int alloc1 = 0 ;
5488   PyObject * obj0 = 0 ;
5489   StringMers *result = 0 ;
5490 
5491   if (!PyArg_ParseTuple(args,(char *)"O:string_mers",&obj0)) SWIG_fail;
5492   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, &size1, &alloc1);
5493   if (!SWIG_IsOK(res1)) {
5494     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "string_mers" "', argument " "1"" of type '" "char *""'");
5495   }
5496   arg1 = reinterpret_cast< char * >(buf1);
5497   arg2 = static_cast< int >(size1 - 1);
5498   result = (StringMers *)string_mers(arg1,arg2);
5499   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_StringMers, SWIG_POINTER_OWN |  0 );
5500   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
5501   return resultobj;
5502 fail:
5503   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
5504   return NULL;
5505 }
5506 
5507 
_wrap_string_canonicals(PyObject * SWIGUNUSEDPARM (self),PyObject * args)5508 SWIGINTERN PyObject *_wrap_string_canonicals(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5509   PyObject *resultobj = 0;
5510   char *arg1 = (char *) 0 ;
5511   int arg2 ;
5512   int res1 ;
5513   char *buf1 = 0 ;
5514   size_t size1 = 0 ;
5515   int alloc1 = 0 ;
5516   PyObject * obj0 = 0 ;
5517   StringMers *result = 0 ;
5518 
5519   if (!PyArg_ParseTuple(args,(char *)"O:string_canonicals",&obj0)) SWIG_fail;
5520   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, &size1, &alloc1);
5521   if (!SWIG_IsOK(res1)) {
5522     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "string_canonicals" "', argument " "1"" of type '" "char *""'");
5523   }
5524   arg1 = reinterpret_cast< char * >(buf1);
5525   arg2 = static_cast< int >(size1 - 1);
5526   result = (StringMers *)string_canonicals(arg1,arg2);
5527   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_StringMers, SWIG_POINTER_OWN |  0 );
5528   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
5529   return resultobj;
5530 fail:
5531   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
5532   return NULL;
5533 }
5534 
5535 
_wrap_new_StringMers(PyObject * SWIGUNUSEDPARM (self),PyObject * args)5536 SWIGINTERN PyObject *_wrap_new_StringMers(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5537   PyObject *resultobj = 0;
5538   char *arg1 = (char *) 0 ;
5539   int arg2 ;
5540   bool arg3 ;
5541   int res1 ;
5542   char *buf1 = 0 ;
5543   int alloc1 = 0 ;
5544   int val2 ;
5545   int ecode2 = 0 ;
5546   bool val3 ;
5547   int ecode3 = 0 ;
5548   PyObject * obj0 = 0 ;
5549   PyObject * obj1 = 0 ;
5550   PyObject * obj2 = 0 ;
5551   StringMers *result = 0 ;
5552 
5553   if (!PyArg_ParseTuple(args,(char *)"OOO:new_StringMers",&obj0,&obj1,&obj2)) SWIG_fail;
5554   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
5555   if (!SWIG_IsOK(res1)) {
5556     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_StringMers" "', argument " "1"" of type '" "char const *""'");
5557   }
5558   arg1 = reinterpret_cast< char * >(buf1);
5559   ecode2 = SWIG_AsVal_int(obj1, &val2);
5560   if (!SWIG_IsOK(ecode2)) {
5561     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_StringMers" "', argument " "2"" of type '" "int""'");
5562   }
5563   arg2 = static_cast< int >(val2);
5564   ecode3 = SWIG_AsVal_bool(obj2, &val3);
5565   if (!SWIG_IsOK(ecode3)) {
5566     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_StringMers" "', argument " "3"" of type '" "bool""'");
5567   }
5568   arg3 = static_cast< bool >(val3);
5569   result = (StringMers *)new StringMers((char const *)arg1,arg2,arg3);
5570   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_StringMers, SWIG_POINTER_NEW |  0 );
5571   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
5572   return resultobj;
5573 fail:
5574   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
5575   return NULL;
5576 }
5577 
5578 
_wrap_StringMers_next_mer(PyObject * SWIGUNUSEDPARM (self),PyObject * args)5579 SWIGINTERN PyObject *_wrap_StringMers_next_mer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5580   PyObject *resultobj = 0;
5581   StringMers *arg1 = (StringMers *) 0 ;
5582   void *argp1 = 0 ;
5583   int res1 = 0 ;
5584   PyObject * obj0 = 0 ;
5585   bool result;
5586 
5587   if (!PyArg_ParseTuple(args,(char *)"O:StringMers_next_mer",&obj0)) SWIG_fail;
5588   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_StringMers, 0 |  0 );
5589   if (!SWIG_IsOK(res1)) {
5590     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringMers_next_mer" "', argument " "1"" of type '" "StringMers *""'");
5591   }
5592   arg1 = reinterpret_cast< StringMers * >(argp1);
5593   result = (bool)(arg1)->next_mer();
5594   resultobj = SWIG_From_bool(static_cast< bool >(result));
5595   return resultobj;
5596 fail:
5597   return NULL;
5598 }
5599 
5600 
_wrap_StringMers_mer(PyObject * SWIGUNUSEDPARM (self),PyObject * args)5601 SWIGINTERN PyObject *_wrap_StringMers_mer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5602   PyObject *resultobj = 0;
5603   StringMers *arg1 = (StringMers *) 0 ;
5604   void *argp1 = 0 ;
5605   int res1 = 0 ;
5606   PyObject * obj0 = 0 ;
5607   MerDNA *result = 0 ;
5608 
5609   if (!PyArg_ParseTuple(args,(char *)"O:StringMers_mer",&obj0)) SWIG_fail;
5610   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_StringMers, 0 |  0 );
5611   if (!SWIG_IsOK(res1)) {
5612     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringMers_mer" "', argument " "1"" of type '" "StringMers const *""'");
5613   }
5614   arg1 = reinterpret_cast< StringMers * >(argp1);
5615   result = (MerDNA *)((StringMers const *)arg1)->mer();
5616   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MerDNA, 0 |  0 );
5617   return resultobj;
5618 fail:
5619   return NULL;
5620 }
5621 
5622 
_wrap_StringMers___iter__(PyObject * SWIGUNUSEDPARM (self),PyObject * args)5623 SWIGINTERN PyObject *_wrap_StringMers___iter__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5624   PyObject *resultobj = 0;
5625   StringMers *arg1 = (StringMers *) 0 ;
5626   void *argp1 = 0 ;
5627   int res1 = 0 ;
5628   PyObject * obj0 = 0 ;
5629   StringMers *result = 0 ;
5630 
5631   if (!PyArg_ParseTuple(args,(char *)"O:StringMers___iter__",&obj0)) SWIG_fail;
5632   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_StringMers, 0 |  0 );
5633   if (!SWIG_IsOK(res1)) {
5634     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringMers___iter__" "', argument " "1"" of type '" "StringMers *""'");
5635   }
5636   arg1 = reinterpret_cast< StringMers * >(argp1);
5637   result = (StringMers *)(arg1)->__iter__();
5638   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_StringMers, 0 |  0 );
5639   return resultobj;
5640 fail:
5641   return NULL;
5642 }
5643 
5644 
_wrap_StringMers___next__(PyObject * SWIGUNUSEDPARM (self),PyObject * args)5645 SWIGINTERN PyObject *_wrap_StringMers___next__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5646   PyObject *resultobj = 0;
5647   StringMers *arg1 = (StringMers *) 0 ;
5648   void *argp1 = 0 ;
5649   int res1 = 0 ;
5650   PyObject * obj0 = 0 ;
5651   MerDNA *result = 0 ;
5652 
5653   if (!PyArg_ParseTuple(args,(char *)"O:StringMers___next__",&obj0)) SWIG_fail;
5654   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_StringMers, 0 |  0 );
5655   if (!SWIG_IsOK(res1)) {
5656     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringMers___next__" "', argument " "1"" of type '" "StringMers *""'");
5657   }
5658   arg1 = reinterpret_cast< StringMers * >(argp1);
5659   {
5660     result = (MerDNA *)(arg1)->__next__();;
5661     if(!result) {
5662       PyErr_SetString(PyExc_StopIteration, "Done");
5663       SWIG_fail;
5664     }
5665   }
5666   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MerDNA, 0 |  0 );
5667   return resultobj;
5668 fail:
5669   return NULL;
5670 }
5671 
5672 
_wrap_StringMers_next(PyObject * SWIGUNUSEDPARM (self),PyObject * args)5673 SWIGINTERN PyObject *_wrap_StringMers_next(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5674   PyObject *resultobj = 0;
5675   StringMers *arg1 = (StringMers *) 0 ;
5676   void *argp1 = 0 ;
5677   int res1 = 0 ;
5678   PyObject * obj0 = 0 ;
5679   MerDNA *result = 0 ;
5680 
5681   if (!PyArg_ParseTuple(args,(char *)"O:StringMers_next",&obj0)) SWIG_fail;
5682   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_StringMers, 0 |  0 );
5683   if (!SWIG_IsOK(res1)) {
5684     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringMers_next" "', argument " "1"" of type '" "StringMers *""'");
5685   }
5686   arg1 = reinterpret_cast< StringMers * >(argp1);
5687   {
5688     result = (MerDNA *)(arg1)->next();;
5689     if(!result) {
5690       PyErr_SetString(PyExc_StopIteration, "Done");
5691       SWIG_fail;
5692     }
5693   }
5694   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MerDNA, 0 |  0 );
5695   return resultobj;
5696 fail:
5697   return NULL;
5698 }
5699 
5700 
_wrap_delete_StringMers(PyObject * SWIGUNUSEDPARM (self),PyObject * args)5701 SWIGINTERN PyObject *_wrap_delete_StringMers(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5702   PyObject *resultobj = 0;
5703   StringMers *arg1 = (StringMers *) 0 ;
5704   void *argp1 = 0 ;
5705   int res1 = 0 ;
5706   PyObject * obj0 = 0 ;
5707 
5708   if (!PyArg_ParseTuple(args,(char *)"O:delete_StringMers",&obj0)) SWIG_fail;
5709   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_StringMers, SWIG_POINTER_DISOWN |  0 );
5710   if (!SWIG_IsOK(res1)) {
5711     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_StringMers" "', argument " "1"" of type '" "StringMers *""'");
5712   }
5713   arg1 = reinterpret_cast< StringMers * >(argp1);
5714   delete arg1;
5715   resultobj = SWIG_Py_Void();
5716   return resultobj;
5717 fail:
5718   return NULL;
5719 }
5720 
5721 
StringMers_swigregister(PyObject * SWIGUNUSEDPARM (self),PyObject * args)5722 SWIGINTERN PyObject *StringMers_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5723   PyObject *obj;
5724   if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
5725   SWIG_TypeNewClientData(SWIGTYPE_p_StringMers, SWIG_NewClientData(obj));
5726   return SWIG_Py_Void();
5727 }
5728 
5729 static PyMethodDef SwigMethods[] = {
5730 	 { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL},
5731 	 { (char *)"new_MerDNA", _wrap_new_MerDNA, METH_VARARGS, (char *)"\n"
5732 		"Class representing a mer. All the mers have the same length, which must be set BEFORE instantiating any mers with jellyfish::MerDNA::k(int)\n"
5733 		"Class representing a mer. All the mers have the same length, which must be set BEFORE instantiating any mers with jellyfish::MerDNA::k(int)\n"
5734 		"Class representing a mer. All the mers have the same length, which must be set BEFORE instantiating any mers with jellyfish::MerDNA::k(int)\n"
5735 		""},
5736 	 { (char *)"MerDNA_k", _wrap_MerDNA_k, METH_VARARGS, (char *)"\n"
5737 		"Get the length of the k-mers\n"
5738 		"Set the length of the k-mers\n"
5739 		""},
5740 	 { (char *)"MerDNA_polyA", _wrap_MerDNA_polyA, METH_VARARGS, (char *)"Change the mer to a homopolymer of A"},
5741 	 { (char *)"MerDNA_polyC", _wrap_MerDNA_polyC, METH_VARARGS, (char *)"Change the mer to a homopolymer of C"},
5742 	 { (char *)"MerDNA_polyG", _wrap_MerDNA_polyG, METH_VARARGS, (char *)"Change the mer to a homopolymer of G"},
5743 	 { (char *)"MerDNA_polyT", _wrap_MerDNA_polyT, METH_VARARGS, (char *)"Change the mer to a homopolymer of T"},
5744 	 { (char *)"MerDNA_randomize", _wrap_MerDNA_randomize, METH_VARARGS, (char *)"Change the mer to a random one"},
5745 	 { (char *)"MerDNA_is_homopolymer", _wrap_MerDNA_is_homopolymer, METH_VARARGS, (char *)"Check if the mer is a homopolymer"},
5746 	 { (char *)"MerDNA_shift_left", _wrap_MerDNA_shift_left, METH_VARARGS, (char *)"Shift a base to the left and the leftmost base is return . \"ACGT\", shift_left('A') becomes \"CGTA\" and 'A' is returned"},
5747 	 { (char *)"MerDNA_shift_right", _wrap_MerDNA_shift_right, METH_VARARGS, (char *)"Shift a base to the right and the rightmost base is return . \"ACGT\", shift_right('A') becomes \"AACG\" and 'T' is returned"},
5748 	 { (char *)"MerDNA_canonicalize", _wrap_MerDNA_canonicalize, METH_VARARGS, (char *)"Change the mer to its canonical representation"},
5749 	 { (char *)"MerDNA_reverse_complement", _wrap_MerDNA_reverse_complement, METH_VARARGS, (char *)"Change the mer to its reverse complement"},
5750 	 { (char *)"MerDNA_get_canonical", _wrap_MerDNA_get_canonical, METH_VARARGS, (char *)"Return canonical representation of the mer"},
5751 	 { (char *)"MerDNA_get_reverse_complement", _wrap_MerDNA_get_reverse_complement, METH_VARARGS, (char *)"Return the reverse complement of the mer"},
5752 	 { (char *)"MerDNA___eq__", _wrap_MerDNA___eq__, METH_VARARGS, (char *)"Equality between mers"},
5753 	 { (char *)"MerDNA___lt__", _wrap_MerDNA___lt__, METH_VARARGS, (char *)"Lexicographic less-than"},
5754 	 { (char *)"MerDNA___gt__", _wrap_MerDNA___gt__, METH_VARARGS, (char *)"Lexicographic greater-than"},
5755 	 { (char *)"MerDNA_dup", _wrap_MerDNA_dup, METH_VARARGS, (char *)"Duplicate the mer"},
5756 	 { (char *)"MerDNA___str__", _wrap_MerDNA___str__, METH_VARARGS, (char *)"Return string representation of the mer"},
5757 	 { (char *)"MerDNA_set", _wrap_MerDNA_set, METH_VARARGS, (char *)"Set the mer from a string"},
5758 	 { (char *)"MerDNA___getitem__", _wrap_MerDNA___getitem__, METH_VARARGS, (char *)"Get base i (0 <= i < k)"},
5759 	 { (char *)"MerDNA___setitem__", _wrap_MerDNA___setitem__, METH_VARARGS, (char *)"Set base i (0 <= i < k)"},
5760 	 { (char *)"MerDNA___lshift__", _wrap_MerDNA___lshift__, METH_VARARGS, (char *)"Shift a base to the left and return the mer"},
5761 	 { (char *)"MerDNA___rshift__", _wrap_MerDNA___rshift__, METH_VARARGS, (char *)"Shift a base to the right and return the mer"},
5762 	 { (char *)"delete_MerDNA", _wrap_delete_MerDNA, METH_VARARGS, (char *)"Shift a base to the right and return the mer"},
5763 	 { (char *)"MerDNA_swigregister", MerDNA_swigregister, METH_VARARGS, NULL},
5764 	 { (char *)"new_QueryMerFile", _wrap_new_QueryMerFile, METH_VARARGS, (char *)"Open the jellyfish database"},
5765 	 { (char *)"QueryMerFile___getitem__", _wrap_QueryMerFile___getitem__, METH_VARARGS, (char *)"Get the count for the mer m"},
5766 	 { (char *)"delete_QueryMerFile", _wrap_delete_QueryMerFile, METH_VARARGS, (char *)"Get the count for the mer m"},
5767 	 { (char *)"QueryMerFile_swigregister", QueryMerFile_swigregister, METH_VARARGS, NULL},
5768 	 { (char *)"new_ReadMerFile", _wrap_new_ReadMerFile, METH_VARARGS, (char *)"Open the jellyfish database"},
5769 	 { (char *)"ReadMerFile_next_mer", _wrap_ReadMerFile_next_mer, METH_VARARGS, (char *)"Move to the next mer in the file. Returns false if no mers left, true otherwise"},
5770 	 { (char *)"ReadMerFile_mer", _wrap_ReadMerFile_mer, METH_VARARGS, (char *)"Returns current mer"},
5771 	 { (char *)"ReadMerFile_count", _wrap_ReadMerFile_count, METH_VARARGS, (char *)"Returns the count of the current mer"},
5772 	 { (char *)"ReadMerFile___iter__", _wrap_ReadMerFile___iter__, METH_VARARGS, (char *)"Iterate through all the mers in the file, passing two values: a mer and its count"},
5773 	 { (char *)"ReadMerFile___next__", _wrap_ReadMerFile___next__, METH_VARARGS, (char *)"Iterate through all the mers in the file, passing two values: a mer and its count"},
5774 	 { (char *)"ReadMerFile_next", _wrap_ReadMerFile_next, METH_VARARGS, (char *)"Iterate through all the mers in the file, passing two values: a mer and its count"},
5775 	 { (char *)"delete_ReadMerFile", _wrap_delete_ReadMerFile, METH_VARARGS, (char *)"Iterate through all the mers in the file, passing two values: a mer and its count"},
5776 	 { (char *)"ReadMerFile_swigregister", ReadMerFile_swigregister, METH_VARARGS, NULL},
5777 	 { (char *)"new_HashCounter", _wrap_new_HashCounter, METH_VARARGS, (char *)"\n"
5778 		"Read a Jellyfish database sequentially\n"
5779 		"Read a Jellyfish database sequentially\n"
5780 		""},
5781 	 { (char *)"HashCounter_size", _wrap_HashCounter_size, METH_VARARGS, (char *)"Read a Jellyfish database sequentially"},
5782 	 { (char *)"HashCounter_val_len", _wrap_HashCounter_val_len, METH_VARARGS, (char *)"Read a Jellyfish database sequentially"},
5783 	 { (char *)"HashCounter_add", _wrap_HashCounter_add, METH_VARARGS, (char *)"Read a Jellyfish database sequentially"},
5784 	 { (char *)"HashCounter_update_add", _wrap_HashCounter_update_add, METH_VARARGS, (char *)"Read a Jellyfish database sequentially"},
5785 	 { (char *)"HashCounter_get", _wrap_HashCounter_get, METH_VARARGS, (char *)"Read a Jellyfish database sequentially"},
5786 	 { (char *)"HashCounter___getitem__", _wrap_HashCounter___getitem__, METH_VARARGS, (char *)"Read a Jellyfish database sequentially"},
5787 	 { (char *)"delete_HashCounter", _wrap_delete_HashCounter, METH_VARARGS, (char *)"Extract k-mers from a sequence string"},
5788 	 { (char *)"HashCounter_swigregister", HashCounter_swigregister, METH_VARARGS, NULL},
5789 	 { (char *)"new_HashSet", _wrap_new_HashSet, METH_VARARGS, (char *)"\n"
5790 		"Read a Jellyfish database sequentially\n"
5791 		"Read a Jellyfish database sequentially\n"
5792 		""},
5793 	 { (char *)"HashSet_size", _wrap_HashSet_size, METH_VARARGS, (char *)"Read a Jellyfish database sequentially"},
5794 	 { (char *)"HashSet_add", _wrap_HashSet_add, METH_VARARGS, (char *)"Read a Jellyfish database sequentially"},
5795 	 { (char *)"HashSet_get", _wrap_HashSet_get, METH_VARARGS, (char *)"Read a Jellyfish database sequentially"},
5796 	 { (char *)"HashSet___getitem__", _wrap_HashSet___getitem__, METH_VARARGS, (char *)"Read a Jellyfish database sequentially"},
5797 	 { (char *)"delete_HashSet", _wrap_delete_HashSet, METH_VARARGS, (char *)"Extract k-mers from a sequence string"},
5798 	 { (char *)"HashSet_swigregister", HashSet_swigregister, METH_VARARGS, NULL},
5799 	 { (char *)"string_mers", _wrap_string_mers, METH_VARARGS, (char *)"Get an iterator to the mers in the string"},
5800 	 { (char *)"string_canonicals", _wrap_string_canonicals, METH_VARARGS, (char *)"Get an iterator to the canonical mers in the string"},
5801 	 { (char *)"new_StringMers", _wrap_new_StringMers, METH_VARARGS, (char *)"Create a k-mers parser from a string. Pass true as a second argument to get canonical mers"},
5802 	 { (char *)"StringMers_next_mer", _wrap_StringMers_next_mer, METH_VARARGS, (char *)"Get the next mer. Return false if reached the end of the string."},
5803 	 { (char *)"StringMers_mer", _wrap_StringMers_mer, METH_VARARGS, (char *)"Return the current mer (or its canonical representation)"},
5804 	 { (char *)"StringMers___iter__", _wrap_StringMers___iter__, METH_VARARGS, (char *)"Return the current mer (or its canonical representation)"},
5805 	 { (char *)"StringMers___next__", _wrap_StringMers___next__, METH_VARARGS, (char *)"Return the current mer (or its canonical representation)"},
5806 	 { (char *)"StringMers_next", _wrap_StringMers_next, METH_VARARGS, (char *)"Return the current mer (or its canonical representation)"},
5807 	 { (char *)"delete_StringMers", _wrap_delete_StringMers, METH_VARARGS, (char *)"Return the current mer (or its canonical representation)"},
5808 	 { (char *)"StringMers_swigregister", StringMers_swigregister, METH_VARARGS, NULL},
5809 	 { NULL, NULL, 0, NULL }
5810 };
5811 
5812 
5813 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
5814 
5815 static swig_type_info _swigt__p_HashCounter = {"_p_HashCounter", "HashCounter *", 0, 0, (void*)0, 0};
5816 static swig_type_info _swigt__p_HashSet = {"_p_HashSet", "HashSet *", 0, 0, (void*)0, 0};
5817 static swig_type_info _swigt__p_MerDNA = {"_p_MerDNA", "MerDNA *", 0, 0, (void*)0, 0};
5818 static swig_type_info _swigt__p_QueryMerFile = {"_p_QueryMerFile", "QueryMerFile *", 0, 0, (void*)0, 0};
5819 static swig_type_info _swigt__p_ReadMerFile = {"_p_ReadMerFile", "ReadMerFile *", 0, 0, (void*)0, 0};
5820 static swig_type_info _swigt__p_StringMers = {"_p_StringMers", "StringMers *", 0, 0, (void*)0, 0};
5821 static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
5822 static swig_type_info _swigt__p_std__pairT_bool_uint64_t_t = {"_p_std__pairT_bool_uint64_t_t", "std::pair< bool,uint64_t > *", 0, 0, (void*)0, 0};
5823 
5824 static swig_type_info *swig_type_initial[] = {
5825   &_swigt__p_HashCounter,
5826   &_swigt__p_HashSet,
5827   &_swigt__p_MerDNA,
5828   &_swigt__p_QueryMerFile,
5829   &_swigt__p_ReadMerFile,
5830   &_swigt__p_StringMers,
5831   &_swigt__p_char,
5832   &_swigt__p_std__pairT_bool_uint64_t_t,
5833 };
5834 
5835 static swig_cast_info _swigc__p_HashCounter[] = {  {&_swigt__p_HashCounter, 0, 0, 0},{0, 0, 0, 0}};
5836 static swig_cast_info _swigc__p_HashSet[] = {  {&_swigt__p_HashSet, 0, 0, 0},{0, 0, 0, 0}};
5837 static swig_cast_info _swigc__p_MerDNA[] = {  {&_swigt__p_MerDNA, 0, 0, 0},{0, 0, 0, 0}};
5838 static swig_cast_info _swigc__p_QueryMerFile[] = {  {&_swigt__p_QueryMerFile, 0, 0, 0},{0, 0, 0, 0}};
5839 static swig_cast_info _swigc__p_ReadMerFile[] = {  {&_swigt__p_ReadMerFile, 0, 0, 0},{0, 0, 0, 0}};
5840 static swig_cast_info _swigc__p_StringMers[] = {  {&_swigt__p_StringMers, 0, 0, 0},{0, 0, 0, 0}};
5841 static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
5842 static swig_cast_info _swigc__p_std__pairT_bool_uint64_t_t[] = {  {&_swigt__p_std__pairT_bool_uint64_t_t, 0, 0, 0},{0, 0, 0, 0}};
5843 
5844 static swig_cast_info *swig_cast_initial[] = {
5845   _swigc__p_HashCounter,
5846   _swigc__p_HashSet,
5847   _swigc__p_MerDNA,
5848   _swigc__p_QueryMerFile,
5849   _swigc__p_ReadMerFile,
5850   _swigc__p_StringMers,
5851   _swigc__p_char,
5852   _swigc__p_std__pairT_bool_uint64_t_t,
5853 };
5854 
5855 
5856 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
5857 
5858 static swig_const_info swig_const_table[] = {
5859 {0, 0, 0, 0.0, 0, 0}};
5860 
5861 #ifdef __cplusplus
5862 }
5863 #endif
5864 /* -----------------------------------------------------------------------------
5865  * Type initialization:
5866  * This problem is tough by the requirement that no dynamic
5867  * memory is used. Also, since swig_type_info structures store pointers to
5868  * swig_cast_info structures and swig_cast_info structures store pointers back
5869  * to swig_type_info structures, we need some lookup code at initialization.
5870  * The idea is that swig generates all the structures that are needed.
5871  * The runtime then collects these partially filled structures.
5872  * The SWIG_InitializeModule function takes these initial arrays out of
5873  * swig_module, and does all the lookup, filling in the swig_module.types
5874  * array with the correct data and linking the correct swig_cast_info
5875  * structures together.
5876  *
5877  * The generated swig_type_info structures are assigned statically to an initial
5878  * array. We just loop through that array, and handle each type individually.
5879  * First we lookup if this type has been already loaded, and if so, use the
5880  * loaded structure instead of the generated one. Then we have to fill in the
5881  * cast linked list. The cast data is initially stored in something like a
5882  * two-dimensional array. Each row corresponds to a type (there are the same
5883  * number of rows as there are in the swig_type_initial array). Each entry in
5884  * a column is one of the swig_cast_info structures for that type.
5885  * The cast_initial array is actually an array of arrays, because each row has
5886  * a variable number of columns. So to actually build the cast linked list,
5887  * we find the array of casts associated with the type, and loop through it
5888  * adding the casts to the list. The one last trick we need to do is making
5889  * sure the type pointer in the swig_cast_info struct is correct.
5890  *
5891  * First off, we lookup the cast->type name to see if it is already loaded.
5892  * There are three cases to handle:
5893  *  1) If the cast->type has already been loaded AND the type we are adding
5894  *     casting info to has not been loaded (it is in this module), THEN we
5895  *     replace the cast->type pointer with the type pointer that has already
5896  *     been loaded.
5897  *  2) If BOTH types (the one we are adding casting info to, and the
5898  *     cast->type) are loaded, THEN the cast info has already been loaded by
5899  *     the previous module so we just ignore it.
5900  *  3) Finally, if cast->type has not already been loaded, then we add that
5901  *     swig_cast_info to the linked list (because the cast->type) pointer will
5902  *     be correct.
5903  * ----------------------------------------------------------------------------- */
5904 
5905 #ifdef __cplusplus
5906 extern "C" {
5907 #if 0
5908 } /* c-mode */
5909 #endif
5910 #endif
5911 
5912 #if 0
5913 #define SWIGRUNTIME_DEBUG
5914 #endif
5915 
5916 
5917 SWIGRUNTIME void
SWIG_InitializeModule(void * clientdata)5918 SWIG_InitializeModule(void *clientdata) {
5919   size_t i;
5920   swig_module_info *module_head, *iter;
5921   int found, init;
5922 
5923   /* check to see if the circular list has been setup, if not, set it up */
5924   if (swig_module.next==0) {
5925     /* Initialize the swig_module */
5926     swig_module.type_initial = swig_type_initial;
5927     swig_module.cast_initial = swig_cast_initial;
5928     swig_module.next = &swig_module;
5929     init = 1;
5930   } else {
5931     init = 0;
5932   }
5933 
5934   /* Try and load any already created modules */
5935   module_head = SWIG_GetModule(clientdata);
5936   if (!module_head) {
5937     /* This is the first module loaded for this interpreter */
5938     /* so set the swig module into the interpreter */
5939     SWIG_SetModule(clientdata, &swig_module);
5940     module_head = &swig_module;
5941   } else {
5942     /* the interpreter has loaded a SWIG module, but has it loaded this one? */
5943     found=0;
5944     iter=module_head;
5945     do {
5946       if (iter==&swig_module) {
5947         found=1;
5948         break;
5949       }
5950       iter=iter->next;
5951     } while (iter!= module_head);
5952 
5953     /* if the is found in the list, then all is done and we may leave */
5954     if (found) return;
5955     /* otherwise we must add out module into the list */
5956     swig_module.next = module_head->next;
5957     module_head->next = &swig_module;
5958   }
5959 
5960   /* When multiple interpreters are used, a module could have already been initialized in
5961        a different interpreter, but not yet have a pointer in this interpreter.
5962        In this case, we do not want to continue adding types... everything should be
5963        set up already */
5964   if (init == 0) return;
5965 
5966   /* Now work on filling in swig_module.types */
5967 #ifdef SWIGRUNTIME_DEBUG
5968   printf("SWIG_InitializeModule: size %d\n", swig_module.size);
5969 #endif
5970   for (i = 0; i < swig_module.size; ++i) {
5971     swig_type_info *type = 0;
5972     swig_type_info *ret;
5973     swig_cast_info *cast;
5974 
5975 #ifdef SWIGRUNTIME_DEBUG
5976     printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
5977 #endif
5978 
5979     /* if there is another module already loaded */
5980     if (swig_module.next != &swig_module) {
5981       type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
5982     }
5983     if (type) {
5984       /* Overwrite clientdata field */
5985 #ifdef SWIGRUNTIME_DEBUG
5986       printf("SWIG_InitializeModule: found type %s\n", type->name);
5987 #endif
5988       if (swig_module.type_initial[i]->clientdata) {
5989         type->clientdata = swig_module.type_initial[i]->clientdata;
5990 #ifdef SWIGRUNTIME_DEBUG
5991         printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
5992 #endif
5993       }
5994     } else {
5995       type = swig_module.type_initial[i];
5996     }
5997 
5998     /* Insert casting types */
5999     cast = swig_module.cast_initial[i];
6000     while (cast->type) {
6001       /* Don't need to add information already in the list */
6002       ret = 0;
6003 #ifdef SWIGRUNTIME_DEBUG
6004       printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
6005 #endif
6006       if (swig_module.next != &swig_module) {
6007         ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
6008 #ifdef SWIGRUNTIME_DEBUG
6009         if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
6010 #endif
6011       }
6012       if (ret) {
6013         if (type == swig_module.type_initial[i]) {
6014 #ifdef SWIGRUNTIME_DEBUG
6015           printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
6016 #endif
6017           cast->type = ret;
6018           ret = 0;
6019         } else {
6020           /* Check for casting already in the list */
6021           swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
6022 #ifdef SWIGRUNTIME_DEBUG
6023           if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
6024 #endif
6025           if (!ocast) ret = 0;
6026         }
6027       }
6028 
6029       if (!ret) {
6030 #ifdef SWIGRUNTIME_DEBUG
6031         printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
6032 #endif
6033         if (type->cast) {
6034           type->cast->prev = cast;
6035           cast->next = type->cast;
6036         }
6037         type->cast = cast;
6038       }
6039       cast++;
6040     }
6041     /* Set entry in modules->types array equal to the type */
6042     swig_module.types[i] = type;
6043   }
6044   swig_module.types[i] = 0;
6045 
6046 #ifdef SWIGRUNTIME_DEBUG
6047   printf("**** SWIG_InitializeModule: Cast List ******\n");
6048   for (i = 0; i < swig_module.size; ++i) {
6049     int j = 0;
6050     swig_cast_info *cast = swig_module.cast_initial[i];
6051     printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
6052     while (cast->type) {
6053       printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
6054       cast++;
6055       ++j;
6056     }
6057     printf("---- Total casts: %d\n",j);
6058   }
6059   printf("**** SWIG_InitializeModule: Cast List ******\n");
6060 #endif
6061 }
6062 
6063 /* This function will propagate the clientdata field of type to
6064 * any new swig_type_info structures that have been added into the list
6065 * of equivalent types.  It is like calling
6066 * SWIG_TypeClientData(type, clientdata) a second time.
6067 */
6068 SWIGRUNTIME void
SWIG_PropagateClientData(void)6069 SWIG_PropagateClientData(void) {
6070   size_t i;
6071   swig_cast_info *equiv;
6072   static int init_run = 0;
6073 
6074   if (init_run) return;
6075   init_run = 1;
6076 
6077   for (i = 0; i < swig_module.size; i++) {
6078     if (swig_module.types[i]->clientdata) {
6079       equiv = swig_module.types[i]->cast;
6080       while (equiv) {
6081         if (!equiv->converter) {
6082           if (equiv->type && !equiv->type->clientdata)
6083           SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
6084         }
6085         equiv = equiv->next;
6086       }
6087     }
6088   }
6089 }
6090 
6091 #ifdef __cplusplus
6092 #if 0
6093 {
6094   /* c-mode */
6095 #endif
6096 }
6097 #endif
6098 
6099 
6100 
6101 #ifdef __cplusplus
6102 extern "C" {
6103 #endif
6104 
6105   /* Python-specific SWIG API */
6106 #define SWIG_newvarlink()                             SWIG_Python_newvarlink()
6107 #define SWIG_addvarlink(p, name, get_attr, set_attr)  SWIG_Python_addvarlink(p, name, get_attr, set_attr)
6108 #define SWIG_InstallConstants(d, constants)           SWIG_Python_InstallConstants(d, constants)
6109 
6110   /* -----------------------------------------------------------------------------
6111    * global variable support code.
6112    * ----------------------------------------------------------------------------- */
6113 
6114   typedef struct swig_globalvar {
6115     char       *name;                  /* Name of global variable */
6116     PyObject *(*get_attr)(void);       /* Return the current value */
6117     int       (*set_attr)(PyObject *); /* Set the value */
6118     struct swig_globalvar *next;
6119   } swig_globalvar;
6120 
6121   typedef struct swig_varlinkobject {
6122     PyObject_HEAD
6123     swig_globalvar *vars;
6124   } swig_varlinkobject;
6125 
6126   SWIGINTERN PyObject *
swig_varlink_repr(swig_varlinkobject * SWIGUNUSEDPARM (v))6127   swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) {
6128 #if PY_VERSION_HEX >= 0x03000000
6129     return PyUnicode_InternFromString("<Swig global variables>");
6130 #else
6131     return PyString_FromString("<Swig global variables>");
6132 #endif
6133   }
6134 
6135   SWIGINTERN PyObject *
swig_varlink_str(swig_varlinkobject * v)6136   swig_varlink_str(swig_varlinkobject *v) {
6137 #if PY_VERSION_HEX >= 0x03000000
6138     PyObject *str = PyUnicode_InternFromString("(");
6139     PyObject *tail;
6140     PyObject *joined;
6141     swig_globalvar *var;
6142     for (var = v->vars; var; var=var->next) {
6143       tail = PyUnicode_FromString(var->name);
6144       joined = PyUnicode_Concat(str, tail);
6145       Py_DecRef(str);
6146       Py_DecRef(tail);
6147       str = joined;
6148       if (var->next) {
6149         tail = PyUnicode_InternFromString(", ");
6150         joined = PyUnicode_Concat(str, tail);
6151         Py_DecRef(str);
6152         Py_DecRef(tail);
6153         str = joined;
6154       }
6155     }
6156     tail = PyUnicode_InternFromString(")");
6157     joined = PyUnicode_Concat(str, tail);
6158     Py_DecRef(str);
6159     Py_DecRef(tail);
6160     str = joined;
6161 #else
6162     PyObject *str = PyString_FromString("(");
6163     swig_globalvar *var;
6164     for (var = v->vars; var; var=var->next) {
6165       PyString_ConcatAndDel(&str,PyString_FromString(var->name));
6166       if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", "));
6167     }
6168     PyString_ConcatAndDel(&str,PyString_FromString(")"));
6169 #endif
6170     return str;
6171   }
6172 
6173   SWIGINTERN int
swig_varlink_print(swig_varlinkobject * v,FILE * fp,int SWIGUNUSEDPARM (flags))6174   swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) {
6175     char *tmp;
6176     PyObject *str = swig_varlink_str(v);
6177     fprintf(fp,"Swig global variables ");
6178     fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str));
6179     SWIG_Python_str_DelForPy3(tmp);
6180     Py_DECREF(str);
6181     return 0;
6182   }
6183 
6184   SWIGINTERN void
swig_varlink_dealloc(swig_varlinkobject * v)6185   swig_varlink_dealloc(swig_varlinkobject *v) {
6186     swig_globalvar *var = v->vars;
6187     while (var) {
6188       swig_globalvar *n = var->next;
6189       free(var->name);
6190       free(var);
6191       var = n;
6192     }
6193   }
6194 
6195   SWIGINTERN PyObject *
swig_varlink_getattr(swig_varlinkobject * v,char * n)6196   swig_varlink_getattr(swig_varlinkobject *v, char *n) {
6197     PyObject *res = NULL;
6198     swig_globalvar *var = v->vars;
6199     while (var) {
6200       if (strcmp(var->name,n) == 0) {
6201         res = (*var->get_attr)();
6202         break;
6203       }
6204       var = var->next;
6205     }
6206     if (res == NULL && !PyErr_Occurred()) {
6207       PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n);
6208     }
6209     return res;
6210   }
6211 
6212   SWIGINTERN int
swig_varlink_setattr(swig_varlinkobject * v,char * n,PyObject * p)6213   swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
6214     int res = 1;
6215     swig_globalvar *var = v->vars;
6216     while (var) {
6217       if (strcmp(var->name,n) == 0) {
6218         res = (*var->set_attr)(p);
6219         break;
6220       }
6221       var = var->next;
6222     }
6223     if (res == 1 && !PyErr_Occurred()) {
6224       PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n);
6225     }
6226     return res;
6227   }
6228 
6229   SWIGINTERN PyTypeObject*
swig_varlink_type(void)6230   swig_varlink_type(void) {
6231     static char varlink__doc__[] = "Swig var link object";
6232     static PyTypeObject varlink_type;
6233     static int type_init = 0;
6234     if (!type_init) {
6235       const PyTypeObject tmp = {
6236         /* PyObject header changed in Python 3 */
6237 #if PY_VERSION_HEX >= 0x03000000
6238         PyVarObject_HEAD_INIT(NULL, 0)
6239 #else
6240         PyObject_HEAD_INIT(NULL)
6241         0,                                  /* ob_size */
6242 #endif
6243         (char *)"swigvarlink",              /* tp_name */
6244         sizeof(swig_varlinkobject),         /* tp_basicsize */
6245         0,                                  /* tp_itemsize */
6246         (destructor) swig_varlink_dealloc,  /* tp_dealloc */
6247         (printfunc) swig_varlink_print,     /* tp_print */
6248         (getattrfunc) swig_varlink_getattr, /* tp_getattr */
6249         (setattrfunc) swig_varlink_setattr, /* tp_setattr */
6250         0,                                  /* tp_compare */
6251         (reprfunc) swig_varlink_repr,       /* tp_repr */
6252         0,                                  /* tp_as_number */
6253         0,                                  /* tp_as_sequence */
6254         0,                                  /* tp_as_mapping */
6255         0,                                  /* tp_hash */
6256         0,                                  /* tp_call */
6257         (reprfunc) swig_varlink_str,        /* tp_str */
6258         0,                                  /* tp_getattro */
6259         0,                                  /* tp_setattro */
6260         0,                                  /* tp_as_buffer */
6261         0,                                  /* tp_flags */
6262         varlink__doc__,                     /* tp_doc */
6263         0,                                  /* tp_traverse */
6264         0,                                  /* tp_clear */
6265         0,                                  /* tp_richcompare */
6266         0,                                  /* tp_weaklistoffset */
6267 #if PY_VERSION_HEX >= 0x02020000
6268         0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
6269 #endif
6270 #if PY_VERSION_HEX >= 0x02030000
6271         0,                                  /* tp_del */
6272 #endif
6273 #if PY_VERSION_HEX >= 0x02060000
6274         0,                                  /* tp_version */
6275 #endif
6276 #ifdef COUNT_ALLOCS
6277         0,0,0,0                             /* tp_alloc -> tp_next */
6278 #endif
6279       };
6280       varlink_type = tmp;
6281       type_init = 1;
6282 #if PY_VERSION_HEX < 0x02020000
6283       varlink_type.ob_type = &PyType_Type;
6284 #else
6285       if (PyType_Ready(&varlink_type) < 0)
6286       return NULL;
6287 #endif
6288     }
6289     return &varlink_type;
6290   }
6291 
6292   /* Create a variable linking object for use later */
6293   SWIGINTERN PyObject *
SWIG_Python_newvarlink(void)6294   SWIG_Python_newvarlink(void) {
6295     swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type());
6296     if (result) {
6297       result->vars = 0;
6298     }
6299     return ((PyObject*) result);
6300   }
6301 
6302   SWIGINTERN void
SWIG_Python_addvarlink(PyObject * p,char * name,PyObject * (* get_attr)(void),int (* set_attr)(PyObject * p))6303   SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
6304     swig_varlinkobject *v = (swig_varlinkobject *) p;
6305     swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar));
6306     if (gv) {
6307       size_t size = strlen(name)+1;
6308       gv->name = (char *)malloc(size);
6309       if (gv->name) {
6310         strncpy(gv->name,name,size);
6311         gv->get_attr = get_attr;
6312         gv->set_attr = set_attr;
6313         gv->next = v->vars;
6314       }
6315     }
6316     v->vars = gv;
6317   }
6318 
6319   SWIGINTERN PyObject *
SWIG_globals(void)6320   SWIG_globals(void) {
6321     static PyObject *_SWIG_globals = 0;
6322     if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink();
6323     return _SWIG_globals;
6324   }
6325 
6326   /* -----------------------------------------------------------------------------
6327    * constants/methods manipulation
6328    * ----------------------------------------------------------------------------- */
6329 
6330   /* Install Constants */
6331   SWIGINTERN void
SWIG_Python_InstallConstants(PyObject * d,swig_const_info constants[])6332   SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
6333     PyObject *obj = 0;
6334     size_t i;
6335     for (i = 0; constants[i].type; ++i) {
6336       switch(constants[i].type) {
6337       case SWIG_PY_POINTER:
6338         obj = SWIG_InternalNewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
6339         break;
6340       case SWIG_PY_BINARY:
6341         obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
6342         break;
6343       default:
6344         obj = 0;
6345         break;
6346       }
6347       if (obj) {
6348         PyDict_SetItemString(d, constants[i].name, obj);
6349         Py_DECREF(obj);
6350       }
6351     }
6352   }
6353 
6354   /* -----------------------------------------------------------------------------*/
6355   /* Fix SwigMethods to carry the callback ptrs when needed */
6356   /* -----------------------------------------------------------------------------*/
6357 
6358   SWIGINTERN void
SWIG_Python_FixMethods(PyMethodDef * methods,swig_const_info * const_table,swig_type_info ** types,swig_type_info ** types_initial)6359   SWIG_Python_FixMethods(PyMethodDef *methods,
6360     swig_const_info *const_table,
6361     swig_type_info **types,
6362     swig_type_info **types_initial) {
6363     size_t i;
6364     for (i = 0; methods[i].ml_name; ++i) {
6365       const char *c = methods[i].ml_doc;
6366       if (c && (c = strstr(c, "swig_ptr: "))) {
6367         int j;
6368         swig_const_info *ci = 0;
6369         const char *name = c + 10;
6370         for (j = 0; const_table[j].type; ++j) {
6371           if (strncmp(const_table[j].name, name,
6372               strlen(const_table[j].name)) == 0) {
6373             ci = &(const_table[j]);
6374             break;
6375           }
6376         }
6377         if (ci) {
6378           void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
6379           if (ptr) {
6380             size_t shift = (ci->ptype) - types;
6381             swig_type_info *ty = types_initial[shift];
6382             size_t ldoc = (c - methods[i].ml_doc);
6383             size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
6384             char *ndoc = (char*)malloc(ldoc + lptr + 10);
6385             if (ndoc) {
6386               char *buff = ndoc;
6387               strncpy(buff, methods[i].ml_doc, ldoc);
6388               buff += ldoc;
6389               strncpy(buff, "swig_ptr: ", 10);
6390               buff += 10;
6391               SWIG_PackVoidPtr(buff, ptr, ty->name, lptr);
6392               methods[i].ml_doc = ndoc;
6393             }
6394           }
6395         }
6396       }
6397     }
6398   }
6399 
6400 #ifdef __cplusplus
6401 }
6402 #endif
6403 
6404 /* -----------------------------------------------------------------------------*
6405  *  Partial Init method
6406  * -----------------------------------------------------------------------------*/
6407 
6408 #ifdef __cplusplus
6409 extern "C"
6410 #endif
6411 
6412 SWIGEXPORT
6413 #if PY_VERSION_HEX >= 0x03000000
6414 PyObject*
6415 #else
6416 void
6417 #endif
SWIG_init(void)6418 SWIG_init(void) {
6419   PyObject *m, *d, *md;
6420 #if PY_VERSION_HEX >= 0x03000000
6421   static struct PyModuleDef SWIG_module = {
6422 # if PY_VERSION_HEX >= 0x03020000
6423     PyModuleDef_HEAD_INIT,
6424 # else
6425     {
6426       PyObject_HEAD_INIT(NULL)
6427       NULL, /* m_init */
6428       0,    /* m_index */
6429       NULL, /* m_copy */
6430     },
6431 # endif
6432     (char *) SWIG_name,
6433     NULL,
6434     -1,
6435     SwigMethods,
6436     NULL,
6437     NULL,
6438     NULL,
6439     NULL
6440   };
6441 #endif
6442 
6443 #if defined(SWIGPYTHON_BUILTIN)
6444   static SwigPyClientData SwigPyObject_clientdata = {
6445     0, 0, 0, 0, 0, 0, 0
6446   };
6447   static PyGetSetDef this_getset_def = {
6448     (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL
6449   };
6450   static SwigPyGetSet thisown_getset_closure = {
6451     (PyCFunction) SwigPyObject_own,
6452     (PyCFunction) SwigPyObject_own
6453   };
6454   static PyGetSetDef thisown_getset_def = {
6455     (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure
6456   };
6457   PyObject *metatype_args;
6458   PyTypeObject *builtin_pytype;
6459   int builtin_base_count;
6460   swig_type_info *builtin_basetype;
6461   PyObject *tuple;
6462   PyGetSetDescrObject *static_getset;
6463   PyTypeObject *metatype;
6464   SwigPyClientData *cd;
6465   PyObject *public_interface, *public_symbol;
6466   PyObject *this_descr;
6467   PyObject *thisown_descr;
6468   int i;
6469 
6470   (void)builtin_pytype;
6471   (void)builtin_base_count;
6472   (void)builtin_basetype;
6473   (void)tuple;
6474   (void)static_getset;
6475 
6476   /* metatype is used to implement static member variables. */
6477   metatype_args = Py_BuildValue("(s(O){})", "SwigPyObjectType", &PyType_Type);
6478   assert(metatype_args);
6479   metatype = (PyTypeObject *) PyType_Type.tp_call((PyObject *) &PyType_Type, metatype_args, NULL);
6480   assert(metatype);
6481   Py_DECREF(metatype_args);
6482   metatype->tp_setattro = (setattrofunc) &SwigPyObjectType_setattro;
6483   assert(PyType_Ready(metatype) >= 0);
6484 #endif
6485 
6486   /* Fix SwigMethods to carry the callback ptrs when needed */
6487   SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial);
6488 
6489 #if PY_VERSION_HEX >= 0x03000000
6490   m = PyModule_Create(&SWIG_module);
6491 #else
6492   m = Py_InitModule((char *) SWIG_name, SwigMethods);
6493 #endif
6494   md = d = PyModule_GetDict(m);
6495   (void)md;
6496 
6497   SWIG_InitializeModule(0);
6498 
6499 #ifdef SWIGPYTHON_BUILTIN
6500   SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject");
6501   assert(SwigPyObject_stype);
6502   cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
6503   if (!cd) {
6504     SwigPyObject_stype->clientdata = &SwigPyObject_clientdata;
6505     SwigPyObject_clientdata.pytype = SwigPyObject_TypeOnce();
6506   } else if (SwigPyObject_TypeOnce()->tp_basicsize != cd->pytype->tp_basicsize) {
6507     PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules.");
6508 # if PY_VERSION_HEX >= 0x03000000
6509     return NULL;
6510 # else
6511     return;
6512 # endif
6513   }
6514 
6515   /* All objects have a 'this' attribute */
6516   this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def);
6517   (void)this_descr;
6518 
6519   /* All objects have a 'thisown' attribute */
6520   thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def);
6521   (void)thisown_descr;
6522 
6523   public_interface = PyList_New(0);
6524   public_symbol = 0;
6525   (void)public_symbol;
6526 
6527   PyDict_SetItemString(md, "__all__", public_interface);
6528   Py_DECREF(public_interface);
6529   for (i = 0; SwigMethods[i].ml_name != NULL; ++i)
6530   SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name);
6531   for (i = 0; swig_const_table[i].name != 0; ++i)
6532   SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name);
6533 #endif
6534 
6535   SWIG_InstallConstants(d,swig_const_table);
6536 
6537 #if PY_VERSION_HEX >= 0x03000000
6538   return m;
6539 #else
6540   return;
6541 #endif
6542 }
6543 
6544