ext/cdio/rubycdio_wrap.c in rbcdio-0.02 vs ext/cdio/rubycdio_wrap.c in rbcdio-0.03

- old
+ new

@@ -1,8 +1,8 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 1.3.31 + * Version 1.3.33 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make * changes to this file unless you know what you are doing--modify the SWIG * interface file instead. @@ -14,18 +14,18 @@ * declarations/attributes, and other compiler dependent labels. * ----------------------------------------------------------------------------- */ /* template workaround for compilers that cannot correctly implement the C++ standard */ #ifndef SWIGTEMPLATEDISAMBIGUATOR -# if defined(__SUNPRO_CC) -# if (__SUNPRO_CC <= 0x560) -# define SWIGTEMPLATEDISAMBIGUATOR template -# else -# define SWIGTEMPLATEDISAMBIGUATOR -# endif +# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) +# define SWIGTEMPLATEDISAMBIGUATOR template +# elif defined(__HP_aCC) +/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ +/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ +# define SWIGTEMPLATEDISAMBIGUATOR template # else -# define SWIGTEMPLATEDISAMBIGUATOR +# define SWIGTEMPLATEDISAMBIGUATOR # endif #endif /* inline attribute */ #ifndef SWIGINLINE @@ -104,25 +104,31 @@ /* Deal with Microsoft's attempt at deprecating C standard runtime functions */ #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) # define _CRT_SECURE_NO_DEPRECATE #endif +/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ +#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) +# define _SCL_SECURE_NO_DEPRECATE +#endif + + /* ----------------------------------------------------------------------------- * This section contains generic SWIG labels for method/variable * declarations/attributes, and other compiler dependent labels. * ----------------------------------------------------------------------------- */ /* template workaround for compilers that cannot correctly implement the C++ standard */ #ifndef SWIGTEMPLATEDISAMBIGUATOR -# if defined(__SUNPRO_CC) -# if (__SUNPRO_CC <= 0x560) -# define SWIGTEMPLATEDISAMBIGUATOR template -# else -# define SWIGTEMPLATEDISAMBIGUATOR -# endif +# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) +# define SWIGTEMPLATEDISAMBIGUATOR template +# elif defined(__HP_aCC) +/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ +/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ +# define SWIGTEMPLATEDISAMBIGUATOR template # else -# define SWIGTEMPLATEDISAMBIGUATOR +# define SWIGTEMPLATEDISAMBIGUATOR # endif #endif /* inline attribute */ #ifndef SWIGINLINE @@ -201,10 +207,16 @@ /* Deal with Microsoft's attempt at deprecating C standard runtime functions */ #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) # define _CRT_SECURE_NO_DEPRECATE #endif +/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ +#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) +# define _SCL_SECURE_NO_DEPRECATE +#endif + + /* ----------------------------------------------------------------------------- * swigrun.swg * * This file contains generic CAPI SWIG runtime support for pointer * type checking. @@ -433,11 +445,11 @@ for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) { while ((*f1 == ' ') && (f1 != l1)) ++f1; while ((*f2 == ' ') && (f2 != l2)) ++f2; if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1; } - return (l1 - f1) - (l2 - f2); + return (int)((l1 - f1) - (l2 - f2)); } /* Check type equivalence in a name list like <name1>|<name2>|... Return 0 if not equal, 1 if equal @@ -789,10 +801,19 @@ #include <ruby.h> +/* Remove global macros defined in Ruby's win32.h */ +#ifdef write +# undef write +#endif +#ifdef read +# undef read +#endif + + /* Ruby 1.7 defines NUM2LL(), LL2NUM() and ULL2NUM() macros */ #ifndef NUM2LL #define NUM2LL(x) NUM2LONG((x)) #endif #ifndef LL2NUM @@ -884,10 +905,11 @@ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC #define rb_define_alloc_func(klass, func) rb_define_singleton_method((klass), "new", VALUEFUNC((func)), -1) #define rb_undef_alloc_func(klass) rb_undef_method(CLASS_OF((klass)), "new") #endif +static VALUE _mSWIG = Qnil; /* ----------------------------------------------------------------------------- * error manipulation * ----------------------------------------------------------------------------- */ @@ -974,12 +996,76 @@ } return type; } +/* This function is called when a user inputs a wrong argument to + a method. + */ +SWIGINTERN +const char* Ruby_Format_TypeError( const char* msg, + const char* type, + const char* name, + const int argn, + VALUE input ) +{ + char buf[128]; + VALUE str; + VALUE asStr; + if ( msg && *msg ) + { + str = rb_str_new2(msg); + } + else + { + str = rb_str_new(NULL, 0); + } + str = rb_str_cat2( str, "Expected argument " ); + sprintf( buf, "%d of type ", argn-1 ); + str = rb_str_cat2( str, buf ); + str = rb_str_cat2( str, type ); + str = rb_str_cat2( str, ", but got " ); + str = rb_str_cat2( str, rb_obj_classname(input) ); + str = rb_str_cat2( str, " " ); + asStr = rb_inspect(input); + if ( RSTRING_LEN(asStr) > 30 ) + { + str = rb_str_cat( str, StringValuePtr(asStr), 30 ); + str = rb_str_cat2( str, "..." ); + } + else + { + str = rb_str_append( str, asStr ); + } + if ( name ) + { + str = rb_str_cat2( str, "\n\tin SWIG method '" ); + str = rb_str_cat2( str, name ); + str = rb_str_cat2( str, "'" ); + } + + return StringValuePtr( str ); +} + +/* This function is called when an overloaded method fails */ +SWIGINTERN +void Ruby_Format_OverloadedError( + const int argc, + const int maxargs, + const char* method, + const char* prototypes + ) +{ + const char* msg = "Wrong # of arguments"; + if ( argc <= maxargs ) msg = "Wrong arguments"; + rb_raise(rb_eArgError,"%s for overloaded method '%s'.\n" + "Possible C/C++ prototypes are:\n%s", + msg, method, prototypes); +} + /* ----------------------------------------------------------------------------- * See the LICENSE file for information on copyright, usage and redistribution * of SWIG, and the README file for authors - http://www.swig.org/release.html. * * rubytracking.swg @@ -992,62 +1078,87 @@ #ifdef __cplusplus extern "C" { #endif +/* Ruby 1.8 actually assumes the first case. */ +#if SIZEOF_VOIDP == SIZEOF_LONG +# define SWIG2NUM(v) LONG2NUM((unsigned long)v) +# define NUM2SWIG(x) (unsigned long)NUM2LONG(x) +#elif SIZEOF_VOIDP == SIZEOF_LONG_LONG +# define SWIG2NUM(v) LL2NUM((unsigned long long)v) +# define NUM2SWIG(x) (unsigned long long)NUM2LL(x) +#else +# error sizeof(void*) is not the same as long or long long +#endif + /* Global Ruby hash table to store Trackings from C/C++ - structs to Ruby Objects. */ -static VALUE swig_ruby_trackings; - -/* Global variable that stores a reference to the ruby - hash table delete function. */ -static ID swig_ruby_hash_delete = 0; + structs to Ruby Objects. +*/ +static VALUE swig_ruby_trackings = Qnil; +/* Global variable that stores a reference to the ruby + hash table delete function. */ +static ID swig_ruby_hash_delete; + /* Setup a Ruby hash table to store Trackings */ SWIGRUNTIME void SWIG_RubyInitializeTrackings(void) { /* Create a ruby hash table to store Trackings from C++ - objects to Ruby objects. Also make sure to tell - the garabage collector about the hash table. */ - swig_ruby_trackings = rb_hash_new(); - rb_gc_register_address(&swig_ruby_trackings); - - /* Now store a reference to the hash table delete function - so that we only have to look it up once.*/ - swig_ruby_hash_delete = rb_intern("delete"); + objects to Ruby objects. */ + + /* Try to see if some other .so has already created a + tracking hash table, which we keep hidden in an instance var + in the SWIG module. + This is done to allow multiple DSOs to share the same + tracking table. + */ + ID trackings_id = rb_intern( "@__trackings__" ); + VALUE verbose = rb_gv_get("VERBOSE"); + rb_gv_set("VERBOSE", Qfalse); + swig_ruby_trackings = rb_ivar_get( _mSWIG, trackings_id ); + rb_gv_set("VERBOSE", verbose); + + /* No, it hasn't. Create one ourselves */ + if ( swig_ruby_trackings == Qnil ) + { + swig_ruby_trackings = rb_hash_new(); + rb_ivar_set( _mSWIG, trackings_id, swig_ruby_trackings ); + } + + /* Now store a reference to the hash table delete function + so that we only have to look it up once.*/ + swig_ruby_hash_delete = rb_intern("delete"); } /* Get a Ruby number to reference a pointer */ SWIGRUNTIME VALUE SWIG_RubyPtrToReference(void* ptr) { /* We cast the pointer to an unsigned long and then store a reference to it using a Ruby number object. */ /* Convert the pointer to a Ruby number */ - unsigned long value = (unsigned long) ptr; - return LONG2NUM(value); + return SWIG2NUM(ptr); } /* Get a Ruby number to reference an object */ SWIGRUNTIME VALUE SWIG_RubyObjectToReference(VALUE object) { /* We cast the object to an unsigned long and then store a reference to it using a Ruby number object. */ /* Convert the Object to a Ruby number */ - unsigned long value = (unsigned long) object; - return LONG2NUM(value); + return SWIG2NUM(object); } /* Get a Ruby object from a previously stored reference */ SWIGRUNTIME VALUE SWIG_RubyReferenceToObject(VALUE reference) { /* The provided Ruby number object is a reference to the Ruby object we want.*/ - /* First convert the Ruby number to a C number */ - unsigned long value = NUM2LONG(reference); - return (VALUE) value; + /* Convert the Ruby number to a Ruby object */ + return NUM2SWIG(reference); } /* Add a Tracking from a C/C++ struct to a Ruby object */ SWIGRUNTIME void SWIG_RubyAddTracking(void* ptr, VALUE object) { /* In a Ruby hash table we store the pointer and @@ -1135,10 +1246,19 @@ rb_ary_push(target, o); } return target; } +/* For ruby1.8.4 and earlier. */ +#ifndef RUBY_INIT_STACK + RUBY_EXTERN void Init_stack(VALUE* addr); +# define RUBY_INIT_STACK \ + VALUE variable_in_this_stack_frame; \ + Init_stack(&variable_in_this_stack_frame); +#endif + + #ifdef __cplusplus } #endif @@ -1206,28 +1326,59 @@ * pointers/data manipulation * ----------------------------------------------------------------------------- */ #ifdef __cplusplus extern "C" { -#if 0 -} /* cc-mode */ #endif -#endif typedef struct { VALUE klass; VALUE mImpl; void (*mark)(void *); void (*destroy)(void *); int trackObjects; } swig_class; -static VALUE _mSWIG = Qnil; +/* Global pointer used to keep some internal SWIG stuff */ static VALUE _cSWIG_Pointer = Qnil; static VALUE swig_runtime_data_type_pointer = Qnil; +/* Global IDs used to keep some internal SWIG stuff */ +static ID swig_arity_id = 0; +static ID swig_call_id = 0; + +/* + If your swig extension is to be run within an embedded ruby and has + director callbacks, you should set -DRUBY_EMBEDDED during compilation. + This will reset ruby's stack frame on each entry point from the main + program the first time a virtual director function is invoked (in a + non-recursive way). + If this is not done, you run the risk of Ruby trashing the stack. +*/ + +#ifdef RUBY_EMBEDDED + +# define SWIG_INIT_STACK \ + if ( !swig_virtual_calls ) { RUBY_INIT_STACK } \ + ++swig_virtual_calls; +# define SWIG_RELEASE_STACK --swig_virtual_calls; +# define Ruby_DirectorTypeMismatchException(x) \ + rb_raise( rb_eTypeError, x ); return c_result; + + static unsigned int swig_virtual_calls = 0; + +#else /* normal non-embedded extension */ + +# define SWIG_INIT_STACK +# define SWIG_RELEASE_STACK +# define Ruby_DirectorTypeMismatchException(x) \ + throw Swig::DirectorTypeMismatchException( x ); + +#endif /* RUBY_EMBEDDED */ + + SWIGRUNTIME VALUE getExceptionClass(void) { static int init = 0; static VALUE rubyExceptionClass ; if (!init) { @@ -1255,10 +1406,12 @@ SWIGRUNTIME void SWIG_Ruby_InitRuntime(void) { if (_mSWIG == Qnil) { _mSWIG = rb_define_module("SWIG"); + swig_call_id = rb_intern("call"); + swig_arity_id = rb_intern("arity"); } } /* Define Ruby class for C type */ SWIGRUNTIME void @@ -1278,11 +1431,11 @@ /* Create a new pointer object */ SWIGRUNTIME VALUE SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags) { int own = flags & SWIG_POINTER_OWN; - + int track; char *klass_name; swig_class *sklass; VALUE klass; VALUE obj; @@ -1291,41 +1444,45 @@ if (type->clientdata) { sklass = (swig_class *) type->clientdata; /* Are we tracking this class and have we already returned this Ruby object? */ - if (sklass->trackObjects) { + track = sklass->trackObjects; + if (track) { obj = SWIG_RubyInstanceFor(ptr); /* Check the object's type and make sure it has the correct type. It might not in cases where methods do things like downcast methods. */ if (obj != Qnil) { - VALUE value = rb_iv_get(obj, "__swigtype__"); + VALUE value = rb_iv_get(obj, "@__swigtype__"); char* type_name = RSTRING_PTR(value); if (strcmp(type->name, type_name) == 0) { return obj; } } } /* Create a new Ruby object */ - obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark), (own ? VOIDFUNC(sklass->destroy) : 0), ptr); + obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark), + ( own ? VOIDFUNC(sklass->destroy) : + (track ? VOIDFUNC(SWIG_RubyRemoveTracking) : 0 ) + ), ptr); /* If tracking is on for this class then track this object. */ - if (sklass->trackObjects) { + if (track) { SWIG_RubyAddTracking(ptr, obj); } } else { klass_name = (char *) malloc(4 + strlen(type->name) + 1); sprintf(klass_name, "TYPE%s", type->name); klass = rb_const_get(_mSWIG, rb_intern(klass_name)); free((void *) klass_name); obj = Data_Wrap_Struct(klass, 0, 0, ptr); } - rb_iv_set(obj, "__swigtype__", rb_str_new2(type->name)); + rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name)); return obj; } /* Create a new class instance (always owned) */ @@ -1333,19 +1490,19 @@ SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type) { VALUE obj; swig_class *sklass = (swig_class *) type->clientdata; obj = Data_Wrap_Struct(klass, VOIDFUNC(sklass->mark), VOIDFUNC(sklass->destroy), 0); - rb_iv_set(obj, "__swigtype__", rb_str_new2(type->name)); + rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name)); return obj; } /* Get type mangle from class name */ SWIGRUNTIMEINLINE char * SWIG_Ruby_MangleStr(VALUE obj) { - VALUE stype = rb_iv_get(obj, "__swigtype__"); + VALUE stype = rb_iv_get(obj, "@__swigtype__"); return StringValuePtr(stype); } /* Acquire a pointer value */ typedef void (*ruby_owntype)(void*); @@ -1505,14 +1662,46 @@ /* create and store the structure pointer to a global variable */ swig_runtime_data_type_pointer = Data_Wrap_Struct(cl, 0, 0, pointer); rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer); } +/* This function can be used to check whether a proc or method or similarly + callable function has been passed. Usually used in a %typecheck, like: + + %typecheck(c_callback_t, precedence=SWIG_TYPECHECK_POINTER) { + $result = SWIG_Ruby_isCallable( $input ); + } + */ +SWIGINTERN +int SWIG_Ruby_isCallable( VALUE proc ) +{ + if ( rb_respond_to( proc, swig_call_id ) == Qtrue ) + return 1; + return 0; +} + +/* This function can be used to check the arity (number of arguments) + a proc or method can take. Usually used in a %typecheck. + Valid arities will be that equal to minimal or those < 0 + which indicate a variable number of parameters at the end. + */ +SWIGINTERN +int SWIG_Ruby_arity( VALUE proc, int minimal ) +{ + if ( rb_respond_to( proc, swig_arity_id ) == Qtrue ) + { + VALUE num = rb_funcall( proc, swig_arity_id, 0 ); + int arity = NUM2INT(num); + if ( arity < 0 && (arity+1) < -minimal ) return 1; + if ( arity == minimal ) return 1; + return 1; + } + return 0; +} + + #ifdef __cplusplus -#if 0 -{ /* cc-mode */ -#endif } #endif @@ -1544,11 +1733,15 @@ #define SWIG_init Init_rubycdio #define SWIG_name "Rubycdio" static VALUE mRubycdio; -#define SWIGVERSION 0x010331 +#define SWIG_RUBY_THREAD_BEGIN_BLOCK +#define SWIG_RUBY_THREAD_END_BLOCK + + +#define SWIGVERSION 0x010333 #define SWIG_VERSION SWIGVERSION #define SWIG_as_voidptr(a) (void *)((const void *)(a)) #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a)) @@ -1644,19 +1837,17 @@ } #endif /* LIBCDIO_VERSION_NUM <= 76 */ #include <limits.h> -#ifndef LLONG_MIN -# define LLONG_MIN LONG_LONG_MIN +#if !defined(SWIG_NO_LLONG_MAX) +# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__) +# define LLONG_MAX __LONG_LONG_MAX__ +# define LLONG_MIN (-LLONG_MAX - 1LL) +# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL) +# endif #endif -#ifndef LLONG_MAX -# define LLONG_MAX LONG_LONG_MAX -#endif -#ifndef ULLONG_MAX -# define ULLONG_MAX ULONG_LONG_MAX -#endif #define SWIG_From_long LONG2NUM @@ -1672,11 +1863,11 @@ { return Qnil; } -/*@SWIG:%ruby_aux_method@*/ +/*@SWIG:/usr/share/swig1.3/ruby/rubyprimtypes.swg,23,%ruby_aux_method@*/ SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args) { VALUE obj = args[0]; VALUE type = TYPE(obj); long *res = (long *)(args[1]); @@ -1717,11 +1908,11 @@ } return res; } -/*@SWIG:%ruby_aux_method@*/ +/*@SWIG:/usr/share/swig1.3/ruby/rubyprimtypes.swg,23,%ruby_aux_method@*/ SWIGINTERN VALUE SWIG_AUX_NUM2ULONG(VALUE *args) { VALUE obj = args[0]; VALUE type = TYPE(obj); unsigned long *res = (unsigned long *)(args[1]); @@ -1779,15 +1970,15 @@ SWIGINTERN int SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc) { if (TYPE(obj) == T_STRING) { - - - + #if defined(StringValuePtr) + char *cstr = StringValuePtr(obj); + #else char *cstr = STR2CSTR(obj); - + #endif size_t size = RSTRING_LEN(obj) + 1; if (cptr) { if (alloc) { if (*alloc == SWIG_NEWOBJ) { *cptr = (char *)memcpy((char *)malloc((size)*sizeof(char)), cstr, sizeof(char)*(size)); @@ -2258,30 +2449,30 @@ if ((argc < 5) || (argc > 5)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 5)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_CdIo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cdio_read_sectors" "', argument " "1"" of type '" "CdIo_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdIo_t const *","cdio_read_sectors", 1, argv[0] )); } arg1 = (CdIo_t *)(argp1); res2 = SWIG_ConvertPtr(argv[1],SWIG_as_voidptrptr(&arg2), 0, 0); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "cdio_read_sectors" "', argument " "2"" of type '" "void *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "void *","cdio_read_sectors", 2, argv[1] )); } ecode3 = SWIG_AsVal_int(argv[2], &val3); if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "cdio_read_sectors" "', argument " "3"" of type '" "lsn_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "lsn_t","cdio_read_sectors", 3, argv[2] )); } arg3 = (lsn_t)(val3); ecode4 = SWIG_AsVal_int(argv[3], &val4); if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "cdio_read_sectors" "', argument " "4"" of type '" "cdio_read_mode_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "cdio_read_mode_t","cdio_read_sectors", 4, argv[3] )); } arg4 = (cdio_read_mode_t)(val4); ecode5 = SWIG_AsVal_unsigned_SS_int(argv[4], &val5); if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "cdio_read_sectors" "', argument " "5"" of type '" "unsigned int""'"); + SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "unsigned int","cdio_read_sectors", 5, argv[4] )); } arg5 = (unsigned int)(val5); result = (driver_return_code_t)cdio_read_sectors((CdIo_t const *)arg1,arg2,arg3,arg4,arg5); vresult = SWIG_From_long((long)(result)); return vresult; @@ -2302,11 +2493,11 @@ if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cdio_eject_media_drive" "', argument " "1"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","cdio_eject_media_drive", 1, argv[0] )); } arg1 = (char *)(buf1); result = (driver_return_code_t)cdio_eject_media_drive((char const *)arg1); vresult = SWIG_From_long((long)(result)); if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); @@ -2315,10 +2506,21 @@ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return Qnil; } + +/* + Document-method: Rubycdio.audio_pause + + call-seq: + audio_pause(p_cdio) -> driver_return_code_t + +audio_pause(cdio)->status + +Pause playing CD through analog output.. +*/ SWIGINTERN VALUE _wrap_audio_pause(int argc, VALUE *argv, VALUE self) { CdIo_t *arg1 = (CdIo_t *) 0 ; driver_return_code_t result; void *argp1 = 0 ; @@ -2328,21 +2530,32 @@ if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_CdIo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cdio_audio_pause" "', argument " "1"" of type '" "CdIo_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdIo_t *","cdio_audio_pause", 1, argv[0] )); } arg1 = (CdIo_t *)(argp1); result = (driver_return_code_t)cdio_audio_pause(arg1); vresult = SWIG_From_long((long)(result)); return vresult; fail: return Qnil; } + +/* + Document-method: Rubycdio.audio_play_lsn + + call-seq: + audio_play_lsn(p_cdio, start_lsn, end_lsn) -> driver_return_code_t + +auto_play_lsn(cdio, start_lsn, end_lsn)->status + +Playing CD through analog output at the given lsn to the ending lsn. +*/ SWIGINTERN VALUE _wrap_audio_play_lsn(int argc, VALUE *argv, VALUE self) { CdIo_t *arg1 = (CdIo_t *) 0 ; lsn_t arg2 ; lsn_t arg3 ; @@ -2358,31 +2571,41 @@ if ((argc < 3) || (argc > 3)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_CdIo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "audio_play_lsn" "', argument " "1"" of type '" "CdIo_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdIo_t *","audio_play_lsn", 1, argv[0] )); } arg1 = (CdIo_t *)(argp1); ecode2 = SWIG_AsVal_int(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "audio_play_lsn" "', argument " "2"" of type '" "lsn_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "lsn_t","audio_play_lsn", 2, argv[1] )); } arg2 = (lsn_t)(val2); ecode3 = SWIG_AsVal_int(argv[2], &val3); if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "audio_play_lsn" "', argument " "3"" of type '" "lsn_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "lsn_t","audio_play_lsn", 3, argv[2] )); } arg3 = (lsn_t)(val3); result = (driver_return_code_t)audio_play_lsn(arg1,arg2,arg3); vresult = SWIG_From_long((long)(result)); return vresult; fail: return Qnil; } + +/* + Document-method: Rubycdio.audio_resume + + call-seq: + audio_resume(p_cdio) -> driver_return_code_t + +audio_resume(cdio)->status +Resume playing an audio CD.. +*/ SWIGINTERN VALUE _wrap_audio_resume(int argc, VALUE *argv, VALUE self) { CdIo_t *arg1 = (CdIo_t *) 0 ; driver_return_code_t result; void *argp1 = 0 ; @@ -2392,21 +2615,31 @@ if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_CdIo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cdio_audio_resume" "', argument " "1"" of type '" "CdIo_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdIo_t *","cdio_audio_resume", 1, argv[0] )); } arg1 = (CdIo_t *)(argp1); result = (driver_return_code_t)cdio_audio_resume(arg1); vresult = SWIG_From_long((long)(result)); return vresult; fail: return Qnil; } + +/* + Document-method: Rubycdio.audio_stop + + call-seq: + audio_stop(p_cdio) -> driver_return_code_t + +audio_stop(cdio)->status +Stop playing an audio CD.. +*/ SWIGINTERN VALUE _wrap_audio_stop(int argc, VALUE *argv, VALUE self) { CdIo_t *arg1 = (CdIo_t *) 0 ; driver_return_code_t result; void *argp1 = 0 ; @@ -2416,23 +2649,53 @@ if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_CdIo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cdio_audio_stop" "', argument " "1"" of type '" "CdIo_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdIo_t *","cdio_audio_stop", 1, argv[0] )); } arg1 = (CdIo_t *)(argp1); result = (driver_return_code_t)cdio_audio_stop(arg1); vresult = SWIG_From_long((long)(result)); return vresult; fail: return Qnil; } + +/* + Document-class: Rubycdio::Buf_triple_t + + call-seq: + + +audio_stop(cdio)->status +Stop playing an audio CD.. +*/ swig_class cBuf_triple_t; + +/* + Document-method: Rubycdio::Buf_triple_t.data + + call-seq: + data -> char + +audio_stop(cdio)->status +Stop playing an audio CD.. +*/ + +/* + Document-method: Rubycdio::Buf_triple_t.data= + + call-seq: + data=(x) -> char + +audio_stop(cdio)->status +Stop playing an audio CD.. +*/ SWIGINTERN VALUE _wrap_Buf_triple_t_data_set(int argc, VALUE *argv, VALUE self) { Buf_triple_t *arg1 = (Buf_triple_t *) 0 ; char *arg2 = (char *) 0 ; void *argp1 = 0 ; @@ -2444,16 +2707,16 @@ if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Buf_triple_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "data" "', argument " "1"" of type '" "Buf_triple_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Buf_triple_t *","data", 1, self )); } arg1 = (Buf_triple_t *)(argp1); res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "data" "', argument " "2"" of type '" "char *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","data", 2, argv[0] )); } arg2 = (char *)(buf2); if (arg1->data) free((char*)arg1->data); if (arg2) { size_t size = strlen((const char *)(arg2)) + 1; @@ -2480,21 +2743,39 @@ if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Buf_triple_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "data" "', argument " "1"" of type '" "Buf_triple_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Buf_triple_t *","data", 1, self )); } arg1 = (Buf_triple_t *)(argp1); result = (char *) ((arg1)->data); vresult = SWIG_FromCharPtr((const char *)result); return vresult; fail: return Qnil; } + +/* + Document-method: Rubycdio::Buf_triple_t.size + + call-seq: + size -> size_t + +Size or Length of the Buf_triple_t. +*/ + +/* + Document-method: Rubycdio::Buf_triple_t.size= + + call-seq: + size=(x) -> size_t + +Size or Length of the Buf_triple_t. +*/ SWIGINTERN VALUE _wrap_Buf_triple_t_size_set(int argc, VALUE *argv, VALUE self) { Buf_triple_t *arg1 = (Buf_triple_t *) 0 ; size_t arg2 ; void *argp1 = 0 ; @@ -2505,16 +2786,16 @@ if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Buf_triple_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "size" "', argument " "1"" of type '" "Buf_triple_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Buf_triple_t *","size", 1, self )); } arg1 = (Buf_triple_t *)(argp1); ecode2 = SWIG_AsVal_size_t(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "size" "', argument " "2"" of type '" "size_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "size_t","size", 2, argv[0] )); } arg2 = (size_t)(val2); if (arg1) (arg1)->size = arg2; return Qnil; @@ -2534,21 +2815,41 @@ if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Buf_triple_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "size" "', argument " "1"" of type '" "Buf_triple_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Buf_triple_t *","size", 1, self )); } arg1 = (Buf_triple_t *)(argp1); result = ((arg1)->size); vresult = SWIG_From_size_t((size_t)(result)); return vresult; fail: return Qnil; } + +/* + Document-method: Rubycdio::Buf_triple_t.drc + + call-seq: + drc -> driver_return_code_t + +audio_stop(cdio)->status +Stop playing an audio CD.. +*/ + +/* + Document-method: Rubycdio::Buf_triple_t.drc= + + call-seq: + drc=(x) -> driver_return_code_t + +audio_stop(cdio)->status +Stop playing an audio CD.. +*/ SWIGINTERN VALUE _wrap_Buf_triple_t_drc_set(int argc, VALUE *argv, VALUE self) { Buf_triple_t *arg1 = (Buf_triple_t *) 0 ; driver_return_code_t arg2 ; void *argp1 = 0 ; @@ -2559,16 +2860,16 @@ if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Buf_triple_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "drc" "', argument " "1"" of type '" "Buf_triple_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Buf_triple_t *","drc", 1, self )); } arg1 = (Buf_triple_t *)(argp1); ecode2 = SWIG_AsVal_long(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "drc" "', argument " "2"" of type '" "driver_return_code_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "driver_return_code_t","drc", 2, argv[0] )); } arg2 = (driver_return_code_t)(val2); if (arg1) (arg1)->drc = arg2; return Qnil; @@ -2588,11 +2889,11 @@ if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Buf_triple_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "drc" "', argument " "1"" of type '" "Buf_triple_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Buf_triple_t *","drc", 1, self )); } arg1 = (Buf_triple_t *)(argp1); result = (driver_return_code_t) ((arg1)->drc); vresult = SWIG_From_long((long)(result)); return vresult; @@ -2616,10 +2917,22 @@ #endif return vresult; } + +/* + Document-method: Rubycdio::Buf_triple_t.new + + call-seq: + + +get_num_tracks(p_cdio)->int + +Return the number of tracks on the CD. +On error rubycdio::INVALID_TRACK is returned.. +*/ SWIGINTERN VALUE _wrap_new_Buf_triple_t(int argc, VALUE *argv, VALUE self) { Buf_triple_t *result = 0 ; if ((argc < 0) || (argc > 0)) { @@ -2636,10 +2949,20 @@ SWIGINTERN void free_Buf_triple_t(Buf_triple_t *arg1) { free((char *) arg1); } + +/* + Document-method: Rubycdio.lseek + + call-seq: + lseek(p_cdio, offset, whence=SEEK_SET) -> off_t + +audio_stop(cdio)->status +Stop playing an audio CD.. +*/ SWIGINTERN VALUE _wrap_lseek(int argc, VALUE *argv, VALUE self) { CdIo_t *arg1 = (CdIo_t *) 0 ; off_t arg2 ; int arg3 = (int) SEEK_SET ; @@ -2655,28 +2978,28 @@ if ((argc < 2) || (argc > 3)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_CdIo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cdio_lseek" "', argument " "1"" of type '" "CdIo_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdIo_t const *","cdio_lseek", 1, argv[0] )); } arg1 = (CdIo_t *)(argp1); { res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_off_t, 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "cdio_lseek" "', argument " "2"" of type '" "off_t""'"); + SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "off_t","cdio_lseek", 2, argv[1] )); } if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "cdio_lseek" "', argument " "2"" of type '" "off_t""'"); + SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "off_t","cdio_lseek", 2, argv[1])); } else { arg2 = *((off_t *)(argp2)); } } if (argc > 2) { ecode3 = SWIG_AsVal_int(argv[2], &val3); if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "cdio_lseek" "', argument " "3"" of type '" "int""'"); + SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","cdio_lseek", 3, argv[2] )); } arg3 = (int)(val3); } result = cdio_lseek((CdIo_t const *)arg1,arg2,arg3); vresult = SWIG_NewPointerObj((off_t *)memcpy((off_t *)malloc(sizeof(off_t)),&result,sizeof(off_t)), SWIGTYPE_p_off_t, SWIG_POINTER_OWN | 0 ); @@ -2684,10 +3007,20 @@ fail: return Qnil; } + +/* + Document-method: Rubycdio.read_cd + + call-seq: + read_cd(p_cdio, i_size) -> Buf_triple_t + +audio_stop(cdio)->status +Stop playing an audio CD.. +*/ SWIGINTERN VALUE _wrap_read_cd(int argc, VALUE *argv, VALUE self) { CdIo_t *arg1 = (CdIo_t *) 0 ; size_t arg2 ; Buf_triple_t result; @@ -2700,16 +3033,16 @@ if ((argc < 2) || (argc > 2)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_CdIo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "read_cd" "', argument " "1"" of type '" "CdIo_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdIo_t const *","read_cd", 1, argv[0] )); } arg1 = (CdIo_t *)(argp1); ecode2 = SWIG_AsVal_size_t(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "read_cd" "', argument " "2"" of type '" "size_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "size_t","read_cd", 2, argv[1] )); } arg2 = (size_t)(val2); result = read_cd((CdIo_t const *)arg1,arg2); { if (!(&result)->data) @@ -2728,10 +3061,20 @@ fail: return Qnil; } + +/* + Document-method: Rubycdio.read_sectors + + call-seq: + read_sectors(p_cdio, i_lsn, read_mode, i_size) -> Buf_triple_t + +audio_stop(cdio)->status +Stop playing an audio CD.. +*/ SWIGINTERN VALUE _wrap_read_sectors(int argc, VALUE *argv, VALUE self) { CdIo_t *arg1 = (CdIo_t *) 0 ; lsn_t arg2 ; cdio_read_mode_t arg3 ; @@ -2750,26 +3093,26 @@ if ((argc < 4) || (argc > 4)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_CdIo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "read_sectors" "', argument " "1"" of type '" "CdIo_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdIo_t const *","read_sectors", 1, argv[0] )); } arg1 = (CdIo_t *)(argp1); ecode2 = SWIG_AsVal_int(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "read_sectors" "', argument " "2"" of type '" "lsn_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "lsn_t","read_sectors", 2, argv[1] )); } arg2 = (lsn_t)(val2); ecode3 = SWIG_AsVal_int(argv[2], &val3); if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "read_sectors" "', argument " "3"" of type '" "cdio_read_mode_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "cdio_read_mode_t","read_sectors", 3, argv[2] )); } arg3 = (cdio_read_mode_t)(val3); ecode4 = SWIG_AsVal_size_t(argv[3], &val4); if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "read_sectors" "', argument " "4"" of type '" "size_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "size_t","read_sectors", 4, argv[3] )); } arg4 = (size_t)(val4); result = read_sectors((CdIo_t const *)arg1,arg2,arg3,arg4); { if (!(&result)->data) @@ -2788,10 +3131,20 @@ fail: return Qnil; } + +/* + Document-method: Rubycdio.read_data_bytes + + call-seq: + read_data_bytes(p_cdio, i_lsn, i_blocksize, i_size) -> Buf_triple_t + +audio_stop(cdio)->status +Stop playing an audio CD.. +*/ SWIGINTERN VALUE _wrap_read_data_bytes(int argc, VALUE *argv, VALUE self) { CdIo_t *arg1 = (CdIo_t *) 0 ; lsn_t arg2 ; int16_t arg3 ; @@ -2810,26 +3163,26 @@ if ((argc < 4) || (argc > 4)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_CdIo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "read_data_bytes" "', argument " "1"" of type '" "CdIo_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdIo_t const *","read_data_bytes", 1, argv[0] )); } arg1 = (CdIo_t *)(argp1); ecode2 = SWIG_AsVal_int(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "read_data_bytes" "', argument " "2"" of type '" "lsn_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "lsn_t","read_data_bytes", 2, argv[1] )); } arg2 = (lsn_t)(val2); ecode3 = SWIG_AsVal_int(argv[2], &val3); if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "read_data_bytes" "', argument " "3"" of type '" "int16_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int16_t","read_data_bytes", 3, argv[2] )); } arg3 = (int16_t)(val3); ecode4 = SWIG_AsVal_size_t(argv[3], &val4); if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "read_data_bytes" "', argument " "4"" of type '" "size_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "size_t","read_data_bytes", 4, argv[3] )); } arg4 = (size_t)(val4); result = read_data_bytes((CdIo_t const *)arg1,arg2,arg3,arg4); { if (!(&result)->data) @@ -2848,10 +3201,23 @@ fail: return Qnil; } + +/* + Document-method: Rubycdio.get_first_track_num + + call-seq: + get_first_track_num(p_cdio) -> track_t + +get_first_track_num(p_cdio) -> int +Get the number of the first track. + +return the track number or pycdio.INVALID_TRACK if there was +a problem.. +*/ SWIGINTERN VALUE _wrap_get_first_track_num(int argc, VALUE *argv, VALUE self) { CdIo_t *arg1 = (CdIo_t *) 0 ; track_t result; void *argp1 = 0 ; @@ -2861,21 +3227,32 @@ if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_CdIo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cdio_get_first_track_num" "', argument " "1"" of type '" "CdIo_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdIo_t const *","cdio_get_first_track_num", 1, argv[0] )); } arg1 = (CdIo_t *)(argp1); result = (track_t)cdio_get_first_track_num((CdIo_t const *)arg1); vresult = SWIG_From_unsigned_SS_int((unsigned int)(result)); return vresult; fail: return Qnil; } + +/* + Document-method: Rubycdio.get_last_track_num + + call-seq: + get_last_track_num(p_cdio) -> track_t + +get_last_track_num +Return the last track number. +pycdio.INVALID_TRACK is if there was a problem.. +*/ SWIGINTERN VALUE _wrap_get_last_track_num(int argc, VALUE *argv, VALUE self) { CdIo_t *arg1 = (CdIo_t *) 0 ; track_t result; void *argp1 = 0 ; @@ -2885,21 +3262,37 @@ if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_CdIo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cdio_get_last_track_num" "', argument " "1"" of type '" "CdIo_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdIo_t const *","cdio_get_last_track_num", 1, argv[0] )); } arg1 = (CdIo_t *)(argp1); result = (track_t)cdio_get_last_track_num((CdIo_t const *)arg1); vresult = SWIG_From_unsigned_SS_int((unsigned int)(result)); return vresult; fail: return Qnil; } + +/* + Document-method: Rubycdio.get_track + + call-seq: + get_track(p_cdio, lsn) -> track_t + +cdio_get_track(lsn)->int + + Find the track which contains lsn. + pycdio.INVALID_TRACK is returned if the lsn outside of the CD or + if there was some error. + + If the lsn is before the pregap of the first track, 0 is returned. + Otherwise we return the track that spans the lsn.. +*/ SWIGINTERN VALUE _wrap_get_track(int argc, VALUE *argv, VALUE self) { CdIo_t *arg1 = (CdIo_t *) 0 ; lsn_t arg2 ; track_t result; @@ -2912,26 +3305,38 @@ if ((argc < 2) || (argc > 2)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_CdIo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cdio_get_track" "', argument " "1"" of type '" "CdIo_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdIo_t const *","cdio_get_track", 1, argv[0] )); } arg1 = (CdIo_t *)(argp1); ecode2 = SWIG_AsVal_int(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cdio_get_track" "', argument " "2"" of type '" "lsn_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "lsn_t","cdio_get_track", 2, argv[1] )); } arg2 = (lsn_t)(val2); result = (track_t)cdio_get_track((CdIo_t const *)arg1,arg2); vresult = SWIG_From_unsigned_SS_int((unsigned int)(result)); return vresult; fail: return Qnil; } + +/* + Document-method: Rubycdio.get_track_channels + + call-seq: + get_track_channels(p_cdio, i_track) -> int + +get_track_channels(cdio, track)->int + +Return number of channels in track: 2 or 4; -2 if implemented or -1 +for error. Not meaningful if track is not an audio track.. +*/ SWIGINTERN VALUE _wrap_get_track_channels(int argc, VALUE *argv, VALUE self) { CdIo_t *arg1 = (CdIo_t *) 0 ; track_t arg2 ; int result; @@ -2944,26 +3349,39 @@ if ((argc < 2) || (argc > 2)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_CdIo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cdio_get_track_channels" "', argument " "1"" of type '" "CdIo_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdIo_t const *","cdio_get_track_channels", 1, argv[0] )); } arg1 = (CdIo_t *)(argp1); ecode2 = SWIG_AsVal_unsigned_SS_int(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cdio_get_track_channels" "', argument " "2"" of type '" "track_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "track_t","cdio_get_track_channels", 2, argv[1] )); } arg2 = (track_t)(val2); result = (int)cdio_get_track_channels((CdIo_t const *)arg1,arg2); vresult = SWIG_From_int((int)(result)); return vresult; fail: return Qnil; } + +/* + Document-method: Rubycdio.track_copy_permit? + + call-seq: + track_copy_permit?(p_cdio, i_track) -> bool + +copy_permit?(cdio, track)->bool + +Return copy protection status on a track. Is this meaningful +not an audio track? +. +*/ SWIGINTERN VALUE _wrap_track_copy_permitq___(int argc, VALUE *argv, VALUE self) { CdIo_t *arg1 = (CdIo_t *) 0 ; track_t arg2 ; bool result; @@ -2976,26 +3394,37 @@ if ((argc < 2) || (argc > 2)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_CdIo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cdio_get_track_copy_permit" "', argument " "1"" of type '" "CdIo_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdIo_t const *","cdio_get_track_copy_permit", 1, argv[0] )); } arg1 = (CdIo_t *)(argp1); ecode2 = SWIG_AsVal_unsigned_SS_int(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cdio_get_track_copy_permit" "', argument " "2"" of type '" "track_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "track_t","cdio_get_track_copy_permit", 2, argv[1] )); } arg2 = (track_t)(val2); result = (bool)cdio_get_track_copy_permit((CdIo_t const *)arg1,arg2); vresult = (result != 0) ? Qtrue : Qfalse; return vresult; fail: return Qnil; } + +/* + Document-method: Rubycdio.get_track_format + + call-seq: + get_track_format(p_cdio, i_track) -> char + +get_track_format(cdio, track)->format + +Get the format (audio, mode2, mode1) of track. . +*/ SWIGINTERN VALUE _wrap_get_track_format(int argc, VALUE *argv, VALUE self) { CdIo_t *arg1 = (CdIo_t *) 0 ; track_t arg2 ; char *result = 0 ; @@ -3008,26 +3437,42 @@ if ((argc < 2) || (argc > 2)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_CdIo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "get_track_format" "', argument " "1"" of type '" "CdIo_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdIo_t const *","get_track_format", 1, argv[0] )); } arg1 = (CdIo_t *)(argp1); ecode2 = SWIG_AsVal_unsigned_SS_int(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "get_track_format" "', argument " "2"" of type '" "track_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "track_t","get_track_format", 2, argv[1] )); } arg2 = (track_t)(val2); result = (char *)get_track_format((CdIo_t const *)arg1,arg2); vresult = SWIG_FromCharPtr((const char *)result); return vresult; fail: return Qnil; } + +/* + Document-method: Rubycdio.track_green? + + call-seq: + track_green?(p_cdio, i_track) -> bool + +track_green?(cdio, track) -> bool + +Return True if we have XA data (green, mode2 form1) or +XA data (green, mode2 form2). That is track begins: + sync - header - subheader +12 4 - 8 + +FIXME: there's gotta be a better design for this and get_track_format?. +*/ SWIGINTERN VALUE _wrap_track_greenq___(int argc, VALUE *argv, VALUE self) { CdIo_t *arg1 = (CdIo_t *) 0 ; track_t arg2 ; bool result; @@ -3040,26 +3485,38 @@ if ((argc < 2) || (argc > 2)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_CdIo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cdio_get_track_green" "', argument " "1"" of type '" "CdIo_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdIo_t const *","cdio_get_track_green", 1, argv[0] )); } arg1 = (CdIo_t *)(argp1); ecode2 = SWIG_AsVal_unsigned_SS_int(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cdio_get_track_green" "', argument " "2"" of type '" "track_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "track_t","cdio_get_track_green", 2, argv[1] )); } arg2 = (track_t)(val2); result = (bool)cdio_get_track_green((CdIo_t const *)arg1,arg2); vresult = (result != 0) ? Qtrue : Qfalse; return vresult; fail: return Qnil; } + +/* + Document-method: Rubycdio.get_track_last_lsn + + call-seq: + get_track_last_lsn(p_cdio, i_track) -> lsn_t + +cdio_get_track_last_lsn(cdio, track)->lsn + +Return the ending LSN for track number +track in cdio. CDIO_INVALID_LSN is returned on error.. +*/ SWIGINTERN VALUE _wrap_get_track_last_lsn(int argc, VALUE *argv, VALUE self) { CdIo_t *arg1 = (CdIo_t *) 0 ; track_t arg2 ; lsn_t result; @@ -3072,26 +3529,45 @@ if ((argc < 2) || (argc > 2)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_CdIo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cdio_get_track_last_lsn" "', argument " "1"" of type '" "CdIo_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdIo_t const *","cdio_get_track_last_lsn", 1, argv[0] )); } arg1 = (CdIo_t *)(argp1); ecode2 = SWIG_AsVal_unsigned_SS_int(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cdio_get_track_last_lsn" "', argument " "2"" of type '" "track_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "track_t","cdio_get_track_last_lsn", 2, argv[1] )); } arg2 = (track_t)(val2); result = (lsn_t)cdio_get_track_last_lsn((CdIo_t const *)arg1,arg2); vresult = SWIG_From_int((int)(result)); return vresult; fail: return Qnil; } + +/* + Document-method: Rubycdio.get_track_lba + + call-seq: + get_track_lba(p_cdio, i_track) -> lba_t + +cdio_get_track_lba + Get the starting LBA for track number + i_track in p_cdio. Track numbers usually start at something + greater than 0, usually 1. + + The 'leadout' track is specified either by + using i_track CDIO_CDROM_LEADOUT_TRACK or the total tracks+1. + + @param p_cdio object to get information from + @param i_track the track number we want the LSN for + @return the starting LBA or CDIO_INVALID_LBA on error.. +*/ SWIGINTERN VALUE _wrap_get_track_lba(int argc, VALUE *argv, VALUE self) { CdIo_t *arg1 = (CdIo_t *) 0 ; track_t arg2 ; lba_t result; @@ -3104,26 +3580,43 @@ if ((argc < 2) || (argc > 2)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_CdIo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cdio_get_track_lba" "', argument " "1"" of type '" "CdIo_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdIo_t const *","cdio_get_track_lba", 1, argv[0] )); } arg1 = (CdIo_t *)(argp1); ecode2 = SWIG_AsVal_unsigned_SS_int(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cdio_get_track_lba" "', argument " "2"" of type '" "track_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "track_t","cdio_get_track_lba", 2, argv[1] )); } arg2 = (track_t)(val2); result = (lba_t)cdio_get_track_lba((CdIo_t const *)arg1,arg2); vresult = SWIG_From_int((int)(result)); return vresult; fail: return Qnil; } + +/* + Document-method: Rubycdio.get_track_lsn + + call-seq: + get_track_lsn(p_cdio, i_track) -> lsn_t + +cdio_get_track_lsn (cdio, track)->int + +Return the starting LSN for track number. +Track numbers usually start at something greater than 0, usually 1. + +The 'leadout' track is specified either by +using i_track pycdio.CDROM_LEADOUT_TRACK or the total tracks+1. + +pycdio.INVALID_LSN is returned on error.. +*/ SWIGINTERN VALUE _wrap_get_track_lsn(int argc, VALUE *argv, VALUE self) { CdIo_t *arg1 = (CdIo_t *) 0 ; track_t arg2 ; lsn_t result; @@ -3136,26 +3629,44 @@ if ((argc < 2) || (argc > 2)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_CdIo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cdio_get_track_lsn" "', argument " "1"" of type '" "CdIo_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdIo_t const *","cdio_get_track_lsn", 1, argv[0] )); } arg1 = (CdIo_t *)(argp1); ecode2 = SWIG_AsVal_unsigned_SS_int(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cdio_get_track_lsn" "', argument " "2"" of type '" "track_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "track_t","cdio_get_track_lsn", 2, argv[1] )); } arg2 = (track_t)(val2); result = (lsn_t)cdio_get_track_lsn((CdIo_t const *)arg1,arg2); vresult = SWIG_From_int((int)(result)); return vresult; fail: return Qnil; } + +/* + Document-method: Rubycdio.get_track_msf + + call-seq: + get_track_msf(p_cdio, i_track) -> char + +get_track_msf(cdio,track)->string + + Return the starting MSF (minutes/secs/frames) for track number + track. Track numbers usually start at something + greater than 0, usually 1. + + The 'leadout' track is specified either by + using i_track CDIO_CDROM_LEADOUT_TRACK or the total tracks+1. + +@return string mm:ss:ff if all good, or string 'error' on error.. +*/ SWIGINTERN VALUE _wrap_get_track_msf(int argc, VALUE *argv, VALUE self) { CdIo_t *arg1 = (CdIo_t *) 0 ; track_t arg2 ; char *result = 0 ; @@ -3168,26 +3679,38 @@ if ((argc < 2) || (argc > 2)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_CdIo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "get_track_msf" "', argument " "1"" of type '" "CdIo_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdIo_t const *","get_track_msf", 1, argv[0] )); } arg1 = (CdIo_t *)(argp1); ecode2 = SWIG_AsVal_unsigned_SS_int(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "get_track_msf" "', argument " "2"" of type '" "track_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "track_t","get_track_msf", 2, argv[1] )); } arg2 = (track_t)(val2); result = (char *)get_track_msf((CdIo_t const *)arg1,arg2); vresult = SWIG_FromCharPtr((const char *)result); return vresult; fail: return Qnil; } + +/* + Document-method: Rubycdio.get_track_preemphasis + + call-seq: + get_track_preemphasis(p_cdio, i_track) -> track_flag_t + +cdio_get_track_preemphasis(cdio, track) + +Get linear preemphasis status on an audio track. +This is not meaningful if not an audio track?. +*/ SWIGINTERN VALUE _wrap_get_track_preemphasis(int argc, VALUE *argv, VALUE self) { CdIo_t *arg1 = (CdIo_t *) 0 ; track_t arg2 ; track_flag_t result; @@ -3200,26 +3723,42 @@ if ((argc < 2) || (argc > 2)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_CdIo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cdio_get_track_preemphasis" "', argument " "1"" of type '" "CdIo_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdIo_t const *","cdio_get_track_preemphasis", 1, argv[0] )); } arg1 = (CdIo_t *)(argp1); ecode2 = SWIG_AsVal_unsigned_SS_int(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cdio_get_track_preemphasis" "', argument " "2"" of type '" "track_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "track_t","cdio_get_track_preemphasis", 2, argv[1] )); } arg2 = (track_t)(val2); result = (track_flag_t)cdio_get_track_preemphasis((CdIo_t const *)arg1,arg2); vresult = SWIG_From_int((int)(result)); return vresult; fail: return Qnil; } + +/* + Document-method: Rubycdio.get_track_sec_count + + call-seq: + get_track_sec_count(p_cdio, i_track) -> unsigned int + +get_track_sec_count(cdio, track)->int + +Get the number of sectors between this track an the next. This +includes any pregap sectors before the start of the next track. +Track numbers usually start at something +greater than 0, usually 1. + +0 is returned if there is an error.. +*/ SWIGINTERN VALUE _wrap_get_track_sec_count(int argc, VALUE *argv, VALUE self) { CdIo_t *arg1 = (CdIo_t *) 0 ; track_t arg2 ; unsigned int result; @@ -3232,26 +3771,42 @@ if ((argc < 2) || (argc > 2)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_CdIo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cdio_get_track_sec_count" "', argument " "1"" of type '" "CdIo_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdIo_t const *","cdio_get_track_sec_count", 1, argv[0] )); } arg1 = (CdIo_t *)(argp1); ecode2 = SWIG_AsVal_unsigned_SS_int(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cdio_get_track_sec_count" "', argument " "2"" of type '" "track_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "track_t","cdio_get_track_sec_count", 2, argv[1] )); } arg2 = (track_t)(val2); result = (unsigned int)cdio_get_track_sec_count((CdIo_t const *)arg1,arg2); vresult = SWIG_From_unsigned_SS_int((unsigned int)(result)); return vresult; fail: return Qnil; } + +/* + Document-method: Rubycdio.close_tray + + call-seq: + close_tray(psz_drive, p_driver_id=DRIVER_UNKNOWN) -> driver_return_code_t + +get_track_sec_count(cdio, track)->int + +Get the number of sectors between this track an the next. This +includes any pregap sectors before the start of the next track. +Track numbers usually start at something +greater than 0, usually 1. + +0 is returned if there is an error.. +*/ SWIGINTERN VALUE _wrap_close_tray(int argc, VALUE *argv, VALUE self) { char *arg1 = (char *) 0 ; driver_id_t arg2 = (driver_id_t) DRIVER_UNKNOWN ; driver_id_t *arg3 = (driver_id_t *) 0 ; @@ -3269,17 +3824,17 @@ if ((argc < 1) || (argc > 2)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "close_tray" "', argument " "1"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","close_tray", 1, argv[0] )); } arg1 = (char *)(buf1); if (argc > 1) { ecode2 = SWIG_AsVal_unsigned_SS_int(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "close_tray" "', argument " "2"" of type '" "driver_id_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "driver_id_t","close_tray", 2, argv[1] )); } arg2 = (driver_id_t)(val2); } result = (driver_return_code_t)close_tray((char const *)arg1,arg2,arg3); vresult = SWIG_From_long((long)(result)); @@ -3295,10 +3850,22 @@ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return Qnil; } + +/* + Document-method: Rubycdio.close + + call-seq: + close(p_cdio) + +destroy(p_cdio) +Free resources associated with p_cdio. Call this when done using +using CD reading/control operations for the current device. +. +*/ SWIGINTERN VALUE _wrap_close(int argc, VALUE *argv, VALUE self) { CdIo_t *arg1 = (CdIo_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; @@ -3306,20 +3873,32 @@ if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_CdIo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cdio_destroy" "', argument " "1"" of type '" "CdIo_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdIo_t *","cdio_destroy", 1, argv[0] )); } arg1 = (CdIo_t *)(argp1); cdio_destroy(arg1); return Qnil; fail: return Qnil; } + +/* + Document-method: Rubycdio.driver_errmsg + + call-seq: + driver_errmsg(drc) -> char + +destroy(p_cdio) +Free resources associated with p_cdio. Call this when done using +using CD reading/control operations for the current device. +. +*/ SWIGINTERN VALUE _wrap_driver_errmsg(int argc, VALUE *argv, VALUE self) { driver_return_code_t arg1 ; char *result = 0 ; long val1 ; @@ -3329,21 +3908,33 @@ if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } ecode1 = SWIG_AsVal_long(argv[0], &val1); if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "driver_errmsg" "', argument " "1"" of type '" "driver_return_code_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "driver_return_code_t","driver_errmsg", 1, argv[0] )); } arg1 = (driver_return_code_t)(val1); result = (char *)driver_errmsg(arg1); vresult = SWIG_FromCharPtr((const char *)result); return vresult; fail: return Qnil; } + +/* + Document-method: Rubycdio.eject_media + + call-seq: + eject_media(p_cdio) -> driver_return_code_t + +eject_media(cdio)->return_code + +Eject media in CD drive if there is a routine to do so. +. +*/ SWIGINTERN VALUE _wrap_eject_media(int argc, VALUE *argv, VALUE self) { CdIo_t *arg1 = (CdIo_t *) 0 ; driver_return_code_t result; void *argp1 = 0 ; @@ -3353,21 +3944,34 @@ if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_CdIo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "eject_media" "', argument " "1"" of type '" "CdIo_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdIo_t *","eject_media", 1, argv[0] )); } arg1 = (CdIo_t *)(argp1); result = (driver_return_code_t)eject_media(arg1); vresult = SWIG_From_long((long)(result)); return vresult; fail: return Qnil; } + +/* + Document-method: Rubycdio.eject_media_drive + + call-seq: + eject_media_drive(psz_drive=nil) -> driver_return_code_t + +eject_media_drive(drive=nil)->return_code +Eject media in CD drive if there is a routine to do so. + +psz_drive: the name of the device to be acted upon. +The operation status is returned.. +*/ SWIGINTERN VALUE _wrap_eject_media_drive(int argc, VALUE *argv, VALUE self) { char *arg1 = (char *) NULL ; driver_return_code_t result; int res1 ; @@ -3379,11 +3983,11 @@ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } if (argc > 0) { res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cdio_eject_media_drive" "', argument " "1"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","cdio_eject_media_drive", 1, argv[0] )); } arg1 = (char *)(buf1); } result = (driver_return_code_t)cdio_eject_media_drive((char const *)arg1); vresult = SWIG_From_long((long)(result)); @@ -3393,10 +3997,21 @@ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return Qnil; } + +/* + Document-method: Rubycdio.get_arg + + call-seq: + get_arg(p_cdio, key) -> char + +get_arg(p_cdio, key)->string + +Get the value associatied with key.. +*/ SWIGINTERN VALUE _wrap_get_arg(int argc, VALUE *argv, VALUE self) { CdIo_t *arg1 = (CdIo_t *) 0 ; char *arg2 ; char *result = 0 ; @@ -3410,16 +4025,16 @@ if ((argc < 2) || (argc > 2)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_CdIo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cdio_get_arg" "', argument " "1"" of type '" "CdIo_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdIo_t const *","cdio_get_arg", 1, argv[0] )); } arg1 = (CdIo_t *)(argp1); res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "cdio_get_arg" "', argument " "2"" of type '" "char const []""'"); + SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const []","cdio_get_arg", 2, argv[1] )); } arg2 = (char *)(buf2); result = (char *)cdio_get_arg((CdIo_t const *)arg1,(char const (*))arg2); vresult = SWIG_FromCharPtr((const char *)result); if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); @@ -3428,10 +4043,27 @@ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return Qnil; } + +/* + Document-method: Rubycdio.get_device + + call-seq: + get_device(p_cdio=nil) -> char + +get_device(cdio)->str + +Get the CD device associated with cdio. +If cdio is NULL (we haven't initialized a specific device driver), +then find a suitable one and return the default device for that. + +In some situations of drivers or OS's we can't find a CD device if +there is no media in it and it is possible for this routine to return +nil even though there may be a hardware CD-ROM.. +*/ SWIGINTERN VALUE _wrap_get_device(int argc, VALUE *argv, VALUE self) { CdIo_t *arg1 = (CdIo_t *) NULL ; char *result = 0 ; void *argp1 = 0 ; @@ -3442,11 +4074,11 @@ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } if (argc > 0) { res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_CdIo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cdio_get_default_device" "', argument " "1"" of type '" "CdIo_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdIo_t const *","cdio_get_default_device", 1, argv[0] )); } arg1 = (CdIo_t *)(argp1); } result = (char *)cdio_get_default_device((CdIo_t const *)arg1); vresult = SWIG_FromCharPtr((const char *)result); @@ -3455,10 +4087,24 @@ fail: return Qnil; } + +/* + Document-method: Rubycdio.get_default_device_driver + + call-seq: + get_default_device_driver(p_driver_id) -> char + +get_default_device_driver(driver_id=nil)->[device, driver] +Return a string containing the default CD device if none is specified. +if p_driver_id is DRIVER_UNKNOWN or DRIVER_DEVICE then find a suitable +one set the default device for that. + +nil is returned as the device if we couldn't get a default device.. +*/ SWIGINTERN VALUE _wrap_get_default_device_driver(int argc, VALUE *argv, VALUE self) { driver_id_t arg1 ; driver_id_t *arg2 = (driver_id_t *) 0 ; char *result = 0 ; @@ -3472,11 +4118,11 @@ if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1); if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "get_default_device_driver" "', argument " "1"" of type '" "driver_id_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "driver_id_t","get_default_device_driver", 1, argv[0] )); } arg1 = (driver_id_t)(val1); result = (char *)get_default_device_driver(arg1,arg2); vresult = SWIG_FromCharPtr((const char *)result); if (SWIG_IsTmpObj(res2)) { @@ -3490,10 +4136,24 @@ fail: return Qnil; } + +/* + Document-method: Rubycdio.get_devices + + call-seq: + get_devices(driver_id) -> DeviceList_t + +get_default_device_driver(driver_id=nil)->[device, driver] +Return a string containing the default CD device if none is specified. +if p_driver_id is DRIVER_UNKNOWN or DRIVER_DEVICE then find a suitable +one set the default device for that. + +nil is returned as the device if we couldn't get a default device.. +*/ SWIGINTERN VALUE _wrap_get_devices(int argc, VALUE *argv, VALUE self) { driver_id_t arg1 ; DeviceList_t result; unsigned int val1 ; @@ -3503,11 +4163,11 @@ if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1); if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cdio_get_devices" "', argument " "1"" of type '" "driver_id_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "driver_id_t","cdio_get_devices", 1, argv[0] )); } arg1 = (driver_id_t)(val1); result = (DeviceList_t)cdio_get_devices(arg1); { // result is of type DeviceList_t @@ -3528,10 +4188,24 @@ fail: return Qnil; } + +/* + Document-method: Rubycdio.get_devices_ret + + call-seq: + get_devices_ret(driver_id) -> DeviceList_t + +get_default_device_driver(driver_id=nil)->[device, driver] +Return a string containing the default CD device if none is specified. +if p_driver_id is DRIVER_UNKNOWN or DRIVER_DEVICE then find a suitable +one set the default device for that. + +nil is returned as the device if we couldn't get a default device.. +*/ SWIGINTERN VALUE _wrap_get_devices_ret(int argc, VALUE *argv, VALUE self) { driver_id_t arg1 ; driver_id_t *arg2 = (driver_id_t *) 0 ; DeviceList_t result; @@ -3545,11 +4219,11 @@ if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1); if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "get_devices_ret" "', argument " "1"" of type '" "driver_id_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "driver_id_t","get_devices_ret", 1, argv[0] )); } arg1 = (driver_id_t)(val1); result = (DeviceList_t)get_devices_ret(arg1,arg2); { // result is of type DeviceList_t @@ -3576,10 +4250,33 @@ fail: return Qnil; } + +/* + Document-method: Rubycdio.get_devices_with_cap + + call-seq: + get_devices_with_cap(capabilities, b_any) -> DeviceList_t + +get_devices_with_cap(capabilities, any)->[device1, device2...] +Get an array of device names in search_devices that have at least +the capabilities listed by the capabities parameter. + +If any is False then every capability listed in the +extended portion of capabilities (i.e. not the basic filesystem) +must be satisified. If any is True, then if any of the +capabilities matches, we call that a success. + +To find a CD-drive of any type, use the mask CDIO_FS_MATCH_ALL. + +The array of device names is returned or NULL if we couldn't get a +default device. It is also possible to return a non NULL but after +dereferencing the the value is NULL. This also means nothing was +found.. +*/ SWIGINTERN VALUE _wrap_get_devices_with_cap(int argc, VALUE *argv, VALUE self) { unsigned int arg1 ; bool arg2 ; DeviceList_t result; @@ -3592,16 +4289,16 @@ if ((argc < 2) || (argc > 2)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail; } ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1); if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "get_devices_with_cap" "', argument " "1"" of type '" "unsigned int""'"); + SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "unsigned int","get_devices_with_cap", 1, argv[0] )); } arg1 = (unsigned int)(val1); ecode2 = SWIG_AsVal_bool(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "get_devices_with_cap" "', argument " "2"" of type '" "bool""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","get_devices_with_cap", 2, argv[1] )); } arg2 = (bool)(val2); result = (DeviceList_t)get_devices_with_cap(arg1,arg2); { // result is of type DeviceList_t @@ -3622,10 +4319,22 @@ fail: return Qnil; } + +/* + Document-method: Rubycdio.get_devices_with_cap_ret + + call-seq: + get_devices_with_cap_ret(capabilities, b_any) -> DeviceList_t + +Like cdio_get_devices_with_cap but we return the driver we found +as well. This is because often one wants to search for kind of drive +and then *open* it afterwards. Giving the driver back facilitates this, + and speeds things up for libcdio as well.. +*/ SWIGINTERN VALUE _wrap_get_devices_with_cap_ret(int argc, VALUE *argv, VALUE self) { unsigned int arg1 ; bool arg2 ; driver_id_t *arg3 = (driver_id_t *) 0 ; @@ -3642,16 +4351,16 @@ if ((argc < 2) || (argc > 2)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail; } ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1); if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "get_devices_with_cap_ret" "', argument " "1"" of type '" "unsigned int""'"); + SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "unsigned int","get_devices_with_cap_ret", 1, argv[0] )); } arg1 = (unsigned int)(val1); ecode2 = SWIG_AsVal_bool(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "get_devices_with_cap_ret" "', argument " "2"" of type '" "bool""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","get_devices_with_cap_ret", 2, argv[1] )); } arg2 = (bool)(val2); result = (DeviceList_t)get_devices_with_cap_ret(arg1,arg2,arg3); { // result is of type DeviceList_t @@ -3678,10 +4387,26 @@ fail: return Qnil; } + +/* + Document-method: Rubycdio.get_drive_cap + + call-seq: + get_drive_cap(p_cdio) + get_drive_cap(device=nil) + +get_drive_cap()->(read_cap, write_cap, misc_cap) + +Get drive capabilities of device. + +In some situations of drivers or OS's we can't find a CD device if +there is no media in it. In this situation capabilities will show up as +empty even though there is a hardware CD-ROM.. +*/ SWIGINTERN VALUE _wrap_get_drive_cap__SWIG_0(int argc, VALUE *argv, VALUE self) { CdIo_t *arg1 = (CdIo_t *) 0 ; unsigned int *arg2 = (unsigned int *) 0 ; unsigned int *arg3 = (unsigned int *) 0 ; @@ -3702,14 +4427,15 @@ if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_CdIo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cdio_get_drive_cap" "', argument " "1"" of type '" "CdIo_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdIo_t const *","cdio_get_drive_cap", 1, argv[0] )); } arg1 = (CdIo_t *)(argp1); cdio_get_drive_cap((CdIo_t const *)arg1,arg2,arg3,arg4); + vresult = rb_ary_new(); if (SWIG_IsTmpObj(res2)) { vresult = SWIG_Ruby_AppendOutput(vresult, SWIG_From_unsigned_SS_int((*arg2))); } else { int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; vresult = SWIG_Ruby_AppendOutput(vresult, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_unsigned_int, new_flags)); @@ -3756,15 +4482,16 @@ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } if (argc > 0) { res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cdio_get_drive_cap_dev" "', argument " "1"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","cdio_get_drive_cap_dev", 1, argv[0] )); } arg1 = (char *)(buf1); } cdio_get_drive_cap_dev((char const *)arg1,arg2,arg3,arg4); + vresult = rb_ary_new(); if (SWIG_IsTmpObj(res2)) { vresult = SWIG_Ruby_AppendOutput(vresult, SWIG_From_unsigned_SS_int((*arg2))); } else { int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN | 0 ) : 0 ; vresult = SWIG_Ruby_AppendOutput(vresult, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_unsigned_int, new_flags)); @@ -3794,11 +4521,11 @@ VALUE argv[1]; int ii; argc = nargs; if (argc > 1) SWIG_fail; - for (ii = 0; (ii < argc); ii++) { + for (ii = 0; (ii < argc); ++ii) { argv[ii] = args[ii]; } if ((argc >= 0) && (argc <= 1)) { int _v; if (argc <= 0) { @@ -3819,15 +4546,30 @@ return _wrap_get_drive_cap__SWIG_0(nargs, args, self); } } fail: - rb_raise(rb_eArgError, "No matching function for overloaded 'get_drive_cap'"); + Ruby_Format_OverloadedError( argc, 1, "get_drive_cap", + " void get_drive_cap(CdIo_t const *p_cdio, unsigned int *p_read_cap, unsigned int *p_write_cap, unsigned int *p_misc_cap)\n" + " void get_drive_cap(char const *device, unsigned int *p_read_cap, unsigned int *p_write_cap, unsigned int *p_misc_cap)\n"); + return Qnil; } + +/* + Document-method: Rubycdio.get_driver_name + + call-seq: + get_driver_name(p_cdio) -> char + +get_driver_name(cdio)-> string + +return a string containing the name of the driver in use. +. +*/ SWIGINTERN VALUE _wrap_get_driver_name(int argc, VALUE *argv, VALUE self) { CdIo_t *arg1 = (CdIo_t *) 0 ; char *result = 0 ; void *argp1 = 0 ; @@ -3837,21 +4579,34 @@ if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_CdIo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cdio_get_driver_name" "', argument " "1"" of type '" "CdIo_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdIo_t const *","cdio_get_driver_name", 1, argv[0] )); } arg1 = (CdIo_t *)(argp1); result = (char *)cdio_get_driver_name((CdIo_t const *)arg1); vresult = SWIG_FromCharPtr((const char *)result); return vresult; fail: return Qnil; } + +/* + Document-method: Rubycdio.get_driver_id + + call-seq: + get_driver_id(p_cdio) -> driver_id_t + +get_driver_id(cdio)-> int + +Return the driver id of the driver in use. +if cdio has not been initialized or is nil, +return pycdio.DRIVER_UNKNOWN.. +*/ SWIGINTERN VALUE _wrap_get_driver_id(int argc, VALUE *argv, VALUE self) { CdIo_t *arg1 = (CdIo_t *) 0 ; driver_id_t result; void *argp1 = 0 ; @@ -3861,21 +4616,34 @@ if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_CdIo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cdio_get_driver_id" "', argument " "1"" of type '" "CdIo_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdIo_t const *","cdio_get_driver_id", 1, argv[0] )); } arg1 = (CdIo_t *)(argp1); result = (driver_id_t)cdio_get_driver_id((CdIo_t const *)arg1); vresult = SWIG_From_unsigned_SS_int((unsigned int)(result)); return vresult; fail: return Qnil; } + +/* + Document-method: Rubycdio.get_last_session + + call-seq: + get_last_session(p_cdio) -> driver_return_code_t + +get_driver_id(cdio)-> int + +Return the driver id of the driver in use. +if cdio has not been initialized or is nil, +return pycdio.DRIVER_UNKNOWN.. +*/ SWIGINTERN VALUE _wrap_get_last_session(int argc, VALUE *argv, VALUE self) { CdIo_t *arg1 = (CdIo_t *) 0 ; lsn_t *arg2 = (lsn_t *) 0 ; driver_return_code_t result; @@ -3889,11 +4657,11 @@ if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_CdIo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cdio_get_last_session" "', argument " "1"" of type '" "CdIo_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdIo_t *","cdio_get_last_session", 1, argv[0] )); } arg1 = (CdIo_t *)(argp1); result = (driver_return_code_t)cdio_get_last_session(arg1,arg2); vresult = SWIG_From_long((long)(result)); if (SWIG_IsTmpObj(res2)) { @@ -3906,10 +4674,22 @@ fail: return Qnil; } + +/* + Document-method: Rubycdio.have_driver + + call-seq: + have_driver(driver_id) -> int + +have_driver(driver_id) -> int + +Return 1 if we have driver driver_id, 0 if not and -1 +if driver id is out of range.. +*/ SWIGINTERN VALUE _wrap_have_driver(int argc, VALUE *argv, VALUE self) { unsigned int arg1 ; int result; unsigned int val1 ; @@ -3919,21 +4699,31 @@ if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1); if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "have_driver" "', argument " "1"" of type '" "unsigned int""'"); + SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "unsigned int","have_driver", 1, argv[0] )); } arg1 = (unsigned int)(val1); result = (int)have_driver(arg1); vresult = SWIG_From_int((int)(result)); return vresult; fail: return Qnil; } + +/* + Document-method: Rubycdio.ATAPI? + + call-seq: + ATAPI?(p_cdio) -> bool + +ATAPI?(CdIo_t *p_cdio)->bool +return True if CD-ROM understand ATAPI commands.. +*/ SWIGINTERN VALUE _wrap_ATAPIq___(int argc, VALUE *argv, VALUE self) { CdIo_t *arg1 = (CdIo_t *) 0 ; bool result; void *argp1 = 0 ; @@ -3943,21 +4733,36 @@ if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_CdIo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "have_ATAPI" "', argument " "1"" of type '" "CdIo_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdIo_t *","have_ATAPI", 1, argv[0] )); } arg1 = (CdIo_t *)(argp1); result = (bool)have_ATAPI(arg1); vresult = (result != 0) ? Qtrue : Qfalse; return vresult; fail: return Qnil; } + +/* + Document-method: Rubycdio.is_binfile + + call-seq: + is_binfile(bin_name) -> buf_t + +is_binfile(binfile_name)->cue_name + +Determine if binfile_name is the BIN file part of a CDRWIN CD disk +image. + +Return the corresponding CUE file if bin_name is a BIN file or +nil if not a BIN file.. +*/ SWIGINTERN VALUE _wrap_is_binfile(int argc, VALUE *argv, VALUE self) { char *arg1 = (char *) 0 ; buf_t result; int res1 ; @@ -3968,11 +4773,11 @@ if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cdio_is_binfile" "', argument " "1"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","cdio_is_binfile", 1, argv[0] )); } arg1 = (char *)(buf1); result = (buf_t)cdio_is_binfile((char const *)arg1); vresult = SWIG_FromCharPtr((const char *)result); if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); @@ -3981,10 +4786,25 @@ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return Qnil; } + +/* + Document-method: Rubycdio.is_cuefile + + call-seq: + is_cuefile(cue_name) -> buf_t + +is_cuefile(cuefile_name)->bin_name + +Determine if cuefile_name is the CUE file part of a CDRWIN CD disk +image. + +Return the corresponding BIN file if bin_name is a CUE file or +nil if not a CUE file.. +*/ SWIGINTERN VALUE _wrap_is_cuefile(int argc, VALUE *argv, VALUE self) { char *arg1 = (char *) 0 ; buf_t result; int res1 ; @@ -3995,11 +4815,11 @@ if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cdio_is_cuefile" "', argument " "1"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","cdio_is_cuefile", 1, argv[0] )); } arg1 = (char *)(buf1); result = (buf_t)cdio_is_cuefile((char const *)arg1); vresult = SWIG_FromCharPtr((const char *)result); if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); @@ -4008,10 +4828,25 @@ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return Qnil; } + +/* + Document-method: Rubycdio.cdio_is_device + + call-seq: + cdio_is_device(psz_source, driver_id=DRIVER_UNKNOWN) -> bool + +is_cuefile(cuefile_name)->bin_name + +Determine if cuefile_name is the CUE file part of a CDRWIN CD disk +image. + +Return the corresponding BIN file if bin_name is a CUE file or +nil if not a CUE file.. +*/ SWIGINTERN VALUE _wrap_cdio_is_device(int argc, VALUE *argv, VALUE self) { char *arg1 = (char *) 0 ; driver_id_t arg2 = (driver_id_t) DRIVER_UNKNOWN ; bool result; @@ -4025,17 +4860,17 @@ if ((argc < 1) || (argc > 2)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cdio_is_device" "', argument " "1"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","cdio_is_device", 1, argv[0] )); } arg1 = (char *)(buf1); if (argc > 1) { ecode2 = SWIG_AsVal_unsigned_SS_int(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cdio_is_device" "', argument " "2"" of type '" "driver_id_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "driver_id_t","cdio_is_device", 2, argv[1] )); } arg2 = (driver_id_t)(val2); } result = (bool)cdio_is_device((char const *)arg1,arg2); vresult = (result != 0) ? Qtrue : Qfalse; @@ -4045,10 +4880,25 @@ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return Qnil; } + +/* + Document-method: Rubycdio.device? + + call-seq: + device?(psz_source, driver_id) -> bool + +is_cuefile(cuefile_name)->bin_name + +Determine if cuefile_name is the CUE file part of a CDRWIN CD disk +image. + +Return the corresponding BIN file if bin_name is a CUE file or +nil if not a CUE file.. +*/ SWIGINTERN VALUE _wrap_deviceq___(int argc, VALUE *argv, VALUE self) { char *arg1 = (char *) 0 ; driver_id_t arg2 ; bool result; @@ -4062,16 +4912,16 @@ if ((argc < 2) || (argc > 2)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail; } res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "is_device" "', argument " "1"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","is_device", 1, argv[0] )); } arg1 = (char *)(buf1); ecode2 = SWIG_AsVal_unsigned_SS_int(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "is_device" "', argument " "2"" of type '" "driver_id_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "driver_id_t","is_device", 2, argv[1] )); } arg2 = (driver_id_t)(val2); result = (bool)is_device((char const *)arg1,arg2); vresult = (result != 0) ? Qtrue : Qfalse; if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); @@ -4080,10 +4930,21 @@ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return Qnil; } + +/* + Document-method: Rubycdio.nrg? + + call-seq: + nrg?(nrg_name) -> bool + +nrg?(cue_name)->bool + +Determine if nrg_name is a Nero CD disc image. +*/ SWIGINTERN VALUE _wrap_nrgq___(int argc, VALUE *argv, VALUE self) { char *arg1 = (char *) 0 ; bool result; int res1 ; @@ -4094,11 +4955,11 @@ if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cdio_is_nrg" "', argument " "1"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","cdio_is_nrg", 1, argv[0] )); } arg1 = (char *)(buf1); result = (bool)cdio_is_nrg((char const *)arg1); vresult = (result != 0) ? Qtrue : Qfalse; if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); @@ -4107,10 +4968,21 @@ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return Qnil; } + +/* + Document-method: Rubycdio.tocfile? + + call-seq: + tocfile?(tocfile_name) -> bool + +tocfile?(tocfile_name)->bool + +Determine if tocfile_name is a cdrdao CD disc image. +*/ SWIGINTERN VALUE _wrap_tocfileq___(int argc, VALUE *argv, VALUE self) { char *arg1 = (char *) 0 ; bool result; int res1 ; @@ -4121,11 +4993,11 @@ if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cdio_is_tocfile" "', argument " "1"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","cdio_is_tocfile", 1, argv[0] )); } arg1 = (char *)(buf1); result = (bool)cdio_is_tocfile((char const *)arg1); vresult = (result != 0) ? Qtrue : Qfalse; if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); @@ -4134,10 +5006,23 @@ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return Qnil; } + +/* + Document-method: Rubycdio.get_media_changed + + call-seq: + get_media_changed(p_cdio) -> int + +get_media_changed(cdio) -> int + +Find out if media has changed since the last call. +Return 1 if media has changed since last call, 0 if not. Error +return codes are the same as driver_return_code_t. +*/ SWIGINTERN VALUE _wrap_get_media_changed(int argc, VALUE *argv, VALUE self) { CdIo_t *arg1 = (CdIo_t *) 0 ; int result; void *argp1 = 0 ; @@ -4147,23 +5032,62 @@ if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_CdIo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cdio_get_media_changed" "', argument " "1"" of type '" "CdIo_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdIo_t *","cdio_get_media_changed", 1, argv[0] )); } arg1 = (CdIo_t *)(argp1); result = (int)cdio_get_media_changed(arg1); vresult = SWIG_From_int((int)(result)); return vresult; fail: return Qnil; } + +/* + Document-class: Rubycdio::HWInfo_t + + call-seq: + + +get_media_changed(cdio) -> int + +Find out if media has changed since the last call. +Return 1 if media has changed since last call, 0 if not. Error +return codes are the same as driver_return_code_t. +*/ swig_class cHWInfo_t; + +/* + Document-method: Rubycdio::HWInfo_t.hw + + call-seq: + hw -> cdio_hwinfo_t + +get_media_changed(cdio) -> int + +Find out if media has changed since the last call. +Return 1 if media has changed since last call, 0 if not. Error +return codes are the same as driver_return_code_t. +*/ + +/* + Document-method: Rubycdio::HWInfo_t.hw= + + call-seq: + hw=(x) -> cdio_hwinfo_t + +get_media_changed(cdio) -> int + +Find out if media has changed since the last call. +Return 1 if media has changed since last call, 0 if not. Error +return codes are the same as driver_return_code_t. +*/ SWIGINTERN VALUE _wrap_HWInfo_t_hw_set(int argc, VALUE *argv, VALUE self) { HWInfo_t *arg1 = (HWInfo_t *) 0 ; cdio_hwinfo_t arg2 ; void *argp1 = 0 ; @@ -4174,20 +5098,20 @@ if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_HWInfo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "hw" "', argument " "1"" of type '" "HWInfo_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "HWInfo_t *","hw", 1, self )); } arg1 = (HWInfo_t *)(argp1); { res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_cdio_hwinfo_t, 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "hw" "', argument " "2"" of type '" "cdio_hwinfo_t""'"); + SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "cdio_hwinfo_t","hw", 2, argv[0] )); } if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "hw" "', argument " "2"" of type '" "cdio_hwinfo_t""'"); + SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "cdio_hwinfo_t","hw", 2, argv[0])); } else { arg2 = *((cdio_hwinfo_t *)(argp2)); } } if (arg1) (arg1)->hw = arg2; @@ -4209,21 +5133,47 @@ if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_HWInfo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "hw" "', argument " "1"" of type '" "HWInfo_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "HWInfo_t *","hw", 1, self )); } arg1 = (HWInfo_t *)(argp1); result = ((arg1)->hw); vresult = SWIG_NewPointerObj((cdio_hwinfo_t *)memcpy((cdio_hwinfo_t *)malloc(sizeof(cdio_hwinfo_t)),&result,sizeof(cdio_hwinfo_t)), SWIGTYPE_p_cdio_hwinfo_t, SWIG_POINTER_OWN | 0 ); return vresult; fail: return Qnil; } + +/* + Document-method: Rubycdio::HWInfo_t.result + + call-seq: + result -> bool + +get_media_changed(cdio) -> int + +Find out if media has changed since the last call. +Return 1 if media has changed since last call, 0 if not. Error +return codes are the same as driver_return_code_t. +*/ + +/* + Document-method: Rubycdio::HWInfo_t.result= + + call-seq: + result=(x) -> bool + +get_media_changed(cdio) -> int + +Find out if media has changed since the last call. +Return 1 if media has changed since last call, 0 if not. Error +return codes are the same as driver_return_code_t. +*/ SWIGINTERN VALUE _wrap_HWInfo_t_result_set(int argc, VALUE *argv, VALUE self) { HWInfo_t *arg1 = (HWInfo_t *) 0 ; bool arg2 ; void *argp1 = 0 ; @@ -4234,16 +5184,16 @@ if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_HWInfo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "result" "', argument " "1"" of type '" "HWInfo_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "HWInfo_t *","result", 1, self )); } arg1 = (HWInfo_t *)(argp1); ecode2 = SWIG_AsVal_bool(argv[0], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "result" "', argument " "2"" of type '" "bool""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","result", 2, argv[0] )); } arg2 = (bool)(val2); if (arg1) (arg1)->result = arg2; return Qnil; @@ -4263,11 +5213,11 @@ if ((argc < 0) || (argc > 0)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_HWInfo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "result" "', argument " "1"" of type '" "HWInfo_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "HWInfo_t *","result", 1, self )); } arg1 = (HWInfo_t *)(argp1); result = (bool) ((arg1)->result); vresult = (result != 0) ? Qtrue : Qfalse; return vresult; @@ -4291,10 +5241,22 @@ #endif return vresult; } + +/* + Document-method: Rubycdio::HWInfo_t.new + + call-seq: + + +get_num_tracks(p_cdio)->int + +Return the number of tracks on the CD. +On error rubycdio::INVALID_TRACK is returned.. +*/ SWIGINTERN VALUE _wrap_new_HWInfo_t(int argc, VALUE *argv, VALUE self) { HWInfo_t *result = 0 ; if ((argc < 0) || (argc > 0)) { @@ -4311,10 +5273,23 @@ SWIGINTERN void free_HWInfo_t(HWInfo_t *arg1) { free((char *) arg1); } + +/* + Document-method: Rubycdio.get_hwinfo + + call-seq: + get_hwinfo(p_cdio) -> HWInfo_t + +get_media_changed(cdio) -> int + +Find out if media has changed since the last call. +Return 1 if media has changed since last call, 0 if not. Error +return codes are the same as driver_return_code_t. +*/ SWIGINTERN VALUE _wrap_get_hwinfo(int argc, VALUE *argv, VALUE self) { CdIo_t *arg1 = (CdIo_t *) 0 ; HWInfo_t result; void *argp1 = 0 ; @@ -4324,11 +5299,11 @@ if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_CdIo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "get_hwinfo" "', argument " "1"" of type '" "CdIo_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdIo_t const *","get_hwinfo", 1, argv[0] )); } arg1 = (CdIo_t *)(argp1); result = get_hwinfo((CdIo_t const *)arg1); { // result is of type HWInfo_t @@ -4350,10 +5325,21 @@ fail: return Qnil; } + +/* + Document-method: Rubycdio.set_blocksize + + call-seq: + set_blocksize(p_cdio, i_blocksize) -> driver_return_code_t + +set_blocksize(cdio, blocksize)->return_status + +Set the blocksize for subsequent reads.. +*/ SWIGINTERN VALUE _wrap_set_blocksize(int argc, VALUE *argv, VALUE self) { CdIo_t *arg1 = (CdIo_t *) 0 ; int arg2 ; driver_return_code_t result; @@ -4366,26 +5352,36 @@ if ((argc < 2) || (argc > 2)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_CdIo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cdio_set_blocksize" "', argument " "1"" of type '" "CdIo_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdIo_t const *","cdio_set_blocksize", 1, argv[0] )); } arg1 = (CdIo_t *)(argp1); ecode2 = SWIG_AsVal_int(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cdio_set_blocksize" "', argument " "2"" of type '" "int""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","cdio_set_blocksize", 2, argv[1] )); } arg2 = (int)(val2); result = (driver_return_code_t)cdio_set_blocksize((CdIo_t const *)arg1,arg2); vresult = SWIG_From_long((long)(result)); return vresult; fail: return Qnil; } + +/* + Document-method: Rubycdio.set_speed + + call-seq: + set_speed(p_cdio, i_speed) -> driver_return_code_t + +cdio_set_speed(cdio, speed)->return_status +Set the drive speed.. +*/ SWIGINTERN VALUE _wrap_set_speed(int argc, VALUE *argv, VALUE self) { CdIo_t *arg1 = (CdIo_t *) 0 ; int arg2 ; driver_return_code_t result; @@ -4398,26 +5394,45 @@ if ((argc < 2) || (argc > 2)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_CdIo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cdio_set_speed" "', argument " "1"" of type '" "CdIo_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdIo_t const *","cdio_set_speed", 1, argv[0] )); } arg1 = (CdIo_t *)(argp1); ecode2 = SWIG_AsVal_int(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cdio_set_speed" "', argument " "2"" of type '" "int""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","cdio_set_speed", 2, argv[1] )); } arg2 = (int)(val2); result = (driver_return_code_t)cdio_set_speed((CdIo_t const *)arg1,arg2); vresult = SWIG_From_long((long)(result)); return vresult; fail: return Qnil; } + +/* + Document-method: Rubycdio.open_cd + + call-seq: + open_cd(psz_source, driver_id=DRIVER_UNKNOWN, psz_access_mode=nil) -> CdIo_t + +open_cd(source=NULL, driver_id=nil, access_mode=nil) + +Sets up to read from place specified by source, driver_id and +access mode. This should be called before using any other routine +except those that act on a CD-ROM drive by name. + +If nil is given as the source, we'll use the default driver device. +If nil is given as the driver_id, we'll find a suitable device driver. + +Return the a pointer than can be used in subsequent operations or +nil on error or no device.. +*/ SWIGINTERN VALUE _wrap_open_cd(int argc, VALUE *argv, VALUE self) { char *arg1 = (char *) 0 ; driver_id_t arg2 = (driver_id_t) DRIVER_UNKNOWN ; char *arg3 = (char *) NULL ; @@ -4435,24 +5450,24 @@ if ((argc < 1) || (argc > 3)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "open_cd" "', argument " "1"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","open_cd", 1, argv[0] )); } arg1 = (char *)(buf1); if (argc > 1) { ecode2 = SWIG_AsVal_unsigned_SS_int(argv[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "open_cd" "', argument " "2"" of type '" "driver_id_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "driver_id_t","open_cd", 2, argv[1] )); } arg2 = (driver_id_t)(val2); } if (argc > 2) { res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3); if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "open_cd" "', argument " "3"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","open_cd", 3, argv[2] )); } arg3 = (char *)(buf3); } result = (CdIo_t *)open_cd((char const *)arg1,arg2,(char const *)arg3); vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CdIo_t, 0 | 0 ); @@ -4464,10 +5479,22 @@ if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return Qnil; } + +/* + Document-method: Rubycdio.get_disc_last_lsn + + call-seq: + get_disc_last_lsn(p_cdio) -> lsn_t + +get_disc_last_lsn(cdio)->lsn +Get the LSN of the end of the CD. + +perlcdio.INVALID_LSN is returned on error.. +*/ SWIGINTERN VALUE _wrap_get_disc_last_lsn(int argc, VALUE *argv, VALUE self) { CdIo_t *arg1 = (CdIo_t *) 0 ; lsn_t result; void *argp1 = 0 ; @@ -4477,21 +5504,34 @@ if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_CdIo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cdio_get_disc_last_lsn" "', argument " "1"" of type '" "CdIo_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdIo_t const *","cdio_get_disc_last_lsn", 1, argv[0] )); } arg1 = (CdIo_t *)(argp1); result = (lsn_t)cdio_get_disc_last_lsn((CdIo_t const *)arg1); vresult = SWIG_From_int((int)(result)); return vresult; fail: return Qnil; } + +/* + Document-method: Rubycdio.get_disc_mode + + call-seq: + get_disc_mode(p_cdio) -> char + +get_disc_mode(p_cdio) -> str + +Get disc mode - the kind of CD (CD-DA, CD-ROM mode 1, CD-MIXED, etc. +that we've got. The notion of 'CD' is extended a little to include +DVD's.. +*/ SWIGINTERN VALUE _wrap_get_disc_mode(int argc, VALUE *argv, VALUE self) { CdIo_t *arg1 = (CdIo_t *) 0 ; char *result = 0 ; void *argp1 = 0 ; @@ -4501,21 +5541,34 @@ if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_CdIo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "get_disc_mode" "', argument " "1"" of type '" "CdIo_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdIo_t *","get_disc_mode", 1, argv[0] )); } arg1 = (CdIo_t *)(argp1); result = (char *)get_disc_mode(arg1); vresult = SWIG_FromCharPtr((const char *)result); return vresult; fail: return Qnil; } + +/* + Document-method: Rubycdio.get_joliet_level + + call-seq: + get_joliet_level(p_cdio) -> int + +get_joliet_level(cdio)->int + +Return the Joliet level recognized for cdio. +This only makes sense for something that has an ISO-9660 +filesystem.. +*/ SWIGINTERN VALUE _wrap_get_joliet_level(int argc, VALUE *argv, VALUE self) { CdIo_t *arg1 = (CdIo_t *) 0 ; int result; void *argp1 = 0 ; @@ -4525,21 +5578,34 @@ if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_CdIo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cdio_get_joliet_level" "', argument " "1"" of type '" "CdIo_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdIo_t const *","cdio_get_joliet_level", 1, argv[0] )); } arg1 = (CdIo_t *)(argp1); result = (int)cdio_get_joliet_level((CdIo_t const *)arg1); vresult = SWIG_From_int((int)(result)); return vresult; fail: return Qnil; } + +/* + Document-method: Rubycdio.get_mcn + + call-seq: + get_mcn(p_cdio) -> char + +get_joliet_level(cdio)->int + +Return the Joliet level recognized for cdio. +This only makes sense for something that has an ISO-9660 +filesystem.. +*/ SWIGINTERN VALUE _wrap_get_mcn(int argc, VALUE *argv, VALUE self) { CdIo_t *arg1 = (CdIo_t *) 0 ; char *result = 0 ; void *argp1 = 0 ; @@ -4549,11 +5615,11 @@ if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_CdIo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cdio_get_mcn" "', argument " "1"" of type '" "CdIo_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdIo_t const *","cdio_get_mcn", 1, argv[0] )); } arg1 = (CdIo_t *)(argp1); result = (char *)cdio_get_mcn((CdIo_t const *)arg1); vresult = SWIG_FromCharPtr((const char *)result); free((char*)result); @@ -4561,10 +5627,22 @@ fail: return Qnil; } + +/* + Document-method: Rubycdio.get_num_tracks + + call-seq: + get_num_tracks(p_cdio) -> track_t + +get_num_tracks(p_cdio)->int + +Return the number of tracks on the CD. +On error rubycdio::INVALID_TRACK is returned.. +*/ SWIGINTERN VALUE _wrap_get_num_tracks(int argc, VALUE *argv, VALUE self) { CdIo_t *arg1 = (CdIo_t *) 0 ; track_t result; void *argp1 = 0 ; @@ -4574,11 +5652,11 @@ if ((argc < 1) || (argc > 1)) { rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; } res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_CdIo_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cdio_get_num_tracks" "', argument " "1"" of type '" "CdIo_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdIo_t const *","cdio_get_num_tracks", 1, argv[0] )); } arg1 = (CdIo_t *)(argp1); result = (track_t)cdio_get_num_tracks((CdIo_t const *)arg1); vresult = SWIG_From_unsigned_SS_int((unsigned int)(result)); return vresult; @@ -4594,14 +5672,14 @@ static swig_type_info _swigt__p_CdIo_t = {"_p_CdIo_t", "CdIo_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_HWInfo_t = {"_p_HWInfo_t", "HWInfo_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_cdio_hwinfo_t = {"_p_cdio_hwinfo_t", "cdio_hwinfo_t *", 0, 0, (void*)0, 0}; 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, (void*)0, 0}; static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_int = {"_p_int", "int *|lsn_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_long = {"_p_long", "long *|ssize_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_int = {"_p_int", "int *|lba_t *|track_flag_t *|lsn_t *|int16_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_long = {"_p_long", "my_ssize_t *|ssize_t *|long *|driver_return_code_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_off_t = {"_p_off_t", "off_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "unsigned int *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "track_t *|unsigned int *|cdio_drive_write_cap_t *|cdio_drive_misc_cap_t *|cdio_drive_read_cap_t *|driver_id_t *", 0, 0, (void*)0, 0}; static swig_type_info *swig_type_initial[] = { &_swigt__p_Buf_triple_t, &_swigt__p_CdIo_t, &_swigt__p_HWInfo_t, @@ -4867,10 +5945,12 @@ { /* c-mode */ #endif } #endif +/* +*/ #ifdef __cplusplus extern "C" #endif SWIGEXPORT void Init_rubycdio(void) { size_t i;