Merge branch 'master' of ssh://git.sv.gnu.org/srv/git/libcdio

This commit is contained in:
Leon Merten Lohse
2012-03-22 22:23:21 +01:00
52 changed files with 1023 additions and 1443 deletions

View File

@@ -1,5 +1,5 @@
/*
Copyright (C) 2005, 2006, 2008 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2005, 2006, 2008, 2012 Rocky Bernstein <rocky@gnu.org>
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
@@ -21,8 +21,8 @@
* library. Applications use this for anything regarding libcdio.
*/
#ifndef __CDIO_HPP__
#define __CDIO_HPP__
#ifndef CDIO_CDIOPP_HPP_
#define CDIO_CDIOPP_HPP_
#include <cdio/cdio.h>
#include <cdio/audio.h>
@@ -179,4 +179,4 @@ public:
/* Things related to devices. No class or object is needed. */
#include "devices.hpp"
#endif /* __CDIO_HPP__ */
#endif /* CDIO_CDIOPP_HPP_ */

View File

@@ -1,7 +1,5 @@
/*
$Id: cdtext.hpp,v 1.2 2008/03/25 15:59:10 karl Exp $
Copyright (C) 2005, 2008 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2005, 2008, 2012 Rocky Bernstein <rocky@gnu.org>
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

View File

@@ -1,7 +1,5 @@
/*
$Id: device.hpp,v 1.7 2008/03/25 15:59:10 karl Exp $
Copyright (C) 2005, 2006, 2008 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2005, 2006, 2008, 2012 Rocky Bernstein <rocky@gnu.org>
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
@@ -111,8 +109,8 @@ getDevice ()
*/
void
getDriveCap (cdio_drive_read_cap_t &read_cap,
cdio_drive_write_cap_t &write_cap,
cdio_drive_misc_cap_t &misc_cap)
cdio_drive_write_cap_t &write_cap,
cdio_drive_misc_cap_t &misc_cap)
{
cdio_get_drive_cap(p_cdio, &read_cap, &write_cap, &misc_cap);
}

View File

@@ -1,7 +1,5 @@
/*
$Id: devices.hpp,v 1.5 2008/03/25 15:59:10 karl Exp $
Copyright (C) 2005, 2006, 2008 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2005, 2006, 2008, 2012 Rocky Bernstein <rocky@gnu.org>
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
@@ -32,7 +30,7 @@
it was DRIVER_UNKNOWN or DRIVER_DEVICE; If this is NULL, we won't
report back the driver used.
*/
void closeTray (const char *psz_drive, /*in/out*/ driver_id_t &driver_id);
void closeTray(const char *psz_drive, /*in/out*/ driver_id_t &driver_id);
/*!
Close media tray in CD drive if there is a routine to do so.
@@ -40,7 +38,7 @@ void closeTray (const char *psz_drive, /*in/out*/ driver_id_t &driver_id);
@param psz_drive the name of CD-ROM to be closed. If omitted or
NULL, we'll scan for a suitable CD-ROM.
*/
void closeTray (const char *psz_drive=(const char *)NULL);
void closeTray(const char *psz_drive=(const char *)NULL);
/*!
Get a string decribing driver_id.
@@ -48,14 +46,14 @@ void closeTray (const char *psz_drive=(const char *)NULL);
@param driver_id the driver you want the description for
@return a sring of driver description
*/
const char *driverDescribe (driver_id_t driver_id);
const char *driverDescribe(driver_id_t driver_id);
/*!
Eject media in CD drive if there is a routine to do so.
If the CD is ejected, object is destroyed.
*/
void ejectMedia (const char *psz_drive);
void ejectMedia(const char *psz_drive);
/*!
Free device list returned by GetDevices
@@ -65,7 +63,7 @@ void ejectMedia (const char *psz_drive);
@see GetDevices
*/
void freeDeviceList (char * device_list[]);
void freeDeviceList(char * device_list[]);
/*!
Return a string containing the default CD device if none is specified.
@@ -96,7 +94,7 @@ char ** getDevices(driver_id_t driver_id=DRIVER_DEVICE);
things up for libcdio as well.
*/
char **getDevices (driver_id_t &driver_id);
char **getDevices(driver_id_t &driver_id);
/*!
Get an array of device names in search_devices that have at least
@@ -116,7 +114,7 @@ char **getDevices (driver_id_t &driver_id);
was found.
*/
char ** getDevices(/*in*/ char *ppsz_search_devices[],
cdio_fs_anal_t capabilities, bool b_any=false);
cdio_fs_anal_t capabilities, bool b_any=false);
/*!
Like GetDevices above but we return the driver we found
@@ -125,11 +123,11 @@ char ** getDevices(/*in*/ char *ppsz_search_devices[],
and speeds things up for libcdio as well.
*/
char ** getDevices(/*in*/ char* ppsz_search_devices[],
cdio_fs_anal_t capabilities, /*out*/ driver_id_t &driver_id,
bool b_any=false);
cdio_fs_anal_t capabilities, /*out*/ driver_id_t &driver_id,
bool b_any=false);
/*! Return true if we Have driver for driver_id */
bool haveDriver (driver_id_t driver_id);
bool haveDriver(driver_id_t driver_id);
/*!
@@ -178,4 +176,3 @@ bool isNero(const char *psz_nrg);
if not a TOC file.
*/
bool isTocFile(const char *psz_toc);

View File

@@ -1,5 +1,5 @@
/*
Copyright (C) 2006, 2008, 2011 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2006, 2008, 2011, 2012 Rocky Bernstein <rocky@gnu.org>
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
@@ -21,12 +21,12 @@
* library. Applications use this for anything regarding libcdio.
*/
#ifndef __ISO9660_HPP__
#define __ISO9660_HPP__
#ifndef CDIO_ISO9660_HPP_
#define CDIO_ISO9660_HPP_
#include <cdio/iso9660.h>
#include <cdio++/cdio.hpp>
#include <vector> // vector class library
#include <vector> // vector class library
#include <cstdlib>
#include <cstring>
using namespace std;
@@ -126,8 +126,8 @@ public:
{
free(p_stat);
p_stat = (iso9660_stat_t *)
calloc( 1, sizeof(iso9660_stat_t)
+ strlen(copy_in.p_stat->filename)+1 );
calloc( 1, sizeof(iso9660_stat_t)
+ strlen(copy_in.p_stat->filename)+1 );
p_stat = copy_in.p_stat;
}
@@ -181,7 +181,7 @@ public:
returned result.
*/
bool readdir (const char psz_path[], stat_vector_t& stat_vector,
bool b_mode2=false);
bool b_mode2=false);
/*!
Return file status for path name psz_path. NULL is returned on
@@ -202,10 +202,10 @@ public:
stat (const char psz_path[], bool b_translate=false, bool b_mode2=false)
{
if (b_translate)
return new Stat(iso9660_fs_stat_translate (p_cdio, psz_path,
b_mode2));
return new Stat(iso9660_fs_stat_translate (p_cdio, psz_path,
b_mode2));
else
return new Stat(iso9660_fs_stat (p_cdio, psz_path));
return new Stat(iso9660_fs_stat (p_cdio, psz_path));
}
};
@@ -321,7 +321,7 @@ public:
@see open_fuzzy
*/
bool open(const char *psz_path,
iso_extension_mask_t iso_extension_mask=ISO_EXTENSION_NONE)
iso_extension_mask_t iso_extension_mask=ISO_EXTENSION_NONE)
{
if (p_iso9660) iso9660_close(p_iso9660);
p_iso9660 = iso9660_open_ext(psz_path, iso_extension_mask);
@@ -340,9 +340,9 @@ public:
@see open
*/
bool open_fuzzy (const char *psz_path,
iso_extension_mask_t iso_extension_mask
=ISO_EXTENSION_NONE,
uint16_t i_fuzz=20);
iso_extension_mask_t iso_extension_mask
=ISO_EXTENSION_NONE,
uint16_t i_fuzz=20);
/*! Read the Primary Volume Descriptor for an ISO 9660 image. A
PVD object is returned if read, and NULL if there was an error.
@@ -358,8 +358,8 @@ public:
@see read_superblock
*/
bool read_superblock (iso_extension_mask_t iso_extension_mask
=ISO_EXTENSION_NONE,
uint16_t i_fuzz=20);
=ISO_EXTENSION_NONE,
uint16_t i_fuzz=20);
/*!
Read the Super block of an ISO 9660 image but determine framesize
@@ -371,8 +371,8 @@ public:
*/
bool
read_superblock_fuzzy (iso_extension_mask_t iso_extension_mask
=ISO_EXTENSION_NONE,
uint16_t i_fuzz=20);
=ISO_EXTENSION_NONE,
uint16_t i_fuzz=20);
/*! Read psz_path (a directory) and return a list of iso9660_stat_t
pointers for the files inside that directory. The caller must free
@@ -383,16 +383,16 @@ public:
CdioList_t *p_stat_list = iso9660_ifs_readdir (p_iso9660, psz_path);
if (p_stat_list) {
CdioListNode_t *p_entnode;
_CDIO_LIST_FOREACH (p_entnode, p_stat_list) {
iso9660_stat_t *p_statbuf =
(iso9660_stat_t *) _cdio_list_node_data (p_entnode);
stat_vector.push_back(new ISO9660::Stat(p_statbuf));
}
_cdio_list_free (p_stat_list, false);
return true;
CdioListNode_t *p_entnode;
_CDIO_LIST_FOREACH (p_entnode, p_stat_list) {
iso9660_stat_t *p_statbuf =
(iso9660_stat_t *) _cdio_list_node_data (p_entnode);
stat_vector.push_back(new ISO9660::Stat(p_statbuf));
}
_cdio_list_free (p_stat_list, false);
return true;
} else {
return false;
return false;
}
}
@@ -412,9 +412,9 @@ public:
stat (const char psz_path[], bool b_translate=false)
{
if (b_translate)
return new Stat(iso9660_ifs_stat_translate (p_iso9660, psz_path));
return new Stat(iso9660_ifs_stat_translate (p_iso9660, psz_path));
else
return new Stat(iso9660_ifs_stat (p_iso9660, psz_path));
return new Stat(iso9660_ifs_stat (p_iso9660, psz_path));
}
private:
@@ -426,4 +426,4 @@ public:
typedef vector< ISO9660::Stat *> stat_vector_t;
typedef vector <ISO9660::Stat *>::iterator stat_vector_iterator_t;
#endif /* __ISO9660_HPP__ */
#endif /* CDIO_ISO9660_HPP_ */

View File

@@ -1,4 +1,5 @@
# Copyright (C) 2003, 2004, 2006, 2008, 2011 Rocky Bernstein <rocky@gnu.org>
# Copyright (C) 2003, 2004, 2006, 2008, 2011, 2012
# Rocky Bernstein <rocky@gnu.org>
#
# 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

View File

@@ -21,8 +21,8 @@
* calls. These control playing of the CD-ROM through its
* line-out jack.
*/
#ifndef __CDIO_AUDIO_H__
#define __CDIO_AUDIO_H__
#ifndef CDIO_AUDIO_H_
#define CDIO_AUDIO_H_
#include <cdio/types.h>
@@ -143,4 +143,4 @@ extern "C" {
}
#endif /* __cplusplus */
#endif /* __CDIO_AUDIO_H__ */
#endif /* CDIO_AUDIO_H_ */

View File

@@ -1,8 +1,6 @@
/*
$Id: bytesex.h,v 1.5 2008/03/25 15:59:08 karl Exp $
Copyright (C) 2000, 2004 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2005, 2008 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2005, 2008, 2012 Rocky Bernstein <rocky@gnu.org>
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
@@ -25,8 +23,8 @@
* use glib.h routines instead.
*/
#ifndef __CDIO_BYTESEX_H__
#define __CDIO_BYTESEX_H__
#ifndef CDIO_BYTESEX_H_
#define CDIO_BYTESEX_H_
#include <cdio/types.h>
#include <cdio/bytesex_asm.h> /* also defines CDIO_INLINE */
@@ -208,7 +206,7 @@ from_733 (uint64_t p)
return (UINT32_C(0xFFFFFFFF) & p);
}
#endif /* __CDIO_BYTESEX_H__ */
#endif /* CDIO_BYTESEX_H_ */
/*

View File

@@ -24,8 +24,8 @@
glib.h routines instead.
*/
#ifndef __CDIO_BYTESEX_ASM_H__
#define __CDIO_BYTESEX_ASM_H__
#ifndef CDIO_BYTESEX_ASM_H_
#define CDIO_BYTESEX_ASM_H_
#if !defined(DISABLE_ASM_OPTIMIZE)
#include <cdio/types.h>
@@ -104,10 +104,10 @@ static CDIO_INLINE
uint32_t uint32_swap_le_be_asm(uint32_t a)
{
__asm__("xchgb %b0,%h0\n\t" /* swap lower bytes */
"rorl $16,%0\n\t" /* swap words */
"xchgb %b0,%h0" /* swap higher bytes */
:"=q" (a)
: "0" (a));
"rorl $16,%0\n\t" /* swap words */
"xchgb %b0,%h0" /* swap higher bytes */
:"=q" (a)
: "0" (a));
return(a);
}
@@ -116,8 +116,8 @@ static CDIO_INLINE
uint16_t uint16_swap_le_be_asm(uint16_t a)
{
__asm__("xchgb %b0,%h0" /* swap bytes */
: "=q" (a)
: "0" (a));
: "=q" (a)
: "0" (a));
return(a);
}
@@ -128,7 +128,7 @@ uint16_t uint16_swap_le_be_asm(uint16_t a)
#endif
#endif /* !defined(DISABLE_ASM_OPTIMIZE) */
#endif /* __CDIO_BYTESEX_ASM_H__ */
#endif /* CDIO_BYTESEX_ASM_H_ */
/*

View File

@@ -1,7 +1,5 @@
/*
$Id: cd_types.h,v 1.18 2008/03/25 15:59:08 karl Exp $
Copyright (C) 2003, 2006, 2008 Rocky Bernstein <rocky@cpan.org>
Copyright (C) 2003, 2006, 2008, 2012 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 1996,1997,1998 Gerd Knorr <kraxel@bytesex.org>
and Heiko Ei<45>feldt <heiko@hexco.de>
@@ -25,8 +23,8 @@
*
*/
#ifndef __CDIO_CD_TYPES_H__
#define __CDIO_CD_TYPES_H__
#ifndef CDIO_CD_TYPES_H_
#define CDIO_CD_TYPES_H_
#ifdef __cplusplus
extern "C" {
@@ -39,13 +37,13 @@ extern "C" {
typedef enum {
CDIO_FS_AUDIO = 1, /**< audio only - not really a
filesystem */
CDIO_FS_HIGH_SIERRA = 2, /**< High-Sierra Filesystem */
CDIO_FS_ISO_9660 = 3, /**< ISO 9660 filesystem */
CDIO_FS_INTERACTIVE = 4,
CDIO_FS_HFS = 5, /**< file system used on the Macintosh
CDIO_FS_HIGH_SIERRA = 2, /**< High-Sierra Filesystem */
CDIO_FS_ISO_9660 = 3, /**< ISO 9660 filesystem */
CDIO_FS_INTERACTIVE = 4,
CDIO_FS_HFS = 5, /**< file system used on the Macintosh
system in MacOS 6 through MacOS 9
and deprecated in OSX. */
CDIO_FS_UFS = 6, /**< Generic Unix file system derived
CDIO_FS_UFS = 6, /**< Generic Unix file system derived
from the Berkeley fast file
system. */
@@ -53,7 +51,7 @@ extern "C" {
* EXT2 was the GNU/Linux native filesystem for early kernels. Newer
* GNU/Linux OS's may use EXT3 which is EXT2 with a journal.
*/
CDIO_FS_EXT2 = 7,
CDIO_FS_EXT2 = 7,
CDIO_FS_ISO_HFS = 8, /**< both HFS & ISO-9660 filesystem */
CDIO_FS_ISO_9660_INTERACTIVE = 9, /**< both CD-RTOS and ISO filesystem */
@@ -65,15 +63,15 @@ extern "C" {
* which uses a CD-player. Panasonic in the early 90's was the first
* company to manufacture and market a 3DO player.
*/
CDIO_FS_3DO = 10,
CDIO_FS_3DO = 10,
/**<
Microsoft X-BOX CD.
*/
CDIO_FS_XISO = 11,
CDIO_FS_UDFX = 12,
CDIO_FS_UDF = 13,
CDIO_FS_XISO = 11,
CDIO_FS_UDFX = 12,
CDIO_FS_UDF = 13,
CDIO_FS_ISO_UDF = 14
} cdio_fs_t;
@@ -89,15 +87,15 @@ extern "C" {
* based of the fs type information. This
*/
typedef enum {
CDIO_FS_MASK = 0x000f, /**< Note: this should be 2**n-1 and
CDIO_FS_MASK = 0x000f, /**< Note: this should be 2**n-1 and
and greater than the highest
CDIO_FS number above */
CDIO_FS_ANAL_XA = 0x00010, /**< eXtended Architecture format */
CDIO_FS_ANAL_XA = 0x00010, /**< eXtended Architecture format */
CDIO_FS_ANAL_MULTISESSION = 0x00020, /**< CD has multisesion */
CDIO_FS_ANAL_PHOTO_CD = 0x00040, /**< Is a Kodak Photo CD */
CDIO_FS_ANAL_PHOTO_CD = 0x00040, /**< Is a Kodak Photo CD */
CDIO_FS_ANAL_HIDDEN_TRACK = 0x00080, /**< Hidden track at the
beginning of the CD */
CDIO_FS_ANAL_CDTV = 0x00100,
CDIO_FS_ANAL_CDTV = 0x00100,
CDIO_FS_ANAL_BOOTABLE = 0x00200, /**< CD is bootable */
CDIO_FS_ANAL_VIDEOCD = 0x00400, /**< VCD 1.1 */
CDIO_FS_ANAL_ROCKRIDGE = 0x00800, /**< Has Rock Ridge Extensions to
@@ -118,7 +116,7 @@ extern "C" {
} cdio_fs_cap_t;
#define CDIO_FS_UNKNOWN CDIO_FS_MASK
#define CDIO_FS_UNKNOWN CDIO_FS_MASK
/**
*
@@ -137,7 +135,7 @@ typedef struct
unsigned int joliet_level; /**< If has Joliet extensions, this is the
associated level number (i.e. 1, 2, or 3). */
char iso_label[33]; /**< This is 32 + 1 for null byte at the end in
formatting the string */
formatting the string */
unsigned int isofs_size;
uint8_t UDFVerMinor; /**< For UDF filesystems only */
uint8_t UDFVerMajor; /**< For UDF filesystems only */
@@ -149,8 +147,8 @@ typedef struct
* is returned in iso_analysis and the return value.
*/
cdio_fs_anal_t cdio_guess_cd_type(const CdIo_t *cdio, int start_session,
track_t track_num,
/*out*/ cdio_iso_analysis_t *iso_analysis);
track_t track_num,
/*out*/ cdio_iso_analysis_t *iso_analysis);
#ifdef __cplusplus
}
@@ -164,7 +162,7 @@ cdio_fs_anal_t cdio_guess_cd_type(const CdIo_t *cdio, int start_session,
extern cdio_fs_cap_t debug_cdio_fs_cap;
extern cdio_fs_t debug_cdio_fs;
#endif /* __CDIO_CD_TYPES_H__ */
#endif /* CDIO_CD_TYPES_H_ */
/*
* Local variables:

View File

@@ -1,411 +0,0 @@
/*
$Id: cdda.h,v 1.30 2008/03/25 15:59:08 karl Exp $
Copyright (C) 2004, 2005, 2006, 2008 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2001 Xiph.org and Heiko Eissfeldt heiko@escape.colossus.de
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 3 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, see <http://www.gnu.org/licenses/>.
*/
/** \file cdda.h
*
* \brief The top-level interface header for libcdio_cdda.
* Applications include this for paranoia access.
*
******************************************************************/
#ifndef _CDDA_INTERFACE_H_
#define _CDDA_INTERFACE_H_
#include <cdio/cdio.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/** cdrom_paranoia is an opaque structure which is used in all of the
library operations.
*/
typedef struct cdrom_paranoia_s cdrom_paranoia_t;
typedef struct cdrom_drive_s cdrom_drive_t;
/** For compatibility. cdrom_drive_t is deprecated, use cdrom_drive_t
instead. */
/**
Flags for simulating jitter used in testing.
The enumeration type one probably wouldn't really use in a program.
It is here instead of defines to give symbolic names that can be
helpful in debuggers where wants just to say refer to
CDDA_TEST_JITTER_SMALL and get the correct value.
*/
typedef enum {
CDDA_MESSAGE_FORGETIT = 0,
CDDA_MESSAGE_PRINTIT = 1,
CDDA_MESSAGE_LOGIT = 2,
CD_FRAMESAMPLES = CDIO_CD_FRAMESIZE_RAW / 4,
MAXTRK = (CDIO_CD_MAX_TRACKS+1)
} paranoia_cdda_enums_t;
#include <signal.h>
/** We keep MAXTRK since this header is exposed publicly and other
programs may have used this.
*/
#define MAXTRK (CDIO_CD_MAX_TRACKS+1)
/** \brief Structure for cdparanoia's CD Table of Contents */
typedef struct TOC_s {
unsigned char bTrack;
int32_t dwStartSector;
} TOC_t;
/** For compatibility. TOC is deprecated, use TOC_t instead. */
#define TOC TOC_t
/** \brief Structure for cdparanoia's CD-ROM access */
struct cdrom_drive_s {
CdIo_t *p_cdio;
int opened; /**< This struct may just represent a candidate for opening */
char *cdda_device_name;
char *drive_model;
int drive_type;
int bigendianp; /**< Whether data returned on the CDDA is bigendian or
not. 1 if big endian, 0 if little endian and -1 if
we don't know.
*/
int nsectors; /**< Number of sectors use in reading. Multiply by
CDIO_CD_FRAMESIZE_RAW to get number of bytes used in
the read buffer. */
int cd_extra; /**< -1 if we can't get multisession info, 0 if
there is one session only or the multi-session
LBA is less than or 100 (don't ask me why -- I
don't know), and 1 if the multi-session lba is
greater than 100. */
bool b_swap_bytes; /**< Swap bytes if Endian-ness of drive
mismatches the endian-ness of the
computer? */
track_t tracks;
TOC_t disc_toc[MAXTRK]; /**< info here starts origin 0 rather than the
first track number (usually 1). So to take
a track number and use it here, subtract
off cdio_get_first_track_num() beforehand.
*/
lsn_t audio_first_sector;
lsn_t audio_last_sector;
int errordest;
int messagedest;
char *errorbuf;
char *messagebuf;
/* functions specific to particular drives/interfaces */
int (*enable_cdda) (cdrom_drive_t *d, int onoff);
int (*read_toc) (cdrom_drive_t *d);
long (*read_audio) (cdrom_drive_t *d, void *p, lsn_t begin,
long sectors);
int (*set_speed) (cdrom_drive_t *d, int speed);
int error_retry;
int report_all;
int is_atapi;
int is_mmc;
int i_test_flags; /**< Normally set 0. But if we are testing
paranoia operation this can be set to one of
the flag masks to simulate a particular kind of
failure. */
};
/**
Flags for simulating jitter used in testing.
The enumeration type one probably wouldn't really use in a program.
It is here instead of defines to give symbolic names that can be
helpful in debuggers where wants just to say refer to
CDDA_TEST_JITTER_SMALL and get the correct value.
*/
typedef enum {
CDDA_TEST_JITTER_SMALL = 1,
CDDA_TEST_JITTER_LARGE = 2,
CDDA_TEST_JITTER_MASSIVE = 3,
CDDA_TEST_FRAG_SMALL = (1<<3),
CDDA_TEST_FRAG_LARGE = (2<<3),
CDDA_TEST_FRAG_MASSIVE = (3<<3),
CDDA_TEST_UNDERRUN = 64
} paranoia_jitter_t;
/** jitter testing. The first two bits are set to determine the
byte-distance we will jitter the data; 0 is no shifting.
*/
/**< jitter testing. Set the below bit to always cause jittering on reads.
The below bit only has any effect if the first two (above) bits are
nonzero. If the above bits are set, but the below bit isn't we'll
jitter 90% of the time.
*/
#define CDDA_TEST_ALWAYS_JITTER 4
/** fragment testing */
#define CDDA_TEST_FRAG_SMALL (1<<3)
#define CDDA_TEST_FRAG_LARGE (2<<3)
#define CDDA_TEST_FRAG_MASSIVE (3<<3)
/**< under-run testing. The below bit is set for testing. */
#define CDDA_TEST_UNDERRUN 64
#if TESTING_IS_FINISHED
/** scratch testing */
#define CDDA_TEST_SCRATCH 128
#undef CDDA_TEST_BOGUS_BYTES 256
#undef CDDA_TEST_DROPDUPE_BYTES 512
#endif /* TESTING_IS_FINISHED */
/** autosense functions */
/** Get a CD-ROM drive with a CD-DA in it.
If mesagedest is 1, then any messages in the process will be stored
in message.
*/
extern cdrom_drive_t *cdio_cddap_find_a_cdrom(int messagedest,
char **ppsz_message);
/** Returns a paranoia CD-ROM drive object with a CD-DA in it or NULL
if there was an error.
@see cdio_cddap_identify_cdio
*/
extern cdrom_drive_t *cdio_cddap_identify(const char *psz_device,
int messagedest,
char **ppsz_message);
/** Returns a paranoia CD-ROM drive object with a CD-DA in it or NULL
if there was an error. In contrast to cdio_cddap_identify, we
start out with an initialized p_cdio object. For example you may
have used that for other purposes such as to get CDDB/CD-Text
information. @see cdio_cddap_identify
*/
cdrom_drive_t *cdio_cddap_identify_cdio(CdIo_t *p_cdio,
int messagedest, char **ppsz_messages);
/** drive-oriented functions */
extern int cdio_cddap_speed_set(cdrom_drive_t *d, int speed);
extern void cdio_cddap_verbose_set(cdrom_drive_t *d, int err_action,
int mes_action);
extern char *cdio_cddap_messages(cdrom_drive_t *d);
extern char *cdio_cddap_errors(cdrom_drive_t *d);
/*!
Closes d and releases all storage associated with it except
the internal p_cdio pointer.
@param d cdrom_drive_t object to be closed.
@return 0 if passed a null pointer and 1 if not in which case
some work was probably done.
@see cdio_cddap_close
*/
bool cdio_cddap_close_no_free_cdio(cdrom_drive_t *d);
/*!
Closes d and releases all storage associated with it.
Doubles as "cdrom_drive_free()".
@param d cdrom_drive_t object to be closed.
@return 0 if passed a null pointer and 1 if not in which case
some work was probably done.
@see cdio_cddap_close_no_free_cdio
*/
extern int cdio_cddap_close(cdrom_drive_t *d);
extern int cdio_cddap_open(cdrom_drive_t *d);
extern long cdio_cddap_read(cdrom_drive_t *d, void *p_buffer,
lsn_t beginsector, long sectors);
/*! Return the lsn for the start of track i_track */
extern lsn_t cdio_cddap_track_firstsector(cdrom_drive_t *d,
track_t i_track);
/*! Get last lsn of the track. This generally one less than the start
of the next track. -1 is returned on error. */
extern lsn_t cdio_cddap_track_lastsector(cdrom_drive_t *d, track_t i_track);
/*! Return the number of tracks on the CD. */
extern track_t cdio_cddap_tracks(cdrom_drive_t *d);
/*! Return the track containing the given LSN. If the LSN is before
the first track (in the pregap), 0 is returned. If there was an
error or the LSN after the LEADOUT (beyond the end of the CD), then
CDIO_INVALID_TRACK is returned.
*/
extern int cdio_cddap_sector_gettrack(cdrom_drive_t *d, lsn_t lsn);
/*! Return the number of channels in track: 2 or 4; -2 if not
implemented or -1 for error.
Not meaningful if track is not an audio track.
*/
extern int cdio_cddap_track_channels(cdrom_drive_t *d, track_t i_track);
/*! Return 1 is track is an audio track, 0 otherwise. */
extern int cdio_cddap_track_audiop(cdrom_drive_t *d, track_t i_track);
/*! Return 1 is track has copy permit set, 0 otherwise. */
extern int cdio_cddap_track_copyp(cdrom_drive_t *d, track_t i_track);
/*! Return 1 is audio track has linear preemphasis set, 0 otherwise.
Only makes sense for audio tracks.
*/
extern int cdio_cddap_track_preemp(cdrom_drive_t *d, track_t i_track);
/*! Get first lsn of the first audio track. -1 is returned on error. */
extern lsn_t cdio_cddap_disc_firstsector(cdrom_drive_t *d);
/*! Get last lsn of the last audio track. The last lsn is generally one
less than the start of the next track after the audio track. -1 is
returned on error. */
extern lsn_t cdio_cddap_disc_lastsector(cdrom_drive_t *d);
/*! Determine Endian-ness of the CD-drive based on reading data from
it. Some drives return audio data Big Endian while some (most)
return data Little Endian. Drives known to return data bigendian are
SCSI drives from Kodak, Ricoh, HP, Philips, Plasmon, Grundig
CDR100IPW, and Mitsumi CD-R. ATAPI and MMC drives are little endian.
rocky: As someone who didn't write the code, I have to say this is
nothing less than brilliant. An FFT is done both ways and the the
transform is looked at to see which has data in the FFT (or audible)
portion. (Or so that's how I understand it.)
@return 1 if big-endian, 0 if little-endian, -1 if we couldn't
figure things out or some error.
*/
extern int data_bigendianp(cdrom_drive_t *d);
/** transport errors: */
typedef enum {
TR_OK = 0,
TR_EWRITE = 1 /**< Error writing packet command (transport) */,
TR_EREAD = 2 /**< Error reading packet data (transport) */,
TR_UNDERRUN = 3 /**< Read underrun */,
TR_OVERRUN = 4 /**< Read overrun */,
TR_ILLEGAL = 5 /**< Illegal/rejected request */,
TR_MEDIUM = 6 /**< Medium error */,
TR_BUSY = 7 /**< Device busy */,
TR_NOTREADY = 8 /**< Device not ready */,
TR_FAULT = 9 /**< Device failure */,
TR_UNKNOWN = 10 /**< Unspecified error */,
TR_STREAMING = 11 /**< loss of streaming */,
} transport_error_t;
#ifdef NEED_STRERROR_TR
const char *strerror_tr[]={
"Success",
"Error writing packet command to device",
"Error reading command from device",
"SCSI packet data underrun (too little data)",
"SCSI packet data overrun (too much data)",
"Illegal SCSI request (rejected by target)",
"Medium reading data from medium",
"Device busy",
"Device not ready",
"Target hardware fault",
"Unspecified error",
"Drive lost streaming"
};
#endif /*NEED_STERROR_TR*/
/** Errors returned by lib:
\verbatim
001: Unable to set CDROM to read audio mode
002: Unable to read table of contents lead-out
003: CDROM reporting illegal number of tracks
004: Unable to read table of contents header
005: Unable to read table of contents entry
006: Could not read any data from drive
007: Unknown, unrecoverable error reading data
008: Unable to identify CDROM model
009: CDROM reporting illegal table of contents
010: Unaddressable sector
100: Interface not supported
101: Drive is neither a CDROM nor a WORM device
102: Permision denied on cdrom (ioctl) device
103: Permision denied on cdrom (data) device
300: Kernel memory error
400: Device not open
401: Invalid track number
402: Track not audio data
403: No audio tracks on disc
\endverbatim
*/
#ifndef DO_NOT_WANT_PARANOIA_COMPATIBILITY
/** For compatibility with good ol' paranoia */
#define cdda_find_a_cdrom cdio_cddap_find_a_cdrom
#define cdda_identify cdio_cddap_identify
#define cdda_speed_set cdio_cddap_speed_set
#define cdda_verbose_set cdio_cddap_verbose_set
#define cdda_messages cdio_cddap_messages
#define cdda_errors cdio_cddap_errors
#define cdda_close cdio_cddap_close
#define cdda_open cdio_cddap_open
#define cdda_read cdio_cddap_read
#define cdda_track_firstsector cdio_cddap_track_firstsector
#define cdda_track_lastsector cdio_cddap_track_lastsector
#define cdda_tracks cdio_cddap_tracks
#define cdda_sector_gettrack cdio_cddap_sector_gettrack
#define cdda_track_channels cdio_cddap_track_channels
#define cdda_track_audiop cdio_cddap_track_audiop
#define cdda_track_copyp cdio_cddap_track_copyp
#define cdda_track_preemp cdio_cddap_track_preemp
#define cdda_disc_firstsector cdio_cddap_disc_firstsector
#define cdda_disc_lastsector cdio_cddap_disc_lastsector
#define cdrom_drive cdrom_drive_t
#endif /*DO_NOT_WANT_PARANOIA_COMPATIBILITY*/
#ifdef __cplusplus
}
#endif /* __cplusplus */
/** The below variables are trickery to force the above enum symbol
values to be recorded in debug symbol tables. They are used to
allow one to refer to the enumeration value names in the typedefs
above in a debugger and debugger expressions
*/
extern paranoia_jitter_t debug_paranoia_jitter;
extern paranoia_cdda_enums_t debug_paranoia_cdda_enums;
#endif /*_CDDA_INTERFACE_H_*/

View File

@@ -1,7 +1,5 @@
/*
$Id: cdtext.h,v 1.14 2008/03/25 15:59:08 karl Exp $
Copyright (C) 2004, 2005, 2008 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2004, 2005, 2008, 2012 Rocky Bernstein <rocky@gnu.org>
adapted from cuetools
Copyright (C) 2003 Svend Sanjay Sorensen <ssorensen@fastmail.fm>
@@ -26,8 +24,8 @@
*/
#ifndef __CDIO_CDTEXT_H__
#define __CDIO_CDTEXT_H__
#ifndef CDIO_CDTEXT_H_
#define CDIO_CDTEXT_H_
#include <cdio/types.h>
@@ -305,7 +303,7 @@ void cdtext_set (cdtext_t *p_cdtext, cdtext_field_t key, const uint8_t *value, t
}
#endif /* __cplusplus */
#endif /* __CDIO_CDTEXT_H__ */
#endif /* CDIO_CDTEXT_H_ */
/*
* Local variables:

View File

@@ -23,8 +23,8 @@
* \brief C header for driver- or device-related libcdio
* calls. ("device" includes CD-image reading devices).
*/
#ifndef __CDIO_DEVICE_H__
#define __CDIO_DEVICE_H__
#ifndef CDIO_DEVICE_H_
#define CDIO_DEVICE_H_
#ifdef __cplusplus
extern "C" {
@@ -47,13 +47,13 @@ extern "C" {
typedef enum {
CDIO_DRIVE_CAP_ERROR = 0x40000, /**< Error */
CDIO_DRIVE_CAP_UNKNOWN = 0x80000, /**< Dunno. It can be on if we
have only partial information
have only partial information
or are not completely certain
*/
*/
CDIO_DRIVE_CAP_MISC_CLOSE_TRAY = 0x00001, /**< caddy systems can't
close... */
CDIO_DRIVE_CAP_MISC_EJECT = 0x00002, /**< but can eject. */
CDIO_DRIVE_CAP_MISC_LOCK = 0x00004, /**< disable manual eject */
CDIO_DRIVE_CAP_MISC_LOCK = 0x00004, /**< disable manual eject */
CDIO_DRIVE_CAP_MISC_SELECT_SPEED = 0x00008, /**< programmable speed */
CDIO_DRIVE_CAP_MISC_SELECT_DISC = 0x00010, /**< select disc from
juke-box */
@@ -61,7 +61,7 @@ extern "C" {
CDIO_DRIVE_CAP_MISC_MEDIA_CHANGED= 0x00080, /**< media changed */
CDIO_DRIVE_CAP_MISC_RESET = 0x00100, /**< hard reset device */
CDIO_DRIVE_CAP_MISC_FILE = 0x20000 /**< drive is really a file,
i.e a CD file image */
i.e a CD file image */
} cdio_drive_cap_misc_t;
/** Reading masks.. */
@@ -151,7 +151,7 @@ extern "C" {
*/
typedef enum {
DRIVER_UNKNOWN, /**< Used as input when we don't care what kind
of driver to use. */
of driver to use. */
DRIVER_AIX, /**< AIX driver */
DRIVER_BSDI, /**< BSDI driver */
DRIVER_FREEBSD, /**< FreeBSD driver - includes CAM and ioctl access */
@@ -161,13 +161,13 @@ extern "C" {
DRIVER_OS2, /**< IBM OS/2 Driver */
DRIVER_OSX, /**< Apple OSX Driver */
DRIVER_WIN32, /**< Microsoft Windows Driver. Includes ASPI and
ioctl access. */
ioctl access. */
DRIVER_CDRDAO, /**< cdrdao format CD image. This is listed
before BIN/CUE, to make the code prefer cdrdao
over BIN/CUE when both exist. */
before BIN/CUE, to make the code prefer cdrdao
over BIN/CUE when both exist. */
DRIVER_BINCUE, /**< CDRWIN BIN/CUE format CD image. This is
listed before NRG, to make the code prefer
BIN/CUE over NRG when both exist. */
listed before NRG, to make the code prefer
BIN/CUE over NRG when both exist. */
DRIVER_NRG, /**< Nero NRG format CD image. */
DRIVER_DEVICE /**< Is really a set of the above; should come last */
} driver_id_t;
@@ -219,30 +219,30 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
*/
typedef enum {
DRIVER_OP_SUCCESS = 0, /**< in cases where an int is
returned, like cdio_set_speed,
more the negative return codes are
for errors and the positive ones
for success. */
returned, like cdio_set_speed,
more the negative return codes are
for errors and the positive ones
for success. */
DRIVER_OP_ERROR = -1, /**< operation returned an error */
DRIVER_OP_UNSUPPORTED = -2, /**< returned when a particular driver
doesn't support a particular operation.
For example an image driver which doesn't
really "eject" a CD.
*/
doesn't support a particular operation.
For example an image driver which doesn't
really "eject" a CD.
*/
DRIVER_OP_UNINIT = -3, /**< returned when a particular driver
hasn't been initialized or a null
pointer has been passed.
*/
hasn't been initialized or a null
pointer has been passed.
*/
DRIVER_OP_NOT_PERMITTED = -4, /**< Operation not permitted.
For example might be a permission
problem.
*/
For example might be a permission
problem.
*/
DRIVER_OP_BAD_PARAMETER = -5, /**< Bad parameter passed */
DRIVER_OP_BAD_POINTER = -6, /**< Bad pointer to memory area */
DRIVER_OP_NO_DRIVER = -7, /**< Operation called on a driver
not available on this OS */
not available on this OS */
DRIVER_OP_MMC_SENSE_DATA = -8, /**< MMC operation returned sense data,
but no other error above recorded. */
but no other error above recorded. */
} driver_return_code_t;
/**
@@ -255,7 +255,7 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
report back the driver used.
*/
driver_return_code_t cdio_close_tray (const char *psz_drive,
/*in/out*/ driver_id_t *p_driver_id);
/*in/out*/ driver_id_t *p_driver_id);
/**
@param drc the return code you want interpreted.
@@ -365,7 +365,7 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
was found.
*/
char ** cdio_get_devices_with_cap (/*in*/ char *ppsz_search_devices[],
cdio_fs_anal_t capabilities, bool b_any);
cdio_fs_anal_t capabilities, bool b_any);
/**
Like cdio_get_devices_with_cap but we return the driver we found
@@ -374,9 +374,9 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
and speeds things up for libcdio as well.
*/
char ** cdio_get_devices_with_cap_ret (/*in*/ char* ppsz_search_devices[],
cdio_fs_anal_t capabilities,
bool b_any,
/*out*/ driver_id_t *p_driver_id);
cdio_fs_anal_t capabilities,
bool b_any,
/*out*/ driver_id_t *p_driver_id);
/**
Like cdio_get_devices, but we may change the p_driver_id if we
@@ -401,9 +401,9 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
NULL even though there isa hardware CD-ROM.
*/
void cdio_get_drive_cap (const CdIo_t *p_cdio,
cdio_drive_read_cap_t *p_read_cap,
cdio_drive_write_cap_t *p_write_cap,
cdio_drive_misc_cap_t *p_misc_cap);
cdio_drive_read_cap_t *p_read_cap,
cdio_drive_write_cap_t *p_write_cap,
cdio_drive_misc_cap_t *p_misc_cap);
/**
Get the drive capabilities for a specified device.
@@ -415,9 +415,9 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
NULL even though there isa hardware CD-ROM.
*/
void cdio_get_drive_cap_dev (const char *device,
cdio_drive_read_cap_t *p_read_cap,
cdio_drive_write_cap_t *p_write_cap,
cdio_drive_misc_cap_t *p_misc_cap);
cdio_drive_read_cap_t *p_read_cap,
cdio_drive_write_cap_t *p_write_cap,
cdio_drive_misc_cap_t *p_misc_cap);
/**
Get a string containing the name of the driver in use.
@@ -441,7 +441,7 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
False is returned if we had an error getting the information.
*/
bool cdio_get_hwinfo ( const CdIo_t *p_cdio,
/*out*/ cdio_hwinfo_t *p_hw_info );
/*out*/ cdio_hwinfo_t *p_hw_info );
/**
@@ -452,7 +452,7 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
@param i_last_session pointer to the session number to be returned.
*/
driver_return_code_t cdio_get_last_session (CdIo_t *p_cdio,
/*out*/ lsn_t *i_last_session);
/*out*/ lsn_t *i_last_session);
/**
Find out if media has changed since the last call.
@@ -508,7 +508,7 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
@return the cdio object or NULL on error or no device.
*/
CdIo_t * cdio_open_am (const char *psz_source,
driver_id_t driver_id, const char *psz_access_mode);
driver_id_t driver_id, const char *psz_access_mode);
/**
Set up BIN/CUE CD disk-image for reading. Source is the .bin or
@@ -525,7 +525,7 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
@return the cdio object or NULL on error or no device..
*/
CdIo_t * cdio_open_am_bincue (const char *psz_cue_name,
const char *psz_access_mode);
const char *psz_access_mode);
/**
Set up cdrdao CD disk-image for reading. Source is the .toc file
@@ -540,7 +540,7 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
@return the cdio object or NULL on error or no device..
*/
CdIo_t * cdio_open_am_cdrdao (const char *psz_toc_name,
const char *psz_access_mode);
const char *psz_access_mode);
/**
Return a string containing the default CUE file that would
@@ -578,7 +578,7 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
NULL on error or there is no driver for a some sort of hardware CD-ROM.
*/
CdIo_t * cdio_open_am_cd (const char *psz_device,
const char *psz_access_mode);
const char *psz_access_mode);
/**
CDRWIN BIN/CUE CD disc-image routines. Source is the .cue file
@@ -598,7 +598,7 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
@see cdio_open
*/
CdIo_t * cdio_open_am_aix (const char *psz_source,
const char *psz_access_mode);
const char *psz_access_mode);
/**
Set up CD-ROM for reading using the AIX driver. The device_name is
@@ -654,7 +654,7 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
@see cdio_open
*/
CdIo_t * cdio_open_am_bsdi (const char *psz_source,
const char *psz_access_mode);
const char *psz_access_mode);
/**
Return a string containing the default device name that the BSDI
@@ -696,7 +696,7 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
@see cdio_open_cd, cdio_open
*/
CdIo_t * cdio_open_am_freebsd (const char *psz_source,
const char *psz_access_mode);
const char *psz_access_mode);
/**
Return a string containing the default device name that the
@@ -733,7 +733,7 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
NULL on error or there is no GNU/Linux driver.
*/
CdIo_t * cdio_open_am_linux (const char *psz_source,
const char *access_mode);
const char *access_mode);
/**
Return a string containing the default device name that the
@@ -773,7 +773,7 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
NULL on error or there is no Solaris driver.
*/
CdIo_t * cdio_open_am_solaris (const char *psz_source,
const char *psz_access_mode);
const char *psz_access_mode);
/**
Return a string containing the default device name that the
@@ -819,7 +819,7 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
@see cdio_open_cd, cdio_open
*/
CdIo_t * cdio_open_am_osx (const char *psz_source,
const char *psz_access_mode);
const char *psz_access_mode);
/**
Return a string containing the default device name that the OSX
@@ -855,7 +855,7 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
NULL is returned on error or there is no Microsof Windows driver.
*/
CdIo_t * cdio_open_am_win32 (const char *psz_source,
const char *psz_access_mode);
const char *psz_access_mode);
/**
Return a string containing the default device name that the
@@ -929,7 +929,7 @@ Return a list of all of the CD-ROM devices that the OS/2 driver
@return true on success; NULL on error or there is no Nero driver.
*/
CdIo_t * cdio_open_am_nrg (const char *psz_source,
const char *psz_access_mode);
const char *psz_access_mode);
/**
Get a string containing the default device name that the NRG
@@ -994,7 +994,7 @@ Return a list of all of the CD-ROM devices that the OS/2 driver
Set the blocksize for subsequent reads.
*/
driver_return_code_t cdio_set_blocksize ( const CdIo_t *p_cdio,
int i_blocksize );
int i_blocksize );
/**
Set the drive speed.
@@ -1013,7 +1013,7 @@ Return a list of all of the CD-ROM devices that the OS/2 driver
@see mmc_set_speed and mmc_set_drive_speed
*/
driver_return_code_t cdio_set_speed ( const CdIo_t *p_cdio,
int i_drive_speed );
int i_drive_speed );
/**
Get the value associatied with key.
@@ -1033,7 +1033,7 @@ Return a list of all of the CD-ROM devices that the OS/2 driver
@param value the value to assocaiate with key
*/
driver_return_code_t cdio_set_arg (CdIo_t *p_cdio, const char key[],
const char value[]);
const char value[]);
/**
Initialize CD Reading and control routines. Should be called first.
@@ -1055,4 +1055,4 @@ extern cdio_drive_cap_write_t debug_drive_cap_write_t;
extern cdio_mmc_hw_len_t debug_cdio_mmc_hw_len;
extern cdio_src_category_mask_t debug_cdio_src_category_mask;
#endif /* __CDIO_DEVICE_H__ */
#endif /* CDIO_DEVICE_H_ */

View File

@@ -1,6 +1,6 @@
/* -*- c -*-
Copyright (C) 2004, 2005, 2006, 2008, 2010 Rocky Bernstein
Copyright (C) 2004, 2005, 2006, 2008, 2010, 2012 Rocky Bernstein
<rocky@gnu.org>
This program is free software: you can redistribute it and/or modify
@@ -21,8 +21,8 @@
\file disc.h
\brief The top-level header for disc-related libcdio calls.
*/
#ifndef __CDIO_DISC_H__
#define __CDIO_DISC_H__
#ifndef CDIO_DISC_H_
#define CDIO_DISC_H_
#ifdef __cplusplus
extern "C" {
@@ -34,10 +34,10 @@ extern "C" {
GNU/Linux /usr/include/linux/cdrom.h and we've added DVD.
*/
typedef enum {
CDIO_DISC_MODE_CD_DA, /**< CD-DA */
CDIO_DISC_MODE_CD_DATA, /**< CD-ROM form 1 */
CDIO_DISC_MODE_CD_XA, /**< CD-ROM XA form2 */
CDIO_DISC_MODE_CD_MIXED, /**< Some combo of above. */
CDIO_DISC_MODE_CD_DA, /**< CD-DA */
CDIO_DISC_MODE_CD_DATA, /**< CD-ROM form 1 */
CDIO_DISC_MODE_CD_XA, /**< CD-ROM XA form2 */
CDIO_DISC_MODE_CD_MIXED, /**< Some combo of above. */
CDIO_DISC_MODE_DVD_ROM, /**< DVD ROM (e.g. movies) */
CDIO_DISC_MODE_DVD_RAM, /**< DVD-RAM */
CDIO_DISC_MODE_DVD_R, /**< DVD-R */
@@ -52,7 +52,7 @@ extern "C" {
CDIO_DISC_MODE_DVD_OTHER, /**< Unknown/unclassified DVD type */
CDIO_DISC_MODE_NO_INFO,
CDIO_DISC_MODE_ERROR,
CDIO_DISC_MODE_CD_I /**< CD-i. */
CDIO_DISC_MODE_CD_I /**< CD-i. */
} discmode_t;
extern const char *discmode2str[];
@@ -134,4 +134,4 @@ extern "C" {
}
#endif /* __cplusplus */
#endif /* __CDIO_DISC_H__ */
#endif /* CDIO_DISC_H_ */

View File

@@ -26,8 +26,8 @@
*/
#ifndef __CDIO_DS_H__
#define __CDIO_DS_H__
#ifndef CDIO_DS_H_
#define CDIO_DS_H_
#include <cdio/types.h>
@@ -86,7 +86,7 @@ void *_cdio_list_node_data (CdioListNode_t *p_node);
}
#endif /* __cplusplus */
#endif /* __CDIO_DS_H__ */
#endif /* CDIO_DS_H_ */
/*
* Local variables:

View File

@@ -27,35 +27,40 @@
*/
#ifndef __CDIO_DVD_H__
#define __CDIO_DVD_H__
#ifndef CDIO_DVD_H_
#define CDIO_DVD_H_
#include <cdio/types.h>
/**
Values used in a READ DVD STRUCTURE
*/
#define CDIO_DVD_STRUCT_PHYSICAL 0x00
#define CDIO_DVD_STRUCT_COPYRIGHT 0x01
#define CDIO_DVD_STRUCT_DISCKEY 0x02
#define CDIO_DVD_STRUCT_BCA 0x03
#define CDIO_DVD_STRUCT_MANUFACT 0x04
typedef enum cdio_dvd_structure
{
CDIO_DVD_STRUCT_PHYSICAL = 0x00,
CDIO_DVD_STRUCT_COPYRIGHT = 0x01,
CDIO_DVD_STRUCT_DISCKEY = 0x02,
CDIO_DVD_STRUCT_BCA = 0x03,
CDIO_DVD_STRUCT_MANUFACT = 0x04
} cdio_dvd_structure;
/**
Media definitions for "DVD Book" from MMC-5 Table 400, page 419.
*/
#define CDIO_DVD_BOOK_DVD_ROM 0x0 /**< DVD-ROM */
#define CDIO_DVD_BOOK_DVD_RAM 0x1 /**< DVD-RAM */
#define CDIO_DVD_BOOK_DVD_R 0x2 /**< DVD-R */
#define CDIO_DVD_BOOK_DVD_RW 0x3 /**< DVD-RW */
#define CDIO_DVD_BOOK_HD_DVD_ROM 0x4 /**< HD DVD-ROM */
#define CDIO_DVD_BOOK_HD_DVD_RAM 0x5 /**< HD DVD-RAM */
#define CDIO_DVD_BOOK_HD_DVD_R 0x6 /**< HD DVD-R */
#define CDIO_DVD_BOOK_DVD_PRW 0x9 /**< DVD+RW */
#define CDIO_DVD_BOOK_DVD_PR 0xa /**< DVD+R */
#define CDIO_DVD_BOOK_DVD_PRW_DL 0xd /**< DVD+RW DL */
#define CDIO_DVD_BOOK_DVD_PR_DL 0xe /**< DVD+R DL */
typedef enum cdio_dvd_book
{
CDIO_DVD_BOOK_DVD_ROM = 0x0, /**< DVD-ROM */
CDIO_DVD_BOOK_DVD_RAM = 0x1, /**< DVD-RAM */
CDIO_DVD_BOOK_DVD_R = 0x2, /**< DVD-R */
CDIO_DVD_BOOK_DVD_RW = 0x3, /**< DVD-RW */
CDIO_DVD_BOOK_HD_DVD_ROM = 0x4, /**< HD DVD-ROM */
CDIO_DVD_BOOK_HD_DVD_RAM = 0x5, /**< HD DVD-RAM */
CDIO_DVD_BOOK_HD_DVD_R = 0x6, /**< HD DVD-R */
CDIO_DVD_BOOK_DVD_PRW = 0x9, /**< DVD+RW */
CDIO_DVD_BOOK_DVD_PR = 0xa, /**< DVD+R */
CDIO_DVD_BOOK_DVD_PRW_DL = 0xd, /**< DVD+RW DL */
CDIO_DVD_BOOK_DVD_PR_DL = 0xe /**< DVD+R DL */
} cdio_dvd_book;
typedef struct cdio_dvd_layer {
unsigned int book_version : 4;
@@ -124,4 +129,4 @@ typedef union {
cdio_dvd_manufact_t manufact;
} cdio_dvd_struct_t;
#endif /* __CDIO_DVD_H__ */
#endif /* CDIO_DVD_H_ */

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,5 @@
/*
$Id: iso9660.h,v 1.102 2008/07/16 00:28:54 rocky Exp $
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2012
Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
@@ -33,8 +31,8 @@
*/
#ifndef __CDIO_ISO9660_H__
#define __CDIO_ISO9660_H__
#ifndef CDIO_ISO9660_H_
#define CDIO_ISO9660_H_
#include <time.h>
@@ -71,7 +69,7 @@ typedef char dchar_t; /*! See section 7.4.1 */
#undef ISODCL
#endif
/* This part borrowed from the bsd386 isofs */
#define ISODCL(from, to) ((to) - (from) + 1)
#define ISODCL(from, to) ((to) - (from) + 1)
#define MIN_TRACK_SIZE 4*75
#define MIN_ISO_SIZE MIN_TRACK_SIZE
@@ -107,14 +105,14 @@ extern enum iso_enum1_s {
/*! ISO 9660 directory flags. */
extern enum iso_flag_enum_s {
ISO_FILE = 0, /**< Not really a flag... */
ISO_EXISTENCE = 1, /**< Do not make existence known (hidden) */
ISO_DIRECTORY = 2, /**< This file is a directory */
ISO_ASSOCIATED = 4, /**< This file is an associated file */
ISO_RECORD = 8, /**< Record format in extended attr. != 0 */
ISO_FILE = 0, /**< Not really a flag... */
ISO_EXISTENCE = 1, /**< Do not make existence known (hidden) */
ISO_DIRECTORY = 2, /**< This file is a directory */
ISO_ASSOCIATED = 4, /**< This file is an associated file */
ISO_RECORD = 8, /**< Record format in extended attr. != 0 */
ISO_PROTECTION = 16, /**< No read/execute perm. in ext. attr. */
ISO_DRESERVED1 = 32, /**<, Reserved bit 5 */
ISO_DRESERVED2 = 64, /**<, Reserved bit 6 */
ISO_DRESERVED1 = 32, /**<, Reserved bit 5 */
ISO_DRESERVED2 = 64, /**<, Reserved bit 6 */
ISO_MULTIEXTENT = 128, /**< Not final entry of a mult. ext. file */
} iso_flag_enums;
@@ -124,7 +122,7 @@ extern enum iso_vd_enum_s {
ISO_VD_PRIMARY = 1, /**< Is in any ISO-9660 */
ISO_VD_SUPPLEMENTARY = 2, /**< Used by Joliet, for example */
ISO_VD_PARITION = 3, /**< Indicates a partition of a CD */
ISO_VD_END = 255
ISO_VD_END = 255
} iso_vd_enums;
@@ -136,12 +134,12 @@ extern enum iso_vd_enum_s {
For ISO-9660 Level 1, the maximum needed string length is:
@code
30 chars (filename + ext)
+ 2 chars ('.' + ';')
+ 5 chars (strlen("32767"))
+ 1 null byte
30 chars (filename + ext)
+ 2 chars ('.' + ';')
+ 5 chars (strlen("32767"))
+ 1 null byte
================================
= 38 chars
= 38 chars
@endcode
*/
@@ -183,15 +181,15 @@ PRAGMA_BEGIN_PACKED
@see iso9660_dtime
*/
struct iso9660_dtime_s {
iso711_t dt_year; /**< Number of years since 1900 */
iso711_t dt_month; /**< Has value in range 1..12. Note starts
struct iso9660_dtime_s {
iso711_t dt_year; /**< Number of years since 1900 */
iso711_t dt_month; /**< Has value in range 1..12. Note starts
at 1, not 0 like a tm struct. */
iso711_t dt_day; /**< Day of the month from 1 to 31 */
iso711_t dt_hour; /**< Hour of the day from 0 to 23 */
iso711_t dt_minute; /**< Minute of the hour from 0 to 59 */
iso711_t dt_second; /**< Second of the minute from 0 to 59 */
iso712_t dt_gmtoff; /**< GMT values -48 .. + 52 in 15 minute
iso711_t dt_day; /**< Day of the month from 1 to 31 */
iso711_t dt_hour; /**< Hour of the day from 0 to 23 */
iso711_t dt_minute; /**< Minute of the hour from 0 to 59 */
iso711_t dt_second; /**< Second of the minute from 0 to 59 */
iso712_t dt_gmtoff; /**< GMT values -48 .. + 52 in 15 minute
intervals */
} GNUC_PACKED;
@@ -206,19 +204,19 @@ typedef struct iso9660_dtime_s iso9660_dtime_t;
@see iso9660_ltime
*/
struct iso9660_ltime_s {
char lt_year [ISODCL( 1, 4)]; /**< Add 1900 to value
struct iso9660_ltime_s {
char lt_year [ISODCL( 1, 4)]; /**< Add 1900 to value
for the Julian
year */
char lt_month [ISODCL( 5, 6)]; /**< Has value in range
char lt_month [ISODCL( 5, 6)]; /**< Has value in range
1..12. Note starts
at 1, not 0 like a
tm struct. */
char lt_day [ISODCL( 7, 8)]; /**< Day of month: 1..31 */
char lt_hour [ISODCL( 9, 10)]; /**< hour: 0..23 */
char lt_minute [ISODCL( 11, 12)]; /**< minute: 0..59 */
char lt_second [ISODCL( 13, 14)]; /**< second: 0..59 */
char lt_hsecond [ISODCL( 15, 16)]; /**< The value is in
char lt_day [ISODCL( 7, 8)]; /**< Day of month: 1..31 */
char lt_hour [ISODCL( 9, 10)]; /**< hour: 0..23 */
char lt_minute [ISODCL( 11, 12)]; /**< minute: 0..59 */
char lt_second [ISODCL( 13, 14)]; /**< second: 0..59 */
char lt_hsecond [ISODCL( 15, 16)]; /**< The value is in
units of 1/100's of
a second */
iso712_t lt_gmtoff; /**< Offset from Greenwich Mean Time in number
@@ -405,7 +403,7 @@ struct iso9660_svd_s {
char id[5]; /**< ISO_STANDARD_ID "CD001"
*/
iso711_t version; /**< value 1 */
char flags; /**< Section 8.5.3 */
char flags; /**< Section 8.5.3 */
achar_t system_id[ISO_MAX_SYSTEM_ID]; /**< Section 8.5.4; each char
is an achar */
dchar_t volume_id[ISO_MAX_VOLUME_ID]; /**< Section 8.5.5; each char
@@ -1133,7 +1131,7 @@ lsn_t iso9660_get_dir_extent(const iso9660_dir_t *p_idr);
#endif /* __cplusplus */
#undef ISODCL
#endif /* __CDIO_ISO9660_H__ */
#endif /* CDIO_ISO9660_H_ */
/*
* Local variables:

View File

@@ -1,7 +1,5 @@
/*
$Id: logging.h,v 1.11 2008/03/25 15:59:09 karl Exp $
Copyright (C) 2003, 2004, 2008 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2003, 2004, 2008, 2012 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
This program is free software: you can redistribute it and/or modify
@@ -23,8 +21,8 @@
*
*/
#ifndef __LOGGING_H__
#define __LOGGING_H__
#ifndef CDIO_LOGGING_H_
#define CDIO_LOGGING_H_
#include <cdio/types.h>
@@ -124,7 +122,7 @@ void cdio_error (const char format[], ...) GNUC_PRINTF(1,2);
}
#endif
#endif /* __LOGGING_H__ */
#endif /* CDIO_LOGGING_H_ */
/*

View File

@@ -1,5 +1,5 @@
/*
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012
Rocky Bernstein <rocky@gnu.org>
This program is free software: you can redistribute it and/or modify
@@ -33,8 +33,8 @@
*/
#ifndef __CDIO_MMC_H__
#define __CDIO_MMC_H__
#ifndef CDIO_MMC_H_
#define CDIO_MMC_H_
#include <cdio/cdio.h>
#include <cdio/types.h>
@@ -68,40 +68,40 @@ extern "C" {
*/
typedef struct cdio_mmc_request_sense {
#if defined(__MMC_BIG_ENDIAN_BITFIELD)
uint8_t valid : 1; /**< valid bit is 1 if info is valid */
uint8_t error_code : 7;
uint8_t valid : 1; /**< valid bit is 1 if info is valid */
uint8_t error_code : 7;
#else
uint8_t error_code : 7;
uint8_t valid : 1; /**< valid bit is 1 if info is valid */
uint8_t error_code : 7;
uint8_t valid : 1; /**< valid bit is 1 if info is valid */
#endif
uint8_t segment_number;
uint8_t segment_number;
#if defined(__MMC_BIG_ENDIAN_BITFIELD)
uint8_t filemark : 1; /**< manditory in sequential
uint8_t filemark : 1; /**< manditory in sequential
* access devices */
uint8_t eom : 1; /**< end of medium. manditory in
uint8_t eom : 1; /**< end of medium. manditory in
* sequential access and
* printer devices */
uint8_t ili : 1; /**< incorrect length indicator */
uint8_t reserved1 : 1;
uint8_t sense_key : 4;
uint8_t ili : 1; /**< incorrect length indicator */
uint8_t reserved1 : 1;
uint8_t sense_key : 4;
#else
uint8_t sense_key : 4;
uint8_t reserved1 : 1;
uint8_t ili : 1; /**< incorrect length indicator */
uint8_t eom : 1; /**< end of medium. manditory in
uint8_t sense_key : 4;
uint8_t reserved1 : 1;
uint8_t ili : 1; /**< incorrect length indicator */
uint8_t eom : 1; /**< end of medium. manditory in
* sequential access and
* printer devices */
uint8_t filemark : 1; /**< manditory in sequential
uint8_t filemark : 1; /**< manditory in sequential
* access devices */
#endif
uint8_t information[4];
uint8_t additional_sense_len; /**< Additional sense length (n-7) */
uint8_t command_info[4]; /**< Command-specific information */
uint8_t asc; /**< Additional sense code */
uint8_t ascq; /**< Additional sense code qualifier */
uint8_t fruc; /**< Field replaceable unit code */
uint8_t sks[3]; /**< Sense-key specific */
uint8_t asb[46]; /**< Additional sense bytes */
uint8_t information[4];
uint8_t additional_sense_len; /**< Additional sense length (n-7) */
uint8_t command_info[4]; /**< Command-specific information */
uint8_t asc; /**< Additional sense code */
uint8_t ascq; /**< Additional sense code qualifier */
uint8_t fruc; /**< Field replaceable unit code */
uint8_t sks[3]; /**< Sense-key specific */
uint8_t asb[46]; /**< Additional sense bytes */
} cdio_mmc_request_sense_t;
@@ -800,7 +800,7 @@ extern cdio_mmc_mode_page_t debug_cdio_mmc_mode_page;
CDIO_MMC_GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL
#endif /*DO_NOT_WANT_PARANOIA_COMPATIBILITY*/
#endif /* __MMC_H__ */
#endif /* CDIO_MMC_H_ */
/*
* Local variables:

View File

@@ -1,5 +1,5 @@
/*
Copyright (C) 2010 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2010, 2012 Rocky Bernstein <rocky@gnu.org>
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
@@ -15,14 +15,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __CDIO_MMC_CMDS_H__
#define __CDIO_MMC_CMDS_H__
#ifndef CDIO_MMC_CMDS_H_
#define CDIO_MMC_CMDS_H_
#include <cdio/mmc.h>
#include <cdio/mmc_ll_cmds.h>
#include <cdio/mmc_hl_cmds.h>
#endif /* __CDIO_MMC_CMDS_H__ */
#endif /* CDIO_MMC_CMDS_H_ */
/*
* Local variables:

View File

@@ -1,5 +1,5 @@
/*
Copyright (C) 2010 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2010, 2012 Rocky Bernstein <rocky@gnu.org>
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
@@ -22,8 +22,8 @@
MMC commands.
*/
#ifndef __CDIO_MMC_HL_CMDS_H__
#define __CDIO_MMC_HL_CMDS_H__
#ifndef CDIO_MMC_HL_CMDS_H_
#define CDIO_MMC_HL_CMDS_H_
#include <cdio/mmc.h>
@@ -94,7 +94,7 @@ extern "C" {
@return DRIVER_OP_SUCCESS if we ran the command ok.
*/
driver_return_code_t mmc_mode_sense( CdIo_t *p_cdio, /*out*/ void *p_buf,
unsigned int i_size, int page);
unsigned int i_size, int page);
/**
Set the drive speed in CD-ROM speed units.
@@ -121,7 +121,7 @@ extern "C" {
}
#endif /* __cplusplus */
#endif /* __CDIO_MMC_HL_CMDS_H__ */
#endif /* CDIO_MMC_HL_CMDS_H_ */
/*
* Local variables:

View File

@@ -1,5 +1,5 @@
/*
Copyright (C) 2010 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2010, 2012 Rocky Bernstein <rocky@gnu.org>
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
@@ -32,8 +32,8 @@
*/
#ifndef __CDIO_MMC_LL_CMDS_H__
#define __CDIO_MMC_LL_CMDS_H__
#ifndef CDIO_MMC_LL_CMDS_H_
#define CDIO_MMC_LL_CMDS_H_
#include <cdio/mmc.h>
@@ -91,13 +91,13 @@ extern "C" {
@param i_timeout_ms value in milliseconds to use on timeout. Setting
to 0 uses the default time-out value stored in
mmc_timeout_ms.
mmc_timeout_ms.
@return DRIVER_OP_SUCCESS if we ran the command ok.
*/
driver_return_code_t mmc_mode_select_10(CdIo_t *p_cdio, /*out*/ void *p_buf,
unsigned int i_size, int page,
unsigned int i_timeout_ms);
unsigned int i_size, int page,
unsigned int i_timeout_ms);
/**
Run a SCSI-MMC MODE SENSE command (10-byte version)
and put the results in p_buf
@@ -112,7 +112,7 @@ extern "C" {
@return DRIVER_OP_SUCCESS if we ran the command ok.
*/
driver_return_code_t mmc_mode_sense_10( CdIo_t *p_cdio, /*out*/ void *p_buf,
unsigned int i_size,
unsigned int i_size,
unsigned int i_page_code);
/**
@@ -125,7 +125,7 @@ extern "C" {
@return DRIVER_OP_SUCCESS if we ran the command ok.
*/
driver_return_code_t mmc_mode_sense_6( CdIo_t *p_cdio, /*out*/ void *p_buf,
unsigned int i_size, int page);
unsigned int i_size, int page);
/**
Request preventing/allowing medium removal on a drive via
@@ -137,15 +137,15 @@ extern "C" {
@param i_timeout_ms value in milliseconds to use on timeout. Setting
to 0 uses the default time-out value stored in
mmc_timeout_ms.
mmc_timeout_ms.
@return DRIVER_OP_SUCCESS (0) if we got the status.
return codes are the same as driver_return_code_t
*/
driver_return_code_t
mmc_prevent_allow_medium_removal(const CdIo_t *p_cdio,
bool b_persistent, bool b_prevent,
unsigned int i_timeout_ms);
bool b_persistent, bool b_prevent,
unsigned int i_timeout_ms);
/**
Issue a MMC READ_CD command.
@@ -296,7 +296,7 @@ extern "C" {
@param i_timeout_ms value in milliseconds to use on timeout. Setting
to 0 uses the default time-out value stored in
mmc_timeout_ms.
mmc_timeout_ms.
@return the drive speed if greater than 0. -1 if we had an error. is -2
returned if this is not implemented for the current driver.
@@ -324,8 +324,8 @@ extern "C" {
@see mmc_eject_media or mmc_close_tray
*/
driver_return_code_t mmc_start_stop_unit(const CdIo_t *p_cdio, bool b_eject,
bool b_immediate,
uint8_t power_condition,
bool b_immediate,
uint8_t power_condition,
unsigned int i_timeout_ms);
/**
@@ -335,12 +335,12 @@ extern "C" {
@param i_timeout_ms value in milliseconds to use on timeout. Setting
to 0 uses the default time-out value stored in
mmc_timeout_ms.
mmc_timeout_ms.
@return DRIVER_OP_SUCCESS if we ran the command ok.
*/
driver_return_code_t mmc_test_unit_ready(const CdIo_t *p_cdio,
unsigned int i_timeout_ms);
unsigned int i_timeout_ms);
#ifndef DO_NOT_WANT_OLD_MMC_COMPATIBILITY
@@ -352,7 +352,7 @@ extern "C" {
}
#endif /* __cplusplus */
#endif /* __CDIO_MMC_HL_CMDS_H__ */
#endif /* CDIO_MMC_HL_CMDS_H_ */
/*
* Local variables:

View File

@@ -1,5 +1,5 @@
/*
Copyright (C) 2010 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2010, 2012 Rocky Bernstein <rocky@gnu.org>
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
@@ -22,8 +22,8 @@
on anything other than headers.
*/
#ifndef __CDIO_MMC_UTIL_H__
#define __CDIO_MMC_UTIL_H__
#ifndef CDIO_MMC_UTIL_H_
#define CDIO_MMC_UTIL_H_
#include <cdio/device.h>
@@ -147,7 +147,7 @@ extern "C" {
}
#endif /* __cplusplus */
#endif /* __MMC_UTIL_H__ */
#endif /* CDIO_MMC_UTIL_H_ */
/*
* Local variables:
* c-file-style: "gnu"

View File

@@ -1,7 +1,5 @@
/*
$Id: posix.h,v 1.2 2008/03/25 15:59:09 karl Exp $
Copyright (C) 2005, 2008 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2005, 2008, 2012 Rocky Bernstein <rocky@gnu.org>
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
@@ -22,8 +20,8 @@
* \brief various POSIX definitions.
*/
#ifndef __CDIO_POSIX_H__
#define __CDIO_POSIX_H__
#ifndef CDIO_POSIX_H_
#define CDIO_POSIX_H_
typedef uint32_t posix_mode_t;
typedef uint32_t posix_nlink_t;
@@ -31,7 +29,7 @@ typedef uint32_t posix_uid_t;
typedef uint32_t posix_gid_t;
typedef uint16_t unicode16_t;
#endif /* __CDIO_POSIX_H__ */
#endif /* CDIO_POSIX_H_ */
/*

View File

@@ -1,7 +1,5 @@
/*
$Id: read.h,v 1.15 2008/03/25 15:59:09 karl Exp $
Copyright (C) 2005, 2006, 2007, 2008 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2005, 2006, 2007, 2008, 2012 Rocky Bernstein <rocky@gnu.org>
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
@@ -23,8 +21,8 @@
* libcdio calls.
*/
#ifndef __CDIO_READ_H__
#define __CDIO_READ_H__
#ifndef CDIO_READ_H_
#define CDIO_READ_H_
#include <cdio/types.h>
@@ -74,11 +72,11 @@ extern "C" {
@param p_cdio object to read from
@param p_buf place to read data into. The caller should make sure
this location can store at least CDIO_FRAMESIZE_RAW
bytes.
bytes.
@param i_lsn sector to read
*/
driver_return_code_t cdio_read_audio_sector (const CdIo_t *p_cdio,
void *p_buf, lsn_t i_lsn);
void *p_buf, lsn_t i_lsn);
/*!
Reads audio sectors
@@ -86,13 +84,13 @@ extern "C" {
@param p_cdio object to read from
@param p_buf place to read data into. The caller should make sure
this location can store at least CDIO_FRAMESIZE_RAW
* i_blocks bytes.
* i_blocks bytes.
@param i_lsn sector to read
@param i_blocks number of sectors to read
*/
driver_return_code_t cdio_read_audio_sectors (const CdIo_t *p_cdio,
void *p_buf, lsn_t i_lsn,
uint32_t i_blocks);
void *p_buf, lsn_t i_lsn,
uint32_t i_blocks);
/*!
Read data sectors
@@ -100,11 +98,11 @@ extern "C" {
@param p_cdio object to read from
@param p_buf place to read data into. The caller should make sure
this location can store at least ISO_BLOCKSIZE,
M2RAW_SECTOR_SIZE, or M2F2_SECTOR_SIZE depending
on the kind of sector getting read. If you don't
know whether you have a Mode 1/2, Form 1/ Form 2/Formless
sector best to reserve space for the maximum,
M2RAW_SECTOR_SIZE.
M2RAW_SECTOR_SIZE, or M2F2_SECTOR_SIZE depending
on the kind of sector getting read. If you don't
know whether you have a Mode 1/2, Form 1/ Form 2/Formless
sector best to reserve space for the maximum,
M2RAW_SECTOR_SIZE.
@param i_lsn sector to read
@param i_blocksize size of block. Should be either CDIO_CD_FRAMESIZE,
M2RAW_SECTOR_SIZE, or M2F2_SECTOR_SIZE. See comment above under p_buf.
@@ -112,9 +110,9 @@ extern "C" {
@param i_blocks number of blocks to read
*/
driver_return_code_t cdio_read_data_sectors ( const CdIo_t *p_cdio,
void *p_buf, lsn_t i_lsn,
uint16_t i_blocksize,
uint32_t i_blocks );
void *p_buf, lsn_t i_lsn,
uint16_t i_blocksize,
uint32_t i_blocks );
/*!
Reads a mode 1 sector
@@ -125,8 +123,8 @@ extern "C" {
mode 1 form 1 sectors.
*/
driver_return_code_t cdio_read_mode1_sector (const CdIo_t *p_cdio,
void *p_buf, lsn_t i_lsn,
bool b_form2);
void *p_buf, lsn_t i_lsn,
bool b_form2);
/*!
Reads mode 1 sectors
@@ -138,17 +136,17 @@ extern "C" {
@param i_blocks number of sectors to read
*/
driver_return_code_t cdio_read_mode1_sectors (const CdIo_t *p_cdio,
void *p_buf, lsn_t i_lsn,
bool b_form2,
uint32_t i_blocks);
void *p_buf, lsn_t i_lsn,
bool b_form2,
uint32_t i_blocks);
/*!
Reads a mode 2 sector
@param p_cdio object to read from
@param p_buf place to read data into. The caller should make sure
this location can store at least
M2RAW_SECTOR_SIZE (for form 1) or CDIO_CD_FRAMESIZE (for
form 2) bytes.
M2RAW_SECTOR_SIZE (for form 1) or CDIO_CD_FRAMESIZE (for
form 2) bytes.
@param i_lsn sector to read
@param b_form2 true for reading mode 2 form 2 sectors or false for
mode 2 form 1 sectors.
@@ -156,23 +154,23 @@ extern "C" {
@return 0 if no error, nonzero otherwise.
*/
driver_return_code_t cdio_read_mode2_sector (const CdIo_t *p_cdio,
void *p_buf, lsn_t i_lsn,
bool b_form2);
void *p_buf, lsn_t i_lsn,
bool b_form2);
/** The special case of reading a single block is a common one so we
provide a routine for that as a convenience.
*/
driver_return_code_t cdio_read_sector(const CdIo_t *p_cdio, void *p_buf,
lsn_t i_lsn,
cdio_read_mode_t read_mode);
lsn_t i_lsn,
cdio_read_mode_t read_mode);
/*!
Reads mode 2 sectors
@param p_cdio object to read from
@param p_buf place to read data into. The caller should make sure
this location can store at least
M2RAW_SECTOR_SIZE (for form 1) or CDIO_CD_FRAMESIZE (for
form 2) * i_blocks bytes.
M2RAW_SECTOR_SIZE (for form 1) or CDIO_CD_FRAMESIZE (for
form 2) * i_blocks bytes.
@param i_lsn sector to read
@param b_form2 true for reading mode2 form 2 sectors or false for
mode 2 form 1 sectors.
@@ -181,9 +179,9 @@ extern "C" {
@return 0 if no error, nonzero otherwise.
*/
driver_return_code_t cdio_read_mode2_sectors (const CdIo_t *p_cdio,
void *p_buf, lsn_t i_lsn,
bool b_form2,
uint32_t i_blocks);
void *p_buf, lsn_t i_lsn,
bool b_form2,
uint32_t i_blocks);
/*!
Reads a number of sectors (AKA blocks).
@@ -215,12 +213,12 @@ extern "C" {
*/
driver_return_code_t cdio_read_sectors(const CdIo_t *p_cdio, void *p_buf,
lsn_t i_lsn,
cdio_read_mode_t read_mode,
uint32_t i_blocks);
lsn_t i_lsn,
cdio_read_mode_t read_mode,
uint32_t i_blocks);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __CDIO_TRACK_H__ */
#endif /* CDIO_READ_H_ */

View File

@@ -1,5 +1,5 @@
/*
Copyright (C) 2005, 2006 2008 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2005, 2006 2008, 2012 Rocky Bernstein <rocky@gnu.org>
See also rock.c by Eric Youngdale (1993) from GNU/Linux
This is Copyright 1993 Yggdrasil Computing, Incorporated
@@ -26,8 +26,8 @@
*/
#ifndef __CDIO_ROCK_H__
#define __CDIO_ROCK_H__
#ifndef CDIO_ROCK_H_
#define CDIO_ROCK_H_
#include <cdio/types.h>
@@ -152,10 +152,10 @@ typedef enum {
ISO_ROCK_SL_ROOT = 8
} iso_rock_sl_flag_t;
#define ISO_ROCK_SL_CONTINUE 1
#define ISO_ROCK_SL_CURRENT 2
#define ISO_ROCK_SL_PARENT 4
#define ISO_ROCK_SL_ROOT 8
#define ISO_ROCK_SL_CONTINUE 1
#define ISO_ROCK_SL_CURRENT 2
#define ISO_ROCK_SL_PARENT 4
#define ISO_ROCK_SL_ROOT 8
typedef struct iso_rock_sl_part_s {
uint8_t flags;
@@ -178,9 +178,9 @@ typedef enum {
ISO_ROCK_NM_PARENT = 4,
} iso_rock_nm_flag_t;
#define ISO_ROCK_NM_CONTINUE 1
#define ISO_ROCK_NM_CURRENT 2
#define ISO_ROCK_NM_PARENT 4
#define ISO_ROCK_NM_CONTINUE 1
#define ISO_ROCK_NM_CURRENT 2
#define ISO_ROCK_NM_PARENT 4
typedef struct iso_rock_nm_s {
@@ -373,7 +373,7 @@ extern iso_rock_tf_flag_t iso_rock_tf_flag;
}
#endif /* __cplusplus */
#endif /* __ISO_ROCK_H__ */
#endif /* CDIO_ROCK_H_ */
/*
* Local variables:

View File

@@ -1,7 +1,6 @@
/*
$Id: sector.h,v 1.38 2008/03/25 15:59:09 karl Exp $
Copyright (C) 2003, 2004, 2005, 2006, 2008 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2003, 2004, 2005, 2006, 2008, 2012
Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
This program is free software: you can redistribute it and/or modify
@@ -57,8 +56,8 @@
*/
#ifndef _CDIO_SECTOR_H_
#define _CDIO_SECTOR_H_
#ifndef CDIO_SECTOR_H_
#define CDIO_SECTOR_H_
#ifdef __cplusplus
extern "C" {
@@ -69,21 +68,24 @@
/*! Information that can be obtained through a Read Subchannel
command.
*/
#define CDIO_SUBCHANNEL_SUBQ_DATA 0
#define CDIO_SUBCHANNEL_CURRENT_POSITION 1
#define CDIO_SUBCHANNEL_MEDIA_CATALOG 2
#define CDIO_SUBCHANNEL_TRACK_ISRC 3
typedef enum cdio_subchannel
{
CDIO_SUBCHANNEL_SUBQ_DATA = 0,
CDIO_SUBCHANNEL_CURRENT_POSITION = 1,
CDIO_SUBCHANNEL_MEDIA_CATALOG = 2,
CDIO_SUBCHANNEL_TRACK_ISRC = 3
} cdio_subchannel;
/*! track flags
* Q Sub-channel Control Field (4.2.3.3)
*/
typedef enum {
NONE = 0x00, /* no flags set */
PRE_EMPHASIS = 0x01, /* audio track recorded with pre-emphasis */
COPY_PERMITTED = 0x02, /* digital copy permitted */
DATA = 0x04, /* data track */
FOUR_CHANNEL_AUDIO = 0x08, /* 4 audio channels */
SCMS = 0x10 /* SCMS (5.29.2.7) */
NONE = 0x00, /* no flags set */
PRE_EMPHASIS = 0x01, /* audio track recorded with pre-emphasis */
COPY_PERMITTED = 0x02, /* digital copy permitted */
DATA = 0x04, /* data track */
FOUR_CHANNEL_AUDIO = 0x08, /* 4 audio channels */
SCMS = 0x10 /* SCMS (5.29.2.7) */
} flag_t;
#define CDIO_PREGAP_SECTORS 150
@@ -199,12 +201,14 @@
#define CDIO_CD_FRAMES_PER_MIN \
(CDIO_CD_FRAMES_PER_SEC*CDIO_CD_SECS_PER_MIN)
#define CDIO_CD_74MIN_SECTORS (UINT32_C(74)*CDIO_CD_FRAMES_PER_MIN)
#define CDIO_CD_80MIN_SECTORS (UINT32_C(80)*CDIO_CD_FRAMES_PER_MIN)
#define CDIO_CD_90MIN_SECTORS (UINT32_C(90)*CDIO_CD_FRAMES_PER_MIN)
typedef enum cdio_cd_minutes_sectors
{
CDIO_CD_74MIN_SECTORS = UINT32_C(74) * CDIO_CD_FRAMES_PER_MIN,
CDIO_CD_80MIN_SECTORS = UINT32_C(80) * CDIO_CD_FRAMES_PER_MIN,
CDIO_CD_90MIN_SECTORS = UINT32_C(90) * CDIO_CD_FRAMES_PER_MIN,
#define CDIO_CD_MAX_SECTORS \
(UINT32_C(100)*CDIO_CD_FRAMES_PER_MIN-CDIO_PREGAP_SECTORS)
CDIO_CD_MAX_SECTORS = UINT32_C(100) * CDIO_CD_FRAMES_PER_MIN - CDIO_PREGAP_SECTORS
} cdio_cd_minutes_sectors;
#define msf_t_SIZEOF 3
@@ -274,7 +278,7 @@
#define CD_FRAMESIZE_RAW CDIO_CD_FRAMESIZE_RAW
#endif /*DO_NOT_WANT_PARANOIA_COMPATIBILITY*/
#endif /* _CDIO_SECTOR_H_ */
#endif /* CDIO_SECTOR_H_ */
/*

View File

@@ -1,5 +1,5 @@
/*
Copyright (C) 2005, 2006, 2008 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2005, 2006, 2008, 2012 Rocky Bernstein <rocky@gnu.org>
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
@@ -18,8 +18,8 @@
/** \file track.h
* \brief The top-level header for track-related libcdio calls.
*/
#ifndef __CDIO_TRACK_H__
#define __CDIO_TRACK_H__
#ifndef CDIO_TRACK_H_
#define CDIO_TRACK_H_
#ifdef __cplusplus
extern "C" {
@@ -34,8 +34,8 @@ extern "C" {
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.
*/
* of user data.
*/
TRACK_FORMAT_ERROR /**< Dunno what is, or some other error. */
} track_format_t;
@@ -51,8 +51,8 @@ extern "C" {
track_flag_t preemphasis; /**< Linear preemphasis on an audio track */
track_flag_t copy_permit; /**< Whether copying is permitted */
int channels; /**< Number of audio channels, 2, 4. -2 if not
implemented or -1 for error.
*/
implemented or -1 for error.
*/
} track_flags_t;
/*! The leadout track is always 0xAA, regardless of # of tracks on
@@ -70,7 +70,7 @@ extern "C" {
extern enum cdio_track_enums {
CDIO_CDROM_LBA = 0x01, /**< "logical block": first frame is #0 */
CDIO_CDROM_MSF = 0x02, /**< "minute-second-frame": binary, not
BCD here! */
BCD here! */
CDIO_CDROM_DATA_TRACK = 0x04,
CDIO_CDROM_CDI_TRACK = 0x10,
CDIO_CDROM_XA_TRACK = 0x20,
@@ -86,14 +86,14 @@ extern "C" {
reference: MMC-3 draft revsion - 10g
*/
typedef enum {
AUDIO, /**< 2352 byte block length */
MODE1, /**< 2048 byte block length */
MODE1_RAW, /**< 2352 byte block length */
MODE2, /**< 2336 byte block length */
MODE2_FORM1, /**< 2048 byte block length */
MODE2_FORM2, /**< 2324 byte block length */
MODE2_FORM_MIX, /**< 2336 byte block length */
MODE2_RAW /**< 2352 byte block length */
AUDIO, /**< 2352 byte block length */
MODE1, /**< 2048 byte block length */
MODE1_RAW, /**< 2352 byte block length */
MODE2, /**< 2336 byte block length */
MODE2_FORM1, /**< 2048 byte block length */
MODE2_FORM2, /**< 2324 byte block length */
MODE2_FORM_MIX, /**< 2336 byte block length */
MODE2_RAW /**< 2352 byte block length */
} trackmode_t;
/*!
@@ -130,7 +130,7 @@ extern "C" {
if not an audio track?
*/
track_flag_t cdio_get_track_copy_permit(const CdIo_t *p_cdio,
track_t i_track);
track_t i_track);
/*!
Get the format (audio, mode2, mode1) of track.
@@ -228,13 +228,13 @@ extern "C" {
@return true if things worked or false if there is no track entry.
*/
bool cdio_get_track_msf(const CdIo_t *p_cdio, track_t i_track,
/*out*/ msf_t *msf);
/*out*/ msf_t *msf);
/*! Get linear preemphasis status on an audio track
This is not meaningful if not an audio track?
*/
track_flag_t cdio_get_track_preemphasis(const CdIo_t *p_cdio,
track_t i_track);
track_t i_track);
/*!
Get the number of sectors between this track an the next. This
@@ -250,5 +250,4 @@ extern "C" {
}
#endif /* __cplusplus */
#endif /* __CDIO_TRACK_H__ */
#endif /* CDIO_TRACK_H_ */

View File

@@ -22,8 +22,8 @@
*/
#ifndef __CDIO_TYPES_H__
#define __CDIO_TYPES_H__
#ifndef CDIO_TYPES_H_
#define CDIO_TYPES_H_
#ifdef __cplusplus
extern "C" {
@@ -265,10 +265,10 @@ typedef uint8_t ubyte;
typedef int32_t lsn_t;
/* Address in either MSF or logical format */
union cdio_cdrom_addr
union cdio_cdrom_addr
{
msf_t msf;
lba_t lba;
msf_t msf;
lba_t lba;
};
/*! The type of a track number 0..99. */
@@ -325,20 +325,20 @@ typedef uint8_t ubyte;
Q Sub-channel Control Field (4.2.3.3)
*/
typedef enum {
CDIO_TRACK_FLAG_NONE = 0x00, /**< no flags set */
CDIO_TRACK_FLAG_PRE_EMPHASIS = 0x01, /**< audio track recorded with
CDIO_TRACK_FLAG_NONE = 0x00, /**< no flags set */
CDIO_TRACK_FLAG_PRE_EMPHASIS = 0x01, /**< audio track recorded with
pre-emphasis */
CDIO_TRACK_FLAG_COPY_PERMITTED = 0x02, /**< digital copy permitted */
CDIO_TRACK_FLAG_DATA = 0x04, /**< data track */
CDIO_TRACK_FLAG_COPY_PERMITTED = 0x02, /**< digital copy permitted */
CDIO_TRACK_FLAG_DATA = 0x04, /**< data track */
CDIO_TRACK_FLAG_FOUR_CHANNEL_AUDIO = 0x08, /**< 4 audio channels */
CDIO_TRACK_FLAG_SCMS = 0x10 /**< SCMS (5.29.2.7) */
CDIO_TRACK_FLAG_SCMS = 0x10 /**< SCMS (5.29.2.7) */
} cdio_track_flag;
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __CDIO_TYPES_H__ */
#endif /* CDIO_TYPES_H_ */
/*

View File

@@ -99,6 +99,7 @@ bool cdio_charset_to_utf8(const char *src, size_t src_len, cdio_utf8_t **dst,
*/
wchar_t* cdio_utf8_to_wchar(const char* str);
#include <stdio.h> /* for FILE */
/** \brief Provides an UTF-8 compliant version of fopen for Windows
* The parameters and return value are the same as fopen().
*/

View File

@@ -17,8 +17,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __CDIO_UTIL_H__
#define __CDIO_UTIL_H__
#ifndef CDIO_UTIL_H_
#define CDIO_UTIL_H_
/*!
\file util.h
@@ -129,7 +129,7 @@ char *cdio_realpath (const char *psz_src, char *psz_dst);
}
#endif
#endif /* __CDIO_UTIL_H__ */
#endif /* CDIO_UTIL_H_ */
/*

View File

@@ -1,7 +1,6 @@
/*
$Id: xa.h,v 1.19 2008/03/25 15:59:10 karl Exp $
Copyright (C) 2003, 2004, 2005, 2006, 2008 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2003, 2004, 2005, 2006, 2008, 2012
Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
See also iso9660.h by Eric Youngdale (1993) and in cdrtools. These are
@@ -31,8 +30,8 @@
*/
#ifndef __CDIO_XA_H__
#define __CDIO_XA_H__
#ifndef CDIO_XA_H_
#define CDIO_XA_H_
#ifdef __cplusplus
extern "C" {
@@ -153,7 +152,7 @@ iso9660_get_xa_attr_str (uint16_t xa_attr);
*/
iso9660_xa_t *
iso9660_xa_init (iso9660_xa_t *_xa, uint16_t uid, uint16_t gid, uint16_t attr,
uint8_t filenum);
uint8_t filenum);
#ifdef __cplusplus
}
@@ -168,7 +167,7 @@ extern xa_misc_enum_t debugger_xa_misc_enum;
#endif /* __cplusplus */
#endif /* __CDIO_XA_H__ */
#endif /* CDIO_XA_H_ */
/*
* Local variables: