relax4 1.0.0

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