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