2003-04-21 10:17:50 +00:00
|
|
|
|
/* -*- c -*-
|
2004-06-27 15:29:20 +00:00
|
|
|
|
$Id: cdio.h,v 1.54 2004/06/27 15:29:21 rocky Exp $
|
2003-03-24 19:01:09 +00:00
|
|
|
|
|
|
|
|
|
|
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
|
2004-02-21 13:10:51 +00:00
|
|
|
|
Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
2003-03-24 19:01:09 +00:00
|
|
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
2003-11-17 12:06:56 +00:00
|
|
|
|
/** \file cdio.h
|
|
|
|
|
|
* \brief The top-level header for libcdio: the CD Input and Control library.
|
|
|
|
|
|
*/
|
2003-03-24 19:01:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __CDIO_H__
|
|
|
|
|
|
#define __CDIO_H__
|
|
|
|
|
|
|
2003-11-04 12:28:08 +00:00
|
|
|
|
/** Application Interface or Protocol version number. If the public
|
|
|
|
|
|
* interface changes, we increase this number.
|
2003-04-19 09:02:30 +00:00
|
|
|
|
*/
|
|
|
|
|
|
#define CDIO_API_VERSION 1
|
|
|
|
|
|
|
2003-04-22 12:09:08 +00:00
|
|
|
|
#include <cdio/version.h>
|
2003-04-19 09:13:06 +00:00
|
|
|
|
|
2003-03-29 17:32:00 +00:00
|
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#ifdef HAVE_UNISTD_H
|
|
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
2003-04-22 12:09:08 +00:00
|
|
|
|
#include <cdio/types.h>
|
|
|
|
|
|
#include <cdio/sector.h>
|
2003-03-24 19:01:09 +00:00
|
|
|
|
|
2004-04-22 03:24:38 +00:00
|
|
|
|
/**! Flags specifying the category of device to open or is opened. */
|
2003-11-04 12:28:08 +00:00
|
|
|
|
|
|
|
|
|
|
#define CDIO_SRC_IS_DISK_IMAGE_MASK 0x0001 /**< Read source is a CD image. */
|
|
|
|
|
|
#define CDIO_SRC_IS_DEVICE_MASK 0x0002 /**< Read source is a CD device. */
|
2004-04-22 03:24:38 +00:00
|
|
|
|
#define CDIO_SRC_IS_SCSI_MASK 0x0004 /**< Read source SCSI device. */
|
2003-03-24 19:01:09 +00:00
|
|
|
|
#define CDIO_SRC_IS_NATIVE_MASK 0x0008
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
|
extern "C" {
|
|
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
|
|
2003-11-04 12:28:08 +00:00
|
|
|
|
/** This is an opaque structure. */
|
2003-03-24 19:01:09 +00:00
|
|
|
|
typedef struct _CdIo CdIo;
|
|
|
|
|
|
|
2003-11-05 12:40:34 +00:00
|
|
|
|
/** The driver_id_t enumerations may be used to tag a specific driver
|
2003-11-04 12:28:08 +00:00
|
|
|
|
* 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.
|
2004-05-11 12:17:17 +00:00
|
|
|
|
* We have to start with DRIVER_UNKNOWN and devices should come before
|
2003-11-04 12:28:08 +00:00
|
|
|
|
* 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.
|
|
|
|
|
|
*
|
|
|
|
|
|
*/
|
2003-03-24 19:01:09 +00:00
|
|
|
|
typedef enum {
|
|
|
|
|
|
DRIVER_UNKNOWN,
|
2003-11-04 12:28:08 +00:00
|
|
|
|
DRIVER_BSDI, /**< BSDI driver */
|
|
|
|
|
|
DRIVER_FREEBSD, /**< FreeBSD driver */
|
|
|
|
|
|
DRIVER_LINUX, /**< GNU/Linux Driver */
|
|
|
|
|
|
DRIVER_SOLARIS, /**< Sun Solaris Driver */
|
|
|
|
|
|
DRIVER_OSX, /**< Apple OSX Driver */
|
|
|
|
|
|
DRIVER_WIN32, /**< Microsoft Windows Driver */
|
2004-05-04 02:06:48 +00:00
|
|
|
|
DRIVER_CDRDAO, /**< cdrdao format CD image. This is listed
|
|
|
|
|
|
before BINCUE, to make the code prefer cdrdao
|
|
|
|
|
|
over BINCUE when both exist. */
|
2003-11-04 12:28:08 +00:00
|
|
|
|
DRIVER_BINCUE, /**< BIN/CUE format CD image. This is listed before NRG,
|
|
|
|
|
|
to make the code prefer BINCUE over NRG when both
|
|
|
|
|
|
exist. */
|
|
|
|
|
|
DRIVER_NRG, /**< Nero NRG format CD image. */
|
|
|
|
|
|
DRIVER_DEVICE /**< Is really a set of the above; should come last */
|
2003-03-24 19:01:09 +00:00
|
|
|
|
} driver_id_t;
|
|
|
|
|
|
|
2003-11-04 12:28:08 +00:00
|
|
|
|
/** 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
|
2003-11-05 12:40:34 +00:00
|
|
|
|
entry above we don't have to add one.
|
2003-11-04 12:28:08 +00:00
|
|
|
|
*/
|
2003-06-22 22:41:29 +00:00
|
|
|
|
#define CDIO_MIN_DRIVER DRIVER_BSDI
|
|
|
|
|
|
#define CDIO_MIN_DEVICE_DRIVER CDIO_MIN_DRIVER
|
|
|
|
|
|
#define CDIO_MAX_DRIVER DRIVER_NRG
|
|
|
|
|
|
#define CDIO_MAX_DEVICE_DRIVER DRIVER_WIN32
|
2003-03-24 19:01:09 +00:00
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
2003-11-04 12:28:08 +00:00
|
|
|
|
TRACK_FORMAT_AUDIO, /**< Audio track, e.g. CD-DA */
|
|
|
|
|
|
TRACK_FORMAT_CDI, /**< CD-i. How this is different from DATA below? */
|
|
|
|
|
|
TRACK_FORMAT_XA, /**< Mode2 of some sort */
|
|
|
|
|
|
TRACK_FORMAT_DATA, /**< Mode1 of some sort */
|
|
|
|
|
|
TRACK_FORMAT_PSX, /**< Playstation CD. Like audio but only 2336 bytes
|
|
|
|
|
|
* of user data.
|
2003-04-06 06:45:13 +00:00
|
|
|
|
*/
|
2003-11-04 12:28:08 +00:00
|
|
|
|
TRACK_FORMAT_ERROR /**< Dunno what is, or some other error. */
|
2003-03-24 19:01:09 +00:00
|
|
|
|
} track_format_t;
|
|
|
|
|
|
|
2003-11-04 12:28:08 +00:00
|
|
|
|
/*! Printable tags for track_format_t enumeration. */
|
2003-06-11 10:57:02 +00:00
|
|
|
|
extern const char *track_format2str[6];
|
2003-03-24 19:01:09 +00:00
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
|
Eject media in CD drive if there is a routine to do so.
|
2004-05-11 12:17:17 +00:00
|
|
|
|
|
|
|
|
|
|
@param obj the CD object to be acted upon.
|
|
|
|
|
|
@return 0 if success and 1 for failure, and 2 if no routine.
|
2003-05-16 07:18:27 +00:00
|
|
|
|
If the CD is ejected *obj is freed and obj set to NULL.
|
2003-03-24 19:01:09 +00:00
|
|
|
|
*/
|
2003-05-16 07:18:27 +00:00
|
|
|
|
int cdio_eject_media (CdIo **obj);
|
2003-03-29 17:32:00 +00:00
|
|
|
|
|
|
|
|
|
|
/*!
|
2004-05-11 12:17:17 +00:00
|
|
|
|
Free any resources associated with obj. Call this when done using obj
|
|
|
|
|
|
and using CD reading/control operations.
|
|
|
|
|
|
|
|
|
|
|
|
@param obj the CD object to eliminated.
|
2003-03-29 17:32:00 +00:00
|
|
|
|
*/
|
2003-03-24 19:01:09 +00:00
|
|
|
|
void cdio_destroy (CdIo *obj);
|
|
|
|
|
|
|
2003-09-28 17:14:20 +00:00
|
|
|
|
/*!
|
|
|
|
|
|
Free device list returned by cdio_get_devices or
|
|
|
|
|
|
cdio_get_devices_with_cap.
|
2004-05-11 12:17:17 +00:00
|
|
|
|
|
|
|
|
|
|
@param device_list list returned by cdio_get_devices or
|
|
|
|
|
|
cdio_get_devices_with_cap
|
|
|
|
|
|
|
|
|
|
|
|
@see cdio_get_devices, cdio_get_devices_with_cap
|
|
|
|
|
|
|
2003-09-28 17:14:20 +00:00
|
|
|
|
*/
|
|
|
|
|
|
void cdio_free_device_list (char * device_list[]);
|
|
|
|
|
|
|
2003-03-24 19:01:09 +00:00
|
|
|
|
/*!
|
2004-05-11 12:17:17 +00:00
|
|
|
|
Get the value associatied with key.
|
|
|
|
|
|
|
|
|
|
|
|
@param obj the CD object queried
|
|
|
|
|
|
@param key the key to retrieve
|
|
|
|
|
|
@return the value associatd with "key" or NULL if obj is NULL
|
2003-05-18 01:50:51 +00:00
|
|
|
|
or "key" does not exist.
|
2003-03-24 19:01:09 +00:00
|
|
|
|
*/
|
|
|
|
|
|
const char * cdio_get_arg (const CdIo *obj, const char key[]);
|
|
|
|
|
|
|
2003-09-28 17:14:20 +00:00
|
|
|
|
/*!
|
2004-05-11 12:17:17 +00:00
|
|
|
|
Get an array of device names in search_devices that have at
|
2003-09-28 17:14:20 +00:00
|
|
|
|
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.
|
2004-05-11 12:17:17 +00:00
|
|
|
|
|
|
|
|
|
|
@return 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.
|
2003-09-28 17:14:20 +00:00
|
|
|
|
*/
|
|
|
|
|
|
char ** cdio_get_devices_with_cap (char* search_devices[],
|
|
|
|
|
|
cdio_fs_anal_t capabilities, bool any);
|
2003-09-29 02:56:22 +00:00
|
|
|
|
|
2003-11-04 12:28:08 +00:00
|
|
|
|
/*! Return an array of device names. If you want a specific
|
2004-02-21 13:10:51 +00:00
|
|
|
|
devices for a driver, give that device. If you want hardware
|
2003-09-29 02:56:22 +00:00
|
|
|
|
devices, give DRIVER_DEVICE and if you want all possible devices,
|
|
|
|
|
|
image drivers and hardware drivers give DRIVER_UNKNOWN.
|
2003-09-28 17:14:20 +00:00
|
|
|
|
|
|
|
|
|
|
NULL is returned if we couldn't return a list of devices.
|
2004-06-19 10:39:30 +00:00
|
|
|
|
|
|
|
|
|
|
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.
|
2003-09-28 17:14:20 +00:00
|
|
|
|
*/
|
2003-09-29 02:56:22 +00:00
|
|
|
|
char ** cdio_get_devices (driver_id_t driver);
|
2003-09-28 17:14:20 +00:00
|
|
|
|
|
2003-03-24 19:01:09 +00:00
|
|
|
|
/*!
|
2004-05-11 12:17:17 +00:00
|
|
|
|
Get the default CD device.
|
2003-09-29 02:56:22 +00:00
|
|
|
|
if obj is NULL (we haven't initialized a specific device driver),
|
2003-04-10 04:13:41 +00:00
|
|
|
|
then find a suitable one and return the default device for that.
|
|
|
|
|
|
|
2004-05-11 12:17:17 +00:00
|
|
|
|
@param obj the CD object queried
|
|
|
|
|
|
@return a string containing the default CD device or NULL is
|
|
|
|
|
|
if we couldn't get a default device.
|
2004-06-19 10:39:30 +00:00
|
|
|
|
|
|
|
|
|
|
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.
|
2003-03-24 19:01:09 +00:00
|
|
|
|
*/
|
|
|
|
|
|
char * cdio_get_default_device (const CdIo *obj);
|
|
|
|
|
|
|
2004-04-22 03:24:38 +00:00
|
|
|
|
/*!
|
2004-05-11 12:17:17 +00:00
|
|
|
|
Get the what kind of device we've got.
|
2004-04-22 03:24:38 +00:00
|
|
|
|
|
2004-05-11 12:17:17 +00:00
|
|
|
|
@param obj the CD object queried
|
|
|
|
|
|
@return a list of device capabilities.
|
2004-06-19 10:39:30 +00:00
|
|
|
|
|
|
|
|
|
|
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.
|
2004-04-22 03:24:38 +00:00
|
|
|
|
*/
|
2004-04-23 22:10:52 +00:00
|
|
|
|
cdio_drive_cap_t cdio_get_drive_cap (const CdIo *obj);
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
2004-05-11 12:17:17 +00:00
|
|
|
|
Get the drive capabilities for a specified device.
|
2004-04-23 22:10:52 +00:00
|
|
|
|
|
2004-05-11 12:17:17 +00:00
|
|
|
|
@return a list of device capabilities.
|
2004-06-19 10:39:30 +00:00
|
|
|
|
|
|
|
|
|
|
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.
|
2004-04-23 22:10:52 +00:00
|
|
|
|
*/
|
|
|
|
|
|
cdio_drive_cap_t cdio_get_drive_cap_dev (const char *device);
|
2004-04-22 03:24:38 +00:00
|
|
|
|
|
2003-09-25 09:38:15 +00:00
|
|
|
|
/*!
|
2004-05-11 12:17:17 +00:00
|
|
|
|
Get the media catalog number (MCN) from the CD.
|
|
|
|
|
|
|
|
|
|
|
|
@return the media catalog number r NULL if there is none or we
|
|
|
|
|
|
don't have the ability to get it.
|
2003-09-25 09:38:15 +00:00
|
|
|
|
|
|
|
|
|
|
Note: string is malloc'd so caller has to free() the returned
|
|
|
|
|
|
string when done with it.
|
2004-05-11 12:17:17 +00:00
|
|
|
|
|
2003-09-25 09:38:15 +00:00
|
|
|
|
*/
|
2004-06-27 15:29:20 +00:00
|
|
|
|
char * cdio_get_mcn (const CdIo *obj);
|
2003-09-25 09:38:15 +00:00
|
|
|
|
|
2003-05-24 15:24:15 +00:00
|
|
|
|
/*!
|
2004-05-11 12:17:17 +00:00
|
|
|
|
Get a string containing the name of the driver in use.
|
|
|
|
|
|
|
|
|
|
|
|
@return a string with driver name or NULL if CdIo is NULL (we
|
|
|
|
|
|
haven't initialized a specific device.
|
2003-05-24 15:24:15 +00:00
|
|
|
|
*/
|
|
|
|
|
|
const char * cdio_get_driver_name (const CdIo *obj);
|
|
|
|
|
|
|
2004-05-04 02:06:48 +00:00
|
|
|
|
/*!
|
2004-05-11 12:17:17 +00:00
|
|
|
|
Get the driver id.
|
2004-05-04 02:06:48 +00:00
|
|
|
|
if CdIo is NULL (we haven't initialized a specific device driver),
|
|
|
|
|
|
then return DRIVER_UNKNOWN.
|
2004-05-11 12:17:17 +00:00
|
|
|
|
|
|
|
|
|
|
@return the driver id..
|
2004-05-04 02:06:48 +00:00
|
|
|
|
*/
|
|
|
|
|
|
driver_id_t cdio_get_driver_id (const CdIo *obj);
|
|
|
|
|
|
|
2003-03-24 19:01:09 +00:00
|
|
|
|
/*!
|
2004-05-11 12:17:17 +00:00
|
|
|
|
Get the number of the first track.
|
|
|
|
|
|
|
|
|
|
|
|
@return the track number or CDIO_INVALID_TRACK
|
|
|
|
|
|
on error.
|
2003-03-24 19:01:09 +00:00
|
|
|
|
*/
|
2004-06-06 11:47:39 +00:00
|
|
|
|
track_t cdio_get_first_track_num(const CdIo *obj);
|
2003-03-24 19:01:09 +00:00
|
|
|
|
|
|
|
|
|
|
/*!
|
2004-05-11 12:17:17 +00:00
|
|
|
|
Get the number of tracks on the CD.
|
|
|
|
|
|
|
|
|
|
|
|
@return the number of tracks, or CDIO_INVALID_TRACK if there is
|
|
|
|
|
|
an error.
|
2003-03-24 19:01:09 +00:00
|
|
|
|
*/
|
|
|
|
|
|
track_t cdio_get_num_tracks (const CdIo *obj);
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
2003-11-04 12:28:08 +00:00
|
|
|
|
Get the format (audio, mode2, mode1) of track.
|
2003-03-24 19:01:09 +00:00
|
|
|
|
*/
|
2004-06-06 11:45:37 +00:00
|
|
|
|
track_format_t cdio_get_track_format(const CdIo *obj, track_t i_track);
|
2003-03-24 19:01:09 +00:00
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
|
Return true if we have XA data (green, mode2 form1) or
|
|
|
|
|
|
XA data (green, mode2 form2). That is track begins:
|
|
|
|
|
|
sync - header - subheader
|
|
|
|
|
|
12 4 - 8
|
|
|
|
|
|
|
|
|
|
|
|
FIXME: there's gotta be a better design for this and get_track_format?
|
|
|
|
|
|
*/
|
2004-06-06 11:45:37 +00:00
|
|
|
|
bool cdio_get_track_green(const CdIo *obj, track_t i_track);
|
2003-03-24 19:01:09 +00:00
|
|
|
|
|
2003-03-29 17:32:00 +00:00
|
|
|
|
/*!
|
2004-05-11 12:17:17 +00:00
|
|
|
|
Get the starting LBA for track number
|
2004-06-06 11:45:37 +00:00
|
|
|
|
i_track in obj. Track numbers usually start at something
|
|
|
|
|
|
greater than 0, usually 1.
|
|
|
|
|
|
|
2003-03-29 17:32:00 +00:00
|
|
|
|
The "leadout" track is specified either by
|
2004-06-06 11:45:37 +00:00
|
|
|
|
using i_track LEADOUT_TRACK or the total tracks+1.
|
2004-05-11 12:17:17 +00:00
|
|
|
|
|
|
|
|
|
|
@param obj object to get information from
|
2004-06-06 11:45:37 +00:00
|
|
|
|
@param i_track the track number we want the LSN for
|
2004-05-11 12:17:17 +00:00
|
|
|
|
@return the starting LBA or CDIO_INVALID_LBA on error.
|
2003-03-29 17:32:00 +00:00
|
|
|
|
*/
|
2004-06-06 11:45:37 +00:00
|
|
|
|
lba_t cdio_get_track_lba(const CdIo *obj, track_t i_track);
|
2003-03-29 17:32:00 +00:00
|
|
|
|
|
2003-04-10 04:13:41 +00:00
|
|
|
|
/*!
|
2004-06-06 11:45:37 +00:00
|
|
|
|
Return the starting MSF (minutes/secs/frames) for track number
|
|
|
|
|
|
i_track in obj. Track numbers usually start at something
|
|
|
|
|
|
greater than 0, usually 1.
|
|
|
|
|
|
|
2003-04-10 04:13:41 +00:00
|
|
|
|
The "leadout" track is specified either by
|
2004-06-06 11:45:37 +00:00
|
|
|
|
using i_track LEADOUT_TRACK or the total tracks+1.
|
2004-05-11 12:17:17 +00:00
|
|
|
|
|
|
|
|
|
|
@param obj object to get information from
|
2004-06-06 11:45:37 +00:00
|
|
|
|
@param i_track the track number we want the LSN for
|
2004-05-11 12:17:17 +00:00
|
|
|
|
@return the starting LSN or CDIO_INVALID_LSN on error.
|
2003-04-10 04:13:41 +00:00
|
|
|
|
*/
|
2004-06-06 11:45:37 +00:00
|
|
|
|
lsn_t cdio_get_track_lsn(const CdIo *obj, track_t i_track);
|
2003-04-10 04:13:41 +00:00
|
|
|
|
|
2003-03-24 19:01:09 +00:00
|
|
|
|
/*!
|
2004-06-06 11:45:37 +00:00
|
|
|
|
Return the starting MSF (minutes/secs/frames) for track number
|
|
|
|
|
|
i_track in obj. Track numbers usually start at something
|
|
|
|
|
|
greater than 0, usually 1.
|
|
|
|
|
|
|
2003-03-24 19:01:09 +00:00
|
|
|
|
The "leadout" track is specified either by
|
2004-06-06 11:45:37 +00:00
|
|
|
|
using i_track LEADOUT_TRACK or the total tracks+1.
|
2004-05-11 12:17:17 +00:00
|
|
|
|
|
|
|
|
|
|
@return true if things worked or false if there is no track entry.
|
2003-03-24 19:01:09 +00:00
|
|
|
|
*/
|
2004-06-06 11:45:37 +00:00
|
|
|
|
bool cdio_get_track_msf(const CdIo *obj, track_t i_track,
|
2003-03-29 17:32:00 +00:00
|
|
|
|
/*out*/ msf_t *msf);
|
2003-03-24 19:01:09 +00:00
|
|
|
|
|
2003-03-29 17:32:00 +00:00
|
|
|
|
/*!
|
2004-05-11 12:17:17 +00:00
|
|
|
|
Get the number of sectors between this track an the next. This
|
2003-03-29 17:32:00 +00:00
|
|
|
|
includes any pregap sectors before the start of the next track.
|
2004-06-06 11:45:37 +00:00
|
|
|
|
Track numbers usually start at something
|
|
|
|
|
|
greater than 0, usually 1.
|
2004-05-11 12:17:17 +00:00
|
|
|
|
|
|
|
|
|
|
@return the number of sectors or 0 if there is an error.
|
2003-03-29 17:32:00 +00:00
|
|
|
|
*/
|
2004-06-06 11:45:37 +00:00
|
|
|
|
unsigned int cdio_get_track_sec_count(const CdIo *obj, track_t i_track);
|
2003-03-29 17:32:00 +00:00
|
|
|
|
|
|
|
|
|
|
/*!
|
2004-05-13 01:50:10 +00:00
|
|
|
|
Reposition read offset
|
2003-03-29 17:32:00 +00:00
|
|
|
|
Similar to (if not the same as) libc's lseek()
|
2004-05-11 12:17:17 +00:00
|
|
|
|
|
|
|
|
|
|
@param obj object to get information from
|
|
|
|
|
|
@param offset amount to seek
|
|
|
|
|
|
@param whence like corresponding parameter in libc's lseek, e.g.
|
|
|
|
|
|
SEEK_SET or SEEK_END.
|
|
|
|
|
|
@return (off_t) -1 on error.
|
2003-03-29 17:32:00 +00:00
|
|
|
|
*/
|
2003-09-05 22:48:16 +00:00
|
|
|
|
off_t cdio_lseek(const CdIo *obj, off_t offset, int whence);
|
2003-03-29 17:32:00 +00:00
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
|
Reads into buf the next size bytes.
|
|
|
|
|
|
Similar to (if not the same as) libc's read()
|
2004-05-11 12:17:17 +00:00
|
|
|
|
|
|
|
|
|
|
@return (ssize_t) -1 on error.
|
2003-03-29 17:32:00 +00:00
|
|
|
|
*/
|
2003-09-05 22:48:16 +00:00
|
|
|
|
ssize_t cdio_read(const CdIo *obj, void *buf, size_t size);
|
2003-03-29 17:32:00 +00:00
|
|
|
|
|
2003-04-10 04:13:41 +00:00
|
|
|
|
/*!
|
2004-05-11 12:17:17 +00:00
|
|
|
|
Read an audio sector
|
|
|
|
|
|
|
|
|
|
|
|
@param obj object to read from
|
|
|
|
|
|
@param buf place to read data into
|
|
|
|
|
|
@param lsn sector to read
|
|
|
|
|
|
|
|
|
|
|
|
@return 0 if no error, nonzero otherwise.
|
2003-11-04 12:28:08 +00:00
|
|
|
|
*/
|
2003-09-05 22:48:16 +00:00
|
|
|
|
int cdio_read_audio_sector (const CdIo *obj, void *buf, lsn_t lsn);
|
2003-04-10 04:13:41 +00:00
|
|
|
|
|
2003-09-20 12:34:02 +00:00
|
|
|
|
/*!
|
2004-05-11 12:17:17 +00:00
|
|
|
|
Reads audio sectors
|
|
|
|
|
|
|
|
|
|
|
|
@param obj object to read from
|
|
|
|
|
|
@param buf place to read data into
|
|
|
|
|
|
@param lsn sector to read
|
2004-06-06 11:45:37 +00:00
|
|
|
|
@param i_sectors number of sectors to read
|
2004-05-11 12:17:17 +00:00
|
|
|
|
|
|
|
|
|
|
@return 0 if no error, nonzero otherwise.
|
2003-11-04 12:28:08 +00:00
|
|
|
|
*/
|
2003-09-20 12:34:02 +00:00
|
|
|
|
int cdio_read_audio_sectors (const CdIo *obj, void *buf, lsn_t lsn,
|
2004-06-06 11:45:37 +00:00
|
|
|
|
unsigned int i_sectors);
|
2003-09-20 12:34:02 +00:00
|
|
|
|
|
2003-06-07 20:42:49 +00:00
|
|
|
|
/*!
|
2004-05-11 12:17:17 +00:00
|
|
|
|
Reads a mode1 sector
|
|
|
|
|
|
|
|
|
|
|
|
@param obj object to read from
|
|
|
|
|
|
@param buf place to read data into
|
|
|
|
|
|
@param lsn sector to read
|
|
|
|
|
|
@param b_form2 true for reading mode1 form2 sectors or false for
|
|
|
|
|
|
mode1 form1 sectors.
|
|
|
|
|
|
|
|
|
|
|
|
@return 0 if no error, nonzero otherwise.
|
2003-11-04 12:28:08 +00:00
|
|
|
|
*/
|
2003-09-05 22:48:16 +00:00
|
|
|
|
int cdio_read_mode1_sector (const CdIo *obj, void *buf, lsn_t lsn,
|
2004-03-06 18:30:44 +00:00
|
|
|
|
bool b_form2);
|
2003-11-04 12:28:08 +00:00
|
|
|
|
|
2003-08-31 14:26:06 +00:00
|
|
|
|
/*!
|
2004-05-11 12:17:17 +00:00
|
|
|
|
Reads mode1 sectors
|
|
|
|
|
|
|
|
|
|
|
|
@param obj object to read from
|
|
|
|
|
|
@param buf place to read data into
|
|
|
|
|
|
@param lsn sector to read
|
|
|
|
|
|
@param b_form2 true for reading mode1 form2 sectors or false for
|
|
|
|
|
|
mode1 form1 sectors.
|
2004-06-06 11:45:37 +00:00
|
|
|
|
@param i_sectors number of sectors to read
|
2004-05-11 12:17:17 +00:00
|
|
|
|
|
|
|
|
|
|
@return 0 if no error, nonzero otherwise.
|
2003-11-04 12:28:08 +00:00
|
|
|
|
*/
|
2003-09-05 22:48:16 +00:00
|
|
|
|
int cdio_read_mode1_sectors (const CdIo *obj, void *buf, lsn_t lsn,
|
2004-06-06 11:45:37 +00:00
|
|
|
|
bool b_form2, unsigned int i_sectors);
|
2003-11-04 12:28:08 +00:00
|
|
|
|
|
2003-03-24 19:01:09 +00:00
|
|
|
|
/*!
|
2004-05-11 12:17:17 +00:00
|
|
|
|
Reads a mode1 sector
|
|
|
|
|
|
|
|
|
|
|
|
@param obj object to read from
|
|
|
|
|
|
@param buf place to read data into
|
|
|
|
|
|
@param lsn sector to read
|
|
|
|
|
|
@param b_form2 true for reading mode1 form2 sectors or false for
|
|
|
|
|
|
mode1 form1 sectors.
|
|
|
|
|
|
|
|
|
|
|
|
@return 0 if no error, nonzero otherwise.
|
2003-11-04 12:28:08 +00:00
|
|
|
|
*/
|
2003-09-05 22:48:16 +00:00
|
|
|
|
int cdio_read_mode2_sector (const CdIo *obj, void *buf, lsn_t lsn,
|
2004-03-06 18:30:44 +00:00
|
|
|
|
bool b_form2);
|
2003-11-04 12:28:08 +00:00
|
|
|
|
|
2003-03-24 19:01:09 +00:00
|
|
|
|
/*!
|
2004-05-11 12:17:17 +00:00
|
|
|
|
Reads mode2 sectors
|
|
|
|
|
|
|
|
|
|
|
|
@param obj object to read from
|
|
|
|
|
|
@param buf place to read data into
|
|
|
|
|
|
@param lsn sector to read
|
|
|
|
|
|
@param b_form2 true for reading mode1 form2 sectors or false for
|
|
|
|
|
|
mode1 form1 sectors.
|
2004-06-06 11:45:37 +00:00
|
|
|
|
@param i_sectors number of sectors to read
|
2004-05-11 12:17:17 +00:00
|
|
|
|
|
|
|
|
|
|
@return 0 if no error, nonzero otherwise.
|
2003-03-24 19:01:09 +00:00
|
|
|
|
*/
|
2003-09-05 22:48:16 +00:00
|
|
|
|
int cdio_read_mode2_sectors (const CdIo *obj, void *buf, lsn_t lsn,
|
2004-06-06 11:45:37 +00:00
|
|
|
|
bool b_form2, unsigned int i_sectors);
|
2003-03-24 19:01:09 +00:00
|
|
|
|
|
|
|
|
|
|
/*!
|
2004-05-11 12:17:17 +00:00
|
|
|
|
Set the arg "key" with "value" in "obj".
|
|
|
|
|
|
|
|
|
|
|
|
@param obj the CD object to set
|
|
|
|
|
|
@param key the key to set
|
|
|
|
|
|
@param value the value to assocaiate with key
|
|
|
|
|
|
@return 0 if no error was found, and nonzero otherwise.
|
2003-03-24 19:01:09 +00:00
|
|
|
|
*/
|
|
|
|
|
|
int cdio_set_arg (CdIo *obj, const char key[], const char value[]);
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
2004-05-11 12:17:17 +00:00
|
|
|
|
Get the size of the CD in logical block address (LBA) units.
|
|
|
|
|
|
|
|
|
|
|
|
@param obj the CD object queried
|
|
|
|
|
|
@return the size
|
2003-03-24 19:01:09 +00:00
|
|
|
|
*/
|
2003-09-05 22:48:16 +00:00
|
|
|
|
uint32_t cdio_stat_size (const CdIo *obj);
|
2003-11-04 12:28:08 +00:00
|
|
|
|
|
2003-03-24 19:01:09 +00:00
|
|
|
|
/*!
|
|
|
|
|
|
Initialize CD Reading and control routines. Should be called first.
|
2003-11-04 12:28:08 +00:00
|
|
|
|
*/
|
2003-03-24 19:01:09 +00:00
|
|
|
|
bool cdio_init(void);
|
2003-11-04 12:28:08 +00:00
|
|
|
|
|
2003-03-24 19:01:09 +00:00
|
|
|
|
/* True if xxx driver is available. where xxx=linux, solaris, nrg, ...
|
|
|
|
|
|
*/
|
2003-11-05 12:40:34 +00:00
|
|
|
|
|
|
|
|
|
|
/*! True if BSDI driver is available. */
|
2003-03-24 23:59:22 +00:00
|
|
|
|
bool cdio_have_bsdi (void);
|
2003-11-05 12:40:34 +00:00
|
|
|
|
|
|
|
|
|
|
/*! True if FreeBSD driver is available. */
|
2003-03-24 23:59:22 +00:00
|
|
|
|
bool cdio_have_freebsd (void);
|
2003-11-05 12:40:34 +00:00
|
|
|
|
|
|
|
|
|
|
/*! True if GNU/Linux driver is available. */
|
2003-03-24 19:01:09 +00:00
|
|
|
|
bool cdio_have_linux (void);
|
2003-11-05 12:40:34 +00:00
|
|
|
|
|
|
|
|
|
|
/*! True if Sun Solaris driver is available. */
|
2003-03-24 19:01:09 +00:00
|
|
|
|
bool cdio_have_solaris (void);
|
2003-11-05 12:40:34 +00:00
|
|
|
|
|
|
|
|
|
|
/*! True if Apple OSX driver is available. */
|
2003-09-13 06:25:36 +00:00
|
|
|
|
bool cdio_have_osx (void);
|
2003-11-05 12:40:34 +00:00
|
|
|
|
|
|
|
|
|
|
/*! True if Microsoft Windows driver is available. */
|
2003-05-27 02:55:58 +00:00
|
|
|
|
bool cdio_have_win32 (void);
|
2003-11-05 12:40:34 +00:00
|
|
|
|
|
|
|
|
|
|
/*! True if Nero driver is available. */
|
2003-03-24 19:01:09 +00:00
|
|
|
|
bool cdio_have_nrg (void);
|
2003-11-05 12:40:34 +00:00
|
|
|
|
|
|
|
|
|
|
/*! True if BIN/CUE driver is available. */
|
2003-03-24 19:01:09 +00:00
|
|
|
|
bool cdio_have_bincue (void);
|
|
|
|
|
|
|
2004-05-04 02:06:48 +00:00
|
|
|
|
/*! True if cdrdao CDRDAO driver is available. */
|
|
|
|
|
|
bool cdio_have_cdrdao (void);
|
|
|
|
|
|
|
2003-11-05 12:40:34 +00:00
|
|
|
|
/*! Like cdio_have_xxx but uses an enumeration instead. */
|
2003-03-24 19:01:09 +00:00
|
|
|
|
bool cdio_have_driver (driver_id_t driver_id);
|
|
|
|
|
|
|
2004-05-11 12:17:17 +00:00
|
|
|
|
/*!
|
|
|
|
|
|
Get a string decribing driver_id.
|
|
|
|
|
|
|
|
|
|
|
|
@param driver_id the driver you want the description for
|
|
|
|
|
|
@return a sring of driver description
|
|
|
|
|
|
*/
|
2003-06-07 01:19:46 +00:00
|
|
|
|
const char *cdio_driver_describe (driver_id_t driver_id);
|
|
|
|
|
|
|
2003-03-24 19:01:09 +00:00
|
|
|
|
/*! Sets up to read from place specified by source_name and
|
2004-04-30 06:54:15 +00:00
|
|
|
|
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.
|
2003-03-24 19:01:09 +00:00
|
|
|
|
|
2004-05-11 12:17:17 +00:00
|
|
|
|
@return the cdio object or NULL on error or no device.
|
2003-03-24 19:01:09 +00:00
|
|
|
|
*/
|
|
|
|
|
|
CdIo * cdio_open (const char *source_name, driver_id_t driver_id);
|
|
|
|
|
|
|
2004-04-30 06:54:15 +00:00
|
|
|
|
/*! Sets up to read from place specified by source_name, 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.
|
|
|
|
|
|
|
2004-05-11 12:17:17 +00:00
|
|
|
|
@return the cdio object or NULL on error or no device.
|
2004-04-30 06:54:15 +00:00
|
|
|
|
*/
|
|
|
|
|
|
CdIo * cdio_open_am (const char *psz_source_name,
|
|
|
|
|
|
driver_id_t driver_id, const char *psz_access_mode);
|
|
|
|
|
|
|
2003-11-05 12:40:34 +00:00
|
|
|
|
/*! Set up BIN/CUE CD disk-image for reading. Source is the .bin or
|
|
|
|
|
|
.cue file
|
2003-03-24 19:01:09 +00:00
|
|
|
|
|
2004-05-11 12:17:17 +00:00
|
|
|
|
@return the cdio object or NULL on error or no device.
|
2003-03-24 19:01:09 +00:00
|
|
|
|
*/
|
2004-04-30 06:54:15 +00:00
|
|
|
|
CdIo * cdio_open_bincue (const char *psz_cue_name);
|
|
|
|
|
|
|
|
|
|
|
|
/*! Set up BIN/CUE CD disk-image for reading. Source is the .bin or
|
|
|
|
|
|
.cue file
|
|
|
|
|
|
|
2004-05-11 12:17:17 +00:00
|
|
|
|
@return the cdio object or NULL on error or no device..
|
2004-04-30 06:54:15 +00:00
|
|
|
|
*/
|
|
|
|
|
|
CdIo * cdio_open_am_bincue (const char *psz_cue_name,
|
|
|
|
|
|
const char *psz_access_mode);
|
2003-03-24 19:01:09 +00:00
|
|
|
|
|
2004-05-04 02:06:48 +00:00
|
|
|
|
/*! Set up cdrdao CD disk-image for reading. Source is the .toc file
|
|
|
|
|
|
|
2004-05-11 12:17:17 +00:00
|
|
|
|
@return the cdio object or NULL on error or no device.
|
2004-05-04 02:06:48 +00:00
|
|
|
|
*/
|
|
|
|
|
|
CdIo * cdio_open_cdrdao (const char *psz_toc_name);
|
|
|
|
|
|
|
|
|
|
|
|
/*! Set up cdrdao CD disk-image for reading. Source is the .toc file
|
|
|
|
|
|
|
2004-05-11 12:17:17 +00:00
|
|
|
|
@return the cdio object or NULL on error or no device..
|
2004-05-04 02:06:48 +00:00
|
|
|
|
*/
|
|
|
|
|
|
CdIo * cdio_open_am_cdrdao (const char *psz_toc_name,
|
|
|
|
|
|
const char *psz_access_mode);
|
|
|
|
|
|
|
2003-11-05 12:40:34 +00:00
|
|
|
|
/*! Return a string containing the default CUE file that would
|
|
|
|
|
|
be used when none is specified.
|
|
|
|
|
|
|
2004-05-11 12:17:17 +00:00
|
|
|
|
@return the cdio object or NULL on error or no device.
|
2003-11-05 12:40:34 +00:00
|
|
|
|
*/
|
2003-04-10 04:13:41 +00:00
|
|
|
|
char * cdio_get_default_device_bincue(void);
|
|
|
|
|
|
|
2003-09-30 03:26:11 +00:00
|
|
|
|
char **cdio_get_devices_bincue(void);
|
|
|
|
|
|
|
2004-05-04 02:06:48 +00:00
|
|
|
|
/*! Return a string containing the default CUE file that would
|
|
|
|
|
|
be used when none is specified.
|
|
|
|
|
|
|
|
|
|
|
|
NULL is returned on error or there is no device.
|
|
|
|
|
|
*/
|
|
|
|
|
|
char * cdio_get_default_device_cdrdao(void);
|
|
|
|
|
|
|
|
|
|
|
|
char **cdio_get_devices_cdrdao(void);
|
|
|
|
|
|
|
2003-11-05 12:40:34 +00:00
|
|
|
|
/*! Set up CD-ROM for reading. The device_name is
|
|
|
|
|
|
the some sort of device name.
|
2003-03-24 19:01:09 +00:00
|
|
|
|
|
2004-05-19 03:00:03 +00:00
|
|
|
|
@return the cdio object for subsequent operations.
|
|
|
|
|
|
NULL on error or there is no driver for a some sort of hardware CD-ROM.
|
2003-03-24 19:01:09 +00:00
|
|
|
|
*/
|
2003-06-07 16:53:21 +00:00
|
|
|
|
CdIo * cdio_open_cd (const char *device_name);
|
2003-03-24 19:01:09 +00:00
|
|
|
|
|
2004-05-19 03:00:03 +00:00
|
|
|
|
/*! Set up CD-ROM for reading. The device_name is
|
|
|
|
|
|
the some sort of device name.
|
|
|
|
|
|
|
|
|
|
|
|
@return the cdio object for subsequent operations.
|
|
|
|
|
|
NULL on error or there is no driver for a some sort of hardware CD-ROM.
|
|
|
|
|
|
*/
|
|
|
|
|
|
CdIo * cdio_open_am_cd (const char *psz_device,
|
|
|
|
|
|
const char *psz_access_mode);
|
|
|
|
|
|
|
|
|
|
|
|
/*! CDRWIN BIN/CUE CD disk-image routines. Source is the .cue file
|
2003-03-24 19:01:09 +00:00
|
|
|
|
|
2004-05-19 03:00:03 +00:00
|
|
|
|
@return the cdio object for subsequent operations.
|
|
|
|
|
|
NULL on error.
|
2003-03-24 19:01:09 +00:00
|
|
|
|
*/
|
|
|
|
|
|
CdIo * cdio_open_cue (const char *cue_name);
|
|
|
|
|
|
|
2003-11-05 12:40:34 +00:00
|
|
|
|
/*! Set up CD-ROM for reading using the BSDI driver. The device_name is
|
|
|
|
|
|
the some sort of device name.
|
|
|
|
|
|
|
2004-05-19 03:00:03 +00:00
|
|
|
|
@return the cdio object for subsequent operations.
|
|
|
|
|
|
NULL on error or there is no BSDI driver.
|
2003-11-17 12:06:56 +00:00
|
|
|
|
|
|
|
|
|
|
@see cdio_open
|
2003-11-05 12:40:34 +00:00
|
|
|
|
*/
|
2004-04-30 06:54:15 +00:00
|
|
|
|
CdIo * cdio_open_bsdi (const char *psz_source_name);
|
|
|
|
|
|
|
|
|
|
|
|
/*! Set up CD-ROM for reading using the BSDI driver. The device_name is
|
|
|
|
|
|
the some sort of device name.
|
|
|
|
|
|
|
2004-05-19 03:00:03 +00:00
|
|
|
|
@return the cdio object for subsequent operations.
|
|
|
|
|
|
NULL on error or there is no BSDI driver.
|
2004-04-30 06:54:15 +00:00
|
|
|
|
|
|
|
|
|
|
@see cdio_open
|
|
|
|
|
|
*/
|
|
|
|
|
|
CdIo * cdio_open_am_bsdi (const char *psz_source_name,
|
|
|
|
|
|
const char *psz_access_mode);
|
2003-03-24 19:01:09 +00:00
|
|
|
|
|
2003-11-05 12:40:34 +00:00
|
|
|
|
/*! Return a string containing the default device name that the
|
|
|
|
|
|
BSDI driver would use when none is specified.
|
|
|
|
|
|
|
2004-05-19 03:00:03 +00:00
|
|
|
|
@return the cdio object for subsequent operations.
|
|
|
|
|
|
NULL on error or there is no BSDI driver.
|
2003-11-17 12:06:56 +00:00
|
|
|
|
|
2004-05-11 12:17:17 +00:00
|
|
|
|
@see cdio_open_cd, cdio_open
|
2003-11-05 12:40:34 +00:00
|
|
|
|
*/
|
2003-04-10 04:13:41 +00:00
|
|
|
|
char * cdio_get_default_device_bsdi(void);
|
|
|
|
|
|
|
2003-11-17 12:06:56 +00:00
|
|
|
|
/*! Return a list of all of the CD-ROM devices that the BSDI driver
|
|
|
|
|
|
can find.
|
2004-06-19 10:39:30 +00:00
|
|
|
|
|
|
|
|
|
|
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.
|
2003-11-17 12:06:56 +00:00
|
|
|
|
*/
|
2003-10-02 02:59:57 +00:00
|
|
|
|
char **cdio_get_devices_bsdi(void);
|
|
|
|
|
|
|
2003-11-05 12:40:34 +00:00
|
|
|
|
/*! 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.
|
2003-11-17 12:06:56 +00:00
|
|
|
|
|
2004-05-11 12:17:17 +00:00
|
|
|
|
@see cdio_open_cd, cdio_open
|
2003-11-05 12:40:34 +00:00
|
|
|
|
*/
|
2004-04-30 06:54:15 +00:00
|
|
|
|
CdIo * cdio_open_freebsd (const char *paz_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.
|
|
|
|
|
|
|
2004-05-11 12:17:17 +00:00
|
|
|
|
@see cdio_open_cd, cdio_open
|
2004-04-30 06:54:15 +00:00
|
|
|
|
*/
|
|
|
|
|
|
CdIo * cdio_open_am_freebsd (const char *psz_source_name,
|
|
|
|
|
|
const char *psz_access_mode);
|
2003-03-24 23:59:22 +00:00
|
|
|
|
|
2003-11-05 12:40:34 +00:00
|
|
|
|
/*! Return a string containing the default device name that the
|
|
|
|
|
|
FreeBSD driver would use when none is specified.
|
|
|
|
|
|
|
2003-11-17 12:06:56 +00:00
|
|
|
|
NULL is returned on error or there is no CD-ROM device.
|
2003-11-05 12:40:34 +00:00
|
|
|
|
*/
|
2003-04-10 04:13:41 +00:00
|
|
|
|
char * cdio_get_default_device_freebsd(void);
|
|
|
|
|
|
|
2003-11-05 12:40:34 +00:00
|
|
|
|
/*! Return a list of all of the CD-ROM devices that the FreeBSD driver
|
|
|
|
|
|
can find.
|
|
|
|
|
|
*/
|
2003-10-03 07:54:58 +00:00
|
|
|
|
char **cdio_get_devices_freebsd(void);
|
|
|
|
|
|
|
2003-11-05 12:40:34 +00:00
|
|
|
|
/*! Set up CD-ROM for reading using the GNU/Linux driver. The device_name is
|
|
|
|
|
|
the some sort of device name.
|
|
|
|
|
|
|
2004-05-19 03:00:03 +00:00
|
|
|
|
@return the cdio object for subsequent operations.
|
|
|
|
|
|
NULL on error or there is no GNU/Linux driver.
|
2004-06-19 10:39:30 +00:00
|
|
|
|
|
|
|
|
|
|
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.
|
2003-03-24 19:01:09 +00:00
|
|
|
|
*/
|
|
|
|
|
|
CdIo * cdio_open_linux (const char *source_name);
|
2003-04-10 04:13:41 +00:00
|
|
|
|
|
2004-05-19 03:00:03 +00:00
|
|
|
|
/*! Set up CD-ROM for reading using the GNU/Linux driver. The
|
|
|
|
|
|
device_name is the some sort of device name.
|
2004-04-30 06:54:15 +00:00
|
|
|
|
|
2004-05-19 03:00:03 +00:00
|
|
|
|
@return the cdio object for subsequent operations.
|
|
|
|
|
|
NULL on error or there is no GNU/Linux driver.
|
2004-04-30 06:54:15 +00:00
|
|
|
|
*/
|
|
|
|
|
|
CdIo * cdio_open_am_linux (const char *source_name,
|
|
|
|
|
|
const char *access_mode);
|
|
|
|
|
|
|
2003-11-05 12:40:34 +00:00
|
|
|
|
/*! 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.
|
|
|
|
|
|
|
2003-11-17 12:06:56 +00:00
|
|
|
|
NULL is returned on error or there is no CD-ROM device.
|
|
|
|
|
|
|
2004-06-19 10:39:30 +00:00
|
|
|
|
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.
|
|
|
|
|
|
|
2004-05-11 12:17:17 +00:00
|
|
|
|
@see cdio_open_cd, cdio_open
|
2003-11-05 12:40:34 +00:00
|
|
|
|
*/
|
2003-04-10 04:13:41 +00:00
|
|
|
|
char * cdio_get_default_device_linux(void);
|
2003-09-30 03:26:11 +00:00
|
|
|
|
|
2003-11-05 12:40:34 +00:00
|
|
|
|
/*! Return a list of all of the CD-ROM devices that the GNU/Linux driver
|
|
|
|
|
|
can find.
|
|
|
|
|
|
*/
|
2003-09-30 03:26:11 +00:00
|
|
|
|
char **cdio_get_devices_linux(void);
|
2003-03-24 19:01:09 +00:00
|
|
|
|
|
2003-11-05 12:40:34 +00:00
|
|
|
|
/*! Set up CD-ROM for reading using the Sun Solaris driver. The
|
|
|
|
|
|
device_name is the some sort of device name.
|
|
|
|
|
|
|
2004-05-19 03:00:03 +00:00
|
|
|
|
@return the cdio object for subsequent operations.
|
|
|
|
|
|
NULL on error or there is no Solaris driver.
|
2003-03-24 19:01:09 +00:00
|
|
|
|
*/
|
2003-05-27 02:55:58 +00:00
|
|
|
|
CdIo * cdio_open_solaris (const char *source_name);
|
2003-03-24 19:01:09 +00:00
|
|
|
|
|
2004-04-30 06:54:15 +00:00
|
|
|
|
/*! Set up CD-ROM for reading using the Sun Solaris driver. The
|
|
|
|
|
|
device_name is the some sort of device name.
|
|
|
|
|
|
|
2004-05-19 03:00:03 +00:00
|
|
|
|
@return the cdio object for subsequent operations.
|
|
|
|
|
|
NULL on error or there is no Solaris driver.
|
2004-04-30 06:54:15 +00:00
|
|
|
|
*/
|
|
|
|
|
|
CdIo * cdio_open_am_solaris (const char *psz_source_name,
|
|
|
|
|
|
const char *psz_access_mode);
|
|
|
|
|
|
|
2003-11-05 12:40:34 +00:00
|
|
|
|
/*! 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.
|
|
|
|
|
|
|
2003-11-17 12:06:56 +00:00
|
|
|
|
NULL is returned on error or there is no CD-ROM device.
|
|
|
|
|
|
|
2004-06-19 10:39:30 +00:00
|
|
|
|
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.
|
|
|
|
|
|
|
2004-05-11 12:17:17 +00:00
|
|
|
|
@see cdio_open_cd, cdio_open
|
2003-11-05 12:40:34 +00:00
|
|
|
|
*/
|
2003-04-10 04:13:41 +00:00
|
|
|
|
char * cdio_get_default_device_solaris(void);
|
|
|
|
|
|
|
2003-11-05 12:40:34 +00:00
|
|
|
|
/*! Return a list of all of the CD-ROM devices that the Solaris driver
|
|
|
|
|
|
can find.
|
|
|
|
|
|
*/
|
2003-10-03 02:36:52 +00:00
|
|
|
|
char **cdio_get_devices_solaris(void);
|
|
|
|
|
|
|
2003-11-05 12:40:34 +00:00
|
|
|
|
/*! 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.
|
2003-11-17 12:06:56 +00:00
|
|
|
|
|
2004-06-19 10:39:30 +00:00
|
|
|
|
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.
|
|
|
|
|
|
|
2004-05-11 12:17:17 +00:00
|
|
|
|
@see cdio_open_cd, cdio_open
|
2003-09-13 06:25:36 +00:00
|
|
|
|
*/
|
2004-04-30 06:54:15 +00:00
|
|
|
|
CdIo * cdio_open_osx (const char *psz_source_name);
|
|
|
|
|
|
|
|
|
|
|
|
/*! 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.
|
|
|
|
|
|
|
2004-05-11 12:17:17 +00:00
|
|
|
|
@see cdio_open_cd, cdio_open
|
2004-04-30 06:54:15 +00:00
|
|
|
|
*/
|
|
|
|
|
|
CdIo * cdio_open_am_osx (const char *psz_source_name,
|
|
|
|
|
|
const char *psz_access_mode);
|
2003-09-13 06:25:36 +00:00
|
|
|
|
|
2003-11-05 12:40:34 +00:00
|
|
|
|
/*! 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.
|
|
|
|
|
|
|
2004-06-19 10:39:30 +00:00
|
|
|
|
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.
|
2003-11-05 12:40:34 +00:00
|
|
|
|
*/
|
2003-09-13 06:25:36 +00:00
|
|
|
|
char * cdio_get_default_device_osx(void);
|
|
|
|
|
|
|
2003-11-05 12:40:34 +00:00
|
|
|
|
/*! Return a list of all of the CD-ROM devices that the OSX driver
|
|
|
|
|
|
can find.
|
|
|
|
|
|
*/
|
2003-10-04 23:11:50 +00:00
|
|
|
|
char **cdio_get_devices_osx(void);
|
|
|
|
|
|
|
2003-11-05 12:40:34 +00:00
|
|
|
|
/*! Set up CD-ROM for reading using the Microsoft Windows driver. The
|
|
|
|
|
|
device_name is the some sort of device name.
|
|
|
|
|
|
|
2004-06-19 10:39:30 +00:00
|
|
|
|
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.
|
2003-05-27 02:55:58 +00:00
|
|
|
|
*/
|
|
|
|
|
|
CdIo * cdio_open_win32 (const char *source_name);
|
|
|
|
|
|
|
2004-04-30 06:54:15 +00:00
|
|
|
|
/*! 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 * cdio_open_am_win32 (const char *psz_source_name,
|
|
|
|
|
|
const char *psz_access_mode);
|
|
|
|
|
|
|
2003-11-05 12:40:34 +00:00
|
|
|
|
/*! 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.
|
|
|
|
|
|
|
2004-06-19 10:39:30 +00:00
|
|
|
|
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.
|
2003-11-17 12:06:56 +00:00
|
|
|
|
|
2004-05-11 12:17:17 +00:00
|
|
|
|
@see cdio_open_cd, cdio_open
|
2003-11-05 12:40:34 +00:00
|
|
|
|
*/
|
2003-05-27 02:55:58 +00:00
|
|
|
|
char * cdio_get_default_device_win32(void);
|
|
|
|
|
|
|
2003-10-03 01:11:48 +00:00
|
|
|
|
char **cdio_get_devices_win32(void);
|
|
|
|
|
|
|
2003-11-05 12:40:34 +00:00
|
|
|
|
/*! Set up CD-ROM for reading using the Nero driver. The
|
|
|
|
|
|
device_name is the some sort of device name.
|
|
|
|
|
|
|
2004-05-11 12:17:17 +00:00
|
|
|
|
@return true on success; NULL on error or there is no Nero driver.
|
2003-03-24 19:01:09 +00:00
|
|
|
|
*/
|
|
|
|
|
|
CdIo * cdio_open_nrg (const char *source_name);
|
|
|
|
|
|
|
2004-04-30 06:54:15 +00:00
|
|
|
|
/*! Set up CD-ROM for reading using the Nero driver. The
|
|
|
|
|
|
device_name is the some sort of device name.
|
|
|
|
|
|
|
2004-05-11 12:17:17 +00:00
|
|
|
|
@return true on success; NULL on error or there is no Nero driver.
|
2004-04-30 06:54:15 +00:00
|
|
|
|
*/
|
|
|
|
|
|
CdIo * cdio_open_am_nrg (const char *psz_source_name,
|
|
|
|
|
|
const char *psz_access_mode);
|
|
|
|
|
|
|
2003-11-05 12:40:34 +00:00
|
|
|
|
/*! Return 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..
|
|
|
|
|
|
|
2003-11-17 12:06:56 +00:00
|
|
|
|
NULL is returned on error or there is no CD-ROM device.
|
2003-11-05 12:40:34 +00:00
|
|
|
|
*/
|
2003-04-10 04:13:41 +00:00
|
|
|
|
char * cdio_get_default_device_nrg(void);
|
2003-04-12 03:38:00 +00:00
|
|
|
|
|
2003-09-30 03:26:11 +00:00
|
|
|
|
char **cdio_get_devices_nrg(void);
|
|
|
|
|
|
|
2004-05-11 12:17:17 +00:00
|
|
|
|
/*!
|
|
|
|
|
|
|
|
|
|
|
|
Determine if bin_name is the bin file part of a CDRWIN CD disk image.
|
|
|
|
|
|
|
|
|
|
|
|
@param bin_name location of presumed CDRWIN bin image file.
|
|
|
|
|
|
@return the corresponding CUE file if bin_name is a BIN file or
|
|
|
|
|
|
NULL if not a BIN file.
|
2004-05-09 16:54:12 +00:00
|
|
|
|
*/
|
|
|
|
|
|
char *cdio_is_binfile(const char *bin_name);
|
|
|
|
|
|
|
2004-05-11 12:17:17 +00:00
|
|
|
|
/*!
|
|
|
|
|
|
Determine if cue_name is the cue sheet for a CDRWIN CD disk image.
|
|
|
|
|
|
|
|
|
|
|
|
@return corresponding BIN file if cue_name is a CDRWIN cue file or
|
|
|
|
|
|
NULL if not a CUE file.
|
2003-05-18 01:50:51 +00:00
|
|
|
|
*/
|
2003-04-12 03:38:00 +00:00
|
|
|
|
char *cdio_is_cuefile(const char *cue_name);
|
2003-04-10 04:13:41 +00:00
|
|
|
|
|
2004-05-11 12:17:17 +00:00
|
|
|
|
/*!
|
|
|
|
|
|
Determine if psg_nrg is a Nero CD disk image.
|
|
|
|
|
|
|
|
|
|
|
|
@param psz_nrg location of presumed NRG image file.
|
|
|
|
|
|
@return true if psz_nrg is a Nero NRG image or false
|
2004-05-09 16:54:12 +00:00
|
|
|
|
if not a NRG image.
|
2004-05-04 02:06:48 +00:00
|
|
|
|
*/
|
2004-05-09 16:54:12 +00:00
|
|
|
|
bool cdio_is_nrg(const char *psz_nrg);
|
2004-05-04 02:06:48 +00:00
|
|
|
|
|
2004-05-11 12:17:17 +00:00
|
|
|
|
/*!
|
|
|
|
|
|
Determine if psg_toc is a TOC file for a cdrdao CD disk image.
|
|
|
|
|
|
|
|
|
|
|
|
@param psz_toc location of presumed TOC image file.
|
|
|
|
|
|
@return true if toc_name is a cdrdao TOC file or false
|
2004-05-09 16:54:12 +00:00
|
|
|
|
if not a TOC file.
|
2003-05-18 01:50:51 +00:00
|
|
|
|
*/
|
2004-05-11 12:17:17 +00:00
|
|
|
|
bool cdio_is_tocfile(const char *psz_toc);
|
2003-05-18 01:50:51 +00:00
|
|
|
|
|
2004-05-11 12:17:17 +00:00
|
|
|
|
/*!
|
|
|
|
|
|
Determine if source_name refers to a real hardware CD-ROM.
|
|
|
|
|
|
|
|
|
|
|
|
@param source_name location name of object
|
|
|
|
|
|
@param driver_id driver for reading object. Use DRIVER_UNKNOWN if you
|
|
|
|
|
|
don't know what driver to use.
|
|
|
|
|
|
@return true if source_name is a device; If false is returned we
|
|
|
|
|
|
could have a CD disk image.
|
2003-06-07 16:53:21 +00:00
|
|
|
|
*/
|
|
|
|
|
|
bool cdio_is_device(const char *source_name, driver_id_t driver_id);
|
|
|
|
|
|
|
2003-03-24 19:01:09 +00:00
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
|
}
|
|
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* __CDIO_H__ */
|