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