phonet 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,2296 @@
1
+ /* ----------------------------------------------------------------------------
2
+ * This file was automatically generated by SWIG (http://www.swig.org).
3
+ * Version 1.3.36
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 SWIGRUBY
12
+ /* -----------------------------------------------------------------------------
13
+ * This section contains generic SWIG labels for method/variable
14
+ * declarations/attributes, and other compiler dependent labels.
15
+ * ----------------------------------------------------------------------------- */
16
+
17
+ /* template workaround for compilers that cannot correctly implement the C++ standard */
18
+ #ifndef SWIGTEMPLATEDISAMBIGUATOR
19
+ # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
20
+ # define SWIGTEMPLATEDISAMBIGUATOR template
21
+ # elif defined(__HP_aCC)
22
+ /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
23
+ /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
24
+ # define SWIGTEMPLATEDISAMBIGUATOR template
25
+ # else
26
+ # define SWIGTEMPLATEDISAMBIGUATOR
27
+ # endif
28
+ #endif
29
+
30
+ /* inline attribute */
31
+ #ifndef SWIGINLINE
32
+ # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
33
+ # define SWIGINLINE inline
34
+ # else
35
+ # define SWIGINLINE
36
+ # endif
37
+ #endif
38
+
39
+ /* attribute recognised by some compilers to avoid 'unused' warnings */
40
+ #ifndef SWIGUNUSED
41
+ # if defined(__GNUC__)
42
+ # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
43
+ # define SWIGUNUSED __attribute__ ((__unused__))
44
+ # else
45
+ # define SWIGUNUSED
46
+ # endif
47
+ # elif defined(__ICC)
48
+ # define SWIGUNUSED __attribute__ ((__unused__))
49
+ # else
50
+ # define SWIGUNUSED
51
+ # endif
52
+ #endif
53
+
54
+ #ifndef SWIG_MSC_UNSUPPRESS_4505
55
+ # if defined(_MSC_VER)
56
+ # pragma warning(disable : 4505) /* unreferenced local function has been removed */
57
+ # endif
58
+ #endif
59
+
60
+ #ifndef SWIGUNUSEDPARM
61
+ # ifdef __cplusplus
62
+ # define SWIGUNUSEDPARM(p)
63
+ # else
64
+ # define SWIGUNUSEDPARM(p) p SWIGUNUSED
65
+ # endif
66
+ #endif
67
+
68
+ /* internal SWIG method */
69
+ #ifndef SWIGINTERN
70
+ # define SWIGINTERN static SWIGUNUSED
71
+ #endif
72
+
73
+ /* internal inline SWIG method */
74
+ #ifndef SWIGINTERNINLINE
75
+ # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
76
+ #endif
77
+
78
+ /* exporting methods */
79
+ #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
80
+ # ifndef GCC_HASCLASSVISIBILITY
81
+ # define GCC_HASCLASSVISIBILITY
82
+ # endif
83
+ #endif
84
+
85
+ #ifndef SWIGEXPORT
86
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
87
+ # if defined(STATIC_LINKED)
88
+ # define SWIGEXPORT
89
+ # else
90
+ # define SWIGEXPORT __declspec(dllexport)
91
+ # endif
92
+ # else
93
+ # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
94
+ # define SWIGEXPORT __attribute__ ((visibility("default")))
95
+ # else
96
+ # define SWIGEXPORT
97
+ # endif
98
+ # endif
99
+ #endif
100
+
101
+ /* calling conventions for Windows */
102
+ #ifndef SWIGSTDCALL
103
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
104
+ # define SWIGSTDCALL __stdcall
105
+ # else
106
+ # define SWIGSTDCALL
107
+ # endif
108
+ #endif
109
+
110
+ /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
111
+ #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
112
+ # define _CRT_SECURE_NO_DEPRECATE
113
+ #endif
114
+
115
+ /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
116
+ #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
117
+ # define _SCL_SECURE_NO_DEPRECATE
118
+ #endif
119
+
120
+
121
+ /* -----------------------------------------------------------------------------
122
+ * This section contains generic SWIG labels for method/variable
123
+ * declarations/attributes, and other compiler dependent labels.
124
+ * ----------------------------------------------------------------------------- */
125
+
126
+ /* template workaround for compilers that cannot correctly implement the C++ standard */
127
+ #ifndef SWIGTEMPLATEDISAMBIGUATOR
128
+ # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
129
+ # define SWIGTEMPLATEDISAMBIGUATOR template
130
+ # elif defined(__HP_aCC)
131
+ /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
132
+ /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
133
+ # define SWIGTEMPLATEDISAMBIGUATOR template
134
+ # else
135
+ # define SWIGTEMPLATEDISAMBIGUATOR
136
+ # endif
137
+ #endif
138
+
139
+ /* inline attribute */
140
+ #ifndef SWIGINLINE
141
+ # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
142
+ # define SWIGINLINE inline
143
+ # else
144
+ # define SWIGINLINE
145
+ # endif
146
+ #endif
147
+
148
+ /* attribute recognised by some compilers to avoid 'unused' warnings */
149
+ #ifndef SWIGUNUSED
150
+ # if defined(__GNUC__)
151
+ # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
152
+ # define SWIGUNUSED __attribute__ ((__unused__))
153
+ # else
154
+ # define SWIGUNUSED
155
+ # endif
156
+ # elif defined(__ICC)
157
+ # define SWIGUNUSED __attribute__ ((__unused__))
158
+ # else
159
+ # define SWIGUNUSED
160
+ # endif
161
+ #endif
162
+
163
+ #ifndef SWIG_MSC_UNSUPPRESS_4505
164
+ # if defined(_MSC_VER)
165
+ # pragma warning(disable : 4505) /* unreferenced local function has been removed */
166
+ # endif
167
+ #endif
168
+
169
+ #ifndef SWIGUNUSEDPARM
170
+ # ifdef __cplusplus
171
+ # define SWIGUNUSEDPARM(p)
172
+ # else
173
+ # define SWIGUNUSEDPARM(p) p SWIGUNUSED
174
+ # endif
175
+ #endif
176
+
177
+ /* internal SWIG method */
178
+ #ifndef SWIGINTERN
179
+ # define SWIGINTERN static SWIGUNUSED
180
+ #endif
181
+
182
+ /* internal inline SWIG method */
183
+ #ifndef SWIGINTERNINLINE
184
+ # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
185
+ #endif
186
+
187
+ /* exporting methods */
188
+ #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
189
+ # ifndef GCC_HASCLASSVISIBILITY
190
+ # define GCC_HASCLASSVISIBILITY
191
+ # endif
192
+ #endif
193
+
194
+ #ifndef SWIGEXPORT
195
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
196
+ # if defined(STATIC_LINKED)
197
+ # define SWIGEXPORT
198
+ # else
199
+ # define SWIGEXPORT __declspec(dllexport)
200
+ # endif
201
+ # else
202
+ # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
203
+ # define SWIGEXPORT __attribute__ ((visibility("default")))
204
+ # else
205
+ # define SWIGEXPORT
206
+ # endif
207
+ # endif
208
+ #endif
209
+
210
+ /* calling conventions for Windows */
211
+ #ifndef SWIGSTDCALL
212
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
213
+ # define SWIGSTDCALL __stdcall
214
+ # else
215
+ # define SWIGSTDCALL
216
+ # endif
217
+ #endif
218
+
219
+ /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
220
+ #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
221
+ # define _CRT_SECURE_NO_DEPRECATE
222
+ #endif
223
+
224
+ /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
225
+ #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
226
+ # define _SCL_SECURE_NO_DEPRECATE
227
+ #endif
228
+
229
+
230
+ /* -----------------------------------------------------------------------------
231
+ * swigrun.swg
232
+ *
233
+ * This file contains generic CAPI SWIG runtime support for pointer
234
+ * type checking.
235
+ * ----------------------------------------------------------------------------- */
236
+
237
+ /* This should only be incremented when either the layout of swig_type_info changes,
238
+ or for whatever reason, the runtime changes incompatibly */
239
+ #define SWIG_RUNTIME_VERSION "4"
240
+
241
+ /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
242
+ #ifdef SWIG_TYPE_TABLE
243
+ # define SWIG_QUOTE_STRING(x) #x
244
+ # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
245
+ # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
246
+ #else
247
+ # define SWIG_TYPE_TABLE_NAME
248
+ #endif
249
+
250
+ /*
251
+ You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
252
+ creating a static or dynamic library from the swig runtime code.
253
+ In 99.9% of the cases, swig just needs to declare them as 'static'.
254
+
255
+ But only do this if is strictly necessary, ie, if you have problems
256
+ with your compiler or so.
257
+ */
258
+
259
+ #ifndef SWIGRUNTIME
260
+ # define SWIGRUNTIME SWIGINTERN
261
+ #endif
262
+
263
+ #ifndef SWIGRUNTIMEINLINE
264
+ # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
265
+ #endif
266
+
267
+ /* Generic buffer size */
268
+ #ifndef SWIG_BUFFER_SIZE
269
+ # define SWIG_BUFFER_SIZE 1024
270
+ #endif
271
+
272
+ /* Flags for pointer conversions */
273
+ #define SWIG_POINTER_DISOWN 0x1
274
+ #define SWIG_CAST_NEW_MEMORY 0x2
275
+
276
+ /* Flags for new pointer objects */
277
+ #define SWIG_POINTER_OWN 0x1
278
+
279
+
280
+ /*
281
+ Flags/methods for returning states.
282
+
283
+ The swig conversion methods, as ConvertPtr, return and integer
284
+ that tells if the conversion was successful or not. And if not,
285
+ an error code can be returned (see swigerrors.swg for the codes).
286
+
287
+ Use the following macros/flags to set or process the returning
288
+ states.
289
+
290
+ In old swig versions, you usually write code as:
291
+
292
+ if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
293
+ // success code
294
+ } else {
295
+ //fail code
296
+ }
297
+
298
+ Now you can be more explicit as:
299
+
300
+ int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
301
+ if (SWIG_IsOK(res)) {
302
+ // success code
303
+ } else {
304
+ // fail code
305
+ }
306
+
307
+ that seems to be the same, but now you can also do
308
+
309
+ Type *ptr;
310
+ int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
311
+ if (SWIG_IsOK(res)) {
312
+ // success code
313
+ if (SWIG_IsNewObj(res) {
314
+ ...
315
+ delete *ptr;
316
+ } else {
317
+ ...
318
+ }
319
+ } else {
320
+ // fail code
321
+ }
322
+
323
+ I.e., now SWIG_ConvertPtr can return new objects and you can
324
+ identify the case and take care of the deallocation. Of course that
325
+ requires also to SWIG_ConvertPtr to return new result values, as
326
+
327
+ int SWIG_ConvertPtr(obj, ptr,...) {
328
+ if (<obj is ok>) {
329
+ if (<need new object>) {
330
+ *ptr = <ptr to new allocated object>;
331
+ return SWIG_NEWOBJ;
332
+ } else {
333
+ *ptr = <ptr to old object>;
334
+ return SWIG_OLDOBJ;
335
+ }
336
+ } else {
337
+ return SWIG_BADOBJ;
338
+ }
339
+ }
340
+
341
+ Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
342
+ more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
343
+ swig errors code.
344
+
345
+ Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
346
+ allows to return the 'cast rank', for example, if you have this
347
+
348
+ int food(double)
349
+ int fooi(int);
350
+
351
+ and you call
352
+
353
+ food(1) // cast rank '1' (1 -> 1.0)
354
+ fooi(1) // cast rank '0'
355
+
356
+ just use the SWIG_AddCast()/SWIG_CheckState()
357
+
358
+
359
+ */
360
+ #define SWIG_OK (0)
361
+ #define SWIG_ERROR (-1)
362
+ #define SWIG_IsOK(r) (r >= 0)
363
+ #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
364
+
365
+ /* The CastRankLimit says how many bits are used for the cast rank */
366
+ #define SWIG_CASTRANKLIMIT (1 << 8)
367
+ /* The NewMask denotes the object was created (using new/malloc) */
368
+ #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
369
+ /* The TmpMask is for in/out typemaps that use temporal objects */
370
+ #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
371
+ /* Simple returning values */
372
+ #define SWIG_BADOBJ (SWIG_ERROR)
373
+ #define SWIG_OLDOBJ (SWIG_OK)
374
+ #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
375
+ #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
376
+ /* Check, add and del mask methods */
377
+ #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
378
+ #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
379
+ #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
380
+ #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
381
+ #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
382
+ #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
383
+
384
+
385
+ /* Cast-Rank Mode */
386
+ #if defined(SWIG_CASTRANK_MODE)
387
+ # ifndef SWIG_TypeRank
388
+ # define SWIG_TypeRank unsigned long
389
+ # endif
390
+ # ifndef SWIG_MAXCASTRANK /* Default cast allowed */
391
+ # define SWIG_MAXCASTRANK (2)
392
+ # endif
393
+ # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
394
+ # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
395
+ SWIGINTERNINLINE int SWIG_AddCast(int r) {
396
+ return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
397
+ }
398
+ SWIGINTERNINLINE int SWIG_CheckState(int r) {
399
+ return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
400
+ }
401
+ #else /* no cast-rank mode */
402
+ # define SWIG_AddCast
403
+ # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
404
+ #endif
405
+
406
+
407
+
408
+
409
+ #include <string.h>
410
+
411
+ #ifdef __cplusplus
412
+ extern "C" {
413
+ #endif
414
+
415
+ typedef void *(*swig_converter_func)(void *, int *);
416
+ typedef struct swig_type_info *(*swig_dycast_func)(void **);
417
+
418
+ /* Structure to store information on one type */
419
+ typedef struct swig_type_info {
420
+ const char *name; /* mangled name of this type */
421
+ const char *str; /* human readable name of this type */
422
+ swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
423
+ struct swig_cast_info *cast; /* linked list of types that can cast into this type */
424
+ void *clientdata; /* language specific type data */
425
+ int owndata; /* flag if the structure owns the clientdata */
426
+ } swig_type_info;
427
+
428
+ /* Structure to store a type and conversion function used for casting */
429
+ typedef struct swig_cast_info {
430
+ swig_type_info *type; /* pointer to type that is equivalent to this type */
431
+ swig_converter_func converter; /* function to cast the void pointers */
432
+ struct swig_cast_info *next; /* pointer to next cast in linked list */
433
+ struct swig_cast_info *prev; /* pointer to the previous cast */
434
+ } swig_cast_info;
435
+
436
+ /* Structure used to store module information
437
+ * Each module generates one structure like this, and the runtime collects
438
+ * all of these structures and stores them in a circularly linked list.*/
439
+ typedef struct swig_module_info {
440
+ swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
441
+ size_t size; /* Number of types in this module */
442
+ struct swig_module_info *next; /* Pointer to next element in circularly linked list */
443
+ swig_type_info **type_initial; /* Array of initially generated type structures */
444
+ swig_cast_info **cast_initial; /* Array of initially generated casting structures */
445
+ void *clientdata; /* Language specific module data */
446
+ } swig_module_info;
447
+
448
+ /*
449
+ Compare two type names skipping the space characters, therefore
450
+ "char*" == "char *" and "Class<int>" == "Class<int >", etc.
451
+
452
+ Return 0 when the two name types are equivalent, as in
453
+ strncmp, but skipping ' '.
454
+ */
455
+ SWIGRUNTIME int
456
+ SWIG_TypeNameComp(const char *f1, const char *l1,
457
+ const char *f2, const char *l2) {
458
+ for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
459
+ while ((*f1 == ' ') && (f1 != l1)) ++f1;
460
+ while ((*f2 == ' ') && (f2 != l2)) ++f2;
461
+ if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
462
+ }
463
+ return (int)((l1 - f1) - (l2 - f2));
464
+ }
465
+
466
+ /*
467
+ Check type equivalence in a name list like <name1>|<name2>|...
468
+ Return 0 if not equal, 1 if equal
469
+ */
470
+ SWIGRUNTIME int
471
+ SWIG_TypeEquiv(const char *nb, const char *tb) {
472
+ int equiv = 0;
473
+ const char* te = tb + strlen(tb);
474
+ const char* ne = nb;
475
+ while (!equiv && *ne) {
476
+ for (nb = ne; *ne; ++ne) {
477
+ if (*ne == '|') break;
478
+ }
479
+ equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
480
+ if (*ne) ++ne;
481
+ }
482
+ return equiv;
483
+ }
484
+
485
+ /*
486
+ Check type equivalence in a name list like <name1>|<name2>|...
487
+ Return 0 if equal, -1 if nb < tb, 1 if nb > tb
488
+ */
489
+ SWIGRUNTIME int
490
+ SWIG_TypeCompare(const char *nb, const char *tb) {
491
+ int equiv = 0;
492
+ const char* te = tb + strlen(tb);
493
+ const char* ne = nb;
494
+ while (!equiv && *ne) {
495
+ for (nb = ne; *ne; ++ne) {
496
+ if (*ne == '|') break;
497
+ }
498
+ equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
499
+ if (*ne) ++ne;
500
+ }
501
+ return equiv;
502
+ }
503
+
504
+
505
+ /* think of this as a c++ template<> or a scheme macro */
506
+ #define SWIG_TypeCheck_Template(comparison, ty) \
507
+ if (ty) { \
508
+ swig_cast_info *iter = ty->cast; \
509
+ while (iter) { \
510
+ if (comparison) { \
511
+ if (iter == ty->cast) return iter; \
512
+ /* Move iter to the top of the linked list */ \
513
+ iter->prev->next = iter->next; \
514
+ if (iter->next) \
515
+ iter->next->prev = iter->prev; \
516
+ iter->next = ty->cast; \
517
+ iter->prev = 0; \
518
+ if (ty->cast) ty->cast->prev = iter; \
519
+ ty->cast = iter; \
520
+ return iter; \
521
+ } \
522
+ iter = iter->next; \
523
+ } \
524
+ } \
525
+ return 0
526
+
527
+ /*
528
+ Check the typename
529
+ */
530
+ SWIGRUNTIME swig_cast_info *
531
+ SWIG_TypeCheck(const char *c, swig_type_info *ty) {
532
+ SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
533
+ }
534
+
535
+ /* Same as previous function, except strcmp is replaced with a pointer comparison */
536
+ SWIGRUNTIME swig_cast_info *
537
+ SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
538
+ SWIG_TypeCheck_Template(iter->type == from, into);
539
+ }
540
+
541
+ /*
542
+ Cast a pointer up an inheritance hierarchy
543
+ */
544
+ SWIGRUNTIMEINLINE void *
545
+ SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
546
+ return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
547
+ }
548
+
549
+ /*
550
+ Dynamic pointer casting. Down an inheritance hierarchy
551
+ */
552
+ SWIGRUNTIME swig_type_info *
553
+ SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
554
+ swig_type_info *lastty = ty;
555
+ if (!ty || !ty->dcast) return ty;
556
+ while (ty && (ty->dcast)) {
557
+ ty = (*ty->dcast)(ptr);
558
+ if (ty) lastty = ty;
559
+ }
560
+ return lastty;
561
+ }
562
+
563
+ /*
564
+ Return the name associated with this type
565
+ */
566
+ SWIGRUNTIMEINLINE const char *
567
+ SWIG_TypeName(const swig_type_info *ty) {
568
+ return ty->name;
569
+ }
570
+
571
+ /*
572
+ Return the pretty name associated with this type,
573
+ that is an unmangled type name in a form presentable to the user.
574
+ */
575
+ SWIGRUNTIME const char *
576
+ SWIG_TypePrettyName(const swig_type_info *type) {
577
+ /* The "str" field contains the equivalent pretty names of the
578
+ type, separated by vertical-bar characters. We choose
579
+ to print the last name, as it is often (?) the most
580
+ specific. */
581
+ if (!type) return NULL;
582
+ if (type->str != NULL) {
583
+ const char *last_name = type->str;
584
+ const char *s;
585
+ for (s = type->str; *s; s++)
586
+ if (*s == '|') last_name = s+1;
587
+ return last_name;
588
+ }
589
+ else
590
+ return type->name;
591
+ }
592
+
593
+ /*
594
+ Set the clientdata field for a type
595
+ */
596
+ SWIGRUNTIME void
597
+ SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
598
+ swig_cast_info *cast = ti->cast;
599
+ /* if (ti->clientdata == clientdata) return; */
600
+ ti->clientdata = clientdata;
601
+
602
+ while (cast) {
603
+ if (!cast->converter) {
604
+ swig_type_info *tc = cast->type;
605
+ if (!tc->clientdata) {
606
+ SWIG_TypeClientData(tc, clientdata);
607
+ }
608
+ }
609
+ cast = cast->next;
610
+ }
611
+ }
612
+ SWIGRUNTIME void
613
+ SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
614
+ SWIG_TypeClientData(ti, clientdata);
615
+ ti->owndata = 1;
616
+ }
617
+
618
+ /*
619
+ Search for a swig_type_info structure only by mangled name
620
+ Search is a O(log #types)
621
+
622
+ We start searching at module start, and finish searching when start == end.
623
+ Note: if start == end at the beginning of the function, we go all the way around
624
+ the circular list.
625
+ */
626
+ SWIGRUNTIME swig_type_info *
627
+ SWIG_MangledTypeQueryModule(swig_module_info *start,
628
+ swig_module_info *end,
629
+ const char *name) {
630
+ swig_module_info *iter = start;
631
+ do {
632
+ if (iter->size) {
633
+ register size_t l = 0;
634
+ register size_t r = iter->size - 1;
635
+ do {
636
+ /* since l+r >= 0, we can (>> 1) instead (/ 2) */
637
+ register size_t i = (l + r) >> 1;
638
+ const char *iname = iter->types[i]->name;
639
+ if (iname) {
640
+ register int compare = strcmp(name, iname);
641
+ if (compare == 0) {
642
+ return iter->types[i];
643
+ } else if (compare < 0) {
644
+ if (i) {
645
+ r = i - 1;
646
+ } else {
647
+ break;
648
+ }
649
+ } else if (compare > 0) {
650
+ l = i + 1;
651
+ }
652
+ } else {
653
+ break; /* should never happen */
654
+ }
655
+ } while (l <= r);
656
+ }
657
+ iter = iter->next;
658
+ } while (iter != end);
659
+ return 0;
660
+ }
661
+
662
+ /*
663
+ Search for a swig_type_info structure for either a mangled name or a human readable name.
664
+ It first searches the mangled names of the types, which is a O(log #types)
665
+ If a type is not found it then searches the human readable names, which is O(#types).
666
+
667
+ We start searching at module start, and finish searching when start == end.
668
+ Note: if start == end at the beginning of the function, we go all the way around
669
+ the circular list.
670
+ */
671
+ SWIGRUNTIME swig_type_info *
672
+ SWIG_TypeQueryModule(swig_module_info *start,
673
+ swig_module_info *end,
674
+ const char *name) {
675
+ /* STEP 1: Search the name field using binary search */
676
+ swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
677
+ if (ret) {
678
+ return ret;
679
+ } else {
680
+ /* STEP 2: If the type hasn't been found, do a complete search
681
+ of the str field (the human readable name) */
682
+ swig_module_info *iter = start;
683
+ do {
684
+ register size_t i = 0;
685
+ for (; i < iter->size; ++i) {
686
+ if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
687
+ return iter->types[i];
688
+ }
689
+ iter = iter->next;
690
+ } while (iter != end);
691
+ }
692
+
693
+ /* neither found a match */
694
+ return 0;
695
+ }
696
+
697
+ /*
698
+ Pack binary data into a string
699
+ */
700
+ SWIGRUNTIME char *
701
+ SWIG_PackData(char *c, void *ptr, size_t sz) {
702
+ static const char hex[17] = "0123456789abcdef";
703
+ register const unsigned char *u = (unsigned char *) ptr;
704
+ register const unsigned char *eu = u + sz;
705
+ for (; u != eu; ++u) {
706
+ register unsigned char uu = *u;
707
+ *(c++) = hex[(uu & 0xf0) >> 4];
708
+ *(c++) = hex[uu & 0xf];
709
+ }
710
+ return c;
711
+ }
712
+
713
+ /*
714
+ Unpack binary data from a string
715
+ */
716
+ SWIGRUNTIME const char *
717
+ SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
718
+ register unsigned char *u = (unsigned char *) ptr;
719
+ register const unsigned char *eu = u + sz;
720
+ for (; u != eu; ++u) {
721
+ register char d = *(c++);
722
+ register unsigned char uu;
723
+ if ((d >= '0') && (d <= '9'))
724
+ uu = ((d - '0') << 4);
725
+ else if ((d >= 'a') && (d <= 'f'))
726
+ uu = ((d - ('a'-10)) << 4);
727
+ else
728
+ return (char *) 0;
729
+ d = *(c++);
730
+ if ((d >= '0') && (d <= '9'))
731
+ uu |= (d - '0');
732
+ else if ((d >= 'a') && (d <= 'f'))
733
+ uu |= (d - ('a'-10));
734
+ else
735
+ return (char *) 0;
736
+ *u = uu;
737
+ }
738
+ return c;
739
+ }
740
+
741
+ /*
742
+ Pack 'void *' into a string buffer.
743
+ */
744
+ SWIGRUNTIME char *
745
+ SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
746
+ char *r = buff;
747
+ if ((2*sizeof(void *) + 2) > bsz) return 0;
748
+ *(r++) = '_';
749
+ r = SWIG_PackData(r,&ptr,sizeof(void *));
750
+ if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
751
+ strcpy(r,name);
752
+ return buff;
753
+ }
754
+
755
+ SWIGRUNTIME const char *
756
+ SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
757
+ if (*c != '_') {
758
+ if (strcmp(c,"NULL") == 0) {
759
+ *ptr = (void *) 0;
760
+ return name;
761
+ } else {
762
+ return 0;
763
+ }
764
+ }
765
+ return SWIG_UnpackData(++c,ptr,sizeof(void *));
766
+ }
767
+
768
+ SWIGRUNTIME char *
769
+ SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
770
+ char *r = buff;
771
+ size_t lname = (name ? strlen(name) : 0);
772
+ if ((2*sz + 2 + lname) > bsz) return 0;
773
+ *(r++) = '_';
774
+ r = SWIG_PackData(r,ptr,sz);
775
+ if (lname) {
776
+ strncpy(r,name,lname+1);
777
+ } else {
778
+ *r = 0;
779
+ }
780
+ return buff;
781
+ }
782
+
783
+ SWIGRUNTIME const char *
784
+ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
785
+ if (*c != '_') {
786
+ if (strcmp(c,"NULL") == 0) {
787
+ memset(ptr,0,sz);
788
+ return name;
789
+ } else {
790
+ return 0;
791
+ }
792
+ }
793
+ return SWIG_UnpackData(++c,ptr,sz);
794
+ }
795
+
796
+ #ifdef __cplusplus
797
+ }
798
+ #endif
799
+
800
+ /* Errors in SWIG */
801
+ #define SWIG_UnknownError -1
802
+ #define SWIG_IOError -2
803
+ #define SWIG_RuntimeError -3
804
+ #define SWIG_IndexError -4
805
+ #define SWIG_TypeError -5
806
+ #define SWIG_DivisionByZero -6
807
+ #define SWIG_OverflowError -7
808
+ #define SWIG_SyntaxError -8
809
+ #define SWIG_ValueError -9
810
+ #define SWIG_SystemError -10
811
+ #define SWIG_AttributeError -11
812
+ #define SWIG_MemoryError -12
813
+ #define SWIG_NullReferenceError -13
814
+
815
+
816
+
817
+ #include <ruby.h>
818
+
819
+ /* Remove global macros defined in Ruby's win32.h */
820
+ #ifdef write
821
+ # undef write
822
+ #endif
823
+ #ifdef read
824
+ # undef read
825
+ #endif
826
+
827
+
828
+ /* Ruby 1.7 defines NUM2LL(), LL2NUM() and ULL2NUM() macros */
829
+ #ifndef NUM2LL
830
+ #define NUM2LL(x) NUM2LONG((x))
831
+ #endif
832
+ #ifndef LL2NUM
833
+ #define LL2NUM(x) INT2NUM((long) (x))
834
+ #endif
835
+ #ifndef ULL2NUM
836
+ #define ULL2NUM(x) UINT2NUM((unsigned long) (x))
837
+ #endif
838
+
839
+ /* Ruby 1.7 doesn't (yet) define NUM2ULL() */
840
+ #ifndef NUM2ULL
841
+ #ifdef HAVE_LONG_LONG
842
+ #define NUM2ULL(x) rb_num2ull((x))
843
+ #else
844
+ #define NUM2ULL(x) NUM2ULONG(x)
845
+ #endif
846
+ #endif
847
+
848
+ /* RSTRING_LEN, etc are new in Ruby 1.9, but ->ptr and ->len no longer work */
849
+ /* Define these for older versions so we can just write code the new way */
850
+ #ifndef RSTRING_LEN
851
+ # define RSTRING_LEN(x) RSTRING(x)->len
852
+ #endif
853
+ #ifndef RSTRING_PTR
854
+ # define RSTRING_PTR(x) RSTRING(x)->ptr
855
+ #endif
856
+ #ifndef RSTRING_END
857
+ # define RSTRING_END(x) (RSTRING_PTR(x) + RSTRING_LEN(x))
858
+ #endif
859
+ #ifndef RARRAY_LEN
860
+ # define RARRAY_LEN(x) RARRAY(x)->len
861
+ #endif
862
+ #ifndef RARRAY_PTR
863
+ # define RARRAY_PTR(x) RARRAY(x)->ptr
864
+ #endif
865
+ #ifndef RFLOAT_VALUE
866
+ # define RFLOAT_VALUE(x) RFLOAT(x)->value
867
+ #endif
868
+ #ifndef DOUBLE2NUM
869
+ # define DOUBLE2NUM(x) rb_float_new(x)
870
+ #endif
871
+ #ifndef RHASH_TBL
872
+ # define RHASH_TBL(x) (RHASH(x)->tbl)
873
+ #endif
874
+ #ifndef RHASH_ITER_LEV
875
+ # define RHASH_ITER_LEV(x) (RHASH(x)->iter_lev)
876
+ #endif
877
+ #ifndef RHASH_IFNONE
878
+ # define RHASH_IFNONE(x) (RHASH(x)->ifnone)
879
+ #endif
880
+ #ifndef RHASH_SIZE
881
+ # define RHASH_SIZE(x) (RHASH(x)->tbl->num_entries)
882
+ #endif
883
+ #ifndef RHASH_EMPTY_P
884
+ # define RHASH_EMPTY_P(x) (RHASH_SIZE(x) == 0)
885
+ #endif
886
+ #ifndef RSTRUCT_LEN
887
+ # define RSTRUCT_LEN(x) RSTRUCT(x)->len
888
+ #endif
889
+ #ifndef RSTRUCT_PTR
890
+ # define RSTRUCT_PTR(x) RSTRUCT(x)->ptr
891
+ #endif
892
+
893
+
894
+
895
+ /*
896
+ * Need to be very careful about how these macros are defined, especially
897
+ * when compiling C++ code or C code with an ANSI C compiler.
898
+ *
899
+ * VALUEFUNC(f) is a macro used to typecast a C function that implements
900
+ * a Ruby method so that it can be passed as an argument to API functions
901
+ * like rb_define_method() and rb_define_singleton_method().
902
+ *
903
+ * VOIDFUNC(f) is a macro used to typecast a C function that implements
904
+ * either the "mark" or "free" stuff for a Ruby Data object, so that it
905
+ * can be passed as an argument to API functions like Data_Wrap_Struct()
906
+ * and Data_Make_Struct().
907
+ */
908
+
909
+ #ifdef __cplusplus
910
+ # ifndef RUBY_METHOD_FUNC /* These definitions should work for Ruby 1.4.6 */
911
+ # define PROTECTFUNC(f) ((VALUE (*)()) f)
912
+ # define VALUEFUNC(f) ((VALUE (*)()) f)
913
+ # define VOIDFUNC(f) ((void (*)()) f)
914
+ # else
915
+ # ifndef ANYARGS /* These definitions should work for Ruby 1.6 */
916
+ # define PROTECTFUNC(f) ((VALUE (*)()) f)
917
+ # define VALUEFUNC(f) ((VALUE (*)()) f)
918
+ # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
919
+ # else /* These definitions should work for Ruby 1.7+ */
920
+ # define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f)
921
+ # define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f)
922
+ # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
923
+ # endif
924
+ # endif
925
+ #else
926
+ # define VALUEFUNC(f) (f)
927
+ # define VOIDFUNC(f) (f)
928
+ #endif
929
+
930
+ /* Don't use for expressions have side effect */
931
+ #ifndef RB_STRING_VALUE
932
+ #define RB_STRING_VALUE(s) (TYPE(s) == T_STRING ? (s) : (*(volatile VALUE *)&(s) = rb_str_to_str(s)))
933
+ #endif
934
+ #ifndef StringValue
935
+ #define StringValue(s) RB_STRING_VALUE(s)
936
+ #endif
937
+ #ifndef StringValuePtr
938
+ #define StringValuePtr(s) RSTRING_PTR(RB_STRING_VALUE(s))
939
+ #endif
940
+ #ifndef StringValueLen
941
+ #define StringValueLen(s) RSTRING_LEN(RB_STRING_VALUE(s))
942
+ #endif
943
+ #ifndef SafeStringValue
944
+ #define SafeStringValue(v) do {\
945
+ StringValue(v);\
946
+ rb_check_safe_str(v);\
947
+ } while (0)
948
+ #endif
949
+
950
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
951
+ #define rb_define_alloc_func(klass, func) rb_define_singleton_method((klass), "new", VALUEFUNC((func)), -1)
952
+ #define rb_undef_alloc_func(klass) rb_undef_method(CLASS_OF((klass)), "new")
953
+ #endif
954
+
955
+ static VALUE _mSWIG = Qnil;
956
+
957
+ /* -----------------------------------------------------------------------------
958
+ * error manipulation
959
+ * ----------------------------------------------------------------------------- */
960
+
961
+
962
+ /* Define some additional error types */
963
+ #define SWIG_ObjectPreviouslyDeletedError -100
964
+
965
+
966
+ /* Define custom exceptions for errors that do not map to existing Ruby
967
+ exceptions. Note this only works for C++ since a global cannot be
968
+ initialized by a funtion in C. For C, fallback to rb_eRuntimeError.*/
969
+
970
+ SWIGINTERN VALUE
971
+ getNullReferenceError(void) {
972
+ static int init = 0;
973
+ static VALUE rb_eNullReferenceError ;
974
+ if (!init) {
975
+ init = 1;
976
+ rb_eNullReferenceError = rb_define_class("NullReferenceError", rb_eRuntimeError);
977
+ }
978
+ return rb_eNullReferenceError;
979
+ }
980
+
981
+ SWIGINTERN VALUE
982
+ getObjectPreviouslyDeletedError(void) {
983
+ static int init = 0;
984
+ static VALUE rb_eObjectPreviouslyDeleted ;
985
+ if (!init) {
986
+ init = 1;
987
+ rb_eObjectPreviouslyDeleted = rb_define_class("ObjectPreviouslyDeleted", rb_eRuntimeError);
988
+ }
989
+ return rb_eObjectPreviouslyDeleted;
990
+ }
991
+
992
+
993
+ SWIGINTERN VALUE
994
+ SWIG_Ruby_ErrorType(int SWIG_code) {
995
+ VALUE type;
996
+ switch (SWIG_code) {
997
+ case SWIG_MemoryError:
998
+ type = rb_eNoMemError;
999
+ break;
1000
+ case SWIG_IOError:
1001
+ type = rb_eIOError;
1002
+ break;
1003
+ case SWIG_RuntimeError:
1004
+ type = rb_eRuntimeError;
1005
+ break;
1006
+ case SWIG_IndexError:
1007
+ type = rb_eIndexError;
1008
+ break;
1009
+ case SWIG_TypeError:
1010
+ type = rb_eTypeError;
1011
+ break;
1012
+ case SWIG_DivisionByZero:
1013
+ type = rb_eZeroDivError;
1014
+ break;
1015
+ case SWIG_OverflowError:
1016
+ type = rb_eRangeError;
1017
+ break;
1018
+ case SWIG_SyntaxError:
1019
+ type = rb_eSyntaxError;
1020
+ break;
1021
+ case SWIG_ValueError:
1022
+ type = rb_eArgError;
1023
+ break;
1024
+ case SWIG_SystemError:
1025
+ type = rb_eFatal;
1026
+ break;
1027
+ case SWIG_AttributeError:
1028
+ type = rb_eRuntimeError;
1029
+ break;
1030
+ case SWIG_NullReferenceError:
1031
+ type = getNullReferenceError();
1032
+ break;
1033
+ case SWIG_ObjectPreviouslyDeletedError:
1034
+ type = getObjectPreviouslyDeletedError();
1035
+ break;
1036
+ case SWIG_UnknownError:
1037
+ type = rb_eRuntimeError;
1038
+ break;
1039
+ default:
1040
+ type = rb_eRuntimeError;
1041
+ }
1042
+ return type;
1043
+ }
1044
+
1045
+
1046
+ /* This function is called when a user inputs a wrong argument to
1047
+ a method.
1048
+ */
1049
+ SWIGINTERN
1050
+ const char* Ruby_Format_TypeError( const char* msg,
1051
+ const char* type,
1052
+ const char* name,
1053
+ const int argn,
1054
+ VALUE input )
1055
+ {
1056
+ char buf[128];
1057
+ VALUE str;
1058
+ VALUE asStr;
1059
+ if ( msg && *msg )
1060
+ {
1061
+ str = rb_str_new2(msg);
1062
+ }
1063
+ else
1064
+ {
1065
+ str = rb_str_new(NULL, 0);
1066
+ }
1067
+
1068
+ str = rb_str_cat2( str, "Expected argument " );
1069
+ sprintf( buf, "%d of type ", argn-1 );
1070
+ str = rb_str_cat2( str, buf );
1071
+ str = rb_str_cat2( str, type );
1072
+ str = rb_str_cat2( str, ", but got " );
1073
+ str = rb_str_cat2( str, rb_obj_classname(input) );
1074
+ str = rb_str_cat2( str, " " );
1075
+ asStr = rb_inspect(input);
1076
+ if ( RSTRING_LEN(asStr) > 30 )
1077
+ {
1078
+ str = rb_str_cat( str, StringValuePtr(asStr), 30 );
1079
+ str = rb_str_cat2( str, "..." );
1080
+ }
1081
+ else
1082
+ {
1083
+ str = rb_str_append( str, asStr );
1084
+ }
1085
+
1086
+ if ( name )
1087
+ {
1088
+ str = rb_str_cat2( str, "\n\tin SWIG method '" );
1089
+ str = rb_str_cat2( str, name );
1090
+ str = rb_str_cat2( str, "'" );
1091
+ }
1092
+
1093
+ return StringValuePtr( str );
1094
+ }
1095
+
1096
+ /* This function is called when an overloaded method fails */
1097
+ SWIGINTERN
1098
+ void Ruby_Format_OverloadedError(
1099
+ const int argc,
1100
+ const int maxargs,
1101
+ const char* method,
1102
+ const char* prototypes
1103
+ )
1104
+ {
1105
+ const char* msg = "Wrong # of arguments";
1106
+ if ( argc <= maxargs ) msg = "Wrong arguments";
1107
+ rb_raise(rb_eArgError,"%s for overloaded method '%s'.\n"
1108
+ "Possible C/C++ prototypes are:\n%s",
1109
+ msg, method, prototypes);
1110
+ }
1111
+
1112
+ /* -----------------------------------------------------------------------------
1113
+ * See the LICENSE file for information on copyright, usage and redistribution
1114
+ * of SWIG, and the README file for authors - http://www.swig.org/release.html.
1115
+ *
1116
+ * rubytracking.swg
1117
+ *
1118
+ * This file contains support for tracking mappings from
1119
+ * Ruby objects to C++ objects. This functionality is needed
1120
+ * to implement mark functions for Ruby's mark and sweep
1121
+ * garbage collector.
1122
+ * ----------------------------------------------------------------------------- */
1123
+
1124
+ #ifdef __cplusplus
1125
+ extern "C" {
1126
+ #endif
1127
+
1128
+ /* Ruby 1.8 actually assumes the first case. */
1129
+ #if SIZEOF_VOIDP == SIZEOF_LONG
1130
+ # define SWIG2NUM(v) LONG2NUM((unsigned long)v)
1131
+ # define NUM2SWIG(x) (unsigned long)NUM2LONG(x)
1132
+ #elif SIZEOF_VOIDP == SIZEOF_LONG_LONG
1133
+ # define SWIG2NUM(v) LL2NUM((unsigned long long)v)
1134
+ # define NUM2SWIG(x) (unsigned long long)NUM2LL(x)
1135
+ #else
1136
+ # error sizeof(void*) is not the same as long or long long
1137
+ #endif
1138
+
1139
+
1140
+ /* Global Ruby hash table to store Trackings from C/C++
1141
+ structs to Ruby Objects.
1142
+ */
1143
+ static VALUE swig_ruby_trackings = Qnil;
1144
+
1145
+ /* Global variable that stores a reference to the ruby
1146
+ hash table delete function. */
1147
+ static ID swig_ruby_hash_delete;
1148
+
1149
+ /* Setup a Ruby hash table to store Trackings */
1150
+ SWIGRUNTIME void SWIG_RubyInitializeTrackings(void) {
1151
+ /* Create a ruby hash table to store Trackings from C++
1152
+ objects to Ruby objects. */
1153
+
1154
+ /* Try to see if some other .so has already created a
1155
+ tracking hash table, which we keep hidden in an instance var
1156
+ in the SWIG module.
1157
+ This is done to allow multiple DSOs to share the same
1158
+ tracking table.
1159
+ */
1160
+ ID trackings_id = rb_intern( "@__trackings__" );
1161
+ VALUE verbose = rb_gv_get("VERBOSE");
1162
+ rb_gv_set("VERBOSE", Qfalse);
1163
+ swig_ruby_trackings = rb_ivar_get( _mSWIG, trackings_id );
1164
+ rb_gv_set("VERBOSE", verbose);
1165
+
1166
+ /* No, it hasn't. Create one ourselves */
1167
+ if ( swig_ruby_trackings == Qnil )
1168
+ {
1169
+ swig_ruby_trackings = rb_hash_new();
1170
+ rb_ivar_set( _mSWIG, trackings_id, swig_ruby_trackings );
1171
+ }
1172
+
1173
+ /* Now store a reference to the hash table delete function
1174
+ so that we only have to look it up once.*/
1175
+ swig_ruby_hash_delete = rb_intern("delete");
1176
+ }
1177
+
1178
+ /* Get a Ruby number to reference a pointer */
1179
+ SWIGRUNTIME VALUE SWIG_RubyPtrToReference(void* ptr) {
1180
+ /* We cast the pointer to an unsigned long
1181
+ and then store a reference to it using
1182
+ a Ruby number object. */
1183
+
1184
+ /* Convert the pointer to a Ruby number */
1185
+ return SWIG2NUM(ptr);
1186
+ }
1187
+
1188
+ /* Get a Ruby number to reference an object */
1189
+ SWIGRUNTIME VALUE SWIG_RubyObjectToReference(VALUE object) {
1190
+ /* We cast the object to an unsigned long
1191
+ and then store a reference to it using
1192
+ a Ruby number object. */
1193
+
1194
+ /* Convert the Object to a Ruby number */
1195
+ return SWIG2NUM(object);
1196
+ }
1197
+
1198
+ /* Get a Ruby object from a previously stored reference */
1199
+ SWIGRUNTIME VALUE SWIG_RubyReferenceToObject(VALUE reference) {
1200
+ /* The provided Ruby number object is a reference
1201
+ to the Ruby object we want.*/
1202
+
1203
+ /* Convert the Ruby number to a Ruby object */
1204
+ return NUM2SWIG(reference);
1205
+ }
1206
+
1207
+ /* Add a Tracking from a C/C++ struct to a Ruby object */
1208
+ SWIGRUNTIME void SWIG_RubyAddTracking(void* ptr, VALUE object) {
1209
+ /* In a Ruby hash table we store the pointer and
1210
+ the associated Ruby object. The trick here is
1211
+ that we cannot store the Ruby object directly - if
1212
+ we do then it cannot be garbage collected. So
1213
+ instead we typecast it as a unsigned long and
1214
+ convert it to a Ruby number object.*/
1215
+
1216
+ /* Get a reference to the pointer as a Ruby number */
1217
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1218
+
1219
+ /* Get a reference to the Ruby object as a Ruby number */
1220
+ VALUE value = SWIG_RubyObjectToReference(object);
1221
+
1222
+ /* Store the mapping to the global hash table. */
1223
+ rb_hash_aset(swig_ruby_trackings, key, value);
1224
+ }
1225
+
1226
+ /* Get the Ruby object that owns the specified C/C++ struct */
1227
+ SWIGRUNTIME VALUE SWIG_RubyInstanceFor(void* ptr) {
1228
+ /* Get a reference to the pointer as a Ruby number */
1229
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1230
+
1231
+ /* Now lookup the value stored in the global hash table */
1232
+ VALUE value = rb_hash_aref(swig_ruby_trackings, key);
1233
+
1234
+ if (value == Qnil) {
1235
+ /* No object exists - return nil. */
1236
+ return Qnil;
1237
+ }
1238
+ else {
1239
+ /* Convert this value to Ruby object */
1240
+ return SWIG_RubyReferenceToObject(value);
1241
+ }
1242
+ }
1243
+
1244
+ /* Remove a Tracking from a C/C++ struct to a Ruby object. It
1245
+ is very important to remove objects once they are destroyed
1246
+ since the same memory address may be reused later to create
1247
+ a new object. */
1248
+ SWIGRUNTIME void SWIG_RubyRemoveTracking(void* ptr) {
1249
+ /* Get a reference to the pointer as a Ruby number */
1250
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1251
+
1252
+ /* Delete the object from the hash table by calling Ruby's
1253
+ do this we need to call the Hash.delete method.*/
1254
+ rb_funcall(swig_ruby_trackings, swig_ruby_hash_delete, 1, key);
1255
+ }
1256
+
1257
+ /* This is a helper method that unlinks a Ruby object from its
1258
+ underlying C++ object. This is needed if the lifetime of the
1259
+ Ruby object is longer than the C++ object */
1260
+ SWIGRUNTIME void SWIG_RubyUnlinkObjects(void* ptr) {
1261
+ VALUE object = SWIG_RubyInstanceFor(ptr);
1262
+
1263
+ if (object != Qnil) {
1264
+ DATA_PTR(object) = 0;
1265
+ }
1266
+ }
1267
+
1268
+
1269
+ #ifdef __cplusplus
1270
+ }
1271
+ #endif
1272
+
1273
+ /* -----------------------------------------------------------------------------
1274
+ * Ruby API portion that goes into the runtime
1275
+ * ----------------------------------------------------------------------------- */
1276
+
1277
+ #ifdef __cplusplus
1278
+ extern "C" {
1279
+ #endif
1280
+
1281
+ SWIGINTERN VALUE
1282
+ SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
1283
+ if (NIL_P(target)) {
1284
+ target = o;
1285
+ } else {
1286
+ if (TYPE(target) != T_ARRAY) {
1287
+ VALUE o2 = target;
1288
+ target = rb_ary_new();
1289
+ rb_ary_push(target, o2);
1290
+ }
1291
+ rb_ary_push(target, o);
1292
+ }
1293
+ return target;
1294
+ }
1295
+
1296
+ /* For ruby1.8.4 and earlier. */
1297
+ #ifndef RUBY_INIT_STACK
1298
+ RUBY_EXTERN void Init_stack(VALUE* addr);
1299
+ # define RUBY_INIT_STACK \
1300
+ VALUE variable_in_this_stack_frame; \
1301
+ Init_stack(&variable_in_this_stack_frame);
1302
+ #endif
1303
+
1304
+
1305
+ #ifdef __cplusplus
1306
+ }
1307
+ #endif
1308
+
1309
+
1310
+ /* -----------------------------------------------------------------------------
1311
+ * See the LICENSE file for information on copyright, usage and redistribution
1312
+ * of SWIG, and the README file for authors - http://www.swig.org/release.html.
1313
+ *
1314
+ * rubyrun.swg
1315
+ *
1316
+ * This file contains the runtime support for Ruby modules
1317
+ * and includes code for managing global variables and pointer
1318
+ * type checking.
1319
+ * ----------------------------------------------------------------------------- */
1320
+
1321
+ /* For backward compatibility only */
1322
+ #define SWIG_POINTER_EXCEPTION 0
1323
+
1324
+ /* for raw pointers */
1325
+ #define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
1326
+ #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, own)
1327
+ #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Ruby_NewPointerObj(ptr, type, flags)
1328
+ #define SWIG_AcquirePtr(ptr, own) SWIG_Ruby_AcquirePtr(ptr, own)
1329
+ #define swig_owntype ruby_owntype
1330
+
1331
+ /* for raw packed data */
1332
+ #define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty, flags)
1333
+ #define SWIG_NewPackedObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type)
1334
+
1335
+ /* for class or struct pointers */
1336
+ #define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
1337
+ #define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
1338
+
1339
+ /* for C or C++ function pointers */
1340
+ #define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0)
1341
+ #define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0)
1342
+
1343
+ /* for C++ member pointers, ie, member methods */
1344
+ #define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty)
1345
+ #define SWIG_NewMemberObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type)
1346
+
1347
+
1348
+ /* Runtime API */
1349
+
1350
+ #define SWIG_GetModule(clientdata) SWIG_Ruby_GetModule()
1351
+ #define SWIG_SetModule(clientdata, pointer) SWIG_Ruby_SetModule(pointer)
1352
+
1353
+
1354
+ /* Error manipulation */
1355
+
1356
+ #define SWIG_ErrorType(code) SWIG_Ruby_ErrorType(code)
1357
+ #define SWIG_Error(code, msg) rb_raise(SWIG_Ruby_ErrorType(code), msg)
1358
+ #define SWIG_fail goto fail
1359
+
1360
+
1361
+ /* Ruby-specific SWIG API */
1362
+
1363
+ #define SWIG_InitRuntime() SWIG_Ruby_InitRuntime()
1364
+ #define SWIG_define_class(ty) SWIG_Ruby_define_class(ty)
1365
+ #define SWIG_NewClassInstance(value, ty) SWIG_Ruby_NewClassInstance(value, ty)
1366
+ #define SWIG_MangleStr(value) SWIG_Ruby_MangleStr(value)
1367
+ #define SWIG_CheckConvert(value, ty) SWIG_Ruby_CheckConvert(value, ty)
1368
+
1369
+ #include "assert.h"
1370
+
1371
+ /* -----------------------------------------------------------------------------
1372
+ * pointers/data manipulation
1373
+ * ----------------------------------------------------------------------------- */
1374
+
1375
+ #ifdef __cplusplus
1376
+ extern "C" {
1377
+ #endif
1378
+
1379
+ typedef struct {
1380
+ VALUE klass;
1381
+ VALUE mImpl;
1382
+ void (*mark)(void *);
1383
+ void (*destroy)(void *);
1384
+ int trackObjects;
1385
+ } swig_class;
1386
+
1387
+
1388
+ /* Global pointer used to keep some internal SWIG stuff */
1389
+ static VALUE _cSWIG_Pointer = Qnil;
1390
+ static VALUE swig_runtime_data_type_pointer = Qnil;
1391
+
1392
+ /* Global IDs used to keep some internal SWIG stuff */
1393
+ static ID swig_arity_id = 0;
1394
+ static ID swig_call_id = 0;
1395
+
1396
+ /*
1397
+ If your swig extension is to be run within an embedded ruby and has
1398
+ director callbacks, you should set -DRUBY_EMBEDDED during compilation.
1399
+ This will reset ruby's stack frame on each entry point from the main
1400
+ program the first time a virtual director function is invoked (in a
1401
+ non-recursive way).
1402
+ If this is not done, you run the risk of Ruby trashing the stack.
1403
+ */
1404
+
1405
+ #ifdef RUBY_EMBEDDED
1406
+
1407
+ # define SWIG_INIT_STACK \
1408
+ if ( !swig_virtual_calls ) { RUBY_INIT_STACK } \
1409
+ ++swig_virtual_calls;
1410
+ # define SWIG_RELEASE_STACK --swig_virtual_calls;
1411
+ # define Ruby_DirectorTypeMismatchException(x) \
1412
+ rb_raise( rb_eTypeError, x ); return c_result;
1413
+
1414
+ static unsigned int swig_virtual_calls = 0;
1415
+
1416
+ #else /* normal non-embedded extension */
1417
+
1418
+ # define SWIG_INIT_STACK
1419
+ # define SWIG_RELEASE_STACK
1420
+ # define Ruby_DirectorTypeMismatchException(x) \
1421
+ throw Swig::DirectorTypeMismatchException( x );
1422
+
1423
+ #endif /* RUBY_EMBEDDED */
1424
+
1425
+
1426
+ SWIGRUNTIME VALUE
1427
+ getExceptionClass(void) {
1428
+ static int init = 0;
1429
+ static VALUE rubyExceptionClass ;
1430
+ if (!init) {
1431
+ init = 1;
1432
+ rubyExceptionClass = rb_const_get(_mSWIG, rb_intern("Exception"));
1433
+ }
1434
+ return rubyExceptionClass;
1435
+ }
1436
+
1437
+ /* This code checks to see if the Ruby object being raised as part
1438
+ of an exception inherits from the Ruby class Exception. If so,
1439
+ the object is simply returned. If not, then a new Ruby exception
1440
+ object is created and that will be returned to Ruby.*/
1441
+ SWIGRUNTIME VALUE
1442
+ SWIG_Ruby_ExceptionType(swig_type_info *desc, VALUE obj) {
1443
+ VALUE exceptionClass = getExceptionClass();
1444
+ if (rb_obj_is_kind_of(obj, exceptionClass)) {
1445
+ return obj;
1446
+ } else {
1447
+ return rb_exc_new3(rb_eRuntimeError, rb_obj_as_string(obj));
1448
+ }
1449
+ }
1450
+
1451
+ /* Initialize Ruby runtime support */
1452
+ SWIGRUNTIME void
1453
+ SWIG_Ruby_InitRuntime(void)
1454
+ {
1455
+ if (_mSWIG == Qnil) {
1456
+ _mSWIG = rb_define_module("SWIG");
1457
+ swig_call_id = rb_intern("call");
1458
+ swig_arity_id = rb_intern("arity");
1459
+ }
1460
+ }
1461
+
1462
+ /* Define Ruby class for C type */
1463
+ SWIGRUNTIME void
1464
+ SWIG_Ruby_define_class(swig_type_info *type)
1465
+ {
1466
+ VALUE klass;
1467
+ char *klass_name = (char *) malloc(4 + strlen(type->name) + 1);
1468
+ sprintf(klass_name, "TYPE%s", type->name);
1469
+ if (NIL_P(_cSWIG_Pointer)) {
1470
+ _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);
1471
+ rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new");
1472
+ }
1473
+ klass = rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
1474
+ free((void *) klass_name);
1475
+ }
1476
+
1477
+ /* Create a new pointer object */
1478
+ SWIGRUNTIME VALUE
1479
+ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
1480
+ {
1481
+ int own = flags & SWIG_POINTER_OWN;
1482
+ int track;
1483
+ char *klass_name;
1484
+ swig_class *sklass;
1485
+ VALUE klass;
1486
+ VALUE obj;
1487
+
1488
+ if (!ptr)
1489
+ return Qnil;
1490
+
1491
+ if (type->clientdata) {
1492
+ sklass = (swig_class *) type->clientdata;
1493
+
1494
+ /* Are we tracking this class and have we already returned this Ruby object? */
1495
+ track = sklass->trackObjects;
1496
+ if (track) {
1497
+ obj = SWIG_RubyInstanceFor(ptr);
1498
+
1499
+ /* Check the object's type and make sure it has the correct type.
1500
+ It might not in cases where methods do things like
1501
+ downcast methods. */
1502
+ if (obj != Qnil) {
1503
+ VALUE value = rb_iv_get(obj, "@__swigtype__");
1504
+ char* type_name = RSTRING_PTR(value);
1505
+
1506
+ if (strcmp(type->name, type_name) == 0) {
1507
+ return obj;
1508
+ }
1509
+ }
1510
+ }
1511
+
1512
+ /* Create a new Ruby object */
1513
+ obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark),
1514
+ ( own ? VOIDFUNC(sklass->destroy) :
1515
+ (track ? VOIDFUNC(SWIG_RubyRemoveTracking) : 0 )
1516
+ ), ptr);
1517
+
1518
+ /* If tracking is on for this class then track this object. */
1519
+ if (track) {
1520
+ SWIG_RubyAddTracking(ptr, obj);
1521
+ }
1522
+ } else {
1523
+ klass_name = (char *) malloc(4 + strlen(type->name) + 1);
1524
+ sprintf(klass_name, "TYPE%s", type->name);
1525
+ klass = rb_const_get(_mSWIG, rb_intern(klass_name));
1526
+ free((void *) klass_name);
1527
+ obj = Data_Wrap_Struct(klass, 0, 0, ptr);
1528
+ }
1529
+ rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
1530
+
1531
+ return obj;
1532
+ }
1533
+
1534
+ /* Create a new class instance (always owned) */
1535
+ SWIGRUNTIME VALUE
1536
+ SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type)
1537
+ {
1538
+ VALUE obj;
1539
+ swig_class *sklass = (swig_class *) type->clientdata;
1540
+ obj = Data_Wrap_Struct(klass, VOIDFUNC(sklass->mark), VOIDFUNC(sklass->destroy), 0);
1541
+ rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
1542
+ return obj;
1543
+ }
1544
+
1545
+ /* Get type mangle from class name */
1546
+ SWIGRUNTIMEINLINE char *
1547
+ SWIG_Ruby_MangleStr(VALUE obj)
1548
+ {
1549
+ VALUE stype = rb_iv_get(obj, "@__swigtype__");
1550
+ return StringValuePtr(stype);
1551
+ }
1552
+
1553
+ /* Acquire a pointer value */
1554
+ typedef void (*ruby_owntype)(void*);
1555
+
1556
+ SWIGRUNTIME ruby_owntype
1557
+ SWIG_Ruby_AcquirePtr(VALUE obj, ruby_owntype own) {
1558
+ if (obj) {
1559
+ ruby_owntype oldown = RDATA(obj)->dfree;
1560
+ RDATA(obj)->dfree = own;
1561
+ return oldown;
1562
+ } else {
1563
+ return 0;
1564
+ }
1565
+ }
1566
+
1567
+ /* Convert a pointer value */
1568
+ SWIGRUNTIME int
1569
+ SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags, ruby_owntype *own)
1570
+ {
1571
+ char *c;
1572
+ swig_cast_info *tc;
1573
+ void *vptr = 0;
1574
+
1575
+ /* Grab the pointer */
1576
+ if (NIL_P(obj)) {
1577
+ *ptr = 0;
1578
+ return SWIG_OK;
1579
+ } else {
1580
+ if (TYPE(obj) != T_DATA) {
1581
+ return SWIG_ERROR;
1582
+ }
1583
+ Data_Get_Struct(obj, void, vptr);
1584
+ }
1585
+
1586
+ if (own) *own = RDATA(obj)->dfree;
1587
+
1588
+ /* Check to see if the input object is giving up ownership
1589
+ of the underlying C struct or C++ object. If so then we
1590
+ need to reset the destructor since the Ruby object no
1591
+ longer owns the underlying C++ object.*/
1592
+ if (flags & SWIG_POINTER_DISOWN) {
1593
+ /* Is tracking on for this class? */
1594
+ int track = 0;
1595
+ if (ty && ty->clientdata) {
1596
+ swig_class *sklass = (swig_class *) ty->clientdata;
1597
+ track = sklass->trackObjects;
1598
+ }
1599
+
1600
+ if (track) {
1601
+ /* We are tracking objects for this class. Thus we change the destructor
1602
+ * to SWIG_RubyRemoveTracking. This allows us to
1603
+ * remove the mapping from the C++ to Ruby object
1604
+ * when the Ruby object is garbage collected. If we don't
1605
+ * do this, then it is possible we will return a reference
1606
+ * to a Ruby object that no longer exists thereby crashing Ruby. */
1607
+ RDATA(obj)->dfree = SWIG_RubyRemoveTracking;
1608
+ } else {
1609
+ RDATA(obj)->dfree = 0;
1610
+ }
1611
+ }
1612
+
1613
+ /* Do type-checking if type info was provided */
1614
+ if (ty) {
1615
+ if (ty->clientdata) {
1616
+ if (rb_obj_is_kind_of(obj, ((swig_class *) (ty->clientdata))->klass)) {
1617
+ if (vptr == 0) {
1618
+ /* The object has already been deleted */
1619
+ return SWIG_ObjectPreviouslyDeletedError;
1620
+ }
1621
+ *ptr = vptr;
1622
+ return SWIG_OK;
1623
+ }
1624
+ }
1625
+ if ((c = SWIG_MangleStr(obj)) == NULL) {
1626
+ return SWIG_ERROR;
1627
+ }
1628
+ tc = SWIG_TypeCheck(c, ty);
1629
+ if (!tc) {
1630
+ return SWIG_ERROR;
1631
+ } else {
1632
+ int newmemory = 0;
1633
+ *ptr = SWIG_TypeCast(tc, vptr, &newmemory);
1634
+ assert(!newmemory); /* newmemory handling not yet implemented */
1635
+ }
1636
+ } else {
1637
+ *ptr = vptr;
1638
+ }
1639
+
1640
+ return SWIG_OK;
1641
+ }
1642
+
1643
+ /* Check convert */
1644
+ SWIGRUNTIMEINLINE int
1645
+ SWIG_Ruby_CheckConvert(VALUE obj, swig_type_info *ty)
1646
+ {
1647
+ char *c = SWIG_MangleStr(obj);
1648
+ if (!c) return 0;
1649
+ return SWIG_TypeCheck(c,ty) != 0;
1650
+ }
1651
+
1652
+ SWIGRUNTIME VALUE
1653
+ SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
1654
+ char result[1024];
1655
+ char *r = result;
1656
+ if ((2*sz + 1 + strlen(type->name)) > 1000) return 0;
1657
+ *(r++) = '_';
1658
+ r = SWIG_PackData(r, ptr, sz);
1659
+ strcpy(r, type->name);
1660
+ return rb_str_new2(result);
1661
+ }
1662
+
1663
+ /* Convert a packed value value */
1664
+ SWIGRUNTIME int
1665
+ SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty) {
1666
+ swig_cast_info *tc;
1667
+ const char *c;
1668
+
1669
+ if (TYPE(obj) != T_STRING) goto type_error;
1670
+ c = StringValuePtr(obj);
1671
+ /* Pointer values must start with leading underscore */
1672
+ if (*c != '_') goto type_error;
1673
+ c++;
1674
+ c = SWIG_UnpackData(c, ptr, sz);
1675
+ if (ty) {
1676
+ tc = SWIG_TypeCheck(c, ty);
1677
+ if (!tc) goto type_error;
1678
+ }
1679
+ return SWIG_OK;
1680
+
1681
+ type_error:
1682
+ return SWIG_ERROR;
1683
+ }
1684
+
1685
+ SWIGRUNTIME swig_module_info *
1686
+ SWIG_Ruby_GetModule(void)
1687
+ {
1688
+ VALUE pointer;
1689
+ swig_module_info *ret = 0;
1690
+ VALUE verbose = rb_gv_get("VERBOSE");
1691
+
1692
+ /* temporarily disable warnings, since the pointer check causes warnings with 'ruby -w' */
1693
+ rb_gv_set("VERBOSE", Qfalse);
1694
+
1695
+ /* first check if pointer already created */
1696
+ pointer = rb_gv_get("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
1697
+ if (pointer != Qnil) {
1698
+ Data_Get_Struct(pointer, swig_module_info, ret);
1699
+ }
1700
+
1701
+ /* reinstate warnings */
1702
+ rb_gv_set("VERBOSE", verbose);
1703
+ return ret;
1704
+ }
1705
+
1706
+ SWIGRUNTIME void
1707
+ SWIG_Ruby_SetModule(swig_module_info *pointer)
1708
+ {
1709
+ /* register a new class */
1710
+ VALUE cl = rb_define_class("swig_runtime_data", rb_cObject);
1711
+ /* create and store the structure pointer to a global variable */
1712
+ swig_runtime_data_type_pointer = Data_Wrap_Struct(cl, 0, 0, pointer);
1713
+ rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer);
1714
+ }
1715
+
1716
+ /* This function can be used to check whether a proc or method or similarly
1717
+ callable function has been passed. Usually used in a %typecheck, like:
1718
+
1719
+ %typecheck(c_callback_t, precedence=SWIG_TYPECHECK_POINTER) {
1720
+ $result = SWIG_Ruby_isCallable( $input );
1721
+ }
1722
+ */
1723
+ SWIGINTERN
1724
+ int SWIG_Ruby_isCallable( VALUE proc )
1725
+ {
1726
+ if ( rb_respond_to( proc, swig_call_id ) == Qtrue )
1727
+ return 1;
1728
+ return 0;
1729
+ }
1730
+
1731
+ /* This function can be used to check the arity (number of arguments)
1732
+ a proc or method can take. Usually used in a %typecheck.
1733
+ Valid arities will be that equal to minimal or those < 0
1734
+ which indicate a variable number of parameters at the end.
1735
+ */
1736
+ SWIGINTERN
1737
+ int SWIG_Ruby_arity( VALUE proc, int minimal )
1738
+ {
1739
+ if ( rb_respond_to( proc, swig_arity_id ) == Qtrue )
1740
+ {
1741
+ VALUE num = rb_funcall( proc, swig_arity_id, 0 );
1742
+ int arity = NUM2INT(num);
1743
+ if ( arity < 0 && (arity+1) < -minimal ) return 1;
1744
+ if ( arity == minimal ) return 1;
1745
+ return 1;
1746
+ }
1747
+ return 0;
1748
+ }
1749
+
1750
+
1751
+ #ifdef __cplusplus
1752
+ }
1753
+ #endif
1754
+
1755
+
1756
+
1757
+ #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
1758
+
1759
+ #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
1760
+
1761
+
1762
+
1763
+ /* -------- TYPES TABLE (BEGIN) -------- */
1764
+
1765
+ #define SWIGTYPE_p_char swig_types[0]
1766
+ static swig_type_info *swig_types[2];
1767
+ static swig_module_info swig_module = {swig_types, 1, 0, 0, 0, 0};
1768
+ #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
1769
+ #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
1770
+
1771
+ /* -------- TYPES TABLE (END) -------- */
1772
+
1773
+ #define SWIG_init Init_phonet_api
1774
+ #define SWIG_name "Phonet_api"
1775
+
1776
+ static VALUE mPhonet_api;
1777
+
1778
+ #define SWIG_RUBY_THREAD_BEGIN_BLOCK
1779
+ #define SWIG_RUBY_THREAD_END_BLOCK
1780
+
1781
+
1782
+ #define SWIGVERSION 0x010336
1783
+ #define SWIG_VERSION SWIGVERSION
1784
+
1785
+
1786
+ #define SWIG_as_voidptr(a) (void *)((const void *)(a))
1787
+ #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a))
1788
+
1789
+
1790
+ #include "umlaut_p.h"
1791
+ #include "ph_ext.h"
1792
+ #include "phonet.h"
1793
+
1794
+
1795
+ #include <limits.h>
1796
+ #if !defined(SWIG_NO_LLONG_MAX)
1797
+ # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
1798
+ # define LLONG_MAX __LONG_LONG_MAX__
1799
+ # define LLONG_MIN (-LLONG_MAX - 1LL)
1800
+ # define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
1801
+ # endif
1802
+ #endif
1803
+
1804
+
1805
+ #define SWIG_From_long LONG2NUM
1806
+
1807
+
1808
+ SWIGINTERNINLINE VALUE
1809
+ SWIG_From_int (int value)
1810
+ {
1811
+ return SWIG_From_long (value);
1812
+ }
1813
+
1814
+
1815
+ SWIGINTERN VALUE
1816
+ SWIG_ruby_failed(void)
1817
+ {
1818
+ return Qnil;
1819
+ }
1820
+
1821
+
1822
+ /*@SWIG:/usr/share/swig1.3/ruby/rubyprimtypes.swg,23,%ruby_aux_method@*/
1823
+ SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
1824
+ {
1825
+ VALUE obj = args[0];
1826
+ VALUE type = TYPE(obj);
1827
+ long *res = (long *)(args[1]);
1828
+ *res = type == T_FIXNUM ? NUM2LONG(obj) : rb_big2long(obj);
1829
+ return obj;
1830
+ }
1831
+ /*@SWIG@*/
1832
+
1833
+ SWIGINTERN int
1834
+ SWIG_AsVal_long (VALUE obj, long* val)
1835
+ {
1836
+ VALUE type = TYPE(obj);
1837
+ if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
1838
+ long v;
1839
+ VALUE a[2];
1840
+ a[0] = obj;
1841
+ a[1] = (VALUE)(&v);
1842
+ if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2LONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
1843
+ if (val) *val = v;
1844
+ return SWIG_OK;
1845
+ }
1846
+ }
1847
+ return SWIG_TypeError;
1848
+ }
1849
+
1850
+
1851
+ SWIGINTERN int
1852
+ SWIG_AsVal_int (VALUE obj, int *val)
1853
+ {
1854
+ long v;
1855
+ int res = SWIG_AsVal_long (obj, &v);
1856
+ if (SWIG_IsOK(res)) {
1857
+ if ((v < INT_MIN || v > INT_MAX)) {
1858
+ return SWIG_OverflowError;
1859
+ } else {
1860
+ if (val) *val = (int)(v);
1861
+ }
1862
+ }
1863
+ return res;
1864
+ }
1865
+
1866
+
1867
+ SWIGINTERN swig_type_info*
1868
+ SWIG_pchar_descriptor(void)
1869
+ {
1870
+ static int init = 0;
1871
+ static swig_type_info* info = 0;
1872
+ if (!init) {
1873
+ info = SWIG_TypeQuery("_p_char");
1874
+ init = 1;
1875
+ }
1876
+ return info;
1877
+ }
1878
+
1879
+
1880
+ SWIGINTERN int
1881
+ SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
1882
+ {
1883
+ if (TYPE(obj) == T_STRING) {
1884
+ #if defined(StringValuePtr)
1885
+ char *cstr = StringValuePtr(obj);
1886
+ #else
1887
+ char *cstr = STR2CSTR(obj);
1888
+ #endif
1889
+ size_t size = RSTRING_LEN(obj) + 1;
1890
+ if (cptr) {
1891
+ if (alloc) {
1892
+ if (*alloc == SWIG_NEWOBJ) {
1893
+ *cptr = (char *)memcpy((char *)malloc((size)*sizeof(char)), cstr, sizeof(char)*(size));
1894
+ } else {
1895
+ *cptr = cstr;
1896
+ *alloc = SWIG_OLDOBJ;
1897
+ }
1898
+ }
1899
+ }
1900
+ if (psize) *psize = size;
1901
+ return SWIG_OK;
1902
+ } else {
1903
+ swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
1904
+ if (pchar_descriptor) {
1905
+ void* vptr = 0;
1906
+ if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
1907
+ if (cptr) *cptr = (char *)vptr;
1908
+ if (psize) *psize = vptr ? (strlen((char*)vptr) + 1) : 0;
1909
+ if (alloc) *alloc = SWIG_OLDOBJ;
1910
+ return SWIG_OK;
1911
+ }
1912
+ }
1913
+ }
1914
+ return SWIG_TypeError;
1915
+ }
1916
+
1917
+
1918
+
1919
+
1920
+ SWIGINTERN VALUE
1921
+ _wrap_set_phonet_language(int argc, VALUE *argv, VALUE self) {
1922
+ int arg1 ;
1923
+ int val1 ;
1924
+ int ecode1 = 0 ;
1925
+ int result;
1926
+ VALUE vresult = Qnil;
1927
+
1928
+ if ((argc < 1) || (argc > 1)) {
1929
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
1930
+ }
1931
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
1932
+ if (!SWIG_IsOK(ecode1)) {
1933
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","set_phonet_language", 1, argv[0] ));
1934
+ }
1935
+ arg1 = (int)(val1);
1936
+ result = (int)set_phonet_language(arg1);
1937
+ vresult = SWIG_From_int((int)(result));
1938
+ return vresult;
1939
+ fail:
1940
+ return Qnil;
1941
+ }
1942
+
1943
+
1944
+ SWIGINTERN VALUE
1945
+ _wrap_phonet(int argc, VALUE *argv, VALUE self) {
1946
+ char *arg1 ;
1947
+ char *arg2 ;
1948
+ int arg3 ;
1949
+ int arg4 ;
1950
+ int res1 ;
1951
+ char *buf1 = 0 ;
1952
+ int alloc1 = 0 ;
1953
+ int res2 ;
1954
+ char *buf2 = 0 ;
1955
+ int alloc2 = 0 ;
1956
+ int val3 ;
1957
+ int ecode3 = 0 ;
1958
+ int val4 ;
1959
+ int ecode4 = 0 ;
1960
+ int result;
1961
+ VALUE vresult = Qnil;
1962
+
1963
+ if ((argc < 4) || (argc > 4)) {
1964
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
1965
+ }
1966
+ res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
1967
+ if (!SWIG_IsOK(res1)) {
1968
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char []","phonet", 1, argv[0] ));
1969
+ }
1970
+ arg1 = (char *)(buf1);
1971
+ res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
1972
+ if (!SWIG_IsOK(res2)) {
1973
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char []","phonet", 2, argv[1] ));
1974
+ }
1975
+ arg2 = (char *)(buf2);
1976
+ ecode3 = SWIG_AsVal_int(argv[2], &val3);
1977
+ if (!SWIG_IsOK(ecode3)) {
1978
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","phonet", 3, argv[2] ));
1979
+ }
1980
+ arg3 = (int)(val3);
1981
+ ecode4 = SWIG_AsVal_int(argv[3], &val4);
1982
+ if (!SWIG_IsOK(ecode4)) {
1983
+ SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","phonet", 4, argv[3] ));
1984
+ }
1985
+ arg4 = (int)(val4);
1986
+ result = (int)phonet(arg1,arg2,arg3,arg4);
1987
+ vresult = SWIG_From_int((int)(result));
1988
+ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
1989
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
1990
+ return vresult;
1991
+ fail:
1992
+ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
1993
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
1994
+ return Qnil;
1995
+ }
1996
+
1997
+
1998
+ SWIGINTERN VALUE
1999
+ _wrap_initialize_phonet(int argc, VALUE *argv, VALUE self) {
2000
+ int result;
2001
+ VALUE vresult = Qnil;
2002
+
2003
+ if ((argc < 0) || (argc > 0)) {
2004
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2005
+ }
2006
+ result = (int)initialize_phonet();
2007
+ vresult = SWIG_From_int((int)(result));
2008
+ return vresult;
2009
+ fail:
2010
+ return Qnil;
2011
+ }
2012
+
2013
+
2014
+
2015
+ /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
2016
+
2017
+ static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
2018
+
2019
+ static swig_type_info *swig_type_initial[] = {
2020
+ &_swigt__p_char,
2021
+ };
2022
+
2023
+ static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
2024
+
2025
+ static swig_cast_info *swig_cast_initial[] = {
2026
+ _swigc__p_char,
2027
+ };
2028
+
2029
+
2030
+ /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
2031
+
2032
+ /* -----------------------------------------------------------------------------
2033
+ * Type initialization:
2034
+ * This problem is tough by the requirement that no dynamic
2035
+ * memory is used. Also, since swig_type_info structures store pointers to
2036
+ * swig_cast_info structures and swig_cast_info structures store pointers back
2037
+ * to swig_type_info structures, we need some lookup code at initialization.
2038
+ * The idea is that swig generates all the structures that are needed.
2039
+ * The runtime then collects these partially filled structures.
2040
+ * The SWIG_InitializeModule function takes these initial arrays out of
2041
+ * swig_module, and does all the lookup, filling in the swig_module.types
2042
+ * array with the correct data and linking the correct swig_cast_info
2043
+ * structures together.
2044
+ *
2045
+ * The generated swig_type_info structures are assigned staticly to an initial
2046
+ * array. We just loop through that array, and handle each type individually.
2047
+ * First we lookup if this type has been already loaded, and if so, use the
2048
+ * loaded structure instead of the generated one. Then we have to fill in the
2049
+ * cast linked list. The cast data is initially stored in something like a
2050
+ * two-dimensional array. Each row corresponds to a type (there are the same
2051
+ * number of rows as there are in the swig_type_initial array). Each entry in
2052
+ * a column is one of the swig_cast_info structures for that type.
2053
+ * The cast_initial array is actually an array of arrays, because each row has
2054
+ * a variable number of columns. So to actually build the cast linked list,
2055
+ * we find the array of casts associated with the type, and loop through it
2056
+ * adding the casts to the list. The one last trick we need to do is making
2057
+ * sure the type pointer in the swig_cast_info struct is correct.
2058
+ *
2059
+ * First off, we lookup the cast->type name to see if it is already loaded.
2060
+ * There are three cases to handle:
2061
+ * 1) If the cast->type has already been loaded AND the type we are adding
2062
+ * casting info to has not been loaded (it is in this module), THEN we
2063
+ * replace the cast->type pointer with the type pointer that has already
2064
+ * been loaded.
2065
+ * 2) If BOTH types (the one we are adding casting info to, and the
2066
+ * cast->type) are loaded, THEN the cast info has already been loaded by
2067
+ * the previous module so we just ignore it.
2068
+ * 3) Finally, if cast->type has not already been loaded, then we add that
2069
+ * swig_cast_info to the linked list (because the cast->type) pointer will
2070
+ * be correct.
2071
+ * ----------------------------------------------------------------------------- */
2072
+
2073
+ #ifdef __cplusplus
2074
+ extern "C" {
2075
+ #if 0
2076
+ } /* c-mode */
2077
+ #endif
2078
+ #endif
2079
+
2080
+ #if 0
2081
+ #define SWIGRUNTIME_DEBUG
2082
+ #endif
2083
+
2084
+
2085
+ SWIGRUNTIME void
2086
+ SWIG_InitializeModule(void *clientdata) {
2087
+ size_t i;
2088
+ swig_module_info *module_head, *iter;
2089
+ int found, init;
2090
+
2091
+ clientdata = clientdata;
2092
+
2093
+ /* check to see if the circular list has been setup, if not, set it up */
2094
+ if (swig_module.next==0) {
2095
+ /* Initialize the swig_module */
2096
+ swig_module.type_initial = swig_type_initial;
2097
+ swig_module.cast_initial = swig_cast_initial;
2098
+ swig_module.next = &swig_module;
2099
+ init = 1;
2100
+ } else {
2101
+ init = 0;
2102
+ }
2103
+
2104
+ /* Try and load any already created modules */
2105
+ module_head = SWIG_GetModule(clientdata);
2106
+ if (!module_head) {
2107
+ /* This is the first module loaded for this interpreter */
2108
+ /* so set the swig module into the interpreter */
2109
+ SWIG_SetModule(clientdata, &swig_module);
2110
+ module_head = &swig_module;
2111
+ } else {
2112
+ /* the interpreter has loaded a SWIG module, but has it loaded this one? */
2113
+ found=0;
2114
+ iter=module_head;
2115
+ do {
2116
+ if (iter==&swig_module) {
2117
+ found=1;
2118
+ break;
2119
+ }
2120
+ iter=iter->next;
2121
+ } while (iter!= module_head);
2122
+
2123
+ /* if the is found in the list, then all is done and we may leave */
2124
+ if (found) return;
2125
+ /* otherwise we must add out module into the list */
2126
+ swig_module.next = module_head->next;
2127
+ module_head->next = &swig_module;
2128
+ }
2129
+
2130
+ /* When multiple interpeters are used, a module could have already been initialized in
2131
+ a different interpreter, but not yet have a pointer in this interpreter.
2132
+ In this case, we do not want to continue adding types... everything should be
2133
+ set up already */
2134
+ if (init == 0) return;
2135
+
2136
+ /* Now work on filling in swig_module.types */
2137
+ #ifdef SWIGRUNTIME_DEBUG
2138
+ printf("SWIG_InitializeModule: size %d\n", swig_module.size);
2139
+ #endif
2140
+ for (i = 0; i < swig_module.size; ++i) {
2141
+ swig_type_info *type = 0;
2142
+ swig_type_info *ret;
2143
+ swig_cast_info *cast;
2144
+
2145
+ #ifdef SWIGRUNTIME_DEBUG
2146
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
2147
+ #endif
2148
+
2149
+ /* if there is another module already loaded */
2150
+ if (swig_module.next != &swig_module) {
2151
+ type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
2152
+ }
2153
+ if (type) {
2154
+ /* Overwrite clientdata field */
2155
+ #ifdef SWIGRUNTIME_DEBUG
2156
+ printf("SWIG_InitializeModule: found type %s\n", type->name);
2157
+ #endif
2158
+ if (swig_module.type_initial[i]->clientdata) {
2159
+ type->clientdata = swig_module.type_initial[i]->clientdata;
2160
+ #ifdef SWIGRUNTIME_DEBUG
2161
+ printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
2162
+ #endif
2163
+ }
2164
+ } else {
2165
+ type = swig_module.type_initial[i];
2166
+ }
2167
+
2168
+ /* Insert casting types */
2169
+ cast = swig_module.cast_initial[i];
2170
+ while (cast->type) {
2171
+
2172
+ /* Don't need to add information already in the list */
2173
+ ret = 0;
2174
+ #ifdef SWIGRUNTIME_DEBUG
2175
+ printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
2176
+ #endif
2177
+ if (swig_module.next != &swig_module) {
2178
+ ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
2179
+ #ifdef SWIGRUNTIME_DEBUG
2180
+ if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
2181
+ #endif
2182
+ }
2183
+ if (ret) {
2184
+ if (type == swig_module.type_initial[i]) {
2185
+ #ifdef SWIGRUNTIME_DEBUG
2186
+ printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
2187
+ #endif
2188
+ cast->type = ret;
2189
+ ret = 0;
2190
+ } else {
2191
+ /* Check for casting already in the list */
2192
+ swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
2193
+ #ifdef SWIGRUNTIME_DEBUG
2194
+ if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
2195
+ #endif
2196
+ if (!ocast) ret = 0;
2197
+ }
2198
+ }
2199
+
2200
+ if (!ret) {
2201
+ #ifdef SWIGRUNTIME_DEBUG
2202
+ printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
2203
+ #endif
2204
+ if (type->cast) {
2205
+ type->cast->prev = cast;
2206
+ cast->next = type->cast;
2207
+ }
2208
+ type->cast = cast;
2209
+ }
2210
+ cast++;
2211
+ }
2212
+ /* Set entry in modules->types array equal to the type */
2213
+ swig_module.types[i] = type;
2214
+ }
2215
+ swig_module.types[i] = 0;
2216
+
2217
+ #ifdef SWIGRUNTIME_DEBUG
2218
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
2219
+ for (i = 0; i < swig_module.size; ++i) {
2220
+ int j = 0;
2221
+ swig_cast_info *cast = swig_module.cast_initial[i];
2222
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
2223
+ while (cast->type) {
2224
+ printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
2225
+ cast++;
2226
+ ++j;
2227
+ }
2228
+ printf("---- Total casts: %d\n",j);
2229
+ }
2230
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
2231
+ #endif
2232
+ }
2233
+
2234
+ /* This function will propagate the clientdata field of type to
2235
+ * any new swig_type_info structures that have been added into the list
2236
+ * of equivalent types. It is like calling
2237
+ * SWIG_TypeClientData(type, clientdata) a second time.
2238
+ */
2239
+ SWIGRUNTIME void
2240
+ SWIG_PropagateClientData(void) {
2241
+ size_t i;
2242
+ swig_cast_info *equiv;
2243
+ static int init_run = 0;
2244
+
2245
+ if (init_run) return;
2246
+ init_run = 1;
2247
+
2248
+ for (i = 0; i < swig_module.size; i++) {
2249
+ if (swig_module.types[i]->clientdata) {
2250
+ equiv = swig_module.types[i]->cast;
2251
+ while (equiv) {
2252
+ if (!equiv->converter) {
2253
+ if (equiv->type && !equiv->type->clientdata)
2254
+ SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
2255
+ }
2256
+ equiv = equiv->next;
2257
+ }
2258
+ }
2259
+ }
2260
+ }
2261
+
2262
+ #ifdef __cplusplus
2263
+ #if 0
2264
+ { /* c-mode */
2265
+ #endif
2266
+ }
2267
+ #endif
2268
+
2269
+ /*
2270
+
2271
+ */
2272
+ #ifdef __cplusplus
2273
+ extern "C"
2274
+ #endif
2275
+ SWIGEXPORT void Init_phonet_api(void) {
2276
+ size_t i;
2277
+
2278
+ SWIG_InitRuntime();
2279
+ mPhonet_api = rb_define_module("Phonet_api");
2280
+
2281
+ SWIG_InitializeModule(0);
2282
+ for (i = 0; i < swig_module.size; i++) {
2283
+ SWIG_define_class(swig_module.types[i]);
2284
+ }
2285
+
2286
+ SWIG_RubyInitializeTrackings();
2287
+ rb_define_const(mPhonet_api, "PHONET_FIRST_RULES", SWIG_From_int((int)(0)));
2288
+ rb_define_const(mPhonet_api, "PHONET_SECOND_RULES", SWIG_From_int((int)(1024)));
2289
+ rb_define_const(mPhonet_api, "PHONET_NO_LANGUAGE", SWIG_From_int((int)(1)));
2290
+ rb_define_const(mPhonet_api, "PHONET_GERMAN", SWIG_From_int((int)(2)));
2291
+ rb_define_const(mPhonet_api, "PHONET_DEFAULT_LANGUAGE", SWIG_From_int((int)(2)));
2292
+ rb_define_module_function(mPhonet_api, "set_phonet_language", _wrap_set_phonet_language, -1);
2293
+ rb_define_module_function(mPhonet_api, "phonet", _wrap_phonet, -1);
2294
+ rb_define_module_function(mPhonet_api, "initialize_phonet", _wrap_initialize_phonet, -1);
2295
+ }
2296
+