taglib-ruby 0.7.1 → 1.0.0

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