rbcdio 0.01

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. data/AUTHORS +1 -0
  2. data/COPYING +340 -0
  3. data/ChangeLog +315 -0
  4. data/INSTALL +236 -0
  5. data/Makefile.am +163 -0
  6. data/Makefile.in +557 -0
  7. data/NEWS +5 -0
  8. data/README +75 -0
  9. data/Rakefile +234 -0
  10. data/THANKS +3 -0
  11. data/VERSION +1 -0
  12. data/VERSION.in +1 -0
  13. data/config.guess +1473 -0
  14. data/config.sub +1576 -0
  15. data/configure +4802 -0
  16. data/configure.ac +158 -0
  17. data/data/copying.iso +0 -0
  18. data/data/isofs-m1.bin +0 -0
  19. data/data/isofs-m1.cue +3 -0
  20. data/doc/created.rid +1 -0
  21. data/doc/fr_class_index.html +42 -0
  22. data/doc/fr_file_index.html +40 -0
  23. data/doc/fr_method_index.html +133 -0
  24. data/doc/index.html +24 -0
  25. data/doc/rdoc-style.css +208 -0
  26. data/example/COPYING +340 -0
  27. data/example/README +47 -0
  28. data/example/audio.rb +186 -0
  29. data/example/cd-read.rb +167 -0
  30. data/example/copying +340 -0
  31. data/example/device.rb +91 -0
  32. data/example/drivers.rb +63 -0
  33. data/example/drives.rb +63 -0
  34. data/example/eject.rb +69 -0
  35. data/example/iso1.rb +89 -0
  36. data/example/iso2.rb +106 -0
  37. data/example/iso3.rb +111 -0
  38. data/example/tracks.rb +83 -0
  39. data/ext/cdio/Makefile +139 -0
  40. data/ext/cdio/extconf.rb +9 -0
  41. data/ext/cdio/rubycdio_wrap.c +3410 -0
  42. data/ext/iso9660/Makefile +139 -0
  43. data/ext/iso9660/extconf.rb +10 -0
  44. data/ext/iso9660/rubyiso9660_wrap.c +3005 -0
  45. data/install-sh +323 -0
  46. data/lib/Makefile +7 -0
  47. data/lib/cdio.rb +1000 -0
  48. data/lib/iso9660.rb +566 -0
  49. data/missing +360 -0
  50. data/rubycdio.m4 +14 -0
  51. data/swig/Makefile +7 -0
  52. data/swig/audio.swg +63 -0
  53. data/swig/compat.swg +104 -0
  54. data/swig/device.swg +513 -0
  55. data/swig/device_const.swg +144 -0
  56. data/swig/disc.swg +96 -0
  57. data/swig/read.swg +164 -0
  58. data/swig/rubycdio.swg +86 -0
  59. data/swig/rubyiso9660.swg +827 -0
  60. data/swig/track.swg +206 -0
  61. data/swig/types.swg +65 -0
  62. data/test/Makefile +7 -0
  63. data/test/Rakefile +8 -0
  64. data/test/cdda.bin +0 -0
  65. data/test/cdda.cue +7 -0
  66. data/test/cdda.toc +14 -0
  67. data/test/cdiotest.rb +228 -0
  68. data/test/isocopy.rb +394 -0
  69. data/test/isotest.rb +187 -0
  70. metadata +116 -0
@@ -0,0 +1,3410 @@
1
+ /* ----------------------------------------------------------------------------
2
+ * This file was automatically generated by SWIG (http://www.swig.org).
3
+ * Version 1.3.27
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
+ /***********************************************************************
12
+ *
13
+ * This section contains generic SWIG labels for method/variable
14
+ * declarations/attributes, and other compiler dependent labels.
15
+ *
16
+ ************************************************************************/
17
+
18
+ /* template workaround for compilers that cannot correctly implement the C++ standard */
19
+ #ifndef SWIGTEMPLATEDISAMBIGUATOR
20
+ # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
21
+ # define SWIGTEMPLATEDISAMBIGUATOR template
22
+ # else
23
+ # define SWIGTEMPLATEDISAMBIGUATOR
24
+ # endif
25
+ #endif
26
+
27
+ /* inline attribute */
28
+ #ifndef SWIGINLINE
29
+ # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
30
+ # define SWIGINLINE inline
31
+ # else
32
+ # define SWIGINLINE
33
+ # endif
34
+ #endif
35
+
36
+ /* attribute recognised by some compilers to avoid 'unused' warnings */
37
+ #ifndef SWIGUNUSED
38
+ # if defined(__GNUC__) || defined(__ICC)
39
+ # define SWIGUNUSED __attribute__ ((unused))
40
+ # else
41
+ # define SWIGUNUSED
42
+ # endif
43
+ #endif
44
+
45
+ /* internal SWIG method */
46
+ #ifndef SWIGINTERN
47
+ # define SWIGINTERN static SWIGUNUSED
48
+ #endif
49
+
50
+ /* internal inline SWIG method */
51
+ #ifndef SWIGINTERNINLINE
52
+ # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
53
+ #endif
54
+
55
+ /* exporting methods for Windows DLLs */
56
+ #ifndef SWIGEXPORT
57
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
58
+ # if defined(STATIC_LINKED)
59
+ # define SWIGEXPORT
60
+ # else
61
+ # define SWIGEXPORT __declspec(dllexport)
62
+ # endif
63
+ # else
64
+ # define SWIGEXPORT
65
+ # endif
66
+ #endif
67
+
68
+ /* calling conventions for Windows */
69
+ #ifndef SWIGSTDCALL
70
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
71
+ # define SWIGSTDCALL __stdcall
72
+ # else
73
+ # define SWIGSTDCALL
74
+ # endif
75
+ #endif
76
+
77
+
78
+ /* ruby.swg */
79
+ /* Implementation : RUBY */
80
+ #define SWIGRUBY 1
81
+
82
+ #include "ruby.h"
83
+
84
+ /* Flags for pointer conversion */
85
+ #define SWIG_POINTER_EXCEPTION 0x1
86
+ #define SWIG_POINTER_OWN 0x1
87
+ #define SWIG_POINTER_DISOWN 0x2
88
+ #define SWIG_TRACK_OBJECTS 0x4
89
+
90
+ #define NUM2USHRT(n) (\
91
+ (0 <= NUM2UINT(n) && NUM2UINT(n) <= USHRT_MAX)\
92
+ ? (unsigned short) NUM2UINT(n) \
93
+ : (rb_raise(rb_eArgError, "integer %d out of range of `unsigned short'",\
94
+ NUM2UINT(n)), (short)0)\
95
+ )
96
+
97
+ #define NUM2SHRT(n) (\
98
+ (SHRT_MIN <= NUM2INT(n) && NUM2INT(n) <= SHRT_MAX)\
99
+ ? (short)NUM2INT(n)\
100
+ : (rb_raise(rb_eArgError, "integer %d out of range of `short'",\
101
+ NUM2INT(n)), (short)0)\
102
+ )
103
+
104
+ /* Ruby 1.7 defines NUM2LL(), LL2NUM() and ULL2NUM() macros */
105
+ #ifndef NUM2LL
106
+ #define NUM2LL(x) NUM2LONG((x))
107
+ #endif
108
+ #ifndef LL2NUM
109
+ #define LL2NUM(x) INT2NUM((long) (x))
110
+ #endif
111
+ #ifndef ULL2NUM
112
+ #define ULL2NUM(x) UINT2NUM((unsigned long) (x))
113
+ #endif
114
+
115
+ /* Ruby 1.7 doesn't (yet) define NUM2ULL() */
116
+ #ifndef NUM2ULL
117
+ #ifdef HAVE_LONG_LONG
118
+ #define NUM2ULL(x) rb_num2ull((x))
119
+ #else
120
+ #define NUM2ULL(x) NUM2ULONG(x)
121
+ #endif
122
+ #endif
123
+
124
+ /*
125
+ * Need to be very careful about how these macros are defined, especially
126
+ * when compiling C++ code or C code with an ANSI C compiler.
127
+ *
128
+ * VALUEFUNC(f) is a macro used to typecast a C function that implements
129
+ * a Ruby method so that it can be passed as an argument to API functions
130
+ * like rb_define_method() and rb_define_singleton_method().
131
+ *
132
+ * VOIDFUNC(f) is a macro used to typecast a C function that implements
133
+ * either the "mark" or "free" stuff for a Ruby Data object, so that it
134
+ * can be passed as an argument to API functions like Data_Wrap_Struct()
135
+ * and Data_Make_Struct().
136
+ */
137
+
138
+ #ifdef __cplusplus
139
+ # ifndef RUBY_METHOD_FUNC /* These definitions should work for Ruby 1.4.6 */
140
+ # define PROTECTFUNC(f) ((VALUE (*)()) f)
141
+ # define VALUEFUNC(f) ((VALUE (*)()) f)
142
+ # define VOIDFUNC(f) ((void (*)()) f)
143
+ # else
144
+ # ifndef ANYARGS /* These definitions should work for Ruby 1.6 */
145
+ # define PROTECTFUNC(f) ((VALUE (*)()) f)
146
+ # define VALUEFUNC(f) ((VALUE (*)()) f)
147
+ # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
148
+ # else /* These definitions should work for Ruby 1.7+ */
149
+ # define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f)
150
+ # define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f)
151
+ # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
152
+ # endif
153
+ # endif
154
+ #else
155
+ # define VALUEFUNC(f) (f)
156
+ # define VOIDFUNC(f) (f)
157
+ #endif
158
+
159
+ typedef struct {
160
+ VALUE klass;
161
+ VALUE mImpl;
162
+ void (*mark)(void *);
163
+ void (*destroy)(void *);
164
+ } swig_class;
165
+
166
+ /* Don't use for expressions have side effect */
167
+ #ifndef RB_STRING_VALUE
168
+ #define RB_STRING_VALUE(s) (TYPE(s) == T_STRING ? (s) : (*(volatile VALUE *)&(s) = rb_str_to_str(s)))
169
+ #endif
170
+ #ifndef StringValue
171
+ #define StringValue(s) RB_STRING_VALUE(s)
172
+ #endif
173
+ #ifndef StringValuePtr
174
+ #define StringValuePtr(s) RSTRING(RB_STRING_VALUE(s))->ptr
175
+ #endif
176
+ #ifndef StringValueLen
177
+ #define StringValueLen(s) RSTRING(RB_STRING_VALUE(s))->len
178
+ #endif
179
+ #ifndef SafeStringValue
180
+ #define SafeStringValue(v) do {\
181
+ StringValue(v);\
182
+ rb_check_safe_str(v);\
183
+ } while (0)
184
+ #endif
185
+
186
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
187
+ #define rb_define_alloc_func(klass, func) rb_define_singleton_method((klass), "new", VALUEFUNC((func)), -1)
188
+ #define rb_undef_alloc_func(klass) rb_undef_method(CLASS_OF((klass)), "new")
189
+ #endif
190
+
191
+ /* Contract support */
192
+
193
+ #define SWIG_contract_assert(expr, msg) if (!(expr)) { rb_raise(rb_eRuntimeError, (char *) msg ); } else
194
+
195
+
196
+ /***********************************************************************
197
+ * swigrun.swg
198
+ *
199
+ * This file contains generic CAPI SWIG runtime support for pointer
200
+ * type checking.
201
+ *
202
+ ************************************************************************/
203
+
204
+ /* This should only be incremented when either the layout of swig_type_info changes,
205
+ or for whatever reason, the runtime changes incompatibly */
206
+ #define SWIG_RUNTIME_VERSION "2"
207
+
208
+ /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
209
+ #ifdef SWIG_TYPE_TABLE
210
+ # define SWIG_QUOTE_STRING(x) #x
211
+ # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
212
+ # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
213
+ #else
214
+ # define SWIG_TYPE_TABLE_NAME
215
+ #endif
216
+
217
+ /*
218
+ You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
219
+ creating a static or dynamic library from the swig runtime code.
220
+ In 99.9% of the cases, swig just needs to declare them as 'static'.
221
+
222
+ But only do this if is strictly necessary, ie, if you have problems
223
+ with your compiler or so.
224
+ */
225
+
226
+ #ifndef SWIGRUNTIME
227
+ # define SWIGRUNTIME SWIGINTERN
228
+ #endif
229
+
230
+ #ifndef SWIGRUNTIMEINLINE
231
+ # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
232
+ #endif
233
+
234
+ #include <string.h>
235
+
236
+ #ifdef __cplusplus
237
+ extern "C" {
238
+ #endif
239
+
240
+ typedef void *(*swig_converter_func)(void *);
241
+ typedef struct swig_type_info *(*swig_dycast_func)(void **);
242
+
243
+ /* Structure to store inforomation on one type */
244
+ typedef struct swig_type_info {
245
+ const char *name; /* mangled name of this type */
246
+ const char *str; /* human readable name of this type */
247
+ swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
248
+ struct swig_cast_info *cast; /* linked list of types that can cast into this type */
249
+ void *clientdata; /* language specific type data */
250
+ } swig_type_info;
251
+
252
+ /* Structure to store a type and conversion function used for casting */
253
+ typedef struct swig_cast_info {
254
+ swig_type_info *type; /* pointer to type that is equivalent to this type */
255
+ swig_converter_func converter; /* function to cast the void pointers */
256
+ struct swig_cast_info *next; /* pointer to next cast in linked list */
257
+ struct swig_cast_info *prev; /* pointer to the previous cast */
258
+ } swig_cast_info;
259
+
260
+ /* Structure used to store module information
261
+ * Each module generates one structure like this, and the runtime collects
262
+ * all of these structures and stores them in a circularly linked list.*/
263
+ typedef struct swig_module_info {
264
+ swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
265
+ size_t size; /* Number of types in this module */
266
+ struct swig_module_info *next; /* Pointer to next element in circularly linked list */
267
+ swig_type_info **type_initial; /* Array of initially generated type structures */
268
+ swig_cast_info **cast_initial; /* Array of initially generated casting structures */
269
+ void *clientdata; /* Language specific module data */
270
+ } swig_module_info;
271
+
272
+
273
+ /*
274
+ Compare two type names skipping the space characters, therefore
275
+ "char*" == "char *" and "Class<int>" == "Class<int >", etc.
276
+
277
+ Return 0 when the two name types are equivalent, as in
278
+ strncmp, but skipping ' '.
279
+ */
280
+ SWIGRUNTIME int
281
+ SWIG_TypeNameComp(const char *f1, const char *l1,
282
+ const char *f2, const char *l2) {
283
+ for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
284
+ while ((*f1 == ' ') && (f1 != l1)) ++f1;
285
+ while ((*f2 == ' ') && (f2 != l2)) ++f2;
286
+ if (*f1 != *f2) return (int)(*f1 - *f2);
287
+ }
288
+ return (l1 - f1) - (l2 - f2);
289
+ }
290
+
291
+ /*
292
+ Check type equivalence in a name list like <name1>|<name2>|...
293
+ Return 0 if not equal, 1 if equal
294
+ */
295
+ SWIGRUNTIME int
296
+ SWIG_TypeEquiv(const char *nb, const char *tb) {
297
+ int equiv = 0;
298
+ const char* te = tb + strlen(tb);
299
+ const char* ne = nb;
300
+ while (!equiv && *ne) {
301
+ for (nb = ne; *ne; ++ne) {
302
+ if (*ne == '|') break;
303
+ }
304
+ equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
305
+ if (*ne) ++ne;
306
+ }
307
+ return equiv;
308
+ }
309
+
310
+ /*
311
+ Check type equivalence in a name list like <name1>|<name2>|...
312
+ Return 0 if equal, -1 if nb < tb, 1 if nb > tb
313
+ */
314
+ SWIGRUNTIME int
315
+ SWIG_TypeCompare(const char *nb, const char *tb) {
316
+ int equiv = 0;
317
+ const char* te = tb + strlen(tb);
318
+ const char* ne = nb;
319
+ while (!equiv && *ne) {
320
+ for (nb = ne; *ne; ++ne) {
321
+ if (*ne == '|') break;
322
+ }
323
+ equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
324
+ if (*ne) ++ne;
325
+ }
326
+ return equiv;
327
+ }
328
+
329
+
330
+ /* think of this as a c++ template<> or a scheme macro */
331
+ #define SWIG_TypeCheck_Template(comparison, ty) \
332
+ if (ty) { \
333
+ swig_cast_info *iter = ty->cast; \
334
+ while (iter) { \
335
+ if (comparison) { \
336
+ if (iter == ty->cast) return iter; \
337
+ /* Move iter to the top of the linked list */ \
338
+ iter->prev->next = iter->next; \
339
+ if (iter->next) \
340
+ iter->next->prev = iter->prev; \
341
+ iter->next = ty->cast; \
342
+ iter->prev = 0; \
343
+ if (ty->cast) ty->cast->prev = iter; \
344
+ ty->cast = iter; \
345
+ return iter; \
346
+ } \
347
+ iter = iter->next; \
348
+ } \
349
+ } \
350
+ return 0
351
+
352
+ /*
353
+ Check the typename
354
+ */
355
+ SWIGRUNTIME swig_cast_info *
356
+ SWIG_TypeCheck(const char *c, swig_type_info *ty) {
357
+ SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
358
+ }
359
+
360
+ /* Same as previous function, except strcmp is replaced with a pointer comparison */
361
+ SWIGRUNTIME swig_cast_info *
362
+ SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
363
+ SWIG_TypeCheck_Template(iter->type == from, into);
364
+ }
365
+
366
+ /*
367
+ Cast a pointer up an inheritance hierarchy
368
+ */
369
+ SWIGRUNTIMEINLINE void *
370
+ SWIG_TypeCast(swig_cast_info *ty, void *ptr) {
371
+ return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr);
372
+ }
373
+
374
+ /*
375
+ Dynamic pointer casting. Down an inheritance hierarchy
376
+ */
377
+ SWIGRUNTIME swig_type_info *
378
+ SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
379
+ swig_type_info *lastty = ty;
380
+ if (!ty || !ty->dcast) return ty;
381
+ while (ty && (ty->dcast)) {
382
+ ty = (*ty->dcast)(ptr);
383
+ if (ty) lastty = ty;
384
+ }
385
+ return lastty;
386
+ }
387
+
388
+ /*
389
+ Return the name associated with this type
390
+ */
391
+ SWIGRUNTIMEINLINE const char *
392
+ SWIG_TypeName(const swig_type_info *ty) {
393
+ return ty->name;
394
+ }
395
+
396
+ /*
397
+ Return the pretty name associated with this type,
398
+ that is an unmangled type name in a form presentable to the user.
399
+ */
400
+ SWIGRUNTIME const char *
401
+ SWIG_TypePrettyName(const swig_type_info *type) {
402
+ /* The "str" field contains the equivalent pretty names of the
403
+ type, separated by vertical-bar characters. We choose
404
+ to print the last name, as it is often (?) the most
405
+ specific. */
406
+ if (type->str != NULL) {
407
+ const char *last_name = type->str;
408
+ const char *s;
409
+ for (s = type->str; *s; s++)
410
+ if (*s == '|') last_name = s+1;
411
+ return last_name;
412
+ }
413
+ else
414
+ return type->name;
415
+ }
416
+
417
+ /*
418
+ Set the clientdata field for a type
419
+ */
420
+ SWIGRUNTIME void
421
+ SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
422
+ swig_cast_info *cast = ti->cast;
423
+ /* if (ti->clientdata == clientdata) return; */
424
+ ti->clientdata = clientdata;
425
+
426
+ while (cast) {
427
+ if (!cast->converter) {
428
+ swig_type_info *tc = cast->type;
429
+ if (!tc->clientdata) {
430
+ SWIG_TypeClientData(tc, clientdata);
431
+ }
432
+ }
433
+ cast = cast->next;
434
+ }
435
+ }
436
+
437
+ /*
438
+ Search for a swig_type_info structure only by mangled name
439
+ Search is a O(log #types)
440
+
441
+ We start searching at module start, and finish searching when start == end.
442
+ Note: if start == end at the beginning of the function, we go all the way around
443
+ the circular list.
444
+ */
445
+ SWIGRUNTIME swig_type_info *
446
+ SWIG_MangledTypeQueryModule(swig_module_info *start,
447
+ swig_module_info *end,
448
+ const char *name) {
449
+ swig_module_info *iter = start;
450
+ do {
451
+ if (iter->size) {
452
+ register size_t l = 0;
453
+ register size_t r = iter->size - 1;
454
+ do {
455
+ /* since l+r >= 0, we can (>> 1) instead (/ 2) */
456
+ register size_t i = (l + r) >> 1;
457
+ const char *iname = iter->types[i]->name;
458
+ if (iname) {
459
+ register int compare = strcmp(name, iname);
460
+ if (compare == 0) {
461
+ return iter->types[i];
462
+ } else if (compare < 0) {
463
+ if (i) {
464
+ r = i - 1;
465
+ } else {
466
+ break;
467
+ }
468
+ } else if (compare > 0) {
469
+ l = i + 1;
470
+ }
471
+ } else {
472
+ break; /* should never happen */
473
+ }
474
+ } while (l <= r);
475
+ }
476
+ iter = iter->next;
477
+ } while (iter != end);
478
+ return 0;
479
+ }
480
+
481
+ /*
482
+ Search for a swig_type_info structure for either a mangled name or a human readable name.
483
+ It first searches the mangled names of the types, which is a O(log #types)
484
+ If a type is not found it then searches the human readable names, which is O(#types).
485
+
486
+ We start searching at module start, and finish searching when start == end.
487
+ Note: if start == end at the beginning of the function, we go all the way around
488
+ the circular list.
489
+ */
490
+ SWIGRUNTIME swig_type_info *
491
+ SWIG_TypeQueryModule(swig_module_info *start,
492
+ swig_module_info *end,
493
+ const char *name) {
494
+ /* STEP 1: Search the name field using binary search */
495
+ swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
496
+ if (ret) {
497
+ return ret;
498
+ } else {
499
+ /* STEP 2: If the type hasn't been found, do a complete search
500
+ of the str field (the human readable name) */
501
+ swig_module_info *iter = start;
502
+ do {
503
+ register size_t i = 0;
504
+ for (; i < iter->size; ++i) {
505
+ if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
506
+ return iter->types[i];
507
+ }
508
+ iter = iter->next;
509
+ } while (iter != end);
510
+ }
511
+
512
+ /* neither found a match */
513
+ return 0;
514
+ }
515
+
516
+
517
+ /*
518
+ Pack binary data into a string
519
+ */
520
+ SWIGRUNTIME char *
521
+ SWIG_PackData(char *c, void *ptr, size_t sz) {
522
+ static const char hex[17] = "0123456789abcdef";
523
+ register const unsigned char *u = (unsigned char *) ptr;
524
+ register const unsigned char *eu = u + sz;
525
+ for (; u != eu; ++u) {
526
+ register unsigned char uu = *u;
527
+ *(c++) = hex[(uu & 0xf0) >> 4];
528
+ *(c++) = hex[uu & 0xf];
529
+ }
530
+ return c;
531
+ }
532
+
533
+ /*
534
+ Unpack binary data from a string
535
+ */
536
+ SWIGRUNTIME const char *
537
+ SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
538
+ register unsigned char *u = (unsigned char *) ptr;
539
+ register const unsigned char *eu = u + sz;
540
+ for (; u != eu; ++u) {
541
+ register char d = *(c++);
542
+ register unsigned char uu = 0;
543
+ if ((d >= '0') && (d <= '9'))
544
+ uu = ((d - '0') << 4);
545
+ else if ((d >= 'a') && (d <= 'f'))
546
+ uu = ((d - ('a'-10)) << 4);
547
+ else
548
+ return (char *) 0;
549
+ d = *(c++);
550
+ if ((d >= '0') && (d <= '9'))
551
+ uu |= (d - '0');
552
+ else if ((d >= 'a') && (d <= 'f'))
553
+ uu |= (d - ('a'-10));
554
+ else
555
+ return (char *) 0;
556
+ *u = uu;
557
+ }
558
+ return c;
559
+ }
560
+
561
+ /*
562
+ Pack 'void *' into a string buffer.
563
+ */
564
+ SWIGRUNTIME char *
565
+ SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
566
+ char *r = buff;
567
+ if ((2*sizeof(void *) + 2) > bsz) return 0;
568
+ *(r++) = '_';
569
+ r = SWIG_PackData(r,&ptr,sizeof(void *));
570
+ if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
571
+ strcpy(r,name);
572
+ return buff;
573
+ }
574
+
575
+ SWIGRUNTIME const char *
576
+ SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
577
+ if (*c != '_') {
578
+ if (strcmp(c,"NULL") == 0) {
579
+ *ptr = (void *) 0;
580
+ return name;
581
+ } else {
582
+ return 0;
583
+ }
584
+ }
585
+ return SWIG_UnpackData(++c,ptr,sizeof(void *));
586
+ }
587
+
588
+ SWIGRUNTIME char *
589
+ SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
590
+ char *r = buff;
591
+ size_t lname = (name ? strlen(name) : 0);
592
+ if ((2*sz + 2 + lname) > bsz) return 0;
593
+ *(r++) = '_';
594
+ r = SWIG_PackData(r,ptr,sz);
595
+ if (lname) {
596
+ strncpy(r,name,lname+1);
597
+ } else {
598
+ *r = 0;
599
+ }
600
+ return buff;
601
+ }
602
+
603
+ SWIGRUNTIME const char *
604
+ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
605
+ if (*c != '_') {
606
+ if (strcmp(c,"NULL") == 0) {
607
+ memset(ptr,0,sz);
608
+ return name;
609
+ } else {
610
+ return 0;
611
+ }
612
+ }
613
+ return SWIG_UnpackData(++c,ptr,sz);
614
+ }
615
+
616
+ #ifdef __cplusplus
617
+ }
618
+ #endif
619
+
620
+ /***********************************************************************
621
+ * rubytracking.swg
622
+ *
623
+ * This file contains support for tracking mappings from
624
+ * Ruby objects to C++ objects. This functionality is needed
625
+ * to implement mark functions for Ruby's mark and sweep
626
+ * garbage collector.
627
+ ************************************************************************/
628
+
629
+ /* Global Ruby hash table to store Trackings from C/C++
630
+ structs to Ruby Objects. */
631
+ static VALUE swig_ruby_trackings;
632
+
633
+ /* Setup a Ruby hash table to store Trackings */
634
+ static void SWIG_RubyInitializeTrackings() {
635
+ /* Create a ruby hash table to store Trackings from C++
636
+ objects to Ruby objects. Also make sure to tell
637
+ the garabage collector about the hash table. */
638
+ swig_ruby_trackings = rb_hash_new();
639
+ rb_gc_register_address(&swig_ruby_trackings);
640
+ }
641
+
642
+ /* Get a Ruby number to reference a pointer */
643
+ static VALUE SWIG_RubyPtrToReference(void* ptr) {
644
+ /* We cast the pointer to an unsigned long
645
+ and then store a reference to it using
646
+ a Ruby number object. */
647
+
648
+ /* Convert the pointer to a Ruby number */
649
+ unsigned long value = (unsigned long) ptr;
650
+ return LONG2NUM(value);
651
+ }
652
+
653
+ /* Get a Ruby number to reference an object */
654
+ static VALUE SWIG_RubyObjectToReference(VALUE object) {
655
+ /* We cast the object to an unsigned long
656
+ and then store a reference to it using
657
+ a Ruby number object. */
658
+
659
+ /* Convert the Object to a Ruby number */
660
+ unsigned long value = (unsigned long) object;
661
+ return LONG2NUM(value);
662
+ }
663
+
664
+ /* Get a Ruby object from a previously stored reference */
665
+ static VALUE SWIG_RubyReferenceToObject(VALUE reference) {
666
+ /* The provided Ruby number object is a reference
667
+ to the Ruby object we want.*/
668
+
669
+ /* First convert the Ruby number to a C number */
670
+ unsigned long value = NUM2LONG(reference);
671
+ return (VALUE) value;
672
+ }
673
+
674
+ /* Add a Tracking from a C/C++ struct to a Ruby object */
675
+ static void SWIG_RubyAddTracking(void* ptr, VALUE object) {
676
+ /* In a Ruby hash table we store the pointer and
677
+ the associated Ruby object. The trick here is
678
+ that we cannot store the Ruby object directly - if
679
+ we do then it cannot be garbage collected. So
680
+ instead we typecast it as a unsigned long and
681
+ convert it to a Ruby number object.*/
682
+
683
+ /* Get a reference to the pointer as a Ruby number */
684
+ VALUE key = SWIG_RubyPtrToReference(ptr);
685
+
686
+ /* Get a reference to the Ruby object as a Ruby number */
687
+ VALUE value = SWIG_RubyObjectToReference(object);
688
+
689
+ /* Store the mapping to the global hash table. */
690
+ rb_hash_aset(swig_ruby_trackings, key, value);
691
+ }
692
+
693
+ /* Get the Ruby object that owns the specified C/C++ struct */
694
+ static VALUE SWIG_RubyInstanceFor(void* ptr) {
695
+ /* Get a reference to the pointer as a Ruby number */
696
+ VALUE key = SWIG_RubyPtrToReference(ptr);
697
+
698
+ /* Now lookup the value stored in the global hash table */
699
+ VALUE value = rb_hash_aref(swig_ruby_trackings, key);
700
+
701
+ if (value == Qnil) {
702
+ /* No object exists - return nil. */
703
+ return Qnil;
704
+ }
705
+ else {
706
+ /* Convert this value to Ruby object */
707
+ return SWIG_RubyReferenceToObject(value);
708
+ }
709
+ }
710
+
711
+ /* Remove a Tracking from a C/C++ struct to a Ruby object */
712
+ static void SWIG_RubyRemoveTracking(void* ptr) {
713
+ /* Get a reference to the pointer as a Ruby number */
714
+ VALUE key = SWIG_RubyPtrToReference(ptr);
715
+
716
+ /* Define delete method - in C++ this could be marked as
717
+ static but unfortunately not in C. */
718
+ VALUE delete_function = rb_intern("delete");
719
+
720
+ /* Delete the object from the hash table by calling Ruby's
721
+ do this we need to call the Hash.delete method.*/
722
+ rb_funcall(swig_ruby_trackings, delete_function, 1, key);
723
+ }
724
+
725
+ /* This is a helper method that unlinks a Ruby object from its
726
+ underlying C++ object. This is needed if the lifetime of the
727
+ Ruby object is longer than the C++ object */
728
+ static void SWIG_RubyUnlinkObjects(void* ptr) {
729
+ VALUE object = SWIG_RubyInstanceFor(ptr);
730
+
731
+ if (object != Qnil) {
732
+ DATA_PTR(object) = 0;
733
+ }
734
+ }
735
+
736
+ /* Common SWIG API */
737
+ #define SWIG_ConvertPtr(obj, pp, type, flags) \
738
+ SWIG_Ruby_ConvertPtr(obj, pp, type, flags)
739
+ #define SWIG_NewPointerObj(p, type, flags) \
740
+ SWIG_Ruby_NewPointerObj(p, type, flags)
741
+ #define SWIG_MustGetPtr(p, type, argnum, flags) \
742
+ SWIG_Ruby_MustGetPtr(p, type, argnum, flags)
743
+ #define SWIG_GetModule(clientdata) \
744
+ SWIG_Ruby_GetModule()
745
+ #define SWIG_SetModule(clientdata, pointer) \
746
+ SWIG_Ruby_SetModule(pointer)
747
+
748
+ /* Ruby-specific SWIG API */
749
+
750
+ #define SWIG_InitRuntime() \
751
+ SWIG_Ruby_InitRuntime()
752
+ #define SWIG_define_class(ty) \
753
+ SWIG_Ruby_define_class(ty)
754
+ #define SWIG_NewClassInstance(value, ty) \
755
+ SWIG_Ruby_NewClassInstance(value, ty)
756
+ #define SWIG_MangleStr(value) \
757
+ SWIG_Ruby_MangleStr(value)
758
+ #define SWIG_CheckConvert(value, ty) \
759
+ SWIG_Ruby_CheckConvert(value, ty)
760
+ #define SWIG_NewPackedObj(ptr, sz, ty) \
761
+ SWIG_Ruby_NewPackedObj(ptr, sz, ty)
762
+ #define SWIG_ConvertPacked(obj, ptr, sz, ty, flags) \
763
+ SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty, flags)
764
+
765
+ /* rubydef.swg */
766
+ #ifdef __cplusplus
767
+ extern "C" {
768
+ #endif
769
+
770
+ static VALUE _mSWIG = Qnil;
771
+ static VALUE _cSWIG_Pointer = Qnil;
772
+ static VALUE swig_runtime_data_type_pointer = Qnil;
773
+
774
+ /* Initialize Ruby runtime support */
775
+ static void
776
+ SWIG_Ruby_InitRuntime(void)
777
+ {
778
+ if (_mSWIG == Qnil) {
779
+ _mSWIG = rb_define_module("SWIG");
780
+ }
781
+ }
782
+
783
+ /* Define Ruby class for C type */
784
+ static void
785
+ SWIG_Ruby_define_class(swig_type_info *type)
786
+ {
787
+ VALUE klass;
788
+ char *klass_name = (char *) malloc(4 + strlen(type->name) + 1);
789
+ sprintf(klass_name, "TYPE%s", type->name);
790
+ if (NIL_P(_cSWIG_Pointer)) {
791
+ _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);
792
+ rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new");
793
+ }
794
+ klass = rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
795
+ free((void *) klass_name);
796
+ }
797
+
798
+ /* Create a new pointer object */
799
+ static VALUE
800
+ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
801
+ {
802
+ int own = flags & SWIG_POINTER_OWN;
803
+ int track = flags & SWIG_TRACK_OBJECTS;
804
+
805
+ char *klass_name;
806
+ swig_class *sklass;
807
+ VALUE klass;
808
+ VALUE obj;
809
+
810
+ if (!ptr)
811
+ return Qnil;
812
+
813
+ /* Have we already wrapped this pointer? */
814
+ if (track) {
815
+ obj = SWIG_RubyInstanceFor(ptr);
816
+ if (obj != Qnil) {
817
+ return obj;
818
+ }
819
+ }
820
+
821
+ if (type->clientdata) {
822
+ sklass = (swig_class *) type->clientdata;
823
+ obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark), (own ? VOIDFUNC(sklass->destroy) : 0), ptr);
824
+ } else {
825
+ klass_name = (char *) malloc(4 + strlen(type->name) + 1);
826
+ sprintf(klass_name, "TYPE%s", type->name);
827
+ klass = rb_const_get(_mSWIG, rb_intern(klass_name));
828
+ free((void *) klass_name);
829
+ obj = Data_Wrap_Struct(klass, 0, 0, ptr);
830
+ }
831
+ rb_iv_set(obj, "__swigtype__", rb_str_new2(type->name));
832
+
833
+ /* Keep track of this object if necessary */
834
+ if (track) {
835
+ SWIG_RubyAddTracking(ptr, obj);
836
+ }
837
+
838
+ return obj;
839
+ }
840
+
841
+ /* Create a new class instance (always owned) */
842
+ static VALUE
843
+ SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type)
844
+ {
845
+ VALUE obj;
846
+ swig_class *sklass = (swig_class *) type->clientdata;
847
+ obj = Data_Wrap_Struct(klass, VOIDFUNC(sklass->mark), VOIDFUNC(sklass->destroy), 0);
848
+ rb_iv_set(obj, "__swigtype__", rb_str_new2(type->name));
849
+ return obj;
850
+ }
851
+
852
+ /* Get type mangle from class name */
853
+ static SWIGINLINE char *
854
+ SWIG_Ruby_MangleStr(VALUE obj)
855
+ {
856
+ VALUE stype = rb_iv_get(obj, "__swigtype__");
857
+ return StringValuePtr(stype);
858
+ }
859
+
860
+ /* Convert a pointer value */
861
+ static int
862
+ SWIG_Ruby_ConvertPtr(VALUE obj, void **ptr, swig_type_info *ty, int flags)
863
+ {
864
+ char *c;
865
+ swig_cast_info *tc;
866
+
867
+ /* Grab the pointer */
868
+ if (NIL_P(obj)) {
869
+ *ptr = 0;
870
+ return 0;
871
+ } else {
872
+ Data_Get_Struct(obj, void, *ptr);
873
+ }
874
+
875
+ /* Check to see if the input object is giving up ownership
876
+ of the underlying C struct or C++ object. If so then we
877
+ need to reset the destructor since the Ruby object no
878
+ longer owns the underlying C++ object.*/
879
+ if (flags & SWIG_POINTER_DISOWN) {
880
+ if (flags & SWIG_TRACK_OBJECTS) {
881
+ /* We are tracking objects. Thus we change the destructor
882
+ * to SWIG_RubyRemoveTracking. This allows us to
883
+ * remove the mapping from the C++ to Ruby object
884
+ * when the Ruby object is garbage collected. If we don't
885
+ * do this, then it is possible we will return a reference
886
+ * to a Ruby object that no longer exists thereby crashing Ruby. */
887
+ RDATA(obj)->dfree = SWIG_RubyRemoveTracking;
888
+ } else {
889
+ RDATA(obj)->dfree = 0;
890
+ }
891
+ }
892
+
893
+ /* Do type-checking if type info was provided */
894
+ if (ty) {
895
+ if (ty->clientdata) {
896
+ if (rb_obj_is_kind_of(obj, ((swig_class *) (ty->clientdata))->klass)) {
897
+ if (*ptr == 0)
898
+ rb_raise(rb_eRuntimeError, "This %s already released", ty->str);
899
+ return 0;
900
+ }
901
+ }
902
+ if ((c = SWIG_MangleStr(obj)) == NULL) {
903
+ if (flags & SWIG_POINTER_EXCEPTION)
904
+ rb_raise(rb_eTypeError, "Expected %s", ty->str);
905
+ else
906
+ return -1;
907
+ }
908
+ tc = SWIG_TypeCheck(c, ty);
909
+ if (!tc) {
910
+ if (flags & SWIG_POINTER_EXCEPTION)
911
+ rb_raise(rb_eTypeError, "Expected %s", ty->str);
912
+ else
913
+ return -1;
914
+ }
915
+ *ptr = SWIG_TypeCast(tc, *ptr);
916
+ }
917
+ return 0;
918
+ }
919
+
920
+ /* Convert a pointer value, signal an exception on a type mismatch */
921
+ static SWIGINLINE void *
922
+ SWIG_Ruby_MustGetPtr(VALUE obj, swig_type_info *ty, int argnum, int flags)
923
+ {
924
+ void *result;
925
+ SWIG_ConvertPtr(obj, &result, ty, flags | SWIG_POINTER_EXCEPTION);
926
+ return result;
927
+ }
928
+
929
+ /* Check convert */
930
+ static SWIGINLINE int
931
+ SWIG_Ruby_CheckConvert(VALUE obj, swig_type_info *ty)
932
+ {
933
+ char *c = SWIG_MangleStr(obj);
934
+ if (!c)
935
+ return 0;
936
+ return SWIG_TypeCheck(c,ty) != 0;
937
+ }
938
+
939
+ static VALUE
940
+ SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
941
+ char result[1024];
942
+ char *r = result;
943
+ if ((2*sz + 1 + strlen(type->name)) > 1000) return 0;
944
+ *(r++) = '_';
945
+ r = SWIG_PackData(r, ptr, sz);
946
+ strcpy(r, type->name);
947
+ return rb_str_new2(result);
948
+ }
949
+
950
+ /* Convert a packed value value */
951
+ static void
952
+ SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty, int flags) {
953
+ swig_cast_info *tc;
954
+ const char *c;
955
+
956
+ if (TYPE(obj) != T_STRING) goto type_error;
957
+ c = StringValuePtr(obj);
958
+ /* Pointer values must start with leading underscore */
959
+ if (*c != '_') goto type_error;
960
+ c++;
961
+ c = SWIG_UnpackData(c, ptr, sz);
962
+ if (ty) {
963
+ tc = SWIG_TypeCheck(c, ty);
964
+ if (!tc) goto type_error;
965
+ }
966
+ return;
967
+
968
+ type_error:
969
+
970
+ if (flags) {
971
+ if (ty) {
972
+ rb_raise(rb_eTypeError, "Type error. Expected %s", ty->name);
973
+ } else {
974
+ rb_raise(rb_eTypeError, "Expected a pointer");
975
+ }
976
+ }
977
+ }
978
+
979
+ static swig_module_info *SWIG_Ruby_GetModule() {
980
+ VALUE pointer;
981
+ swig_module_info *ret = 0;
982
+
983
+ /* first check if pointer already created */
984
+ pointer = rb_gv_get("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
985
+ if (pointer != Qnil) {
986
+ Data_Get_Struct(pointer, swig_module_info, ret);
987
+ }
988
+ return ret;
989
+ }
990
+
991
+ static void SWIG_Ruby_SetModule(swig_module_info *pointer) {
992
+ /* register a new class */
993
+ VALUE cl = rb_define_class("swig_runtime_data", rb_cObject);
994
+ /* create and store the structure pointer to a global variable */
995
+ swig_runtime_data_type_pointer = Data_Wrap_Struct(cl, 0, 0, pointer);
996
+ rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer);
997
+ }
998
+
999
+ #ifdef __cplusplus
1000
+ }
1001
+ #endif
1002
+
1003
+
1004
+
1005
+ /* -------- TYPES TABLE (BEGIN) -------- */
1006
+
1007
+ #define SWIGTYPE_p_Buf_triple_t swig_types[0]
1008
+ #define SWIGTYPE_p_CdIo_t swig_types[1]
1009
+ #define SWIGTYPE_p_HWInfo_t swig_types[2]
1010
+ #define SWIGTYPE_p_cdio_hwinfo_t swig_types[3]
1011
+ #define SWIGTYPE_p_cdio_read_mode_t swig_types[4]
1012
+ #define SWIGTYPE_p_char swig_types[5]
1013
+ #define SWIGTYPE_p_int swig_types[6]
1014
+ #define SWIGTYPE_p_long swig_types[7]
1015
+ #define SWIGTYPE_p_off_t swig_types[8]
1016
+ #define SWIGTYPE_p_unsigned_int swig_types[9]
1017
+ #define SWIGTYPE_p_unsigned_long swig_types[10]
1018
+ static swig_type_info *swig_types[12];
1019
+ static swig_module_info swig_module = {swig_types, 11, 0, 0, 0, 0};
1020
+ #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
1021
+ #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
1022
+
1023
+ /* -------- TYPES TABLE (END) -------- */
1024
+
1025
+ #define SWIG_init Init_rubycdio
1026
+ #define SWIG_name "Rubycdio"
1027
+
1028
+ static VALUE mRubycdio;
1029
+
1030
+ static void SWIG_AsVal(VALUE obj, int *val)
1031
+ {
1032
+ *val = (int) NUM2INT(obj);
1033
+ }
1034
+
1035
+
1036
+ /* Includes the header in the wrapper code */
1037
+ #include <cdio/cdio.h>
1038
+ #include <cdio/audio.h>
1039
+ #include <cdio/cd_types.h>
1040
+
1041
+
1042
+ /* When libcdio version > 0.76 comes out this won't be needed. */
1043
+ #include <cdio/version.h>
1044
+ #if LIBCDIO_VERSION_NUM <= 76
1045
+
1046
+ /**< Masks derived from above... */
1047
+ #undef CDIO_DRIVE_CAP_WRITE_DVD
1048
+ #define CDIO_DRIVE_CAP_WRITE_DVD ( \
1049
+ CDIO_DRIVE_CAP_WRITE_DVD_R \
1050
+ | CDIO_DRIVE_CAP_WRITE_DVD_PR \
1051
+ | CDIO_DRIVE_CAP_WRITE_DVD_RAM \
1052
+ | CDIO_DRIVE_CAP_WRITE_DVD_RW \
1053
+ | CDIO_DRIVE_CAP_WRITE_DVD_RPW \
1054
+ )
1055
+
1056
+ /** All the different ways a block/sector can be read. */
1057
+ typedef enum {
1058
+ CDIO_READ_MODE_AUDIO, /**< CD-DA, audio, Red Book */
1059
+ CDIO_READ_MODE_M1F1, /**< Mode 1 Form 1 */
1060
+ CDIO_READ_MODE_M1F2, /**< Mode 1 Form 2 */
1061
+ CDIO_READ_MODE_M2F1, /**< Mode 2 Form 1 */
1062
+ CDIO_READ_MODE_M2F2, /**< Mode 2 Form 2 */
1063
+ } cdio_read_mode_t;
1064
+
1065
+ /*!
1066
+ Reads a number of sectors (AKA blocks).
1067
+
1068
+ @param p_buf place to read data into. The caller should make sure
1069
+ this location is large enough. See below for size information.
1070
+ @param read_mode the kind of "mode" to use in reading.
1071
+ @param i_lsn sector to read
1072
+ @param i_blocks number of sectors to read
1073
+ @return DRIVER_OP_SUCCESS (0) if no error, other (negative) enumerations
1074
+ are returned on error.
1075
+
1076
+ If read_mode is CDIO_MODE_AUDIO,
1077
+ *p_buf should hold at least CDIO_FRAMESIZE_RAW * i_blocks bytes.
1078
+
1079
+ If read_mode is CDIO_MODE_DATA,
1080
+ *p_buf should hold at least i_blocks times either ISO_BLOCKSIZE,
1081
+ M1RAW_SECTOR_SIZE or M2F2_SECTOR_SIZE depending on the kind of
1082
+ sector getting read. If you don't know whether you have a Mode 1/2,
1083
+ Form 1/ Form 2/Formless sector best to reserve space for the maximum
1084
+ which is M2RAW_SECTOR_SIZE.
1085
+
1086
+ If read_mode is CDIO_MODE_M2F1,
1087
+ *p_buf should hold at least M2RAW_SECTOR_SIZE * i_blocks bytes.
1088
+
1089
+ If read_mode is CDIO_MODE_M2F2,
1090
+ *p_buf should hold at least CDIO_CD_FRAMESIZE * i_blocks bytes.
1091
+
1092
+
1093
+ */
1094
+ driver_return_code_t
1095
+ cdio_read_sectors(const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn,
1096
+ cdio_read_mode_t read_mode, uint32_t i_blocks)
1097
+ {
1098
+ switch(read_mode) {
1099
+ case CDIO_READ_MODE_AUDIO:
1100
+ return cdio_read_audio_sectors (p_cdio, p_buf, i_lsn, i_blocks);
1101
+ case CDIO_READ_MODE_M1F1:
1102
+ return cdio_read_mode1_sectors (p_cdio, p_buf, i_lsn, false, i_blocks);
1103
+ case CDIO_READ_MODE_M1F2:
1104
+ return cdio_read_mode1_sectors (p_cdio, p_buf, i_lsn, true, i_blocks);
1105
+ case CDIO_READ_MODE_M2F1:
1106
+ return cdio_read_mode2_sectors (p_cdio, p_buf, i_lsn, false, i_blocks);
1107
+ case CDIO_READ_MODE_M2F2:
1108
+ return cdio_read_mode2_sectors (p_cdio, p_buf, i_lsn, true, i_blocks);
1109
+ }
1110
+ /* Can't happen. Just to shut up gcc. */
1111
+ return DRIVER_OP_ERROR;
1112
+ }
1113
+
1114
+ driver_return_code_t
1115
+ cdio_eject_media_drive (const char *psz_drive)
1116
+ {
1117
+ CdIo_t *p_cdio = cdio_open (psz_drive, DRIVER_DEVICE);
1118
+ if (p_cdio) {
1119
+ return cdio_eject_media(&p_cdio);
1120
+ } else {
1121
+ return DRIVER_OP_UNINIT;
1122
+ }
1123
+ }
1124
+ #endif /* LIBCDIO_VERSION_NUM <= 76 */
1125
+
1126
+
1127
+ #ifdef __cplusplus
1128
+ extern "C" {
1129
+ #endif
1130
+ #ifdef HAVE_SYS_TIME_H
1131
+ # include <sys/time.h>
1132
+ struct timeval rb_time_timeval(VALUE);
1133
+ #endif
1134
+ #ifdef __cplusplus
1135
+ }
1136
+ #endif
1137
+
1138
+
1139
+ #ifdef __cplusplus
1140
+ extern "C" {
1141
+ #endif
1142
+ #include "rubyio.h"
1143
+ #ifdef __cplusplus
1144
+ }
1145
+ #endif
1146
+
1147
+
1148
+ driver_return_code_t audio_play_lsn (CdIo_t *p_cdio, lsn_t start_lsn,
1149
+ lsn_t end_lsn)
1150
+ {
1151
+ msf_t start_msf;
1152
+ msf_t end_msf;
1153
+ cdio_lsn_to_msf (start_lsn, &start_msf);
1154
+ cdio_lsn_to_msf (end_lsn, &end_msf);
1155
+ return cdio_audio_play_msf(p_cdio, &start_msf, &end_msf);
1156
+ }
1157
+
1158
+
1159
+ typedef struct {
1160
+ char *data;
1161
+ size_t size;
1162
+ driver_return_code_t drc;
1163
+ } Buf_triple_t;
1164
+
1165
+
1166
+ Buf_triple_t read_cd(const CdIo_t *p_cdio, size_t i_size)
1167
+ {
1168
+ Buf_triple_t buf;
1169
+ buf.data = calloc(1, i_size);
1170
+ buf.size = cdio_read(p_cdio, buf.data, i_size);
1171
+ if (buf.size == -1) {
1172
+ free(buf.data);
1173
+ buf.drc = DRIVER_OP_ERROR;
1174
+ buf.data = NULL;
1175
+ }
1176
+ return buf;
1177
+ }
1178
+
1179
+
1180
+ /* NOTE: arg 4 *must* be the size of the buf for the buf_t typemap. */
1181
+ Buf_triple_t
1182
+ read_sectors(const CdIo_t *p_cdio, lsn_t i_lsn, cdio_read_mode_t read_mode,
1183
+ size_t i_size)
1184
+ {
1185
+ Buf_triple_t buf;
1186
+ uint32_t i_blocks;
1187
+ uint16_t i_blocksize;
1188
+ switch (read_mode) {
1189
+ case CDIO_READ_MODE_AUDIO:
1190
+ i_blocksize = CDIO_CD_FRAMESIZE_RAW;
1191
+ break;
1192
+ case CDIO_READ_MODE_M1F1:
1193
+ i_blocksize = M2RAW_SECTOR_SIZE;
1194
+ break;
1195
+ case CDIO_READ_MODE_M1F2:
1196
+ i_blocksize = M2RAW_SECTOR_SIZE;
1197
+ break;
1198
+ case CDIO_READ_MODE_M2F1:
1199
+ i_blocksize = CDIO_CD_FRAMESIZE;
1200
+ break;
1201
+ case CDIO_READ_MODE_M2F2:
1202
+ i_blocksize = M2F2_SECTOR_SIZE;
1203
+ break;
1204
+ default:
1205
+ buf.data = NULL;
1206
+ buf.drc = DRIVER_OP_BAD_PARAMETER;
1207
+ buf.size = -1;
1208
+ return buf;
1209
+ }
1210
+ buf.data = calloc(1, i_size);
1211
+ i_blocks = i_size / i_blocksize;
1212
+ buf.drc = cdio_read_sectors(p_cdio, buf.data, i_lsn, read_mode, i_blocks);
1213
+ if (buf.drc < 0) {
1214
+ free(buf.data);
1215
+ buf.data = NULL;
1216
+ buf.size = -1;
1217
+ } else {
1218
+ buf.size = i_size;
1219
+ }
1220
+ return buf;
1221
+
1222
+ }
1223
+
1224
+
1225
+ Buf_triple_t
1226
+ read_data_bytes(const CdIo_t *p_cdio, lsn_t i_lsn, int16_t i_blocksize,
1227
+ size_t i_size)
1228
+ {
1229
+ uint32_t i_blocks = i_size / i_blocksize;
1230
+ Buf_triple_t buf;
1231
+
1232
+ switch (i_blocksize) {
1233
+ case CDIO_CD_FRAMESIZE:
1234
+ case CDIO_CD_FRAMESIZE_RAW:
1235
+ case M2F2_SECTOR_SIZE:
1236
+ case M2RAW_SECTOR_SIZE:
1237
+ break;
1238
+ default:
1239
+ /* Don't know about these block sizes */
1240
+ buf.data = NULL;
1241
+ buf.drc = DRIVER_OP_BAD_PARAMETER;
1242
+ buf.size = -1;
1243
+ return buf;
1244
+ }
1245
+ buf.data = calloc(1, i_size);
1246
+
1247
+ #if DEBUGGING
1248
+ printf("p_cdio: %x, i_size: %d, lsn: %d, blocksize %d, blocks %d\n",
1249
+ p_cdio, i_size, i_lsn, i_blocksize, i_blocks);
1250
+ #endif
1251
+ buf.drc = cdio_read_data_sectors (p_cdio, buf.data, i_lsn,
1252
+ i_blocksize, i_blocks);
1253
+ #if DEBUGGING
1254
+ printf("drc: %d\n", buf.drc);
1255
+ #endif
1256
+ if (buf.drc < 0) {
1257
+ buf.data = NULL;
1258
+ buf.size = -1;
1259
+ } else {
1260
+ buf.size = i_size;
1261
+ }
1262
+ return buf;
1263
+ }
1264
+
1265
+
1266
+ char *get_track_msf(const CdIo_t *p_cdio, track_t i_track)
1267
+ {
1268
+ msf_t msf;
1269
+
1270
+ if (!cdio_get_track_msf( p_cdio, i_track, &msf )) {
1271
+ return NULL;
1272
+ } else {
1273
+ return cdio_msf_to_str( &msf );
1274
+ }
1275
+ }
1276
+
1277
+
1278
+ const char
1279
+ *get_track_format(const CdIo_t *p_cdio, track_t i_track)
1280
+ {
1281
+ track_format_t track_format = cdio_get_track_format(p_cdio, i_track);
1282
+ return track_format2str[track_format];
1283
+ }
1284
+
1285
+
1286
+ typedef char ** DeviceList_t;
1287
+
1288
+
1289
+ static VALUE output_helper(VALUE target, VALUE o) {
1290
+ if (NIL_P(target)) {
1291
+ target = o;
1292
+ } else {
1293
+ if (TYPE(target) != T_ARRAY) {
1294
+ VALUE o2 = target;
1295
+ target = rb_ary_new();
1296
+ rb_ary_push(target, o2);
1297
+ }
1298
+ rb_ary_push(target, o);
1299
+ }
1300
+ return target;
1301
+ }
1302
+
1303
+
1304
+ driver_return_code_t
1305
+ close_tray(const char *psz_drive, driver_id_t p_driver_id,
1306
+ driver_id_t *p_out_driver_id)
1307
+ {
1308
+ *p_out_driver_id = p_driver_id;
1309
+ return cdio_close_tray(psz_drive, p_out_driver_id);
1310
+ }
1311
+
1312
+
1313
+ const char *
1314
+ driver_errmsg(driver_return_code_t drc)
1315
+ {
1316
+ switch(drc) {
1317
+ case DRIVER_OP_SUCCESS:
1318
+ return "driver operation was successful";
1319
+ case DRIVER_OP_ERROR:
1320
+ return "driver I/O error";
1321
+ case DRIVER_OP_UNSUPPORTED:
1322
+ return "driver operatation not supported";
1323
+ case DRIVER_OP_UNINIT:
1324
+ return "driver not initialized";
1325
+ case DRIVER_OP_NOT_PERMITTED:
1326
+ return "driver operatation not permitted";
1327
+ case DRIVER_OP_BAD_PARAMETER:
1328
+ return "bad parameter passed";
1329
+ case DRIVER_OP_BAD_POINTER:
1330
+ return "bad pointer to memory area";
1331
+ case DRIVER_OP_NO_DRIVER:
1332
+ return "driver not available";
1333
+ default:
1334
+ return "unknown or bad driver return status";
1335
+ }
1336
+ }
1337
+
1338
+
1339
+ driver_return_code_t
1340
+ eject_media (CdIo_t *p_cdio)
1341
+ {
1342
+ /* libcdio routines uses a Cdio_t **p_cdio, so we have to pass in
1343
+ something it can clobber.
1344
+ */
1345
+ CdIo_t **pp_cdio = &p_cdio;
1346
+ return cdio_eject_media (pp_cdio);
1347
+ }
1348
+
1349
+
1350
+ char *
1351
+ get_default_device_driver(driver_id_t driver_id, driver_id_t *p_out_driver_id)
1352
+ {
1353
+ *p_out_driver_id = driver_id;
1354
+ return cdio_get_default_device_driver(p_out_driver_id);
1355
+ }
1356
+
1357
+
1358
+ DeviceList_t get_devices_ret (driver_id_t driver_id,
1359
+ driver_id_t *p_out_driver_id) {
1360
+ *p_out_driver_id = driver_id;
1361
+ return cdio_get_devices_ret (p_out_driver_id);
1362
+ }
1363
+
1364
+
1365
+ DeviceList_t
1366
+ get_devices_with_cap (unsigned int capabilities, bool b_any) {
1367
+ /* FIXME: ? libcdio allows one to specify a list (char **) of devices
1368
+ to search. Don't know how to do that via SWIG though. */
1369
+ return cdio_get_devices_with_cap (NULL, (cdio_fs_anal_t) capabilities,
1370
+ b_any);
1371
+ }
1372
+
1373
+
1374
+ DeviceList_t
1375
+ get_devices_with_cap_ret (unsigned int capabilities, bool b_any,
1376
+ driver_id_t *p_out_driver_id) {
1377
+ /* FIXME: ? libcdio allows one to specify a list (char **) of devices
1378
+ to search. Don't know how to do that via SWIG though. */
1379
+ return cdio_get_devices_with_cap_ret (NULL,
1380
+ (cdio_fs_anal_t) capabilities, b_any,
1381
+ p_out_driver_id);
1382
+ }
1383
+
1384
+
1385
+ int
1386
+ have_driver (unsigned int driver_id)
1387
+ {
1388
+ if (driver_id < CDIO_MIN_DRIVER || driver_id > CDIO_MAX_DRIVER)
1389
+ return -1;
1390
+ if (cdio_have_driver(driver_id)) return 1;
1391
+ return 0;
1392
+ }
1393
+
1394
+
1395
+ /*! True if CD-ROM understand ATAPI commands. */
1396
+ bool
1397
+ have_ATAPI (CdIo_t *p_cdio)
1398
+ {
1399
+ return cdio_have_atapi(p_cdio) == yep;
1400
+ }
1401
+
1402
+
1403
+ typedef char * buf_t;
1404
+
1405
+
1406
+ bool
1407
+ is_device(const char *psz_source, driver_id_t driver_id)
1408
+ {
1409
+ #if LIBCDIO_VERSION_NUM <= 76
1410
+ /* There is a bug in the 0.76 code when driver_id==DRIVER_UNKNOWN
1411
+ or DRIVER_DEVICE, so here we'll use code from compat.swg.
1412
+ */
1413
+ if (DRIVER_UNKNOWN == driver_id || DRIVER_DEVICE == driver_id) {
1414
+ char *psz_drive = cdio_get_default_device_driver(&driver_id);
1415
+ /* We don't need the psz_drive, just the driver_id */
1416
+ free(psz_drive);
1417
+ }
1418
+ #endif /* LIBCDIO_VERSION_NUM <= 76 */
1419
+ return cdio_is_device(psz_source, driver_id);
1420
+ }
1421
+
1422
+
1423
+ typedef struct {
1424
+ cdio_hwinfo_t hw;
1425
+ bool result;
1426
+ } HWInfo_t;
1427
+
1428
+
1429
+ const
1430
+ HWInfo_t get_hwinfo ( const CdIo_t *p_cdio)
1431
+ {
1432
+ static HWInfo_t info;
1433
+ info.result = cdio_get_hwinfo(p_cdio, &info.hw);
1434
+ return info;
1435
+ }
1436
+
1437
+
1438
+ CdIo_t *open_cd(const char *psz_orig_source, driver_id_t driver_id,
1439
+ const char *psz_orig_access_mode)
1440
+ {
1441
+ const char *psz_source = psz_orig_source;
1442
+ const char *psz_access_mode = psz_orig_access_mode;
1443
+
1444
+ if (psz_source && strlen(psz_source) == 0)
1445
+ psz_source = NULL;
1446
+ if (psz_access_mode || strlen(psz_access_mode) == 0)
1447
+ psz_access_mode = NULL;
1448
+ return cdio_open_am(psz_source, driver_id, psz_access_mode);
1449
+ }
1450
+
1451
+
1452
+ const char *
1453
+ get_disc_mode (CdIo_t *p_cdio)
1454
+ {
1455
+ discmode_t discmode = cdio_get_discmode(p_cdio);
1456
+ if (CDIO_DISC_MODE_ERROR == discmode) return NULL;
1457
+ return discmode2str[discmode];
1458
+ }
1459
+
1460
+
1461
+ static VALUE
1462
+ _wrap_cdio_read_sectors(int argc, VALUE *argv, VALUE self) {
1463
+ CdIo_t *arg1 = (CdIo_t *) 0 ;
1464
+ void *arg2 = (void *) 0 ;
1465
+ lsn_t arg3 ;
1466
+ cdio_read_mode_t arg4 ;
1467
+ unsigned int arg5 ;
1468
+ driver_return_code_t result;
1469
+ VALUE vresult = Qnil;
1470
+
1471
+ if ((argc < 5) || (argc > 5))
1472
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 5)",argc);
1473
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_CdIo_t, 0);
1474
+ SWIG_ConvertPtr(argv[1], (void **) &arg2, 0, SWIG_POINTER_EXCEPTION|0);
1475
+ arg3 = NUM2INT(argv[2]);
1476
+ arg4 = (cdio_read_mode_t) NUM2INT(argv[3]);
1477
+ arg5 = NUM2UINT(argv[4]);
1478
+ result = (driver_return_code_t)cdio_read_sectors((CdIo_t const *)arg1,arg2,arg3,arg4,arg5);
1479
+
1480
+ vresult = INT2NUM(result);
1481
+ return vresult;
1482
+ }
1483
+
1484
+
1485
+ static VALUE
1486
+ _wrap_cdio_eject_media_drive(int argc, VALUE *argv, VALUE self) {
1487
+ char *arg1 = (char *) 0 ;
1488
+ driver_return_code_t result;
1489
+ VALUE vresult = Qnil;
1490
+
1491
+ if ((argc < 1) || (argc > 1))
1492
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1493
+ arg1 = StringValuePtr(argv[0]);
1494
+ result = (driver_return_code_t)cdio_eject_media_drive((char const *)arg1);
1495
+
1496
+ vresult = INT2NUM(result);
1497
+ return vresult;
1498
+ }
1499
+
1500
+
1501
+ static VALUE
1502
+ _wrap_audio_pause(int argc, VALUE *argv, VALUE self) {
1503
+ CdIo_t *arg1 = (CdIo_t *) 0 ;
1504
+ driver_return_code_t result;
1505
+ VALUE vresult = Qnil;
1506
+
1507
+ if ((argc < 1) || (argc > 1))
1508
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1509
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_CdIo_t, 0);
1510
+ result = (driver_return_code_t)cdio_audio_pause(arg1);
1511
+
1512
+ vresult = INT2NUM(result);
1513
+ return vresult;
1514
+ }
1515
+
1516
+
1517
+ static VALUE
1518
+ _wrap_audio_play_lsn(int argc, VALUE *argv, VALUE self) {
1519
+ CdIo_t *arg1 = (CdIo_t *) 0 ;
1520
+ lsn_t arg2 ;
1521
+ lsn_t arg3 ;
1522
+ driver_return_code_t result;
1523
+ VALUE vresult = Qnil;
1524
+
1525
+ if ((argc < 3) || (argc > 3))
1526
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc);
1527
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_CdIo_t, 0);
1528
+ arg2 = NUM2INT(argv[1]);
1529
+ arg3 = NUM2INT(argv[2]);
1530
+ result = (driver_return_code_t)audio_play_lsn(arg1,arg2,arg3);
1531
+
1532
+ vresult = INT2NUM(result);
1533
+ return vresult;
1534
+ }
1535
+
1536
+
1537
+ static VALUE
1538
+ _wrap_audio_resume(int argc, VALUE *argv, VALUE self) {
1539
+ CdIo_t *arg1 = (CdIo_t *) 0 ;
1540
+ driver_return_code_t result;
1541
+ VALUE vresult = Qnil;
1542
+
1543
+ if ((argc < 1) || (argc > 1))
1544
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1545
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_CdIo_t, 0);
1546
+ result = (driver_return_code_t)cdio_audio_resume(arg1);
1547
+
1548
+ vresult = INT2NUM(result);
1549
+ return vresult;
1550
+ }
1551
+
1552
+
1553
+ static VALUE
1554
+ _wrap_audio_stop(int argc, VALUE *argv, VALUE self) {
1555
+ CdIo_t *arg1 = (CdIo_t *) 0 ;
1556
+ driver_return_code_t result;
1557
+ VALUE vresult = Qnil;
1558
+
1559
+ if ((argc < 1) || (argc > 1))
1560
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1561
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_CdIo_t, 0);
1562
+ result = (driver_return_code_t)cdio_audio_stop(arg1);
1563
+
1564
+ vresult = INT2NUM(result);
1565
+ return vresult;
1566
+ }
1567
+
1568
+
1569
+ swig_class cBuf_triple_t;
1570
+
1571
+ static VALUE
1572
+ _wrap_Buf_triple_t_data_set(int argc, VALUE *argv, VALUE self) {
1573
+ Buf_triple_t *arg1 = (Buf_triple_t *) 0 ;
1574
+ char *arg2 = (char *) 0 ;
1575
+
1576
+ if ((argc < 1) || (argc > 1))
1577
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1578
+ SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_Buf_triple_t, 0);
1579
+ arg2 = StringValuePtr(argv[0]);
1580
+ {
1581
+ if (arg1->data) free((char*)arg1->data);
1582
+ if (arg2) {
1583
+ arg1->data = (char *) malloc(strlen(arg2)+1);
1584
+ strcpy((char*)arg1->data,arg2);
1585
+ } else {
1586
+ arg1->data = 0;
1587
+ }
1588
+ }
1589
+ return Qnil;
1590
+ }
1591
+
1592
+
1593
+ static VALUE
1594
+ _wrap_Buf_triple_t_data_get(int argc, VALUE *argv, VALUE self) {
1595
+ Buf_triple_t *arg1 = (Buf_triple_t *) 0 ;
1596
+ char *result;
1597
+ VALUE vresult = Qnil;
1598
+
1599
+ if ((argc < 0) || (argc > 0))
1600
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
1601
+ SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_Buf_triple_t, 0);
1602
+ result = (char *) ((arg1)->data);
1603
+
1604
+ vresult = rb_str_new2(result);
1605
+ return vresult;
1606
+ }
1607
+
1608
+
1609
+ static VALUE
1610
+ _wrap_Buf_triple_t_size_set(int argc, VALUE *argv, VALUE self) {
1611
+ Buf_triple_t *arg1 = (Buf_triple_t *) 0 ;
1612
+ size_t arg2 ;
1613
+
1614
+ if ((argc < 1) || (argc > 1))
1615
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1616
+ SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_Buf_triple_t, 0);
1617
+ arg2 = NUM2ULONG(argv[0]);
1618
+ if (arg1) (arg1)->size = arg2;
1619
+
1620
+ return Qnil;
1621
+ }
1622
+
1623
+
1624
+ static VALUE
1625
+ _wrap_Buf_triple_t_size_get(int argc, VALUE *argv, VALUE self) {
1626
+ Buf_triple_t *arg1 = (Buf_triple_t *) 0 ;
1627
+ size_t result;
1628
+ VALUE vresult = Qnil;
1629
+
1630
+ if ((argc < 0) || (argc > 0))
1631
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
1632
+ SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_Buf_triple_t, 0);
1633
+ result = ((arg1)->size);
1634
+
1635
+ vresult = UINT2NUM(result);
1636
+ return vresult;
1637
+ }
1638
+
1639
+
1640
+ static VALUE
1641
+ _wrap_Buf_triple_t_drc_set(int argc, VALUE *argv, VALUE self) {
1642
+ Buf_triple_t *arg1 = (Buf_triple_t *) 0 ;
1643
+ driver_return_code_t arg2 ;
1644
+
1645
+ if ((argc < 1) || (argc > 1))
1646
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1647
+ SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_Buf_triple_t, 0);
1648
+ arg2 = NUM2LONG(argv[0]);
1649
+ if (arg1) (arg1)->drc = arg2;
1650
+
1651
+ return Qnil;
1652
+ }
1653
+
1654
+
1655
+ static VALUE
1656
+ _wrap_Buf_triple_t_drc_get(int argc, VALUE *argv, VALUE self) {
1657
+ Buf_triple_t *arg1 = (Buf_triple_t *) 0 ;
1658
+ driver_return_code_t result;
1659
+ VALUE vresult = Qnil;
1660
+
1661
+ if ((argc < 0) || (argc > 0))
1662
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
1663
+ SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_Buf_triple_t, 0);
1664
+ result = (driver_return_code_t) ((arg1)->drc);
1665
+
1666
+ vresult = INT2NUM(result);
1667
+ return vresult;
1668
+ }
1669
+
1670
+
1671
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
1672
+ static VALUE
1673
+ _wrap_Buf_triple_t_allocate(VALUE self) {
1674
+ #else
1675
+ static VALUE
1676
+ _wrap_Buf_triple_t_allocate(int argc, VALUE *argv, VALUE self) {
1677
+ #endif
1678
+
1679
+
1680
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Buf_triple_t);
1681
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
1682
+ rb_obj_call_init(vresult, argc, argv);
1683
+ #endif
1684
+ return vresult;
1685
+ }
1686
+
1687
+
1688
+ static VALUE
1689
+ _wrap_new_Buf_triple_t(int argc, VALUE *argv, VALUE self) {
1690
+ Buf_triple_t *result;
1691
+
1692
+ if ((argc < 0) || (argc > 0))
1693
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
1694
+ result = (Buf_triple_t *)(Buf_triple_t *) calloc(1, sizeof(Buf_triple_t));
1695
+ DATA_PTR(self) = result;
1696
+
1697
+ return self;
1698
+ }
1699
+
1700
+
1701
+ static void
1702
+ free_Buf_triple_t(Buf_triple_t *arg1) {
1703
+ free((char *) arg1);
1704
+ }
1705
+
1706
+ static VALUE
1707
+ _wrap_lseek(int argc, VALUE *argv, VALUE self) {
1708
+ CdIo_t *arg1 = (CdIo_t *) 0 ;
1709
+ off_t arg2 ;
1710
+ int arg3 = (int) SEEK_SET ;
1711
+ off_t result;
1712
+ VALUE vresult = Qnil;
1713
+
1714
+ if ((argc < 2) || (argc > 3))
1715
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
1716
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_CdIo_t, 0);
1717
+ {
1718
+ off_t * ptr;
1719
+ SWIG_ConvertPtr(argv[1], (void **) &ptr, SWIGTYPE_p_off_t, 0);
1720
+ if (ptr) arg2 = *ptr;
1721
+ }
1722
+ if (argc > 2) {
1723
+ arg3 = NUM2INT(argv[2]);
1724
+ }
1725
+ result = cdio_lseek((CdIo_t const *)arg1,arg2,arg3);
1726
+
1727
+ {
1728
+ off_t * resultptr;
1729
+ resultptr = (off_t *) malloc(sizeof(off_t));
1730
+ memmove(resultptr, &result, sizeof(off_t));
1731
+ vresult = SWIG_NewPointerObj((void *) resultptr, SWIGTYPE_p_off_t, 1);
1732
+ }
1733
+ return vresult;
1734
+ }
1735
+
1736
+
1737
+ static VALUE
1738
+ _wrap_read_cd(int argc, VALUE *argv, VALUE self) {
1739
+ CdIo_t *arg1 = (CdIo_t *) 0 ;
1740
+ size_t arg2 ;
1741
+ Buf_triple_t result;
1742
+ VALUE vresult = Qnil;
1743
+
1744
+ if ((argc < 2) || (argc > 2))
1745
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
1746
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_CdIo_t, 0);
1747
+ arg2 = NUM2ULONG(argv[1]);
1748
+ result = read_cd((CdIo_t const *)arg1,arg2);
1749
+
1750
+ {
1751
+ if (!(&result)->data)
1752
+ return Qnil;
1753
+ else {
1754
+ VALUE data_triple = rb_ary_new();
1755
+ rb_ary_push(data_triple, rb_str_new((&result)->data, (&result)->size));
1756
+ rb_ary_push(data_triple, INT2NUM((&result)->size));
1757
+ rb_ary_push(data_triple, INT2NUM((&result)->drc));
1758
+ free((&result)->data);
1759
+ return data_triple;
1760
+ }
1761
+
1762
+ }
1763
+ return vresult;
1764
+ }
1765
+
1766
+
1767
+ static VALUE
1768
+ _wrap_read_sectors(int argc, VALUE *argv, VALUE self) {
1769
+ CdIo_t *arg1 = (CdIo_t *) 0 ;
1770
+ lsn_t arg2 ;
1771
+ cdio_read_mode_t arg3 ;
1772
+ size_t arg4 ;
1773
+ Buf_triple_t result;
1774
+ VALUE vresult = Qnil;
1775
+
1776
+ if ((argc < 4) || (argc > 4))
1777
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc);
1778
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_CdIo_t, 0);
1779
+ arg2 = NUM2INT(argv[1]);
1780
+ arg3 = (cdio_read_mode_t) NUM2INT(argv[2]);
1781
+ arg4 = NUM2ULONG(argv[3]);
1782
+ result = read_sectors((CdIo_t const *)arg1,arg2,arg3,arg4);
1783
+
1784
+ {
1785
+ if (!(&result)->data)
1786
+ return Qnil;
1787
+ else {
1788
+ VALUE data_triple = rb_ary_new();
1789
+ rb_ary_push(data_triple, rb_str_new((&result)->data, (&result)->size));
1790
+ rb_ary_push(data_triple, INT2NUM((&result)->size));
1791
+ rb_ary_push(data_triple, INT2NUM((&result)->drc));
1792
+ free((&result)->data);
1793
+ return data_triple;
1794
+ }
1795
+
1796
+ }
1797
+ return vresult;
1798
+ }
1799
+
1800
+
1801
+ static VALUE
1802
+ _wrap_read_data_bytes(int argc, VALUE *argv, VALUE self) {
1803
+ CdIo_t *arg1 = (CdIo_t *) 0 ;
1804
+ lsn_t arg2 ;
1805
+ int16_t arg3 ;
1806
+ size_t arg4 ;
1807
+ Buf_triple_t result;
1808
+ VALUE vresult = Qnil;
1809
+
1810
+ if ((argc < 4) || (argc > 4))
1811
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc);
1812
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_CdIo_t, 0);
1813
+ arg2 = NUM2INT(argv[1]);
1814
+ arg3 = NUM2INT(argv[2]);
1815
+ arg4 = NUM2ULONG(argv[3]);
1816
+ result = read_data_bytes((CdIo_t const *)arg1,arg2,arg3,arg4);
1817
+
1818
+ {
1819
+ if (!(&result)->data)
1820
+ return Qnil;
1821
+ else {
1822
+ VALUE data_triple = rb_ary_new();
1823
+ rb_ary_push(data_triple, rb_str_new((&result)->data, (&result)->size));
1824
+ rb_ary_push(data_triple, INT2NUM((&result)->size));
1825
+ rb_ary_push(data_triple, INT2NUM((&result)->drc));
1826
+ free((&result)->data);
1827
+ return data_triple;
1828
+ }
1829
+
1830
+ }
1831
+ return vresult;
1832
+ }
1833
+
1834
+
1835
+ static VALUE
1836
+ _wrap_get_first_track_num(int argc, VALUE *argv, VALUE self) {
1837
+ CdIo_t *arg1 = (CdIo_t *) 0 ;
1838
+ track_t result;
1839
+ VALUE vresult = Qnil;
1840
+
1841
+ if ((argc < 1) || (argc > 1))
1842
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1843
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_CdIo_t, 0);
1844
+ result = (track_t)cdio_get_first_track_num((CdIo_t const *)arg1);
1845
+
1846
+ vresult = UINT2NUM(result);
1847
+ return vresult;
1848
+ }
1849
+
1850
+
1851
+ static VALUE
1852
+ _wrap_get_last_track_num(int argc, VALUE *argv, VALUE self) {
1853
+ CdIo_t *arg1 = (CdIo_t *) 0 ;
1854
+ track_t result;
1855
+ VALUE vresult = Qnil;
1856
+
1857
+ if ((argc < 1) || (argc > 1))
1858
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1859
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_CdIo_t, 0);
1860
+ result = (track_t)cdio_get_last_track_num((CdIo_t const *)arg1);
1861
+
1862
+ vresult = UINT2NUM(result);
1863
+ return vresult;
1864
+ }
1865
+
1866
+
1867
+ static VALUE
1868
+ _wrap_get_track(int argc, VALUE *argv, VALUE self) {
1869
+ CdIo_t *arg1 = (CdIo_t *) 0 ;
1870
+ lsn_t arg2 ;
1871
+ track_t result;
1872
+ VALUE vresult = Qnil;
1873
+
1874
+ if ((argc < 2) || (argc > 2))
1875
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
1876
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_CdIo_t, 0);
1877
+ arg2 = NUM2INT(argv[1]);
1878
+ result = (track_t)cdio_get_track((CdIo_t const *)arg1,arg2);
1879
+
1880
+ vresult = UINT2NUM(result);
1881
+ return vresult;
1882
+ }
1883
+
1884
+
1885
+ static VALUE
1886
+ _wrap_get_track_channels(int argc, VALUE *argv, VALUE self) {
1887
+ CdIo_t *arg1 = (CdIo_t *) 0 ;
1888
+ track_t arg2 ;
1889
+ int result;
1890
+ VALUE vresult = Qnil;
1891
+
1892
+ if ((argc < 2) || (argc > 2))
1893
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
1894
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_CdIo_t, 0);
1895
+ arg2 = NUM2UINT(argv[1]);
1896
+ result = (int)cdio_get_track_channels((CdIo_t const *)arg1,arg2);
1897
+
1898
+ vresult = INT2NUM(result);
1899
+ return vresult;
1900
+ }
1901
+
1902
+
1903
+ static VALUE
1904
+ _wrap_track_copy_permitq___(int argc, VALUE *argv, VALUE self) {
1905
+ CdIo_t *arg1 = (CdIo_t *) 0 ;
1906
+ track_t arg2 ;
1907
+ bool result;
1908
+ VALUE vresult = Qnil;
1909
+
1910
+ if ((argc < 2) || (argc > 2))
1911
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
1912
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_CdIo_t, 0);
1913
+ arg2 = NUM2UINT(argv[1]);
1914
+ result = (bool)cdio_get_track_copy_permit((CdIo_t const *)arg1,arg2);
1915
+
1916
+ vresult = (result != 0) ? Qtrue : Qfalse;
1917
+ return vresult;
1918
+ }
1919
+
1920
+
1921
+ static VALUE
1922
+ _wrap_get_track_format(int argc, VALUE *argv, VALUE self) {
1923
+ CdIo_t *arg1 = (CdIo_t *) 0 ;
1924
+ track_t arg2 ;
1925
+ char *result;
1926
+ VALUE vresult = Qnil;
1927
+
1928
+ if ((argc < 2) || (argc > 2))
1929
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
1930
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_CdIo_t, 0);
1931
+ arg2 = NUM2UINT(argv[1]);
1932
+ result = (char *)get_track_format((CdIo_t const *)arg1,arg2);
1933
+
1934
+ vresult = rb_str_new2(result);
1935
+ return vresult;
1936
+ }
1937
+
1938
+
1939
+ static VALUE
1940
+ _wrap_track_greenq___(int argc, VALUE *argv, VALUE self) {
1941
+ CdIo_t *arg1 = (CdIo_t *) 0 ;
1942
+ track_t arg2 ;
1943
+ bool result;
1944
+ VALUE vresult = Qnil;
1945
+
1946
+ if ((argc < 2) || (argc > 2))
1947
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
1948
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_CdIo_t, 0);
1949
+ arg2 = NUM2UINT(argv[1]);
1950
+ result = (bool)cdio_get_track_green((CdIo_t const *)arg1,arg2);
1951
+
1952
+ vresult = (result != 0) ? Qtrue : Qfalse;
1953
+ return vresult;
1954
+ }
1955
+
1956
+
1957
+ static VALUE
1958
+ _wrap_get_track_last_lsn(int argc, VALUE *argv, VALUE self) {
1959
+ CdIo_t *arg1 = (CdIo_t *) 0 ;
1960
+ track_t arg2 ;
1961
+ lsn_t result;
1962
+ VALUE vresult = Qnil;
1963
+
1964
+ if ((argc < 2) || (argc > 2))
1965
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
1966
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_CdIo_t, 0);
1967
+ arg2 = NUM2UINT(argv[1]);
1968
+ result = (lsn_t)cdio_get_track_last_lsn((CdIo_t const *)arg1,arg2);
1969
+
1970
+ vresult = INT2NUM(result);
1971
+ return vresult;
1972
+ }
1973
+
1974
+
1975
+ static VALUE
1976
+ _wrap_get_track_lba(int argc, VALUE *argv, VALUE self) {
1977
+ CdIo_t *arg1 = (CdIo_t *) 0 ;
1978
+ track_t arg2 ;
1979
+ lba_t result;
1980
+ VALUE vresult = Qnil;
1981
+
1982
+ if ((argc < 2) || (argc > 2))
1983
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
1984
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_CdIo_t, 0);
1985
+ arg2 = NUM2UINT(argv[1]);
1986
+ result = (lba_t)cdio_get_track_lba((CdIo_t const *)arg1,arg2);
1987
+
1988
+ vresult = INT2NUM(result);
1989
+ return vresult;
1990
+ }
1991
+
1992
+
1993
+ static VALUE
1994
+ _wrap_get_track_lsn(int argc, VALUE *argv, VALUE self) {
1995
+ CdIo_t *arg1 = (CdIo_t *) 0 ;
1996
+ track_t arg2 ;
1997
+ lsn_t result;
1998
+ VALUE vresult = Qnil;
1999
+
2000
+ if ((argc < 2) || (argc > 2))
2001
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2002
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_CdIo_t, 0);
2003
+ arg2 = NUM2UINT(argv[1]);
2004
+ result = (lsn_t)cdio_get_track_lsn((CdIo_t const *)arg1,arg2);
2005
+
2006
+ vresult = INT2NUM(result);
2007
+ return vresult;
2008
+ }
2009
+
2010
+
2011
+ static VALUE
2012
+ _wrap_get_track_msf(int argc, VALUE *argv, VALUE self) {
2013
+ CdIo_t *arg1 = (CdIo_t *) 0 ;
2014
+ track_t arg2 ;
2015
+ char *result;
2016
+ VALUE vresult = Qnil;
2017
+
2018
+ if ((argc < 2) || (argc > 2))
2019
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2020
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_CdIo_t, 0);
2021
+ arg2 = NUM2UINT(argv[1]);
2022
+ result = (char *)get_track_msf((CdIo_t const *)arg1,arg2);
2023
+
2024
+ vresult = rb_str_new2(result);
2025
+ return vresult;
2026
+ }
2027
+
2028
+
2029
+ static VALUE
2030
+ _wrap_get_track_preemphasis(int argc, VALUE *argv, VALUE self) {
2031
+ CdIo_t *arg1 = (CdIo_t *) 0 ;
2032
+ track_t arg2 ;
2033
+ track_flag_t result;
2034
+ VALUE vresult = Qnil;
2035
+
2036
+ if ((argc < 2) || (argc > 2))
2037
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2038
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_CdIo_t, 0);
2039
+ arg2 = NUM2UINT(argv[1]);
2040
+ result = (track_flag_t)cdio_get_track_preemphasis((CdIo_t const *)arg1,arg2);
2041
+
2042
+ vresult = INT2NUM(result);
2043
+ return vresult;
2044
+ }
2045
+
2046
+
2047
+ static VALUE
2048
+ _wrap_get_track_sec_count(int argc, VALUE *argv, VALUE self) {
2049
+ CdIo_t *arg1 = (CdIo_t *) 0 ;
2050
+ track_t arg2 ;
2051
+ unsigned int result;
2052
+ VALUE vresult = Qnil;
2053
+
2054
+ if ((argc < 2) || (argc > 2))
2055
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2056
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_CdIo_t, 0);
2057
+ arg2 = NUM2UINT(argv[1]);
2058
+ result = (unsigned int)cdio_get_track_sec_count((CdIo_t const *)arg1,arg2);
2059
+
2060
+ vresult = UINT2NUM(result);
2061
+ return vresult;
2062
+ }
2063
+
2064
+
2065
+ static VALUE
2066
+ _wrap_close_tray(int argc, VALUE *argv, VALUE self) {
2067
+ char *arg1 = (char *) 0 ;
2068
+ driver_id_t arg2 = (driver_id_t) DRIVER_UNKNOWN ;
2069
+ driver_id_t *arg3 = (driver_id_t *) 0 ;
2070
+ driver_return_code_t result;
2071
+ driver_id_t temp3 ;
2072
+ VALUE vresult = Qnil;
2073
+
2074
+ arg3 = &temp3;
2075
+ if ((argc < 1) || (argc > 2))
2076
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2077
+ arg1 = StringValuePtr(argv[0]);
2078
+ if (argc > 1) {
2079
+ arg2 = NUM2UINT(argv[1]);
2080
+ }
2081
+ result = (driver_return_code_t)close_tray((char const *)arg1,arg2,arg3);
2082
+
2083
+ vresult = INT2NUM(result);
2084
+ {
2085
+ VALUE o = UINT2NUM((unsigned int) (*arg3));
2086
+ vresult = output_helper(vresult, o);
2087
+ }
2088
+ return vresult;
2089
+ }
2090
+
2091
+
2092
+ static VALUE
2093
+ _wrap_close(int argc, VALUE *argv, VALUE self) {
2094
+ CdIo_t *arg1 = (CdIo_t *) 0 ;
2095
+
2096
+ if ((argc < 1) || (argc > 1))
2097
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2098
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_CdIo_t, 0);
2099
+ cdio_destroy(arg1);
2100
+
2101
+ return Qnil;
2102
+ }
2103
+
2104
+
2105
+ static VALUE
2106
+ _wrap_driver_errmsg(int argc, VALUE *argv, VALUE self) {
2107
+ driver_return_code_t arg1 ;
2108
+ char *result;
2109
+ VALUE vresult = Qnil;
2110
+
2111
+ if ((argc < 1) || (argc > 1))
2112
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2113
+ arg1 = NUM2LONG(argv[0]);
2114
+ result = (char *)driver_errmsg(arg1);
2115
+
2116
+ vresult = rb_str_new2(result);
2117
+ return vresult;
2118
+ }
2119
+
2120
+
2121
+ static VALUE
2122
+ _wrap_eject_media(int argc, VALUE *argv, VALUE self) {
2123
+ CdIo_t *arg1 = (CdIo_t *) 0 ;
2124
+ driver_return_code_t result;
2125
+ VALUE vresult = Qnil;
2126
+
2127
+ if ((argc < 1) || (argc > 1))
2128
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2129
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_CdIo_t, 0);
2130
+ result = (driver_return_code_t)eject_media(arg1);
2131
+
2132
+ vresult = INT2NUM(result);
2133
+ return vresult;
2134
+ }
2135
+
2136
+
2137
+ static VALUE
2138
+ _wrap_eject_media_drive(int argc, VALUE *argv, VALUE self) {
2139
+ char *arg1 = (char *) NULL ;
2140
+ driver_return_code_t result;
2141
+ VALUE vresult = Qnil;
2142
+
2143
+ if ((argc < 0) || (argc > 1))
2144
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
2145
+ if (argc > 0) {
2146
+ arg1 = StringValuePtr(argv[0]);
2147
+ }
2148
+ result = (driver_return_code_t)cdio_eject_media_drive((char const *)arg1);
2149
+
2150
+ vresult = INT2NUM(result);
2151
+ return vresult;
2152
+ }
2153
+
2154
+
2155
+ static VALUE
2156
+ _wrap_get_arg(int argc, VALUE *argv, VALUE self) {
2157
+ CdIo_t *arg1 = (CdIo_t *) 0 ;
2158
+ char *arg2 ;
2159
+ char *result;
2160
+ VALUE vresult = Qnil;
2161
+
2162
+ if ((argc < 2) || (argc > 2))
2163
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2164
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_CdIo_t, 0);
2165
+ arg2 = StringValuePtr(argv[1]);
2166
+ result = (char *)cdio_get_arg((CdIo_t const *)arg1,(char const (*))arg2);
2167
+
2168
+ vresult = rb_str_new2(result);
2169
+ return vresult;
2170
+ }
2171
+
2172
+
2173
+ static VALUE
2174
+ _wrap_get_device(int argc, VALUE *argv, VALUE self) {
2175
+ CdIo_t *arg1 = (CdIo_t *) NULL ;
2176
+ char *result;
2177
+ VALUE vresult = Qnil;
2178
+
2179
+ if ((argc < 0) || (argc > 1))
2180
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
2181
+ if (argc > 0) {
2182
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_CdIo_t, 0);
2183
+ }
2184
+ result = (char *)cdio_get_default_device((CdIo_t const *)arg1);
2185
+
2186
+ vresult = rb_str_new2(result);
2187
+ free(result);
2188
+ return vresult;
2189
+ }
2190
+
2191
+
2192
+ static VALUE
2193
+ _wrap_get_default_device_driver(int argc, VALUE *argv, VALUE self) {
2194
+ driver_id_t arg1 ;
2195
+ driver_id_t *arg2 = (driver_id_t *) 0 ;
2196
+ char *result;
2197
+ driver_id_t temp2 ;
2198
+ VALUE vresult = Qnil;
2199
+
2200
+ arg2 = &temp2;
2201
+ if ((argc < 1) || (argc > 1))
2202
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2203
+ arg1 = NUM2UINT(argv[0]);
2204
+ result = (char *)get_default_device_driver(arg1,arg2);
2205
+
2206
+ vresult = rb_str_new2(result);
2207
+ {
2208
+ VALUE o = UINT2NUM((unsigned int) (*arg2));
2209
+ vresult = output_helper(vresult, o);
2210
+ }
2211
+ free(result);
2212
+ return vresult;
2213
+ }
2214
+
2215
+
2216
+ static VALUE
2217
+ _wrap_get_devices(int argc, VALUE *argv, VALUE self) {
2218
+ driver_id_t arg1 ;
2219
+ DeviceList_t result;
2220
+ VALUE vresult = Qnil;
2221
+
2222
+ if ((argc < 1) || (argc > 1))
2223
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2224
+ arg1 = NUM2UINT(argv[0]);
2225
+ result = (DeviceList_t)cdio_get_devices(arg1);
2226
+
2227
+ {
2228
+ // result is of type DeviceList_t
2229
+ char **p = result;
2230
+
2231
+ if (result) {
2232
+ VALUE aDevices = rb_ary_new();
2233
+ for (p = result; *p; p++) {
2234
+ rb_ary_push(aDevices, rb_str_new2(*p));
2235
+ }
2236
+ cdio_free_device_list(result);
2237
+ return aDevices;
2238
+ } else {
2239
+ return Qnil;
2240
+ }
2241
+ }
2242
+ return vresult;
2243
+ }
2244
+
2245
+
2246
+ static VALUE
2247
+ _wrap_get_devices_ret(int argc, VALUE *argv, VALUE self) {
2248
+ driver_id_t arg1 ;
2249
+ driver_id_t *arg2 = (driver_id_t *) 0 ;
2250
+ DeviceList_t result;
2251
+ driver_id_t temp2 ;
2252
+ VALUE vresult = Qnil;
2253
+
2254
+ arg2 = &temp2;
2255
+ if ((argc < 1) || (argc > 1))
2256
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2257
+ arg1 = NUM2UINT(argv[0]);
2258
+ result = (DeviceList_t)get_devices_ret(arg1,arg2);
2259
+
2260
+ {
2261
+ // result is of type DeviceList_t
2262
+ char **p = result;
2263
+
2264
+ if (result) {
2265
+ VALUE aDevices = rb_ary_new();
2266
+ for (p = result; *p; p++) {
2267
+ rb_ary_push(aDevices, rb_str_new2(*p));
2268
+ }
2269
+ cdio_free_device_list(result);
2270
+ return aDevices;
2271
+ } else {
2272
+ return Qnil;
2273
+ }
2274
+ }
2275
+ {
2276
+ VALUE o = UINT2NUM((unsigned int) (*arg2));
2277
+ vresult = output_helper(vresult, o);
2278
+ }
2279
+ return vresult;
2280
+ }
2281
+
2282
+
2283
+ static VALUE
2284
+ _wrap_get_devices_with_cap(int argc, VALUE *argv, VALUE self) {
2285
+ unsigned int arg1 ;
2286
+ bool arg2 ;
2287
+ DeviceList_t result;
2288
+ VALUE vresult = Qnil;
2289
+
2290
+ if ((argc < 2) || (argc > 2))
2291
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2292
+ arg1 = NUM2UINT(argv[0]);
2293
+ arg2 = RTEST(argv[1]);
2294
+ result = (DeviceList_t)get_devices_with_cap(arg1,arg2);
2295
+
2296
+ {
2297
+ // result is of type DeviceList_t
2298
+ char **p = result;
2299
+
2300
+ if (result) {
2301
+ VALUE aDevices = rb_ary_new();
2302
+ for (p = result; *p; p++) {
2303
+ rb_ary_push(aDevices, rb_str_new2(*p));
2304
+ }
2305
+ cdio_free_device_list(result);
2306
+ return aDevices;
2307
+ } else {
2308
+ return Qnil;
2309
+ }
2310
+ }
2311
+ return vresult;
2312
+ }
2313
+
2314
+
2315
+ static VALUE
2316
+ _wrap_get_devices_with_cap_ret(int argc, VALUE *argv, VALUE self) {
2317
+ unsigned int arg1 ;
2318
+ bool arg2 ;
2319
+ driver_id_t *arg3 = (driver_id_t *) 0 ;
2320
+ DeviceList_t result;
2321
+ driver_id_t temp3 ;
2322
+ VALUE vresult = Qnil;
2323
+
2324
+ arg3 = &temp3;
2325
+ if ((argc < 2) || (argc > 2))
2326
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2327
+ arg1 = NUM2UINT(argv[0]);
2328
+ arg2 = RTEST(argv[1]);
2329
+ result = (DeviceList_t)get_devices_with_cap_ret(arg1,arg2,arg3);
2330
+
2331
+ {
2332
+ // result is of type DeviceList_t
2333
+ char **p = result;
2334
+
2335
+ if (result) {
2336
+ VALUE aDevices = rb_ary_new();
2337
+ for (p = result; *p; p++) {
2338
+ rb_ary_push(aDevices, rb_str_new2(*p));
2339
+ }
2340
+ cdio_free_device_list(result);
2341
+ return aDevices;
2342
+ } else {
2343
+ return Qnil;
2344
+ }
2345
+ }
2346
+ {
2347
+ VALUE o = UINT2NUM((unsigned int) (*arg3));
2348
+ vresult = output_helper(vresult, o);
2349
+ }
2350
+ return vresult;
2351
+ }
2352
+
2353
+
2354
+ static VALUE
2355
+ _wrap_get_drive_cap__SWIG_0(int argc, VALUE *argv, VALUE self) {
2356
+ CdIo_t *arg1 = (CdIo_t *) 0 ;
2357
+ unsigned int *arg2 = (unsigned int *) 0 ;
2358
+ unsigned int *arg3 = (unsigned int *) 0 ;
2359
+ unsigned int *arg4 = (unsigned int *) 0 ;
2360
+ unsigned int temp2 ;
2361
+ unsigned int temp3 ;
2362
+ unsigned int temp4 ;
2363
+ VALUE vresult = Qnil;
2364
+
2365
+ arg2 = &temp2;
2366
+ arg3 = &temp3;
2367
+ arg4 = &temp4;
2368
+ if ((argc < 1) || (argc > 1))
2369
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2370
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_CdIo_t, 0);
2371
+ cdio_get_drive_cap((CdIo_t const *)arg1,arg2,arg3,arg4);
2372
+
2373
+ {
2374
+ VALUE o = UINT2NUM((unsigned int) (*arg2));
2375
+ vresult = output_helper(vresult, o);
2376
+ }
2377
+ {
2378
+ VALUE o = UINT2NUM((unsigned int) (*arg3));
2379
+ vresult = output_helper(vresult, o);
2380
+ }
2381
+ {
2382
+ VALUE o = UINT2NUM((unsigned int) (*arg4));
2383
+ vresult = output_helper(vresult, o);
2384
+ }
2385
+ return vresult;
2386
+ }
2387
+
2388
+
2389
+ static VALUE
2390
+ _wrap_get_drive_cap__SWIG_1(int argc, VALUE *argv, VALUE self) {
2391
+ char *arg1 = (char *) NULL ;
2392
+ unsigned int *arg2 = (unsigned int *) 0 ;
2393
+ unsigned int *arg3 = (unsigned int *) 0 ;
2394
+ unsigned int *arg4 = (unsigned int *) 0 ;
2395
+ unsigned int temp2 ;
2396
+ unsigned int temp3 ;
2397
+ unsigned int temp4 ;
2398
+ VALUE vresult = Qnil;
2399
+
2400
+ arg2 = &temp2;
2401
+ arg3 = &temp3;
2402
+ arg4 = &temp4;
2403
+ if ((argc < 0) || (argc > 1))
2404
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
2405
+ if (argc > 0) {
2406
+ arg1 = StringValuePtr(argv[0]);
2407
+ }
2408
+ cdio_get_drive_cap_dev((char const *)arg1,arg2,arg3,arg4);
2409
+
2410
+ {
2411
+ VALUE o = UINT2NUM((unsigned int) (*arg2));
2412
+ vresult = output_helper(vresult, o);
2413
+ }
2414
+ {
2415
+ VALUE o = UINT2NUM((unsigned int) (*arg3));
2416
+ vresult = output_helper(vresult, o);
2417
+ }
2418
+ {
2419
+ VALUE o = UINT2NUM((unsigned int) (*arg4));
2420
+ vresult = output_helper(vresult, o);
2421
+ }
2422
+ return vresult;
2423
+ }
2424
+
2425
+
2426
+ static VALUE _wrap_get_drive_cap(int nargs, VALUE *args, VALUE self) {
2427
+ int argc;
2428
+ VALUE argv[1];
2429
+ int ii;
2430
+
2431
+ argc = nargs;
2432
+ for (ii = 0; (ii < argc) && (ii < 1); ii++) {
2433
+ argv[ii] = args[ii];
2434
+ }
2435
+ if ((argc >= 0) && (argc <= 1)) {
2436
+ int _v;
2437
+ if (argc <= 0) {
2438
+ return _wrap_get_drive_cap__SWIG_1(nargs, args, self);
2439
+ }
2440
+ {
2441
+ _v = (TYPE(argv[0]) == T_STRING) ? 1 : 0;
2442
+ }
2443
+ if (_v) {
2444
+ return _wrap_get_drive_cap__SWIG_1(nargs, args, self);
2445
+ }
2446
+ }
2447
+ if (argc == 1) {
2448
+ int _v;
2449
+ {
2450
+ void *ptr;
2451
+ _v = (NIL_P(argv[0]) || (TYPE(argv[0]) == T_DATA && SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_CdIo_t, 0) != -1)) ? 1 : 0;
2452
+ }
2453
+ if (_v) {
2454
+ return _wrap_get_drive_cap__SWIG_0(nargs, args, self);
2455
+ }
2456
+ }
2457
+
2458
+ rb_raise(rb_eArgError, "No matching function for overloaded 'get_drive_cap'");
2459
+ return Qnil;
2460
+ }
2461
+
2462
+
2463
+ static VALUE
2464
+ _wrap_get_driver_name(int argc, VALUE *argv, VALUE self) {
2465
+ CdIo_t *arg1 = (CdIo_t *) 0 ;
2466
+ char *result;
2467
+ VALUE vresult = Qnil;
2468
+
2469
+ if ((argc < 1) || (argc > 1))
2470
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2471
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_CdIo_t, 0);
2472
+ result = (char *)cdio_get_driver_name((CdIo_t const *)arg1);
2473
+
2474
+ vresult = rb_str_new2(result);
2475
+ return vresult;
2476
+ }
2477
+
2478
+
2479
+ static VALUE
2480
+ _wrap_get_driver_id(int argc, VALUE *argv, VALUE self) {
2481
+ CdIo_t *arg1 = (CdIo_t *) 0 ;
2482
+ driver_id_t result;
2483
+ VALUE vresult = Qnil;
2484
+
2485
+ if ((argc < 1) || (argc > 1))
2486
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2487
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_CdIo_t, 0);
2488
+ result = (driver_id_t)cdio_get_driver_id((CdIo_t const *)arg1);
2489
+
2490
+ vresult = UINT2NUM(result);
2491
+ return vresult;
2492
+ }
2493
+
2494
+
2495
+ static VALUE
2496
+ _wrap_get_last_session(int argc, VALUE *argv, VALUE self) {
2497
+ CdIo_t *arg1 = (CdIo_t *) 0 ;
2498
+ lsn_t *arg2 = (lsn_t *) 0 ;
2499
+ driver_return_code_t result;
2500
+ lsn_t temp2 ;
2501
+ VALUE vresult = Qnil;
2502
+
2503
+ arg2 = &temp2;
2504
+ if ((argc < 1) || (argc > 1))
2505
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2506
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_CdIo_t, 0);
2507
+ result = (driver_return_code_t)cdio_get_last_session(arg1,arg2);
2508
+
2509
+ vresult = INT2NUM(result);
2510
+ {
2511
+ VALUE o = INT2NUM((int) (*arg2));
2512
+ vresult = output_helper(vresult, o);
2513
+ }
2514
+ return vresult;
2515
+ }
2516
+
2517
+
2518
+ static VALUE
2519
+ _wrap_have_driver(int argc, VALUE *argv, VALUE self) {
2520
+ unsigned int arg1 ;
2521
+ int result;
2522
+ VALUE vresult = Qnil;
2523
+
2524
+ if ((argc < 1) || (argc > 1))
2525
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2526
+ arg1 = NUM2UINT(argv[0]);
2527
+ result = (int)have_driver(arg1);
2528
+
2529
+ vresult = INT2NUM(result);
2530
+ return vresult;
2531
+ }
2532
+
2533
+
2534
+ static VALUE
2535
+ _wrap_ATAPIq___(int argc, VALUE *argv, VALUE self) {
2536
+ CdIo_t *arg1 = (CdIo_t *) 0 ;
2537
+ bool result;
2538
+ VALUE vresult = Qnil;
2539
+
2540
+ if ((argc < 1) || (argc > 1))
2541
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2542
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_CdIo_t, 0);
2543
+ result = (bool)have_ATAPI(arg1);
2544
+
2545
+ vresult = (result != 0) ? Qtrue : Qfalse;
2546
+ return vresult;
2547
+ }
2548
+
2549
+
2550
+ static VALUE
2551
+ _wrap_is_binfile(int argc, VALUE *argv, VALUE self) {
2552
+ char *arg1 = (char *) 0 ;
2553
+ buf_t result;
2554
+ VALUE vresult = Qnil;
2555
+
2556
+ if ((argc < 1) || (argc > 1))
2557
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2558
+ arg1 = StringValuePtr(argv[0]);
2559
+ result = (buf_t)cdio_is_binfile((char const *)arg1);
2560
+
2561
+ vresult = rb_str_new2(result);
2562
+ return vresult;
2563
+ }
2564
+
2565
+
2566
+ static VALUE
2567
+ _wrap_is_cuefile(int argc, VALUE *argv, VALUE self) {
2568
+ char *arg1 = (char *) 0 ;
2569
+ buf_t result;
2570
+ VALUE vresult = Qnil;
2571
+
2572
+ if ((argc < 1) || (argc > 1))
2573
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2574
+ arg1 = StringValuePtr(argv[0]);
2575
+ result = (buf_t)cdio_is_cuefile((char const *)arg1);
2576
+
2577
+ vresult = rb_str_new2(result);
2578
+ return vresult;
2579
+ }
2580
+
2581
+
2582
+ static VALUE
2583
+ _wrap_cdio_is_device(int argc, VALUE *argv, VALUE self) {
2584
+ char *arg1 = (char *) 0 ;
2585
+ driver_id_t arg2 = (driver_id_t) DRIVER_UNKNOWN ;
2586
+ bool result;
2587
+ VALUE vresult = Qnil;
2588
+
2589
+ if ((argc < 1) || (argc > 2))
2590
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2591
+ arg1 = StringValuePtr(argv[0]);
2592
+ if (argc > 1) {
2593
+ arg2 = NUM2UINT(argv[1]);
2594
+ }
2595
+ result = (bool)cdio_is_device((char const *)arg1,arg2);
2596
+
2597
+ vresult = (result != 0) ? Qtrue : Qfalse;
2598
+ return vresult;
2599
+ }
2600
+
2601
+
2602
+ static VALUE
2603
+ _wrap_deviceq___(int argc, VALUE *argv, VALUE self) {
2604
+ char *arg1 = (char *) 0 ;
2605
+ driver_id_t arg2 ;
2606
+ bool result;
2607
+ VALUE vresult = Qnil;
2608
+
2609
+ if ((argc < 2) || (argc > 2))
2610
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2611
+ arg1 = StringValuePtr(argv[0]);
2612
+ arg2 = NUM2UINT(argv[1]);
2613
+ result = (bool)is_device((char const *)arg1,arg2);
2614
+
2615
+ vresult = (result != 0) ? Qtrue : Qfalse;
2616
+ return vresult;
2617
+ }
2618
+
2619
+
2620
+ static VALUE
2621
+ _wrap_nrgq___(int argc, VALUE *argv, VALUE self) {
2622
+ char *arg1 = (char *) 0 ;
2623
+ bool result;
2624
+ VALUE vresult = Qnil;
2625
+
2626
+ if ((argc < 1) || (argc > 1))
2627
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2628
+ arg1 = StringValuePtr(argv[0]);
2629
+ result = (bool)cdio_is_nrg((char const *)arg1);
2630
+
2631
+ vresult = (result != 0) ? Qtrue : Qfalse;
2632
+ return vresult;
2633
+ }
2634
+
2635
+
2636
+ static VALUE
2637
+ _wrap_tocfileq___(int argc, VALUE *argv, VALUE self) {
2638
+ char *arg1 = (char *) 0 ;
2639
+ bool result;
2640
+ VALUE vresult = Qnil;
2641
+
2642
+ if ((argc < 1) || (argc > 1))
2643
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2644
+ arg1 = StringValuePtr(argv[0]);
2645
+ result = (bool)cdio_is_tocfile((char const *)arg1);
2646
+
2647
+ vresult = (result != 0) ? Qtrue : Qfalse;
2648
+ return vresult;
2649
+ }
2650
+
2651
+
2652
+ static VALUE
2653
+ _wrap_get_media_changed(int argc, VALUE *argv, VALUE self) {
2654
+ CdIo_t *arg1 = (CdIo_t *) 0 ;
2655
+ int result;
2656
+ VALUE vresult = Qnil;
2657
+
2658
+ if ((argc < 1) || (argc > 1))
2659
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2660
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_CdIo_t, 0);
2661
+ result = (int)cdio_get_media_changed(arg1);
2662
+
2663
+ vresult = INT2NUM(result);
2664
+ return vresult;
2665
+ }
2666
+
2667
+
2668
+ swig_class cHWInfo_t;
2669
+
2670
+ static VALUE
2671
+ _wrap_HWInfo_t_hw_set(int argc, VALUE *argv, VALUE self) {
2672
+ HWInfo_t *arg1 = (HWInfo_t *) 0 ;
2673
+ cdio_hwinfo_t arg2 ;
2674
+
2675
+ if ((argc < 1) || (argc > 1))
2676
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2677
+ SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_HWInfo_t, 0);
2678
+ {
2679
+ cdio_hwinfo_t * ptr;
2680
+ SWIG_ConvertPtr(argv[0], (void **) &ptr, SWIGTYPE_p_cdio_hwinfo_t, 0);
2681
+ if (ptr) arg2 = *ptr;
2682
+ }
2683
+ if (arg1) (arg1)->hw = arg2;
2684
+
2685
+ return Qnil;
2686
+ }
2687
+
2688
+
2689
+ static VALUE
2690
+ _wrap_HWInfo_t_hw_get(int argc, VALUE *argv, VALUE self) {
2691
+ HWInfo_t *arg1 = (HWInfo_t *) 0 ;
2692
+ cdio_hwinfo_t result;
2693
+ VALUE vresult = Qnil;
2694
+
2695
+ if ((argc < 0) || (argc > 0))
2696
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
2697
+ SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_HWInfo_t, 0);
2698
+ result = ((arg1)->hw);
2699
+
2700
+ {
2701
+ cdio_hwinfo_t * resultptr;
2702
+ resultptr = (cdio_hwinfo_t *) malloc(sizeof(cdio_hwinfo_t));
2703
+ memmove(resultptr, &result, sizeof(cdio_hwinfo_t));
2704
+ vresult = SWIG_NewPointerObj((void *) resultptr, SWIGTYPE_p_cdio_hwinfo_t, 1);
2705
+ }
2706
+ return vresult;
2707
+ }
2708
+
2709
+
2710
+ static VALUE
2711
+ _wrap_HWInfo_t_result_set(int argc, VALUE *argv, VALUE self) {
2712
+ HWInfo_t *arg1 = (HWInfo_t *) 0 ;
2713
+ bool arg2 ;
2714
+
2715
+ if ((argc < 1) || (argc > 1))
2716
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2717
+ SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_HWInfo_t, 0);
2718
+ arg2 = RTEST(argv[0]);
2719
+ if (arg1) (arg1)->result = arg2;
2720
+
2721
+ return Qnil;
2722
+ }
2723
+
2724
+
2725
+ static VALUE
2726
+ _wrap_HWInfo_t_result_get(int argc, VALUE *argv, VALUE self) {
2727
+ HWInfo_t *arg1 = (HWInfo_t *) 0 ;
2728
+ bool result;
2729
+ VALUE vresult = Qnil;
2730
+
2731
+ if ((argc < 0) || (argc > 0))
2732
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
2733
+ SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_HWInfo_t, 0);
2734
+ result = (bool) ((arg1)->result);
2735
+
2736
+ vresult = (result != 0) ? Qtrue : Qfalse;
2737
+ return vresult;
2738
+ }
2739
+
2740
+
2741
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
2742
+ static VALUE
2743
+ _wrap_HWInfo_t_allocate(VALUE self) {
2744
+ #else
2745
+ static VALUE
2746
+ _wrap_HWInfo_t_allocate(int argc, VALUE *argv, VALUE self) {
2747
+ #endif
2748
+
2749
+
2750
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_HWInfo_t);
2751
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
2752
+ rb_obj_call_init(vresult, argc, argv);
2753
+ #endif
2754
+ return vresult;
2755
+ }
2756
+
2757
+
2758
+ static VALUE
2759
+ _wrap_new_HWInfo_t(int argc, VALUE *argv, VALUE self) {
2760
+ HWInfo_t *result;
2761
+
2762
+ if ((argc < 0) || (argc > 0))
2763
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
2764
+ result = (HWInfo_t *)(HWInfo_t *) calloc(1, sizeof(HWInfo_t));
2765
+ DATA_PTR(self) = result;
2766
+
2767
+ return self;
2768
+ }
2769
+
2770
+
2771
+ static void
2772
+ free_HWInfo_t(HWInfo_t *arg1) {
2773
+ free((char *) arg1);
2774
+ }
2775
+
2776
+ static VALUE
2777
+ _wrap_get_hwinfo(int argc, VALUE *argv, VALUE self) {
2778
+ CdIo_t *arg1 = (CdIo_t *) 0 ;
2779
+ HWInfo_t result;
2780
+ VALUE vresult = Qnil;
2781
+
2782
+ if ((argc < 1) || (argc > 1))
2783
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2784
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_CdIo_t, 0);
2785
+ result = get_hwinfo((CdIo_t const *)arg1);
2786
+
2787
+ {
2788
+ // result is of type HWInfo_t
2789
+ VALUE ret;
2790
+ if ((&result)->result == 0)
2791
+ return Qnil;
2792
+ else {
2793
+ ret = rb_hash_new();
2794
+ rb_hash_aset(ret, rb_str_new2("vendor"),
2795
+ rb_str_new2((&result)->hw.psz_vendor));
2796
+ rb_hash_aset(ret, rb_str_new2("model"),
2797
+ rb_str_new2((&result)->hw.psz_model));
2798
+ rb_hash_aset(ret, rb_str_new2("revision"),
2799
+ rb_str_new2((&result)->hw.psz_revision));
2800
+ return ret;
2801
+ }
2802
+ }
2803
+ return vresult;
2804
+ }
2805
+
2806
+
2807
+ static VALUE
2808
+ _wrap_set_blocksize(int argc, VALUE *argv, VALUE self) {
2809
+ CdIo_t *arg1 = (CdIo_t *) 0 ;
2810
+ int arg2 ;
2811
+ driver_return_code_t result;
2812
+ VALUE vresult = Qnil;
2813
+
2814
+ if ((argc < 2) || (argc > 2))
2815
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2816
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_CdIo_t, 0);
2817
+ arg2 = NUM2INT(argv[1]);
2818
+ result = (driver_return_code_t)cdio_set_blocksize((CdIo_t const *)arg1,arg2);
2819
+
2820
+ vresult = INT2NUM(result);
2821
+ return vresult;
2822
+ }
2823
+
2824
+
2825
+ static VALUE
2826
+ _wrap_set_speed(int argc, VALUE *argv, VALUE self) {
2827
+ CdIo_t *arg1 = (CdIo_t *) 0 ;
2828
+ int arg2 ;
2829
+ driver_return_code_t result;
2830
+ VALUE vresult = Qnil;
2831
+
2832
+ if ((argc < 2) || (argc > 2))
2833
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2834
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_CdIo_t, 0);
2835
+ arg2 = NUM2INT(argv[1]);
2836
+ result = (driver_return_code_t)cdio_set_speed((CdIo_t const *)arg1,arg2);
2837
+
2838
+ vresult = INT2NUM(result);
2839
+ return vresult;
2840
+ }
2841
+
2842
+
2843
+ static VALUE
2844
+ _wrap_open_cd(int argc, VALUE *argv, VALUE self) {
2845
+ char *arg1 = (char *) 0 ;
2846
+ driver_id_t arg2 = (driver_id_t) DRIVER_UNKNOWN ;
2847
+ char *arg3 = (char *) NULL ;
2848
+ CdIo_t *result;
2849
+ VALUE vresult = Qnil;
2850
+
2851
+ if ((argc < 1) || (argc > 3))
2852
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2853
+ arg1 = StringValuePtr(argv[0]);
2854
+ if (argc > 1) {
2855
+ arg2 = NUM2UINT(argv[1]);
2856
+ }
2857
+ if (argc > 2) {
2858
+ arg3 = StringValuePtr(argv[2]);
2859
+ }
2860
+ result = (CdIo_t *)open_cd((char const *)arg1,arg2,(char const *)arg3);
2861
+
2862
+ vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_CdIo_t,0);
2863
+ return vresult;
2864
+ }
2865
+
2866
+
2867
+ static VALUE
2868
+ _wrap_get_disc_last_lsn(int argc, VALUE *argv, VALUE self) {
2869
+ CdIo_t *arg1 = (CdIo_t *) 0 ;
2870
+ lsn_t result;
2871
+ VALUE vresult = Qnil;
2872
+
2873
+ if ((argc < 1) || (argc > 1))
2874
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2875
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_CdIo_t, 0);
2876
+ result = (lsn_t)cdio_get_disc_last_lsn((CdIo_t const *)arg1);
2877
+
2878
+ vresult = INT2NUM(result);
2879
+ return vresult;
2880
+ }
2881
+
2882
+
2883
+ static VALUE
2884
+ _wrap_get_disc_mode(int argc, VALUE *argv, VALUE self) {
2885
+ CdIo_t *arg1 = (CdIo_t *) 0 ;
2886
+ char *result;
2887
+ VALUE vresult = Qnil;
2888
+
2889
+ if ((argc < 1) || (argc > 1))
2890
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2891
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_CdIo_t, 0);
2892
+ result = (char *)get_disc_mode(arg1);
2893
+
2894
+ vresult = rb_str_new2(result);
2895
+ return vresult;
2896
+ }
2897
+
2898
+
2899
+ static VALUE
2900
+ _wrap_get_joliet_level(int argc, VALUE *argv, VALUE self) {
2901
+ CdIo_t *arg1 = (CdIo_t *) 0 ;
2902
+ int result;
2903
+ VALUE vresult = Qnil;
2904
+
2905
+ if ((argc < 1) || (argc > 1))
2906
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2907
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_CdIo_t, 0);
2908
+ result = (int)cdio_get_joliet_level((CdIo_t const *)arg1);
2909
+
2910
+ vresult = INT2NUM(result);
2911
+ return vresult;
2912
+ }
2913
+
2914
+
2915
+ static VALUE
2916
+ _wrap_get_mcn(int argc, VALUE *argv, VALUE self) {
2917
+ CdIo_t *arg1 = (CdIo_t *) 0 ;
2918
+ char *result;
2919
+ VALUE vresult = Qnil;
2920
+
2921
+ if ((argc < 1) || (argc > 1))
2922
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2923
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_CdIo_t, 0);
2924
+ result = (char *)cdio_get_mcn((CdIo_t const *)arg1);
2925
+
2926
+ vresult = rb_str_new2(result);
2927
+ free(result);
2928
+ return vresult;
2929
+ }
2930
+
2931
+
2932
+ static VALUE
2933
+ _wrap_get_num_tracks(int argc, VALUE *argv, VALUE self) {
2934
+ CdIo_t *arg1 = (CdIo_t *) 0 ;
2935
+ track_t result;
2936
+ VALUE vresult = Qnil;
2937
+
2938
+ if ((argc < 1) || (argc > 1))
2939
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2940
+ SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_CdIo_t, 0);
2941
+ result = (track_t)cdio_get_num_tracks((CdIo_t const *)arg1);
2942
+
2943
+ vresult = UINT2NUM(result);
2944
+ return vresult;
2945
+ }
2946
+
2947
+
2948
+
2949
+ /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
2950
+
2951
+ static swig_type_info _swigt__p_Buf_triple_t = {"_p_Buf_triple_t", "Buf_triple_t *", 0, 0, 0};
2952
+ static swig_type_info _swigt__p_CdIo_t = {"_p_CdIo_t", "CdIo_t *", 0, 0, 0};
2953
+ static swig_type_info _swigt__p_HWInfo_t = {"_p_HWInfo_t", "HWInfo_t *", 0, 0, 0};
2954
+ static swig_type_info _swigt__p_cdio_hwinfo_t = {"_p_cdio_hwinfo_t", "cdio_hwinfo_t *", 0, 0, 0};
2955
+ static swig_type_info _swigt__p_cdio_read_mode_t = {"_p_cdio_read_mode_t", "enum cdio_read_mode_t *|cdio_read_mode_t *", 0, 0, 0};
2956
+ static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, 0};
2957
+ static swig_type_info _swigt__p_int = {"_p_int", "int *|lsn_t *", 0, 0, 0};
2958
+ static swig_type_info _swigt__p_long = {"_p_long", "long *|ssize_t *", 0, 0, 0};
2959
+ static swig_type_info _swigt__p_off_t = {"_p_off_t", "off_t *", 0, 0, 0};
2960
+ static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "unsigned int *", 0, 0, 0};
2961
+ static swig_type_info _swigt__p_unsigned_long = {"_p_unsigned_long", "unsigned long *|VALUE *", 0, 0, 0};
2962
+
2963
+ static swig_type_info *swig_type_initial[] = {
2964
+ &_swigt__p_Buf_triple_t,
2965
+ &_swigt__p_CdIo_t,
2966
+ &_swigt__p_HWInfo_t,
2967
+ &_swigt__p_cdio_hwinfo_t,
2968
+ &_swigt__p_cdio_read_mode_t,
2969
+ &_swigt__p_char,
2970
+ &_swigt__p_int,
2971
+ &_swigt__p_long,
2972
+ &_swigt__p_off_t,
2973
+ &_swigt__p_unsigned_int,
2974
+ &_swigt__p_unsigned_long,
2975
+ };
2976
+
2977
+ static swig_cast_info _swigc__p_Buf_triple_t[] = { {&_swigt__p_Buf_triple_t, 0, 0, 0},{0, 0, 0, 0}};
2978
+ static swig_cast_info _swigc__p_CdIo_t[] = { {&_swigt__p_CdIo_t, 0, 0, 0},{0, 0, 0, 0}};
2979
+ static swig_cast_info _swigc__p_HWInfo_t[] = { {&_swigt__p_HWInfo_t, 0, 0, 0},{0, 0, 0, 0}};
2980
+ static swig_cast_info _swigc__p_cdio_hwinfo_t[] = { {&_swigt__p_cdio_hwinfo_t, 0, 0, 0},{0, 0, 0, 0}};
2981
+ static swig_cast_info _swigc__p_cdio_read_mode_t[] = { {&_swigt__p_cdio_read_mode_t, 0, 0, 0},{0, 0, 0, 0}};
2982
+ static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
2983
+ static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
2984
+ static swig_cast_info _swigc__p_long[] = { {&_swigt__p_long, 0, 0, 0},{0, 0, 0, 0}};
2985
+ static swig_cast_info _swigc__p_off_t[] = { {&_swigt__p_off_t, 0, 0, 0},{0, 0, 0, 0}};
2986
+ static swig_cast_info _swigc__p_unsigned_int[] = { {&_swigt__p_unsigned_int, 0, 0, 0},{0, 0, 0, 0}};
2987
+ static swig_cast_info _swigc__p_unsigned_long[] = { {&_swigt__p_unsigned_long, 0, 0, 0},{0, 0, 0, 0}};
2988
+
2989
+ static swig_cast_info *swig_cast_initial[] = {
2990
+ _swigc__p_Buf_triple_t,
2991
+ _swigc__p_CdIo_t,
2992
+ _swigc__p_HWInfo_t,
2993
+ _swigc__p_cdio_hwinfo_t,
2994
+ _swigc__p_cdio_read_mode_t,
2995
+ _swigc__p_char,
2996
+ _swigc__p_int,
2997
+ _swigc__p_long,
2998
+ _swigc__p_off_t,
2999
+ _swigc__p_unsigned_int,
3000
+ _swigc__p_unsigned_long,
3001
+ };
3002
+
3003
+
3004
+ /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
3005
+
3006
+ /*************************************************************************
3007
+ * Type initialization:
3008
+ * This problem is tough by the requirement that no dynamic
3009
+ * memory is used. Also, since swig_type_info structures store pointers to
3010
+ * swig_cast_info structures and swig_cast_info structures store pointers back
3011
+ * to swig_type_info structures, we need some lookup code at initialization.
3012
+ * The idea is that swig generates all the structures that are needed.
3013
+ * The runtime then collects these partially filled structures.
3014
+ * The SWIG_InitializeModule function takes these initial arrays out of
3015
+ * swig_module, and does all the lookup, filling in the swig_module.types
3016
+ * array with the correct data and linking the correct swig_cast_info
3017
+ * structures together.
3018
+
3019
+ * The generated swig_type_info structures are assigned staticly to an initial
3020
+ * array. We just loop though that array, and handle each type individually.
3021
+ * First we lookup if this type has been already loaded, and if so, use the
3022
+ * loaded structure instead of the generated one. Then we have to fill in the
3023
+ * cast linked list. The cast data is initially stored in something like a
3024
+ * two-dimensional array. Each row corresponds to a type (there are the same
3025
+ * number of rows as there are in the swig_type_initial array). Each entry in
3026
+ * a column is one of the swig_cast_info structures for that type.
3027
+ * The cast_initial array is actually an array of arrays, because each row has
3028
+ * a variable number of columns. So to actually build the cast linked list,
3029
+ * we find the array of casts associated with the type, and loop through it
3030
+ * adding the casts to the list. The one last trick we need to do is making
3031
+ * sure the type pointer in the swig_cast_info struct is correct.
3032
+
3033
+ * First off, we lookup the cast->type name to see if it is already loaded.
3034
+ * There are three cases to handle:
3035
+ * 1) If the cast->type has already been loaded AND the type we are adding
3036
+ * casting info to has not been loaded (it is in this module), THEN we
3037
+ * replace the cast->type pointer with the type pointer that has already
3038
+ * been loaded.
3039
+ * 2) If BOTH types (the one we are adding casting info to, and the
3040
+ * cast->type) are loaded, THEN the cast info has already been loaded by
3041
+ * the previous module so we just ignore it.
3042
+ * 3) Finally, if cast->type has not already been loaded, then we add that
3043
+ * swig_cast_info to the linked list (because the cast->type) pointer will
3044
+ * be correct.
3045
+ **/
3046
+
3047
+ #ifdef __cplusplus
3048
+ extern "C" {
3049
+ #endif
3050
+
3051
+ SWIGRUNTIME void
3052
+ SWIG_InitializeModule(void *clientdata) {
3053
+ swig_type_info *type, *ret;
3054
+ swig_cast_info *cast;
3055
+ size_t i;
3056
+ swig_module_info *module_head;
3057
+ static int init_run = 0;
3058
+
3059
+ clientdata = clientdata;
3060
+
3061
+ if (init_run) return;
3062
+ init_run = 1;
3063
+
3064
+ /* Initialize the swig_module */
3065
+ swig_module.type_initial = swig_type_initial;
3066
+ swig_module.cast_initial = swig_cast_initial;
3067
+
3068
+ /* Try and load any already created modules */
3069
+ module_head = SWIG_GetModule(clientdata);
3070
+ if (module_head) {
3071
+ swig_module.next = module_head->next;
3072
+ module_head->next = &swig_module;
3073
+ } else {
3074
+ /* This is the first module loaded */
3075
+ swig_module.next = &swig_module;
3076
+ SWIG_SetModule(clientdata, &swig_module);
3077
+ }
3078
+
3079
+ /* Now work on filling in swig_module.types */
3080
+ for (i = 0; i < swig_module.size; ++i) {
3081
+ type = 0;
3082
+
3083
+ /* if there is another module already loaded */
3084
+ if (swig_module.next != &swig_module) {
3085
+ type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
3086
+ }
3087
+ if (type) {
3088
+ /* Overwrite clientdata field */
3089
+ if (swig_module.type_initial[i]->clientdata) type->clientdata = swig_module.type_initial[i]->clientdata;
3090
+ } else {
3091
+ type = swig_module.type_initial[i];
3092
+ }
3093
+
3094
+ /* Insert casting types */
3095
+ cast = swig_module.cast_initial[i];
3096
+ while (cast->type) {
3097
+
3098
+ /* Don't need to add information already in the list */
3099
+ ret = 0;
3100
+ if (swig_module.next != &swig_module) {
3101
+ ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
3102
+ }
3103
+ if (ret && type == swig_module.type_initial[i]) {
3104
+ cast->type = ret;
3105
+ ret = 0;
3106
+ }
3107
+
3108
+ if (!ret) {
3109
+ if (type->cast) {
3110
+ type->cast->prev = cast;
3111
+ cast->next = type->cast;
3112
+ }
3113
+ type->cast = cast;
3114
+ }
3115
+
3116
+ cast++;
3117
+ }
3118
+
3119
+ /* Set entry in modules->types array equal to the type */
3120
+ swig_module.types[i] = type;
3121
+ }
3122
+ swig_module.types[i] = 0;
3123
+ }
3124
+
3125
+ /* This function will propagate the clientdata field of type to
3126
+ * any new swig_type_info structures that have been added into the list
3127
+ * of equivalent types. It is like calling
3128
+ * SWIG_TypeClientData(type, clientdata) a second time.
3129
+ */
3130
+ SWIGRUNTIME void
3131
+ SWIG_PropagateClientData(void) {
3132
+ size_t i;
3133
+ swig_cast_info *equiv;
3134
+ static int init_run = 0;
3135
+
3136
+ if (init_run) return;
3137
+ init_run = 1;
3138
+
3139
+ for (i = 0; i < swig_module.size; i++) {
3140
+ if (swig_module.types[i]->clientdata) {
3141
+ equiv = swig_module.types[i]->cast;
3142
+ while (equiv) {
3143
+ if (!equiv->converter) {
3144
+ if (equiv->type && !equiv->type->clientdata)
3145
+ SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
3146
+ }
3147
+ equiv = equiv->next;
3148
+ }
3149
+ }
3150
+ }
3151
+ }
3152
+
3153
+ #ifdef __cplusplus
3154
+ }
3155
+ #endif
3156
+
3157
+
3158
+ #ifdef __cplusplus
3159
+ extern "C"
3160
+ #endif
3161
+ SWIGEXPORT void Init_rubycdio(void) {
3162
+ size_t i;
3163
+
3164
+ SWIG_InitRuntime();
3165
+ mRubycdio = rb_define_module("Rubycdio");
3166
+
3167
+ SWIG_InitializeModule(0);
3168
+ for (i = 0; i < swig_module.size; i++) {
3169
+ SWIG_define_class(swig_module.types[i]);
3170
+ }
3171
+
3172
+ SWIG_RubyInitializeTrackings();
3173
+ rb_define_const(mRubycdio,"CDIO_READ_MODE_AUDIO", INT2NUM(CDIO_READ_MODE_AUDIO));
3174
+ rb_define_const(mRubycdio,"CDIO_READ_MODE_M1F1", INT2NUM(CDIO_READ_MODE_M1F1));
3175
+ rb_define_const(mRubycdio,"CDIO_READ_MODE_M1F2", INT2NUM(CDIO_READ_MODE_M1F2));
3176
+ rb_define_const(mRubycdio,"CDIO_READ_MODE_M2F1", INT2NUM(CDIO_READ_MODE_M2F1));
3177
+ rb_define_const(mRubycdio,"CDIO_READ_MODE_M2F2", INT2NUM(CDIO_READ_MODE_M2F2));
3178
+ rb_define_module_function(mRubycdio, "cdio_read_sectors", _wrap_cdio_read_sectors, -1);
3179
+ rb_define_module_function(mRubycdio, "cdio_eject_media_drive", _wrap_cdio_eject_media_drive, -1);
3180
+ rb_define_const(mRubycdio,"VERSION_NUM", INT2NUM(LIBCDIO_VERSION_NUM));
3181
+ rb_define_const(mRubycdio,"INVALID_LBA", INT2NUM(CDIO_INVALID_LBA));
3182
+ rb_define_const(mRubycdio,"INVALID_LSN", INT2NUM(CDIO_INVALID_LSN));
3183
+ rb_define_const(mRubycdio,"CD_FRAMESIZE", INT2NUM(CDIO_CD_FRAMESIZE));
3184
+ rb_define_const(mRubycdio,"CD_FRAMESIZE_RAW", INT2NUM(CDIO_CD_FRAMESIZE_RAW));
3185
+ rb_define_const(mRubycdio,"ISO_BLOCKSIZE", INT2NUM(CDIO_CD_FRAMESIZE));
3186
+ rb_define_const(mRubycdio,"M2F2_SECTOR_SIZE", INT2NUM(M2F2_SECTOR_SIZE));
3187
+ rb_define_const(mRubycdio,"M2RAW_SECTOR_SIZE", INT2NUM(M2RAW_SECTOR_SIZE));
3188
+ rb_define_module_function(mRubycdio, "audio_pause", _wrap_audio_pause, -1);
3189
+ rb_define_module_function(mRubycdio, "audio_play_lsn", _wrap_audio_play_lsn, -1);
3190
+ rb_define_module_function(mRubycdio, "audio_resume", _wrap_audio_resume, -1);
3191
+ rb_define_module_function(mRubycdio, "audio_stop", _wrap_audio_stop, -1);
3192
+ rb_define_const(mRubycdio,"READ_MODE_AUDIO", INT2NUM(CDIO_READ_MODE_AUDIO));
3193
+ rb_define_const(mRubycdio,"READ_MODE_M1F1", INT2NUM(CDIO_READ_MODE_M1F1));
3194
+ rb_define_const(mRubycdio,"READ_MODE_M1F2", INT2NUM(CDIO_READ_MODE_M1F2));
3195
+ rb_define_const(mRubycdio,"READ_MODE_M2F1", INT2NUM(CDIO_READ_MODE_M2F1));
3196
+ rb_define_const(mRubycdio,"READ_MODE_M2F2", INT2NUM(CDIO_READ_MODE_M2F2));
3197
+
3198
+ cBuf_triple_t.klass = rb_define_class_under(mRubycdio, "Buf_triple_t", rb_cObject);
3199
+ SWIG_TypeClientData(SWIGTYPE_p_Buf_triple_t, (void *) &cBuf_triple_t);
3200
+ rb_define_alloc_func(cBuf_triple_t.klass, _wrap_Buf_triple_t_allocate);
3201
+ rb_define_method(cBuf_triple_t.klass, "initialize", _wrap_new_Buf_triple_t, -1);
3202
+ rb_define_method(cBuf_triple_t.klass, "data=", _wrap_Buf_triple_t_data_set, -1);
3203
+ rb_define_method(cBuf_triple_t.klass, "data", _wrap_Buf_triple_t_data_get, -1);
3204
+ rb_define_method(cBuf_triple_t.klass, "size=", _wrap_Buf_triple_t_size_set, -1);
3205
+ rb_define_method(cBuf_triple_t.klass, "size", _wrap_Buf_triple_t_size_get, -1);
3206
+ rb_define_method(cBuf_triple_t.klass, "drc=", _wrap_Buf_triple_t_drc_set, -1);
3207
+ rb_define_method(cBuf_triple_t.klass, "drc", _wrap_Buf_triple_t_drc_get, -1);
3208
+ cBuf_triple_t.mark = 0;
3209
+ cBuf_triple_t.destroy = (void (*)(void *)) free_Buf_triple_t;
3210
+ rb_define_module_function(mRubycdio, "lseek", _wrap_lseek, -1);
3211
+ rb_define_module_function(mRubycdio, "read_cd", _wrap_read_cd, -1);
3212
+ rb_define_module_function(mRubycdio, "read_sectors", _wrap_read_sectors, -1);
3213
+ rb_define_module_function(mRubycdio, "read_data_bytes", _wrap_read_data_bytes, -1);
3214
+ rb_define_const(mRubycdio,"TRACK_FORMAT_AUDIO", INT2NUM(TRACK_FORMAT_AUDIO));
3215
+ rb_define_const(mRubycdio,"TRACK_FORMAT_CDI", INT2NUM(TRACK_FORMAT_CDI));
3216
+ rb_define_const(mRubycdio,"TRACK_FORMAT_XA", INT2NUM(TRACK_FORMAT_XA));
3217
+ rb_define_const(mRubycdio,"TRACK_FORMAT_DATA", INT2NUM(TRACK_FORMAT_DATA));
3218
+ rb_define_const(mRubycdio,"TRACK_FORMAT_PSX", INT2NUM(TRACK_FORMAT_PSX));
3219
+ rb_define_const(mRubycdio,"CDIO_TRACK_FLAG_FALSE", INT2NUM(CDIO_TRACK_FLAG_FALSE));
3220
+ rb_define_const(mRubycdio,"CDIO_TRACK_FLAG_TRUE", INT2NUM(CDIO_TRACK_FLAG_TRUE));
3221
+ rb_define_const(mRubycdio,"CDIO_TRACK_FLAG_ERROR", INT2NUM(CDIO_TRACK_FLAG_ERROR));
3222
+ rb_define_const(mRubycdio,"CDIO_TRACK_FLAG_UNKNOWN", INT2NUM(CDIO_TRACK_FLAG_UNKNOWN));
3223
+ rb_define_const(mRubycdio,"CDIO_CDROM_LBA", INT2NUM(CDIO_CDROM_LBA));
3224
+ rb_define_const(mRubycdio,"CDIO_CDROM_MSF", INT2NUM(CDIO_CDROM_MSF));
3225
+ rb_define_const(mRubycdio,"CDIO_CDROM_DATA_TRACK", INT2NUM(CDIO_CDROM_DATA_TRACK));
3226
+ rb_define_const(mRubycdio,"CDIO_CDROM_CDI_TRACK", INT2NUM(CDIO_CDROM_CDI_TRACK));
3227
+ rb_define_const(mRubycdio,"CDIO_CDROM_XA_TRACK", INT2NUM(CDIO_CDROM_XA_TRACK));
3228
+ rb_define_const(mRubycdio,"AUDIO", INT2NUM(AUDIO));
3229
+ rb_define_const(mRubycdio,"MODE1", INT2NUM(MODE1));
3230
+ rb_define_const(mRubycdio,"MODE1_RAW", INT2NUM(MODE1_RAW));
3231
+ rb_define_const(mRubycdio,"MODE2", INT2NUM(MODE2));
3232
+ rb_define_const(mRubycdio,"MODE2_FORM1", INT2NUM(MODE2_FORM1));
3233
+ rb_define_const(mRubycdio,"MODE2_FORM2", INT2NUM(MODE2_FORM2));
3234
+ rb_define_const(mRubycdio,"MODE2_FORM_MIX", INT2NUM(MODE2_FORM_MIX));
3235
+ rb_define_const(mRubycdio,"MODE2_RAW", INT2NUM(MODE2_RAW));
3236
+ rb_define_const(mRubycdio,"INVALID_TRACK", INT2NUM(CDIO_INVALID_TRACK));
3237
+ rb_define_const(mRubycdio,"CDROM_LEADOUT_TRACK", INT2NUM(0xAA));
3238
+ rb_define_module_function(mRubycdio, "get_first_track_num", _wrap_get_first_track_num, -1);
3239
+ rb_define_module_function(mRubycdio, "get_last_track_num", _wrap_get_last_track_num, -1);
3240
+ rb_define_module_function(mRubycdio, "get_track", _wrap_get_track, -1);
3241
+ rb_define_module_function(mRubycdio, "get_track_channels", _wrap_get_track_channels, -1);
3242
+ rb_define_module_function(mRubycdio, "track_copy_permit?", _wrap_track_copy_permitq___, -1);
3243
+ rb_define_module_function(mRubycdio, "get_track_format", _wrap_get_track_format, -1);
3244
+ rb_define_module_function(mRubycdio, "track_green?", _wrap_track_greenq___, -1);
3245
+ rb_define_module_function(mRubycdio, "get_track_last_lsn", _wrap_get_track_last_lsn, -1);
3246
+ rb_define_module_function(mRubycdio, "get_track_lba", _wrap_get_track_lba, -1);
3247
+ rb_define_module_function(mRubycdio, "get_track_lsn", _wrap_get_track_lsn, -1);
3248
+ rb_define_module_function(mRubycdio, "get_track_msf", _wrap_get_track_msf, -1);
3249
+ rb_define_module_function(mRubycdio, "get_track_preemphasis", _wrap_get_track_preemphasis, -1);
3250
+ rb_define_module_function(mRubycdio, "get_track_sec_count", _wrap_get_track_sec_count, -1);
3251
+ rb_define_const(mRubycdio,"DRIVE_CAP_ERROR", INT2NUM(CDIO_DRIVE_CAP_ERROR));
3252
+ rb_define_const(mRubycdio,"DRIVE_CAP_UNKNOWN", INT2NUM(CDIO_DRIVE_CAP_UNKNOWN));
3253
+ rb_define_const(mRubycdio,"DRIVE_CAP_MISC_CLOSE_TRAY", INT2NUM(CDIO_DRIVE_CAP_MISC_CLOSE_TRAY));
3254
+ rb_define_const(mRubycdio,"DRIVE_CAP_MISC_EJECT", INT2NUM(CDIO_DRIVE_CAP_MISC_EJECT));
3255
+ rb_define_const(mRubycdio,"DRIVE_CAP_MISC_LOCK", INT2NUM(CDIO_DRIVE_CAP_MISC_LOCK));
3256
+ rb_define_const(mRubycdio,"DRIVE_CAP_MISC_SELECT_SPEED", INT2NUM(CDIO_DRIVE_CAP_MISC_SELECT_SPEED));
3257
+ rb_define_const(mRubycdio,"DRIVE_CAP_MISC_SELECT_DISC", INT2NUM(CDIO_DRIVE_CAP_MISC_SELECT_DISC));
3258
+ rb_define_const(mRubycdio,"DRIVE_CAP_MISC_MULTI_SESSION", INT2NUM(CDIO_DRIVE_CAP_MISC_MULTI_SESSION));
3259
+ rb_define_const(mRubycdio,"DRIVE_CAP_MISC_MEDIA_CHANGED", INT2NUM(CDIO_DRIVE_CAP_MISC_MEDIA_CHANGED));
3260
+ rb_define_const(mRubycdio,"DRIVE_CAP_MISC_RESET", INT2NUM(CDIO_DRIVE_CAP_MISC_RESET));
3261
+ rb_define_const(mRubycdio,"DRIVE_CAP_MISC_FILE", INT2NUM(CDIO_DRIVE_CAP_MISC_FILE));
3262
+ rb_define_const(mRubycdio,"DRIVE_CAP_READ_AUDIO", INT2NUM(CDIO_DRIVE_CAP_READ_AUDIO));
3263
+ rb_define_const(mRubycdio,"DRIVE_CAP_READ_CD_DA", INT2NUM(CDIO_DRIVE_CAP_READ_CD_DA));
3264
+ rb_define_const(mRubycdio,"DRIVE_CAP_READ_CD_G", INT2NUM(CDIO_DRIVE_CAP_READ_CD_G));
3265
+ rb_define_const(mRubycdio,"DRIVE_CAP_READ_CD_R", INT2NUM(CDIO_DRIVE_CAP_READ_CD_R));
3266
+ rb_define_const(mRubycdio,"DRIVE_CAP_READ_CD_RW", INT2NUM(CDIO_DRIVE_CAP_READ_CD_RW));
3267
+ rb_define_const(mRubycdio,"DRIVE_CAP_READ_DVD_R", INT2NUM(CDIO_DRIVE_CAP_READ_DVD_R));
3268
+ rb_define_const(mRubycdio,"DRIVE_CAP_READ_DVD_PR", INT2NUM(CDIO_DRIVE_CAP_READ_DVD_PR));
3269
+ rb_define_const(mRubycdio,"DRIVE_CAP_READ_DVD_RAM", INT2NUM(CDIO_DRIVE_CAP_READ_DVD_RAM));
3270
+ rb_define_const(mRubycdio,"DRIVE_CAP_READ_DVD_ROM", INT2NUM(CDIO_DRIVE_CAP_READ_DVD_ROM));
3271
+ rb_define_const(mRubycdio,"DRIVE_CAP_READ_DVD_RW", INT2NUM(CDIO_DRIVE_CAP_READ_DVD_RW));
3272
+ rb_define_const(mRubycdio,"DRIVE_CAP_READ_DVD_RPW", INT2NUM(CDIO_DRIVE_CAP_READ_DVD_RPW));
3273
+ rb_define_const(mRubycdio,"DRIVE_CAP_READ_C2_ERRS", INT2NUM(CDIO_DRIVE_CAP_READ_C2_ERRS));
3274
+ rb_define_const(mRubycdio,"DRIVE_CAP_READ_MODE2_FORM1", INT2NUM(CDIO_DRIVE_CAP_READ_MODE2_FORM1));
3275
+ rb_define_const(mRubycdio,"DRIVE_CAP_READ_MODE2_FORM2", INT2NUM(CDIO_DRIVE_CAP_READ_MODE2_FORM2));
3276
+ rb_define_const(mRubycdio,"DRIVE_CAP_READ_MCN", INT2NUM(CDIO_DRIVE_CAP_READ_MCN));
3277
+ rb_define_const(mRubycdio,"DRIVE_CAP_READ_ISRC", INT2NUM(CDIO_DRIVE_CAP_READ_ISRC));
3278
+ rb_define_const(mRubycdio,"DRIVE_CAP_WRITE_CD_R", INT2NUM(CDIO_DRIVE_CAP_WRITE_CD_R));
3279
+ rb_define_const(mRubycdio,"DRIVE_CAP_WRITE_CD_RW", INT2NUM(CDIO_DRIVE_CAP_WRITE_CD_RW));
3280
+ rb_define_const(mRubycdio,"DRIVE_CAP_WRITE_DVD_R", INT2NUM(CDIO_DRIVE_CAP_WRITE_DVD_R));
3281
+ rb_define_const(mRubycdio,"DRIVE_CAP_WRITE_DVD_PR", INT2NUM(CDIO_DRIVE_CAP_WRITE_DVD_PR));
3282
+ rb_define_const(mRubycdio,"DRIVE_CAP_WRITE_DVD_RAM", INT2NUM(CDIO_DRIVE_CAP_WRITE_DVD_RAM));
3283
+ rb_define_const(mRubycdio,"DRIVE_CAP_WRITE_DVD_RW", INT2NUM(CDIO_DRIVE_CAP_WRITE_DVD_RW));
3284
+ rb_define_const(mRubycdio,"DRIVE_CAP_WRITE_DVD_RPW", INT2NUM(CDIO_DRIVE_CAP_WRITE_DVD_RPW));
3285
+ rb_define_const(mRubycdio,"DRIVE_CAP_WRITE_MT_RAINIER", INT2NUM(CDIO_DRIVE_CAP_WRITE_MT_RAINIER));
3286
+ rb_define_const(mRubycdio,"DRIVE_CAP_WRITE_BURN_PROOF", INT2NUM(CDIO_DRIVE_CAP_WRITE_BURN_PROOF));
3287
+ rb_define_const(mRubycdio,"DRIVE_CAP_WRITE_CD", INT2NUM(CDIO_DRIVE_CAP_WRITE_CD));
3288
+ rb_define_const(mRubycdio,"DRIVE_CAP_WRITE_DVD", INT2NUM(CDIO_DRIVE_CAP_WRITE_DVD));
3289
+ rb_define_const(mRubycdio,"DRIVE_CAP_WRITE", INT2NUM(CDIO_DRIVE_CAP_WRITE));
3290
+ rb_define_const(mRubycdio,"MMC_HW_VENDOR_LEN", INT2NUM(CDIO_MMC_HW_VENDOR_LEN));
3291
+ rb_define_const(mRubycdio,"MMC_HW_MODEL_LEN", INT2NUM(CDIO_MMC_HW_MODEL_LEN));
3292
+ rb_define_const(mRubycdio,"MMC_HW_REVISION_LEN", INT2NUM(CDIO_MMC_HW_REVISION_LEN));
3293
+ rb_define_const(mRubycdio,"SRC_IS_DISK_IMAGE_MASK", INT2NUM(CDIO_SRC_IS_DISK_IMAGE_MASK));
3294
+ rb_define_const(mRubycdio,"SRC_IS_DEVICE_MASK", INT2NUM(CDIO_SRC_IS_DEVICE_MASK));
3295
+ rb_define_const(mRubycdio,"SRC_IS_SCSI_MASK", INT2NUM(CDIO_SRC_IS_SCSI_MASK));
3296
+ rb_define_const(mRubycdio,"SRC_IS_NATIVE_MASK", INT2NUM(CDIO_SRC_IS_NATIVE_MASK));
3297
+ rb_define_const(mRubycdio,"DRIVER_UNKNOWN", INT2NUM(DRIVER_UNKNOWN));
3298
+ rb_define_const(mRubycdio,"DRIVER_AIX", INT2NUM(DRIVER_AIX));
3299
+ rb_define_const(mRubycdio,"DRIVER_BSDI", INT2NUM(DRIVER_BSDI));
3300
+ rb_define_const(mRubycdio,"DRIVER_FREEBSD", INT2NUM(DRIVER_FREEBSD));
3301
+ rb_define_const(mRubycdio,"DRIVER_LINUX", INT2NUM(DRIVER_LINUX));
3302
+ rb_define_const(mRubycdio,"DRIVER_SOLARIS", INT2NUM(DRIVER_SOLARIS));
3303
+ rb_define_const(mRubycdio,"DRIVER_OSX", INT2NUM(DRIVER_OSX));
3304
+ rb_define_const(mRubycdio,"DRIVER_WIN32", INT2NUM(DRIVER_WIN32));
3305
+ rb_define_const(mRubycdio,"DRIVER_CDRDAO", INT2NUM(DRIVER_CDRDAO));
3306
+ rb_define_const(mRubycdio,"DRIVER_BINCUE", INT2NUM(DRIVER_BINCUE));
3307
+ rb_define_const(mRubycdio,"DRIVER_NRG", INT2NUM(DRIVER_NRG));
3308
+ rb_define_const(mRubycdio,"DRIVER_DEVICE", INT2NUM(DRIVER_DEVICE));
3309
+ rb_define_const(mRubycdio,"MIN_DRIVER", INT2NUM(CDIO_MIN_DRIVER));
3310
+ rb_define_const(mRubycdio,"MIN_DEVICE_DRIVER", INT2NUM(CDIO_MIN_DEVICE_DRIVER));
3311
+ rb_define_const(mRubycdio,"MAX_DRIVER", INT2NUM(CDIO_MAX_DRIVER));
3312
+ rb_define_const(mRubycdio,"MAX_DEVICE_DRIVER", INT2NUM(CDIO_MAX_DEVICE_DRIVER));
3313
+ rb_define_const(mRubycdio,"DRIVER_OP_SUCCESS", INT2NUM(DRIVER_OP_SUCCESS));
3314
+ rb_define_const(mRubycdio,"DRIVER_OP_ERROR", INT2NUM(DRIVER_OP_ERROR));
3315
+ rb_define_const(mRubycdio,"DRIVER_OP_UNSUPPORTED", INT2NUM(DRIVER_OP_UNSUPPORTED));
3316
+ rb_define_const(mRubycdio,"DRIVER_OP_UNINIT", INT2NUM(DRIVER_OP_UNINIT));
3317
+ rb_define_const(mRubycdio,"DRIVER_OP_NOT_PERMITTED", INT2NUM(DRIVER_OP_NOT_PERMITTED));
3318
+ rb_define_const(mRubycdio,"DRIVER_OP_BAD_PARAMETER", INT2NUM(DRIVER_OP_BAD_PARAMETER));
3319
+ rb_define_const(mRubycdio,"DRIVER_OP_BAD_POINTER", INT2NUM(DRIVER_OP_BAD_POINTER));
3320
+ rb_define_const(mRubycdio,"DRIVER_OP_NO_DRIVER", INT2NUM(DRIVER_OP_NO_DRIVER));
3321
+ rb_define_const(mRubycdio,"FS_AUDIO", UINT2NUM(CDIO_FS_AUDIO));
3322
+ rb_define_const(mRubycdio,"FS_HIGH_SIERRA", UINT2NUM(CDIO_FS_HIGH_SIERRA));
3323
+ rb_define_const(mRubycdio,"FS_ISO_9660", UINT2NUM(CDIO_FS_ISO_9660));
3324
+ rb_define_const(mRubycdio,"FS_INTERACTIVE", UINT2NUM(CDIO_FS_INTERACTIVE));
3325
+ rb_define_const(mRubycdio,"FS_HFS", UINT2NUM(CDIO_FS_HFS));
3326
+ rb_define_const(mRubycdio,"FS_UFS", UINT2NUM(CDIO_FS_UFS));
3327
+ rb_define_const(mRubycdio,"FS_EXT2", UINT2NUM(CDIO_FS_EXT2));
3328
+ rb_define_const(mRubycdio,"FS_ISO_HFS", UINT2NUM(CDIO_FS_ISO_HFS));
3329
+ rb_define_const(mRubycdio,"FS_ISO_9660_INTERACTIVE", UINT2NUM(CDIO_FS_ISO_9660_INTERACTIVE));
3330
+ rb_define_const(mRubycdio,"FS_3DO", UINT2NUM(CDIO_FS_3DO));
3331
+ rb_define_const(mRubycdio,"FS_XISO", UINT2NUM(CDIO_FS_XISO));
3332
+ rb_define_const(mRubycdio,"FS_UDFX", UINT2NUM(CDIO_FS_UDFX));
3333
+ rb_define_const(mRubycdio,"FS_UDF", UINT2NUM(CDIO_FS_UDF));
3334
+ rb_define_const(mRubycdio,"FS_ISO_UDF", UINT2NUM(CDIO_FS_ISO_UDF));
3335
+ rb_define_const(mRubycdio,"FS_ANAL_XA", UINT2NUM(CDIO_FS_ANAL_XA));
3336
+ rb_define_const(mRubycdio,"FS_ANAL_MULTISESSION", UINT2NUM(CDIO_FS_ANAL_MULTISESSION));
3337
+ rb_define_const(mRubycdio,"FS_ANAL_PHOTO_CD", UINT2NUM(CDIO_FS_ANAL_PHOTO_CD));
3338
+ rb_define_const(mRubycdio,"FS_ANAL_HIDDEN_TRACK", UINT2NUM(CDIO_FS_ANAL_HIDDEN_TRACK));
3339
+ rb_define_const(mRubycdio,"FS_ANAL_CDTV", UINT2NUM(CDIO_FS_ANAL_CDTV));
3340
+ rb_define_const(mRubycdio,"FS_ANAL_BOOTABLE", UINT2NUM(CDIO_FS_ANAL_BOOTABLE));
3341
+ rb_define_const(mRubycdio,"FS_ANAL_VIDEOCD", UINT2NUM(CDIO_FS_ANAL_VIDEOCD));
3342
+ rb_define_const(mRubycdio,"FS_ANAL_ROCKRIDGE", UINT2NUM(CDIO_FS_ANAL_ROCKRIDGE));
3343
+ rb_define_const(mRubycdio,"FS_ANAL_JOLIET", UINT2NUM(CDIO_FS_ANAL_JOLIET));
3344
+ rb_define_const(mRubycdio,"FS_ANAL_SVCD", UINT2NUM(CDIO_FS_ANAL_SVCD));
3345
+ rb_define_const(mRubycdio,"FS_ANAL_CVD", UINT2NUM(CDIO_FS_ANAL_CVD));
3346
+ rb_define_const(mRubycdio,"FS_ANAL_XISO", UINT2NUM(CDIO_FS_ANAL_XISO));
3347
+ rb_define_const(mRubycdio,"FS_MATCH_ALL", UINT2NUM(CDIO_FS_MATCH_ALL));
3348
+ rb_define_const(mRubycdio,"FS_UNKNOWN", UINT2NUM(CDIO_FS_UNKNOWN));
3349
+ rb_define_module_function(mRubycdio, "close_tray", _wrap_close_tray, -1);
3350
+ rb_define_module_function(mRubycdio, "close", _wrap_close, -1);
3351
+ rb_define_module_function(mRubycdio, "driver_errmsg", _wrap_driver_errmsg, -1);
3352
+ rb_define_module_function(mRubycdio, "eject_media", _wrap_eject_media, -1);
3353
+ rb_define_module_function(mRubycdio, "eject_media_drive", _wrap_eject_media_drive, -1);
3354
+ rb_define_module_function(mRubycdio, "get_arg", _wrap_get_arg, -1);
3355
+ rb_define_module_function(mRubycdio, "get_device", _wrap_get_device, -1);
3356
+ rb_define_module_function(mRubycdio, "get_default_device_driver", _wrap_get_default_device_driver, -1);
3357
+ rb_define_module_function(mRubycdio, "get_devices", _wrap_get_devices, -1);
3358
+ rb_define_module_function(mRubycdio, "get_devices_ret", _wrap_get_devices_ret, -1);
3359
+ rb_define_module_function(mRubycdio, "get_devices_with_cap", _wrap_get_devices_with_cap, -1);
3360
+ rb_define_module_function(mRubycdio, "get_devices_with_cap_ret", _wrap_get_devices_with_cap_ret, -1);
3361
+ rb_define_module_function(mRubycdio, "get_drive_cap", _wrap_get_drive_cap, -1);
3362
+ rb_define_module_function(mRubycdio, "get_driver_name", _wrap_get_driver_name, -1);
3363
+ rb_define_module_function(mRubycdio, "get_driver_id", _wrap_get_driver_id, -1);
3364
+ rb_define_module_function(mRubycdio, "get_last_session", _wrap_get_last_session, -1);
3365
+ rb_define_module_function(mRubycdio, "have_driver", _wrap_have_driver, -1);
3366
+ rb_define_module_function(mRubycdio, "ATAPI?", _wrap_ATAPIq___, -1);
3367
+ rb_define_module_function(mRubycdio, "is_binfile", _wrap_is_binfile, -1);
3368
+ rb_define_module_function(mRubycdio, "is_cuefile", _wrap_is_cuefile, -1);
3369
+ rb_define_module_function(mRubycdio, "cdio_is_device", _wrap_cdio_is_device, -1);
3370
+ rb_define_module_function(mRubycdio, "device?", _wrap_deviceq___, -1);
3371
+ rb_define_module_function(mRubycdio, "nrg?", _wrap_nrgq___, -1);
3372
+ rb_define_module_function(mRubycdio, "tocfile?", _wrap_tocfileq___, -1);
3373
+ rb_define_module_function(mRubycdio, "get_media_changed", _wrap_get_media_changed, -1);
3374
+
3375
+ cHWInfo_t.klass = rb_define_class_under(mRubycdio, "HWInfo_t", rb_cObject);
3376
+ SWIG_TypeClientData(SWIGTYPE_p_HWInfo_t, (void *) &cHWInfo_t);
3377
+ rb_define_alloc_func(cHWInfo_t.klass, _wrap_HWInfo_t_allocate);
3378
+ rb_define_method(cHWInfo_t.klass, "initialize", _wrap_new_HWInfo_t, -1);
3379
+ rb_define_method(cHWInfo_t.klass, "hw=", _wrap_HWInfo_t_hw_set, -1);
3380
+ rb_define_method(cHWInfo_t.klass, "hw", _wrap_HWInfo_t_hw_get, -1);
3381
+ rb_define_method(cHWInfo_t.klass, "result=", _wrap_HWInfo_t_result_set, -1);
3382
+ rb_define_method(cHWInfo_t.klass, "result", _wrap_HWInfo_t_result_get, -1);
3383
+ cHWInfo_t.mark = 0;
3384
+ cHWInfo_t.destroy = (void (*)(void *)) free_HWInfo_t;
3385
+ rb_define_module_function(mRubycdio, "get_hwinfo", _wrap_get_hwinfo, -1);
3386
+ rb_define_module_function(mRubycdio, "set_blocksize", _wrap_set_blocksize, -1);
3387
+ rb_define_module_function(mRubycdio, "set_speed", _wrap_set_speed, -1);
3388
+ rb_define_module_function(mRubycdio, "open_cd", _wrap_open_cd, -1);
3389
+ rb_define_const(mRubycdio,"DISC_MODE_CD_DA", INT2NUM(CDIO_DISC_MODE_CD_DA));
3390
+ rb_define_const(mRubycdio,"DISC_MODE_CD_DATA", INT2NUM(CDIO_DISC_MODE_CD_DATA));
3391
+ rb_define_const(mRubycdio,"DISC_MODE_CD_XA", INT2NUM(CDIO_DISC_MODE_CD_XA));
3392
+ rb_define_const(mRubycdio,"DISC_MODE_CD_MIXED", INT2NUM(CDIO_DISC_MODE_CD_MIXED));
3393
+ rb_define_const(mRubycdio,"DISC_MODE_DVD_ROM", INT2NUM(CDIO_DISC_MODE_DVD_ROM));
3394
+ rb_define_const(mRubycdio,"DISC_MODE_DVD_RAM", INT2NUM(CDIO_DISC_MODE_DVD_RAM));
3395
+ rb_define_const(mRubycdio,"DISC_MODE_DVD_R", INT2NUM(CDIO_DISC_MODE_DVD_R));
3396
+ rb_define_const(mRubycdio,"DISC_MODE_DVD_RW", INT2NUM(CDIO_DISC_MODE_DVD_RW));
3397
+ rb_define_const(mRubycdio,"DISC_MODE_DVD_PR", INT2NUM(CDIO_DISC_MODE_DVD_PR));
3398
+ rb_define_const(mRubycdio,"DISC_MODE_DVD_PRW", INT2NUM(CDIO_DISC_MODE_DVD_PRW));
3399
+ rb_define_const(mRubycdio,"DISC_MODE_DVD_OTHER", INT2NUM(CDIO_DISC_MODE_DVD_OTHER));
3400
+ rb_define_const(mRubycdio,"DISC_MODE_NO_INFO", INT2NUM(CDIO_DISC_MODE_NO_INFO));
3401
+ rb_define_const(mRubycdio,"DISC_MODE_ERROR", INT2NUM(CDIO_DISC_MODE_ERROR));
3402
+ rb_define_const(mRubycdio,"DISC_MODE_CD_I", INT2NUM(CDIO_DISC_MODE_CD_I));
3403
+ rb_define_module_function(mRubycdio, "get_disc_last_lsn", _wrap_get_disc_last_lsn, -1);
3404
+ rb_define_module_function(mRubycdio, "get_disc_mode", _wrap_get_disc_mode, -1);
3405
+ rb_define_module_function(mRubycdio, "get_joliet_level", _wrap_get_joliet_level, -1);
3406
+ rb_define_module_function(mRubycdio, "get_mcn", _wrap_get_mcn, -1);
3407
+ rb_define_module_function(mRubycdio, "get_num_tracks", _wrap_get_num_tracks, -1);
3408
+ rb_define_const(mRubycdio,"INCLUDE_CLASS", INT2NUM(0));
3409
+ }
3410
+