id3lib-ruby 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,5 +1,10 @@
1
1
  = id3lib-ruby changes
2
2
 
3
+ === 0.3.1 (r32)
4
+
5
+ * Added check and messages for -lstdc++ and -lz to extconf.rb.
6
+ * Updated to SWIG 1.3.29.
7
+
3
8
  === 0.3.0 (r29)
4
9
 
5
10
  * Added generation of mswin32 binary gem. This means that
data/Rakefile CHANGED
@@ -10,7 +10,7 @@ require 'rake/testtask'
10
10
  require 'rake/rdoctask'
11
11
 
12
12
 
13
- PKG_VERSION = '0.3.0'
13
+ PKG_VERSION = '0.3.1'
14
14
 
15
15
  PKG_COMMON = FileList[
16
16
  'lib/**/*.rb',
@@ -1,7 +1,20 @@
1
1
  require 'mkmf'
2
2
 
3
- if have_header('id3.h') and have_library('id3', 'ID3Tag_New')
4
- create_makefile('id3lib_api')
5
- else
6
- message "You must have id3lib installed in order to use id3lib-ruby!\n"
3
+ def error msg
4
+ message msg + "\n"
5
+ abort
7
6
  end
7
+
8
+ unless have_library('stdc++')
9
+ error "You must have libstdc++ installed."
10
+ end
11
+
12
+ unless have_library('z')
13
+ error "You must have zlib installed."
14
+ end
15
+
16
+ unless have_header('id3.h') and have_library('id3', 'ID3Tag_New')
17
+ error "You must have id3lib installed in order to use id3lib-ruby."
18
+ end
19
+
20
+ create_makefile('id3lib_api')
@@ -1,6 +1,6 @@
1
1
  /* ----------------------------------------------------------------------------
2
2
  * This file was automatically generated by SWIG (http://www.swig.org).
3
- * Version 1.3.25
3
+ * Version 1.3.29
4
4
  *
5
5
  * This file is not intended to be easily readable and contains a number of
6
6
  * coding conventions designed to improve portability and efficiency. Do not make
@@ -8,6 +8,7 @@
8
8
  * interface file instead.
9
9
  * ----------------------------------------------------------------------------- */
10
10
 
11
+ #define SWIGRUBY
11
12
 
12
13
  #ifdef __cplusplus
13
14
  template<class T> class SwigValueWrapper {
@@ -25,20 +26,22 @@ private:
25
26
  };
26
27
  #endif
27
28
 
28
- /***********************************************************************
29
- *
29
+ /* -----------------------------------------------------------------------------
30
30
  * This section contains generic SWIG labels for method/variable
31
31
  * declarations/attributes, and other compiler dependent labels.
32
- *
33
- ************************************************************************/
32
+ * ----------------------------------------------------------------------------- */
34
33
 
35
34
  /* template workaround for compilers that cannot correctly implement the C++ standard */
36
35
  #ifndef SWIGTEMPLATEDISAMBIGUATOR
37
- # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
38
- # define SWIGTEMPLATEDISAMBIGUATOR template
39
- # else
40
- # define SWIGTEMPLATEDISAMBIGUATOR
41
- # endif
36
+ # if defined(__SUNPRO_CC)
37
+ # if (__SUNPRO_CC <= 0x560)
38
+ # define SWIGTEMPLATEDISAMBIGUATOR template
39
+ # else
40
+ # define SWIGTEMPLATEDISAMBIGUATOR
41
+ # endif
42
+ # else
43
+ # define SWIGTEMPLATEDISAMBIGUATOR
44
+ # endif
42
45
  #endif
43
46
 
44
47
  /* inline attribute */
@@ -52,13 +55,27 @@ private:
52
55
 
53
56
  /* attribute recognised by some compilers to avoid 'unused' warnings */
54
57
  #ifndef SWIGUNUSED
55
- # if defined(__GNUC__) || defined(__ICC)
56
- # define SWIGUNUSED __attribute__ ((unused))
58
+ # if defined(__GNUC__)
59
+ # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
60
+ # define SWIGUNUSED __attribute__ ((__unused__))
61
+ # else
62
+ # define SWIGUNUSED
63
+ # endif
64
+ # elif defined(__ICC)
65
+ # define SWIGUNUSED __attribute__ ((__unused__))
57
66
  # else
58
67
  # define SWIGUNUSED
59
68
  # endif
60
69
  #endif
61
70
 
71
+ #ifndef SWIGUNUSEDPARM
72
+ # ifdef __cplusplus
73
+ # define SWIGUNUSEDPARM(p)
74
+ # else
75
+ # define SWIGUNUSEDPARM(p) p SWIGUNUSED
76
+ # endif
77
+ #endif
78
+
62
79
  /* internal SWIG method */
63
80
  #ifndef SWIGINTERN
64
81
  # define SWIGINTERN static SWIGUNUSED
@@ -69,7 +86,13 @@ private:
69
86
  # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
70
87
  #endif
71
88
 
72
- /* exporting methods for Windows DLLs */
89
+ /* exporting methods */
90
+ #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
91
+ # ifndef GCC_HASCLASSVISIBILITY
92
+ # define GCC_HASCLASSVISIBILITY
93
+ # endif
94
+ #endif
95
+
73
96
  #ifndef SWIGEXPORT
74
97
  # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
75
98
  # if defined(STATIC_LINKED)
@@ -78,7 +101,11 @@ private:
78
101
  # define SWIGEXPORT __declspec(dllexport)
79
102
  # endif
80
103
  # else
81
- # define SWIGEXPORT
104
+ # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
105
+ # define SWIGEXPORT __attribute__ ((visibility("default")))
106
+ # else
107
+ # define SWIGEXPORT
108
+ # endif
82
109
  # endif
83
110
  #endif
84
111
 
@@ -91,130 +118,114 @@ private:
91
118
  # endif
92
119
  #endif
93
120
 
121
+ /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
122
+ #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER)
123
+ # define _CRT_SECURE_NO_DEPRECATE
124
+ #endif
94
125
 
95
- /* ruby.swg */
96
- /* Implementation : RUBY */
97
- #define SWIGRUBY 1
98
-
99
- #include "ruby.h"
100
-
101
- /* Flags for pointer conversion */
102
- #define SWIG_POINTER_EXCEPTION 0x1
103
- #define SWIG_POINTER_DISOWN 0x2
104
-
105
- #define NUM2USHRT(n) (\
106
- (0 <= NUM2UINT(n) && NUM2UINT(n) <= USHRT_MAX)\
107
- ? (unsigned short) NUM2UINT(n) \
108
- : (rb_raise(rb_eArgError, "integer %d out of range of `unsigned short'",\
109
- NUM2UINT(n)), (short)0)\
110
- )
126
+ /* -----------------------------------------------------------------------------
127
+ * This section contains generic SWIG labels for method/variable
128
+ * declarations/attributes, and other compiler dependent labels.
129
+ * ----------------------------------------------------------------------------- */
111
130
 
112
- #define NUM2SHRT(n) (\
113
- (SHRT_MIN <= NUM2INT(n) && NUM2INT(n) <= SHRT_MAX)\
114
- ? (short)NUM2INT(n)\
115
- : (rb_raise(rb_eArgError, "integer %d out of range of `short'",\
116
- NUM2INT(n)), (short)0)\
117
- )
131
+ /* template workaround for compilers that cannot correctly implement the C++ standard */
132
+ #ifndef SWIGTEMPLATEDISAMBIGUATOR
133
+ # if defined(__SUNPRO_CC)
134
+ # if (__SUNPRO_CC <= 0x560)
135
+ # define SWIGTEMPLATEDISAMBIGUATOR template
136
+ # else
137
+ # define SWIGTEMPLATEDISAMBIGUATOR
138
+ # endif
139
+ # else
140
+ # define SWIGTEMPLATEDISAMBIGUATOR
141
+ # endif
142
+ #endif
118
143
 
119
- /* Ruby 1.7 defines NUM2LL(), LL2NUM() and ULL2NUM() macros */
120
- #ifndef NUM2LL
121
- #define NUM2LL(x) NUM2LONG((x))
144
+ /* inline attribute */
145
+ #ifndef SWIGINLINE
146
+ # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
147
+ # define SWIGINLINE inline
148
+ # else
149
+ # define SWIGINLINE
150
+ # endif
122
151
  #endif
123
- #ifndef LL2NUM
124
- #define LL2NUM(x) INT2NUM((long) (x))
152
+
153
+ /* attribute recognised by some compilers to avoid 'unused' warnings */
154
+ #ifndef SWIGUNUSED
155
+ # if defined(__GNUC__)
156
+ # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
157
+ # define SWIGUNUSED __attribute__ ((__unused__))
158
+ # else
159
+ # define SWIGUNUSED
160
+ # endif
161
+ # elif defined(__ICC)
162
+ # define SWIGUNUSED __attribute__ ((__unused__))
163
+ # else
164
+ # define SWIGUNUSED
165
+ # endif
125
166
  #endif
126
- #ifndef ULL2NUM
127
- #define ULL2NUM(x) UINT2NUM((unsigned long) (x))
167
+
168
+ #ifndef SWIGUNUSEDPARM
169
+ # ifdef __cplusplus
170
+ # define SWIGUNUSEDPARM(p)
171
+ # else
172
+ # define SWIGUNUSEDPARM(p) p SWIGUNUSED
173
+ # endif
128
174
  #endif
129
175
 
130
- /* Ruby 1.7 doesn't (yet) define NUM2ULL() */
131
- #ifndef NUM2ULL
132
- #ifdef HAVE_LONG_LONG
133
- #define NUM2ULL(x) rb_num2ull((x))
134
- #else
135
- #define NUM2ULL(x) NUM2ULONG(x)
176
+ /* internal SWIG method */
177
+ #ifndef SWIGINTERN
178
+ # define SWIGINTERN static SWIGUNUSED
136
179
  #endif
180
+
181
+ /* internal inline SWIG method */
182
+ #ifndef SWIGINTERNINLINE
183
+ # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
137
184
  #endif
138
185
 
139
- /*
140
- * Need to be very careful about how these macros are defined, especially
141
- * when compiling C++ code or C code with an ANSI C compiler.
142
- *
143
- * VALUEFUNC(f) is a macro used to typecast a C function that implements
144
- * a Ruby method so that it can be passed as an argument to API functions
145
- * like rb_define_method() and rb_define_singleton_method().
146
- *
147
- * VOIDFUNC(f) is a macro used to typecast a C function that implements
148
- * either the "mark" or "free" stuff for a Ruby Data object, so that it
149
- * can be passed as an argument to API functions like Data_Wrap_Struct()
150
- * and Data_Make_Struct().
151
- */
152
-
153
- #ifdef __cplusplus
154
- # ifndef RUBY_METHOD_FUNC /* These definitions should work for Ruby 1.4.6 */
155
- # define PROTECTFUNC(f) ((VALUE (*)()) f)
156
- # define VALUEFUNC(f) ((VALUE (*)()) f)
157
- # define VOIDFUNC(f) ((void (*)()) f)
158
- # else
159
- # ifndef ANYARGS /* These definitions should work for Ruby 1.6 */
160
- # define PROTECTFUNC(f) ((VALUE (*)()) f)
161
- # define VALUEFUNC(f) ((VALUE (*)()) f)
162
- # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
163
- # else /* These definitions should work for Ruby 1.7+ */
164
- # define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f)
165
- # define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f)
166
- # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
167
- # endif
186
+ /* exporting methods */
187
+ #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
188
+ # ifndef GCC_HASCLASSVISIBILITY
189
+ # define GCC_HASCLASSVISIBILITY
168
190
  # endif
169
- #else
170
- # define VALUEFUNC(f) (f)
171
- # define VOIDFUNC(f) (f)
172
191
  #endif
173
192
 
174
- typedef struct {
175
- VALUE klass;
176
- VALUE mImpl;
177
- void (*mark)(void *);
178
- void (*destroy)(void *);
179
- } swig_class;
180
-
181
- /* Don't use for expressions have side effect */
182
- #ifndef RB_STRING_VALUE
183
- #define RB_STRING_VALUE(s) (TYPE(s) == T_STRING ? (s) : (*(volatile VALUE *)&(s) = rb_str_to_str(s)))
184
- #endif
185
- #ifndef StringValue
186
- #define StringValue(s) RB_STRING_VALUE(s)
187
- #endif
188
- #ifndef StringValuePtr
189
- #define StringValuePtr(s) RSTRING(RB_STRING_VALUE(s))->ptr
190
- #endif
191
- #ifndef StringValueLen
192
- #define StringValueLen(s) RSTRING(RB_STRING_VALUE(s))->len
193
- #endif
194
- #ifndef SafeStringValue
195
- #define SafeStringValue(v) do {\
196
- StringValue(v);\
197
- rb_check_safe_str(v);\
198
- } while (0)
193
+ #ifndef SWIGEXPORT
194
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
195
+ # if defined(STATIC_LINKED)
196
+ # define SWIGEXPORT
197
+ # else
198
+ # define SWIGEXPORT __declspec(dllexport)
199
+ # endif
200
+ # else
201
+ # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
202
+ # define SWIGEXPORT __attribute__ ((visibility("default")))
203
+ # else
204
+ # define SWIGEXPORT
205
+ # endif
206
+ # endif
199
207
  #endif
200
208
 
201
- #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
202
- #define rb_define_alloc_func(klass, func) rb_define_singleton_method((klass), "new", VALUEFUNC((func)), -1)
203
- #define rb_undef_alloc_func(klass) rb_undef_method(CLASS_OF((klass)), "new")
209
+ /* calling conventions for Windows */
210
+ #ifndef SWIGSTDCALL
211
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
212
+ # define SWIGSTDCALL __stdcall
213
+ # else
214
+ # define SWIGSTDCALL
215
+ # endif
204
216
  #endif
205
217
 
206
- /* Contract support */
207
-
208
- #define SWIG_contract_assert(expr, msg) if (!(expr)) { rb_raise(rb_eRuntimeError, (char *) msg ); } else
209
-
218
+ /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
219
+ #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER)
220
+ # define _CRT_SECURE_NO_DEPRECATE
221
+ #endif
210
222
 
211
- /***********************************************************************
223
+ /* -----------------------------------------------------------------------------
212
224
  * swigrun.swg
213
225
  *
214
- * This file contains generic CAPI SWIG runtime support for pointer
215
- * type checking.
216
- *
217
- ************************************************************************/
226
+ * This file contains generic CAPI SWIG runtime support for pointer
227
+ * type checking.
228
+ * ----------------------------------------------------------------------------- */
218
229
 
219
230
  /* This should only be incremented when either the layout of swig_type_info changes,
220
231
  or for whatever reason, the runtime changes incompatibly */
@@ -246,6 +257,147 @@ typedef struct {
246
257
  # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
247
258
  #endif
248
259
 
260
+ /* Generic buffer size */
261
+ #ifndef SWIG_BUFFER_SIZE
262
+ # define SWIG_BUFFER_SIZE 1024
263
+ #endif
264
+
265
+ /* Flags for pointer conversions */
266
+ #define SWIG_POINTER_DISOWN 0x1
267
+
268
+ /* Flags for new pointer objects */
269
+ #define SWIG_POINTER_OWN 0x1
270
+
271
+
272
+ /*
273
+ Flags/methods for returning states.
274
+
275
+ The swig conversion methods, as ConvertPtr, return and integer
276
+ that tells if the conversion was successful or not. And if not,
277
+ an error code can be returned (see swigerrors.swg for the codes).
278
+
279
+ Use the following macros/flags to set or process the returning
280
+ states.
281
+
282
+ In old swig versions, you usually write code as:
283
+
284
+ if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
285
+ // success code
286
+ } else {
287
+ //fail code
288
+ }
289
+
290
+ Now you can be more explicit as:
291
+
292
+ int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
293
+ if (SWIG_IsOK(res)) {
294
+ // success code
295
+ } else {
296
+ // fail code
297
+ }
298
+
299
+ that seems to be the same, but now you can also do
300
+
301
+ Type *ptr;
302
+ int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
303
+ if (SWIG_IsOK(res)) {
304
+ // success code
305
+ if (SWIG_IsNewObj(res) {
306
+ ...
307
+ delete *ptr;
308
+ } else {
309
+ ...
310
+ }
311
+ } else {
312
+ // fail code
313
+ }
314
+
315
+ I.e., now SWIG_ConvertPtr can return new objects and you can
316
+ identify the case and take care of the deallocation. Of course that
317
+ requires also to SWIG_ConvertPtr to return new result values, as
318
+
319
+ int SWIG_ConvertPtr(obj, ptr,...) {
320
+ if (<obj is ok>) {
321
+ if (<need new object>) {
322
+ *ptr = <ptr to new allocated object>;
323
+ return SWIG_NEWOBJ;
324
+ } else {
325
+ *ptr = <ptr to old object>;
326
+ return SWIG_OLDOBJ;
327
+ }
328
+ } else {
329
+ return SWIG_BADOBJ;
330
+ }
331
+ }
332
+
333
+ Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
334
+ more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
335
+ swig errors code.
336
+
337
+ Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
338
+ allows to return the 'cast rank', for example, if you have this
339
+
340
+ int food(double)
341
+ int fooi(int);
342
+
343
+ and you call
344
+
345
+ food(1) // cast rank '1' (1 -> 1.0)
346
+ fooi(1) // cast rank '0'
347
+
348
+ just use the SWIG_AddCast()/SWIG_CheckState()
349
+
350
+
351
+ */
352
+ #define SWIG_OK (0)
353
+ #define SWIG_ERROR (-1)
354
+ #define SWIG_IsOK(r) (r >= 0)
355
+ #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
356
+
357
+ /* The CastRankLimit says how many bits are used for the cast rank */
358
+ #define SWIG_CASTRANKLIMIT (1 << 8)
359
+ /* The NewMask denotes the object was created (using new/malloc) */
360
+ #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
361
+ /* The TmpMask is for in/out typemaps that use temporal objects */
362
+ #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
363
+ /* Simple returning values */
364
+ #define SWIG_BADOBJ (SWIG_ERROR)
365
+ #define SWIG_OLDOBJ (SWIG_OK)
366
+ #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
367
+ #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
368
+ /* Check, add and del mask methods */
369
+ #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
370
+ #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
371
+ #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
372
+ #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
373
+ #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
374
+ #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
375
+
376
+
377
+ /* Cast-Rank Mode */
378
+ #if defined(SWIG_CASTRANK_MODE)
379
+ # ifndef SWIG_TypeRank
380
+ # define SWIG_TypeRank unsigned long
381
+ # endif
382
+ # ifndef SWIG_MAXCASTRANK /* Default cast allowed */
383
+ # define SWIG_MAXCASTRANK (2)
384
+ # endif
385
+ # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
386
+ # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
387
+ SWIGINTERNINLINE int SWIG_AddCast(int r) {
388
+ return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
389
+ }
390
+ SWIGINTERNINLINE int SWIG_CheckState(int r) {
391
+ return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
392
+ }
393
+ #else /* no cast-rank mode */
394
+ # define SWIG_AddCast
395
+ # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
396
+ #endif
397
+
398
+
399
+
400
+
249
401
  #include <string.h>
250
402
 
251
403
  #ifdef __cplusplus
@@ -262,6 +414,7 @@ typedef struct swig_type_info {
262
414
  swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
263
415
  struct swig_cast_info *cast; /* linked list of types that can cast into this type */
264
416
  void *clientdata; /* language specific type data */
417
+ int owndata; /* flag if the structure owns the clientdata */
265
418
  } swig_type_info;
266
419
 
267
420
  /* Structure to store a type and conversion function used for casting */
@@ -284,7 +437,6 @@ typedef struct swig_module_info {
284
437
  void *clientdata; /* Language specific module data */
285
438
  } swig_module_info;
286
439
 
287
-
288
440
  /*
289
441
  Compare two type names skipping the space characters, therefore
290
442
  "char*" == "char *" and "Class<int>" == "Class<int >", etc.
@@ -298,7 +450,7 @@ SWIG_TypeNameComp(const char *f1, const char *l1,
298
450
  for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
299
451
  while ((*f1 == ' ') && (f1 != l1)) ++f1;
300
452
  while ((*f2 == ' ') && (f2 != l2)) ++f2;
301
- if (*f1 != *f2) return (int)(*f1 - *f2);
453
+ if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
302
454
  }
303
455
  return (l1 - f1) - (l2 - f2);
304
456
  }
@@ -418,6 +570,7 @@ SWIG_TypePrettyName(const swig_type_info *type) {
418
570
  type, separated by vertical-bar characters. We choose
419
571
  to print the last name, as it is often (?) the most
420
572
  specific. */
573
+ if (!type) return NULL;
421
574
  if (type->str != NULL) {
422
575
  const char *last_name = type->str;
423
576
  const char *s;
@@ -434,19 +587,26 @@ SWIG_TypePrettyName(const swig_type_info *type) {
434
587
  */
435
588
  SWIGRUNTIME void
436
589
  SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
437
- if (!ti->clientdata) {
438
- swig_cast_info *cast = ti->cast;
439
- /* if (ti->clientdata == clientdata) return; */
440
- ti->clientdata = clientdata;
441
-
442
- while (cast) {
443
- if (!cast->converter)
444
- SWIG_TypeClientData(cast->type, clientdata);
445
- cast = cast->next;
446
- }
590
+ swig_cast_info *cast = ti->cast;
591
+ /* if (ti->clientdata == clientdata) return; */
592
+ ti->clientdata = clientdata;
593
+
594
+ while (cast) {
595
+ if (!cast->converter) {
596
+ swig_type_info *tc = cast->type;
597
+ if (!tc->clientdata) {
598
+ SWIG_TypeClientData(tc, clientdata);
599
+ }
600
+ }
601
+ cast = cast->next;
447
602
  }
448
603
  }
449
-
604
+ SWIGRUNTIME void
605
+ SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
606
+ SWIG_TypeClientData(ti, clientdata);
607
+ ti->owndata = 1;
608
+ }
609
+
450
610
  /*
451
611
  Search for a swig_type_info structure only by mangled name
452
612
  Search is a O(log #types)
@@ -526,7 +686,6 @@ SWIG_TypeQueryModule(swig_module_info *start,
526
686
  return 0;
527
687
  }
528
688
 
529
-
530
689
  /*
531
690
  Pack binary data into a string
532
691
  */
@@ -552,7 +711,7 @@ SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
552
711
  register const unsigned char *eu = u + sz;
553
712
  for (; u != eu; ++u) {
554
713
  register char d = *(c++);
555
- register unsigned char uu = 0;
714
+ register unsigned char uu;
556
715
  if ((d >= '0') && (d <= '9'))
557
716
  uu = ((d - '0') << 4);
558
717
  else if ((d >= 'a') && (d <= 'f'))
@@ -630,175 +789,663 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
630
789
  }
631
790
  #endif
632
791
 
633
- /* Common SWIG API */
634
- #define SWIG_ConvertPtr(obj, pp, type, flags) \
635
- SWIG_Ruby_ConvertPtr(obj, pp, type, flags)
636
- #define SWIG_NewPointerObj(p, type, flags) \
637
- SWIG_Ruby_NewPointerObj(p, type, flags)
638
- #define SWIG_MustGetPtr(p, type, argnum, flags) \
639
- SWIG_Ruby_MustGetPtr(p, type, argnum, flags)
640
- #define SWIG_GetModule(clientdata) \
641
- SWIG_Ruby_GetModule()
642
- #define SWIG_SetModule(clientdata, pointer) \
643
- SWIG_Ruby_SetModule(pointer)
644
-
645
- /* Ruby-specific SWIG API */
646
-
647
- #define SWIG_InitRuntime() \
648
- SWIG_Ruby_InitRuntime()
649
- #define SWIG_define_class(ty) \
650
- SWIG_Ruby_define_class(ty)
651
- #define SWIG_NewClassInstance(value, ty) \
652
- SWIG_Ruby_NewClassInstance(value, ty)
653
- #define SWIG_MangleStr(value) \
654
- SWIG_Ruby_MangleStr(value)
655
- #define SWIG_CheckConvert(value, ty) \
656
- SWIG_Ruby_CheckConvert(value, ty)
657
- #define SWIG_NewPackedObj(ptr, sz, ty) \
658
- SWIG_Ruby_NewPackedObj(ptr, sz, ty)
659
- #define SWIG_ConvertPacked(obj, ptr, sz, ty, flags) \
660
- SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty, flags)
661
-
662
- /* rubydef.swg */
663
- #ifdef __cplusplus
664
- extern "C" {
665
- #endif
792
+ /* Errors in SWIG */
793
+ #define SWIG_UnknownError -1
794
+ #define SWIG_IOError -2
795
+ #define SWIG_RuntimeError -3
796
+ #define SWIG_IndexError -4
797
+ #define SWIG_TypeError -5
798
+ #define SWIG_DivisionByZero -6
799
+ #define SWIG_OverflowError -7
800
+ #define SWIG_SyntaxError -8
801
+ #define SWIG_ValueError -9
802
+ #define SWIG_SystemError -10
803
+ #define SWIG_AttributeError -11
804
+ #define SWIG_MemoryError -12
805
+ #define SWIG_NullReferenceError -13
666
806
 
667
- static VALUE _mSWIG = Qnil;
668
- static VALUE _cSWIG_Pointer = Qnil;
669
- static VALUE swig_runtime_data_type_pointer = Qnil;
670
807
 
671
- /* Initialize Ruby runtime support */
672
- static void
673
- SWIG_Ruby_InitRuntime(void)
674
- {
675
- if (_mSWIG == Qnil) {
676
- _mSWIG = rb_define_module("SWIG");
677
- }
678
- }
679
808
 
680
- /* Define Ruby class for C type */
681
- static void
682
- SWIG_Ruby_define_class(swig_type_info *type)
683
- {
684
- VALUE klass;
685
- char *klass_name = (char *) malloc(4 + strlen(type->name) + 1);
686
- sprintf(klass_name, "TYPE%s", type->name);
687
- if (NIL_P(_cSWIG_Pointer)) {
688
- _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);
689
- rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new");
690
- }
691
- klass = rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
692
- free((void *) klass_name);
693
- }
809
+ #include <ruby.h>
694
810
 
695
- /* Create a new pointer object */
696
- static VALUE
697
- SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int own)
698
- {
699
- char *klass_name;
700
- swig_class *sklass;
701
- VALUE klass;
702
- VALUE obj;
703
-
704
- if (!ptr)
705
- return Qnil;
706
-
707
- if (type->clientdata) {
708
- sklass = (swig_class *) type->clientdata;
709
- obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark), (own ? VOIDFUNC(sklass->destroy) : 0), ptr);
710
- } else {
711
- klass_name = (char *) malloc(4 + strlen(type->name) + 1);
712
- sprintf(klass_name, "TYPE%s", type->name);
713
- klass = rb_const_get(_mSWIG, rb_intern(klass_name));
714
- free((void *) klass_name);
715
- obj = Data_Wrap_Struct(klass, 0, 0, ptr);
716
- }
717
- rb_iv_set(obj, "__swigtype__", rb_str_new2(type->name));
718
- return obj;
719
- }
811
+ /* Ruby 1.7 defines NUM2LL(), LL2NUM() and ULL2NUM() macros */
812
+ #ifndef NUM2LL
813
+ #define NUM2LL(x) NUM2LONG((x))
814
+ #endif
815
+ #ifndef LL2NUM
816
+ #define LL2NUM(x) INT2NUM((long) (x))
817
+ #endif
818
+ #ifndef ULL2NUM
819
+ #define ULL2NUM(x) UINT2NUM((unsigned long) (x))
820
+ #endif
720
821
 
721
- /* Create a new class instance (always owned) */
722
- static VALUE
723
- SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type)
724
- {
725
- VALUE obj;
726
- swig_class *sklass = (swig_class *) type->clientdata;
727
- obj = Data_Wrap_Struct(klass, VOIDFUNC(sklass->mark), VOIDFUNC(sklass->destroy), 0);
728
- rb_iv_set(obj, "__swigtype__", rb_str_new2(type->name));
729
- return obj;
730
- }
822
+ /* Ruby 1.7 doesn't (yet) define NUM2ULL() */
823
+ #ifndef NUM2ULL
824
+ #ifdef HAVE_LONG_LONG
825
+ #define NUM2ULL(x) rb_num2ull((x))
826
+ #else
827
+ #define NUM2ULL(x) NUM2ULONG(x)
828
+ #endif
829
+ #endif
731
830
 
732
- /* Get type mangle from class name */
733
- static SWIGINLINE char *
734
- SWIG_Ruby_MangleStr(VALUE obj)
735
- {
736
- VALUE stype = rb_iv_get(obj, "__swigtype__");
737
- return StringValuePtr(stype);
831
+ /*
832
+ * Need to be very careful about how these macros are defined, especially
833
+ * when compiling C++ code or C code with an ANSI C compiler.
834
+ *
835
+ * VALUEFUNC(f) is a macro used to typecast a C function that implements
836
+ * a Ruby method so that it can be passed as an argument to API functions
837
+ * like rb_define_method() and rb_define_singleton_method().
838
+ *
839
+ * VOIDFUNC(f) is a macro used to typecast a C function that implements
840
+ * either the "mark" or "free" stuff for a Ruby Data object, so that it
841
+ * can be passed as an argument to API functions like Data_Wrap_Struct()
842
+ * and Data_Make_Struct().
843
+ */
844
+
845
+ #ifdef __cplusplus
846
+ # ifndef RUBY_METHOD_FUNC /* These definitions should work for Ruby 1.4.6 */
847
+ # define PROTECTFUNC(f) ((VALUE (*)()) f)
848
+ # define VALUEFUNC(f) ((VALUE (*)()) f)
849
+ # define VOIDFUNC(f) ((void (*)()) f)
850
+ # else
851
+ # ifndef ANYARGS /* These definitions should work for Ruby 1.6 */
852
+ # define PROTECTFUNC(f) ((VALUE (*)()) f)
853
+ # define VALUEFUNC(f) ((VALUE (*)()) f)
854
+ # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
855
+ # else /* These definitions should work for Ruby 1.7+ */
856
+ # define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f)
857
+ # define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f)
858
+ # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
859
+ # endif
860
+ # endif
861
+ #else
862
+ # define VALUEFUNC(f) (f)
863
+ # define VOIDFUNC(f) (f)
864
+ #endif
865
+
866
+ /* Don't use for expressions have side effect */
867
+ #ifndef RB_STRING_VALUE
868
+ #define RB_STRING_VALUE(s) (TYPE(s) == T_STRING ? (s) : (*(volatile VALUE *)&(s) = rb_str_to_str(s)))
869
+ #endif
870
+ #ifndef StringValue
871
+ #define StringValue(s) RB_STRING_VALUE(s)
872
+ #endif
873
+ #ifndef StringValuePtr
874
+ #define StringValuePtr(s) RSTRING(RB_STRING_VALUE(s))->ptr
875
+ #endif
876
+ #ifndef StringValueLen
877
+ #define StringValueLen(s) RSTRING(RB_STRING_VALUE(s))->len
878
+ #endif
879
+ #ifndef SafeStringValue
880
+ #define SafeStringValue(v) do {\
881
+ StringValue(v);\
882
+ rb_check_safe_str(v);\
883
+ } while (0)
884
+ #endif
885
+
886
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
887
+ #define rb_define_alloc_func(klass, func) rb_define_singleton_method((klass), "new", VALUEFUNC((func)), -1)
888
+ #define rb_undef_alloc_func(klass) rb_undef_method(CLASS_OF((klass)), "new")
889
+ #endif
890
+
891
+
892
+ /* -----------------------------------------------------------------------------
893
+ * error manipulation
894
+ * ----------------------------------------------------------------------------- */
895
+
896
+
897
+ /* Define some additional error types */
898
+ #define SWIG_ObjectPreviouslyDeletedError -100
899
+
900
+
901
+ /* Define custom exceptions for errors that do not map to existing Ruby
902
+ exceptions. Note this only works for C++ since a global cannot be
903
+ initialized by a funtion in C. For C, fallback to rb_eRuntimeError.*/
904
+
905
+ SWIGINTERN VALUE
906
+ getNullReferenceError(void) {
907
+ static int init = 0;
908
+ static VALUE rb_eNullReferenceError ;
909
+ if (!init) {
910
+ init = 1;
911
+ rb_eNullReferenceError = rb_define_class("NullReferenceError", rb_eRuntimeError);
912
+ }
913
+ return rb_eNullReferenceError;
914
+ }
915
+
916
+ SWIGINTERN VALUE
917
+ getObjectPreviouslyDeletedError(void) {
918
+ static int init = 0;
919
+ static VALUE rb_eObjectPreviouslyDeleted ;
920
+ if (!init) {
921
+ init = 1;
922
+ rb_eObjectPreviouslyDeleted = rb_define_class("ObjectPreviouslyDeleted", rb_eRuntimeError);
923
+ }
924
+ return rb_eObjectPreviouslyDeleted;
925
+ }
926
+
927
+
928
+ SWIGINTERN VALUE
929
+ SWIG_Ruby_ErrorType(int SWIG_code) {
930
+ VALUE type;
931
+ switch (SWIG_code) {
932
+ case SWIG_MemoryError:
933
+ type = rb_eNoMemError;
934
+ break;
935
+ case SWIG_IOError:
936
+ type = rb_eIOError;
937
+ break;
938
+ case SWIG_RuntimeError:
939
+ type = rb_eRuntimeError;
940
+ break;
941
+ case SWIG_IndexError:
942
+ type = rb_eIndexError;
943
+ break;
944
+ case SWIG_TypeError:
945
+ type = rb_eTypeError;
946
+ break;
947
+ case SWIG_DivisionByZero:
948
+ type = rb_eZeroDivError;
949
+ break;
950
+ case SWIG_OverflowError:
951
+ type = rb_eRangeError;
952
+ break;
953
+ case SWIG_SyntaxError:
954
+ type = rb_eSyntaxError;
955
+ break;
956
+ case SWIG_ValueError:
957
+ type = rb_eArgError;
958
+ break;
959
+ case SWIG_SystemError:
960
+ type = rb_eFatal;
961
+ break;
962
+ case SWIG_AttributeError:
963
+ type = rb_eRuntimeError;
964
+ break;
965
+ case SWIG_NullReferenceError:
966
+ type = getNullReferenceError();
967
+ break;
968
+ case SWIG_ObjectPreviouslyDeletedError:
969
+ type = getObjectPreviouslyDeletedError();
970
+ break;
971
+ case SWIG_UnknownError:
972
+ type = rb_eRuntimeError;
973
+ break;
974
+ default:
975
+ type = rb_eRuntimeError;
976
+ }
977
+ return type;
978
+ }
979
+
980
+
981
+
982
+
983
+ /* -----------------------------------------------------------------------------
984
+ * See the LICENSE file for information on copyright, usage and redistribution
985
+ * of SWIG, and the README file for authors - http://www.swig.org/release.html.
986
+ *
987
+ * rubytracking.swg
988
+ *
989
+ * This file contains support for tracking mappings from
990
+ * Ruby objects to C++ objects. This functionality is needed
991
+ * to implement mark functions for Ruby's mark and sweep
992
+ * garbage collector.
993
+ * ----------------------------------------------------------------------------- */
994
+
995
+ #ifdef __cplusplus
996
+ extern "C" {
997
+ #endif
998
+
999
+
1000
+ /* Global Ruby hash table to store Trackings from C/C++
1001
+ structs to Ruby Objects. */
1002
+ static VALUE swig_ruby_trackings;
1003
+
1004
+ /* Global variable that stores a reference to the ruby
1005
+ hash table delete function. */
1006
+ static ID swig_ruby_hash_delete = 0;
1007
+
1008
+ /* Setup a Ruby hash table to store Trackings */
1009
+ SWIGRUNTIME void SWIG_RubyInitializeTrackings(void) {
1010
+ /* Create a ruby hash table to store Trackings from C++
1011
+ objects to Ruby objects. Also make sure to tell
1012
+ the garabage collector about the hash table. */
1013
+ swig_ruby_trackings = rb_hash_new();
1014
+ rb_gc_register_address(&swig_ruby_trackings);
1015
+
1016
+ /* Now store a reference to the hash table delete function
1017
+ so that we only have to look it up once.*/
1018
+ swig_ruby_hash_delete = rb_intern("delete");
1019
+ }
1020
+
1021
+ /* Get a Ruby number to reference a pointer */
1022
+ SWIGRUNTIME VALUE SWIG_RubyPtrToReference(void* ptr) {
1023
+ /* We cast the pointer to an unsigned long
1024
+ and then store a reference to it using
1025
+ a Ruby number object. */
1026
+
1027
+ /* Convert the pointer to a Ruby number */
1028
+ unsigned long value = (unsigned long) ptr;
1029
+ return LONG2NUM(value);
1030
+ }
1031
+
1032
+ /* Get a Ruby number to reference an object */
1033
+ SWIGRUNTIME VALUE SWIG_RubyObjectToReference(VALUE object) {
1034
+ /* We cast the object to an unsigned long
1035
+ and then store a reference to it using
1036
+ a Ruby number object. */
1037
+
1038
+ /* Convert the Object to a Ruby number */
1039
+ unsigned long value = (unsigned long) object;
1040
+ return LONG2NUM(value);
1041
+ }
1042
+
1043
+ /* Get a Ruby object from a previously stored reference */
1044
+ SWIGRUNTIME VALUE SWIG_RubyReferenceToObject(VALUE reference) {
1045
+ /* The provided Ruby number object is a reference
1046
+ to the Ruby object we want.*/
1047
+
1048
+ /* First convert the Ruby number to a C number */
1049
+ unsigned long value = NUM2LONG(reference);
1050
+ return (VALUE) value;
1051
+ }
1052
+
1053
+ /* Add a Tracking from a C/C++ struct to a Ruby object */
1054
+ SWIGRUNTIME void SWIG_RubyAddTracking(void* ptr, VALUE object) {
1055
+ /* In a Ruby hash table we store the pointer and
1056
+ the associated Ruby object. The trick here is
1057
+ that we cannot store the Ruby object directly - if
1058
+ we do then it cannot be garbage collected. So
1059
+ instead we typecast it as a unsigned long and
1060
+ convert it to a Ruby number object.*/
1061
+
1062
+ /* Get a reference to the pointer as a Ruby number */
1063
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1064
+
1065
+ /* Get a reference to the Ruby object as a Ruby number */
1066
+ VALUE value = SWIG_RubyObjectToReference(object);
1067
+
1068
+ /* Store the mapping to the global hash table. */
1069
+ rb_hash_aset(swig_ruby_trackings, key, value);
1070
+ }
1071
+
1072
+ /* Get the Ruby object that owns the specified C/C++ struct */
1073
+ SWIGRUNTIME VALUE SWIG_RubyInstanceFor(void* ptr) {
1074
+ /* Get a reference to the pointer as a Ruby number */
1075
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1076
+
1077
+ /* Now lookup the value stored in the global hash table */
1078
+ VALUE value = rb_hash_aref(swig_ruby_trackings, key);
1079
+
1080
+ if (value == Qnil) {
1081
+ /* No object exists - return nil. */
1082
+ return Qnil;
1083
+ }
1084
+ else {
1085
+ /* Convert this value to Ruby object */
1086
+ return SWIG_RubyReferenceToObject(value);
1087
+ }
1088
+ }
1089
+
1090
+ /* Remove a Tracking from a C/C++ struct to a Ruby object. It
1091
+ is very important to remove objects once they are destroyed
1092
+ since the same memory address may be reused later to create
1093
+ a new object. */
1094
+ SWIGRUNTIME void SWIG_RubyRemoveTracking(void* ptr) {
1095
+ /* Get a reference to the pointer as a Ruby number */
1096
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1097
+
1098
+ /* Delete the object from the hash table by calling Ruby's
1099
+ do this we need to call the Hash.delete method.*/
1100
+ rb_funcall(swig_ruby_trackings, swig_ruby_hash_delete, 1, key);
1101
+ }
1102
+
1103
+ /* This is a helper method that unlinks a Ruby object from its
1104
+ underlying C++ object. This is needed if the lifetime of the
1105
+ Ruby object is longer than the C++ object */
1106
+ SWIGRUNTIME void SWIG_RubyUnlinkObjects(void* ptr) {
1107
+ VALUE object = SWIG_RubyInstanceFor(ptr);
1108
+
1109
+ if (object != Qnil) {
1110
+ DATA_PTR(object) = 0;
1111
+ }
1112
+ }
1113
+
1114
+
1115
+ #ifdef __cplusplus
1116
+ }
1117
+ #endif
1118
+
1119
+ /* -----------------------------------------------------------------------------
1120
+ * Ruby API portion that goes into the runtime
1121
+ * ----------------------------------------------------------------------------- */
1122
+
1123
+ #ifdef __cplusplus
1124
+ extern "C" {
1125
+ #endif
1126
+
1127
+ SWIGINTERN VALUE
1128
+ SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
1129
+ if (NIL_P(target)) {
1130
+ target = o;
1131
+ } else {
1132
+ if (TYPE(target) != T_ARRAY) {
1133
+ VALUE o2 = target;
1134
+ target = rb_ary_new();
1135
+ rb_ary_push(target, o2);
1136
+ }
1137
+ rb_ary_push(target, o);
1138
+ }
1139
+ return target;
1140
+ }
1141
+
1142
+ #ifdef __cplusplus
1143
+ }
1144
+ #endif
1145
+
1146
+
1147
+ /* -----------------------------------------------------------------------------
1148
+ * See the LICENSE file for information on copyright, usage and redistribution
1149
+ * of SWIG, and the README file for authors - http://www.swig.org/release.html.
1150
+ *
1151
+ * rubyrun.swg
1152
+ *
1153
+ * This file contains the runtime support for Ruby modules
1154
+ * and includes code for managing global variables and pointer
1155
+ * type checking.
1156
+ * ----------------------------------------------------------------------------- */
1157
+
1158
+ /* For backward compatibility only */
1159
+ #define SWIG_POINTER_EXCEPTION 0
1160
+
1161
+ /* for raw pointers */
1162
+ #define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
1163
+ #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, own)
1164
+ #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Ruby_NewPointerObj(ptr, type, flags)
1165
+ #define SWIG_AcquirePtr(ptr, own) SWIG_Ruby_AcquirePtr(ptr, own)
1166
+ #define swig_owntype ruby_owntype
1167
+
1168
+ /* for raw packed data */
1169
+ #define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty, flags)
1170
+ #define SWIG_NewPackedObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type)
1171
+
1172
+ /* for class or struct pointers */
1173
+ #define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
1174
+ #define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
1175
+
1176
+ /* for C or C++ function pointers */
1177
+ #define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0)
1178
+ #define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0)
1179
+
1180
+ /* for C++ member pointers, ie, member methods */
1181
+ #define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty)
1182
+ #define SWIG_NewMemberObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type)
1183
+
1184
+
1185
+ /* Runtime API */
1186
+
1187
+ #define SWIG_GetModule(clientdata) SWIG_Ruby_GetModule()
1188
+ #define SWIG_SetModule(clientdata, pointer) SWIG_Ruby_SetModule(pointer)
1189
+
1190
+
1191
+ /* Error manipulation */
1192
+
1193
+ #define SWIG_ErrorType(code) SWIG_Ruby_ErrorType(code)
1194
+ #define SWIG_Error(code, msg) rb_raise(SWIG_Ruby_ErrorType(code), msg)
1195
+ #define SWIG_fail goto fail
1196
+
1197
+
1198
+ /* Ruby-specific SWIG API */
1199
+
1200
+ #define SWIG_InitRuntime() SWIG_Ruby_InitRuntime()
1201
+ #define SWIG_define_class(ty) SWIG_Ruby_define_class(ty)
1202
+ #define SWIG_NewClassInstance(value, ty) SWIG_Ruby_NewClassInstance(value, ty)
1203
+ #define SWIG_MangleStr(value) SWIG_Ruby_MangleStr(value)
1204
+ #define SWIG_CheckConvert(value, ty) SWIG_Ruby_CheckConvert(value, ty)
1205
+
1206
+
1207
+ /* -----------------------------------------------------------------------------
1208
+ * pointers/data manipulation
1209
+ * ----------------------------------------------------------------------------- */
1210
+
1211
+ #ifdef __cplusplus
1212
+ extern "C" {
1213
+ #if 0
1214
+ } /* cc-mode */
1215
+ #endif
1216
+ #endif
1217
+
1218
+ typedef struct {
1219
+ VALUE klass;
1220
+ VALUE mImpl;
1221
+ void (*mark)(void *);
1222
+ void (*destroy)(void *);
1223
+ int trackObjects;
1224
+ } swig_class;
1225
+
1226
+
1227
+ static VALUE _mSWIG = Qnil;
1228
+ static VALUE _cSWIG_Pointer = Qnil;
1229
+ static VALUE swig_runtime_data_type_pointer = Qnil;
1230
+
1231
+ SWIGRUNTIME VALUE
1232
+ getExceptionClass(void) {
1233
+ static int init = 0;
1234
+ static VALUE rubyExceptionClass ;
1235
+ if (!init) {
1236
+ init = 1;
1237
+ rubyExceptionClass = rb_const_get(_mSWIG, rb_intern("Exception"));
1238
+ }
1239
+ return rubyExceptionClass;
1240
+ }
1241
+
1242
+ /* This code checks to see if the Ruby object being raised as part
1243
+ of an exception inherits from the Ruby class Exception. If so,
1244
+ the object is simply returned. If not, then a new Ruby exception
1245
+ object is created and that will be returned to Ruby.*/
1246
+ SWIGRUNTIME VALUE
1247
+ SWIG_Ruby_ExceptionType(swig_type_info *desc, VALUE obj) {
1248
+ VALUE exceptionClass = getExceptionClass();
1249
+ if (rb_obj_is_kind_of(obj, exceptionClass)) {
1250
+ return obj;
1251
+ } else {
1252
+ return rb_exc_new3(rb_eRuntimeError, rb_obj_as_string(obj));
1253
+ }
1254
+ }
1255
+
1256
+ /* Initialize Ruby runtime support */
1257
+ SWIGRUNTIME void
1258
+ SWIG_Ruby_InitRuntime(void)
1259
+ {
1260
+ if (_mSWIG == Qnil) {
1261
+ _mSWIG = rb_define_module("SWIG");
1262
+ }
1263
+ }
1264
+
1265
+ /* Define Ruby class for C type */
1266
+ SWIGRUNTIME void
1267
+ SWIG_Ruby_define_class(swig_type_info *type)
1268
+ {
1269
+ VALUE klass;
1270
+ char *klass_name = (char *) malloc(4 + strlen(type->name) + 1);
1271
+ sprintf(klass_name, "TYPE%s", type->name);
1272
+ if (NIL_P(_cSWIG_Pointer)) {
1273
+ _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);
1274
+ rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new");
1275
+ }
1276
+ klass = rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
1277
+ free((void *) klass_name);
1278
+ }
1279
+
1280
+ /* Create a new pointer object */
1281
+ SWIGRUNTIME VALUE
1282
+ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
1283
+ {
1284
+ int own = flags & SWIG_POINTER_OWN;
1285
+
1286
+ char *klass_name;
1287
+ swig_class *sklass;
1288
+ VALUE klass;
1289
+ VALUE obj;
1290
+
1291
+ if (!ptr)
1292
+ return Qnil;
1293
+
1294
+ if (type->clientdata) {
1295
+ sklass = (swig_class *) type->clientdata;
1296
+
1297
+ /* Are we tracking this class and have we already returned this Ruby object? */
1298
+ if (sklass->trackObjects) {
1299
+ obj = SWIG_RubyInstanceFor(ptr);
1300
+
1301
+ /* Check the object's type and make sure it has the correct type.
1302
+ It might not in cases where methods do things like
1303
+ downcast methods. */
1304
+ if (obj != Qnil) {
1305
+ VALUE value = rb_iv_get(obj, "__swigtype__");
1306
+ char* type_name = RSTRING(value)->ptr;
1307
+
1308
+ if (strcmp(type->name, type_name) == 0) {
1309
+ return obj;
1310
+ }
1311
+ }
1312
+ }
1313
+
1314
+ /* Create a new Ruby object */
1315
+ obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark), (own ? VOIDFUNC(sklass->destroy) : 0), ptr);
1316
+
1317
+ /* If tracking is on for this class then track this object. */
1318
+ if (sklass->trackObjects) {
1319
+ SWIG_RubyAddTracking(ptr, obj);
1320
+ }
1321
+ } else {
1322
+ klass_name = (char *) malloc(4 + strlen(type->name) + 1);
1323
+ sprintf(klass_name, "TYPE%s", type->name);
1324
+ klass = rb_const_get(_mSWIG, rb_intern(klass_name));
1325
+ free((void *) klass_name);
1326
+ obj = Data_Wrap_Struct(klass, 0, 0, ptr);
1327
+ }
1328
+ rb_iv_set(obj, "__swigtype__", rb_str_new2(type->name));
1329
+
1330
+ return obj;
1331
+ }
1332
+
1333
+ /* Create a new class instance (always owned) */
1334
+ SWIGRUNTIME VALUE
1335
+ SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type)
1336
+ {
1337
+ VALUE obj;
1338
+ swig_class *sklass = (swig_class *) type->clientdata;
1339
+ obj = Data_Wrap_Struct(klass, VOIDFUNC(sklass->mark), VOIDFUNC(sklass->destroy), 0);
1340
+ rb_iv_set(obj, "__swigtype__", rb_str_new2(type->name));
1341
+ return obj;
1342
+ }
1343
+
1344
+ /* Get type mangle from class name */
1345
+ SWIGRUNTIMEINLINE char *
1346
+ SWIG_Ruby_MangleStr(VALUE obj)
1347
+ {
1348
+ VALUE stype = rb_iv_get(obj, "__swigtype__");
1349
+ return StringValuePtr(stype);
1350
+ }
1351
+
1352
+ /* Acquire a pointer value */
1353
+ typedef void (*ruby_owntype)(void*);
1354
+
1355
+ SWIGRUNTIME ruby_owntype
1356
+ SWIG_Ruby_AcquirePtr(VALUE obj, ruby_owntype own) {
1357
+ if (obj) {
1358
+ ruby_owntype oldown = RDATA(obj)->dfree;
1359
+ RDATA(obj)->dfree = own;
1360
+ return oldown;
1361
+ } else {
1362
+ return 0;
1363
+ }
738
1364
  }
739
1365
 
740
1366
  /* Convert a pointer value */
741
- static int
742
- SWIG_Ruby_ConvertPtr(VALUE obj, void **ptr, swig_type_info *ty, int flags)
1367
+ SWIGRUNTIME int
1368
+ SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags, ruby_owntype *own)
743
1369
  {
744
1370
  char *c;
745
1371
  swig_cast_info *tc;
1372
+ void *vptr = 0;
746
1373
 
747
1374
  /* Grab the pointer */
748
1375
  if (NIL_P(obj)) {
749
1376
  *ptr = 0;
750
- return 0;
1377
+ return SWIG_OK;
751
1378
  } else {
752
- Data_Get_Struct(obj, void, *ptr);
1379
+ if (TYPE(obj) != T_DATA) {
1380
+ return SWIG_ERROR;
1381
+ }
1382
+ Data_Get_Struct(obj, void, vptr);
753
1383
  }
754
1384
 
1385
+ if (own) *own = RDATA(obj)->dfree;
1386
+
1387
+ /* Check to see if the input object is giving up ownership
1388
+ of the underlying C struct or C++ object. If so then we
1389
+ need to reset the destructor since the Ruby object no
1390
+ longer owns the underlying C++ object.*/
1391
+ if (flags & SWIG_POINTER_DISOWN) {
1392
+ /* Is tracking on for this class? */
1393
+ int track = 0;
1394
+ if (ty && ty->clientdata) {
1395
+ swig_class *sklass = (swig_class *) ty->clientdata;
1396
+ track = sklass->trackObjects;
1397
+ }
1398
+
1399
+ if (track) {
1400
+ /* We are tracking objects for this class. Thus we change the destructor
1401
+ * to SWIG_RubyRemoveTracking. This allows us to
1402
+ * remove the mapping from the C++ to Ruby object
1403
+ * when the Ruby object is garbage collected. If we don't
1404
+ * do this, then it is possible we will return a reference
1405
+ * to a Ruby object that no longer exists thereby crashing Ruby. */
1406
+ RDATA(obj)->dfree = SWIG_RubyRemoveTracking;
1407
+ } else {
1408
+ RDATA(obj)->dfree = 0;
1409
+ }
1410
+ }
1411
+
755
1412
  /* Do type-checking if type info was provided */
756
1413
  if (ty) {
757
1414
  if (ty->clientdata) {
758
- if (rb_obj_is_kind_of(obj, ((swig_class *) (ty->clientdata))->klass)) {
759
- if (*ptr == 0)
760
- rb_raise(rb_eRuntimeError, "This %s already released", ty->str);
761
- return 0;
1415
+ if (rb_obj_is_kind_of(obj, ((swig_class *) (ty->clientdata))->klass)) {
1416
+ if (vptr == 0) {
1417
+ /* The object has already been deleted */
1418
+ return SWIG_ObjectPreviouslyDeletedError;
762
1419
  }
1420
+ *ptr = vptr;
1421
+ return SWIG_OK;
1422
+ }
763
1423
  }
764
1424
  if ((c = SWIG_MangleStr(obj)) == NULL) {
765
- if (flags & SWIG_POINTER_EXCEPTION)
766
- rb_raise(rb_eTypeError, "Expected %s", ty->str);
767
- else
768
- return -1;
1425
+ return SWIG_ERROR;
769
1426
  }
770
1427
  tc = SWIG_TypeCheck(c, ty);
771
1428
  if (!tc) {
772
- if (flags & SWIG_POINTER_EXCEPTION)
773
- rb_raise(rb_eTypeError, "Expected %s", ty->str);
774
- else
775
- return -1;
1429
+ return SWIG_ERROR;
776
1430
  }
777
- *ptr = SWIG_TypeCast(tc, *ptr);
1431
+ *ptr = SWIG_TypeCast(tc, vptr);
1432
+ } else {
1433
+ *ptr = vptr;
778
1434
  }
779
- return 0;
780
- }
781
-
782
- /* Convert a pointer value, signal an exception on a type mismatch */
783
- static SWIGINLINE void *
784
- SWIG_Ruby_MustGetPtr(VALUE obj, swig_type_info *ty, int argnum, int flags)
785
- {
786
- void *result;
787
- SWIG_ConvertPtr(obj, &result, ty, flags | SWIG_POINTER_EXCEPTION);
788
- return result;
1435
+
1436
+ return SWIG_OK;
789
1437
  }
790
1438
 
791
1439
  /* Check convert */
792
- static SWIGINLINE int
1440
+ SWIGRUNTIMEINLINE int
793
1441
  SWIG_Ruby_CheckConvert(VALUE obj, swig_type_info *ty)
794
1442
  {
795
1443
  char *c = SWIG_MangleStr(obj);
796
- if (!c)
797
- return 0;
1444
+ if (!c) return 0;
798
1445
  return SWIG_TypeCheck(c,ty) != 0;
799
1446
  }
800
1447
 
801
- static VALUE
1448
+ SWIGRUNTIME VALUE
802
1449
  SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
803
1450
  char result[1024];
804
1451
  char *r = result;
@@ -810,8 +1457,8 @@ SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
810
1457
  }
811
1458
 
812
1459
  /* Convert a packed value value */
813
- static void
814
- SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty, int flags) {
1460
+ SWIGRUNTIME int
1461
+ SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty) {
815
1462
  swig_cast_info *tc;
816
1463
  const char *c;
817
1464
 
@@ -825,54 +1472,67 @@ SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty, int fl
825
1472
  tc = SWIG_TypeCheck(c, ty);
826
1473
  if (!tc) goto type_error;
827
1474
  }
828
- return;
829
-
830
- type_error:
1475
+ return SWIG_OK;
831
1476
 
832
- if (flags) {
833
- if (ty) {
834
- rb_raise(rb_eTypeError, "Type error. Expected %s", ty->name);
835
- } else {
836
- rb_raise(rb_eTypeError, "Expected a pointer");
837
- }
838
- }
1477
+ type_error:
1478
+ return SWIG_ERROR;
839
1479
  }
840
1480
 
841
- static swig_module_info *SWIG_Ruby_GetModule() {
842
- VALUE pointer;
843
- swig_module_info *ret = 0;
1481
+ SWIGRUNTIME swig_module_info *
1482
+ SWIG_Ruby_GetModule(void)
1483
+ {
1484
+ VALUE pointer;
1485
+ swig_module_info *ret = 0;
1486
+ VALUE verbose = rb_gv_get("VERBOSE");
844
1487
 
845
- /* first check if pointer already created */
846
- pointer = rb_gv_get("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
847
- if (pointer != Qnil) {
848
- Data_Get_Struct(pointer, swig_module_info, ret);
849
- }
850
- return ret;
1488
+ /* temporarily disable warnings, since the pointer check causes warnings with 'ruby -w' */
1489
+ rb_gv_set("VERBOSE", Qfalse);
1490
+
1491
+ /* first check if pointer already created */
1492
+ pointer = rb_gv_get("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
1493
+ if (pointer != Qnil) {
1494
+ Data_Get_Struct(pointer, swig_module_info, ret);
1495
+ }
1496
+
1497
+ /* reinstate warnings */
1498
+ rb_gv_set("VERBOSE", verbose);
1499
+ return ret;
851
1500
  }
852
1501
 
853
- static void SWIG_Ruby_SetModule(swig_module_info *pointer) {
854
- /* register a new class */
855
- VALUE cl = rb_define_class("swig_runtime_data", rb_cObject);
856
- /* create and store the structure pointer to a global variable */
857
- swig_runtime_data_type_pointer = Data_Wrap_Struct(cl, 0, 0, pointer);
858
- rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer);
1502
+ SWIGRUNTIME void
1503
+ SWIG_Ruby_SetModule(swig_module_info *pointer)
1504
+ {
1505
+ /* register a new class */
1506
+ VALUE cl = rb_define_class("swig_runtime_data", rb_cObject);
1507
+ /* create and store the structure pointer to a global variable */
1508
+ swig_runtime_data_type_pointer = Data_Wrap_Struct(cl, 0, 0, pointer);
1509
+ rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer);
859
1510
  }
860
1511
 
861
1512
  #ifdef __cplusplus
1513
+ #if 0
1514
+ { /* cc-mode */
1515
+ #endif
862
1516
  }
863
1517
  #endif
864
1518
 
865
1519
 
866
1520
 
1521
+ #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
1522
+
1523
+ #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
1524
+
1525
+
1526
+
867
1527
  /* -------- TYPES TABLE (BEGIN) -------- */
868
1528
 
869
1529
  #define SWIGTYPE_p_ID3_Field swig_types[0]
870
1530
  #define SWIGTYPE_p_ID3_Frame swig_types[1]
871
1531
  #define SWIGTYPE_p_ID3_Tag swig_types[2]
872
1532
  #define SWIGTYPE_p_ID3_Tag__Iterator swig_types[3]
873
- #define SWIGTYPE_p_unsigned_int swig_types[4]
874
- #define SWIGTYPE_p_unsigned_long swig_types[5]
875
- static swig_type_info *swig_types[6];
1533
+ #define SWIGTYPE_p_char swig_types[4]
1534
+ #define SWIGTYPE_p_unsigned_int swig_types[5]
1535
+ static swig_type_info *swig_types[7];
876
1536
  static swig_module_info swig_module = {swig_types, 6, 0, 0, 0, 0};
877
1537
  #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
878
1538
  #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
@@ -884,21 +1544,270 @@ static swig_module_info swig_module = {swig_types, 6, 0, 0, 0, 0};
884
1544
 
885
1545
  static VALUE mAPI;
886
1546
 
887
- static void SWIG_AsVal(VALUE obj, int *val)
1547
+ #define SWIGVERSION 0x010329
1548
+
1549
+
1550
+ #define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
1551
+ #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))
1552
+
1553
+
1554
+ #include <stdexcept>
1555
+
1556
+
1557
+ #include <id3/tag.h>
1558
+
1559
+
1560
+ SWIGINTERN swig_type_info*
1561
+ SWIG_pchar_descriptor()
888
1562
  {
889
- *val = (int) NUM2INT(obj);
1563
+ static int init = 0;
1564
+ static swig_type_info* info = 0;
1565
+ if (!init) {
1566
+ info = SWIG_TypeQuery("_p_char");
1567
+ init = 1;
1568
+ }
1569
+ return info;
890
1570
  }
891
1571
 
892
1572
 
893
- #include <id3/tag.h>
1573
+ SWIGINTERN int
1574
+ SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
1575
+ {
1576
+ if (TYPE(obj) == T_STRING) {
1577
+
1578
+
1579
+
1580
+ char *cstr = STR2CSTR(obj);
1581
+
1582
+ size_t size = RSTRING(obj)->len + 1;
1583
+ if (cptr) {
1584
+ if (alloc) {
1585
+ if (*alloc == SWIG_NEWOBJ) {
1586
+ *cptr = reinterpret_cast< char* >(memcpy((new char[size]), cstr, sizeof(char)*(size)));
1587
+ } else {
1588
+ *cptr = cstr;
1589
+ *alloc = SWIG_OLDOBJ;
1590
+ }
1591
+ }
1592
+ }
1593
+ if (psize) *psize = size;
1594
+ return SWIG_OK;
1595
+ } else {
1596
+ swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
1597
+ if (pchar_descriptor) {
1598
+ void* vptr = 0;
1599
+ if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
1600
+ if (cptr) *cptr = (char *)vptr;
1601
+ if (psize) *psize = vptr ? (strlen((char*)vptr) + 1) : 0;
1602
+ if (alloc) *alloc = SWIG_OLDOBJ;
1603
+ return SWIG_OK;
1604
+ }
1605
+ }
1606
+ }
1607
+ return SWIG_TypeError;
1608
+ }
1609
+
1610
+
1611
+
1612
+
1613
+
1614
+ #include <limits.h>
1615
+ #ifndef LLONG_MIN
1616
+ # define LLONG_MIN LONG_LONG_MIN
1617
+ #endif
1618
+ #ifndef LLONG_MAX
1619
+ # define LLONG_MAX LONG_LONG_MAX
1620
+ #endif
1621
+ #ifndef ULLONG_MAX
1622
+ # define ULLONG_MAX ULONG_LONG_MAX
1623
+ #endif
1624
+
1625
+
1626
+ SWIGINTERN VALUE
1627
+ SWIG_ruby_failed(void)
1628
+ {
1629
+ return Qnil;
1630
+ }
1631
+
1632
+
1633
+ /*@SWIG:%ruby_aux_method@*/
1634
+ SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
1635
+ {
1636
+ VALUE obj = args[0];
1637
+ VALUE type = TYPE(obj);
1638
+ long *res = (long *)(args[1]);
1639
+ *res = type == T_FIXNUM ? NUM2LONG(obj) : rb_big2long(obj);
1640
+ return obj;
1641
+ }
1642
+ /*@SWIG@*/
1643
+
1644
+ SWIGINTERN int
1645
+ SWIG_AsVal_long (VALUE obj, long* val)
1646
+ {
1647
+ VALUE type = TYPE(obj);
1648
+ if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
1649
+ long v;
1650
+ VALUE a[2];
1651
+ a[0] = obj;
1652
+ a[1] = (VALUE)(&v);
1653
+ if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2LONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
1654
+ if (val) *val = v;
1655
+ return SWIG_OK;
1656
+ }
1657
+ }
1658
+ return SWIG_TypeError;
1659
+ }
1660
+
1661
+
1662
+ SWIGINTERN int
1663
+ SWIG_AsVal_int (VALUE obj, int *val)
1664
+ {
1665
+ long v;
1666
+ int res = SWIG_AsVal_long (obj, &v);
1667
+ if (SWIG_IsOK(res)) {
1668
+ if ((v < INT_MIN || v > INT_MAX)) {
1669
+ return SWIG_OverflowError;
1670
+ } else {
1671
+ if (val) *val = static_cast< int >(v);
1672
+ }
1673
+ }
1674
+ return res;
1675
+ }
1676
+
1677
+
1678
+ SWIGINTERNINLINE VALUE
1679
+ SWIG_From_bool (bool value)
1680
+ {
1681
+ return value ? Qtrue : Qfalse;
1682
+ }
1683
+
1684
+
1685
+ /*@SWIG:%ruby_aux_method@*/
1686
+ SWIGINTERN VALUE SWIG_AUX_NUM2ULONG(VALUE *args)
1687
+ {
1688
+ VALUE obj = args[0];
1689
+ VALUE type = TYPE(obj);
1690
+ unsigned long *res = (unsigned long *)(args[1]);
1691
+ *res = type == T_FIXNUM ? NUM2ULONG(obj) : rb_big2ulong(obj);
1692
+ return obj;
1693
+ }
1694
+ /*@SWIG@*/
1695
+
1696
+ SWIGINTERN int
1697
+ SWIG_AsVal_unsigned_SS_long (VALUE obj, unsigned long *val)
1698
+ {
1699
+ VALUE type = TYPE(obj);
1700
+ if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
1701
+ unsigned long v;
1702
+ VALUE a[2];
1703
+ a[0] = obj;
1704
+ a[1] = (VALUE)(&v);
1705
+ if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2ULONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
1706
+ if (val) *val = v;
1707
+ return SWIG_OK;
1708
+ }
1709
+ }
1710
+ return SWIG_TypeError;
1711
+ }
1712
+
1713
+
1714
+ SWIGINTERN int
1715
+ SWIG_AsVal_unsigned_SS_int (VALUE obj, unsigned int *val)
1716
+ {
1717
+ unsigned long v;
1718
+ int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
1719
+ if (SWIG_IsOK(res)) {
1720
+ if ((v > UINT_MAX)) {
1721
+ return SWIG_OverflowError;
1722
+ } else {
1723
+ if (val) *val = static_cast< unsigned int >(v);
1724
+ }
1725
+ }
1726
+ return res;
1727
+ }
1728
+
1729
+
1730
+ #define SWIG_From_long LONG2NUM
1731
+
1732
+
1733
+ SWIGINTERNINLINE VALUE
1734
+ SWIG_From_unsigned_SS_long (unsigned long value)
1735
+ {
1736
+ return ULONG2NUM(value);
1737
+ }
1738
+
1739
+
1740
+ SWIGINTERNINLINE VALUE
1741
+ SWIG_From_size_t (size_t value)
1742
+ {
1743
+ return SWIG_From_unsigned_SS_long (static_cast< unsigned long >(value));
1744
+ }
894
1745
 
895
- static ID3_Frame *ID3_Tag_iterator_next_frame(ID3_Tag *self,ID3_Tag::Iterator *iterator){
1746
+
1747
+ SWIGINTERNINLINE VALUE
1748
+ SWIG_From_unsigned_SS_int (unsigned int value)
1749
+ {
1750
+ return SWIG_From_unsigned_SS_long (value);
1751
+ }
1752
+
1753
+
1754
+ SWIGINTERNINLINE VALUE
1755
+ SWIG_FromCharPtrAndSize(const char* carray, size_t size)
1756
+ {
1757
+ if (carray) {
1758
+ if (size > LONG_MAX) {
1759
+ swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
1760
+ return pchar_descriptor ?
1761
+ SWIG_NewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : Qnil;
1762
+ } else {
1763
+ return rb_str_new(carray, static_cast< long >(size));
1764
+ }
1765
+ } else {
1766
+ return Qnil;
1767
+ }
1768
+ }
1769
+
1770
+
1771
+ SWIGINTERNINLINE VALUE
1772
+ SWIG_FromCharPtr(const char *cptr)
1773
+ {
1774
+ return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
1775
+ }
1776
+
1777
+
1778
+ SWIGINTERN int
1779
+ SWIG_AsVal_bool (VALUE obj, bool *val)
1780
+ {
1781
+ if (obj == Qtrue) {
1782
+ if (val) *val = true;
1783
+ return SWIG_OK;
1784
+ } else if (obj == Qfalse) {
1785
+ if (val) *val = false;
1786
+ return SWIG_OK;
1787
+ } else {
1788
+ int res = 0;
1789
+ if (SWIG_AsVal_int (obj, &res) == SWIG_OK) {
1790
+ if (val) *val = res ? true : false;
1791
+ return SWIG_OK;
1792
+ }
1793
+ }
1794
+ return SWIG_TypeError;
1795
+ }
1796
+
1797
+ SWIGINTERN ID3_Frame *ID3_Tag_iterator_next_frame(ID3_Tag *self,ID3_Tag::Iterator *iterator){
896
1798
  return iterator->GetNext();
897
1799
  }
898
- static VALUE ID3_Field_binary(ID3_Field *self){
1800
+
1801
+ SWIGINTERNINLINE VALUE
1802
+ SWIG_From_int (int value)
1803
+ {
1804
+ return SWIG_From_long (value);
1805
+ }
1806
+
1807
+ SWIGINTERN VALUE ID3_Field_binary(ID3_Field *self){
899
1808
  return rb_str_new((const char *)self->GetRawBinary(), self->Size());
900
1809
  }
901
- static VALUE ID3_Field_unicode(ID3_Field *self){
1810
+ SWIGINTERN VALUE ID3_Field_unicode(ID3_Field *self){
902
1811
  const char *string = (const char *)self->GetRawUnicodeText();
903
1812
  long size = self->Size();
904
1813
  if (size < 2) {
@@ -911,12 +1820,12 @@ static VALUE ID3_Field_unicode(ID3_Field *self){
911
1820
  }
912
1821
  return rb_str_new(string, size);
913
1822
  }
914
- static size_t ID3_Field_set_binary(ID3_Field *self,VALUE data){
1823
+ SWIGINTERN size_t ID3_Field_set_binary(ID3_Field *self,VALUE data){
915
1824
  StringValue(data);
916
1825
  return self->Set( (const unsigned char *)RSTRING(data)->ptr,
917
1826
  RSTRING(data)->len );
918
1827
  }
919
- static size_t ID3_Field_set_unicode(ID3_Field *self,VALUE data){
1828
+ SWIGINTERN size_t ID3_Field_set_unicode(ID3_Field *self,VALUE data){
920
1829
  StringValue(data);
921
1830
 
922
1831
  long len;
@@ -940,803 +1849,1160 @@ static size_t ID3_Field_set_unicode(ID3_Field *self,VALUE data){
940
1849
  }
941
1850
  swig_class cTag;
942
1851
 
943
- static VALUE
1852
+ SWIGINTERN VALUE
944
1853
  _wrap_new_Tag__SWIG_0(int argc, VALUE *argv, VALUE self) {
945
- char *arg1 = (char *) 0 ;
946
- ID3_Tag *result;
947
-
948
- if ((argc < 1) || (argc > 1))
949
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
950
- arg1 = StringValuePtr(argv[0]);
951
- result = (ID3_Tag *)new ID3_Tag((char const *)arg1);
952
- DATA_PTR(self) = result;
953
- return self;
1854
+ char *arg1 = (char *) 0 ;
1855
+ ID3_Tag *result = 0 ;
1856
+ int res1 ;
1857
+ char *buf1 = 0 ;
1858
+ int alloc1 = 0 ;
1859
+
1860
+ if ((argc < 1) || (argc > 1)) {
1861
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
1862
+ }
1863
+ res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
1864
+ if (!SWIG_IsOK(res1)) {
1865
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ID3_Tag" "', argument " "1"" of type '" "char const *""'");
1866
+ }
1867
+ arg1 = buf1;
1868
+ result = (ID3_Tag *)new ID3_Tag((char const *)arg1);DATA_PTR(self) = result;
1869
+
1870
+ if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
1871
+ return self;
1872
+ fail:
1873
+ if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
1874
+ return Qnil;
954
1875
  }
955
1876
 
956
1877
 
957
1878
  #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
958
- static VALUE
1879
+ SWIGINTERN VALUE
959
1880
  _wrap_Tag_allocate(VALUE self) {
960
1881
  #else
961
- static VALUE
962
- _wrap_Tag_allocate(int argc, VALUE *argv, VALUE self) {
1882
+ SWIGINTERN VALUE
1883
+ _wrap_Tag_allocate(int argc, VALUE *argv, VALUE self) {
963
1884
  #endif
964
-
965
-
966
- VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_ID3_Tag);
1885
+
1886
+
1887
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_ID3_Tag);
967
1888
  #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
968
- rb_obj_call_init(vresult, argc, argv);
1889
+ rb_obj_call_init(vresult, argc, argv);
969
1890
  #endif
970
- return vresult;
971
- }
972
-
1891
+ return vresult;
1892
+ }
1893
+
973
1894
 
974
- static VALUE
1895
+ SWIGINTERN VALUE
975
1896
  _wrap_new_Tag__SWIG_1(int argc, VALUE *argv, VALUE self) {
976
- ID3_Tag *result;
977
-
978
- if ((argc < 0) || (argc > 0))
979
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
980
- result = (ID3_Tag *)new ID3_Tag();
981
- DATA_PTR(self) = result;
982
- return self;
1897
+ ID3_Tag *result = 0 ;
1898
+
1899
+ if ((argc < 0) || (argc > 0)) {
1900
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
1901
+ }
1902
+ result = (ID3_Tag *)new ID3_Tag();DATA_PTR(self) = result;
1903
+
1904
+ return self;
1905
+ fail:
1906
+ return Qnil;
983
1907
  }
984
1908
 
985
1909
 
986
- static VALUE _wrap_new_Tag(int nargs, VALUE *args, VALUE self) {
987
- int argc;
988
- VALUE argv[1];
989
- int ii;
990
-
991
- argc = nargs;
992
- for (ii = 0; (ii < argc) && (ii < 1); ii++) {
993
- argv[ii] = args[ii];
994
- }
995
- if (argc == 0) {
996
- return _wrap_new_Tag__SWIG_1(nargs, args, self);
997
- }
998
- if (argc == 1) {
999
- int _v;
1000
- {
1001
- _v = (TYPE(argv[0]) == T_STRING) ? 1 : 0;
1002
- }
1003
- if (_v) {
1004
- return _wrap_new_Tag__SWIG_0(nargs, args, self);
1005
- }
1910
+ SWIGINTERN VALUE _wrap_new_Tag(int nargs, VALUE *args, VALUE self) {
1911
+ int argc;
1912
+ VALUE argv[1];
1913
+ int ii;
1914
+
1915
+ argc = nargs;
1916
+ if (argc > 1) SWIG_fail;
1917
+ for (ii = 0; (ii < argc); ii++) {
1918
+ argv[ii] = args[ii];
1919
+ }
1920
+ if (argc == 0) {
1921
+ return _wrap_new_Tag__SWIG_1(nargs, args, self);
1922
+ }
1923
+ if (argc == 1) {
1924
+ int _v;
1925
+ int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
1926
+ _v = SWIG_CheckState(res);
1927
+ if (_v) {
1928
+ return _wrap_new_Tag__SWIG_0(nargs, args, self);
1006
1929
  }
1007
-
1008
- rb_raise(rb_eArgError, "No matching function for overloaded 'new_Tag'");
1009
- return Qnil;
1930
+ }
1931
+
1932
+ fail:
1933
+ rb_raise(rb_eArgError, "No matching function for overloaded 'new_Tag'");
1934
+ return Qnil;
1010
1935
  }
1011
1936
 
1012
1937
 
1013
- static void
1938
+ SWIGINTERN void
1014
1939
  free_ID3_Tag(ID3_Tag *arg1) {
1015
1940
  delete arg1;
1016
1941
  }
1017
- static VALUE
1942
+
1943
+ SWIGINTERN VALUE
1018
1944
  _wrap_Tag_has_tag_type(int argc, VALUE *argv, VALUE self) {
1019
- ID3_Tag *arg1 = (ID3_Tag *) 0 ;
1020
- ID3_TagType arg2 ;
1021
- bool result;
1022
- VALUE vresult = Qnil;
1023
-
1024
- if ((argc < 1) || (argc > 1))
1025
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1026
- SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_ID3_Tag, 1);
1027
- arg2 = (ID3_TagType) NUM2INT(argv[0]);
1028
- result = (bool)((ID3_Tag const *)arg1)->HasTagType(arg2);
1029
-
1030
- vresult = result ? Qtrue : Qfalse;
1031
- return vresult;
1945
+ ID3_Tag *arg1 = (ID3_Tag *) 0 ;
1946
+ ID3_TagType arg2 ;
1947
+ bool result;
1948
+ void *argp1 = 0 ;
1949
+ int res1 = 0 ;
1950
+ int val2 ;
1951
+ int ecode2 = 0 ;
1952
+ VALUE vresult = Qnil;
1953
+
1954
+ if ((argc < 1) || (argc > 1)) {
1955
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
1956
+ }
1957
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Tag, 0 | 0 );
1958
+ if (!SWIG_IsOK(res1)) {
1959
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HasTagType" "', argument " "1"" of type '" "ID3_Tag const *""'");
1960
+ }
1961
+ arg1 = reinterpret_cast< ID3_Tag * >(argp1);
1962
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
1963
+ if (!SWIG_IsOK(ecode2)) {
1964
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HasTagType" "', argument " "2"" of type '" "ID3_TagType""'");
1965
+ }
1966
+ arg2 = static_cast< ID3_TagType >(val2);
1967
+ result = (bool)((ID3_Tag const *)arg1)->HasTagType(arg2);
1968
+ vresult = SWIG_From_bool(static_cast< bool >(result));
1969
+ return vresult;
1970
+ fail:
1971
+ return Qnil;
1032
1972
  }
1033
1973
 
1034
1974
 
1035
- static VALUE
1975
+ SWIGINTERN VALUE
1036
1976
  _wrap_Tag_link__SWIG_0(int argc, VALUE *argv, VALUE self) {
1037
- ID3_Tag *arg1 = (ID3_Tag *) 0 ;
1038
- char *arg2 = (char *) 0 ;
1039
- flags_t arg3 ;
1040
- size_t result;
1041
- VALUE vresult = Qnil;
1042
-
1043
- if ((argc < 2) || (argc > 2))
1044
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
1045
- SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_ID3_Tag, 1);
1046
- arg2 = StringValuePtr(argv[0]);
1047
- arg3 = NUM2UINT(argv[1]);
1048
- result = (arg1)->Link((char const *)arg2,arg3);
1049
-
1050
- vresult = UINT2NUM(result);
1051
- return vresult;
1052
- }
1053
-
1054
-
1055
- static VALUE
1977
+ ID3_Tag *arg1 = (ID3_Tag *) 0 ;
1978
+ char *arg2 = (char *) 0 ;
1979
+ flags_t arg3 ;
1980
+ size_t result;
1981
+ void *argp1 = 0 ;
1982
+ int res1 = 0 ;
1983
+ int res2 ;
1984
+ char *buf2 = 0 ;
1985
+ int alloc2 = 0 ;
1986
+ unsigned int val3 ;
1987
+ int ecode3 = 0 ;
1988
+ VALUE vresult = Qnil;
1989
+
1990
+ if ((argc < 2) || (argc > 2)) {
1991
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
1992
+ }
1993
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Tag, 0 | 0 );
1994
+ if (!SWIG_IsOK(res1)) {
1995
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Link" "', argument " "1"" of type '" "ID3_Tag *""'");
1996
+ }
1997
+ arg1 = reinterpret_cast< ID3_Tag * >(argp1);
1998
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
1999
+ if (!SWIG_IsOK(res2)) {
2000
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Link" "', argument " "2"" of type '" "char const *""'");
2001
+ }
2002
+ arg2 = buf2;
2003
+ ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
2004
+ if (!SWIG_IsOK(ecode3)) {
2005
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Link" "', argument " "3"" of type '" "flags_t""'");
2006
+ }
2007
+ arg3 = static_cast< flags_t >(val3);
2008
+ result = (arg1)->Link((char const *)arg2,arg3);
2009
+ vresult = SWIG_From_size_t(static_cast< size_t >(result));
2010
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
2011
+ return vresult;
2012
+ fail:
2013
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
2014
+ return Qnil;
2015
+ }
2016
+
2017
+
2018
+ SWIGINTERN VALUE
1056
2019
  _wrap_Tag_link__SWIG_1(int argc, VALUE *argv, VALUE self) {
1057
- ID3_Tag *arg1 = (ID3_Tag *) 0 ;
1058
- char *arg2 = (char *) 0 ;
1059
- size_t result;
1060
- VALUE vresult = Qnil;
1061
-
1062
- if ((argc < 1) || (argc > 1))
1063
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1064
- SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_ID3_Tag, 1);
1065
- arg2 = StringValuePtr(argv[0]);
1066
- result = (arg1)->Link((char const *)arg2);
1067
-
1068
- vresult = UINT2NUM(result);
1069
- return vresult;
2020
+ ID3_Tag *arg1 = (ID3_Tag *) 0 ;
2021
+ char *arg2 = (char *) 0 ;
2022
+ size_t result;
2023
+ void *argp1 = 0 ;
2024
+ int res1 = 0 ;
2025
+ int res2 ;
2026
+ char *buf2 = 0 ;
2027
+ int alloc2 = 0 ;
2028
+ VALUE vresult = Qnil;
2029
+
2030
+ if ((argc < 1) || (argc > 1)) {
2031
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2032
+ }
2033
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Tag, 0 | 0 );
2034
+ if (!SWIG_IsOK(res1)) {
2035
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Link" "', argument " "1"" of type '" "ID3_Tag *""'");
2036
+ }
2037
+ arg1 = reinterpret_cast< ID3_Tag * >(argp1);
2038
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
2039
+ if (!SWIG_IsOK(res2)) {
2040
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Link" "', argument " "2"" of type '" "char const *""'");
2041
+ }
2042
+ arg2 = buf2;
2043
+ result = (arg1)->Link((char const *)arg2);
2044
+ vresult = SWIG_From_size_t(static_cast< size_t >(result));
2045
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
2046
+ return vresult;
2047
+ fail:
2048
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
2049
+ return Qnil;
1070
2050
  }
1071
2051
 
1072
2052
 
1073
- static VALUE _wrap_Tag_link(int nargs, VALUE *args, VALUE self) {
1074
- int argc;
1075
- VALUE argv[4];
1076
- int ii;
1077
-
1078
- argc = nargs + 1;
1079
- argv[0] = self;
1080
- for (ii = 1; (ii < argc) && (ii < 3); ii++) {
1081
- argv[ii] = args[ii-1];
1082
- }
1083
- if (argc == 2) {
1084
- int _v;
1085
- {
1086
- void *ptr;
1087
- _v = (NIL_P(argv[0]) || (TYPE(argv[0]) == T_DATA && SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_ID3_Tag, 0) != -1)) ? 1 : 0;
1088
- }
1089
- if (_v) {
1090
- {
1091
- _v = (TYPE(argv[1]) == T_STRING) ? 1 : 0;
1092
- }
1093
- if (_v) {
1094
- return _wrap_Tag_link__SWIG_1(nargs, args, self);
1095
- }
1096
- }
2053
+ SWIGINTERN VALUE _wrap_Tag_link(int nargs, VALUE *args, VALUE self) {
2054
+ int argc;
2055
+ VALUE argv[4];
2056
+ int ii;
2057
+
2058
+ argc = nargs + 1;
2059
+ argv[0] = self;
2060
+ if (argc > 4) SWIG_fail;
2061
+ for (ii = 1; (ii < argc); ii++) {
2062
+ argv[ii] = args[ii-1];
2063
+ }
2064
+ if (argc == 2) {
2065
+ int _v;
2066
+ void *vptr = 0;
2067
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ID3_Tag, 0);
2068
+ _v = SWIG_CheckState(res);
2069
+ if (_v) {
2070
+ int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
2071
+ _v = SWIG_CheckState(res);
2072
+ if (_v) {
2073
+ return _wrap_Tag_link__SWIG_1(nargs, args, self);
2074
+ }
1097
2075
  }
1098
- if (argc == 3) {
1099
- int _v;
2076
+ }
2077
+ if (argc == 3) {
2078
+ int _v;
2079
+ void *vptr = 0;
2080
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ID3_Tag, 0);
2081
+ _v = SWIG_CheckState(res);
2082
+ if (_v) {
2083
+ int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
2084
+ _v = SWIG_CheckState(res);
2085
+ if (_v) {
1100
2086
  {
1101
- void *ptr;
1102
- _v = (NIL_P(argv[0]) || (TYPE(argv[0]) == T_DATA && SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_ID3_Tag, 0) != -1)) ? 1 : 0;
2087
+ int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
2088
+ _v = SWIG_CheckState(res);
1103
2089
  }
1104
2090
  if (_v) {
1105
- {
1106
- _v = (TYPE(argv[1]) == T_STRING) ? 1 : 0;
1107
- }
1108
- if (_v) {
1109
- {
1110
- _v = ((TYPE(argv[2]) == T_FIXNUM) || (TYPE(argv[2]) == T_BIGNUM)) ? 1 : 0;
1111
- }
1112
- if (_v) {
1113
- return _wrap_Tag_link__SWIG_0(nargs, args, self);
1114
- }
1115
- }
2091
+ return _wrap_Tag_link__SWIG_0(nargs, args, self);
1116
2092
  }
2093
+ }
1117
2094
  }
1118
-
1119
- rb_raise(rb_eArgError, "No matching function for overloaded 'Tag_link'");
1120
- return Qnil;
2095
+ }
2096
+
2097
+ fail:
2098
+ rb_raise(rb_eArgError, "No matching function for overloaded 'Tag_link'");
2099
+ return Qnil;
1121
2100
  }
1122
2101
 
1123
2102
 
1124
- static VALUE
2103
+ SWIGINTERN VALUE
1125
2104
  _wrap_Tag_update__SWIG_0(int argc, VALUE *argv, VALUE self) {
1126
- ID3_Tag *arg1 = (ID3_Tag *) 0 ;
1127
- flags_t arg2 ;
1128
- flags_t result;
1129
- VALUE vresult = Qnil;
1130
-
1131
- if ((argc < 1) || (argc > 1))
1132
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1133
- SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_ID3_Tag, 1);
1134
- arg2 = NUM2UINT(argv[0]);
1135
- result = (flags_t)(arg1)->Update(arg2);
1136
-
1137
- vresult = UINT2NUM(result);
1138
- return vresult;
2105
+ ID3_Tag *arg1 = (ID3_Tag *) 0 ;
2106
+ flags_t arg2 ;
2107
+ flags_t result;
2108
+ void *argp1 = 0 ;
2109
+ int res1 = 0 ;
2110
+ unsigned int val2 ;
2111
+ int ecode2 = 0 ;
2112
+ VALUE vresult = Qnil;
2113
+
2114
+ if ((argc < 1) || (argc > 1)) {
2115
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2116
+ }
2117
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Tag, 0 | 0 );
2118
+ if (!SWIG_IsOK(res1)) {
2119
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Update" "', argument " "1"" of type '" "ID3_Tag *""'");
2120
+ }
2121
+ arg1 = reinterpret_cast< ID3_Tag * >(argp1);
2122
+ ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
2123
+ if (!SWIG_IsOK(ecode2)) {
2124
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Update" "', argument " "2"" of type '" "flags_t""'");
2125
+ }
2126
+ arg2 = static_cast< flags_t >(val2);
2127
+ result = (flags_t)(arg1)->Update(arg2);
2128
+ vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
2129
+ return vresult;
2130
+ fail:
2131
+ return Qnil;
1139
2132
  }
1140
2133
 
1141
2134
 
1142
- static VALUE
2135
+ SWIGINTERN VALUE
1143
2136
  _wrap_Tag_update__SWIG_1(int argc, VALUE *argv, VALUE self) {
1144
- ID3_Tag *arg1 = (ID3_Tag *) 0 ;
1145
- flags_t result;
1146
- VALUE vresult = Qnil;
1147
-
1148
- if ((argc < 0) || (argc > 0))
1149
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
1150
- SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_ID3_Tag, 1);
1151
- result = (flags_t)(arg1)->Update();
1152
-
1153
- vresult = UINT2NUM(result);
1154
- return vresult;
1155
- }
1156
-
1157
-
1158
- static VALUE _wrap_Tag_update(int nargs, VALUE *args, VALUE self) {
1159
- int argc;
1160
- VALUE argv[3];
1161
- int ii;
1162
-
1163
- argc = nargs + 1;
1164
- argv[0] = self;
1165
- for (ii = 1; (ii < argc) && (ii < 2); ii++) {
1166
- argv[ii] = args[ii-1];
1167
- }
1168
- if (argc == 1) {
1169
- int _v;
1170
- {
1171
- void *ptr;
1172
- _v = (NIL_P(argv[0]) || (TYPE(argv[0]) == T_DATA && SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_ID3_Tag, 0) != -1)) ? 1 : 0;
1173
- }
1174
- if (_v) {
1175
- return _wrap_Tag_update__SWIG_1(nargs, args, self);
1176
- }
2137
+ ID3_Tag *arg1 = (ID3_Tag *) 0 ;
2138
+ flags_t result;
2139
+ void *argp1 = 0 ;
2140
+ int res1 = 0 ;
2141
+ VALUE vresult = Qnil;
2142
+
2143
+ if ((argc < 0) || (argc > 0)) {
2144
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2145
+ }
2146
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Tag, 0 | 0 );
2147
+ if (!SWIG_IsOK(res1)) {
2148
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Update" "', argument " "1"" of type '" "ID3_Tag *""'");
2149
+ }
2150
+ arg1 = reinterpret_cast< ID3_Tag * >(argp1);
2151
+ result = (flags_t)(arg1)->Update();
2152
+ vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
2153
+ return vresult;
2154
+ fail:
2155
+ return Qnil;
2156
+ }
2157
+
2158
+
2159
+ SWIGINTERN VALUE _wrap_Tag_update(int nargs, VALUE *args, VALUE self) {
2160
+ int argc;
2161
+ VALUE argv[3];
2162
+ int ii;
2163
+
2164
+ argc = nargs + 1;
2165
+ argv[0] = self;
2166
+ if (argc > 3) SWIG_fail;
2167
+ for (ii = 1; (ii < argc); ii++) {
2168
+ argv[ii] = args[ii-1];
2169
+ }
2170
+ if (argc == 1) {
2171
+ int _v;
2172
+ void *vptr = 0;
2173
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ID3_Tag, 0);
2174
+ _v = SWIG_CheckState(res);
2175
+ if (_v) {
2176
+ return _wrap_Tag_update__SWIG_1(nargs, args, self);
1177
2177
  }
1178
- if (argc == 2) {
1179
- int _v;
1180
- {
1181
- void *ptr;
1182
- _v = (NIL_P(argv[0]) || (TYPE(argv[0]) == T_DATA && SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_ID3_Tag, 0) != -1)) ? 1 : 0;
1183
- }
1184
- if (_v) {
1185
- {
1186
- _v = ((TYPE(argv[1]) == T_FIXNUM) || (TYPE(argv[1]) == T_BIGNUM)) ? 1 : 0;
1187
- }
1188
- if (_v) {
1189
- return _wrap_Tag_update__SWIG_0(nargs, args, self);
1190
- }
1191
- }
2178
+ }
2179
+ if (argc == 2) {
2180
+ int _v;
2181
+ void *vptr = 0;
2182
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ID3_Tag, 0);
2183
+ _v = SWIG_CheckState(res);
2184
+ if (_v) {
2185
+ {
2186
+ int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
2187
+ _v = SWIG_CheckState(res);
2188
+ }
2189
+ if (_v) {
2190
+ return _wrap_Tag_update__SWIG_0(nargs, args, self);
2191
+ }
1192
2192
  }
1193
-
1194
- rb_raise(rb_eArgError, "No matching function for overloaded 'Tag_update'");
1195
- return Qnil;
2193
+ }
2194
+
2195
+ fail:
2196
+ rb_raise(rb_eArgError, "No matching function for overloaded 'Tag_update'");
2197
+ return Qnil;
1196
2198
  }
1197
2199
 
1198
2200
 
1199
- static VALUE
2201
+ SWIGINTERN VALUE
1200
2202
  _wrap_Tag_strip__SWIG_0(int argc, VALUE *argv, VALUE self) {
1201
- ID3_Tag *arg1 = (ID3_Tag *) 0 ;
1202
- flags_t arg2 ;
1203
- flags_t result;
1204
- VALUE vresult = Qnil;
1205
-
1206
- if ((argc < 1) || (argc > 1))
1207
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1208
- SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_ID3_Tag, 1);
1209
- arg2 = NUM2UINT(argv[0]);
1210
- result = (flags_t)(arg1)->Strip(arg2);
1211
-
1212
- vresult = UINT2NUM(result);
1213
- return vresult;
2203
+ ID3_Tag *arg1 = (ID3_Tag *) 0 ;
2204
+ flags_t arg2 ;
2205
+ flags_t result;
2206
+ void *argp1 = 0 ;
2207
+ int res1 = 0 ;
2208
+ unsigned int val2 ;
2209
+ int ecode2 = 0 ;
2210
+ VALUE vresult = Qnil;
2211
+
2212
+ if ((argc < 1) || (argc > 1)) {
2213
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2214
+ }
2215
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Tag, 0 | 0 );
2216
+ if (!SWIG_IsOK(res1)) {
2217
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Strip" "', argument " "1"" of type '" "ID3_Tag *""'");
2218
+ }
2219
+ arg1 = reinterpret_cast< ID3_Tag * >(argp1);
2220
+ ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
2221
+ if (!SWIG_IsOK(ecode2)) {
2222
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Strip" "', argument " "2"" of type '" "flags_t""'");
2223
+ }
2224
+ arg2 = static_cast< flags_t >(val2);
2225
+ result = (flags_t)(arg1)->Strip(arg2);
2226
+ vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
2227
+ return vresult;
2228
+ fail:
2229
+ return Qnil;
1214
2230
  }
1215
2231
 
1216
2232
 
1217
- static VALUE
2233
+ SWIGINTERN VALUE
1218
2234
  _wrap_Tag_strip__SWIG_1(int argc, VALUE *argv, VALUE self) {
1219
- ID3_Tag *arg1 = (ID3_Tag *) 0 ;
1220
- flags_t result;
1221
- VALUE vresult = Qnil;
1222
-
1223
- if ((argc < 0) || (argc > 0))
1224
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
1225
- SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_ID3_Tag, 1);
1226
- result = (flags_t)(arg1)->Strip();
1227
-
1228
- vresult = UINT2NUM(result);
1229
- return vresult;
2235
+ ID3_Tag *arg1 = (ID3_Tag *) 0 ;
2236
+ flags_t result;
2237
+ void *argp1 = 0 ;
2238
+ int res1 = 0 ;
2239
+ VALUE vresult = Qnil;
2240
+
2241
+ if ((argc < 0) || (argc > 0)) {
2242
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2243
+ }
2244
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Tag, 0 | 0 );
2245
+ if (!SWIG_IsOK(res1)) {
2246
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Strip" "', argument " "1"" of type '" "ID3_Tag *""'");
2247
+ }
2248
+ arg1 = reinterpret_cast< ID3_Tag * >(argp1);
2249
+ result = (flags_t)(arg1)->Strip();
2250
+ vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
2251
+ return vresult;
2252
+ fail:
2253
+ return Qnil;
1230
2254
  }
1231
2255
 
1232
2256
 
1233
- static VALUE _wrap_Tag_strip(int nargs, VALUE *args, VALUE self) {
1234
- int argc;
1235
- VALUE argv[3];
1236
- int ii;
1237
-
1238
- argc = nargs + 1;
1239
- argv[0] = self;
1240
- for (ii = 1; (ii < argc) && (ii < 2); ii++) {
1241
- argv[ii] = args[ii-1];
1242
- }
1243
- if (argc == 1) {
1244
- int _v;
1245
- {
1246
- void *ptr;
1247
- _v = (NIL_P(argv[0]) || (TYPE(argv[0]) == T_DATA && SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_ID3_Tag, 0) != -1)) ? 1 : 0;
1248
- }
1249
- if (_v) {
1250
- return _wrap_Tag_strip__SWIG_1(nargs, args, self);
1251
- }
2257
+ SWIGINTERN VALUE _wrap_Tag_strip(int nargs, VALUE *args, VALUE self) {
2258
+ int argc;
2259
+ VALUE argv[3];
2260
+ int ii;
2261
+
2262
+ argc = nargs + 1;
2263
+ argv[0] = self;
2264
+ if (argc > 3) SWIG_fail;
2265
+ for (ii = 1; (ii < argc); ii++) {
2266
+ argv[ii] = args[ii-1];
2267
+ }
2268
+ if (argc == 1) {
2269
+ int _v;
2270
+ void *vptr = 0;
2271
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ID3_Tag, 0);
2272
+ _v = SWIG_CheckState(res);
2273
+ if (_v) {
2274
+ return _wrap_Tag_strip__SWIG_1(nargs, args, self);
1252
2275
  }
1253
- if (argc == 2) {
1254
- int _v;
1255
- {
1256
- void *ptr;
1257
- _v = (NIL_P(argv[0]) || (TYPE(argv[0]) == T_DATA && SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_ID3_Tag, 0) != -1)) ? 1 : 0;
1258
- }
1259
- if (_v) {
1260
- {
1261
- _v = ((TYPE(argv[1]) == T_FIXNUM) || (TYPE(argv[1]) == T_BIGNUM)) ? 1 : 0;
1262
- }
1263
- if (_v) {
1264
- return _wrap_Tag_strip__SWIG_0(nargs, args, self);
1265
- }
1266
- }
2276
+ }
2277
+ if (argc == 2) {
2278
+ int _v;
2279
+ void *vptr = 0;
2280
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_ID3_Tag, 0);
2281
+ _v = SWIG_CheckState(res);
2282
+ if (_v) {
2283
+ {
2284
+ int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL);
2285
+ _v = SWIG_CheckState(res);
2286
+ }
2287
+ if (_v) {
2288
+ return _wrap_Tag_strip__SWIG_0(nargs, args, self);
2289
+ }
1267
2290
  }
1268
-
1269
- rb_raise(rb_eArgError, "No matching function for overloaded 'Tag_strip'");
1270
- return Qnil;
2291
+ }
2292
+
2293
+ fail:
2294
+ rb_raise(rb_eArgError, "No matching function for overloaded 'Tag_strip'");
2295
+ return Qnil;
1271
2296
  }
1272
2297
 
1273
2298
 
1274
- static VALUE
2299
+ SWIGINTERN VALUE
1275
2300
  _wrap_Tag_clear(int argc, VALUE *argv, VALUE self) {
1276
- ID3_Tag *arg1 = (ID3_Tag *) 0 ;
1277
-
1278
- if ((argc < 0) || (argc > 0))
1279
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
1280
- SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_ID3_Tag, 1);
1281
- (arg1)->Clear();
1282
-
1283
- return Qnil;
2301
+ ID3_Tag *arg1 = (ID3_Tag *) 0 ;
2302
+ void *argp1 = 0 ;
2303
+ int res1 = 0 ;
2304
+
2305
+ if ((argc < 0) || (argc > 0)) {
2306
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2307
+ }
2308
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Tag, 0 | 0 );
2309
+ if (!SWIG_IsOK(res1)) {
2310
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Clear" "', argument " "1"" of type '" "ID3_Tag *""'");
2311
+ }
2312
+ arg1 = reinterpret_cast< ID3_Tag * >(argp1);
2313
+ (arg1)->Clear();
2314
+ return Qnil;
2315
+ fail:
2316
+ return Qnil;
1284
2317
  }
1285
2318
 
1286
2319
 
1287
- static VALUE
2320
+ SWIGINTERN VALUE
1288
2321
  _wrap_Tag_remove_frame(int argc, VALUE *argv, VALUE self) {
1289
- ID3_Tag *arg1 = (ID3_Tag *) 0 ;
1290
- ID3_Frame *arg2 = (ID3_Frame *) 0 ;
1291
- ID3_Frame *result;
1292
- VALUE vresult = Qnil;
1293
-
1294
- if ((argc < 1) || (argc > 1))
1295
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1296
- SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_ID3_Tag, 1);
1297
- SWIG_ConvertPtr(argv[0], (void **) &arg2, SWIGTYPE_p_ID3_Frame, 1);
1298
- result = (ID3_Frame *)(arg1)->RemoveFrame((ID3_Frame const *)arg2);
1299
-
1300
- vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_ID3_Frame,0);
1301
- return vresult;
2322
+ ID3_Tag *arg1 = (ID3_Tag *) 0 ;
2323
+ ID3_Frame *arg2 = (ID3_Frame *) 0 ;
2324
+ ID3_Frame *result = 0 ;
2325
+ void *argp1 = 0 ;
2326
+ int res1 = 0 ;
2327
+ void *argp2 = 0 ;
2328
+ int res2 = 0 ;
2329
+ VALUE vresult = Qnil;
2330
+
2331
+ if ((argc < 1) || (argc > 1)) {
2332
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2333
+ }
2334
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Tag, 0 | 0 );
2335
+ if (!SWIG_IsOK(res1)) {
2336
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RemoveFrame" "', argument " "1"" of type '" "ID3_Tag *""'");
2337
+ }
2338
+ arg1 = reinterpret_cast< ID3_Tag * >(argp1);
2339
+ res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_ID3_Frame, 0 | 0 );
2340
+ if (!SWIG_IsOK(res2)) {
2341
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "RemoveFrame" "', argument " "2"" of type '" "ID3_Frame const *""'");
2342
+ }
2343
+ arg2 = reinterpret_cast< ID3_Frame * >(argp2);
2344
+ result = (ID3_Frame *)(arg1)->RemoveFrame((ID3_Frame const *)arg2);
2345
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ID3_Frame, 0 | 0 );
2346
+ return vresult;
2347
+ fail:
2348
+ return Qnil;
1302
2349
  }
1303
2350
 
1304
2351
 
1305
- static VALUE
2352
+ SWIGINTERN VALUE
1306
2353
  _wrap_Tag_add_frame(int argc, VALUE *argv, VALUE self) {
1307
- ID3_Tag *arg1 = (ID3_Tag *) 0 ;
1308
- ID3_Frame *arg2 = (ID3_Frame *) 0 ;
1309
-
1310
- if ((argc < 1) || (argc > 1))
1311
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1312
- SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_ID3_Tag, 1);
1313
- SWIG_ConvertPtr(argv[0], (void **) &arg2, SWIGTYPE_p_ID3_Frame, 1);
1314
- (arg1)->AddFrame((ID3_Frame const *)arg2);
1315
-
1316
- return Qnil;
2354
+ ID3_Tag *arg1 = (ID3_Tag *) 0 ;
2355
+ ID3_Frame *arg2 = (ID3_Frame *) 0 ;
2356
+ void *argp1 = 0 ;
2357
+ int res1 = 0 ;
2358
+ void *argp2 = 0 ;
2359
+ int res2 = 0 ;
2360
+
2361
+ if ((argc < 1) || (argc > 1)) {
2362
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2363
+ }
2364
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Tag, 0 | 0 );
2365
+ if (!SWIG_IsOK(res1)) {
2366
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AddFrame" "', argument " "1"" of type '" "ID3_Tag *""'");
2367
+ }
2368
+ arg1 = reinterpret_cast< ID3_Tag * >(argp1);
2369
+ res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_ID3_Frame, 0 | 0 );
2370
+ if (!SWIG_IsOK(res2)) {
2371
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "AddFrame" "', argument " "2"" of type '" "ID3_Frame const *""'");
2372
+ }
2373
+ arg2 = reinterpret_cast< ID3_Frame * >(argp2);
2374
+ (arg1)->AddFrame((ID3_Frame const *)arg2);
2375
+ return Qnil;
2376
+ fail:
2377
+ return Qnil;
1317
2378
  }
1318
2379
 
1319
2380
 
1320
- static VALUE
2381
+ SWIGINTERN VALUE
1321
2382
  _wrap_Tag_filename(int argc, VALUE *argv, VALUE self) {
1322
- ID3_Tag *arg1 = (ID3_Tag *) 0 ;
1323
- char *result;
1324
- VALUE vresult = Qnil;
1325
-
1326
- if ((argc < 0) || (argc > 0))
1327
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
1328
- SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_ID3_Tag, 1);
1329
- result = (char *)((ID3_Tag const *)arg1)->GetFileName();
1330
-
1331
- vresult = rb_str_new2(result);
1332
- return vresult;
2383
+ ID3_Tag *arg1 = (ID3_Tag *) 0 ;
2384
+ char *result = 0 ;
2385
+ void *argp1 = 0 ;
2386
+ int res1 = 0 ;
2387
+ VALUE vresult = Qnil;
2388
+
2389
+ if ((argc < 0) || (argc > 0)) {
2390
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2391
+ }
2392
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Tag, 0 | 0 );
2393
+ if (!SWIG_IsOK(res1)) {
2394
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GetFileName" "', argument " "1"" of type '" "ID3_Tag const *""'");
2395
+ }
2396
+ arg1 = reinterpret_cast< ID3_Tag * >(argp1);
2397
+ result = (char *)((ID3_Tag const *)arg1)->GetFileName();
2398
+ vresult = SWIG_FromCharPtr(result);
2399
+ return vresult;
2400
+ fail:
2401
+ return Qnil;
1333
2402
  }
1334
2403
 
1335
2404
 
1336
- static VALUE
2405
+ SWIGINTERN VALUE
1337
2406
  _wrap_Tag_set_padding(int argc, VALUE *argv, VALUE self) {
1338
- ID3_Tag *arg1 = (ID3_Tag *) 0 ;
1339
- bool arg2 ;
1340
- bool result;
1341
- VALUE vresult = Qnil;
1342
-
1343
- if ((argc < 1) || (argc > 1))
1344
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1345
- SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_ID3_Tag, 1);
1346
- arg2 = RTEST(argv[0]);
1347
- result = (bool)(arg1)->SetPadding(arg2);
1348
-
1349
- vresult = result ? Qtrue : Qfalse;
1350
- return vresult;
2407
+ ID3_Tag *arg1 = (ID3_Tag *) 0 ;
2408
+ bool arg2 ;
2409
+ bool result;
2410
+ void *argp1 = 0 ;
2411
+ int res1 = 0 ;
2412
+ bool val2 ;
2413
+ int ecode2 = 0 ;
2414
+ VALUE vresult = Qnil;
2415
+
2416
+ if ((argc < 1) || (argc > 1)) {
2417
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2418
+ }
2419
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Tag, 0 | 0 );
2420
+ if (!SWIG_IsOK(res1)) {
2421
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SetPadding" "', argument " "1"" of type '" "ID3_Tag *""'");
2422
+ }
2423
+ arg1 = reinterpret_cast< ID3_Tag * >(argp1);
2424
+ ecode2 = SWIG_AsVal_bool(argv[0], &val2);
2425
+ if (!SWIG_IsOK(ecode2)) {
2426
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SetPadding" "', argument " "2"" of type '" "bool""'");
2427
+ }
2428
+ arg2 = static_cast< bool >(val2);
2429
+ result = (bool)(arg1)->SetPadding(arg2);
2430
+ vresult = SWIG_From_bool(static_cast< bool >(result));
2431
+ return vresult;
2432
+ fail:
2433
+ return Qnil;
1351
2434
  }
1352
2435
 
1353
2436
 
1354
- static VALUE
2437
+ SWIGINTERN VALUE
1355
2438
  _wrap_Tag_size(int argc, VALUE *argv, VALUE self) {
1356
- ID3_Tag *arg1 = (ID3_Tag *) 0 ;
1357
- size_t result;
1358
- VALUE vresult = Qnil;
1359
-
1360
- if ((argc < 0) || (argc > 0))
1361
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
1362
- SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_ID3_Tag, 1);
1363
- result = ((ID3_Tag const *)arg1)->Size();
1364
-
1365
- vresult = UINT2NUM(result);
1366
- return vresult;
2439
+ ID3_Tag *arg1 = (ID3_Tag *) 0 ;
2440
+ size_t result;
2441
+ void *argp1 = 0 ;
2442
+ int res1 = 0 ;
2443
+ VALUE vresult = Qnil;
2444
+
2445
+ if ((argc < 0) || (argc > 0)) {
2446
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2447
+ }
2448
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Tag, 0 | 0 );
2449
+ if (!SWIG_IsOK(res1)) {
2450
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Size" "', argument " "1"" of type '" "ID3_Tag const *""'");
2451
+ }
2452
+ arg1 = reinterpret_cast< ID3_Tag * >(argp1);
2453
+ result = ((ID3_Tag const *)arg1)->Size();
2454
+ vresult = SWIG_From_size_t(static_cast< size_t >(result));
2455
+ return vresult;
2456
+ fail:
2457
+ return Qnil;
1367
2458
  }
1368
2459
 
1369
2460
 
1370
- static VALUE
2461
+ SWIGINTERN VALUE
1371
2462
  _wrap_Tag_find(int argc, VALUE *argv, VALUE self) {
1372
- ID3_Tag *arg1 = (ID3_Tag *) 0 ;
1373
- ID3_FrameID arg2 ;
1374
- ID3_Frame *result;
1375
- VALUE vresult = Qnil;
1376
-
1377
- if ((argc < 1) || (argc > 1))
1378
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1379
- SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_ID3_Tag, 1);
1380
- arg2 = (ID3_FrameID) NUM2INT(argv[0]);
1381
- result = (ID3_Frame *)((ID3_Tag const *)arg1)->Find(arg2);
1382
-
1383
- vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_ID3_Frame,0);
1384
- return vresult;
2463
+ ID3_Tag *arg1 = (ID3_Tag *) 0 ;
2464
+ ID3_FrameID arg2 ;
2465
+ ID3_Frame *result = 0 ;
2466
+ void *argp1 = 0 ;
2467
+ int res1 = 0 ;
2468
+ int val2 ;
2469
+ int ecode2 = 0 ;
2470
+ VALUE vresult = Qnil;
2471
+
2472
+ if ((argc < 1) || (argc > 1)) {
2473
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2474
+ }
2475
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Tag, 0 | 0 );
2476
+ if (!SWIG_IsOK(res1)) {
2477
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Find" "', argument " "1"" of type '" "ID3_Tag const *""'");
2478
+ }
2479
+ arg1 = reinterpret_cast< ID3_Tag * >(argp1);
2480
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
2481
+ if (!SWIG_IsOK(ecode2)) {
2482
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Find" "', argument " "2"" of type '" "ID3_FrameID""'");
2483
+ }
2484
+ arg2 = static_cast< ID3_FrameID >(val2);
2485
+ result = (ID3_Frame *)((ID3_Tag const *)arg1)->Find(arg2);
2486
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ID3_Frame, 0 | 0 );
2487
+ return vresult;
2488
+ fail:
2489
+ return Qnil;
1385
2490
  }
1386
2491
 
1387
2492
 
1388
- static VALUE
2493
+ SWIGINTERN VALUE
1389
2494
  _wrap_Tag_iterator_new(int argc, VALUE *argv, VALUE self) {
1390
- ID3_Tag *arg1 = (ID3_Tag *) 0 ;
1391
- ID3_Tag::Iterator *result;
1392
- VALUE vresult = Qnil;
1393
-
1394
- if ((argc < 0) || (argc > 0))
1395
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
1396
- SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_ID3_Tag, 1);
1397
- result = (ID3_Tag::Iterator *)(arg1)->CreateIterator();
1398
-
1399
- vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_ID3_Tag__Iterator,0);
1400
- return vresult;
2495
+ ID3_Tag *arg1 = (ID3_Tag *) 0 ;
2496
+ ID3_Tag::Iterator *result = 0 ;
2497
+ void *argp1 = 0 ;
2498
+ int res1 = 0 ;
2499
+ VALUE vresult = Qnil;
2500
+
2501
+ if ((argc < 0) || (argc > 0)) {
2502
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2503
+ }
2504
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Tag, 0 | 0 );
2505
+ if (!SWIG_IsOK(res1)) {
2506
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CreateIterator" "', argument " "1"" of type '" "ID3_Tag *""'");
2507
+ }
2508
+ arg1 = reinterpret_cast< ID3_Tag * >(argp1);
2509
+ result = (ID3_Tag::Iterator *)(arg1)->CreateIterator();
2510
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ID3_Tag__Iterator, 0 | 0 );
2511
+ return vresult;
2512
+ fail:
2513
+ return Qnil;
1401
2514
  }
1402
2515
 
1403
2516
 
1404
- static VALUE
2517
+ SWIGINTERN VALUE
1405
2518
  _wrap_Tag_iterator_next_frame(int argc, VALUE *argv, VALUE self) {
1406
- ID3_Tag *arg1 = (ID3_Tag *) 0 ;
1407
- ID3_Tag::Iterator *arg2 = (ID3_Tag::Iterator *) 0 ;
1408
- ID3_Frame *result;
1409
- VALUE vresult = Qnil;
1410
-
1411
- if ((argc < 1) || (argc > 1))
1412
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1413
- SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_ID3_Tag, 1);
1414
- SWIG_ConvertPtr(argv[0], (void **) &arg2, SWIGTYPE_p_ID3_Tag__Iterator, 1);
1415
- result = (ID3_Frame *)ID3_Tag_iterator_next_frame(arg1,arg2);
1416
-
1417
- vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_ID3_Frame,0);
1418
- return vresult;
2519
+ ID3_Tag *arg1 = (ID3_Tag *) 0 ;
2520
+ ID3_Tag::Iterator *arg2 = (ID3_Tag::Iterator *) 0 ;
2521
+ ID3_Frame *result = 0 ;
2522
+ void *argp1 = 0 ;
2523
+ int res1 = 0 ;
2524
+ void *argp2 = 0 ;
2525
+ int res2 = 0 ;
2526
+ VALUE vresult = Qnil;
2527
+
2528
+ if ((argc < 1) || (argc > 1)) {
2529
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2530
+ }
2531
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Tag, 0 | 0 );
2532
+ if (!SWIG_IsOK(res1)) {
2533
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "iterator_next_frame" "', argument " "1"" of type '" "ID3_Tag *""'");
2534
+ }
2535
+ arg1 = reinterpret_cast< ID3_Tag * >(argp1);
2536
+ res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_ID3_Tag__Iterator, 0 | 0 );
2537
+ if (!SWIG_IsOK(res2)) {
2538
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "iterator_next_frame" "', argument " "2"" of type '" "ID3_Tag::Iterator *""'");
2539
+ }
2540
+ arg2 = reinterpret_cast< ID3_Tag::Iterator * >(argp2);
2541
+ result = (ID3_Frame *)ID3_Tag_iterator_next_frame(arg1,arg2);
2542
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ID3_Frame, 0 | 0 );
2543
+ return vresult;
2544
+ fail:
2545
+ return Qnil;
1419
2546
  }
1420
2547
 
1421
2548
 
1422
2549
  swig_class cFrame;
1423
2550
 
1424
- static VALUE
2551
+ SWIGINTERN VALUE
1425
2552
  _wrap_new_Frame__SWIG_0(int argc, VALUE *argv, VALUE self) {
1426
- ID3_FrameID arg1 ;
1427
- ID3_Frame *result;
1428
-
1429
- if ((argc < 1) || (argc > 1))
1430
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1431
- arg1 = (ID3_FrameID) NUM2INT(argv[0]);
1432
- result = (ID3_Frame *)new ID3_Frame(arg1);
1433
- DATA_PTR(self) = result;
1434
- return self;
2553
+ ID3_FrameID arg1 ;
2554
+ ID3_Frame *result = 0 ;
2555
+ int val1 ;
2556
+ int ecode1 = 0 ;
2557
+
2558
+ if ((argc < 1) || (argc > 1)) {
2559
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2560
+ }
2561
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
2562
+ if (!SWIG_IsOK(ecode1)) {
2563
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "ID3_Frame" "', argument " "1"" of type '" "ID3_FrameID""'");
2564
+ }
2565
+ arg1 = static_cast< ID3_FrameID >(val1);
2566
+ result = (ID3_Frame *)new ID3_Frame(arg1);DATA_PTR(self) = result;
2567
+
2568
+ return self;
2569
+ fail:
2570
+ return Qnil;
1435
2571
  }
1436
2572
 
1437
2573
 
1438
2574
  #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
1439
- static VALUE
2575
+ SWIGINTERN VALUE
1440
2576
  _wrap_Frame_allocate(VALUE self) {
1441
2577
  #else
1442
- static VALUE
1443
- _wrap_Frame_allocate(int argc, VALUE *argv, VALUE self) {
2578
+ SWIGINTERN VALUE
2579
+ _wrap_Frame_allocate(int argc, VALUE *argv, VALUE self) {
1444
2580
  #endif
1445
-
1446
-
1447
- VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_ID3_Frame);
2581
+
2582
+
2583
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_ID3_Frame);
1448
2584
  #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
1449
- rb_obj_call_init(vresult, argc, argv);
2585
+ rb_obj_call_init(vresult, argc, argv);
1450
2586
  #endif
1451
- return vresult;
1452
- }
1453
-
2587
+ return vresult;
2588
+ }
2589
+
1454
2590
 
1455
- static VALUE
2591
+ SWIGINTERN VALUE
1456
2592
  _wrap_new_Frame__SWIG_1(int argc, VALUE *argv, VALUE self) {
1457
- ID3_Frame *result;
1458
-
1459
- if ((argc < 0) || (argc > 0))
1460
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
1461
- result = (ID3_Frame *)new ID3_Frame();
1462
- DATA_PTR(self) = result;
1463
- return self;
2593
+ ID3_Frame *result = 0 ;
2594
+
2595
+ if ((argc < 0) || (argc > 0)) {
2596
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2597
+ }
2598
+ result = (ID3_Frame *)new ID3_Frame();DATA_PTR(self) = result;
2599
+
2600
+ return self;
2601
+ fail:
2602
+ return Qnil;
1464
2603
  }
1465
2604
 
1466
2605
 
1467
- static VALUE _wrap_new_Frame(int nargs, VALUE *args, VALUE self) {
1468
- int argc;
1469
- VALUE argv[1];
1470
- int ii;
1471
-
1472
- argc = nargs;
1473
- for (ii = 0; (ii < argc) && (ii < 1); ii++) {
1474
- argv[ii] = args[ii];
1475
- }
1476
- if (argc == 0) {
1477
- return _wrap_new_Frame__SWIG_1(nargs, args, self);
2606
+ SWIGINTERN VALUE _wrap_new_Frame(int nargs, VALUE *args, VALUE self) {
2607
+ int argc;
2608
+ VALUE argv[1];
2609
+ int ii;
2610
+
2611
+ argc = nargs;
2612
+ if (argc > 1) SWIG_fail;
2613
+ for (ii = 0; (ii < argc); ii++) {
2614
+ argv[ii] = args[ii];
2615
+ }
2616
+ if (argc == 0) {
2617
+ return _wrap_new_Frame__SWIG_1(nargs, args, self);
2618
+ }
2619
+ if (argc == 1) {
2620
+ int _v;
2621
+ {
2622
+ int res = SWIG_AsVal_int(argv[0], NULL);
2623
+ _v = SWIG_CheckState(res);
1478
2624
  }
1479
- if (argc == 1) {
1480
- int _v;
1481
- {
1482
- _v = ((TYPE(argv[0]) == T_FIXNUM) || (TYPE(argv[0]) == T_BIGNUM)) ? 1 : 0;
1483
- }
1484
- if (_v) {
1485
- return _wrap_new_Frame__SWIG_0(nargs, args, self);
1486
- }
2625
+ if (_v) {
2626
+ return _wrap_new_Frame__SWIG_0(nargs, args, self);
1487
2627
  }
1488
-
1489
- rb_raise(rb_eArgError, "No matching function for overloaded 'new_Frame'");
1490
- return Qnil;
2628
+ }
2629
+
2630
+ fail:
2631
+ rb_raise(rb_eArgError, "No matching function for overloaded 'new_Frame'");
2632
+ return Qnil;
1491
2633
  }
1492
2634
 
1493
2635
 
1494
- static void
2636
+ SWIGINTERN void
1495
2637
  free_ID3_Frame(ID3_Frame *arg1) {
1496
2638
  delete arg1;
1497
2639
  }
1498
- static VALUE
2640
+
2641
+ SWIGINTERN VALUE
1499
2642
  _wrap_Frame_field(int argc, VALUE *argv, VALUE self) {
1500
- ID3_Frame *arg1 = (ID3_Frame *) 0 ;
1501
- ID3_FieldID arg2 ;
1502
- ID3_Field *result;
1503
- VALUE vresult = Qnil;
1504
-
1505
- if ((argc < 1) || (argc > 1))
1506
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1507
- SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_ID3_Frame, 1);
1508
- arg2 = (ID3_FieldID) NUM2INT(argv[0]);
1509
- result = (ID3_Field *)((ID3_Frame const *)arg1)->GetField(arg2);
1510
-
1511
- vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_ID3_Field,0);
1512
- return vresult;
2643
+ ID3_Frame *arg1 = (ID3_Frame *) 0 ;
2644
+ ID3_FieldID arg2 ;
2645
+ ID3_Field *result = 0 ;
2646
+ void *argp1 = 0 ;
2647
+ int res1 = 0 ;
2648
+ int val2 ;
2649
+ int ecode2 = 0 ;
2650
+ VALUE vresult = Qnil;
2651
+
2652
+ if ((argc < 1) || (argc > 1)) {
2653
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2654
+ }
2655
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Frame, 0 | 0 );
2656
+ if (!SWIG_IsOK(res1)) {
2657
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GetField" "', argument " "1"" of type '" "ID3_Frame const *""'");
2658
+ }
2659
+ arg1 = reinterpret_cast< ID3_Frame * >(argp1);
2660
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
2661
+ if (!SWIG_IsOK(ecode2)) {
2662
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GetField" "', argument " "2"" of type '" "ID3_FieldID""'");
2663
+ }
2664
+ arg2 = static_cast< ID3_FieldID >(val2);
2665
+ result = (ID3_Field *)((ID3_Frame const *)arg1)->GetField(arg2);
2666
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ID3_Field, 0 | 0 );
2667
+ return vresult;
2668
+ fail:
2669
+ return Qnil;
1513
2670
  }
1514
2671
 
1515
2672
 
1516
- static VALUE
2673
+ SWIGINTERN VALUE
1517
2674
  _wrap_Frame_num(int argc, VALUE *argv, VALUE self) {
1518
- ID3_Frame *arg1 = (ID3_Frame *) 0 ;
1519
- ID3_FrameID result;
1520
- VALUE vresult = Qnil;
1521
-
1522
- if ((argc < 0) || (argc > 0))
1523
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
1524
- SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_ID3_Frame, 1);
1525
- result = (ID3_FrameID)((ID3_Frame const *)arg1)->GetID();
1526
-
1527
- vresult = INT2NUM(result);
1528
- return vresult;
2675
+ ID3_Frame *arg1 = (ID3_Frame *) 0 ;
2676
+ ID3_FrameID result;
2677
+ void *argp1 = 0 ;
2678
+ int res1 = 0 ;
2679
+ VALUE vresult = Qnil;
2680
+
2681
+ if ((argc < 0) || (argc > 0)) {
2682
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2683
+ }
2684
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Frame, 0 | 0 );
2685
+ if (!SWIG_IsOK(res1)) {
2686
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GetID" "', argument " "1"" of type '" "ID3_Frame const *""'");
2687
+ }
2688
+ arg1 = reinterpret_cast< ID3_Frame * >(argp1);
2689
+ result = (ID3_FrameID)((ID3_Frame const *)arg1)->GetID();
2690
+ vresult = SWIG_From_int(static_cast< int >(result));
2691
+ return vresult;
2692
+ fail:
2693
+ return Qnil;
1529
2694
  }
1530
2695
 
1531
2696
 
1532
2697
  swig_class cField;
1533
2698
 
1534
- static VALUE
2699
+ SWIGINTERN VALUE
1535
2700
  _wrap_Field_type(int argc, VALUE *argv, VALUE self) {
1536
- ID3_Field *arg1 = (ID3_Field *) 0 ;
1537
- ID3_FieldType result;
1538
- VALUE vresult = Qnil;
1539
-
1540
- if ((argc < 0) || (argc > 0))
1541
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
1542
- SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_ID3_Field, 1);
1543
- result = (ID3_FieldType)((ID3_Field const *)arg1)->GetType();
1544
-
1545
- vresult = INT2NUM(result);
1546
- return vresult;
2701
+ ID3_Field *arg1 = (ID3_Field *) 0 ;
2702
+ ID3_FieldType result;
2703
+ void *argp1 = 0 ;
2704
+ int res1 = 0 ;
2705
+ VALUE vresult = Qnil;
2706
+
2707
+ if ((argc < 0) || (argc > 0)) {
2708
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2709
+ }
2710
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Field, 0 | 0 );
2711
+ if (!SWIG_IsOK(res1)) {
2712
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GetType" "', argument " "1"" of type '" "ID3_Field const *""'");
2713
+ }
2714
+ arg1 = reinterpret_cast< ID3_Field * >(argp1);
2715
+ result = (ID3_FieldType)((ID3_Field const *)arg1)->GetType();
2716
+ vresult = SWIG_From_int(static_cast< int >(result));
2717
+ return vresult;
2718
+ fail:
2719
+ return Qnil;
1547
2720
  }
1548
2721
 
1549
2722
 
1550
- static VALUE
2723
+ SWIGINTERN VALUE
1551
2724
  _wrap_Field_integer(int argc, VALUE *argv, VALUE self) {
1552
- ID3_Field *arg1 = (ID3_Field *) 0 ;
1553
- unsigned long result;
1554
- VALUE vresult = Qnil;
1555
-
1556
- if ((argc < 0) || (argc > 0))
1557
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
1558
- SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_ID3_Field, 1);
1559
- result = (unsigned long)((ID3_Field const *)arg1)->Get();
1560
-
1561
- vresult = UINT2NUM(result);
1562
- return vresult;
2725
+ ID3_Field *arg1 = (ID3_Field *) 0 ;
2726
+ unsigned long result;
2727
+ void *argp1 = 0 ;
2728
+ int res1 = 0 ;
2729
+ VALUE vresult = Qnil;
2730
+
2731
+ if ((argc < 0) || (argc > 0)) {
2732
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2733
+ }
2734
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Field, 0 | 0 );
2735
+ if (!SWIG_IsOK(res1)) {
2736
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Get" "', argument " "1"" of type '" "ID3_Field const *""'");
2737
+ }
2738
+ arg1 = reinterpret_cast< ID3_Field * >(argp1);
2739
+ result = (unsigned long)((ID3_Field const *)arg1)->Get();
2740
+ vresult = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result));
2741
+ return vresult;
2742
+ fail:
2743
+ return Qnil;
1563
2744
  }
1564
2745
 
1565
2746
 
1566
- static VALUE
2747
+ SWIGINTERN VALUE
1567
2748
  _wrap_Field_binary(int argc, VALUE *argv, VALUE self) {
1568
- ID3_Field *arg1 = (ID3_Field *) 0 ;
1569
- VALUE result;
1570
- VALUE vresult = Qnil;
1571
-
1572
- if ((argc < 0) || (argc > 0))
1573
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
1574
- SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_ID3_Field, 1);
1575
- result = (VALUE)ID3_Field_binary(arg1);
1576
-
1577
- vresult = result;
1578
- return vresult;
2749
+ ID3_Field *arg1 = (ID3_Field *) 0 ;
2750
+ VALUE result;
2751
+ void *argp1 = 0 ;
2752
+ int res1 = 0 ;
2753
+ VALUE vresult = Qnil;
2754
+
2755
+ if ((argc < 0) || (argc > 0)) {
2756
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2757
+ }
2758
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Field, 0 | 0 );
2759
+ if (!SWIG_IsOK(res1)) {
2760
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "binary" "', argument " "1"" of type '" "ID3_Field *""'");
2761
+ }
2762
+ arg1 = reinterpret_cast< ID3_Field * >(argp1);
2763
+ result = (VALUE)ID3_Field_binary(arg1);
2764
+ vresult = result;
2765
+ return vresult;
2766
+ fail:
2767
+ return Qnil;
1579
2768
  }
1580
2769
 
1581
2770
 
1582
- static VALUE
2771
+ SWIGINTERN VALUE
1583
2772
  _wrap_Field_ascii(int argc, VALUE *argv, VALUE self) {
1584
- ID3_Field *arg1 = (ID3_Field *) 0 ;
1585
- char *result;
1586
- VALUE vresult = Qnil;
1587
-
1588
- if ((argc < 0) || (argc > 0))
1589
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
1590
- SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_ID3_Field, 1);
1591
- result = (char *)((ID3_Field const *)arg1)->GetRawText();
1592
-
1593
- vresult = rb_str_new2(result);
1594
- return vresult;
2773
+ ID3_Field *arg1 = (ID3_Field *) 0 ;
2774
+ char *result = 0 ;
2775
+ void *argp1 = 0 ;
2776
+ int res1 = 0 ;
2777
+ VALUE vresult = Qnil;
2778
+
2779
+ if ((argc < 0) || (argc > 0)) {
2780
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2781
+ }
2782
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Field, 0 | 0 );
2783
+ if (!SWIG_IsOK(res1)) {
2784
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GetRawText" "', argument " "1"" of type '" "ID3_Field const *""'");
2785
+ }
2786
+ arg1 = reinterpret_cast< ID3_Field * >(argp1);
2787
+ result = (char *)((ID3_Field const *)arg1)->GetRawText();
2788
+ vresult = SWIG_FromCharPtr(result);
2789
+ return vresult;
2790
+ fail:
2791
+ return Qnil;
1595
2792
  }
1596
2793
 
1597
2794
 
1598
- static VALUE
2795
+ SWIGINTERN VALUE
1599
2796
  _wrap_Field_unicode(int argc, VALUE *argv, VALUE self) {
1600
- ID3_Field *arg1 = (ID3_Field *) 0 ;
1601
- VALUE result;
1602
- VALUE vresult = Qnil;
1603
-
1604
- if ((argc < 0) || (argc > 0))
1605
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
1606
- SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_ID3_Field, 1);
1607
- result = (VALUE)ID3_Field_unicode(arg1);
1608
-
1609
- vresult = result;
1610
- return vresult;
2797
+ ID3_Field *arg1 = (ID3_Field *) 0 ;
2798
+ VALUE result;
2799
+ void *argp1 = 0 ;
2800
+ int res1 = 0 ;
2801
+ VALUE vresult = Qnil;
2802
+
2803
+ if ((argc < 0) || (argc > 0)) {
2804
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2805
+ }
2806
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Field, 0 | 0 );
2807
+ if (!SWIG_IsOK(res1)) {
2808
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "unicode" "', argument " "1"" of type '" "ID3_Field *""'");
2809
+ }
2810
+ arg1 = reinterpret_cast< ID3_Field * >(argp1);
2811
+ result = (VALUE)ID3_Field_unicode(arg1);
2812
+ vresult = result;
2813
+ return vresult;
2814
+ fail:
2815
+ return Qnil;
1611
2816
  }
1612
2817
 
1613
2818
 
1614
- static VALUE
2819
+ SWIGINTERN VALUE
1615
2820
  _wrap_Field_set_integer(int argc, VALUE *argv, VALUE self) {
1616
- ID3_Field *arg1 = (ID3_Field *) 0 ;
1617
- unsigned long arg2 ;
1618
-
1619
- if ((argc < 1) || (argc > 1))
1620
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1621
- SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_ID3_Field, 1);
1622
- arg2 = NUM2ULONG(argv[0]);
1623
- (arg1)->Set(arg2);
1624
-
1625
- return Qnil;
2821
+ ID3_Field *arg1 = (ID3_Field *) 0 ;
2822
+ unsigned long arg2 ;
2823
+ void *argp1 = 0 ;
2824
+ int res1 = 0 ;
2825
+ unsigned long val2 ;
2826
+ int ecode2 = 0 ;
2827
+
2828
+ if ((argc < 1) || (argc > 1)) {
2829
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2830
+ }
2831
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Field, 0 | 0 );
2832
+ if (!SWIG_IsOK(res1)) {
2833
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Set" "', argument " "1"" of type '" "ID3_Field *""'");
2834
+ }
2835
+ arg1 = reinterpret_cast< ID3_Field * >(argp1);
2836
+ ecode2 = SWIG_AsVal_unsigned_SS_long(argv[0], &val2);
2837
+ if (!SWIG_IsOK(ecode2)) {
2838
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Set" "', argument " "2"" of type '" "unsigned long""'");
2839
+ }
2840
+ arg2 = static_cast< unsigned long >(val2);
2841
+ (arg1)->Set(arg2);
2842
+ return Qnil;
2843
+ fail:
2844
+ return Qnil;
1626
2845
  }
1627
2846
 
1628
2847
 
1629
- static VALUE
2848
+ SWIGINTERN VALUE
1630
2849
  _wrap_Field_set_binary(int argc, VALUE *argv, VALUE self) {
1631
- ID3_Field *arg1 = (ID3_Field *) 0 ;
1632
- VALUE arg2 ;
1633
- size_t result;
1634
- VALUE vresult = Qnil;
1635
-
1636
- if ((argc < 1) || (argc > 1))
1637
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1638
- SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_ID3_Field, 1);
1639
- arg2 = argv[0];
1640
- result = ID3_Field_set_binary(arg1,arg2);
1641
-
1642
- vresult = UINT2NUM(result);
1643
- return vresult;
2850
+ ID3_Field *arg1 = (ID3_Field *) 0 ;
2851
+ VALUE arg2 = (VALUE) 0 ;
2852
+ size_t result;
2853
+ void *argp1 = 0 ;
2854
+ int res1 = 0 ;
2855
+ VALUE vresult = Qnil;
2856
+
2857
+ if ((argc < 1) || (argc > 1)) {
2858
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2859
+ }
2860
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Field, 0 | 0 );
2861
+ if (!SWIG_IsOK(res1)) {
2862
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "set_binary" "', argument " "1"" of type '" "ID3_Field *""'");
2863
+ }
2864
+ arg1 = reinterpret_cast< ID3_Field * >(argp1);
2865
+ arg2 = argv[0];
2866
+ result = ID3_Field_set_binary(arg1,arg2);
2867
+ vresult = SWIG_From_size_t(static_cast< size_t >(result));
2868
+ return vresult;
2869
+ fail:
2870
+ return Qnil;
1644
2871
  }
1645
2872
 
1646
2873
 
1647
- static VALUE
2874
+ SWIGINTERN VALUE
1648
2875
  _wrap_Field_set_ascii(int argc, VALUE *argv, VALUE self) {
1649
- ID3_Field *arg1 = (ID3_Field *) 0 ;
1650
- char *arg2 = (char *) 0 ;
1651
- size_t result;
1652
- VALUE vresult = Qnil;
1653
-
1654
- if ((argc < 1) || (argc > 1))
1655
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1656
- SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_ID3_Field, 1);
1657
- arg2 = StringValuePtr(argv[0]);
1658
- result = (arg1)->Set((char const *)arg2);
1659
-
1660
- vresult = UINT2NUM(result);
1661
- return vresult;
2876
+ ID3_Field *arg1 = (ID3_Field *) 0 ;
2877
+ char *arg2 = (char *) 0 ;
2878
+ size_t result;
2879
+ void *argp1 = 0 ;
2880
+ int res1 = 0 ;
2881
+ int res2 ;
2882
+ char *buf2 = 0 ;
2883
+ int alloc2 = 0 ;
2884
+ VALUE vresult = Qnil;
2885
+
2886
+ if ((argc < 1) || (argc > 1)) {
2887
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2888
+ }
2889
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Field, 0 | 0 );
2890
+ if (!SWIG_IsOK(res1)) {
2891
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Set" "', argument " "1"" of type '" "ID3_Field *""'");
2892
+ }
2893
+ arg1 = reinterpret_cast< ID3_Field * >(argp1);
2894
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
2895
+ if (!SWIG_IsOK(res2)) {
2896
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Set" "', argument " "2"" of type '" "char const *""'");
2897
+ }
2898
+ arg2 = buf2;
2899
+ result = (arg1)->Set((char const *)arg2);
2900
+ vresult = SWIG_From_size_t(static_cast< size_t >(result));
2901
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
2902
+ return vresult;
2903
+ fail:
2904
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
2905
+ return Qnil;
1662
2906
  }
1663
2907
 
1664
2908
 
1665
- static VALUE
2909
+ SWIGINTERN VALUE
1666
2910
  _wrap_Field_set_encoding(int argc, VALUE *argv, VALUE self) {
1667
- ID3_Field *arg1 = (ID3_Field *) 0 ;
1668
- ID3_TextEnc arg2 ;
1669
- bool result;
1670
- VALUE vresult = Qnil;
1671
-
1672
- if ((argc < 1) || (argc > 1))
1673
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1674
- SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_ID3_Field, 1);
1675
- arg2 = (ID3_TextEnc) NUM2INT(argv[0]);
1676
- result = (bool)(arg1)->SetEncoding(arg2);
1677
-
1678
- vresult = result ? Qtrue : Qfalse;
1679
- return vresult;
2911
+ ID3_Field *arg1 = (ID3_Field *) 0 ;
2912
+ ID3_TextEnc arg2 ;
2913
+ bool result;
2914
+ void *argp1 = 0 ;
2915
+ int res1 = 0 ;
2916
+ int val2 ;
2917
+ int ecode2 = 0 ;
2918
+ VALUE vresult = Qnil;
2919
+
2920
+ if ((argc < 1) || (argc > 1)) {
2921
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2922
+ }
2923
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Field, 0 | 0 );
2924
+ if (!SWIG_IsOK(res1)) {
2925
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SetEncoding" "', argument " "1"" of type '" "ID3_Field *""'");
2926
+ }
2927
+ arg1 = reinterpret_cast< ID3_Field * >(argp1);
2928
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
2929
+ if (!SWIG_IsOK(ecode2)) {
2930
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SetEncoding" "', argument " "2"" of type '" "ID3_TextEnc""'");
2931
+ }
2932
+ arg2 = static_cast< ID3_TextEnc >(val2);
2933
+ result = (bool)(arg1)->SetEncoding(arg2);
2934
+ vresult = SWIG_From_bool(static_cast< bool >(result));
2935
+ return vresult;
2936
+ fail:
2937
+ return Qnil;
1680
2938
  }
1681
2939
 
1682
2940
 
1683
- static VALUE
2941
+ SWIGINTERN VALUE
1684
2942
  _wrap_Field_set_unicode(int argc, VALUE *argv, VALUE self) {
1685
- ID3_Field *arg1 = (ID3_Field *) 0 ;
1686
- VALUE arg2 ;
1687
- size_t result;
1688
- VALUE vresult = Qnil;
1689
-
1690
- if ((argc < 1) || (argc > 1))
1691
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1692
- SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_ID3_Field, 1);
1693
- arg2 = argv[0];
1694
- result = ID3_Field_set_unicode(arg1,arg2);
1695
-
1696
- vresult = UINT2NUM(result);
1697
- return vresult;
2943
+ ID3_Field *arg1 = (ID3_Field *) 0 ;
2944
+ VALUE arg2 = (VALUE) 0 ;
2945
+ size_t result;
2946
+ void *argp1 = 0 ;
2947
+ int res1 = 0 ;
2948
+ VALUE vresult = Qnil;
2949
+
2950
+ if ((argc < 1) || (argc > 1)) {
2951
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2952
+ }
2953
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ID3_Field, 0 | 0 );
2954
+ if (!SWIG_IsOK(res1)) {
2955
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "set_unicode" "', argument " "1"" of type '" "ID3_Field *""'");
2956
+ }
2957
+ arg1 = reinterpret_cast< ID3_Field * >(argp1);
2958
+ arg2 = argv[0];
2959
+ result = ID3_Field_set_unicode(arg1,arg2);
2960
+ vresult = SWIG_From_size_t(static_cast< size_t >(result));
2961
+ return vresult;
2962
+ fail:
2963
+ return Qnil;
1698
2964
  }
1699
2965
 
1700
2966
 
1701
2967
 
1702
2968
  /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
1703
2969
 
1704
- static swig_type_info _swigt__p_ID3_Field = {"_p_ID3_Field", "ID3_Field *", 0, 0, 0};
1705
- static swig_type_info _swigt__p_ID3_Frame = {"_p_ID3_Frame", "ID3_Frame *", 0, 0, 0};
1706
- static swig_type_info _swigt__p_ID3_Tag = {"_p_ID3_Tag", "ID3_Tag *", 0, 0, 0};
1707
- static swig_type_info _swigt__p_ID3_Tag__Iterator = {"_p_ID3_Tag__Iterator", "ID3_Tag::Iterator *", 0, 0, 0};
1708
- static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "unsigned int *|flags_t *", 0, 0, 0};
1709
- static swig_type_info _swigt__p_unsigned_long = {"_p_unsigned_long", "unsigned long *|VALUE *", 0, 0, 0};
2970
+ static swig_type_info _swigt__p_ID3_Field = {"_p_ID3_Field", "ID3_Field *", 0, 0, (void*)0, 0};
2971
+ static swig_type_info _swigt__p_ID3_Frame = {"_p_ID3_Frame", "ID3_Frame *", 0, 0, (void*)0, 0};
2972
+ static swig_type_info _swigt__p_ID3_Tag = {"_p_ID3_Tag", "ID3_Tag *", 0, 0, (void*)0, 0};
2973
+ static swig_type_info _swigt__p_ID3_Tag__Iterator = {"_p_ID3_Tag__Iterator", "ID3_Tag::Iterator *", 0, 0, (void*)0, 0};
2974
+ static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
2975
+ static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "unsigned int *|flags_t *", 0, 0, (void*)0, 0};
1710
2976
 
1711
2977
  static swig_type_info *swig_type_initial[] = {
1712
2978
  &_swigt__p_ID3_Field,
1713
2979
  &_swigt__p_ID3_Frame,
1714
2980
  &_swigt__p_ID3_Tag,
1715
2981
  &_swigt__p_ID3_Tag__Iterator,
2982
+ &_swigt__p_char,
1716
2983
  &_swigt__p_unsigned_int,
1717
- &_swigt__p_unsigned_long,
1718
2984
  };
1719
2985
 
1720
2986
  static swig_cast_info _swigc__p_ID3_Field[] = { {&_swigt__p_ID3_Field, 0, 0, 0},{0, 0, 0, 0}};
1721
2987
  static swig_cast_info _swigc__p_ID3_Frame[] = { {&_swigt__p_ID3_Frame, 0, 0, 0},{0, 0, 0, 0}};
1722
2988
  static swig_cast_info _swigc__p_ID3_Tag[] = { {&_swigt__p_ID3_Tag, 0, 0, 0},{0, 0, 0, 0}};
1723
2989
  static swig_cast_info _swigc__p_ID3_Tag__Iterator[] = { {&_swigt__p_ID3_Tag__Iterator, 0, 0, 0},{0, 0, 0, 0}};
2990
+ static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
1724
2991
  static swig_cast_info _swigc__p_unsigned_int[] = { {&_swigt__p_unsigned_int, 0, 0, 0},{0, 0, 0, 0}};
1725
- static swig_cast_info _swigc__p_unsigned_long[] = { {&_swigt__p_unsigned_long, 0, 0, 0},{0, 0, 0, 0}};
1726
2992
 
1727
2993
  static swig_cast_info *swig_cast_initial[] = {
1728
2994
  _swigc__p_ID3_Field,
1729
2995
  _swigc__p_ID3_Frame,
1730
2996
  _swigc__p_ID3_Tag,
1731
2997
  _swigc__p_ID3_Tag__Iterator,
2998
+ _swigc__p_char,
1732
2999
  _swigc__p_unsigned_int,
1733
- _swigc__p_unsigned_long,
1734
3000
  };
1735
3001
 
1736
3002
 
1737
3003
  /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
1738
3004
 
1739
- /*************************************************************************
3005
+ /* -----------------------------------------------------------------------------
1740
3006
  * Type initialization:
1741
3007
  * This problem is tough by the requirement that no dynamic
1742
3008
  * memory is used. Also, since swig_type_info structures store pointers to
@@ -1748,7 +3014,7 @@ static swig_cast_info *swig_cast_initial[] = {
1748
3014
  * swig_module, and does all the lookup, filling in the swig_module.types
1749
3015
  * array with the correct data and linking the correct swig_cast_info
1750
3016
  * structures together.
1751
-
3017
+ *
1752
3018
  * The generated swig_type_info structures are assigned staticly to an initial
1753
3019
  * array. We just loop though that array, and handle each type individually.
1754
3020
  * First we lookup if this type has been already loaded, and if so, use the
@@ -1762,7 +3028,7 @@ static swig_cast_info *swig_cast_initial[] = {
1762
3028
  * we find the array of casts associated with the type, and loop through it
1763
3029
  * adding the casts to the list. The one last trick we need to do is making
1764
3030
  * sure the type pointer in the swig_cast_info struct is correct.
1765
-
3031
+ *
1766
3032
  * First off, we lookup the cast->type name to see if it is already loaded.
1767
3033
  * There are three cases to handle:
1768
3034
  * 1) If the cast->type has already been loaded AND the type we are adding
@@ -1775,16 +3041,21 @@ static swig_cast_info *swig_cast_initial[] = {
1775
3041
  * 3) Finally, if cast->type has not already been loaded, then we add that
1776
3042
  * swig_cast_info to the linked list (because the cast->type) pointer will
1777
3043
  * be correct.
1778
- **/
3044
+ * ----------------------------------------------------------------------------- */
1779
3045
 
1780
3046
  #ifdef __cplusplus
1781
3047
  extern "C" {
3048
+ #if 0
3049
+ } /* c-mode */
3050
+ #endif
3051
+ #endif
3052
+
3053
+ #if 0
3054
+ #define SWIGRUNTIME_DEBUG
1782
3055
  #endif
1783
3056
 
1784
3057
  SWIGRUNTIME void
1785
3058
  SWIG_InitializeModule(void *clientdata) {
1786
- swig_type_info *type, *ret;
1787
- swig_cast_info *cast;
1788
3059
  size_t i;
1789
3060
  swig_module_info *module_head;
1790
3061
  static int init_run = 0;
@@ -1810,8 +3081,17 @@ SWIG_InitializeModule(void *clientdata) {
1810
3081
  }
1811
3082
 
1812
3083
  /* Now work on filling in swig_module.types */
3084
+ #ifdef SWIGRUNTIME_DEBUG
3085
+ printf("SWIG_InitializeModule: size %d\n", swig_module.size);
3086
+ #endif
1813
3087
  for (i = 0; i < swig_module.size; ++i) {
1814
- type = 0;
3088
+ swig_type_info *type = 0;
3089
+ swig_type_info *ret;
3090
+ swig_cast_info *cast;
3091
+
3092
+ #ifdef SWIGRUNTIME_DEBUG
3093
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
3094
+ #endif
1815
3095
 
1816
3096
  /* if there is another module already loaded */
1817
3097
  if (swig_module.next != &swig_module) {
@@ -1819,7 +3099,15 @@ SWIG_InitializeModule(void *clientdata) {
1819
3099
  }
1820
3100
  if (type) {
1821
3101
  /* Overwrite clientdata field */
1822
- if (swig_module.type_initial[i]->clientdata) type->clientdata = swig_module.type_initial[i]->clientdata;
3102
+ #ifdef SWIGRUNTIME_DEBUG
3103
+ printf("SWIG_InitializeModule: found type %s\n", type->name);
3104
+ #endif
3105
+ if (swig_module.type_initial[i]->clientdata) {
3106
+ type->clientdata = swig_module.type_initial[i]->clientdata;
3107
+ #ifdef SWIGRUNTIME_DEBUG
3108
+ printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
3109
+ #endif
3110
+ }
1823
3111
  } else {
1824
3112
  type = swig_module.type_initial[i];
1825
3113
  }
@@ -1830,28 +3118,64 @@ SWIG_InitializeModule(void *clientdata) {
1830
3118
 
1831
3119
  /* Don't need to add information already in the list */
1832
3120
  ret = 0;
3121
+ #ifdef SWIGRUNTIME_DEBUG
3122
+ printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
3123
+ #endif
1833
3124
  if (swig_module.next != &swig_module) {
1834
3125
  ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
3126
+ #ifdef SWIGRUNTIME_DEBUG
3127
+ if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
3128
+ #endif
1835
3129
  }
1836
- if (ret && type == swig_module.type_initial[i]) {
1837
- cast->type = ret;
1838
- ret = 0;
3130
+ if (ret) {
3131
+ if (type == swig_module.type_initial[i]) {
3132
+ #ifdef SWIGRUNTIME_DEBUG
3133
+ printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
3134
+ #endif
3135
+ cast->type = ret;
3136
+ ret = 0;
3137
+ } else {
3138
+ /* Check for casting already in the list */
3139
+ swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
3140
+ #ifdef SWIGRUNTIME_DEBUG
3141
+ if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
3142
+ #endif
3143
+ if (!ocast) ret = 0;
3144
+ }
1839
3145
  }
1840
-
3146
+
1841
3147
  if (!ret) {
3148
+ #ifdef SWIGRUNTIME_DEBUG
3149
+ printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
3150
+ #endif
1842
3151
  if (type->cast) {
1843
3152
  type->cast->prev = cast;
1844
3153
  cast->next = type->cast;
1845
3154
  }
1846
3155
  type->cast = cast;
1847
3156
  }
1848
-
1849
3157
  cast++;
1850
3158
  }
1851
-
1852
3159
  /* Set entry in modules->types array equal to the type */
1853
3160
  swig_module.types[i] = type;
1854
3161
  }
3162
+ swig_module.types[i] = 0;
3163
+
3164
+ #ifdef SWIGRUNTIME_DEBUG
3165
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
3166
+ for (i = 0; i < swig_module.size; ++i) {
3167
+ int j = 0;
3168
+ swig_cast_info *cast = swig_module.cast_initial[i];
3169
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
3170
+ while (cast->type) {
3171
+ printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
3172
+ cast++;
3173
+ ++j;
3174
+ }
3175
+ printf("---- Total casts: %d\n",j);
3176
+ }
3177
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
3178
+ #endif
1855
3179
  }
1856
3180
 
1857
3181
  /* This function will propagate the clientdata field of type to
@@ -1883,6 +3207,9 @@ SWIG_PropagateClientData(void) {
1883
3207
  }
1884
3208
 
1885
3209
  #ifdef __cplusplus
3210
+ #if 0
3211
+ { /* c-mode */
3212
+ #endif
1886
3213
  }
1887
3214
  #endif
1888
3215
 
@@ -1891,60 +3218,64 @@ SWIG_PropagateClientData(void) {
1891
3218
  extern "C"
1892
3219
  #endif
1893
3220
  SWIGEXPORT void Init_id3lib_api(void) {
1894
- int i;
1895
-
1896
- SWIG_InitRuntime();
1897
- mAPI = rb_define_module("ID3Lib");
1898
- mAPI = rb_define_module_under(mAPI, "API");
1899
-
1900
- SWIG_InitializeModule(0);
1901
- for (i = 0; i < swig_module.size; i++) {
1902
- SWIG_define_class(swig_module.types[i]);
1903
- }
1904
-
1905
-
1906
- cTag.klass = rb_define_class_under(mAPI, "Tag", rb_cObject);
1907
- SWIG_TypeClientData(SWIGTYPE_p_ID3_Tag, (void *) &cTag);
1908
- rb_define_alloc_func(cTag.klass, _wrap_Tag_allocate);
1909
- rb_define_method(cTag.klass, "initialize", VALUEFUNC(_wrap_new_Tag), -1);
1910
- rb_define_method(cTag.klass, "has_tag_type", VALUEFUNC(_wrap_Tag_has_tag_type), -1);
1911
- rb_define_method(cTag.klass, "link", VALUEFUNC(_wrap_Tag_link), -1);
1912
- rb_define_method(cTag.klass, "update", VALUEFUNC(_wrap_Tag_update), -1);
1913
- rb_define_method(cTag.klass, "strip", VALUEFUNC(_wrap_Tag_strip), -1);
1914
- rb_define_method(cTag.klass, "clear", VALUEFUNC(_wrap_Tag_clear), -1);
1915
- rb_define_method(cTag.klass, "remove_frame", VALUEFUNC(_wrap_Tag_remove_frame), -1);
1916
- rb_define_method(cTag.klass, "add_frame", VALUEFUNC(_wrap_Tag_add_frame), -1);
1917
- rb_define_method(cTag.klass, "filename", VALUEFUNC(_wrap_Tag_filename), -1);
1918
- rb_define_method(cTag.klass, "set_padding", VALUEFUNC(_wrap_Tag_set_padding), -1);
1919
- rb_define_method(cTag.klass, "size", VALUEFUNC(_wrap_Tag_size), -1);
1920
- rb_define_method(cTag.klass, "find", VALUEFUNC(_wrap_Tag_find), -1);
1921
- rb_define_method(cTag.klass, "iterator_new", VALUEFUNC(_wrap_Tag_iterator_new), -1);
1922
- rb_define_method(cTag.klass, "iterator_next_frame", VALUEFUNC(_wrap_Tag_iterator_next_frame), -1);
1923
- cTag.mark = 0;
1924
- cTag.destroy = (void (*)(void *)) free_ID3_Tag;
1925
-
1926
- cFrame.klass = rb_define_class_under(mAPI, "Frame", rb_cObject);
1927
- SWIG_TypeClientData(SWIGTYPE_p_ID3_Frame, (void *) &cFrame);
1928
- rb_define_alloc_func(cFrame.klass, _wrap_Frame_allocate);
1929
- rb_define_method(cFrame.klass, "initialize", VALUEFUNC(_wrap_new_Frame), -1);
1930
- rb_define_method(cFrame.klass, "field", VALUEFUNC(_wrap_Frame_field), -1);
1931
- rb_define_method(cFrame.klass, "num", VALUEFUNC(_wrap_Frame_num), -1);
1932
- cFrame.mark = 0;
1933
- cFrame.destroy = (void (*)(void *)) free_ID3_Frame;
1934
-
1935
- cField.klass = rb_define_class_under(mAPI, "Field", rb_cObject);
1936
- SWIG_TypeClientData(SWIGTYPE_p_ID3_Field, (void *) &cField);
1937
- rb_undef_alloc_func(cField.klass);
1938
- rb_define_method(cField.klass, "type", VALUEFUNC(_wrap_Field_type), -1);
1939
- rb_define_method(cField.klass, "integer", VALUEFUNC(_wrap_Field_integer), -1);
1940
- rb_define_method(cField.klass, "binary", VALUEFUNC(_wrap_Field_binary), -1);
1941
- rb_define_method(cField.klass, "ascii", VALUEFUNC(_wrap_Field_ascii), -1);
1942
- rb_define_method(cField.klass, "unicode", VALUEFUNC(_wrap_Field_unicode), -1);
1943
- rb_define_method(cField.klass, "set_integer", VALUEFUNC(_wrap_Field_set_integer), -1);
1944
- rb_define_method(cField.klass, "set_binary", VALUEFUNC(_wrap_Field_set_binary), -1);
1945
- rb_define_method(cField.klass, "set_ascii", VALUEFUNC(_wrap_Field_set_ascii), -1);
1946
- rb_define_method(cField.klass, "set_encoding", VALUEFUNC(_wrap_Field_set_encoding), -1);
1947
- rb_define_method(cField.klass, "set_unicode", VALUEFUNC(_wrap_Field_set_unicode), -1);
1948
- cField.mark = 0;
3221
+ size_t i;
3222
+
3223
+ SWIG_InitRuntime();
3224
+ mAPI = rb_define_module("ID3Lib");
3225
+ mAPI = rb_define_module_under(mAPI, "API");
3226
+
3227
+ SWIG_InitializeModule(0);
3228
+ for (i = 0; i < swig_module.size; i++) {
3229
+ SWIG_define_class(swig_module.types[i]);
3230
+ }
3231
+
3232
+ SWIG_RubyInitializeTrackings();
3233
+
3234
+ cTag.klass = rb_define_class_under(mAPI, "Tag", rb_cObject);
3235
+ SWIG_TypeClientData(SWIGTYPE_p_ID3_Tag, (void *) &cTag);
3236
+ rb_define_alloc_func(cTag.klass, _wrap_Tag_allocate);
3237
+ rb_define_method(cTag.klass, "initialize", VALUEFUNC(_wrap_new_Tag), -1);
3238
+ rb_define_method(cTag.klass, "has_tag_type", VALUEFUNC(_wrap_Tag_has_tag_type), -1);
3239
+ rb_define_method(cTag.klass, "link", VALUEFUNC(_wrap_Tag_link), -1);
3240
+ rb_define_method(cTag.klass, "update", VALUEFUNC(_wrap_Tag_update), -1);
3241
+ rb_define_method(cTag.klass, "strip", VALUEFUNC(_wrap_Tag_strip), -1);
3242
+ rb_define_method(cTag.klass, "clear", VALUEFUNC(_wrap_Tag_clear), -1);
3243
+ rb_define_method(cTag.klass, "remove_frame", VALUEFUNC(_wrap_Tag_remove_frame), -1);
3244
+ rb_define_method(cTag.klass, "add_frame", VALUEFUNC(_wrap_Tag_add_frame), -1);
3245
+ rb_define_method(cTag.klass, "filename", VALUEFUNC(_wrap_Tag_filename), -1);
3246
+ rb_define_method(cTag.klass, "set_padding", VALUEFUNC(_wrap_Tag_set_padding), -1);
3247
+ rb_define_method(cTag.klass, "size", VALUEFUNC(_wrap_Tag_size), -1);
3248
+ rb_define_method(cTag.klass, "find", VALUEFUNC(_wrap_Tag_find), -1);
3249
+ rb_define_method(cTag.klass, "iterator_new", VALUEFUNC(_wrap_Tag_iterator_new), -1);
3250
+ rb_define_method(cTag.klass, "iterator_next_frame", VALUEFUNC(_wrap_Tag_iterator_next_frame), -1);
3251
+ cTag.mark = 0;
3252
+ cTag.destroy = (void (*)(void *)) free_ID3_Tag;
3253
+ cTag.trackObjects = 0;
3254
+
3255
+ cFrame.klass = rb_define_class_under(mAPI, "Frame", rb_cObject);
3256
+ SWIG_TypeClientData(SWIGTYPE_p_ID3_Frame, (void *) &cFrame);
3257
+ rb_define_alloc_func(cFrame.klass, _wrap_Frame_allocate);
3258
+ rb_define_method(cFrame.klass, "initialize", VALUEFUNC(_wrap_new_Frame), -1);
3259
+ rb_define_method(cFrame.klass, "field", VALUEFUNC(_wrap_Frame_field), -1);
3260
+ rb_define_method(cFrame.klass, "num", VALUEFUNC(_wrap_Frame_num), -1);
3261
+ cFrame.mark = 0;
3262
+ cFrame.destroy = (void (*)(void *)) free_ID3_Frame;
3263
+ cFrame.trackObjects = 0;
3264
+
3265
+ cField.klass = rb_define_class_under(mAPI, "Field", rb_cObject);
3266
+ SWIG_TypeClientData(SWIGTYPE_p_ID3_Field, (void *) &cField);
3267
+ rb_undef_alloc_func(cField.klass);
3268
+ rb_define_method(cField.klass, "type", VALUEFUNC(_wrap_Field_type), -1);
3269
+ rb_define_method(cField.klass, "integer", VALUEFUNC(_wrap_Field_integer), -1);
3270
+ rb_define_method(cField.klass, "binary", VALUEFUNC(_wrap_Field_binary), -1);
3271
+ rb_define_method(cField.klass, "ascii", VALUEFUNC(_wrap_Field_ascii), -1);
3272
+ rb_define_method(cField.klass, "unicode", VALUEFUNC(_wrap_Field_unicode), -1);
3273
+ rb_define_method(cField.klass, "set_integer", VALUEFUNC(_wrap_Field_set_integer), -1);
3274
+ rb_define_method(cField.klass, "set_binary", VALUEFUNC(_wrap_Field_set_binary), -1);
3275
+ rb_define_method(cField.klass, "set_ascii", VALUEFUNC(_wrap_Field_set_ascii), -1);
3276
+ rb_define_method(cField.klass, "set_encoding", VALUEFUNC(_wrap_Field_set_encoding), -1);
3277
+ rb_define_method(cField.klass, "set_unicode", VALUEFUNC(_wrap_Field_set_unicode), -1);
3278
+ cField.mark = 0;
3279
+ cField.trackObjects = 0;
1949
3280
  }
1950
3281