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 SWIGPERL
12 #define SWIG_CASTRANK_MODE
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 * swigrun.swg
149 *
150 * This file contains generic C API SWIG runtime support for pointer
151 * type checking.
152 * ----------------------------------------------------------------------------- */
153
154 /* This should only be incremented when either the layout of swig_type_info changes,
155 or for whatever reason, the runtime changes incompatibly */
156 #define SWIG_RUNTIME_VERSION "4"
157
158 /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
159 #ifdef SWIG_TYPE_TABLE
160 # define SWIG_QUOTE_STRING(x) #x
161 # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
162 # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
163 #else
164 # define SWIG_TYPE_TABLE_NAME
165 #endif
166
167 /*
168 You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
169 creating a static or dynamic library from the SWIG runtime code.
170 In 99.9% of the cases, SWIG just needs to declare them as 'static'.
171
172 But only do this if strictly necessary, ie, if you have problems
173 with your compiler or suchlike.
174 */
175
176 #ifndef SWIGRUNTIME
177 # define SWIGRUNTIME SWIGINTERN
178 #endif
179
180 #ifndef SWIGRUNTIMEINLINE
181 # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
182 #endif
183
184 /* Generic buffer size */
185 #ifndef SWIG_BUFFER_SIZE
186 # define SWIG_BUFFER_SIZE 1024
187 #endif
188
189 /* Flags for pointer conversions */
190 #define SWIG_POINTER_DISOWN 0x1
191 #define SWIG_CAST_NEW_MEMORY 0x2
192
193 /* Flags for new pointer objects */
194 #define SWIG_POINTER_OWN 0x1
195
196
197 /*
198 Flags/methods for returning states.
199
200 The SWIG conversion methods, as ConvertPtr, return an integer
201 that tells if the conversion was successful or not. And if not,
202 an error code can be returned (see swigerrors.swg for the codes).
203
204 Use the following macros/flags to set or process the returning
205 states.
206
207 In old versions of SWIG, code such as the following was usually written:
208
209 if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
210 // success code
211 } else {
212 //fail code
213 }
214
215 Now you can be more explicit:
216
217 int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
218 if (SWIG_IsOK(res)) {
219 // success code
220 } else {
221 // fail code
222 }
223
224 which is the same really, but now you can also do
225
226 Type *ptr;
227 int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
228 if (SWIG_IsOK(res)) {
229 // success code
230 if (SWIG_IsNewObj(res) {
231 ...
232 delete *ptr;
233 } else {
234 ...
235 }
236 } else {
237 // fail code
238 }
239
240 I.e., now SWIG_ConvertPtr can return new objects and you can
241 identify the case and take care of the deallocation. Of course that
242 also requires SWIG_ConvertPtr to return new result values, such as
243
244 int SWIG_ConvertPtr(obj, ptr,...) {
245 if (<obj is ok>) {
246 if (<need new object>) {
247 *ptr = <ptr to new allocated object>;
248 return SWIG_NEWOBJ;
249 } else {
250 *ptr = <ptr to old object>;
251 return SWIG_OLDOBJ;
252 }
253 } else {
254 return SWIG_BADOBJ;
255 }
256 }
257
258 Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
259 more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
260 SWIG errors code.
261
262 Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
263 allows to return the 'cast rank', for example, if you have this
264
265 int food(double)
266 int fooi(int);
267
268 and you call
269
270 food(1) // cast rank '1' (1 -> 1.0)
271 fooi(1) // cast rank '0'
272
273 just use the SWIG_AddCast()/SWIG_CheckState()
274 */
275
276 #define SWIG_OK (0)
277 #define SWIG_ERROR (-1)
278 #define SWIG_IsOK(r) (r >= 0)
279 #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
280
281 /* The CastRankLimit says how many bits are used for the cast rank */
282 #define SWIG_CASTRANKLIMIT (1 << 8)
283 /* The NewMask denotes the object was created (using new/malloc) */
284 #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
285 /* The TmpMask is for in/out typemaps that use temporal objects */
286 #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
287 /* Simple returning values */
288 #define SWIG_BADOBJ (SWIG_ERROR)
289 #define SWIG_OLDOBJ (SWIG_OK)
290 #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
291 #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
292 /* Check, add and del mask methods */
293 #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
294 #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
295 #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
296 #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
297 #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
298 #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
299
300 /* Cast-Rank Mode */
301 #if defined(SWIG_CASTRANK_MODE)
302 # ifndef SWIG_TypeRank
303 # define SWIG_TypeRank unsigned long
304 # endif
305 # ifndef SWIG_MAXCASTRANK /* Default cast allowed */
306 # define SWIG_MAXCASTRANK (2)
307 # endif
308 # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
309 # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
SWIG_AddCast(int r)310 SWIGINTERNINLINE int SWIG_AddCast(int r) {
311 return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
312 }
SWIG_CheckState(int r)313 SWIGINTERNINLINE int SWIG_CheckState(int r) {
314 return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
315 }
316 #else /* no cast-rank mode */
317 # define SWIG_AddCast(r) (r)
318 # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
319 #endif
320
321
322 #include <string.h>
323
324 #ifdef __cplusplus
325 extern "C" {
326 #endif
327
328 typedef void *(*swig_converter_func)(void *, int *);
329 typedef struct swig_type_info *(*swig_dycast_func)(void **);
330
331 /* Structure to store information on one type */
332 typedef struct swig_type_info {
333 const char *name; /* mangled name of this type */
334 const char *str; /* human readable name of this type */
335 swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
336 struct swig_cast_info *cast; /* linked list of types that can cast into this type */
337 void *clientdata; /* language specific type data */
338 int owndata; /* flag if the structure owns the clientdata */
339 } swig_type_info;
340
341 /* Structure to store a type and conversion function used for casting */
342 typedef struct swig_cast_info {
343 swig_type_info *type; /* pointer to type that is equivalent to this type */
344 swig_converter_func converter; /* function to cast the void pointers */
345 struct swig_cast_info *next; /* pointer to next cast in linked list */
346 struct swig_cast_info *prev; /* pointer to the previous cast */
347 } swig_cast_info;
348
349 /* Structure used to store module information
350 * Each module generates one structure like this, and the runtime collects
351 * all of these structures and stores them in a circularly linked list.*/
352 typedef struct swig_module_info {
353 swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
354 size_t size; /* Number of types in this module */
355 struct swig_module_info *next; /* Pointer to next element in circularly linked list */
356 swig_type_info **type_initial; /* Array of initially generated type structures */
357 swig_cast_info **cast_initial; /* Array of initially generated casting structures */
358 void *clientdata; /* Language specific module data */
359 } swig_module_info;
360
361 /*
362 Compare two type names skipping the space characters, therefore
363 "char*" == "char *" and "Class<int>" == "Class<int >", etc.
364
365 Return 0 when the two name types are equivalent, as in
366 strncmp, but skipping ' '.
367 */
368 SWIGRUNTIME int
SWIG_TypeNameComp(const char * f1,const char * l1,const char * f2,const char * l2)369 SWIG_TypeNameComp(const char *f1, const char *l1,
370 const char *f2, const char *l2) {
371 for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
372 while ((*f1 == ' ') && (f1 != l1)) ++f1;
373 while ((*f2 == ' ') && (f2 != l2)) ++f2;
374 if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
375 }
376 return (int)((l1 - f1) - (l2 - f2));
377 }
378
379 /*
380 Check type equivalence in a name list like <name1>|<name2>|...
381 Return 0 if equal, -1 if nb < tb, 1 if nb > tb
382 */
383 SWIGRUNTIME int
SWIG_TypeCmp(const char * nb,const char * tb)384 SWIG_TypeCmp(const char *nb, const char *tb) {
385 int equiv = 1;
386 const char* te = tb + strlen(tb);
387 const char* ne = nb;
388 while (equiv != 0 && *ne) {
389 for (nb = ne; *ne; ++ne) {
390 if (*ne == '|') break;
391 }
392 equiv = SWIG_TypeNameComp(nb, ne, tb, te);
393 if (*ne) ++ne;
394 }
395 return equiv;
396 }
397
398 /*
399 Check type equivalence in a name list like <name1>|<name2>|...
400 Return 0 if not equal, 1 if equal
401 */
402 SWIGRUNTIME int
SWIG_TypeEquiv(const char * nb,const char * tb)403 SWIG_TypeEquiv(const char *nb, const char *tb) {
404 return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
405 }
406
407 /*
408 Check the typename
409 */
410 SWIGRUNTIME swig_cast_info *
SWIG_TypeCheck(const char * c,swig_type_info * ty)411 SWIG_TypeCheck(const char *c, swig_type_info *ty) {
412 if (ty) {
413 swig_cast_info *iter = ty->cast;
414 while (iter) {
415 if (strcmp(iter->type->name, c) == 0) {
416 if (iter == ty->cast)
417 return iter;
418 /* Move iter to the top of the linked list */
419 iter->prev->next = iter->next;
420 if (iter->next)
421 iter->next->prev = iter->prev;
422 iter->next = ty->cast;
423 iter->prev = 0;
424 if (ty->cast) ty->cast->prev = iter;
425 ty->cast = iter;
426 return iter;
427 }
428 iter = iter->next;
429 }
430 }
431 return 0;
432 }
433
434 /*
435 Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
436 */
437 SWIGRUNTIME swig_cast_info *
SWIG_TypeCheckStruct(swig_type_info * from,swig_type_info * ty)438 SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
439 if (ty) {
440 swig_cast_info *iter = ty->cast;
441 while (iter) {
442 if (iter->type == from) {
443 if (iter == ty->cast)
444 return iter;
445 /* Move iter to the top of the linked list */
446 iter->prev->next = iter->next;
447 if (iter->next)
448 iter->next->prev = iter->prev;
449 iter->next = ty->cast;
450 iter->prev = 0;
451 if (ty->cast) ty->cast->prev = iter;
452 ty->cast = iter;
453 return iter;
454 }
455 iter = iter->next;
456 }
457 }
458 return 0;
459 }
460
461 /*
462 Cast a pointer up an inheritance hierarchy
463 */
464 SWIGRUNTIMEINLINE void *
SWIG_TypeCast(swig_cast_info * ty,void * ptr,int * newmemory)465 SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
466 return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
467 }
468
469 /*
470 Dynamic pointer casting. Down an inheritance hierarchy
471 */
472 SWIGRUNTIME swig_type_info *
SWIG_TypeDynamicCast(swig_type_info * ty,void ** ptr)473 SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
474 swig_type_info *lastty = ty;
475 if (!ty || !ty->dcast) return ty;
476 while (ty && (ty->dcast)) {
477 ty = (*ty->dcast)(ptr);
478 if (ty) lastty = ty;
479 }
480 return lastty;
481 }
482
483 /*
484 Return the name associated with this type
485 */
486 SWIGRUNTIMEINLINE const char *
SWIG_TypeName(const swig_type_info * ty)487 SWIG_TypeName(const swig_type_info *ty) {
488 return ty->name;
489 }
490
491 /*
492 Return the pretty name associated with this type,
493 that is an unmangled type name in a form presentable to the user.
494 */
495 SWIGRUNTIME const char *
SWIG_TypePrettyName(const swig_type_info * type)496 SWIG_TypePrettyName(const swig_type_info *type) {
497 /* The "str" field contains the equivalent pretty names of the
498 type, separated by vertical-bar characters. We choose
499 to print the last name, as it is often (?) the most
500 specific. */
501 if (!type) return NULL;
502 if (type->str != NULL) {
503 const char *last_name = type->str;
504 const char *s;
505 for (s = type->str; *s; s++)
506 if (*s == '|') last_name = s+1;
507 return last_name;
508 }
509 else
510 return type->name;
511 }
512
513 /*
514 Set the clientdata field for a type
515 */
516 SWIGRUNTIME void
SWIG_TypeClientData(swig_type_info * ti,void * clientdata)517 SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
518 swig_cast_info *cast = ti->cast;
519 /* if (ti->clientdata == clientdata) return; */
520 ti->clientdata = clientdata;
521
522 while (cast) {
523 if (!cast->converter) {
524 swig_type_info *tc = cast->type;
525 if (!tc->clientdata) {
526 SWIG_TypeClientData(tc, clientdata);
527 }
528 }
529 cast = cast->next;
530 }
531 }
532 SWIGRUNTIME void
SWIG_TypeNewClientData(swig_type_info * ti,void * clientdata)533 SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
534 SWIG_TypeClientData(ti, clientdata);
535 ti->owndata = 1;
536 }
537
538 /*
539 Search for a swig_type_info structure only by mangled name
540 Search is a O(log #types)
541
542 We start searching at module start, and finish searching when start == end.
543 Note: if start == end at the beginning of the function, we go all the way around
544 the circular list.
545 */
546 SWIGRUNTIME swig_type_info *
SWIG_MangledTypeQueryModule(swig_module_info * start,swig_module_info * end,const char * name)547 SWIG_MangledTypeQueryModule(swig_module_info *start,
548 swig_module_info *end,
549 const char *name) {
550 swig_module_info *iter = start;
551 do {
552 if (iter->size) {
553 size_t l = 0;
554 size_t r = iter->size - 1;
555 do {
556 /* since l+r >= 0, we can (>> 1) instead (/ 2) */
557 size_t i = (l + r) >> 1;
558 const char *iname = iter->types[i]->name;
559 if (iname) {
560 int compare = strcmp(name, iname);
561 if (compare == 0) {
562 return iter->types[i];
563 } else if (compare < 0) {
564 if (i) {
565 r = i - 1;
566 } else {
567 break;
568 }
569 } else if (compare > 0) {
570 l = i + 1;
571 }
572 } else {
573 break; /* should never happen */
574 }
575 } while (l <= r);
576 }
577 iter = iter->next;
578 } while (iter != end);
579 return 0;
580 }
581
582 /*
583 Search for a swig_type_info structure for either a mangled name or a human readable name.
584 It first searches the mangled names of the types, which is a O(log #types)
585 If a type is not found it then searches the human readable names, which is O(#types).
586
587 We start searching at module start, and finish searching when start == end.
588 Note: if start == end at the beginning of the function, we go all the way around
589 the circular list.
590 */
591 SWIGRUNTIME swig_type_info *
SWIG_TypeQueryModule(swig_module_info * start,swig_module_info * end,const char * name)592 SWIG_TypeQueryModule(swig_module_info *start,
593 swig_module_info *end,
594 const char *name) {
595 /* STEP 1: Search the name field using binary search */
596 swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
597 if (ret) {
598 return ret;
599 } else {
600 /* STEP 2: If the type hasn't been found, do a complete search
601 of the str field (the human readable name) */
602 swig_module_info *iter = start;
603 do {
604 size_t i = 0;
605 for (; i < iter->size; ++i) {
606 if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
607 return iter->types[i];
608 }
609 iter = iter->next;
610 } while (iter != end);
611 }
612
613 /* neither found a match */
614 return 0;
615 }
616
617 /*
618 Pack binary data into a string
619 */
620 SWIGRUNTIME char *
SWIG_PackData(char * c,void * ptr,size_t sz)621 SWIG_PackData(char *c, void *ptr, size_t sz) {
622 static const char hex[17] = "0123456789abcdef";
623 const unsigned char *u = (unsigned char *) ptr;
624 const unsigned char *eu = u + sz;
625 for (; u != eu; ++u) {
626 unsigned char uu = *u;
627 *(c++) = hex[(uu & 0xf0) >> 4];
628 *(c++) = hex[uu & 0xf];
629 }
630 return c;
631 }
632
633 /*
634 Unpack binary data from a string
635 */
636 SWIGRUNTIME const char *
SWIG_UnpackData(const char * c,void * ptr,size_t sz)637 SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
638 unsigned char *u = (unsigned char *) ptr;
639 const unsigned char *eu = u + sz;
640 for (; u != eu; ++u) {
641 char d = *(c++);
642 unsigned char uu;
643 if ((d >= '0') && (d <= '9'))
644 uu = ((d - '0') << 4);
645 else if ((d >= 'a') && (d <= 'f'))
646 uu = ((d - ('a'-10)) << 4);
647 else
648 return (char *) 0;
649 d = *(c++);
650 if ((d >= '0') && (d <= '9'))
651 uu |= (d - '0');
652 else if ((d >= 'a') && (d <= 'f'))
653 uu |= (d - ('a'-10));
654 else
655 return (char *) 0;
656 *u = uu;
657 }
658 return c;
659 }
660
661 /*
662 Pack 'void *' into a string buffer.
663 */
664 SWIGRUNTIME char *
SWIG_PackVoidPtr(char * buff,void * ptr,const char * name,size_t bsz)665 SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
666 char *r = buff;
667 if ((2*sizeof(void *) + 2) > bsz) return 0;
668 *(r++) = '_';
669 r = SWIG_PackData(r,&ptr,sizeof(void *));
670 if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
671 strcpy(r,name);
672 return buff;
673 }
674
675 SWIGRUNTIME const char *
SWIG_UnpackVoidPtr(const char * c,void ** ptr,const char * name)676 SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
677 if (*c != '_') {
678 if (strcmp(c,"NULL") == 0) {
679 *ptr = (void *) 0;
680 return name;
681 } else {
682 return 0;
683 }
684 }
685 return SWIG_UnpackData(++c,ptr,sizeof(void *));
686 }
687
688 SWIGRUNTIME char *
SWIG_PackDataName(char * buff,void * ptr,size_t sz,const char * name,size_t bsz)689 SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
690 char *r = buff;
691 size_t lname = (name ? strlen(name) : 0);
692 if ((2*sz + 2 + lname) > bsz) return 0;
693 *(r++) = '_';
694 r = SWIG_PackData(r,ptr,sz);
695 if (lname) {
696 strncpy(r,name,lname+1);
697 } else {
698 *r = 0;
699 }
700 return buff;
701 }
702
703 SWIGRUNTIME const char *
SWIG_UnpackDataName(const char * c,void * ptr,size_t sz,const char * name)704 SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
705 if (*c != '_') {
706 if (strcmp(c,"NULL") == 0) {
707 memset(ptr,0,sz);
708 return name;
709 } else {
710 return 0;
711 }
712 }
713 return SWIG_UnpackData(++c,ptr,sz);
714 }
715
716 #ifdef __cplusplus
717 }
718 #endif
719
720 /* Errors in SWIG */
721 #define SWIG_UnknownError -1
722 #define SWIG_IOError -2
723 #define SWIG_RuntimeError -3
724 #define SWIG_IndexError -4
725 #define SWIG_TypeError -5
726 #define SWIG_DivisionByZero -6
727 #define SWIG_OverflowError -7
728 #define SWIG_SyntaxError -8
729 #define SWIG_ValueError -9
730 #define SWIG_SystemError -10
731 #define SWIG_AttributeError -11
732 #define SWIG_MemoryError -12
733 #define SWIG_NullReferenceError -13
734
735
736
737 #ifdef __cplusplus
738 /* Needed on some windows machines---since MS plays funny games with the header files under C++ */
739 #include <math.h>
740 #include <stdlib.h>
741 extern "C" {
742 #endif
743 #include "EXTERN.h"
744 #include "perl.h"
745 #include "XSUB.h"
746
747 /* Add in functionality missing in older versions of Perl. Much of this is based on Devel-PPPort on cpan. */
748
749 /* Add PERL_REVISION, PERL_VERSION, PERL_SUBVERSION if missing */
750 #ifndef PERL_REVISION
751 # if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION))
752 # define PERL_PATCHLEVEL_H_IMPLICIT
753 # include <patchlevel.h>
754 # endif
755 # if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL)))
756 # include <could_not_find_Perl_patchlevel.h>
757 # endif
758 # ifndef PERL_REVISION
759 # define PERL_REVISION (5)
760 # define PERL_VERSION PATCHLEVEL
761 # define PERL_SUBVERSION SUBVERSION
762 # endif
763 #endif
764
765 #if defined(WIN32) && defined(PERL_OBJECT) && !defined(PerlIO_exportFILE)
766 #define PerlIO_exportFILE(fh,fl) (FILE*)(fh)
767 #endif
768
769 #ifndef SvIOK_UV
770 # define SvIOK_UV(sv) (SvIOK(sv) && (SvUVX(sv) == SvIVX(sv)))
771 #endif
772
773 #ifndef SvUOK
774 # define SvUOK(sv) SvIOK_UV(sv)
775 #endif
776
777 #if ((PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION <= 5)))
778 # define PL_sv_undef sv_undef
779 # define PL_na na
780 # define PL_errgv errgv
781 # define PL_sv_no sv_no
782 # define PL_sv_yes sv_yes
783 # define PL_markstack_ptr markstack_ptr
784 #endif
785
786 #ifndef IVSIZE
787 # ifdef LONGSIZE
788 # define IVSIZE LONGSIZE
789 # else
790 # define IVSIZE 4 /* A bold guess, but the best we can make. */
791 # endif
792 #endif
793
794 #ifndef INT2PTR
795 # if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE)
796 # define PTRV UV
797 # define INT2PTR(any,d) (any)(d)
798 # else
799 # if PTRSIZE == LONGSIZE
800 # define PTRV unsigned long
801 # else
802 # define PTRV unsigned
803 # endif
804 # define INT2PTR(any,d) (any)(PTRV)(d)
805 # endif
806
807 # define NUM2PTR(any,d) (any)(PTRV)(d)
808 # define PTR2IV(p) INT2PTR(IV,p)
809 # define PTR2UV(p) INT2PTR(UV,p)
810 # define PTR2NV(p) NUM2PTR(NV,p)
811
812 # if PTRSIZE == LONGSIZE
813 # define PTR2ul(p) (unsigned long)(p)
814 # else
815 # define PTR2ul(p) INT2PTR(unsigned long,p)
816 # endif
817 #endif /* !INT2PTR */
818
819 #ifndef SvPV_nolen
820 # define SvPV_nolen(x) SvPV(x,PL_na)
821 #endif
822
823 #ifndef get_sv
824 # define get_sv perl_get_sv
825 #endif
826
827 #ifndef ERRSV
828 # define ERRSV get_sv("@",FALSE)
829 #endif
830
831 #ifndef pTHX_
832 #define pTHX_
833 #endif
834
835 #include <string.h>
836 #ifdef __cplusplus
837 }
838 #endif
839
840 /* -----------------------------------------------------------------------------
841 * error manipulation
842 * ----------------------------------------------------------------------------- */
843
844 SWIGINTERN const char*
SWIG_Perl_ErrorType(int code)845 SWIG_Perl_ErrorType(int code) {
846 switch(code) {
847 case SWIG_MemoryError:
848 return "MemoryError";
849 case SWIG_IOError:
850 return "IOError";
851 case SWIG_RuntimeError:
852 return "RuntimeError";
853 case SWIG_IndexError:
854 return "IndexError";
855 case SWIG_TypeError:
856 return "TypeError";
857 case SWIG_DivisionByZero:
858 return "ZeroDivisionError";
859 case SWIG_OverflowError:
860 return "OverflowError";
861 case SWIG_SyntaxError:
862 return "SyntaxError";
863 case SWIG_ValueError:
864 return "ValueError";
865 case SWIG_SystemError:
866 return "SystemError";
867 case SWIG_AttributeError:
868 return "AttributeError";
869 default:
870 return "RuntimeError";
871 }
872 }
873
874
875 /* -----------------------------------------------------------------------------
876 * perlrun.swg
877 *
878 * This file contains the runtime support for Perl modules
879 * and includes code for managing global variables and pointer
880 * type checking.
881 * ----------------------------------------------------------------------------- */
882
883 #ifdef PERL_OBJECT
884 #define SWIG_PERL_OBJECT_DECL CPerlObj *SWIGUNUSEDPARM(pPerl),
885 #define SWIG_PERL_OBJECT_CALL pPerl,
886 #else
887 #define SWIG_PERL_OBJECT_DECL
888 #define SWIG_PERL_OBJECT_CALL
889 #endif
890
891 /* Common SWIG API */
892
893 /* for raw pointers */
894 #define SWIG_ConvertPtr(obj, pp, type, flags) SWIG_Perl_ConvertPtr(SWIG_PERL_OBJECT_CALL obj, pp, type, flags)
895 #define SWIG_ConvertPtrAndOwn(obj, pp, type, flags,own) SWIG_Perl_ConvertPtrAndOwn(SWIG_PERL_OBJECT_CALL obj, pp, type, flags, own)
896 #define SWIG_NewPointerObj(p, type, flags) SWIG_Perl_NewPointerObj(SWIG_PERL_OBJECT_CALL p, type, flags)
897 #define swig_owntype int
898
899 /* for raw packed data */
900 #define SWIG_ConvertPacked(obj, p, s, type) SWIG_Perl_ConvertPacked(SWIG_PERL_OBJECT_CALL obj, p, s, type)
901 #define SWIG_NewPackedObj(p, s, type) SWIG_Perl_NewPackedObj(SWIG_PERL_OBJECT_CALL p, s, type)
902
903 /* for class or struct pointers */
904 #define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
905 #define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
906
907 /* for C or C++ function pointers */
908 #define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0)
909 #define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0)
910
911 /* for C++ member pointers, ie, member methods */
912 #define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_ConvertPacked(obj, ptr, sz, ty)
913 #define SWIG_NewMemberObj(ptr, sz, type) SWIG_NewPackedObj(ptr, sz, type)
914
915
916 /* Runtime API */
917
918 #define SWIG_GetModule(clientdata) SWIG_Perl_GetModule(clientdata)
919 #define SWIG_SetModule(clientdata, pointer) SWIG_Perl_SetModule(pointer)
920
921
922 /* Error manipulation */
923
924 #define SWIG_ErrorType(code) SWIG_Perl_ErrorType(code)
925 #define SWIG_Error(code, msg) sv_setpvf(get_sv("@", GV_ADD), "%s %s", SWIG_ErrorType(code), msg)
926 #define SWIG_fail goto fail
927
928 /* Perl-specific SWIG API */
929
930 #define SWIG_MakePtr(sv, ptr, type, flags) SWIG_Perl_MakePtr(SWIG_PERL_OBJECT_CALL sv, ptr, type, flags)
931 #define SWIG_MakePackedObj(sv, p, s, type) SWIG_Perl_MakePackedObj(SWIG_PERL_OBJECT_CALL sv, p, s, type)
932 #define SWIG_SetError(str) SWIG_Error(SWIG_RuntimeError, str)
933
934
935 #define SWIG_PERL_DECL_ARGS_1(arg1) (SWIG_PERL_OBJECT_DECL arg1)
936 #define SWIG_PERL_CALL_ARGS_1(arg1) (SWIG_PERL_OBJECT_CALL arg1)
937 #define SWIG_PERL_DECL_ARGS_2(arg1, arg2) (SWIG_PERL_OBJECT_DECL arg1, arg2)
938 #define SWIG_PERL_CALL_ARGS_2(arg1, arg2) (SWIG_PERL_OBJECT_CALL arg1, arg2)
939
940 /* -----------------------------------------------------------------------------
941 * pointers/data manipulation
942 * ----------------------------------------------------------------------------- */
943
944 /* For backward compatibility only */
945 #define SWIG_POINTER_EXCEPTION 0
946
947 #ifdef __cplusplus
948 extern "C" {
949 #endif
950
951 #define SWIG_OWNER SWIG_POINTER_OWN
952 #define SWIG_SHADOW SWIG_OWNER << 1
953
954 #define SWIG_MAYBE_PERL_OBJECT SWIG_PERL_OBJECT_DECL
955
956 /* SWIG Perl macros */
957
958 /* Macro to declare an XS function */
959 #ifndef XSPROTO
960 # define XSPROTO(name) void name(pTHX_ CV* cv)
961 #endif
962
963 /* Macro to call an XS function */
964 #ifdef PERL_OBJECT
965 # define SWIG_CALLXS(_name) _name(cv,pPerl)
966 #else
967 # ifndef MULTIPLICITY
968 # define SWIG_CALLXS(_name) _name(cv)
969 # else
970 # define SWIG_CALLXS(_name) _name(PERL_GET_THX, cv)
971 # endif
972 #endif
973
974 #ifdef PERL_OBJECT
975 #define MAGIC_PPERL CPerlObj *pPerl = (CPerlObj *) this;
976
977 #ifdef __cplusplus
978 extern "C" {
979 #endif
980 typedef int (CPerlObj::*SwigMagicFunc)(SV *, MAGIC *);
981 #ifdef __cplusplus
982 }
983 #endif
984
985 #define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
986 #define SWIGCLASS_STATIC
987
988 #else /* PERL_OBJECT */
989
990 #define MAGIC_PPERL
991 #define SWIGCLASS_STATIC static SWIGUNUSED
992
993 #ifndef MULTIPLICITY
994 #define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
995
996 #ifdef __cplusplus
997 extern "C" {
998 #endif
999 typedef int (*SwigMagicFunc)(SV *, MAGIC *);
1000 #ifdef __cplusplus
1001 }
1002 #endif
1003
1004 #else /* MULTIPLICITY */
1005
1006 #define SWIG_MAGIC(a,b) (struct interpreter *interp, SV *a, MAGIC *b)
1007
1008 #ifdef __cplusplus
1009 extern "C" {
1010 #endif
1011 typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *);
1012 #ifdef __cplusplus
1013 }
1014 #endif
1015
1016 #endif /* MULTIPLICITY */
1017 #endif /* PERL_OBJECT */
1018
1019 # ifdef PERL_OBJECT
1020 # define SWIG_croak_null() SWIG_Perl_croak_null(pPerl)
SWIG_Perl_croak_null(CPerlObj * pPerl)1021 static void SWIG_Perl_croak_null(CPerlObj *pPerl)
1022 # else
1023 static void SWIG_croak_null()
1024 # endif
1025 {
1026 SV *err = get_sv("@", GV_ADD);
1027 # if (PERL_VERSION < 6)
1028 croak("%_", err);
1029 # else
1030 if (sv_isobject(err))
1031 croak(0);
1032 else
1033 croak("%s", SvPV_nolen(err));
1034 # endif
1035 }
1036
1037
1038 /*
1039 Define how strict is the cast between strings and integers/doubles
1040 when overloading between these types occurs.
1041
1042 The default is making it as strict as possible by using SWIG_AddCast
1043 when needed.
1044
1045 You can use -DSWIG_PERL_NO_STRICT_STR2NUM at compilation time to
1046 disable the SWIG_AddCast, making the casting between string and
1047 numbers less strict.
1048
1049 In the end, we try to solve the overloading between strings and
1050 numerical types in the more natural way, but if you can avoid it,
1051 well, avoid it using %rename, for example.
1052 */
1053 #ifndef SWIG_PERL_NO_STRICT_STR2NUM
1054 # ifndef SWIG_PERL_STRICT_STR2NUM
1055 # define SWIG_PERL_STRICT_STR2NUM
1056 # endif
1057 #endif
1058 #ifdef SWIG_PERL_STRICT_STR2NUM
1059 /* string takes precedence */
1060 #define SWIG_Str2NumCast(x) SWIG_AddCast(x)
1061 #else
1062 /* number takes precedence */
1063 #define SWIG_Str2NumCast(x) x
1064 #endif
1065
1066
1067
1068 #include <stdlib.h>
1069
1070 SWIGRUNTIME const char *
SWIG_Perl_TypeProxyName(const swig_type_info * type)1071 SWIG_Perl_TypeProxyName(const swig_type_info *type) {
1072 if (!type) return NULL;
1073 if (type->clientdata != NULL) {
1074 return (const char*) type->clientdata;
1075 }
1076 else {
1077 return type->name;
1078 }
1079 }
1080
1081 /* Identical to SWIG_TypeCheck, except for strcmp comparison */
1082 SWIGRUNTIME swig_cast_info *
SWIG_TypeProxyCheck(const char * c,swig_type_info * ty)1083 SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) {
1084 if (ty) {
1085 swig_cast_info *iter = ty->cast;
1086 while (iter) {
1087 if (strcmp(SWIG_Perl_TypeProxyName(iter->type), c) == 0) {
1088 if (iter == ty->cast)
1089 return iter;
1090 /* Move iter to the top of the linked list */
1091 iter->prev->next = iter->next;
1092 if (iter->next)
1093 iter->next->prev = iter->prev;
1094 iter->next = ty->cast;
1095 iter->prev = 0;
1096 if (ty->cast) ty->cast->prev = iter;
1097 ty->cast = iter;
1098 return iter;
1099 }
1100 iter = iter->next;
1101 }
1102 }
1103 return 0;
1104 }
1105
1106 /* Function for getting a pointer value */
1107
1108 SWIGRUNTIME int
SWIG_Perl_ConvertPtrAndOwn(SWIG_MAYBE_PERL_OBJECT SV * sv,void ** ptr,swig_type_info * _t,int flags,int * own)1109 SWIG_Perl_ConvertPtrAndOwn(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags, int *own) {
1110 swig_cast_info *tc;
1111 void *voidptr = (void *)0;
1112 SV *tsv = 0;
1113
1114 if (own)
1115 *own = 0;
1116
1117 /* If magical, apply more magic */
1118 if (SvGMAGICAL(sv))
1119 mg_get(sv);
1120
1121 /* Check to see if this is an object */
1122 if (sv_isobject(sv)) {
1123 IV tmp = 0;
1124 tsv = (SV*) SvRV(sv);
1125 if ((SvTYPE(tsv) == SVt_PVHV)) {
1126 MAGIC *mg;
1127 if (SvMAGICAL(tsv)) {
1128 mg = mg_find(tsv,'P');
1129 if (mg) {
1130 sv = mg->mg_obj;
1131 if (sv_isobject(sv)) {
1132 tsv = (SV*)SvRV(sv);
1133 tmp = SvIV(tsv);
1134 }
1135 }
1136 } else {
1137 return SWIG_ERROR;
1138 }
1139 } else {
1140 tmp = SvIV(tsv);
1141 }
1142 voidptr = INT2PTR(void *,tmp);
1143 } else if (! SvOK(sv)) { /* Check for undef */
1144 *(ptr) = (void *) 0;
1145 return SWIG_OK;
1146 } else if (SvTYPE(sv) == SVt_RV) { /* Check for NULL pointer */
1147 if (!SvROK(sv)) {
1148 /* In Perl 5.12 and later, SVt_RV == SVt_IV, so sv could be a valid integer value. */
1149 if (SvIOK(sv)) {
1150 return SWIG_ERROR;
1151 } else {
1152 /* NULL pointer (reference to undef). */
1153 *(ptr) = (void *) 0;
1154 return SWIG_OK;
1155 }
1156 } else {
1157 return SWIG_ERROR;
1158 }
1159 } else { /* Don't know what it is */
1160 return SWIG_ERROR;
1161 }
1162 if (_t) {
1163 /* Now see if the types match */
1164 char *_c = HvNAME(SvSTASH(SvRV(sv)));
1165 tc = SWIG_TypeProxyCheck(_c,_t);
1166 #ifdef SWIG_DIRECTORS
1167 if (!tc && !sv_derived_from(sv,SWIG_Perl_TypeProxyName(_t))) {
1168 #else
1169 if (!tc) {
1170 #endif
1171 return SWIG_ERROR;
1172 }
1173 {
1174 int newmemory = 0;
1175 *ptr = SWIG_TypeCast(tc,voidptr,&newmemory);
1176 if (newmemory == SWIG_CAST_NEW_MEMORY) {
1177 assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
1178 if (own)
1179 *own = *own | SWIG_CAST_NEW_MEMORY;
1180 }
1181 }
1182 } else {
1183 *ptr = voidptr;
1184 }
1185
1186 /*
1187 * DISOWN implementation: we need a perl guru to check this one.
1188 */
1189 if (tsv && (flags & SWIG_POINTER_DISOWN)) {
1190 /*
1191 * almost copy paste code from below SWIG_POINTER_OWN setting
1192 */
1193 SV *obj = sv;
1194 HV *stash = SvSTASH(SvRV(obj));
1195 GV *gv = *(GV**)hv_fetch(stash, "OWNER", 5, TRUE);
1196 if (isGV(gv)) {
1197 HV *hv = GvHVn(gv);
1198 /*
1199 * To set ownership (see below), a newSViv(1) entry is added.
1200 * Hence, to remove ownership, we delete the entry.
1201 */
1202 if (hv_exists_ent(hv, obj, 0)) {
1203 hv_delete_ent(hv, obj, 0, 0);
1204 }
1205 }
1206 }
1207 return SWIG_OK;
1208 }
1209
1210 SWIGRUNTIME int
1211 SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags) {
1212 return SWIG_Perl_ConvertPtrAndOwn(sv, ptr, _t, flags, 0);
1213 }
1214
1215 SWIGRUNTIME void
1216 SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, swig_type_info *t, int flags) {
1217 if (ptr && (flags & (SWIG_SHADOW | SWIG_POINTER_OWN))) {
1218 SV *self;
1219 SV *obj=newSV(0);
1220 HV *hash=newHV();
1221 HV *stash;
1222 sv_setref_pv(obj, SWIG_Perl_TypeProxyName(t), ptr);
1223 stash=SvSTASH(SvRV(obj));
1224 if (flags & SWIG_POINTER_OWN) {
1225 HV *hv;
1226 GV *gv = *(GV**)hv_fetch(stash, "OWNER", 5, TRUE);
1227 if (!isGV(gv))
1228 gv_init(gv, stash, "OWNER", 5, FALSE);
1229 hv=GvHVn(gv);
1230 hv_store_ent(hv, obj, newSViv(1), 0);
1231 }
1232 sv_magic((SV *)hash, (SV *)obj, 'P', Nullch, 0);
1233 SvREFCNT_dec(obj);
1234 self=newRV_noinc((SV *)hash);
1235 sv_setsv(sv, self);
1236 SvREFCNT_dec((SV *)self);
1237 sv_bless(sv, stash);
1238 }
1239 else {
1240 sv_setref_pv(sv, SWIG_Perl_TypeProxyName(t), ptr);
1241 }
1242 }
1243
1244 SWIGRUNTIMEINLINE SV *
1245 SWIG_Perl_NewPointerObj(SWIG_MAYBE_PERL_OBJECT void *ptr, swig_type_info *t, int flags) {
1246 SV *result = sv_newmortal();
1247 SWIG_MakePtr(result, ptr, t, flags);
1248 return result;
1249 }
1250
1251 SWIGRUNTIME void
1252 SWIG_Perl_MakePackedObj(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, int sz, swig_type_info *type) {
1253 char result[1024];
1254 char *r = result;
1255 if ((2*sz + 1 + strlen(SWIG_Perl_TypeProxyName(type))) > 1000) return;
1256 *(r++) = '_';
1257 r = SWIG_PackData(r,ptr,sz);
1258 strcpy(r,SWIG_Perl_TypeProxyName(type));
1259 sv_setpv(sv, result);
1260 }
1261
1262 SWIGRUNTIME SV *
1263 SWIG_Perl_NewPackedObj(SWIG_MAYBE_PERL_OBJECT void *ptr, int sz, swig_type_info *type) {
1264 SV *result = sv_newmortal();
1265 SWIG_Perl_MakePackedObj(result, ptr, sz, type);
1266 return result;
1267 }
1268
1269 /* Convert a packed value value */
1270 SWIGRUNTIME int
1271 SWIG_Perl_ConvertPacked(SWIG_MAYBE_PERL_OBJECT SV *obj, void *ptr, int sz, swig_type_info *ty) {
1272 swig_cast_info *tc;
1273 const char *c = 0;
1274
1275 if ((!obj) || (!SvOK(obj))) return SWIG_ERROR;
1276 c = SvPV_nolen(obj);
1277 /* Pointer values must start with leading underscore */
1278 if (*c != '_') return SWIG_ERROR;
1279 c++;
1280 c = SWIG_UnpackData(c,ptr,sz);
1281 if (ty) {
1282 tc = SWIG_TypeCheck(c,ty);
1283 if (!tc) return SWIG_ERROR;
1284 }
1285 return SWIG_OK;
1286 }
1287
1288
1289 /* Macros for low-level exception handling */
1290 #define SWIG_croak(x) { SWIG_Error(SWIG_RuntimeError, x); SWIG_fail; }
1291
1292
1293 typedef XSPROTO(SwigPerlWrapper);
1294 typedef SwigPerlWrapper *SwigPerlWrapperPtr;
1295
1296 /* Structure for command table */
1297 typedef struct {
1298 const char *name;
1299 SwigPerlWrapperPtr wrapper;
1300 } swig_command_info;
1301
1302 /* Information for constant table */
1303
1304 #define SWIG_INT 1
1305 #define SWIG_FLOAT 2
1306 #define SWIG_STRING 3
1307 #define SWIG_POINTER 4
1308 #define SWIG_BINARY 5
1309
1310 /* Constant information structure */
1311 typedef struct swig_constant_info {
1312 int type;
1313 const char *name;
1314 long lvalue;
1315 double dvalue;
1316 void *pvalue;
1317 swig_type_info **ptype;
1318 } swig_constant_info;
1319
1320
1321 /* Structure for variable table */
1322 typedef struct {
1323 const char *name;
1324 SwigMagicFunc set;
1325 SwigMagicFunc get;
1326 swig_type_info **type;
1327 } swig_variable_info;
1328
1329 /* Magic variable code */
1330 #ifndef PERL_OBJECT
1331 # ifdef __cplusplus
1332 # define swig_create_magic(s,a,b,c) _swig_create_magic(s,const_cast<char*>(a),b,c)
1333 # else
1334 # define swig_create_magic(s,a,b,c) _swig_create_magic(s,(char*)(a),b,c)
1335 # endif
1336 # ifndef MULTIPLICITY
1337 SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(SV *, MAGIC *), int (*get)(SV *,MAGIC *))
1338 # else
1339 SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(struct interpreter*, SV *, MAGIC *), int (*get)(struct interpreter*, SV *,MAGIC *))
1340 # endif
1341 #else
1342 # define swig_create_magic(s,a,b,c) _swig_create_magic(pPerl,s,a,b,c)
1343 SWIGRUNTIME void _swig_create_magic(CPerlObj *pPerl, SV *sv, const char *name, int (CPerlObj::*set)(SV *, MAGIC *), int (CPerlObj::*get)(SV *, MAGIC *))
1344 #endif
1345 {
1346 MAGIC *mg;
1347 sv_magic(sv,sv,'U',name,strlen(name));
1348 mg = mg_find(sv,'U');
1349 mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL));
1350 mg->mg_virtual->svt_get = (SwigMagicFunc) get;
1351 mg->mg_virtual->svt_set = (SwigMagicFunc) set;
1352 mg->mg_virtual->svt_len = 0;
1353 mg->mg_virtual->svt_clear = 0;
1354 mg->mg_virtual->svt_free = 0;
1355 }
1356
1357
1358 SWIGRUNTIME swig_module_info *
1359 SWIG_Perl_GetModule(void *SWIGUNUSEDPARM(clientdata)) {
1360 static void *type_pointer = (void *)0;
1361 SV *pointer;
1362
1363 /* first check if pointer already created */
1364 if (!type_pointer) {
1365 pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE | GV_ADDMULTI);
1366 if (pointer && SvOK(pointer)) {
1367 type_pointer = INT2PTR(swig_type_info **, SvIV(pointer));
1368 }
1369 }
1370
1371 return (swig_module_info *) type_pointer;
1372 }
1373
1374 SWIGRUNTIME void
1375 SWIG_Perl_SetModule(swig_module_info *module) {
1376 SV *pointer;
1377
1378 /* create a new pointer */
1379 pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE | GV_ADDMULTI);
1380 sv_setiv(pointer, PTR2IV(module));
1381 }
1382
1383 #ifdef __cplusplus
1384 }
1385 #endif
1386
1387 /* Workaround perl5 global namespace pollution. Note that undefining library
1388 * functions like fopen will not solve the problem on all platforms as fopen
1389 * might be a macro on Windows but not necessarily on other operating systems. */
1390 #ifdef do_open
1391 #undef do_open
1392 #endif
1393 #ifdef do_close
1394 #undef do_close
1395 #endif
1396 #ifdef do_exec
1397 #undef do_exec
1398 #endif
1399 #ifdef scalar
1400 #undef scalar
1401 #endif
1402 #ifdef list
1403 #undef list
1404 #endif
1405 #ifdef apply
1406 #undef apply
1407 #endif
1408 #ifdef convert
1409 #undef convert
1410 #endif
1411 #ifdef Error
1412 #undef Error
1413 #endif
1414 #ifdef form
1415 #undef form
1416 #endif
1417 #ifdef vform
1418 #undef vform
1419 #endif
1420 #ifdef LABEL
1421 #undef LABEL
1422 #endif
1423 #ifdef METHOD
1424 #undef METHOD
1425 #endif
1426 #ifdef Move
1427 #undef Move
1428 #endif
1429 #ifdef yylex
1430 #undef yylex
1431 #endif
1432 #ifdef yyparse
1433 #undef yyparse
1434 #endif
1435 #ifdef yyerror
1436 #undef yyerror
1437 #endif
1438 #ifdef invert
1439 #undef invert
1440 #endif
1441 #ifdef ref
1442 #undef ref
1443 #endif
1444 #ifdef read
1445 #undef read
1446 #endif
1447 #ifdef write
1448 #undef write
1449 #endif
1450 #ifdef eof
1451 #undef eof
1452 #endif
1453 #ifdef close
1454 #undef close
1455 #endif
1456 #ifdef rewind
1457 #undef rewind
1458 #endif
1459 #ifdef free
1460 #undef free
1461 #endif
1462 #ifdef malloc
1463 #undef malloc
1464 #endif
1465 #ifdef calloc
1466 #undef calloc
1467 #endif
1468 #ifdef Stat
1469 #undef Stat
1470 #endif
1471 #ifdef check
1472 #undef check
1473 #endif
1474 #ifdef seekdir
1475 #undef seekdir
1476 #endif
1477 #ifdef open
1478 #undef open
1479 #endif
1480 #ifdef readdir
1481 #undef readdir
1482 #endif
1483 #ifdef bind
1484 #undef bind
1485 #endif
1486 #ifdef access
1487 #undef access
1488 #endif
1489 #ifdef stat
1490 #undef stat
1491 #endif
1492
1493 #ifdef bool
1494 /* Leave if macro is from C99 stdbool.h */
1495 #ifndef __bool_true_false_are_defined
1496 #undef bool
1497 #endif
1498 #endif
1499
1500
1501
1502
1503 #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
1504
1505 #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
1506
1507
1508
1509 #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0)
1510
1511
1512 /* -------- TYPES TABLE (BEGIN) -------- */
1513
1514 #define SWIGTYPE_p_HashCounter swig_types[0]
1515 #define SWIGTYPE_p_HashSet swig_types[1]
1516 #define SWIGTYPE_p_MerDNA swig_types[2]
1517 #define SWIGTYPE_p_QueryMerFile swig_types[3]
1518 #define SWIGTYPE_p_ReadMerFile swig_types[4]
1519 #define SWIGTYPE_p_StringMers swig_types[5]
1520 #define SWIGTYPE_p_char swig_types[6]
1521 #define SWIGTYPE_p_std__pairT_bool_uint64_t_t swig_types[7]
1522 static swig_type_info *swig_types[9];
1523 static swig_module_info swig_module = {swig_types, 8, 0, 0, 0, 0};
1524 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
1525 #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
1526
1527 /* -------- TYPES TABLE (END) -------- */
1528
1529 #define SWIG_init boot_jellyfish
1530
1531 #define SWIG_name "jellyfishc::boot_jellyfish"
1532 #define SWIG_prefix "jellyfishc::"
1533
1534 #define SWIGVERSION 0x030002
1535 #define SWIG_VERSION SWIGVERSION
1536
1537
1538 #define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
1539 #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))
1540
1541
1542 #include <stdexcept>
1543
1544
1545 #ifdef __cplusplus
1546 extern "C"
1547 #endif
1548 #ifndef PERL_OBJECT
1549 #ifndef MULTIPLICITY
1550 SWIGEXPORT void SWIG_init (CV* cv);
1551 #else
1552 SWIGEXPORT void SWIG_init (pTHXo_ CV* cv);
1553 #endif
1554 #else
1555 SWIGEXPORT void SWIG_init (CV *cv, CPerlObj *);
1556 #endif
1557
1558
1559 #include <string>
1560
1561
1562 #include <stdexcept>
1563
1564
1565 #ifdef SWIGPYTHON
1566 #define SWIG_FILE_WITH_INIT
1567 #endif
1568
1569 #ifdef SWIGPERL
1570 #undef seed
1571 #undef random
1572 #endif
1573
1574 #include <fstream>
1575 #include <stdexcept>
1576 #undef die
1577 #include <jellyfish/mer_dna.hpp>
1578 #include <jellyfish/file_header.hpp>
1579 #include <jellyfish/mer_dna_bloom_counter.hpp>
1580 #include <jellyfish/hash_counter.hpp>
1581 #include <jellyfish/jellyfish.hpp>
1582 #undef die
1583
1584
1585 class MerDNA : public jellyfish::mer_dna {
1586 public:
1587 MerDNA() = default;
MerDNA(const char * s)1588 MerDNA(const char* s) : jellyfish::mer_dna(s) { }
MerDNA(const MerDNA & m)1589 MerDNA(const MerDNA& m) : jellyfish::mer_dna(m) { }
operator =(const jellyfish::mer_dna & m)1590 MerDNA& operator=(const jellyfish::mer_dna& m) { *static_cast<jellyfish::mer_dna*>(this) = m; return *this; }
1591 };
1592
1593
1594 SWIGINTERN swig_type_info*
SWIG_pchar_descriptor(void)1595 SWIG_pchar_descriptor(void)
1596 {
1597 static int init = 0;
1598 static swig_type_info* info = 0;
1599 if (!init) {
1600 info = SWIG_TypeQuery("_p_char");
1601 init = 1;
1602 }
1603 return info;
1604 }
1605
1606
1607 SWIGINTERN int
SWIG_AsCharPtrAndSize(SV * obj,char ** cptr,size_t * psize,int * alloc)1608 SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc)
1609 {
1610 if (SvMAGICAL(obj)) {
1611 SV *tmp = sv_newmortal();
1612 SvSetSV(tmp, obj);
1613 obj = tmp;
1614 }
1615 if (SvPOK(obj)) {
1616 STRLEN len = 0;
1617 char *cstr = SvPV(obj, len);
1618 size_t size = len + 1;
1619 if (cptr) {
1620 if (alloc) {
1621 if (*alloc == SWIG_NEWOBJ) {
1622 *cptr = reinterpret_cast< char* >(memcpy((new char[size]), cstr, sizeof(char)*(size)));
1623 } else {
1624 *cptr = cstr;
1625 *alloc = SWIG_OLDOBJ;
1626 }
1627 }
1628 }
1629 if (psize) *psize = size;
1630 return SWIG_OK;
1631 } else {
1632 swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
1633 if (pchar_descriptor) {
1634 char* vptr = 0;
1635 if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_descriptor, 0) == SWIG_OK) {
1636 if (cptr) *cptr = vptr;
1637 if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0;
1638 if (alloc) *alloc = SWIG_OLDOBJ;
1639 return SWIG_OK;
1640 }
1641 }
1642 }
1643 return SWIG_TypeError;
1644 }
1645
1646
1647
1648
1649
1650 SWIGINTERNINLINE SV *
SWIG_PERL_DECL_ARGS_1(unsigned long value)1651 SWIG_From_unsigned_SS_long SWIG_PERL_DECL_ARGS_1(unsigned long value)
1652 {
1653 SV *sv;
1654 if (value <= UV_MAX)
1655 sv = newSVuv(value);
1656 else
1657 sv = newSVpvf("%lu", value);
1658 return sv_2mortal(sv);
1659 }
1660
1661
1662 SWIGINTERNINLINE SV *
SWIG_PERL_DECL_ARGS_1(unsigned int value)1663 SWIG_From_unsigned_SS_int SWIG_PERL_DECL_ARGS_1(unsigned int value)
1664 {
1665 return SWIG_From_unsigned_SS_long SWIG_PERL_CALL_ARGS_1(value);
1666 }
1667
1668
1669 #include <limits.h>
1670 #if !defined(SWIG_NO_LLONG_MAX)
1671 # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
1672 # define LLONG_MAX __LONG_LONG_MAX__
1673 # define LLONG_MIN (-LLONG_MAX - 1LL)
1674 # define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
1675 # endif
1676 #endif
1677
1678
1679 SWIGINTERN int
SWIG_PERL_DECL_ARGS_2(SV * obj,double * val)1680 SWIG_AsVal_double SWIG_PERL_DECL_ARGS_2(SV *obj, double *val)
1681 {
1682 if (SvNIOK(obj)) {
1683 if (val) *val = SvNV(obj);
1684 return SWIG_OK;
1685 } else if (SvIOK(obj)) {
1686 if (val) *val = (double) SvIV(obj);
1687 return SWIG_AddCast(SWIG_OK);
1688 } else {
1689 const char *nptr = SvPV_nolen(obj);
1690 if (nptr) {
1691 char *endptr;
1692 double v;
1693 errno = 0;
1694 v = strtod(nptr, &endptr);
1695 if (errno == ERANGE) {
1696 errno = 0;
1697 return SWIG_OverflowError;
1698 } else {
1699 if (*endptr == '\0') {
1700 if (val) *val = v;
1701 return SWIG_Str2NumCast(SWIG_OK);
1702 }
1703 }
1704 }
1705 }
1706 return SWIG_TypeError;
1707 }
1708
1709
1710 #include <float.h>
1711
1712
1713 #include <math.h>
1714
1715
1716 SWIGINTERNINLINE int
SWIG_CanCastAsInteger(double * d,double min,double max)1717 SWIG_CanCastAsInteger(double *d, double min, double max) {
1718 double x = *d;
1719 if ((min <= x && x <= max)) {
1720 double fx = floor(x);
1721 double cx = ceil(x);
1722 double rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */
1723 if ((errno == EDOM) || (errno == ERANGE)) {
1724 errno = 0;
1725 } else {
1726 double summ, reps, diff;
1727 if (rd < x) {
1728 diff = x - rd;
1729 } else if (rd > x) {
1730 diff = rd - x;
1731 } else {
1732 return 1;
1733 }
1734 summ = rd + x;
1735 reps = diff/summ;
1736 if (reps < 8*DBL_EPSILON) {
1737 *d = rd;
1738 return 1;
1739 }
1740 }
1741 }
1742 return 0;
1743 }
1744
1745
1746 SWIGINTERN int
SWIG_PERL_DECL_ARGS_2(SV * obj,unsigned long * val)1747 SWIG_AsVal_unsigned_SS_long SWIG_PERL_DECL_ARGS_2(SV *obj, unsigned long *val)
1748 {
1749 if (SvUOK(obj)) {
1750 UV v = SvUV(obj);
1751 if (v <= ULONG_MAX) {
1752 if (val) *val = v;
1753 return SWIG_OK;
1754 }
1755 return SWIG_OverflowError;
1756 } else if (SvIOK(obj)) {
1757 IV v = SvIV(obj);
1758 if (v >= 0 && v <= ULONG_MAX) {
1759 if (val) *val = v;
1760 return SWIG_OK;
1761 }
1762 return SWIG_OverflowError;
1763 } else {
1764 int dispatch = 0;
1765 const char *nptr = SvPV_nolen(obj);
1766 if (nptr) {
1767 char *endptr;
1768 unsigned long v;
1769 errno = 0;
1770 v = strtoul(nptr, &endptr,0);
1771 if (errno == ERANGE) {
1772 errno = 0;
1773 return SWIG_OverflowError;
1774 } else {
1775 if (*endptr == '\0') {
1776 if (val) *val = v;
1777 return SWIG_Str2NumCast(SWIG_OK);
1778 }
1779 }
1780 }
1781 if (!dispatch) {
1782 double d;
1783 int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d));
1784 if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) {
1785 if (val) *val = (unsigned long)(d);
1786 return res;
1787 }
1788 }
1789 }
1790 return SWIG_TypeError;
1791 }
1792
1793
1794 SWIGINTERN int
SWIG_PERL_DECL_ARGS_2(SV * obj,unsigned int * val)1795 SWIG_AsVal_unsigned_SS_int SWIG_PERL_DECL_ARGS_2(SV * obj, unsigned int *val)
1796 {
1797 unsigned long v;
1798 int res = SWIG_AsVal_unsigned_SS_long SWIG_PERL_CALL_ARGS_2(obj, &v);
1799 if (SWIG_IsOK(res)) {
1800 if ((v > UINT_MAX)) {
1801 return SWIG_OverflowError;
1802 } else {
1803 if (val) *val = static_cast< unsigned int >(v);
1804 }
1805 }
1806 return res;
1807 }
1808
1809
1810 SWIGINTERNINLINE SV *
SWIG_PERL_DECL_ARGS_1(bool value)1811 SWIG_From_bool SWIG_PERL_DECL_ARGS_1(bool value)
1812 {
1813 return boolSV(value);
1814 }
1815
1816
1817 SWIGINTERN int
SWIG_AsCharArray(SV * obj,char * val,size_t size)1818 SWIG_AsCharArray(SV * obj, char *val, size_t size)
1819 {
1820 char* cptr = 0; size_t csize = 0; int alloc = SWIG_OLDOBJ;
1821 int res = SWIG_AsCharPtrAndSize(obj, &cptr, &csize, &alloc);
1822 if (SWIG_IsOK(res)) {
1823 /* special case of single char conversion when we don't need space for NUL */
1824 if (size == 1 && csize == 2 && cptr && !cptr[1]) --csize;
1825 if (csize <= size) {
1826 if (val) {
1827 if (csize) memcpy(val, cptr, csize*sizeof(char));
1828 if (csize < size) memset(val + csize, 0, (size - csize)*sizeof(char));
1829 }
1830 if (alloc == SWIG_NEWOBJ) {
1831 delete[] cptr;
1832 res = SWIG_DelNewMask(res);
1833 }
1834 return res;
1835 }
1836 if (alloc == SWIG_NEWOBJ) delete[] cptr;
1837 }
1838 return SWIG_TypeError;
1839 }
1840
1841
1842 SWIGINTERN int
SWIG_PERL_DECL_ARGS_2(SV * obj,long * val)1843 SWIG_AsVal_long SWIG_PERL_DECL_ARGS_2(SV *obj, long* val)
1844 {
1845 if (SvUOK(obj)) {
1846 UV v = SvUV(obj);
1847 if (v <= LONG_MAX) {
1848 if (val) *val = v;
1849 return SWIG_OK;
1850 }
1851 return SWIG_OverflowError;
1852 } else if (SvIOK(obj)) {
1853 IV v = SvIV(obj);
1854 if (v >= LONG_MIN && v <= LONG_MAX) {
1855 if(val) *val = v;
1856 return SWIG_OK;
1857 }
1858 return SWIG_OverflowError;
1859 } else {
1860 int dispatch = 0;
1861 const char *nptr = SvPV_nolen(obj);
1862 if (nptr) {
1863 char *endptr;
1864 long v;
1865 errno = 0;
1866 v = strtol(nptr, &endptr,0);
1867 if (errno == ERANGE) {
1868 errno = 0;
1869 return SWIG_OverflowError;
1870 } else {
1871 if (*endptr == '\0') {
1872 if (val) *val = v;
1873 return SWIG_Str2NumCast(SWIG_OK);
1874 }
1875 }
1876 }
1877 if (!dispatch) {
1878 double d;
1879 int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d));
1880 if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
1881 if (val) *val = (long)(d);
1882 return res;
1883 }
1884 }
1885 }
1886 return SWIG_TypeError;
1887 }
1888
1889
1890 SWIGINTERN int
SWIG_PERL_DECL_ARGS_2(SV * obj,char * val)1891 SWIG_AsVal_char SWIG_PERL_DECL_ARGS_2(SV * obj, char *val)
1892 {
1893 int res = SWIG_AsCharArray(obj, val, 1);
1894 if (!SWIG_IsOK(res)) {
1895 long v;
1896 res = SWIG_AddCast(SWIG_AsVal_long SWIG_PERL_CALL_ARGS_2(obj, &v));
1897 if (SWIG_IsOK(res)) {
1898 if ((CHAR_MIN <= v) && (v <= CHAR_MAX)) {
1899 if (val) *val = static_cast< char >(v);
1900 } else {
1901 res = SWIG_OverflowError;
1902 }
1903 }
1904 }
1905 return res;
1906 }
1907
1908
1909 SWIGINTERNINLINE SV *
SWIG_FromCharPtrAndSize(const char * carray,size_t size)1910 SWIG_FromCharPtrAndSize(const char* carray, size_t size)
1911 {
1912 SV *obj = sv_newmortal();
1913 if (carray) {
1914 sv_setpvn(obj, carray, size);
1915 } else {
1916 sv_setsv(obj, &PL_sv_undef);
1917 }
1918 return obj;
1919 }
1920
1921
1922 SWIGINTERNINLINE SV *
SWIG_PERL_DECL_ARGS_1(char c)1923 SWIG_From_char SWIG_PERL_DECL_ARGS_1(char c)
1924 {
1925 return SWIG_FromCharPtrAndSize(&c,1);
1926 }
1927
MerDNA_dup(MerDNA const * self)1928 SWIGINTERN MerDNA MerDNA_dup(MerDNA const *self){ return MerDNA(*self); }
MerDNA___str__(MerDNA * self)1929 SWIGINTERN std::string MerDNA___str__(MerDNA *self){ return self->to_str(); }
1930
1931 SWIGINTERNINLINE SV *
SWIG_PERL_DECL_ARGS_1(const std::string & s)1932 SWIG_From_std_string SWIG_PERL_DECL_ARGS_1(const std::string& s)
1933 {
1934 return SWIG_FromCharPtrAndSize(s.data(), s.size());
1935 }
1936
MerDNA_set(MerDNA * self,char const * s)1937 SWIGINTERN void MerDNA_set(MerDNA *self,char const *s){ *static_cast<jellyfish::mer_dna*>(self) = s; }
MerDNA_get_base(MerDNA * self,unsigned int i)1938 SWIGINTERN char MerDNA_get_base(MerDNA *self,unsigned int i){ return (char)self->base(i); }
MerDNA_set_base(MerDNA * self,unsigned int i,char b)1939 SWIGINTERN void MerDNA_set_base(MerDNA *self,unsigned int i,char b){ self->base(i) = b; }
1940
1941 class QueryMerFile {
1942 std::unique_ptr<jellyfish::mer_dna_bloom_filter> bf;
1943 jellyfish::mapped_file binary_map;
1944 std::unique_ptr<binary_query> jf;
1945
1946 public:
QueryMerFile(const char * path)1947 QueryMerFile(const char* path) throw(std::runtime_error) {
1948 std::ifstream in(path);
1949 if(!in.good())
1950 throw std::runtime_error(std::string("Can't open file '") + path + "'");
1951 jellyfish::file_header header(in);
1952 jellyfish::mer_dna::k(header.key_len() / 2);
1953 if(header.format() == "bloomcounter") {
1954 jellyfish::hash_pair<jellyfish::mer_dna> fns(header.matrix(1), header.matrix(2));
1955 bf.reset(new jellyfish::mer_dna_bloom_filter(header.size(), header.nb_hashes(), in, fns));
1956 if(!in.good())
1957 throw std::runtime_error("Bloom filter file is truncated");
1958 } else if(header.format() == "binary/sorted") {
1959 binary_map.map(path);
1960 jf.reset(new binary_query(binary_map.base() + header.offset(), header.key_len(), header.counter_len(), header.matrix(),
1961 header.size() - 1, binary_map.length() - header.offset()));
1962 } else {
1963 throw std::runtime_error(std::string("Unsupported format '") + header.format() + "'");
1964 }
1965 }
1966
1967 #ifdef SWIGPERL
get(const MerDNA & m)1968 unsigned int get(const MerDNA& m) { return jf ? jf->check(m) : bf->check(m); }
1969 #else
__getitem__(const MerDNA & m)1970 unsigned int __getitem__(const MerDNA& m) { return jf ? jf->check(m) : bf->check(m); }
1971 #endif
1972 };
1973
1974
1975 class ReadMerFile {
1976 std::ifstream in;
1977 std::unique_ptr<binary_reader> binary;
1978 std::unique_ptr<text_reader> text;
1979
next_mer__()1980 std::pair<const MerDNA*, uint64_t> next_mer__() {
1981 std::pair<const MerDNA*, uint64_t> res((const MerDNA*)0, 0);
1982 if(next_mer()) {
1983 res.first = mer();
1984 res.second = count();
1985 }
1986 return res;
1987 }
1988
1989 public:
ReadMerFile(const char * path)1990 ReadMerFile(const char* path) throw(std::runtime_error) :
1991 in(path)
1992 {
1993 if(!in.good())
1994 throw std::runtime_error(std::string("Can't open file '") + path + "'");
1995 jellyfish::file_header header(in);
1996 jellyfish::mer_dna::k(header.key_len() / 2);
1997 if(header.format() == binary_dumper::format)
1998 binary.reset(new binary_reader(in, &header));
1999 else if(header.format() == text_dumper::format)
2000 text.reset(new text_reader(in, &header));
2001 else
2002 throw std::runtime_error(std::string("Unsupported format '") + header.format() + "'");
2003 }
2004
next_mer()2005 bool next_mer() {
2006 if(binary) {
2007 if(binary->next()) return true;
2008 binary.reset();
2009 } else if(text) {
2010 if(text->next()) return true;
2011 text.reset();
2012 }
2013 return false;
2014 }
2015
mer() const2016 const MerDNA* mer() const { return static_cast<const MerDNA*>(binary ? &binary->key() : &text->key()); }
count() const2017 unsigned long count() const { return binary ? binary->val() : text->val(); }
2018
2019 #ifdef SWIGRUBY
each()2020 void each() {
2021 if(!rb_block_given_p()) return;
2022 while(next_mer()) {
2023 auto m = SWIG_NewPointerObj(const_cast<MerDNA*>(mer()), SWIGTYPE_p_MerDNA, 0);
2024 auto c = SWIG_From_unsigned_SS_long(count());
2025 rb_yield(rb_ary_new3(2, m, c));
2026 }
2027 }
2028 #endif
2029
2030 #ifdef SWIGPERL
each()2031 std::pair<const MerDNA*, uint64_t> each() { return next_mer__(); }
2032 #endif
2033
2034 #ifdef SWIGPYTHON
__iter__()2035 ReadMerFile* __iter__() { return this; }
__next__()2036 std::pair<const MerDNA*, uint64_t> __next__() { return next_mer__(); }
next()2037 std::pair<const MerDNA*, uint64_t> next() { return next_mer__(); }
2038 #endif
2039 };
2040
2041
2042 class HashCounter : public jellyfish::cooperative::hash_counter<jellyfish::mer_dna> {
2043 typedef jellyfish::cooperative::hash_counter<jellyfish::mer_dna> super;
2044 public:
HashCounter(size_t size,unsigned int val_len,unsigned int nb_threads=1)2045 HashCounter(size_t size, unsigned int val_len, unsigned int nb_threads = 1) : \
2046 super(size, jellyfish::mer_dna::k() * 2, val_len, nb_threads)
2047 { }
2048
add(const MerDNA & m,const int & x)2049 bool add(const MerDNA& m, const int& x) {
2050 bool res;
2051 size_t id;
2052 super::add(m, x, &res, &id);
2053 return res;
2054 }
2055
2056 };
2057
2058
2059 SWIGINTERNINLINE int
SWIG_PERL_DECL_ARGS_2(SV * obj,size_t * val)2060 SWIG_AsVal_size_t SWIG_PERL_DECL_ARGS_2(SV * obj, size_t *val)
2061 {
2062 unsigned long v;
2063 int res = SWIG_AsVal_unsigned_SS_long SWIG_PERL_CALL_ARGS_2(obj, val ? &v : 0);
2064 if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v);
2065 return res;
2066 }
2067
2068
2069 SWIGINTERNINLINE SV *
SWIG_PERL_DECL_ARGS_1(size_t value)2070 SWIG_From_size_t SWIG_PERL_DECL_ARGS_1(size_t value)
2071 {
2072 return SWIG_From_unsigned_SS_long SWIG_PERL_CALL_ARGS_1(static_cast< unsigned long >(value));
2073 }
2074
2075
2076 SWIGINTERN int
SWIG_PERL_DECL_ARGS_2(SV * obj,int * val)2077 SWIG_AsVal_int SWIG_PERL_DECL_ARGS_2(SV * obj, int *val)
2078 {
2079 long v;
2080 int res = SWIG_AsVal_long SWIG_PERL_CALL_ARGS_2(obj, &v);
2081 if (SWIG_IsOK(res)) {
2082 if ((v < INT_MIN || v > INT_MAX)) {
2083 return SWIG_OverflowError;
2084 } else {
2085 if (val) *val = static_cast< int >(v);
2086 }
2087 }
2088 return res;
2089 }
2090
HashCounter_get(HashCounter const * self,MerDNA const & m,std::pair<bool,uint64_t> * COUNT)2091 SWIGINTERN void HashCounter_get(HashCounter const *self,MerDNA const &m,std::pair< bool,uint64_t > *COUNT){
2092 COUNT->first = self->ary()->get_val_for_key(m, &COUNT->second);
2093 }
2094
2095 class HashSet : public jellyfish::cooperative::hash_counter<jellyfish::mer_dna> {
2096 typedef jellyfish::cooperative::hash_counter<jellyfish::mer_dna> super;
2097 public:
HashSet(size_t size,unsigned int nb_threads=1)2098 HashSet(size_t size, unsigned int nb_threads = 1) : \
2099 super(size, jellyfish::mer_dna::k() * 2, 0, nb_threads)
2100 { }
2101
add(const MerDNA & m)2102 bool add(const MerDNA& m) {
2103 bool res;
2104 size_t id;
2105 super::set(m, &res, &id);
2106 return res;
2107 }
2108 };
2109
HashSet_get(HashSet const * self,MerDNA const & m)2110 SWIGINTERN bool HashSet_get(HashSet const *self,MerDNA const &m){ return self->ary()->has_key(m); }
2111
2112 class StringMers {
2113 const char* m_current;
2114 const char* const m_last;
2115 const bool m_canonical;
2116 MerDNA m_m, m_rcm;
2117 unsigned int m_filled;
2118
2119 public:
StringMers(const char * str,int len,bool canonical)2120 StringMers(const char* str, int len, bool canonical)
2121 : m_current(str)
2122 , m_last(str + len)
2123 , m_canonical(canonical)
2124 , m_filled(0)
2125 { }
2126
next_mer()2127 bool next_mer() {
2128 if(m_current == m_last)
2129 return false;
2130
2131 do {
2132 int code = jellyfish::mer_dna::code(*m_current);
2133 ++m_current;
2134 if(code >= 0) {
2135 m_m.shift_left(code);
2136 if(m_canonical)
2137 m_rcm.shift_right(m_rcm.complement(code));
2138 m_filled = std::min(m_filled + 1, m_m.k());
2139 } else
2140 m_filled = 0;
2141 } while(m_filled < m_m.k() && m_current != m_last);
2142 return m_filled == m_m.k();
2143 }
2144
mer() const2145 const MerDNA* mer() const { return !m_canonical || m_m < m_rcm ? &m_m : &m_rcm; }
2146
next_mer__()2147 const MerDNA* next_mer__() {
2148 return next_mer() ? mer() : nullptr;
2149 }
2150
2151
2152 #ifdef SWIGRUBY
each()2153 void each() {
2154 if(!rb_block_given_p()) return;
2155 while(next_mer()) {
2156 auto m = SWIG_NewPointerObj(const_cast<MerDNA*>(mer()), SWIGTYPE_p_MerDNA, 0);
2157 rb_yield(m);
2158 }
2159 }
2160 #endif
2161
2162 #ifdef SWIGPYTHON
__iter__()2163 StringMers* __iter__() { return this; }
__next__()2164 const MerDNA* __next__() { return next_mer__(); }
next()2165 const MerDNA* next() { return next_mer__(); }
2166 #endif
2167
2168 #ifdef SWIGPERL
each()2169 const MerDNA* each() { return next_mer__(); }
2170 #endif
2171
2172 };
2173
string_mers(char * str,int length)2174 StringMers* string_mers(char* str, int length) { return new StringMers(str, length, false); }
string_canonicals(char * str,int length)2175 StringMers* string_canonicals(char* str, int length) { return new StringMers(str, length, true); }
2176
2177
2178 SWIGINTERN int
SWIG_PERL_DECL_ARGS_2(SV * obj,bool * val)2179 SWIG_AsVal_bool SWIG_PERL_DECL_ARGS_2(SV *obj, bool* val)
2180 {
2181 if (obj == &PL_sv_yes) {
2182 if (val) *val = true;
2183 return SWIG_OK;
2184 } else if (obj == &PL_sv_no) {
2185 if (val) *val = false;
2186 return SWIG_OK;
2187 } else {
2188 if (val) *val = SvTRUE(obj) ? true : false;
2189 return SWIG_AddCast(SWIG_OK);
2190 }
2191 }
2192
2193 #ifdef __cplusplus
2194 extern "C" {
2195 #endif
2196
2197 #ifdef PERL_OBJECT
2198 #define MAGIC_CLASS _wrap_jellyfish_var::
2199 class _wrap_jellyfish_var : public CPerlObj {
2200 public:
2201 #else
2202 #define MAGIC_CLASS
2203 #endif
swig_magic_readonly(pTHX_ SV * SWIGUNUSEDPARM (sv),MAGIC * SWIGUNUSEDPARM (mg))2204 SWIGCLASS_STATIC int swig_magic_readonly(pTHX_ SV *SWIGUNUSEDPARM(sv), MAGIC *SWIGUNUSEDPARM(mg)) {
2205 MAGIC_PPERL
2206 croak("Value is read-only.");
2207 return 0;
2208 }
2209
2210
2211 #ifdef PERL_OBJECT
2212 };
2213 #endif
2214
2215 #ifdef __cplusplus
2216 }
2217 #endif
2218
2219 #ifdef __cplusplus
2220 extern "C" {
2221 #endif
XS(_wrap_new_MerDNA__SWIG_0)2222 XS(_wrap_new_MerDNA__SWIG_0) {
2223 {
2224 int argvi = 0;
2225 MerDNA *result = 0 ;
2226 dXSARGS;
2227
2228 if ((items < 0) || (items > 0)) {
2229 SWIG_croak("Usage: new_MerDNA();");
2230 }
2231 result = (MerDNA *)new MerDNA();
2232 ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MerDNA, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
2233 XSRETURN(argvi);
2234 fail:
2235 SWIG_croak_null();
2236 }
2237 }
2238
2239
XS(_wrap_new_MerDNA__SWIG_1)2240 XS(_wrap_new_MerDNA__SWIG_1) {
2241 {
2242 char *arg1 = (char *) 0 ;
2243 int res1 ;
2244 char *buf1 = 0 ;
2245 int alloc1 = 0 ;
2246 int argvi = 0;
2247 MerDNA *result = 0 ;
2248 dXSARGS;
2249
2250 if ((items < 1) || (items > 1)) {
2251 SWIG_croak("Usage: new_MerDNA(char const *);");
2252 }
2253 res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
2254 if (!SWIG_IsOK(res1)) {
2255 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_MerDNA" "', argument " "1"" of type '" "char const *""'");
2256 }
2257 arg1 = reinterpret_cast< char * >(buf1);
2258 result = (MerDNA *)new MerDNA((char const *)arg1);
2259 ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MerDNA, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
2260 if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
2261 XSRETURN(argvi);
2262 fail:
2263 if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
2264 SWIG_croak_null();
2265 }
2266 }
2267
2268
XS(_wrap_new_MerDNA__SWIG_2)2269 XS(_wrap_new_MerDNA__SWIG_2) {
2270 {
2271 MerDNA *arg1 = 0 ;
2272 void *argp1 ;
2273 int res1 = 0 ;
2274 int argvi = 0;
2275 MerDNA *result = 0 ;
2276 dXSARGS;
2277
2278 if ((items < 1) || (items > 1)) {
2279 SWIG_croak("Usage: new_MerDNA(MerDNA const &);");
2280 }
2281 res1 = SWIG_ConvertPtr(ST(0), &argp1, SWIGTYPE_p_MerDNA, 0 );
2282 if (!SWIG_IsOK(res1)) {
2283 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_MerDNA" "', argument " "1"" of type '" "MerDNA const &""'");
2284 }
2285 if (!argp1) {
2286 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_MerDNA" "', argument " "1"" of type '" "MerDNA const &""'");
2287 }
2288 arg1 = reinterpret_cast< MerDNA * >(argp1);
2289 result = (MerDNA *)new MerDNA((MerDNA const &)*arg1);
2290 ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MerDNA, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
2291
2292 XSRETURN(argvi);
2293 fail:
2294
2295 SWIG_croak_null();
2296 }
2297 }
2298
2299
XS(_wrap_new_MerDNA)2300 XS(_wrap_new_MerDNA) {
2301 dXSARGS;
2302
2303 {
2304 unsigned long _index = 0;
2305 SWIG_TypeRank _rank = 0;
2306 if (items == 0) {
2307 SWIG_TypeRank _ranki = 0;
2308 SWIG_TypeRank _rankm = 0;
2309 if (!_index || (_ranki < _rank)) {
2310 _rank = _ranki; _index = 1;
2311 if (_rank == _rankm) goto dispatch;
2312 }
2313 }
2314 if (items == 1) {
2315 SWIG_TypeRank _ranki = 0;
2316 SWIG_TypeRank _rankm = 0;
2317 SWIG_TypeRank _pi = 1;
2318 int _v = 0;
2319 {
2320 void *vptr = 0;
2321 int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_MerDNA, 0);
2322 _v = SWIG_CheckState(res);
2323 }
2324 if (!_v) goto check_2;
2325 _ranki += _v*_pi;
2326 _rankm += _pi;
2327 _pi *= SWIG_MAXCASTRANK;
2328 if (!_index || (_ranki < _rank)) {
2329 _rank = _ranki; _index = 2;
2330 if (_rank == _rankm) goto dispatch;
2331 }
2332 }
2333 check_2:
2334
2335 if (items == 1) {
2336 SWIG_TypeRank _ranki = 0;
2337 SWIG_TypeRank _rankm = 0;
2338 SWIG_TypeRank _pi = 1;
2339 int _v = 0;
2340 {
2341 int res = SWIG_AsCharPtrAndSize(ST(0), 0, NULL, 0);
2342 _v = SWIG_CheckState(res);
2343 }
2344 if (!_v) goto check_3;
2345 _ranki += _v*_pi;
2346 _rankm += _pi;
2347 _pi *= SWIG_MAXCASTRANK;
2348 if (!_index || (_ranki < _rank)) {
2349 _rank = _ranki; _index = 3;
2350 if (_rank == _rankm) goto dispatch;
2351 }
2352 }
2353 check_3:
2354
2355 dispatch:
2356 switch(_index) {
2357 case 1:
2358 PUSHMARK(MARK); SWIG_CALLXS(_wrap_new_MerDNA__SWIG_0); return;
2359 case 2:
2360 PUSHMARK(MARK); SWIG_CALLXS(_wrap_new_MerDNA__SWIG_2); return;
2361 case 3:
2362 PUSHMARK(MARK); SWIG_CALLXS(_wrap_new_MerDNA__SWIG_1); return;
2363 }
2364 }
2365
2366 croak("No matching function for overloaded 'new_MerDNA'");
2367 XSRETURN(0);
2368 }
2369
2370
XS(_wrap_MerDNA_k__SWIG_0)2371 XS(_wrap_MerDNA_k__SWIG_0) {
2372 {
2373 int argvi = 0;
2374 unsigned int result;
2375 dXSARGS;
2376
2377 if ((items < 0) || (items > 0)) {
2378 SWIG_croak("Usage: MerDNA_k();");
2379 }
2380 result = (unsigned int)MerDNA::k();
2381 ST(argvi) = SWIG_From_unsigned_SS_int SWIG_PERL_CALL_ARGS_1(static_cast< unsigned int >(result)); argvi++ ;
2382 XSRETURN(argvi);
2383 fail:
2384 SWIG_croak_null();
2385 }
2386 }
2387
2388
XS(_wrap_MerDNA_k__SWIG_1)2389 XS(_wrap_MerDNA_k__SWIG_1) {
2390 {
2391 unsigned int arg1 ;
2392 unsigned int val1 ;
2393 int ecode1 = 0 ;
2394 int argvi = 0;
2395 unsigned int result;
2396 dXSARGS;
2397
2398 if ((items < 1) || (items > 1)) {
2399 SWIG_croak("Usage: MerDNA_k(unsigned int);");
2400 }
2401 ecode1 = SWIG_AsVal_unsigned_SS_int SWIG_PERL_CALL_ARGS_2(ST(0), &val1);
2402 if (!SWIG_IsOK(ecode1)) {
2403 SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "MerDNA_k" "', argument " "1"" of type '" "unsigned int""'");
2404 }
2405 arg1 = static_cast< unsigned int >(val1);
2406 result = (unsigned int)MerDNA::k(arg1);
2407 ST(argvi) = SWIG_From_unsigned_SS_int SWIG_PERL_CALL_ARGS_1(static_cast< unsigned int >(result)); argvi++ ;
2408
2409 XSRETURN(argvi);
2410 fail:
2411
2412 SWIG_croak_null();
2413 }
2414 }
2415
2416
XS(_wrap_MerDNA_k)2417 XS(_wrap_MerDNA_k) {
2418 dXSARGS;
2419
2420 {
2421 unsigned long _index = 0;
2422 SWIG_TypeRank _rank = 0;
2423 if (items == 0) {
2424 SWIG_TypeRank _ranki = 0;
2425 SWIG_TypeRank _rankm = 0;
2426 if (!_index || (_ranki < _rank)) {
2427 _rank = _ranki; _index = 1;
2428 if (_rank == _rankm) goto dispatch;
2429 }
2430 }
2431 if (items == 1) {
2432 SWIG_TypeRank _ranki = 0;
2433 SWIG_TypeRank _rankm = 0;
2434 SWIG_TypeRank _pi = 1;
2435 int _v = 0;
2436 {
2437 {
2438 int res = SWIG_AsVal_unsigned_SS_int SWIG_PERL_CALL_ARGS_2(ST(0), NULL);
2439 _v = SWIG_CheckState(res);
2440 }
2441 }
2442 if (!_v) goto check_2;
2443 _ranki += _v*_pi;
2444 _rankm += _pi;
2445 _pi *= SWIG_MAXCASTRANK;
2446 if (!_index || (_ranki < _rank)) {
2447 _rank = _ranki; _index = 2;
2448 if (_rank == _rankm) goto dispatch;
2449 }
2450 }
2451 check_2:
2452
2453 dispatch:
2454 switch(_index) {
2455 case 1:
2456 PUSHMARK(MARK); SWIG_CALLXS(_wrap_MerDNA_k__SWIG_0); return;
2457 case 2:
2458 PUSHMARK(MARK); SWIG_CALLXS(_wrap_MerDNA_k__SWIG_1); return;
2459 }
2460 }
2461
2462 croak("No matching function for overloaded 'MerDNA_k'");
2463 XSRETURN(0);
2464 }
2465
2466
XS(_wrap_MerDNA_polyA)2467 XS(_wrap_MerDNA_polyA) {
2468 {
2469 MerDNA *arg1 = (MerDNA *) 0 ;
2470 void *argp1 = 0 ;
2471 int res1 = 0 ;
2472 int argvi = 0;
2473 dXSARGS;
2474
2475 if ((items < 1) || (items > 1)) {
2476 SWIG_croak("Usage: MerDNA_polyA(self);");
2477 }
2478 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MerDNA, 0 | 0 );
2479 if (!SWIG_IsOK(res1)) {
2480 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA_polyA" "', argument " "1"" of type '" "MerDNA *""'");
2481 }
2482 arg1 = reinterpret_cast< MerDNA * >(argp1);
2483 (arg1)->polyA();
2484 ST(argvi) = sv_newmortal();
2485
2486 XSRETURN(argvi);
2487 fail:
2488
2489 SWIG_croak_null();
2490 }
2491 }
2492
2493
XS(_wrap_MerDNA_polyC)2494 XS(_wrap_MerDNA_polyC) {
2495 {
2496 MerDNA *arg1 = (MerDNA *) 0 ;
2497 void *argp1 = 0 ;
2498 int res1 = 0 ;
2499 int argvi = 0;
2500 dXSARGS;
2501
2502 if ((items < 1) || (items > 1)) {
2503 SWIG_croak("Usage: MerDNA_polyC(self);");
2504 }
2505 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MerDNA, 0 | 0 );
2506 if (!SWIG_IsOK(res1)) {
2507 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA_polyC" "', argument " "1"" of type '" "MerDNA *""'");
2508 }
2509 arg1 = reinterpret_cast< MerDNA * >(argp1);
2510 (arg1)->polyC();
2511 ST(argvi) = sv_newmortal();
2512
2513 XSRETURN(argvi);
2514 fail:
2515
2516 SWIG_croak_null();
2517 }
2518 }
2519
2520
XS(_wrap_MerDNA_polyG)2521 XS(_wrap_MerDNA_polyG) {
2522 {
2523 MerDNA *arg1 = (MerDNA *) 0 ;
2524 void *argp1 = 0 ;
2525 int res1 = 0 ;
2526 int argvi = 0;
2527 dXSARGS;
2528
2529 if ((items < 1) || (items > 1)) {
2530 SWIG_croak("Usage: MerDNA_polyG(self);");
2531 }
2532 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MerDNA, 0 | 0 );
2533 if (!SWIG_IsOK(res1)) {
2534 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA_polyG" "', argument " "1"" of type '" "MerDNA *""'");
2535 }
2536 arg1 = reinterpret_cast< MerDNA * >(argp1);
2537 (arg1)->polyG();
2538 ST(argvi) = sv_newmortal();
2539
2540 XSRETURN(argvi);
2541 fail:
2542
2543 SWIG_croak_null();
2544 }
2545 }
2546
2547
XS(_wrap_MerDNA_polyT)2548 XS(_wrap_MerDNA_polyT) {
2549 {
2550 MerDNA *arg1 = (MerDNA *) 0 ;
2551 void *argp1 = 0 ;
2552 int res1 = 0 ;
2553 int argvi = 0;
2554 dXSARGS;
2555
2556 if ((items < 1) || (items > 1)) {
2557 SWIG_croak("Usage: MerDNA_polyT(self);");
2558 }
2559 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MerDNA, 0 | 0 );
2560 if (!SWIG_IsOK(res1)) {
2561 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA_polyT" "', argument " "1"" of type '" "MerDNA *""'");
2562 }
2563 arg1 = reinterpret_cast< MerDNA * >(argp1);
2564 (arg1)->polyT();
2565 ST(argvi) = sv_newmortal();
2566
2567 XSRETURN(argvi);
2568 fail:
2569
2570 SWIG_croak_null();
2571 }
2572 }
2573
2574
XS(_wrap_MerDNA_randomize)2575 XS(_wrap_MerDNA_randomize) {
2576 {
2577 MerDNA *arg1 = (MerDNA *) 0 ;
2578 void *argp1 = 0 ;
2579 int res1 = 0 ;
2580 int argvi = 0;
2581 dXSARGS;
2582
2583 if ((items < 1) || (items > 1)) {
2584 SWIG_croak("Usage: MerDNA_randomize(self);");
2585 }
2586 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MerDNA, 0 | 0 );
2587 if (!SWIG_IsOK(res1)) {
2588 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA_randomize" "', argument " "1"" of type '" "MerDNA *""'");
2589 }
2590 arg1 = reinterpret_cast< MerDNA * >(argp1);
2591 (arg1)->randomize();
2592 ST(argvi) = sv_newmortal();
2593
2594 XSRETURN(argvi);
2595 fail:
2596
2597 SWIG_croak_null();
2598 }
2599 }
2600
2601
XS(_wrap_MerDNA_is_homopolymer)2602 XS(_wrap_MerDNA_is_homopolymer) {
2603 {
2604 MerDNA *arg1 = (MerDNA *) 0 ;
2605 void *argp1 = 0 ;
2606 int res1 = 0 ;
2607 int argvi = 0;
2608 bool result;
2609 dXSARGS;
2610
2611 if ((items < 1) || (items > 1)) {
2612 SWIG_croak("Usage: MerDNA_is_homopolymer(self);");
2613 }
2614 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MerDNA, 0 | 0 );
2615 if (!SWIG_IsOK(res1)) {
2616 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA_is_homopolymer" "', argument " "1"" of type '" "MerDNA const *""'");
2617 }
2618 arg1 = reinterpret_cast< MerDNA * >(argp1);
2619 result = (bool)((MerDNA const *)arg1)->is_homopolymer();
2620 ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
2621
2622 XSRETURN(argvi);
2623 fail:
2624
2625 SWIG_croak_null();
2626 }
2627 }
2628
2629
XS(_wrap_MerDNA_shift_left)2630 XS(_wrap_MerDNA_shift_left) {
2631 {
2632 MerDNA *arg1 = (MerDNA *) 0 ;
2633 char arg2 ;
2634 void *argp1 = 0 ;
2635 int res1 = 0 ;
2636 char val2 ;
2637 int ecode2 = 0 ;
2638 int argvi = 0;
2639 char result;
2640 dXSARGS;
2641
2642 if ((items < 2) || (items > 2)) {
2643 SWIG_croak("Usage: MerDNA_shift_left(self,char);");
2644 }
2645 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MerDNA, 0 | 0 );
2646 if (!SWIG_IsOK(res1)) {
2647 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA_shift_left" "', argument " "1"" of type '" "MerDNA *""'");
2648 }
2649 arg1 = reinterpret_cast< MerDNA * >(argp1);
2650 ecode2 = SWIG_AsVal_char SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
2651 if (!SWIG_IsOK(ecode2)) {
2652 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MerDNA_shift_left" "', argument " "2"" of type '" "char""'");
2653 }
2654 arg2 = static_cast< char >(val2);
2655 result = (char)(arg1)->shift_left(arg2);
2656 ST(argvi) = SWIG_From_char SWIG_PERL_CALL_ARGS_1(static_cast< char >(result)); argvi++ ;
2657
2658
2659 XSRETURN(argvi);
2660 fail:
2661
2662
2663 SWIG_croak_null();
2664 }
2665 }
2666
2667
XS(_wrap_MerDNA_shift_right)2668 XS(_wrap_MerDNA_shift_right) {
2669 {
2670 MerDNA *arg1 = (MerDNA *) 0 ;
2671 char arg2 ;
2672 void *argp1 = 0 ;
2673 int res1 = 0 ;
2674 char val2 ;
2675 int ecode2 = 0 ;
2676 int argvi = 0;
2677 char result;
2678 dXSARGS;
2679
2680 if ((items < 2) || (items > 2)) {
2681 SWIG_croak("Usage: MerDNA_shift_right(self,char);");
2682 }
2683 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MerDNA, 0 | 0 );
2684 if (!SWIG_IsOK(res1)) {
2685 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA_shift_right" "', argument " "1"" of type '" "MerDNA *""'");
2686 }
2687 arg1 = reinterpret_cast< MerDNA * >(argp1);
2688 ecode2 = SWIG_AsVal_char SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
2689 if (!SWIG_IsOK(ecode2)) {
2690 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MerDNA_shift_right" "', argument " "2"" of type '" "char""'");
2691 }
2692 arg2 = static_cast< char >(val2);
2693 result = (char)(arg1)->shift_right(arg2);
2694 ST(argvi) = SWIG_From_char SWIG_PERL_CALL_ARGS_1(static_cast< char >(result)); argvi++ ;
2695
2696
2697 XSRETURN(argvi);
2698 fail:
2699
2700
2701 SWIG_croak_null();
2702 }
2703 }
2704
2705
XS(_wrap_MerDNA_canonicalize)2706 XS(_wrap_MerDNA_canonicalize) {
2707 {
2708 MerDNA *arg1 = (MerDNA *) 0 ;
2709 void *argp1 = 0 ;
2710 int res1 = 0 ;
2711 int argvi = 0;
2712 dXSARGS;
2713
2714 if ((items < 1) || (items > 1)) {
2715 SWIG_croak("Usage: MerDNA_canonicalize(self);");
2716 }
2717 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MerDNA, 0 | 0 );
2718 if (!SWIG_IsOK(res1)) {
2719 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA_canonicalize" "', argument " "1"" of type '" "MerDNA *""'");
2720 }
2721 arg1 = reinterpret_cast< MerDNA * >(argp1);
2722 (arg1)->canonicalize();
2723 ST(argvi) = sv_newmortal();
2724
2725 XSRETURN(argvi);
2726 fail:
2727
2728 SWIG_croak_null();
2729 }
2730 }
2731
2732
XS(_wrap_MerDNA_reverse_complement)2733 XS(_wrap_MerDNA_reverse_complement) {
2734 {
2735 MerDNA *arg1 = (MerDNA *) 0 ;
2736 void *argp1 = 0 ;
2737 int res1 = 0 ;
2738 int argvi = 0;
2739 dXSARGS;
2740
2741 if ((items < 1) || (items > 1)) {
2742 SWIG_croak("Usage: MerDNA_reverse_complement(self);");
2743 }
2744 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MerDNA, 0 | 0 );
2745 if (!SWIG_IsOK(res1)) {
2746 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA_reverse_complement" "', argument " "1"" of type '" "MerDNA *""'");
2747 }
2748 arg1 = reinterpret_cast< MerDNA * >(argp1);
2749 (arg1)->reverse_complement();
2750 ST(argvi) = sv_newmortal();
2751
2752 XSRETURN(argvi);
2753 fail:
2754
2755 SWIG_croak_null();
2756 }
2757 }
2758
2759
XS(_wrap_MerDNA_get_canonical)2760 XS(_wrap_MerDNA_get_canonical) {
2761 {
2762 MerDNA *arg1 = (MerDNA *) 0 ;
2763 void *argp1 = 0 ;
2764 int res1 = 0 ;
2765 int argvi = 0;
2766 MerDNA result;
2767 dXSARGS;
2768
2769 if ((items < 1) || (items > 1)) {
2770 SWIG_croak("Usage: MerDNA_get_canonical(self);");
2771 }
2772 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MerDNA, 0 | 0 );
2773 if (!SWIG_IsOK(res1)) {
2774 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA_get_canonical" "', argument " "1"" of type '" "MerDNA const *""'");
2775 }
2776 arg1 = reinterpret_cast< MerDNA * >(argp1);
2777 result = ((MerDNA const *)arg1)->get_canonical();
2778 ST(argvi) = SWIG_NewPointerObj((new MerDNA(static_cast< const MerDNA& >(result))), SWIGTYPE_p_MerDNA, SWIG_POINTER_OWN | SWIG_SHADOW); argvi++ ;
2779
2780 XSRETURN(argvi);
2781 fail:
2782
2783 SWIG_croak_null();
2784 }
2785 }
2786
2787
XS(_wrap_MerDNA_get_reverse_complement)2788 XS(_wrap_MerDNA_get_reverse_complement) {
2789 {
2790 MerDNA *arg1 = (MerDNA *) 0 ;
2791 void *argp1 = 0 ;
2792 int res1 = 0 ;
2793 int argvi = 0;
2794 MerDNA result;
2795 dXSARGS;
2796
2797 if ((items < 1) || (items > 1)) {
2798 SWIG_croak("Usage: MerDNA_get_reverse_complement(self);");
2799 }
2800 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MerDNA, 0 | 0 );
2801 if (!SWIG_IsOK(res1)) {
2802 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA_get_reverse_complement" "', argument " "1"" of type '" "MerDNA const *""'");
2803 }
2804 arg1 = reinterpret_cast< MerDNA * >(argp1);
2805 result = ((MerDNA const *)arg1)->get_reverse_complement();
2806 ST(argvi) = SWIG_NewPointerObj((new MerDNA(static_cast< const MerDNA& >(result))), SWIGTYPE_p_MerDNA, SWIG_POINTER_OWN | SWIG_SHADOW); argvi++ ;
2807
2808 XSRETURN(argvi);
2809 fail:
2810
2811 SWIG_croak_null();
2812 }
2813 }
2814
2815
XS(_wrap_MerDNA___eq__)2816 XS(_wrap_MerDNA___eq__) {
2817 {
2818 MerDNA *arg1 = (MerDNA *) 0 ;
2819 MerDNA *arg2 = 0 ;
2820 void *argp1 = 0 ;
2821 int res1 = 0 ;
2822 void *argp2 ;
2823 int res2 = 0 ;
2824 int argvi = 0;
2825 bool result;
2826 dXSARGS;
2827
2828 if ((items < 2) || (items > 2)) {
2829 SWIG_croak("Usage: MerDNA___eq__(self,MerDNA const &);");
2830 }
2831 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MerDNA, 0 | 0 );
2832 if (!SWIG_IsOK(res1)) {
2833 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA___eq__" "', argument " "1"" of type '" "MerDNA const *""'");
2834 }
2835 arg1 = reinterpret_cast< MerDNA * >(argp1);
2836 res2 = SWIG_ConvertPtr(ST(1), &argp2, SWIGTYPE_p_MerDNA, 0 );
2837 if (!SWIG_IsOK(res2)) {
2838 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MerDNA___eq__" "', argument " "2"" of type '" "MerDNA const &""'");
2839 }
2840 if (!argp2) {
2841 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "MerDNA___eq__" "', argument " "2"" of type '" "MerDNA const &""'");
2842 }
2843 arg2 = reinterpret_cast< MerDNA * >(argp2);
2844 result = (bool)((MerDNA const *)arg1)->operator ==((MerDNA const &)*arg2);
2845 ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
2846
2847
2848 XSRETURN(argvi);
2849 fail:
2850
2851
2852 SWIG_croak_null();
2853 }
2854 }
2855
2856
XS(_wrap_MerDNA___lt__)2857 XS(_wrap_MerDNA___lt__) {
2858 {
2859 MerDNA *arg1 = (MerDNA *) 0 ;
2860 MerDNA *arg2 = 0 ;
2861 void *argp1 = 0 ;
2862 int res1 = 0 ;
2863 void *argp2 ;
2864 int res2 = 0 ;
2865 int argvi = 0;
2866 bool result;
2867 dXSARGS;
2868
2869 if ((items < 2) || (items > 2)) {
2870 SWIG_croak("Usage: MerDNA___lt__(self,MerDNA const &);");
2871 }
2872 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MerDNA, 0 | 0 );
2873 if (!SWIG_IsOK(res1)) {
2874 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA___lt__" "', argument " "1"" of type '" "MerDNA const *""'");
2875 }
2876 arg1 = reinterpret_cast< MerDNA * >(argp1);
2877 res2 = SWIG_ConvertPtr(ST(1), &argp2, SWIGTYPE_p_MerDNA, 0 );
2878 if (!SWIG_IsOK(res2)) {
2879 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MerDNA___lt__" "', argument " "2"" of type '" "MerDNA const &""'");
2880 }
2881 if (!argp2) {
2882 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "MerDNA___lt__" "', argument " "2"" of type '" "MerDNA const &""'");
2883 }
2884 arg2 = reinterpret_cast< MerDNA * >(argp2);
2885 result = (bool)((MerDNA const *)arg1)->operator <((MerDNA const &)*arg2);
2886 ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
2887
2888
2889 XSRETURN(argvi);
2890 fail:
2891
2892
2893 SWIG_croak_null();
2894 }
2895 }
2896
2897
XS(_wrap_MerDNA___gt__)2898 XS(_wrap_MerDNA___gt__) {
2899 {
2900 MerDNA *arg1 = (MerDNA *) 0 ;
2901 MerDNA *arg2 = 0 ;
2902 void *argp1 = 0 ;
2903 int res1 = 0 ;
2904 void *argp2 ;
2905 int res2 = 0 ;
2906 int argvi = 0;
2907 bool result;
2908 dXSARGS;
2909
2910 if ((items < 2) || (items > 2)) {
2911 SWIG_croak("Usage: MerDNA___gt__(self,MerDNA const &);");
2912 }
2913 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MerDNA, 0 | 0 );
2914 if (!SWIG_IsOK(res1)) {
2915 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA___gt__" "', argument " "1"" of type '" "MerDNA const *""'");
2916 }
2917 arg1 = reinterpret_cast< MerDNA * >(argp1);
2918 res2 = SWIG_ConvertPtr(ST(1), &argp2, SWIGTYPE_p_MerDNA, 0 );
2919 if (!SWIG_IsOK(res2)) {
2920 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MerDNA___gt__" "', argument " "2"" of type '" "MerDNA const &""'");
2921 }
2922 if (!argp2) {
2923 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "MerDNA___gt__" "', argument " "2"" of type '" "MerDNA const &""'");
2924 }
2925 arg2 = reinterpret_cast< MerDNA * >(argp2);
2926 result = (bool)((MerDNA const *)arg1)->operator >((MerDNA const &)*arg2);
2927 ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
2928
2929
2930 XSRETURN(argvi);
2931 fail:
2932
2933
2934 SWIG_croak_null();
2935 }
2936 }
2937
2938
XS(_wrap_MerDNA_dup)2939 XS(_wrap_MerDNA_dup) {
2940 {
2941 MerDNA *arg1 = (MerDNA *) 0 ;
2942 void *argp1 = 0 ;
2943 int res1 = 0 ;
2944 int argvi = 0;
2945 MerDNA result;
2946 dXSARGS;
2947
2948 if ((items < 1) || (items > 1)) {
2949 SWIG_croak("Usage: MerDNA_dup(self);");
2950 }
2951 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MerDNA, 0 | 0 );
2952 if (!SWIG_IsOK(res1)) {
2953 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA_dup" "', argument " "1"" of type '" "MerDNA const *""'");
2954 }
2955 arg1 = reinterpret_cast< MerDNA * >(argp1);
2956 result = MerDNA_dup((MerDNA const *)arg1);
2957 ST(argvi) = SWIG_NewPointerObj((new MerDNA(static_cast< const MerDNA& >(result))), SWIGTYPE_p_MerDNA, SWIG_POINTER_OWN | SWIG_SHADOW); argvi++ ;
2958
2959 XSRETURN(argvi);
2960 fail:
2961
2962 SWIG_croak_null();
2963 }
2964 }
2965
2966
XS(_wrap_MerDNA___str__)2967 XS(_wrap_MerDNA___str__) {
2968 {
2969 MerDNA *arg1 = (MerDNA *) 0 ;
2970 void *argp1 = 0 ;
2971 int res1 = 0 ;
2972 int argvi = 0;
2973 std::string result;
2974 dXSARGS;
2975
2976 if ((items < 1) || (items > 1)) {
2977 SWIG_croak("Usage: MerDNA___str__(self);");
2978 }
2979 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MerDNA, 0 | 0 );
2980 if (!SWIG_IsOK(res1)) {
2981 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA___str__" "', argument " "1"" of type '" "MerDNA *""'");
2982 }
2983 arg1 = reinterpret_cast< MerDNA * >(argp1);
2984 result = MerDNA___str__(arg1);
2985 ST(argvi) = SWIG_From_std_string SWIG_PERL_CALL_ARGS_1(static_cast< std::string >(result)); argvi++ ;
2986
2987 XSRETURN(argvi);
2988 fail:
2989
2990 SWIG_croak_null();
2991 }
2992 }
2993
2994
XS(_wrap_MerDNA_set)2995 XS(_wrap_MerDNA_set) {
2996 {
2997 MerDNA *arg1 = (MerDNA *) 0 ;
2998 char *arg2 = (char *) 0 ;
2999 void *argp1 = 0 ;
3000 int res1 = 0 ;
3001 int res2 ;
3002 char *buf2 = 0 ;
3003 int alloc2 = 0 ;
3004 int argvi = 0;
3005 dXSARGS;
3006
3007 if ((items < 2) || (items > 2)) {
3008 SWIG_croak("Usage: MerDNA_set(self,s);");
3009 }
3010 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MerDNA, 0 | 0 );
3011 if (!SWIG_IsOK(res1)) {
3012 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA_set" "', argument " "1"" of type '" "MerDNA *""'");
3013 }
3014 arg1 = reinterpret_cast< MerDNA * >(argp1);
3015 res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
3016 if (!SWIG_IsOK(res2)) {
3017 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MerDNA_set" "', argument " "2"" of type '" "char const *""'");
3018 }
3019 arg2 = reinterpret_cast< char * >(buf2);
3020 try {
3021 MerDNA_set(arg1,(char const *)arg2);
3022 }
3023 catch(std::length_error &_e) {
3024 SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
3025 }
3026
3027 ST(argvi) = sv_newmortal();
3028
3029 if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
3030 XSRETURN(argvi);
3031 fail:
3032
3033 if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
3034 SWIG_croak_null();
3035 }
3036 }
3037
3038
XS(_wrap_MerDNA_get_base)3039 XS(_wrap_MerDNA_get_base) {
3040 {
3041 MerDNA *arg1 = (MerDNA *) 0 ;
3042 unsigned int arg2 ;
3043 void *argp1 = 0 ;
3044 int res1 = 0 ;
3045 unsigned int val2 ;
3046 int ecode2 = 0 ;
3047 int argvi = 0;
3048 char result;
3049 dXSARGS;
3050
3051 if ((items < 2) || (items > 2)) {
3052 SWIG_croak("Usage: MerDNA_get_base(self,i);");
3053 }
3054 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MerDNA, 0 | 0 );
3055 if (!SWIG_IsOK(res1)) {
3056 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA_get_base" "', argument " "1"" of type '" "MerDNA *""'");
3057 }
3058 arg1 = reinterpret_cast< MerDNA * >(argp1);
3059 ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
3060 if (!SWIG_IsOK(ecode2)) {
3061 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MerDNA_get_base" "', argument " "2"" of type '" "unsigned int""'");
3062 }
3063 arg2 = static_cast< unsigned int >(val2);
3064 result = (char)MerDNA_get_base(arg1,arg2);
3065 ST(argvi) = SWIG_From_char SWIG_PERL_CALL_ARGS_1(static_cast< char >(result)); argvi++ ;
3066
3067
3068 XSRETURN(argvi);
3069 fail:
3070
3071
3072 SWIG_croak_null();
3073 }
3074 }
3075
3076
XS(_wrap_MerDNA_set_base)3077 XS(_wrap_MerDNA_set_base) {
3078 {
3079 MerDNA *arg1 = (MerDNA *) 0 ;
3080 unsigned int arg2 ;
3081 char arg3 ;
3082 void *argp1 = 0 ;
3083 int res1 = 0 ;
3084 unsigned int val2 ;
3085 int ecode2 = 0 ;
3086 char val3 ;
3087 int ecode3 = 0 ;
3088 int argvi = 0;
3089 dXSARGS;
3090
3091 if ((items < 3) || (items > 3)) {
3092 SWIG_croak("Usage: MerDNA_set_base(self,i,b);");
3093 }
3094 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MerDNA, 0 | 0 );
3095 if (!SWIG_IsOK(res1)) {
3096 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MerDNA_set_base" "', argument " "1"" of type '" "MerDNA *""'");
3097 }
3098 arg1 = reinterpret_cast< MerDNA * >(argp1);
3099 ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
3100 if (!SWIG_IsOK(ecode2)) {
3101 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MerDNA_set_base" "', argument " "2"" of type '" "unsigned int""'");
3102 }
3103 arg2 = static_cast< unsigned int >(val2);
3104 ecode3 = SWIG_AsVal_char SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
3105 if (!SWIG_IsOK(ecode3)) {
3106 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "MerDNA_set_base" "', argument " "3"" of type '" "char""'");
3107 }
3108 arg3 = static_cast< char >(val3);
3109 MerDNA_set_base(arg1,arg2,arg3);
3110 ST(argvi) = sv_newmortal();
3111
3112
3113
3114 XSRETURN(argvi);
3115 fail:
3116
3117
3118
3119 SWIG_croak_null();
3120 }
3121 }
3122
3123
XS(_wrap_delete_MerDNA)3124 XS(_wrap_delete_MerDNA) {
3125 {
3126 MerDNA *arg1 = (MerDNA *) 0 ;
3127 void *argp1 = 0 ;
3128 int res1 = 0 ;
3129 int argvi = 0;
3130 dXSARGS;
3131
3132 if ((items < 1) || (items > 1)) {
3133 SWIG_croak("Usage: delete_MerDNA(self);");
3134 }
3135 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MerDNA, SWIG_POINTER_DISOWN | 0 );
3136 if (!SWIG_IsOK(res1)) {
3137 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_MerDNA" "', argument " "1"" of type '" "MerDNA *""'");
3138 }
3139 arg1 = reinterpret_cast< MerDNA * >(argp1);
3140 delete arg1;
3141 ST(argvi) = sv_newmortal();
3142
3143 XSRETURN(argvi);
3144 fail:
3145
3146 SWIG_croak_null();
3147 }
3148 }
3149
3150
XS(_wrap_new_QueryMerFile)3151 XS(_wrap_new_QueryMerFile) {
3152 {
3153 char *arg1 = (char *) 0 ;
3154 int res1 ;
3155 char *buf1 = 0 ;
3156 int alloc1 = 0 ;
3157 int argvi = 0;
3158 QueryMerFile *result = 0 ;
3159 dXSARGS;
3160
3161 if ((items < 1) || (items > 1)) {
3162 SWIG_croak("Usage: new_QueryMerFile(path);");
3163 }
3164 res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
3165 if (!SWIG_IsOK(res1)) {
3166 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_QueryMerFile" "', argument " "1"" of type '" "char const *""'");
3167 }
3168 arg1 = reinterpret_cast< char * >(buf1);
3169 try {
3170 result = (QueryMerFile *)new QueryMerFile((char const *)arg1);
3171 }
3172 catch(std::runtime_error &_e) {
3173 SWIG_exception_fail(SWIG_RuntimeError, (&_e)->what());
3174 }
3175
3176 ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_QueryMerFile, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
3177 if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
3178 XSRETURN(argvi);
3179 fail:
3180 if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
3181 SWIG_croak_null();
3182 }
3183 }
3184
3185
XS(_wrap_QueryMerFile_get)3186 XS(_wrap_QueryMerFile_get) {
3187 {
3188 QueryMerFile *arg1 = (QueryMerFile *) 0 ;
3189 MerDNA *arg2 = 0 ;
3190 void *argp1 = 0 ;
3191 int res1 = 0 ;
3192 void *argp2 ;
3193 int res2 = 0 ;
3194 int argvi = 0;
3195 unsigned int result;
3196 dXSARGS;
3197
3198 if ((items < 2) || (items > 2)) {
3199 SWIG_croak("Usage: QueryMerFile_get(self,m);");
3200 }
3201 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QueryMerFile, 0 | 0 );
3202 if (!SWIG_IsOK(res1)) {
3203 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QueryMerFile_get" "', argument " "1"" of type '" "QueryMerFile *""'");
3204 }
3205 arg1 = reinterpret_cast< QueryMerFile * >(argp1);
3206 res2 = SWIG_ConvertPtr(ST(1), &argp2, SWIGTYPE_p_MerDNA, 0 );
3207 if (!SWIG_IsOK(res2)) {
3208 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "QueryMerFile_get" "', argument " "2"" of type '" "MerDNA const &""'");
3209 }
3210 if (!argp2) {
3211 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "QueryMerFile_get" "', argument " "2"" of type '" "MerDNA const &""'");
3212 }
3213 arg2 = reinterpret_cast< MerDNA * >(argp2);
3214 result = (unsigned int)(arg1)->get((MerDNA const &)*arg2);
3215 ST(argvi) = SWIG_From_unsigned_SS_int SWIG_PERL_CALL_ARGS_1(static_cast< unsigned int >(result)); argvi++ ;
3216
3217
3218 XSRETURN(argvi);
3219 fail:
3220
3221
3222 SWIG_croak_null();
3223 }
3224 }
3225
3226
XS(_wrap_delete_QueryMerFile)3227 XS(_wrap_delete_QueryMerFile) {
3228 {
3229 QueryMerFile *arg1 = (QueryMerFile *) 0 ;
3230 void *argp1 = 0 ;
3231 int res1 = 0 ;
3232 int argvi = 0;
3233 dXSARGS;
3234
3235 if ((items < 1) || (items > 1)) {
3236 SWIG_croak("Usage: delete_QueryMerFile(self);");
3237 }
3238 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QueryMerFile, SWIG_POINTER_DISOWN | 0 );
3239 if (!SWIG_IsOK(res1)) {
3240 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_QueryMerFile" "', argument " "1"" of type '" "QueryMerFile *""'");
3241 }
3242 arg1 = reinterpret_cast< QueryMerFile * >(argp1);
3243 delete arg1;
3244 ST(argvi) = sv_newmortal();
3245
3246 XSRETURN(argvi);
3247 fail:
3248
3249 SWIG_croak_null();
3250 }
3251 }
3252
3253
XS(_wrap_new_ReadMerFile)3254 XS(_wrap_new_ReadMerFile) {
3255 {
3256 char *arg1 = (char *) 0 ;
3257 int res1 ;
3258 char *buf1 = 0 ;
3259 int alloc1 = 0 ;
3260 int argvi = 0;
3261 ReadMerFile *result = 0 ;
3262 dXSARGS;
3263
3264 if ((items < 1) || (items > 1)) {
3265 SWIG_croak("Usage: new_ReadMerFile(path);");
3266 }
3267 res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
3268 if (!SWIG_IsOK(res1)) {
3269 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_ReadMerFile" "', argument " "1"" of type '" "char const *""'");
3270 }
3271 arg1 = reinterpret_cast< char * >(buf1);
3272 try {
3273 result = (ReadMerFile *)new ReadMerFile((char const *)arg1);
3274 }
3275 catch(std::runtime_error &_e) {
3276 SWIG_exception_fail(SWIG_RuntimeError, (&_e)->what());
3277 }
3278
3279 ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ReadMerFile, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
3280 if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
3281 XSRETURN(argvi);
3282 fail:
3283 if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
3284 SWIG_croak_null();
3285 }
3286 }
3287
3288
XS(_wrap_ReadMerFile_next_mer)3289 XS(_wrap_ReadMerFile_next_mer) {
3290 {
3291 ReadMerFile *arg1 = (ReadMerFile *) 0 ;
3292 void *argp1 = 0 ;
3293 int res1 = 0 ;
3294 int argvi = 0;
3295 bool result;
3296 dXSARGS;
3297
3298 if ((items < 1) || (items > 1)) {
3299 SWIG_croak("Usage: ReadMerFile_next_mer(self);");
3300 }
3301 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ReadMerFile, 0 | 0 );
3302 if (!SWIG_IsOK(res1)) {
3303 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReadMerFile_next_mer" "', argument " "1"" of type '" "ReadMerFile *""'");
3304 }
3305 arg1 = reinterpret_cast< ReadMerFile * >(argp1);
3306 result = (bool)(arg1)->next_mer();
3307 ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
3308
3309 XSRETURN(argvi);
3310 fail:
3311
3312 SWIG_croak_null();
3313 }
3314 }
3315
3316
XS(_wrap_ReadMerFile_mer)3317 XS(_wrap_ReadMerFile_mer) {
3318 {
3319 ReadMerFile *arg1 = (ReadMerFile *) 0 ;
3320 void *argp1 = 0 ;
3321 int res1 = 0 ;
3322 int argvi = 0;
3323 MerDNA *result = 0 ;
3324 dXSARGS;
3325
3326 if ((items < 1) || (items > 1)) {
3327 SWIG_croak("Usage: ReadMerFile_mer(self);");
3328 }
3329 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ReadMerFile, 0 | 0 );
3330 if (!SWIG_IsOK(res1)) {
3331 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReadMerFile_mer" "', argument " "1"" of type '" "ReadMerFile const *""'");
3332 }
3333 arg1 = reinterpret_cast< ReadMerFile * >(argp1);
3334 result = (MerDNA *)((ReadMerFile const *)arg1)->mer();
3335 ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MerDNA, 0 | SWIG_SHADOW); argvi++ ;
3336
3337 XSRETURN(argvi);
3338 fail:
3339
3340 SWIG_croak_null();
3341 }
3342 }
3343
3344
XS(_wrap_ReadMerFile_count)3345 XS(_wrap_ReadMerFile_count) {
3346 {
3347 ReadMerFile *arg1 = (ReadMerFile *) 0 ;
3348 void *argp1 = 0 ;
3349 int res1 = 0 ;
3350 int argvi = 0;
3351 unsigned long result;
3352 dXSARGS;
3353
3354 if ((items < 1) || (items > 1)) {
3355 SWIG_croak("Usage: ReadMerFile_count(self);");
3356 }
3357 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ReadMerFile, 0 | 0 );
3358 if (!SWIG_IsOK(res1)) {
3359 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReadMerFile_count" "', argument " "1"" of type '" "ReadMerFile const *""'");
3360 }
3361 arg1 = reinterpret_cast< ReadMerFile * >(argp1);
3362 result = (unsigned long)((ReadMerFile const *)arg1)->count();
3363 ST(argvi) = SWIG_From_unsigned_SS_long SWIG_PERL_CALL_ARGS_1(static_cast< unsigned long >(result)); argvi++ ;
3364
3365 XSRETURN(argvi);
3366 fail:
3367
3368 SWIG_croak_null();
3369 }
3370 }
3371
3372
XS(_wrap_ReadMerFile_each)3373 XS(_wrap_ReadMerFile_each) {
3374 {
3375 ReadMerFile *arg1 = (ReadMerFile *) 0 ;
3376 void *argp1 = 0 ;
3377 int res1 = 0 ;
3378 int argvi = 0;
3379 std::pair< MerDNA const *,uint64_t > result;
3380 dXSARGS;
3381
3382 if ((items < 1) || (items > 1)) {
3383 SWIG_croak("Usage: ReadMerFile_each(self);");
3384 }
3385 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ReadMerFile, 0 | 0 );
3386 if (!SWIG_IsOK(res1)) {
3387 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReadMerFile_each" "', argument " "1"" of type '" "ReadMerFile *""'");
3388 }
3389 arg1 = reinterpret_cast< ReadMerFile * >(argp1);
3390 result = (arg1)->each();
3391 {
3392 if((result).first) {
3393 SV * m = SWIG_NewPointerObj(const_cast<MerDNA*>((result).first), SWIGTYPE_p_MerDNA, 0);
3394 SV * c = SWIG_From_unsigned_SS_long SWIG_PERL_CALL_ARGS_1((result).second);
3395 if (argvi >= items) EXTEND(sp,1); ST(argvi) = m; argvi++ ;
3396 if (argvi >= items) EXTEND(sp,1); ST(argvi) = c; argvi++ ;
3397 }
3398 }
3399
3400 XSRETURN(argvi);
3401 fail:
3402
3403 SWIG_croak_null();
3404 }
3405 }
3406
3407
XS(_wrap_delete_ReadMerFile)3408 XS(_wrap_delete_ReadMerFile) {
3409 {
3410 ReadMerFile *arg1 = (ReadMerFile *) 0 ;
3411 void *argp1 = 0 ;
3412 int res1 = 0 ;
3413 int argvi = 0;
3414 dXSARGS;
3415
3416 if ((items < 1) || (items > 1)) {
3417 SWIG_croak("Usage: delete_ReadMerFile(self);");
3418 }
3419 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ReadMerFile, SWIG_POINTER_DISOWN | 0 );
3420 if (!SWIG_IsOK(res1)) {
3421 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ReadMerFile" "', argument " "1"" of type '" "ReadMerFile *""'");
3422 }
3423 arg1 = reinterpret_cast< ReadMerFile * >(argp1);
3424 delete arg1;
3425 ST(argvi) = sv_newmortal();
3426
3427 XSRETURN(argvi);
3428 fail:
3429
3430 SWIG_croak_null();
3431 }
3432 }
3433
3434
XS(_wrap_new_HashCounter__SWIG_0)3435 XS(_wrap_new_HashCounter__SWIG_0) {
3436 {
3437 size_t arg1 ;
3438 unsigned int arg2 ;
3439 unsigned int arg3 ;
3440 size_t val1 ;
3441 int ecode1 = 0 ;
3442 unsigned int val2 ;
3443 int ecode2 = 0 ;
3444 unsigned int val3 ;
3445 int ecode3 = 0 ;
3446 int argvi = 0;
3447 HashCounter *result = 0 ;
3448 dXSARGS;
3449
3450 if ((items < 3) || (items > 3)) {
3451 SWIG_croak("Usage: new_HashCounter(size,val_len,nb_threads);");
3452 }
3453 ecode1 = SWIG_AsVal_size_t SWIG_PERL_CALL_ARGS_2(ST(0), &val1);
3454 if (!SWIG_IsOK(ecode1)) {
3455 SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_HashCounter" "', argument " "1"" of type '" "size_t""'");
3456 }
3457 arg1 = static_cast< size_t >(val1);
3458 ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
3459 if (!SWIG_IsOK(ecode2)) {
3460 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_HashCounter" "', argument " "2"" of type '" "unsigned int""'");
3461 }
3462 arg2 = static_cast< unsigned int >(val2);
3463 ecode3 = SWIG_AsVal_unsigned_SS_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
3464 if (!SWIG_IsOK(ecode3)) {
3465 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_HashCounter" "', argument " "3"" of type '" "unsigned int""'");
3466 }
3467 arg3 = static_cast< unsigned int >(val3);
3468 result = (HashCounter *)new HashCounter(arg1,arg2,arg3);
3469 ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_HashCounter, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
3470
3471
3472
3473 XSRETURN(argvi);
3474 fail:
3475
3476
3477
3478 SWIG_croak_null();
3479 }
3480 }
3481
3482
XS(_wrap_new_HashCounter__SWIG_1)3483 XS(_wrap_new_HashCounter__SWIG_1) {
3484 {
3485 size_t arg1 ;
3486 unsigned int arg2 ;
3487 size_t val1 ;
3488 int ecode1 = 0 ;
3489 unsigned int val2 ;
3490 int ecode2 = 0 ;
3491 int argvi = 0;
3492 HashCounter *result = 0 ;
3493 dXSARGS;
3494
3495 if ((items < 2) || (items > 2)) {
3496 SWIG_croak("Usage: new_HashCounter(size,val_len);");
3497 }
3498 ecode1 = SWIG_AsVal_size_t SWIG_PERL_CALL_ARGS_2(ST(0), &val1);
3499 if (!SWIG_IsOK(ecode1)) {
3500 SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_HashCounter" "', argument " "1"" of type '" "size_t""'");
3501 }
3502 arg1 = static_cast< size_t >(val1);
3503 ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
3504 if (!SWIG_IsOK(ecode2)) {
3505 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_HashCounter" "', argument " "2"" of type '" "unsigned int""'");
3506 }
3507 arg2 = static_cast< unsigned int >(val2);
3508 result = (HashCounter *)new HashCounter(arg1,arg2);
3509 ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_HashCounter, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
3510
3511
3512 XSRETURN(argvi);
3513 fail:
3514
3515
3516 SWIG_croak_null();
3517 }
3518 }
3519
3520
XS(_wrap_new_HashCounter)3521 XS(_wrap_new_HashCounter) {
3522 dXSARGS;
3523
3524 {
3525 unsigned long _index = 0;
3526 SWIG_TypeRank _rank = 0;
3527 if (items == 2) {
3528 SWIG_TypeRank _ranki = 0;
3529 SWIG_TypeRank _rankm = 0;
3530 SWIG_TypeRank _pi = 1;
3531 int _v = 0;
3532 {
3533 {
3534 int res = SWIG_AsVal_size_t SWIG_PERL_CALL_ARGS_2(ST(0), NULL);
3535 _v = SWIG_CheckState(res);
3536 }
3537 }
3538 if (!_v) goto check_1;
3539 _ranki += _v*_pi;
3540 _rankm += _pi;
3541 _pi *= SWIG_MAXCASTRANK;
3542 {
3543 {
3544 int res = SWIG_AsVal_unsigned_SS_int SWIG_PERL_CALL_ARGS_2(ST(1), NULL);
3545 _v = SWIG_CheckState(res);
3546 }
3547 }
3548 if (!_v) goto check_1;
3549 _ranki += _v*_pi;
3550 _rankm += _pi;
3551 _pi *= SWIG_MAXCASTRANK;
3552 if (!_index || (_ranki < _rank)) {
3553 _rank = _ranki; _index = 1;
3554 if (_rank == _rankm) goto dispatch;
3555 }
3556 }
3557 check_1:
3558
3559 if (items == 3) {
3560 SWIG_TypeRank _ranki = 0;
3561 SWIG_TypeRank _rankm = 0;
3562 SWIG_TypeRank _pi = 1;
3563 int _v = 0;
3564 {
3565 {
3566 int res = SWIG_AsVal_size_t SWIG_PERL_CALL_ARGS_2(ST(0), NULL);
3567 _v = SWIG_CheckState(res);
3568 }
3569 }
3570 if (!_v) goto check_2;
3571 _ranki += _v*_pi;
3572 _rankm += _pi;
3573 _pi *= SWIG_MAXCASTRANK;
3574 {
3575 {
3576 int res = SWIG_AsVal_unsigned_SS_int SWIG_PERL_CALL_ARGS_2(ST(1), NULL);
3577 _v = SWIG_CheckState(res);
3578 }
3579 }
3580 if (!_v) goto check_2;
3581 _ranki += _v*_pi;
3582 _rankm += _pi;
3583 _pi *= SWIG_MAXCASTRANK;
3584 {
3585 {
3586 int res = SWIG_AsVal_unsigned_SS_int SWIG_PERL_CALL_ARGS_2(ST(2), NULL);
3587 _v = SWIG_CheckState(res);
3588 }
3589 }
3590 if (!_v) goto check_2;
3591 _ranki += _v*_pi;
3592 _rankm += _pi;
3593 _pi *= SWIG_MAXCASTRANK;
3594 if (!_index || (_ranki < _rank)) {
3595 _rank = _ranki; _index = 2;
3596 if (_rank == _rankm) goto dispatch;
3597 }
3598 }
3599 check_2:
3600
3601 dispatch:
3602 switch(_index) {
3603 case 1:
3604 PUSHMARK(MARK); SWIG_CALLXS(_wrap_new_HashCounter__SWIG_1); return;
3605 case 2:
3606 PUSHMARK(MARK); SWIG_CALLXS(_wrap_new_HashCounter__SWIG_0); return;
3607 }
3608 }
3609
3610 croak("No matching function for overloaded 'new_HashCounter'");
3611 XSRETURN(0);
3612 }
3613
3614
XS(_wrap_HashCounter_size)3615 XS(_wrap_HashCounter_size) {
3616 {
3617 HashCounter *arg1 = (HashCounter *) 0 ;
3618 void *argp1 = 0 ;
3619 int res1 = 0 ;
3620 int argvi = 0;
3621 size_t result;
3622 dXSARGS;
3623
3624 if ((items < 1) || (items > 1)) {
3625 SWIG_croak("Usage: HashCounter_size(self);");
3626 }
3627 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_HashCounter, 0 | 0 );
3628 if (!SWIG_IsOK(res1)) {
3629 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HashCounter_size" "', argument " "1"" of type '" "HashCounter const *""'");
3630 }
3631 arg1 = reinterpret_cast< HashCounter * >(argp1);
3632 result = ((HashCounter const *)arg1)->size();
3633 ST(argvi) = SWIG_From_size_t SWIG_PERL_CALL_ARGS_1(static_cast< size_t >(result)); argvi++ ;
3634
3635 XSRETURN(argvi);
3636 fail:
3637
3638 SWIG_croak_null();
3639 }
3640 }
3641
3642
XS(_wrap_HashCounter_val_len)3643 XS(_wrap_HashCounter_val_len) {
3644 {
3645 HashCounter *arg1 = (HashCounter *) 0 ;
3646 void *argp1 = 0 ;
3647 int res1 = 0 ;
3648 int argvi = 0;
3649 unsigned int result;
3650 dXSARGS;
3651
3652 if ((items < 1) || (items > 1)) {
3653 SWIG_croak("Usage: HashCounter_val_len(self);");
3654 }
3655 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_HashCounter, 0 | 0 );
3656 if (!SWIG_IsOK(res1)) {
3657 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HashCounter_val_len" "', argument " "1"" of type '" "HashCounter const *""'");
3658 }
3659 arg1 = reinterpret_cast< HashCounter * >(argp1);
3660 result = (unsigned int)((HashCounter const *)arg1)->val_len();
3661 ST(argvi) = SWIG_From_unsigned_SS_int SWIG_PERL_CALL_ARGS_1(static_cast< unsigned int >(result)); argvi++ ;
3662
3663 XSRETURN(argvi);
3664 fail:
3665
3666 SWIG_croak_null();
3667 }
3668 }
3669
3670
XS(_wrap_HashCounter_add)3671 XS(_wrap_HashCounter_add) {
3672 {
3673 HashCounter *arg1 = (HashCounter *) 0 ;
3674 MerDNA *arg2 = 0 ;
3675 int *arg3 = 0 ;
3676 void *argp1 = 0 ;
3677 int res1 = 0 ;
3678 void *argp2 ;
3679 int res2 = 0 ;
3680 int temp3 ;
3681 int val3 ;
3682 int ecode3 = 0 ;
3683 int argvi = 0;
3684 bool result;
3685 dXSARGS;
3686
3687 if ((items < 3) || (items > 3)) {
3688 SWIG_croak("Usage: HashCounter_add(self,m,x);");
3689 }
3690 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_HashCounter, 0 | 0 );
3691 if (!SWIG_IsOK(res1)) {
3692 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HashCounter_add" "', argument " "1"" of type '" "HashCounter *""'");
3693 }
3694 arg1 = reinterpret_cast< HashCounter * >(argp1);
3695 res2 = SWIG_ConvertPtr(ST(1), &argp2, SWIGTYPE_p_MerDNA, 0 );
3696 if (!SWIG_IsOK(res2)) {
3697 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HashCounter_add" "', argument " "2"" of type '" "MerDNA const &""'");
3698 }
3699 if (!argp2) {
3700 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HashCounter_add" "', argument " "2"" of type '" "MerDNA const &""'");
3701 }
3702 arg2 = reinterpret_cast< MerDNA * >(argp2);
3703 ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
3704 if (!SWIG_IsOK(ecode3)) {
3705 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HashCounter_add" "', argument " "3"" of type '" "int""'");
3706 }
3707 temp3 = static_cast< int >(val3);
3708 arg3 = &temp3;
3709 result = (bool)(arg1)->add((MerDNA const &)*arg2,(int const &)*arg3);
3710 ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
3711
3712
3713
3714 XSRETURN(argvi);
3715 fail:
3716
3717
3718
3719 SWIG_croak_null();
3720 }
3721 }
3722
3723
XS(_wrap_HashCounter_update_add)3724 XS(_wrap_HashCounter_update_add) {
3725 {
3726 HashCounter *arg1 = (HashCounter *) 0 ;
3727 MerDNA *arg2 = 0 ;
3728 int *arg3 = 0 ;
3729 void *argp1 = 0 ;
3730 int res1 = 0 ;
3731 void *argp2 ;
3732 int res2 = 0 ;
3733 int temp3 ;
3734 int val3 ;
3735 int ecode3 = 0 ;
3736 int argvi = 0;
3737 bool result;
3738 dXSARGS;
3739
3740 if ((items < 3) || (items > 3)) {
3741 SWIG_croak("Usage: HashCounter_update_add(self,MerDNA const &,int const &);");
3742 }
3743 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_HashCounter, 0 | 0 );
3744 if (!SWIG_IsOK(res1)) {
3745 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HashCounter_update_add" "', argument " "1"" of type '" "HashCounter *""'");
3746 }
3747 arg1 = reinterpret_cast< HashCounter * >(argp1);
3748 res2 = SWIG_ConvertPtr(ST(1), &argp2, SWIGTYPE_p_MerDNA, 0 );
3749 if (!SWIG_IsOK(res2)) {
3750 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HashCounter_update_add" "', argument " "2"" of type '" "MerDNA const &""'");
3751 }
3752 if (!argp2) {
3753 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HashCounter_update_add" "', argument " "2"" of type '" "MerDNA const &""'");
3754 }
3755 arg2 = reinterpret_cast< MerDNA * >(argp2);
3756 ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
3757 if (!SWIG_IsOK(ecode3)) {
3758 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HashCounter_update_add" "', argument " "3"" of type '" "int""'");
3759 }
3760 temp3 = static_cast< int >(val3);
3761 arg3 = &temp3;
3762 result = (bool)(arg1)->update_add((MerDNA const &)*arg2,(int const &)*arg3);
3763 ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
3764
3765
3766
3767 XSRETURN(argvi);
3768 fail:
3769
3770
3771
3772 SWIG_croak_null();
3773 }
3774 }
3775
3776
XS(_wrap_HashCounter_get)3777 XS(_wrap_HashCounter_get) {
3778 {
3779 HashCounter *arg1 = (HashCounter *) 0 ;
3780 MerDNA *arg2 = 0 ;
3781 std::pair< bool,uint64_t > *arg3 = (std::pair< bool,uint64_t > *) 0 ;
3782 void *argp1 = 0 ;
3783 int res1 = 0 ;
3784 void *argp2 ;
3785 int res2 = 0 ;
3786 std::pair< bool,uint64_t > tmp3 ;
3787 int argvi = 0;
3788 dXSARGS;
3789
3790 {
3791 arg3 = &tmp3;
3792 }
3793 if ((items < 2) || (items > 2)) {
3794 SWIG_croak("Usage: HashCounter_get(self,m);");
3795 }
3796 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_HashCounter, 0 | 0 );
3797 if (!SWIG_IsOK(res1)) {
3798 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HashCounter_get" "', argument " "1"" of type '" "HashCounter const *""'");
3799 }
3800 arg1 = reinterpret_cast< HashCounter * >(argp1);
3801 res2 = SWIG_ConvertPtr(ST(1), &argp2, SWIGTYPE_p_MerDNA, 0 );
3802 if (!SWIG_IsOK(res2)) {
3803 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HashCounter_get" "', argument " "2"" of type '" "MerDNA const &""'");
3804 }
3805 if (!argp2) {
3806 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HashCounter_get" "', argument " "2"" of type '" "MerDNA const &""'");
3807 }
3808 arg2 = reinterpret_cast< MerDNA * >(argp2);
3809 HashCounter_get((HashCounter const *)arg1,(MerDNA const &)*arg2,arg3);
3810 ST(argvi) = sv_newmortal();
3811 {
3812 if((arg3)->first) {
3813 SV * o = SWIG_From_unsigned_SS_long SWIG_PERL_CALL_ARGS_1((arg3)->second);
3814 if (argvi >= items) EXTEND(sp,1); ST(argvi) = o; argvi++ ;
3815 } else {
3816 if (argvi >= items) EXTEND(sp,1); ST(argvi) = sv_newmortal(); argvi++ ;
3817 }
3818 }
3819
3820
3821
3822 XSRETURN(argvi);
3823 fail:
3824
3825
3826
3827 SWIG_croak_null();
3828 }
3829 }
3830
3831
XS(_wrap_delete_HashCounter)3832 XS(_wrap_delete_HashCounter) {
3833 {
3834 HashCounter *arg1 = (HashCounter *) 0 ;
3835 void *argp1 = 0 ;
3836 int res1 = 0 ;
3837 int argvi = 0;
3838 dXSARGS;
3839
3840 if ((items < 1) || (items > 1)) {
3841 SWIG_croak("Usage: delete_HashCounter(self);");
3842 }
3843 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_HashCounter, SWIG_POINTER_DISOWN | 0 );
3844 if (!SWIG_IsOK(res1)) {
3845 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_HashCounter" "', argument " "1"" of type '" "HashCounter *""'");
3846 }
3847 arg1 = reinterpret_cast< HashCounter * >(argp1);
3848 delete arg1;
3849 ST(argvi) = sv_newmortal();
3850
3851 XSRETURN(argvi);
3852 fail:
3853
3854 SWIG_croak_null();
3855 }
3856 }
3857
3858
XS(_wrap_new_HashSet__SWIG_0)3859 XS(_wrap_new_HashSet__SWIG_0) {
3860 {
3861 size_t arg1 ;
3862 unsigned int arg2 ;
3863 size_t val1 ;
3864 int ecode1 = 0 ;
3865 unsigned int val2 ;
3866 int ecode2 = 0 ;
3867 int argvi = 0;
3868 HashSet *result = 0 ;
3869 dXSARGS;
3870
3871 if ((items < 2) || (items > 2)) {
3872 SWIG_croak("Usage: new_HashSet(size,nb_threads);");
3873 }
3874 ecode1 = SWIG_AsVal_size_t SWIG_PERL_CALL_ARGS_2(ST(0), &val1);
3875 if (!SWIG_IsOK(ecode1)) {
3876 SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_HashSet" "', argument " "1"" of type '" "size_t""'");
3877 }
3878 arg1 = static_cast< size_t >(val1);
3879 ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
3880 if (!SWIG_IsOK(ecode2)) {
3881 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_HashSet" "', argument " "2"" of type '" "unsigned int""'");
3882 }
3883 arg2 = static_cast< unsigned int >(val2);
3884 result = (HashSet *)new HashSet(arg1,arg2);
3885 ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_HashSet, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
3886
3887
3888 XSRETURN(argvi);
3889 fail:
3890
3891
3892 SWIG_croak_null();
3893 }
3894 }
3895
3896
XS(_wrap_new_HashSet__SWIG_1)3897 XS(_wrap_new_HashSet__SWIG_1) {
3898 {
3899 size_t arg1 ;
3900 size_t val1 ;
3901 int ecode1 = 0 ;
3902 int argvi = 0;
3903 HashSet *result = 0 ;
3904 dXSARGS;
3905
3906 if ((items < 1) || (items > 1)) {
3907 SWIG_croak("Usage: new_HashSet(size);");
3908 }
3909 ecode1 = SWIG_AsVal_size_t SWIG_PERL_CALL_ARGS_2(ST(0), &val1);
3910 if (!SWIG_IsOK(ecode1)) {
3911 SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_HashSet" "', argument " "1"" of type '" "size_t""'");
3912 }
3913 arg1 = static_cast< size_t >(val1);
3914 result = (HashSet *)new HashSet(arg1);
3915 ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_HashSet, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
3916
3917 XSRETURN(argvi);
3918 fail:
3919
3920 SWIG_croak_null();
3921 }
3922 }
3923
3924
XS(_wrap_new_HashSet)3925 XS(_wrap_new_HashSet) {
3926 dXSARGS;
3927
3928 {
3929 unsigned long _index = 0;
3930 SWIG_TypeRank _rank = 0;
3931 if (items == 1) {
3932 SWIG_TypeRank _ranki = 0;
3933 SWIG_TypeRank _rankm = 0;
3934 SWIG_TypeRank _pi = 1;
3935 int _v = 0;
3936 {
3937 {
3938 int res = SWIG_AsVal_size_t SWIG_PERL_CALL_ARGS_2(ST(0), NULL);
3939 _v = SWIG_CheckState(res);
3940 }
3941 }
3942 if (!_v) goto check_1;
3943 _ranki += _v*_pi;
3944 _rankm += _pi;
3945 _pi *= SWIG_MAXCASTRANK;
3946 if (!_index || (_ranki < _rank)) {
3947 _rank = _ranki; _index = 1;
3948 if (_rank == _rankm) goto dispatch;
3949 }
3950 }
3951 check_1:
3952
3953 if (items == 2) {
3954 SWIG_TypeRank _ranki = 0;
3955 SWIG_TypeRank _rankm = 0;
3956 SWIG_TypeRank _pi = 1;
3957 int _v = 0;
3958 {
3959 {
3960 int res = SWIG_AsVal_size_t SWIG_PERL_CALL_ARGS_2(ST(0), NULL);
3961 _v = SWIG_CheckState(res);
3962 }
3963 }
3964 if (!_v) goto check_2;
3965 _ranki += _v*_pi;
3966 _rankm += _pi;
3967 _pi *= SWIG_MAXCASTRANK;
3968 {
3969 {
3970 int res = SWIG_AsVal_unsigned_SS_int SWIG_PERL_CALL_ARGS_2(ST(1), NULL);
3971 _v = SWIG_CheckState(res);
3972 }
3973 }
3974 if (!_v) goto check_2;
3975 _ranki += _v*_pi;
3976 _rankm += _pi;
3977 _pi *= SWIG_MAXCASTRANK;
3978 if (!_index || (_ranki < _rank)) {
3979 _rank = _ranki; _index = 2;
3980 if (_rank == _rankm) goto dispatch;
3981 }
3982 }
3983 check_2:
3984
3985 dispatch:
3986 switch(_index) {
3987 case 1:
3988 PUSHMARK(MARK); SWIG_CALLXS(_wrap_new_HashSet__SWIG_1); return;
3989 case 2:
3990 PUSHMARK(MARK); SWIG_CALLXS(_wrap_new_HashSet__SWIG_0); return;
3991 }
3992 }
3993
3994 croak("No matching function for overloaded 'new_HashSet'");
3995 XSRETURN(0);
3996 }
3997
3998
XS(_wrap_HashSet_size)3999 XS(_wrap_HashSet_size) {
4000 {
4001 HashSet *arg1 = (HashSet *) 0 ;
4002 void *argp1 = 0 ;
4003 int res1 = 0 ;
4004 int argvi = 0;
4005 size_t result;
4006 dXSARGS;
4007
4008 if ((items < 1) || (items > 1)) {
4009 SWIG_croak("Usage: HashSet_size(self);");
4010 }
4011 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_HashSet, 0 | 0 );
4012 if (!SWIG_IsOK(res1)) {
4013 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HashSet_size" "', argument " "1"" of type '" "HashSet const *""'");
4014 }
4015 arg1 = reinterpret_cast< HashSet * >(argp1);
4016 result = ((HashSet const *)arg1)->size();
4017 ST(argvi) = SWIG_From_size_t SWIG_PERL_CALL_ARGS_1(static_cast< size_t >(result)); argvi++ ;
4018
4019 XSRETURN(argvi);
4020 fail:
4021
4022 SWIG_croak_null();
4023 }
4024 }
4025
4026
XS(_wrap_HashSet_add)4027 XS(_wrap_HashSet_add) {
4028 {
4029 HashSet *arg1 = (HashSet *) 0 ;
4030 MerDNA *arg2 = 0 ;
4031 void *argp1 = 0 ;
4032 int res1 = 0 ;
4033 void *argp2 ;
4034 int res2 = 0 ;
4035 int argvi = 0;
4036 bool result;
4037 dXSARGS;
4038
4039 if ((items < 2) || (items > 2)) {
4040 SWIG_croak("Usage: HashSet_add(self,m);");
4041 }
4042 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_HashSet, 0 | 0 );
4043 if (!SWIG_IsOK(res1)) {
4044 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HashSet_add" "', argument " "1"" of type '" "HashSet *""'");
4045 }
4046 arg1 = reinterpret_cast< HashSet * >(argp1);
4047 res2 = SWIG_ConvertPtr(ST(1), &argp2, SWIGTYPE_p_MerDNA, 0 );
4048 if (!SWIG_IsOK(res2)) {
4049 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HashSet_add" "', argument " "2"" of type '" "MerDNA const &""'");
4050 }
4051 if (!argp2) {
4052 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HashSet_add" "', argument " "2"" of type '" "MerDNA const &""'");
4053 }
4054 arg2 = reinterpret_cast< MerDNA * >(argp2);
4055 result = (bool)(arg1)->add((MerDNA const &)*arg2);
4056 ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
4057
4058
4059 XSRETURN(argvi);
4060 fail:
4061
4062
4063 SWIG_croak_null();
4064 }
4065 }
4066
4067
XS(_wrap_HashSet_get)4068 XS(_wrap_HashSet_get) {
4069 {
4070 HashSet *arg1 = (HashSet *) 0 ;
4071 MerDNA *arg2 = 0 ;
4072 void *argp1 = 0 ;
4073 int res1 = 0 ;
4074 void *argp2 ;
4075 int res2 = 0 ;
4076 int argvi = 0;
4077 bool result;
4078 dXSARGS;
4079
4080 if ((items < 2) || (items > 2)) {
4081 SWIG_croak("Usage: HashSet_get(self,m);");
4082 }
4083 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_HashSet, 0 | 0 );
4084 if (!SWIG_IsOK(res1)) {
4085 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HashSet_get" "', argument " "1"" of type '" "HashSet const *""'");
4086 }
4087 arg1 = reinterpret_cast< HashSet * >(argp1);
4088 res2 = SWIG_ConvertPtr(ST(1), &argp2, SWIGTYPE_p_MerDNA, 0 );
4089 if (!SWIG_IsOK(res2)) {
4090 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HashSet_get" "', argument " "2"" of type '" "MerDNA const &""'");
4091 }
4092 if (!argp2) {
4093 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HashSet_get" "', argument " "2"" of type '" "MerDNA const &""'");
4094 }
4095 arg2 = reinterpret_cast< MerDNA * >(argp2);
4096 result = (bool)HashSet_get((HashSet const *)arg1,(MerDNA const &)*arg2);
4097 ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
4098
4099
4100 XSRETURN(argvi);
4101 fail:
4102
4103
4104 SWIG_croak_null();
4105 }
4106 }
4107
4108
XS(_wrap_delete_HashSet)4109 XS(_wrap_delete_HashSet) {
4110 {
4111 HashSet *arg1 = (HashSet *) 0 ;
4112 void *argp1 = 0 ;
4113 int res1 = 0 ;
4114 int argvi = 0;
4115 dXSARGS;
4116
4117 if ((items < 1) || (items > 1)) {
4118 SWIG_croak("Usage: delete_HashSet(self);");
4119 }
4120 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_HashSet, SWIG_POINTER_DISOWN | 0 );
4121 if (!SWIG_IsOK(res1)) {
4122 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_HashSet" "', argument " "1"" of type '" "HashSet *""'");
4123 }
4124 arg1 = reinterpret_cast< HashSet * >(argp1);
4125 delete arg1;
4126 ST(argvi) = sv_newmortal();
4127
4128 XSRETURN(argvi);
4129 fail:
4130
4131 SWIG_croak_null();
4132 }
4133 }
4134
4135
XS(_wrap_string_mers)4136 XS(_wrap_string_mers) {
4137 {
4138 char *arg1 = (char *) 0 ;
4139 int arg2 ;
4140 int res1 ;
4141 char *buf1 = 0 ;
4142 size_t size1 = 0 ;
4143 int alloc1 = 0 ;
4144 int argvi = 0;
4145 StringMers *result = 0 ;
4146 dXSARGS;
4147
4148 if ((items < 1) || (items > 1)) {
4149 SWIG_croak("Usage: string_mers(str,length);");
4150 }
4151 res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, &size1, &alloc1);
4152 if (!SWIG_IsOK(res1)) {
4153 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "string_mers" "', argument " "1"" of type '" "char *""'");
4154 }
4155 arg1 = reinterpret_cast< char * >(buf1);
4156 arg2 = static_cast< int >(size1 - 1);
4157 result = (StringMers *)string_mers(arg1,arg2);
4158 ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_StringMers, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
4159 if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
4160 XSRETURN(argvi);
4161 fail:
4162 if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
4163 SWIG_croak_null();
4164 }
4165 }
4166
4167
XS(_wrap_string_canonicals)4168 XS(_wrap_string_canonicals) {
4169 {
4170 char *arg1 = (char *) 0 ;
4171 int arg2 ;
4172 int res1 ;
4173 char *buf1 = 0 ;
4174 size_t size1 = 0 ;
4175 int alloc1 = 0 ;
4176 int argvi = 0;
4177 StringMers *result = 0 ;
4178 dXSARGS;
4179
4180 if ((items < 1) || (items > 1)) {
4181 SWIG_croak("Usage: string_canonicals(str,length);");
4182 }
4183 res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, &size1, &alloc1);
4184 if (!SWIG_IsOK(res1)) {
4185 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "string_canonicals" "', argument " "1"" of type '" "char *""'");
4186 }
4187 arg1 = reinterpret_cast< char * >(buf1);
4188 arg2 = static_cast< int >(size1 - 1);
4189 result = (StringMers *)string_canonicals(arg1,arg2);
4190 ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_StringMers, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
4191 if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
4192 XSRETURN(argvi);
4193 fail:
4194 if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
4195 SWIG_croak_null();
4196 }
4197 }
4198
4199
XS(_wrap_new_StringMers)4200 XS(_wrap_new_StringMers) {
4201 {
4202 char *arg1 = (char *) 0 ;
4203 int arg2 ;
4204 bool arg3 ;
4205 int res1 ;
4206 char *buf1 = 0 ;
4207 int alloc1 = 0 ;
4208 int val2 ;
4209 int ecode2 = 0 ;
4210 bool val3 ;
4211 int ecode3 = 0 ;
4212 int argvi = 0;
4213 StringMers *result = 0 ;
4214 dXSARGS;
4215
4216 if ((items < 3) || (items > 3)) {
4217 SWIG_croak("Usage: new_StringMers(str,len,canonical);");
4218 }
4219 res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
4220 if (!SWIG_IsOK(res1)) {
4221 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_StringMers" "', argument " "1"" of type '" "char const *""'");
4222 }
4223 arg1 = reinterpret_cast< char * >(buf1);
4224 ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
4225 if (!SWIG_IsOK(ecode2)) {
4226 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_StringMers" "', argument " "2"" of type '" "int""'");
4227 }
4228 arg2 = static_cast< int >(val2);
4229 ecode3 = SWIG_AsVal_bool SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
4230 if (!SWIG_IsOK(ecode3)) {
4231 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_StringMers" "', argument " "3"" of type '" "bool""'");
4232 }
4233 arg3 = static_cast< bool >(val3);
4234 result = (StringMers *)new StringMers((char const *)arg1,arg2,arg3);
4235 ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_StringMers, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
4236 if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
4237
4238
4239 XSRETURN(argvi);
4240 fail:
4241 if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
4242
4243
4244 SWIG_croak_null();
4245 }
4246 }
4247
4248
XS(_wrap_StringMers_next_mer)4249 XS(_wrap_StringMers_next_mer) {
4250 {
4251 StringMers *arg1 = (StringMers *) 0 ;
4252 void *argp1 = 0 ;
4253 int res1 = 0 ;
4254 int argvi = 0;
4255 bool result;
4256 dXSARGS;
4257
4258 if ((items < 1) || (items > 1)) {
4259 SWIG_croak("Usage: StringMers_next_mer(self);");
4260 }
4261 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_StringMers, 0 | 0 );
4262 if (!SWIG_IsOK(res1)) {
4263 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringMers_next_mer" "', argument " "1"" of type '" "StringMers *""'");
4264 }
4265 arg1 = reinterpret_cast< StringMers * >(argp1);
4266 result = (bool)(arg1)->next_mer();
4267 ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
4268
4269 XSRETURN(argvi);
4270 fail:
4271
4272 SWIG_croak_null();
4273 }
4274 }
4275
4276
XS(_wrap_StringMers_mer)4277 XS(_wrap_StringMers_mer) {
4278 {
4279 StringMers *arg1 = (StringMers *) 0 ;
4280 void *argp1 = 0 ;
4281 int res1 = 0 ;
4282 int argvi = 0;
4283 MerDNA *result = 0 ;
4284 dXSARGS;
4285
4286 if ((items < 1) || (items > 1)) {
4287 SWIG_croak("Usage: StringMers_mer(self);");
4288 }
4289 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_StringMers, 0 | 0 );
4290 if (!SWIG_IsOK(res1)) {
4291 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringMers_mer" "', argument " "1"" of type '" "StringMers const *""'");
4292 }
4293 arg1 = reinterpret_cast< StringMers * >(argp1);
4294 result = (MerDNA *)((StringMers const *)arg1)->mer();
4295 ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MerDNA, 0 | SWIG_SHADOW); argvi++ ;
4296
4297 XSRETURN(argvi);
4298 fail:
4299
4300 SWIG_croak_null();
4301 }
4302 }
4303
4304
XS(_wrap_StringMers_each)4305 XS(_wrap_StringMers_each) {
4306 {
4307 StringMers *arg1 = (StringMers *) 0 ;
4308 void *argp1 = 0 ;
4309 int res1 = 0 ;
4310 int argvi = 0;
4311 MerDNA *result = 0 ;
4312 dXSARGS;
4313
4314 if ((items < 1) || (items > 1)) {
4315 SWIG_croak("Usage: StringMers_each(self);");
4316 }
4317 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_StringMers, 0 | 0 );
4318 if (!SWIG_IsOK(res1)) {
4319 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringMers_each" "', argument " "1"" of type '" "StringMers *""'");
4320 }
4321 arg1 = reinterpret_cast< StringMers * >(argp1);
4322 result = (MerDNA *)(arg1)->each();
4323 ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MerDNA, 0 | SWIG_SHADOW); argvi++ ;
4324
4325 XSRETURN(argvi);
4326 fail:
4327
4328 SWIG_croak_null();
4329 }
4330 }
4331
4332
XS(_wrap_delete_StringMers)4333 XS(_wrap_delete_StringMers) {
4334 {
4335 StringMers *arg1 = (StringMers *) 0 ;
4336 void *argp1 = 0 ;
4337 int res1 = 0 ;
4338 int argvi = 0;
4339 dXSARGS;
4340
4341 if ((items < 1) || (items > 1)) {
4342 SWIG_croak("Usage: delete_StringMers(self);");
4343 }
4344 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_StringMers, SWIG_POINTER_DISOWN | 0 );
4345 if (!SWIG_IsOK(res1)) {
4346 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_StringMers" "', argument " "1"" of type '" "StringMers *""'");
4347 }
4348 arg1 = reinterpret_cast< StringMers * >(argp1);
4349 delete arg1;
4350 ST(argvi) = sv_newmortal();
4351
4352 XSRETURN(argvi);
4353 fail:
4354
4355 SWIG_croak_null();
4356 }
4357 }
4358
4359
4360
4361 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
4362
4363 static swig_type_info _swigt__p_HashCounter = {"_p_HashCounter", "HashCounter *", 0, 0, (void*)"jellyfish::HashCounter", 0};
4364 static swig_type_info _swigt__p_HashSet = {"_p_HashSet", "HashSet *", 0, 0, (void*)"jellyfish::HashSet", 0};
4365 static swig_type_info _swigt__p_MerDNA = {"_p_MerDNA", "MerDNA *", 0, 0, (void*)"jellyfish::MerDNA", 0};
4366 static swig_type_info _swigt__p_QueryMerFile = {"_p_QueryMerFile", "QueryMerFile *", 0, 0, (void*)"jellyfish::QueryMerFile", 0};
4367 static swig_type_info _swigt__p_ReadMerFile = {"_p_ReadMerFile", "ReadMerFile *", 0, 0, (void*)"jellyfish::ReadMerFile", 0};
4368 static swig_type_info _swigt__p_StringMers = {"_p_StringMers", "StringMers *", 0, 0, (void*)"jellyfish::StringMers", 0};
4369 static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
4370 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};
4371
4372 static swig_type_info *swig_type_initial[] = {
4373 &_swigt__p_HashCounter,
4374 &_swigt__p_HashSet,
4375 &_swigt__p_MerDNA,
4376 &_swigt__p_QueryMerFile,
4377 &_swigt__p_ReadMerFile,
4378 &_swigt__p_StringMers,
4379 &_swigt__p_char,
4380 &_swigt__p_std__pairT_bool_uint64_t_t,
4381 };
4382
4383 static swig_cast_info _swigc__p_HashCounter[] = { {&_swigt__p_HashCounter, 0, 0, 0},{0, 0, 0, 0}};
4384 static swig_cast_info _swigc__p_HashSet[] = { {&_swigt__p_HashSet, 0, 0, 0},{0, 0, 0, 0}};
4385 static swig_cast_info _swigc__p_MerDNA[] = { {&_swigt__p_MerDNA, 0, 0, 0},{0, 0, 0, 0}};
4386 static swig_cast_info _swigc__p_QueryMerFile[] = { {&_swigt__p_QueryMerFile, 0, 0, 0},{0, 0, 0, 0}};
4387 static swig_cast_info _swigc__p_ReadMerFile[] = { {&_swigt__p_ReadMerFile, 0, 0, 0},{0, 0, 0, 0}};
4388 static swig_cast_info _swigc__p_StringMers[] = { {&_swigt__p_StringMers, 0, 0, 0},{0, 0, 0, 0}};
4389 static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
4390 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}};
4391
4392 static swig_cast_info *swig_cast_initial[] = {
4393 _swigc__p_HashCounter,
4394 _swigc__p_HashSet,
4395 _swigc__p_MerDNA,
4396 _swigc__p_QueryMerFile,
4397 _swigc__p_ReadMerFile,
4398 _swigc__p_StringMers,
4399 _swigc__p_char,
4400 _swigc__p_std__pairT_bool_uint64_t_t,
4401 };
4402
4403
4404 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
4405
4406 static swig_constant_info swig_constants[] = {
4407 {0,0,0,0,0,0}
4408 };
4409 #ifdef __cplusplus
4410 }
4411 #endif
4412 static swig_variable_info swig_variables[] = {
4413 {0,0,0,0}
4414 };
4415 static swig_command_info swig_commands[] = {
4416 {"jellyfishc::new_MerDNA", _wrap_new_MerDNA},
4417 {"jellyfishc::MerDNA_k", _wrap_MerDNA_k},
4418 {"jellyfishc::MerDNA_polyA", _wrap_MerDNA_polyA},
4419 {"jellyfishc::MerDNA_polyC", _wrap_MerDNA_polyC},
4420 {"jellyfishc::MerDNA_polyG", _wrap_MerDNA_polyG},
4421 {"jellyfishc::MerDNA_polyT", _wrap_MerDNA_polyT},
4422 {"jellyfishc::MerDNA_randomize", _wrap_MerDNA_randomize},
4423 {"jellyfishc::MerDNA_is_homopolymer", _wrap_MerDNA_is_homopolymer},
4424 {"jellyfishc::MerDNA_shift_left", _wrap_MerDNA_shift_left},
4425 {"jellyfishc::MerDNA_shift_right", _wrap_MerDNA_shift_right},
4426 {"jellyfishc::MerDNA_canonicalize", _wrap_MerDNA_canonicalize},
4427 {"jellyfishc::MerDNA_reverse_complement", _wrap_MerDNA_reverse_complement},
4428 {"jellyfishc::MerDNA_get_canonical", _wrap_MerDNA_get_canonical},
4429 {"jellyfishc::MerDNA_get_reverse_complement", _wrap_MerDNA_get_reverse_complement},
4430 {"jellyfishc::MerDNA___eq__", _wrap_MerDNA___eq__},
4431 {"jellyfishc::MerDNA___lt__", _wrap_MerDNA___lt__},
4432 {"jellyfishc::MerDNA___gt__", _wrap_MerDNA___gt__},
4433 {"jellyfishc::MerDNA_dup", _wrap_MerDNA_dup},
4434 {"jellyfishc::MerDNA___str__", _wrap_MerDNA___str__},
4435 {"jellyfishc::MerDNA_set", _wrap_MerDNA_set},
4436 {"jellyfishc::MerDNA_get_base", _wrap_MerDNA_get_base},
4437 {"jellyfishc::MerDNA_set_base", _wrap_MerDNA_set_base},
4438 {"jellyfishc::delete_MerDNA", _wrap_delete_MerDNA},
4439 {"jellyfishc::new_QueryMerFile", _wrap_new_QueryMerFile},
4440 {"jellyfishc::QueryMerFile_get", _wrap_QueryMerFile_get},
4441 {"jellyfishc::delete_QueryMerFile", _wrap_delete_QueryMerFile},
4442 {"jellyfishc::new_ReadMerFile", _wrap_new_ReadMerFile},
4443 {"jellyfishc::ReadMerFile_next_mer", _wrap_ReadMerFile_next_mer},
4444 {"jellyfishc::ReadMerFile_mer", _wrap_ReadMerFile_mer},
4445 {"jellyfishc::ReadMerFile_count", _wrap_ReadMerFile_count},
4446 {"jellyfishc::ReadMerFile_each", _wrap_ReadMerFile_each},
4447 {"jellyfishc::delete_ReadMerFile", _wrap_delete_ReadMerFile},
4448 {"jellyfishc::new_HashCounter", _wrap_new_HashCounter},
4449 {"jellyfishc::HashCounter_size", _wrap_HashCounter_size},
4450 {"jellyfishc::HashCounter_val_len", _wrap_HashCounter_val_len},
4451 {"jellyfishc::HashCounter_add", _wrap_HashCounter_add},
4452 {"jellyfishc::HashCounter_update_add", _wrap_HashCounter_update_add},
4453 {"jellyfishc::HashCounter_get", _wrap_HashCounter_get},
4454 {"jellyfishc::delete_HashCounter", _wrap_delete_HashCounter},
4455 {"jellyfishc::new_HashSet", _wrap_new_HashSet},
4456 {"jellyfishc::HashSet_size", _wrap_HashSet_size},
4457 {"jellyfishc::HashSet_add", _wrap_HashSet_add},
4458 {"jellyfishc::HashSet_get", _wrap_HashSet_get},
4459 {"jellyfishc::delete_HashSet", _wrap_delete_HashSet},
4460 {"jellyfishc::string_mers", _wrap_string_mers},
4461 {"jellyfishc::string_canonicals", _wrap_string_canonicals},
4462 {"jellyfishc::new_StringMers", _wrap_new_StringMers},
4463 {"jellyfishc::StringMers_next_mer", _wrap_StringMers_next_mer},
4464 {"jellyfishc::StringMers_mer", _wrap_StringMers_mer},
4465 {"jellyfishc::StringMers_each", _wrap_StringMers_each},
4466 {"jellyfishc::delete_StringMers", _wrap_delete_StringMers},
4467 {0,0}
4468 };
4469 /* -----------------------------------------------------------------------------
4470 * Type initialization:
4471 * This problem is tough by the requirement that no dynamic
4472 * memory is used. Also, since swig_type_info structures store pointers to
4473 * swig_cast_info structures and swig_cast_info structures store pointers back
4474 * to swig_type_info structures, we need some lookup code at initialization.
4475 * The idea is that swig generates all the structures that are needed.
4476 * The runtime then collects these partially filled structures.
4477 * The SWIG_InitializeModule function takes these initial arrays out of
4478 * swig_module, and does all the lookup, filling in the swig_module.types
4479 * array with the correct data and linking the correct swig_cast_info
4480 * structures together.
4481 *
4482 * The generated swig_type_info structures are assigned statically to an initial
4483 * array. We just loop through that array, and handle each type individually.
4484 * First we lookup if this type has been already loaded, and if so, use the
4485 * loaded structure instead of the generated one. Then we have to fill in the
4486 * cast linked list. The cast data is initially stored in something like a
4487 * two-dimensional array. Each row corresponds to a type (there are the same
4488 * number of rows as there are in the swig_type_initial array). Each entry in
4489 * a column is one of the swig_cast_info structures for that type.
4490 * The cast_initial array is actually an array of arrays, because each row has
4491 * a variable number of columns. So to actually build the cast linked list,
4492 * we find the array of casts associated with the type, and loop through it
4493 * adding the casts to the list. The one last trick we need to do is making
4494 * sure the type pointer in the swig_cast_info struct is correct.
4495 *
4496 * First off, we lookup the cast->type name to see if it is already loaded.
4497 * There are three cases to handle:
4498 * 1) If the cast->type has already been loaded AND the type we are adding
4499 * casting info to has not been loaded (it is in this module), THEN we
4500 * replace the cast->type pointer with the type pointer that has already
4501 * been loaded.
4502 * 2) If BOTH types (the one we are adding casting info to, and the
4503 * cast->type) are loaded, THEN the cast info has already been loaded by
4504 * the previous module so we just ignore it.
4505 * 3) Finally, if cast->type has not already been loaded, then we add that
4506 * swig_cast_info to the linked list (because the cast->type) pointer will
4507 * be correct.
4508 * ----------------------------------------------------------------------------- */
4509
4510 #ifdef __cplusplus
4511 extern "C" {
4512 #if 0
4513 } /* c-mode */
4514 #endif
4515 #endif
4516
4517 #if 0
4518 #define SWIGRUNTIME_DEBUG
4519 #endif
4520
4521
4522 SWIGRUNTIME void
SWIG_InitializeModule(void * clientdata)4523 SWIG_InitializeModule(void *clientdata) {
4524 size_t i;
4525 swig_module_info *module_head, *iter;
4526 int found, init;
4527
4528 /* check to see if the circular list has been setup, if not, set it up */
4529 if (swig_module.next==0) {
4530 /* Initialize the swig_module */
4531 swig_module.type_initial = swig_type_initial;
4532 swig_module.cast_initial = swig_cast_initial;
4533 swig_module.next = &swig_module;
4534 init = 1;
4535 } else {
4536 init = 0;
4537 }
4538
4539 /* Try and load any already created modules */
4540 module_head = SWIG_GetModule(clientdata);
4541 if (!module_head) {
4542 /* This is the first module loaded for this interpreter */
4543 /* so set the swig module into the interpreter */
4544 SWIG_SetModule(clientdata, &swig_module);
4545 module_head = &swig_module;
4546 } else {
4547 /* the interpreter has loaded a SWIG module, but has it loaded this one? */
4548 found=0;
4549 iter=module_head;
4550 do {
4551 if (iter==&swig_module) {
4552 found=1;
4553 break;
4554 }
4555 iter=iter->next;
4556 } while (iter!= module_head);
4557
4558 /* if the is found in the list, then all is done and we may leave */
4559 if (found) return;
4560 /* otherwise we must add out module into the list */
4561 swig_module.next = module_head->next;
4562 module_head->next = &swig_module;
4563 }
4564
4565 /* When multiple interpreters are used, a module could have already been initialized in
4566 a different interpreter, but not yet have a pointer in this interpreter.
4567 In this case, we do not want to continue adding types... everything should be
4568 set up already */
4569 if (init == 0) return;
4570
4571 /* Now work on filling in swig_module.types */
4572 #ifdef SWIGRUNTIME_DEBUG
4573 printf("SWIG_InitializeModule: size %d\n", swig_module.size);
4574 #endif
4575 for (i = 0; i < swig_module.size; ++i) {
4576 swig_type_info *type = 0;
4577 swig_type_info *ret;
4578 swig_cast_info *cast;
4579
4580 #ifdef SWIGRUNTIME_DEBUG
4581 printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
4582 #endif
4583
4584 /* if there is another module already loaded */
4585 if (swig_module.next != &swig_module) {
4586 type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
4587 }
4588 if (type) {
4589 /* Overwrite clientdata field */
4590 #ifdef SWIGRUNTIME_DEBUG
4591 printf("SWIG_InitializeModule: found type %s\n", type->name);
4592 #endif
4593 if (swig_module.type_initial[i]->clientdata) {
4594 type->clientdata = swig_module.type_initial[i]->clientdata;
4595 #ifdef SWIGRUNTIME_DEBUG
4596 printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
4597 #endif
4598 }
4599 } else {
4600 type = swig_module.type_initial[i];
4601 }
4602
4603 /* Insert casting types */
4604 cast = swig_module.cast_initial[i];
4605 while (cast->type) {
4606 /* Don't need to add information already in the list */
4607 ret = 0;
4608 #ifdef SWIGRUNTIME_DEBUG
4609 printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
4610 #endif
4611 if (swig_module.next != &swig_module) {
4612 ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
4613 #ifdef SWIGRUNTIME_DEBUG
4614 if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
4615 #endif
4616 }
4617 if (ret) {
4618 if (type == swig_module.type_initial[i]) {
4619 #ifdef SWIGRUNTIME_DEBUG
4620 printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
4621 #endif
4622 cast->type = ret;
4623 ret = 0;
4624 } else {
4625 /* Check for casting already in the list */
4626 swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
4627 #ifdef SWIGRUNTIME_DEBUG
4628 if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
4629 #endif
4630 if (!ocast) ret = 0;
4631 }
4632 }
4633
4634 if (!ret) {
4635 #ifdef SWIGRUNTIME_DEBUG
4636 printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
4637 #endif
4638 if (type->cast) {
4639 type->cast->prev = cast;
4640 cast->next = type->cast;
4641 }
4642 type->cast = cast;
4643 }
4644 cast++;
4645 }
4646 /* Set entry in modules->types array equal to the type */
4647 swig_module.types[i] = type;
4648 }
4649 swig_module.types[i] = 0;
4650
4651 #ifdef SWIGRUNTIME_DEBUG
4652 printf("**** SWIG_InitializeModule: Cast List ******\n");
4653 for (i = 0; i < swig_module.size; ++i) {
4654 int j = 0;
4655 swig_cast_info *cast = swig_module.cast_initial[i];
4656 printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
4657 while (cast->type) {
4658 printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
4659 cast++;
4660 ++j;
4661 }
4662 printf("---- Total casts: %d\n",j);
4663 }
4664 printf("**** SWIG_InitializeModule: Cast List ******\n");
4665 #endif
4666 }
4667
4668 /* This function will propagate the clientdata field of type to
4669 * any new swig_type_info structures that have been added into the list
4670 * of equivalent types. It is like calling
4671 * SWIG_TypeClientData(type, clientdata) a second time.
4672 */
4673 SWIGRUNTIME void
SWIG_PropagateClientData(void)4674 SWIG_PropagateClientData(void) {
4675 size_t i;
4676 swig_cast_info *equiv;
4677 static int init_run = 0;
4678
4679 if (init_run) return;
4680 init_run = 1;
4681
4682 for (i = 0; i < swig_module.size; i++) {
4683 if (swig_module.types[i]->clientdata) {
4684 equiv = swig_module.types[i]->cast;
4685 while (equiv) {
4686 if (!equiv->converter) {
4687 if (equiv->type && !equiv->type->clientdata)
4688 SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
4689 }
4690 equiv = equiv->next;
4691 }
4692 }
4693 }
4694 }
4695
4696 #ifdef __cplusplus
4697 #if 0
4698 {
4699 /* c-mode */
4700 #endif
4701 }
4702 #endif
4703
4704
4705
4706 #ifdef __cplusplus
4707 extern "C"
4708 #endif
4709
XS(SWIG_init)4710 XS(SWIG_init) {
4711 dXSARGS;
4712 int i;
4713
4714 SWIG_InitializeModule(0);
4715
4716 /* Install commands */
4717 for (i = 0; swig_commands[i].name; i++) {
4718 /* Casts only needed for Perl < 5.10. */
4719 #ifdef __cplusplus
4720 newXS(const_cast<char*>(swig_commands[i].name), swig_commands[i].wrapper, const_cast<char*>(__FILE__));
4721 #else
4722 newXS((char*)swig_commands[i].name, swig_commands[i].wrapper, (char*)__FILE__);
4723 #endif
4724 }
4725
4726 /* Install variables */
4727 for (i = 0; swig_variables[i].name; i++) {
4728 SV *sv;
4729 sv = get_sv(swig_variables[i].name, TRUE | 0x2 | GV_ADDMULTI);
4730 if (swig_variables[i].type) {
4731 SWIG_MakePtr(sv,(void *)1, *swig_variables[i].type,0);
4732 } else {
4733 sv_setiv(sv,(IV) 0);
4734 }
4735 swig_create_magic(sv, swig_variables[i].name, swig_variables[i].set, swig_variables[i].get);
4736 }
4737
4738 /* Install constant */
4739 for (i = 0; swig_constants[i].type; i++) {
4740 SV *sv;
4741 sv = get_sv(swig_constants[i].name, TRUE | 0x2 | GV_ADDMULTI);
4742 switch(swig_constants[i].type) {
4743 case SWIG_INT:
4744 sv_setiv(sv, (IV) swig_constants[i].lvalue);
4745 break;
4746 case SWIG_FLOAT:
4747 sv_setnv(sv, (double) swig_constants[i].dvalue);
4748 break;
4749 case SWIG_STRING:
4750 sv_setpv(sv, (const char *) swig_constants[i].pvalue);
4751 break;
4752 case SWIG_POINTER:
4753 SWIG_MakePtr(sv, swig_constants[i].pvalue, *(swig_constants[i].ptype),0);
4754 break;
4755 case SWIG_BINARY:
4756 SWIG_MakePackedObj(sv, swig_constants[i].pvalue, swig_constants[i].lvalue, *(swig_constants[i].ptype));
4757 break;
4758 default:
4759 break;
4760 }
4761 SvREADONLY_on(sv);
4762 }
4763
4764 SWIG_TypeClientData(SWIGTYPE_p_MerDNA, (void*) "jellyfish::MerDNA");
4765 SWIG_TypeClientData(SWIGTYPE_p_QueryMerFile, (void*) "jellyfish::QueryMerFile");
4766 SWIG_TypeClientData(SWIGTYPE_p_ReadMerFile, (void*) "jellyfish::ReadMerFile");
4767 SWIG_TypeClientData(SWIGTYPE_p_HashCounter, (void*) "jellyfish::HashCounter");
4768 SWIG_TypeClientData(SWIGTYPE_p_HashSet, (void*) "jellyfish::HashSet");
4769 SWIG_TypeClientData(SWIGTYPE_p_StringMers, (void*) "jellyfish::StringMers");
4770 ST(0) = &PL_sv_yes;
4771 XSRETURN(1);
4772 }
4773
4774