regular *mode2 variable name.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/* -*- c -*-
|
||||
$Id: cdio.h,v 1.35 2004/02/21 13:10:51 rocky Exp $
|
||||
$Id: cdio.h,v 1.36 2004/03/06 18:30:44 rocky Exp $
|
||||
|
||||
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
|
||||
Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
||||
@@ -278,21 +278,21 @@ extern "C" {
|
||||
from lsn. Returns 0 if no error.
|
||||
*/
|
||||
int cdio_read_mode1_sector (const CdIo *obj, void *buf, lsn_t lsn,
|
||||
bool is_form2);
|
||||
bool b_form2);
|
||||
|
||||
/*!
|
||||
Reads nblocks of mode1 sectors from cd device into data starting
|
||||
from lsn. Returns 0 if no error.
|
||||
*/
|
||||
int cdio_read_mode1_sectors (const CdIo *obj, void *buf, lsn_t lsn,
|
||||
bool is_form2, unsigned int num_sectors);
|
||||
bool b_form2, unsigned int num_sectors);
|
||||
|
||||
/*!
|
||||
Reads a single mode2 sector from cd device into data starting
|
||||
from lsn. Returns 0 if no error.
|
||||
*/
|
||||
int cdio_read_mode2_sector (const CdIo *obj, void *buf, lsn_t lsn,
|
||||
bool is_form2);
|
||||
bool b_form2);
|
||||
|
||||
/*!
|
||||
Reads nblocks of mode2 sectors from cd device into data starting
|
||||
@@ -300,7 +300,7 @@ extern "C" {
|
||||
Returns 0 if no error.
|
||||
*/
|
||||
int cdio_read_mode2_sectors (const CdIo *obj, void *buf, lsn_t lsn,
|
||||
bool is_form2, unsigned int num_sectors);
|
||||
bool b_form2, unsigned int num_sectors);
|
||||
|
||||
/*!
|
||||
Set the arg "key" with "value" in the source device.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
$Id: win32.c,v 1.2 2004/03/06 18:05:37 rocky Exp $
|
||||
$Id: win32.c,v 1.3 2004/03/06 18:30:44 rocky Exp $
|
||||
|
||||
Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
static const char _rcsid[] = "$Id: win32.c,v 1.2 2004/03/06 18:05:37 rocky Exp $";
|
||||
static const char _rcsid[] = "$Id: win32.c,v 1.3 2004/03/06 18:30:44 rocky Exp $";
|
||||
|
||||
#include <cdio/cdio.h>
|
||||
#include <cdio/sector.h>
|
||||
@@ -151,7 +151,7 @@ _cdio_read_audio_sectors (void *user_data, void *data, lsn_t lsn,
|
||||
*/
|
||||
static int
|
||||
_cdio_read_mode1_sector (void *user_data, void *data, lsn_t lsn,
|
||||
bool mode1_form2)
|
||||
bool b_form2)
|
||||
{
|
||||
_img_private_t *env = user_data;
|
||||
|
||||
@@ -172,7 +172,7 @@ _cdio_read_mode1_sector (void *user_data, void *data, lsn_t lsn,
|
||||
if ( env->hASPI ) {
|
||||
return 1;
|
||||
} else {
|
||||
return win32ioctl_read_mode1_sector( env, data, lsn, mode1_form2 );
|
||||
return win32ioctl_read_mode1_sector( env, data, lsn, b_form2 );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,14 +183,14 @@ _cdio_read_mode1_sector (void *user_data, void *data, lsn_t lsn,
|
||||
*/
|
||||
static int
|
||||
_cdio_read_mode1_sectors (void *user_data, void *data, lsn_t lsn,
|
||||
bool mode1_form2, unsigned int nblocks)
|
||||
bool b_form2, unsigned int nblocks)
|
||||
{
|
||||
_img_private_t *env = user_data;
|
||||
int i;
|
||||
int retval;
|
||||
|
||||
for (i = 0; i < nblocks; i++) {
|
||||
if (mode1_form2) {
|
||||
if (b_form2) {
|
||||
if ( (retval = _cdio_read_mode1_sector (env,
|
||||
((char *)data) + (M2RAW_SECTOR_SIZE * i),
|
||||
lsn + i, true)) )
|
||||
@@ -213,7 +213,7 @@ _cdio_read_mode1_sectors (void *user_data, void *data, lsn_t lsn,
|
||||
*/
|
||||
static int
|
||||
_cdio_read_mode2_sector (void *user_data, void *data, lsn_t lsn,
|
||||
bool mode2_form2)
|
||||
bool b_form2)
|
||||
{
|
||||
char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, };
|
||||
_img_private_t *env = user_data;
|
||||
@@ -236,13 +236,13 @@ _cdio_read_mode2_sector (void *user_data, void *data, lsn_t lsn,
|
||||
int ret;
|
||||
ret = wnaspi32_read_mode2_sector(user_data, buf, lsn);
|
||||
if( ret != 0 ) return ret;
|
||||
if (mode2_form2)
|
||||
if (b_form2)
|
||||
memcpy (data, buf, M2RAW_SECTOR_SIZE);
|
||||
else
|
||||
memcpy (((char *)data), buf + CDIO_CD_SUBHEADER_SIZE, CDIO_CD_FRAMESIZE);
|
||||
return 0;
|
||||
} else {
|
||||
return win32ioctl_read_mode2_sector( env, data, lsn, mode2_form2 );
|
||||
return win32ioctl_read_mode2_sector( env, data, lsn, b_form2 );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -253,14 +253,14 @@ _cdio_read_mode2_sector (void *user_data, void *data, lsn_t lsn,
|
||||
*/
|
||||
static int
|
||||
_cdio_read_mode2_sectors (void *user_data, void *data, lsn_t lsn,
|
||||
bool mode2_form2, unsigned int nblocks)
|
||||
bool b_form2, unsigned int nblocks)
|
||||
{
|
||||
_img_private_t *env = user_data;
|
||||
int i;
|
||||
int retval;
|
||||
|
||||
for (i = 0; i < nblocks; i++) {
|
||||
if (mode2_form2) {
|
||||
if (b_form2) {
|
||||
if ( (retval = _cdio_read_mode2_sector (env,
|
||||
((char *)data)
|
||||
+ (M2RAW_SECTOR_SIZE * i),
|
||||
|
||||
24
lib/cdio.c
24
lib/cdio.c
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
$Id: cdio.c,v 1.39 2004/03/05 04:23:52 rocky Exp $
|
||||
$Id: cdio.c,v 1.40 2004/03/06 18:30:44 rocky Exp $
|
||||
|
||||
Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
|
||||
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
|
||||
@@ -37,7 +37,7 @@
|
||||
#include <cdio/logging.h>
|
||||
#include "cdio_private.h"
|
||||
|
||||
static const char _rcsid[] = "$Id: cdio.c,v 1.39 2004/03/05 04:23:52 rocky Exp $";
|
||||
static const char _rcsid[] = "$Id: cdio.c,v 1.40 2004/03/06 18:30:44 rocky Exp $";
|
||||
|
||||
|
||||
const char *track_format2str[6] =
|
||||
@@ -674,16 +674,16 @@ cdio_read_audio_sectors (const CdIo *cdio, void *buf, lsn_t lsn,
|
||||
into data starting from lsn. Returns 0 if no error.
|
||||
*/
|
||||
int
|
||||
cdio_read_mode1_sector (const CdIo *cdio, void *data, lsn_t lsn, bool is_form2)
|
||||
cdio_read_mode1_sector (const CdIo *cdio, void *data, lsn_t lsn, bool b_form2)
|
||||
{
|
||||
uint32_t size = is_form2 ? M2RAW_SECTOR_SIZE : CDIO_CD_FRAMESIZE ;
|
||||
uint32_t size = b_form2 ? M2RAW_SECTOR_SIZE : CDIO_CD_FRAMESIZE ;
|
||||
char buf[M2RAW_SECTOR_SIZE] = { 0, };
|
||||
|
||||
cdio_assert (cdio != NULL);
|
||||
cdio_assert (data != NULL);
|
||||
|
||||
if (cdio->op.read_mode1_sector && cdio->op.read_mode1_sector) {
|
||||
return cdio->op.read_mode1_sector(cdio->env, data, lsn, is_form2);
|
||||
return cdio->op.read_mode1_sector(cdio->env, data, lsn, b_form2);
|
||||
} else if (cdio->op.lseek && cdio->op.read) {
|
||||
if (0 > cdio_lseek(cdio, CDIO_CD_FRAMESIZE*lsn, SEEK_SET))
|
||||
return -1;
|
||||
@@ -699,13 +699,13 @@ cdio_read_mode1_sector (const CdIo *cdio, void *data, lsn_t lsn, bool is_form2)
|
||||
|
||||
int
|
||||
cdio_read_mode1_sectors (const CdIo *cdio, void *buf, lsn_t lsn,
|
||||
bool is_form2, unsigned int num_sectors)
|
||||
bool b_form2, unsigned int num_sectors)
|
||||
{
|
||||
cdio_assert (cdio != NULL);
|
||||
cdio_assert (buf != NULL);
|
||||
cdio_assert (cdio->op.read_mode1_sectors != NULL);
|
||||
|
||||
return cdio->op.read_mode1_sectors (cdio->env, buf, lsn, is_form2,
|
||||
return cdio->op.read_mode1_sectors (cdio->env, buf, lsn, b_form2,
|
||||
num_sectors);
|
||||
}
|
||||
|
||||
@@ -715,7 +715,7 @@ cdio_read_mode1_sectors (const CdIo *cdio, void *buf, lsn_t lsn,
|
||||
*/
|
||||
int
|
||||
cdio_read_mode2_sector (const CdIo *cdio, void *buf, lsn_t lsn,
|
||||
bool is_form2)
|
||||
bool b_form2)
|
||||
{
|
||||
cdio_assert (cdio != NULL);
|
||||
cdio_assert (buf != NULL);
|
||||
@@ -723,24 +723,24 @@ cdio_read_mode2_sector (const CdIo *cdio, void *buf, lsn_t lsn,
|
||||
|| cdio->op.read_mode2_sectors != NULL);
|
||||
|
||||
if (cdio->op.read_mode2_sector)
|
||||
return cdio->op.read_mode2_sector (cdio->env, buf, lsn, is_form2);
|
||||
return cdio->op.read_mode2_sector (cdio->env, buf, lsn, b_form2);
|
||||
|
||||
/* fallback */
|
||||
if (cdio->op.read_mode2_sectors != NULL)
|
||||
return cdio_read_mode2_sectors (cdio, buf, lsn, is_form2, 1);
|
||||
return cdio_read_mode2_sectors (cdio, buf, lsn, b_form2, 1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
cdio_read_mode2_sectors (const CdIo *cdio, void *buf, lsn_t lsn,
|
||||
bool is_form2, unsigned int num_sectors)
|
||||
bool b_form2, unsigned int num_sectors)
|
||||
{
|
||||
cdio_assert (cdio != NULL);
|
||||
cdio_assert (buf != NULL);
|
||||
cdio_assert (cdio->op.read_mode2_sectors != NULL);
|
||||
|
||||
return cdio->op.read_mode2_sectors (cdio->env, buf, lsn,
|
||||
is_form2, num_sectors);
|
||||
b_form2, num_sectors);
|
||||
}
|
||||
|
||||
uint32_t
|
||||
|
||||
Reference in New Issue
Block a user