/[hyperestraier_wrappers]/trunk/ruby/HyperEstraier_wrap.cxx
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/ruby/HyperEstraier_wrap.cxx

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2 - (show annotations)
Sat Sep 3 18:04:41 2005 UTC (17 years, 2 months ago) by dpavlin
File size: 114460 byte(s)
make working copy
1 /* ----------------------------------------------------------------------------
2 * This file was automatically generated by SWIG (http://www.swig.org).
3 * Version 1.3.24
4 *
5 * This file is not intended to be easily readable and contains a number of
6 * coding conventions designed to improve portability and efficiency. Do not make
7 * changes to this file unless you know what you are doing--modify the SWIG
8 * interface file instead.
9 * ----------------------------------------------------------------------------- */
10
11
12 #ifdef __cplusplus
13 template<class T> class SwigValueWrapper {
14 T *tt;
15 public:
16 SwigValueWrapper() : tt(0) { }
17 SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { }
18 SwigValueWrapper(const T& t) : tt(new T(t)) { }
19 ~SwigValueWrapper() { delete tt; }
20 SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; }
21 operator T&() const { return *tt; }
22 T *operator&() { return tt; }
23 private:
24 SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
25 };
26 #endif
27
28
29 #ifndef SWIG_TEMPLATE_DISAMBIGUATOR
30 # if defined(__SUNPRO_CC)
31 # define SWIG_TEMPLATE_DISAMBIGUATOR template
32 # else
33 # define SWIG_TEMPLATE_DISAMBIGUATOR
34 # endif
35 #endif
36
37 /* ruby.swg */
38 /* Implementation : RUBY */
39 #define SWIGRUBY 1
40
41 #include "ruby.h"
42
43 /* Flags for pointer conversion */
44 #define SWIG_POINTER_EXCEPTION 0x1
45 #define SWIG_POINTER_DISOWN 0x2
46
47 #define NUM2USHRT(n) (\
48 (0 <= NUM2UINT(n) && NUM2UINT(n) <= USHRT_MAX)\
49 ? (unsigned short) NUM2UINT(n) \
50 : (rb_raise(rb_eArgError, "integer %d out of range of `unsigned short'",\
51 NUM2UINT(n)), (short)0)\
52 )
53
54 #define NUM2SHRT(n) (\
55 (SHRT_MIN <= NUM2INT(n) && NUM2INT(n) <= SHRT_MAX)\
56 ? (short)NUM2INT(n)\
57 : (rb_raise(rb_eArgError, "integer %d out of range of `short'",\
58 NUM2INT(n)), (short)0)\
59 )
60
61 /* Ruby 1.7 defines NUM2LL(), LL2NUM() and ULL2NUM() macros */
62 #ifndef NUM2LL
63 #define NUM2LL(x) NUM2LONG((x))
64 #endif
65 #ifndef LL2NUM
66 #define LL2NUM(x) INT2NUM((long) (x))
67 #endif
68 #ifndef ULL2NUM
69 #define ULL2NUM(x) UINT2NUM((unsigned long) (x))
70 #endif
71
72 /* Ruby 1.7 doesn't (yet) define NUM2ULL() */
73 #ifndef NUM2ULL
74 #ifdef HAVE_LONG_LONG
75 #define NUM2ULL(x) rb_num2ull((x))
76 #else
77 #define NUM2ULL(x) NUM2ULONG(x)
78 #endif
79 #endif
80
81 /*
82 * Need to be very careful about how these macros are defined, especially
83 * when compiling C++ code or C code with an ANSI C compiler.
84 *
85 * VALUEFUNC(f) is a macro used to typecast a C function that implements
86 * a Ruby method so that it can be passed as an argument to API functions
87 * like rb_define_method() and rb_define_singleton_method().
88 *
89 * VOIDFUNC(f) is a macro used to typecast a C function that implements
90 * either the "mark" or "free" stuff for a Ruby Data object, so that it
91 * can be passed as an argument to API functions like Data_Wrap_Struct()
92 * and Data_Make_Struct().
93 */
94
95 #ifdef __cplusplus
96 # ifndef RUBY_METHOD_FUNC /* These definitions should work for Ruby 1.4.6 */
97 # define PROTECTFUNC(f) ((VALUE (*)()) f)
98 # define VALUEFUNC(f) ((VALUE (*)()) f)
99 # define VOIDFUNC(f) ((void (*)()) f)
100 # else
101 # ifndef ANYARGS /* These definitions should work for Ruby 1.6 */
102 # define PROTECTFUNC(f) ((VALUE (*)()) f)
103 # define VALUEFUNC(f) ((VALUE (*)()) f)
104 # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
105 # else /* These definitions should work for Ruby 1.7+ */
106 # define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f)
107 # define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f)
108 # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
109 # endif
110 # endif
111 #else
112 # define VALUEFUNC(f) (f)
113 # define VOIDFUNC(f) (f)
114 #endif
115
116 typedef struct {
117 VALUE klass;
118 VALUE mImpl;
119 void (*mark)(void *);
120 void (*destroy)(void *);
121 } swig_class;
122
123 /* Don't use for expressions have side effect */
124 #ifndef RB_STRING_VALUE
125 #define RB_STRING_VALUE(s) (TYPE(s) == T_STRING ? (s) : (*(volatile VALUE *)&(s) = rb_str_to_str(s)))
126 #endif
127 #ifndef StringValue
128 #define StringValue(s) RB_STRING_VALUE(s)
129 #endif
130 #ifndef StringValuePtr
131 #define StringValuePtr(s) RSTRING(RB_STRING_VALUE(s))->ptr
132 #endif
133 #ifndef StringValueLen
134 #define StringValueLen(s) RSTRING(RB_STRING_VALUE(s))->len
135 #endif
136 #ifndef SafeStringValue
137 #define SafeStringValue(v) do {\
138 StringValue(v);\
139 rb_check_safe_str(v);\
140 } while (0)
141 #endif
142
143 #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
144 #define rb_define_alloc_func(klass, func) rb_define_singleton_method((klass), "new", VALUEFUNC((func)), -1)
145 #define rb_undef_alloc_func(klass) rb_undef_method(CLASS_OF((klass)), "new")
146 #endif
147
148 /* Contract support */
149
150 #define SWIG_contract_assert(expr, msg) if (!(expr)) { rb_raise(rb_eRuntimeError, (char *) msg ); } else
151
152
153 /***********************************************************************
154 * swigrun.swg
155 *
156 * This file contains generic CAPI SWIG runtime support for pointer
157 * type checking.
158 *
159 ************************************************************************/
160
161 /* This should only be incremented when either the layout of swig_type_info changes,
162 or for whatever reason, the runtime changes incompatibly */
163 #define SWIG_RUNTIME_VERSION "1"
164
165 /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
166 #ifdef SWIG_TYPE_TABLE
167 #define SWIG_QUOTE_STRING(x) #x
168 #define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
169 #define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
170 #else
171 #define SWIG_TYPE_TABLE_NAME
172 #endif
173
174 #include <string.h>
175
176 #ifndef SWIGINLINE
177 #if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
178 # define SWIGINLINE inline
179 #else
180 # define SWIGINLINE
181 #endif
182 #endif
183
184 /*
185 You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
186 creating a static or dynamic library from the swig runtime code.
187 In 99.9% of the cases, swig just needs to declare them as 'static'.
188
189 But only do this if is strictly necessary, ie, if you have problems
190 with your compiler or so.
191 */
192 #ifndef SWIGRUNTIME
193 #define SWIGRUNTIME static
194 #endif
195 #ifndef SWIGRUNTIMEINLINE
196 #define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
197 #endif
198
199 #ifdef __cplusplus
200 extern "C" {
201 #endif
202
203 typedef void *(*swig_converter_func)(void *);
204 typedef struct swig_type_info *(*swig_dycast_func)(void **);
205
206 typedef struct swig_type_info {
207 const char *name;
208 swig_converter_func converter;
209 const char *str;
210 void *clientdata;
211 swig_dycast_func dcast;
212 struct swig_type_info *next;
213 struct swig_type_info *prev;
214 } swig_type_info;
215
216 /*
217 Compare two type names skipping the space characters, therefore
218 "char*" == "char *" and "Class<int>" == "Class<int >", etc.
219
220 Return 0 when the two name types are equivalent, as in
221 strncmp, but skipping ' '.
222 */
223 SWIGRUNTIME int
224 SWIG_TypeNameComp(const char *f1, const char *l1,
225 const char *f2, const char *l2) {
226 for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
227 while ((*f1 == ' ') && (f1 != l1)) ++f1;
228 while ((*f2 == ' ') && (f2 != l2)) ++f2;
229 if (*f1 != *f2) return *f1 - *f2;
230 }
231 return (l1 - f1) - (l2 - f2);
232 }
233
234 /*
235 Check type equivalence in a name list like <name1>|<name2>|...
236 */
237 SWIGRUNTIME int
238 SWIG_TypeEquiv(const char *nb, const char *tb) {
239 int equiv = 0;
240 const char* te = tb + strlen(tb);
241 const char* ne = nb;
242 while (!equiv && *ne) {
243 for (nb = ne; *ne; ++ne) {
244 if (*ne == '|') break;
245 }
246 equiv = SWIG_TypeNameComp(nb, ne, tb, te) == 0;
247 if (*ne) ++ne;
248 }
249 return equiv;
250 }
251
252 /*
253 Register a type mapping with the type-checking
254 */
255 SWIGRUNTIME swig_type_info *
256 SWIG_TypeRegisterTL(swig_type_info **tl, swig_type_info *ti) {
257 swig_type_info *tc, *head, *ret, *next;
258 /* Check to see if this type has already been registered */
259 tc = *tl;
260 while (tc) {
261 /* check simple type equivalence */
262 int typeequiv = (strcmp(tc->name, ti->name) == 0);
263 /* check full type equivalence, resolving typedefs */
264 if (!typeequiv) {
265 /* only if tc is not a typedef (no '|' on it) */
266 if (tc->str && ti->str && !strstr(tc->str,"|")) {
267 typeequiv = SWIG_TypeEquiv(ti->str,tc->str);
268 }
269 }
270 if (typeequiv) {
271 /* Already exists in the table. Just add additional types to the list */
272 if (ti->clientdata) tc->clientdata = ti->clientdata;
273 head = tc;
274 next = tc->next;
275 goto l1;
276 }
277 tc = tc->prev;
278 }
279 head = ti;
280 next = 0;
281
282 /* Place in list */
283 ti->prev = *tl;
284 *tl = ti;
285
286 /* Build linked lists */
287 l1:
288 ret = head;
289 tc = ti + 1;
290 /* Patch up the rest of the links */
291 while (tc->name) {
292 head->next = tc;
293 tc->prev = head;
294 head = tc;
295 tc++;
296 }
297 if (next) next->prev = head;
298 head->next = next;
299
300 return ret;
301 }
302
303 /*
304 Check the typename
305 */
306 SWIGRUNTIME swig_type_info *
307 SWIG_TypeCheck(const char *c, swig_type_info *ty) {
308 swig_type_info *s;
309 if (!ty) return 0; /* Void pointer */
310 s = ty->next; /* First element always just a name */
311 do {
312 if (strcmp(s->name,c) == 0) {
313 if (s == ty->next) return s;
314 /* Move s to the top of the linked list */
315 s->prev->next = s->next;
316 if (s->next) {
317 s->next->prev = s->prev;
318 }
319 /* Insert s as second element in the list */
320 s->next = ty->next;
321 if (ty->next) ty->next->prev = s;
322 ty->next = s;
323 s->prev = ty;
324 return s;
325 }
326 s = s->next;
327 } while (s && (s != ty->next));
328 return 0;
329 }
330
331 /*
332 Cast a pointer up an inheritance hierarchy
333 */
334 SWIGRUNTIMEINLINE void *
335 SWIG_TypeCast(swig_type_info *ty, void *ptr) {
336 return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr);
337 }
338
339 /*
340 Dynamic pointer casting. Down an inheritance hierarchy
341 */
342 SWIGRUNTIME swig_type_info *
343 SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
344 swig_type_info *lastty = ty;
345 if (!ty || !ty->dcast) return ty;
346 while (ty && (ty->dcast)) {
347 ty = (*ty->dcast)(ptr);
348 if (ty) lastty = ty;
349 }
350 return lastty;
351 }
352
353 /*
354 Return the name associated with this type
355 */
356 SWIGRUNTIMEINLINE const char *
357 SWIG_TypeName(const swig_type_info *ty) {
358 return ty->name;
359 }
360
361 /*
362 Return the pretty name associated with this type,
363 that is an unmangled type name in a form presentable to the user.
364 */
365 SWIGRUNTIME const char *
366 SWIG_TypePrettyName(const swig_type_info *type) {
367 /* The "str" field contains the equivalent pretty names of the
368 type, separated by vertical-bar characters. We choose
369 to print the last name, as it is often (?) the most
370 specific. */
371 if (type->str != NULL) {
372 const char *last_name = type->str;
373 const char *s;
374 for (s = type->str; *s; s++)
375 if (*s == '|') last_name = s+1;
376 return last_name;
377 }
378 else
379 return type->name;
380 }
381
382 /*
383 Search for a swig_type_info structure
384 */
385 SWIGRUNTIME swig_type_info *
386 SWIG_TypeQueryTL(swig_type_info *tl, const char *name) {
387 swig_type_info *ty = tl;
388 while (ty) {
389 if (ty->str && (SWIG_TypeEquiv(ty->str,name))) return ty;
390 if (ty->name && (strcmp(name,ty->name) == 0)) return ty;
391 ty = ty->prev;
392 }
393 return 0;
394 }
395
396 /*
397 Set the clientdata field for a type
398 */
399 SWIGRUNTIME void
400 SWIG_TypeClientDataTL(swig_type_info *tl, swig_type_info *ti, void *clientdata) {
401 swig_type_info *tc, *equiv;
402 if (ti->clientdata) return;
403 /* if (ti->clientdata == clientdata) return; */
404 ti->clientdata = clientdata;
405 equiv = ti->next;
406 while (equiv) {
407 if (!equiv->converter) {
408 tc = tl;
409 while (tc) {
410 if ((strcmp(tc->name, equiv->name) == 0))
411 SWIG_TypeClientDataTL(tl,tc,clientdata);
412 tc = tc->prev;
413 }
414 }
415 equiv = equiv->next;
416 }
417 }
418
419 /*
420 Pack binary data into a string
421 */
422 SWIGRUNTIME char *
423 SWIG_PackData(char *c, void *ptr, size_t sz) {
424 static char hex[17] = "0123456789abcdef";
425 unsigned char *u = (unsigned char *) ptr;
426 const unsigned char *eu = u + sz;
427 register unsigned char uu;
428 for (; u != eu; ++u) {
429 uu = *u;
430 *(c++) = hex[(uu & 0xf0) >> 4];
431 *(c++) = hex[uu & 0xf];
432 }
433 return c;
434 }
435
436 /*
437 Unpack binary data from a string
438 */
439 SWIGRUNTIME const char *
440 SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
441 register unsigned char *u = (unsigned char *) ptr;
442 register const unsigned char *eu = u + sz;
443 for (; u != eu; ++u) {
444 register int d = *(c++);
445 register unsigned char uu = 0;
446 if ((d >= '0') && (d <= '9'))
447 uu = ((d - '0') << 4);
448 else if ((d >= 'a') && (d <= 'f'))
449 uu = ((d - ('a'-10)) << 4);
450 else
451 return (char *) 0;
452 d = *(c++);
453 if ((d >= '0') && (d <= '9'))
454 uu |= (d - '0');
455 else if ((d >= 'a') && (d <= 'f'))
456 uu |= (d - ('a'-10));
457 else
458 return (char *) 0;
459 *u = uu;
460 }
461 return c;
462 }
463
464 /*
465 This function will propagate the clientdata field of type to any new
466 swig_type_info structures that have been added into the list of
467 equivalent types. It is like calling SWIG_TypeClientData(type,
468 clientdata) a second time.
469 */
470 SWIGRUNTIME void
471 SWIG_PropagateClientDataTL(swig_type_info *tl, swig_type_info *type) {
472 swig_type_info *equiv = type->next;
473 swig_type_info *tc;
474 if (!type->clientdata) return;
475 while (equiv) {
476 if (!equiv->converter) {
477 tc = tl;
478 while (tc) {
479 if ((strcmp(tc->name, equiv->name) == 0) && !tc->clientdata)
480 SWIG_TypeClientDataTL(tl,tc, type->clientdata);
481 tc = tc->prev;
482 }
483 }
484 equiv = equiv->next;
485 }
486 }
487
488 /*
489 Pack 'void *' into a string buffer.
490 */
491 SWIGRUNTIME char *
492 SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
493 char *r = buff;
494 if ((2*sizeof(void *) + 2) > bsz) return 0;
495 *(r++) = '_';
496 r = SWIG_PackData(r,&ptr,sizeof(void *));
497 if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
498 strcpy(r,name);
499 return buff;
500 }
501
502 SWIGRUNTIME const char *
503 SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
504 if (*c != '_') {
505 if (strcmp(c,"NULL") == 0) {
506 *ptr = (void *) 0;
507 return name;
508 } else {
509 return 0;
510 }
511 }
512 return SWIG_UnpackData(++c,ptr,sizeof(void *));
513 }
514
515 SWIGRUNTIME char *
516 SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
517 char *r = buff;
518 size_t lname = (name ? strlen(name) : 0);
519 if ((2*sz + 2 + lname) > bsz) return 0;
520 *(r++) = '_';
521 r = SWIG_PackData(r,ptr,sz);
522 if (lname) {
523 strncpy(r,name,lname+1);
524 } else {
525 *r = 0;
526 }
527 return buff;
528 }
529
530 SWIGRUNTIME const char *
531 SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
532 if (*c != '_') {
533 if (strcmp(c,"NULL") == 0) {
534 memset(ptr,0,sz);
535 return name;
536 } else {
537 return 0;
538 }
539 }
540 return SWIG_UnpackData(++c,ptr,sz);
541 }
542
543 #ifdef __cplusplus
544 }
545 #endif
546
547 /***********************************************************************
548 * common.swg
549 *
550 * This file contains generic SWIG runtime support for pointer
551 * type checking as well as a few commonly used macros to control
552 * external linkage.
553 *
554 * Author : David Beazley (beazley@cs.uchicago.edu)
555 *
556 * Copyright (c) 1999-2000, The University of Chicago
557 *
558 * This file may be freely redistributed without license or fee provided
559 * this copyright message remains intact.
560 ************************************************************************/
561
562
563 #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
564 # if !defined(STATIC_LINKED)
565 # define SWIGEXPORT(a) __declspec(dllexport) a
566 # else
567 # define SWIGEXPORT(a) a
568 # endif
569 #else
570 # define SWIGEXPORT(a) a
571 #endif
572
573 #ifdef __cplusplus
574 extern "C" {
575 #endif
576
577
578 /*************************************************************************/
579
580
581 /* The static type info list */
582
583 static swig_type_info *swig_type_list = 0;
584 static swig_type_info **swig_type_list_handle = &swig_type_list;
585
586
587 /* Register a type mapping with the type-checking */
588 static swig_type_info *
589 SWIG_TypeRegister(swig_type_info *ti) {
590 return SWIG_TypeRegisterTL(swig_type_list_handle, ti);
591 }
592
593 /* Search for a swig_type_info structure */
594 static swig_type_info *
595 SWIG_TypeQuery(const char *name) {
596 return SWIG_TypeQueryTL(*swig_type_list_handle, name);
597 }
598
599 /* Set the clientdata field for a type */
600 static void
601 SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
602 SWIG_TypeClientDataTL(*swig_type_list_handle, ti, clientdata);
603 }
604
605 /* This function will propagate the clientdata field of type to
606 * any new swig_type_info structures that have been added into the list
607 * of equivalent types. It is like calling
608 * SWIG_TypeClientData(type, clientdata) a second time.
609 */
610 static void
611 SWIG_PropagateClientData(swig_type_info *type) {
612 SWIG_PropagateClientDataTL(*swig_type_list_handle, type);
613 }
614
615 #ifdef __cplusplus
616 }
617 #endif
618
619 /* Common SWIG API */
620 #define SWIG_ConvertPtr(obj, pp, type, flags) \
621 SWIG_Ruby_ConvertPtr(obj, pp, type, flags)
622 #define SWIG_NewPointerObj(p, type, flags) \
623 SWIG_Ruby_NewPointerObj(p, type, flags)
624 #define SWIG_MustGetPtr(p, type, argnum, flags) \
625 SWIG_Ruby_MustGetPtr(p, type, argnum, flags)
626
627 /* Ruby-specific SWIG API */
628
629 #define SWIG_InitRuntime() \
630 SWIG_Ruby_InitRuntime()
631 #define SWIG_define_class(ty) \
632 SWIG_Ruby_define_class(ty)
633 #define SWIG_NewClassInstance(value, ty) \
634 SWIG_Ruby_NewClassInstance(value, ty)
635 #define SWIG_MangleStr(value) \
636 SWIG_Ruby_MangleStr(value)
637 #define SWIG_CheckConvert(value, ty) \
638 SWIG_Ruby_CheckConvert(value, ty)
639 #define SWIG_NewPackedObj(ptr, sz, ty) \
640 SWIG_Ruby_NewPackedObj(ptr, sz, ty)
641 #define SWIG_ConvertPacked(obj, ptr, sz, ty, flags) \
642 SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty, flags)
643
644 /* rubydef.swg */
645 #ifdef __cplusplus
646 extern "C" {
647 #endif
648
649 static VALUE _mSWIG = Qnil;
650 static VALUE _cSWIG_Pointer = Qnil;
651 static VALUE swig_runtime_data_type_pointer = Qnil;
652
653 /* Initialize Ruby runtime support */
654 static void
655 SWIG_Ruby_InitRuntime(void)
656 {
657 VALUE pointer;
658
659 if (_mSWIG == Qnil) {
660 _mSWIG = rb_define_module("SWIG");
661 }
662
663 /* first check if pointer already created */
664 pointer = rb_gv_get("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
665 if (pointer != Qnil) {
666 Data_Get_Struct(pointer, swig_type_info *, swig_type_list_handle);
667 } else {
668 /* register a new class */
669 VALUE cl = rb_define_class("swig_runtime_data", rb_cObject);
670 /* create and store the structure pointer to a global variable */
671 swig_runtime_data_type_pointer = Data_Wrap_Struct(cl, 0, 0, swig_type_list_handle);
672 rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer);
673 }
674 }
675
676 /* Define Ruby class for C type */
677 static void
678 SWIG_Ruby_define_class(swig_type_info *type)
679 {
680 VALUE klass;
681 char *klass_name = (char *) malloc(4 + strlen(type->name) + 1);
682 sprintf(klass_name, "TYPE%s", type->name);
683 if (NIL_P(_cSWIG_Pointer)) {
684 _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);
685 rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new");
686 }
687 klass = rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
688 free((void *) klass_name);
689 }
690
691 /* Create a new pointer object */
692 static VALUE
693 SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int own)
694 {
695 char *klass_name;
696 swig_class *sklass;
697 VALUE klass;
698 VALUE obj;
699
700 if (!ptr)
701 return Qnil;
702
703 if (type->clientdata) {
704 sklass = (swig_class *) type->clientdata;
705 obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark), (own ? VOIDFUNC(sklass->destroy) : 0), ptr);
706 } else {
707 klass_name = (char *) malloc(4 + strlen(type->name) + 1);
708 sprintf(klass_name, "TYPE%s", type->name);
709 klass = rb_const_get(_mSWIG, rb_intern(klass_name));
710 free((void *) klass_name);
711 obj = Data_Wrap_Struct(klass, 0, 0, ptr);
712 }
713 rb_iv_set(obj, "__swigtype__", rb_str_new2(type->name));
714 return obj;
715 }
716
717 /* Create a new class instance (always owned) */
718 static VALUE
719 SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type)
720 {
721 VALUE obj;
722 swig_class *sklass = (swig_class *) type->clientdata;
723 obj = Data_Wrap_Struct(klass, VOIDFUNC(sklass->mark), VOIDFUNC(sklass->destroy), 0);
724 rb_iv_set(obj, "__swigtype__", rb_str_new2(type->name));
725 return obj;
726 }
727
728 /* Get type mangle from class name */
729 static SWIGINLINE char *
730 SWIG_Ruby_MangleStr(VALUE obj)
731 {
732 VALUE stype = rb_iv_get(obj, "__swigtype__");
733 return StringValuePtr(stype);
734 }
735
736 /* Convert a pointer value */
737 static int
738 SWIG_Ruby_ConvertPtr(VALUE obj, void **ptr, swig_type_info *ty, int flags)
739 {
740 char *c;
741 swig_type_info *tc;
742
743 /* Grab the pointer */
744 if (NIL_P(obj)) {
745 *ptr = 0;
746 return 0;
747 } else {
748 Data_Get_Struct(obj, void, *ptr);
749 }
750
751 /* Do type-checking if type info was provided */
752 if (ty) {
753 if (ty->clientdata) {
754 if (rb_obj_is_kind_of(obj, ((swig_class *) (ty->clientdata))->klass)) {
755 if (*ptr == 0)
756 rb_raise(rb_eRuntimeError, "This %s already released", ty->str);
757 return 0;
758 }
759 }
760 if ((c = SWIG_MangleStr(obj)) == NULL) {
761 if (flags & SWIG_POINTER_EXCEPTION)
762 rb_raise(rb_eTypeError, "Expected %s", ty->str);
763 else
764 return -1;
765 }
766 tc = SWIG_TypeCheck(c, ty);
767 if (!tc) {
768 if (flags & SWIG_POINTER_EXCEPTION)
769 rb_raise(rb_eTypeError, "Expected %s", ty->str);
770 else
771 return -1;
772 }
773 *ptr = SWIG_TypeCast(tc, *ptr);
774 }
775 return 0;
776 }
777
778 /* Convert a pointer value, signal an exception on a type mismatch */
779 static SWIGINLINE void *
780 SWIG_Ruby_MustGetPtr(VALUE obj, swig_type_info *ty, int argnum, int flags)
781 {
782 void *result;
783 SWIG_ConvertPtr(obj, &result, ty, flags | SWIG_POINTER_EXCEPTION);
784 return result;
785 }
786
787 /* Check convert */
788 static SWIGINLINE int
789 SWIG_Ruby_CheckConvert(VALUE obj, swig_type_info *ty)
790 {
791 char *c = SWIG_MangleStr(obj);
792 if (!c)
793 return 0;
794 return SWIG_TypeCheck(c,ty) != 0;
795 }
796
797 static VALUE
798 SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
799 char result[1024];
800 char *r = result;
801 if ((2*sz + 1 + strlen(type->name)) > 1000) return 0;
802 *(r++) = '_';
803 r = SWIG_PackData(r, ptr, sz);
804 strcpy(r, type->name);
805 return rb_str_new2(result);
806 }
807
808 /* Convert a packed value value */
809 static void
810 SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty, int flags) {
811 swig_type_info *tc;
812 const char *c;
813
814 if (TYPE(obj) != T_STRING) goto type_error;
815 c = StringValuePtr(obj);
816 /* Pointer values must start with leading underscore */
817 if (*c != '_') goto type_error;
818 c++;
819 c = SWIG_UnpackData(c, ptr, sz);
820 if (ty) {
821 tc = SWIG_TypeCheck(c, ty);
822 if (!tc) goto type_error;
823 }
824 return;
825
826 type_error:
827
828 if (flags) {
829 if (ty) {
830 rb_raise(rb_eTypeError, "Type error. Expected %s", ty->name);
831 } else {
832 rb_raise(rb_eTypeError, "Expected a pointer");
833 }
834 }
835 }
836
837 #ifdef __cplusplus
838 }
839 #endif
840
841
842
843 /* -------- TYPES TABLE (BEGIN) -------- */
844
845 #define SWIGTYPE_p_estraier__Condition swig_types[0]
846 #define SWIGTYPE_p_ESTCOND swig_types[1]
847 #define SWIGTYPE_p_estraier__Database swig_types[2]
848 #define SWIGTYPE_p_unsigned_long swig_types[3]
849 #define SWIGTYPE_p_ESTDOC swig_types[4]
850 #define SWIGTYPE_p_std__vectorTstd__string_t swig_types[5]
851 #define SWIGTYPE_p_std__mapTstd__string_std__string_t swig_types[6]
852 #define SWIGTYPE_p_std__vectorTint_t swig_types[7]
853 #define SWIGTYPE_p_estraier__Document swig_types[8]
854 static swig_type_info *swig_types[10];
855
856 /* -------- TYPES TABLE (END) -------- */
857
858 #define SWIG_init Init_HyperEstraier
859 #define SWIG_name "HyperEstraier"
860
861 static VALUE mHyperEstraier;
862
863 static void SWIG_AsVal(VALUE obj, int *val)
864 {
865 *val = (int) NUM2INT(obj);
866 }
867
868
869 #define SWIG_MemoryError 1
870 #define SWIG_IOError 2
871 #define SWIG_RuntimeError 3
872 #define SWIG_IndexError 4
873 #define SWIG_TypeError 5
874 #define SWIG_DivisionByZero 6
875 #define SWIG_OverflowError 7
876 #define SWIG_SyntaxError 8
877 #define SWIG_ValueError 9
878 #define SWIG_SystemError 10
879 #define SWIG_UnknownError 99
880
881
882 static void SWIG_exception_(int code, const char *msg) {
883 switch (code) {
884 case SWIG_MemoryError:
885 rb_raise(rb_eNoMemError, msg);
886 break;
887 case SWIG_IOError:
888 rb_raise(rb_eIOError, msg);
889 break;
890 case SWIG_RuntimeError:
891 rb_raise(rb_eRuntimeError, msg);
892 break;
893 case SWIG_IndexError:
894 rb_raise(rb_eIndexError, msg);
895 break;
896 case SWIG_TypeError:
897 rb_raise(rb_eTypeError, msg);
898 break;
899 case SWIG_DivisionByZero:
900 rb_raise(rb_eZeroDivError, msg);
901 break;
902 case SWIG_OverflowError:
903 rb_raise(rb_eRangeError, msg);
904 break;
905 case SWIG_SyntaxError:
906 rb_raise(rb_eSyntaxError, msg);
907 break;
908 case SWIG_ValueError:
909 rb_raise(rb_eArgError, msg);
910 break;
911 case SWIG_SystemError:
912 rb_raise(rb_eFatal, msg);
913 break;
914 case SWIG_UnknownError:
915 rb_raise(rb_eRuntimeError, msg);
916 break;
917 default:
918 break;
919 }
920 }
921
922 #define SWIG_exception(a, b) SWIG_exception_((a), (b))
923
924
925 #include <stdexcept>
926
927
928 #include <string>
929
930 #define SWIG_FLOAT_P(x) ((TYPE(x) == T_FLOAT) || FIXNUM_P(x))
931
932 bool SWIG_BOOL_P(VALUE) {
933 // dummy test, RTEST should take care of everything
934 return true;
935 }
936 bool SWIG_RB2BOOL(VALUE x) {
937 return RTEST(x);
938 }
939 VALUE SWIG_BOOL2RB(bool b) {
940 return b ? Qtrue : Qfalse;
941 }
942 double SWIG_NUM2DBL(VALUE x) {
943 return (FIXNUM_P(x) ? FIX2INT(x) : NUM2DBL(x));
944 }
945 bool SWIG_STRING_P(VALUE x) {
946 return TYPE(x) == T_STRING;
947 }
948 std::string SWIG_RB2STR(VALUE x) {
949 return std::string(StringValuePtr(x));
950 }
951 VALUE SWIG_STR2RB(const std::string& s) {
952 return rb_str_new2(s.c_str());
953 }
954
955
956 #include <string>
957
958
959 #include <vector>
960 #include <algorithm>
961 #include <stdexcept>
962
963
964 #include <map>
965 #include <algorithm>
966 #include <stdexcept>
967
968
969 #include <utility>
970
971 static std::string std_vector_Sl_std_string_Sg__pop(std::vector<std::string > *self){
972 if (self->size() == 0)
973 throw std::out_of_range("pop from empty vector");
974 std::string x = self->back();
975 self->pop_back();
976 return x;
977 }
978 static std::string std_vector_Sl_std_string_Sg____getitem__(std::vector<std::string > *self,int i){
979 int size = int(self->size());
980 if (i<0) i += size;
981 if (i>=0 && i<size)
982 return (*self)[i];
983 else
984 throw std::out_of_range("vector index out of range");
985 }
986 static void std_vector_Sl_std_string_Sg____setitem__(std::vector<std::string > *self,int i,std::string x){
987 int size = int(self->size());
988 if (i<0) i+= size;
989 if (i>=0 && i<size)
990 (*self)[i] = x;
991 else
992 throw std::out_of_range("vector index out of range");
993 }
994 static void std_vector_Sl_std_string_Sg__each(std::vector<std::string > *self){
995 for (unsigned int i=0; i<self->size(); i++)
996 rb_yield(SWIG_STR2RB((*self)[i]));
997 }
998
999 swig_class cStrVector;
1000 static void free_std_vector_Sl_std_string_Sg_(std::vector<std::string > *);
1001 static int std_vector_Sl_int_Sg__pop(std::vector<int > *self){
1002 if (self->size() == 0)
1003 throw std::out_of_range("pop from empty vector");
1004 int x = self->back();
1005 self->pop_back();
1006 return x;
1007 }
1008 static int std_vector_Sl_int_Sg____getitem__(std::vector<int > *self,int i){
1009 int size = int(self->size());
1010 if (i<0) i += size;
1011 if (i>=0 && i<size)
1012 return (*self)[i];
1013 else
1014 throw std::out_of_range("vector index out of range");
1015 }
1016 static void std_vector_Sl_int_Sg____setitem__(std::vector<int > *self,int i,int x){
1017 int size = int(self->size());
1018 if (i<0) i+= size;
1019 if (i>=0 && i<size)
1020 (*self)[i] = x;
1021 else
1022 throw std::out_of_range("vector index out of range");
1023 }
1024 static void std_vector_Sl_int_Sg__each(std::vector<int > *self){
1025 for (unsigned int i=0; i<self->size(); i++)
1026 rb_yield(INT2NUM((*self)[i]));
1027 }
1028
1029 swig_class cIntVector;
1030 static void free_std_vector_Sl_int_Sg_(std::vector<int > *);
1031 static std::string std_map_Sl_std_string_Sc_std_string_Sg____getitem__(std::map<std::string,std::string > *self,std::string key){
1032 std::map<std::string,std::string >::iterator i = self->find(key);
1033 if (i != self->end())
1034 return i->second;
1035 else
1036 throw std::out_of_range("key not found");
1037 }
1038 static void std_map_Sl_std_string_Sc_std_string_Sg____setitem__(std::map<std::string,std::string > *self,std::string key,std::string x){
1039 (*self)[key] = x;
1040 }
1041 static std::string std_map_Sl_std_string_Sc_std_string_Sg____delitem__(std::map<std::string,std::string > *self,std::string key){
1042 std::map<std::string,std::string >::iterator i = self->find(key);
1043 if (i != self->end()) {
1044 std::string x = i->second;
1045 self->erase(i);
1046 return x;
1047 } else
1048 throw std::out_of_range("key not found");
1049 }
1050 static bool std_map_Sl_std_string_Sc_std_string_Sg__has_key(std::map<std::string,std::string > *self,std::string key){
1051 std::map<std::string,std::string >::iterator i = self->find(key);
1052 return i != self->end();
1053 }
1054 static VALUE std_map_Sl_std_string_Sc_std_string_Sg__keys(std::map<std::string,std::string > *self){
1055 VALUE keyList = rb_ary_new2(self->size());
1056 std::map<std::string,std::string >::iterator i;
1057 unsigned int j;
1058 for (i=self->begin(), j=0; i!=self->end(); ++i, ++j) {
1059 rb_ary_store(keyList,j,
1060 SWIG_STR2RB(i->first));
1061 }
1062 return keyList;
1063 }
1064 static VALUE std_map_Sl_std_string_Sc_std_string_Sg__values(std::map<std::string,std::string > *self){
1065 VALUE valueList = rb_ary_new2(self->size());
1066 std::map<std::string,std::string >::iterator i;
1067 unsigned int j;
1068 for (i=self->begin(), j=0; i!=self->end(); ++i, ++j) {
1069 rb_ary_store(valueList,j,
1070 SWIG_STR2RB(i->second));
1071 }
1072 return valueList;
1073 }
1074 static void std_map_Sl_std_string_Sc_std_string_Sg__each(std::map<std::string,std::string > *self){
1075 std::map<std::string,std::string >::iterator i;
1076 for (i=self->begin(); i!=self->end(); ++i) {
1077 VALUE entry = rb_ary_new2(2);
1078 rb_ary_store(entry,0,SWIG_STR2RB(i->first));
1079 rb_ary_store(entry,1,SWIG_STR2RB(i->second));
1080 rb_yield(entry);
1081 }
1082 }
1083
1084 swig_class cStrStrMap;
1085 static void free_std_map_Sl_std_string_Sc_std_string_Sg_(std::map<std::string,std::string > *);
1086
1087 #include "HyperEstraierWrapper.cpp"
1088
1089
1090 swig_class cCondition;
1091 static void free_estraier_Condition(estraier::Condition *);
1092
1093 swig_class cDocument;
1094 static void free_estraier_Document(estraier::Document *);
1095
1096 swig_class cDatabase;
1097 static void free_estraier_Database(estraier::Database *);
1098 static VALUE
1099 _wrap_new_StrVector__SWIG_0(int argc, VALUE *argv, VALUE self) {
1100 unsigned int arg1 ;
1101 std::vector<std::string > *result;
1102
1103 if ((argc < 1) || (argc > 1))
1104 rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1105 arg1 = NUM2UINT(argv[0]);
1106 {
1107 try {
1108 result = (std::vector<std::string > *)new std::vector<std::string >(arg1);
1109 DATA_PTR(self) = result;
1110 } catch (const char *msg) {
1111 SWIG_exception(SWIG_RuntimeError, msg);
1112 }
1113 }
1114 return self;
1115 }
1116
1117
1118 static VALUE
1119 _wrap_new_StrVector__SWIG_1(int argc, VALUE *argv, VALUE self) {
1120 std::vector<std::string > *result;
1121
1122 if ((argc < 0) || (argc > 0))
1123 rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
1124 {
1125 try {
1126 result = (std::vector<std::string > *)new std::vector<std::string >();
1127 DATA_PTR(self) = result;
1128 } catch (const char *msg) {
1129 SWIG_exception(SWIG_RuntimeError, msg);
1130 }
1131 }
1132 return self;
1133 }
1134
1135
1136 static VALUE
1137 _wrap_new_StrVector__SWIG_2(int argc, VALUE *argv, VALUE self) {
1138 unsigned int arg1 ;
1139 std::string *arg2 = 0 ;
1140 std::vector<std::string > *result;
1141 std::string temp2 ;
1142
1143 if ((argc < 2) || (argc > 2))
1144 rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
1145 arg1 = NUM2UINT(argv[0]);
1146 {
1147 if (TYPE(argv[1]) == T_STRING) {
1148 temp2 = std::string(StringValuePtr(argv[1]));
1149 arg2 = &temp2;
1150 } else {
1151 SWIG_exception(SWIG_TypeError, "not a string");
1152 }
1153 }
1154 {
1155 try {
1156 result = (std::vector<std::string > *)new std::vector<std::string >(arg1,(std::string const &)*arg2);
1157 DATA_PTR(self) = result;
1158 } catch (const char *msg) {
1159 SWIG_exception(SWIG_RuntimeError, msg);
1160 }
1161 }
1162 return self;
1163 }
1164
1165
1166 #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
1167 static VALUE
1168 _wrap_StrVector_allocate(VALUE self) {
1169 #else
1170 static VALUE
1171 _wrap_StrVector_allocate(int argc, VALUE *argv, VALUE self) {
1172 #endif
1173
1174
1175 VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_std__vectorTstd__string_t);
1176 #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
1177 rb_obj_call_init(vresult, argc, argv);
1178 #endif
1179 return vresult;
1180 }
1181
1182
1183 static VALUE
1184 _wrap_new_StrVector__SWIG_3(int argc, VALUE *argv, VALUE self) {
1185 std::vector<std::string > *arg1 = 0 ;
1186 std::vector<std::string > *result;
1187 std::vector<std::string > temp1 ;
1188
1189 if ((argc < 1) || (argc > 1))
1190 rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1191 {
1192 if (rb_obj_is_kind_of(argv[0],rb_cArray)) {
1193 unsigned int size = RARRAY(argv[0])->len;
1194 temp1 = std::vector<std::string >(size);
1195 arg1 = &temp1;
1196 for (unsigned int i=0; i<size; i++) {
1197 VALUE o = RARRAY(argv[0])->ptr[i];
1198 if (SWIG_STRING_P(o))
1199 temp1[i] = (std::string)(SWIG_RB2STR(o));
1200 else
1201 rb_raise(rb_eTypeError,
1202 "wrong argument type"
1203 " (expected vector<""std::string" ">)");
1204 }
1205 } else {
1206 SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_std__vectorTstd__string_t, 1);
1207 }
1208 }
1209 {
1210 try {
1211 result = (std::vector<std::string > *)new std::vector<std::string >((std::vector<std::string > const &)*arg1);
1212 DATA_PTR(self) = result;
1213 } catch (const char *msg) {
1214 SWIG_exception(SWIG_RuntimeError, msg);
1215 }
1216 }
1217 return self;
1218 }
1219
1220
1221 static VALUE _wrap_new_StrVector(int nargs, VALUE *args, VALUE self) {
1222 int argc;
1223 VALUE argv[2];
1224 int ii;
1225
1226 argc = nargs;
1227 for (ii = 0; (ii < argc) && (ii < 2); ii++) {
1228 argv[ii] = args[ii];
1229 }
1230 if (argc == 0) {
1231 return _wrap_new_StrVector__SWIG_1(nargs, args, self);
1232 }
1233 if (argc == 1) {
1234 int _v;
1235 {
1236 _v = ((TYPE(argv[0]) == T_FIXNUM) || (TYPE(argv[0]) == T_BIGNUM)) ? 1 : 0;
1237 }
1238 if (_v) {
1239 return _wrap_new_StrVector__SWIG_0(nargs, args, self);
1240 }
1241 }
1242 if (argc == 1) {
1243 int _v;
1244 {
1245 /* native sequence? */
1246 if (rb_obj_is_kind_of(argv[0],rb_cArray)) {
1247 unsigned int size = RARRAY(argv[0])->len;
1248 if (size == 0) {
1249 /* an empty sequence can be of any type */
1250 _v = 1;
1251 } else {
1252 /* check the first element only */
1253 VALUE o = RARRAY(argv[0])->ptr[0];
1254 if (SWIG_STRING_P(o))
1255 _v = 1;
1256 else
1257 _v = 0;
1258 }
1259 } else {
1260 /* wrapped vector? */
1261 std::vector<std::string >* v;
1262 if (SWIG_ConvertPtr(argv[0],(void **) &v,
1263 SWIGTYPE_p_std__vectorTstd__string_t,0) != -1)
1264 _v = 1;
1265 else
1266 _v = 0;
1267 }
1268 }
1269 if (_v) {
1270 return _wrap_new_StrVector__SWIG_3(nargs, args, self);
1271 }
1272 }
1273 if (argc == 2) {
1274 int _v;
1275 {
1276 _v = ((TYPE(argv[0]) == T_FIXNUM) || (TYPE(argv[0]) == T_BIGNUM)) ? 1 : 0;
1277 }
1278 if (_v) {
1279 {
1280 _v = (TYPE(argv[1]) == T_STRING) ? 1 : 0;
1281 }
1282 if (_v) {
1283 return _wrap_new_StrVector__SWIG_2(nargs, args, self);
1284 }
1285 }
1286 }
1287
1288 rb_raise(rb_eArgError, "No matching function for overloaded 'new_StrVector'");
1289 return Qnil;
1290 }
1291
1292
1293 static VALUE
1294 _wrap_StrVector___len__(int argc, VALUE *argv, VALUE self) {
1295 std::vector<std::string > *arg1 = (std::vector<std::string > *) 0 ;
1296 unsigned int result;
1297 std::vector<std::string > temp1 ;
1298 VALUE vresult = Qnil;
1299
1300 if ((argc < 0) || (argc > 0))
1301 rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
1302 {
1303 if (rb_obj_is_kind_of(self,rb_cArray)) {
1304 unsigned int size = RARRAY(self)->len;
1305 temp1 = std::vector<std::string >(size);
1306 arg1 = &temp1;
1307 for (unsigned int i=0; i<size; i++) {
1308 VALUE o = RARRAY(self)->ptr[i];
1309 if (SWIG_STRING_P(o))
1310 temp1[i] = (std::string)(SWIG_RB2STR(o));
1311 else
1312 rb_raise(rb_eTypeError,
1313 "wrong argument type"
1314 " (expected vector<""std::string" ">)");
1315 }
1316 } else {
1317 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_std__vectorTstd__string_t, 1);
1318 }
1319 }
1320 {
1321 try {
1322 result = (unsigned int)((std::vector<std::string > const *)arg1)->size();
1323
1324 } catch (const char *msg) {
1325 SWIG_exception(SWIG_RuntimeError, msg);
1326 }
1327 }
1328 vresult = UINT2NUM(result);
1329 return vresult;
1330 }
1331
1332
1333 static VALUE
1334 _wrap_StrVector_emptyq___(int argc, VALUE *argv, VALUE self) {
1335 std::vector<std::string > *arg1 = (std::vector<std::string > *) 0 ;
1336 bool result;
1337 std::vector<std::string > temp1 ;
1338 VALUE vresult = Qnil;
1339
1340 if ((argc < 0) || (argc > 0))
1341 rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
1342 {
1343 if (rb_obj_is_kind_of(self,rb_cArray)) {
1344 unsigned int size = RARRAY(self)->len;
1345 temp1 = std::vector<std::string >(size);
1346 arg1 = &temp1;
1347 for (unsigned int i=0; i<size; i++) {
1348 VALUE o = RARRAY(self)->ptr[i];
1349 if (SWIG_STRING_P(o))
1350 temp1[i] = (std::string)(SWIG_RB2STR(o));
1351 else
1352 rb_raise(rb_eTypeError,
1353 "wrong argument type"
1354 " (expected vector<""std::string" ">)");
1355 }
1356 } else {
1357 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_std__vectorTstd__string_t, 1);
1358 }
1359 }
1360 {
1361 try {
1362 result = (bool)((std::vector<std::string > const *)arg1)->empty();
1363
1364 } catch (const char *msg) {
1365 SWIG_exception(SWIG_RuntimeError, msg);
1366 }
1367 }
1368 vresult = result ? Qtrue : Qfalse;
1369 return vresult;
1370 }
1371
1372
1373 static VALUE
1374 _wrap_StrVector_clear(int argc, VALUE *argv, VALUE self) {
1375 std::vector<std::string > *arg1 = (std::vector<std::string > *) 0 ;
1376
1377 if ((argc < 0) || (argc > 0))
1378 rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
1379 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_std__vectorTstd__string_t, 1);
1380 {
1381 try {
1382 (arg1)->clear();
1383
1384 } catch (const char *msg) {
1385 SWIG_exception(SWIG_RuntimeError, msg);
1386 }
1387 }
1388 return Qnil;
1389 }
1390
1391
1392 static VALUE
1393 _wrap_StrVector_push(int argc, VALUE *argv, VALUE self) {
1394 std::vector<std::string > *arg1 = (std::vector<std::string > *) 0 ;
1395 std::string arg2 ;
1396
1397 if ((argc < 1) || (argc > 1))
1398 rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1399 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_std__vectorTstd__string_t, 1);
1400 {
1401 if (TYPE(argv[0]) == T_STRING) {
1402 arg2 = std::string(StringValuePtr(argv[0]));
1403 } else {
1404 SWIG_exception(SWIG_TypeError, "not a string");
1405 }
1406 }
1407 {
1408 try {
1409 (arg1)->push_back(arg2);
1410
1411 } catch (const char *msg) {
1412 SWIG_exception(SWIG_RuntimeError, msg);
1413 }
1414 }
1415 return Qnil;
1416 }
1417
1418
1419 static VALUE
1420 _wrap_StrVector_pop(int argc, VALUE *argv, VALUE self) {
1421 std::vector<std::string > *arg1 = (std::vector<std::string > *) 0 ;
1422 std::string result;
1423 VALUE vresult = Qnil;
1424
1425 if ((argc < 0) || (argc > 0))
1426 rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
1427 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_std__vectorTstd__string_t, 1);
1428 {
1429 try {
1430 result = std_vector_Sl_std_string_Sg__pop(arg1);
1431
1432 } catch (std::out_of_range& e) {
1433 SWIG_exception(SWIG_IndexError,const_cast<char*>(e.what()));
1434 }
1435 }
1436 {
1437 vresult = rb_str_new2((&result)->c_str());
1438 }
1439 return vresult;
1440 }
1441
1442
1443 static VALUE
1444 _wrap_StrVector___getitem__(int argc, VALUE *argv, VALUE self) {
1445 std::vector<std::string > *arg1 = (std::vector<std::string > *) 0 ;
1446 int arg2 ;
1447 std::string result;
1448 VALUE vresult = Qnil;
1449
1450 if ((argc < 1) || (argc > 1))
1451 rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1452 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_std__vectorTstd__string_t, 1);
1453 arg2 = NUM2INT(argv[0]);
1454 {
1455 try {
1456 result = std_vector_Sl_std_string_Sg____getitem__(arg1,arg2);
1457
1458 } catch (std::out_of_range& e) {
1459 SWIG_exception(SWIG_IndexError,const_cast<char*>(e.what()));
1460 }
1461 }
1462 {
1463 vresult = rb_str_new2((&result)->c_str());
1464 }
1465 return vresult;
1466 }
1467
1468
1469 static VALUE
1470 _wrap_StrVector___setitem__(int argc, VALUE *argv, VALUE self) {
1471 std::vector<std::string > *arg1 = (std::vector<std::string > *) 0 ;
1472 int arg2 ;
1473 std::string arg3 ;
1474
1475 if ((argc < 2) || (argc > 2))
1476 rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
1477 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_std__vectorTstd__string_t, 1);
1478 arg2 = NUM2INT(argv[0]);
1479 {
1480 if (TYPE(argv[1]) == T_STRING) {
1481 arg3 = std::string(StringValuePtr(argv[1]));
1482 } else {
1483 SWIG_exception(SWIG_TypeError, "not a string");
1484 }
1485 }
1486 {
1487 try {
1488 std_vector_Sl_std_string_Sg____setitem__(arg1,arg2,arg3);
1489
1490 } catch (std::out_of_range& e) {
1491 SWIG_exception(SWIG_IndexError,const_cast<char*>(e.what()));
1492 }
1493 }
1494 return Qnil;
1495 }
1496
1497
1498 static VALUE
1499 _wrap_StrVector_each(int argc, VALUE *argv, VALUE self) {
1500 std::vector<std::string > *arg1 = (std::vector<std::string > *) 0 ;
1501
1502 if ((argc < 0) || (argc > 0))
1503 rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
1504 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_std__vectorTstd__string_t, 1);
1505 {
1506 try {
1507 std_vector_Sl_std_string_Sg__each(arg1);
1508
1509 } catch (const char *msg) {
1510 SWIG_exception(SWIG_RuntimeError, msg);
1511 }
1512 }
1513 return Qnil;
1514 }
1515
1516
1517 static void
1518 free_std_vector_Sl_std_string_Sg_(std::vector<std::string > *arg1) {
1519 delete arg1;
1520 }
1521 static VALUE
1522 _wrap_new_IntVector__SWIG_0(int argc, VALUE *argv, VALUE self) {
1523 unsigned int arg1 ;
1524 std::vector<int > *result;
1525
1526 if ((argc < 1) || (argc > 1))
1527 rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1528 arg1 = NUM2UINT(argv[0]);
1529 {
1530 try {
1531 result = (std::vector<int > *)new std::vector<int >(arg1);
1532 DATA_PTR(self) = result;
1533 } catch (const char *msg) {
1534 SWIG_exception(SWIG_RuntimeError, msg);
1535 }
1536 }
1537 return self;
1538 }
1539
1540
1541 static VALUE
1542 _wrap_new_IntVector__SWIG_1(int argc, VALUE *argv, VALUE self) {
1543 std::vector<int > *result;
1544
1545 if ((argc < 0) || (argc > 0))
1546 rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
1547 {
1548 try {
1549 result = (std::vector<int > *)new std::vector<int >();
1550 DATA_PTR(self) = result;
1551 } catch (const char *msg) {
1552 SWIG_exception(SWIG_RuntimeError, msg);
1553 }
1554 }
1555 return self;
1556 }
1557
1558
1559 static VALUE
1560 _wrap_new_IntVector__SWIG_2(int argc, VALUE *argv, VALUE self) {
1561 unsigned int arg1 ;
1562 int *arg2 = 0 ;
1563 std::vector<int > *result;
1564 int temp2 ;
1565
1566 if ((argc < 2) || (argc > 2))
1567 rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
1568 arg1 = NUM2UINT(argv[0]);
1569 temp2 = (int) NUM2INT(argv[1]);
1570 arg2 = &temp2;
1571 {
1572 try {
1573 result = (std::vector<int > *)new std::vector<int >(arg1,(int const &)*arg2);
1574 DATA_PTR(self) = result;
1575 } catch (const char *msg) {
1576 SWIG_exception(SWIG_RuntimeError, msg);
1577 }
1578 }
1579 return self;
1580 }
1581
1582
1583 #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
1584 static VALUE
1585 _wrap_IntVector_allocate(VALUE self) {
1586 #else
1587 static VALUE
1588 _wrap_IntVector_allocate(int argc, VALUE *argv, VALUE self) {
1589 #endif
1590
1591
1592 VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_std__vectorTint_t);
1593 #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
1594 rb_obj_call_init(vresult, argc, argv);
1595 #endif
1596 return vresult;
1597 }
1598
1599
1600 static VALUE
1601 _wrap_new_IntVector__SWIG_3(int argc, VALUE *argv, VALUE self) {
1602 std::vector<int > *arg1 = 0 ;
1603 std::vector<int > *result;
1604 std::vector<int > temp1 ;
1605
1606 if ((argc < 1) || (argc > 1))
1607 rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1608 {
1609 if (rb_obj_is_kind_of(argv[0],rb_cArray)) {
1610 unsigned int size = RARRAY(argv[0])->len;
1611 temp1 = std::vector<int >(size);
1612 arg1 = &temp1;
1613 for (unsigned int i=0; i<size; i++) {
1614 VALUE o = RARRAY(argv[0])->ptr[i];
1615 if (FIXNUM_P(o))
1616 temp1[i] = (int)(FIX2INT(o));
1617 else
1618 rb_raise(rb_eTypeError,
1619 "wrong argument type"
1620 " (expected vector<""int" ">)");
1621 }
1622 } else {
1623 SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_std__vectorTint_t, 1);
1624 }
1625 }
1626 {
1627 try {
1628 result = (std::vector<int > *)new std::vector<int >((std::vector<int > const &)*arg1);
1629 DATA_PTR(self) = result;
1630 } catch (const char *msg) {
1631 SWIG_exception(SWIG_RuntimeError, msg);
1632 }
1633 }
1634 return self;
1635 }
1636
1637
1638 static VALUE _wrap_new_IntVector(int nargs, VALUE *args, VALUE self) {
1639 int argc;
1640 VALUE argv[2];
1641 int ii;
1642
1643 argc = nargs;
1644 for (ii = 0; (ii < argc) && (ii < 2); ii++) {
1645 argv[ii] = args[ii];
1646 }
1647 if (argc == 0) {
1648 return _wrap_new_IntVector__SWIG_1(nargs, args, self);
1649 }
1650 if (argc == 1) {
1651 int _v;
1652 {
1653 _v = ((TYPE(argv[0]) == T_FIXNUM) || (TYPE(argv[0]) == T_BIGNUM)) ? 1 : 0;
1654 }
1655 if (_v) {
1656 return _wrap_new_IntVector__SWIG_0(nargs, args, self);
1657 }
1658 }
1659 if (argc == 1) {
1660 int _v;
1661 {
1662 /* native sequence? */
1663 if (rb_obj_is_kind_of(argv[0],rb_cArray)) {
1664 unsigned int size = RARRAY(argv[0])->len;
1665 if (size == 0) {
1666 /* an empty sequence can be of any type */
1667 _v = 1;
1668 } else {
1669 /* check the first element only */
1670 VALUE o = RARRAY(argv[0])->ptr[0];
1671 if (FIXNUM_P(o))
1672 _v = 1;
1673 else
1674 _v = 0;
1675 }
1676 } else {
1677 /* wrapped vector? */
1678 std::vector<int >* v;
1679 if (SWIG_ConvertPtr(argv[0],(void **) &v,
1680 SWIGTYPE_p_std__vectorTint_t,0) != -1)
1681 _v = 1;
1682 else
1683 _v = 0;
1684 }
1685 }
1686 if (_v) {
1687 return _wrap_new_IntVector__SWIG_3(nargs, args, self);
1688 }
1689 }
1690 if (argc == 2) {
1691 int _v;
1692 {
1693 _v = ((TYPE(argv[0]) == T_FIXNUM) || (TYPE(argv[0]) == T_BIGNUM)) ? 1 : 0;
1694 }
1695 if (_v) {
1696 {
1697 _v = ((TYPE(argv[1]) == T_FIXNUM) || (TYPE(argv[1]) == T_BIGNUM)) ? 1 : 0;
1698 }
1699 if (_v) {
1700 return _wrap_new_IntVector__SWIG_2(nargs, args, self);
1701 }
1702 }
1703 }
1704
1705 rb_raise(rb_eArgError, "No matching function for overloaded 'new_IntVector'");
1706 return Qnil;
1707 }
1708
1709
1710 static VALUE
1711 _wrap_IntVector___len__(int argc, VALUE *argv, VALUE self) {
1712 std::vector<int > *arg1 = (std::vector<int > *) 0 ;
1713 unsigned int result;
1714 std::vector<int > temp1 ;
1715 VALUE vresult = Qnil;
1716
1717 if ((argc < 0) || (argc > 0))
1718 rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
1719 {
1720 if (rb_obj_is_kind_of(self,rb_cArray)) {
1721 unsigned int size = RARRAY(self)->len;
1722 temp1 = std::vector<int >(size);
1723 arg1 = &temp1;
1724 for (unsigned int i=0; i<size; i++) {
1725 VALUE o = RARRAY(self)->ptr[i];
1726 if (FIXNUM_P(o))
1727 temp1[i] = (int)(FIX2INT(o));
1728 else
1729 rb_raise(rb_eTypeError,
1730 "wrong argument type"
1731 " (expected vector<""int" ">)");
1732 }
1733 } else {
1734 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_std__vectorTint_t, 1);
1735 }
1736 }
1737 {
1738 try {
1739 result = (unsigned int)((std::vector<int > const *)arg1)->size();
1740
1741 } catch (const char *msg) {
1742 SWIG_exception(SWIG_RuntimeError, msg);
1743 }
1744 }
1745 vresult = UINT2NUM(result);
1746 return vresult;
1747 }
1748
1749
1750 static VALUE
1751 _wrap_IntVector_emptyq___(int argc, VALUE *argv, VALUE self) {
1752 std::vector<int > *arg1 = (std::vector<int > *) 0 ;
1753 bool result;
1754 std::vector<int > temp1 ;
1755 VALUE vresult = Qnil;
1756
1757 if ((argc < 0) || (argc > 0))
1758 rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
1759 {
1760 if (rb_obj_is_kind_of(self,rb_cArray)) {
1761 unsigned int size = RARRAY(self)->len;
1762 temp1 = std::vector<int >(size);
1763 arg1 = &temp1;
1764 for (unsigned int i=0; i<size; i++) {
1765 VALUE o = RARRAY(self)->ptr[i];
1766 if (FIXNUM_P(o))
1767 temp1[i] = (int)(FIX2INT(o));
1768 else
1769 rb_raise(rb_eTypeError,
1770 "wrong argument type"
1771 " (expected vector<""int" ">)");
1772 }
1773 } else {
1774 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_std__vectorTint_t, 1);
1775 }
1776 }
1777 {
1778 try {
1779 result = (bool)((std::vector<int > const *)arg1)->empty();
1780
1781 } catch (const char *msg) {
1782 SWIG_exception(SWIG_RuntimeError, msg);
1783 }
1784 }
1785 vresult = result ? Qtrue : Qfalse;
1786 return vresult;
1787 }
1788
1789
1790 static VALUE
1791 _wrap_IntVector_clear(int argc, VALUE *argv, VALUE self) {
1792 std::vector<int > *arg1 = (std::vector<int > *) 0 ;
1793
1794 if ((argc < 0) || (argc > 0))
1795 rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
1796 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_std__vectorTint_t, 1);
1797 {
1798 try {
1799 (arg1)->clear();
1800
1801 } catch (const char *msg) {
1802 SWIG_exception(SWIG_RuntimeError, msg);
1803 }
1804 }
1805 return Qnil;
1806 }
1807
1808
1809 static VALUE
1810 _wrap_IntVector_push(int argc, VALUE *argv, VALUE self) {
1811 std::vector<int > *arg1 = (std::vector<int > *) 0 ;
1812 int arg2 ;
1813
1814 if ((argc < 1) || (argc > 1))
1815 rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1816 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_std__vectorTint_t, 1);
1817 arg2 = NUM2INT(argv[0]);
1818 {
1819 try {
1820 (arg1)->push_back(arg2);
1821
1822 } catch (const char *msg) {
1823 SWIG_exception(SWIG_RuntimeError, msg);
1824 }
1825 }
1826 return Qnil;
1827 }
1828
1829
1830 static VALUE
1831 _wrap_IntVector_pop(int argc, VALUE *argv, VALUE self) {
1832 std::vector<int > *arg1 = (std::vector<int > *) 0 ;
1833 int result;
1834 VALUE vresult = Qnil;
1835
1836 if ((argc < 0) || (argc > 0))
1837 rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
1838 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_std__vectorTint_t, 1);
1839 {
1840 try {
1841 result = (int)std_vector_Sl_int_Sg__pop(arg1);
1842
1843 } catch (std::out_of_range& e) {
1844 SWIG_exception(SWIG_IndexError,const_cast<char*>(e.what()));
1845 }
1846 }
1847 vresult = INT2NUM(result);
1848 return vresult;
1849 }
1850
1851
1852 static VALUE
1853 _wrap_IntVector___getitem__(int argc, VALUE *argv, VALUE self) {
1854 std::vector<int > *arg1 = (std::vector<int > *) 0 ;
1855 int arg2 ;
1856 int result;
1857 VALUE vresult = Qnil;
1858
1859 if ((argc < 1) || (argc > 1))
1860 rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1861 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_std__vectorTint_t, 1);
1862 arg2 = NUM2INT(argv[0]);
1863 {
1864 try {
1865 result = (int)std_vector_Sl_int_Sg____getitem__(arg1,arg2);
1866
1867 } catch (std::out_of_range& e) {
1868 SWIG_exception(SWIG_IndexError,const_cast<char*>(e.what()));
1869 }
1870 }
1871 vresult = INT2NUM(result);
1872 return vresult;
1873 }
1874
1875
1876 static VALUE
1877 _wrap_IntVector___setitem__(int argc, VALUE *argv, VALUE self) {
1878 std::vector<int > *arg1 = (std::vector<int > *) 0 ;
1879 int arg2 ;
1880 int arg3 ;
1881
1882 if ((argc < 2) || (argc > 2))
1883 rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
1884 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_std__vectorTint_t, 1);
1885 arg2 = NUM2INT(argv[0]);
1886 arg3 = NUM2INT(argv[1]);
1887 {
1888 try {
1889 std_vector_Sl_int_Sg____setitem__(arg1,arg2,arg3);
1890
1891 } catch (std::out_of_range& e) {
1892 SWIG_exception(SWIG_IndexError,const_cast<char*>(e.what()));
1893 }
1894 }
1895 return Qnil;
1896 }
1897
1898
1899 static VALUE
1900 _wrap_IntVector_each(int argc, VALUE *argv, VALUE self) {
1901 std::vector<int > *arg1 = (std::vector<int > *) 0 ;
1902
1903 if ((argc < 0) || (argc > 0))
1904 rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
1905 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_std__vectorTint_t, 1);
1906 {
1907 try {
1908 std_vector_Sl_int_Sg__each(arg1);
1909
1910 } catch (const char *msg) {
1911 SWIG_exception(SWIG_RuntimeError, msg);
1912 }
1913 }
1914 return Qnil;
1915 }
1916
1917
1918 static void
1919 free_std_vector_Sl_int_Sg_(std::vector<int > *arg1) {
1920 delete arg1;
1921 }
1922 static VALUE
1923 _wrap_new_StrStrMap__SWIG_0(int argc, VALUE *argv, VALUE self) {
1924 std::map<std::string,std::string > *result;
1925
1926 if ((argc < 0) || (argc > 0))
1927 rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
1928 {
1929 try {
1930 result = (std::map<std::string,std::string > *)new std::map<std::string,std::string >();
1931 DATA_PTR(self) = result;
1932 } catch (const char *msg) {
1933 SWIG_exception(SWIG_RuntimeError, msg);
1934 }
1935 }
1936 return self;
1937 }
1938
1939
1940 #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
1941 static VALUE
1942 _wrap_StrStrMap_allocate(VALUE self) {
1943 #else
1944 static VALUE
1945 _wrap_StrStrMap_allocate(int argc, VALUE *argv, VALUE self) {
1946 #endif
1947
1948
1949 VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_std__mapTstd__string_std__string_t);
1950 #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
1951 rb_obj_call_init(vresult, argc, argv);
1952 #endif
1953 return vresult;
1954 }
1955
1956
1957 static VALUE
1958 _wrap_new_StrStrMap__SWIG_1(int argc, VALUE *argv, VALUE self) {
1959 std::map<std::string,std::string > *arg1 = 0 ;
1960 std::map<std::string,std::string > *result;
1961 std::map<std::string,std::string > temp1 ;
1962 std::map<std::string,std::string > *m1 ;
1963
1964 if ((argc < 1) || (argc > 1))
1965 rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1966 {
1967 if (rb_obj_is_kind_of(argv[0],rb_cHash)) {
1968 temp1 = std::map<std::string,std::string >();
1969 arg1 = &temp1;
1970 VALUE keys = rb_funcall(argv[0],rb_intern("keys"),0);
1971 unsigned int size = RARRAY(keys)->len;
1972 for (unsigned int i=0; i<size; i++) {
1973 VALUE key = RARRAY(keys)->ptr[i];
1974 VALUE val = rb_hash_aref(argv[0],key);
1975 if (!(SWIG_STRING_P(key) && SWIG_STRING_P(val)))
1976 rb_raise(rb_eTypeError,
1977 "wrong argument type"
1978 " (expected map<""std::string" ",""std::string" ">)");
1979 temp1[SWIG_RB2STR(key)] = SWIG_RB2STR(val);
1980 }
1981 } else {
1982 SWIG_ConvertPtr(argv[0],(void **) &m1, SWIGTYPE_p_std__mapTstd__string_std__string_t,1);
1983 arg1 = m1;
1984 }
1985 }
1986 {
1987 try {
1988 result = (std::map<std::string,std::string > *)new std::map<std::string,std::string >((std::map<std::string,std::string > const &)*arg1);
1989 DATA_PTR(self) = result;
1990 } catch (const char *msg) {
1991 SWIG_exception(SWIG_RuntimeError, msg);
1992 }
1993 }
1994 return self;
1995 }
1996
1997
1998 static VALUE _wrap_new_StrStrMap(int nargs, VALUE *args, VALUE self) {
1999 int argc;
2000 VALUE argv[1];
2001 int ii;
2002
2003 argc = nargs;
2004 for (ii = 0; (ii < argc) && (ii < 1); ii++) {
2005 argv[ii] = args[ii];
2006 }
2007 if (argc == 0) {
2008 return _wrap_new_StrStrMap__SWIG_0(nargs, args, self);
2009 }
2010 if (argc == 1) {
2011 int _v;
2012 {
2013 // native sequence?
2014 if (rb_obj_is_kind_of(argv[0],rb_cHash)) {
2015 VALUE keys = rb_funcall(argv[0],rb_intern("keys"),0);
2016 unsigned int size = RARRAY(keys)->len;
2017 if (size == 0) {
2018 // an empty dictionary can be of any type
2019 _v = 1;
2020 } else {
2021 // check the first element only
2022 VALUE key = RARRAY(keys)->ptr[0];
2023 VALUE val = rb_hash_aref(argv[0],key);
2024 if (SWIG_STRING_P(key) && SWIG_STRING_P(val))
2025 _v = 1;
2026 else
2027 _v = 0;
2028 }
2029 } else {
2030 // wrapped map?
2031 std::map<std::string,std::string >* m;
2032 if (SWIG_ConvertPtr(argv[0],(void **) &m,
2033 SWIGTYPE_p_std__mapTstd__string_std__string_t,0) != -1)
2034 _v = 1;
2035 else
2036 _v = 0;
2037 }
2038 }
2039 if (_v) {
2040 return _wrap_new_StrStrMap__SWIG_1(nargs, args, self);
2041 }
2042 }
2043
2044 rb_raise(rb_eArgError, "No matching function for overloaded 'new_StrStrMap'");
2045 return Qnil;
2046 }
2047
2048
2049 static VALUE
2050 _wrap_StrStrMap___len__(int argc, VALUE *argv, VALUE self) {
2051 std::map<std::string,std::string > *arg1 = (std::map<std::string,std::string > *) 0 ;
2052 unsigned int result;
2053 std::map<std::string,std::string > temp1 ;
2054 std::map<std::string,std::string > *m1 ;
2055 VALUE vresult = Qnil;
2056
2057 if ((argc < 0) || (argc > 0))
2058 rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
2059 {
2060 if (rb_obj_is_kind_of(self,rb_cHash)) {
2061 temp1 = std::map<std::string,std::string >();
2062 arg1 = &temp1;
2063 VALUE keys = rb_funcall(self,rb_intern("keys"),0);
2064 unsigned int size = RARRAY(keys)->len;
2065 for (unsigned int i=0; i<size; i++) {
2066 VALUE key = RARRAY(keys)->ptr[i];
2067 VALUE val = rb_hash_aref(self,key);
2068 if (!(SWIG_STRING_P(key) && SWIG_STRING_P(val)))
2069 rb_raise(rb_eTypeError,
2070 "wrong argument type"
2071 " (expected map<""std::string" ",""std::string" ">)");
2072 temp1[SWIG_RB2STR(key)] = SWIG_RB2STR(val);
2073 }
2074 } else {
2075 SWIG_ConvertPtr(self,(void **) &m1, SWIGTYPE_p_std__mapTstd__string_std__string_t,1);
2076 arg1 = m1;
2077 }
2078 }
2079 {
2080 try {
2081 result = (unsigned int)((std::map<std::string,std::string > const *)arg1)->size();
2082
2083 } catch (const char *msg) {
2084 SWIG_exception(SWIG_RuntimeError, msg);
2085 }
2086 }
2087 vresult = UINT2NUM(result);
2088 return vresult;
2089 }
2090
2091
2092 static VALUE
2093 _wrap_StrStrMap_emptyq___(int argc, VALUE *argv, VALUE self) {
2094 std::map<std::string,std::string > *arg1 = (std::map<std::string,std::string > *) 0 ;
2095 bool result;
2096 std::map<std::string,std::string > temp1 ;
2097 std::map<std::string,std::string > *m1 ;
2098 VALUE vresult = Qnil;
2099
2100 if ((argc < 0) || (argc > 0))
2101 rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
2102 {
2103 if (rb_obj_is_kind_of(self,rb_cHash)) {
2104 temp1 = std::map<std::string,std::string >();
2105 arg1 = &temp1;
2106 VALUE keys = rb_funcall(self,rb_intern("keys"),0);
2107 unsigned int size = RARRAY(keys)->len;
2108 for (unsigned int i=0; i<size; i++) {
2109 VALUE key = RARRAY(keys)->ptr[i];
2110 VALUE val = rb_hash_aref(self,key);
2111 if (!(SWIG_STRING_P(key) && SWIG_STRING_P(val)))
2112 rb_raise(rb_eTypeError,
2113 "wrong argument type"
2114 " (expected map<""std::string" ",""std::string" ">)");
2115 temp1[SWIG_RB2STR(key)] = SWIG_RB2STR(val);
2116 }
2117 } else {
2118 SWIG_ConvertPtr(self,(void **) &m1, SWIGTYPE_p_std__mapTstd__string_std__string_t,1);
2119 arg1 = m1;
2120 }
2121 }
2122 {
2123 try {
2124 result = (bool)((std::map<std::string,std::string > const *)arg1)->empty();
2125
2126 } catch (const char *msg) {
2127 SWIG_exception(SWIG_RuntimeError, msg);
2128 }
2129 }
2130 vresult = result ? Qtrue : Qfalse;
2131 return vresult;
2132 }
2133
2134
2135 static VALUE
2136 _wrap_StrStrMap_clear(int argc, VALUE *argv, VALUE self) {
2137 std::map<std::string,std::string > *arg1 = (std::map<std::string,std::string > *) 0 ;
2138
2139 if ((argc < 0) || (argc > 0))
2140 rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
2141 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_std__mapTstd__string_std__string_t, 1);
2142 {
2143 try {
2144 (arg1)->clear();
2145
2146 } catch (const char *msg) {
2147 SWIG_exception(SWIG_RuntimeError, msg);
2148 }
2149 }
2150 return Qnil;
2151 }
2152
2153
2154 static VALUE
2155 _wrap_StrStrMap___getitem__(int argc, VALUE *argv, VALUE self) {
2156 std::map<std::string,std::string > *arg1 = (std::map<std::string,std::string > *) 0 ;
2157 std::string arg2 ;
2158 std::string result;
2159 VALUE vresult = Qnil;
2160
2161 if ((argc < 1) || (argc > 1))
2162 rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2163 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_std__mapTstd__string_std__string_t, 1);
2164 {
2165 if (TYPE(argv[0]) == T_STRING) {
2166 arg2 = std::string(StringValuePtr(argv[0]));
2167 } else {
2168 SWIG_exception(SWIG_TypeError, "not a string");
2169 }
2170 }
2171 {
2172 try {
2173 result = std_map_Sl_std_string_Sc_std_string_Sg____getitem__(arg1,arg2);
2174
2175 } catch (std::out_of_range& e) {
2176 SWIG_exception(SWIG_IndexError,const_cast<char*>(e.what()));
2177 }
2178 }
2179 {
2180 vresult = rb_str_new2((&result)->c_str());
2181 }
2182 return vresult;
2183 }
2184
2185
2186 static VALUE
2187 _wrap_StrStrMap___setitem__(int argc, VALUE *argv, VALUE self) {
2188 std::map<std::string,std::string > *arg1 = (std::map<std::string,std::string > *) 0 ;
2189 std::string arg2 ;
2190 std::string arg3 ;
2191
2192 if ((argc < 2) || (argc > 2))
2193 rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2194 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_std__mapTstd__string_std__string_t, 1);
2195 {
2196 if (TYPE(argv[0]) == T_STRING) {
2197 arg2 = std::string(StringValuePtr(argv[0]));
2198 } else {
2199 SWIG_exception(SWIG_TypeError, "not a string");
2200 }
2201 }
2202 {
2203 if (TYPE(argv[1]) == T_STRING) {
2204 arg3 = std::string(StringValuePtr(argv[1]));
2205 } else {
2206 SWIG_exception(SWIG_TypeError, "not a string");
2207 }
2208 }
2209 {
2210 try {
2211 std_map_Sl_std_string_Sc_std_string_Sg____setitem__(arg1,arg2,arg3);
2212
2213 } catch (const char *msg) {
2214 SWIG_exception(SWIG_RuntimeError, msg);
2215 }
2216 }
2217 return Qnil;
2218 }
2219
2220
2221 static VALUE
2222 _wrap_StrStrMap_delete(int argc, VALUE *argv, VALUE self) {
2223 std::map<std::string,std::string > *arg1 = (std::map<std::string,std::string > *) 0 ;
2224 std::string arg2 ;
2225 std::string result;
2226 VALUE vresult = Qnil;
2227
2228 if ((argc < 1) || (argc > 1))
2229 rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2230 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_std__mapTstd__string_std__string_t, 1);
2231 {
2232 if (TYPE(argv[0]) == T_STRING) {
2233 arg2 = std::string(StringValuePtr(argv[0]));
2234 } else {
2235 SWIG_exception(SWIG_TypeError, "not a string");
2236 }
2237 }
2238 {
2239 try {
2240 result = std_map_Sl_std_string_Sc_std_string_Sg____delitem__(arg1,arg2);
2241
2242 } catch (std::out_of_range& e) {
2243 SWIG_exception(SWIG_IndexError,const_cast<char*>(e.what()));
2244 }
2245 }
2246 {
2247 vresult = rb_str_new2((&result)->c_str());
2248 }
2249 return vresult;
2250 }
2251
2252
2253 static VALUE
2254 _wrap_StrStrMap_has_keyq___(int argc, VALUE *argv, VALUE self) {
2255 std::map<std::string,std::string > *arg1 = (std::map<std::string,std::string > *) 0 ;
2256 std::string arg2 ;
2257 bool result;
2258 VALUE vresult = Qnil;
2259
2260 if ((argc < 1) || (argc > 1))
2261 rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2262 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_std__mapTstd__string_std__string_t, 1);
2263 {
2264 if (TYPE(argv[0]) == T_STRING) {
2265 arg2 = std::string(StringValuePtr(argv[0]));
2266 } else {
2267 SWIG_exception(SWIG_TypeError, "not a string");
2268 }
2269 }
2270 {
2271 try {
2272 result = (bool)std_map_Sl_std_string_Sc_std_string_Sg__has_key(arg1,arg2);
2273
2274 } catch (const char *msg) {
2275 SWIG_exception(SWIG_RuntimeError, msg);
2276 }
2277 }
2278 vresult = result ? Qtrue : Qfalse;
2279 return vresult;
2280 }
2281
2282
2283 static VALUE
2284 _wrap_StrStrMap_keys(int argc, VALUE *argv, VALUE self) {
2285 std::map<std::string,std::string > *arg1 = (std::map<std::string,std::string > *) 0 ;
2286 VALUE result;
2287 VALUE vresult = Qnil;
2288
2289 if ((argc < 0) || (argc > 0))
2290 rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
2291 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_std__mapTstd__string_std__string_t, 1);
2292 {
2293 try {
2294 result = (VALUE)std_map_Sl_std_string_Sc_std_string_Sg__keys(arg1);
2295
2296 } catch (const char *msg) {
2297 SWIG_exception(SWIG_RuntimeError, msg);
2298 }
2299 }
2300 vresult = result;
2301 return vresult;
2302 }
2303
2304
2305 static VALUE
2306 _wrap_StrStrMap_values(int argc, VALUE *argv, VALUE self) {
2307 std::map<std::string,std::string > *arg1 = (std::map<std::string,std::string > *) 0 ;
2308 VALUE result;
2309 VALUE vresult = Qnil;
2310
2311 if ((argc < 0) || (argc > 0))
2312 rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
2313 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_std__mapTstd__string_std__string_t, 1);
2314 {
2315 try {
2316 result = (VALUE)std_map_Sl_std_string_Sc_std_string_Sg__values(arg1);
2317
2318 } catch (const char *msg) {
2319 SWIG_exception(SWIG_RuntimeError, msg);
2320 }
2321 }
2322 vresult = result;
2323 return vresult;
2324 }
2325
2326
2327 static VALUE
2328 _wrap_StrStrMap_each(int argc, VALUE *argv, VALUE self) {
2329 std::map<std::string,std::string > *arg1 = (std::map<std::string,std::string > *) 0 ;
2330
2331 if ((argc < 0) || (argc > 0))
2332 rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
2333 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_std__mapTstd__string_std__string_t, 1);
2334 {
2335 try {
2336 std_map_Sl_std_string_Sc_std_string_Sg__each(arg1);
2337
2338 } catch (const char *msg) {
2339 SWIG_exception(SWIG_RuntimeError, msg);
2340 }
2341 }
2342 return Qnil;
2343 }
2344
2345
2346 static void
2347 free_std_map_Sl_std_string_Sc_std_string_Sg_(std::map<std::string,std::string > *arg1) {
2348 delete arg1;
2349 }
2350 static VALUE
2351 _wrap_Condition_cond_set(int argc, VALUE *argv, VALUE self) {
2352 estraier::Condition *arg1 = (estraier::Condition *) 0 ;
2353 ESTCOND *arg2 = (ESTCOND *) 0 ;
2354
2355 if ((argc < 1) || (argc > 1))
2356 rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2357 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_estraier__Condition, 1);
2358 SWIG_ConvertPtr(argv[0], (void **) &arg2, SWIGTYPE_p_ESTCOND, 1);
2359 if (arg1) (arg1)->cond = arg2;
2360
2361 return Qnil;
2362 }
2363
2364
2365 static VALUE
2366 _wrap_Condition_cond_get(int argc, VALUE *argv, VALUE self) {
2367 estraier::Condition *arg1 = (estraier::Condition *) 0 ;
2368 ESTCOND *result;
2369 VALUE vresult = Qnil;
2370
2371 if ((argc < 0) || (argc > 0))
2372 rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
2373 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_estraier__Condition, 1);
2374 result = (ESTCOND *) ((arg1)->cond);
2375
2376 vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_ESTCOND,0);
2377 return vresult;
2378 }
2379
2380
2381 #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
2382 static VALUE
2383 _wrap_Condition_allocate(VALUE self) {
2384 #else
2385 static VALUE
2386 _wrap_Condition_allocate(int argc, VALUE *argv, VALUE self) {
2387 #endif
2388
2389
2390 VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_estraier__Condition);
2391 #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
2392 rb_obj_call_init(vresult, argc, argv);
2393 #endif
2394 return vresult;
2395 }
2396
2397
2398 static VALUE
2399 _wrap_new_Condition(int argc, VALUE *argv, VALUE self) {
2400 estraier::Condition *result;
2401
2402 if ((argc < 0) || (argc > 0))
2403 rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
2404 {
2405 try {
2406 result = (estraier::Condition *)new estraier::Condition();
2407 DATA_PTR(self) = result;
2408 } catch (const char *msg) {
2409 SWIG_exception(SWIG_RuntimeError, msg);
2410 }
2411 }
2412 return self;
2413 }
2414
2415
2416 static void
2417 free_estraier_Condition(estraier::Condition *arg1) {
2418 delete arg1;
2419 }
2420 static VALUE
2421 _wrap_Condition_set_phrase(int argc, VALUE *argv, VALUE self) {
2422 estraier::Condition *arg1 = (estraier::Condition *) 0 ;
2423 char *arg2 = (char *) 0 ;
2424
2425 if ((argc < 1) || (argc > 1))
2426 rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2427 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_estraier__Condition, 1);
2428 arg2 = StringValuePtr(argv[0]);
2429 {
2430 try {
2431 (arg1)->set_phrase((char const *)arg2);
2432
2433 } catch (const char *msg) {
2434 SWIG_exception(SWIG_RuntimeError, msg);
2435 }
2436 }
2437 return Qnil;
2438 }
2439
2440
2441 static VALUE
2442 _wrap_Condition_add_attr(int argc, VALUE *argv, VALUE self) {
2443 estraier::Condition *arg1 = (estraier::Condition *) 0 ;
2444 char *arg2 = (char *) 0 ;
2445
2446 if ((argc < 1) || (argc > 1))
2447 rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2448 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_estraier__Condition, 1);
2449 arg2 = StringValuePtr(argv[0]);
2450 {
2451 try {
2452 (arg1)->add_attr((char const *)arg2);
2453
2454 } catch (const char *msg) {
2455 SWIG_exception(SWIG_RuntimeError, msg);
2456 }
2457 }
2458 return Qnil;
2459 }
2460
2461
2462 static VALUE
2463 _wrap_Condition_set_order(int argc, VALUE *argv, VALUE self) {
2464 estraier::Condition *arg1 = (estraier::Condition *) 0 ;
2465 char *arg2 = (char *) 0 ;
2466
2467 if ((argc < 1) || (argc > 1))
2468 rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2469 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_estraier__Condition, 1);
2470 arg2 = StringValuePtr(argv[0]);
2471 {
2472 try {
2473 (arg1)->set_order((char const *)arg2);
2474
2475 } catch (const char *msg) {
2476 SWIG_exception(SWIG_RuntimeError, msg);
2477 }
2478 }
2479 return Qnil;
2480 }
2481
2482
2483 static VALUE
2484 _wrap_Condition_set_max(int argc, VALUE *argv, VALUE self) {
2485 estraier::Condition *arg1 = (estraier::Condition *) 0 ;
2486 int arg2 ;
2487
2488 if ((argc < 1) || (argc > 1))
2489 rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2490 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_estraier__Condition, 1);
2491 arg2 = NUM2INT(argv[0]);
2492 {
2493 try {
2494 (arg1)->set_max(arg2);
2495
2496 } catch (const char *msg) {
2497 SWIG_exception(SWIG_RuntimeError, msg);
2498 }
2499 }
2500 return Qnil;
2501 }
2502
2503
2504 static VALUE
2505 _wrap_Condition_set_options(int argc, VALUE *argv, VALUE self) {
2506 estraier::Condition *arg1 = (estraier::Condition *) 0 ;
2507 int arg2 ;
2508
2509 if ((argc < 1) || (argc > 1))
2510 rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2511 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_estraier__Condition, 1);
2512 arg2 = NUM2INT(argv[0]);
2513 {
2514 try {
2515 (arg1)->set_options(arg2);
2516
2517 } catch (const char *msg) {
2518 SWIG_exception(SWIG_RuntimeError, msg);
2519 }
2520 }
2521 return Qnil;
2522 }
2523
2524
2525 static VALUE
2526 _wrap_Document_doc_set(int argc, VALUE *argv, VALUE self) {
2527 estraier::Document *arg1 = (estraier::Document *) 0 ;
2528 ESTDOC *arg2 = (ESTDOC *) 0 ;
2529
2530 if ((argc < 1) || (argc > 1))
2531 rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2532 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_estraier__Document, 1);
2533 SWIG_ConvertPtr(argv[0], (void **) &arg2, SWIGTYPE_p_ESTDOC, 1);
2534 if (arg1) (arg1)->doc = arg2;
2535
2536 return Qnil;
2537 }
2538
2539
2540 static VALUE
2541 _wrap_Document_doc_get(int argc, VALUE *argv, VALUE self) {
2542 estraier::Document *arg1 = (estraier::Document *) 0 ;
2543 ESTDOC *result;
2544 VALUE vresult = Qnil;
2545
2546 if ((argc < 0) || (argc > 0))
2547 rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
2548 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_estraier__Document, 1);
2549 result = (ESTDOC *) ((arg1)->doc);
2550
2551 vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_ESTDOC,0);
2552 return vresult;
2553 }
2554
2555
2556 static VALUE
2557 _wrap_new_Document__SWIG_0(int argc, VALUE *argv, VALUE self) {
2558 estraier::Document *result;
2559
2560 if ((argc < 0) || (argc > 0))
2561 rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
2562 {
2563 try {
2564 result = (estraier::Document *)new estraier::Document();
2565 DATA_PTR(self) = result;
2566 } catch (const char *msg) {
2567 SWIG_exception(SWIG_RuntimeError, msg);
2568 }
2569 }
2570 return self;
2571 }
2572
2573
2574 static VALUE
2575 _wrap_new_Document__SWIG_1(int argc, VALUE *argv, VALUE self) {
2576 char *arg1 = (char *) 0 ;
2577 estraier::Document *result;
2578
2579 if ((argc < 1) || (argc > 1))
2580 rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2581 arg1 = StringValuePtr(argv[0]);
2582 {
2583 try {
2584 result = (estraier::Document *)new estraier::Document((char const *)arg1);
2585 DATA_PTR(self) = result;
2586 } catch (const char *msg) {
2587 SWIG_exception(SWIG_RuntimeError, msg);
2588 }
2589 }
2590 return self;
2591 }
2592
2593
2594 #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
2595 static VALUE
2596 _wrap_Document_allocate(VALUE self) {
2597 #else
2598 static VALUE
2599 _wrap_Document_allocate(int argc, VALUE *argv, VALUE self) {
2600 #endif
2601
2602
2603 VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_estraier__Document);
2604 #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
2605 rb_obj_call_init(vresult, argc, argv);
2606 #endif
2607 return vresult;
2608 }
2609
2610
2611 static VALUE
2612 _wrap_new_Document__SWIG_2(int argc, VALUE *argv, VALUE self) {
2613 ESTDOC *arg1 = (ESTDOC *) 0 ;
2614 estraier::Document *result;
2615
2616 if ((argc < 1) || (argc > 1))
2617 rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2618 SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_ESTDOC, 1);
2619 {
2620 try {
2621 result = (estraier::Document *)new estraier::Document(arg1);
2622 DATA_PTR(self) = result;
2623 } catch (const char *msg) {
2624 SWIG_exception(SWIG_RuntimeError, msg);
2625 }
2626 }
2627 return self;
2628 }
2629
2630
2631 static VALUE _wrap_new_Document(int nargs, VALUE *args, VALUE self) {
2632 int argc;
2633 VALUE argv[1];
2634 int ii;
2635
2636 argc = nargs;
2637 for (ii = 0; (ii < argc) && (ii < 1); ii++) {
2638 argv[ii] = args[ii];
2639 }
2640 if (argc == 0) {
2641 return _wrap_new_Document__SWIG_0(nargs, args, self);
2642 }
2643 if (argc == 1) {
2644 int _v;
2645 {
2646 void *ptr;
2647 _v = (NIL_P(argv[0]) || (TYPE(argv[0]) == T_DATA && SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_ESTDOC, 0) != -1)) ? 1 : 0;
2648 }
2649 if (_v) {
2650 return _wrap_new_Document__SWIG_2(nargs, args, self);
2651 }
2652 }
2653 if (argc == 1) {
2654 int _v;
2655 {
2656 _v = (TYPE(argv[0]) == T_STRING) ? 1 : 0;
2657 }
2658 if (_v) {
2659 return _wrap_new_Document__SWIG_1(nargs, args, self);
2660 }
2661 }
2662
2663 rb_raise(rb_eArgError, "No matching function for overloaded 'new_Document'");
2664 return Qnil;
2665 }
2666
2667
2668 static void
2669 free_estraier_Document(estraier::Document *arg1) {
2670 delete arg1;
2671 }
2672 static VALUE
2673 _wrap_Document_add_attr(int argc, VALUE *argv, VALUE self) {
2674 estraier::Document *arg1 = (estraier::Document *) 0 ;
2675 char *arg2 = (char *) 0 ;
2676 char *arg3 = (char *) 0 ;
2677
2678 if ((argc < 2) || (argc > 2))
2679 rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2680 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_estraier__Document, 1);
2681 arg2 = StringValuePtr(argv[0]);
2682 arg3 = StringValuePtr(argv[1]);
2683 {
2684 try {
2685 (arg1)->add_attr((char const *)arg2,(char const *)arg3);
2686
2687 } catch (const char *msg) {
2688 SWIG_exception(SWIG_RuntimeError, msg);
2689 }
2690 }
2691 return Qnil;
2692 }
2693
2694
2695 static VALUE
2696 _wrap_Document_add_text(int argc, VALUE *argv, VALUE self) {
2697 estraier::Document *arg1 = (estraier::Document *) 0 ;
2698 char *arg2 = (char *) 0 ;
2699
2700 if ((argc < 1) || (argc > 1))
2701 rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2702 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_estraier__Document, 1);
2703 arg2 = StringValuePtr(argv[0]);
2704 {
2705 try {
2706 (arg1)->add_text((char const *)arg2);
2707
2708 } catch (const char *msg) {
2709 SWIG_exception(SWIG_RuntimeError, msg);
2710 }
2711 }
2712 return Qnil;
2713 }
2714
2715
2716 static VALUE
2717 _wrap_Document_add_hidden_text(int argc, VALUE *argv, VALUE self) {
2718 estraier::Document *arg1 = (estraier::Document *) 0 ;
2719 char *arg2 = (char *) 0 ;
2720
2721 if ((argc < 1) || (argc > 1))
2722 rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2723 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_estraier__Document, 1);
2724 arg2 = StringValuePtr(argv[0]);
2725 {
2726 try {
2727 (arg1)->add_hidden_text((char const *)arg2);
2728
2729 } catch (const char *msg) {
2730 SWIG_exception(SWIG_RuntimeError, msg);
2731 }
2732 }
2733 return Qnil;
2734 }
2735
2736
2737 static VALUE
2738 _wrap_Document_id(int argc, VALUE *argv, VALUE self) {
2739 estraier::Document *arg1 = (estraier::Document *) 0 ;
2740 int result;
2741 VALUE vresult = Qnil;
2742
2743 if ((argc < 0) || (argc > 0))
2744 rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
2745 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_estraier__Document, 1);
2746 {
2747 try {
2748 result = (int)(arg1)->id();
2749
2750 } catch (const char *msg) {
2751 SWIG_exception(SWIG_RuntimeError, msg);
2752 }
2753 }
2754 vresult = INT2NUM(result);
2755 return vresult;
2756 }
2757
2758
2759 static VALUE
2760 _wrap_Document_attr_names(int argc, VALUE *argv, VALUE self) {
2761 estraier::Document *arg1 = (estraier::Document *) 0 ;
2762 std::vector<std::string > *result;
2763 VALUE vresult = Qnil;
2764
2765 if ((argc < 0) || (argc > 0))
2766 rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
2767 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_estraier__Document, 1);
2768 {
2769 try {
2770 result = (std::vector<std::string > *)(arg1)->attr_names();
2771
2772 } catch (const char *msg) {
2773 SWIG_exception(SWIG_RuntimeError, msg);
2774 }
2775 }
2776 vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_std__vectorTstd__string_t,0);
2777 return vresult;
2778 }
2779
2780
2781 static VALUE
2782 _wrap_Document_attr(int argc, VALUE *argv, VALUE self) {
2783 estraier::Document *arg1 = (estraier::Document *) 0 ;
2784 char *arg2 = (char *) 0 ;
2785 char *result;
2786 VALUE vresult = Qnil;
2787
2788 if ((argc < 1) || (argc > 1))
2789 rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2790 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_estraier__Document, 1);
2791 arg2 = StringValuePtr(argv[0]);
2792 {
2793 try {
2794 result = (char *)(arg1)->attr((char const *)arg2);
2795
2796 } catch (const char *msg) {
2797 SWIG_exception(SWIG_RuntimeError, msg);
2798 }
2799 }
2800 vresult = rb_str_new2(result);
2801 return vresult;
2802 }
2803
2804
2805 static VALUE
2806 _wrap_Document_cat_texts(int argc, VALUE *argv, VALUE self) {
2807 estraier::Document *arg1 = (estraier::Document *) 0 ;
2808 char *result;
2809 VALUE vresult = Qnil;
2810
2811 if ((argc < 0) || (argc > 0))
2812 rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
2813 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_estraier__Document, 1);
2814 {
2815 try {
2816 result = (char *)(arg1)->cat_texts();
2817
2818 } catch (const char *msg) {
2819 SWIG_exception(SWIG_RuntimeError, msg);
2820 }
2821 }
2822 vresult = rb_str_new2(result);
2823 return vresult;
2824 }
2825
2826
2827 static VALUE
2828 _wrap_Document_texts(int argc, VALUE *argv, VALUE self) {
2829 estraier::Document *arg1 = (estraier::Document *) 0 ;
2830 std::vector<std::string > *result;
2831 VALUE vresult = Qnil;
2832
2833 if ((argc < 0) || (argc > 0))
2834 rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
2835 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_estraier__Document, 1);
2836 {
2837 try {
2838 result = (std::vector<std::string > *)(arg1)->texts();
2839
2840 } catch (const char *msg) {
2841 SWIG_exception(SWIG_RuntimeError, msg);
2842 }
2843 }
2844 vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_std__vectorTstd__string_t,0);
2845 return vresult;
2846 }
2847
2848
2849 static VALUE
2850 _wrap_Document_dump_draft(int argc, VALUE *argv, VALUE self) {
2851 estraier::Document *arg1 = (estraier::Document *) 0 ;
2852 char *result;
2853 VALUE vresult = Qnil;
2854
2855 if ((argc < 0) || (argc > 0))
2856 rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
2857 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_estraier__Document, 1);
2858 {
2859 try {
2860 result = (char *)(arg1)->dump_draft();
2861
2862 } catch (const char *msg) {
2863 SWIG_exception(SWIG_RuntimeError, msg);
2864 }
2865 }
2866 vresult = rb_str_new2(result);
2867 return vresult;
2868 }
2869
2870
2871 static VALUE
2872 _wrap_Document_make_snippet(int argc, VALUE *argv, VALUE self) {
2873 estraier::Document *arg1 = (estraier::Document *) 0 ;
2874 std::vector<std::string > arg2 ;
2875 int arg3 ;
2876 int arg4 ;
2877 int arg5 ;
2878 char *result;
2879 VALUE vresult = Qnil;
2880
2881 if ((argc < 4) || (argc > 4))
2882 rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc);
2883 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_estraier__Document, 1);
2884 {
2885 if (rb_obj_is_kind_of(argv[0],rb_cArray)) {
2886 unsigned int size = RARRAY(argv[0])->len;
2887 arg2 = std::vector<std::string >(size);
2888 for (unsigned int i=0; i<size; i++) {
2889 VALUE o = RARRAY(argv[0])->ptr[i];
2890 if (SWIG_STRING_P(o))
2891 ((std::vector<std::string > &)arg2)[i] = (std::string)(SWIG_RB2STR(o));
2892 else
2893 rb_raise(rb_eTypeError,
2894 "wrong argument type"
2895 " (expected vector<""std::string" ">)");
2896 }
2897 } else {
2898 void *ptr;
2899 SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_std__vectorTstd__string_t, 1);
2900 arg2 = *((std::vector<std::string > *) ptr);
2901 }
2902 }
2903 arg3 = NUM2INT(argv[1]);
2904 arg4 = NUM2INT(argv[2]);
2905 arg5 = NUM2INT(argv[3]);
2906 {
2907 try {
2908 result = (char *)(arg1)->make_snippet(arg2,arg3,arg4,arg5);
2909
2910 } catch (const char *msg) {
2911 SWIG_exception(SWIG_RuntimeError, msg);
2912 }
2913 }
2914 vresult = rb_str_new2(result);
2915 return vresult;
2916 }
2917
2918
2919 #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
2920 static VALUE
2921 _wrap_Database_allocate(VALUE self) {
2922 #else
2923 static VALUE
2924 _wrap_Database_allocate(int argc, VALUE *argv, VALUE self) {
2925 #endif
2926
2927
2928 VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_estraier__Database);
2929 #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
2930 rb_obj_call_init(vresult, argc, argv);
2931 #endif
2932 return vresult;
2933 }
2934
2935
2936 static VALUE
2937 _wrap_new_Database(int argc, VALUE *argv, VALUE self) {
2938 estraier::Database *result;
2939
2940 if ((argc < 0) || (argc > 0))
2941 rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
2942 {
2943 try {
2944 result = (estraier::Database *)new estraier::Database();
2945 DATA_PTR(self) = result;
2946 } catch (const char *msg) {
2947 SWIG_exception(SWIG_RuntimeError, msg);
2948 }
2949 }
2950 return self;
2951 }
2952
2953
2954 static void
2955 free_estraier_Database(estraier::Database *arg1) {
2956 delete arg1;
2957 }
2958 static VALUE
2959 _wrap_Database_open(int argc, VALUE *argv, VALUE self) {
2960 estraier::Database *arg1 = (estraier::Database *) 0 ;
2961 char *arg2 = (char *) 0 ;
2962 int arg3 ;
2963 bool result;
2964 VALUE vresult = Qnil;
2965
2966 if ((argc < 2) || (argc > 2))
2967 rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2968 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_estraier__Database, 1);
2969 arg2 = StringValuePtr(argv[0]);
2970 arg3 = NUM2INT(argv[1]);
2971 {
2972 try {
2973 result = (bool)(arg1)->open((char const *)arg2,arg3);
2974
2975 } catch (const char *msg) {
2976 SWIG_exception(SWIG_RuntimeError, msg);
2977 }
2978 }
2979 vresult = result ? Qtrue : Qfalse;
2980 return vresult;
2981 }
2982
2983
2984 static VALUE
2985 _wrap_Database_close(int argc, VALUE *argv, VALUE self) {
2986 estraier::Database *arg1 = (estraier::Database *) 0 ;
2987 bool result;
2988 VALUE vresult = Qnil;
2989
2990 if ((argc < 0) || (argc > 0))
2991 rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
2992 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_estraier__Database, 1);
2993 {
2994 try {
2995 result = (bool)(arg1)->close();
2996
2997 } catch (const char *msg) {
2998 SWIG_exception(SWIG_RuntimeError, msg);
2999 }
3000 }
3001 vresult = result ? Qtrue : Qfalse;
3002 return vresult;
3003 }
3004
3005
3006 static VALUE
3007 _wrap_Database_put_doc(int argc, VALUE *argv, VALUE self) {
3008 estraier::Database *arg1 = (estraier::Database *) 0 ;
3009 estraier::Document *arg2 = (estraier::Document *) 0 ;
3010 int arg3 ;
3011 bool result;
3012 VALUE vresult = Qnil;
3013
3014 if ((argc < 2) || (argc > 2))
3015 rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
3016 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_estraier__Database, 1);
3017 SWIG_ConvertPtr(argv[0], (void **) &arg2, SWIGTYPE_p_estraier__Document, 1);
3018 arg3 = NUM2INT(argv[1]);
3019 {
3020 try {
3021 result = (bool)(arg1)->put_doc(arg2,arg3);
3022
3023 } catch (const char *msg) {
3024 SWIG_exception(SWIG_RuntimeError, msg);
3025 }
3026 }
3027 vresult = result ? Qtrue : Qfalse;
3028 return vresult;
3029 }
3030
3031
3032 static VALUE
3033 _wrap_Database_search(int argc, VALUE *argv, VALUE self) {
3034 estraier::Database *arg1 = (estraier::Database *) 0 ;
3035 estraier::Condition *arg2 = (estraier::Condition *) 0 ;
3036 int arg3 ;
3037 std::vector<int > *result;
3038 VALUE vresult = Qnil;
3039
3040 if ((argc < 2) || (argc > 2))
3041 rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
3042 SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_estraier__Database, 1);
3043 SWIG_ConvertPtr(argv[0], (void **) &arg2, SWIGTYPE_p_estraier__Condition, 1);
3044 arg3 = NUM2INT(argv[1]);
3045 {
3046 try {
3047 result = (std::vector<int > *)(arg1)->search(arg2,arg3);
3048
3049 } catch (const char *msg) {
3050 SWIG_exception(SWIG_RuntimeError, msg);
3051 }
3052 }
3053 vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_std__vectorTint_t,0);
3054 return vresult;
3055 }
3056
3057
3058 static VALUE
3059 _wrap_Database_err_msg(int argc, VALUE *argv, VALUE self) {
3060 int arg1 ;
3061 char *result;
3062 VALUE vresult = Qnil;
3063
3064 if ((argc < 1) || (argc > 1))
3065 rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
3066 arg1 = NUM2INT(argv[0]);
3067 {
3068 try {
3069 result = (char *)estraier::Database::err_msg(arg1);
3070
3071 } catch (const char *msg) {
3072 SWIG_exception(SWIG_RuntimeError, msg);
3073 }
3074 }
3075 vresult = rb_str_new2(result);
3076 return vresult;
3077 }
3078
3079
3080 static VALUE
3081 _wrap_Database_error(int argc, VALUE *argv, VALUE self) {
3082 estraier::Database *arg1 = (estraier::Database *) 0 ;
3083 int result;
3084 VALUE vresult = Qnil;