cygwin fixes mostly.

This commit is contained in:
rocky
2005-01-27 11:08:55 +00:00
parent 97bedb82a6
commit 18bda94aca
7 changed files with 41 additions and 40 deletions

View File

@@ -1,7 +1,7 @@
/* /*
$Id: aspi32.c,v 1.3 2005/01/01 15:08:48 rocky Exp $ $Id: aspi32.c,v 1.4 2005/01/27 11:08:55 rocky Exp $
Copyright (C) 2004 Rocky Bernstein <rocky@panix.com> Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com>
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -27,7 +27,7 @@
# include "config.h" # include "config.h"
#endif #endif
static const char _rcsid[] = "$Id: aspi32.c,v 1.3 2005/01/01 15:08:48 rocky Exp $"; static const char _rcsid[] = "$Id: aspi32.c,v 1.4 2005/01/27 11:08:55 rocky Exp $";
#include <cdio/cdio.h> #include <cdio/cdio.h>
#include <cdio/sector.h> #include <cdio/sector.h>
@@ -488,7 +488,7 @@ init_aspi (_img_private_t *env)
We return 0 if command completed successfully. We return 0 if command completed successfully.
*/ */
int int
run_scsi_cmd_aspi( const void *p_user_data, unsigned int i_timeout_ms, run_scsi_cmd_aspi( void *p_user_data, unsigned int i_timeout_ms,
unsigned int i_cdb, const scsi_mmc_cdb_t * p_cdb, unsigned int i_cdb, const scsi_mmc_cdb_t * p_cdb,
scsi_mmc_direction_t e_direction, scsi_mmc_direction_t e_direction,
unsigned int i_buf, /*in/out*/ void *p_buf ) unsigned int i_buf, /*in/out*/ void *p_buf )
@@ -550,7 +550,7 @@ run_scsi_cmd_aspi( const void *p_user_data, unsigned int i_timeout_ms,
Returns 0 if no error. Returns 0 if no error.
*/ */
static int static int
read_sectors_aspi (const _img_private_t *env, void *data, lsn_t lsn, read_sectors_aspi (_img_private_t *p_env, void *data, lsn_t lsn,
int sector_type, unsigned int nblocks) int sector_type, unsigned int nblocks)
{ {
scsi_mmc_cdb_t cdb = {{0, }}; scsi_mmc_cdb_t cdb = {{0, }};
@@ -602,7 +602,7 @@ read_sectors_aspi (const _img_private_t *env, void *data, lsn_t lsn,
i_buf = CDIO_CD_FRAMESIZE_RAW; i_buf = CDIO_CD_FRAMESIZE_RAW;
} }
return run_scsi_cmd_aspi(env, OP_TIMEOUT_MS, return run_scsi_cmd_aspi(p_env, OP_TIMEOUT_MS,
scsi_mmc_get_cmd_len(cdb.field[0]), scsi_mmc_get_cmd_len(cdb.field[0]),
&cdb, SCSI_MMC_DATA_READ, i_buf*nblocks, data); &cdb, SCSI_MMC_DATA_READ, i_buf*nblocks, data);
} }
@@ -612,11 +612,12 @@ read_sectors_aspi (const _img_private_t *env, void *data, lsn_t lsn,
Returns 0 if no error. Returns 0 if no error.
*/ */
int int
read_audio_sectors_aspi (_img_private_t *env, void *data, lsn_t lsn, read_audio_sectors_aspi (_img_private_t *p_env, void *data, lsn_t lsn,
unsigned int nblocks) unsigned int i_blocks)
{ {
if (read_sectors_aspi(env, data, lsn, CDIO_MMC_READ_TYPE_CDDA, 1)) { if (read_sectors_aspi(p_env, data, lsn, CDIO_MMC_READ_TYPE_CDDA, i_blocks)) {
return read_sectors_aspi(env, data, lsn, CDIO_MMC_READ_TYPE_ANY, 1); return read_sectors_aspi(p_env, data, lsn,
CDIO_MMC_READ_TYPE_ANY, i_blocks);
} }
return 0; return 0;
} }
@@ -626,10 +627,10 @@ read_audio_sectors_aspi (_img_private_t *env, void *data, lsn_t lsn,
from lsn. Returns 0 if no error. from lsn. Returns 0 if no error.
*/ */
int int
read_mode2_sector_aspi (const _img_private_t *env, void *data, lsn_t lsn, read_mode2_sector_aspi (_img_private_t *p_env, void *data, lsn_t lsn,
bool b_form2) bool b_form2)
{ {
return read_sectors_aspi(env, data, lsn, b_form2 return read_sectors_aspi(p_env, data, lsn, b_form2
? CDIO_MMC_READ_TYPE_M2F2 ? CDIO_MMC_READ_TYPE_M2F2
: CDIO_MMC_READ_TYPE_M2F1, : CDIO_MMC_READ_TYPE_M2F1,
1); 1);
@@ -640,10 +641,10 @@ read_mode2_sector_aspi (const _img_private_t *env, void *data, lsn_t lsn,
from lsn. Returns 0 if no error. from lsn. Returns 0 if no error.
*/ */
int int
read_mode1_sector_aspi (const _img_private_t *env, void *data, lsn_t lsn, read_mode1_sector_aspi (_img_private_t *p_env, void *data, lsn_t lsn,
bool b_form2) bool b_form2)
{ {
return read_sectors_aspi(env, data, lsn, CDIO_MMC_READ_TYPE_MODE1, 1); return read_sectors_aspi(p_env, data, lsn, CDIO_MMC_READ_TYPE_MODE1, 1);
} }
/*! /*!

View File

@@ -1,8 +1,8 @@
/* Win32 aspi specific */ /* Win32 aspi specific */
/* /*
$Id: aspi32.h,v 1.1 2004/12/18 17:29:32 rocky Exp $ $Id: aspi32.h,v 1.2 2005/01/27 11:08:55 rocky Exp $
Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com> Copyright (C) 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com>
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -210,13 +210,13 @@ int read_audio_sectors_aspi (_img_private_t *obj, void *data, lsn_t lsn,
Reads a single mode1 sector using the DeviceIoControl method into Reads a single mode1 sector using the DeviceIoControl method into
data starting from lsn. Returns 0 if no error. data starting from lsn. Returns 0 if no error.
*/ */
int read_mode1_sector_aspi (const _img_private_t *env, void *data, int read_mode1_sector_aspi (_img_private_t *env, void *data,
lsn_t lsn, bool b_form2); lsn_t lsn, bool b_form2);
/*! /*!
Reads a single mode2 sector from cd device into data starting Reads a single mode2 sector from cd device into data starting
from lsn. Returns 0 if no error. from lsn. Returns 0 if no error.
*/ */
int read_mode2_sector_aspi (const _img_private_t *env, void *data, lsn_t lsn, int read_mode2_sector_aspi (_img_private_t *env, void *data, lsn_t lsn,
bool b_form2); bool b_form2);
/*! /*!
@@ -240,7 +240,7 @@ bool read_toc_aspi (_img_private_t *env);
Return 0 if command completed successfully. Return 0 if command completed successfully.
*/ */
int run_scsi_cmd_aspi( const void *p_user_data, int run_scsi_cmd_aspi( void *p_user_data,
unsigned int i_timeout, unsigned int i_timeout,
unsigned int i_cdb, unsigned int i_cdb,
const scsi_mmc_cdb_t * p_cdb, const scsi_mmc_cdb_t * p_cdb,

View File

@@ -1,5 +1,5 @@
/* /*
$Id: win32.c,v 1.13 2005/01/24 00:23:18 rocky Exp $ $Id: win32.c,v 1.14 2005/01/27 11:08:55 rocky Exp $
Copyright (C) 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com> Copyright (C) 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com>
@@ -26,7 +26,7 @@
# include "config.h" # include "config.h"
#endif #endif
static const char _rcsid[] = "$Id: win32.c,v 1.13 2005/01/24 00:23:18 rocky Exp $"; static const char _rcsid[] = "$Id: win32.c,v 1.14 2005/01/27 11:08:55 rocky Exp $";
#include <cdio/cdio.h> #include <cdio/cdio.h>
#include <cdio/sector.h> #include <cdio/sector.h>
@@ -171,7 +171,7 @@ run_scsi_cmd_win32( void *p_user_data, unsigned int i_timeout_ms,
scsi_mmc_direction_t e_direction, scsi_mmc_direction_t e_direction,
unsigned int i_buf, /*in/out*/ void *p_buf ) unsigned int i_buf, /*in/out*/ void *p_buf )
{ {
const _img_private_t *p_env = p_user_data; _img_private_t *p_env = p_user_data;
if (p_env->hASPI) { if (p_env->hASPI) {
return run_scsi_cmd_aspi( p_env, i_timeout_ms, i_cdb, p_cdb, return run_scsi_cmd_aspi( p_env, i_timeout_ms, i_cdb, p_cdb,

View File

@@ -1,7 +1,7 @@
/* /*
$Id: win32.h,v 1.1 2004/12/18 17:29:32 rocky Exp $ $Id: win32.h,v 1.2 2005/01/27 11:08:55 rocky Exp $
Copyright (C) 2004 Rocky Bernstein <rocky@panix.com> Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com>
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -99,7 +99,7 @@ const char *is_cdrom_win32ioctl (const char drive_letter);
Return 0 if command completed successfully. Return 0 if command completed successfully.
*/ */
int run_scsi_cmd_win32ioctl( const void *p_user_data, int run_scsi_cmd_win32ioctl( void *p_user_data,
unsigned int i_timeout, unsigned int i_timeout,
unsigned int i_cdb, unsigned int i_cdb,
const scsi_mmc_cdb_t * p_cdb, const scsi_mmc_cdb_t * p_cdb,
@@ -109,13 +109,13 @@ int run_scsi_cmd_win32ioctl( const void *p_user_data,
/*! /*!
Initialize internal structures for CD device. Initialize internal structures for CD device.
*/ */
bool init_win32ioctl (_img_private_t *env); bool init_win32ioctl (_img_private_t *p_env);
/*! /*!
Read and cache the CD's Track Table of Contents and track info. Read and cache the CD's Track Table of Contents and track info.
Return true if successful or false if an error. Return true if successful or false if an error.
*/ */
bool read_toc_win32ioctl (_img_private_t *env); bool read_toc_win32ioctl (_img_private_t *p_env);
/*! /*!
Return the media catalog number MCN. Return the media catalog number MCN.
@@ -124,7 +124,7 @@ bool read_toc_win32ioctl (_img_private_t *env);
string when done with it. string when done with it.
*/ */
char *get_mcn_win32ioctl (const _img_private_t *env); char *get_mcn_win32ioctl (const _img_private_t *p_env);
/* /*
Read cdtext information for a CdIo object . Read cdtext information for a CdIo object .
@@ -132,7 +132,7 @@ char *get_mcn_win32ioctl (const _img_private_t *env);
return true on success, false on error or CD-TEXT information does return true on success, false on error or CD-TEXT information does
not exist. not exist.
*/ */
bool init_cdtext_win32ioctl (_img_private_t *env); bool init_cdtext_win32ioctl (_img_private_t *p_env);
/*! /*!
Return the the kind of drive capabilities of device. Return the the kind of drive capabilities of device.
@@ -141,7 +141,7 @@ bool init_cdtext_win32ioctl (_img_private_t *env);
string when done with it. string when done with it.
*/ */
void get_drive_cap_aspi (const _img_private_t *env, void get_drive_cap_aspi (const _img_private_t *p_env,
cdio_drive_read_cap_t *p_read_cap, cdio_drive_read_cap_t *p_read_cap,
cdio_drive_write_cap_t *p_write_cap, cdio_drive_write_cap_t *p_write_cap,
cdio_drive_misc_cap_t *p_misc_cap); cdio_drive_misc_cap_t *p_misc_cap);
@@ -153,7 +153,7 @@ void get_drive_cap_aspi (const _img_private_t *env,
string when done with it. string when done with it.
*/ */
void get_drive_cap_win32ioctl (const _img_private_t *env, void get_drive_cap_win32ioctl (const _img_private_t *p_env,
cdio_drive_read_cap_t *p_read_cap, cdio_drive_read_cap_t *p_read_cap,
cdio_drive_write_cap_t *p_write_cap, cdio_drive_write_cap_t *p_write_cap,
cdio_drive_misc_cap_t *p_misc_cap); cdio_drive_misc_cap_t *p_misc_cap);
@@ -161,7 +161,7 @@ void get_drive_cap_win32ioctl (const _img_private_t *env,
/*! /*!
Get the format (XA, DATA, AUDIO) of a track. Get the format (XA, DATA, AUDIO) of a track.
*/ */
track_format_t get_track_format_win32ioctl(const _img_private_t *env, track_format_t get_track_format_win32ioctl(const _img_private_t *p_env,
track_t i_track); track_t i_track);
void set_cdtext_field_win32(void *user_data, track_t i_track, void set_cdtext_field_win32(void *user_data, track_t i_track,

View File

@@ -1,5 +1,5 @@
/* /*
$Id: win32_ioctl.c,v 1.7 2005/01/19 17:25:50 rocky Exp $ $Id: win32_ioctl.c,v 1.8 2005/01/27 11:08:55 rocky Exp $
Copyright (C) 2004 Rocky Bernstein <rocky@panix.com> Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
@@ -26,7 +26,7 @@
# include "config.h" # include "config.h"
#endif #endif
static const char _rcsid[] = "$Id: win32_ioctl.c,v 1.7 2005/01/19 17:25:50 rocky Exp $"; static const char _rcsid[] = "$Id: win32_ioctl.c,v 1.8 2005/01/27 11:08:55 rocky Exp $";
#ifdef HAVE_WIN32_CDROM #ifdef HAVE_WIN32_CDROM
@@ -184,7 +184,7 @@ typedef struct _SUB_Q_MEDIA_CATALOG_NUMBER {
Return 0 if command completed successfully. Return 0 if command completed successfully.
*/ */
int int
run_scsi_cmd_win32ioctl( const void *p_user_data, run_scsi_cmd_win32ioctl( void *p_user_data,
unsigned int i_timeout_ms, unsigned int i_timeout_ms,
unsigned int i_cdb, const scsi_mmc_cdb_t * p_cdb, unsigned int i_cdb, const scsi_mmc_cdb_t * p_cdb,
scsi_mmc_direction_t e_direction, scsi_mmc_direction_t e_direction,
@@ -398,7 +398,7 @@ read_audio_sectors_win32ioctl (_img_private_t *p_env, void *data, lsn_t lsn,
data starting from lsn. Returns 0 if no error. data starting from lsn. Returns 0 if no error.
*/ */
static int static int
read_raw_sector (const _img_private_t *p_env, void *p_buf, lsn_t lsn) read_raw_sector (_img_private_t *p_env, void *p_buf, lsn_t lsn)
{ {
scsi_mmc_cdb_t cdb = {{0, }}; scsi_mmc_cdb_t cdb = {{0, }};

View File

@@ -1,6 +1,6 @@
/* Common SCSI Multimedia Command (MMC) routines. /* Common SCSI Multimedia Command (MMC) routines.
$Id: scsi_mmc.c,v 1.11 2005/01/24 00:06:31 rocky Exp $ $Id: scsi_mmc.c,v 1.12 2005/01/27 11:08:55 rocky Exp $
Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com> Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com>
@@ -288,7 +288,7 @@ scsi_mmc_get_drive_cap_private (void *p_env,
Get the DVD type associated with cd object. Get the DVD type associated with cd object.
*/ */
discmode_t discmode_t
scsi_mmc_get_dvd_struct_physical_private ( void *p_env, const scsi_mmc_get_dvd_struct_physical_private ( void *p_env,
scsi_mmc_run_cmd_fn_t run_scsi_mmc_cmd, scsi_mmc_run_cmd_fn_t run_scsi_mmc_cmd,
cdio_dvd_struct_t *s) cdio_dvd_struct_t *s)
{ {

View File

@@ -1,6 +1,6 @@
/* private MMC helper routines. /* private MMC helper routines.
$Id: scsi_mmc_private.h,v 1.5 2005/01/24 00:06:31 rocky Exp $ $Id: scsi_mmc_private.h,v 1.6 2005/01/27 11:08:55 rocky Exp $
Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com> Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com>
@@ -84,7 +84,7 @@ int scsi_mmc_set_blocksize_mmc_private ( const void *p_env, const
Get the DVD type associated with cd object. Get the DVD type associated with cd object.
*/ */
discmode_t discmode_t
scsi_mmc_get_dvd_struct_physical_private ( void *p_env, const scsi_mmc_get_dvd_struct_physical_private ( void *p_env,
scsi_mmc_run_cmd_fn_t run_scsi_mmc_cmd, scsi_mmc_run_cmd_fn_t run_scsi_mmc_cmd,
cdio_dvd_struct_t *s ); cdio_dvd_struct_t *s );