Change read routines so the use the driver_return_code_t enumeration.
It's a little cleaner and may make things clearer in debugging.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/* -*- c -*-
|
||||
$Id: cdio.h,v 1.76 2005/01/19 09:23:24 rocky Exp $
|
||||
$Id: cdio.h,v 1.77 2005/01/23 19:16:58 rocky Exp $
|
||||
|
||||
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
|
||||
Copyright (C) 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com>
|
||||
@@ -61,7 +61,14 @@ extern "C" {
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* Sector (frame, or block)-related functions. */
|
||||
/* Drive(r)/Device-related functions. Perhaps we should break out
|
||||
Driver from device?
|
||||
*/
|
||||
#include <cdio/device.h>
|
||||
|
||||
/* Sector (frame, or block)-related functions. Uses driver_return_code_t
|
||||
from <cdio/device.h> so it should come after that.
|
||||
*/
|
||||
#include <cdio/read.h>
|
||||
|
||||
/* CD-Text-related functions. */
|
||||
@@ -73,9 +80,4 @@ extern "C" {
|
||||
/* Disc-related functions. */
|
||||
#include <cdio/disc.h>
|
||||
|
||||
/* Drive(r)/Device-related functions. Perhaps we should break out
|
||||
Driver from device?
|
||||
*/
|
||||
#include <cdio/device.h>
|
||||
|
||||
#endif /* __CDIO_H__ */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* -*- c -*-
|
||||
$Id: device.h,v 1.7 2005/01/20 04:51:14 rocky Exp $
|
||||
$Id: device.h,v 1.8 2005/01/23 19:16:58 rocky Exp $
|
||||
|
||||
Copyright (C) 2005 Rocky Bernstein <rocky@panix.com>
|
||||
|
||||
@@ -102,10 +102,16 @@ extern "C" {
|
||||
#define CDIO_MAX_DRIVER DRIVER_NRG
|
||||
#define CDIO_MAX_DEVICE_DRIVER DRIVER_WIN32
|
||||
|
||||
/** There will generally be only one hardware for a given
|
||||
build/platform from the list above. You can use the variable
|
||||
below to determine which you've got. If the build doesn't make an
|
||||
hardware driver, then the value will be DRIVER_UNKNOWN.
|
||||
/** The following are status codes for completion of a given cdio
|
||||
operation. By design 0 is successful completion and -1 is error
|
||||
completion. This is compatable with ioctl so those routines that
|
||||
call ioctl can just pass the value the get back (cast as this
|
||||
enum). Also, by using negative numbers for errors, the
|
||||
enumeration values below can be used in places where a positive
|
||||
value is expected when things complete successfully. For example,
|
||||
get_blocksize returns the blocksize, but on error uses the error
|
||||
codes below. So note that this enumeration is often cast to an
|
||||
integer. C seems to tolerate this.
|
||||
*/
|
||||
typedef enum {
|
||||
DRIVER_OP_UNINIT = -3, /**< returned when a particular driver
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* -*- c -*-
|
||||
$Id: read.h,v 1.2 2005/01/20 04:51:14 rocky Exp $
|
||||
$Id: read.h,v 1.3 2005/01/23 19:16:58 rocky Exp $
|
||||
|
||||
Copyright (C) 2005 Rocky Bernstein <rocky@panix.com>
|
||||
|
||||
@@ -62,10 +62,9 @@ extern "C" {
|
||||
@param p_cdio object to read from
|
||||
@param p_buf place to read data into
|
||||
@param i_lsn sector to read
|
||||
|
||||
@return 0 if no error, nonzero otherwise.
|
||||
*/
|
||||
int cdio_read_audio_sector (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn);
|
||||
driver_return_code_t cdio_read_audio_sector (const CdIo_t *p_cdio,
|
||||
void *p_buf, lsn_t i_lsn);
|
||||
|
||||
/*!
|
||||
Reads audio sectors
|
||||
@@ -74,11 +73,10 @@ extern "C" {
|
||||
@param p_buf place to read data into
|
||||
@param i_lsn sector to read
|
||||
@param i_sectors number of sectors to read
|
||||
|
||||
@return 0 if no error, nonzero otherwise.
|
||||
*/
|
||||
int cdio_read_audio_sectors (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn,
|
||||
unsigned int i_sectors);
|
||||
driver_return_code_t cdio_read_audio_sectors (const CdIo_t *p_cdio,
|
||||
void *p_buf, lsn_t i_lsn,
|
||||
unsigned int i_sectors);
|
||||
|
||||
/*!
|
||||
Reads a mode 1 sector
|
||||
@@ -88,11 +86,10 @@ extern "C" {
|
||||
@param i_lsn sector to read
|
||||
@param b_form2 true for reading mode 1 form 2 sectors or false for
|
||||
mode 1 form 1 sectors.
|
||||
|
||||
@return 0 if no error, nonzero otherwise.
|
||||
*/
|
||||
int cdio_read_mode1_sector (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn,
|
||||
bool b_form2);
|
||||
driver_return_code_t cdio_read_mode1_sector (const CdIo_t *p_cdio,
|
||||
void *p_buf, lsn_t i_lsn,
|
||||
bool b_form2);
|
||||
|
||||
/*!
|
||||
Reads mode 1 sectors
|
||||
@@ -103,11 +100,11 @@ extern "C" {
|
||||
@param b_form2 true for reading mode 1 form 2 sectors or false for
|
||||
mode 1 form 1 sectors.
|
||||
@param i_sectors number of sectors to read
|
||||
|
||||
@return 0 if no error, nonzero otherwise.
|
||||
*/
|
||||
int cdio_read_mode1_sectors (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn,
|
||||
bool b_form2, unsigned int i_sectors);
|
||||
driver_return_code_t cdio_read_mode1_sectors (const CdIo_t *p_cdio,
|
||||
void *p_buf, lsn_t i_lsn,
|
||||
bool b_form2,
|
||||
unsigned int i_sectors);
|
||||
|
||||
/*!
|
||||
Reads a mode 2 sector
|
||||
@@ -120,8 +117,9 @@ extern "C" {
|
||||
|
||||
@return 0 if no error, nonzero otherwise.
|
||||
*/
|
||||
int cdio_read_mode2_sector (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn,
|
||||
bool b_form2);
|
||||
driver_return_code_t cdio_read_mode2_sector (const CdIo_t *p_cdio,
|
||||
void *p_buf, lsn_t i_lsn,
|
||||
bool b_form2);
|
||||
|
||||
/*!
|
||||
Reads mode 2 sectors
|
||||
@@ -135,8 +133,10 @@ extern "C" {
|
||||
|
||||
@return 0 if no error, nonzero otherwise.
|
||||
*/
|
||||
int cdio_read_mode2_sectors (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn,
|
||||
bool b_form2, unsigned int i_sectors);
|
||||
driver_return_code_t cdio_read_mode2_sectors (const CdIo_t *p_cdio,
|
||||
void *p_buf, lsn_t i_lsn,
|
||||
bool b_form2,
|
||||
unsigned int i_sectors);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user