diff --git a/include/cdio/cdio.h b/include/cdio/cdio.h index c7652886..b8c72c86 100644 --- a/include/cdio/cdio.h +++ b/include/cdio/cdio.h @@ -1,5 +1,5 @@ /* -*- c -*- - $Id: cdio.h,v 1.70 2004/12/31 05:47:36 rocky Exp $ + $Id: cdio.h,v 1.71 2005/01/02 22:43:41 rocky Exp $ Copyright (C) 2001 Herbert Valerio Riedel Copyright (C) 2003, 2004 Rocky Bernstein @@ -69,8 +69,11 @@ extern "C" { char psz_revision[CDIO_MMC_HW_REVISION_LEN+1]; } cdio_hwinfo_t; +/* For compatability. */ +#define CdIo CdIo_t + /** This is an opaque structure for the CD object. */ - typedef struct _CdIo CdIo; + typedef struct _CdIo CdIo_t; /** This is an opaque structure for the CD-Text object. */ typedef struct cdtext cdtext_t; @@ -126,17 +129,6 @@ extern "C" { #define CDIO_MAX_DRIVER DRIVER_NRG #define CDIO_MAX_DEVICE_DRIVER DRIVER_WIN32 - typedef enum { - TRACK_FORMAT_AUDIO, /**< Audio track, e.g. CD-DA */ - TRACK_FORMAT_CDI, /**< CD-i. How this is different from DATA below? */ - TRACK_FORMAT_XA, /**< Mode2 of some sort */ - TRACK_FORMAT_DATA, /**< Mode1 of some sort */ - TRACK_FORMAT_PSX, /**< Playstation CD. Like audio but only 2336 bytes - * of user data. - */ - TRACK_FORMAT_ERROR /**< Dunno what is, or some other error. */ - } track_format_t; - extern const char *discmode2str[]; /*! Printable tags for track_format_t enumeration. */ @@ -149,7 +141,7 @@ extern "C" { @return 0 if success and 1 for failure, and 2 if no routine. If the CD is ejected *p_cdio is freed and p_cdio set to NULL. */ - int cdio_eject_media (CdIo **p_cdio); + int cdio_eject_media (CdIo_t **p_cdio); /*! Free any resources associated with p_cdio. Call this when done using p_cdio @@ -157,7 +149,7 @@ extern "C" { @param p_cdio the CD object to eliminated. */ - void cdio_destroy (CdIo *p_cdio); + void cdio_destroy (CdIo_t *p_cdio); /*! Free device list returned by cdio_get_devices or @@ -179,10 +171,10 @@ extern "C" { @return the value associatd with "key" or NULL if p_cdio is NULL or "key" does not exist. */ - const char * cdio_get_arg (const CdIo *p_cdio, const char key[]); + const char * cdio_get_arg (const CdIo_t *p_cdio, const char key[]); /*! - Get CD-Text information for a CdIo object. + Get CD-Text information for a CdIo_t object. @param p_cdio the CD object that may contain CD-Text information. @param i_track track for which we are requesting CD-Text information. @@ -192,7 +184,7 @@ extern "C" { If i_track is 0 or CDIO_CDROM_LEADOUT_TRACK the track returned is the information assocated with the CD. */ - const cdtext_t *cdio_get_cdtext (CdIo *p_cdio, track_t i_track); + const cdtext_t *cdio_get_cdtext (CdIo_t *p_cdio, track_t i_track); /*! Get the default CD device. @@ -207,7 +199,7 @@ extern "C" { there is no media in it and it is possible for this routine to return NULL even though there may be a hardware CD-ROM. */ - char * cdio_get_default_device (const CdIo *p_cdio); + char * cdio_get_default_device (const CdIo_t *p_cdio); /*! Return an array of device names. If you want a specific devices for a driver, give that device. If you want hardware @@ -267,7 +259,7 @@ extern "C" { that we've got. The notion of "CD" is extended a little to include DVD's. */ - discmode_t cdio_get_discmode (CdIo *p_cdio); + discmode_t cdio_get_discmode (CdIo_t *p_cdio); /*! Get the what kind of device we've got. @@ -281,7 +273,7 @@ extern "C" { there is no media in it and it is possible for this routine to return NULL even though there may be a hardware CD-ROM. */ - void cdio_get_drive_cap (const CdIo *p_cdio, + void cdio_get_drive_cap (const CdIo_t *p_cdio, cdio_drive_read_cap_t *p_read_cap, cdio_drive_write_cap_t *p_write_cap, cdio_drive_misc_cap_t *p_misc_cap); @@ -303,19 +295,19 @@ extern "C" { /*! Get a string containing the name of the driver in use. - @return a string with driver name or NULL if CdIo is NULL (we + @return a string with driver name or NULL if CdIo_t is NULL (we haven't initialized a specific device. */ - const char * cdio_get_driver_name (const CdIo *p_cdio); + const char * cdio_get_driver_name (const CdIo_t *p_cdio); /*! Get the driver id. - if CdIo is NULL (we haven't initialized a specific device driver), + if CdIo_t is NULL (we haven't initialized a specific device driver), then return DRIVER_UNKNOWN. @return the driver id.. */ - driver_id_t cdio_get_driver_id (const CdIo *p_cdio); + driver_id_t cdio_get_driver_id (const CdIo_t *p_cdio); /*! Get the number of the first track. @@ -323,20 +315,20 @@ extern "C" { @return the track number or CDIO_INVALID_TRACK on error. */ - track_t cdio_get_first_track_num(const CdIo *p_cdio); + track_t cdio_get_first_track_num(const CdIo_t *p_cdio); /*! Get the CD-ROM hardware info via a SCSI MMC INQUIRY command. False is returned if we had an error getting the information. */ - bool cdio_get_hwinfo ( const CdIo *p_cdio, + bool cdio_get_hwinfo ( const CdIo_t *p_cdio, /* out*/ cdio_hwinfo_t *p_hw_info ); /*! Return the Joliet level recognized for p_cdio. */ - uint8_t cdio_get_joliet_level(const CdIo *p_cdio); + uint8_t cdio_get_joliet_level(const CdIo_t *p_cdio); /*! Get the media catalog number (MCN) from the CD. @@ -348,7 +340,7 @@ extern "C" { string when done with it. */ - char * cdio_get_mcn (const CdIo *p_cdio); + char * cdio_get_mcn (const CdIo_t *p_cdio); /*! Get the number of tracks on the CD. @@ -356,7 +348,7 @@ extern "C" { @return the number of tracks, or CDIO_INVALID_TRACK if there is an error. */ - track_t cdio_get_num_tracks (const CdIo *p_cdio); + track_t cdio_get_num_tracks (const CdIo_t *p_cdio); /*! Reposition read offset @@ -368,7 +360,7 @@ extern "C" { SEEK_SET or SEEK_END. @return (off_t) -1 on error. */ - off_t cdio_lseek(const CdIo *p_cdio, off_t offset, int whence); + off_t cdio_lseek(const CdIo_t *p_cdio, off_t offset, int whence); /*! Reads into buf the next size bytes. @@ -376,7 +368,7 @@ extern "C" { @return (ssize_t) -1 on error. */ - ssize_t cdio_read(const CdIo *p_cdio, void *buf, size_t size); + ssize_t cdio_read(const CdIo_t *p_cdio, void *buf, size_t size); /*! Read an audio sector @@ -387,7 +379,7 @@ extern "C" { @return 0 if no error, nonzero otherwise. */ - int cdio_read_audio_sector (const CdIo *p_cdio, void *buf, lsn_t lsn); + int cdio_read_audio_sector (const CdIo_t *p_cdio, void *buf, lsn_t lsn); /*! Reads audio sectors @@ -399,7 +391,7 @@ extern "C" { @return 0 if no error, nonzero otherwise. */ - int cdio_read_audio_sectors (const CdIo *p_cdio, void *buf, lsn_t lsn, + int cdio_read_audio_sectors (const CdIo_t *p_cdio, void *buf, lsn_t lsn, unsigned int i_sectors); /*! @@ -413,7 +405,7 @@ extern "C" { @return 0 if no error, nonzero otherwise. */ - int cdio_read_mode1_sector (const CdIo *p_cdio, void *p_buf, lsn_t i_lsn, + int cdio_read_mode1_sector (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn, bool b_form2); /*! @@ -428,7 +420,7 @@ extern "C" { @return 0 if no error, nonzero otherwise. */ - int cdio_read_mode1_sectors (const CdIo *p_cdio, void *p_buf, lsn_t i_lsn, + int cdio_read_mode1_sectors (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn, bool b_form2, unsigned int i_sectors); /*! @@ -442,7 +434,7 @@ extern "C" { @return 0 if no error, nonzero otherwise. */ - int cdio_read_mode2_sector (const CdIo *p_cdio, void *p_buf, lsn_t i_lsn, + int cdio_read_mode2_sector (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn, bool b_form2); /*! @@ -457,7 +449,7 @@ extern "C" { @return 0 if no error, nonzero otherwise. */ - int cdio_read_mode2_sectors (const CdIo *p_cdio, void *p_buf, lsn_t i_lsn, + int cdio_read_mode2_sectors (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn, bool b_form2, unsigned int i_sectors); /*! @@ -468,7 +460,7 @@ extern "C" { @param value the value to assocaiate with key @return 0 if no error was found, and nonzero otherwise. */ - int cdio_set_arg (CdIo *p_cdio, const char key[], const char value[]); + int cdio_set_arg (CdIo_t *p_cdio, const char key[], const char value[]); /*! Get the size of the CD in logical block address (LBA) units. @@ -476,7 +468,7 @@ extern "C" { @param p_cdio the CD object queried @return the size */ - uint32_t cdio_stat_size (const CdIo *p_cdio); + uint32_t cdio_stat_size (const CdIo_t *p_cdio); /*! Initialize CD Reading and control routines. Should be called first. @@ -535,7 +527,7 @@ extern "C" { @return the cdio object or NULL on error or no device. */ - CdIo * cdio_open (const char *source_name, driver_id_t driver_id); + CdIo_t * cdio_open (const char *source_name, driver_id_t driver_id); /*! Sets up to read from place specified by source_name, driver_id and access mode. This or cdio_open should be called before using @@ -545,36 +537,36 @@ extern "C" { @return the cdio object or NULL on error or no device. */ - CdIo * cdio_open_am (const char *psz_source_name, - driver_id_t driver_id, const char *psz_access_mode); + CdIo_t * cdio_open_am (const char *psz_source_name, + driver_id_t driver_id, const char *psz_access_mode); /*! Set up BIN/CUE CD disk-image for reading. Source is the .bin or .cue file @return the cdio object or NULL on error or no device. */ - CdIo * cdio_open_bincue (const char *psz_cue_name); + CdIo_t * cdio_open_bincue (const char *psz_cue_name); /*! Set up BIN/CUE CD disk-image for reading. Source is the .bin or .cue file @return the cdio object or NULL on error or no device.. */ - CdIo * cdio_open_am_bincue (const char *psz_cue_name, - const char *psz_access_mode); + CdIo_t * cdio_open_am_bincue (const char *psz_cue_name, + const char *psz_access_mode); /*! Set up cdrdao CD disk-image for reading. Source is the .toc file @return the cdio object or NULL on error or no device. */ - CdIo * cdio_open_cdrdao (const char *psz_toc_name); + CdIo_t * cdio_open_cdrdao (const char *psz_toc_name); /*! Set up cdrdao CD disk-image for reading. Source is the .toc file @return the cdio object or NULL on error or no device.. */ - CdIo * cdio_open_am_cdrdao (const char *psz_toc_name, - const char *psz_access_mode); + CdIo_t * cdio_open_am_cdrdao (const char *psz_toc_name, + const char *psz_access_mode); /*! Return a string containing the default CUE file that would be used when none is specified. @@ -600,7 +592,7 @@ extern "C" { @return the cdio object for subsequent operations. NULL on error or there is no driver for a some sort of hardware CD-ROM. */ - CdIo * cdio_open_cd (const char *device_name); + CdIo_t * cdio_open_cd (const char *device_name); /*! Set up CD-ROM for reading. The device_name is the some sort of device name. @@ -608,15 +600,15 @@ extern "C" { @return the cdio object for subsequent operations. NULL on error or there is no driver for a some sort of hardware CD-ROM. */ - CdIo * cdio_open_am_cd (const char *psz_device, - const char *psz_access_mode); + CdIo_t * cdio_open_am_cd (const char *psz_device, + const char *psz_access_mode); /*! CDRWIN BIN/CUE CD disc-image routines. Source is the .cue file @return the cdio object for subsequent operations. NULL on error. */ - CdIo * cdio_open_cue (const char *cue_name); + CdIo_t * cdio_open_cue (const char *cue_name); /*! Set up CD-ROM for reading using the AIX driver. The device_name is the some sort of device name. @@ -626,8 +618,8 @@ extern "C" { @see cdio_open */ - CdIo * cdio_open_am_aix (const char *psz_source_name, - const char *psz_access_mode); + CdIo_t * cdio_open_am_aix (const char *psz_source_name, + const char *psz_access_mode); /*! Set up CD-ROM for reading using the AIX driver. The device_name is the some sort of device name. @@ -637,7 +629,7 @@ extern "C" { @see cdio_open */ - CdIo * cdio_open_aix (const char *psz_source_name); + CdIo_t * cdio_open_aix (const char *psz_source_name); /*! Return a string containing the default device name that the BSDI driver would use when none is specified. @@ -666,7 +658,7 @@ extern "C" { @see cdio_open */ - CdIo * cdio_open_am_bsdi (const char *psz_source_name, + CdIo_t * cdio_open_am_bsdi (const char *psz_source_name, const char *psz_access_mode); /*! Set up CD-ROM for reading using the BSDI driver. The device_name is @@ -677,7 +669,7 @@ extern "C" { @see cdio_open */ - CdIo * cdio_open_bsdi (const char *psz_source_name); + CdIo_t * cdio_open_bsdi (const char *psz_source_name); /*! Set up CD-ROM for reading using the BSDI driver. The device_name is the some sort of device name. @@ -687,7 +679,7 @@ extern "C" { @see cdio_open */ - CdIo * cdio_open_am_bsdi (const char *psz_source_name, + CdIo_t * cdio_open_am_bsdi (const char *psz_source_name, const char *psz_access_mode); /*! Return a string containing the default device name that the @@ -716,7 +708,7 @@ extern "C" { @see cdio_open_cd, cdio_open */ - CdIo * cdio_open_freebsd (const char *paz_source_name); + CdIo_t * cdio_open_freebsd (const char *paz_source_name); /*! Set up CD-ROM for reading using the FreeBSD driver. The device_name is the some sort of device name. @@ -725,7 +717,7 @@ extern "C" { @see cdio_open_cd, cdio_open */ - CdIo * cdio_open_am_freebsd (const char *psz_source_name, + CdIo_t * cdio_open_am_freebsd (const char *psz_source_name, const char *psz_access_mode); /*! Return a string containing the default device name that the @@ -750,7 +742,7 @@ extern "C" { there is no media in it and it is possible for this routine to return NULL even though there may be a hardware CD-ROM. */ - CdIo * cdio_open_linux (const char *source_name); + CdIo_t * cdio_open_linux (const char *source_name); /*! Set up CD-ROM for reading using the GNU/Linux driver. The device_name is the some sort of device name. @@ -758,7 +750,7 @@ extern "C" { @return the cdio object for subsequent operations. NULL on error or there is no GNU/Linux driver. */ - CdIo * cdio_open_am_linux (const char *source_name, + CdIo_t * cdio_open_am_linux (const char *source_name, const char *access_mode); /*! Return a string containing the default device name that the @@ -786,7 +778,7 @@ extern "C" { @return the cdio object for subsequent operations. NULL on error or there is no Solaris driver. */ - CdIo * cdio_open_solaris (const char *source_name); + CdIo_t * cdio_open_solaris (const char *source_name); /*! Set up CD-ROM for reading using the Sun Solaris driver. The device_name is the some sort of device name. @@ -794,7 +786,7 @@ extern "C" { @return the cdio object for subsequent operations. NULL on error or there is no Solaris driver. */ - CdIo * cdio_open_am_solaris (const char *psz_source_name, + CdIo_t * cdio_open_am_solaris (const char *psz_source_name, const char *psz_access_mode); /*! Return a string containing the default device name that the @@ -827,7 +819,7 @@ extern "C" { @see cdio_open_cd, cdio_open */ - CdIo * cdio_open_osx (const char *psz_source_name); + CdIo_t * cdio_open_osx (const char *psz_source_name); /*! Set up CD-ROM for reading using the Apple OSX driver. The device_name is the some sort of device name. @@ -836,7 +828,7 @@ extern "C" { @see cdio_open_cd, cdio_open */ - CdIo * cdio_open_am_osx (const char *psz_source_name, + CdIo_t * cdio_open_am_osx (const char *psz_source_name, const char *psz_access_mode); /*! Return a string containing the default device name that the @@ -861,14 +853,14 @@ extern "C" { there is no media in it and it is possible for this routine to return NULL even though there may be a hardware CD-ROM. */ - CdIo * cdio_open_win32 (const char *source_name); + CdIo_t * cdio_open_win32 (const char *source_name); /*! Set up CD-ROM for reading using the Microsoft Windows driver. The device_name is the some sort of device name. NULL is returned on error or there is no Microsof Windows driver. */ - CdIo * cdio_open_am_win32 (const char *psz_source_name, + CdIo_t * cdio_open_am_win32 (const char *psz_source_name, const char *psz_access_mode); /*! Return a string containing the default device name that the @@ -890,15 +882,15 @@ extern "C" { @return true on success; NULL on error or there is no Nero driver. */ - CdIo * cdio_open_nrg (const char *source_name); + CdIo_t * cdio_open_nrg (const char *source_name); /*! Set up CD-ROM for reading using the Nero driver. The device_name is the some sort of device name. @return true on success; NULL on error or there is no Nero driver. */ - CdIo * cdio_open_am_nrg (const char *psz_source_name, - const char *psz_access_mode); + CdIo_t * cdio_open_am_nrg (const char *psz_source_name, + const char *psz_access_mode); /*! Return a string containing the default device name that the NRG driver would use when none is specified. A scan is made diff --git a/include/cdio/track.h b/include/cdio/track.h index ef07f7ea..e6cd9992 100644 --- a/include/cdio/track.h +++ b/include/cdio/track.h @@ -1,5 +1,5 @@ /* -*- c -*- - $Id: track.h,v 1.1 2004/12/31 05:48:09 rocky Exp $ + $Id: track.h,v 1.2 2005/01/02 22:43:41 rocky Exp $ Copyright (C) 2004 Rocky Bernstein @@ -28,6 +28,17 @@ extern "C" { #endif /* __cplusplus */ + typedef enum { + TRACK_FORMAT_AUDIO, /**< Audio track, e.g. CD-DA */ + TRACK_FORMAT_CDI, /**< CD-i. How this is different from DATA below? */ + TRACK_FORMAT_XA, /**< Mode2 of some sort */ + TRACK_FORMAT_DATA, /**< Mode1 of some sort */ + TRACK_FORMAT_PSX, /**< Playstation CD. Like audio but only 2336 bytes + * of user data. + */ + TRACK_FORMAT_ERROR /**< Dunno what is, or some other error. */ + } track_format_t; + typedef enum { CDIO_TRACK_FLAG_FALSE, CDIO_TRACK_FLAG_TRUE, diff --git a/lib/driver/_cdio_aix.c b/lib/driver/_cdio_aix.c index a59e0e5a..b76cfa1b 100644 --- a/lib/driver/_cdio_aix.c +++ b/lib/driver/_cdio_aix.c @@ -1,5 +1,5 @@ /* - $Id: _cdio_aix.c,v 1.1 2004/12/18 17:29:32 rocky Exp $ + $Id: _cdio_aix.c,v 1.2 2005/01/02 22:43:41 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.1 2004/12/18 17:29:32 rocky Exp $"; +static const char _rcsid[] = "$Id: _cdio_aix.c,v 1.2 2005/01/02 22:43:41 rocky Exp $"; #ifdef HAVE_GLOB_H #include @@ -920,7 +920,7 @@ cdio_get_devices_aix (void) get called via a function pointer. In fact *we* are the ones to set that up. */ -CdIo * +CdIo_t * cdio_open_aix (const char *psz_source_name) { return cdio_open_am_aix(psz_source_name, NULL); @@ -931,12 +931,12 @@ cdio_open_aix (const char *psz_source_name) get called via a function pointer. In fact *we* are the ones to set that up. */ -CdIo * +CdIo_t * cdio_open_am_aix (const char *psz_orig_source, const char *access_mode) { #ifdef HAVE_AIX_CDROM - CdIo *ret; + CdIo_t *ret; _img_private_t *_data; char *psz_source; diff --git a/lib/driver/_cdio_bsdi.c b/lib/driver/_cdio_bsdi.c index 7c9b675d..3161e4e7 100644 --- a/lib/driver/_cdio_bsdi.c +++ b/lib/driver/_cdio_bsdi.c @@ -1,5 +1,5 @@ /* - $Id: _cdio_bsdi.c,v 1.1 2004/12/18 17:29:32 rocky Exp $ + $Id: _cdio_bsdi.c,v 1.2 2005/01/02 22:43:41 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.1 2004/12/18 17:29:32 rocky Exp $"; +static const char _rcsid[] = "$Id: _cdio_bsdi.c,v 1.2 2005/01/02 22:43:41 rocky Exp $"; #include #include @@ -740,7 +740,7 @@ cdio_get_default_device_bsdi(void) get called via a function pointer. In fact *we* are the ones to set that up. */ -CdIo * +CdIo_t * cdio_open_am_bsdi (const char *psz_source_name, const char *psz_access_mode) { if (psz_access_mode != NULL) @@ -755,12 +755,12 @@ cdio_open_am_bsdi (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_bsdi (const char *psz_orig_source) { #ifdef HAVE_BSDI_CDROM - CdIo *ret; + CdIo_t *ret; _img_private_t *_data; char *psz_source; diff --git a/lib/driver/_cdio_generic.c b/lib/driver/_cdio_generic.c index 90df2384..319f90e5 100644 --- a/lib/driver/_cdio_generic.c +++ b/lib/driver/_cdio_generic.c @@ -1,5 +1,5 @@ /* - $Id: _cdio_generic.c,v 1.4 2005/01/01 15:08:48 rocky Exp $ + $Id: _cdio_generic.c,v 1.5 2005/01/02 22:43:41 rocky Exp $ Copyright (C) 2004 Rocky Bernstein @@ -25,7 +25,7 @@ # include "config.h" #endif -static const char _rcsid[] = "$Id: _cdio_generic.c,v 1.4 2005/01/01 15:08:48 rocky Exp $"; +static const char _rcsid[] = "$Id: _cdio_generic.c,v 1.5 2005/01/02 22:43:41 rocky Exp $"; #include #include @@ -234,7 +234,7 @@ cdio_add_device_list(char **device_list[], const char *drive, /*! - Get cdtext information for a CdIo object . + Get cdtext information for a CdIo_t object . @param obj the CD object that may contain CD-TEXT information. @return the CD-TEXT object or NULL if obj is NULL @@ -410,7 +410,7 @@ set_cdtext_field_generic(void *user_data, track_t i_track, } /*! - Read CD-Text information for a CdIo object . + Read CD-Text information for a CdIo_t object . return true on success, false on error or CD-TEXT information does not exist. diff --git a/lib/driver/_cdio_linux.c b/lib/driver/_cdio_linux.c index ac1d1968..16f09cb9 100644 --- a/lib/driver/_cdio_linux.c +++ b/lib/driver/_cdio_linux.c @@ -1,5 +1,5 @@ /* - $Id: _cdio_linux.c,v 1.5 2005/01/01 15:08:48 rocky Exp $ + $Id: _cdio_linux.c,v 1.6 2005/01/02 22:43:41 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.5 2005/01/01 15:08:48 rocky Exp $"; +static const char _rcsid[] = "$Id: _cdio_linux.c,v 1.6 2005/01/02 22:43:41 rocky Exp $"; #include @@ -1104,7 +1104,7 @@ cdio_get_default_device_linux(void) get called via a function pointer. In fact *we* are the ones to set that up. */ -CdIo * +CdIo_t * cdio_open_linux (const char *psz_source_name) { return cdio_open_am_linux(psz_source_name, NULL); @@ -1115,12 +1115,12 @@ cdio_open_linux (const char *psz_source_name) get called via a function pointer. In fact *we* are the ones to set that up. */ -CdIo * +CdIo_t * cdio_open_am_linux (const char *psz_orig_source, const char *access_mode) { #ifdef HAVE_LINUX_CDROM - CdIo *ret; + CdIo_t *ret; _img_private_t *_data; char *psz_source; diff --git a/lib/driver/cd_types.c b/lib/driver/cd_types.c index db32cb55..08ffa172 100644 --- a/lib/driver/cd_types.c +++ b/lib/driver/cd_types.c @@ -1,5 +1,5 @@ /* - $Id: cd_types.c,v 1.1 2004/12/18 17:29:32 rocky Exp $ + $Id: cd_types.c,v 1.2 2005/01/02 22:43:41 rocky Exp $ Copyright (C) 2003, 2004 Rocky Bernstein @@ -221,7 +221,7 @@ _cdio_get_joliet_level( void ) is returned in cdio_analysis and the return value. */ cdio_fs_anal_t -cdio_guess_cd_type(const CdIo *cdio, int start_session, track_t i_track, +cdio_guess_cd_type(const CdIo_t *cdio, int start_session, track_t i_track, /*out*/ cdio_iso_analysis_t *iso_analysis) { int ret = CDIO_FS_UNKNOWN; diff --git a/lib/driver/cdio.c b/lib/driver/cdio.c index 434976d0..bd8c018a 100644 --- a/lib/driver/cdio.c +++ b/lib/driver/cdio.c @@ -1,5 +1,5 @@ /* - $Id: cdio.c,v 1.3 2004/12/31 05:47:36 rocky Exp $ + $Id: cdio.c,v 1.4 2005/01/02 22:43:41 rocky Exp $ Copyright (C) 2003, 2004 Rocky Bernstein Copyright (C) 2001 Herbert Valerio Riedel @@ -39,7 +39,7 @@ #include #include "cdio_private.h" -static const char _rcsid[] = "$Id: cdio.c,v 1.3 2004/12/31 05:47:36 rocky Exp $"; +static const char _rcsid[] = "$Id: cdio.c,v 1.4 2005/01/02 22:43:41 rocky Exp $"; const char *track_format2str[6] = @@ -861,10 +861,10 @@ cdio_init(void) return true; } -CdIo * +CdIo_t * cdio_new (generic_img_private_t *p_env, cdio_funcs *p_funcs) { - CdIo *p_new_cdio = _cdio_malloc (sizeof (CdIo)); + CdIo_t *p_new_cdio = _cdio_malloc (sizeof (CdIo_t)); if (NULL == p_new_cdio) return NULL; @@ -881,7 +881,7 @@ cdio_new (generic_img_private_t *p_env, cdio_funcs *p_funcs) Free any resources associated with cdio. */ void -cdio_destroy (CdIo *cdio) +cdio_destroy (CdIo_t *cdio) { CdIo_last_driver = CDIO_DRIVER_UNINIT; if (cdio == NULL) return; @@ -897,7 +897,7 @@ cdio_destroy (CdIo *cdio) Similar to (if not the same as) libc's lseek() */ off_t -cdio_lseek (const CdIo *cdio, off_t offset, int whence) +cdio_lseek (const CdIo_t *cdio, off_t offset, int whence) { if (cdio == NULL) return -1; @@ -912,7 +912,7 @@ cdio_lseek (const CdIo *cdio, off_t offset, int whence) Similar to (if not the same as) libc's read() */ ssize_t -cdio_read (const CdIo *p_cdio, void *buf, size_t size) +cdio_read (const CdIo_t *p_cdio, void *buf, size_t size) { if (p_cdio == NULL) return -1; @@ -926,7 +926,7 @@ cdio_read (const CdIo *p_cdio, void *buf, size_t size) from lsn. Returns 0 if no error. */ int -cdio_read_audio_sector (const CdIo *p_cdio, void *buf, lsn_t lsn) +cdio_read_audio_sector (const CdIo_t *p_cdio, void *buf, lsn_t lsn) { if (NULL == p_cdio || NULL == buf || CDIO_INVALID_LSN == lsn ) @@ -942,7 +942,7 @@ cdio_read_audio_sector (const CdIo *p_cdio, void *buf, lsn_t lsn) from lsn. Returns 0 if no error. */ int -cdio_read_audio_sectors (const CdIo *p_cdio, void *buf, lsn_t lsn, +cdio_read_audio_sectors (const CdIo_t *p_cdio, void *buf, lsn_t lsn, unsigned int nblocks) { if ( NULL == p_cdio || NULL == buf || CDIO_INVALID_LSN == lsn ) @@ -962,7 +962,7 @@ cdio_read_audio_sectors (const CdIo *p_cdio, void *buf, lsn_t lsn, into data starting from lsn. Returns 0 if no error. */ int -cdio_read_mode1_sector (const CdIo *p_cdio, void *data, lsn_t lsn, +cdio_read_mode1_sector (const CdIo_t *p_cdio, void *data, lsn_t lsn, bool b_form2) { uint32_t size = b_form2 ? M2RAW_SECTOR_SIZE : CDIO_CD_FRAMESIZE ; @@ -987,7 +987,7 @@ cdio_read_mode1_sector (const CdIo *p_cdio, void *data, lsn_t lsn, } int -cdio_read_mode1_sectors (const CdIo *cdio, void *buf, lsn_t lsn, +cdio_read_mode1_sectors (const CdIo_t *cdio, void *buf, lsn_t lsn, bool b_form2, unsigned int num_sectors) { @@ -1005,7 +1005,7 @@ cdio_read_mode1_sectors (const CdIo *cdio, void *buf, lsn_t lsn, from lsn. Returns 0 if no error. */ int -cdio_read_mode2_sector (const CdIo *cdio, void *buf, lsn_t lsn, +cdio_read_mode2_sector (const CdIo_t *cdio, void *buf, lsn_t lsn, bool b_form2) { if (NULL == cdio || NULL == buf || CDIO_INVALID_LSN == lsn ) @@ -1024,7 +1024,7 @@ cdio_read_mode2_sector (const CdIo *cdio, void *buf, lsn_t lsn, } int -cdio_read_mode2_sectors (const CdIo *cdio, void *buf, lsn_t lsn, +cdio_read_mode2_sectors (const CdIo_t *cdio, void *buf, lsn_t lsn, bool b_form2, unsigned int num_sectors) { @@ -1038,7 +1038,7 @@ cdio_read_mode2_sectors (const CdIo *cdio, void *buf, lsn_t lsn, } uint32_t -cdio_stat_size (const CdIo *cdio) +cdio_stat_size (const CdIo_t *cdio) { cdio_assert (cdio != NULL); @@ -1049,7 +1049,7 @@ cdio_stat_size (const CdIo *cdio) Set the arg "key" with "value" in the source device. */ int -cdio_set_arg (CdIo *cdio, const char key[], const char value[]) +cdio_set_arg (CdIo_t *cdio, const char key[], const char value[]) { cdio_assert (cdio != NULL); cdio_assert (cdio->op.set_arg != NULL); @@ -1065,7 +1065,7 @@ cdio_set_arg (CdIo *cdio, const char key[], const char value[]) NULL is returned on error. */ -CdIo * +CdIo_t * cdio_open (const char *orig_source_name, driver_id_t driver_id) { return cdio_open_am(orig_source_name, driver_id, NULL); @@ -1078,7 +1078,7 @@ cdio_open (const char *orig_source_name, driver_id_t driver_id) NULL is returned on error. */ -CdIo * +CdIo_t * cdio_open_am (const char *psz_orig_source, driver_id_t driver_id, const char *psz_access_mode) { @@ -1094,7 +1094,7 @@ cdio_open_am (const char *psz_orig_source, driver_id_t driver_id, switch (driver_id) { case DRIVER_UNKNOWN: { - CdIo *cdio=scan_for_driver(CDIO_MIN_DRIVER, CDIO_MAX_DRIVER, + CdIo_t *cdio=scan_for_driver(CDIO_MIN_DRIVER, CDIO_MAX_DRIVER, psz_source, psz_access_mode); free(psz_source); return cdio; @@ -1102,7 +1102,7 @@ cdio_open_am (const char *psz_orig_source, driver_id_t driver_id, case DRIVER_DEVICE: { /* Scan for a driver. */ - CdIo *ret = cdio_open_am_cd(psz_source, psz_access_mode); + CdIo_t *ret = cdio_open_am_cd(psz_source, psz_access_mode); free(psz_source); return ret; } @@ -1118,7 +1118,7 @@ cdio_open_am (const char *psz_orig_source, driver_id_t driver_id, case DRIVER_BINCUE: case DRIVER_CDRDAO: if ((*CdIo_all_drivers[driver_id].have_driver)()) { - CdIo *ret = + CdIo_t *ret = (*CdIo_all_drivers[driver_id].driver_open_am)(psz_source, psz_access_mode); if (ret) ret->driver_id = driver_id; @@ -1139,7 +1139,7 @@ cdio_open_am (const char *psz_orig_source, driver_id_t driver_id, @return the cdio object for subsequent operations. NULL on error or there is no driver for a some sort of hardware CD-ROM. */ -CdIo * +CdIo_t * cdio_open_cd (const char *psz_source) { return cdio_open_am_cd(psz_source, NULL); @@ -1160,7 +1160,7 @@ cdio_open_cd (const char *psz_source) For now though, we'll start more simply... */ -CdIo * +CdIo_t * cdio_open_am_cd (const char *psz_source, const char *psz_access_mode) { if (CdIo_last_driver == -1) cdio_init(); diff --git a/lib/driver/scsi_mmc.c b/lib/driver/scsi_mmc.c index 04cf38f6..42ad881f 100644 --- a/lib/driver/scsi_mmc.c +++ b/lib/driver/scsi_mmc.c @@ -1,6 +1,6 @@ /* Common SCSI Multimedia Command (MMC) routines. - $Id: scsi_mmc.c,v 1.1 2004/12/18 17:29:32 rocky Exp $ + $Id: scsi_mmc.c,v 1.2 2005/01/02 22:43:41 rocky Exp $ Copyright (C) 2004 Rocky Bernstein @@ -50,7 +50,7 @@ especially tables 72, 73 and 75. */ discmode_t -scsi_mmc_get_discmode( const CdIo *p_cdio ) +scsi_mmc_get_discmode( const CdIo_t *p_cdio ) { uint8_t buf[14] = { 0, }; @@ -142,7 +142,7 @@ scsi_mmc_get_cmd_len(uint8_t scsi_cmd) We return 0 if command completed successfully and 1 if not. */ int -scsi_mmc_run_cmd( const CdIo *p_cdio, unsigned int i_timeout_ms, +scsi_mmc_run_cmd( const CdIo_t *p_cdio, unsigned int i_timeout_ms, const scsi_mmc_cdb_t *p_cdb, scsi_mmc_direction_t e_direction, unsigned int i_buf, /*in/out*/ void *p_buf ) @@ -201,7 +201,7 @@ scsi_mmc_get_blocksize_private ( const void *p_env, } int -scsi_mmc_get_blocksize ( const CdIo *p_cdio) +scsi_mmc_get_blocksize ( const CdIo_t *p_cdio) { if ( ! p_cdio ) return -2; return @@ -214,7 +214,7 @@ scsi_mmc_get_blocksize ( const CdIo *p_cdio) * Eject using SCSI MMC commands. Return 0 if successful. */ int -scsi_mmc_eject_media( const CdIo *p_cdio ) +scsi_mmc_eject_media( const CdIo_t *p_cdio ) { int i_status = 0; scsi_mmc_cdb_t cdb = {{0, }}; @@ -254,7 +254,7 @@ scsi_mmc_eject_media( const CdIo *p_cdio ) Can read only up to 25 blocks. */ int -scsi_mmc_read_sectors ( const CdIo *p_cdio, void *p_buf, lba_t lba, +scsi_mmc_read_sectors ( const CdIo_t *p_cdio, void *p_buf, lba_t lba, int sector_type, unsigned int nblocks ) { scsi_mmc_cdb_t cdb = {{0, }}; @@ -323,7 +323,7 @@ scsi_mmc_set_blocksize_private ( const void *p_env, } int -scsi_mmc_set_blocksize ( const CdIo *p_cdio, unsigned int i_bsize) +scsi_mmc_set_blocksize ( const CdIo_t *p_cdio, unsigned int i_bsize) { if ( ! p_cdio ) return -2; return @@ -424,7 +424,7 @@ scsi_mmc_get_drive_cap_private (const void *p_env, } void -scsi_mmc_get_drive_cap (const CdIo *p_cdio, +scsi_mmc_get_drive_cap (const CdIo_t *p_cdio, /*out*/ cdio_drive_read_cap_t *p_read_cap, /*out*/ cdio_drive_write_cap_t *p_write_cap, /*out*/ cdio_drive_misc_cap_t *p_misc_cap) @@ -510,7 +510,7 @@ scsi_mmc_get_dvd_struct_physical_private ( void *p_env, const Get the DVD type associated with cd object. */ discmode_t -scsi_mmc_get_dvd_struct_physical ( const CdIo *p_cdio, cdio_dvd_struct_t *s) +scsi_mmc_get_dvd_struct_physical ( const CdIo_t *p_cdio, cdio_dvd_struct_t *s) { if ( ! p_cdio ) return -2; return @@ -524,7 +524,7 @@ scsi_mmc_get_dvd_struct_physical ( const CdIo *p_cdio, cdio_dvd_struct_t *s) False is returned if we had an error getting the information. */ bool -scsi_mmc_get_hwinfo ( const CdIo *p_cdio, +scsi_mmc_get_hwinfo ( const CdIo_t *p_cdio, /*out*/ cdio_hwinfo_t *hw_info ) { int i_status; /* Result of SCSI MMC command */ @@ -594,7 +594,7 @@ scsi_mmc_get_mcn_private ( void *p_env, } char * -scsi_mmc_get_mcn ( const CdIo *p_cdio ) +scsi_mmc_get_mcn ( const CdIo_t *p_cdio ) { if ( ! p_cdio ) return NULL; return scsi_mmc_get_mcn_private (p_cdio->env, @@ -609,7 +609,7 @@ scsi_mmc_get_mcn_generic (const void *p_user_data) } /* - Read cdtext information for a CdIo object . + Read cdtext information for a CdIo_t object . return true on success, false on error or CD-Text information does not exist. diff --git a/lib/iso9660/iso9660_fs.c b/lib/iso9660/iso9660_fs.c index 22a2ff34..6643550c 100644 --- a/lib/iso9660/iso9660_fs.c +++ b/lib/iso9660/iso9660_fs.c @@ -1,5 +1,5 @@ /* - $Id: iso9660_fs.c,v 1.1 2004/12/18 17:29:32 rocky Exp $ + $Id: iso9660_fs.c,v 1.2 2005/01/02 22:43:41 rocky Exp $ Copyright (C) 2001 Herbert Valerio Riedel Copyright (C) 2003, 2004 Rocky Bernstein @@ -51,7 +51,7 @@ #include -static const char _rcsid[] = "$Id: iso9660_fs.c,v 1.1 2004/12/18 17:29:32 rocky Exp $"; +static const char _rcsid[] = "$Id: iso9660_fs.c,v 1.2 2005/01/02 22:43:41 rocky Exp $"; /* Implementation of iso9660_t type */ struct _iso9660 { @@ -453,7 +453,7 @@ iso9660_ifs_read_superblock (iso9660_t *p_iso, Read the Primary Volume Descriptor for of CD. */ bool -iso9660_fs_read_pvd(const CdIo *p_cdio, /*out*/ iso9660_pvd_t *p_pvd) +iso9660_fs_read_pvd(const CdIo_t *p_cdio, /*out*/ iso9660_pvd_t *p_pvd) { /* A bit of a hack, we'll assume track 1 contains ISO_PVD_SECTOR.*/ bool b_mode2; @@ -501,7 +501,7 @@ iso9660_fs_read_pvd(const CdIo *p_cdio, /*out*/ iso9660_pvd_t *p_pvd) Descriptor if (Joliet) extensions are acceptable. */ bool -iso9660_fs_read_superblock (CdIo *p_cdio, +iso9660_fs_read_superblock (CdIo_t *p_cdio, iso_extension_mask_t iso_extension_mask) { if (!p_cdio) return false; @@ -705,7 +705,7 @@ iso9660_dir_to_name (const iso9660_dir_t *iso9660_dir) Return a pointer to a ISO 9660 stat buffer or NULL if there's an error */ static iso9660_stat_t * -_fs_stat_root (CdIo *p_cdio) +_fs_stat_root (CdIo_t *p_cdio) { if (!p_cdio) return NULL; @@ -761,7 +761,7 @@ _fs_stat_iso_root (iso9660_t *p_iso) } static iso9660_stat_t * -_fs_stat_traverse (const CdIo *p_cdio, const iso9660_stat_t *_root, +_fs_stat_traverse (const CdIo_t *p_cdio, const iso9660_stat_t *_root, char **splitpath, bool b_mode2, bool translate) { unsigned offset = 0; @@ -944,7 +944,7 @@ _fs_iso_stat_traverse (iso9660_t *p_iso, const iso9660_stat_t *_root, Get file status for pathname into stat. NULL is returned on error. */ iso9660_stat_t * -iso9660_fs_stat (CdIo *p_cdio, const char pathname[]) +iso9660_fs_stat (CdIo_t *p_cdio, const char pathname[]) { iso9660_stat_t *p_root; char **p_psz_splitpath; @@ -974,7 +974,7 @@ iso9660_fs_stat (CdIo *p_cdio, const char pathname[]) are lowercased. */ iso9660_stat_t * -iso9660_fs_stat_translate (CdIo *p_cdio, const char pathname[], +iso9660_fs_stat_translate (CdIo_t *p_cdio, const char pathname[], bool b_mode2) { iso9660_stat_t *p_root; @@ -1051,7 +1051,7 @@ iso9660_ifs_stat_translate (iso9660_t *p_iso, const char pathname[]) of the files inside that. The caller must free the returned result. */ CdioList * -iso9660_fs_readdir (CdIo *p_cdio, const char pathname[], bool b_mode2) +iso9660_fs_readdir (CdIo_t *p_cdio, const char pathname[], bool b_mode2) { iso9660_stat_t *p_stat; generic_img_private_t *p_env = (generic_img_private_t *) p_cdio->env; @@ -1182,7 +1182,7 @@ iso9660_ifs_readdir (iso9660_t *p_iso, const char pathname[]) } static iso9660_stat_t * -find_fs_lsn_recurse (CdIo *p_cdio, const char pathname[], lsn_t lsn) +find_fs_lsn_recurse (CdIo_t *p_cdio, const char pathname[], lsn_t lsn) { CdioList *entlist = iso9660_fs_readdir (p_cdio, pathname, true); CdioList *dirlist = _cdio_list_new (); @@ -1244,7 +1244,7 @@ find_fs_lsn_recurse (CdIo *p_cdio, const char pathname[], lsn_t lsn) Returns stat_t of entry if we found lsn, or NULL otherwise. */ iso9660_stat_t * -iso9660_find_fs_lsn(CdIo *p_cdio, lsn_t i_lsn) +iso9660_find_fs_lsn(CdIo_t *p_cdio, lsn_t i_lsn) { return find_fs_lsn_recurse (p_cdio, "/", i_lsn); }