Blame include/cdio/device.h

Packit dd8086
/* -*- c -*-
Packit dd8086
Packit dd8086
    Copyright (C) 2005-2006, 2008-2013 Rocky Bernstein <rocky@gnu.org>
Packit dd8086
Packit dd8086
    This program is free software: you can redistribute it and/or modify
Packit dd8086
    it under the terms of the GNU General Public License as published by
Packit dd8086
    the Free Software Foundation, either version 3 of the License, or
Packit dd8086
    (at your option) any later version.
Packit dd8086
Packit dd8086
    This program is distributed in the hope that it will be useful,
Packit dd8086
    but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit dd8086
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit dd8086
    GNU General Public License for more details.
Packit dd8086
Packit dd8086
    You should have received a copy of the GNU General Public License
Packit dd8086
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
Packit dd8086
*/
Packit dd8086
Packit dd8086
/**
Packit dd8086
 *  \file device.h
Packit dd8086
 *
Packit dd8086
 *  \brief C header for driver- or device-related libcdio
Packit dd8086
 *          calls.  ("device" includes CD-image reading devices).
Packit dd8086
 */
Packit dd8086
#ifndef CDIO_DEVICE_H_
Packit dd8086
#define CDIO_DEVICE_H_
Packit dd8086
Packit dd8086
#ifdef __cplusplus
Packit dd8086
extern "C" {
Packit dd8086
#endif /* __cplusplus */
Packit dd8086
Packit dd8086
#include <cdio/types.h>
Packit dd8086
#include <cdio/cdio.h>
Packit dd8086
Packit dd8086
  /** The type of an drive capability bit mask. See below for values*/
Packit dd8086
  typedef uint32_t cdio_drive_read_cap_t;
Packit dd8086
  typedef uint32_t cdio_drive_write_cap_t;
Packit dd8086
  typedef uint32_t cdio_drive_misc_cap_t;
Packit dd8086
Packit dd8086
  /**
Packit dd8086
    \brief Drive capability bits returned by cdio_get_drive_cap()
Packit dd8086
    NOTE: Setting a bit here means the presence of a capability.
Packit dd8086
  */
Packit dd8086
Packit dd8086
  /** Miscellaneous capabilities. */
Packit dd8086
  typedef enum {
Packit dd8086
    CDIO_DRIVE_CAP_ERROR             = 0x40000, /**< Error */
Packit dd8086
    CDIO_DRIVE_CAP_UNKNOWN           = 0x80000, /**< Dunno. It can be on if we
Packit dd8086
                                                have only partial information
Packit dd8086
                                                or are not completely certain
Packit dd8086
                                                */
Packit dd8086
    CDIO_DRIVE_CAP_MISC_CLOSE_TRAY   = 0x00001, /**< caddy systems can't
Packit dd8086
                                                     close... */
Packit dd8086
    CDIO_DRIVE_CAP_MISC_EJECT        = 0x00002, /**< but can eject.  */
Packit dd8086
    CDIO_DRIVE_CAP_MISC_LOCK         = 0x00004, /**< disable manual eject */
Packit dd8086
    CDIO_DRIVE_CAP_MISC_SELECT_SPEED = 0x00008, /**< programmable speed */
Packit dd8086
    CDIO_DRIVE_CAP_MISC_SELECT_DISC  = 0x00010, /**< select disc from
Packit dd8086
                                                      juke-box */
Packit dd8086
    CDIO_DRIVE_CAP_MISC_MULTI_SESSION= 0x00020, /**< read sessions>1 */
Packit dd8086
    CDIO_DRIVE_CAP_MISC_MEDIA_CHANGED= 0x00080, /**< media changed */
Packit dd8086
    CDIO_DRIVE_CAP_MISC_RESET        = 0x00100, /**< hard reset device */
Packit dd8086
    CDIO_DRIVE_CAP_MISC_FILE         = 0x20000 /**< drive is really a file,
Packit dd8086
                                                  i.e a CD file image */
Packit dd8086
  } cdio_drive_cap_misc_t;
Packit dd8086
Packit dd8086
  /** Reading masks.. */
Packit dd8086
  typedef enum {
Packit dd8086
    CDIO_DRIVE_CAP_READ_AUDIO        = 0x00001, /**< drive can play CD audio */
Packit dd8086
    CDIO_DRIVE_CAP_READ_CD_DA        = 0x00002, /**< drive can read CD-DA */
Packit dd8086
    CDIO_DRIVE_CAP_READ_CD_G         = 0x00004, /**< drive can read CD+G  */
Packit dd8086
    CDIO_DRIVE_CAP_READ_CD_R         = 0x00008, /**< drive can read CD-R  */
Packit dd8086
    CDIO_DRIVE_CAP_READ_CD_RW        = 0x00010, /**< drive can read CD-RW */
Packit dd8086
    CDIO_DRIVE_CAP_READ_DVD_R        = 0x00020, /**< drive can read DVD-R */
Packit dd8086
    CDIO_DRIVE_CAP_READ_DVD_PR       = 0x00040, /**< drive can read DVD+R */
Packit dd8086
    CDIO_DRIVE_CAP_READ_DVD_RAM      = 0x00080, /**< drive can read DVD-RAM */
Packit dd8086
    CDIO_DRIVE_CAP_READ_DVD_ROM      = 0x00100, /**< drive can read DVD-ROM */
Packit dd8086
    CDIO_DRIVE_CAP_READ_DVD_RW       = 0x00200, /**< drive can read DVD-RW  */
Packit dd8086
    CDIO_DRIVE_CAP_READ_DVD_RPW      = 0x00400, /**< drive can read DVD+RW  */
Packit dd8086
    CDIO_DRIVE_CAP_READ_C2_ERRS      = 0x00800, /**< has C2 error correction */
Packit dd8086
    CDIO_DRIVE_CAP_READ_MODE2_FORM1  = 0x01000, /**< can read mode 2 form 1 */
Packit dd8086
    CDIO_DRIVE_CAP_READ_MODE2_FORM2  = 0x02000, /**< can read mode 2 form 2 */
Packit dd8086
    CDIO_DRIVE_CAP_READ_MCN          = 0x04000, /**< can read MCN      */
Packit dd8086
    CDIO_DRIVE_CAP_READ_ISRC         = 0x08000 /**< can read ISRC     */
Packit dd8086
  } cdio_drive_cap_read_t;
Packit dd8086
Packit dd8086
  /** Writing masks.. */
Packit dd8086
  typedef enum {
Packit dd8086
    CDIO_DRIVE_CAP_WRITE_CD_R        = 0x00001, /**< drive can write CD-R */
Packit dd8086
    CDIO_DRIVE_CAP_WRITE_CD_RW       = 0x00002, /**< drive can write CD-RW */
Packit dd8086
    CDIO_DRIVE_CAP_WRITE_DVD_R       = 0x00004, /**< drive can write DVD-R */
Packit dd8086
    CDIO_DRIVE_CAP_WRITE_DVD_PR      = 0x00008, /**< drive can write DVD+R */
Packit dd8086
    CDIO_DRIVE_CAP_WRITE_DVD_RAM     = 0x00010, /**< drive can write DVD-RAM */
Packit dd8086
    CDIO_DRIVE_CAP_WRITE_DVD_RW      = 0x00020, /**< drive can write DVD-RW */
Packit dd8086
    CDIO_DRIVE_CAP_WRITE_DVD_RPW     = 0x00040, /**< drive can write DVD+RW */
Packit dd8086
    CDIO_DRIVE_CAP_WRITE_MT_RAINIER  = 0x00080, /**< Mount Rainier           */
Packit dd8086
    CDIO_DRIVE_CAP_WRITE_BURN_PROOF  = 0x00100, /**< burn proof */
Packit dd8086
    CDIO_DRIVE_CAP_WRITE_CD =
Packit dd8086
    (CDIO_DRIVE_CAP_WRITE_CD_R | CDIO_DRIVE_CAP_WRITE_CD_RW),
Packit dd8086
    /**< Has some sort of CD writer ability */
Packit dd8086
Packit dd8086
    CDIO_DRIVE_CAP_WRITE_DVD =
Packit dd8086
    (CDIO_DRIVE_CAP_WRITE_DVD_R | CDIO_DRIVE_CAP_WRITE_DVD_PR
Packit dd8086
     | CDIO_DRIVE_CAP_WRITE_DVD_RAM | CDIO_DRIVE_CAP_WRITE_DVD_RW
Packit dd8086
     | CDIO_DRIVE_CAP_WRITE_DVD_RPW ),
Packit dd8086
    /**< Has some sort of DVD writer ability */
Packit dd8086
Packit dd8086
    CDIO_DRIVE_CAP_WRITE =
Packit dd8086
    (CDIO_DRIVE_CAP_WRITE_CD | CDIO_DRIVE_CAP_WRITE_DVD)
Packit dd8086
    /**< Has some sort of DVD or CD writing ability */
Packit dd8086
  } cdio_drive_cap_write_t;
Packit dd8086
Packit dd8086
/** Size of fields returned by an INQUIRY command */
Packit dd8086
  typedef enum {
Packit dd8086
    CDIO_MMC_HW_VENDOR_LEN   =  8, /**< length of vendor field */
Packit dd8086
    CDIO_MMC_HW_MODEL_LEN    = 16, /**< length of model field */
Packit dd8086
    CDIO_MMC_HW_REVISION_LEN =  4  /**< length of revision field */
Packit dd8086
  } cdio_mmc_hw_len_t;
Packit dd8086
Packit dd8086
Packit dd8086
  /** \brief Structure to return CD vendor, model, and revision-level
Packit dd8086
      strings obtained via the INQUIRY command  */
Packit dd8086
  typedef struct cdio_hwinfo
Packit dd8086
  {
Packit dd8086
    char psz_vendor  [CDIO_MMC_HW_VENDOR_LEN+1];
Packit dd8086
    char psz_model   [CDIO_MMC_HW_MODEL_LEN+1];
Packit dd8086
    char psz_revision[CDIO_MMC_HW_REVISION_LEN+1];
Packit dd8086
  } cdio_hwinfo_t;
Packit dd8086
Packit dd8086
Packit dd8086
  /** Flags specifying the category of device to open or is opened. */
Packit dd8086
  typedef enum {
Packit dd8086
    CDIO_SRC_IS_DISK_IMAGE_MASK = 0x0001, /**< Read source is a CD image. */
Packit dd8086
    CDIO_SRC_IS_DEVICE_MASK     = 0x0002, /**< Read source is a CD device. */
Packit dd8086
    CDIO_SRC_IS_SCSI_MASK       = 0x0004, /**< Read source SCSI device. */
Packit dd8086
    CDIO_SRC_IS_NATIVE_MASK     = 0x0008
Packit dd8086
  } cdio_src_category_mask_t;
Packit dd8086
Packit dd8086
Packit dd8086
  /**
Packit dd8086
   * The driver_id_t enumerations may be used to tag a specific driver
Packit dd8086
   * that is opened or is desired to be opened. Note that this is
Packit dd8086
   * different than what is available on a given host.
Packit dd8086
   *
Packit dd8086
   * Order should not be changed lightly because it breaks the ABI.
Packit dd8086
   * One is not supposed to iterate over the values, but iterate over the
Packit dd8086
   * cdio_drivers and cdio_device_drivers arrays.
Packit dd8086
   *
Packit dd8086
   * NOTE: IF YOU MODIFY ENUM MAKE SURE INITIALIZATION IN CDIO.C AGREES.
Packit dd8086
   *
Packit dd8086
   */
Packit dd8086
  typedef enum  {
Packit dd8086
    DRIVER_UNKNOWN, /**< Used as input when we don't care what kind
Packit dd8086
                         of driver to use. */
Packit dd8086
    DRIVER_AIX,     /**< AIX driver */
Packit dd8086
    DRIVER_FREEBSD, /**< FreeBSD driver - includes CAM and ioctl access */
Packit dd8086
    DRIVER_NETBSD,  /**< NetBSD Driver. */
Packit dd8086
    DRIVER_LINUX,   /**< GNU/Linux Driver */
Packit dd8086
    DRIVER_SOLARIS, /**< Sun Solaris Driver */
Packit dd8086
    DRIVER_OSX,     /**< Apple OSX (or MacOS) Driver */
Packit dd8086
    DRIVER_WIN32,   /**< Microsoft Windows Driver. Includes ASPI and
Packit dd8086
                         ioctl access. */
Packit dd8086
    DRIVER_CDRDAO,  /**< cdrdao format CD image. This is listed
Packit dd8086
                         before BIN/CUE, to make the code prefer cdrdao
Packit dd8086
                         over BIN/CUE when both exist. */
Packit dd8086
    DRIVER_BINCUE,  /**< CDRWIN BIN/CUE format CD image. This is
Packit dd8086
                         listed before NRG, to make the code prefer
Packit dd8086
                         BIN/CUE over NRG when both exist. */
Packit dd8086
    DRIVER_NRG,     /**< Nero NRG format CD image. */
Packit dd8086
    DRIVER_DEVICE   /**< Is really a set of the above; should come last */
Packit dd8086
  } driver_id_t;
Packit dd8086
Packit dd8086
  /**
Packit dd8086
      A null-terminated (that is DRIVER_UNKNOWN-terminated) ordered (in
Packit dd8086
      order of preference) array of drivers.
Packit dd8086
  */
Packit dd8086
  extern const driver_id_t cdio_drivers[];
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     A null-terminated (that is DRIVER_UNKNOWN-terminated) ordered (in
Packit dd8086
     order of preference) array of device drivers.
Packit dd8086
  */
Packit dd8086
  extern const driver_id_t cdio_device_drivers[];
Packit dd8086
Packit dd8086
  /**
Packit dd8086
      There will generally be only one hardware for a given
Packit dd8086
      build/platform from the list above. You can use the variable
Packit dd8086
      below to determine which you've got. If the build doesn't make an
Packit dd8086
      hardware driver, then the value will be DRIVER_UNKNOWN.
Packit dd8086
  */
Packit dd8086
  extern const driver_id_t cdio_os_driver;
Packit dd8086
Packit dd8086
Packit dd8086
  /**
Packit dd8086
      The following are status codes for completion of a given cdio
Packit dd8086
      operation. By design 0 is successful completion and -1 is error
Packit dd8086
      completion. This is compatable with ioctl so those routines that
Packit dd8086
      call ioctl can just pass the value the get back (cast as this
Packit dd8086
      enum). Also, by using negative numbers for errors, the
Packit dd8086
      enumeration values below can be used in places where a positive
Packit dd8086
      value is expected when things complete successfully. For example,
Packit dd8086
      get_blocksize returns the blocksize, but on error uses the error
Packit dd8086
      codes below. So note that this enumeration is often cast to an
Packit dd8086
      integer.  C seems to tolerate this.
Packit dd8086
  */
Packit dd8086
  typedef enum  {
Packit dd8086
    DRIVER_OP_SUCCESS        =  0, /**< in cases where an int is
Packit dd8086
                                    returned, like cdio_set_speed,
Packit dd8086
                                    more the negative return codes are
Packit dd8086
                                    for errors and the positive ones
Packit dd8086
                                    for success. */
Packit dd8086
    DRIVER_OP_ERROR          = -1, /**< operation returned an error */
Packit dd8086
    DRIVER_OP_UNSUPPORTED    = -2, /**< returned when a particular driver
Packit dd8086
                                      doesn't support a particular operation.
Packit dd8086
                                      For example an image driver which doesn't
Packit dd8086
                                      really "eject" a CD.
Packit dd8086
                                   */
Packit dd8086
    DRIVER_OP_UNINIT         = -3, /**< returned when a particular driver
Packit dd8086
                                      hasn't been initialized or a null
Packit dd8086
                                      pointer has been passed.
Packit dd8086
                                   */
Packit dd8086
    DRIVER_OP_NOT_PERMITTED  = -4, /**< Operation not permitted.
Packit dd8086
                                      For example might be a permission
Packit dd8086
                                      problem.
Packit dd8086
                                   */
Packit dd8086
    DRIVER_OP_BAD_PARAMETER  = -5, /**< Bad parameter passed  */
Packit dd8086
    DRIVER_OP_BAD_POINTER    = -6, /**< Bad pointer to memory area  */
Packit dd8086
    DRIVER_OP_NO_DRIVER      = -7, /**< Operation called on a driver
Packit dd8086
                                      not available on this OS  */
Packit dd8086
    DRIVER_OP_MMC_SENSE_DATA = -8, /**< MMC operation returned sense data,
Packit dd8086
                                      but no other error above recorded. */
Packit dd8086
  } driver_return_code_t;
Packit dd8086
Packit dd8086
  /**
Packit dd8086
    Close media tray in CD drive if there is a routine to do so.
Packit dd8086
Packit dd8086
    @param psz_drive the name of CD-ROM to be closed. If NULL, we will
Packit dd8086
    use the default device.
Packit dd8086
    @param p_driver_id is the driver to be used or that got used if
Packit dd8086
    it was DRIVER_UNKNOWN or DRIVER_DEVICE; If this is NULL, we won't
Packit dd8086
    report back the driver used.
Packit dd8086
  */
Packit dd8086
  driver_return_code_t cdio_close_tray (const char *psz_drive,
Packit dd8086
                                        /*in/out*/ driver_id_t *p_driver_id);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
    @param drc the return code you want interpreted.
Packit dd8086
    @return the string information about drc
Packit dd8086
  */
Packit dd8086
  const char *cdio_driver_errmsg(driver_return_code_t drc);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
    Eject media in CD drive if there is a routine to do so.
Packit dd8086
Packit dd8086
    @param p_cdio the CD object to be acted upon.
Packit dd8086
    If the CD is ejected *p_cdio is free'd and p_cdio set to NULL.
Packit dd8086
  */
Packit dd8086
  driver_return_code_t cdio_eject_media (CdIo_t **p_cdio);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
    Eject media in CD drive if there is a routine to do so.
Packit dd8086
Packit dd8086
    @param psz_drive the name of the device to be acted upon.
Packit dd8086
    If NULL is given as the drive, we'll use the default driver device.
Packit dd8086
  */
Packit dd8086
  driver_return_code_t cdio_eject_media_drive (const char *psz_drive);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
    Free device list returned by cdio_get_devices or
Packit dd8086
    cdio_get_devices_with_cap.
Packit dd8086
Packit dd8086
    @param device_list list returned by cdio_get_devices or
Packit dd8086
    cdio_get_devices_with_cap
Packit dd8086
Packit dd8086
    @see cdio_get_devices, cdio_get_devices_with_cap
Packit dd8086
Packit dd8086
  */
Packit dd8086
  void cdio_free_device_list (char * device_list[]);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
    Get the default CD device.
Packit dd8086
    if p_cdio is NULL (we haven't initialized a specific device driver),
Packit dd8086
    then find a suitable one and return the default device for that.
Packit dd8086
Packit dd8086
    @param p_cdio the CD object queried
Packit dd8086
    @return a string containing the default CD device or NULL is
Packit dd8086
    if we couldn't get a default device.
Packit dd8086
Packit dd8086
    In some situations of drivers or OS's we can't find a CD device if
Packit dd8086
    there is no media in it and it is possible for this routine to return
Packit dd8086
    NULL even though there may be a hardware CD-ROM.
Packit dd8086
  */
Packit dd8086
  char * cdio_get_default_device (const CdIo_t *p_cdio);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
    Return a string containing the default CD device if none is specified.
Packit dd8086
    if p_driver_id is DRIVER_UNKNOWN or DRIVER_DEVICE
Packit dd8086
    then find a suitable one set the default device for that.
Packit dd8086
Packit dd8086
    NULL is returned if we couldn't get a default device.
Packit dd8086
  */
Packit dd8086
  char * cdio_get_default_device_driver (/*in/out*/ driver_id_t *p_driver_id);
Packit dd8086
Packit dd8086
  /** Return an array of device names. If you want a specific
Packit dd8086
    devices for a driver, give that device. If you want hardware
Packit dd8086
    devices, give DRIVER_DEVICE and if you want all possible devices,
Packit dd8086
    image drivers and hardware drivers give DRIVER_UNKNOWN.
Packit dd8086
Packit dd8086
    NULL is returned if we couldn't return a list of devices.
Packit dd8086
Packit dd8086
    In some situations of drivers or OS's we can't find a CD device if
Packit dd8086
    there is no media in it and it is possible for this routine to return
Packit dd8086
    NULL even though there may be a hardware CD-ROM.
Packit dd8086
  */
Packit dd8086
  char ** cdio_get_devices (driver_id_t driver_id);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Get an array of device names in search_devices that have at least
Packit dd8086
     the capabilities listed by the capabities parameter.  If
Packit dd8086
     search_devices is NULL, then we'll search all possible CD drives.
Packit dd8086
Packit dd8086
     Capabilities have two parts to them, a "filesystem" part and an
Packit dd8086
     "analysis" part.
Packit dd8086
Packit dd8086
     The filesystem part is mutually exclusive. For example either the
Packit dd8086
     filesystem is at most one of the High-Sierra, UFS, or HFS,
Packit dd8086
     ISO9660, fileystems. Valid combinations of say HFS and ISO9660
Packit dd8086
     are specified as a separate "filesystem".
Packit dd8086
Packit dd8086
     Capabilities on the other hand are not mutually exclusive. For
Packit dd8086
     example a filesystem may have none, either, or both of the XA or
Packit dd8086
     Rock-Ridge extension properties.
Packit dd8086
Packit dd8086
     If "b_any" is set false then every capability listed in the
Packit dd8086
     analysis portion of capabilities (i.e. not the basic filesystem)
Packit dd8086
     must be satisified. If no analysis capabilities are specified,
Packit dd8086
     that's a match.
Packit dd8086
Packit dd8086
     If "b_any" is set true, then if any of the analysis capabilities
Packit dd8086
     matches, we call that a success.
Packit dd8086
Packit dd8086
     In either case, in the filesystem portion different filesystem
Packit dd8086
     either specify 0 to match any filesystem or the specific
Packit dd8086
     filesystem type.
Packit dd8086
Packit dd8086
     To find a CD-drive of any type, use the mask CDIO_FS_MATCH_ALL.
Packit dd8086
Packit dd8086
     @return the array of device names or NULL if we couldn't get a
Packit dd8086
     default device.  It is also possible to return a non NULL but
Packit dd8086
     after dereferencing the the value is NULL. This also means nothing
Packit dd8086
     was found.
Packit dd8086
  */
Packit dd8086
  char ** cdio_get_devices_with_cap (/*in*/ char *ppsz_search_devices[],
Packit dd8086
                                     cdio_fs_anal_t capabilities, bool b_any);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Like cdio_get_devices_with_cap but we return the driver we found
Packit dd8086
     as well. This is because often one wants to search for kind of drive
Packit dd8086
     and then *open* it afterwards. Giving the driver back facilitates this,
Packit dd8086
     and speeds things up for libcdio as well.
Packit dd8086
  */
Packit dd8086
  char ** cdio_get_devices_with_cap_ret (/*in*/ char* ppsz_search_devices[],
Packit dd8086
                                         cdio_fs_anal_t capabilities,
Packit dd8086
                                         bool b_any,
Packit dd8086
                                         /*out*/ driver_id_t *p_driver_id);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Like cdio_get_devices, but we may change the p_driver_id if we
Packit dd8086
     were given DRIVER_DEVICE or DRIVER_UNKNOWN. This is because often
Packit dd8086
     one wants to get a drive name and then *open* it
Packit dd8086
     afterwards. Giving the driver back facilitates this, and speeds
Packit dd8086
     things up for libcdio as well.
Packit dd8086
   */
Packit dd8086
Packit dd8086
  char ** cdio_get_devices_ret (/*in/out*/ driver_id_t *p_driver_id);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Get the what kind of device we've got.
Packit dd8086
Packit dd8086
     @param p_cdio the CD object queried
Packit dd8086
     @param p_read_cap pointer to return read capabilities
Packit dd8086
     @param p_write_cap pointer to return write capabilities
Packit dd8086
     @param p_misc_cap pointer to return miscellaneous other capabilities
Packit dd8086
Packit dd8086
     In some situations of drivers or OS's we can't find a CD device if
Packit dd8086
     there is no media in it. In this situation capabilities will show up as
Packit dd8086
     NULL even though there isa hardware CD-ROM.
Packit dd8086
  */
Packit dd8086
  void cdio_get_drive_cap (const CdIo_t *p_cdio,
Packit dd8086
                           cdio_drive_read_cap_t  *p_read_cap,
Packit dd8086
                           cdio_drive_write_cap_t *p_write_cap,
Packit dd8086
                           cdio_drive_misc_cap_t  *p_misc_cap);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Get the drive capabilities for a specified device.
Packit dd8086
Packit dd8086
     Return a list of device capabilities.
Packit dd8086
Packit dd8086
     In some situations of drivers or OS's we can't find a CD device if
Packit dd8086
     there is no media in it. In this situation capabilities will show up as
Packit dd8086
     NULL even though there isa hardware CD-ROM.
Packit dd8086
  */
Packit dd8086
  void cdio_get_drive_cap_dev (const char *device,
Packit dd8086
                               cdio_drive_read_cap_t  *p_read_cap,
Packit dd8086
                               cdio_drive_write_cap_t *p_write_cap,
Packit dd8086
                               cdio_drive_misc_cap_t  *p_misc_cap);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Get a string containing the name of the driver in use.
Packit dd8086
Packit dd8086
     @return a string with driver name or NULL if CdIo_t is NULL (we
Packit dd8086
     haven't initialized a specific device.
Packit dd8086
  */
Packit dd8086
  const char * cdio_get_driver_name (const CdIo_t *p_cdio);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Return a string containing the name of the driver in use from the driver_id.
Packit dd8086
     if CdIo is NULL (we haven't initialized a specific device driver),
Packit dd8086
     then return NULL.
Packit dd8086
  */
Packit dd8086
  const char * cdio_get_driver_name_from_id (driver_id_t driver_id);
Packit dd8086
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Get the driver id.
Packit dd8086
     if CdIo_t is NULL (we haven't initialized a specific device driver),
Packit dd8086
     then return DRIVER_UNKNOWN.
Packit dd8086
Packit dd8086
     @return the driver id..
Packit dd8086
  */
Packit dd8086
  driver_id_t cdio_get_driver_id (const CdIo_t *p_cdio);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
    Get the CD-ROM hardware info via a SCSI MMC INQUIRY command.
Packit dd8086
    False is returned if we had an error getting the information.
Packit dd8086
  */
Packit dd8086
  bool cdio_get_hwinfo ( const CdIo_t *p_cdio,
Packit dd8086
                         /*out*/ cdio_hwinfo_t *p_hw_info );
Packit dd8086
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Get the LSN of the first track of the last session of
Packit dd8086
     on the CD.
Packit dd8086
Packit dd8086
     @param p_cdio the CD object to be acted upon.
Packit dd8086
     @param i_last_session pointer to the session number to be returned.
Packit dd8086
  */
Packit dd8086
  driver_return_code_t cdio_get_last_session (CdIo_t *p_cdio,
Packit dd8086
                                              /*out*/ lsn_t *i_last_session);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
      Find out if media has changed since the last call.
Packit dd8086
      @param p_cdio the CD object to be acted upon.
Packit dd8086
      @return 1 if media has changed since last call, 0 if not. Error
Packit dd8086
      return codes are the same as driver_return_code_t
Packit dd8086
   */
Packit dd8086
  int cdio_get_media_changed(CdIo_t *p_cdio);
Packit dd8086
Packit dd8086
  /** True if CD-ROM understand ATAPI commands. */
Packit dd8086
  bool_3way_t cdio_have_atapi (CdIo_t *p_cdio);
Packit dd8086
Packit dd8086
  /** Like cdio_have_xxx but uses an enumeration instead. */
Packit dd8086
  bool cdio_have_driver (driver_id_t driver_id);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Free any resources associated with p_cdio. Call this when done
Packit dd8086
     using p_cdio and using CD reading/control operations.
Packit dd8086
Packit dd8086
    @param p_cdio the CD object to eliminated.
Packit dd8086
   */
Packit dd8086
  void cdio_destroy (CdIo_t *p_cdio);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
    Get a string decribing driver_id.
Packit dd8086
Packit dd8086
    @param driver_id the driver you want the description for
Packit dd8086
    @return a string of driver description
Packit dd8086
  */
Packit dd8086
  const char *cdio_driver_describe (driver_id_t driver_id);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Sets up to read from place specified by psz_source and
Packit dd8086
     driver_id. This or cdio_open_* should be called before using any
Packit dd8086
     other routine, except cdio_init or any routine that accesses the
Packit dd8086
     CD-ROM drive by name. cdio_open will call cdio_init, if that
Packit dd8086
     hasn't been done previously.
Packit dd8086
Packit dd8086
     @return the cdio object or NULL on error or no device.  If NULL
Packit dd8086
     is given as the source, we'll use the default driver device.
Packit dd8086
  */
Packit dd8086
  CdIo_t * cdio_open (const char *psz_source, driver_id_t driver_id);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Sets up to read from place specified by psz_source, driver_id and
Packit dd8086
     access mode. This or cdio_open* should be called before using any
Packit dd8086
     other routine, except cdio_init or any routine that accesses the
Packit dd8086
     CD-ROM drive by name. This will call cdio_init, if that hasn't
Packit dd8086
     been done previously.
Packit dd8086
Packit dd8086
     If NULL is given as the source, we'll use the default driver device.
Packit dd8086
Packit dd8086
     @return the cdio object or NULL on error or no device.
Packit dd8086
  */
Packit dd8086
  CdIo_t * cdio_open_am (const char *psz_source,
Packit dd8086
                         driver_id_t driver_id, const char *psz_access_mode);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Set up BIN/CUE CD disk-image for reading. Source is the .bin or
Packit dd8086
     .cue file
Packit dd8086
Packit dd8086
     @return the cdio object or NULL on error or no device.
Packit dd8086
   */
Packit dd8086
  CdIo_t * cdio_open_bincue (const char *psz_cue_name);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Set up BIN/CUE CD disk-image for reading. Source is the .bin or
Packit dd8086
     .cue file
Packit dd8086
Packit dd8086
     @return the cdio object or NULL on error or no device..
Packit dd8086
   */
Packit dd8086
  CdIo_t * cdio_open_am_bincue (const char *psz_cue_name,
Packit dd8086
                                const char *psz_access_mode);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Set up cdrdao CD disk-image for reading. Source is the .toc file
Packit dd8086
Packit dd8086
     @return the cdio object or NULL on error or no device.
Packit dd8086
   */
Packit dd8086
  CdIo_t * cdio_open_cdrdao (const char *psz_toc_name);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Set up cdrdao CD disk-image for reading. Source is the .toc file
Packit dd8086
Packit dd8086
     @return the cdio object or NULL on error or no device..
Packit dd8086
  */
Packit dd8086
  CdIo_t * cdio_open_am_cdrdao (const char *psz_toc_name,
Packit dd8086
                                const char *psz_access_mode);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Return a string containing the default CUE file that would
Packit dd8086
     be used when none is specified.
Packit dd8086
Packit dd8086
     @return the cdio object or NULL on error or no device.
Packit dd8086
  */
Packit dd8086
  char * cdio_get_default_device_bincue(void);
Packit dd8086
Packit dd8086
  char **cdio_get_devices_bincue(void);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     @return string containing the default CUE file that would be
Packit dd8086
     used when none is specified. NULL is returned on error or there
Packit dd8086
     is no device.
Packit dd8086
   */
Packit dd8086
  char * cdio_get_default_device_cdrdao(void);
Packit dd8086
Packit dd8086
  char **cdio_get_devices_cdrdao(void);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Set up CD-ROM for reading. The device_name is
Packit dd8086
     the some sort of device name.
Packit dd8086
Packit dd8086
     @return the cdio object for subsequent operations.
Packit dd8086
     NULL on error or there is no driver for a some sort of hardware CD-ROM.
Packit dd8086
  */
Packit dd8086
  CdIo_t * cdio_open_cd (const char *device_name);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Set up CD-ROM for reading. The device_name is
Packit dd8086
     the some sort of device name.
Packit dd8086
Packit dd8086
     @return the cdio object for subsequent operations.
Packit dd8086
     NULL on error or there is no driver for a some sort of hardware CD-ROM.
Packit dd8086
  */
Packit dd8086
  CdIo_t * cdio_open_am_cd (const char *psz_device,
Packit dd8086
                            const char *psz_access_mode);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     CDRWIN BIN/CUE CD disc-image routines. Source is the .cue file
Packit dd8086
Packit dd8086
     @return the cdio object for subsequent operations.
Packit dd8086
     NULL on error.
Packit dd8086
   */
Packit dd8086
  CdIo_t * cdio_open_cue (const char *cue_name);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Set up CD-ROM for reading using the AIX driver. The device_name is
Packit dd8086
     the some sort of device name.
Packit dd8086
Packit dd8086
     @return the cdio object for subsequent operations.
Packit dd8086
     NULL on error or there is no AIX driver.
Packit dd8086
Packit dd8086
     @see cdio_open
Packit dd8086
   */
Packit dd8086
  CdIo_t * cdio_open_am_aix (const char *psz_source,
Packit dd8086
                             const char *psz_access_mode);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Set up CD-ROM for reading using the AIX driver. The device_name is
Packit dd8086
     the some sort of device name.
Packit dd8086
Packit dd8086
     @return the cdio object for subsequent operations.
Packit dd8086
     NULL on error or there is no AIX driver.
Packit dd8086
Packit dd8086
     @see cdio_open
Packit dd8086
   */
Packit dd8086
  CdIo_t * cdio_open_aix (const char *psz_source);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Return a string containing the default device name that the AIX
Packit dd8086
     driver would use when none is specified.
Packit dd8086
Packit dd8086
     @return the cdio object for subsequent operations.
Packit dd8086
     NULL on error or there is no AIX driver.
Packit dd8086
Packit dd8086
     @see cdio_open_cd, cdio_open
Packit dd8086
   */
Packit dd8086
  char * cdio_get_default_device_aix(void);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Return a list of all of the CD-ROM devices that the AIX driver
Packit dd8086
     can find.
Packit dd8086
Packit dd8086
     In some situations of drivers or OS's we can't find a CD device
Packit dd8086
     if there is no media in it and it is possible for this routine to
Packit dd8086
     return NULL even though there may be a hardware CD-ROM.
Packit dd8086
   */
Packit dd8086
  char **cdio_get_devices_aix(void);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Set up CD-ROM for reading using the BSDI driver. The device_name
Packit dd8086
     is the some sort of device name.
Packit dd8086
Packit dd8086
     @param psz_source the name of the device to open
Packit dd8086
     @return the cdio object for subsequent operations.
Packit dd8086
     NULL on error or there is no BSDI driver.
Packit dd8086
Packit dd8086
     @see cdio_open
Packit dd8086
   */
Packit dd8086
  CdIo_t * cdio_open_bsdi (const char *psz_source);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Set up CD-ROM for reading using the BSDI driver. The device_name
Packit dd8086
     is the some sort of device name.
Packit dd8086
Packit dd8086
     @return the cdio object for subsequent operations.
Packit dd8086
     NULL on error or there is no BSDI driver.
Packit dd8086
Packit dd8086
     @see cdio_open
Packit dd8086
   */
Packit dd8086
  CdIo_t * cdio_open_am_bsdi (const char *psz_source,
Packit dd8086
                              const char *psz_access_mode);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Return a string containing the default device name that the BSDI
Packit dd8086
     driver would use when none is specified.
Packit dd8086
Packit dd8086
     @return the cdio object for subsequent operations.
Packit dd8086
     NULL on error or there is no BSDI driver.
Packit dd8086
Packit dd8086
     @see cdio_open_cd, cdio_open
Packit dd8086
   */
Packit dd8086
  char * cdio_get_default_device_bsdi(void);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Return a list of all of the CD-ROM devices that the BSDI driver
Packit dd8086
     can find.
Packit dd8086
Packit dd8086
     In some situations of drivers or OS's we can't find a CD device
Packit dd8086
     if there is no media in it and it is possible for this routine to
Packit dd8086
     return NULL even though there may be a hardware CD-ROM.
Packit dd8086
   */
Packit dd8086
  char **cdio_get_devices_bsdi(void);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Set up CD-ROM for reading using the FreeBSD driver. The
Packit dd8086
     device_name is the some sort of device name.
Packit dd8086
Packit dd8086
     NULL is returned on error or there is no FreeBSD driver.
Packit dd8086
Packit dd8086
     @see cdio_open_cd, cdio_open
Packit dd8086
   */
Packit dd8086
  CdIo_t * cdio_open_freebsd (const char *paz_psz_source);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Set up CD-ROM for reading using the FreeBSD driver. The
Packit dd8086
     device_name is the some sort of device name.
Packit dd8086
Packit dd8086
     NULL is returned on error or there is no FreeBSD driver.
Packit dd8086
Packit dd8086
     @see cdio_open_cd, cdio_open
Packit dd8086
   */
Packit dd8086
  CdIo_t * cdio_open_am_freebsd (const char *psz_source,
Packit dd8086
                                 const char *psz_access_mode);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Return a string containing the default device name that the
Packit dd8086
     FreeBSD driver would use when none is specified.
Packit dd8086
Packit dd8086
     NULL is returned on error or there is no CD-ROM device.
Packit dd8086
   */
Packit dd8086
  char * cdio_get_default_device_freebsd(void);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Return a list of all of the CD-ROM devices that the FreeBSD
Packit dd8086
     driver can find.
Packit dd8086
   */
Packit dd8086
  char **cdio_get_devices_freebsd(void);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Set up CD-ROM for reading using the GNU/Linux driver. The
Packit dd8086
     device_name is the some sort of device name.
Packit dd8086
Packit dd8086
     @return the cdio object for subsequent operations.
Packit dd8086
     NULL on error or there is no GNU/Linux driver.
Packit dd8086
Packit dd8086
     In some situations of drivers or OS's we can't find a CD device if
Packit dd8086
     there is no media in it and it is possible for this routine to return
Packit dd8086
     NULL even though there may be a hardware CD-ROM.
Packit dd8086
   */
Packit dd8086
  CdIo_t * cdio_open_linux (const char *psz_source);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Set up CD-ROM for reading using the GNU/Linux driver. The
Packit dd8086
     device_name is the some sort of device name.
Packit dd8086
Packit dd8086
     @return the cdio object for subsequent operations.
Packit dd8086
     NULL on error or there is no GNU/Linux driver.
Packit dd8086
   */
Packit dd8086
  CdIo_t * cdio_open_am_linux (const char *psz_source,
Packit dd8086
                               const char *access_mode);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Return a string containing the default device name that the
Packit dd8086
     GNU/Linux driver would use when none is specified. A scan is made
Packit dd8086
     for CD-ROM drives with CDs in them.
Packit dd8086
Packit dd8086
     NULL is returned on error or there is no CD-ROM device.
Packit dd8086
Packit dd8086
     In some situations of drivers or OS's we can't find a CD device if
Packit dd8086
     there is no media in it and it is possible for this routine to return
Packit dd8086
     NULL even though there may be a hardware CD-ROM.
Packit dd8086
Packit dd8086
     @see cdio_open_cd, cdio_open
Packit dd8086
   */
Packit dd8086
  char * cdio_get_default_device_linux(void);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Return a list of all of the CD-ROM devices that the GNU/Linux
Packit dd8086
     driver can find.
Packit dd8086
   */
Packit dd8086
  char **cdio_get_devices_linux(void);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Set up CD-ROM for reading using the Sun Solaris driver. The
Packit dd8086
     device_name is the some sort of device name.
Packit dd8086
Packit dd8086
     @return the cdio object for subsequent operations.
Packit dd8086
     NULL on error or there is no Solaris driver.
Packit dd8086
   */
Packit dd8086
  CdIo_t * cdio_open_solaris (const char *psz_source);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Set up CD-ROM for reading using the Sun Solaris driver. The
Packit dd8086
     device_name is the some sort of device name.
Packit dd8086
Packit dd8086
     @return the cdio object for subsequent operations.
Packit dd8086
     NULL on error or there is no Solaris driver.
Packit dd8086
   */
Packit dd8086
  CdIo_t * cdio_open_am_solaris (const char *psz_source,
Packit dd8086
                                 const char *psz_access_mode);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Return a string containing the default device name that the
Packit dd8086
     Solaris driver would use when none is specified. A scan is made
Packit dd8086
     for CD-ROM drives with CDs in them.
Packit dd8086
Packit dd8086
     NULL is returned on error or there is no CD-ROM device.
Packit dd8086
Packit dd8086
     In some situations of drivers or OS's we can't find a CD device if
Packit dd8086
     there is no media in it and it is possible for this routine to return
Packit dd8086
     NULL even though there may be a hardware CD-ROM.
Packit dd8086
Packit dd8086
     @see cdio_open_cd, cdio_open
Packit dd8086
   */
Packit dd8086
  char * cdio_get_default_device_solaris(void);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Return a list of all of the CD-ROM devices that the Solaris
Packit dd8086
     driver can find.
Packit dd8086
   */
Packit dd8086
  char **cdio_get_devices_solaris(void);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Set up CD-ROM for reading using the Apple OSX driver. The
Packit dd8086
     device_name is the some sort of device name.
Packit dd8086
Packit dd8086
     NULL is returned on error or there is no OSX driver.
Packit dd8086
Packit dd8086
     In some situations of drivers or OS's we can't find a CD device if
Packit dd8086
     there is no media in it and it is possible for this routine to return
Packit dd8086
     NULL even though there may be a hardware CD-ROM.
Packit dd8086
Packit dd8086
     @see cdio_open_cd, cdio_open
Packit dd8086
   */
Packit dd8086
  CdIo_t * cdio_open_osx (const char *psz_source);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Set up CD-ROM for reading using the Apple OSX driver. The
Packit dd8086
     device_name is the some sort of device name.
Packit dd8086
Packit dd8086
     NULL is returned on error or there is no OSX driver.
Packit dd8086
Packit dd8086
     @see cdio_open_cd, cdio_open
Packit dd8086
   */
Packit dd8086
  CdIo_t * cdio_open_am_osx (const char *psz_source,
Packit dd8086
                             const char *psz_access_mode);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Return a string containing the default device name that the OSX
Packit dd8086
     driver would use when none is specified. A scan is made for
Packit dd8086
     CD-ROM drives with CDs in them.
Packit dd8086
Packit dd8086
     In some situations of drivers or OS's we can't find a CD device if
Packit dd8086
     there is no media in it and it is possible for this routine to return
Packit dd8086
     NULL even though there may be a hardware CD-ROM.
Packit dd8086
   */
Packit dd8086
  char * cdio_get_default_device_osx(void);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Return a list of all of the CD-ROM devices that the OSX driver
Packit dd8086
     can find.
Packit dd8086
   */
Packit dd8086
  char **cdio_get_devices_osx(void);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Set up CD-ROM for reading using the Microsoft Windows driver. The
Packit dd8086
     device_name is the some sort of device name.
Packit dd8086
Packit dd8086
     In some situations of drivers or OS's we can't find a CD device if
Packit dd8086
     there is no media in it and it is possible for this routine to return
Packit dd8086
     NULL even though there may be a hardware CD-ROM.
Packit dd8086
   */
Packit dd8086
  CdIo_t * cdio_open_win32 (const char *psz_source);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Set up CD-ROM for reading using the Microsoft Windows driver. The
Packit dd8086
     device_name is the some sort of device name.
Packit dd8086
Packit dd8086
     NULL is returned on error or there is no Microsof Windows driver.
Packit dd8086
   */
Packit dd8086
  CdIo_t * cdio_open_am_win32 (const char *psz_source,
Packit dd8086
                               const char *psz_access_mode);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Return a string containing the default device name that the
Packit dd8086
     Win32 driver would use when none is specified. A scan is made
Packit dd8086
     for CD-ROM drives with CDs in them.
Packit dd8086
Packit dd8086
     In some situations of drivers or OS's we can't find a CD device
Packit dd8086
     if there is no media in it and it is possible for this routine to
Packit dd8086
     return NULL even though there may be a hardware CD-ROM.
Packit dd8086
Packit dd8086
     @see cdio_open_cd, cdio_open
Packit dd8086
   */
Packit dd8086
  char * cdio_get_default_device_win32(void);
Packit dd8086
Packit dd8086
  char **cdio_get_devices_win32(void);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Set up CD-ROM for reading using the IBM OS/2 driver. The
Packit dd8086
     device_name is the some sort of device name.
Packit dd8086
Packit dd8086
     NULL is returned on error or there is no OS/2 driver.
Packit dd8086
Packit dd8086
     In some situations of drivers or OS's we can't find a CD device if
Packit dd8086
     there is no media in it and it is possible for this routine to return
Packit dd8086
     NULL even though there may be a hardware CD-ROM.
Packit dd8086
Packit dd8086
     @see cdio_open_cd, cdio_open
Packit dd8086
   */
Packit dd8086
  CdIo_t * cdio_open_os2 (const char *psz_source);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Set up CD-ROM for reading using the IBM OS/2 driver. The
Packit dd8086
     device_name is the some sort of device name.
Packit dd8086
Packit dd8086
     NULL is returned on error or there is no OS/2 driver.
Packit dd8086
Packit dd8086
     @see cdio_open_cd, cdio_open
Packit dd8086
   */
Packit dd8086
  CdIo_t * cdio_open_am_os2 (const char *psz_source,
Packit dd8086
                            const char *psz_access_mode);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Return a string containing the default device name that the OS/2
Packit dd8086
     driver would use when none is specified. A scan is made for
Packit dd8086
     CD-ROM drives with CDs in them.
Packit dd8086
Packit dd8086
     In some situations of drivers or OS's we can't find a CD device
Packit dd8086
     if there is no media in it and it is possible for this routine to
Packit dd8086
     return NULL even though there may be a hardware CD-ROM.
Packit dd8086
   */
Packit dd8086
  char * cdio_get_default_device_os2(void);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
Return a list of all of the CD-ROM devices that the OS/2 driver
Packit dd8086
      can find.
Packit dd8086
   */
Packit dd8086
  char **cdio_get_devices_os2(void);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Set up CD-ROM for reading using the Nero driver. The device_name
Packit dd8086
     is the some sort of device name.
Packit dd8086
Packit dd8086
     @return true on success; NULL on error or there is no Nero driver.
Packit dd8086
   */
Packit dd8086
  CdIo_t * cdio_open_nrg (const char *psz_source);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Set up CD-ROM for reading using the Nero driver. The device_name
Packit dd8086
     is the some sort of device name.
Packit dd8086
Packit dd8086
     @return true on success; NULL on error or there is no Nero driver.
Packit dd8086
   */
Packit dd8086
  CdIo_t * cdio_open_am_nrg (const char *psz_source,
Packit dd8086
                             const char *psz_access_mode);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Get a string containing the default device name that the NRG
Packit dd8086
     driver would use when none is specified. A scan is made for NRG
Packit dd8086
     disk images in the current directory.
Packit dd8086
Packit dd8086
     @return string containing the default device. NULL on error or
Packit dd8086
     there is no CD-ROM device.
Packit dd8086
   */
Packit dd8086
  char * cdio_get_default_device_nrg(void);
Packit dd8086
Packit dd8086
  char **cdio_get_devices_nrg(void);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
Packit dd8086
     Determine if bin_name is the bin file part of  a CDRWIN CD disk image.
Packit dd8086
Packit dd8086
     @param bin_name location of presumed CDRWIN bin image file.
Packit dd8086
     @return the corresponding CUE file if bin_name is a BIN file or
Packit dd8086
     NULL if not a BIN file.
Packit dd8086
  */
Packit dd8086
  char *cdio_is_binfile(const char *bin_name);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Determine if cue_name is the cue sheet for a CDRWIN CD disk image.
Packit dd8086
Packit dd8086
     @return corresponding BIN file if cue_name is a CDRWIN cue file or
Packit dd8086
     NULL if not a CUE file.
Packit dd8086
  */
Packit dd8086
  char *cdio_is_cuefile(const char *cue_name);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
    Determine if psg_nrg is a Nero CD disc image.
Packit dd8086
Packit dd8086
    @param psz_nrg location of presumed NRG image file.
Packit dd8086
    @return true if psz_nrg is a Nero NRG image or false
Packit dd8086
    if not a NRG image.
Packit dd8086
  */
Packit dd8086
  bool cdio_is_nrg(const char *psz_nrg);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Determine if psz_toc is a TOC file for a cdrdao CD disc image.
Packit dd8086
Packit dd8086
     @param psz_toc location of presumed TOC image file.
Packit dd8086
     @return true if toc_name is a cdrdao TOC file or false
Packit dd8086
     if not a TOC file.
Packit dd8086
  */
Packit dd8086
  bool cdio_is_tocfile(const char *psz_toc);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Determine if psz_source refers to a real hardware CD-ROM.
Packit dd8086
Packit dd8086
     @param psz_source location name of object
Packit dd8086
     @param driver_id   driver for reading object. Use DRIVER_UNKNOWN if you
Packit dd8086
     don't know what driver to use.
Packit dd8086
     @return true if psz_source is a device; If false is returned we
Packit dd8086
     could have a CD disk image.
Packit dd8086
  */
Packit dd8086
  bool cdio_is_device(const char *psz_source, driver_id_t driver_id);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
    Set the blocksize for subsequent reads.
Packit dd8086
  */
Packit dd8086
  driver_return_code_t cdio_set_blocksize ( const CdIo_t *p_cdio,
Packit dd8086
                                            int i_blocksize );
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Set the drive speed.
Packit dd8086
Packit dd8086
     @param p_cdio          CD structure set by cdio_open().
Packit dd8086
Packit dd8086
    @param i_drive_speed speed in CD-ROM speed units. Note this not
Packit dd8086
                         Kbs as would be used in the MMC spec or in
Packit dd8086
                         mmc_set_speed(). To convert CD-ROM speed
Packit dd8086
                         units to Kbs, multiply the number by 176 (for
Packit dd8086
                         raw data) and by 150 (for filesystem
Packit dd8086
                         data). On many CD-ROM drives, specifying a
Packit dd8086
                         value too large will result in using the
Packit dd8086
                         fastest speed.
Packit dd8086
Packit dd8086
      @see mmc_set_speed and mmc_set_drive_speed
Packit dd8086
  */
Packit dd8086
  driver_return_code_t cdio_set_speed ( const CdIo_t *p_cdio,
Packit dd8086
                                        int i_drive_speed );
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Get the value associatied with key.
Packit dd8086
Packit dd8086
     @param p_cdio the CD object queried
Packit dd8086
     @param key the key to retrieve
Packit dd8086
     @return the value associatd with "key" or NULL if p_cdio is NULL
Packit dd8086
     or "key" does not exist.
Packit dd8086
  */
Packit dd8086
  const char * cdio_get_arg (const CdIo_t *p_cdio,  const char key[]);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Set the arg "key" with "value" in "p_cdio".
Packit dd8086
Packit dd8086
     @param p_cdio the CD object to set
Packit dd8086
     @param key the key to set
Packit dd8086
     @param value the value to assocaiate with key
Packit dd8086
  */
Packit dd8086
  driver_return_code_t cdio_set_arg (CdIo_t *p_cdio, const char key[],
Packit dd8086
                                     const char value[]);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
    Initialize CD Reading and control routines. Should be called first.
Packit dd8086
  */
Packit dd8086
  bool cdio_init(void);
Packit dd8086
Packit dd8086
#ifdef __cplusplus
Packit dd8086
}
Packit dd8086
#endif /* __cplusplus */
Packit dd8086
Packit dd8086
/**
Packit dd8086
   The below variables are trickery to force the above enum symbol
Packit dd8086
   values to be recorded in debug symbol tables. They are used to
Packit dd8086
   allow one to refer to the enumeration value names in the typedefs
Packit dd8086
   above in a debugger and debugger expressions.  */
Packit dd8086
extern cdio_drive_cap_misc_t          debug_cdio_drive_cap_misc;
Packit dd8086
extern cdio_drive_cap_read_t          debug_cdio_drive_cap_read_t;
Packit dd8086
extern cdio_drive_cap_write_t         debug_drive_cap_write_t;
Packit dd8086
extern cdio_mmc_hw_len_t              debug_cdio_mmc_hw_len;
Packit dd8086
extern cdio_src_category_mask_t       debug_cdio_src_category_mask;
Packit dd8086
Packit dd8086
#endif /* CDIO_DEVICE_H_ */