libcdio  2.1.0
About: GNU libcdio is a library for CD-ROM and CD image access.
  Fossies Dox: libcdio-2.1.0.tar.bz2  ("inofficial" and yet experimental doxygen-generated source code documentation)  

device.h File Reference

C header for driver- or device-related libcdio calls. ("device" includes CD-image reading devices). More...

#include <cdio/types.h>
#include <cdio/cdio.h>
Include dependency graph for device.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  cdio_hwinfo
 Structure to return CD vendor, model, and revision-level strings obtained via the INQUIRY command
More...
 

Typedefs

typedef uint32_t cdio_drive_read_cap_t
 
typedef uint32_t cdio_drive_write_cap_t
 
typedef uint32_t cdio_drive_misc_cap_t
 
typedef struct cdio_hwinfo cdio_hwinfo_t
 Structure to return CD vendor, model, and revision-level strings obtained via the INQUIRY command
More...
 

Enumerations

enum  cdio_drive_cap_misc_t {
  CDIO_DRIVE_CAP_ERROR = 0x40000, CDIO_DRIVE_CAP_UNKNOWN = 0x80000, CDIO_DRIVE_CAP_MISC_CLOSE_TRAY = 0x00001, CDIO_DRIVE_CAP_MISC_EJECT = 0x00002,
  CDIO_DRIVE_CAP_MISC_LOCK = 0x00004, CDIO_DRIVE_CAP_MISC_SELECT_SPEED = 0x00008, CDIO_DRIVE_CAP_MISC_SELECT_DISC = 0x00010, CDIO_DRIVE_CAP_MISC_MULTI_SESSION = 0x00020,
  CDIO_DRIVE_CAP_MISC_MEDIA_CHANGED = 0x00080, CDIO_DRIVE_CAP_MISC_RESET = 0x00100, CDIO_DRIVE_CAP_MISC_FILE = 0x20000
}
 Drive capability bits returned by cdio_get_drive_cap() NOTE: Setting a bit here means the presence of a capability. More...
 
enum  cdio_drive_cap_read_t {
  CDIO_DRIVE_CAP_READ_AUDIO = 0x00001, CDIO_DRIVE_CAP_READ_CD_DA = 0x00002, CDIO_DRIVE_CAP_READ_CD_G = 0x00004, CDIO_DRIVE_CAP_READ_CD_R = 0x00008,
  CDIO_DRIVE_CAP_READ_CD_RW = 0x00010, CDIO_DRIVE_CAP_READ_DVD_R = 0x00020, CDIO_DRIVE_CAP_READ_DVD_PR = 0x00040, CDIO_DRIVE_CAP_READ_DVD_RAM = 0x00080,
  CDIO_DRIVE_CAP_READ_DVD_ROM = 0x00100, CDIO_DRIVE_CAP_READ_DVD_RW = 0x00200, CDIO_DRIVE_CAP_READ_DVD_RPW = 0x00400, CDIO_DRIVE_CAP_READ_C2_ERRS = 0x00800,
  CDIO_DRIVE_CAP_READ_MODE2_FORM1 = 0x01000, CDIO_DRIVE_CAP_READ_MODE2_FORM2 = 0x02000, CDIO_DRIVE_CAP_READ_MCN = 0x04000, CDIO_DRIVE_CAP_READ_ISRC = 0x08000
}
 
enum  cdio_drive_cap_write_t {
  CDIO_DRIVE_CAP_WRITE_CD_R = 0x00001, CDIO_DRIVE_CAP_WRITE_CD_RW = 0x00002, CDIO_DRIVE_CAP_WRITE_DVD_R = 0x00004, CDIO_DRIVE_CAP_WRITE_DVD_PR = 0x00008,
  CDIO_DRIVE_CAP_WRITE_DVD_RAM = 0x00010, CDIO_DRIVE_CAP_WRITE_DVD_RW = 0x00020, CDIO_DRIVE_CAP_WRITE_DVD_RPW = 0x00040, CDIO_DRIVE_CAP_WRITE_MT_RAINIER = 0x00080,
  CDIO_DRIVE_CAP_WRITE_BURN_PROOF = 0x00100, CDIO_DRIVE_CAP_WRITE_CD, CDIO_DRIVE_CAP_WRITE_DVD, CDIO_DRIVE_CAP_WRITE
}
 
enum  cdio_mmc_hw_len_t { CDIO_MMC_HW_VENDOR_LEN = 8, CDIO_MMC_HW_MODEL_LEN = 16, CDIO_MMC_HW_REVISION_LEN = 4 }
 
enum  cdio_src_category_mask_t { CDIO_SRC_IS_DISK_IMAGE_MASK = 0x0001, CDIO_SRC_IS_DEVICE_MASK = 0x0002, CDIO_SRC_IS_SCSI_MASK = 0x0004, CDIO_SRC_IS_NATIVE_MASK = 0x0008 }
 
enum  driver_id_t {
  DRIVER_UNKNOWN, DRIVER_AIX, DRIVER_FREEBSD, DRIVER_NETBSD,
  DRIVER_LINUX, DRIVER_SOLARIS, DRIVER_OSX, DRIVER_WIN32,
  DRIVER_CDRDAO, DRIVER_BINCUE, DRIVER_NRG, DRIVER_DEVICE
}
 
enum  driver_return_code_t {
  DRIVER_OP_SUCCESS = 0, DRIVER_OP_ERROR = -1, DRIVER_OP_UNSUPPORTED = -2, DRIVER_OP_UNINIT = -3,
  DRIVER_OP_NOT_PERMITTED = -4, DRIVER_OP_BAD_PARAMETER = -5, DRIVER_OP_BAD_POINTER = -6, DRIVER_OP_NO_DRIVER = -7,
  DRIVER_OP_MMC_SENSE_DATA = -8
}
 

Functions

driver_return_code_t cdio_close_tray (const char *psz_drive, driver_id_t *p_driver_id)
 
const char * cdio_driver_errmsg (driver_return_code_t drc)
 
driver_return_code_t cdio_eject_media (CdIo_t **p_cdio)
 
driver_return_code_t cdio_eject_media_drive (const char *psz_drive)
 
void cdio_free_device_list (char *device_list[])
 
char * cdio_get_default_device (const CdIo_t *p_cdio)
 
char * cdio_get_default_device_driver (driver_id_t *p_driver_id)
 
char ** cdio_get_devices (driver_id_t driver_id)
 
char ** cdio_get_devices_with_cap (char *ppsz_search_devices[], cdio_fs_anal_t capabilities, bool b_any)
 
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)
 
char ** cdio_get_devices_ret (driver_id_t *p_driver_id)
 
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)
 
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)
 
const char * cdio_get_driver_name (const CdIo_t *p_cdio)
 
const char * cdio_get_driver_name_from_id (driver_id_t driver_id)
 
driver_id_t cdio_get_driver_id (const CdIo_t *p_cdio)
 
bool cdio_get_hwinfo (const CdIo_t *p_cdio, cdio_hwinfo_t *p_hw_info)
 
driver_return_code_t cdio_get_last_session (CdIo_t *p_cdio, lsn_t *i_last_session)
 
int cdio_get_media_changed (CdIo_t *p_cdio)
 
bool_3way_t cdio_have_atapi (CdIo_t *p_cdio)
 
bool cdio_have_driver (driver_id_t driver_id)
 
void cdio_destroy (CdIo_t *p_cdio)
 
const char * cdio_driver_describe (driver_id_t driver_id)
 
CdIo_tcdio_open (const char *psz_source, driver_id_t driver_id)
 
CdIo_tcdio_open_am (const char *psz_source, driver_id_t driver_id, const char *psz_access_mode)
 
CdIo_tcdio_open_bincue (const char *psz_cue_name)
 
CdIo_tcdio_open_am_bincue (const char *psz_cue_name, const char *psz_access_mode)
 
CdIo_tcdio_open_cdrdao (const char *psz_toc_name)
 
CdIo_tcdio_open_am_cdrdao (const char *psz_toc_name, const char *psz_access_mode)
 
char * cdio_get_default_device_bincue (void)
 
char ** cdio_get_devices_bincue (void)
 
char * cdio_get_default_device_cdrdao (void)
 
char ** cdio_get_devices_cdrdao (void)
 
CdIo_tcdio_open_cd (const char *device_name)
 
CdIo_tcdio_open_am_cd (const char *psz_device, const char *psz_access_mode)
 
CdIo_tcdio_open_cue (const char *cue_name)
 
CdIo_tcdio_open_am_aix (const char *psz_source, const char *psz_access_mode)
 
CdIo_tcdio_open_aix (const char *psz_source)
 
char * cdio_get_default_device_aix (void)
 
char ** cdio_get_devices_aix (void)
 
CdIo_tcdio_open_freebsd (const char *paz_psz_source)
 
CdIo_tcdio_open_am_freebsd (const char *psz_source, const char *psz_access_mode)
 
char * cdio_get_default_device_freebsd (void)
 
char ** cdio_get_devices_freebsd (void)
 
CdIo_tcdio_open_linux (const char *psz_source)
 
CdIo_tcdio_open_am_linux (const char *psz_source, const char *access_mode)
 
char * cdio_get_default_device_linux (void)
 
char ** cdio_get_devices_linux (void)
 
CdIo_tcdio_open_solaris (const char *psz_source)
 
CdIo_tcdio_open_am_solaris (const char *psz_source, const char *psz_access_mode)
 
char * cdio_get_default_device_solaris (void)
 
char ** cdio_get_devices_solaris (void)
 
CdIo_tcdio_open_osx (const char *psz_source)
 
CdIo_tcdio_open_am_osx (const char *psz_source, const char *psz_access_mode)
 
char * cdio_get_default_device_osx (void)
 
char ** cdio_get_devices_osx (void)
 
CdIo_tcdio_open_win32 (const char *psz_source)
 
CdIo_tcdio_open_am_win32 (const char *psz_source, const char *psz_access_mode)
 
char * cdio_get_default_device_win32 (void)
 
char ** cdio_get_devices_win32 (void)
 
CdIo_tcdio_open_nrg (const char *psz_source)
 
CdIo_tcdio_open_am_nrg (const char *psz_source, const char *psz_access_mode)
 
char * cdio_get_default_device_nrg (void)
 
char ** cdio_get_devices_nrg (void)
 
char * cdio_is_binfile (const char *bin_name)
 
char * cdio_is_cuefile (const char *cue_name)
 
bool cdio_is_nrg (const char *psz_nrg)
 
bool cdio_is_tocfile (const char *psz_toc)
 
bool cdio_is_device (const char *psz_source, driver_id_t driver_id)
 
driver_return_code_t cdio_set_blocksize (const CdIo_t *p_cdio, int i_blocksize)
 
driver_return_code_t cdio_set_speed (const CdIo_t *p_cdio, int i_drive_speed)
 
const char * cdio_get_arg (const CdIo_t *p_cdio, const char key[])
 
driver_return_code_t cdio_set_arg (CdIo_t *p_cdio, const char key[], const char value[])
 
bool cdio_init (void)
 

Variables

const driver_id_t cdio_drivers []
 
const driver_id_t cdio_device_drivers []
 
const driver_id_t cdio_os_driver
 
cdio_drive_cap_misc_t debug_cdio_drive_cap_misc
 
cdio_drive_cap_read_t debug_cdio_drive_cap_read_t
 
cdio_drive_cap_write_t debug_drive_cap_write_t
 
cdio_mmc_hw_len_t debug_cdio_mmc_hw_len
 
cdio_src_category_mask_t debug_cdio_src_category_mask
 

Detailed Description

C header for driver- or device-related libcdio calls. ("device" includes CD-image reading devices).

Definition in file device.h.

Typedef Documentation

◆ cdio_drive_misc_cap_t

typedef uint32_t cdio_drive_misc_cap_t

Definition at line 38 of file device.h.

◆ cdio_drive_read_cap_t

typedef uint32_t cdio_drive_read_cap_t

The type of an drive capability bit mask. See below for values

Definition at line 36 of file device.h.

◆ cdio_drive_write_cap_t

typedef uint32_t cdio_drive_write_cap_t

Definition at line 37 of file device.h.

◆ cdio_hwinfo_t

typedef struct cdio_hwinfo cdio_hwinfo_t

Structure to return CD vendor, model, and revision-level strings obtained via the INQUIRY command

Enumeration Type Documentation

◆ cdio_drive_cap_misc_t

Drive capability bits returned by cdio_get_drive_cap() NOTE: Setting a bit here means the presence of a capability.

Miscellaneous capabilities.

Enumerator
CDIO_DRIVE_CAP_ERROR 

Error

CDIO_DRIVE_CAP_UNKNOWN 

Dunno. It can be on if we have only partial information or are not completely certain

CDIO_DRIVE_CAP_MISC_CLOSE_TRAY 

caddy systems can't close...

CDIO_DRIVE_CAP_MISC_EJECT 

but can eject.

CDIO_DRIVE_CAP_MISC_LOCK 

disable manual eject

CDIO_DRIVE_CAP_MISC_SELECT_SPEED 

programmable speed

CDIO_DRIVE_CAP_MISC_SELECT_DISC 

select disc from juke-box

CDIO_DRIVE_CAP_MISC_MULTI_SESSION 

read sessions>1

CDIO_DRIVE_CAP_MISC_MEDIA_CHANGED 

media changed

CDIO_DRIVE_CAP_MISC_RESET 

hard reset device

CDIO_DRIVE_CAP_MISC_FILE 

drive is really a file, i.e a CD file image

Definition at line 46 of file device.h.

◆ cdio_drive_cap_read_t

Reading masks..

Enumerator
CDIO_DRIVE_CAP_READ_AUDIO 

drive can play CD audio

CDIO_DRIVE_CAP_READ_CD_DA 

drive can read CD-DA

CDIO_DRIVE_CAP_READ_CD_G 

drive can read CD+G

CDIO_DRIVE_CAP_READ_CD_R 

drive can read CD-R

CDIO_DRIVE_CAP_READ_CD_RW 

drive can read CD-RW

CDIO_DRIVE_CAP_READ_DVD_R 

drive can read DVD-R

CDIO_DRIVE_CAP_READ_DVD_PR 

drive can read DVD+R

CDIO_DRIVE_CAP_READ_DVD_RAM 

drive can read DVD-RAM

CDIO_DRIVE_CAP_READ_DVD_ROM 

drive can read DVD-ROM

CDIO_DRIVE_CAP_READ_DVD_RW 

drive can read DVD-RW

CDIO_DRIVE_CAP_READ_DVD_RPW 

drive can read DVD+RW

CDIO_DRIVE_CAP_READ_C2_ERRS 

has C2 error correction

CDIO_DRIVE_CAP_READ_MODE2_FORM1 

can read mode 2 form 1

CDIO_DRIVE_CAP_READ_MODE2_FORM2 

can read mode 2 form 2

CDIO_DRIVE_CAP_READ_MCN 

can read MCN

CDIO_DRIVE_CAP_READ_ISRC 

can read ISRC

Definition at line 67 of file device.h.

◆ cdio_drive_cap_write_t

Writing masks..

Enumerator
CDIO_DRIVE_CAP_WRITE_CD_R 

drive can write CD-R

CDIO_DRIVE_CAP_WRITE_CD_RW 

drive can write CD-RW

CDIO_DRIVE_CAP_WRITE_DVD_R 

drive can write DVD-R

CDIO_DRIVE_CAP_WRITE_DVD_PR 

drive can write DVD+R

CDIO_DRIVE_CAP_WRITE_DVD_RAM 

drive can write DVD-RAM

CDIO_DRIVE_CAP_WRITE_DVD_RW 

drive can write DVD-RW

CDIO_DRIVE_CAP_WRITE_DVD_RPW 

drive can write DVD+RW

CDIO_DRIVE_CAP_WRITE_MT_RAINIER 

Mount Rainier

CDIO_DRIVE_CAP_WRITE_BURN_PROOF 

burn proof

CDIO_DRIVE_CAP_WRITE_CD 

Has some sort of CD writer ability

CDIO_DRIVE_CAP_WRITE_DVD 

Has some sort of DVD writer ability

CDIO_DRIVE_CAP_WRITE 

Has some sort of DVD or CD writing ability

Definition at line 87 of file device.h.

◆ cdio_mmc_hw_len_t

Size of fields returned by an INQUIRY command

Enumerator
CDIO_MMC_HW_VENDOR_LEN 

length of vendor field

CDIO_MMC_HW_MODEL_LEN 

length of model field

CDIO_MMC_HW_REVISION_LEN 

length of revision field

Definition at line 113 of file device.h.

◆ cdio_src_category_mask_t

Flags specifying the category of device to open or is opened.

Enumerator
CDIO_SRC_IS_DISK_IMAGE_MASK 

Read source is a CD image.

CDIO_SRC_IS_DEVICE_MASK 

Read source is a CD device.

CDIO_SRC_IS_SCSI_MASK 

Read source SCSI device.

CDIO_SRC_IS_NATIVE_MASK 

Definition at line 131 of file device.h.

◆ 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 should not be changed lightly because it breaks the ABI. One is not supposed to iterate over the values, but iterate over the cdio_drivers and cdio_device_drivers arrays.

NOTE: IF YOU MODIFY ENUM MAKE SURE INITIALIZATION IN CDIO.C AGREES.

Enumerator
DRIVER_UNKNOWN 

Used as input when we don't care what kind of driver to use.

DRIVER_AIX 

AIX driver

DRIVER_FREEBSD 

FreeBSD driver - includes CAM and ioctl access

DRIVER_NETBSD 

NetBSD Driver.

DRIVER_LINUX 

GNU/Linux Driver

DRIVER_SOLARIS 

Sun Solaris Driver

DRIVER_OSX 

Apple OSX (or MacOS) Driver

DRIVER_WIN32 

Microsoft Windows Driver. Includes ASPI and ioctl access.

DRIVER_CDRDAO 

cdrdao format CD image. This is listed before BIN/CUE, to make the code prefer cdrdao over BIN/CUE when both exist.

DRIVER_BINCUE 

CDRWIN BIN/CUE format CD image. This is listed before NRG, to make the code prefer BIN/CUE over NRG when both exist.

DRIVER_NRG 

Nero NRG format CD image.

DRIVER_DEVICE 

Is really a set of the above; should come last

Definition at line 151 of file device.h.

◆ 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.

Enumerator
DRIVER_OP_SUCCESS 

in cases where an int is returned, like cdio_set_speed, more the negative return codes are for errors and the positive ones for success.

DRIVER_OP_ERROR 

operation returned an error

DRIVER_OP_UNSUPPORTED 

returned when a particular driver doesn't support a particular operation. For example an image driver which doesn't really "eject" a CD.

DRIVER_OP_UNINIT 

returned when a particular driver hasn't been initialized or a null pointer has been passed.

DRIVER_OP_NOT_PERMITTED 

Operation not permitted. For example might be a permission problem.

DRIVER_OP_BAD_PARAMETER 

Bad parameter passed

DRIVER_OP_BAD_POINTER 

Bad pointer to memory area

DRIVER_OP_NO_DRIVER 

Operation called on a driver not available on this OS

DRIVER_OP_MMC_SENSE_DATA 

MMC operation returned sense data, but no other error above recorded.

Definition at line 205 of file device.h.

Function Documentation

◆ cdio_close_tray()

driver_return_code_t cdio_close_tray ( const char *  psz_orig_drive,
driver_id_t p_driver_id 
)

Close media tray in CD drive if there is a routine to do so.

Parameters
psz_drivethe name of CD-ROM to be closed. If NULL, we will use the default device.
p_driver_idis 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.

Close media tray in CD drive if there is a routine to do so.

Parameters
psz_drivethe name of CD-ROM to be closed. If NULL, we will use the default device.
p_driver_idis 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.

Definition at line 382 of file device.c.

References CdIo_all_drivers, cdio_device_drivers, cdio_drivers, cdio_get_default_device_driver(), CdIo_driver_t::close_tray, DRIVER_DEVICE, DRIVER_OP_UNSUPPORTED, and DRIVER_UNKNOWN.

Referenced by cd_close(), closeTray(), and main().

◆ cdio_destroy()

void cdio_destroy ( CdIo_t p_cdio)

Free any resources associated with p_cdio. Call this when done using p_cdio and using CD reading/control operations.

Parameters
p_cdiothe CD object to eliminated.

Free any resources associated with cdio.

Definition at line 361 of file device.c.

References CDIO_DRIVER_UNINIT, CdIo_last_driver, _CdIo::env, cdio_funcs_t::free, NULL, and _CdIo::op.

Referenced by cd_eject(), cdio_eject_media(), cdio_eject_media_drive(), cdio_get_devices_ret(), cdio_get_devices_with_cap_ret(), cdio_get_drive_cap_dev(), close(), finish(), main(), myexit(), open(), udf_close(), and CdioDevice::~CdioDevice().

◆ cdio_driver_describe()

const char* cdio_driver_describe ( driver_id_t  driver_id)

Get a string decribing driver_id.

Parameters
driver_idthe driver you want the description for
Returns
a string of driver description

Definition at line 324 of file device.c.

References CdIo_all_drivers, CdIo_driver_t::describe, and driver_id.

Referenced by driverDescribe(), main(), and print_version().

◆ cdio_driver_errmsg()

const char* cdio_driver_errmsg ( driver_return_code_t  drc)
Parameters
drcthe return code you want interpreted.
Returns
the string information about drc

Definition at line 277 of file device.c.

References DRIVER_OP_BAD_PARAMETER, DRIVER_OP_BAD_POINTER, DRIVER_OP_ERROR, DRIVER_OP_NO_DRIVER, DRIVER_OP_NOT_PERMITTED, DRIVER_OP_SUCCESS, DRIVER_OP_UNINIT, and DRIVER_OP_UNSUPPORTED.

Referenced by DriverOpException::get_msg(), and main().

◆ cdio_eject_media()

driver_return_code_t cdio_eject_media ( CdIo_t **  pp_cdio)

Eject media in CD drive if there is a routine to do so.

Parameters
p_cdiothe CD object to be acted upon. If the CD is ejected *p_cdio is free'd and p_cdio set to NULL.

Eject media in CD drive if there is a routine to do so.

Parameters
p_cdiothe CD object to be acted upon. If the CD is ejected *p_cdio is freed and p_cdio set to NULL.

Definition at line 433 of file device.c.

References cdio_destroy(), DRIVER_OP_UNINIT, DRIVER_OP_UNSUPPORTED, and NULL.

Referenced by cd_eject(), cdio_eject_media_drive(), and ejectMedia().

◆ cdio_eject_media_drive()

driver_return_code_t cdio_eject_media_drive ( const char *  psz_drive)

Eject media in CD drive if there is a routine to do so.

Parameters
psz_drivethe name of the device to be acted upon. If NULL is given as the drive, we'll use the default driver device.

Eject media in CD drive if there is a routine to do so. If you want to scan for any CD-ROM and eject that, pass NULL for psz_drive.

Parameters
psz_drivethe CD object to be acted upon. If NULL is given as the drive, we'll use the default driver device.

Definition at line 459 of file device.c.

References cdio_destroy(), cdio_eject_media(), cdio_open(), DRIVER_DEVICE, DRIVER_OP_UNINIT, and rc.

Referenced by ejectMedia().

◆ cdio_free_device_list()

void cdio_free_device_list ( char *  ppsz_device_list[])

Free device list returned by cdio_get_devices or cdio_get_devices_with_cap().

Parameters
device_listlist returned by cdio_get_devices or cdio_get_devices_with_cap().
See also
cdio_get_devices(), and cdio_get_devices_with_cap().

Free device list returned by cdio_get_devices or cdio_get_devices_with_cap.

Definition at line 477 of file device.c.

References CDIO_FREE_IF_NOT_NULL, and NULL.

Referenced by cdio_get_default_device_bincue(), cdio_get_default_device_cdrdao(), cdio_get_default_device_nrg(), cdio_get_devices_with_cap_ret(), freeDeviceList(), and main().

◆ cdio_get_arg()

const char* cdio_get_arg ( const CdIo_t p_cdio,
const char  key[] 
)

Get the value associatied with key.

Parameters
p_cdiothe CD object queried
keythe key to retrieve
Returns
the value associated with "key", NULL if p_cdio is NULL, or "key" does not exist.

Referenced by getArg(), and main().

◆ cdio_get_default_device()

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.

Parameters
p_cdiothe CD object queried
Returns
a string containing the default CD device or NULL if we couldn't get a default 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.

Return a string containing the default CD device if none is specified. 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.

NULL is returned if we couldn't get a default device.

Definition at line 497 of file device.c.

References CdIo_all_drivers, cdio_drivers, DRIVER_UNKNOWN, cdio_funcs_t::get_default_device, NULL, and _CdIo::op.

Referenced by cdio_open_am(), getDevice(), main(), and print_version().

◆ cdio_get_default_device_aix()

char* cdio_get_default_device_aix ( void  )

Return a string containing the default device name that the AIX driver would use when none is specified.

Returns
the cdio object for subsequent operations. NULL on error or there is no AIX driver.
See also
cdio_open_cd(), cdio_open()

Return a string containing the default VCD device if none is specified.

Definition at line 867 of file aix.c.

References DEFAULT_CDIO_DEVICE.

Referenced by cdio_open_am_aix().

◆ cdio_get_default_device_bincue()

char* cdio_get_default_device_bincue ( void  )

Return a string containing the default CUE file that would be used when none is specified.

Returns
the cdio object or NULL on error or no device.

Return a string containing the default CD device.

Definition at line 1072 of file bincue.c.

References cdio_free_device_list(), cdio_get_devices_bincue(), and NULL.

Referenced by cdio_open_cue().

◆ cdio_get_default_device_cdrdao()

char* cdio_get_default_device_cdrdao ( void  )
Returns
string containing the default CUE file that would be used when none is specified. NULL is returned on error or there is no device.

Return a string containing the default CD device.

Definition at line 1172 of file cdrdao.c.

References cdio_free_device_list(), cdio_get_devices_nrg(), and NULL.

Referenced by cdio_open_cdrdao().

◆ cdio_get_default_device_driver()

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.

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.

Definition at line 526 of file device.c.

References CdIo_all_drivers, cdio_device_drivers, cdio_drivers, DRIVER_DEVICE, DRIVER_UNKNOWN, and NULL.

Referenced by cdio_close_tray(), and getDefaultDevice().

◆ cdio_get_default_device_freebsd()

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.

Return a string containing the default CD device if none is specified.

Definition at line 866 of file freebsd.c.

References NULL.

Referenced by cdio_open_am_freebsd().

◆ cdio_get_default_device_linux()

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.

See also
cdio_open_cd, cdio_open

Return a string containing the default CD device.

Definition at line 1449 of file gnu_linux.c.

References i, j, and NULL.

Referenced by cdio_open_am_linux().

◆ cdio_get_default_device_nrg()

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.

Returns
string containing the default device. NULL on error or there is no CD-ROM device.

Return a string containing the default CD device.

Definition at line 1194 of file nrg.c.

References cdio_free_device_list(), cdio_get_devices_nrg(), and NULL.

Referenced by cdio_open_nrg().

◆ cdio_get_default_device_osx()

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.

Return a string containing the default CD device if none is specified.

Definition at line 1883 of file osx.c.

References cdio_warn(), and NULL.

Referenced by cdio_open_osx().

◆ cdio_get_default_device_solaris()

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.

See also
cdio_open_cd(), cdio_open()

Return a string containing the default VCD device if none is specified.

Definition at line 1144 of file solaris.c.

References DEFAULT_CDIO_DEVICE.

Referenced by cdio_open_am_solaris().

◆ cdio_get_default_device_win32()

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.

See also
cdio_open_cd(), cdio_open()

Return a string containing the default CD device if none is specified. if CdIo is NULL (we haven't initialized a specific device driver), then find a suitable one and return the default device for that.

NULL is returned if we couldn't get a default device.

Definition at line 883 of file win32.c.

References NULL.

Referenced by cdio_open_am_win32().

◆ cdio_get_devices()

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.

Return an array of device names. If you want a specific devices, dor 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.

Definition at line 559 of file device.c.

References cdio_get_devices_ret(), and driver_id.

Referenced by getDevices().

◆ cdio_get_devices_aix()

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.

Return an array of strings giving possible CD devices.

Definition at line 878 of file aix.c.

References cdio_add_device_list(), i, and NULL.

Referenced by cdio_open_am_aix().

◆ cdio_get_devices_bincue()

char** cdio_get_devices_bincue ( void  )

Return an array of strings giving possible BIN/CUE disk images.

Definition at line 1044 of file bincue.c.

References cdio_add_device_list(), DEFAULT_CDIO_DEVICE, i, and NULL.

Referenced by cdio_get_default_device_bincue(), and cdio_open_cue().

◆ cdio_get_devices_cdrdao()

char** cdio_get_devices_cdrdao ( void  )

Return an array of strings giving possible TOC disk images.

Definition at line 1148 of file cdrdao.c.

References cdio_add_device_list(), DEFAULT_CDIO_DEVICE, i, and NULL.

Referenced by cdio_open_cdrdao().

◆ cdio_get_devices_freebsd()

char** cdio_get_devices_freebsd ( void  )

Return a list of all of the CD-ROM devices that the FreeBSD driver can find.

Return an array of strings giving possible CD devices.

Definition at line 793 of file freebsd.c.

References cdio_add_device_list(), and NULL.

Referenced by cdio_open_am_freebsd().

◆ cdio_get_devices_linux()

char** cdio_get_devices_linux ( void  )

Return a list of all of the CD-ROM devices that the GNU/Linux driver can find.

Return an array of strings giving possible CD devices.

Definition at line 1394 of file gnu_linux.c.

References cdio_add_device_list(), i, j, and NULL.

Referenced by cdio_open_am_linux().

◆ cdio_get_devices_nrg()

char** cdio_get_devices_nrg ( void  )

Return an array of strings giving possible NRG disk images.

Definition at line 1166 of file nrg.c.

References cdio_add_device_list(), DEFAULT_CDIO_DEVICE, i, and NULL.

Referenced by cdio_get_default_device_cdrdao(), cdio_get_default_device_nrg(), and cdio_open_nrg().

◆ cdio_get_devices_osx()

char** cdio_get_devices_osx ( void  )

Return a list of all of the CD-ROM devices that the OSX driver can find.

Return a string containing the default CD device if none is specified.

Definition at line 1793 of file osx.c.

References cdio_add_device_list(), and NULL.

Referenced by cdio_open_osx().

◆ cdio_get_devices_ret()

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.

Definition at line 567 of file device.c.

References CdIo_all_drivers, cdio_destroy(), cdio_device_drivers, cdio_drivers, cdio_get_driver_id(), DRIVER_DEVICE, DRIVER_UNKNOWN, cdio_funcs_t::get_devices, NULL, _CdIo::op, and scan_for_driver().

Referenced by cdio_get_devices(), cdio_get_devices_with_cap_ret(), getDevices(), and main().

◆ cdio_get_devices_solaris()

char** cdio_get_devices_solaris ( void  )

Return a list of all of the CD-ROM devices that the Solaris driver can find.

Return an array of strings giving possible CD devices.

Definition at line 1292 of file solaris.c.

References cdio_add_device_list(), DEFAULT_CDIO_DEVICE, i, and NULL.

Referenced by cdio_open_am_solaris().

◆ cdio_get_devices_win32()

char** cdio_get_devices_win32 ( void  )

Return an array of strings giving possible CD devices.

Definition at line 837 of file win32.c.

References cdio_add_device_list(), and NULL.

Referenced by cdio_open_am_win32().

◆ cdio_get_devices_with_cap()

char** cdio_get_devices_with_cap ( char *  search_devices[],
cdio_fs_anal_t  capabilities,
bool  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.

Capabilities have two parts to them, a "filesystem" part and an "analysis" part.

The filesystem part is mutually exclusive. For example either the filesystem is at most one of the High-Sierra, UFS, or HFS, ISO9660, fileystems. Valid combinations of say HFS and ISO9660 are specified as a separate "filesystem".

Capabilities on the other hand are not mutually exclusive. For example a filesystem may have none, either, or both of the XA or Rock-Ridge extension properties.

If "b_any" is set false then every capability listed in the analysis portion of capabilities (i.e. not the basic filesystem) must be satisified. If no analysis capabilities are specified, that's a match.

If "b_any" is set true, then if any of the analysis capabilities matches, we call that a success.

In either case, in the filesystem portion different filesystem either specify 0 to match any filesystem or the specific filesystem type.

To find a CD-drive of any type, use the mask CDIO_FS_MATCH_ALL.

Returns
the array of device names or NULL if we couldn't get a default device. It is also possible to return a non NULL but after dereferencing the the value is NULL. This also means nothing was found.

Return an array of device names in search_devices that have at least the capabilities listed by cap. If search_devices is NULL, then we'll search all possible CD drives.

If "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.

NULL is returned if we couldn't get a default device. It is also possible to return a non NULL but after dereferencing the the value is NULL. This also means nothing was found.

Definition at line 612 of file device.c.

References cdio_get_devices_with_cap_ret().

Referenced by getDevices(), and main().

◆ cdio_get_devices_with_cap_ret()

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.

Definition at line 621 of file device.c.

References cdio_add_device_list(), cdio_destroy(), cdio_free_device_list(), CDIO_FS_MASK, CDIO_FS_MATCH_ALL, CDIO_FS_UNKNOWN, CDIO_FSTYPE, cdio_get_devices_ret(), cdio_get_first_track_num(), cdio_guess_cd_type(), CDIO_INVALID_TRACK, cdio_open(), DRIVER_DEVICE, and NULL.

Referenced by cdio_get_devices_with_cap(), and getDevices().

◆ cdio_get_drive_cap()

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.

Parameters
p_cdiothe CD object queried
p_read_cappointer to return read capabilities
p_write_cappointer to return write capabilities
p_misc_cappointer to return miscellaneous other capabilities

In some situations of drivers or OS's we can't find a CD device if there is no media in it. In this situation capabilities will show up as NULL even though there isa hardware CD-ROM.

Return the the kind of drive capabilities of device.

Note: string is malloc'd so caller should free() then returned string when done with it.

Definition at line 701 of file device.c.

References CDIO_DRIVE_CAP_UNKNOWN, _CdIo::env, cdio_funcs_t::get_drive_cap, and _CdIo::op.

Referenced by cdio_get_drive_cap_dev(), getDriveCap(), and main().

◆ cdio_get_drive_cap_dev()

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.

Return a list of device capabilities.

In some situations of drivers or OS's we can't find a CD device if there is no media in it. In this situation capabilities will show up as NULL even though there isa hardware CD-ROM.

Return the the kind of drive capabilities of device.

Note: string is malloc'd so caller should free() then returned string when done with it.

Definition at line 724 of file device.c.

References cdio_destroy(), CDIO_DRIVE_CAP_UNKNOWN, cdio_drivers, cdio_get_drive_cap(), NULL, and scan_for_driver().

Referenced by main().

◆ cdio_get_driver_id()

driver_id_t cdio_get_driver_id ( const CdIo_t p_cdio)

Get the driver id. if p_cdio is NULL (we haven't initialized a specific device driver), then return DRIVER_UNKNOWN.

Parameters
p_cdiothe CD object to be acted upon.
Returns
the driver id..

Return the driver id. if CdIo is NULL (we haven't initialized a specific device driver), then return DRIVER_UNKNOWN.

Definition at line 771 of file device.c.

References _CdIo::driver_id, and DRIVER_UNKNOWN.

Referenced by cdio_get_devices_ret(), getDriverId(), main(), and print_analysis().

◆ cdio_get_driver_name()

const char* cdio_get_driver_name ( const CdIo_t p_cdio)

Get a string containing the name of the driver in use.

Parameters
p_cdiothe CD object to be acted upon.
Returns
a string with driver name or NULL if CdIo_t is NULL (we haven't initialized a specific device.

Return a string containing the name of the driver in use. if CdIo is NULL (we haven't initialized a specific device driver), then return NULL.

Definition at line 748 of file device.c.

References cdio_get_driver_name_from_id(), _CdIo::driver_id, and NULL.

Referenced by getDriverName(), and main().

◆ cdio_get_driver_name_from_id()

const char* cdio_get_driver_name_from_id ( driver_id_t  driver_id)

Return a string name for the driver_id.

Return a string containing the name of the driver in use from the driver_id. if CdIo is NULL (we haven't initialized a specific device driver), then return NULL.

Definition at line 760 of file device.c.

References CdIo_all_drivers, driver_id, and CdIo_driver_t::name.

Referenced by cdio_get_driver_name(), and scan_for_driver().

◆ cdio_get_hwinfo()

bool cdio_get_hwinfo ( const CdIo_t p_cdio,
cdio_hwinfo_t 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.

Return a string containing the name of the driver in use. if CdIo is NULL (we haven't initialized a specific device driver), then return NULL.

Definition at line 783 of file device.c.

References cdio_funcs_t::get_hwinfo, mmc_get_hwinfo(), and _CdIo::op.

Referenced by getHWinfo(), and main().

◆ cdio_get_last_session()

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.

Parameters
p_cdiothe CD object to be acted upon.
i_last_sessionpointer to the session number to be returned.

Return the session number of the last on the CD.

Parameters
p_cdiothe CD object to be acted upon.
i_last_sessionpointer to the session number to be returned.

Definition at line 801 of file device.c.

References DRIVER_OP_UNINIT, DRIVER_OP_UNSUPPORTED, _CdIo::env, cdio_funcs_t::get_last_session, and _CdIo::op.

Referenced by getLastSession(), and main().

◆ cdio_get_media_changed()

int cdio_get_media_changed ( CdIo_t p_cdio)

Find out if media has changed since the last call.

Parameters
p_cdiothe CD object to be acted upon.
Returns
1 if media has changed since last call, 0 if not. Error return codes are the same as driver_return_code_t

Find out if media has changed since the last call.

Parameters
p_cdiothe CD object to be acted upon.
Returns
1 if media has changed since last call, 0 if not. Error return codes are the same as driver_return_code_t

Definition at line 817 of file device.c.

References DRIVER_OP_UNINIT, DRIVER_OP_UNSUPPORTED, _CdIo::env, cdio_funcs_t::get_media_changed, and _CdIo::op.

Referenced by getMediaChanged().

◆ cdio_have_atapi()

bool_3way_t cdio_have_atapi ( CdIo_t p_cdio)

True if CD-ROM understand ATAPI commands.

Definition at line 826 of file device.c.

References CDIO_MMC_CAPABILITIES_PAGE, CDIO_MMC_FEATURE_INTERFACE_ATAPI, DRIVER_OP_SUCCESS, dunno, _CdIo::env, mmc_have_interface(), mmc_mode_sense(), nope, and yep.

Referenced by haveATAPI().

◆ cdio_have_driver()

bool cdio_have_driver ( driver_id_t  driver_id)

Like cdio_have_xxx but uses an enumeration instead.

Definition at line 896 of file device.c.

References CdIo_all_drivers, and driver_id.

Referenced by haveDriver(), main(), and print_version().

◆ cdio_init()

bool cdio_init ( void  )

Initialize CD Reading and control routines. Should be called first.

Initialize CD Reading and control routines. Should be called first. May be implicitly called by other routines if not called first.

Definition at line 334 of file device.c.

References CdIo_all_drivers, CdIo_driver, CDIO_DRIVER_UNINIT, cdio_drivers, CdIo_last_driver, cdio_warn(), and DRIVER_UNKNOWN.

Referenced by cdio_open_am(), and cdio_open_am_cd().

◆ cdio_is_binfile()

char* cdio_is_binfile ( const char *  psz_bin_name)

Determine if bin_name is the bin file part of a CDRWIN CD disk image.

Parameters
bin_namelocation of presumed CDRWIN bin image file.
Returns
the corresponding CUE file if bin_name is a BIN file or NULL if not a BIN file.

Return corresponding CUE file if psz_bin_name is a bin file or NULL if not a BIN file.

Definition at line 1203 of file bincue.c.

References i, and NULL.

Referenced by cdio_open_bincue(), and isBinFile().

◆ cdio_is_cuefile()

char* cdio_is_cuefile ( const char *  psz_cue_name)

Determine if cue_name is the cue sheet for a CDRWIN CD disk image.

Returns
corresponding BIN file if cue_name is a CDRWIN cue file or NULL if not a CUE file.

Return corresponding BIN file if psz_cue_name is a cue file or NULL if not a CUE file.

Definition at line 1162 of file bincue.c.

References i, NULL, and parse_cuefile().

Referenced by cdio_open_bincue(), cdio_open_cue(), and isCueFile().

◆ cdio_is_device()

bool cdio_is_device ( const char *  psz_source,
driver_id_t  driver_id 
)

Determine if psz_source refers to a real hardware CD-ROM.

Parameters
psz_sourcelocation name of object
driver_iddriver for reading object. Use DRIVER_UNKNOWN if you don't know what driver to use.
Returns
true if psz_source is a device; If false is returned we could have a CD disk image.

Definition at line 904 of file device.c.

References CdIo_all_drivers, cdio_device_drivers, cdio_drivers, DRIVER_DEVICE, driver_id, DRIVER_UNKNOWN, and NULL.

Referenced by isDevice(), and main().

◆ cdio_is_nrg()

bool cdio_is_nrg ( const char *  psz_nrg)

Determine if psg_nrg is a Nero CD disc image.

Parameters
psz_nrglocation of presumed NRG image file.
Returns
true if psz_nrg is a Nero NRG image or false if not a NRG image.

Check that a NRG file is valid.

Definition at line 1268 of file nrg.c.

References _free_nrg(), CDIO_LOG_INFO, cdio_stdio_new(), cdio_warn(), generic_img_private_t::data_source, _img_private_t::gen, NULL, and parse_nrg().

Referenced by cdio_open_nrg(), and isNero().

◆ cdio_is_tocfile()

bool cdio_is_tocfile ( const char *  psz_cue_name)

Determine if psz_toc is a TOC file for a cdrdao CD disc image.

Parameters
psz_toclocation of presumed TOC image file.
Returns
true if toc_name is a cdrdao TOC file or false if not a TOC file.

Check that a TOC file is valid. We parse the entire file.

Definition at line 1260 of file cdrdao.c.

References i, NULL, and parse_tocfile().

Referenced by cdio_open_cdrdao(), and isTocFile().

◆ cdio_open()

CdIo_t* cdio_open ( const char *  orig_source_name,
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 or any routine that accesses the CD-ROM drive by name. cdio_open will call cdio_init, if that hasn't been done previously.

Returns
the cdio object or NULL on error or no device. If NULL is given as the source, we'll use the default driver device.

Sets up to read from place specified by source_name and driver_id. This should be called before using any other routine, except cdio_init. This will call cdio_init, if that hasn't been done previously.

NULL is returned on error.

Definition at line 930 of file device.c.

References cdio_open_am(), driver_id, and NULL.

Referenced by cdio_eject_media_drive(), cdio_get_devices_with_cap_ret(), main(), open(), and udf_open().

◆ cdio_open_aix()

CdIo_t* cdio_open_aix ( const char *  psz_source_name)

Set up CD-ROM for reading using the AIX driver. The device_name is the some sort of device name.

Returns
the cdio object for subsequent operations. NULL on error or there is no AIX driver.
See also
cdio_open()

Initialization routine. This is the only thing that doesn't get called via a function pointer. In fact we are the ones to set that up.

Definition at line 925 of file aix.c.

References cdio_open_am_aix(), and NULL.

◆ cdio_open_am()

CdIo_t* cdio_open_am ( const char *  psz_orig_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 or any routine that accesses the CD-ROM drive by name. This will call cdio_init, if that hasn't been done previously.

If NULL is given as the source, we'll use the default driver device.

Returns
the cdio object or NULL on error or no device.

Sets up to read from place specified by source_name and driver_id. This should be called before using any other routine, except cdio_init. This will call cdio_init, if that hasn't been done previously.

NULL is returned on error.

Definition at line 943 of file device.c.

References CdIo_all_drivers, cdio_drivers, cdio_get_default_device(), cdio_init(), CdIo_last_driver, cdio_open_am_cd(), DRIVER_AIX, DRIVER_BINCUE, DRIVER_CDRDAO, DRIVER_DEVICE, DRIVER_FREEBSD, driver_id, _CdIo::driver_id, DRIVER_LINUX, DRIVER_NETBSD, DRIVER_NRG, CdIo_driver_t::driver_open_am, DRIVER_OSX, DRIVER_SOLARIS, DRIVER_UNKNOWN, DRIVER_WIN32, NULL, and scan_for_driver().

Referenced by cdio_open(), and open().

◆ cdio_open_am_aix()

CdIo_t* cdio_open_am_aix ( const char *  psz_orig_source,
const char *  access_mode 
)

Set up CD-ROM for reading using the AIX driver. The device_name is the some sort of device name.

Returns
the cdio object for subsequent operations. NULL on error or there is no AIX driver.
See also
cdio_open()

Initialization routine. This is the only thing that doesn't get called via a function pointer. In fact we are the ones to set that up.

Definition at line 936 of file aix.c.

References _img_private_t::access_mode, generic_img_private_t::b_cdtext_error, cdio_generic_free(), cdio_generic_lseek(), cdio_generic_read(), cdio_get_default_device_aix(), cdio_get_devices_aix(), cdio_info(), cdio_is_device_generic(), cdio_new(), DRIVER_AIX, _CdIo::driver_id, cdio_funcs_t::eject_media, generic_img_private_t::fd, cdio_funcs_t::free, _img_private_t::gen, cdio_funcs_t::get_arg, cdio_funcs_t::get_cdtext, get_cdtext_generic(), cdio_funcs_t::get_cdtext_raw, cdio_funcs_t::get_default_device, cdio_funcs_t::get_devices, cdio_funcs_t::get_disc_last_lsn, cdio_funcs_t::get_discmode, cdio_funcs_t::get_drive_cap, get_drive_cap_mmc(), cdio_funcs_t::get_first_track_num, get_first_track_num_generic(), cdio_funcs_t::get_hwinfo, cdio_funcs_t::get_mcn, get_mcn_mmc(), cdio_funcs_t::get_num_tracks, get_num_tracks_generic(), cdio_funcs_t::get_track_format, cdio_funcs_t::get_track_green, cdio_funcs_t::get_track_isrc, get_track_isrc_mmc(), cdio_funcs_t::get_track_lba, cdio_funcs_t::get_track_msf, generic_img_private_t::init, cdio_funcs_t::lseek, NULL, cdio_funcs_t::read, cdio_funcs_t::read_audio_sectors, read_cdtext_generic(), cdio_funcs_t::read_mode1_sector, cdio_funcs_t::read_mode1_sectors, cdio_funcs_t::read_mode2_sector, cdio_funcs_t::read_mode2_sectors, cdio_funcs_t::read_toc, cdio_funcs_t::run_mmc_cmd, cdio_funcs_t::set_arg, and generic_img_private_t::toc_init.

Referenced by cdio_open_aix().

◆ cdio_open_am_bincue()

CdIo_t* cdio_open_am_bincue ( const char *  psz_source_name,
const char *  psz_access_mode 
)

Set up BIN/CUE CD disk-image for reading. Source is the .bin or .cue file

Returns
the cdio object or NULL on error or no device..

Initialization routine. This is the only thing that doesn't get called via a function pointer. In fact we are the ones to set that up.

Definition at line 1233 of file bincue.c.

References cdio_open_bincue(), cdio_warn(), and NULL.

◆ cdio_open_am_cd()

CdIo_t* cdio_open_am_cd ( const char *  psz_source,
const char *  psz_access_mode 
)

Set up CD-ROM for reading. The device_name is the some sort of device name.

Returns
the cdio object for subsequent operations. NULL on error or there is no driver for a some sort of hardware CD-ROM.

Set up CD-ROM for reading. The device_name is the some sort of device name.

Returns
the cdio object for subsequent operations. NULL on error or there is no driver for a some sort of hardware CD-ROM.

Definition at line 1025 of file device.c.

References cdio_device_drivers, cdio_init(), CdIo_last_driver, and scan_for_driver().

Referenced by cdio_open_am(), and cdio_open_cd().

◆ cdio_open_am_cdrdao()

CdIo_t* cdio_open_am_cdrdao ( const char *  psz_source_name,
const char *  psz_access_mode 
)

Set up cdrdao CD disk-image for reading. Source is the .toc file

Returns
the cdio object or NULL on error or no device..

Initialization routine. This is the only thing that doesn't get called via a function pointer. In fact we are the ones to set that up.

Definition at line 1283 of file cdrdao.c.

References cdio_open_cdrdao(), cdio_warn(), and NULL.

◆ cdio_open_am_freebsd()

CdIo_t* cdio_open_am_freebsd ( const char *  psz_orig_source_name,
const char *  psz_access_mode 
)

◆ cdio_open_am_linux()

CdIo_t* cdio_open_am_linux ( const char *  psz_orig_source,
const char *  access_mode 
)

◆ cdio_open_am_nrg()

CdIo_t* cdio_open_am_nrg ( const char *  psz_source_name,
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.

Returns
true on success; NULL on error or there is no Nero driver.

Initialization routine. This is the only thing that doesn't get called via a function pointer. In fact we are the ones to set that up.

Definition at line 1309 of file nrg.c.

References cdio_open_nrg(), cdio_warn(), and NULL.

◆ cdio_open_am_osx()

CdIo_t* cdio_open_am_osx ( const char *  psz_source_name,
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.

See also
cdio_open_cd(), cdio_open()

Initialization routine. This is the only thing that doesn't get called via a function pointer. In fact we are the ones to set that up.

Definition at line 1972 of file osx.c.

References cdio_open_osx(), cdio_warn(), and NULL.

◆ cdio_open_am_solaris()

CdIo_t* cdio_open_am_solaris ( const char *  psz_orig_source,
const char *  access_mode 
)

Set up CD-ROM for reading using the Sun Solaris driver. The device_name is the some sort of device name.

Returns
the cdio object for subsequent operations. NULL on error or there is no Solaris driver.

Initialization routine. This is the only thing that doesn't get called via a function pointer. In fact we are the ones to set that up.

Definition at line 1364 of file solaris.c.

References _img_private_t::access_mode, cdio_funcs_t::audio_pause, cdio_funcs_t::audio_play_msf, cdio_funcs_t::audio_play_track_index, cdio_funcs_t::audio_read_subchannel, cdio_funcs_t::audio_resume, cdio_funcs_t::audio_set_volume, cdio_funcs_t::audio_stop, generic_img_private_t::b_cdtext_error, CdIo, cdio_generic_free(), cdio_generic_lseek(), cdio_generic_read(), cdio_get_default_device_solaris(), cdio_get_devices_solaris(), cdio_info(), cdio_is_device_generic(), cdio_new(), DRIVER_SOLARIS, cdio_funcs_t::eject_media, generic_img_private_t::fd, cdio_funcs_t::free, _img_private_t::gen, cdio_funcs_t::get_arg, cdio_funcs_t::get_blocksize, get_blocksize_mmc(), cdio_funcs_t::get_cdtext, get_cdtext_generic(), cdio_funcs_t::get_cdtext_raw, cdio_funcs_t::get_default_device, cdio_funcs_t::get_devices, cdio_funcs_t::get_disc_last_lsn, cdio_funcs_t::get_discmode, cdio_funcs_t::get_drive_cap, get_drive_cap_mmc(), cdio_funcs_t::get_first_track_num, get_first_track_num_generic(), cdio_funcs_t::get_hwinfo, cdio_funcs_t::get_last_session, cdio_funcs_t::get_mcn, get_mcn_mmc(), cdio_funcs_t::get_media_changed, get_media_changed_mmc(), cdio_funcs_t::get_num_tracks, get_num_tracks_generic(), cdio_funcs_t::get_track_channels, get_track_channels_generic(), cdio_funcs_t::get_track_copy_permit, get_track_copy_permit_generic(), cdio_funcs_t::get_track_format, cdio_funcs_t::get_track_green, cdio_funcs_t::get_track_isrc, cdio_funcs_t::get_track_lba, cdio_funcs_t::get_track_msf, cdio_funcs_t::get_track_preemphasis, get_track_preemphasis_generic(), generic_img_private_t::init, cdio_funcs_t::lseek, NULL, cdio_funcs_t::read, cdio_funcs_t::read_audio_sectors, read_cdtext_generic(), cdio_funcs_t::read_data_sectors, read_data_sectors_generic(), cdio_funcs_t::read_mode1_sector, cdio_funcs_t::read_mode1_sectors, cdio_funcs_t::read_mode2_sector, cdio_funcs_t::read_mode2_sectors, cdio_funcs_t::read_toc, cdio_funcs_t::run_mmc_cmd, cdio_funcs_t::set_arg, cdio_funcs_t::set_blocksize, set_blocksize_mmc(), cdio_funcs_t::set_speed, and generic_img_private_t::toc_init.

Referenced by cdio_open_solaris().

◆ cdio_open_am_win32()

CdIo_t* cdio_open_am_win32 ( const char *  psz_orig_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.

Initialization routine. This is the only thing that doesn't get called via a function pointer. In fact we are the ones to set that up.

Definition at line 972 of file win32.c.

References _img_private_t::access_mode, cdio_funcs_t::audio_get_volume, cdio_funcs_t::audio_pause, cdio_funcs_t::audio_play_msf, cdio_funcs_t::audio_play_track_index, cdio_funcs_t::audio_read_subchannel, cdio_funcs_t::audio_resume, cdio_funcs_t::audio_set_volume, cdio_funcs_t::audio_stop, cdio_debug(), cdio_get_default_device_win32(), cdio_get_devices_win32(), cdio_is_device_win32(), cdio_new(), cdio_funcs_t::eject_media, generic_img_private_t::fd, cdio_funcs_t::free, _img_private_t::gen, cdio_funcs_t::get_arg, cdio_funcs_t::get_cdtext, get_cdtext_generic(), cdio_funcs_t::get_cdtext_raw, cdio_funcs_t::get_default_device, cdio_funcs_t::get_devices, cdio_funcs_t::get_disc_last_lsn, cdio_funcs_t::get_discmode, cdio_funcs_t::get_drive_cap, get_drive_cap_mmc(), cdio_funcs_t::get_first_track_num, get_first_track_num_generic(), cdio_funcs_t::get_hwinfo, cdio_funcs_t::get_last_session, cdio_funcs_t::get_mcn, cdio_funcs_t::get_media_changed, get_media_changed_mmc(), cdio_funcs_t::get_num_tracks, get_num_tracks_generic(), cdio_funcs_t::get_track_channels, get_track_channels_generic(), cdio_funcs_t::get_track_copy_permit, get_track_copy_permit_generic(), cdio_funcs_t::get_track_format, cdio_funcs_t::get_track_green, cdio_funcs_t::get_track_isrc, cdio_funcs_t::get_track_lba, cdio_funcs_t::get_track_msf, cdio_funcs_t::get_track_preemphasis, get_track_preemphasis_generic(), generic_img_private_t::init, cdio_funcs_t::lseek, NULL, cdio_funcs_t::read, cdio_funcs_t::read_audio_sectors, read_cdtext_generic(), cdio_funcs_t::read_data_sectors, cdio_funcs_t::read_mode1_sector, cdio_funcs_t::read_mode1_sectors, cdio_funcs_t::read_mode2_sector, cdio_funcs_t::read_mode2_sectors, cdio_funcs_t::read_toc, cdio_funcs_t::run_mmc_cmd, cdio_funcs_t::set_arg, cdio_funcs_t::set_blocksize, set_blocksize_mmc(), set_drive_speed_mmc(), and cdio_funcs_t::set_speed.

Referenced by cdio_open_win32().

◆ cdio_open_bincue()

CdIo_t* cdio_open_bincue ( const char *  psz_source)

Set up BIN/CUE CD disk-image for reading. Source is the .bin or .cue file

Returns
the cdio object or NULL on error or no device.

Initialization routine. This is the only thing that doesn't get called via a function pointer. In fact we are the ones to set that up.

Definition at line 1247 of file bincue.c.

References cdio_is_binfile(), cdio_is_cuefile(), cdio_open_cue(), and NULL.

Referenced by cdio_open_am_bincue().

◆ cdio_open_cd()

CdIo_t* cdio_open_cd ( const char *  psz_source)

Set up CD-ROM for reading. The device_name is the some sort of device name.

Returns
the cdio object for subsequent operations. NULL on error or there is no driver for a some sort of hardware CD-ROM.

Set up CD-ROM for reading. The device_name is the some sort of device name.

Returns
the cdio object for subsequent operations. NULL on error or there is no driver for a some sort of hardware CD-ROM.

Definition at line 1004 of file device.c.

References cdio_open_am_cd(), and NULL.

Referenced by open().

◆ cdio_open_cdrdao()

CdIo_t* cdio_open_cdrdao ( const char *  psz_cue_name)

Set up cdrdao CD disk-image for reading. Source is the .toc file

Returns
the cdio object or NULL on error or no device.

Initialization routine. This is the only thing that doesn't get called via a function pointer. In fact we are the ones to set that up.

Definition at line 1297 of file cdrdao.c.

References _eject_media_image(), _free_image(), _get_arg_image(), _get_cdtext_image(), _get_discmode_image(), _get_drive_cap_image(), _get_first_track_num_image(), _get_lba_track_cdrdao(), _get_mcn_image(), _get_num_tracks_image(), _get_track_format_cdrdao(), _get_track_green_cdrdao(), _get_track_msf_image(), _init_cdrdao(), _lseek_cdrdao(), _read_audio_sectors_cdrdao(), _read_cdrdao(), _read_mode1_sector_cdrdao(), _read_mode1_sectors_cdrdao(), _read_mode2_sector_cdrdao(), _read_mode2_sectors_cdrdao(), _set_arg_image(), cdio_debug(), cdio_generic_unimplemented_set_blocksize(), cdio_generic_unimplemented_set_speed(), cdio_get_default_device_cdrdao(), cdio_get_devices_cdrdao(), cdio_is_tocfile(), cdio_new(), generic_img_private_t::data_source, DRIVER_CDRDAO, _CdIo::driver_id, cdio_funcs_t::eject_media, cdio_funcs_t::free, _img_private_t::gen, cdio_funcs_t::get_arg, cdio_funcs_t::get_cdtext, cdio_funcs_t::get_cdtext_raw, cdio_funcs_t::get_default_device, cdio_funcs_t::get_devices, cdio_funcs_t::get_disc_last_lsn, get_disc_last_lsn_cdrdao(), cdio_funcs_t::get_discmode, cdio_funcs_t::get_drive_cap, cdio_funcs_t::get_first_track_num, cdio_funcs_t::get_hwinfo, get_hwinfo_cdrdao(), cdio_funcs_t::get_mcn, cdio_funcs_t::get_media_changed, get_media_changed_image(), cdio_funcs_t::get_num_tracks, cdio_funcs_t::get_track_channels, get_track_channels_image(), cdio_funcs_t::get_track_copy_permit, get_track_copy_permit_image(), cdio_funcs_t::get_track_format, cdio_funcs_t::get_track_green, cdio_funcs_t::get_track_isrc, get_track_isrc_image(), cdio_funcs_t::get_track_lba, cdio_funcs_t::get_track_msf, cdio_funcs_t::get_track_preemphasis, get_track_preemphasis_image(), cdio_funcs_t::get_track_pregap_lba, get_track_pregap_lba_image(), generic_img_private_t::init, cdio_funcs_t::lseek, NULL, _img_private_t::psz_cue_name, cdio_funcs_t::read, cdio_funcs_t::read_audio_sectors, cdio_funcs_t::read_data_sectors, read_data_sectors_image(), cdio_funcs_t::read_mode1_sector, cdio_funcs_t::read_mode1_sectors, cdio_funcs_t::read_mode2_sector, cdio_funcs_t::read_mode2_sectors, cdio_funcs_t::run_mmc_cmd, cdio_funcs_t::set_arg, cdio_funcs_t::set_blocksize, cdio_funcs_t::set_speed, and generic_img_private_t::source_name.

Referenced by cdio_open_am_cdrdao().

◆ cdio_open_cue()

CdIo_t* cdio_open_cue ( const char *  cue_name)

CDRWIN BIN/CUE CD disc-image routines. Source is the .cue file

Returns
the cdio object for subsequent operations. NULL on error.

Definition at line 1263 of file bincue.c.

References _eject_media_image(), _free_image(), _get_arg_image(), _get_cdtext_image(), _get_discmode_image(), _get_drive_cap_image(), _get_first_track_num_image(), _get_lba_track_bincue(), _get_mcn_image(), _get_num_tracks_image(), _get_track_format_bincue(), _get_track_green_bincue(), _get_track_msf_image(), _init_bincue(), _lseek_bincue(), _read_audio_sectors_bincue(), _read_bincue(), _read_mode1_sector_bincue(), _read_mode1_sectors_bincue(), _read_mode2_sector_bincue(), _read_mode2_sectors_bincue(), _set_arg_image(), cdio_error(), cdio_generic_unimplemented_set_blocksize(), cdio_generic_unimplemented_set_speed(), cdio_get_default_device_bincue(), cdio_get_devices_bincue(), cdio_is_cuefile(), cdio_new(), DRIVER_BINCUE, _CdIo::driver_id, cdio_funcs_t::eject_media, cdio_funcs_t::free, _img_private_t::gen, cdio_funcs_t::get_arg, cdio_funcs_t::get_cdtext, cdio_funcs_t::get_cdtext_raw, cdio_funcs_t::get_default_device, cdio_funcs_t::get_devices, cdio_funcs_t::get_disc_last_lsn, get_disc_last_lsn_bincue(), cdio_funcs_t::get_discmode, cdio_funcs_t::get_drive_cap, cdio_funcs_t::get_first_track_num, cdio_funcs_t::get_hwinfo, get_hwinfo_bincue(), cdio_funcs_t::get_mcn, cdio_funcs_t::get_media_changed, get_media_changed_image(), cdio_funcs_t::get_num_tracks, cdio_funcs_t::get_track_channels, get_track_channels_image(), cdio_funcs_t::get_track_copy_permit, get_track_copy_permit_image(), cdio_funcs_t::get_track_format, cdio_funcs_t::get_track_green, cdio_funcs_t::get_track_isrc, get_track_isrc_image(), cdio_funcs_t::get_track_lba, cdio_funcs_t::get_track_msf, cdio_funcs_t::get_track_preemphasis, get_track_preemphasis_image(), cdio_funcs_t::get_track_pregap_lba, get_track_pregap_lba_image(), generic_img_private_t::init, cdio_funcs_t::lseek, NULL, _img_private_t::psz_cue_name, cdio_funcs_t::read, cdio_funcs_t::read_audio_sectors, cdio_funcs_t::read_data_sectors, read_data_sectors_image(), cdio_funcs_t::read_mode1_sector, cdio_funcs_t::read_mode1_sectors, cdio_funcs_t::read_mode2_sector, cdio_funcs_t::read_mode2_sectors, cdio_funcs_t::run_mmc_cmd, cdio_funcs_t::set_arg, cdio_funcs_t::set_blocksize, and cdio_funcs_t::set_speed.

Referenced by cdio_open_bincue().

◆ cdio_open_freebsd()

CdIo_t* cdio_open_freebsd ( const char *  psz_source_name)

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.

See also
cdio_open_cd(), cdio_open()

Find out if media has changed since the last call.

Parameters
p_user_datathe environment of the CD object to be acted upon.
Returns
1 if media has changed since last call, 0 if not. Error return codes are the same as driver_return_code_t

Initialization routine. This is the only thing that doesn't get called via a function pointer. In fact we are the ones to set that up.

Definition at line 1103 of file freebsd.c.

References cdio_open_am_freebsd(), and NULL.

◆ cdio_open_linux()

CdIo_t* cdio_open_linux ( const char *  psz_source_name)

Set up CD-ROM for reading using the GNU/Linux driver. The device_name is the some sort of device name.

Returns
the cdio object for subsequent operations. NULL on error or there is no GNU/Linux 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.

Initialization routine. This is the only thing that doesn't get called via a function pointer. In fact we are the ones to set that up.

Definition at line 1619 of file gnu_linux.c.

References cdio_open_am_linux(), and NULL.

◆ cdio_open_nrg()

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.

Returns
true on success; NULL on error or there is no Nero driver.

Definition at line 1319 of file nrg.c.

References _eject_media_nrg(), _free_nrg(), _get_arg_image(), _get_cdtext_image(), _get_discmode_image(), _get_drive_cap_image(), _get_first_track_num_image(), _get_mcn_image(), _get_num_tracks_image(), _get_track_green_nrg(), _get_track_msf_image(), _init_nrg(), _lseek_nrg(), _read_audio_sectors_nrg(), _read_mode1_sector_nrg(), _read_mode1_sectors_nrg(), _read_mode2_sector_nrg(), _read_mode2_sectors_nrg(), _read_nrg(), _set_arg_image(), CdIo, cdio_debug(), cdio_get_default_device_nrg(), cdio_get_devices_nrg(), cdio_is_nrg(), cdio_new(), DEFAULT_CDIO_DEVICE, DRIVER_NRG, DTYP_INVALID, cdio_funcs_t::eject_media, cdio_funcs_t::free, _img_private_t::gen, cdio_funcs_t::get_arg, cdio_funcs_t::get_cdtext, cdio_funcs_t::get_cdtext_raw, cdio_funcs_t::get_default_device, cdio_funcs_t::get_devices, cdio_funcs_t::get_disc_last_lsn, get_disc_last_lsn_nrg(), cdio_funcs_t::get_discmode, cdio_funcs_t::get_drive_cap, cdio_funcs_t::get_first_track_num, cdio_funcs_t::get_hwinfo, get_hwinfo_nrg(), cdio_funcs_t::get_mcn, cdio_funcs_t::get_media_changed, get_media_changed_image(), cdio_funcs_t::get_num_tracks, cdio_funcs_t::get_track_channels, get_track_channels_generic(), cdio_funcs_t::get_track_copy_permit, get_track_copy_permit_image(), cdio_funcs_t::get_track_format, get_track_format_nrg(), cdio_funcs_t::get_track_green, cdio_funcs_t::get_track_isrc, get_track_isrc_image(), cdio_funcs_t::get_track_lba, cdio_funcs_t::get_track_msf, cdio_funcs_t::get_track_preemphasis, get_track_preemphasis_generic(), cdio_funcs_t::get_track_pregap_lba, get_track_pregap_lba_image(), generic_img_private_t::i_first_track, generic_img_private_t::i_tracks, generic_img_private_t::init, cdio_funcs_t::lseek, NULL, cdio_funcs_t::read, cdio_funcs_t::read_audio_sectors, cdio_funcs_t::read_data_sectors, read_data_sectors_image(), cdio_funcs_t::read_mode1_sector, cdio_funcs_t::read_mode1_sectors, cdio_funcs_t::read_mode2_sector, cdio_funcs_t::read_mode2_sectors, cdio_funcs_t::run_mmc_cmd, and cdio_funcs_t::set_arg.

Referenced by cdio_open_am_nrg().

◆ cdio_open_osx()

CdIo_t* cdio_open_osx ( const char *  psz_orig_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.

See also
cdio_open_cd(), cdio_open()

Initialization routine. This is the only thing that doesn't get called via a function pointer. In fact we are the ones to set that up.

Definition at line 1988 of file osx.c.

References _img_private_t::access_mode, generic_img_private_t::b_cdtext_error, cdio_generic_free(), cdio_generic_init(), cdio_generic_lseek(), cdio_generic_read(), cdio_get_default_device_osx(), cdio_get_devices_osx(), cdio_info(), cdio_is_device_generic(), cdio_new(), _CdIo::driver_id, DRIVER_OSX, cdio_funcs_t::eject_media, generic_img_private_t::fd, _img_private_t::gen, get_cdtext_generic(), get_first_track_num_generic(), get_num_tracks_generic(), get_track_channels_generic(), get_track_copy_permit_generic(), get_track_preemphasis_generic(), generic_img_private_t::init, NULL, read_cdtext_generic(), and generic_img_private_t::toc_init.

Referenced by cdio_open_am_osx().

◆ cdio_open_solaris()

CdIo_t* cdio_open_solaris ( const char *  psz_source_name)

Set up CD-ROM for reading using the Sun Solaris driver. The device_name is the some sort of device name.

Returns
the cdio object for subsequent operations. NULL on error or there is no Solaris driver.

Initialization routine. This is the only thing that doesn't get called via a function pointer. In fact we are the ones to set that up.

Definition at line 1353 of file solaris.c.

References cdio_open_am_solaris(), and NULL.

◆ cdio_open_win32()

CdIo_t* cdio_open_win32 ( const char *  psz_source_name)

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.

Initialization routine. This is the only thing that doesn't get called via a function pointer. In fact we are the ones to set that up.

Definition at line 953 of file win32.c.

References cdio_open_am_win32(), and NULL.

◆ cdio_set_arg()

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".

Parameters
p_cdiothe CD object to set
keythe key to set
valuethe value to assocaiate with key

Set the arg "key" with "value" in the source device.

Definition at line 77 of file cdio.c.

References DRIVER_OP_ERROR, DRIVER_OP_UNINIT, DRIVER_OP_UNSUPPORTED, _CdIo::env, _CdIo::op, and cdio_funcs_t::set_arg.

Referenced by setArg().

◆ cdio_set_blocksize()

driver_return_code_t cdio_set_blocksize ( const CdIo_t p_cdio,
int  i_blocksize 
)

Set the blocksize for subsequent reads.

Definition at line 1037 of file device.c.

References DRIVER_OP_UNINIT, DRIVER_OP_UNSUPPORTED, _CdIo::env, _CdIo::op, and cdio_funcs_t::set_blocksize.

Referenced by setBlocksize().

◆ cdio_set_speed()

driver_return_code_t cdio_set_speed ( const CdIo_t p_cdio,
int  i_speed 
)

Set the drive speed.

Parameters
p_cdioCD structure set by cdio_open().
i_drive_speedspeed in CD-ROM speed units. Note this not Kbs as would be used in the MMC spec or in mmc_set_speed(). To convert CD-ROM speed units to Kbs, multiply the number by 176 (for raw data) and by 150 (for filesystem data). On many CD-ROM drives, specifying a value too large will result in using the fastest speed.
See also
mmc_set_speed() and mmc_set_drive_speed()

Set the drive speed.

Parameters
p_cdioCD structure set by cdio_open().
i_drive_speedspeed in CD-ROM speed units. Note this not Kbs as would be used in the MMC spec or in mmc_set_speed(). To convert CD-ROM speed units to Kbs, multiply the number by 176 (for raw data) and by 150 (for filesystem data). On many CD-ROM drives, specifying a value too large will result in using the fastest speed.
See also
mmc_set_speed and mmc_set_drive_speed

Definition at line 1059 of file device.c.

References DRIVER_OP_UNINIT, DRIVER_OP_UNSUPPORTED, _CdIo::env, _CdIo::op, and cdio_funcs_t::set_speed.

Referenced by setSpeed().

Variable Documentation

◆ cdio_device_drivers

const driver_id_t cdio_device_drivers[]

A null-terminated (that is DRIVER_UNKNOWN-terminated) ordered (in order of preference) array of device drivers.

Definition at line 265 of file device.c.

Referenced by cdio_close_tray(), cdio_get_default_device_driver(), cdio_get_devices_ret(), cdio_is_device(), and cdio_open_am_cd().

◆ cdio_drivers

const driver_id_t cdio_drivers[]

A null-terminated (that is DRIVER_UNKNOWN-terminated) ordered (in order of preference) array of drivers.

Definition at line 251 of file device.c.

Referenced by cdio_close_tray(), cdio_get_default_device(), cdio_get_default_device_driver(), cdio_get_devices_ret(), cdio_get_drive_cap_dev(), cdio_init(), cdio_is_device(), cdio_open_am(), main(), and print_version().

◆ cdio_os_driver

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.

Definition at line 76 of file device.c.

◆ debug_cdio_drive_cap_misc

cdio_drive_cap_misc_t debug_cdio_drive_cap_misc

The below variables are trickery to force the above enum symbol values to be recorded in debug symbol tables. They are used to allow one to refer to the enumeration value names in the typedefs above in a debugger and debugger expressions.

The below variables are trickery to force enum symbol values to be recorded in debug symbol tables. They are used to allow one to refer to the enumeration value names in the typedefs above in a debugger and debugger expressions.

Definition at line 84 of file device.c.

◆ debug_cdio_drive_cap_read_t

cdio_drive_cap_read_t debug_cdio_drive_cap_read_t

Definition at line 85 of file device.c.

◆ debug_cdio_mmc_hw_len

cdio_mmc_hw_len_t debug_cdio_mmc_hw_len

Definition at line 87 of file device.c.

◆ debug_cdio_src_category_mask

cdio_src_category_mask_t debug_cdio_src_category_mask

Definition at line 88 of file device.c.

◆ debug_drive_cap_write_t

cdio_drive_cap_write_t debug_drive_cap_write_t

Definition at line 86 of file device.c.