rqrencoder 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,3677 @@
1
+ /* ----------------------------------------------------------------------------
2
+ * This file was automatically generated by SWIG (http://www.swig.org).
3
+ * Version 2.0.1
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
+
14
+ #ifdef __cplusplus
15
+ /* SwigValueWrapper is described in swig.swg */
16
+ template<typename T> class SwigValueWrapper {
17
+ struct SwigMovePointer {
18
+ T *ptr;
19
+ SwigMovePointer(T *p) : ptr(p) { }
20
+ ~SwigMovePointer() { delete ptr; }
21
+ SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
22
+ } pointer;
23
+ SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
24
+ SwigValueWrapper(const SwigValueWrapper<T>& rhs);
25
+ public:
26
+ SwigValueWrapper() : pointer(0) { }
27
+ SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
28
+ operator T&() const { return *pointer.ptr; }
29
+ T *operator&() { return pointer.ptr; }
30
+ };
31
+
32
+ template <typename T> T SwigValueInit() {
33
+ return T();
34
+ }
35
+ #endif
36
+
37
+ /* -----------------------------------------------------------------------------
38
+ * This section contains generic SWIG labels for method/variable
39
+ * declarations/attributes, and other compiler dependent labels.
40
+ * ----------------------------------------------------------------------------- */
41
+
42
+ /* template workaround for compilers that cannot correctly implement the C++ standard */
43
+ #ifndef SWIGTEMPLATEDISAMBIGUATOR
44
+ # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
45
+ # define SWIGTEMPLATEDISAMBIGUATOR template
46
+ # elif defined(__HP_aCC)
47
+ /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
48
+ /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
49
+ # define SWIGTEMPLATEDISAMBIGUATOR template
50
+ # else
51
+ # define SWIGTEMPLATEDISAMBIGUATOR
52
+ # endif
53
+ #endif
54
+
55
+ /* inline attribute */
56
+ #ifndef SWIGINLINE
57
+ # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
58
+ # define SWIGINLINE inline
59
+ # else
60
+ # define SWIGINLINE
61
+ # endif
62
+ #endif
63
+
64
+ /* attribute recognised by some compilers to avoid 'unused' warnings */
65
+ #ifndef SWIGUNUSED
66
+ # if defined(__GNUC__)
67
+ # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
68
+ # define SWIGUNUSED __attribute__ ((__unused__))
69
+ # else
70
+ # define SWIGUNUSED
71
+ # endif
72
+ # elif defined(__ICC)
73
+ # define SWIGUNUSED __attribute__ ((__unused__))
74
+ # else
75
+ # define SWIGUNUSED
76
+ # endif
77
+ #endif
78
+
79
+ #ifndef SWIG_MSC_UNSUPPRESS_4505
80
+ # if defined(_MSC_VER)
81
+ # pragma warning(disable : 4505) /* unreferenced local function has been removed */
82
+ # endif
83
+ #endif
84
+
85
+ #ifndef SWIGUNUSEDPARM
86
+ # ifdef __cplusplus
87
+ # define SWIGUNUSEDPARM(p)
88
+ # else
89
+ # define SWIGUNUSEDPARM(p) p SWIGUNUSED
90
+ # endif
91
+ #endif
92
+
93
+ /* internal SWIG method */
94
+ #ifndef SWIGINTERN
95
+ # define SWIGINTERN static SWIGUNUSED
96
+ #endif
97
+
98
+ /* internal inline SWIG method */
99
+ #ifndef SWIGINTERNINLINE
100
+ # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
101
+ #endif
102
+
103
+ /* exporting methods */
104
+ #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
105
+ # ifndef GCC_HASCLASSVISIBILITY
106
+ # define GCC_HASCLASSVISIBILITY
107
+ # endif
108
+ #endif
109
+
110
+ #ifndef SWIGEXPORT
111
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
112
+ # if defined(STATIC_LINKED)
113
+ # define SWIGEXPORT
114
+ # else
115
+ # define SWIGEXPORT __declspec(dllexport)
116
+ # endif
117
+ # else
118
+ # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
119
+ # define SWIGEXPORT __attribute__ ((visibility("default")))
120
+ # else
121
+ # define SWIGEXPORT
122
+ # endif
123
+ # endif
124
+ #endif
125
+
126
+ /* calling conventions for Windows */
127
+ #ifndef SWIGSTDCALL
128
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
129
+ # define SWIGSTDCALL __stdcall
130
+ # else
131
+ # define SWIGSTDCALL
132
+ # endif
133
+ #endif
134
+
135
+ /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
136
+ #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
137
+ # define _CRT_SECURE_NO_DEPRECATE
138
+ #endif
139
+
140
+ /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
141
+ #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
142
+ # define _SCL_SECURE_NO_DEPRECATE
143
+ #endif
144
+
145
+
146
+ /* -----------------------------------------------------------------------------
147
+ * This section contains generic SWIG labels for method/variable
148
+ * declarations/attributes, and other compiler dependent labels.
149
+ * ----------------------------------------------------------------------------- */
150
+
151
+ /* template workaround for compilers that cannot correctly implement the C++ standard */
152
+ #ifndef SWIGTEMPLATEDISAMBIGUATOR
153
+ # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
154
+ # define SWIGTEMPLATEDISAMBIGUATOR template
155
+ # elif defined(__HP_aCC)
156
+ /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
157
+ /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
158
+ # define SWIGTEMPLATEDISAMBIGUATOR template
159
+ # else
160
+ # define SWIGTEMPLATEDISAMBIGUATOR
161
+ # endif
162
+ #endif
163
+
164
+ /* inline attribute */
165
+ #ifndef SWIGINLINE
166
+ # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
167
+ # define SWIGINLINE inline
168
+ # else
169
+ # define SWIGINLINE
170
+ # endif
171
+ #endif
172
+
173
+ /* attribute recognised by some compilers to avoid 'unused' warnings */
174
+ #ifndef SWIGUNUSED
175
+ # if defined(__GNUC__)
176
+ # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
177
+ # define SWIGUNUSED __attribute__ ((__unused__))
178
+ # else
179
+ # define SWIGUNUSED
180
+ # endif
181
+ # elif defined(__ICC)
182
+ # define SWIGUNUSED __attribute__ ((__unused__))
183
+ # else
184
+ # define SWIGUNUSED
185
+ # endif
186
+ #endif
187
+
188
+ #ifndef SWIG_MSC_UNSUPPRESS_4505
189
+ # if defined(_MSC_VER)
190
+ # pragma warning(disable : 4505) /* unreferenced local function has been removed */
191
+ # endif
192
+ #endif
193
+
194
+ #ifndef SWIGUNUSEDPARM
195
+ # ifdef __cplusplus
196
+ # define SWIGUNUSEDPARM(p)
197
+ # else
198
+ # define SWIGUNUSEDPARM(p) p SWIGUNUSED
199
+ # endif
200
+ #endif
201
+
202
+ /* internal SWIG method */
203
+ #ifndef SWIGINTERN
204
+ # define SWIGINTERN static SWIGUNUSED
205
+ #endif
206
+
207
+ /* internal inline SWIG method */
208
+ #ifndef SWIGINTERNINLINE
209
+ # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
210
+ #endif
211
+
212
+ /* exporting methods */
213
+ #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
214
+ # ifndef GCC_HASCLASSVISIBILITY
215
+ # define GCC_HASCLASSVISIBILITY
216
+ # endif
217
+ #endif
218
+
219
+ #ifndef SWIGEXPORT
220
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
221
+ # if defined(STATIC_LINKED)
222
+ # define SWIGEXPORT
223
+ # else
224
+ # define SWIGEXPORT __declspec(dllexport)
225
+ # endif
226
+ # else
227
+ # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
228
+ # define SWIGEXPORT __attribute__ ((visibility("default")))
229
+ # else
230
+ # define SWIGEXPORT
231
+ # endif
232
+ # endif
233
+ #endif
234
+
235
+ /* calling conventions for Windows */
236
+ #ifndef SWIGSTDCALL
237
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
238
+ # define SWIGSTDCALL __stdcall
239
+ # else
240
+ # define SWIGSTDCALL
241
+ # endif
242
+ #endif
243
+
244
+ /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
245
+ #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
246
+ # define _CRT_SECURE_NO_DEPRECATE
247
+ #endif
248
+
249
+ /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
250
+ #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
251
+ # define _SCL_SECURE_NO_DEPRECATE
252
+ #endif
253
+
254
+
255
+ /* -----------------------------------------------------------------------------
256
+ * swigrun.swg
257
+ *
258
+ * This file contains generic C API SWIG runtime support for pointer
259
+ * type checking.
260
+ * ----------------------------------------------------------------------------- */
261
+
262
+ /* This should only be incremented when either the layout of swig_type_info changes,
263
+ or for whatever reason, the runtime changes incompatibly */
264
+ #define SWIG_RUNTIME_VERSION "4"
265
+
266
+ /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
267
+ #ifdef SWIG_TYPE_TABLE
268
+ # define SWIG_QUOTE_STRING(x) #x
269
+ # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
270
+ # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
271
+ #else
272
+ # define SWIG_TYPE_TABLE_NAME
273
+ #endif
274
+
275
+ /*
276
+ You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
277
+ creating a static or dynamic library from the SWIG runtime code.
278
+ In 99.9% of the cases, SWIG just needs to declare them as 'static'.
279
+
280
+ But only do this if strictly necessary, ie, if you have problems
281
+ with your compiler or suchlike.
282
+ */
283
+
284
+ #ifndef SWIGRUNTIME
285
+ # define SWIGRUNTIME SWIGINTERN
286
+ #endif
287
+
288
+ #ifndef SWIGRUNTIMEINLINE
289
+ # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
290
+ #endif
291
+
292
+ /* Generic buffer size */
293
+ #ifndef SWIG_BUFFER_SIZE
294
+ # define SWIG_BUFFER_SIZE 1024
295
+ #endif
296
+
297
+ /* Flags for pointer conversions */
298
+ #define SWIG_POINTER_DISOWN 0x1
299
+ #define SWIG_CAST_NEW_MEMORY 0x2
300
+
301
+ /* Flags for new pointer objects */
302
+ #define SWIG_POINTER_OWN 0x1
303
+
304
+
305
+ /*
306
+ Flags/methods for returning states.
307
+
308
+ The SWIG conversion methods, as ConvertPtr, return an integer
309
+ that tells if the conversion was successful or not. And if not,
310
+ an error code can be returned (see swigerrors.swg for the codes).
311
+
312
+ Use the following macros/flags to set or process the returning
313
+ states.
314
+
315
+ In old versions of SWIG, code such as the following was usually written:
316
+
317
+ if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
318
+ // success code
319
+ } else {
320
+ //fail code
321
+ }
322
+
323
+ Now you can be more explicit:
324
+
325
+ int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
326
+ if (SWIG_IsOK(res)) {
327
+ // success code
328
+ } else {
329
+ // fail code
330
+ }
331
+
332
+ which is the same really, but now you can also do
333
+
334
+ Type *ptr;
335
+ int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
336
+ if (SWIG_IsOK(res)) {
337
+ // success code
338
+ if (SWIG_IsNewObj(res) {
339
+ ...
340
+ delete *ptr;
341
+ } else {
342
+ ...
343
+ }
344
+ } else {
345
+ // fail code
346
+ }
347
+
348
+ I.e., now SWIG_ConvertPtr can return new objects and you can
349
+ identify the case and take care of the deallocation. Of course that
350
+ also requires SWIG_ConvertPtr to return new result values, such as
351
+
352
+ int SWIG_ConvertPtr(obj, ptr,...) {
353
+ if (<obj is ok>) {
354
+ if (<need new object>) {
355
+ *ptr = <ptr to new allocated object>;
356
+ return SWIG_NEWOBJ;
357
+ } else {
358
+ *ptr = <ptr to old object>;
359
+ return SWIG_OLDOBJ;
360
+ }
361
+ } else {
362
+ return SWIG_BADOBJ;
363
+ }
364
+ }
365
+
366
+ Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
367
+ more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
368
+ SWIG errors code.
369
+
370
+ Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
371
+ allows to return the 'cast rank', for example, if you have this
372
+
373
+ int food(double)
374
+ int fooi(int);
375
+
376
+ and you call
377
+
378
+ food(1) // cast rank '1' (1 -> 1.0)
379
+ fooi(1) // cast rank '0'
380
+
381
+ just use the SWIG_AddCast()/SWIG_CheckState()
382
+ */
383
+
384
+ #define SWIG_OK (0)
385
+ #define SWIG_ERROR (-1)
386
+ #define SWIG_IsOK(r) (r >= 0)
387
+ #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
388
+
389
+ /* The CastRankLimit says how many bits are used for the cast rank */
390
+ #define SWIG_CASTRANKLIMIT (1 << 8)
391
+ /* The NewMask denotes the object was created (using new/malloc) */
392
+ #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
393
+ /* The TmpMask is for in/out typemaps that use temporal objects */
394
+ #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
395
+ /* Simple returning values */
396
+ #define SWIG_BADOBJ (SWIG_ERROR)
397
+ #define SWIG_OLDOBJ (SWIG_OK)
398
+ #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
399
+ #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
400
+ /* Check, add and del mask methods */
401
+ #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
402
+ #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
403
+ #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
404
+ #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
405
+ #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
406
+ #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
407
+
408
+ /* Cast-Rank Mode */
409
+ #if defined(SWIG_CASTRANK_MODE)
410
+ # ifndef SWIG_TypeRank
411
+ # define SWIG_TypeRank unsigned long
412
+ # endif
413
+ # ifndef SWIG_MAXCASTRANK /* Default cast allowed */
414
+ # define SWIG_MAXCASTRANK (2)
415
+ # endif
416
+ # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
417
+ # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
418
+ SWIGINTERNINLINE int SWIG_AddCast(int r) {
419
+ return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
420
+ }
421
+ SWIGINTERNINLINE int SWIG_CheckState(int r) {
422
+ return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
423
+ }
424
+ #else /* no cast-rank mode */
425
+ # define SWIG_AddCast
426
+ # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
427
+ #endif
428
+
429
+
430
+ #include <string.h>
431
+
432
+ #ifdef __cplusplus
433
+ extern "C" {
434
+ #endif
435
+
436
+ typedef void *(*swig_converter_func)(void *, int *);
437
+ typedef struct swig_type_info *(*swig_dycast_func)(void **);
438
+
439
+ /* Structure to store information on one type */
440
+ typedef struct swig_type_info {
441
+ const char *name; /* mangled name of this type */
442
+ const char *str; /* human readable name of this type */
443
+ swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
444
+ struct swig_cast_info *cast; /* linked list of types that can cast into this type */
445
+ void *clientdata; /* language specific type data */
446
+ int owndata; /* flag if the structure owns the clientdata */
447
+ } swig_type_info;
448
+
449
+ /* Structure to store a type and conversion function used for casting */
450
+ typedef struct swig_cast_info {
451
+ swig_type_info *type; /* pointer to type that is equivalent to this type */
452
+ swig_converter_func converter; /* function to cast the void pointers */
453
+ struct swig_cast_info *next; /* pointer to next cast in linked list */
454
+ struct swig_cast_info *prev; /* pointer to the previous cast */
455
+ } swig_cast_info;
456
+
457
+ /* Structure used to store module information
458
+ * Each module generates one structure like this, and the runtime collects
459
+ * all of these structures and stores them in a circularly linked list.*/
460
+ typedef struct swig_module_info {
461
+ swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
462
+ size_t size; /* Number of types in this module */
463
+ struct swig_module_info *next; /* Pointer to next element in circularly linked list */
464
+ swig_type_info **type_initial; /* Array of initially generated type structures */
465
+ swig_cast_info **cast_initial; /* Array of initially generated casting structures */
466
+ void *clientdata; /* Language specific module data */
467
+ } swig_module_info;
468
+
469
+ /*
470
+ Compare two type names skipping the space characters, therefore
471
+ "char*" == "char *" and "Class<int>" == "Class<int >", etc.
472
+
473
+ Return 0 when the two name types are equivalent, as in
474
+ strncmp, but skipping ' '.
475
+ */
476
+ SWIGRUNTIME int
477
+ SWIG_TypeNameComp(const char *f1, const char *l1,
478
+ const char *f2, const char *l2) {
479
+ for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
480
+ while ((*f1 == ' ') && (f1 != l1)) ++f1;
481
+ while ((*f2 == ' ') && (f2 != l2)) ++f2;
482
+ if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
483
+ }
484
+ return (int)((l1 - f1) - (l2 - f2));
485
+ }
486
+
487
+ /*
488
+ Check type equivalence in a name list like <name1>|<name2>|...
489
+ Return 0 if not equal, 1 if equal
490
+ */
491
+ SWIGRUNTIME int
492
+ SWIG_TypeEquiv(const char *nb, const char *tb) {
493
+ int equiv = 0;
494
+ const char* te = tb + strlen(tb);
495
+ const char* ne = nb;
496
+ while (!equiv && *ne) {
497
+ for (nb = ne; *ne; ++ne) {
498
+ if (*ne == '|') break;
499
+ }
500
+ equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
501
+ if (*ne) ++ne;
502
+ }
503
+ return equiv;
504
+ }
505
+
506
+ /*
507
+ Check type equivalence in a name list like <name1>|<name2>|...
508
+ Return 0 if equal, -1 if nb < tb, 1 if nb > tb
509
+ */
510
+ SWIGRUNTIME int
511
+ SWIG_TypeCompare(const char *nb, const char *tb) {
512
+ int equiv = 0;
513
+ const char* te = tb + strlen(tb);
514
+ const char* ne = nb;
515
+ while (!equiv && *ne) {
516
+ for (nb = ne; *ne; ++ne) {
517
+ if (*ne == '|') break;
518
+ }
519
+ equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
520
+ if (*ne) ++ne;
521
+ }
522
+ return equiv;
523
+ }
524
+
525
+
526
+ /*
527
+ Check the typename
528
+ */
529
+ SWIGRUNTIME swig_cast_info *
530
+ SWIG_TypeCheck(const char *c, swig_type_info *ty) {
531
+ if (ty) {
532
+ swig_cast_info *iter = ty->cast;
533
+ while (iter) {
534
+ if (strcmp(iter->type->name, c) == 0) {
535
+ if (iter == ty->cast)
536
+ return iter;
537
+ /* Move iter to the top of the linked list */
538
+ iter->prev->next = iter->next;
539
+ if (iter->next)
540
+ iter->next->prev = iter->prev;
541
+ iter->next = ty->cast;
542
+ iter->prev = 0;
543
+ if (ty->cast) ty->cast->prev = iter;
544
+ ty->cast = iter;
545
+ return iter;
546
+ }
547
+ iter = iter->next;
548
+ }
549
+ }
550
+ return 0;
551
+ }
552
+
553
+ /*
554
+ Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
555
+ */
556
+ SWIGRUNTIME swig_cast_info *
557
+ SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
558
+ if (ty) {
559
+ swig_cast_info *iter = ty->cast;
560
+ while (iter) {
561
+ if (iter->type == from) {
562
+ if (iter == ty->cast)
563
+ return iter;
564
+ /* Move iter to the top of the linked list */
565
+ iter->prev->next = iter->next;
566
+ if (iter->next)
567
+ iter->next->prev = iter->prev;
568
+ iter->next = ty->cast;
569
+ iter->prev = 0;
570
+ if (ty->cast) ty->cast->prev = iter;
571
+ ty->cast = iter;
572
+ return iter;
573
+ }
574
+ iter = iter->next;
575
+ }
576
+ }
577
+ return 0;
578
+ }
579
+
580
+ /*
581
+ Cast a pointer up an inheritance hierarchy
582
+ */
583
+ SWIGRUNTIMEINLINE void *
584
+ SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
585
+ return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
586
+ }
587
+
588
+ /*
589
+ Dynamic pointer casting. Down an inheritance hierarchy
590
+ */
591
+ SWIGRUNTIME swig_type_info *
592
+ SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
593
+ swig_type_info *lastty = ty;
594
+ if (!ty || !ty->dcast) return ty;
595
+ while (ty && (ty->dcast)) {
596
+ ty = (*ty->dcast)(ptr);
597
+ if (ty) lastty = ty;
598
+ }
599
+ return lastty;
600
+ }
601
+
602
+ /*
603
+ Return the name associated with this type
604
+ */
605
+ SWIGRUNTIMEINLINE const char *
606
+ SWIG_TypeName(const swig_type_info *ty) {
607
+ return ty->name;
608
+ }
609
+
610
+ /*
611
+ Return the pretty name associated with this type,
612
+ that is an unmangled type name in a form presentable to the user.
613
+ */
614
+ SWIGRUNTIME const char *
615
+ SWIG_TypePrettyName(const swig_type_info *type) {
616
+ /* The "str" field contains the equivalent pretty names of the
617
+ type, separated by vertical-bar characters. We choose
618
+ to print the last name, as it is often (?) the most
619
+ specific. */
620
+ if (!type) return NULL;
621
+ if (type->str != NULL) {
622
+ const char *last_name = type->str;
623
+ const char *s;
624
+ for (s = type->str; *s; s++)
625
+ if (*s == '|') last_name = s+1;
626
+ return last_name;
627
+ }
628
+ else
629
+ return type->name;
630
+ }
631
+
632
+ /*
633
+ Set the clientdata field for a type
634
+ */
635
+ SWIGRUNTIME void
636
+ SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
637
+ swig_cast_info *cast = ti->cast;
638
+ /* if (ti->clientdata == clientdata) return; */
639
+ ti->clientdata = clientdata;
640
+
641
+ while (cast) {
642
+ if (!cast->converter) {
643
+ swig_type_info *tc = cast->type;
644
+ if (!tc->clientdata) {
645
+ SWIG_TypeClientData(tc, clientdata);
646
+ }
647
+ }
648
+ cast = cast->next;
649
+ }
650
+ }
651
+ SWIGRUNTIME void
652
+ SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
653
+ SWIG_TypeClientData(ti, clientdata);
654
+ ti->owndata = 1;
655
+ }
656
+
657
+ /*
658
+ Search for a swig_type_info structure only by mangled name
659
+ Search is a O(log #types)
660
+
661
+ We start searching at module start, and finish searching when start == end.
662
+ Note: if start == end at the beginning of the function, we go all the way around
663
+ the circular list.
664
+ */
665
+ SWIGRUNTIME swig_type_info *
666
+ SWIG_MangledTypeQueryModule(swig_module_info *start,
667
+ swig_module_info *end,
668
+ const char *name) {
669
+ swig_module_info *iter = start;
670
+ do {
671
+ if (iter->size) {
672
+ register size_t l = 0;
673
+ register size_t r = iter->size - 1;
674
+ do {
675
+ /* since l+r >= 0, we can (>> 1) instead (/ 2) */
676
+ register size_t i = (l + r) >> 1;
677
+ const char *iname = iter->types[i]->name;
678
+ if (iname) {
679
+ register int compare = strcmp(name, iname);
680
+ if (compare == 0) {
681
+ return iter->types[i];
682
+ } else if (compare < 0) {
683
+ if (i) {
684
+ r = i - 1;
685
+ } else {
686
+ break;
687
+ }
688
+ } else if (compare > 0) {
689
+ l = i + 1;
690
+ }
691
+ } else {
692
+ break; /* should never happen */
693
+ }
694
+ } while (l <= r);
695
+ }
696
+ iter = iter->next;
697
+ } while (iter != end);
698
+ return 0;
699
+ }
700
+
701
+ /*
702
+ Search for a swig_type_info structure for either a mangled name or a human readable name.
703
+ It first searches the mangled names of the types, which is a O(log #types)
704
+ If a type is not found it then searches the human readable names, which is O(#types).
705
+
706
+ We start searching at module start, and finish searching when start == end.
707
+ Note: if start == end at the beginning of the function, we go all the way around
708
+ the circular list.
709
+ */
710
+ SWIGRUNTIME swig_type_info *
711
+ SWIG_TypeQueryModule(swig_module_info *start,
712
+ swig_module_info *end,
713
+ const char *name) {
714
+ /* STEP 1: Search the name field using binary search */
715
+ swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
716
+ if (ret) {
717
+ return ret;
718
+ } else {
719
+ /* STEP 2: If the type hasn't been found, do a complete search
720
+ of the str field (the human readable name) */
721
+ swig_module_info *iter = start;
722
+ do {
723
+ register size_t i = 0;
724
+ for (; i < iter->size; ++i) {
725
+ if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
726
+ return iter->types[i];
727
+ }
728
+ iter = iter->next;
729
+ } while (iter != end);
730
+ }
731
+
732
+ /* neither found a match */
733
+ return 0;
734
+ }
735
+
736
+ /*
737
+ Pack binary data into a string
738
+ */
739
+ SWIGRUNTIME char *
740
+ SWIG_PackData(char *c, void *ptr, size_t sz) {
741
+ static const char hex[17] = "0123456789abcdef";
742
+ register const unsigned char *u = (unsigned char *) ptr;
743
+ register const unsigned char *eu = u + sz;
744
+ for (; u != eu; ++u) {
745
+ register unsigned char uu = *u;
746
+ *(c++) = hex[(uu & 0xf0) >> 4];
747
+ *(c++) = hex[uu & 0xf];
748
+ }
749
+ return c;
750
+ }
751
+
752
+ /*
753
+ Unpack binary data from a string
754
+ */
755
+ SWIGRUNTIME const char *
756
+ SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
757
+ register unsigned char *u = (unsigned char *) ptr;
758
+ register const unsigned char *eu = u + sz;
759
+ for (; u != eu; ++u) {
760
+ register char d = *(c++);
761
+ register unsigned char uu;
762
+ if ((d >= '0') && (d <= '9'))
763
+ uu = ((d - '0') << 4);
764
+ else if ((d >= 'a') && (d <= 'f'))
765
+ uu = ((d - ('a'-10)) << 4);
766
+ else
767
+ return (char *) 0;
768
+ d = *(c++);
769
+ if ((d >= '0') && (d <= '9'))
770
+ uu |= (d - '0');
771
+ else if ((d >= 'a') && (d <= 'f'))
772
+ uu |= (d - ('a'-10));
773
+ else
774
+ return (char *) 0;
775
+ *u = uu;
776
+ }
777
+ return c;
778
+ }
779
+
780
+ /*
781
+ Pack 'void *' into a string buffer.
782
+ */
783
+ SWIGRUNTIME char *
784
+ SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
785
+ char *r = buff;
786
+ if ((2*sizeof(void *) + 2) > bsz) return 0;
787
+ *(r++) = '_';
788
+ r = SWIG_PackData(r,&ptr,sizeof(void *));
789
+ if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
790
+ strcpy(r,name);
791
+ return buff;
792
+ }
793
+
794
+ SWIGRUNTIME const char *
795
+ SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
796
+ if (*c != '_') {
797
+ if (strcmp(c,"NULL") == 0) {
798
+ *ptr = (void *) 0;
799
+ return name;
800
+ } else {
801
+ return 0;
802
+ }
803
+ }
804
+ return SWIG_UnpackData(++c,ptr,sizeof(void *));
805
+ }
806
+
807
+ SWIGRUNTIME char *
808
+ SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
809
+ char *r = buff;
810
+ size_t lname = (name ? strlen(name) : 0);
811
+ if ((2*sz + 2 + lname) > bsz) return 0;
812
+ *(r++) = '_';
813
+ r = SWIG_PackData(r,ptr,sz);
814
+ if (lname) {
815
+ strncpy(r,name,lname+1);
816
+ } else {
817
+ *r = 0;
818
+ }
819
+ return buff;
820
+ }
821
+
822
+ SWIGRUNTIME const char *
823
+ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
824
+ if (*c != '_') {
825
+ if (strcmp(c,"NULL") == 0) {
826
+ memset(ptr,0,sz);
827
+ return name;
828
+ } else {
829
+ return 0;
830
+ }
831
+ }
832
+ return SWIG_UnpackData(++c,ptr,sz);
833
+ }
834
+
835
+ #ifdef __cplusplus
836
+ }
837
+ #endif
838
+
839
+ /* Errors in SWIG */
840
+ #define SWIG_UnknownError -1
841
+ #define SWIG_IOError -2
842
+ #define SWIG_RuntimeError -3
843
+ #define SWIG_IndexError -4
844
+ #define SWIG_TypeError -5
845
+ #define SWIG_DivisionByZero -6
846
+ #define SWIG_OverflowError -7
847
+ #define SWIG_SyntaxError -8
848
+ #define SWIG_ValueError -9
849
+ #define SWIG_SystemError -10
850
+ #define SWIG_AttributeError -11
851
+ #define SWIG_MemoryError -12
852
+ #define SWIG_NullReferenceError -13
853
+
854
+
855
+
856
+ #include <ruby.h>
857
+
858
+ /* Ruby 1.9.1 has a "memoisation optimisation" when compiling with GCC which
859
+ * breaks using rb_intern as an lvalue, as SWIG does. We work around this
860
+ * issue for now by disabling this.
861
+ * https://sourceforge.net/tracker/?func=detail&aid=2859614&group_id=1645&atid=101645
862
+ */
863
+ #ifdef rb_intern
864
+ # undef rb_intern
865
+ #endif
866
+
867
+ /* Remove global macros defined in Ruby's win32.h */
868
+ #ifdef write
869
+ # undef write
870
+ #endif
871
+ #ifdef read
872
+ # undef read
873
+ #endif
874
+ #ifdef bind
875
+ # undef bind
876
+ #endif
877
+ #ifdef close
878
+ # undef close
879
+ #endif
880
+ #ifdef connect
881
+ # undef connect
882
+ #endif
883
+
884
+
885
+ /* Ruby 1.7 defines NUM2LL(), LL2NUM() and ULL2NUM() macros */
886
+ #ifndef NUM2LL
887
+ #define NUM2LL(x) NUM2LONG((x))
888
+ #endif
889
+ #ifndef LL2NUM
890
+ #define LL2NUM(x) INT2NUM((long) (x))
891
+ #endif
892
+ #ifndef ULL2NUM
893
+ #define ULL2NUM(x) UINT2NUM((unsigned long) (x))
894
+ #endif
895
+
896
+ /* Ruby 1.7 doesn't (yet) define NUM2ULL() */
897
+ #ifndef NUM2ULL
898
+ #ifdef HAVE_LONG_LONG
899
+ #define NUM2ULL(x) rb_num2ull((x))
900
+ #else
901
+ #define NUM2ULL(x) NUM2ULONG(x)
902
+ #endif
903
+ #endif
904
+
905
+ /* RSTRING_LEN, etc are new in Ruby 1.9, but ->ptr and ->len no longer work */
906
+ /* Define these for older versions so we can just write code the new way */
907
+ #ifndef RSTRING_LEN
908
+ # define RSTRING_LEN(x) RSTRING(x)->len
909
+ #endif
910
+ #ifndef RSTRING_PTR
911
+ # define RSTRING_PTR(x) RSTRING(x)->ptr
912
+ #endif
913
+ #ifndef RSTRING_END
914
+ # define RSTRING_END(x) (RSTRING_PTR(x) + RSTRING_LEN(x))
915
+ #endif
916
+ #ifndef RARRAY_LEN
917
+ # define RARRAY_LEN(x) RARRAY(x)->len
918
+ #endif
919
+ #ifndef RARRAY_PTR
920
+ # define RARRAY_PTR(x) RARRAY(x)->ptr
921
+ #endif
922
+ #ifndef RFLOAT_VALUE
923
+ # define RFLOAT_VALUE(x) RFLOAT(x)->value
924
+ #endif
925
+ #ifndef DOUBLE2NUM
926
+ # define DOUBLE2NUM(x) rb_float_new(x)
927
+ #endif
928
+ #ifndef RHASH_TBL
929
+ # define RHASH_TBL(x) (RHASH(x)->tbl)
930
+ #endif
931
+ #ifndef RHASH_ITER_LEV
932
+ # define RHASH_ITER_LEV(x) (RHASH(x)->iter_lev)
933
+ #endif
934
+ #ifndef RHASH_IFNONE
935
+ # define RHASH_IFNONE(x) (RHASH(x)->ifnone)
936
+ #endif
937
+ #ifndef RHASH_SIZE
938
+ # define RHASH_SIZE(x) (RHASH(x)->tbl->num_entries)
939
+ #endif
940
+ #ifndef RHASH_EMPTY_P
941
+ # define RHASH_EMPTY_P(x) (RHASH_SIZE(x) == 0)
942
+ #endif
943
+ #ifndef RSTRUCT_LEN
944
+ # define RSTRUCT_LEN(x) RSTRUCT(x)->len
945
+ #endif
946
+ #ifndef RSTRUCT_PTR
947
+ # define RSTRUCT_PTR(x) RSTRUCT(x)->ptr
948
+ #endif
949
+
950
+
951
+
952
+ /*
953
+ * Need to be very careful about how these macros are defined, especially
954
+ * when compiling C++ code or C code with an ANSI C compiler.
955
+ *
956
+ * VALUEFUNC(f) is a macro used to typecast a C function that implements
957
+ * a Ruby method so that it can be passed as an argument to API functions
958
+ * like rb_define_method() and rb_define_singleton_method().
959
+ *
960
+ * VOIDFUNC(f) is a macro used to typecast a C function that implements
961
+ * either the "mark" or "free" stuff for a Ruby Data object, so that it
962
+ * can be passed as an argument to API functions like Data_Wrap_Struct()
963
+ * and Data_Make_Struct().
964
+ */
965
+
966
+ #ifdef __cplusplus
967
+ # ifndef RUBY_METHOD_FUNC /* These definitions should work for Ruby 1.4.6 */
968
+ # define PROTECTFUNC(f) ((VALUE (*)()) f)
969
+ # define VALUEFUNC(f) ((VALUE (*)()) f)
970
+ # define VOIDFUNC(f) ((void (*)()) f)
971
+ # else
972
+ # ifndef ANYARGS /* These definitions should work for Ruby 1.6 */
973
+ # define PROTECTFUNC(f) ((VALUE (*)()) f)
974
+ # define VALUEFUNC(f) ((VALUE (*)()) f)
975
+ # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
976
+ # else /* These definitions should work for Ruby 1.7+ */
977
+ # define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f)
978
+ # define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f)
979
+ # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
980
+ # endif
981
+ # endif
982
+ #else
983
+ # define VALUEFUNC(f) (f)
984
+ # define VOIDFUNC(f) (f)
985
+ #endif
986
+
987
+ /* Don't use for expressions have side effect */
988
+ #ifndef RB_STRING_VALUE
989
+ #define RB_STRING_VALUE(s) (TYPE(s) == T_STRING ? (s) : (*(volatile VALUE *)&(s) = rb_str_to_str(s)))
990
+ #endif
991
+ #ifndef StringValue
992
+ #define StringValue(s) RB_STRING_VALUE(s)
993
+ #endif
994
+ #ifndef StringValuePtr
995
+ #define StringValuePtr(s) RSTRING_PTR(RB_STRING_VALUE(s))
996
+ #endif
997
+ #ifndef StringValueLen
998
+ #define StringValueLen(s) RSTRING_LEN(RB_STRING_VALUE(s))
999
+ #endif
1000
+ #ifndef SafeStringValue
1001
+ #define SafeStringValue(v) do {\
1002
+ StringValue(v);\
1003
+ rb_check_safe_str(v);\
1004
+ } while (0)
1005
+ #endif
1006
+
1007
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
1008
+ #define rb_define_alloc_func(klass, func) rb_define_singleton_method((klass), "new", VALUEFUNC((func)), -1)
1009
+ #define rb_undef_alloc_func(klass) rb_undef_method(CLASS_OF((klass)), "new")
1010
+ #endif
1011
+
1012
+ static VALUE _mSWIG = Qnil;
1013
+
1014
+ /* -----------------------------------------------------------------------------
1015
+ * error manipulation
1016
+ * ----------------------------------------------------------------------------- */
1017
+
1018
+
1019
+ /* Define some additional error types */
1020
+ #define SWIG_ObjectPreviouslyDeletedError -100
1021
+
1022
+
1023
+ /* Define custom exceptions for errors that do not map to existing Ruby
1024
+ exceptions. Note this only works for C++ since a global cannot be
1025
+ initialized by a function in C. For C, fallback to rb_eRuntimeError.*/
1026
+
1027
+ SWIGINTERN VALUE
1028
+ getNullReferenceError(void) {
1029
+ static int init = 0;
1030
+ static VALUE rb_eNullReferenceError ;
1031
+ if (!init) {
1032
+ init = 1;
1033
+ rb_eNullReferenceError = rb_define_class("NullReferenceError", rb_eRuntimeError);
1034
+ }
1035
+ return rb_eNullReferenceError;
1036
+ }
1037
+
1038
+ SWIGINTERN VALUE
1039
+ getObjectPreviouslyDeletedError(void) {
1040
+ static int init = 0;
1041
+ static VALUE rb_eObjectPreviouslyDeleted ;
1042
+ if (!init) {
1043
+ init = 1;
1044
+ rb_eObjectPreviouslyDeleted = rb_define_class("ObjectPreviouslyDeleted", rb_eRuntimeError);
1045
+ }
1046
+ return rb_eObjectPreviouslyDeleted;
1047
+ }
1048
+
1049
+
1050
+ SWIGINTERN VALUE
1051
+ SWIG_Ruby_ErrorType(int SWIG_code) {
1052
+ VALUE type;
1053
+ switch (SWIG_code) {
1054
+ case SWIG_MemoryError:
1055
+ type = rb_eNoMemError;
1056
+ break;
1057
+ case SWIG_IOError:
1058
+ type = rb_eIOError;
1059
+ break;
1060
+ case SWIG_RuntimeError:
1061
+ type = rb_eRuntimeError;
1062
+ break;
1063
+ case SWIG_IndexError:
1064
+ type = rb_eIndexError;
1065
+ break;
1066
+ case SWIG_TypeError:
1067
+ type = rb_eTypeError;
1068
+ break;
1069
+ case SWIG_DivisionByZero:
1070
+ type = rb_eZeroDivError;
1071
+ break;
1072
+ case SWIG_OverflowError:
1073
+ type = rb_eRangeError;
1074
+ break;
1075
+ case SWIG_SyntaxError:
1076
+ type = rb_eSyntaxError;
1077
+ break;
1078
+ case SWIG_ValueError:
1079
+ type = rb_eArgError;
1080
+ break;
1081
+ case SWIG_SystemError:
1082
+ type = rb_eFatal;
1083
+ break;
1084
+ case SWIG_AttributeError:
1085
+ type = rb_eRuntimeError;
1086
+ break;
1087
+ case SWIG_NullReferenceError:
1088
+ type = getNullReferenceError();
1089
+ break;
1090
+ case SWIG_ObjectPreviouslyDeletedError:
1091
+ type = getObjectPreviouslyDeletedError();
1092
+ break;
1093
+ case SWIG_UnknownError:
1094
+ type = rb_eRuntimeError;
1095
+ break;
1096
+ default:
1097
+ type = rb_eRuntimeError;
1098
+ }
1099
+ return type;
1100
+ }
1101
+
1102
+
1103
+ /* This function is called when a user inputs a wrong argument to
1104
+ a method.
1105
+ */
1106
+ SWIGINTERN
1107
+ const char* Ruby_Format_TypeError( const char* msg,
1108
+ const char* type,
1109
+ const char* name,
1110
+ const int argn,
1111
+ VALUE input )
1112
+ {
1113
+ char buf[128];
1114
+ VALUE str;
1115
+ VALUE asStr;
1116
+ if ( msg && *msg )
1117
+ {
1118
+ str = rb_str_new2(msg);
1119
+ }
1120
+ else
1121
+ {
1122
+ str = rb_str_new(NULL, 0);
1123
+ }
1124
+
1125
+ str = rb_str_cat2( str, "Expected argument " );
1126
+ sprintf( buf, "%d of type ", argn-1 );
1127
+ str = rb_str_cat2( str, buf );
1128
+ str = rb_str_cat2( str, type );
1129
+ str = rb_str_cat2( str, ", but got " );
1130
+ str = rb_str_cat2( str, rb_obj_classname(input) );
1131
+ str = rb_str_cat2( str, " " );
1132
+ asStr = rb_inspect(input);
1133
+ if ( RSTRING_LEN(asStr) > 30 )
1134
+ {
1135
+ str = rb_str_cat( str, StringValuePtr(asStr), 30 );
1136
+ str = rb_str_cat2( str, "..." );
1137
+ }
1138
+ else
1139
+ {
1140
+ str = rb_str_append( str, asStr );
1141
+ }
1142
+
1143
+ if ( name )
1144
+ {
1145
+ str = rb_str_cat2( str, "\n\tin SWIG method '" );
1146
+ str = rb_str_cat2( str, name );
1147
+ str = rb_str_cat2( str, "'" );
1148
+ }
1149
+
1150
+ return StringValuePtr( str );
1151
+ }
1152
+
1153
+ /* This function is called when an overloaded method fails */
1154
+ SWIGINTERN
1155
+ void Ruby_Format_OverloadedError(
1156
+ const int argc,
1157
+ const int maxargs,
1158
+ const char* method,
1159
+ const char* prototypes
1160
+ )
1161
+ {
1162
+ const char* msg = "Wrong # of arguments";
1163
+ if ( argc <= maxargs ) msg = "Wrong arguments";
1164
+ rb_raise(rb_eArgError,"%s for overloaded method '%s'.\n"
1165
+ "Possible C/C++ prototypes are:\n%s",
1166
+ msg, method, prototypes);
1167
+ }
1168
+
1169
+ /* -----------------------------------------------------------------------------
1170
+ * rubytracking.swg
1171
+ *
1172
+ * This file contains support for tracking mappings from
1173
+ * Ruby objects to C++ objects. This functionality is needed
1174
+ * to implement mark functions for Ruby's mark and sweep
1175
+ * garbage collector.
1176
+ * ----------------------------------------------------------------------------- */
1177
+
1178
+ #ifdef __cplusplus
1179
+ extern "C" {
1180
+ #endif
1181
+
1182
+ /* Ruby 1.8 actually assumes the first case. */
1183
+ #if SIZEOF_VOIDP == SIZEOF_LONG
1184
+ # define SWIG2NUM(v) LONG2NUM((unsigned long)v)
1185
+ # define NUM2SWIG(x) (unsigned long)NUM2LONG(x)
1186
+ #elif SIZEOF_VOIDP == SIZEOF_LONG_LONG
1187
+ # define SWIG2NUM(v) LL2NUM((unsigned long long)v)
1188
+ # define NUM2SWIG(x) (unsigned long long)NUM2LL(x)
1189
+ #else
1190
+ # error sizeof(void*) is not the same as long or long long
1191
+ #endif
1192
+
1193
+
1194
+ /* Global Ruby hash table to store Trackings from C/C++
1195
+ structs to Ruby Objects.
1196
+ */
1197
+ static VALUE swig_ruby_trackings = Qnil;
1198
+
1199
+ /* Global variable that stores a reference to the ruby
1200
+ hash table delete function. */
1201
+ static ID swig_ruby_hash_delete;
1202
+
1203
+ /* Setup a Ruby hash table to store Trackings */
1204
+ SWIGRUNTIME void SWIG_RubyInitializeTrackings(void) {
1205
+ /* Create a ruby hash table to store Trackings from C++
1206
+ objects to Ruby objects. */
1207
+
1208
+ /* Try to see if some other .so has already created a
1209
+ tracking hash table, which we keep hidden in an instance var
1210
+ in the SWIG module.
1211
+ This is done to allow multiple DSOs to share the same
1212
+ tracking table.
1213
+ */
1214
+ ID trackings_id = rb_intern( "@__trackings__" );
1215
+ VALUE verbose = rb_gv_get("VERBOSE");
1216
+ rb_gv_set("VERBOSE", Qfalse);
1217
+ swig_ruby_trackings = rb_ivar_get( _mSWIG, trackings_id );
1218
+ rb_gv_set("VERBOSE", verbose);
1219
+
1220
+ /* No, it hasn't. Create one ourselves */
1221
+ if ( swig_ruby_trackings == Qnil )
1222
+ {
1223
+ swig_ruby_trackings = rb_hash_new();
1224
+ rb_ivar_set( _mSWIG, trackings_id, swig_ruby_trackings );
1225
+ }
1226
+
1227
+ /* Now store a reference to the hash table delete function
1228
+ so that we only have to look it up once.*/
1229
+ swig_ruby_hash_delete = rb_intern("delete");
1230
+ }
1231
+
1232
+ /* Get a Ruby number to reference a pointer */
1233
+ SWIGRUNTIME VALUE SWIG_RubyPtrToReference(void* ptr) {
1234
+ /* We cast the pointer to an unsigned long
1235
+ and then store a reference to it using
1236
+ a Ruby number object. */
1237
+
1238
+ /* Convert the pointer to a Ruby number */
1239
+ return SWIG2NUM(ptr);
1240
+ }
1241
+
1242
+ /* Get a Ruby number to reference an object */
1243
+ SWIGRUNTIME VALUE SWIG_RubyObjectToReference(VALUE object) {
1244
+ /* We cast the object to an unsigned long
1245
+ and then store a reference to it using
1246
+ a Ruby number object. */
1247
+
1248
+ /* Convert the Object to a Ruby number */
1249
+ return SWIG2NUM(object);
1250
+ }
1251
+
1252
+ /* Get a Ruby object from a previously stored reference */
1253
+ SWIGRUNTIME VALUE SWIG_RubyReferenceToObject(VALUE reference) {
1254
+ /* The provided Ruby number object is a reference
1255
+ to the Ruby object we want.*/
1256
+
1257
+ /* Convert the Ruby number to a Ruby object */
1258
+ return NUM2SWIG(reference);
1259
+ }
1260
+
1261
+ /* Add a Tracking from a C/C++ struct to a Ruby object */
1262
+ SWIGRUNTIME void SWIG_RubyAddTracking(void* ptr, VALUE object) {
1263
+ /* In a Ruby hash table we store the pointer and
1264
+ the associated Ruby object. The trick here is
1265
+ that we cannot store the Ruby object directly - if
1266
+ we do then it cannot be garbage collected. So
1267
+ instead we typecast it as a unsigned long and
1268
+ convert it to a Ruby number object.*/
1269
+
1270
+ /* Get a reference to the pointer as a Ruby number */
1271
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1272
+
1273
+ /* Get a reference to the Ruby object as a Ruby number */
1274
+ VALUE value = SWIG_RubyObjectToReference(object);
1275
+
1276
+ /* Store the mapping to the global hash table. */
1277
+ rb_hash_aset(swig_ruby_trackings, key, value);
1278
+ }
1279
+
1280
+ /* Get the Ruby object that owns the specified C/C++ struct */
1281
+ SWIGRUNTIME VALUE SWIG_RubyInstanceFor(void* ptr) {
1282
+ /* Get a reference to the pointer as a Ruby number */
1283
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1284
+
1285
+ /* Now lookup the value stored in the global hash table */
1286
+ VALUE value = rb_hash_aref(swig_ruby_trackings, key);
1287
+
1288
+ if (value == Qnil) {
1289
+ /* No object exists - return nil. */
1290
+ return Qnil;
1291
+ }
1292
+ else {
1293
+ /* Convert this value to Ruby object */
1294
+ return SWIG_RubyReferenceToObject(value);
1295
+ }
1296
+ }
1297
+
1298
+ /* Remove a Tracking from a C/C++ struct to a Ruby object. It
1299
+ is very important to remove objects once they are destroyed
1300
+ since the same memory address may be reused later to create
1301
+ a new object. */
1302
+ SWIGRUNTIME void SWIG_RubyRemoveTracking(void* ptr) {
1303
+ /* Get a reference to the pointer as a Ruby number */
1304
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1305
+
1306
+ /* Delete the object from the hash table by calling Ruby's
1307
+ do this we need to call the Hash.delete method.*/
1308
+ rb_funcall(swig_ruby_trackings, swig_ruby_hash_delete, 1, key);
1309
+ }
1310
+
1311
+ /* This is a helper method that unlinks a Ruby object from its
1312
+ underlying C++ object. This is needed if the lifetime of the
1313
+ Ruby object is longer than the C++ object */
1314
+ SWIGRUNTIME void SWIG_RubyUnlinkObjects(void* ptr) {
1315
+ VALUE object = SWIG_RubyInstanceFor(ptr);
1316
+
1317
+ if (object != Qnil) {
1318
+ DATA_PTR(object) = 0;
1319
+ }
1320
+ }
1321
+
1322
+
1323
+ #ifdef __cplusplus
1324
+ }
1325
+ #endif
1326
+
1327
+ /* -----------------------------------------------------------------------------
1328
+ * Ruby API portion that goes into the runtime
1329
+ * ----------------------------------------------------------------------------- */
1330
+
1331
+ #ifdef __cplusplus
1332
+ extern "C" {
1333
+ #endif
1334
+
1335
+ SWIGINTERN VALUE
1336
+ SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
1337
+ if (NIL_P(target)) {
1338
+ target = o;
1339
+ } else {
1340
+ if (TYPE(target) != T_ARRAY) {
1341
+ VALUE o2 = target;
1342
+ target = rb_ary_new();
1343
+ rb_ary_push(target, o2);
1344
+ }
1345
+ rb_ary_push(target, o);
1346
+ }
1347
+ return target;
1348
+ }
1349
+
1350
+ /* For ruby1.8.4 and earlier. */
1351
+ #ifndef RUBY_INIT_STACK
1352
+ RUBY_EXTERN void Init_stack(VALUE* addr);
1353
+ # define RUBY_INIT_STACK \
1354
+ VALUE variable_in_this_stack_frame; \
1355
+ Init_stack(&variable_in_this_stack_frame);
1356
+ #endif
1357
+
1358
+
1359
+ #ifdef __cplusplus
1360
+ }
1361
+ #endif
1362
+
1363
+
1364
+ /* -----------------------------------------------------------------------------
1365
+ * rubyrun.swg
1366
+ *
1367
+ * This file contains the runtime support for Ruby modules
1368
+ * and includes code for managing global variables and pointer
1369
+ * type checking.
1370
+ * ----------------------------------------------------------------------------- */
1371
+
1372
+ /* For backward compatibility only */
1373
+ #define SWIG_POINTER_EXCEPTION 0
1374
+
1375
+ /* for raw pointers */
1376
+ #define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
1377
+ #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, own)
1378
+ #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Ruby_NewPointerObj(ptr, type, flags)
1379
+ #define SWIG_AcquirePtr(ptr, own) SWIG_Ruby_AcquirePtr(ptr, own)
1380
+ #define swig_owntype ruby_owntype
1381
+
1382
+ /* for raw packed data */
1383
+ #define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty, flags)
1384
+ #define SWIG_NewPackedObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type)
1385
+
1386
+ /* for class or struct pointers */
1387
+ #define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
1388
+ #define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
1389
+
1390
+ /* for C or C++ function pointers */
1391
+ #define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0)
1392
+ #define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0)
1393
+
1394
+ /* for C++ member pointers, ie, member methods */
1395
+ #define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty)
1396
+ #define SWIG_NewMemberObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type)
1397
+
1398
+
1399
+ /* Runtime API */
1400
+
1401
+ #define SWIG_GetModule(clientdata) SWIG_Ruby_GetModule()
1402
+ #define SWIG_SetModule(clientdata, pointer) SWIG_Ruby_SetModule(pointer)
1403
+
1404
+
1405
+ /* Error manipulation */
1406
+
1407
+ #define SWIG_ErrorType(code) SWIG_Ruby_ErrorType(code)
1408
+ #define SWIG_Error(code, msg) rb_raise(SWIG_Ruby_ErrorType(code), "%s", msg)
1409
+ #define SWIG_fail goto fail
1410
+
1411
+
1412
+ /* Ruby-specific SWIG API */
1413
+
1414
+ #define SWIG_InitRuntime() SWIG_Ruby_InitRuntime()
1415
+ #define SWIG_define_class(ty) SWIG_Ruby_define_class(ty)
1416
+ #define SWIG_NewClassInstance(value, ty) SWIG_Ruby_NewClassInstance(value, ty)
1417
+ #define SWIG_MangleStr(value) SWIG_Ruby_MangleStr(value)
1418
+ #define SWIG_CheckConvert(value, ty) SWIG_Ruby_CheckConvert(value, ty)
1419
+
1420
+ #include "assert.h"
1421
+
1422
+ /* -----------------------------------------------------------------------------
1423
+ * pointers/data manipulation
1424
+ * ----------------------------------------------------------------------------- */
1425
+
1426
+ #ifdef __cplusplus
1427
+ extern "C" {
1428
+ #endif
1429
+
1430
+ typedef struct {
1431
+ VALUE klass;
1432
+ VALUE mImpl;
1433
+ void (*mark)(void *);
1434
+ void (*destroy)(void *);
1435
+ int trackObjects;
1436
+ } swig_class;
1437
+
1438
+
1439
+ /* Global pointer used to keep some internal SWIG stuff */
1440
+ static VALUE _cSWIG_Pointer = Qnil;
1441
+ static VALUE swig_runtime_data_type_pointer = Qnil;
1442
+
1443
+ /* Global IDs used to keep some internal SWIG stuff */
1444
+ static ID swig_arity_id = 0;
1445
+ static ID swig_call_id = 0;
1446
+
1447
+ /*
1448
+ If your swig extension is to be run within an embedded ruby and has
1449
+ director callbacks, you should set -DRUBY_EMBEDDED during compilation.
1450
+ This will reset ruby's stack frame on each entry point from the main
1451
+ program the first time a virtual director function is invoked (in a
1452
+ non-recursive way).
1453
+ If this is not done, you run the risk of Ruby trashing the stack.
1454
+ */
1455
+
1456
+ #ifdef RUBY_EMBEDDED
1457
+
1458
+ # define SWIG_INIT_STACK \
1459
+ if ( !swig_virtual_calls ) { RUBY_INIT_STACK } \
1460
+ ++swig_virtual_calls;
1461
+ # define SWIG_RELEASE_STACK --swig_virtual_calls;
1462
+ # define Ruby_DirectorTypeMismatchException(x) \
1463
+ rb_raise( rb_eTypeError, "%s", x ); return c_result;
1464
+
1465
+ static unsigned int swig_virtual_calls = 0;
1466
+
1467
+ #else /* normal non-embedded extension */
1468
+
1469
+ # define SWIG_INIT_STACK
1470
+ # define SWIG_RELEASE_STACK
1471
+ # define Ruby_DirectorTypeMismatchException(x) \
1472
+ throw Swig::DirectorTypeMismatchException( x );
1473
+
1474
+ #endif /* RUBY_EMBEDDED */
1475
+
1476
+
1477
+ SWIGRUNTIME VALUE
1478
+ getExceptionClass(void) {
1479
+ static int init = 0;
1480
+ static VALUE rubyExceptionClass ;
1481
+ if (!init) {
1482
+ init = 1;
1483
+ rubyExceptionClass = rb_const_get(_mSWIG, rb_intern("Exception"));
1484
+ }
1485
+ return rubyExceptionClass;
1486
+ }
1487
+
1488
+ /* This code checks to see if the Ruby object being raised as part
1489
+ of an exception inherits from the Ruby class Exception. If so,
1490
+ the object is simply returned. If not, then a new Ruby exception
1491
+ object is created and that will be returned to Ruby.*/
1492
+ SWIGRUNTIME VALUE
1493
+ SWIG_Ruby_ExceptionType(swig_type_info *desc, VALUE obj) {
1494
+ VALUE exceptionClass = getExceptionClass();
1495
+ if (rb_obj_is_kind_of(obj, exceptionClass)) {
1496
+ return obj;
1497
+ } else {
1498
+ return rb_exc_new3(rb_eRuntimeError, rb_obj_as_string(obj));
1499
+ }
1500
+ }
1501
+
1502
+ /* Initialize Ruby runtime support */
1503
+ SWIGRUNTIME void
1504
+ SWIG_Ruby_InitRuntime(void)
1505
+ {
1506
+ if (_mSWIG == Qnil) {
1507
+ _mSWIG = rb_define_module("SWIG");
1508
+ swig_call_id = rb_intern("call");
1509
+ swig_arity_id = rb_intern("arity");
1510
+ }
1511
+ }
1512
+
1513
+ /* Define Ruby class for C type */
1514
+ SWIGRUNTIME void
1515
+ SWIG_Ruby_define_class(swig_type_info *type)
1516
+ {
1517
+ VALUE klass;
1518
+ char *klass_name = (char *) malloc(4 + strlen(type->name) + 1);
1519
+ sprintf(klass_name, "TYPE%s", type->name);
1520
+ if (NIL_P(_cSWIG_Pointer)) {
1521
+ _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);
1522
+ rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new");
1523
+ }
1524
+ klass = rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
1525
+ free((void *) klass_name);
1526
+ }
1527
+
1528
+ /* Create a new pointer object */
1529
+ SWIGRUNTIME VALUE
1530
+ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
1531
+ {
1532
+ int own = flags & SWIG_POINTER_OWN;
1533
+ int track;
1534
+ char *klass_name;
1535
+ swig_class *sklass;
1536
+ VALUE klass;
1537
+ VALUE obj;
1538
+
1539
+ if (!ptr)
1540
+ return Qnil;
1541
+
1542
+ if (type->clientdata) {
1543
+ sklass = (swig_class *) type->clientdata;
1544
+
1545
+ /* Are we tracking this class and have we already returned this Ruby object? */
1546
+ track = sklass->trackObjects;
1547
+ if (track) {
1548
+ obj = SWIG_RubyInstanceFor(ptr);
1549
+
1550
+ /* Check the object's type and make sure it has the correct type.
1551
+ It might not in cases where methods do things like
1552
+ downcast methods. */
1553
+ if (obj != Qnil) {
1554
+ VALUE value = rb_iv_get(obj, "@__swigtype__");
1555
+ char* type_name = RSTRING_PTR(value);
1556
+
1557
+ if (strcmp(type->name, type_name) == 0) {
1558
+ return obj;
1559
+ }
1560
+ }
1561
+ }
1562
+
1563
+ /* Create a new Ruby object */
1564
+ obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark),
1565
+ ( own ? VOIDFUNC(sklass->destroy) :
1566
+ (track ? VOIDFUNC(SWIG_RubyRemoveTracking) : 0 )
1567
+ ), ptr);
1568
+
1569
+ /* If tracking is on for this class then track this object. */
1570
+ if (track) {
1571
+ SWIG_RubyAddTracking(ptr, obj);
1572
+ }
1573
+ } else {
1574
+ klass_name = (char *) malloc(4 + strlen(type->name) + 1);
1575
+ sprintf(klass_name, "TYPE%s", type->name);
1576
+ klass = rb_const_get(_mSWIG, rb_intern(klass_name));
1577
+ free((void *) klass_name);
1578
+ obj = Data_Wrap_Struct(klass, 0, 0, ptr);
1579
+ }
1580
+ rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
1581
+
1582
+ return obj;
1583
+ }
1584
+
1585
+ /* Create a new class instance (always owned) */
1586
+ SWIGRUNTIME VALUE
1587
+ SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type)
1588
+ {
1589
+ VALUE obj;
1590
+ swig_class *sklass = (swig_class *) type->clientdata;
1591
+ obj = Data_Wrap_Struct(klass, VOIDFUNC(sklass->mark), VOIDFUNC(sklass->destroy), 0);
1592
+ rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
1593
+ return obj;
1594
+ }
1595
+
1596
+ /* Get type mangle from class name */
1597
+ SWIGRUNTIMEINLINE char *
1598
+ SWIG_Ruby_MangleStr(VALUE obj)
1599
+ {
1600
+ VALUE stype = rb_iv_get(obj, "@__swigtype__");
1601
+ return StringValuePtr(stype);
1602
+ }
1603
+
1604
+ /* Acquire a pointer value */
1605
+ typedef void (*ruby_owntype)(void*);
1606
+
1607
+ SWIGRUNTIME ruby_owntype
1608
+ SWIG_Ruby_AcquirePtr(VALUE obj, ruby_owntype own) {
1609
+ if (obj) {
1610
+ ruby_owntype oldown = RDATA(obj)->dfree;
1611
+ RDATA(obj)->dfree = own;
1612
+ return oldown;
1613
+ } else {
1614
+ return 0;
1615
+ }
1616
+ }
1617
+
1618
+ /* Convert a pointer value */
1619
+ SWIGRUNTIME int
1620
+ SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags, ruby_owntype *own)
1621
+ {
1622
+ char *c;
1623
+ swig_cast_info *tc;
1624
+ void *vptr = 0;
1625
+
1626
+ /* Grab the pointer */
1627
+ if (NIL_P(obj)) {
1628
+ *ptr = 0;
1629
+ return SWIG_OK;
1630
+ } else {
1631
+ if (TYPE(obj) != T_DATA) {
1632
+ return SWIG_ERROR;
1633
+ }
1634
+ Data_Get_Struct(obj, void, vptr);
1635
+ }
1636
+
1637
+ if (own) *own = RDATA(obj)->dfree;
1638
+
1639
+ /* Check to see if the input object is giving up ownership
1640
+ of the underlying C struct or C++ object. If so then we
1641
+ need to reset the destructor since the Ruby object no
1642
+ longer owns the underlying C++ object.*/
1643
+ if (flags & SWIG_POINTER_DISOWN) {
1644
+ /* Is tracking on for this class? */
1645
+ int track = 0;
1646
+ if (ty && ty->clientdata) {
1647
+ swig_class *sklass = (swig_class *) ty->clientdata;
1648
+ track = sklass->trackObjects;
1649
+ }
1650
+
1651
+ if (track) {
1652
+ /* We are tracking objects for this class. Thus we change the destructor
1653
+ * to SWIG_RubyRemoveTracking. This allows us to
1654
+ * remove the mapping from the C++ to Ruby object
1655
+ * when the Ruby object is garbage collected. If we don't
1656
+ * do this, then it is possible we will return a reference
1657
+ * to a Ruby object that no longer exists thereby crashing Ruby. */
1658
+ RDATA(obj)->dfree = SWIG_RubyRemoveTracking;
1659
+ } else {
1660
+ RDATA(obj)->dfree = 0;
1661
+ }
1662
+ }
1663
+
1664
+ /* Do type-checking if type info was provided */
1665
+ if (ty) {
1666
+ if (ty->clientdata) {
1667
+ if (rb_obj_is_kind_of(obj, ((swig_class *) (ty->clientdata))->klass)) {
1668
+ if (vptr == 0) {
1669
+ /* The object has already been deleted */
1670
+ return SWIG_ObjectPreviouslyDeletedError;
1671
+ }
1672
+ *ptr = vptr;
1673
+ return SWIG_OK;
1674
+ }
1675
+ }
1676
+ if ((c = SWIG_MangleStr(obj)) == NULL) {
1677
+ return SWIG_ERROR;
1678
+ }
1679
+ tc = SWIG_TypeCheck(c, ty);
1680
+ if (!tc) {
1681
+ return SWIG_ERROR;
1682
+ } else {
1683
+ int newmemory = 0;
1684
+ *ptr = SWIG_TypeCast(tc, vptr, &newmemory);
1685
+ assert(!newmemory); /* newmemory handling not yet implemented */
1686
+ }
1687
+ } else {
1688
+ *ptr = vptr;
1689
+ }
1690
+
1691
+ return SWIG_OK;
1692
+ }
1693
+
1694
+ /* Check convert */
1695
+ SWIGRUNTIMEINLINE int
1696
+ SWIG_Ruby_CheckConvert(VALUE obj, swig_type_info *ty)
1697
+ {
1698
+ char *c = SWIG_MangleStr(obj);
1699
+ if (!c) return 0;
1700
+ return SWIG_TypeCheck(c,ty) != 0;
1701
+ }
1702
+
1703
+ SWIGRUNTIME VALUE
1704
+ SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
1705
+ char result[1024];
1706
+ char *r = result;
1707
+ if ((2*sz + 1 + strlen(type->name)) > 1000) return 0;
1708
+ *(r++) = '_';
1709
+ r = SWIG_PackData(r, ptr, sz);
1710
+ strcpy(r, type->name);
1711
+ return rb_str_new2(result);
1712
+ }
1713
+
1714
+ /* Convert a packed value value */
1715
+ SWIGRUNTIME int
1716
+ SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty) {
1717
+ swig_cast_info *tc;
1718
+ const char *c;
1719
+
1720
+ if (TYPE(obj) != T_STRING) goto type_error;
1721
+ c = StringValuePtr(obj);
1722
+ /* Pointer values must start with leading underscore */
1723
+ if (*c != '_') goto type_error;
1724
+ c++;
1725
+ c = SWIG_UnpackData(c, ptr, sz);
1726
+ if (ty) {
1727
+ tc = SWIG_TypeCheck(c, ty);
1728
+ if (!tc) goto type_error;
1729
+ }
1730
+ return SWIG_OK;
1731
+
1732
+ type_error:
1733
+ return SWIG_ERROR;
1734
+ }
1735
+
1736
+ SWIGRUNTIME swig_module_info *
1737
+ SWIG_Ruby_GetModule(void)
1738
+ {
1739
+ VALUE pointer;
1740
+ swig_module_info *ret = 0;
1741
+ VALUE verbose = rb_gv_get("VERBOSE");
1742
+
1743
+ /* temporarily disable warnings, since the pointer check causes warnings with 'ruby -w' */
1744
+ rb_gv_set("VERBOSE", Qfalse);
1745
+
1746
+ /* first check if pointer already created */
1747
+ pointer = rb_gv_get("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
1748
+ if (pointer != Qnil) {
1749
+ Data_Get_Struct(pointer, swig_module_info, ret);
1750
+ }
1751
+
1752
+ /* reinstate warnings */
1753
+ rb_gv_set("VERBOSE", verbose);
1754
+ return ret;
1755
+ }
1756
+
1757
+ SWIGRUNTIME void
1758
+ SWIG_Ruby_SetModule(swig_module_info *pointer)
1759
+ {
1760
+ /* register a new class */
1761
+ VALUE cl = rb_define_class("swig_runtime_data", rb_cObject);
1762
+ /* create and store the structure pointer to a global variable */
1763
+ swig_runtime_data_type_pointer = Data_Wrap_Struct(cl, 0, 0, pointer);
1764
+ rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer);
1765
+ }
1766
+
1767
+ /* This function can be used to check whether a proc or method or similarly
1768
+ callable function has been passed. Usually used in a %typecheck, like:
1769
+
1770
+ %typecheck(c_callback_t, precedence=SWIG_TYPECHECK_POINTER) {
1771
+ $result = SWIG_Ruby_isCallable( $input );
1772
+ }
1773
+ */
1774
+ SWIGINTERN
1775
+ int SWIG_Ruby_isCallable( VALUE proc )
1776
+ {
1777
+ if ( rb_respond_to( proc, swig_call_id ) == Qtrue )
1778
+ return 1;
1779
+ return 0;
1780
+ }
1781
+
1782
+ /* This function can be used to check the arity (number of arguments)
1783
+ a proc or method can take. Usually used in a %typecheck.
1784
+ Valid arities will be that equal to minimal or those < 0
1785
+ which indicate a variable number of parameters at the end.
1786
+ */
1787
+ SWIGINTERN
1788
+ int SWIG_Ruby_arity( VALUE proc, int minimal )
1789
+ {
1790
+ if ( rb_respond_to( proc, swig_arity_id ) == Qtrue )
1791
+ {
1792
+ VALUE num = rb_funcall( proc, swig_arity_id, 0 );
1793
+ int arity = NUM2INT(num);
1794
+ if ( arity < 0 && (arity+1) < -minimal ) return 1;
1795
+ if ( arity == minimal ) return 1;
1796
+ return 1;
1797
+ }
1798
+ return 0;
1799
+ }
1800
+
1801
+
1802
+ #ifdef __cplusplus
1803
+ }
1804
+ #endif
1805
+
1806
+
1807
+
1808
+ #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
1809
+
1810
+ #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
1811
+
1812
+
1813
+
1814
+ /* -------- TYPES TABLE (BEGIN) -------- */
1815
+
1816
+ #define SWIGTYPE_p_CQR_Encode swig_types[0]
1817
+ #define SWIGTYPE_p_a_177__unsigned_char swig_types[1]
1818
+ #define SWIGTYPE_p_bool swig_types[2]
1819
+ #define SWIGTYPE_p_char swig_types[3]
1820
+ #define SWIGTYPE_p_int swig_types[4]
1821
+ #define SWIGTYPE_p_tagQR_VERSIONINFO swig_types[5]
1822
+ #define SWIGTYPE_p_tagRS_BLOCKINFO swig_types[6]
1823
+ #define SWIGTYPE_p_unsigned_char swig_types[7]
1824
+ #define SWIGTYPE_p_unsigned_short swig_types[8]
1825
+ static swig_type_info *swig_types[10];
1826
+ static swig_module_info swig_module = {swig_types, 9, 0, 0, 0, 0};
1827
+ #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
1828
+ #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
1829
+
1830
+ /* -------- TYPES TABLE (END) -------- */
1831
+
1832
+ #define SWIG_init Init_RQREncoder
1833
+ #define SWIG_name "RQREncoder"
1834
+
1835
+ static VALUE mRQREncoder;
1836
+
1837
+ #define SWIG_RUBY_THREAD_BEGIN_BLOCK
1838
+ #define SWIG_RUBY_THREAD_END_BLOCK
1839
+
1840
+
1841
+ #define SWIGVERSION 0x020001
1842
+ #define SWIG_VERSION SWIGVERSION
1843
+
1844
+
1845
+ #define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
1846
+ #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))
1847
+
1848
+
1849
+ #include <stdexcept>
1850
+
1851
+
1852
+ #include "win2ansi.h"
1853
+ #include "QR_Encode.h"
1854
+
1855
+
1856
+ SWIGINTERNINLINE VALUE
1857
+ SWIG_From_bool (bool value)
1858
+ {
1859
+ return value ? Qtrue : Qfalse;
1860
+ }
1861
+
1862
+
1863
+ #include <limits.h>
1864
+ #if !defined(SWIG_NO_LLONG_MAX)
1865
+ # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
1866
+ # define LLONG_MAX __LONG_LONG_MAX__
1867
+ # define LLONG_MIN (-LLONG_MAX - 1LL)
1868
+ # define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
1869
+ # endif
1870
+ #endif
1871
+
1872
+
1873
+ #define SWIG_From_long LONG2NUM
1874
+
1875
+
1876
+ SWIGINTERNINLINE VALUE
1877
+ SWIG_From_int (int value)
1878
+ {
1879
+ return SWIG_From_long (value);
1880
+ }
1881
+
1882
+
1883
+ SWIGINTERN VALUE
1884
+ SWIG_ruby_failed(void)
1885
+ {
1886
+ return Qnil;
1887
+ }
1888
+
1889
+
1890
+ /*@SWIG:/usr/local/share/swig/2.0.1/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
1891
+ SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
1892
+ {
1893
+ VALUE obj = args[0];
1894
+ VALUE type = TYPE(obj);
1895
+ long *res = (long *)(args[1]);
1896
+ *res = type == T_FIXNUM ? NUM2LONG(obj) : rb_big2long(obj);
1897
+ return obj;
1898
+ }
1899
+ /*@SWIG@*/
1900
+
1901
+ SWIGINTERN int
1902
+ SWIG_AsVal_long (VALUE obj, long* val)
1903
+ {
1904
+ VALUE type = TYPE(obj);
1905
+ if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
1906
+ long v;
1907
+ VALUE a[2];
1908
+ a[0] = obj;
1909
+ a[1] = (VALUE)(&v);
1910
+ if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2LONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
1911
+ if (val) *val = v;
1912
+ return SWIG_OK;
1913
+ }
1914
+ }
1915
+ return SWIG_TypeError;
1916
+ }
1917
+
1918
+
1919
+ SWIGINTERN int
1920
+ SWIG_AsVal_int (VALUE obj, int *val)
1921
+ {
1922
+ long v;
1923
+ int res = SWIG_AsVal_long (obj, &v);
1924
+ if (SWIG_IsOK(res)) {
1925
+ if ((v < INT_MIN || v > INT_MAX)) {
1926
+ return SWIG_OverflowError;
1927
+ } else {
1928
+ if (val) *val = static_cast< int >(v);
1929
+ }
1930
+ }
1931
+ return res;
1932
+ }
1933
+
1934
+
1935
+ SWIGINTERN int
1936
+ SWIG_AsVal_bool (VALUE obj, bool *val)
1937
+ {
1938
+ if (obj == Qtrue) {
1939
+ if (val) *val = true;
1940
+ return SWIG_OK;
1941
+ } else if (obj == Qfalse) {
1942
+ if (val) *val = false;
1943
+ return SWIG_OK;
1944
+ } else {
1945
+ int res = 0;
1946
+ if (SWIG_AsVal_int (obj, &res) == SWIG_OK) {
1947
+ if (val) *val = res ? true : false;
1948
+ return SWIG_OK;
1949
+ }
1950
+ }
1951
+ return SWIG_TypeError;
1952
+ }
1953
+
1954
+
1955
+ SWIGINTERN swig_type_info*
1956
+ SWIG_pchar_descriptor(void)
1957
+ {
1958
+ static int init = 0;
1959
+ static swig_type_info* info = 0;
1960
+ if (!init) {
1961
+ info = SWIG_TypeQuery("_p_char");
1962
+ init = 1;
1963
+ }
1964
+ return info;
1965
+ }
1966
+
1967
+
1968
+ SWIGINTERN int
1969
+ SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
1970
+ {
1971
+ if (TYPE(obj) == T_STRING) {
1972
+ #if defined(StringValuePtr)
1973
+ char *cstr = StringValuePtr(obj);
1974
+ #else
1975
+ char *cstr = STR2CSTR(obj);
1976
+ #endif
1977
+ size_t size = RSTRING_LEN(obj) + 1;
1978
+ if (cptr) {
1979
+ if (alloc) {
1980
+ if (*alloc == SWIG_NEWOBJ) {
1981
+ *cptr = reinterpret_cast< char* >(memcpy((new char[size]), cstr, sizeof(char)*(size)));
1982
+ } else {
1983
+ *cptr = cstr;
1984
+ *alloc = SWIG_OLDOBJ;
1985
+ }
1986
+ }
1987
+ }
1988
+ if (psize) *psize = size;
1989
+ return SWIG_OK;
1990
+ } else {
1991
+ swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
1992
+ if (pchar_descriptor) {
1993
+ void* vptr = 0;
1994
+ if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
1995
+ if (cptr) *cptr = (char *)vptr;
1996
+ if (psize) *psize = vptr ? (strlen((char*)vptr) + 1) : 0;
1997
+ if (alloc) *alloc = SWIG_OLDOBJ;
1998
+ return SWIG_OK;
1999
+ }
2000
+ }
2001
+ }
2002
+ return SWIG_TypeError;
2003
+ }
2004
+
2005
+
2006
+
2007
+
2008
+ SWIGINTERN VALUE CQR_Encode_results(CQR_Encode *self){
2009
+ VALUE result = rb_ary_new2(self->m_nSymbleSize);
2010
+ size_t ii = 0;
2011
+ for (; ii < (size_t)self->m_nSymbleSize; ++ii) {
2012
+ VALUE innerAry = rb_ary_new2(self->m_nSymbleSize);
2013
+ rb_ary_push(result, innerAry);
2014
+ size_t jj = 0;
2015
+ for (; jj < (size_t)self->m_nSymbleSize; ++jj) {
2016
+ rb_ary_push(innerAry, self->m_byModuleData[ii][jj] ? Qtrue : Qfalse);
2017
+ }
2018
+ }
2019
+ return result;
2020
+ }
2021
+ swig_class SwigClassRS_BLOCKINFO;
2022
+
2023
+ SWIGINTERN VALUE
2024
+ _wrap_RS_BLOCKINFO_ncRSBlock_set(int argc, VALUE *argv, VALUE self) {
2025
+ RS_BLOCKINFO *arg1 = (RS_BLOCKINFO *) 0 ;
2026
+ int arg2 ;
2027
+ void *argp1 = 0 ;
2028
+ int res1 = 0 ;
2029
+ int val2 ;
2030
+ int ecode2 = 0 ;
2031
+
2032
+ if ((argc < 1) || (argc > 1)) {
2033
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2034
+ }
2035
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_tagRS_BLOCKINFO, 0 | 0 );
2036
+ if (!SWIG_IsOK(res1)) {
2037
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "RS_BLOCKINFO *","ncRSBlock", 1, self ));
2038
+ }
2039
+ arg1 = reinterpret_cast< RS_BLOCKINFO * >(argp1);
2040
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
2041
+ if (!SWIG_IsOK(ecode2)) {
2042
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","ncRSBlock", 2, argv[0] ));
2043
+ }
2044
+ arg2 = static_cast< int >(val2);
2045
+ if (arg1) (arg1)->ncRSBlock = arg2;
2046
+ return Qnil;
2047
+ fail:
2048
+ return Qnil;
2049
+ }
2050
+
2051
+
2052
+ SWIGINTERN VALUE
2053
+ _wrap_RS_BLOCKINFO_ncRSBlock_get(int argc, VALUE *argv, VALUE self) {
2054
+ RS_BLOCKINFO *arg1 = (RS_BLOCKINFO *) 0 ;
2055
+ void *argp1 = 0 ;
2056
+ int res1 = 0 ;
2057
+ int result;
2058
+ VALUE vresult = Qnil;
2059
+
2060
+ if ((argc < 0) || (argc > 0)) {
2061
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2062
+ }
2063
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_tagRS_BLOCKINFO, 0 | 0 );
2064
+ if (!SWIG_IsOK(res1)) {
2065
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "RS_BLOCKINFO *","ncRSBlock", 1, self ));
2066
+ }
2067
+ arg1 = reinterpret_cast< RS_BLOCKINFO * >(argp1);
2068
+ result = (int) ((arg1)->ncRSBlock);
2069
+ vresult = SWIG_From_int(static_cast< int >(result));
2070
+ return vresult;
2071
+ fail:
2072
+ return Qnil;
2073
+ }
2074
+
2075
+
2076
+ SWIGINTERN VALUE
2077
+ _wrap_RS_BLOCKINFO_ncAllCodeWord_set(int argc, VALUE *argv, VALUE self) {
2078
+ RS_BLOCKINFO *arg1 = (RS_BLOCKINFO *) 0 ;
2079
+ int arg2 ;
2080
+ void *argp1 = 0 ;
2081
+ int res1 = 0 ;
2082
+ int val2 ;
2083
+ int ecode2 = 0 ;
2084
+
2085
+ if ((argc < 1) || (argc > 1)) {
2086
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2087
+ }
2088
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_tagRS_BLOCKINFO, 0 | 0 );
2089
+ if (!SWIG_IsOK(res1)) {
2090
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "RS_BLOCKINFO *","ncAllCodeWord", 1, self ));
2091
+ }
2092
+ arg1 = reinterpret_cast< RS_BLOCKINFO * >(argp1);
2093
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
2094
+ if (!SWIG_IsOK(ecode2)) {
2095
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","ncAllCodeWord", 2, argv[0] ));
2096
+ }
2097
+ arg2 = static_cast< int >(val2);
2098
+ if (arg1) (arg1)->ncAllCodeWord = arg2;
2099
+ return Qnil;
2100
+ fail:
2101
+ return Qnil;
2102
+ }
2103
+
2104
+
2105
+ SWIGINTERN VALUE
2106
+ _wrap_RS_BLOCKINFO_ncAllCodeWord_get(int argc, VALUE *argv, VALUE self) {
2107
+ RS_BLOCKINFO *arg1 = (RS_BLOCKINFO *) 0 ;
2108
+ void *argp1 = 0 ;
2109
+ int res1 = 0 ;
2110
+ int result;
2111
+ VALUE vresult = Qnil;
2112
+
2113
+ if ((argc < 0) || (argc > 0)) {
2114
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2115
+ }
2116
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_tagRS_BLOCKINFO, 0 | 0 );
2117
+ if (!SWIG_IsOK(res1)) {
2118
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "RS_BLOCKINFO *","ncAllCodeWord", 1, self ));
2119
+ }
2120
+ arg1 = reinterpret_cast< RS_BLOCKINFO * >(argp1);
2121
+ result = (int) ((arg1)->ncAllCodeWord);
2122
+ vresult = SWIG_From_int(static_cast< int >(result));
2123
+ return vresult;
2124
+ fail:
2125
+ return Qnil;
2126
+ }
2127
+
2128
+
2129
+ SWIGINTERN VALUE
2130
+ _wrap_RS_BLOCKINFO_ncDataCodeWord_set(int argc, VALUE *argv, VALUE self) {
2131
+ RS_BLOCKINFO *arg1 = (RS_BLOCKINFO *) 0 ;
2132
+ int arg2 ;
2133
+ void *argp1 = 0 ;
2134
+ int res1 = 0 ;
2135
+ int val2 ;
2136
+ int ecode2 = 0 ;
2137
+
2138
+ if ((argc < 1) || (argc > 1)) {
2139
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2140
+ }
2141
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_tagRS_BLOCKINFO, 0 | 0 );
2142
+ if (!SWIG_IsOK(res1)) {
2143
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "RS_BLOCKINFO *","ncDataCodeWord", 1, self ));
2144
+ }
2145
+ arg1 = reinterpret_cast< RS_BLOCKINFO * >(argp1);
2146
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
2147
+ if (!SWIG_IsOK(ecode2)) {
2148
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","ncDataCodeWord", 2, argv[0] ));
2149
+ }
2150
+ arg2 = static_cast< int >(val2);
2151
+ if (arg1) (arg1)->ncDataCodeWord = arg2;
2152
+ return Qnil;
2153
+ fail:
2154
+ return Qnil;
2155
+ }
2156
+
2157
+
2158
+ SWIGINTERN VALUE
2159
+ _wrap_RS_BLOCKINFO_ncDataCodeWord_get(int argc, VALUE *argv, VALUE self) {
2160
+ RS_BLOCKINFO *arg1 = (RS_BLOCKINFO *) 0 ;
2161
+ void *argp1 = 0 ;
2162
+ int res1 = 0 ;
2163
+ int result;
2164
+ VALUE vresult = Qnil;
2165
+
2166
+ if ((argc < 0) || (argc > 0)) {
2167
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2168
+ }
2169
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_tagRS_BLOCKINFO, 0 | 0 );
2170
+ if (!SWIG_IsOK(res1)) {
2171
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "RS_BLOCKINFO *","ncDataCodeWord", 1, self ));
2172
+ }
2173
+ arg1 = reinterpret_cast< RS_BLOCKINFO * >(argp1);
2174
+ result = (int) ((arg1)->ncDataCodeWord);
2175
+ vresult = SWIG_From_int(static_cast< int >(result));
2176
+ return vresult;
2177
+ fail:
2178
+ return Qnil;
2179
+ }
2180
+
2181
+
2182
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
2183
+ SWIGINTERN VALUE
2184
+ _wrap_RS_BLOCKINFO_allocate(VALUE self) {
2185
+ #else
2186
+ SWIGINTERN VALUE
2187
+ _wrap_RS_BLOCKINFO_allocate(int argc, VALUE *argv, VALUE self) {
2188
+ #endif
2189
+
2190
+
2191
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_tagRS_BLOCKINFO);
2192
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
2193
+ rb_obj_call_init(vresult, argc, argv);
2194
+ #endif
2195
+ return vresult;
2196
+ }
2197
+
2198
+
2199
+ SWIGINTERN VALUE
2200
+ _wrap_new_RS_BLOCKINFO(int argc, VALUE *argv, VALUE self) {
2201
+ RS_BLOCKINFO *result = 0 ;
2202
+
2203
+ if ((argc < 0) || (argc > 0)) {
2204
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2205
+ }
2206
+ result = (RS_BLOCKINFO *)new RS_BLOCKINFO();
2207
+ DATA_PTR(self) = result;
2208
+ return self;
2209
+ fail:
2210
+ return Qnil;
2211
+ }
2212
+
2213
+
2214
+ SWIGINTERN void
2215
+ free_RS_BLOCKINFO(RS_BLOCKINFO *arg1) {
2216
+ delete arg1;
2217
+ }
2218
+
2219
+ swig_class SwigClassQR_VERSIONINFO;
2220
+
2221
+ SWIGINTERN VALUE
2222
+ _wrap_QR_VERSIONINFO_nVersionNo_set(int argc, VALUE *argv, VALUE self) {
2223
+ QR_VERSIONINFO *arg1 = (QR_VERSIONINFO *) 0 ;
2224
+ int arg2 ;
2225
+ void *argp1 = 0 ;
2226
+ int res1 = 0 ;
2227
+ int val2 ;
2228
+ int ecode2 = 0 ;
2229
+
2230
+ if ((argc < 1) || (argc > 1)) {
2231
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2232
+ }
2233
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_tagQR_VERSIONINFO, 0 | 0 );
2234
+ if (!SWIG_IsOK(res1)) {
2235
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "QR_VERSIONINFO *","nVersionNo", 1, self ));
2236
+ }
2237
+ arg1 = reinterpret_cast< QR_VERSIONINFO * >(argp1);
2238
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
2239
+ if (!SWIG_IsOK(ecode2)) {
2240
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","nVersionNo", 2, argv[0] ));
2241
+ }
2242
+ arg2 = static_cast< int >(val2);
2243
+ if (arg1) (arg1)->nVersionNo = arg2;
2244
+ return Qnil;
2245
+ fail:
2246
+ return Qnil;
2247
+ }
2248
+
2249
+
2250
+ SWIGINTERN VALUE
2251
+ _wrap_QR_VERSIONINFO_nVersionNo_get(int argc, VALUE *argv, VALUE self) {
2252
+ QR_VERSIONINFO *arg1 = (QR_VERSIONINFO *) 0 ;
2253
+ void *argp1 = 0 ;
2254
+ int res1 = 0 ;
2255
+ int result;
2256
+ VALUE vresult = Qnil;
2257
+
2258
+ if ((argc < 0) || (argc > 0)) {
2259
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2260
+ }
2261
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_tagQR_VERSIONINFO, 0 | 0 );
2262
+ if (!SWIG_IsOK(res1)) {
2263
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "QR_VERSIONINFO *","nVersionNo", 1, self ));
2264
+ }
2265
+ arg1 = reinterpret_cast< QR_VERSIONINFO * >(argp1);
2266
+ result = (int) ((arg1)->nVersionNo);
2267
+ vresult = SWIG_From_int(static_cast< int >(result));
2268
+ return vresult;
2269
+ fail:
2270
+ return Qnil;
2271
+ }
2272
+
2273
+
2274
+ SWIGINTERN VALUE
2275
+ _wrap_QR_VERSIONINFO_ncAllCodeWord_set(int argc, VALUE *argv, VALUE self) {
2276
+ QR_VERSIONINFO *arg1 = (QR_VERSIONINFO *) 0 ;
2277
+ int arg2 ;
2278
+ void *argp1 = 0 ;
2279
+ int res1 = 0 ;
2280
+ int val2 ;
2281
+ int ecode2 = 0 ;
2282
+
2283
+ if ((argc < 1) || (argc > 1)) {
2284
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2285
+ }
2286
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_tagQR_VERSIONINFO, 0 | 0 );
2287
+ if (!SWIG_IsOK(res1)) {
2288
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "QR_VERSIONINFO *","ncAllCodeWord", 1, self ));
2289
+ }
2290
+ arg1 = reinterpret_cast< QR_VERSIONINFO * >(argp1);
2291
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
2292
+ if (!SWIG_IsOK(ecode2)) {
2293
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","ncAllCodeWord", 2, argv[0] ));
2294
+ }
2295
+ arg2 = static_cast< int >(val2);
2296
+ if (arg1) (arg1)->ncAllCodeWord = arg2;
2297
+ return Qnil;
2298
+ fail:
2299
+ return Qnil;
2300
+ }
2301
+
2302
+
2303
+ SWIGINTERN VALUE
2304
+ _wrap_QR_VERSIONINFO_ncAllCodeWord_get(int argc, VALUE *argv, VALUE self) {
2305
+ QR_VERSIONINFO *arg1 = (QR_VERSIONINFO *) 0 ;
2306
+ void *argp1 = 0 ;
2307
+ int res1 = 0 ;
2308
+ int result;
2309
+ VALUE vresult = Qnil;
2310
+
2311
+ if ((argc < 0) || (argc > 0)) {
2312
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2313
+ }
2314
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_tagQR_VERSIONINFO, 0 | 0 );
2315
+ if (!SWIG_IsOK(res1)) {
2316
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "QR_VERSIONINFO *","ncAllCodeWord", 1, self ));
2317
+ }
2318
+ arg1 = reinterpret_cast< QR_VERSIONINFO * >(argp1);
2319
+ result = (int) ((arg1)->ncAllCodeWord);
2320
+ vresult = SWIG_From_int(static_cast< int >(result));
2321
+ return vresult;
2322
+ fail:
2323
+ return Qnil;
2324
+ }
2325
+
2326
+
2327
+ SWIGINTERN VALUE
2328
+ _wrap_QR_VERSIONINFO_ncDataCodeWord_set(int argc, VALUE *argv, VALUE self) {
2329
+ QR_VERSIONINFO *arg1 = (QR_VERSIONINFO *) 0 ;
2330
+ int *arg2 ;
2331
+ void *argp1 = 0 ;
2332
+ int res1 = 0 ;
2333
+ void *argp2 = 0 ;
2334
+ int res2 = 0 ;
2335
+
2336
+ if ((argc < 1) || (argc > 1)) {
2337
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2338
+ }
2339
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_tagQR_VERSIONINFO, 0 | 0 );
2340
+ if (!SWIG_IsOK(res1)) {
2341
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "QR_VERSIONINFO *","ncDataCodeWord", 1, self ));
2342
+ }
2343
+ arg1 = reinterpret_cast< QR_VERSIONINFO * >(argp1);
2344
+ res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_int, 0 | 0 );
2345
+ if (!SWIG_IsOK(res2)) {
2346
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "int [4]","ncDataCodeWord", 2, argv[0] ));
2347
+ }
2348
+ arg2 = reinterpret_cast< int * >(argp2);
2349
+ {
2350
+ if (arg2) {
2351
+ size_t ii = 0;
2352
+ for (; ii < (size_t)4; ++ii) arg1->ncDataCodeWord[ii] = arg2[ii];
2353
+ } else {
2354
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""ncDataCodeWord""' of type '""int [4]""'");
2355
+ }
2356
+ }
2357
+ return Qnil;
2358
+ fail:
2359
+ return Qnil;
2360
+ }
2361
+
2362
+
2363
+ SWIGINTERN VALUE
2364
+ _wrap_QR_VERSIONINFO_ncDataCodeWord_get(int argc, VALUE *argv, VALUE self) {
2365
+ QR_VERSIONINFO *arg1 = (QR_VERSIONINFO *) 0 ;
2366
+ void *argp1 = 0 ;
2367
+ int res1 = 0 ;
2368
+ int *result = 0 ;
2369
+ VALUE vresult = Qnil;
2370
+
2371
+ if ((argc < 0) || (argc > 0)) {
2372
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2373
+ }
2374
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_tagQR_VERSIONINFO, 0 | 0 );
2375
+ if (!SWIG_IsOK(res1)) {
2376
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "QR_VERSIONINFO *","ncDataCodeWord", 1, self ));
2377
+ }
2378
+ arg1 = reinterpret_cast< QR_VERSIONINFO * >(argp1);
2379
+ result = (int *)(int *) ((arg1)->ncDataCodeWord);
2380
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int, 0 | 0 );
2381
+ return vresult;
2382
+ fail:
2383
+ return Qnil;
2384
+ }
2385
+
2386
+
2387
+ SWIGINTERN VALUE
2388
+ _wrap_QR_VERSIONINFO_ncAlignPoint_set(int argc, VALUE *argv, VALUE self) {
2389
+ QR_VERSIONINFO *arg1 = (QR_VERSIONINFO *) 0 ;
2390
+ int arg2 ;
2391
+ void *argp1 = 0 ;
2392
+ int res1 = 0 ;
2393
+ int val2 ;
2394
+ int ecode2 = 0 ;
2395
+
2396
+ if ((argc < 1) || (argc > 1)) {
2397
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2398
+ }
2399
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_tagQR_VERSIONINFO, 0 | 0 );
2400
+ if (!SWIG_IsOK(res1)) {
2401
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "QR_VERSIONINFO *","ncAlignPoint", 1, self ));
2402
+ }
2403
+ arg1 = reinterpret_cast< QR_VERSIONINFO * >(argp1);
2404
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
2405
+ if (!SWIG_IsOK(ecode2)) {
2406
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","ncAlignPoint", 2, argv[0] ));
2407
+ }
2408
+ arg2 = static_cast< int >(val2);
2409
+ if (arg1) (arg1)->ncAlignPoint = arg2;
2410
+ return Qnil;
2411
+ fail:
2412
+ return Qnil;
2413
+ }
2414
+
2415
+
2416
+ SWIGINTERN VALUE
2417
+ _wrap_QR_VERSIONINFO_ncAlignPoint_get(int argc, VALUE *argv, VALUE self) {
2418
+ QR_VERSIONINFO *arg1 = (QR_VERSIONINFO *) 0 ;
2419
+ void *argp1 = 0 ;
2420
+ int res1 = 0 ;
2421
+ int result;
2422
+ VALUE vresult = Qnil;
2423
+
2424
+ if ((argc < 0) || (argc > 0)) {
2425
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2426
+ }
2427
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_tagQR_VERSIONINFO, 0 | 0 );
2428
+ if (!SWIG_IsOK(res1)) {
2429
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "QR_VERSIONINFO *","ncAlignPoint", 1, self ));
2430
+ }
2431
+ arg1 = reinterpret_cast< QR_VERSIONINFO * >(argp1);
2432
+ result = (int) ((arg1)->ncAlignPoint);
2433
+ vresult = SWIG_From_int(static_cast< int >(result));
2434
+ return vresult;
2435
+ fail:
2436
+ return Qnil;
2437
+ }
2438
+
2439
+
2440
+ SWIGINTERN VALUE
2441
+ _wrap_QR_VERSIONINFO_nAlignPoint_set(int argc, VALUE *argv, VALUE self) {
2442
+ QR_VERSIONINFO *arg1 = (QR_VERSIONINFO *) 0 ;
2443
+ int *arg2 ;
2444
+ void *argp1 = 0 ;
2445
+ int res1 = 0 ;
2446
+ void *argp2 = 0 ;
2447
+ int res2 = 0 ;
2448
+
2449
+ if ((argc < 1) || (argc > 1)) {
2450
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2451
+ }
2452
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_tagQR_VERSIONINFO, 0 | 0 );
2453
+ if (!SWIG_IsOK(res1)) {
2454
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "QR_VERSIONINFO *","nAlignPoint", 1, self ));
2455
+ }
2456
+ arg1 = reinterpret_cast< QR_VERSIONINFO * >(argp1);
2457
+ res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_int, 0 | 0 );
2458
+ if (!SWIG_IsOK(res2)) {
2459
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "int [6]","nAlignPoint", 2, argv[0] ));
2460
+ }
2461
+ arg2 = reinterpret_cast< int * >(argp2);
2462
+ {
2463
+ if (arg2) {
2464
+ size_t ii = 0;
2465
+ for (; ii < (size_t)6; ++ii) arg1->nAlignPoint[ii] = arg2[ii];
2466
+ } else {
2467
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""nAlignPoint""' of type '""int [6]""'");
2468
+ }
2469
+ }
2470
+ return Qnil;
2471
+ fail:
2472
+ return Qnil;
2473
+ }
2474
+
2475
+
2476
+ SWIGINTERN VALUE
2477
+ _wrap_QR_VERSIONINFO_nAlignPoint_get(int argc, VALUE *argv, VALUE self) {
2478
+ QR_VERSIONINFO *arg1 = (QR_VERSIONINFO *) 0 ;
2479
+ void *argp1 = 0 ;
2480
+ int res1 = 0 ;
2481
+ int *result = 0 ;
2482
+ VALUE vresult = Qnil;
2483
+
2484
+ if ((argc < 0) || (argc > 0)) {
2485
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2486
+ }
2487
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_tagQR_VERSIONINFO, 0 | 0 );
2488
+ if (!SWIG_IsOK(res1)) {
2489
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "QR_VERSIONINFO *","nAlignPoint", 1, self ));
2490
+ }
2491
+ arg1 = reinterpret_cast< QR_VERSIONINFO * >(argp1);
2492
+ result = (int *)(int *) ((arg1)->nAlignPoint);
2493
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int, 0 | 0 );
2494
+ return vresult;
2495
+ fail:
2496
+ return Qnil;
2497
+ }
2498
+
2499
+
2500
+ SWIGINTERN VALUE
2501
+ _wrap_QR_VERSIONINFO_RS_BlockInfo1_set(int argc, VALUE *argv, VALUE self) {
2502
+ QR_VERSIONINFO *arg1 = (QR_VERSIONINFO *) 0 ;
2503
+ RS_BLOCKINFO *arg2 ;
2504
+ void *argp1 = 0 ;
2505
+ int res1 = 0 ;
2506
+ void *argp2 = 0 ;
2507
+ int res2 = 0 ;
2508
+
2509
+ if ((argc < 1) || (argc > 1)) {
2510
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2511
+ }
2512
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_tagQR_VERSIONINFO, 0 | 0 );
2513
+ if (!SWIG_IsOK(res1)) {
2514
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "QR_VERSIONINFO *","RS_BlockInfo1", 1, self ));
2515
+ }
2516
+ arg1 = reinterpret_cast< QR_VERSIONINFO * >(argp1);
2517
+ res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_tagRS_BLOCKINFO, 0 | 0 );
2518
+ if (!SWIG_IsOK(res2)) {
2519
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "RS_BLOCKINFO [4]","RS_BlockInfo1", 2, argv[0] ));
2520
+ }
2521
+ arg2 = reinterpret_cast< RS_BLOCKINFO * >(argp2);
2522
+ {
2523
+ if (arg2) {
2524
+ size_t ii = 0;
2525
+ for (; ii < (size_t)4; ++ii) arg1->RS_BlockInfo1[ii] = arg2[ii];
2526
+ } else {
2527
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""RS_BlockInfo1""' of type '""RS_BLOCKINFO [4]""'");
2528
+ }
2529
+ }
2530
+ return Qnil;
2531
+ fail:
2532
+ return Qnil;
2533
+ }
2534
+
2535
+
2536
+ SWIGINTERN VALUE
2537
+ _wrap_QR_VERSIONINFO_RS_BlockInfo1_get(int argc, VALUE *argv, VALUE self) {
2538
+ QR_VERSIONINFO *arg1 = (QR_VERSIONINFO *) 0 ;
2539
+ void *argp1 = 0 ;
2540
+ int res1 = 0 ;
2541
+ RS_BLOCKINFO *result = 0 ;
2542
+ VALUE vresult = Qnil;
2543
+
2544
+ if ((argc < 0) || (argc > 0)) {
2545
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2546
+ }
2547
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_tagQR_VERSIONINFO, 0 | 0 );
2548
+ if (!SWIG_IsOK(res1)) {
2549
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "QR_VERSIONINFO *","RS_BlockInfo1", 1, self ));
2550
+ }
2551
+ arg1 = reinterpret_cast< QR_VERSIONINFO * >(argp1);
2552
+ result = (RS_BLOCKINFO *)(RS_BLOCKINFO *) ((arg1)->RS_BlockInfo1);
2553
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_tagRS_BLOCKINFO, 0 | 0 );
2554
+ return vresult;
2555
+ fail:
2556
+ return Qnil;
2557
+ }
2558
+
2559
+
2560
+ SWIGINTERN VALUE
2561
+ _wrap_QR_VERSIONINFO_RS_BlockInfo2_set(int argc, VALUE *argv, VALUE self) {
2562
+ QR_VERSIONINFO *arg1 = (QR_VERSIONINFO *) 0 ;
2563
+ RS_BLOCKINFO *arg2 ;
2564
+ void *argp1 = 0 ;
2565
+ int res1 = 0 ;
2566
+ void *argp2 = 0 ;
2567
+ int res2 = 0 ;
2568
+
2569
+ if ((argc < 1) || (argc > 1)) {
2570
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2571
+ }
2572
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_tagQR_VERSIONINFO, 0 | 0 );
2573
+ if (!SWIG_IsOK(res1)) {
2574
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "QR_VERSIONINFO *","RS_BlockInfo2", 1, self ));
2575
+ }
2576
+ arg1 = reinterpret_cast< QR_VERSIONINFO * >(argp1);
2577
+ res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_tagRS_BLOCKINFO, 0 | 0 );
2578
+ if (!SWIG_IsOK(res2)) {
2579
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "RS_BLOCKINFO [4]","RS_BlockInfo2", 2, argv[0] ));
2580
+ }
2581
+ arg2 = reinterpret_cast< RS_BLOCKINFO * >(argp2);
2582
+ {
2583
+ if (arg2) {
2584
+ size_t ii = 0;
2585
+ for (; ii < (size_t)4; ++ii) arg1->RS_BlockInfo2[ii] = arg2[ii];
2586
+ } else {
2587
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""RS_BlockInfo2""' of type '""RS_BLOCKINFO [4]""'");
2588
+ }
2589
+ }
2590
+ return Qnil;
2591
+ fail:
2592
+ return Qnil;
2593
+ }
2594
+
2595
+
2596
+ SWIGINTERN VALUE
2597
+ _wrap_QR_VERSIONINFO_RS_BlockInfo2_get(int argc, VALUE *argv, VALUE self) {
2598
+ QR_VERSIONINFO *arg1 = (QR_VERSIONINFO *) 0 ;
2599
+ void *argp1 = 0 ;
2600
+ int res1 = 0 ;
2601
+ RS_BLOCKINFO *result = 0 ;
2602
+ VALUE vresult = Qnil;
2603
+
2604
+ if ((argc < 0) || (argc > 0)) {
2605
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2606
+ }
2607
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_tagQR_VERSIONINFO, 0 | 0 );
2608
+ if (!SWIG_IsOK(res1)) {
2609
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "QR_VERSIONINFO *","RS_BlockInfo2", 1, self ));
2610
+ }
2611
+ arg1 = reinterpret_cast< QR_VERSIONINFO * >(argp1);
2612
+ result = (RS_BLOCKINFO *)(RS_BLOCKINFO *) ((arg1)->RS_BlockInfo2);
2613
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_tagRS_BLOCKINFO, 0 | 0 );
2614
+ return vresult;
2615
+ fail:
2616
+ return Qnil;
2617
+ }
2618
+
2619
+
2620
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
2621
+ SWIGINTERN VALUE
2622
+ _wrap_QR_VERSIONINFO_allocate(VALUE self) {
2623
+ #else
2624
+ SWIGINTERN VALUE
2625
+ _wrap_QR_VERSIONINFO_allocate(int argc, VALUE *argv, VALUE self) {
2626
+ #endif
2627
+
2628
+
2629
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_tagQR_VERSIONINFO);
2630
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
2631
+ rb_obj_call_init(vresult, argc, argv);
2632
+ #endif
2633
+ return vresult;
2634
+ }
2635
+
2636
+
2637
+ SWIGINTERN VALUE
2638
+ _wrap_new_QR_VERSIONINFO(int argc, VALUE *argv, VALUE self) {
2639
+ QR_VERSIONINFO *result = 0 ;
2640
+
2641
+ if ((argc < 0) || (argc > 0)) {
2642
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2643
+ }
2644
+ result = (QR_VERSIONINFO *)new QR_VERSIONINFO();
2645
+ DATA_PTR(self) = result;
2646
+ return self;
2647
+ fail:
2648
+ return Qnil;
2649
+ }
2650
+
2651
+
2652
+ SWIGINTERN void
2653
+ free_QR_VERSIONINFO(QR_VERSIONINFO *arg1) {
2654
+ delete arg1;
2655
+ }
2656
+
2657
+ swig_class SwigClassCQR_Encode;
2658
+
2659
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
2660
+ SWIGINTERN VALUE
2661
+ _wrap_CQR_Encode_allocate(VALUE self) {
2662
+ #else
2663
+ SWIGINTERN VALUE
2664
+ _wrap_CQR_Encode_allocate(int argc, VALUE *argv, VALUE self) {
2665
+ #endif
2666
+
2667
+
2668
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_CQR_Encode);
2669
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
2670
+ rb_obj_call_init(vresult, argc, argv);
2671
+ #endif
2672
+ return vresult;
2673
+ }
2674
+
2675
+
2676
+ SWIGINTERN VALUE
2677
+ _wrap_new_CQR_Encode(int argc, VALUE *argv, VALUE self) {
2678
+ CQR_Encode *result = 0 ;
2679
+
2680
+ if ((argc < 0) || (argc > 0)) {
2681
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2682
+ }
2683
+ result = (CQR_Encode *)new CQR_Encode();
2684
+ DATA_PTR(self) = result;
2685
+ return self;
2686
+ fail:
2687
+ return Qnil;
2688
+ }
2689
+
2690
+
2691
+ SWIGINTERN void
2692
+ free_CQR_Encode(CQR_Encode *arg1) {
2693
+ delete arg1;
2694
+ }
2695
+
2696
+ SWIGINTERN VALUE
2697
+ _wrap_CQR_Encode_m_nLevel_set(int argc, VALUE *argv, VALUE self) {
2698
+ CQR_Encode *arg1 = (CQR_Encode *) 0 ;
2699
+ int arg2 ;
2700
+ void *argp1 = 0 ;
2701
+ int res1 = 0 ;
2702
+ int val2 ;
2703
+ int ecode2 = 0 ;
2704
+
2705
+ if ((argc < 1) || (argc > 1)) {
2706
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2707
+ }
2708
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CQR_Encode, 0 | 0 );
2709
+ if (!SWIG_IsOK(res1)) {
2710
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CQR_Encode *","m_nLevel", 1, self ));
2711
+ }
2712
+ arg1 = reinterpret_cast< CQR_Encode * >(argp1);
2713
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
2714
+ if (!SWIG_IsOK(ecode2)) {
2715
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","m_nLevel", 2, argv[0] ));
2716
+ }
2717
+ arg2 = static_cast< int >(val2);
2718
+ if (arg1) (arg1)->m_nLevel = arg2;
2719
+ return Qnil;
2720
+ fail:
2721
+ return Qnil;
2722
+ }
2723
+
2724
+
2725
+ SWIGINTERN VALUE
2726
+ _wrap_CQR_Encode_m_nLevel_get(int argc, VALUE *argv, VALUE self) {
2727
+ CQR_Encode *arg1 = (CQR_Encode *) 0 ;
2728
+ void *argp1 = 0 ;
2729
+ int res1 = 0 ;
2730
+ int result;
2731
+ VALUE vresult = Qnil;
2732
+
2733
+ if ((argc < 0) || (argc > 0)) {
2734
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2735
+ }
2736
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CQR_Encode, 0 | 0 );
2737
+ if (!SWIG_IsOK(res1)) {
2738
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CQR_Encode *","m_nLevel", 1, self ));
2739
+ }
2740
+ arg1 = reinterpret_cast< CQR_Encode * >(argp1);
2741
+ result = (int) ((arg1)->m_nLevel);
2742
+ vresult = SWIG_From_int(static_cast< int >(result));
2743
+ return vresult;
2744
+ fail:
2745
+ return Qnil;
2746
+ }
2747
+
2748
+
2749
+ SWIGINTERN VALUE
2750
+ _wrap_CQR_Encode_m_nVersion_set(int argc, VALUE *argv, VALUE self) {
2751
+ CQR_Encode *arg1 = (CQR_Encode *) 0 ;
2752
+ int arg2 ;
2753
+ void *argp1 = 0 ;
2754
+ int res1 = 0 ;
2755
+ int val2 ;
2756
+ int ecode2 = 0 ;
2757
+
2758
+ if ((argc < 1) || (argc > 1)) {
2759
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2760
+ }
2761
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CQR_Encode, 0 | 0 );
2762
+ if (!SWIG_IsOK(res1)) {
2763
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CQR_Encode *","m_nVersion", 1, self ));
2764
+ }
2765
+ arg1 = reinterpret_cast< CQR_Encode * >(argp1);
2766
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
2767
+ if (!SWIG_IsOK(ecode2)) {
2768
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","m_nVersion", 2, argv[0] ));
2769
+ }
2770
+ arg2 = static_cast< int >(val2);
2771
+ if (arg1) (arg1)->m_nVersion = arg2;
2772
+ return Qnil;
2773
+ fail:
2774
+ return Qnil;
2775
+ }
2776
+
2777
+
2778
+ SWIGINTERN VALUE
2779
+ _wrap_CQR_Encode_m_nVersion_get(int argc, VALUE *argv, VALUE self) {
2780
+ CQR_Encode *arg1 = (CQR_Encode *) 0 ;
2781
+ void *argp1 = 0 ;
2782
+ int res1 = 0 ;
2783
+ int result;
2784
+ VALUE vresult = Qnil;
2785
+
2786
+ if ((argc < 0) || (argc > 0)) {
2787
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2788
+ }
2789
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CQR_Encode, 0 | 0 );
2790
+ if (!SWIG_IsOK(res1)) {
2791
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CQR_Encode *","m_nVersion", 1, self ));
2792
+ }
2793
+ arg1 = reinterpret_cast< CQR_Encode * >(argp1);
2794
+ result = (int) ((arg1)->m_nVersion);
2795
+ vresult = SWIG_From_int(static_cast< int >(result));
2796
+ return vresult;
2797
+ fail:
2798
+ return Qnil;
2799
+ }
2800
+
2801
+
2802
+ SWIGINTERN VALUE
2803
+ _wrap_CQR_Encode_m_bAutoExtent_set(int argc, VALUE *argv, VALUE self) {
2804
+ CQR_Encode *arg1 = (CQR_Encode *) 0 ;
2805
+ BOOL arg2 ;
2806
+ void *argp1 = 0 ;
2807
+ int res1 = 0 ;
2808
+ bool val2 ;
2809
+ int ecode2 = 0 ;
2810
+
2811
+ if ((argc < 1) || (argc > 1)) {
2812
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2813
+ }
2814
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CQR_Encode, 0 | 0 );
2815
+ if (!SWIG_IsOK(res1)) {
2816
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CQR_Encode *","m_bAutoExtent", 1, self ));
2817
+ }
2818
+ arg1 = reinterpret_cast< CQR_Encode * >(argp1);
2819
+ ecode2 = SWIG_AsVal_bool(argv[0], &val2);
2820
+ if (!SWIG_IsOK(ecode2)) {
2821
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "BOOL","m_bAutoExtent", 2, argv[0] ));
2822
+ }
2823
+ arg2 = static_cast< BOOL >(val2);
2824
+ if (arg1) (arg1)->m_bAutoExtent = arg2;
2825
+ return Qnil;
2826
+ fail:
2827
+ return Qnil;
2828
+ }
2829
+
2830
+
2831
+ SWIGINTERN VALUE
2832
+ _wrap_CQR_Encode_m_bAutoExtent_get(int argc, VALUE *argv, VALUE self) {
2833
+ CQR_Encode *arg1 = (CQR_Encode *) 0 ;
2834
+ void *argp1 = 0 ;
2835
+ int res1 = 0 ;
2836
+ BOOL result;
2837
+ VALUE vresult = Qnil;
2838
+
2839
+ if ((argc < 0) || (argc > 0)) {
2840
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2841
+ }
2842
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CQR_Encode, 0 | 0 );
2843
+ if (!SWIG_IsOK(res1)) {
2844
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CQR_Encode *","m_bAutoExtent", 1, self ));
2845
+ }
2846
+ arg1 = reinterpret_cast< CQR_Encode * >(argp1);
2847
+ result = (BOOL) ((arg1)->m_bAutoExtent);
2848
+ vresult = SWIG_From_bool(static_cast< bool >(result));
2849
+ return vresult;
2850
+ fail:
2851
+ return Qnil;
2852
+ }
2853
+
2854
+
2855
+ SWIGINTERN VALUE
2856
+ _wrap_CQR_Encode_m_nMaskingNo_set(int argc, VALUE *argv, VALUE self) {
2857
+ CQR_Encode *arg1 = (CQR_Encode *) 0 ;
2858
+ int arg2 ;
2859
+ void *argp1 = 0 ;
2860
+ int res1 = 0 ;
2861
+ int val2 ;
2862
+ int ecode2 = 0 ;
2863
+
2864
+ if ((argc < 1) || (argc > 1)) {
2865
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2866
+ }
2867
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CQR_Encode, 0 | 0 );
2868
+ if (!SWIG_IsOK(res1)) {
2869
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CQR_Encode *","m_nMaskingNo", 1, self ));
2870
+ }
2871
+ arg1 = reinterpret_cast< CQR_Encode * >(argp1);
2872
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
2873
+ if (!SWIG_IsOK(ecode2)) {
2874
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","m_nMaskingNo", 2, argv[0] ));
2875
+ }
2876
+ arg2 = static_cast< int >(val2);
2877
+ if (arg1) (arg1)->m_nMaskingNo = arg2;
2878
+ return Qnil;
2879
+ fail:
2880
+ return Qnil;
2881
+ }
2882
+
2883
+
2884
+ SWIGINTERN VALUE
2885
+ _wrap_CQR_Encode_m_nMaskingNo_get(int argc, VALUE *argv, VALUE self) {
2886
+ CQR_Encode *arg1 = (CQR_Encode *) 0 ;
2887
+ void *argp1 = 0 ;
2888
+ int res1 = 0 ;
2889
+ int result;
2890
+ VALUE vresult = Qnil;
2891
+
2892
+ if ((argc < 0) || (argc > 0)) {
2893
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2894
+ }
2895
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CQR_Encode, 0 | 0 );
2896
+ if (!SWIG_IsOK(res1)) {
2897
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CQR_Encode *","m_nMaskingNo", 1, self ));
2898
+ }
2899
+ arg1 = reinterpret_cast< CQR_Encode * >(argp1);
2900
+ result = (int) ((arg1)->m_nMaskingNo);
2901
+ vresult = SWIG_From_int(static_cast< int >(result));
2902
+ return vresult;
2903
+ fail:
2904
+ return Qnil;
2905
+ }
2906
+
2907
+
2908
+ SWIGINTERN VALUE
2909
+ _wrap_CQR_Encode_m_nSymbleSize_set(int argc, VALUE *argv, VALUE self) {
2910
+ CQR_Encode *arg1 = (CQR_Encode *) 0 ;
2911
+ int arg2 ;
2912
+ void *argp1 = 0 ;
2913
+ int res1 = 0 ;
2914
+ int val2 ;
2915
+ int ecode2 = 0 ;
2916
+
2917
+ if ((argc < 1) || (argc > 1)) {
2918
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2919
+ }
2920
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CQR_Encode, 0 | 0 );
2921
+ if (!SWIG_IsOK(res1)) {
2922
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CQR_Encode *","m_nSymbleSize", 1, self ));
2923
+ }
2924
+ arg1 = reinterpret_cast< CQR_Encode * >(argp1);
2925
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
2926
+ if (!SWIG_IsOK(ecode2)) {
2927
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","m_nSymbleSize", 2, argv[0] ));
2928
+ }
2929
+ arg2 = static_cast< int >(val2);
2930
+ if (arg1) (arg1)->m_nSymbleSize = arg2;
2931
+ return Qnil;
2932
+ fail:
2933
+ return Qnil;
2934
+ }
2935
+
2936
+
2937
+ SWIGINTERN VALUE
2938
+ _wrap_CQR_Encode_m_nSymbleSize_get(int argc, VALUE *argv, VALUE self) {
2939
+ CQR_Encode *arg1 = (CQR_Encode *) 0 ;
2940
+ void *argp1 = 0 ;
2941
+ int res1 = 0 ;
2942
+ int result;
2943
+ VALUE vresult = Qnil;
2944
+
2945
+ if ((argc < 0) || (argc > 0)) {
2946
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2947
+ }
2948
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CQR_Encode, 0 | 0 );
2949
+ if (!SWIG_IsOK(res1)) {
2950
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CQR_Encode *","m_nSymbleSize", 1, self ));
2951
+ }
2952
+ arg1 = reinterpret_cast< CQR_Encode * >(argp1);
2953
+ result = (int) ((arg1)->m_nSymbleSize);
2954
+ vresult = SWIG_From_int(static_cast< int >(result));
2955
+ return vresult;
2956
+ fail:
2957
+ return Qnil;
2958
+ }
2959
+
2960
+
2961
+ SWIGINTERN VALUE
2962
+ _wrap_CQR_Encode_m_byModuleData_set(int argc, VALUE *argv, VALUE self) {
2963
+ CQR_Encode *arg1 = (CQR_Encode *) 0 ;
2964
+ BYTE (*arg2)[177] ;
2965
+ void *argp1 = 0 ;
2966
+ int res1 = 0 ;
2967
+ void *argp2 = 0 ;
2968
+ int res2 = 0 ;
2969
+
2970
+ if ((argc < 1) || (argc > 1)) {
2971
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2972
+ }
2973
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CQR_Encode, 0 | 0 );
2974
+ if (!SWIG_IsOK(res1)) {
2975
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CQR_Encode *","m_byModuleData", 1, self ));
2976
+ }
2977
+ arg1 = reinterpret_cast< CQR_Encode * >(argp1);
2978
+ res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_a_177__unsigned_char, 0 | 0 );
2979
+ if (!SWIG_IsOK(res2)) {
2980
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "BYTE [177][177]","m_byModuleData", 2, argv[0] ));
2981
+ }
2982
+ arg2 = reinterpret_cast< BYTE (*)[177] >(argp2);
2983
+ {
2984
+ if (arg2) {
2985
+ size_t ii = 0;
2986
+ for (; ii < (size_t)177; ++ii) {
2987
+ if (arg2[ii]) {
2988
+ size_t jj = 0;
2989
+ for (; jj < (size_t)177; ++jj) arg1->m_byModuleData[ii][jj] = arg2[ii][jj];
2990
+ } else {
2991
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""m_byModuleData""' of type '""BYTE [177][177]""'");
2992
+ }
2993
+ }
2994
+ } else {
2995
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""m_byModuleData""' of type '""BYTE [177][177]""'");
2996
+ }
2997
+ }
2998
+ return Qnil;
2999
+ fail:
3000
+ return Qnil;
3001
+ }
3002
+
3003
+
3004
+ SWIGINTERN VALUE
3005
+ _wrap_CQR_Encode_m_byModuleData_get(int argc, VALUE *argv, VALUE self) {
3006
+ CQR_Encode *arg1 = (CQR_Encode *) 0 ;
3007
+ void *argp1 = 0 ;
3008
+ int res1 = 0 ;
3009
+ BYTE (*result)[177] = 0 ;
3010
+ VALUE vresult = Qnil;
3011
+
3012
+ if ((argc < 0) || (argc > 0)) {
3013
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3014
+ }
3015
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CQR_Encode, 0 | 0 );
3016
+ if (!SWIG_IsOK(res1)) {
3017
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CQR_Encode *","m_byModuleData", 1, self ));
3018
+ }
3019
+ arg1 = reinterpret_cast< CQR_Encode * >(argp1);
3020
+ result = (BYTE (*)[177])(BYTE (*)[177]) ((arg1)->m_byModuleData);
3021
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_a_177__unsigned_char, 0 | 0 );
3022
+ return vresult;
3023
+ fail:
3024
+ return Qnil;
3025
+ }
3026
+
3027
+
3028
+ SWIGINTERN VALUE
3029
+ _wrap_CQR_Encode_EncodeData__SWIG_0(int argc, VALUE *argv, VALUE self) {
3030
+ CQR_Encode *arg1 = (CQR_Encode *) 0 ;
3031
+ int arg2 ;
3032
+ int arg3 ;
3033
+ BOOL arg4 ;
3034
+ int arg5 ;
3035
+ LPCSTR arg6 = (LPCSTR) 0 ;
3036
+ int arg7 ;
3037
+ void *argp1 = 0 ;
3038
+ int res1 = 0 ;
3039
+ int val2 ;
3040
+ int ecode2 = 0 ;
3041
+ int val3 ;
3042
+ int ecode3 = 0 ;
3043
+ bool val4 ;
3044
+ int ecode4 = 0 ;
3045
+ int val5 ;
3046
+ int ecode5 = 0 ;
3047
+ int res6 ;
3048
+ char *buf6 = 0 ;
3049
+ int alloc6 = 0 ;
3050
+ int val7 ;
3051
+ int ecode7 = 0 ;
3052
+ BOOL result;
3053
+ VALUE vresult = Qnil;
3054
+
3055
+ if ((argc < 6) || (argc > 6)) {
3056
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 6)",argc); SWIG_fail;
3057
+ }
3058
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CQR_Encode, 0 | 0 );
3059
+ if (!SWIG_IsOK(res1)) {
3060
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CQR_Encode *","EncodeData", 1, self ));
3061
+ }
3062
+ arg1 = reinterpret_cast< CQR_Encode * >(argp1);
3063
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
3064
+ if (!SWIG_IsOK(ecode2)) {
3065
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","EncodeData", 2, argv[0] ));
3066
+ }
3067
+ arg2 = static_cast< int >(val2);
3068
+ ecode3 = SWIG_AsVal_int(argv[1], &val3);
3069
+ if (!SWIG_IsOK(ecode3)) {
3070
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","EncodeData", 3, argv[1] ));
3071
+ }
3072
+ arg3 = static_cast< int >(val3);
3073
+ ecode4 = SWIG_AsVal_bool(argv[2], &val4);
3074
+ if (!SWIG_IsOK(ecode4)) {
3075
+ SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "BOOL","EncodeData", 4, argv[2] ));
3076
+ }
3077
+ arg4 = static_cast< BOOL >(val4);
3078
+ ecode5 = SWIG_AsVal_int(argv[3], &val5);
3079
+ if (!SWIG_IsOK(ecode5)) {
3080
+ SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "int","EncodeData", 5, argv[3] ));
3081
+ }
3082
+ arg5 = static_cast< int >(val5);
3083
+ res6 = SWIG_AsCharPtrAndSize(argv[4], &buf6, NULL, &alloc6);
3084
+ if (!SWIG_IsOK(res6)) {
3085
+ SWIG_exception_fail(SWIG_ArgError(res6), Ruby_Format_TypeError( "", "LPCSTR","EncodeData", 6, argv[4] ));
3086
+ }
3087
+ arg6 = reinterpret_cast< LPCSTR >(buf6);
3088
+ ecode7 = SWIG_AsVal_int(argv[5], &val7);
3089
+ if (!SWIG_IsOK(ecode7)) {
3090
+ SWIG_exception_fail(SWIG_ArgError(ecode7), Ruby_Format_TypeError( "", "int","EncodeData", 7, argv[5] ));
3091
+ }
3092
+ arg7 = static_cast< int >(val7);
3093
+ result = (BOOL)(arg1)->EncodeData(arg2,arg3,arg4,arg5,arg6,arg7);
3094
+ vresult = SWIG_From_bool(static_cast< bool >(result));
3095
+ if (alloc6 == SWIG_NEWOBJ) delete[] buf6;
3096
+ return vresult;
3097
+ fail:
3098
+ if (alloc6 == SWIG_NEWOBJ) delete[] buf6;
3099
+ return Qnil;
3100
+ }
3101
+
3102
+
3103
+ SWIGINTERN VALUE
3104
+ _wrap_CQR_Encode_EncodeData__SWIG_1(int argc, VALUE *argv, VALUE self) {
3105
+ CQR_Encode *arg1 = (CQR_Encode *) 0 ;
3106
+ int arg2 ;
3107
+ int arg3 ;
3108
+ BOOL arg4 ;
3109
+ int arg5 ;
3110
+ LPCSTR arg6 = (LPCSTR) 0 ;
3111
+ void *argp1 = 0 ;
3112
+ int res1 = 0 ;
3113
+ int val2 ;
3114
+ int ecode2 = 0 ;
3115
+ int val3 ;
3116
+ int ecode3 = 0 ;
3117
+ bool val4 ;
3118
+ int ecode4 = 0 ;
3119
+ int val5 ;
3120
+ int ecode5 = 0 ;
3121
+ int res6 ;
3122
+ char *buf6 = 0 ;
3123
+ int alloc6 = 0 ;
3124
+ BOOL result;
3125
+ VALUE vresult = Qnil;
3126
+
3127
+ if ((argc < 5) || (argc > 5)) {
3128
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 5)",argc); SWIG_fail;
3129
+ }
3130
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CQR_Encode, 0 | 0 );
3131
+ if (!SWIG_IsOK(res1)) {
3132
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CQR_Encode *","EncodeData", 1, self ));
3133
+ }
3134
+ arg1 = reinterpret_cast< CQR_Encode * >(argp1);
3135
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
3136
+ if (!SWIG_IsOK(ecode2)) {
3137
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","EncodeData", 2, argv[0] ));
3138
+ }
3139
+ arg2 = static_cast< int >(val2);
3140
+ ecode3 = SWIG_AsVal_int(argv[1], &val3);
3141
+ if (!SWIG_IsOK(ecode3)) {
3142
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","EncodeData", 3, argv[1] ));
3143
+ }
3144
+ arg3 = static_cast< int >(val3);
3145
+ ecode4 = SWIG_AsVal_bool(argv[2], &val4);
3146
+ if (!SWIG_IsOK(ecode4)) {
3147
+ SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "BOOL","EncodeData", 4, argv[2] ));
3148
+ }
3149
+ arg4 = static_cast< BOOL >(val4);
3150
+ ecode5 = SWIG_AsVal_int(argv[3], &val5);
3151
+ if (!SWIG_IsOK(ecode5)) {
3152
+ SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "int","EncodeData", 5, argv[3] ));
3153
+ }
3154
+ arg5 = static_cast< int >(val5);
3155
+ res6 = SWIG_AsCharPtrAndSize(argv[4], &buf6, NULL, &alloc6);
3156
+ if (!SWIG_IsOK(res6)) {
3157
+ SWIG_exception_fail(SWIG_ArgError(res6), Ruby_Format_TypeError( "", "LPCSTR","EncodeData", 6, argv[4] ));
3158
+ }
3159
+ arg6 = reinterpret_cast< LPCSTR >(buf6);
3160
+ result = (BOOL)(arg1)->EncodeData(arg2,arg3,arg4,arg5,arg6);
3161
+ vresult = SWIG_From_bool(static_cast< bool >(result));
3162
+ if (alloc6 == SWIG_NEWOBJ) delete[] buf6;
3163
+ return vresult;
3164
+ fail:
3165
+ if (alloc6 == SWIG_NEWOBJ) delete[] buf6;
3166
+ return Qnil;
3167
+ }
3168
+
3169
+
3170
+ SWIGINTERN VALUE _wrap_CQR_Encode_EncodeData(int nargs, VALUE *args, VALUE self) {
3171
+ int argc;
3172
+ VALUE argv[8];
3173
+ int ii;
3174
+
3175
+ argc = nargs + 1;
3176
+ argv[0] = self;
3177
+ if (argc > 8) SWIG_fail;
3178
+ for (ii = 1; (ii < argc); ++ii) {
3179
+ argv[ii] = args[ii-1];
3180
+ }
3181
+ if (argc == 6) {
3182
+ int _v;
3183
+ void *vptr = 0;
3184
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CQR_Encode, 0);
3185
+ _v = SWIG_CheckState(res);
3186
+ if (_v) {
3187
+ {
3188
+ int res = SWIG_AsVal_int(argv[1], NULL);
3189
+ _v = SWIG_CheckState(res);
3190
+ }
3191
+ if (_v) {
3192
+ {
3193
+ int res = SWIG_AsVal_int(argv[2], NULL);
3194
+ _v = SWIG_CheckState(res);
3195
+ }
3196
+ if (_v) {
3197
+ {
3198
+ int res = SWIG_AsVal_bool(argv[3], NULL);
3199
+ _v = SWIG_CheckState(res);
3200
+ }
3201
+ if (_v) {
3202
+ {
3203
+ int res = SWIG_AsVal_int(argv[4], NULL);
3204
+ _v = SWIG_CheckState(res);
3205
+ }
3206
+ if (_v) {
3207
+ int res = SWIG_AsCharPtrAndSize(argv[5], 0, NULL, 0);
3208
+ _v = SWIG_CheckState(res);
3209
+ if (_v) {
3210
+ return _wrap_CQR_Encode_EncodeData__SWIG_1(nargs, args, self);
3211
+ }
3212
+ }
3213
+ }
3214
+ }
3215
+ }
3216
+ }
3217
+ }
3218
+ if (argc == 7) {
3219
+ int _v;
3220
+ void *vptr = 0;
3221
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CQR_Encode, 0);
3222
+ _v = SWIG_CheckState(res);
3223
+ if (_v) {
3224
+ {
3225
+ int res = SWIG_AsVal_int(argv[1], NULL);
3226
+ _v = SWIG_CheckState(res);
3227
+ }
3228
+ if (_v) {
3229
+ {
3230
+ int res = SWIG_AsVal_int(argv[2], NULL);
3231
+ _v = SWIG_CheckState(res);
3232
+ }
3233
+ if (_v) {
3234
+ {
3235
+ int res = SWIG_AsVal_bool(argv[3], NULL);
3236
+ _v = SWIG_CheckState(res);
3237
+ }
3238
+ if (_v) {
3239
+ {
3240
+ int res = SWIG_AsVal_int(argv[4], NULL);
3241
+ _v = SWIG_CheckState(res);
3242
+ }
3243
+ if (_v) {
3244
+ int res = SWIG_AsCharPtrAndSize(argv[5], 0, NULL, 0);
3245
+ _v = SWIG_CheckState(res);
3246
+ if (_v) {
3247
+ {
3248
+ int res = SWIG_AsVal_int(argv[6], NULL);
3249
+ _v = SWIG_CheckState(res);
3250
+ }
3251
+ if (_v) {
3252
+ return _wrap_CQR_Encode_EncodeData__SWIG_0(nargs, args, self);
3253
+ }
3254
+ }
3255
+ }
3256
+ }
3257
+ }
3258
+ }
3259
+ }
3260
+ }
3261
+
3262
+ fail:
3263
+ Ruby_Format_OverloadedError( argc, 8, "CQR_Encode.EncodeData",
3264
+ " BOOL CQR_Encode.EncodeData(int nLevel, int nVersion, BOOL bAutoExtent, int nMaskingNo, LPCSTR lpsSource, int ncSource)\n"
3265
+ " BOOL CQR_Encode.EncodeData(int nLevel, int nVersion, BOOL bAutoExtent, int nMaskingNo, LPCSTR lpsSource)\n");
3266
+
3267
+ return Qnil;
3268
+ }
3269
+
3270
+
3271
+ SWIGINTERN VALUE
3272
+ _wrap_CQR_Encode_results(int argc, VALUE *argv, VALUE self) {
3273
+ CQR_Encode *arg1 = (CQR_Encode *) 0 ;
3274
+ void *argp1 = 0 ;
3275
+ int res1 = 0 ;
3276
+ VALUE result;
3277
+ VALUE vresult = Qnil;
3278
+
3279
+ if ((argc < 0) || (argc > 0)) {
3280
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3281
+ }
3282
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CQR_Encode, 0 | 0 );
3283
+ if (!SWIG_IsOK(res1)) {
3284
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CQR_Encode *","results", 1, self ));
3285
+ }
3286
+ arg1 = reinterpret_cast< CQR_Encode * >(argp1);
3287
+ result = (VALUE)CQR_Encode_results(arg1);
3288
+ vresult = result;
3289
+ return vresult;
3290
+ fail:
3291
+ return Qnil;
3292
+ }
3293
+
3294
+
3295
+
3296
+ /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
3297
+
3298
+ static swig_type_info _swigt__p_CQR_Encode = {"_p_CQR_Encode", "CQR_Encode *", 0, 0, (void*)0, 0};
3299
+ static swig_type_info _swigt__p_a_177__unsigned_char = {"_p_a_177__unsigned_char", "unsigned char (*)[177]|BYTE (*)[177]", 0, 0, (void*)0, 0};
3300
+ static swig_type_info _swigt__p_bool = {"_p_bool", "BOOL *|bool *", 0, 0, (void*)0, 0};
3301
+ static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
3302
+ static swig_type_info _swigt__p_int = {"_p_int", "int *", 0, 0, (void*)0, 0};
3303
+ static swig_type_info _swigt__p_tagQR_VERSIONINFO = {"_p_tagQR_VERSIONINFO", "tagQR_VERSIONINFO *|QR_VERSIONINFO *", 0, 0, (void*)0, 0};
3304
+ static swig_type_info _swigt__p_tagRS_BLOCKINFO = {"_p_tagRS_BLOCKINFO", "tagRS_BLOCKINFO *|RS_BLOCKINFO *", 0, 0, (void*)0, 0};
3305
+ static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "unsigned char *|BYTE *", 0, 0, (void*)0, 0};
3306
+ static swig_type_info _swigt__p_unsigned_short = {"_p_unsigned_short", "WORD *|unsigned short *", 0, 0, (void*)0, 0};
3307
+
3308
+ static swig_type_info *swig_type_initial[] = {
3309
+ &_swigt__p_CQR_Encode,
3310
+ &_swigt__p_a_177__unsigned_char,
3311
+ &_swigt__p_bool,
3312
+ &_swigt__p_char,
3313
+ &_swigt__p_int,
3314
+ &_swigt__p_tagQR_VERSIONINFO,
3315
+ &_swigt__p_tagRS_BLOCKINFO,
3316
+ &_swigt__p_unsigned_char,
3317
+ &_swigt__p_unsigned_short,
3318
+ };
3319
+
3320
+ static swig_cast_info _swigc__p_CQR_Encode[] = { {&_swigt__p_CQR_Encode, 0, 0, 0},{0, 0, 0, 0}};
3321
+ static swig_cast_info _swigc__p_a_177__unsigned_char[] = { {&_swigt__p_a_177__unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
3322
+ static swig_cast_info _swigc__p_bool[] = { {&_swigt__p_bool, 0, 0, 0},{0, 0, 0, 0}};
3323
+ static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
3324
+ static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
3325
+ static swig_cast_info _swigc__p_tagQR_VERSIONINFO[] = { {&_swigt__p_tagQR_VERSIONINFO, 0, 0, 0},{0, 0, 0, 0}};
3326
+ static swig_cast_info _swigc__p_tagRS_BLOCKINFO[] = { {&_swigt__p_tagRS_BLOCKINFO, 0, 0, 0},{0, 0, 0, 0}};
3327
+ static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
3328
+ static swig_cast_info _swigc__p_unsigned_short[] = { {&_swigt__p_unsigned_short, 0, 0, 0},{0, 0, 0, 0}};
3329
+
3330
+ static swig_cast_info *swig_cast_initial[] = {
3331
+ _swigc__p_CQR_Encode,
3332
+ _swigc__p_a_177__unsigned_char,
3333
+ _swigc__p_bool,
3334
+ _swigc__p_char,
3335
+ _swigc__p_int,
3336
+ _swigc__p_tagQR_VERSIONINFO,
3337
+ _swigc__p_tagRS_BLOCKINFO,
3338
+ _swigc__p_unsigned_char,
3339
+ _swigc__p_unsigned_short,
3340
+ };
3341
+
3342
+
3343
+ /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
3344
+
3345
+ /* -----------------------------------------------------------------------------
3346
+ * Type initialization:
3347
+ * This problem is tough by the requirement that no dynamic
3348
+ * memory is used. Also, since swig_type_info structures store pointers to
3349
+ * swig_cast_info structures and swig_cast_info structures store pointers back
3350
+ * to swig_type_info structures, we need some lookup code at initialization.
3351
+ * The idea is that swig generates all the structures that are needed.
3352
+ * The runtime then collects these partially filled structures.
3353
+ * The SWIG_InitializeModule function takes these initial arrays out of
3354
+ * swig_module, and does all the lookup, filling in the swig_module.types
3355
+ * array with the correct data and linking the correct swig_cast_info
3356
+ * structures together.
3357
+ *
3358
+ * The generated swig_type_info structures are assigned staticly to an initial
3359
+ * array. We just loop through that array, and handle each type individually.
3360
+ * First we lookup if this type has been already loaded, and if so, use the
3361
+ * loaded structure instead of the generated one. Then we have to fill in the
3362
+ * cast linked list. The cast data is initially stored in something like a
3363
+ * two-dimensional array. Each row corresponds to a type (there are the same
3364
+ * number of rows as there are in the swig_type_initial array). Each entry in
3365
+ * a column is one of the swig_cast_info structures for that type.
3366
+ * The cast_initial array is actually an array of arrays, because each row has
3367
+ * a variable number of columns. So to actually build the cast linked list,
3368
+ * we find the array of casts associated with the type, and loop through it
3369
+ * adding the casts to the list. The one last trick we need to do is making
3370
+ * sure the type pointer in the swig_cast_info struct is correct.
3371
+ *
3372
+ * First off, we lookup the cast->type name to see if it is already loaded.
3373
+ * There are three cases to handle:
3374
+ * 1) If the cast->type has already been loaded AND the type we are adding
3375
+ * casting info to has not been loaded (it is in this module), THEN we
3376
+ * replace the cast->type pointer with the type pointer that has already
3377
+ * been loaded.
3378
+ * 2) If BOTH types (the one we are adding casting info to, and the
3379
+ * cast->type) are loaded, THEN the cast info has already been loaded by
3380
+ * the previous module so we just ignore it.
3381
+ * 3) Finally, if cast->type has not already been loaded, then we add that
3382
+ * swig_cast_info to the linked list (because the cast->type) pointer will
3383
+ * be correct.
3384
+ * ----------------------------------------------------------------------------- */
3385
+
3386
+ #ifdef __cplusplus
3387
+ extern "C" {
3388
+ #if 0
3389
+ } /* c-mode */
3390
+ #endif
3391
+ #endif
3392
+
3393
+ #if 0
3394
+ #define SWIGRUNTIME_DEBUG
3395
+ #endif
3396
+
3397
+
3398
+ SWIGRUNTIME void
3399
+ SWIG_InitializeModule(void *clientdata) {
3400
+ size_t i;
3401
+ swig_module_info *module_head, *iter;
3402
+ int found, init;
3403
+
3404
+ clientdata = clientdata;
3405
+
3406
+ /* check to see if the circular list has been setup, if not, set it up */
3407
+ if (swig_module.next==0) {
3408
+ /* Initialize the swig_module */
3409
+ swig_module.type_initial = swig_type_initial;
3410
+ swig_module.cast_initial = swig_cast_initial;
3411
+ swig_module.next = &swig_module;
3412
+ init = 1;
3413
+ } else {
3414
+ init = 0;
3415
+ }
3416
+
3417
+ /* Try and load any already created modules */
3418
+ module_head = SWIG_GetModule(clientdata);
3419
+ if (!module_head) {
3420
+ /* This is the first module loaded for this interpreter */
3421
+ /* so set the swig module into the interpreter */
3422
+ SWIG_SetModule(clientdata, &swig_module);
3423
+ module_head = &swig_module;
3424
+ } else {
3425
+ /* the interpreter has loaded a SWIG module, but has it loaded this one? */
3426
+ found=0;
3427
+ iter=module_head;
3428
+ do {
3429
+ if (iter==&swig_module) {
3430
+ found=1;
3431
+ break;
3432
+ }
3433
+ iter=iter->next;
3434
+ } while (iter!= module_head);
3435
+
3436
+ /* if the is found in the list, then all is done and we may leave */
3437
+ if (found) return;
3438
+ /* otherwise we must add out module into the list */
3439
+ swig_module.next = module_head->next;
3440
+ module_head->next = &swig_module;
3441
+ }
3442
+
3443
+ /* When multiple interpeters are used, a module could have already been initialized in
3444
+ a different interpreter, but not yet have a pointer in this interpreter.
3445
+ In this case, we do not want to continue adding types... everything should be
3446
+ set up already */
3447
+ if (init == 0) return;
3448
+
3449
+ /* Now work on filling in swig_module.types */
3450
+ #ifdef SWIGRUNTIME_DEBUG
3451
+ printf("SWIG_InitializeModule: size %d\n", swig_module.size);
3452
+ #endif
3453
+ for (i = 0; i < swig_module.size; ++i) {
3454
+ swig_type_info *type = 0;
3455
+ swig_type_info *ret;
3456
+ swig_cast_info *cast;
3457
+
3458
+ #ifdef SWIGRUNTIME_DEBUG
3459
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
3460
+ #endif
3461
+
3462
+ /* if there is another module already loaded */
3463
+ if (swig_module.next != &swig_module) {
3464
+ type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
3465
+ }
3466
+ if (type) {
3467
+ /* Overwrite clientdata field */
3468
+ #ifdef SWIGRUNTIME_DEBUG
3469
+ printf("SWIG_InitializeModule: found type %s\n", type->name);
3470
+ #endif
3471
+ if (swig_module.type_initial[i]->clientdata) {
3472
+ type->clientdata = swig_module.type_initial[i]->clientdata;
3473
+ #ifdef SWIGRUNTIME_DEBUG
3474
+ printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
3475
+ #endif
3476
+ }
3477
+ } else {
3478
+ type = swig_module.type_initial[i];
3479
+ }
3480
+
3481
+ /* Insert casting types */
3482
+ cast = swig_module.cast_initial[i];
3483
+ while (cast->type) {
3484
+
3485
+ /* Don't need to add information already in the list */
3486
+ ret = 0;
3487
+ #ifdef SWIGRUNTIME_DEBUG
3488
+ printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
3489
+ #endif
3490
+ if (swig_module.next != &swig_module) {
3491
+ ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
3492
+ #ifdef SWIGRUNTIME_DEBUG
3493
+ if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
3494
+ #endif
3495
+ }
3496
+ if (ret) {
3497
+ if (type == swig_module.type_initial[i]) {
3498
+ #ifdef SWIGRUNTIME_DEBUG
3499
+ printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
3500
+ #endif
3501
+ cast->type = ret;
3502
+ ret = 0;
3503
+ } else {
3504
+ /* Check for casting already in the list */
3505
+ swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
3506
+ #ifdef SWIGRUNTIME_DEBUG
3507
+ if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
3508
+ #endif
3509
+ if (!ocast) ret = 0;
3510
+ }
3511
+ }
3512
+
3513
+ if (!ret) {
3514
+ #ifdef SWIGRUNTIME_DEBUG
3515
+ printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
3516
+ #endif
3517
+ if (type->cast) {
3518
+ type->cast->prev = cast;
3519
+ cast->next = type->cast;
3520
+ }
3521
+ type->cast = cast;
3522
+ }
3523
+ cast++;
3524
+ }
3525
+ /* Set entry in modules->types array equal to the type */
3526
+ swig_module.types[i] = type;
3527
+ }
3528
+ swig_module.types[i] = 0;
3529
+
3530
+ #ifdef SWIGRUNTIME_DEBUG
3531
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
3532
+ for (i = 0; i < swig_module.size; ++i) {
3533
+ int j = 0;
3534
+ swig_cast_info *cast = swig_module.cast_initial[i];
3535
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
3536
+ while (cast->type) {
3537
+ printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
3538
+ cast++;
3539
+ ++j;
3540
+ }
3541
+ printf("---- Total casts: %d\n",j);
3542
+ }
3543
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
3544
+ #endif
3545
+ }
3546
+
3547
+ /* This function will propagate the clientdata field of type to
3548
+ * any new swig_type_info structures that have been added into the list
3549
+ * of equivalent types. It is like calling
3550
+ * SWIG_TypeClientData(type, clientdata) a second time.
3551
+ */
3552
+ SWIGRUNTIME void
3553
+ SWIG_PropagateClientData(void) {
3554
+ size_t i;
3555
+ swig_cast_info *equiv;
3556
+ static int init_run = 0;
3557
+
3558
+ if (init_run) return;
3559
+ init_run = 1;
3560
+
3561
+ for (i = 0; i < swig_module.size; i++) {
3562
+ if (swig_module.types[i]->clientdata) {
3563
+ equiv = swig_module.types[i]->cast;
3564
+ while (equiv) {
3565
+ if (!equiv->converter) {
3566
+ if (equiv->type && !equiv->type->clientdata)
3567
+ SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
3568
+ }
3569
+ equiv = equiv->next;
3570
+ }
3571
+ }
3572
+ }
3573
+ }
3574
+
3575
+ #ifdef __cplusplus
3576
+ #if 0
3577
+ { /* c-mode */
3578
+ #endif
3579
+ }
3580
+ #endif
3581
+
3582
+ /*
3583
+
3584
+ */
3585
+ #ifdef __cplusplus
3586
+ extern "C"
3587
+ #endif
3588
+ SWIGEXPORT void Init_RQREncoder(void) {
3589
+ size_t i;
3590
+
3591
+ SWIG_InitRuntime();
3592
+ mRQREncoder = rb_define_module("RQREncoder");
3593
+
3594
+ SWIG_InitializeModule(0);
3595
+ for (i = 0; i < swig_module.size; i++) {
3596
+ SWIG_define_class(swig_module.types[i]);
3597
+ }
3598
+
3599
+ SWIG_RubyInitializeTrackings();
3600
+ rb_define_const(mRQREncoder, "TRUE", SWIG_From_bool(static_cast< bool >(true)));
3601
+ rb_define_const(mRQREncoder, "FALSE", SWIG_From_bool(static_cast< bool >(false)));
3602
+ rb_define_const(mRQREncoder, "QR_LEVEL_L", SWIG_From_int(static_cast< int >(0)));
3603
+ rb_define_const(mRQREncoder, "QR_LEVEL_M", SWIG_From_int(static_cast< int >(1)));
3604
+ rb_define_const(mRQREncoder, "QR_LEVEL_Q", SWIG_From_int(static_cast< int >(2)));
3605
+ rb_define_const(mRQREncoder, "QR_LEVEL_H", SWIG_From_int(static_cast< int >(3)));
3606
+ rb_define_const(mRQREncoder, "QR_MODE_NUMERAL", SWIG_From_int(static_cast< int >(0)));
3607
+ rb_define_const(mRQREncoder, "QR_MODE_ALPHABET", SWIG_From_int(static_cast< int >(1)));
3608
+ rb_define_const(mRQREncoder, "QR_MODE_8BIT", SWIG_From_int(static_cast< int >(2)));
3609
+ rb_define_const(mRQREncoder, "QR_MODE_KANJI", SWIG_From_int(static_cast< int >(3)));
3610
+ rb_define_const(mRQREncoder, "QR_VRESION_S", SWIG_From_int(static_cast< int >(0)));
3611
+ rb_define_const(mRQREncoder, "QR_VRESION_M", SWIG_From_int(static_cast< int >(1)));
3612
+ rb_define_const(mRQREncoder, "QR_VRESION_L", SWIG_From_int(static_cast< int >(2)));
3613
+ rb_define_const(mRQREncoder, "MAX_ALLCODEWORD", SWIG_From_int(static_cast< int >(3706)));
3614
+ rb_define_const(mRQREncoder, "MAX_DATACODEWORD", SWIG_From_int(static_cast< int >(2956)));
3615
+ rb_define_const(mRQREncoder, "MAX_CODEBLOCK", SWIG_From_int(static_cast< int >(153)));
3616
+ rb_define_const(mRQREncoder, "MAX_MODULESIZE", SWIG_From_int(static_cast< int >(177)));
3617
+ rb_define_const(mRQREncoder, "QR_MARGIN", SWIG_From_int(static_cast< int >(4)));
3618
+
3619
+ SwigClassRS_BLOCKINFO.klass = rb_define_class_under(mRQREncoder, "RS_BLOCKINFO", rb_cObject);
3620
+ SWIG_TypeClientData(SWIGTYPE_p_tagRS_BLOCKINFO, (void *) &SwigClassRS_BLOCKINFO);
3621
+ rb_define_alloc_func(SwigClassRS_BLOCKINFO.klass, _wrap_RS_BLOCKINFO_allocate);
3622
+ rb_define_method(SwigClassRS_BLOCKINFO.klass, "initialize", VALUEFUNC(_wrap_new_RS_BLOCKINFO), -1);
3623
+ rb_define_method(SwigClassRS_BLOCKINFO.klass, "ncRSBlock=", VALUEFUNC(_wrap_RS_BLOCKINFO_ncRSBlock_set), -1);
3624
+ rb_define_method(SwigClassRS_BLOCKINFO.klass, "ncRSBlock", VALUEFUNC(_wrap_RS_BLOCKINFO_ncRSBlock_get), -1);
3625
+ rb_define_method(SwigClassRS_BLOCKINFO.klass, "ncAllCodeWord=", VALUEFUNC(_wrap_RS_BLOCKINFO_ncAllCodeWord_set), -1);
3626
+ rb_define_method(SwigClassRS_BLOCKINFO.klass, "ncAllCodeWord", VALUEFUNC(_wrap_RS_BLOCKINFO_ncAllCodeWord_get), -1);
3627
+ rb_define_method(SwigClassRS_BLOCKINFO.klass, "ncDataCodeWord=", VALUEFUNC(_wrap_RS_BLOCKINFO_ncDataCodeWord_set), -1);
3628
+ rb_define_method(SwigClassRS_BLOCKINFO.klass, "ncDataCodeWord", VALUEFUNC(_wrap_RS_BLOCKINFO_ncDataCodeWord_get), -1);
3629
+ SwigClassRS_BLOCKINFO.mark = 0;
3630
+ SwigClassRS_BLOCKINFO.destroy = (void (*)(void *)) free_RS_BLOCKINFO;
3631
+ SwigClassRS_BLOCKINFO.trackObjects = 0;
3632
+
3633
+ SwigClassQR_VERSIONINFO.klass = rb_define_class_under(mRQREncoder, "QR_VERSIONINFO", rb_cObject);
3634
+ SWIG_TypeClientData(SWIGTYPE_p_tagQR_VERSIONINFO, (void *) &SwigClassQR_VERSIONINFO);
3635
+ rb_define_alloc_func(SwigClassQR_VERSIONINFO.klass, _wrap_QR_VERSIONINFO_allocate);
3636
+ rb_define_method(SwigClassQR_VERSIONINFO.klass, "initialize", VALUEFUNC(_wrap_new_QR_VERSIONINFO), -1);
3637
+ rb_define_method(SwigClassQR_VERSIONINFO.klass, "nVersionNo=", VALUEFUNC(_wrap_QR_VERSIONINFO_nVersionNo_set), -1);
3638
+ rb_define_method(SwigClassQR_VERSIONINFO.klass, "nVersionNo", VALUEFUNC(_wrap_QR_VERSIONINFO_nVersionNo_get), -1);
3639
+ rb_define_method(SwigClassQR_VERSIONINFO.klass, "ncAllCodeWord=", VALUEFUNC(_wrap_QR_VERSIONINFO_ncAllCodeWord_set), -1);
3640
+ rb_define_method(SwigClassQR_VERSIONINFO.klass, "ncAllCodeWord", VALUEFUNC(_wrap_QR_VERSIONINFO_ncAllCodeWord_get), -1);
3641
+ rb_define_method(SwigClassQR_VERSIONINFO.klass, "ncDataCodeWord=", VALUEFUNC(_wrap_QR_VERSIONINFO_ncDataCodeWord_set), -1);
3642
+ rb_define_method(SwigClassQR_VERSIONINFO.klass, "ncDataCodeWord", VALUEFUNC(_wrap_QR_VERSIONINFO_ncDataCodeWord_get), -1);
3643
+ rb_define_method(SwigClassQR_VERSIONINFO.klass, "ncAlignPoint=", VALUEFUNC(_wrap_QR_VERSIONINFO_ncAlignPoint_set), -1);
3644
+ rb_define_method(SwigClassQR_VERSIONINFO.klass, "ncAlignPoint", VALUEFUNC(_wrap_QR_VERSIONINFO_ncAlignPoint_get), -1);
3645
+ rb_define_method(SwigClassQR_VERSIONINFO.klass, "nAlignPoint=", VALUEFUNC(_wrap_QR_VERSIONINFO_nAlignPoint_set), -1);
3646
+ rb_define_method(SwigClassQR_VERSIONINFO.klass, "nAlignPoint", VALUEFUNC(_wrap_QR_VERSIONINFO_nAlignPoint_get), -1);
3647
+ rb_define_method(SwigClassQR_VERSIONINFO.klass, "RS_BlockInfo1=", VALUEFUNC(_wrap_QR_VERSIONINFO_RS_BlockInfo1_set), -1);
3648
+ rb_define_method(SwigClassQR_VERSIONINFO.klass, "RS_BlockInfo1", VALUEFUNC(_wrap_QR_VERSIONINFO_RS_BlockInfo1_get), -1);
3649
+ rb_define_method(SwigClassQR_VERSIONINFO.klass, "RS_BlockInfo2=", VALUEFUNC(_wrap_QR_VERSIONINFO_RS_BlockInfo2_set), -1);
3650
+ rb_define_method(SwigClassQR_VERSIONINFO.klass, "RS_BlockInfo2", VALUEFUNC(_wrap_QR_VERSIONINFO_RS_BlockInfo2_get), -1);
3651
+ SwigClassQR_VERSIONINFO.mark = 0;
3652
+ SwigClassQR_VERSIONINFO.destroy = (void (*)(void *)) free_QR_VERSIONINFO;
3653
+ SwigClassQR_VERSIONINFO.trackObjects = 0;
3654
+
3655
+ SwigClassCQR_Encode.klass = rb_define_class_under(mRQREncoder, "CQR_Encode", rb_cObject);
3656
+ SWIG_TypeClientData(SWIGTYPE_p_CQR_Encode, (void *) &SwigClassCQR_Encode);
3657
+ rb_define_alloc_func(SwigClassCQR_Encode.klass, _wrap_CQR_Encode_allocate);
3658
+ rb_define_method(SwigClassCQR_Encode.klass, "initialize", VALUEFUNC(_wrap_new_CQR_Encode), -1);
3659
+ rb_define_method(SwigClassCQR_Encode.klass, "m_nLevel=", VALUEFUNC(_wrap_CQR_Encode_m_nLevel_set), -1);
3660
+ rb_define_method(SwigClassCQR_Encode.klass, "m_nLevel", VALUEFUNC(_wrap_CQR_Encode_m_nLevel_get), -1);
3661
+ rb_define_method(SwigClassCQR_Encode.klass, "m_nVersion=", VALUEFUNC(_wrap_CQR_Encode_m_nVersion_set), -1);
3662
+ rb_define_method(SwigClassCQR_Encode.klass, "m_nVersion", VALUEFUNC(_wrap_CQR_Encode_m_nVersion_get), -1);
3663
+ rb_define_method(SwigClassCQR_Encode.klass, "m_bAutoExtent=", VALUEFUNC(_wrap_CQR_Encode_m_bAutoExtent_set), -1);
3664
+ rb_define_method(SwigClassCQR_Encode.klass, "m_bAutoExtent", VALUEFUNC(_wrap_CQR_Encode_m_bAutoExtent_get), -1);
3665
+ rb_define_method(SwigClassCQR_Encode.klass, "m_nMaskingNo=", VALUEFUNC(_wrap_CQR_Encode_m_nMaskingNo_set), -1);
3666
+ rb_define_method(SwigClassCQR_Encode.klass, "m_nMaskingNo", VALUEFUNC(_wrap_CQR_Encode_m_nMaskingNo_get), -1);
3667
+ rb_define_method(SwigClassCQR_Encode.klass, "m_nSymbleSize=", VALUEFUNC(_wrap_CQR_Encode_m_nSymbleSize_set), -1);
3668
+ rb_define_method(SwigClassCQR_Encode.klass, "m_nSymbleSize", VALUEFUNC(_wrap_CQR_Encode_m_nSymbleSize_get), -1);
3669
+ rb_define_method(SwigClassCQR_Encode.klass, "m_byModuleData=", VALUEFUNC(_wrap_CQR_Encode_m_byModuleData_set), -1);
3670
+ rb_define_method(SwigClassCQR_Encode.klass, "m_byModuleData", VALUEFUNC(_wrap_CQR_Encode_m_byModuleData_get), -1);
3671
+ rb_define_method(SwigClassCQR_Encode.klass, "EncodeData", VALUEFUNC(_wrap_CQR_Encode_EncodeData), -1);
3672
+ rb_define_method(SwigClassCQR_Encode.klass, "results", VALUEFUNC(_wrap_CQR_Encode_results), -1);
3673
+ SwigClassCQR_Encode.mark = 0;
3674
+ SwigClassCQR_Encode.destroy = (void (*)(void *)) free_CQR_Encode;
3675
+ SwigClassCQR_Encode.trackObjects = 0;
3676
+ }
3677
+