CDIO_DRIVE -> CDIO_DRIVE_CAP

This commit is contained in:
rocky
2004-04-25 14:07:23 +00:00
parent 36507b3c10
commit 20974d4568
9 changed files with 94 additions and 87 deletions

View File

@@ -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 <rocky@panix.com> Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
@@ -48,22 +48,22 @@ main(int argc, const char *argv[])
cdio_drive_cap_t i_drive_cap = cdio_get_drive_cap(cdio); 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("The default device for this driver is %s\n", default_device);
printf("drive capability in hex: %x\n", i_drive_cap); 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"); 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"); 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"); printf("Disc-image file\n");
} else { } 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"); 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"); 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"); 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"); 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"); printf("Drive can write DVD-RAM\n");
} }
} }

View File

@@ -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 <hvr@gnu.org> Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com> Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com>
@@ -244,44 +244,48 @@ typedef int cdio_fs_anal_t;
a capability. a capability.
*/ */
#define CDIO_DRIVE_CLOSE_TRAY 0x00001 /**< caddy systems _can't_ close */ #define CDIO_DRIVE_CAP_CLOSE_TRAY 0x00001 /**< caddy systems can't
#define CDIO_DRIVE_OPEN_TRAY 0x00002 /**< but _can_ eject. */ close... */
#define CDIO_DRIVE_LOCK 0x00004 /**< disable manual eject */ #define CDIO_DRIVE_CAP_OPEN_TRAY 0x00002 /**< but can eject. */
#define CDIO_DRIVE_SELECT_SPEED 0x00008 /**< programmable speed */ #define CDIO_DRIVE_CAP_LOCK 0x00004 /**< disable manual eject */
#define CDIO_DRIVE_SELECT_DISC 0x00010 /**< select disc from juke-box */ #define CDIO_DRIVE_CAP_SELECT_SPEED 0x00008 /**< programmable speed */
#define CDIO_DRIVE_MULTI_SESSION 0x00020 /**< read sessions>1 */ #define CDIO_DRIVE_CAP_SELECT_DISC 0x00010 /**< select disc from juke-box */
#define CDIO_DRIVE_MCN 0x00040 /**< Medium Catalog Number */ #define CDIO_DRIVE_CAP_MULTI_SESSION 0x00020 /**< read sessions>1 */
#define CDIO_DRIVE_MEDIA_CHANGED 0x00080 /**< media changed */ #define CDIO_DRIVE_CAP_MCN 0x00040 /**< Medium Catalog Number */
#define CDIO_DRIVE_CD_AUDIO 0x00100 /**< drive can play CD audio */ #define CDIO_DRIVE_CAP_MEDIA_CHANGED 0x00080 /**< media changed */
#define CDIO_DRIVE_RESET 0x00200 /**< hard reset device */ #define CDIO_DRIVE_CAP_CD_AUDIO 0x00100 /**< drive can play CD audio */
#define CDIO_DRIVE_IOCTLS 0x00400 /**< driver has non-standard #define CDIO_DRIVE_CAP_RESET 0x00200 /**< hard reset device */
ioctls */ #define CDIO_DRIVE_CAP_IOCTLS 0x00400 /**< driver has non-standard
#define CDIO_DRIVE_DRIVE_STATUS 0x00800 /**< driver implements drive ioctls */
#define CDIO_DRIVE_CAP_DRIVE_STATUS 0x00800 /**< driver implements drive
status */ status */
#define CDIO_DRIVE_GENERIC_PACKET 0x01000 /**< driver implements generic #define CDIO_DRIVE_CAP_GENERIC_PACKET 0x01000 /**< driver implements generic
packets */ packets */
#define CDIO_DRIVE_CD_R 0x02000 /**< drive can write CD-R */ #define CDIO_DRIVE_CAP_CD_R 0x02000 /**< drive can write CD-R */
#define CDIO_DRIVE_CD_RW 0x04000 /**< drive can write CD-RW */ #define CDIO_DRIVE_CAP_CD_RW 0x04000 /**< drive can write CD-RW */
#define CDIO_DRIVE_DVD 0x08000 /**< drive can read DVD */ #define CDIO_DRIVE_CAP_DVD 0x08000 /**< drive can read DVD */
#define CDIO_DRIVE_DVD_R 0x10000 /**< drive can write DVD-R */ #define CDIO_DRIVE_CAP_DVD_R 0x10000 /**< drive can write DVD-R */
#define CDIO_DRIVE_DVD_RAM 0x20000 /**< drive can write DVD-RAM */ #define CDIO_DRIVE_CAP_DVD_RAM 0x20000 /**< drive can write DVD-RAM */
/**< These are not taken by GNU/Linux cdrom.h (yet) */ /**< These are not taken by GNU/Linux cdrom.h (yet) */
#define CDIO_DRIVE_ERROR 0x00000 /**< Error */ #define CDIO_DRIVE_CAP_ERROR 0x00000 /**< Error */
#define CDIO_DRIVE_FILE 0x40000 /**< drive is really a file, i.e a #define CDIO_DRIVE_CAP_FILE 0x40000 /**< drive is really a file, i.e
CD file image */ a CD file image */
#define CDIO_DRIVE_UNKNOWN 0x80000 /**< Dunno. It can be on if we #define CDIO_DRIVE_CAP_UNKNOWN 0x80000 /**< Dunno. It can be on if we
have only partial information have only partial information
or are not completely certain or are not completely certain
*/ */
/**< Masks derived from above... */ /**< 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 */ /**< 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 */ /**< 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 */ /**< Has some sort of DVD writer ability */
#ifdef __cplusplus #ifdef __cplusplus

View File

@@ -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 <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: 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 <cdio/cdio.h> #include <cdio/cdio.h>
#include <cdio/sector.h> #include <cdio/sector.h>
@@ -489,23 +489,24 @@ win32ioctl_get_drive_cap (const void *env)
{ {
unsigned int n=sptwb.DataBuf[3]+4; unsigned int n=sptwb.DataBuf[3]+4;
/* Reader? */ /* Reader? */
if (sptwb.DataBuf[n+5] & 0x01) i_drivetype |= CDIO_DRIVE_CD_AUDIO; if (sptwb.DataBuf[n+5] & 0x01) i_drivetype |= CDIO_DRIVE_CAP_CD_AUDIO;
if (sptwb.DataBuf[n+2] & 0x02) i_drivetype |= CDIO_DRIVE_CD_RW; if (sptwb.DataBuf[n+2] & 0x02) i_drivetype |= CDIO_DRIVE_CAP_CD_RW;
if (sptwb.DataBuf[n+2] & 0x08) i_drivetype |= CDIO_DRIVE_DVD; if (sptwb.DataBuf[n+2] & 0x08) i_drivetype |= CDIO_DRIVE_CAP_DVD;
/* Writer? */ /* Writer? */
if (sptwb.DataBuf[n+3] & 0x01) i_drivetype |= CDIO_DRIVE_CD_R; if (sptwb.DataBuf[n+3] & 0x01) i_drivetype |= CDIO_DRIVE_CAP_CD_R;
if (sptwb.DataBuf[n+3] & 0x10) i_drivetype |= CDIO_DRIVE_DVD_R; if (sptwb.DataBuf[n+3] & 0x10) i_drivetype |= CDIO_DRIVE_CAP_DVD_R;
if (sptwb.DataBuf[n+3] & 0x20) i_drivetype |= CDIO_DRIVE_DVD_RAM; 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] & 0x08) i_drivetype |= CDIO_DRIVE_CAP_OPEN_TRAY;
if (sptwb.DataBuf[n+6] >> 5 != 0) i_drivetype |= CDIO_DRIVE_CLOSE_TRAY; if (sptwb.DataBuf[n+6] >> 5 != 0)
i_drivetype |= CDIO_DRIVE_CAP_CLOSE_TRAY;
return i_drivetype; return i_drivetype;
} else { } 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*/ #endif /*HAVE_WIN32_CDROM*/

View File

@@ -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 <hvr@gnu.org> Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com> Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com>
@@ -27,7 +27,7 @@
# include "config.h" # include "config.h"
#endif #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 <string.h> #include <string.h>
@@ -834,7 +834,7 @@ _cdio_get_drive_cap_linux (const void *env) {
i_drivetype = ioctl (_obj->gen.fd, CDROM_GET_CAPABILITY, CDSL_CURRENT); 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 */ /* If >= 0 we can safely cast as cdio_drive_cap_t and return */
return (cdio_drive_cap_t) i_drivetype; return (cdio_drive_cap_t) i_drivetype;

View File

@@ -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 <hvr@gnu.org> Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com> Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com>
@@ -41,7 +41,7 @@
#ifdef HAVE_SOLARIS_CDROM #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 <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@@ -524,25 +524,26 @@ _cdio_get_drive_cap_solaris (const void *env)
if(rc == 0) { if(rc == 0) {
unsigned int n=buf[3]+4; unsigned int n=buf[3]+4;
/* Reader? */ /* Reader? */
if (buf[n+5] & 0x01) i_drivetype |= CDIO_DRIVE_CD_AUDIO; if (buf[n+5] & 0x01) i_drivetype |= CDIO_DRIVE_CAP_CD_AUDIO;
if (buf[n+2] & 0x02) i_drivetype |= CDIO_DRIVE_CD_RW; if (buf[n+2] & 0x02) i_drivetype |= CDIO_DRIVE_CAP_CD_RW;
if (buf[n+2] & 0x08) i_drivetype |= CDIO_DRIVE_DVD; if (buf[n+2] & 0x08) i_drivetype |= CDIO_DRIVE_CAP_DVD;
/* Writer? */ /* Writer? */
if (buf[n+3] & 0x01) i_drivetype |= CDIO_DRIVE_CD_R; if (buf[n+3] & 0x01) i_drivetype |= CDIO_DRIVE_CAP_CD_R;
if (buf[n+3] & 0x10) i_drivetype |= CDIO_DRIVE_DVD_R; if (buf[n+3] & 0x10) i_drivetype |= CDIO_DRIVE_CAP_DVD_R;
if (buf[n+3] & 0x20) i_drivetype |= CDIO_DRIVE_DVD_RAM; 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] & 0x08) i_drivetype |= CDIO_DRIVE_CAP_OPEN_TRAY;
if (buf[n+6] >> 5 != 0) i_drivetype |= CDIO_DRIVE_CLOSE_TRAY; if (buf[n+6] >> 5 != 0) i_drivetype |= CDIO_DRIVE_CAP_CLOSE_TRAY;
} else { } else {
i_drivetype = CDIO_DRIVE_CD_AUDIO | CDIO_DRIVE_UNKNOWN; i_drivetype = CDIO_DRIVE_CAP_CD_AUDIO | CDIO_DRIVE_CAP_UNKNOWN;
} }
return i_drivetype; return i_drivetype;
#else #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 #endif
} }

View File

@@ -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 <rocky@panix.com> Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org> Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
@@ -37,7 +37,7 @@
#include <cdio/logging.h> #include <cdio/logging.h>
#include "cdio_private.h" #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] = const char *track_format2str[6] =
@@ -386,7 +386,7 @@ cdio_get_devices_with_cap (char* search_devices[],
unsigned int unsigned int
cdio_get_drive_cap (const CdIo *cdio) 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) { if (cdio && cdio->op.get_drive_cap) {
i_drivetype=cdio->op.get_drive_cap(cdio->env); i_drivetype=cdio->op.get_drive_cap(cdio->env);
@@ -405,7 +405,7 @@ cdio_get_drive_cap (const CdIo *cdio)
unsigned int unsigned int
cdio_get_drive_cap_dev (const char *device) 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, CdIo *cdio=scan_for_driver(CDIO_MIN_DRIVER, CDIO_MAX_DRIVER,
device); device);

View File

@@ -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 <hvr@gnu.org> Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com> Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com>
@@ -24,7 +24,7 @@
(*.cue). (*.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_assert.h"
#include "cdio_private.h" #include "cdio_private.h"
@@ -756,7 +756,7 @@ _cdio_get_drive_cap_bincue (const void *env) {
Also, we know we can't handle Also, we know we can't handle
LOCK, OPEN_TRAY, CLOSE_TRAY, SELECT_SPEED, SELECT_DISC 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 ;
} }
/*! /*!

View File

@@ -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 <hvr@gnu.org> Copyright (C) 2001, 2003 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com> Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
@@ -48,7 +48,7 @@
#include "cdio_private.h" #include "cdio_private.h"
#include "_cdio_stdio.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 */ /* structures used */
@@ -1090,7 +1090,7 @@ _cdio_get_drive_cap_nrg (const void *env) {
Also, we know we can't handle Also, we know we can't handle
LOCK, OPEN_TRAY, CLOSE_TRAY, SELECT_SPEED, SELECT_DISC 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 ;
} }
/*! /*!

View File

@@ -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 <rocky@panix.com> Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
@@ -90,33 +90,34 @@ fillout_device_name(const char *device_name)
void void
print_drive_capabilities(cdio_drive_cap_t i_drive_cap) 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"); printf("Error in getting drive properties\n");
} else { } else {
printf("Hardware : %s\n", 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", 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", 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", 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", 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", 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", 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", 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", 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", 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"); printf("Not completely sure about drive properties\n\n");
} }
} }