From 17c55ea59b97428b694052eeb2d4479f244900d4 Mon Sep 17 00:00:00 2001 From: rocky Date: Mon, 17 Jan 2005 17:20:09 +0000 Subject: [PATCH] add _t to another time. driver_id inside p_cdio wasn't initialized. --- lib/driver/FreeBSD/freebsd.c | 6 +++--- lib/driver/MSWindows/win32.c | 6 +++--- lib/driver/_cdio_aix.c | 8 +++++--- lib/driver/_cdio_bsdi.c | 8 +++++--- lib/driver/_cdio_linux.c | 8 +++++--- lib/driver/_cdio_osx.c | 8 +++++--- lib/driver/_cdio_sunos.c | 8 +++++--- lib/driver/cdio.c | 6 +++--- lib/driver/cdio_private.h | 8 ++++---- lib/driver/device.c | 8 ++++---- lib/driver/image/bincue.c | 17 +++++++++-------- lib/driver/image/cdrdao.c | 7 ++++--- lib/driver/image/nrg.c | 7 ++++--- 13 files changed, 59 insertions(+), 46 deletions(-) diff --git a/lib/driver/FreeBSD/freebsd.c b/lib/driver/FreeBSD/freebsd.c index f0202969..40b63dd3 100644 --- a/lib/driver/FreeBSD/freebsd.c +++ b/lib/driver/FreeBSD/freebsd.c @@ -1,5 +1,5 @@ /* - $Id: freebsd.c,v 1.2 2005/01/12 12:15:25 rocky Exp $ + $Id: freebsd.c,v 1.3 2005/01/17 17:20:09 rocky Exp $ Copyright (C) 2003, 2004 Rocky Bernstein @@ -27,7 +27,7 @@ # include "config.h" #endif -static const char _rcsid[] = "$Id: freebsd.c,v 1.2 2005/01/12 12:15:25 rocky Exp $"; +static const char _rcsid[] = "$Id: freebsd.c,v 1.3 2005/01/17 17:20:09 rocky Exp $"; #include "freebsd.h" @@ -554,7 +554,7 @@ cdio_open_am_freebsd (const char *psz_orig_source_name, _img_private_t *_data; char *psz_source_name; - cdio_funcs _funcs = { + cdio_funcs_t _funcs = { .eject_media = _eject_media_freebsd, .free = _free_freebsd, .get_arg = _get_arg_freebsd, diff --git a/lib/driver/MSWindows/win32.c b/lib/driver/MSWindows/win32.c index 7e444b8c..71f23fb2 100644 --- a/lib/driver/MSWindows/win32.c +++ b/lib/driver/MSWindows/win32.c @@ -1,5 +1,5 @@ /* - $Id: win32.c,v 1.4 2005/01/14 21:41:36 rocky Exp $ + $Id: win32.c,v 1.5 2005/01/17 17:20:09 rocky Exp $ Copyright (C) 2003, 2004, 2005 Rocky Bernstein @@ -26,7 +26,7 @@ # include "config.h" #endif -static const char _rcsid[] = "$Id: win32.c,v 1.4 2005/01/14 21:41:36 rocky Exp $"; +static const char _rcsid[] = "$Id: win32.c,v 1.5 2005/01/17 17:20:09 rocky Exp $"; #include #include @@ -726,7 +726,7 @@ cdio_open_am_win32 (const char *psz_orig_source, const char *psz_access_mode) _img_private_t *_data; char *psz_source; - cdio_funcs _funcs; + cdio_funcs_t _funcs; memset( &_funcs, 0, sizeof(_funcs) ); diff --git a/lib/driver/_cdio_aix.c b/lib/driver/_cdio_aix.c index b76cfa1b..bedd8a53 100644 --- a/lib/driver/_cdio_aix.c +++ b/lib/driver/_cdio_aix.c @@ -1,5 +1,5 @@ /* - $Id: _cdio_aix.c,v 1.2 2005/01/02 22:43:41 rocky Exp $ + $Id: _cdio_aix.c,v 1.3 2005/01/17 17:20:09 rocky Exp $ Copyright (C) 2004 Rocky Bernstein @@ -37,7 +37,7 @@ #ifdef HAVE_AIX_CDROM -static const char _rcsid[] = "$Id: _cdio_aix.c,v 1.2 2005/01/02 22:43:41 rocky Exp $"; +static const char _rcsid[] = "$Id: _cdio_aix.c,v 1.3 2005/01/17 17:20:09 rocky Exp $"; #ifdef HAVE_GLOB_H #include @@ -940,7 +940,7 @@ cdio_open_am_aix (const char *psz_orig_source, const char *access_mode) _img_private_t *_data; char *psz_source; - cdio_funcs _funcs; + cdio_funcs_t _funcs; _funcs.eject_media = eject_media_aix; _funcs.free = cdio_generic_free; @@ -996,6 +996,8 @@ cdio_open_am_aix (const char *psz_orig_source, const char *access_mode) } } + ret->driver_id = DRIVER_AIX; + ret = cdio_new ( (void *) _data, &_funcs ); if (ret == NULL) return NULL; diff --git a/lib/driver/_cdio_bsdi.c b/lib/driver/_cdio_bsdi.c index 3161e4e7..7f3e2cc1 100644 --- a/lib/driver/_cdio_bsdi.c +++ b/lib/driver/_cdio_bsdi.c @@ -1,5 +1,5 @@ /* - $Id: _cdio_bsdi.c,v 1.2 2005/01/02 22:43:41 rocky Exp $ + $Id: _cdio_bsdi.c,v 1.3 2005/01/17 17:20:09 rocky Exp $ Copyright (C) 2001 Herbert Valerio Riedel Copyright (C) 2002, 2003, 2004 Rocky Bernstein @@ -27,7 +27,7 @@ # include "config.h" #endif -static const char _rcsid[] = "$Id: _cdio_bsdi.c,v 1.2 2005/01/02 22:43:41 rocky Exp $"; +static const char _rcsid[] = "$Id: _cdio_bsdi.c,v 1.3 2005/01/17 17:20:09 rocky Exp $"; #include #include @@ -764,7 +764,7 @@ cdio_open_bsdi (const char *psz_orig_source) _img_private_t *_data; char *psz_source; - cdio_funcs _funcs = { + cdio_funcs_t _funcs = { .eject_media = _eject_media_bsdi, .free = cdio_generic_free, .get_arg = _get_arg_bsdi, @@ -822,6 +822,8 @@ cdio_open_bsdi (const char *psz_orig_source) ret = cdio_new ( (void *) _data, &_funcs); if (ret == NULL) return NULL; + ret->driver_id = DRIVER_BSDI; + if (_cdio_init(_data)) return ret; else { diff --git a/lib/driver/_cdio_linux.c b/lib/driver/_cdio_linux.c index 16f09cb9..624d4895 100644 --- a/lib/driver/_cdio_linux.c +++ b/lib/driver/_cdio_linux.c @@ -1,5 +1,5 @@ /* - $Id: _cdio_linux.c,v 1.6 2005/01/02 22:43:41 rocky Exp $ + $Id: _cdio_linux.c,v 1.7 2005/01/17 17:20:09 rocky Exp $ Copyright (C) 2001 Herbert Valerio Riedel Copyright (C) 2002, 2003, 2004 Rocky Bernstein @@ -27,7 +27,7 @@ # include "config.h" #endif -static const char _rcsid[] = "$Id: _cdio_linux.c,v 1.6 2005/01/02 22:43:41 rocky Exp $"; +static const char _rcsid[] = "$Id: _cdio_linux.c,v 1.7 2005/01/17 17:20:09 rocky Exp $"; #include @@ -1124,7 +1124,7 @@ cdio_open_am_linux (const char *psz_orig_source, const char *access_mode) _img_private_t *_data; char *psz_source; - cdio_funcs _funcs = { + cdio_funcs_t _funcs = { .eject_media = eject_media_linux, .free = cdio_generic_free, .get_arg = get_arg_linux, @@ -1190,6 +1190,8 @@ cdio_open_am_linux (const char *psz_orig_source, const char *access_mode) ret = cdio_new ((void *)_data, &_funcs); if (ret == NULL) return NULL; + ret->driver_id = DRIVER_LINUX; + if (cdio_generic_init(_data)) { return ret; } else { diff --git a/lib/driver/_cdio_osx.c b/lib/driver/_cdio_osx.c index 962618c5..478af3dd 100644 --- a/lib/driver/_cdio_osx.c +++ b/lib/driver/_cdio_osx.c @@ -1,5 +1,5 @@ /* - $Id: _cdio_osx.c,v 1.4 2005/01/14 22:04:24 rocky Exp $ + $Id: _cdio_osx.c,v 1.5 2005/01/17 17:20:09 rocky Exp $ Copyright (C) 2003, 2004, 2005 Rocky Bernstein from vcdimager code: @@ -34,7 +34,7 @@ #include "config.h" #endif -static const char _rcsid[] = "$Id: _cdio_osx.c,v 1.4 2005/01/14 22:04:24 rocky Exp $"; +static const char _rcsid[] = "$Id: _cdio_osx.c,v 1.5 2005/01/17 17:20:09 rocky Exp $"; #include #include @@ -1389,7 +1389,7 @@ cdio_open_osx (const char *psz_orig_source) _img_private_t *_data; char *psz_source; - cdio_funcs _funcs = { + cdio_funcs_t _funcs = { .eject_media = _eject_media_osx, .free = _free_osx, .get_arg = _get_arg_osx, @@ -1451,6 +1451,8 @@ cdio_open_osx (const char *psz_orig_source) ret = cdio_new ((void *)_data, &_funcs); if (ret == NULL) return NULL; + ret->driver_id = DRIVER_OSX; + if (cdio_generic_init(_data) && init_osx(_data)) return ret; else { diff --git a/lib/driver/_cdio_sunos.c b/lib/driver/_cdio_sunos.c index 05dac16f..ae59aa1a 100644 --- a/lib/driver/_cdio_sunos.c +++ b/lib/driver/_cdio_sunos.c @@ -1,5 +1,5 @@ /* - $Id: _cdio_sunos.c,v 1.5 2005/01/09 01:50:56 rocky Exp $ + $Id: _cdio_sunos.c,v 1.6 2005/01/17 17:20:09 rocky Exp $ Copyright (C) 2001 Herbert Valerio Riedel Copyright (C) 2002, 2003, 2004, 2005 Rocky Bernstein @@ -38,7 +38,7 @@ #ifdef HAVE_SOLARIS_CDROM -static const char _rcsid[] = "$Id: _cdio_sunos.c,v 1.5 2005/01/09 01:50:56 rocky Exp $"; +static const char _rcsid[] = "$Id: _cdio_sunos.c,v 1.6 2005/01/17 17:20:09 rocky Exp $"; #ifdef HAVE_GLOB_H #include @@ -854,7 +854,7 @@ cdio_open_am_solaris (const char *psz_orig_source, const char *access_mode) _img_private_t *_data; char *psz_source; - cdio_funcs _funcs; + cdio_funcs_t _funcs; _funcs.eject_media = eject_media_solaris; _funcs.free = cdio_generic_free; @@ -916,6 +916,8 @@ cdio_open_am_solaris (const char *psz_orig_source, const char *access_mode) ret = cdio_new ( (void *) _data, &_funcs ); if (ret == NULL) return NULL; + ret->driver_id = DRIVER_SOLARIS; + if (init_solaris(_data)) return ret; else { diff --git a/lib/driver/cdio.c b/lib/driver/cdio.c index 644c9074..418c3ba1 100644 --- a/lib/driver/cdio.c +++ b/lib/driver/cdio.c @@ -1,5 +1,5 @@ /* - $Id: cdio.c,v 1.8 2005/01/09 16:07:46 rocky Exp $ + $Id: cdio.c,v 1.9 2005/01/17 17:20:09 rocky Exp $ Copyright (C) 2003, 2004, 2005 Rocky Bernstein Copyright (C) 2001 Herbert Valerio Riedel @@ -35,7 +35,7 @@ #include #include "cdio_private.h" -static const char _rcsid[] = "$Id: cdio.c,v 1.8 2005/01/09 16:07:46 rocky Exp $"; +static const char _rcsid[] = "$Id: cdio.c,v 1.9 2005/01/17 17:20:09 rocky Exp $"; /*! @@ -74,7 +74,7 @@ cdio_get_cdtext (CdIo *obj, track_t i_track) } CdIo_t * -cdio_new (generic_img_private_t *p_env, cdio_funcs *p_funcs) +cdio_new (generic_img_private_t *p_env, cdio_funcs_t *p_funcs) { CdIo_t *p_new_cdio = _cdio_malloc (sizeof (CdIo_t)); diff --git a/lib/driver/cdio_private.h b/lib/driver/cdio_private.h index 11222c18..00ed298b 100644 --- a/lib/driver/cdio_private.h +++ b/lib/driver/cdio_private.h @@ -1,5 +1,5 @@ /* - $Id: cdio_private.h,v 1.4 2005/01/04 04:33:36 rocky Exp $ + $Id: cdio_private.h,v 1.5 2005/01/17 17:20:09 rocky Exp $ Copyright (C) 2003, 2004, 2005 Rocky Bernstein @@ -267,13 +267,13 @@ extern "C" { */ uint32_t (*stat_size) (void *p_env); - } cdio_funcs; + } cdio_funcs_t; /*! Implementation of CdIo type */ struct _CdIo { driver_id_t driver_id; /**< Particular driver opened. */ - cdio_funcs op; /**< driver-specific routines handling + cdio_funcs_t op; /**< driver-specific routines handling implementation*/ void *env; /**< environment. Passed to routine above. */ }; @@ -289,7 +289,7 @@ extern "C" { lba_t lba; /* Current LBA */ } internal_position_t; - CdIo * cdio_new (generic_img_private_t *p_env, cdio_funcs *funcs); + CdIo_t * cdio_new (generic_img_private_t *p_env, cdio_funcs_t *p_funcs); /* The below structure describes a specific CD Input driver */ typedef struct diff --git a/lib/driver/device.c b/lib/driver/device.c index c3784f95..09fadb45 100644 --- a/lib/driver/device.c +++ b/lib/driver/device.c @@ -1,5 +1,5 @@ /* - $Id: device.c,v 1.2 2005/01/14 19:25:45 rocky Exp $ + $Id: device.c,v 1.3 2005/01/17 17:20:09 rocky Exp $ Copyright (C) 2005 Rocky Bernstein @@ -530,10 +530,10 @@ cdio_get_drive_cap_dev (const char *device, then return NULL. */ const char * -cdio_get_driver_name (const CdIo_t *cdio) +cdio_get_driver_name (const CdIo_t *p_cdio) { - if (NULL==cdio) return NULL; - return CdIo_all_drivers[cdio->driver_id].name; + if (NULL==p_cdio) return NULL; + return CdIo_all_drivers[p_cdio->driver_id].name; } /*! diff --git a/lib/driver/image/bincue.c b/lib/driver/image/bincue.c index 4e13e353..8e959e8d 100644 --- a/lib/driver/image/bincue.c +++ b/lib/driver/image/bincue.c @@ -1,5 +1,5 @@ /* - $Id: bincue.c,v 1.4 2005/01/04 04:33:36 rocky Exp $ + $Id: bincue.c,v 1.5 2005/01/17 17:20:09 rocky Exp $ Copyright (C) 2002, 2003, 2004, 2005 Rocky Bernstein Copyright (C) 2001 Herbert Valerio Riedel @@ -26,7 +26,7 @@ (*.cue). */ -static const char _rcsid[] = "$Id: bincue.c,v 1.4 2005/01/04 04:33:36 rocky Exp $"; +static const char _rcsid[] = "$Id: bincue.c,v 1.5 2005/01/17 17:20:09 rocky Exp $"; #include "image.h" #include "cdio_assert.h" @@ -1093,7 +1093,7 @@ cdio_is_binfile(const char *psz_bin_name) get called via a function pointer. In fact *we* are the ones to set that up. */ -CdIo * +CdIo_t * cdio_open_am_bincue (const char *psz_source_name, const char *psz_access_mode) { if (psz_access_mode != NULL) @@ -1107,7 +1107,7 @@ cdio_open_am_bincue (const char *psz_source_name, const char *psz_access_mode) get called via a function pointer. In fact *we* are the ones to set that up. */ -CdIo * +CdIo_t * cdio_open_bincue (const char *source_name) { char *psz_bin_name = cdio_is_cuefile(source_name); @@ -1123,15 +1123,15 @@ cdio_open_bincue (const char *source_name) } } -CdIo * +CdIo_t * cdio_open_cue (const char *psz_cue_name) { - CdIo *ret; + CdIo_t *ret; _img_private_t *_data; char *psz_bin_name; - cdio_funcs _funcs; - + cdio_funcs_t _funcs; + memset( &_funcs, 0, sizeof(_funcs) ); _funcs.eject_media = _eject_media_image; @@ -1176,6 +1176,7 @@ cdio_open_cue (const char *psz_cue_name) return NULL; } + ret->driver_id = DRIVER_BINCUE; psz_bin_name = cdio_is_cuefile(psz_cue_name); if (NULL == psz_bin_name) { diff --git a/lib/driver/image/cdrdao.c b/lib/driver/image/cdrdao.c index 1b3912e7..2c328ecb 100644 --- a/lib/driver/image/cdrdao.c +++ b/lib/driver/image/cdrdao.c @@ -1,5 +1,5 @@ /* - $Id: cdrdao.c,v 1.5 2005/01/16 04:28:02 rocky Exp $ + $Id: cdrdao.c,v 1.6 2005/01/17 17:20:09 rocky Exp $ Copyright (C) 2004, 2005 Rocky Bernstein toc reading routine adapted from cuetools @@ -25,7 +25,7 @@ (*.cue). */ -static const char _rcsid[] = "$Id: cdrdao.c,v 1.5 2005/01/16 04:28:02 rocky Exp $"; +static const char _rcsid[] = "$Id: cdrdao.c,v 1.6 2005/01/17 17:20:09 rocky Exp $"; #include "image.h" #include "cdio_assert.h" @@ -1172,7 +1172,7 @@ cdio_open_cdrdao (const char *psz_cue_name) CdIo *ret; _img_private_t *_data; - cdio_funcs _funcs; + cdio_funcs_t _funcs; memset( &_funcs, 0, sizeof(_funcs) ); @@ -1220,6 +1220,7 @@ cdio_open_cdrdao (const char *psz_cue_name) return NULL; } + ret->driver_id = DRIVER_CDRDAO; if (!cdio_is_tocfile(psz_cue_name)) { cdio_debug ("source name %s is not recognized as a TOC file", psz_cue_name); diff --git a/lib/driver/image/nrg.c b/lib/driver/image/nrg.c index 53e1a0d1..a949a21f 100644 --- a/lib/driver/image/nrg.c +++ b/lib/driver/image/nrg.c @@ -1,5 +1,5 @@ /* - $Id: nrg.c,v 1.6 2005/01/12 11:34:52 rocky Exp $ + $Id: nrg.c,v 1.7 2005/01/17 17:20:09 rocky Exp $ Copyright (C) 2003, 2004, 2005 Rocky Bernstein Copyright (C) 2001, 2003 Herbert Valerio Riedel @@ -46,7 +46,7 @@ #include "_cdio_stdio.h" #include "nrg.h" -static const char _rcsid[] = "$Id: nrg.c,v 1.6 2005/01/12 11:34:52 rocky Exp $"; +static const char _rcsid[] = "$Id: nrg.c,v 1.7 2005/01/17 17:20:09 rocky Exp $"; /* reader */ @@ -1200,7 +1200,7 @@ cdio_open_nrg (const char *psz_source) CdIo *ret; _img_private_t *_data; - cdio_funcs _funcs; + cdio_funcs_t _funcs; memset( &_funcs, 0, sizeof(_funcs) ); @@ -1250,6 +1250,7 @@ cdio_open_nrg (const char *psz_source) return NULL; } + ret->driver_id = DRIVER_NRG; _set_arg_image(_data, "source", (NULL == psz_source) ? DEFAULT_CDIO_DEVICE: psz_source); _set_arg_image (_data, "access-mode", "Nero");