id3lib-ruby 0.6.0-x86-mswin32-60

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,182 @@
1
+ %module "ID3Lib::API"
2
+ %{
3
+ #include <id3/tag.h>
4
+ %}
5
+
6
+
7
+ enum ID3_FrameID;
8
+ enum ID3_FieldID;
9
+ enum ID3_FieldType;
10
+ enum ID3_TextEnc;
11
+ enum ID3_TagType;
12
+
13
+ typedef unsigned int flags_t;
14
+ typedef unsigned long uint32;
15
+ typedef unsigned char uchar;
16
+
17
+
18
+ %rename (Tag) ID3_Tag;
19
+ class ID3_Tag
20
+ {
21
+ public:
22
+
23
+ ID3_Tag(const char *name = NULL);
24
+ ~ID3_Tag();
25
+
26
+ %rename (has_tag_type) HasTagType;
27
+ bool HasTagType(ID3_TagType type) const;
28
+
29
+ %rename (link) Link;
30
+ size_t Link(const char *filename, flags_t flags = ID3TT_ALL);
31
+
32
+ %rename (update) Update;
33
+ flags_t Update(flags_t flags = ID3TT_ALL);
34
+
35
+ %rename (strip) Strip;
36
+ flags_t Strip(flags_t flags = ID3TT_ALL);
37
+
38
+ %rename (clear) Clear;
39
+ void Clear();
40
+
41
+ %rename (remove_frame) RemoveFrame;
42
+ ID3_Frame * RemoveFrame(const ID3_Frame *frame);
43
+
44
+ %rename (add_frame) AddFrame;
45
+ void AddFrame(const ID3_Frame *frame);
46
+
47
+ %rename (get_filename) GetFileName;
48
+ const char * GetFileName() const;
49
+
50
+ %rename (set_padding) SetPadding;
51
+ bool SetPadding(bool padding);
52
+
53
+ %rename (size) Size;
54
+ size_t Size() const;
55
+
56
+ %rename (find) Find;
57
+ ID3_Frame * Find(ID3_FrameID name) const;
58
+
59
+ %rename (create_iterator) CreateIterator;
60
+ %newobject CreateIterator;
61
+ ID3_Tag::Iterator * CreateIterator();
62
+ };
63
+
64
+ %rename (Tag_Iterator) ID3_Tag::Iterator;
65
+ class ID3_Tag::Iterator
66
+ {
67
+ public:
68
+
69
+ %rename (get_next) GetNext;
70
+ virtual ID3_Frame * GetNext() = 0;
71
+ };
72
+
73
+
74
+ %rename (Frame) ID3_Frame;
75
+ class ID3_Frame
76
+ {
77
+ public:
78
+
79
+ ID3_Frame(ID3_FrameID id = ID3FID_NOFRAME);
80
+ ~ID3_Frame();
81
+
82
+ %rename (get_field) GetField;
83
+ ID3_Field * GetField(ID3_FieldID name) const;
84
+
85
+ %rename (get_id) GetID;
86
+ ID3_FrameID GetID() const;
87
+ };
88
+
89
+
90
+ %rename (Field) ID3_Field;
91
+ class ID3_Field
92
+ {
93
+ public:
94
+
95
+ // Getters
96
+
97
+ %rename (get_type) GetType;
98
+ ID3_FieldType GetType() const;
99
+
100
+ %rename (get_encoding) GetEncoding;
101
+ ID3_TextEnc GetEncoding() const;
102
+
103
+ %rename (get_integer) Get;
104
+ uint32 Get() const;
105
+
106
+ %rename (get_ascii) GetRawText;
107
+ const char * GetRawText() const;
108
+
109
+ %extend
110
+ {
111
+ VALUE get_binary()
112
+ {
113
+ return rb_str_new((const char *)self->GetRawBinary(), self->Size());
114
+ }
115
+
116
+ VALUE get_unicode()
117
+ {
118
+ const char *str = (const char *)self->GetRawUnicodeText();
119
+ if (str == NULL) return rb_str_new("", 0);
120
+ size_t size = self->Size();
121
+ if (size >= 2 && str[size-2] == '\0' && str[size-1] == '\0') {
122
+ // id3lib seems to be inconsistent: the Unicode strings
123
+ // don't always end in 0x0000. If they do, we don't want these
124
+ // trailing bytes.
125
+ size -= 2;
126
+ }
127
+ return rb_str_new(str, size);
128
+ }
129
+ }
130
+
131
+ // Setters
132
+
133
+ %rename (set_encoding) SetEncoding(ID3_TextEnc);
134
+ bool SetEncoding(ID3_TextEnc enc);
135
+
136
+ %rename (set_integer) Set(uint32);
137
+ void Set(uint32 i);
138
+
139
+ %rename (set_ascii) Set(const char *);
140
+ size_t Set(const char *string);
141
+
142
+ %extend
143
+ {
144
+ size_t set_binary(VALUE data)
145
+ {
146
+ StringValue(data);
147
+ return self->Set((const uchar *)RSTRING_PTR(data),
148
+ RSTRING_LEN(data));
149
+ }
150
+
151
+ size_t set_unicode(VALUE data)
152
+ {
153
+ StringValue(data);
154
+
155
+ long len;
156
+ unicode_t *unicode;
157
+
158
+ len = RSTRING_LEN(data) / sizeof(unicode_t);
159
+ unicode = (unicode_t *)malloc(sizeof(unicode_t) * (len+1));
160
+
161
+ if (unicode == NULL) {
162
+ rb_raise(rb_eNoMemError, "Couldn't allocate memory for Unicode data.");
163
+ }
164
+
165
+ memcpy(unicode, RSTRING_PTR(data), sizeof(unicode_t) * len);
166
+ // Unicode strings need 0x0000 at the end.
167
+ unicode[len] = 0;
168
+ size_t retval = self->Set(unicode);
169
+
170
+ // Free Unicode! ;)
171
+ free(unicode);
172
+ return retval;
173
+ }
174
+ }
175
+
176
+ protected:
177
+
178
+ ID3_Field();
179
+ ~ID3_Field();
180
+ };
181
+
182
+ // vim: set filetype=cpp sw=4 ts=4 noexpandtab:
@@ -0,0 +1,3648 @@
1
+ /* ----------------------------------------------------------------------------
2
+ * This file was automatically generated by SWIG (http://www.swig.org).
3
+ * Version 1.3.40
4
+ *
5
+ * This file is not intended to be easily readable and contains a number of
6
+ * coding conventions designed to improve portability and efficiency. Do not make
7
+ * changes to this file unless you know what you are doing--modify the SWIG
8
+ * interface file instead.
9
+ * ----------------------------------------------------------------------------- */
10
+
11
+ #define 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 and 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
+ /* Remove global macros defined in Ruby's win32.h */
859
+ #ifdef write
860
+ # undef write
861
+ #endif
862
+ #ifdef read
863
+ # undef read
864
+ #endif
865
+ #ifdef bind
866
+ # undef bind
867
+ #endif
868
+ #ifdef close
869
+ # undef close
870
+ #endif
871
+ #ifdef connect
872
+ # undef connect
873
+ #endif
874
+
875
+
876
+ /* Ruby 1.7 defines NUM2LL(), LL2NUM() and ULL2NUM() macros */
877
+ #ifndef NUM2LL
878
+ #define NUM2LL(x) NUM2LONG((x))
879
+ #endif
880
+ #ifndef LL2NUM
881
+ #define LL2NUM(x) INT2NUM((long) (x))
882
+ #endif
883
+ #ifndef ULL2NUM
884
+ #define ULL2NUM(x) UINT2NUM((unsigned long) (x))
885
+ #endif
886
+
887
+ /* Ruby 1.7 doesn't (yet) define NUM2ULL() */
888
+ #ifndef NUM2ULL
889
+ #ifdef HAVE_LONG_LONG
890
+ #define NUM2ULL(x) rb_num2ull((x))
891
+ #else
892
+ #define NUM2ULL(x) NUM2ULONG(x)
893
+ #endif
894
+ #endif
895
+
896
+ /* RSTRING_LEN, etc are new in Ruby 1.9, but ->ptr and ->len no longer work */
897
+ /* Define these for older versions so we can just write code the new way */
898
+ #ifndef RSTRING_LEN
899
+ # define RSTRING_LEN(x) RSTRING(x)->len
900
+ #endif
901
+ #ifndef RSTRING_PTR
902
+ # define RSTRING_PTR(x) RSTRING(x)->ptr
903
+ #endif
904
+ #ifndef RSTRING_END
905
+ # define RSTRING_END(x) (RSTRING_PTR(x) + RSTRING_LEN(x))
906
+ #endif
907
+ #ifndef RARRAY_LEN
908
+ # define RARRAY_LEN(x) RARRAY(x)->len
909
+ #endif
910
+ #ifndef RARRAY_PTR
911
+ # define RARRAY_PTR(x) RARRAY(x)->ptr
912
+ #endif
913
+ #ifndef RFLOAT_VALUE
914
+ # define RFLOAT_VALUE(x) RFLOAT(x)->value
915
+ #endif
916
+ #ifndef DOUBLE2NUM
917
+ # define DOUBLE2NUM(x) rb_float_new(x)
918
+ #endif
919
+ #ifndef RHASH_TBL
920
+ # define RHASH_TBL(x) (RHASH(x)->tbl)
921
+ #endif
922
+ #ifndef RHASH_ITER_LEV
923
+ # define RHASH_ITER_LEV(x) (RHASH(x)->iter_lev)
924
+ #endif
925
+ #ifndef RHASH_IFNONE
926
+ # define RHASH_IFNONE(x) (RHASH(x)->ifnone)
927
+ #endif
928
+ #ifndef RHASH_SIZE
929
+ # define RHASH_SIZE(x) (RHASH(x)->tbl->num_entries)
930
+ #endif
931
+ #ifndef RHASH_EMPTY_P
932
+ # define RHASH_EMPTY_P(x) (RHASH_SIZE(x) == 0)
933
+ #endif
934
+ #ifndef RSTRUCT_LEN
935
+ # define RSTRUCT_LEN(x) RSTRUCT(x)->len
936
+ #endif
937
+ #ifndef RSTRUCT_PTR
938
+ # define RSTRUCT_PTR(x) RSTRUCT(x)->ptr
939
+ #endif
940
+
941
+
942
+
943
+ /*
944
+ * Need to be very careful about how these macros are defined, especially
945
+ * when compiling C++ code or C code with an ANSI C compiler.
946
+ *
947
+ * VALUEFUNC(f) is a macro used to typecast a C function that implements
948
+ * a Ruby method so that it can be passed as an argument to API functions
949
+ * like rb_define_method() and rb_define_singleton_method().
950
+ *
951
+ * VOIDFUNC(f) is a macro used to typecast a C function that implements
952
+ * either the "mark" or "free" stuff for a Ruby Data object, so that it
953
+ * can be passed as an argument to API functions like Data_Wrap_Struct()
954
+ * and Data_Make_Struct().
955
+ */
956
+
957
+ #ifdef __cplusplus
958
+ # ifndef RUBY_METHOD_FUNC /* These definitions should work for Ruby 1.4.6 */
959
+ # define PROTECTFUNC(f) ((VALUE (*)()) f)
960
+ # define VALUEFUNC(f) ((VALUE (*)()) f)
961
+ # define VOIDFUNC(f) ((void (*)()) f)
962
+ # else
963
+ # ifndef ANYARGS /* These definitions should work for Ruby 1.6 */
964
+ # define PROTECTFUNC(f) ((VALUE (*)()) f)
965
+ # define VALUEFUNC(f) ((VALUE (*)()) f)
966
+ # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
967
+ # else /* These definitions should work for Ruby 1.7+ */
968
+ # define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f)
969
+ # define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f)
970
+ # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
971
+ # endif
972
+ # endif
973
+ #else
974
+ # define VALUEFUNC(f) (f)
975
+ # define VOIDFUNC(f) (f)
976
+ #endif
977
+
978
+ /* Don't use for expressions have side effect */
979
+ #ifndef RB_STRING_VALUE
980
+ #define RB_STRING_VALUE(s) (TYPE(s) == T_STRING ? (s) : (*(volatile VALUE *)&(s) = rb_str_to_str(s)))
981
+ #endif
982
+ #ifndef StringValue
983
+ #define StringValue(s) RB_STRING_VALUE(s)
984
+ #endif
985
+ #ifndef StringValuePtr
986
+ #define StringValuePtr(s) RSTRING_PTR(RB_STRING_VALUE(s))
987
+ #endif
988
+ #ifndef StringValueLen
989
+ #define StringValueLen(s) RSTRING_LEN(RB_STRING_VALUE(s))
990
+ #endif
991
+ #ifndef SafeStringValue
992
+ #define SafeStringValue(v) do {\
993
+ StringValue(v);\
994
+ rb_check_safe_str(v);\
995
+ } while (0)
996
+ #endif
997
+
998
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
999
+ #define rb_define_alloc_func(klass, func) rb_define_singleton_method((klass), "new", VALUEFUNC((func)), -1)
1000
+ #define rb_undef_alloc_func(klass) rb_undef_method(CLASS_OF((klass)), "new")
1001
+ #endif
1002
+
1003
+ static VALUE _mSWIG = Qnil;
1004
+
1005
+ /* -----------------------------------------------------------------------------
1006
+ * error manipulation
1007
+ * ----------------------------------------------------------------------------- */
1008
+
1009
+
1010
+ /* Define some additional error types */
1011
+ #define SWIG_ObjectPreviouslyDeletedError -100
1012
+
1013
+
1014
+ /* Define custom exceptions for errors that do not map to existing Ruby
1015
+ exceptions. Note this only works for C++ since a global cannot be
1016
+ initialized by a funtion in C. For C, fallback to rb_eRuntimeError.*/
1017
+
1018
+ SWIGINTERN VALUE
1019
+ getNullReferenceError(void) {
1020
+ static int init = 0;
1021
+ static VALUE rb_eNullReferenceError ;
1022
+ if (!init) {
1023
+ init = 1;
1024
+ rb_eNullReferenceError = rb_define_class("NullReferenceError", rb_eRuntimeError);
1025
+ }
1026
+ return rb_eNullReferenceError;
1027
+ }
1028
+
1029
+ SWIGINTERN VALUE
1030
+ getObjectPreviouslyDeletedError(void) {
1031
+ static int init = 0;
1032
+ static VALUE rb_eObjectPreviouslyDeleted ;
1033
+ if (!init) {
1034
+ init = 1;
1035
+ rb_eObjectPreviouslyDeleted = rb_define_class("ObjectPreviouslyDeleted", rb_eRuntimeError);
1036
+ }
1037
+ return rb_eObjectPreviouslyDeleted;
1038
+ }
1039
+
1040
+
1041
+ SWIGINTERN VALUE
1042
+ SWIG_Ruby_ErrorType(int SWIG_code) {
1043
+ VALUE type;
1044
+ switch (SWIG_code) {
1045
+ case SWIG_MemoryError:
1046
+ type = rb_eNoMemError;
1047
+ break;
1048
+ case SWIG_IOError:
1049
+ type = rb_eIOError;
1050
+ break;
1051
+ case SWIG_RuntimeError:
1052
+ type = rb_eRuntimeError;
1053
+ break;
1054
+ case SWIG_IndexError:
1055
+ type = rb_eIndexError;
1056
+ break;
1057
+ case SWIG_TypeError:
1058
+ type = rb_eTypeError;
1059
+ break;
1060
+ case SWIG_DivisionByZero:
1061
+ type = rb_eZeroDivError;
1062
+ break;
1063
+ case SWIG_OverflowError:
1064
+ type = rb_eRangeError;
1065
+ break;
1066
+ case SWIG_SyntaxError:
1067
+ type = rb_eSyntaxError;
1068
+ break;
1069
+ case SWIG_ValueError:
1070
+ type = rb_eArgError;
1071
+ break;
1072
+ case SWIG_SystemError:
1073
+ type = rb_eFatal;
1074
+ break;
1075
+ case SWIG_AttributeError:
1076
+ type = rb_eRuntimeError;
1077
+ break;
1078
+ case SWIG_NullReferenceError:
1079
+ type = getNullReferenceError();
1080
+ break;
1081
+ case SWIG_ObjectPreviouslyDeletedError:
1082
+ type = getObjectPreviouslyDeletedError();
1083
+ break;
1084
+ case SWIG_UnknownError:
1085
+ type = rb_eRuntimeError;
1086
+ break;
1087
+ default:
1088
+ type = rb_eRuntimeError;
1089
+ }
1090
+ return type;
1091
+ }
1092
+
1093
+
1094
+ /* This function is called when a user inputs a wrong argument to
1095
+ a method.
1096
+ */
1097
+ SWIGINTERN
1098
+ const char* Ruby_Format_TypeError( const char* msg,
1099
+ const char* type,
1100
+ const char* name,
1101
+ const int argn,
1102
+ VALUE input )
1103
+ {
1104
+ char buf[128];
1105
+ VALUE str;
1106
+ VALUE asStr;
1107
+ if ( msg && *msg )
1108
+ {
1109
+ str = rb_str_new2(msg);
1110
+ }
1111
+ else
1112
+ {
1113
+ str = rb_str_new(NULL, 0);
1114
+ }
1115
+
1116
+ str = rb_str_cat2( str, "Expected argument " );
1117
+ sprintf( buf, "%d of type ", argn-1 );
1118
+ str = rb_str_cat2( str, buf );
1119
+ str = rb_str_cat2( str, type );
1120
+ str = rb_str_cat2( str, ", but got " );
1121
+ str = rb_str_cat2( str, rb_obj_classname(input) );
1122
+ str = rb_str_cat2( str, " " );
1123
+ asStr = rb_inspect(input);
1124
+ if ( RSTRING_LEN(asStr) > 30 )
1125
+ {
1126
+ str = rb_str_cat( str, StringValuePtr(asStr), 30 );
1127
+ str = rb_str_cat2( str, "..." );
1128
+ }
1129
+ else
1130
+ {
1131
+ str = rb_str_append( str, asStr );
1132
+ }
1133
+
1134
+ if ( name )
1135
+ {
1136
+ str = rb_str_cat2( str, "\n\tin SWIG method '" );
1137
+ str = rb_str_cat2( str, name );
1138
+ str = rb_str_cat2( str, "'" );
1139
+ }
1140
+
1141
+ return StringValuePtr( str );
1142
+ }
1143
+
1144
+ /* This function is called when an overloaded method fails */
1145
+ SWIGINTERN
1146
+ void Ruby_Format_OverloadedError(
1147
+ const int argc,
1148
+ const int maxargs,
1149
+ const char* method,
1150
+ const char* prototypes
1151
+ )
1152
+ {
1153
+ const char* msg = "Wrong # of arguments";
1154
+ if ( argc <= maxargs ) msg = "Wrong arguments";
1155
+ rb_raise(rb_eArgError,"%s for overloaded method '%s'.\n"
1156
+ "Possible C/C++ prototypes are:\n%s",
1157
+ msg, method, prototypes);
1158
+ }
1159
+
1160
+ /* -----------------------------------------------------------------------------
1161
+ * See the LICENSE file for information on copyright, usage and redistribution
1162
+ * of SWIG, and the README file for authors - http://www.swig.org/release.html.
1163
+ *
1164
+ * rubytracking.swg
1165
+ *
1166
+ * This file contains support for tracking mappings from
1167
+ * Ruby objects to C++ objects. This functionality is needed
1168
+ * to implement mark functions for Ruby's mark and sweep
1169
+ * garbage collector.
1170
+ * ----------------------------------------------------------------------------- */
1171
+
1172
+ #ifdef __cplusplus
1173
+ extern "C" {
1174
+ #endif
1175
+
1176
+ /* Ruby 1.8 actually assumes the first case. */
1177
+ #if SIZEOF_VOIDP == SIZEOF_LONG
1178
+ # define SWIG2NUM(v) LONG2NUM((unsigned long)v)
1179
+ # define NUM2SWIG(x) (unsigned long)NUM2LONG(x)
1180
+ #elif SIZEOF_VOIDP == SIZEOF_LONG_LONG
1181
+ # define SWIG2NUM(v) LL2NUM((unsigned long long)v)
1182
+ # define NUM2SWIG(x) (unsigned long long)NUM2LL(x)
1183
+ #else
1184
+ # error sizeof(void*) is not the same as long or long long
1185
+ #endif
1186
+
1187
+
1188
+ /* Global Ruby hash table to store Trackings from C/C++
1189
+ structs to Ruby Objects.
1190
+ */
1191
+ static VALUE swig_ruby_trackings = Qnil;
1192
+
1193
+ /* Global variable that stores a reference to the ruby
1194
+ hash table delete function. */
1195
+ static ID swig_ruby_hash_delete;
1196
+
1197
+ /* Setup a Ruby hash table to store Trackings */
1198
+ SWIGRUNTIME void SWIG_RubyInitializeTrackings(void) {
1199
+ /* Create a ruby hash table to store Trackings from C++
1200
+ objects to Ruby objects. */
1201
+
1202
+ /* Try to see if some other .so has already created a
1203
+ tracking hash table, which we keep hidden in an instance var
1204
+ in the SWIG module.
1205
+ This is done to allow multiple DSOs to share the same
1206
+ tracking table.
1207
+ */
1208
+ ID trackings_id = rb_intern( "@__trackings__" );
1209
+ VALUE verbose = rb_gv_get("VERBOSE");
1210
+ rb_gv_set("VERBOSE", Qfalse);
1211
+ swig_ruby_trackings = rb_ivar_get( _mSWIG, trackings_id );
1212
+ rb_gv_set("VERBOSE", verbose);
1213
+
1214
+ /* No, it hasn't. Create one ourselves */
1215
+ if ( swig_ruby_trackings == Qnil )
1216
+ {
1217
+ swig_ruby_trackings = rb_hash_new();
1218
+ rb_ivar_set( _mSWIG, trackings_id, swig_ruby_trackings );
1219
+ }
1220
+
1221
+ /* Now store a reference to the hash table delete function
1222
+ so that we only have to look it up once.*/
1223
+ swig_ruby_hash_delete = rb_intern("delete");
1224
+ }
1225
+
1226
+ /* Get a Ruby number to reference a pointer */
1227
+ SWIGRUNTIME VALUE SWIG_RubyPtrToReference(void* ptr) {
1228
+ /* We cast the pointer to an unsigned long
1229
+ and then store a reference to it using
1230
+ a Ruby number object. */
1231
+
1232
+ /* Convert the pointer to a Ruby number */
1233
+ return SWIG2NUM(ptr);
1234
+ }
1235
+
1236
+ /* Get a Ruby number to reference an object */
1237
+ SWIGRUNTIME VALUE SWIG_RubyObjectToReference(VALUE object) {
1238
+ /* We cast the object to an unsigned long
1239
+ and then store a reference to it using
1240
+ a Ruby number object. */
1241
+
1242
+ /* Convert the Object to a Ruby number */
1243
+ return SWIG2NUM(object);
1244
+ }
1245
+
1246
+ /* Get a Ruby object from a previously stored reference */
1247
+ SWIGRUNTIME VALUE SWIG_RubyReferenceToObject(VALUE reference) {
1248
+ /* The provided Ruby number object is a reference
1249
+ to the Ruby object we want.*/
1250
+
1251
+ /* Convert the Ruby number to a Ruby object */
1252
+ return NUM2SWIG(reference);
1253
+ }
1254
+
1255
+ /* Add a Tracking from a C/C++ struct to a Ruby object */
1256
+ SWIGRUNTIME void SWIG_RubyAddTracking(void* ptr, VALUE object) {
1257
+ /* In a Ruby hash table we store the pointer and
1258
+ the associated Ruby object. The trick here is
1259
+ that we cannot store the Ruby object directly - if
1260
+ we do then it cannot be garbage collected. So
1261
+ instead we typecast it as a unsigned long and
1262
+ convert it to a Ruby number object.*/
1263
+
1264
+ /* Get a reference to the pointer as a Ruby number */
1265
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1266
+
1267
+ /* Get a reference to the Ruby object as a Ruby number */
1268
+ VALUE value = SWIG_RubyObjectToReference(object);
1269
+
1270
+ /* Store the mapping to the global hash table. */
1271
+ rb_hash_aset(swig_ruby_trackings, key, value);
1272
+ }
1273
+
1274
+ /* Get the Ruby object that owns the specified C/C++ struct */
1275
+ SWIGRUNTIME VALUE SWIG_RubyInstanceFor(void* ptr) {
1276
+ /* Get a reference to the pointer as a Ruby number */
1277
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1278
+
1279
+ /* Now lookup the value stored in the global hash table */
1280
+ VALUE value = rb_hash_aref(swig_ruby_trackings, key);
1281
+
1282
+ if (value == Qnil) {
1283
+ /* No object exists - return nil. */
1284
+ return Qnil;
1285
+ }
1286
+ else {
1287
+ /* Convert this value to Ruby object */
1288
+ return SWIG_RubyReferenceToObject(value);
1289
+ }
1290
+ }
1291
+
1292
+ /* Remove a Tracking from a C/C++ struct to a Ruby object. It
1293
+ is very important to remove objects once they are destroyed
1294
+ since the same memory address may be reused later to create
1295
+ a new object. */
1296
+ SWIGRUNTIME void SWIG_RubyRemoveTracking(void* ptr) {
1297
+ /* Get a reference to the pointer as a Ruby number */
1298
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1299
+
1300
+ /* Delete the object from the hash table by calling Ruby's
1301
+ do this we need to call the Hash.delete method.*/
1302
+ rb_funcall(swig_ruby_trackings, swig_ruby_hash_delete, 1, key);
1303
+ }
1304
+
1305
+ /* This is a helper method that unlinks a Ruby object from its
1306
+ underlying C++ object. This is needed if the lifetime of the
1307
+ Ruby object is longer than the C++ object */
1308
+ SWIGRUNTIME void SWIG_RubyUnlinkObjects(void* ptr) {
1309
+ VALUE object = SWIG_RubyInstanceFor(ptr);
1310
+
1311
+ if (object != Qnil) {
1312
+ DATA_PTR(object) = 0;
1313
+ }
1314
+ }
1315
+
1316
+
1317
+ #ifdef __cplusplus
1318
+ }
1319
+ #endif
1320
+
1321
+ /* -----------------------------------------------------------------------------
1322
+ * Ruby API portion that goes into the runtime
1323
+ * ----------------------------------------------------------------------------- */
1324
+
1325
+ #ifdef __cplusplus
1326
+ extern "C" {
1327
+ #endif
1328
+
1329
+ SWIGINTERN VALUE
1330
+ SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
1331
+ if (NIL_P(target)) {
1332
+ target = o;
1333
+ } else {
1334
+ if (TYPE(target) != T_ARRAY) {
1335
+ VALUE o2 = target;
1336
+ target = rb_ary_new();
1337
+ rb_ary_push(target, o2);
1338
+ }
1339
+ rb_ary_push(target, o);
1340
+ }
1341
+ return target;
1342
+ }
1343
+
1344
+ /* For ruby1.8.4 and earlier. */
1345
+ #ifndef RUBY_INIT_STACK
1346
+ RUBY_EXTERN void Init_stack(VALUE* addr);
1347
+ # define RUBY_INIT_STACK \
1348
+ VALUE variable_in_this_stack_frame; \
1349
+ Init_stack(&variable_in_this_stack_frame);
1350
+ #endif
1351
+
1352
+
1353
+ #ifdef __cplusplus
1354
+ }
1355
+ #endif
1356
+
1357
+
1358
+ /* -----------------------------------------------------------------------------
1359
+ * See the LICENSE file for information on copyright, usage and redistribution
1360
+ * of SWIG, and the README file for authors - http://www.swig.org/release.html.
1361
+ *
1362
+ * rubyrun.swg
1363
+ *
1364
+ * This file contains the runtime support for Ruby modules
1365
+ * and includes code for managing global variables and pointer
1366
+ * type checking.
1367
+ * ----------------------------------------------------------------------------- */
1368
+
1369
+ /* For backward compatibility only */
1370
+ #define SWIG_POINTER_EXCEPTION 0
1371
+
1372
+ /* for raw pointers */
1373
+ #define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
1374
+ #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, own)
1375
+ #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Ruby_NewPointerObj(ptr, type, flags)
1376
+ #define SWIG_AcquirePtr(ptr, own) SWIG_Ruby_AcquirePtr(ptr, own)
1377
+ #define swig_owntype ruby_owntype
1378
+
1379
+ /* for raw packed data */
1380
+ #define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty, flags)
1381
+ #define SWIG_NewPackedObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type)
1382
+
1383
+ /* for class or struct pointers */
1384
+ #define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
1385
+ #define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
1386
+
1387
+ /* for C or C++ function pointers */
1388
+ #define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0)
1389
+ #define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0)
1390
+
1391
+ /* for C++ member pointers, ie, member methods */
1392
+ #define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty)
1393
+ #define SWIG_NewMemberObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type)
1394
+
1395
+
1396
+ /* Runtime API */
1397
+
1398
+ #define SWIG_GetModule(clientdata) SWIG_Ruby_GetModule()
1399
+ #define SWIG_SetModule(clientdata, pointer) SWIG_Ruby_SetModule(pointer)
1400
+
1401
+
1402
+ /* Error manipulation */
1403
+
1404
+ #define SWIG_ErrorType(code) SWIG_Ruby_ErrorType(code)
1405
+ #define SWIG_Error(code, msg) rb_raise(SWIG_Ruby_ErrorType(code), msg)
1406
+ #define SWIG_fail goto fail
1407
+
1408
+
1409
+ /* Ruby-specific SWIG API */
1410
+
1411
+ #define SWIG_InitRuntime() SWIG_Ruby_InitRuntime()
1412
+ #define SWIG_define_class(ty) SWIG_Ruby_define_class(ty)
1413
+ #define SWIG_NewClassInstance(value, ty) SWIG_Ruby_NewClassInstance(value, ty)
1414
+ #define SWIG_MangleStr(value) SWIG_Ruby_MangleStr(value)
1415
+ #define SWIG_CheckConvert(value, ty) SWIG_Ruby_CheckConvert(value, ty)
1416
+
1417
+ #include "assert.h"
1418
+
1419
+ /* -----------------------------------------------------------------------------
1420
+ * pointers/data manipulation
1421
+ * ----------------------------------------------------------------------------- */
1422
+
1423
+ #ifdef __cplusplus
1424
+ extern "C" {
1425
+ #endif
1426
+
1427
+ typedef struct {
1428
+ VALUE klass;
1429
+ VALUE mImpl;
1430
+ void (*mark)(void *);
1431
+ void (*destroy)(void *);
1432
+ int trackObjects;
1433
+ } swig_class;
1434
+
1435
+
1436
+ /* Global pointer used to keep some internal SWIG stuff */
1437
+ static VALUE _cSWIG_Pointer = Qnil;
1438
+ static VALUE swig_runtime_data_type_pointer = Qnil;
1439
+
1440
+ /* Global IDs used to keep some internal SWIG stuff */
1441
+ static ID swig_arity_id = 0;
1442
+ static ID swig_call_id = 0;
1443
+
1444
+ /*
1445
+ If your swig extension is to be run within an embedded ruby and has
1446
+ director callbacks, you should set -DRUBY_EMBEDDED during compilation.
1447
+ This will reset ruby's stack frame on each entry point from the main
1448
+ program the first time a virtual director function is invoked (in a
1449
+ non-recursive way).
1450
+ If this is not done, you run the risk of Ruby trashing the stack.
1451
+ */
1452
+
1453
+ #ifdef RUBY_EMBEDDED
1454
+
1455
+ # define SWIG_INIT_STACK \
1456
+ if ( !swig_virtual_calls ) { RUBY_INIT_STACK } \
1457
+ ++swig_virtual_calls;
1458
+ # define SWIG_RELEASE_STACK --swig_virtual_calls;
1459
+ # define Ruby_DirectorTypeMismatchException(x) \
1460
+ rb_raise( rb_eTypeError, x ); return c_result;
1461
+
1462
+ static unsigned int swig_virtual_calls = 0;
1463
+
1464
+ #else /* normal non-embedded extension */
1465
+
1466
+ # define SWIG_INIT_STACK
1467
+ # define SWIG_RELEASE_STACK
1468
+ # define Ruby_DirectorTypeMismatchException(x) \
1469
+ throw Swig::DirectorTypeMismatchException( x );
1470
+
1471
+ #endif /* RUBY_EMBEDDED */
1472
+
1473
+
1474
+ SWIGRUNTIME VALUE
1475
+ getExceptionClass(void) {
1476
+ static int init = 0;
1477
+ static VALUE rubyExceptionClass ;
1478
+ if (!init) {
1479
+ init = 1;
1480
+ rubyExceptionClass = rb_const_get(_mSWIG, rb_intern("Exception"));
1481
+ }
1482
+ return rubyExceptionClass;
1483
+ }
1484
+
1485
+ /* This code checks to see if the Ruby object being raised as part
1486
+ of an exception inherits from the Ruby class Exception. If so,
1487
+ the object is simply returned. If not, then a new Ruby exception
1488
+ object is created and that will be returned to Ruby.*/
1489
+ SWIGRUNTIME VALUE
1490
+ SWIG_Ruby_ExceptionType(swig_type_info *desc, VALUE obj) {
1491
+ VALUE exceptionClass = getExceptionClass();
1492
+ if (rb_obj_is_kind_of(obj, exceptionClass)) {
1493
+ return obj;
1494
+ } else {
1495
+ return rb_exc_new3(rb_eRuntimeError, rb_obj_as_string(obj));
1496
+ }
1497
+ }
1498
+
1499
+ /* Initialize Ruby runtime support */
1500
+ SWIGRUNTIME void
1501
+ SWIG_Ruby_InitRuntime(void)
1502
+ {
1503
+ if (_mSWIG == Qnil) {
1504
+ _mSWIG = rb_define_module("SWIG");
1505
+ swig_call_id = rb_intern("call");
1506
+ swig_arity_id = rb_intern("arity");
1507
+ }
1508
+ }
1509
+
1510
+ /* Define Ruby class for C type */
1511
+ SWIGRUNTIME void
1512
+ SWIG_Ruby_define_class(swig_type_info *type)
1513
+ {
1514
+ VALUE klass;
1515
+ char *klass_name = (char *) malloc(4 + strlen(type->name) + 1);
1516
+ sprintf(klass_name, "TYPE%s", type->name);
1517
+ if (NIL_P(_cSWIG_Pointer)) {
1518
+ _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);
1519
+ rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new");
1520
+ }
1521
+ klass = rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
1522
+ free((void *) klass_name);
1523
+ }
1524
+
1525
+ /* Create a new pointer object */
1526
+ SWIGRUNTIME VALUE
1527
+ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
1528
+ {
1529
+ int own = flags & SWIG_POINTER_OWN;
1530
+ int track;
1531
+ char *klass_name;
1532
+ swig_class *sklass;
1533
+ VALUE klass;
1534
+ VALUE obj;
1535
+
1536
+ if (!ptr)
1537
+ return Qnil;
1538
+
1539
+ if (type->clientdata) {
1540
+ sklass = (swig_class *) type->clientdata;
1541
+
1542
+ /* Are we tracking this class and have we already returned this Ruby object? */
1543
+ track = sklass->trackObjects;
1544
+ if (track) {
1545
+ obj = SWIG_RubyInstanceFor(ptr);
1546
+
1547
+ /* Check the object's type and make sure it has the correct type.
1548
+ It might not in cases where methods do things like
1549
+ downcast methods. */
1550
+ if (obj != Qnil) {
1551
+ VALUE value = rb_iv_get(obj, "@__swigtype__");
1552
+ char* type_name = RSTRING_PTR(value);
1553
+
1554
+ if (strcmp(type->name, type_name) == 0) {
1555
+ return obj;
1556
+ }
1557
+ }
1558
+ }
1559
+
1560
+ /* Create a new Ruby object */
1561
+ obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark),
1562
+ ( own ? VOIDFUNC(sklass->destroy) :
1563
+ (track ? VOIDFUNC(SWIG_RubyRemoveTracking) : 0 )
1564
+ ), ptr);
1565
+
1566
+ /* If tracking is on for this class then track this object. */
1567
+ if (track) {
1568
+ SWIG_RubyAddTracking(ptr, obj);
1569
+ }
1570
+ } else {
1571
+ klass_name = (char *) malloc(4 + strlen(type->name) + 1);
1572
+ sprintf(klass_name, "TYPE%s", type->name);
1573
+ klass = rb_const_get(_mSWIG, rb_intern(klass_name));
1574
+ free((void *) klass_name);
1575
+ obj = Data_Wrap_Struct(klass, 0, 0, ptr);
1576
+ }
1577
+ rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
1578
+
1579
+ return obj;
1580
+ }
1581
+
1582
+ /* Create a new class instance (always owned) */
1583
+ SWIGRUNTIME VALUE
1584
+ SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type)
1585
+ {
1586
+ VALUE obj;
1587
+ swig_class *sklass = (swig_class *) type->clientdata;
1588
+ obj = Data_Wrap_Struct(klass, VOIDFUNC(sklass->mark), VOIDFUNC(sklass->destroy), 0);
1589
+ rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
1590
+ return obj;
1591
+ }
1592
+
1593
+ /* Get type mangle from class name */
1594
+ SWIGRUNTIMEINLINE char *
1595
+ SWIG_Ruby_MangleStr(VALUE obj)
1596
+ {
1597
+ VALUE stype = rb_iv_get(obj, "@__swigtype__");
1598
+ return StringValuePtr(stype);
1599
+ }
1600
+
1601
+ /* Acquire a pointer value */
1602
+ typedef void (*ruby_owntype)(void*);
1603
+
1604
+ SWIGRUNTIME ruby_owntype
1605
+ SWIG_Ruby_AcquirePtr(VALUE obj, ruby_owntype own) {
1606
+ if (obj) {
1607
+ ruby_owntype oldown = RDATA(obj)->dfree;
1608
+ RDATA(obj)->dfree = own;
1609
+ return oldown;
1610
+ } else {
1611
+ return 0;
1612
+ }
1613
+ }
1614
+
1615
+ /* Convert a pointer value */
1616
+ SWIGRUNTIME int
1617
+ SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags, ruby_owntype *own)
1618
+ {
1619
+ char *c;
1620
+ swig_cast_info *tc;
1621
+ void *vptr = 0;
1622
+
1623
+ /* Grab the pointer */
1624
+ if (NIL_P(obj)) {
1625
+ *ptr = 0;
1626
+ return SWIG_OK;
1627
+ } else {
1628
+ if (TYPE(obj) != T_DATA) {
1629
+ return SWIG_ERROR;
1630
+ }
1631
+ Data_Get_Struct(obj, void, vptr);
1632
+ }
1633
+
1634
+ if (own) *own = RDATA(obj)->dfree;
1635
+
1636
+ /* Check to see if the input object is giving up ownership
1637
+ of the underlying C struct or C++ object. If so then we
1638
+ need to reset the destructor since the Ruby object no
1639
+ longer owns the underlying C++ object.*/
1640
+ if (flags & SWIG_POINTER_DISOWN) {
1641
+ /* Is tracking on for this class? */
1642
+ int track = 0;
1643
+ if (ty && ty->clientdata) {
1644
+ swig_class *sklass = (swig_class *) ty->clientdata;
1645
+ track = sklass->trackObjects;
1646
+ }
1647
+
1648
+ if (track) {
1649
+ /* We are tracking objects for this class. Thus we change the destructor
1650
+ * to SWIG_RubyRemoveTracking. This allows us to
1651
+ * remove the mapping from the C++ to Ruby object
1652
+ * when the Ruby object is garbage collected. If we don't
1653
+ * do this, then it is possible we will return a reference
1654
+ * to a Ruby object that no longer exists thereby crashing Ruby. */
1655
+ RDATA(obj)->dfree = SWIG_RubyRemoveTracking;
1656
+ } else {
1657
+ RDATA(obj)->dfree = 0;
1658
+ }
1659
+ }
1660
+
1661
+ /* Do type-checking if type info was provided */
1662
+ if (ty) {
1663
+ if (ty->clientdata) {
1664
+ if (rb_obj_is_kind_of(obj, ((swig_class *) (ty->clientdata))->klass)) {
1665
+ if (vptr == 0) {
1666
+ /* The object has already been deleted */
1667
+ return SWIG_ObjectPreviouslyDeletedError;
1668
+ }
1669
+ *ptr = vptr;
1670
+ return SWIG_OK;
1671
+ }
1672
+ }
1673
+ if ((c = SWIG_MangleStr(obj)) == NULL) {
1674
+ return SWIG_ERROR;
1675
+ }
1676
+ tc = SWIG_TypeCheck(c, ty);
1677
+ if (!tc) {
1678
+ return SWIG_ERROR;
1679
+ } else {
1680
+ int newmemory = 0;
1681
+ *ptr = SWIG_TypeCast(tc, vptr, &newmemory);
1682
+ assert(!newmemory); /* newmemory handling not yet implemented */
1683
+ }
1684
+ } else {
1685
+ *ptr = vptr;
1686
+ }
1687
+
1688
+ return SWIG_OK;
1689
+ }
1690
+
1691
+ /* Check convert */
1692
+ SWIGRUNTIMEINLINE int
1693
+ SWIG_Ruby_CheckConvert(VALUE obj, swig_type_info *ty)
1694
+ {
1695
+ char *c = SWIG_MangleStr(obj);
1696
+ if (!c) return 0;
1697
+ return SWIG_TypeCheck(c,ty) != 0;
1698
+ }
1699
+
1700
+ SWIGRUNTIME VALUE
1701
+ SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
1702
+ char result[1024];
1703
+ char *r = result;
1704
+ if ((2*sz + 1 + strlen(type->name)) > 1000) return 0;
1705
+ *(r++) = '_';
1706
+ r = SWIG_PackData(r, ptr, sz);
1707
+ strcpy(r, type->name);
1708
+ return rb_str_new2(result);
1709
+ }
1710
+
1711
+ /* Convert a packed value value */
1712
+ SWIGRUNTIME int
1713
+ SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty) {
1714
+ swig_cast_info *tc;
1715
+ const char *c;
1716
+
1717
+ if (TYPE(obj) != T_STRING) goto type_error;
1718
+ c = StringValuePtr(obj);
1719
+ /* Pointer values must start with leading underscore */
1720
+ if (*c != '_') goto type_error;
1721
+ c++;
1722
+ c = SWIG_UnpackData(c, ptr, sz);
1723
+ if (ty) {
1724
+ tc = SWIG_TypeCheck(c, ty);
1725
+ if (!tc) goto type_error;
1726
+ }
1727
+ return SWIG_OK;
1728
+
1729
+ type_error:
1730
+ return SWIG_ERROR;
1731
+ }
1732
+
1733
+ SWIGRUNTIME swig_module_info *
1734
+ SWIG_Ruby_GetModule(void)
1735
+ {
1736
+ VALUE pointer;
1737
+ swig_module_info *ret = 0;
1738
+ VALUE verbose = rb_gv_get("VERBOSE");
1739
+
1740
+ /* temporarily disable warnings, since the pointer check causes warnings with 'ruby -w' */
1741
+ rb_gv_set("VERBOSE", Qfalse);
1742
+
1743
+ /* first check if pointer already created */
1744
+ pointer = rb_gv_get("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
1745
+ if (pointer != Qnil) {
1746
+ Data_Get_Struct(pointer, swig_module_info, ret);
1747
+ }
1748
+
1749
+ /* reinstate warnings */
1750
+ rb_gv_set("VERBOSE", verbose);
1751
+ return ret;
1752
+ }
1753
+
1754
+ SWIGRUNTIME void
1755
+ SWIG_Ruby_SetModule(swig_module_info *pointer)
1756
+ {
1757
+ /* register a new class */
1758
+ VALUE cl = rb_define_class("swig_runtime_data", rb_cObject);
1759
+ /* create and store the structure pointer to a global variable */
1760
+ swig_runtime_data_type_pointer = Data_Wrap_Struct(cl, 0, 0, pointer);
1761
+ rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer);
1762
+ }
1763
+
1764
+ /* This function can be used to check whether a proc or method or similarly
1765
+ callable function has been passed. Usually used in a %typecheck, like:
1766
+
1767
+ %typecheck(c_callback_t, precedence=SWIG_TYPECHECK_POINTER) {
1768
+ $result = SWIG_Ruby_isCallable( $input );
1769
+ }
1770
+ */
1771
+ SWIGINTERN
1772
+ int SWIG_Ruby_isCallable( VALUE proc )
1773
+ {
1774
+ if ( rb_respond_to( proc, swig_call_id ) == Qtrue )
1775
+ return 1;
1776
+ return 0;
1777
+ }
1778
+
1779
+ /* This function can be used to check the arity (number of arguments)
1780
+ a proc or method can take. Usually used in a %typecheck.
1781
+ Valid arities will be that equal to minimal or those < 0
1782
+ which indicate a variable number of parameters at the end.
1783
+ */
1784
+ SWIGINTERN
1785
+ int SWIG_Ruby_arity( VALUE proc, int minimal )
1786
+ {
1787
+ if ( rb_respond_to( proc, swig_arity_id ) == Qtrue )
1788
+ {
1789
+ VALUE num = rb_funcall( proc, swig_arity_id, 0 );
1790
+ int arity = NUM2INT(num);
1791
+ if ( arity < 0 && (arity+1) < -minimal ) return 1;
1792
+ if ( arity == minimal ) return 1;
1793
+ return 1;
1794
+ }
1795
+ return 0;
1796
+ }
1797
+
1798
+
1799
+ #ifdef __cplusplus
1800
+ }
1801
+ #endif
1802
+
1803
+
1804
+
1805
+ #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
1806
+
1807
+ #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
1808
+
1809
+
1810
+
1811
+ /* -------- TYPES TABLE (BEGIN) -------- */
1812
+
1813
+ #define SWIGTYPE_p_ID3_Field swig_types[0]
1814
+ #define SWIGTYPE_p_ID3_Frame swig_types[1]
1815
+ #define SWIGTYPE_p_ID3_Tag swig_types[2]
1816
+ #define SWIGTYPE_p_ID3_Tag__Iterator swig_types[3]
1817
+ #define SWIGTYPE_p_char swig_types[4]
1818
+ #define SWIGTYPE_p_unsigned_char swig_types[5]
1819
+ #define SWIGTYPE_p_unsigned_int swig_types[6]
1820
+ #define SWIGTYPE_p_unsigned_long swig_types[7]
1821
+ static swig_type_info *swig_types[9];
1822
+ static swig_module_info swig_module = {swig_types, 8, 0, 0, 0, 0};
1823
+ #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
1824
+ #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
1825
+
1826
+ /* -------- TYPES TABLE (END) -------- */
1827
+
1828
+ #define SWIG_init Init_id3lib_api
1829
+ #define SWIG_name "ID3Lib::API"
1830
+
1831
+ static VALUE mAPI;
1832
+
1833
+ #define SWIG_RUBY_THREAD_BEGIN_BLOCK
1834
+ #define SWIG_RUBY_THREAD_END_BLOCK
1835
+
1836
+
1837
+ #define SWIGVERSION 0x010340
1838
+ #define SWIG_VERSION SWIGVERSION
1839
+
1840
+
1841
+ #define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
1842
+ #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))
1843
+
1844
+
1845
+ #include <stdexcept>
1846
+
1847
+
1848
+ #include <id3/tag.h>
1849
+
1850
+
1851
+ SWIGINTERN swig_type_info*
1852
+ SWIG_pchar_descriptor(void)
1853
+ {
1854
+ static int init = 0;
1855
+ static swig_type_info* info = 0;
1856
+ if (!init) {
1857
+ info = SWIG_TypeQuery("_p_char");
1858
+ init = 1;
1859
+ }
1860
+ return info;
1861
+ }
1862
+
1863
+
1864
+ SWIGINTERN int
1865
+ SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
1866
+ {
1867
+ if (TYPE(obj) == T_STRING) {
1868
+ #if defined(StringValuePtr)
1869
+ char *cstr = StringValuePtr(obj);
1870
+ #else
1871
+ char *cstr = STR2CSTR(obj);
1872
+ #endif
1873
+ size_t size = RSTRING_LEN(obj) + 1;
1874
+ if (cptr) {
1875
+ if (alloc) {
1876
+ if (*alloc == SWIG_NEWOBJ) {
1877
+ *cptr = reinterpret_cast< char* >(memcpy((new char[size]), cstr, sizeof(char)*(size)));
1878
+ } else {
1879
+ *cptr = cstr;
1880
+ *alloc = SWIG_OLDOBJ;
1881
+ }
1882
+ }
1883
+ }
1884
+ if (psize) *psize = size;
1885
+ return SWIG_OK;
1886
+ } else {
1887
+ swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
1888
+ if (pchar_descriptor) {
1889
+ void* vptr = 0;
1890
+ if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
1891
+ if (cptr) *cptr = (char *)vptr;
1892
+ if (psize) *psize = vptr ? (strlen((char*)vptr) + 1) : 0;
1893
+ if (alloc) *alloc = SWIG_OLDOBJ;
1894
+ return SWIG_OK;
1895
+ }
1896
+ }
1897
+ }
1898
+ return SWIG_TypeError;
1899
+ }
1900
+
1901
+
1902
+
1903
+
1904
+
1905
+ #include <limits.h>
1906
+ #if !defined(SWIG_NO_LLONG_MAX)
1907
+ # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
1908
+ # define LLONG_MAX __LONG_LONG_MAX__
1909
+ # define LLONG_MIN (-LLONG_MAX - 1LL)
1910
+ # define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
1911
+ # endif
1912
+ #endif
1913
+
1914
+
1915
+ SWIGINTERN VALUE
1916
+ SWIG_ruby_failed(void)
1917
+ {
1918
+ return Qnil;
1919
+ }
1920
+
1921
+
1922
+ /*@SWIG:/usr/local/share/swig/1.3.40/ruby/rubyprimtypes.swg,23,%ruby_aux_method@*/
1923
+ SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
1924
+ {
1925
+ VALUE obj = args[0];
1926
+ VALUE type = TYPE(obj);
1927
+ long *res = (long *)(args[1]);
1928
+ *res = type == T_FIXNUM ? NUM2LONG(obj) : rb_big2long(obj);
1929
+ return obj;
1930
+ }
1931
+ /*@SWIG@*/
1932
+
1933
+ SWIGINTERN int
1934
+ SWIG_AsVal_long (VALUE obj, long* val)
1935
+ {
1936
+ VALUE type = TYPE(obj);
1937
+ if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
1938
+ long v;
1939
+ VALUE a[2];
1940
+ a[0] = obj;
1941
+ a[1] = (VALUE)(&v);
1942
+ if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2LONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
1943
+ if (val) *val = v;
1944
+ return SWIG_OK;
1945
+ }
1946
+ }
1947
+ return SWIG_TypeError;
1948
+ }
1949
+
1950
+
1951
+ SWIGINTERN int
1952
+ SWIG_AsVal_int (VALUE obj, int *val)
1953
+ {
1954
+ long v;
1955
+ int res = SWIG_AsVal_long (obj, &v);
1956
+ if (SWIG_IsOK(res)) {
1957
+ if ((v < INT_MIN || v > INT_MAX)) {
1958
+ return SWIG_OverflowError;
1959
+ } else {
1960
+ if (val) *val = static_cast< int >(v);
1961
+ }
1962
+ }
1963
+ return res;
1964
+ }
1965
+
1966
+
1967
+ SWIGINTERNINLINE VALUE
1968
+ SWIG_From_bool (bool value)
1969
+ {
1970
+ return value ? Qtrue : Qfalse;
1971
+ }
1972
+
1973
+
1974
+ /*@SWIG:/usr/local/share/swig/1.3.40/ruby/rubyprimtypes.swg,23,%ruby_aux_method@*/
1975
+ SWIGINTERN VALUE SWIG_AUX_NUM2ULONG(VALUE *args)
1976
+ {
1977
+ VALUE obj = args[0];
1978
+ VALUE type = TYPE(obj);
1979
+ unsigned long *res = (unsigned long *)(args[1]);
1980
+ *res = type == T_FIXNUM ? NUM2ULONG(obj) : rb_big2ulong(obj);
1981
+ return obj;
1982
+ }
1983
+ /*@SWIG@*/
1984
+
1985
+ SWIGINTERN int
1986
+ SWIG_AsVal_unsigned_SS_long (VALUE obj, unsigned long *val)
1987
+ {
1988
+ VALUE type = TYPE(obj);
1989
+ if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
1990
+ unsigned long v;
1991
+ VALUE a[2];
1992
+ a[0] = obj;
1993
+ a[1] = (VALUE)(&v);
1994
+ if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2ULONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
1995
+ if (val) *val = v;
1996
+ return SWIG_OK;
1997
+ }
1998
+ }
1999
+ return SWIG_TypeError;
2000
+ }
2001
+
2002
+
2003
+ SWIGINTERN int
2004
+ SWIG_AsVal_unsigned_SS_int (VALUE obj, unsigned int *val)
2005
+ {
2006
+ unsigned long v;
2007
+ int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
2008
+ if (SWIG_IsOK(res)) {
2009
+ if ((v > UINT_MAX)) {
2010
+ return SWIG_OverflowError;
2011
+ } else {
2012
+ if (val) *val = static_cast< unsigned int >(v);
2013
+ }
2014
+ }
2015
+ return res;
2016
+ }
2017
+
2018
+
2019
+ #define SWIG_From_long LONG2NUM
2020
+
2021
+
2022
+ SWIGINTERNINLINE VALUE
2023
+ SWIG_From_unsigned_SS_long (unsigned long value)
2024
+ {
2025
+ return ULONG2NUM(value);
2026
+ }
2027
+
2028
+
2029
+ SWIGINTERNINLINE VALUE
2030
+ SWIG_From_size_t (size_t value)
2031
+ {
2032
+ return SWIG_From_unsigned_SS_long (static_cast< unsigned long >(value));
2033
+ }
2034
+
2035
+
2036
+ SWIGINTERNINLINE VALUE
2037
+ SWIG_From_unsigned_SS_int (unsigned int value)
2038
+ {
2039
+ return SWIG_From_unsigned_SS_long (value);
2040
+ }
2041
+
2042
+
2043
+ SWIGINTERNINLINE VALUE
2044
+ SWIG_FromCharPtrAndSize(const char* carray, size_t size)
2045
+ {
2046
+ if (carray) {
2047
+ if (size > LONG_MAX) {
2048
+ swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
2049
+ return pchar_descriptor ?
2050
+ SWIG_NewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : Qnil;
2051
+ } else {
2052
+ return rb_str_new(carray, static_cast< long >(size));
2053
+ }
2054
+ } else {
2055
+ return Qnil;
2056
+ }
2057
+ }
2058
+
2059
+
2060
+ SWIGINTERNINLINE VALUE
2061
+ SWIG_FromCharPtr(const char *cptr)
2062
+ {
2063
+ return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
2064
+ }
2065
+
2066
+
2067
+ SWIGINTERN int
2068
+ SWIG_AsVal_bool (VALUE obj, bool *val)
2069
+ {
2070
+ if (obj == Qtrue) {
2071
+ if (val) *val = true;
2072
+ return SWIG_OK;
2073
+ } else if (obj == Qfalse) {
2074
+ if (val) *val = false;
2075
+ return SWIG_OK;
2076
+ } else {
2077
+ int res = 0;
2078
+ if (SWIG_AsVal_int (obj, &res) == SWIG_OK) {
2079
+ if (val) *val = res ? true : false;
2080
+ return SWIG_OK;
2081
+ }
2082
+ }
2083
+ return SWIG_TypeError;
2084
+ }
2085
+
2086
+
2087
+ SWIGINTERNINLINE VALUE
2088
+ SWIG_From_int (int value)
2089
+ {
2090
+ return SWIG_From_long (value);
2091
+ }
2092
+
2093
+ SWIGINTERN VALUE ID3_Field_get_binary(ID3_Field *self){
2094
+ return rb_str_new((const char *)self->GetRawBinary(), self->Size());
2095
+ }
2096
+ SWIGINTERN VALUE ID3_Field_get_unicode(ID3_Field *self){
2097
+ const char *str = (const char *)self->GetRawUnicodeText();
2098
+ if (str == NULL) return rb_str_new("", 0);
2099
+ size_t size = self->Size();
2100
+ if (size >= 2 && str[size-2] == '\0' && str[size-1] == '\0') {
2101
+ // id3lib seems to be inconsistent: the Unicode strings
2102
+ // don't always end in 0x0000. If they do, we don't want these
2103
+ // trailing bytes.
2104
+ size -= 2;
2105
+ }
2106
+ return rb_str_new(str, size);
2107
+ }
2108
+ SWIGINTERN size_t ID3_Field_set_binary(ID3_Field *self,VALUE data){
2109
+ StringValue(data);
2110
+ return self->Set((const uchar *)RSTRING_PTR(data),
2111
+ RSTRING_LEN(data));
2112
+ }
2113
+ SWIGINTERN size_t ID3_Field_set_unicode(ID3_Field *self,VALUE data){
2114
+ StringValue(data);
2115
+
2116
+ long len;
2117
+ unicode_t *unicode;
2118
+
2119
+ len = RSTRING_LEN(data) / sizeof(unicode_t);
2120
+ unicode = (unicode_t *)malloc(sizeof(unicode_t) * (len+1));
2121
+
2122
+ if (unicode == NULL) {
2123
+ rb_raise(rb_eNoMemError, "Couldn't allocate memory for Unicode data.");
2124
+ }
2125
+
2126
+ memcpy(unicode, RSTRING_PTR(data), sizeof(unicode_t) * len);
2127
+ // Unicode strings need 0x0000 at the end.
2128
+ unicode[len] = 0;
2129
+ size_t retval = self->Set(unicode);
2130
+
2131
+ // Free Unicode! ;)
2132
+ free(unicode);
2133
+ return retval;
2134
+ }
2135
+ swig_class SwigClassTag;
2136
+
2137
+ SWIGINTERN VALUE
2138
+ _wrap_new_Tag__SWIG_0(int argc, VALUE *argv, VALUE self) {
2139
+ char *arg1 = (char *) 0 ;
2140
+ int res1 ;
2141
+ char *buf1 = 0 ;
2142
+ int alloc1 = 0 ;
2143
+ ID3_Tag *result = 0 ;
2144
+
2145
+ if ((argc < 1) || (argc > 1)) {
2146
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2147
+ }
2148
+ res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
2149
+ if (!SWIG_IsOK(res1)) {
2150
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","ID3_Tag", 1, argv[0] ));
2151
+ }
2152
+ arg1 = reinterpret_cast< char * >(buf1);
2153
+ result = (ID3_Tag *)new ID3_Tag((char const *)arg1);
2154
+ DATA_PTR(self) = result;
2155
+ if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
2156
+ return self;
2157
+ fail:
2158
+ if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
2159
+ return Qnil;
2160
+ }
2161
+
2162
+
2163
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
2164
+ SWIGINTERN VALUE
2165
+ _wrap_Tag_allocate(VALUE self) {
2166
+ #else
2167
+ SWIGINTERN VALUE
2168
+ _wrap_Tag_allocate(int argc, VALUE *argv, VALUE self) {
2169
+ #endif
2170
+
2171
+
2172
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_ID3_Tag);
2173
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
2174
+ rb_obj_call_init(vresult, argc, argv);
2175
+ #endif
2176
+ return vresult;
2177
+ }
2178
+
2179
+
2180
+ SWIGINTERN VALUE
2181
+ _wrap_new_Tag__SWIG_1(int argc, VALUE *argv, VALUE self) {
2182
+ ID3_Tag *result = 0 ;
2183
+
2184
+ if ((argc < 0) || (argc > 0)) {
2185
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2186
+ }
2187
+ result = (ID3_Tag *)new ID3_Tag();
2188
+ DATA_PTR(self) = result;
2189
+ return self;
2190
+ fail:
2191
+ return Qnil;
2192
+ }
2193
+
2194
+
2195
+ SWIGINTERN VALUE _wrap_new_Tag(int nargs, VALUE *args, VALUE self) {
2196
+ int argc;
2197
+ VALUE argv[1];
2198
+ int ii;
2199
+
2200
+ argc = nargs;
2201
+ if (argc > 1) SWIG_fail;
2202
+ for (ii = 0; (ii < argc); ++ii) {
2203
+ argv[ii] = args[ii];
2204
+ }
2205
+ if (argc == 0) {
2206
+ return _wrap_new_Tag__SWIG_1(nargs, args, self);
2207
+ }
2208
+ if (argc == 1) {
2209
+ int _v;
2210
+ int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
2211
+ _v = SWIG_CheckState(res);
2212
+ if (_v) {
2213
+ return _wrap_new_Tag__SWIG_0(nargs, args, self);
2214
+ }
2215
+ }
2216
+
2217
+ fail:
2218
+ Ruby_Format_OverloadedError( argc, 1, "Tag.new",
2219
+ " Tag.new(char const *name)\n"
2220
+ " Tag.new()\n");
2221
+
2222
+ return Qnil;
2223
+ }
2224
+
2225
+
2226
+ SWIGINTERN void
2227
+ free_ID3_Tag(ID3_Tag *arg1) {
2228
+ delete arg1;
2229
+ }
2230
+
2231
+ SWIGINTERN VALUE
2232
+ _wrap_Tag_has_tag_type(int argc, VALUE *argv, VALUE self) {
2233
+ ID3_Tag *arg1 = (ID3_Tag *) 0 ;
2234
+ ID3_TagType arg2 ;
2235
+ void *argp1 = 0 ;
2236
+ int res1 = 0 ;
2237
+ int val2 ;
2238
+ int ecode2 = 0 ;
2239
+ bool result;
2240
+ VALUE vresult = Qnil;
2241
+
2242
+ if ((argc < 1) || (argc > 1)) {
2243
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2244
+ }
2245
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Tag, 0 | 0 );
2246
+ if (!SWIG_IsOK(res1)) {
2247
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ID3_Tag const *","HasTagType", 1, self ));
2248
+ }
2249
+ arg1 = reinterpret_cast< ID3_Tag * >(argp1);
2250
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
2251
+ if (!SWIG_IsOK(ecode2)) {
2252
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "ID3_TagType","HasTagType", 2, argv[0] ));
2253
+ }
2254
+ arg2 = static_cast< ID3_TagType >(val2);
2255
+ result = (bool)((ID3_Tag const *)arg1)->HasTagType(arg2);
2256
+ vresult = SWIG_From_bool(static_cast< bool >(result));
2257
+ return vresult;
2258
+ fail:
2259
+ return Qnil;
2260
+ }
2261
+
2262
+
2263
+ SWIGINTERN VALUE
2264
+ _wrap_Tag_link__SWIG_0(int argc, VALUE *argv, VALUE self) {
2265
+ ID3_Tag *arg1 = (ID3_Tag *) 0 ;
2266
+ char *arg2 = (char *) 0 ;
2267
+ flags_t arg3 ;
2268
+ void *argp1 = 0 ;
2269
+ int res1 = 0 ;
2270
+ int res2 ;
2271
+ char *buf2 = 0 ;
2272
+ int alloc2 = 0 ;
2273
+ unsigned int val3 ;
2274
+ int ecode3 = 0 ;
2275
+ size_t result;
2276
+ VALUE vresult = Qnil;
2277
+
2278
+ if ((argc < 2) || (argc > 2)) {
2279
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
2280
+ }
2281
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Tag, 0 | 0 );
2282
+ if (!SWIG_IsOK(res1)) {
2283
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ID3_Tag *","Link", 1, self ));
2284
+ }
2285
+ arg1 = reinterpret_cast< ID3_Tag * >(argp1);
2286
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
2287
+ if (!SWIG_IsOK(res2)) {
2288
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","Link", 2, argv[0] ));
2289
+ }
2290
+ arg2 = reinterpret_cast< char * >(buf2);
2291
+ ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
2292
+ if (!SWIG_IsOK(ecode3)) {
2293
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "flags_t","Link", 3, argv[1] ));
2294
+ }
2295
+ arg3 = static_cast< flags_t >(val3);
2296
+ result = (arg1)->Link((char const *)arg2,arg3);
2297
+ vresult = SWIG_From_size_t(static_cast< size_t >(result));
2298
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
2299
+ return vresult;
2300
+ fail:
2301
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
2302
+ return Qnil;
2303
+ }
2304
+
2305
+
2306
+ SWIGINTERN VALUE
2307
+ _wrap_Tag_link__SWIG_1(int argc, VALUE *argv, VALUE self) {
2308
+ ID3_Tag *arg1 = (ID3_Tag *) 0 ;
2309
+ char *arg2 = (char *) 0 ;
2310
+ void *argp1 = 0 ;
2311
+ int res1 = 0 ;
2312
+ int res2 ;
2313
+ char *buf2 = 0 ;
2314
+ int alloc2 = 0 ;
2315
+ size_t result;
2316
+ VALUE vresult = Qnil;
2317
+
2318
+ if ((argc < 1) || (argc > 1)) {
2319
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2320
+ }
2321
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Tag, 0 | 0 );
2322
+ if (!SWIG_IsOK(res1)) {
2323
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ID3_Tag *","Link", 1, self ));
2324
+ }
2325
+ arg1 = reinterpret_cast< ID3_Tag * >(argp1);
2326
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
2327
+ if (!SWIG_IsOK(res2)) {
2328
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","Link", 2, argv[0] ));
2329
+ }
2330
+ arg2 = reinterpret_cast< char * >(buf2);
2331
+ result = (arg1)->Link((char const *)arg2);
2332
+ vresult = SWIG_From_size_t(static_cast< size_t >(result));
2333
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
2334
+ return vresult;
2335
+ fail:
2336
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
2337
+ return Qnil;
2338
+ }
2339
+
2340
+
2341
+ SWIGINTERN VALUE _wrap_Tag_link(int nargs, VALUE *args, VALUE self) {
2342
+ int argc;
2343
+ VALUE argv[4];
2344
+ int ii;
2345
+
2346
+ argc = nargs + 1;
2347
+ argv[0] = self;
2348
+ if (argc > 4) SWIG_fail;
2349
+ for (ii = 1; (ii < argc); ++ii) {
2350
+ argv[ii] = args[ii-1];
2351
+ }
2352
+ if (argc == 2) {
2353
+ int _v;
2354
+ void *vptr = 0;
2355
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ID3_Tag, 0);
2356
+ _v = SWIG_CheckState(res);
2357
+ if (_v) {
2358
+ int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
2359
+ _v = SWIG_CheckState(res);
2360
+ if (_v) {
2361
+ return _wrap_Tag_link__SWIG_1(nargs, args, self);
2362
+ }
2363
+ }
2364
+ }
2365
+ if (argc == 3) {
2366
+ int _v;
2367
+ void *vptr = 0;
2368
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ID3_Tag, 0);
2369
+ _v = SWIG_CheckState(res);
2370
+ if (_v) {
2371
+ int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
2372
+ _v = SWIG_CheckState(res);
2373
+ if (_v) {
2374
+ {
2375
+ int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
2376
+ _v = SWIG_CheckState(res);
2377
+ }
2378
+ if (_v) {
2379
+ return _wrap_Tag_link__SWIG_0(nargs, args, self);
2380
+ }
2381
+ }
2382
+ }
2383
+ }
2384
+
2385
+ fail:
2386
+ Ruby_Format_OverloadedError( argc, 4, "Tag.link",
2387
+ " size_t Tag.link(char const *filename, flags_t flags)\n"
2388
+ " size_t Tag.link(char const *filename)\n");
2389
+
2390
+ return Qnil;
2391
+ }
2392
+
2393
+
2394
+ SWIGINTERN VALUE
2395
+ _wrap_Tag_update__SWIG_0(int argc, VALUE *argv, VALUE self) {
2396
+ ID3_Tag *arg1 = (ID3_Tag *) 0 ;
2397
+ flags_t arg2 ;
2398
+ void *argp1 = 0 ;
2399
+ int res1 = 0 ;
2400
+ unsigned int val2 ;
2401
+ int ecode2 = 0 ;
2402
+ flags_t result;
2403
+ VALUE vresult = Qnil;
2404
+
2405
+ if ((argc < 1) || (argc > 1)) {
2406
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2407
+ }
2408
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Tag, 0 | 0 );
2409
+ if (!SWIG_IsOK(res1)) {
2410
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ID3_Tag *","Update", 1, self ));
2411
+ }
2412
+ arg1 = reinterpret_cast< ID3_Tag * >(argp1);
2413
+ ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
2414
+ if (!SWIG_IsOK(ecode2)) {
2415
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "flags_t","Update", 2, argv[0] ));
2416
+ }
2417
+ arg2 = static_cast< flags_t >(val2);
2418
+ result = (flags_t)(arg1)->Update(arg2);
2419
+ vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
2420
+ return vresult;
2421
+ fail:
2422
+ return Qnil;
2423
+ }
2424
+
2425
+
2426
+ SWIGINTERN VALUE
2427
+ _wrap_Tag_update__SWIG_1(int argc, VALUE *argv, VALUE self) {
2428
+ ID3_Tag *arg1 = (ID3_Tag *) 0 ;
2429
+ void *argp1 = 0 ;
2430
+ int res1 = 0 ;
2431
+ flags_t result;
2432
+ VALUE vresult = Qnil;
2433
+
2434
+ if ((argc < 0) || (argc > 0)) {
2435
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2436
+ }
2437
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Tag, 0 | 0 );
2438
+ if (!SWIG_IsOK(res1)) {
2439
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ID3_Tag *","Update", 1, self ));
2440
+ }
2441
+ arg1 = reinterpret_cast< ID3_Tag * >(argp1);
2442
+ result = (flags_t)(arg1)->Update();
2443
+ vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
2444
+ return vresult;
2445
+ fail:
2446
+ return Qnil;
2447
+ }
2448
+
2449
+
2450
+ SWIGINTERN VALUE _wrap_Tag_update(int nargs, VALUE *args, VALUE self) {
2451
+ int argc;
2452
+ VALUE argv[3];
2453
+ int ii;
2454
+
2455
+ argc = nargs + 1;
2456
+ argv[0] = self;
2457
+ if (argc > 3) SWIG_fail;
2458
+ for (ii = 1; (ii < argc); ++ii) {
2459
+ argv[ii] = args[ii-1];
2460
+ }
2461
+ if (argc == 1) {
2462
+ int _v;
2463
+ void *vptr = 0;
2464
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ID3_Tag, 0);
2465
+ _v = SWIG_CheckState(res);
2466
+ if (_v) {
2467
+ return _wrap_Tag_update__SWIG_1(nargs, args, self);
2468
+ }
2469
+ }
2470
+ if (argc == 2) {
2471
+ int _v;
2472
+ void *vptr = 0;
2473
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ID3_Tag, 0);
2474
+ _v = SWIG_CheckState(res);
2475
+ if (_v) {
2476
+ {
2477
+ int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
2478
+ _v = SWIG_CheckState(res);
2479
+ }
2480
+ if (_v) {
2481
+ return _wrap_Tag_update__SWIG_0(nargs, args, self);
2482
+ }
2483
+ }
2484
+ }
2485
+
2486
+ fail:
2487
+ Ruby_Format_OverloadedError( argc, 3, "Tag.update",
2488
+ " flags_t Tag.update(flags_t flags)\n"
2489
+ " flags_t Tag.update()\n");
2490
+
2491
+ return Qnil;
2492
+ }
2493
+
2494
+
2495
+ SWIGINTERN VALUE
2496
+ _wrap_Tag_strip__SWIG_0(int argc, VALUE *argv, VALUE self) {
2497
+ ID3_Tag *arg1 = (ID3_Tag *) 0 ;
2498
+ flags_t arg2 ;
2499
+ void *argp1 = 0 ;
2500
+ int res1 = 0 ;
2501
+ unsigned int val2 ;
2502
+ int ecode2 = 0 ;
2503
+ flags_t result;
2504
+ VALUE vresult = Qnil;
2505
+
2506
+ if ((argc < 1) || (argc > 1)) {
2507
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2508
+ }
2509
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Tag, 0 | 0 );
2510
+ if (!SWIG_IsOK(res1)) {
2511
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ID3_Tag *","Strip", 1, self ));
2512
+ }
2513
+ arg1 = reinterpret_cast< ID3_Tag * >(argp1);
2514
+ ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
2515
+ if (!SWIG_IsOK(ecode2)) {
2516
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "flags_t","Strip", 2, argv[0] ));
2517
+ }
2518
+ arg2 = static_cast< flags_t >(val2);
2519
+ result = (flags_t)(arg1)->Strip(arg2);
2520
+ vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
2521
+ return vresult;
2522
+ fail:
2523
+ return Qnil;
2524
+ }
2525
+
2526
+
2527
+ SWIGINTERN VALUE
2528
+ _wrap_Tag_strip__SWIG_1(int argc, VALUE *argv, VALUE self) {
2529
+ ID3_Tag *arg1 = (ID3_Tag *) 0 ;
2530
+ void *argp1 = 0 ;
2531
+ int res1 = 0 ;
2532
+ flags_t result;
2533
+ VALUE vresult = Qnil;
2534
+
2535
+ if ((argc < 0) || (argc > 0)) {
2536
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2537
+ }
2538
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Tag, 0 | 0 );
2539
+ if (!SWIG_IsOK(res1)) {
2540
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ID3_Tag *","Strip", 1, self ));
2541
+ }
2542
+ arg1 = reinterpret_cast< ID3_Tag * >(argp1);
2543
+ result = (flags_t)(arg1)->Strip();
2544
+ vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
2545
+ return vresult;
2546
+ fail:
2547
+ return Qnil;
2548
+ }
2549
+
2550
+
2551
+ SWIGINTERN VALUE _wrap_Tag_strip(int nargs, VALUE *args, VALUE self) {
2552
+ int argc;
2553
+ VALUE argv[3];
2554
+ int ii;
2555
+
2556
+ argc = nargs + 1;
2557
+ argv[0] = self;
2558
+ if (argc > 3) SWIG_fail;
2559
+ for (ii = 1; (ii < argc); ++ii) {
2560
+ argv[ii] = args[ii-1];
2561
+ }
2562
+ if (argc == 1) {
2563
+ int _v;
2564
+ void *vptr = 0;
2565
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ID3_Tag, 0);
2566
+ _v = SWIG_CheckState(res);
2567
+ if (_v) {
2568
+ return _wrap_Tag_strip__SWIG_1(nargs, args, self);
2569
+ }
2570
+ }
2571
+ if (argc == 2) {
2572
+ int _v;
2573
+ void *vptr = 0;
2574
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ID3_Tag, 0);
2575
+ _v = SWIG_CheckState(res);
2576
+ if (_v) {
2577
+ {
2578
+ int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
2579
+ _v = SWIG_CheckState(res);
2580
+ }
2581
+ if (_v) {
2582
+ return _wrap_Tag_strip__SWIG_0(nargs, args, self);
2583
+ }
2584
+ }
2585
+ }
2586
+
2587
+ fail:
2588
+ Ruby_Format_OverloadedError( argc, 3, "Tag.strip",
2589
+ " flags_t Tag.strip(flags_t flags)\n"
2590
+ " flags_t Tag.strip()\n");
2591
+
2592
+ return Qnil;
2593
+ }
2594
+
2595
+
2596
+ SWIGINTERN VALUE
2597
+ _wrap_Tag_clear(int argc, VALUE *argv, VALUE self) {
2598
+ ID3_Tag *arg1 = (ID3_Tag *) 0 ;
2599
+ void *argp1 = 0 ;
2600
+ int res1 = 0 ;
2601
+
2602
+ if ((argc < 0) || (argc > 0)) {
2603
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2604
+ }
2605
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Tag, 0 | 0 );
2606
+ if (!SWIG_IsOK(res1)) {
2607
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ID3_Tag *","Clear", 1, self ));
2608
+ }
2609
+ arg1 = reinterpret_cast< ID3_Tag * >(argp1);
2610
+ (arg1)->Clear();
2611
+ return Qnil;
2612
+ fail:
2613
+ return Qnil;
2614
+ }
2615
+
2616
+
2617
+ SWIGINTERN VALUE
2618
+ _wrap_Tag_remove_frame(int argc, VALUE *argv, VALUE self) {
2619
+ ID3_Tag *arg1 = (ID3_Tag *) 0 ;
2620
+ ID3_Frame *arg2 = (ID3_Frame *) 0 ;
2621
+ void *argp1 = 0 ;
2622
+ int res1 = 0 ;
2623
+ void *argp2 = 0 ;
2624
+ int res2 = 0 ;
2625
+ ID3_Frame *result = 0 ;
2626
+ VALUE vresult = Qnil;
2627
+
2628
+ if ((argc < 1) || (argc > 1)) {
2629
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2630
+ }
2631
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Tag, 0 | 0 );
2632
+ if (!SWIG_IsOK(res1)) {
2633
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ID3_Tag *","RemoveFrame", 1, self ));
2634
+ }
2635
+ arg1 = reinterpret_cast< ID3_Tag * >(argp1);
2636
+ res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_ID3_Frame, 0 | 0 );
2637
+ if (!SWIG_IsOK(res2)) {
2638
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "ID3_Frame const *","RemoveFrame", 2, argv[0] ));
2639
+ }
2640
+ arg2 = reinterpret_cast< ID3_Frame * >(argp2);
2641
+ result = (ID3_Frame *)(arg1)->RemoveFrame((ID3_Frame const *)arg2);
2642
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ID3_Frame, 0 | 0 );
2643
+ return vresult;
2644
+ fail:
2645
+ return Qnil;
2646
+ }
2647
+
2648
+
2649
+ SWIGINTERN VALUE
2650
+ _wrap_Tag_add_frame(int argc, VALUE *argv, VALUE self) {
2651
+ ID3_Tag *arg1 = (ID3_Tag *) 0 ;
2652
+ ID3_Frame *arg2 = (ID3_Frame *) 0 ;
2653
+ void *argp1 = 0 ;
2654
+ int res1 = 0 ;
2655
+ void *argp2 = 0 ;
2656
+ int res2 = 0 ;
2657
+
2658
+ if ((argc < 1) || (argc > 1)) {
2659
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2660
+ }
2661
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Tag, 0 | 0 );
2662
+ if (!SWIG_IsOK(res1)) {
2663
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ID3_Tag *","AddFrame", 1, self ));
2664
+ }
2665
+ arg1 = reinterpret_cast< ID3_Tag * >(argp1);
2666
+ res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_ID3_Frame, 0 | 0 );
2667
+ if (!SWIG_IsOK(res2)) {
2668
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "ID3_Frame const *","AddFrame", 2, argv[0] ));
2669
+ }
2670
+ arg2 = reinterpret_cast< ID3_Frame * >(argp2);
2671
+ (arg1)->AddFrame((ID3_Frame const *)arg2);
2672
+ return Qnil;
2673
+ fail:
2674
+ return Qnil;
2675
+ }
2676
+
2677
+
2678
+ SWIGINTERN VALUE
2679
+ _wrap_Tag_get_filename(int argc, VALUE *argv, VALUE self) {
2680
+ ID3_Tag *arg1 = (ID3_Tag *) 0 ;
2681
+ void *argp1 = 0 ;
2682
+ int res1 = 0 ;
2683
+ char *result = 0 ;
2684
+ VALUE vresult = Qnil;
2685
+
2686
+ if ((argc < 0) || (argc > 0)) {
2687
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2688
+ }
2689
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Tag, 0 | 0 );
2690
+ if (!SWIG_IsOK(res1)) {
2691
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ID3_Tag const *","GetFileName", 1, self ));
2692
+ }
2693
+ arg1 = reinterpret_cast< ID3_Tag * >(argp1);
2694
+ result = (char *)((ID3_Tag const *)arg1)->GetFileName();
2695
+ vresult = SWIG_FromCharPtr((const char *)result);
2696
+ return vresult;
2697
+ fail:
2698
+ return Qnil;
2699
+ }
2700
+
2701
+
2702
+ SWIGINTERN VALUE
2703
+ _wrap_Tag_set_padding(int argc, VALUE *argv, VALUE self) {
2704
+ ID3_Tag *arg1 = (ID3_Tag *) 0 ;
2705
+ bool arg2 ;
2706
+ void *argp1 = 0 ;
2707
+ int res1 = 0 ;
2708
+ bool val2 ;
2709
+ int ecode2 = 0 ;
2710
+ bool result;
2711
+ VALUE vresult = Qnil;
2712
+
2713
+ if ((argc < 1) || (argc > 1)) {
2714
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2715
+ }
2716
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Tag, 0 | 0 );
2717
+ if (!SWIG_IsOK(res1)) {
2718
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ID3_Tag *","SetPadding", 1, self ));
2719
+ }
2720
+ arg1 = reinterpret_cast< ID3_Tag * >(argp1);
2721
+ ecode2 = SWIG_AsVal_bool(argv[0], &val2);
2722
+ if (!SWIG_IsOK(ecode2)) {
2723
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","SetPadding", 2, argv[0] ));
2724
+ }
2725
+ arg2 = static_cast< bool >(val2);
2726
+ result = (bool)(arg1)->SetPadding(arg2);
2727
+ vresult = SWIG_From_bool(static_cast< bool >(result));
2728
+ return vresult;
2729
+ fail:
2730
+ return Qnil;
2731
+ }
2732
+
2733
+
2734
+ SWIGINTERN VALUE
2735
+ _wrap_Tag_size(int argc, VALUE *argv, VALUE self) {
2736
+ ID3_Tag *arg1 = (ID3_Tag *) 0 ;
2737
+ void *argp1 = 0 ;
2738
+ int res1 = 0 ;
2739
+ size_t result;
2740
+ VALUE vresult = Qnil;
2741
+
2742
+ if ((argc < 0) || (argc > 0)) {
2743
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2744
+ }
2745
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Tag, 0 | 0 );
2746
+ if (!SWIG_IsOK(res1)) {
2747
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ID3_Tag const *","Size", 1, self ));
2748
+ }
2749
+ arg1 = reinterpret_cast< ID3_Tag * >(argp1);
2750
+ result = ((ID3_Tag const *)arg1)->Size();
2751
+ vresult = SWIG_From_size_t(static_cast< size_t >(result));
2752
+ return vresult;
2753
+ fail:
2754
+ return Qnil;
2755
+ }
2756
+
2757
+
2758
+ SWIGINTERN VALUE
2759
+ _wrap_Tag_find(int argc, VALUE *argv, VALUE self) {
2760
+ ID3_Tag *arg1 = (ID3_Tag *) 0 ;
2761
+ ID3_FrameID arg2 ;
2762
+ void *argp1 = 0 ;
2763
+ int res1 = 0 ;
2764
+ int val2 ;
2765
+ int ecode2 = 0 ;
2766
+ ID3_Frame *result = 0 ;
2767
+ VALUE vresult = Qnil;
2768
+
2769
+ if ((argc < 1) || (argc > 1)) {
2770
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2771
+ }
2772
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Tag, 0 | 0 );
2773
+ if (!SWIG_IsOK(res1)) {
2774
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ID3_Tag const *","Find", 1, self ));
2775
+ }
2776
+ arg1 = reinterpret_cast< ID3_Tag * >(argp1);
2777
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
2778
+ if (!SWIG_IsOK(ecode2)) {
2779
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "ID3_FrameID","Find", 2, argv[0] ));
2780
+ }
2781
+ arg2 = static_cast< ID3_FrameID >(val2);
2782
+ result = (ID3_Frame *)((ID3_Tag const *)arg1)->Find(arg2);
2783
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ID3_Frame, 0 | 0 );
2784
+ return vresult;
2785
+ fail:
2786
+ return Qnil;
2787
+ }
2788
+
2789
+
2790
+ SWIGINTERN VALUE
2791
+ _wrap_Tag_create_iterator(int argc, VALUE *argv, VALUE self) {
2792
+ ID3_Tag *arg1 = (ID3_Tag *) 0 ;
2793
+ void *argp1 = 0 ;
2794
+ int res1 = 0 ;
2795
+ ID3_Tag::Iterator *result = 0 ;
2796
+ VALUE vresult = Qnil;
2797
+
2798
+ if ((argc < 0) || (argc > 0)) {
2799
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2800
+ }
2801
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Tag, 0 | 0 );
2802
+ if (!SWIG_IsOK(res1)) {
2803
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ID3_Tag *","CreateIterator", 1, self ));
2804
+ }
2805
+ arg1 = reinterpret_cast< ID3_Tag * >(argp1);
2806
+ result = (ID3_Tag::Iterator *)(arg1)->CreateIterator();
2807
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ID3_Tag__Iterator, SWIG_POINTER_OWN | 0 );
2808
+ return vresult;
2809
+ fail:
2810
+ return Qnil;
2811
+ }
2812
+
2813
+
2814
+ swig_class SwigClassTag_Iterator;
2815
+
2816
+ SWIGINTERN VALUE
2817
+ _wrap_Tag_Iterator_get_next(int argc, VALUE *argv, VALUE self) {
2818
+ ID3_Tag::Iterator *arg1 = (ID3_Tag::Iterator *) 0 ;
2819
+ void *argp1 = 0 ;
2820
+ int res1 = 0 ;
2821
+ ID3_Frame *result = 0 ;
2822
+ VALUE vresult = Qnil;
2823
+
2824
+ if ((argc < 0) || (argc > 0)) {
2825
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2826
+ }
2827
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Tag__Iterator, 0 | 0 );
2828
+ if (!SWIG_IsOK(res1)) {
2829
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ID3_Tag::Iterator *","GetNext", 1, self ));
2830
+ }
2831
+ arg1 = reinterpret_cast< ID3_Tag::Iterator * >(argp1);
2832
+ result = (ID3_Frame *)(arg1)->GetNext();
2833
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ID3_Frame, 0 | 0 );
2834
+ return vresult;
2835
+ fail:
2836
+ return Qnil;
2837
+ }
2838
+
2839
+
2840
+ SWIGINTERN void
2841
+ free_ID3_Tag_Iterator(ID3_Tag::Iterator *arg1) {
2842
+ delete arg1;
2843
+ }
2844
+
2845
+ swig_class SwigClassFrame;
2846
+
2847
+ SWIGINTERN VALUE
2848
+ _wrap_new_Frame__SWIG_0(int argc, VALUE *argv, VALUE self) {
2849
+ ID3_FrameID arg1 ;
2850
+ int val1 ;
2851
+ int ecode1 = 0 ;
2852
+ ID3_Frame *result = 0 ;
2853
+
2854
+ if ((argc < 1) || (argc > 1)) {
2855
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2856
+ }
2857
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
2858
+ if (!SWIG_IsOK(ecode1)) {
2859
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "ID3_FrameID","ID3_Frame", 1, argv[0] ));
2860
+ }
2861
+ arg1 = static_cast< ID3_FrameID >(val1);
2862
+ result = (ID3_Frame *)new ID3_Frame(arg1);
2863
+ DATA_PTR(self) = result;
2864
+ return self;
2865
+ fail:
2866
+ return Qnil;
2867
+ }
2868
+
2869
+
2870
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
2871
+ SWIGINTERN VALUE
2872
+ _wrap_Frame_allocate(VALUE self) {
2873
+ #else
2874
+ SWIGINTERN VALUE
2875
+ _wrap_Frame_allocate(int argc, VALUE *argv, VALUE self) {
2876
+ #endif
2877
+
2878
+
2879
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_ID3_Frame);
2880
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
2881
+ rb_obj_call_init(vresult, argc, argv);
2882
+ #endif
2883
+ return vresult;
2884
+ }
2885
+
2886
+
2887
+ SWIGINTERN VALUE
2888
+ _wrap_new_Frame__SWIG_1(int argc, VALUE *argv, VALUE self) {
2889
+ ID3_Frame *result = 0 ;
2890
+
2891
+ if ((argc < 0) || (argc > 0)) {
2892
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2893
+ }
2894
+ result = (ID3_Frame *)new ID3_Frame();
2895
+ DATA_PTR(self) = result;
2896
+ return self;
2897
+ fail:
2898
+ return Qnil;
2899
+ }
2900
+
2901
+
2902
+ SWIGINTERN VALUE _wrap_new_Frame(int nargs, VALUE *args, VALUE self) {
2903
+ int argc;
2904
+ VALUE argv[1];
2905
+ int ii;
2906
+
2907
+ argc = nargs;
2908
+ if (argc > 1) SWIG_fail;
2909
+ for (ii = 0; (ii < argc); ++ii) {
2910
+ argv[ii] = args[ii];
2911
+ }
2912
+ if (argc == 0) {
2913
+ return _wrap_new_Frame__SWIG_1(nargs, args, self);
2914
+ }
2915
+ if (argc == 1) {
2916
+ int _v;
2917
+ {
2918
+ int res = SWIG_AsVal_int(argv[0], NULL);
2919
+ _v = SWIG_CheckState(res);
2920
+ }
2921
+ if (_v) {
2922
+ return _wrap_new_Frame__SWIG_0(nargs, args, self);
2923
+ }
2924
+ }
2925
+
2926
+ fail:
2927
+ Ruby_Format_OverloadedError( argc, 1, "Frame.new",
2928
+ " Frame.new(ID3_FrameID id)\n"
2929
+ " Frame.new()\n");
2930
+
2931
+ return Qnil;
2932
+ }
2933
+
2934
+
2935
+ SWIGINTERN void
2936
+ free_ID3_Frame(ID3_Frame *arg1) {
2937
+ delete arg1;
2938
+ }
2939
+
2940
+ SWIGINTERN VALUE
2941
+ _wrap_Frame_get_field(int argc, VALUE *argv, VALUE self) {
2942
+ ID3_Frame *arg1 = (ID3_Frame *) 0 ;
2943
+ ID3_FieldID arg2 ;
2944
+ void *argp1 = 0 ;
2945
+ int res1 = 0 ;
2946
+ int val2 ;
2947
+ int ecode2 = 0 ;
2948
+ ID3_Field *result = 0 ;
2949
+ VALUE vresult = Qnil;
2950
+
2951
+ if ((argc < 1) || (argc > 1)) {
2952
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2953
+ }
2954
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Frame, 0 | 0 );
2955
+ if (!SWIG_IsOK(res1)) {
2956
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ID3_Frame const *","GetField", 1, self ));
2957
+ }
2958
+ arg1 = reinterpret_cast< ID3_Frame * >(argp1);
2959
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
2960
+ if (!SWIG_IsOK(ecode2)) {
2961
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "ID3_FieldID","GetField", 2, argv[0] ));
2962
+ }
2963
+ arg2 = static_cast< ID3_FieldID >(val2);
2964
+ result = (ID3_Field *)((ID3_Frame const *)arg1)->GetField(arg2);
2965
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ID3_Field, 0 | 0 );
2966
+ return vresult;
2967
+ fail:
2968
+ return Qnil;
2969
+ }
2970
+
2971
+
2972
+ SWIGINTERN VALUE
2973
+ _wrap_Frame_get_id(int argc, VALUE *argv, VALUE self) {
2974
+ ID3_Frame *arg1 = (ID3_Frame *) 0 ;
2975
+ void *argp1 = 0 ;
2976
+ int res1 = 0 ;
2977
+ ID3_FrameID result;
2978
+ VALUE vresult = Qnil;
2979
+
2980
+ if ((argc < 0) || (argc > 0)) {
2981
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2982
+ }
2983
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Frame, 0 | 0 );
2984
+ if (!SWIG_IsOK(res1)) {
2985
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ID3_Frame const *","GetID", 1, self ));
2986
+ }
2987
+ arg1 = reinterpret_cast< ID3_Frame * >(argp1);
2988
+ result = (ID3_FrameID)((ID3_Frame const *)arg1)->GetID();
2989
+ vresult = SWIG_From_int(static_cast< int >(result));
2990
+ return vresult;
2991
+ fail:
2992
+ return Qnil;
2993
+ }
2994
+
2995
+
2996
+ swig_class SwigClassField;
2997
+
2998
+ SWIGINTERN VALUE
2999
+ _wrap_Field_get_type(int argc, VALUE *argv, VALUE self) {
3000
+ ID3_Field *arg1 = (ID3_Field *) 0 ;
3001
+ void *argp1 = 0 ;
3002
+ int res1 = 0 ;
3003
+ ID3_FieldType result;
3004
+ VALUE vresult = Qnil;
3005
+
3006
+ if ((argc < 0) || (argc > 0)) {
3007
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3008
+ }
3009
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Field, 0 | 0 );
3010
+ if (!SWIG_IsOK(res1)) {
3011
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ID3_Field const *","GetType", 1, self ));
3012
+ }
3013
+ arg1 = reinterpret_cast< ID3_Field * >(argp1);
3014
+ result = (ID3_FieldType)((ID3_Field const *)arg1)->GetType();
3015
+ vresult = SWIG_From_int(static_cast< int >(result));
3016
+ return vresult;
3017
+ fail:
3018
+ return Qnil;
3019
+ }
3020
+
3021
+
3022
+ SWIGINTERN VALUE
3023
+ _wrap_Field_get_encoding(int argc, VALUE *argv, VALUE self) {
3024
+ ID3_Field *arg1 = (ID3_Field *) 0 ;
3025
+ void *argp1 = 0 ;
3026
+ int res1 = 0 ;
3027
+ ID3_TextEnc result;
3028
+ VALUE vresult = Qnil;
3029
+
3030
+ if ((argc < 0) || (argc > 0)) {
3031
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3032
+ }
3033
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Field, 0 | 0 );
3034
+ if (!SWIG_IsOK(res1)) {
3035
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ID3_Field const *","GetEncoding", 1, self ));
3036
+ }
3037
+ arg1 = reinterpret_cast< ID3_Field * >(argp1);
3038
+ result = (ID3_TextEnc)((ID3_Field const *)arg1)->GetEncoding();
3039
+ vresult = SWIG_From_int(static_cast< int >(result));
3040
+ return vresult;
3041
+ fail:
3042
+ return Qnil;
3043
+ }
3044
+
3045
+
3046
+ SWIGINTERN VALUE
3047
+ _wrap_Field_get_integer(int argc, VALUE *argv, VALUE self) {
3048
+ ID3_Field *arg1 = (ID3_Field *) 0 ;
3049
+ void *argp1 = 0 ;
3050
+ int res1 = 0 ;
3051
+ uint32 result;
3052
+ VALUE vresult = Qnil;
3053
+
3054
+ if ((argc < 0) || (argc > 0)) {
3055
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3056
+ }
3057
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Field, 0 | 0 );
3058
+ if (!SWIG_IsOK(res1)) {
3059
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ID3_Field const *","Get", 1, self ));
3060
+ }
3061
+ arg1 = reinterpret_cast< ID3_Field * >(argp1);
3062
+ result = (uint32)((ID3_Field const *)arg1)->Get();
3063
+ vresult = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result));
3064
+ return vresult;
3065
+ fail:
3066
+ return Qnil;
3067
+ }
3068
+
3069
+
3070
+ SWIGINTERN VALUE
3071
+ _wrap_Field_get_ascii(int argc, VALUE *argv, VALUE self) {
3072
+ ID3_Field *arg1 = (ID3_Field *) 0 ;
3073
+ void *argp1 = 0 ;
3074
+ int res1 = 0 ;
3075
+ char *result = 0 ;
3076
+ VALUE vresult = Qnil;
3077
+
3078
+ if ((argc < 0) || (argc > 0)) {
3079
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3080
+ }
3081
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Field, 0 | 0 );
3082
+ if (!SWIG_IsOK(res1)) {
3083
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ID3_Field const *","GetRawText", 1, self ));
3084
+ }
3085
+ arg1 = reinterpret_cast< ID3_Field * >(argp1);
3086
+ result = (char *)((ID3_Field const *)arg1)->GetRawText();
3087
+ vresult = SWIG_FromCharPtr((const char *)result);
3088
+ return vresult;
3089
+ fail:
3090
+ return Qnil;
3091
+ }
3092
+
3093
+
3094
+ SWIGINTERN VALUE
3095
+ _wrap_Field_get_binary(int argc, VALUE *argv, VALUE self) {
3096
+ ID3_Field *arg1 = (ID3_Field *) 0 ;
3097
+ void *argp1 = 0 ;
3098
+ int res1 = 0 ;
3099
+ VALUE result;
3100
+ VALUE vresult = Qnil;
3101
+
3102
+ if ((argc < 0) || (argc > 0)) {
3103
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3104
+ }
3105
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Field, 0 | 0 );
3106
+ if (!SWIG_IsOK(res1)) {
3107
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ID3_Field *","get_binary", 1, self ));
3108
+ }
3109
+ arg1 = reinterpret_cast< ID3_Field * >(argp1);
3110
+ result = (VALUE)ID3_Field_get_binary(arg1);
3111
+ vresult = result;
3112
+ return vresult;
3113
+ fail:
3114
+ return Qnil;
3115
+ }
3116
+
3117
+
3118
+ SWIGINTERN VALUE
3119
+ _wrap_Field_get_unicode(int argc, VALUE *argv, VALUE self) {
3120
+ ID3_Field *arg1 = (ID3_Field *) 0 ;
3121
+ void *argp1 = 0 ;
3122
+ int res1 = 0 ;
3123
+ VALUE result;
3124
+ VALUE vresult = Qnil;
3125
+
3126
+ if ((argc < 0) || (argc > 0)) {
3127
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3128
+ }
3129
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Field, 0 | 0 );
3130
+ if (!SWIG_IsOK(res1)) {
3131
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ID3_Field *","get_unicode", 1, self ));
3132
+ }
3133
+ arg1 = reinterpret_cast< ID3_Field * >(argp1);
3134
+ result = (VALUE)ID3_Field_get_unicode(arg1);
3135
+ vresult = result;
3136
+ return vresult;
3137
+ fail:
3138
+ return Qnil;
3139
+ }
3140
+
3141
+
3142
+ SWIGINTERN VALUE
3143
+ _wrap_Field_set_encoding(int argc, VALUE *argv, VALUE self) {
3144
+ ID3_Field *arg1 = (ID3_Field *) 0 ;
3145
+ ID3_TextEnc arg2 ;
3146
+ void *argp1 = 0 ;
3147
+ int res1 = 0 ;
3148
+ int val2 ;
3149
+ int ecode2 = 0 ;
3150
+ bool result;
3151
+ VALUE vresult = Qnil;
3152
+
3153
+ if ((argc < 1) || (argc > 1)) {
3154
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3155
+ }
3156
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Field, 0 | 0 );
3157
+ if (!SWIG_IsOK(res1)) {
3158
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ID3_Field *","SetEncoding", 1, self ));
3159
+ }
3160
+ arg1 = reinterpret_cast< ID3_Field * >(argp1);
3161
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
3162
+ if (!SWIG_IsOK(ecode2)) {
3163
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "ID3_TextEnc","SetEncoding", 2, argv[0] ));
3164
+ }
3165
+ arg2 = static_cast< ID3_TextEnc >(val2);
3166
+ result = (bool)(arg1)->SetEncoding(arg2);
3167
+ vresult = SWIG_From_bool(static_cast< bool >(result));
3168
+ return vresult;
3169
+ fail:
3170
+ return Qnil;
3171
+ }
3172
+
3173
+
3174
+ SWIGINTERN VALUE
3175
+ _wrap_Field_set_integer(int argc, VALUE *argv, VALUE self) {
3176
+ ID3_Field *arg1 = (ID3_Field *) 0 ;
3177
+ uint32 arg2 ;
3178
+ void *argp1 = 0 ;
3179
+ int res1 = 0 ;
3180
+ unsigned long val2 ;
3181
+ int ecode2 = 0 ;
3182
+
3183
+ if ((argc < 1) || (argc > 1)) {
3184
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3185
+ }
3186
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Field, 0 | 0 );
3187
+ if (!SWIG_IsOK(res1)) {
3188
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ID3_Field *","Set", 1, self ));
3189
+ }
3190
+ arg1 = reinterpret_cast< ID3_Field * >(argp1);
3191
+ ecode2 = SWIG_AsVal_unsigned_SS_long(argv[0], &val2);
3192
+ if (!SWIG_IsOK(ecode2)) {
3193
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "uint32","Set", 2, argv[0] ));
3194
+ }
3195
+ arg2 = static_cast< uint32 >(val2);
3196
+ (arg1)->Set(arg2);
3197
+ return Qnil;
3198
+ fail:
3199
+ return Qnil;
3200
+ }
3201
+
3202
+
3203
+ SWIGINTERN VALUE
3204
+ _wrap_Field_set_ascii(int argc, VALUE *argv, VALUE self) {
3205
+ ID3_Field *arg1 = (ID3_Field *) 0 ;
3206
+ char *arg2 = (char *) 0 ;
3207
+ void *argp1 = 0 ;
3208
+ int res1 = 0 ;
3209
+ int res2 ;
3210
+ char *buf2 = 0 ;
3211
+ int alloc2 = 0 ;
3212
+ size_t result;
3213
+ VALUE vresult = Qnil;
3214
+
3215
+ if ((argc < 1) || (argc > 1)) {
3216
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3217
+ }
3218
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Field, 0 | 0 );
3219
+ if (!SWIG_IsOK(res1)) {
3220
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ID3_Field *","Set", 1, self ));
3221
+ }
3222
+ arg1 = reinterpret_cast< ID3_Field * >(argp1);
3223
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
3224
+ if (!SWIG_IsOK(res2)) {
3225
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","Set", 2, argv[0] ));
3226
+ }
3227
+ arg2 = reinterpret_cast< char * >(buf2);
3228
+ result = (arg1)->Set((char const *)arg2);
3229
+ vresult = SWIG_From_size_t(static_cast< size_t >(result));
3230
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
3231
+ return vresult;
3232
+ fail:
3233
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
3234
+ return Qnil;
3235
+ }
3236
+
3237
+
3238
+ SWIGINTERN VALUE
3239
+ _wrap_Field_set_binary(int argc, VALUE *argv, VALUE self) {
3240
+ ID3_Field *arg1 = (ID3_Field *) 0 ;
3241
+ VALUE arg2 = (VALUE) 0 ;
3242
+ void *argp1 = 0 ;
3243
+ int res1 = 0 ;
3244
+ size_t result;
3245
+ VALUE vresult = Qnil;
3246
+
3247
+ if ((argc < 1) || (argc > 1)) {
3248
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3249
+ }
3250
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Field, 0 | 0 );
3251
+ if (!SWIG_IsOK(res1)) {
3252
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ID3_Field *","set_binary", 1, self ));
3253
+ }
3254
+ arg1 = reinterpret_cast< ID3_Field * >(argp1);
3255
+ arg2 = argv[0];
3256
+ result = ID3_Field_set_binary(arg1,arg2);
3257
+ vresult = SWIG_From_size_t(static_cast< size_t >(result));
3258
+ return vresult;
3259
+ fail:
3260
+ return Qnil;
3261
+ }
3262
+
3263
+
3264
+ SWIGINTERN VALUE
3265
+ _wrap_Field_set_unicode(int argc, VALUE *argv, VALUE self) {
3266
+ ID3_Field *arg1 = (ID3_Field *) 0 ;
3267
+ VALUE arg2 = (VALUE) 0 ;
3268
+ void *argp1 = 0 ;
3269
+ int res1 = 0 ;
3270
+ size_t result;
3271
+ VALUE vresult = Qnil;
3272
+
3273
+ if ((argc < 1) || (argc > 1)) {
3274
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3275
+ }
3276
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Field, 0 | 0 );
3277
+ if (!SWIG_IsOK(res1)) {
3278
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ID3_Field *","set_unicode", 1, self ));
3279
+ }
3280
+ arg1 = reinterpret_cast< ID3_Field * >(argp1);
3281
+ arg2 = argv[0];
3282
+ result = ID3_Field_set_unicode(arg1,arg2);
3283
+ vresult = SWIG_From_size_t(static_cast< size_t >(result));
3284
+ return vresult;
3285
+ fail:
3286
+ return Qnil;
3287
+ }
3288
+
3289
+
3290
+
3291
+ /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
3292
+
3293
+ static swig_type_info _swigt__p_ID3_Field = {"_p_ID3_Field", "ID3_Field *", 0, 0, (void*)0, 0};
3294
+ static swig_type_info _swigt__p_ID3_Frame = {"_p_ID3_Frame", "ID3_Frame *", 0, 0, (void*)0, 0};
3295
+ static swig_type_info _swigt__p_ID3_Tag = {"_p_ID3_Tag", "ID3_Tag *", 0, 0, (void*)0, 0};
3296
+ static swig_type_info _swigt__p_ID3_Tag__Iterator = {"_p_ID3_Tag__Iterator", "ID3_Tag::Iterator *", 0, 0, (void*)0, 0};
3297
+ static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
3298
+ static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "uchar *|unsigned char *", 0, 0, (void*)0, 0};
3299
+ static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "unsigned int *|flags_t *", 0, 0, (void*)0, 0};
3300
+ static swig_type_info _swigt__p_unsigned_long = {"_p_unsigned_long", "uint32 *|unsigned long *", 0, 0, (void*)0, 0};
3301
+
3302
+ static swig_type_info *swig_type_initial[] = {
3303
+ &_swigt__p_ID3_Field,
3304
+ &_swigt__p_ID3_Frame,
3305
+ &_swigt__p_ID3_Tag,
3306
+ &_swigt__p_ID3_Tag__Iterator,
3307
+ &_swigt__p_char,
3308
+ &_swigt__p_unsigned_char,
3309
+ &_swigt__p_unsigned_int,
3310
+ &_swigt__p_unsigned_long,
3311
+ };
3312
+
3313
+ static swig_cast_info _swigc__p_ID3_Field[] = { {&_swigt__p_ID3_Field, 0, 0, 0},{0, 0, 0, 0}};
3314
+ static swig_cast_info _swigc__p_ID3_Frame[] = { {&_swigt__p_ID3_Frame, 0, 0, 0},{0, 0, 0, 0}};
3315
+ static swig_cast_info _swigc__p_ID3_Tag[] = { {&_swigt__p_ID3_Tag, 0, 0, 0},{0, 0, 0, 0}};
3316
+ static swig_cast_info _swigc__p_ID3_Tag__Iterator[] = { {&_swigt__p_ID3_Tag__Iterator, 0, 0, 0},{0, 0, 0, 0}};
3317
+ static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
3318
+ static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
3319
+ static swig_cast_info _swigc__p_unsigned_int[] = { {&_swigt__p_unsigned_int, 0, 0, 0},{0, 0, 0, 0}};
3320
+ static swig_cast_info _swigc__p_unsigned_long[] = { {&_swigt__p_unsigned_long, 0, 0, 0},{0, 0, 0, 0}};
3321
+
3322
+ static swig_cast_info *swig_cast_initial[] = {
3323
+ _swigc__p_ID3_Field,
3324
+ _swigc__p_ID3_Frame,
3325
+ _swigc__p_ID3_Tag,
3326
+ _swigc__p_ID3_Tag__Iterator,
3327
+ _swigc__p_char,
3328
+ _swigc__p_unsigned_char,
3329
+ _swigc__p_unsigned_int,
3330
+ _swigc__p_unsigned_long,
3331
+ };
3332
+
3333
+
3334
+ /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
3335
+
3336
+ /* -----------------------------------------------------------------------------
3337
+ * Type initialization:
3338
+ * This problem is tough by the requirement that no dynamic
3339
+ * memory is used. Also, since swig_type_info structures store pointers to
3340
+ * swig_cast_info structures and swig_cast_info structures store pointers back
3341
+ * to swig_type_info structures, we need some lookup code at initialization.
3342
+ * The idea is that swig generates all the structures that are needed.
3343
+ * The runtime then collects these partially filled structures.
3344
+ * The SWIG_InitializeModule function takes these initial arrays out of
3345
+ * swig_module, and does all the lookup, filling in the swig_module.types
3346
+ * array with the correct data and linking the correct swig_cast_info
3347
+ * structures together.
3348
+ *
3349
+ * The generated swig_type_info structures are assigned staticly to an initial
3350
+ * array. We just loop through that array, and handle each type individually.
3351
+ * First we lookup if this type has been already loaded, and if so, use the
3352
+ * loaded structure instead of the generated one. Then we have to fill in the
3353
+ * cast linked list. The cast data is initially stored in something like a
3354
+ * two-dimensional array. Each row corresponds to a type (there are the same
3355
+ * number of rows as there are in the swig_type_initial array). Each entry in
3356
+ * a column is one of the swig_cast_info structures for that type.
3357
+ * The cast_initial array is actually an array of arrays, because each row has
3358
+ * a variable number of columns. So to actually build the cast linked list,
3359
+ * we find the array of casts associated with the type, and loop through it
3360
+ * adding the casts to the list. The one last trick we need to do is making
3361
+ * sure the type pointer in the swig_cast_info struct is correct.
3362
+ *
3363
+ * First off, we lookup the cast->type name to see if it is already loaded.
3364
+ * There are three cases to handle:
3365
+ * 1) If the cast->type has already been loaded AND the type we are adding
3366
+ * casting info to has not been loaded (it is in this module), THEN we
3367
+ * replace the cast->type pointer with the type pointer that has already
3368
+ * been loaded.
3369
+ * 2) If BOTH types (the one we are adding casting info to, and the
3370
+ * cast->type) are loaded, THEN the cast info has already been loaded by
3371
+ * the previous module so we just ignore it.
3372
+ * 3) Finally, if cast->type has not already been loaded, then we add that
3373
+ * swig_cast_info to the linked list (because the cast->type) pointer will
3374
+ * be correct.
3375
+ * ----------------------------------------------------------------------------- */
3376
+
3377
+ #ifdef __cplusplus
3378
+ extern "C" {
3379
+ #if 0
3380
+ } /* c-mode */
3381
+ #endif
3382
+ #endif
3383
+
3384
+ #if 0
3385
+ #define SWIGRUNTIME_DEBUG
3386
+ #endif
3387
+
3388
+
3389
+ SWIGRUNTIME void
3390
+ SWIG_InitializeModule(void *clientdata) {
3391
+ size_t i;
3392
+ swig_module_info *module_head, *iter;
3393
+ int found, init;
3394
+
3395
+ clientdata = clientdata;
3396
+
3397
+ /* check to see if the circular list has been setup, if not, set it up */
3398
+ if (swig_module.next==0) {
3399
+ /* Initialize the swig_module */
3400
+ swig_module.type_initial = swig_type_initial;
3401
+ swig_module.cast_initial = swig_cast_initial;
3402
+ swig_module.next = &swig_module;
3403
+ init = 1;
3404
+ } else {
3405
+ init = 0;
3406
+ }
3407
+
3408
+ /* Try and load any already created modules */
3409
+ module_head = SWIG_GetModule(clientdata);
3410
+ if (!module_head) {
3411
+ /* This is the first module loaded for this interpreter */
3412
+ /* so set the swig module into the interpreter */
3413
+ SWIG_SetModule(clientdata, &swig_module);
3414
+ module_head = &swig_module;
3415
+ } else {
3416
+ /* the interpreter has loaded a SWIG module, but has it loaded this one? */
3417
+ found=0;
3418
+ iter=module_head;
3419
+ do {
3420
+ if (iter==&swig_module) {
3421
+ found=1;
3422
+ break;
3423
+ }
3424
+ iter=iter->next;
3425
+ } while (iter!= module_head);
3426
+
3427
+ /* if the is found in the list, then all is done and we may leave */
3428
+ if (found) return;
3429
+ /* otherwise we must add out module into the list */
3430
+ swig_module.next = module_head->next;
3431
+ module_head->next = &swig_module;
3432
+ }
3433
+
3434
+ /* When multiple interpeters are used, a module could have already been initialized in
3435
+ a different interpreter, but not yet have a pointer in this interpreter.
3436
+ In this case, we do not want to continue adding types... everything should be
3437
+ set up already */
3438
+ if (init == 0) return;
3439
+
3440
+ /* Now work on filling in swig_module.types */
3441
+ #ifdef SWIGRUNTIME_DEBUG
3442
+ printf("SWIG_InitializeModule: size %d\n", swig_module.size);
3443
+ #endif
3444
+ for (i = 0; i < swig_module.size; ++i) {
3445
+ swig_type_info *type = 0;
3446
+ swig_type_info *ret;
3447
+ swig_cast_info *cast;
3448
+
3449
+ #ifdef SWIGRUNTIME_DEBUG
3450
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
3451
+ #endif
3452
+
3453
+ /* if there is another module already loaded */
3454
+ if (swig_module.next != &swig_module) {
3455
+ type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
3456
+ }
3457
+ if (type) {
3458
+ /* Overwrite clientdata field */
3459
+ #ifdef SWIGRUNTIME_DEBUG
3460
+ printf("SWIG_InitializeModule: found type %s\n", type->name);
3461
+ #endif
3462
+ if (swig_module.type_initial[i]->clientdata) {
3463
+ type->clientdata = swig_module.type_initial[i]->clientdata;
3464
+ #ifdef SWIGRUNTIME_DEBUG
3465
+ printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
3466
+ #endif
3467
+ }
3468
+ } else {
3469
+ type = swig_module.type_initial[i];
3470
+ }
3471
+
3472
+ /* Insert casting types */
3473
+ cast = swig_module.cast_initial[i];
3474
+ while (cast->type) {
3475
+
3476
+ /* Don't need to add information already in the list */
3477
+ ret = 0;
3478
+ #ifdef SWIGRUNTIME_DEBUG
3479
+ printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
3480
+ #endif
3481
+ if (swig_module.next != &swig_module) {
3482
+ ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
3483
+ #ifdef SWIGRUNTIME_DEBUG
3484
+ if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
3485
+ #endif
3486
+ }
3487
+ if (ret) {
3488
+ if (type == swig_module.type_initial[i]) {
3489
+ #ifdef SWIGRUNTIME_DEBUG
3490
+ printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
3491
+ #endif
3492
+ cast->type = ret;
3493
+ ret = 0;
3494
+ } else {
3495
+ /* Check for casting already in the list */
3496
+ swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
3497
+ #ifdef SWIGRUNTIME_DEBUG
3498
+ if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
3499
+ #endif
3500
+ if (!ocast) ret = 0;
3501
+ }
3502
+ }
3503
+
3504
+ if (!ret) {
3505
+ #ifdef SWIGRUNTIME_DEBUG
3506
+ printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
3507
+ #endif
3508
+ if (type->cast) {
3509
+ type->cast->prev = cast;
3510
+ cast->next = type->cast;
3511
+ }
3512
+ type->cast = cast;
3513
+ }
3514
+ cast++;
3515
+ }
3516
+ /* Set entry in modules->types array equal to the type */
3517
+ swig_module.types[i] = type;
3518
+ }
3519
+ swig_module.types[i] = 0;
3520
+
3521
+ #ifdef SWIGRUNTIME_DEBUG
3522
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
3523
+ for (i = 0; i < swig_module.size; ++i) {
3524
+ int j = 0;
3525
+ swig_cast_info *cast = swig_module.cast_initial[i];
3526
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
3527
+ while (cast->type) {
3528
+ printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
3529
+ cast++;
3530
+ ++j;
3531
+ }
3532
+ printf("---- Total casts: %d\n",j);
3533
+ }
3534
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
3535
+ #endif
3536
+ }
3537
+
3538
+ /* This function will propagate the clientdata field of type to
3539
+ * any new swig_type_info structures that have been added into the list
3540
+ * of equivalent types. It is like calling
3541
+ * SWIG_TypeClientData(type, clientdata) a second time.
3542
+ */
3543
+ SWIGRUNTIME void
3544
+ SWIG_PropagateClientData(void) {
3545
+ size_t i;
3546
+ swig_cast_info *equiv;
3547
+ static int init_run = 0;
3548
+
3549
+ if (init_run) return;
3550
+ init_run = 1;
3551
+
3552
+ for (i = 0; i < swig_module.size; i++) {
3553
+ if (swig_module.types[i]->clientdata) {
3554
+ equiv = swig_module.types[i]->cast;
3555
+ while (equiv) {
3556
+ if (!equiv->converter) {
3557
+ if (equiv->type && !equiv->type->clientdata)
3558
+ SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
3559
+ }
3560
+ equiv = equiv->next;
3561
+ }
3562
+ }
3563
+ }
3564
+ }
3565
+
3566
+ #ifdef __cplusplus
3567
+ #if 0
3568
+ { /* c-mode */
3569
+ #endif
3570
+ }
3571
+ #endif
3572
+
3573
+ /*
3574
+
3575
+ */
3576
+ #ifdef __cplusplus
3577
+ extern "C"
3578
+ #endif
3579
+ SWIGEXPORT void Init_id3lib_api(void) {
3580
+ size_t i;
3581
+
3582
+ SWIG_InitRuntime();
3583
+ mAPI = rb_define_module("ID3Lib");
3584
+ mAPI = rb_define_module_under(mAPI, "API");
3585
+
3586
+ SWIG_InitializeModule(0);
3587
+ for (i = 0; i < swig_module.size; i++) {
3588
+ SWIG_define_class(swig_module.types[i]);
3589
+ }
3590
+
3591
+ SWIG_RubyInitializeTrackings();
3592
+
3593
+ SwigClassTag.klass = rb_define_class_under(mAPI, "Tag", rb_cObject);
3594
+ SWIG_TypeClientData(SWIGTYPE_p_ID3_Tag, (void *) &SwigClassTag);
3595
+ rb_define_alloc_func(SwigClassTag.klass, _wrap_Tag_allocate);
3596
+ rb_define_method(SwigClassTag.klass, "initialize", VALUEFUNC(_wrap_new_Tag), -1);
3597
+ rb_define_method(SwigClassTag.klass, "has_tag_type", VALUEFUNC(_wrap_Tag_has_tag_type), -1);
3598
+ rb_define_method(SwigClassTag.klass, "link", VALUEFUNC(_wrap_Tag_link), -1);
3599
+ rb_define_method(SwigClassTag.klass, "update", VALUEFUNC(_wrap_Tag_update), -1);
3600
+ rb_define_method(SwigClassTag.klass, "strip", VALUEFUNC(_wrap_Tag_strip), -1);
3601
+ rb_define_method(SwigClassTag.klass, "clear", VALUEFUNC(_wrap_Tag_clear), -1);
3602
+ rb_define_method(SwigClassTag.klass, "remove_frame", VALUEFUNC(_wrap_Tag_remove_frame), -1);
3603
+ rb_define_method(SwigClassTag.klass, "add_frame", VALUEFUNC(_wrap_Tag_add_frame), -1);
3604
+ rb_define_method(SwigClassTag.klass, "get_filename", VALUEFUNC(_wrap_Tag_get_filename), -1);
3605
+ rb_define_method(SwigClassTag.klass, "set_padding", VALUEFUNC(_wrap_Tag_set_padding), -1);
3606
+ rb_define_method(SwigClassTag.klass, "size", VALUEFUNC(_wrap_Tag_size), -1);
3607
+ rb_define_method(SwigClassTag.klass, "find", VALUEFUNC(_wrap_Tag_find), -1);
3608
+ rb_define_method(SwigClassTag.klass, "create_iterator", VALUEFUNC(_wrap_Tag_create_iterator), -1);
3609
+ SwigClassTag.mark = 0;
3610
+ SwigClassTag.destroy = (void (*)(void *)) free_ID3_Tag;
3611
+ SwigClassTag.trackObjects = 0;
3612
+
3613
+ SwigClassTag_Iterator.klass = rb_define_class_under(mAPI, "Tag_Iterator", rb_cObject);
3614
+ SWIG_TypeClientData(SWIGTYPE_p_ID3_Tag__Iterator, (void *) &SwigClassTag_Iterator);
3615
+ rb_undef_alloc_func(SwigClassTag_Iterator.klass);
3616
+ rb_define_method(SwigClassTag_Iterator.klass, "get_next", VALUEFUNC(_wrap_Tag_Iterator_get_next), -1);
3617
+ SwigClassTag_Iterator.mark = 0;
3618
+ SwigClassTag_Iterator.destroy = (void (*)(void *)) free_ID3_Tag_Iterator;
3619
+ SwigClassTag_Iterator.trackObjects = 0;
3620
+
3621
+ SwigClassFrame.klass = rb_define_class_under(mAPI, "Frame", rb_cObject);
3622
+ SWIG_TypeClientData(SWIGTYPE_p_ID3_Frame, (void *) &SwigClassFrame);
3623
+ rb_define_alloc_func(SwigClassFrame.klass, _wrap_Frame_allocate);
3624
+ rb_define_method(SwigClassFrame.klass, "initialize", VALUEFUNC(_wrap_new_Frame), -1);
3625
+ rb_define_method(SwigClassFrame.klass, "get_field", VALUEFUNC(_wrap_Frame_get_field), -1);
3626
+ rb_define_method(SwigClassFrame.klass, "get_id", VALUEFUNC(_wrap_Frame_get_id), -1);
3627
+ SwigClassFrame.mark = 0;
3628
+ SwigClassFrame.destroy = (void (*)(void *)) free_ID3_Frame;
3629
+ SwigClassFrame.trackObjects = 0;
3630
+
3631
+ SwigClassField.klass = rb_define_class_under(mAPI, "Field", rb_cObject);
3632
+ SWIG_TypeClientData(SWIGTYPE_p_ID3_Field, (void *) &SwigClassField);
3633
+ rb_undef_alloc_func(SwigClassField.klass);
3634
+ rb_define_method(SwigClassField.klass, "get_type", VALUEFUNC(_wrap_Field_get_type), -1);
3635
+ rb_define_method(SwigClassField.klass, "get_encoding", VALUEFUNC(_wrap_Field_get_encoding), -1);
3636
+ rb_define_method(SwigClassField.klass, "get_integer", VALUEFUNC(_wrap_Field_get_integer), -1);
3637
+ rb_define_method(SwigClassField.klass, "get_ascii", VALUEFUNC(_wrap_Field_get_ascii), -1);
3638
+ rb_define_method(SwigClassField.klass, "get_binary", VALUEFUNC(_wrap_Field_get_binary), -1);
3639
+ rb_define_method(SwigClassField.klass, "get_unicode", VALUEFUNC(_wrap_Field_get_unicode), -1);
3640
+ rb_define_method(SwigClassField.klass, "set_encoding", VALUEFUNC(_wrap_Field_set_encoding), -1);
3641
+ rb_define_method(SwigClassField.klass, "set_integer", VALUEFUNC(_wrap_Field_set_integer), -1);
3642
+ rb_define_method(SwigClassField.klass, "set_ascii", VALUEFUNC(_wrap_Field_set_ascii), -1);
3643
+ rb_define_method(SwigClassField.klass, "set_binary", VALUEFUNC(_wrap_Field_set_binary), -1);
3644
+ rb_define_method(SwigClassField.klass, "set_unicode", VALUEFUNC(_wrap_Field_set_unicode), -1);
3645
+ SwigClassField.mark = 0;
3646
+ SwigClassField.trackObjects = 0;
3647
+ }
3648
+