Go to the source code of this file.
#define CDIO_DRIVE_CAP_ERROR 0x40000 |
Drive types returned by cdio_get_drive_cap().
NOTE: Setting a bit here means the presence of a capability. Error
#define CDIO_DRIVE_CAP_MISC_CLOSE_TRAY 0x00001 |
caddy systems can't close...
#define CDIO_DRIVE_CAP_MISC_EJECT 0x00002 |
but can eject.
#define CDIO_DRIVE_CAP_MISC_FILE 0x20000 |
drive is really a file, i.e a CD file image
#define CDIO_DRIVE_CAP_MISC_LOCK 0x00004 |
disable manual eject
#define CDIO_DRIVE_CAP_MISC_MEDIA_CHANGED 0x00080 |
media changed
#define CDIO_DRIVE_CAP_MISC_MULTI_SESSION 0x00020 |
read sessions>1
#define CDIO_DRIVE_CAP_MISC_RESET 0x00100 |
hard reset device
#define CDIO_DRIVE_CAP_MISC_SELECT_DISC 0x00010 |
select disc from juke-box
#define CDIO_DRIVE_CAP_MISC_SELECT_SPEED 0x00008 |
programmable speed
#define CDIO_DRIVE_CAP_READ_AUDIO 0x00001 |
Reading masks.. drive can play CD audio
#define CDIO_DRIVE_CAP_READ_C2_ERRS 0x00800 |
has C2 error correction
#define CDIO_DRIVE_CAP_READ_CD_DA 0x00002 |
drive can read CD-DA
#define CDIO_DRIVE_CAP_READ_CD_G 0x00004 |
drive can read CD+G
#define CDIO_DRIVE_CAP_READ_CD_R 0x00008 |
drive can read CD-R
#define CDIO_DRIVE_CAP_READ_CD_RW 0x00010 |
drive can read CD-RW
#define CDIO_DRIVE_CAP_READ_DVD_PR 0x00040 |
drive can read DVD+R
#define CDIO_DRIVE_CAP_READ_DVD_R 0x00020 |
drive can read DVD-R
#define CDIO_DRIVE_CAP_READ_DVD_RAM 0x00080 |
drive can read DVD-RAM
#define CDIO_DRIVE_CAP_READ_DVD_ROM 0x00100 |
drive can read DVD-ROM
#define CDIO_DRIVE_CAP_READ_DVD_RPW 0x00400 |
drive can read DVD+RW
#define CDIO_DRIVE_CAP_READ_DVD_RW 0x00200 |
drive can read DVD-RW
#define CDIO_DRIVE_CAP_READ_ISRC 0x08000 |
can read ISRC
#define CDIO_DRIVE_CAP_READ_MCN 0x04000 |
can read MCN
#define CDIO_DRIVE_CAP_READ_MODE2_FORM1 0x01000 |
can read mode 2 form 1
#define CDIO_DRIVE_CAP_READ_MODE2_FORM2 0x02000 |
can read mode 2 form 2
#define CDIO_DRIVE_CAP_UNKNOWN 0x80000 |
Dunno. It can be on if we have only partial information or are not completely certain
#define CDIO_DRIVE_CAP_WRITE (CDIO_DRIVE_CAP_WRITE_CD | CDIO_DRIVE_CAP_WRITE_DVD) |
Has some sort of DVD or CD writing ability
#define CDIO_DRIVE_CAP_WRITE_BURN_PROOF 0x00100 |
burn proof Masks derived from above...
#define CDIO_DRIVE_CAP_WRITE_CD |
Value:
( \ CDIO_DRIVE_CAP_WRITE_CD_R \ | CDIO_DRIVE_CAP_WRITE_CD_RW \ )
#define CDIO_DRIVE_CAP_WRITE_CD_R 0x00001 |
Writing masks.. drive can write CD-R
#define CDIO_DRIVE_CAP_WRITE_CD_RW 0x00002 |
drive can write CD-R
#define CDIO_DRIVE_CAP_WRITE_DVD |
Value:
Has some sort of DVD writer ability#define CDIO_DRIVE_CAP_WRITE_DVD_PR 0x00008 |
drive can write DVD+R
#define CDIO_DRIVE_CAP_WRITE_DVD_R 0x00004 |
drive can write DVD-R
#define CDIO_DRIVE_CAP_WRITE_DVD_RAM 0x00010 |
drive can write DVD-RAM
#define CDIO_DRIVE_CAP_WRITE_DVD_RPW 0x00040 |
drive can write DVD+RW
#define CDIO_DRIVE_CAP_WRITE_DVD_RW 0x00020 |
drive can write DVD-RW
#define CDIO_DRIVE_CAP_WRITE_MT_RAINIER 0x00080 |
Mount Rainier
#define CDIO_MAX_DEVICE_DRIVER DRIVER_WIN32 |
#define CDIO_MAX_DRIVER DRIVER_NRG |
#define CDIO_MIN_DEVICE_DRIVER CDIO_MIN_DRIVER |
#define CDIO_MIN_DRIVER DRIVER_AIX |
Make sure what's listed for CDIO_MIN_DRIVER is the last enumeration in driver_id_t. Since we have a bogus (but useful) 0th entry above we don't have to add one.
#define CDIO_MMC_HW_MODEL_LEN 16 |
length of model field
#define CDIO_MMC_HW_REVISION_LEN 4 |
length of revision field
#define CDIO_MMC_HW_VENDOR_LEN 8 |
Size of fields returned by an INQUIRY command length of vendor field
#define CDIO_SRC_IS_DEVICE_MASK 0x0002 |
Read source is a CD device.
#define CDIO_SRC_IS_DISK_IMAGE_MASK 0x0001 |
! Flags specifying the category of device to open or is opened. Read source is a CD image.
#define CDIO_SRC_IS_NATIVE_MASK 0x0008 |
#define CDIO_SRC_IS_SCSI_MASK 0x0004 |
Read source SCSI device.
typedef uint32_t cdio_drive_misc_cap_t |
typedef uint32_t cdio_drive_read_cap_t |
The type of an drive capability bit mask. See below for values
typedef uint32_t cdio_drive_write_cap_t |
typedef struct cdio_hwinfo cdio_hwinfo_t |
Structure to return CD vendor, model, and revision-level strings obtained via the INQUIRY command.
enum driver_id_t |
The driver_id_t enumerations may be used to tag a specific driver that is opened or is desired to be opened. Note that this is different than what is available on a given host.
Order is a little significant since the order is used in scans. We have to start with DRIVER_UNKNOWN and devices should come before disk-image readers. By putting something towards the top (a lower enumeration number), in an iterative scan we prefer that to something with a higher enumeration number.
NOTE: IF YOU MODIFY ENUM MAKE SURE INITIALIZATION IN CDIO.C AGREES.
enum driver_return_code_t |
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.
driver_return_code_t cdio_close_tray | ( | const char * | psz_drive, | |
driver_id_t * | p_driver_id | |||
) |
Close media tray in CD drive if there is a routine to do so.
psz_drive | the name of CD-ROM to be closed. | |
p_driver_id | is the driver to be used or that got used if it was DRIVER_UNKNOWN or DRIVER_DEVICE; If this is NULL, we won't report back the driver used. |
void cdio_destroy | ( | CdIo_t * | p_cdio | ) |
const char* cdio_driver_describe | ( | driver_id_t | driver_id | ) |
Get a string decribing driver_id.
driver_id | the driver you want the description for |
driver_return_code_t cdio_eject_media | ( | CdIo_t ** | p_cdio | ) |
Eject media in CD drive if there is a routine to do so.
p_cdio | the CD object to be acted upon. If the CD is ejected *p_cdio is free'd and p_cdio set to NULL. |
void cdio_free_device_list | ( | char * | device_list[] | ) |
Free device list returned by cdio_get_devices or cdio_get_devices_with_cap.
device_list | list returned by cdio_get_devices or cdio_get_devices_with_cap |
const char* cdio_get_arg | ( | const CdIo_t * | p_cdio, | |
const char | key[] | |||
) |
Get the value associatied with key.
p_cdio | the CD object queried | |
key | the key to retrieve |
char* cdio_get_default_device | ( | const CdIo_t * | p_cdio | ) |
Get the default CD device. if p_cdio is NULL (we haven't initialized a specific device driver), then find a suitable one and return the default device for that.
p_cdio | the CD object queried |
char* cdio_get_default_device_aix | ( | void | ) |
Return a string containing the default device name that the BSDI driver would use when none is specified.
char* cdio_get_default_device_bincue | ( | void | ) |
Return a string containing the default CUE file that would be used when none is specified.
char* cdio_get_default_device_bsdi | ( | void | ) |
Return a string containing the default device name that the BSDI driver would use when none is specified.
char* cdio_get_default_device_cdrdao | ( | void | ) |
char* cdio_get_default_device_driver | ( | driver_id_t * | p_driver_id | ) |
Return a string containing the default CD device if none is specified. if p_driver_id is DRIVER_UNKNOWN or DRIVER_DEVICE then find a suitable one set the default device for that.
NULL is returned if we couldn't get a default device.
char* cdio_get_default_device_freebsd | ( | void | ) |
Return a string containing the default device name that the FreeBSD driver would use when none is specified.
NULL is returned on error or there is no CD-ROM device.
char* cdio_get_default_device_linux | ( | void | ) |
Return a string containing the default device name that the GNU/Linux driver would use when none is specified. A scan is made for CD-ROM drives with CDs in them.
NULL is returned on error or there is no CD-ROM device.
In some situations of drivers or OS's we can't find a CD device if there is no media in it and it is possible for this routine to return NULL even though there may be a hardware CD-ROM.
char* cdio_get_default_device_nrg | ( | void | ) |
Get a string containing the default device name that the NRG driver would use when none is specified. A scan is made for NRG disk images in the current directory.
char* cdio_get_default_device_osx | ( | void | ) |
Return a string containing the default device name that the OSX driver would use when none is specified. A scan is made for CD-ROM drives with CDs in them.
In some situations of drivers or OS's we can't find a CD device if there is no media in it and it is possible for this routine to return NULL even though there may be a hardware CD-ROM.
char* cdio_get_default_device_solaris | ( | void | ) |
Return a string containing the default device name that the Solaris driver would use when none is specified. A scan is made for CD-ROM drives with CDs in them.
NULL is returned on error or there is no CD-ROM device.
In some situations of drivers or OS's we can't find a CD device if there is no media in it and it is possible for this routine to return NULL even though there may be a hardware CD-ROM.
char* cdio_get_default_device_win32 | ( | void | ) |
Return a string containing the default device name that the Win32 driver would use when none is specified. A scan is made for CD-ROM drives with CDs in them.
In some situations of drivers or OS's we can't find a CD device if there is no media in it and it is possible for this routine to return NULL even though there may be a hardware CD-ROM.
char** cdio_get_devices | ( | driver_id_t | driver_id | ) |
Return an array of device names. If you want a specific devices for a driver, give that device. If you want hardware devices, give DRIVER_DEVICE and if you want all possible devices, image drivers and hardware drivers give DRIVER_UNKNOWN.
NULL is returned if we couldn't return a list of devices.
In some situations of drivers or OS's we can't find a CD device if there is no media in it and it is possible for this routine to return NULL even though there may be a hardware CD-ROM.
char** cdio_get_devices_aix | ( | void | ) |
Return a list of all of the CD-ROM devices that the AIX driver can find.
In some situations of drivers or OS's we can't find a CD device if there is no media in it and it is possible for this routine to return NULL even though there may be a hardware CD-ROM.
char** cdio_get_devices_bincue | ( | void | ) |
char** cdio_get_devices_bsdi | ( | void | ) |
Return a list of all of the CD-ROM devices that the BSDI driver can find.
In some situations of drivers or OS's we can't find a CD device if there is no media in it and it is possible for this routine to return NULL even though there may be a hardware CD-ROM.
char** cdio_get_devices_cdrdao | ( | void | ) |
char** cdio_get_devices_freebsd | ( | void | ) |
Return a list of all of the CD-ROM devices that the FreeBSD driver can find.
char** cdio_get_devices_linux | ( | void | ) |
Return a list of all of the CD-ROM devices that the GNU/Linux driver can find.
char** cdio_get_devices_nrg | ( | void | ) |
char** cdio_get_devices_osx | ( | void | ) |
Return a list of all of the CD-ROM devices that the OSX driver can find.
char** cdio_get_devices_ret | ( | driver_id_t * | p_driver_id | ) |
Like cdio_get_devices, but we may change the p_driver_id if we were given DRIVER_DEVICE or DRIVER_UNKNOWN. This is because often one wants to get a drive name and then *open* it afterwards. Giving the driver back facilitates this, and speeds things up for libcdio as well.
char** cdio_get_devices_solaris | ( | void | ) |
Return a list of all of the CD-ROM devices that the Solaris driver can find.
char** cdio_get_devices_win32 | ( | void | ) |
char** cdio_get_devices_with_cap | ( | char * | ppsz_search_devices[], | |
cdio_fs_anal_t | capabilities, | |||
bool | b_any | |||
) |
Get an array of device names in search_devices that have at least the capabilities listed by the capabities parameter. If search_devices is NULL, then we'll search all possible CD drives.
If "b_any" is set false then every capability listed in the extended portion of capabilities (i.e. not the basic filesystem) must be satisified. If "any" is set true, then if any of the capabilities matches, we call that a success.
To find a CD-drive of any type, use the mask CDIO_FS_MATCH_ALL.
char** cdio_get_devices_with_cap_ret | ( | char * | ppsz_search_devices[], | |
cdio_fs_anal_t | capabilities, | |||
bool | b_any, | |||
driver_id_t * | p_driver_id | |||
) |
Like cdio_get_devices_with_cap but we return the driver we found as well. This is because often one wants to search for kind of drive and then *open* it afterwards. Giving the driver back facilitates this, and speeds things up for libcdio as well.
void cdio_get_drive_cap | ( | const CdIo_t * | p_cdio, | |
cdio_drive_read_cap_t * | p_read_cap, | |||
cdio_drive_write_cap_t * | p_write_cap, | |||
cdio_drive_misc_cap_t * | p_misc_cap | |||
) |
Get the what kind of device we've got.
p_cdio | the CD object queried | |
p_read_cap | pointer to return read capabilities | |
p_write_cap | pointer to return write capabilities | |
p_misc_cap | pointer to return miscellaneous other capabilities |
void cdio_get_drive_cap_dev | ( | const char * | device, | |
cdio_drive_read_cap_t * | p_read_cap, | |||
cdio_drive_write_cap_t * | p_write_cap, | |||
cdio_drive_misc_cap_t * | p_misc_cap | |||
) |
Get the drive capabilities for a specified device.
driver_id_t cdio_get_driver_id | ( | const CdIo_t * | p_cdio | ) |
Get the driver id. if CdIo_t is NULL (we haven't initialized a specific device driver), then return DRIVER_UNKNOWN.
const char* cdio_get_driver_name | ( | const CdIo_t * | p_cdio | ) |
Get a string containing the name of the driver in use.
bool cdio_get_hwinfo | ( | const CdIo_t * | p_cdio, | |
cdio_hwinfo_t * | p_hw_info | |||
) |
Get the CD-ROM hardware info via a SCSI MMC INQUIRY command. False is returned if we had an error getting the information.
driver_return_code_t cdio_get_last_session | ( | CdIo_t * | p_cdio, | |
lsn_t * | i_last_session | |||
) |
Get the LSN of the first track of the last session of on the CD.
p_cdio | the CD object to be acted upon. | |
i_last_session | pointer to the session number to be returned. |
int cdio_get_media_changed | ( | CdIo_t * | p_cdio | ) |
Find out if media has changed since the last call.
p_cdio | the CD object to be acted upon. |
bool cdio_have_aix | ( | void | ) |
True if AIX driver is available.
bool_3way_t cdio_have_atapi | ( | CdIo_t * | p_cdio | ) |
True if CD-ROM understand ATAPI commands.
bool cdio_have_bincue | ( | void | ) |
True if BIN/CUE driver is available.
bool cdio_have_bsdi | ( | void | ) |
True if BSDI driver is available.
bool cdio_have_cdrdao | ( | void | ) |
True if cdrdao CDRDAO driver is available.
bool cdio_have_driver | ( | driver_id_t | driver_id | ) |
Like cdio_have_xxx but uses an enumeration instead.
bool cdio_have_freebsd | ( | void | ) |
True if FreeBSD driver is available.
bool cdio_have_linux | ( | void | ) |
True if GNU/Linux driver is available.
bool cdio_have_nrg | ( | void | ) |
True if Nero driver is available.
bool cdio_have_osx | ( | void | ) |
True if Apple OSX driver is available.
bool cdio_have_solaris | ( | void | ) |
True if Sun Solaris driver is available.
bool cdio_have_win32 | ( | void | ) |
True if Microsoft Windows driver is available.
bool cdio_init | ( | void | ) |
Initialize CD Reading and control routines. Should be called first.
char* cdio_is_binfile | ( | const char * | bin_name | ) |
Determine if bin_name is the bin file part of a CDRWIN CD disk image.
bin_name | location of presumed CDRWIN bin image file. |
char* cdio_is_cuefile | ( | const char * | cue_name | ) |
Determine if cue_name is the cue sheet for a CDRWIN CD disk image.
bool cdio_is_device | ( | const char * | psz_source, | |
driver_id_t | driver_id | |||
) |
Determine if psz_source refers to a real hardware CD-ROM.
psz_source | location name of object | |
driver_id | driver for reading object. Use DRIVER_UNKNOWN if you don't know what driver to use. |
bool cdio_is_nrg | ( | const char * | psz_nrg | ) |
Determine if psg_nrg is a Nero CD disk image.
psz_nrg | location of presumed NRG image file. |
bool cdio_is_tocfile | ( | const char * | psz_toc | ) |
Determine if psg_toc is a TOC file for a cdrdao CD disk image.
psz_toc | location of presumed TOC image file. |
CdIo_t* cdio_open | ( | const char * | psz_source, | |
driver_id_t | driver_id | |||
) |
Sets up to read from place specified by psz_source and driver_id. This or cdio_open_* should be called before using any other routine, except cdio_init. This will call cdio_init, if that hasn't been done previously. to call one of the specific cdio_open_xxx routines.
CdIo_t* cdio_open_aix | ( | const char * | psz_source | ) |
Set up CD-ROM for reading using the AIX driver. The device_name is the some sort of device name.
CdIo_t* cdio_open_am | ( | const char * | psz_source, | |
driver_id_t | driver_id, | |||
const char * | psz_access_mode | |||
) |
Sets up to read from place specified by psz_source, driver_id and access mode. This or cdio_open should be called before using any other routine, except cdio_init. This will call cdio_init, if that hasn't been done previously. to call one of the specific cdio_open_xxx routines.
CdIo_t* cdio_open_am_aix | ( | const char * | psz_source, | |
const char * | psz_access_mode | |||
) |
Set up CD-ROM for reading using the AIX driver. The device_name is the some sort of device name.
CdIo_t* cdio_open_am_bincue | ( | const char * | psz_cue_name, | |
const char * | psz_access_mode | |||
) |
Set up BIN/CUE CD disk-image for reading. Source is the .bin or .cue file
CdIo_t* cdio_open_am_bsdi | ( | const char * | psz_source, | |
const char * | psz_access_mode | |||
) |
Set up CD-ROM for reading using the BSDI driver. The device_name is the some sort of device name.
CdIo_t* cdio_open_am_cd | ( | const char * | psz_device, | |
const char * | psz_access_mode | |||
) |
Set up CD-ROM for reading. The device_name is the some sort of device name.
CdIo_t* cdio_open_am_cdrdao | ( | const char * | psz_toc_name, | |
const char * | psz_access_mode | |||
) |
Set up cdrdao CD disk-image for reading. Source is the .toc file
CdIo_t* cdio_open_am_freebsd | ( | const char * | psz_source, | |
const char * | psz_access_mode | |||
) |
Set up CD-ROM for reading using the FreeBSD driver. The device_name is the some sort of device name.
NULL is returned on error or there is no FreeBSD driver.
CdIo_t* cdio_open_am_linux | ( | const char * | psz_source, | |
const char * | access_mode | |||
) |
Set up CD-ROM for reading using the GNU/Linux driver. The device_name is the some sort of device name.
CdIo_t* cdio_open_am_nrg | ( | const char * | psz_source, | |
const char * | psz_access_mode | |||
) |
Set up CD-ROM for reading using the Nero driver. The device_name is the some sort of device name.
CdIo_t* cdio_open_am_osx | ( | const char * | psz_source, | |
const char * | psz_access_mode | |||
) |
Set up CD-ROM for reading using the Apple OSX driver. The device_name is the some sort of device name.
NULL is returned on error or there is no OSX driver.
CdIo_t* cdio_open_am_solaris | ( | const char * | psz_source, | |
const char * | psz_access_mode | |||
) |
Set up CD-ROM for reading using the Sun Solaris driver. The device_name is the some sort of device name.
CdIo_t* cdio_open_am_win32 | ( | const char * | psz_source, | |
const char * | psz_access_mode | |||
) |
Set up CD-ROM for reading using the Microsoft Windows driver. The device_name is the some sort of device name.
NULL is returned on error or there is no Microsof Windows driver.
CdIo_t* cdio_open_bincue | ( | const char * | psz_cue_name | ) |
Set up BIN/CUE CD disk-image for reading. Source is the .bin or .cue file
CdIo_t* cdio_open_bsdi | ( | const char * | psz_source | ) |
Set up CD-ROM for reading using the BSDI driver. The device_name is the some sort of device name.
psz_source | the name of the device to open |
CdIo_t* cdio_open_cd | ( | const char * | device_name | ) |
Set up CD-ROM for reading. The device_name is the some sort of device name.
CdIo_t* cdio_open_cdrdao | ( | const char * | psz_toc_name | ) |
Set up cdrdao CD disk-image for reading. Source is the .toc file
CdIo_t* cdio_open_cue | ( | const char * | cue_name | ) |
CDRWIN BIN/CUE CD disc-image routines. Source is the .cue file
CdIo_t* cdio_open_freebsd | ( | const char * | paz_psz_source | ) |
Set up CD-ROM for reading using the FreeBSD driver. The device_name is the some sort of device name.
NULL is returned on error or there is no FreeBSD driver.
CdIo_t* cdio_open_linux | ( | const char * | psz_source | ) |
Set up CD-ROM for reading using the GNU/Linux driver. The device_name is the some sort of device name.
CdIo_t* cdio_open_nrg | ( | const char * | psz_source | ) |
Set up CD-ROM for reading using the Nero driver. The device_name is the some sort of device name.
CdIo_t* cdio_open_osx | ( | const char * | psz_source | ) |
Set up CD-ROM for reading using the Apple OSX driver. The device_name is the some sort of device name.
NULL is returned on error or there is no OSX driver.
In some situations of drivers or OS's we can't find a CD device if there is no media in it and it is possible for this routine to return NULL even though there may be a hardware CD-ROM.
CdIo_t* cdio_open_solaris | ( | const char * | psz_source | ) |
Set up CD-ROM for reading using the Sun Solaris driver. The device_name is the some sort of device name.
CdIo_t* cdio_open_win32 | ( | const char * | psz_source | ) |
Set up CD-ROM for reading using the Microsoft Windows driver. The device_name is the some sort of device name.
In some situations of drivers or OS's we can't find a CD device if there is no media in it and it is possible for this routine to return NULL even though there may be a hardware CD-ROM.
driver_return_code_t cdio_set_arg | ( | CdIo_t * | p_cdio, | |
const char | key[], | |||
const char | value[] | |||
) |
Set the arg "key" with "value" in "p_cdio".
p_cdio | the CD object to set | |
key | the key to set | |
value | the value to assocaiate with key |
driver_return_code_t cdio_set_blocksize | ( | const CdIo_t * | p_cdio, | |
int | i_blocksize | |||
) |
Set the blocksize for subsequent reads.
driver_return_code_t cdio_set_speed | ( | const CdIo_t * | p_cdio, | |
int | i_speed | |||
) |
Set the drive speed.
const driver_id_t cdio_os_driver |
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.