diff --git a/example/sample2.c b/example/sample2.c index 010d1534..b5421406 100644 --- a/example/sample2.c +++ b/example/sample2.c @@ -1,5 +1,5 @@ /* - $Id: sample2.c,v 1.7 2004/04/23 22:10:52 rocky Exp $ + $Id: sample2.c,v 1.8 2004/04/25 14:07:23 rocky Exp $ Copyright (C) 2003, 2004 Rocky Bernstein @@ -48,22 +48,22 @@ main(int argc, const char *argv[]) cdio_drive_cap_t i_drive_cap = cdio_get_drive_cap(cdio); printf("The default device for this driver is %s\n", default_device); printf("drive capability in hex: %x\n", i_drive_cap); - if (CDIO_DRIVE_ERROR == i_drive_cap) { + if (CDIO_DRIVE_CAP_ERROR == i_drive_cap) { printf("Error in getting drive properties\n"); - } else if (CDIO_DRIVE_UNKNOWN == i_drive_cap) { + } else if (CDIO_DRIVE_CAP_UNKNOWN == i_drive_cap) { printf("Can't determine drive properties\n"); - } else if (CDIO_DRIVE_FILE == i_drive_cap) { + } else if (CDIO_DRIVE_CAP_FILE == i_drive_cap) { printf("Disc-image file\n"); } else { - if (i_drive_cap & CDIO_DRIVE_CD_R) + if (i_drive_cap & CDIO_DRIVE_CAP_CD_R) printf("Drive can read CD-ROM\n"); - if (i_drive_cap & CDIO_DRIVE_CD_RW) + if (i_drive_cap & CDIO_DRIVE_CAP_CD_RW) printf("Drive can write CD-ROM\n"); - if (i_drive_cap & CDIO_DRIVE_DVD) + if (i_drive_cap & CDIO_DRIVE_CAP_DVD) printf("Drive can read DVD\n"); - if (i_drive_cap & CDIO_DRIVE_DVD_R) + if (i_drive_cap & CDIO_DRIVE_CAP_DVD_R) printf("Drive can write DVD-R\n"); - if (i_drive_cap & CDIO_DRIVE_DVD_RAM) + if (i_drive_cap & CDIO_DRIVE_CAP_DVD_RAM) printf("Drive can write DVD-RAM\n"); } } diff --git a/include/cdio/types.h b/include/cdio/types.h index 580499ad..5e41bfd1 100644 --- a/include/cdio/types.h +++ b/include/cdio/types.h @@ -1,5 +1,5 @@ /* - $Id: types.h,v 1.12 2004/04/25 00:46:34 rocky Exp $ + $Id: types.h,v 1.13 2004/04/25 14:07:23 rocky Exp $ Copyright (C) 2000 Herbert Valerio Riedel Copyright (C) 2002, 2003, 2004 Rocky Bernstein @@ -244,44 +244,48 @@ typedef int cdio_fs_anal_t; a capability. */ -#define CDIO_DRIVE_CLOSE_TRAY 0x00001 /**< caddy systems _can't_ close */ -#define CDIO_DRIVE_OPEN_TRAY 0x00002 /**< but _can_ eject. */ -#define CDIO_DRIVE_LOCK 0x00004 /**< disable manual eject */ -#define CDIO_DRIVE_SELECT_SPEED 0x00008 /**< programmable speed */ -#define CDIO_DRIVE_SELECT_DISC 0x00010 /**< select disc from juke-box */ -#define CDIO_DRIVE_MULTI_SESSION 0x00020 /**< read sessions>1 */ -#define CDIO_DRIVE_MCN 0x00040 /**< Medium Catalog Number */ -#define CDIO_DRIVE_MEDIA_CHANGED 0x00080 /**< media changed */ -#define CDIO_DRIVE_CD_AUDIO 0x00100 /**< drive can play CD audio */ -#define CDIO_DRIVE_RESET 0x00200 /**< hard reset device */ -#define CDIO_DRIVE_IOCTLS 0x00400 /**< driver has non-standard - ioctls */ -#define CDIO_DRIVE_DRIVE_STATUS 0x00800 /**< driver implements drive +#define CDIO_DRIVE_CAP_CLOSE_TRAY 0x00001 /**< caddy systems can't + close... */ +#define CDIO_DRIVE_CAP_OPEN_TRAY 0x00002 /**< but can eject. */ +#define CDIO_DRIVE_CAP_LOCK 0x00004 /**< disable manual eject */ +#define CDIO_DRIVE_CAP_SELECT_SPEED 0x00008 /**< programmable speed */ +#define CDIO_DRIVE_CAP_SELECT_DISC 0x00010 /**< select disc from juke-box */ +#define CDIO_DRIVE_CAP_MULTI_SESSION 0x00020 /**< read sessions>1 */ +#define CDIO_DRIVE_CAP_MCN 0x00040 /**< Medium Catalog Number */ +#define CDIO_DRIVE_CAP_MEDIA_CHANGED 0x00080 /**< media changed */ +#define CDIO_DRIVE_CAP_CD_AUDIO 0x00100 /**< drive can play CD audio */ +#define CDIO_DRIVE_CAP_RESET 0x00200 /**< hard reset device */ +#define CDIO_DRIVE_CAP_IOCTLS 0x00400 /**< driver has non-standard + ioctls */ +#define CDIO_DRIVE_CAP_DRIVE_STATUS 0x00800 /**< driver implements drive status */ -#define CDIO_DRIVE_GENERIC_PACKET 0x01000 /**< driver implements generic - packets */ -#define CDIO_DRIVE_CD_R 0x02000 /**< drive can write CD-R */ -#define CDIO_DRIVE_CD_RW 0x04000 /**< drive can write CD-RW */ -#define CDIO_DRIVE_DVD 0x08000 /**< drive can read DVD */ -#define CDIO_DRIVE_DVD_R 0x10000 /**< drive can write DVD-R */ -#define CDIO_DRIVE_DVD_RAM 0x20000 /**< drive can write DVD-RAM */ +#define CDIO_DRIVE_CAP_GENERIC_PACKET 0x01000 /**< driver implements generic + packets */ +#define CDIO_DRIVE_CAP_CD_R 0x02000 /**< drive can write CD-R */ +#define CDIO_DRIVE_CAP_CD_RW 0x04000 /**< drive can write CD-RW */ +#define CDIO_DRIVE_CAP_DVD 0x08000 /**< drive can read DVD */ +#define CDIO_DRIVE_CAP_DVD_R 0x10000 /**< drive can write DVD-R */ +#define CDIO_DRIVE_CAP_DVD_RAM 0x20000 /**< drive can write DVD-RAM */ /**< These are not taken by GNU/Linux cdrom.h (yet) */ -#define CDIO_DRIVE_ERROR 0x00000 /**< Error */ -#define CDIO_DRIVE_FILE 0x40000 /**< drive is really a file, i.e a - CD file image */ -#define CDIO_DRIVE_UNKNOWN 0x80000 /**< Dunno. It can be on if we +#define CDIO_DRIVE_CAP_ERROR 0x00000 /**< Error */ +#define CDIO_DRIVE_CAP_FILE 0x40000 /**< drive is really a file, i.e + a CD file image */ +#define CDIO_DRIVE_CAP_UNKNOWN 0x80000 /**< Dunno. It can be on if we have only partial information or are not completely certain */ /**< Masks derived from above... */ -#define CDIO_DRIVE_CD_WRITER (CDIO_DRIVE_CD_R|CDIO_DRIVE_CD_RW) +#define CDIO_DRIVE_CAP_CD_WRITER \ + (CDIO_DRIVE_CAP_CD_R|CDIO_DRIVE_CAP_CD_RW) /**< Has some sort of CD writer ability */ -#define CDIO_DRIVE_CD (CDIO_DRIVE_CD_AUDIO|CDIO_DRIVE_CD_WRITER) +#define CDIO_DRIVE_CAP_CD \ + (CDIO_DRIVE_CAP_CD_AUDIO|CDIO_DRIVE_CAP_CD_WRITER) /**< Has some sort of CD ability */ -#define CDIO_DRIVE_DVD_WRITER (CDIO_DRIVE_DVD_R|CDIO_DRIVE_DVD_RAM) +#define CDIO_DRIVE_CAP_DVD_WRITER \ + (CDIO_DRIVE_CAP_DVD_R|CDIO_DRIVE_CAP_DVD_RAM) /**< Has some sort of DVD writer ability */ #ifdef __cplusplus diff --git a/lib/MSWindows/ioctl.c b/lib/MSWindows/ioctl.c index ce94c467..6a93920e 100644 --- a/lib/MSWindows/ioctl.c +++ b/lib/MSWindows/ioctl.c @@ -1,5 +1,5 @@ /* - $Id: ioctl.c,v 1.9 2004/04/25 00:46:34 rocky Exp $ + $Id: ioctl.c,v 1.10 2004/04/25 14:07:23 rocky Exp $ Copyright (C) 2004 Rocky Bernstein @@ -26,7 +26,7 @@ # include "config.h" #endif -static const char _rcsid[] = "$Id: ioctl.c,v 1.9 2004/04/25 00:46:34 rocky Exp $"; +static const char _rcsid[] = "$Id: ioctl.c,v 1.10 2004/04/25 14:07:23 rocky Exp $"; #include #include @@ -489,23 +489,24 @@ win32ioctl_get_drive_cap (const void *env) { unsigned int n=sptwb.DataBuf[3]+4; /* Reader? */ - if (sptwb.DataBuf[n+5] & 0x01) i_drivetype |= CDIO_DRIVE_CD_AUDIO; - if (sptwb.DataBuf[n+2] & 0x02) i_drivetype |= CDIO_DRIVE_CD_RW; - if (sptwb.DataBuf[n+2] & 0x08) i_drivetype |= CDIO_DRIVE_DVD; + if (sptwb.DataBuf[n+5] & 0x01) i_drivetype |= CDIO_DRIVE_CAP_CD_AUDIO; + if (sptwb.DataBuf[n+2] & 0x02) i_drivetype |= CDIO_DRIVE_CAP_CD_RW; + if (sptwb.DataBuf[n+2] & 0x08) i_drivetype |= CDIO_DRIVE_CAP_DVD; /* Writer? */ - if (sptwb.DataBuf[n+3] & 0x01) i_drivetype |= CDIO_DRIVE_CD_R; - if (sptwb.DataBuf[n+3] & 0x10) i_drivetype |= CDIO_DRIVE_DVD_R; - if (sptwb.DataBuf[n+3] & 0x20) i_drivetype |= CDIO_DRIVE_DVD_RAM; + if (sptwb.DataBuf[n+3] & 0x01) i_drivetype |= CDIO_DRIVE_CAP_CD_R; + if (sptwb.DataBuf[n+3] & 0x10) i_drivetype |= CDIO_DRIVE_CAP_DVD_R; + if (sptwb.DataBuf[n+3] & 0x20) i_drivetype |= CDIO_DRIVE_CAP_DVD_RAM; - if (sptwb.DataBuf[n+6] & 0x08) i_drivetype |= CDIO_DRIVE_OPEN_TRAY; - if (sptwb.DataBuf[n+6] >> 5 != 0) i_drivetype |= CDIO_DRIVE_CLOSE_TRAY; + if (sptwb.DataBuf[n+6] & 0x08) i_drivetype |= CDIO_DRIVE_CAP_OPEN_TRAY; + if (sptwb.DataBuf[n+6] >> 5 != 0) + i_drivetype |= CDIO_DRIVE_CAP_CLOSE_TRAY; return i_drivetype; } else { - i_drivetype = CDIO_DRIVE_CD_AUDIO | CDIO_DRIVE_UNKNOWN; + i_drivetype = CDIO_DRIVE_CAP_CD_AUDIO | CDIO_DRIVE_CAP_UNKNOWN; } - return CDIO_DRIVE_ERROR; + return CDIO_DRIVE_CAP_ERROR; } #endif /*HAVE_WIN32_CDROM*/ diff --git a/lib/_cdio_linux.c b/lib/_cdio_linux.c index b7e9f868..5a89236a 100644 --- a/lib/_cdio_linux.c +++ b/lib/_cdio_linux.c @@ -1,5 +1,5 @@ /* - $Id: _cdio_linux.c,v 1.36 2004/04/25 03:52:37 rocky Exp $ + $Id: _cdio_linux.c,v 1.37 2004/04/25 14:07:23 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.36 2004/04/25 03:52:37 rocky Exp $"; +static const char _rcsid[] = "$Id: _cdio_linux.c,v 1.37 2004/04/25 14:07:23 rocky Exp $"; #include @@ -834,7 +834,7 @@ _cdio_get_drive_cap_linux (const void *env) { i_drivetype = ioctl (_obj->gen.fd, CDROM_GET_CAPABILITY, CDSL_CURRENT); - if (i_drivetype < 0) return CDIO_DRIVE_ERROR; + if (i_drivetype < 0) return CDIO_DRIVE_CAP_ERROR; /* If >= 0 we can safely cast as cdio_drive_cap_t and return */ return (cdio_drive_cap_t) i_drivetype; diff --git a/lib/_cdio_sunos.c b/lib/_cdio_sunos.c index 56e7fd1d..2bc79679 100644 --- a/lib/_cdio_sunos.c +++ b/lib/_cdio_sunos.c @@ -1,5 +1,5 @@ /* - $Id: _cdio_sunos.c,v 1.26 2004/04/25 03:52:37 rocky Exp $ + $Id: _cdio_sunos.c,v 1.27 2004/04/25 14:07:23 rocky Exp $ Copyright (C) 2001 Herbert Valerio Riedel Copyright (C) 2002, 2003, 2004 Rocky Bernstein @@ -41,7 +41,7 @@ #ifdef HAVE_SOLARIS_CDROM -static const char _rcsid[] = "$Id: _cdio_sunos.c,v 1.26 2004/04/25 03:52:37 rocky Exp $"; +static const char _rcsid[] = "$Id: _cdio_sunos.c,v 1.27 2004/04/25 14:07:23 rocky Exp $"; #include #include @@ -524,25 +524,26 @@ _cdio_get_drive_cap_solaris (const void *env) if(rc == 0) { unsigned int n=buf[3]+4; /* Reader? */ - if (buf[n+5] & 0x01) i_drivetype |= CDIO_DRIVE_CD_AUDIO; - if (buf[n+2] & 0x02) i_drivetype |= CDIO_DRIVE_CD_RW; - if (buf[n+2] & 0x08) i_drivetype |= CDIO_DRIVE_DVD; + if (buf[n+5] & 0x01) i_drivetype |= CDIO_DRIVE_CAP_CD_AUDIO; + if (buf[n+2] & 0x02) i_drivetype |= CDIO_DRIVE_CAP_CD_RW; + if (buf[n+2] & 0x08) i_drivetype |= CDIO_DRIVE_CAP_DVD; /* Writer? */ - if (buf[n+3] & 0x01) i_drivetype |= CDIO_DRIVE_CD_R; - if (buf[n+3] & 0x10) i_drivetype |= CDIO_DRIVE_DVD_R; - if (buf[n+3] & 0x20) i_drivetype |= CDIO_DRIVE_DVD_RAM; + if (buf[n+3] & 0x01) i_drivetype |= CDIO_DRIVE_CAP_CD_R; + if (buf[n+3] & 0x10) i_drivetype |= CDIO_DRIVE_CAP_DVD_R; + if (buf[n+3] & 0x20) i_drivetype |= CDIO_DRIVE_CAP_DVD_RAM; - if (buf[n+6] & 0x08) i_drivetype |= CDIO_DRIVE_OPEN_TRAY; - if (buf[n+6] >> 5 != 0) i_drivetype |= CDIO_DRIVE_CLOSE_TRAY; + if (buf[n+6] & 0x08) i_drivetype |= CDIO_DRIVE_CAP_OPEN_TRAY; + if (buf[n+6] >> 5 != 0) i_drivetype |= CDIO_DRIVE_CAP_CLOSE_TRAY; } else { - i_drivetype = CDIO_DRIVE_CD_AUDIO | CDIO_DRIVE_UNKNOWN; + i_drivetype = CDIO_DRIVE_CAP_CD_AUDIO | CDIO_DRIVE_CAP_UNKNOWN; } return i_drivetype; #else - return CDIO_DRIVE_UNKNOWN | CDIO_DRIVE_CD_AUDIO | CDIO_DRIVE_CD_RW; + return CDIO_DRIVE_CAP_UNKNOWN | CDIO_DRIVE_CAP_CD_AUDIO + | CDIO_DRIVE_CAP_CD_RW; #endif } diff --git a/lib/cdio.c b/lib/cdio.c index 6c41b550..6177ecb8 100644 --- a/lib/cdio.c +++ b/lib/cdio.c @@ -1,5 +1,5 @@ /* - $Id: cdio.c,v 1.46 2004/04/25 00:46:34 rocky Exp $ + $Id: cdio.c,v 1.47 2004/04/25 14:07:23 rocky Exp $ Copyright (C) 2003, 2004 Rocky Bernstein Copyright (C) 2001 Herbert Valerio Riedel @@ -37,7 +37,7 @@ #include #include "cdio_private.h" -static const char _rcsid[] = "$Id: cdio.c,v 1.46 2004/04/25 00:46:34 rocky Exp $"; +static const char _rcsid[] = "$Id: cdio.c,v 1.47 2004/04/25 14:07:23 rocky Exp $"; const char *track_format2str[6] = @@ -386,7 +386,7 @@ cdio_get_devices_with_cap (char* search_devices[], unsigned int cdio_get_drive_cap (const CdIo *cdio) { - cdio_drive_cap_t i_drivetype = CDIO_DRIVE_UNKNOWN; + cdio_drive_cap_t i_drivetype = CDIO_DRIVE_CAP_UNKNOWN; if (cdio && cdio->op.get_drive_cap) { i_drivetype=cdio->op.get_drive_cap(cdio->env); @@ -405,7 +405,7 @@ cdio_get_drive_cap (const CdIo *cdio) unsigned int cdio_get_drive_cap_dev (const char *device) { - cdio_drive_cap_t i_drivetype = CDIO_DRIVE_UNKNOWN; + cdio_drive_cap_t i_drivetype = CDIO_DRIVE_CAP_UNKNOWN; CdIo *cdio=scan_for_driver(CDIO_MIN_DRIVER, CDIO_MAX_DRIVER, device); diff --git a/lib/image/bincue.c b/lib/image/bincue.c index 908efdc2..0df0d474 100644 --- a/lib/image/bincue.c +++ b/lib/image/bincue.c @@ -1,5 +1,5 @@ /* - $Id: bincue.c,v 1.13 2004/04/25 01:19:58 rocky Exp $ + $Id: bincue.c,v 1.14 2004/04/25 14:07:23 rocky Exp $ Copyright (C) 2001 Herbert Valerio Riedel Copyright (C) 2002, 2003, 2004 Rocky Bernstein @@ -24,7 +24,7 @@ (*.cue). */ -static const char _rcsid[] = "$Id: bincue.c,v 1.13 2004/04/25 01:19:58 rocky Exp $"; +static const char _rcsid[] = "$Id: bincue.c,v 1.14 2004/04/25 14:07:23 rocky Exp $"; #include "cdio_assert.h" #include "cdio_private.h" @@ -756,7 +756,7 @@ _cdio_get_drive_cap_bincue (const void *env) { Also, we know we can't handle LOCK, OPEN_TRAY, CLOSE_TRAY, SELECT_SPEED, SELECT_DISC */ - return CDIO_DRIVE_FILE | CDIO_DRIVE_MCN | CDIO_DRIVE_CD_AUDIO ; + return CDIO_DRIVE_CAP_FILE | CDIO_DRIVE_CAP_MCN | CDIO_DRIVE_CAP_CD_AUDIO ; } /*! diff --git a/lib/image/nrg.c b/lib/image/nrg.c index be045784..ac48b734 100644 --- a/lib/image/nrg.c +++ b/lib/image/nrg.c @@ -1,5 +1,5 @@ /* - $Id: nrg.c,v 1.8 2004/04/25 01:19:58 rocky Exp $ + $Id: nrg.c,v 1.9 2004/04/25 14:07:23 rocky Exp $ Copyright (C) 2001, 2003 Herbert Valerio Riedel Copyright (C) 2003, 2004 Rocky Bernstein @@ -48,7 +48,7 @@ #include "cdio_private.h" #include "_cdio_stdio.h" -static const char _rcsid[] = "$Id: nrg.c,v 1.8 2004/04/25 01:19:58 rocky Exp $"; +static const char _rcsid[] = "$Id: nrg.c,v 1.9 2004/04/25 14:07:23 rocky Exp $"; /* structures used */ @@ -1090,7 +1090,7 @@ _cdio_get_drive_cap_nrg (const void *env) { Also, we know we can't handle LOCK, OPEN_TRAY, CLOSE_TRAY, SELECT_SPEED, SELECT_DISC */ - return CDIO_DRIVE_FILE | CDIO_DRIVE_MCN | CDIO_DRIVE_CD_AUDIO ; + return CDIO_DRIVE_CAP_FILE | CDIO_DRIVE_CAP_MCN | CDIO_DRIVE_CAP_CD_AUDIO ; } /*! diff --git a/src/util.c b/src/util.c index 7233a947..9159bd51 100644 --- a/src/util.c +++ b/src/util.c @@ -1,5 +1,5 @@ /* - $Id: util.c,v 1.6 2004/04/25 03:52:37 rocky Exp $ + $Id: util.c,v 1.7 2004/04/25 14:07:23 rocky Exp $ Copyright (C) 2003, 2004 Rocky Bernstein @@ -90,33 +90,34 @@ fillout_device_name(const char *device_name) void print_drive_capabilities(cdio_drive_cap_t i_drive_cap) { - if (CDIO_DRIVE_ERROR == i_drive_cap) { + if (CDIO_DRIVE_CAP_ERROR == i_drive_cap) { printf("Error in getting drive properties\n"); } else { printf("Hardware : %s\n", - i_drive_cap & CDIO_DRIVE_FILE ? "Disk Image" : "CD-ROM or DVD"); + i_drive_cap & CDIO_DRIVE_CAP_FILE + ? "Disk Image" : "CD-ROM or DVD"); printf("Can open tray : %s\n", - i_drive_cap & CDIO_DRIVE_OPEN_TRAY ? "Yes" : "No"); + i_drive_cap & CDIO_DRIVE_CAP_OPEN_TRAY ? "Yes" : "No"); printf("Can close tray : %s\n\n", - i_drive_cap & CDIO_DRIVE_OPEN_TRAY ? "Yes" : "No"); + i_drive_cap & CDIO_DRIVE_CAP_OPEN_TRAY ? "Yes" : "No"); printf("Compact Disc : %s\n", - i_drive_cap & CDIO_DRIVE_CD ? "Yes" : "No"); + i_drive_cap & CDIO_DRIVE_CAP_CD ? "Yes" : "No"); printf(" Can play audio : %s\n", - i_drive_cap & CDIO_DRIVE_CD_AUDIO ? "Yes" : "No"); + i_drive_cap & CDIO_DRIVE_CAP_CD_AUDIO ? "Yes" : "No"); printf(" Can read CD-RW : %s\n", - i_drive_cap & CDIO_DRIVE_CD_RW ? "Yes" : "No"); + i_drive_cap & CDIO_DRIVE_CAP_CD_RW ? "Yes" : "No"); printf(" Can write CD-R : %s\n\n", - i_drive_cap & CDIO_DRIVE_CD_R ? "Yes" : "No"); + i_drive_cap & CDIO_DRIVE_CAP_CD_R ? "Yes" : "No"); printf("Digital Versital Disc: %s\n", - i_drive_cap & CDIO_DRIVE_DVD ? "Yes" : "No"); + i_drive_cap & CDIO_DRIVE_CAP_DVD ? "Yes" : "No"); printf(" Can write DVD-R : %s\n", - i_drive_cap & CDIO_DRIVE_DVD_R ? "Yes" : "No"); + i_drive_cap & CDIO_DRIVE_CAP_DVD_R ? "Yes" : "No"); printf(" Can write DVD-RAM : %s\n", - i_drive_cap & CDIO_DRIVE_DVD_RAM ? "Yes" : "No"); + i_drive_cap & CDIO_DRIVE_CAP_DVD_RAM ? "Yes" : "No"); } - if (CDIO_DRIVE_UNKNOWN == i_drive_cap) { + if (CDIO_DRIVE_CAP_UNKNOWN == i_drive_cap) { printf("Not completely sure about drive properties\n\n"); } }