[iso] upgrade to libcdio latest

* This should fix #179
* Also bump rufus-next to v1.4.0
This commit is contained in:
Pete Batard 2013-10-14 00:31:20 +01:00
parent 3c438db3fd
commit cf3964c8a3
12 changed files with 644 additions and 625 deletions

20
configure vendored
View File

@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.68 for rufus 1.3.4.
# Generated by GNU Autoconf 2.68 for rufus 1.4.0.
#
# Report bugs to <https://github.com/pbatard/rufus/issues>.
#
@ -559,8 +559,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='rufus'
PACKAGE_TARNAME='rufus'
PACKAGE_VERSION='1.3.4'
PACKAGE_STRING='rufus 1.3.4'
PACKAGE_VERSION='1.4.0'
PACKAGE_STRING='rufus 1.4.0'
PACKAGE_BUGREPORT='https://github.com/pbatard/rufus/issues'
PACKAGE_URL='http://rufus.akeo.ie'
@ -1201,7 +1201,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures rufus 1.3.4 to adapt to many kinds of systems.
\`configure' configures rufus 1.4.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1267,7 +1267,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of rufus 1.3.4:";;
short | recursive ) echo "Configuration of rufus 1.4.0:";;
esac
cat <<\_ACEOF
@ -1355,7 +1355,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
rufus configure 1.3.4
rufus configure 1.4.0
generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
@ -1410,7 +1410,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by rufus $as_me 1.3.4, which was
It was created by rufus $as_me 1.4.0, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
@ -2225,7 +2225,7 @@ fi
# Define the identity of the package.
PACKAGE='rufus'
VERSION='1.3.4'
VERSION='1.4.0'
cat >>confdefs.h <<_ACEOF
@ -4067,7 +4067,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by rufus $as_me 1.3.4, which was
This file was extended by rufus $as_me 1.4.0, which was
generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -4121,7 +4121,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
rufus config.status 1.3.4
rufus config.status 1.4.0
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"

View File

@ -1,4 +1,4 @@
AC_INIT([rufus], [1.3.4], [https://github.com/pbatard/rufus/issues], [rufus], [http://rufus.akeo.ie])
AC_INIT([rufus], [1.4.0], [https://github.com/pbatard/rufus/issues], [rufus], [http://rufus.akeo.ie])
AM_INIT_AUTOMAKE([-Wno-portability foreign no-dist no-dependencies])
AC_CONFIG_SRCDIR([src/rufus.c])
AC_CONFIG_MACRO_DIR([m4])

View File

@ -1,7 +1,6 @@
/* -*- c -*-
Copyright (C) 2005, 2006, 2008, 2009, 2010, 2011, 2012 Rocky Bernstein
<rocky@gnu.org>
Copyright (C) 2005-2006, 2008-2013 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,7 +17,7 @@
*/
/**
* \file device.h
* \file device.h
*
* \brief C header for driver- or device-related libcdio
* calls. ("device" includes CD-image reading devices).
@ -37,25 +36,25 @@ extern "C" {
typedef uint32_t cdio_drive_read_cap_t;
typedef uint32_t cdio_drive_write_cap_t;
typedef uint32_t cdio_drive_misc_cap_t;
/**
\brief Drive capability bits returned by cdio_get_drive_cap()
NOTE: Setting a bit here means the presence of a capability.
*/
*/
/** Miscellaneous capabilities. */
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
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_SELECT_SPEED = 0x00008, /**< programmable speed */
CDIO_DRIVE_CAP_MISC_SELECT_DISC = 0x00010, /**< select disc from
CDIO_DRIVE_CAP_MISC_SELECT_DISC = 0x00010, /**< select disc from
juke-box */
CDIO_DRIVE_CAP_MISC_MULTI_SESSION= 0x00020, /**< read sessions>1 */
CDIO_DRIVE_CAP_MISC_MEDIA_CHANGED= 0x00080, /**< media changed */
@ -99,28 +98,28 @@ extern "C" {
(CDIO_DRIVE_CAP_WRITE_CD_R | CDIO_DRIVE_CAP_WRITE_CD_RW),
/**< Has some sort of CD writer ability */
CDIO_DRIVE_CAP_WRITE_DVD =
(CDIO_DRIVE_CAP_WRITE_DVD_R | CDIO_DRIVE_CAP_WRITE_DVD_PR
| CDIO_DRIVE_CAP_WRITE_DVD_RAM | CDIO_DRIVE_CAP_WRITE_DVD_RW
CDIO_DRIVE_CAP_WRITE_DVD =
(CDIO_DRIVE_CAP_WRITE_DVD_R | CDIO_DRIVE_CAP_WRITE_DVD_PR
| CDIO_DRIVE_CAP_WRITE_DVD_RAM | CDIO_DRIVE_CAP_WRITE_DVD_RW
| CDIO_DRIVE_CAP_WRITE_DVD_RPW ),
/**< Has some sort of DVD writer ability */
CDIO_DRIVE_CAP_WRITE =
CDIO_DRIVE_CAP_WRITE =
(CDIO_DRIVE_CAP_WRITE_CD | CDIO_DRIVE_CAP_WRITE_DVD)
/**< Has some sort of DVD or CD writing ability */
} cdio_drive_cap_write_t;
/** Size of fields returned by an INQUIRY command */
typedef enum {
CDIO_MMC_HW_VENDOR_LEN = 8, /**< length of vendor field */
CDIO_MMC_HW_MODEL_LEN = 16, /**< length of model field */
CDIO_MMC_HW_REVISION_LEN = 4 /**< length of revision field */
} cdio_mmc_hw_len_t;
/** \brief Structure to return CD vendor, model, and revision-level
strings obtained via the INQUIRY command */
typedef struct cdio_hwinfo
typedef struct cdio_hwinfo
{
char psz_vendor [CDIO_MMC_HW_VENDOR_LEN+1];
char psz_model [CDIO_MMC_HW_MODEL_LEN+1];
@ -135,7 +134,7 @@ extern "C" {
CDIO_SRC_IS_SCSI_MASK = 0x0004, /**< Read source SCSI device. */
CDIO_SRC_IS_NATIVE_MASK = 0x0008
} cdio_src_category_mask_t;
/**
* The driver_id_t enumerations may be used to tag a specific driver
@ -147,10 +146,10 @@ extern "C" {
* cdio_drivers and cdio_device_drivers arrays.
*
* NOTE: IF YOU MODIFY ENUM MAKE SURE INITIALIZATION IN CDIO.C AGREES.
*
*
*/
typedef enum {
DRIVER_UNKNOWN, /**< Used as input when we don't care what kind
DRIVER_UNKNOWN, /**< Used as input when we don't care what kind
of driver to use. */
DRIVER_AIX, /**< AIX driver */
DRIVER_BSDI, /**< BSDI driver */
@ -160,7 +159,7 @@ extern "C" {
DRIVER_SOLARIS, /**< Sun Solaris Driver */
DRIVER_OS2, /**< IBM OS/2 Driver */
DRIVER_OSX, /**< Apple OSX Driver */
DRIVER_WIN32, /**< Microsoft Windows Driver. Includes ASPI and
DRIVER_WIN32, /**< Microsoft Windows Driver. Includes ASPI and
ioctl access. */
DRIVER_CDRDAO, /**< cdrdao format CD image. This is listed
before BIN/CUE, to make the code prefer cdrdao
@ -184,14 +183,14 @@ extern "C" {
*/
extern const driver_id_t cdio_device_drivers[];
/**
/**
There will generally be only one hardware for a given
build/platform from the list above. You can use the variable
below to determine which you've got. If the build doesn't make an
hardware driver, then the value will be DRIVER_UNKNOWN.
*/
extern const driver_id_t cdio_os_driver;
/**
Those are deprecated; use cdio_drivers or cdio_device_drivers to
@ -246,15 +245,15 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
} driver_return_code_t;
/**
Close media tray in CD drive if there is a routine to do so.
Close media tray in CD drive if there is a routine to do so.
@param psz_drive the name of CD-ROM to be closed. If NULL, we will
use the default device.
@param p_driver_id is the driver to be used or that got used if
it was DRIVER_UNKNOWN or DRIVER_DEVICE; If this is NULL, we won't
report back the driver used.
*/
driver_return_code_t cdio_close_tray (const char *psz_drive,
driver_return_code_t cdio_close_tray (const char *psz_drive,
/*in/out*/ driver_id_t *p_driver_id);
/**
@ -262,9 +261,9 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
@return the string information about drc
*/
const char *cdio_driver_errmsg(driver_return_code_t drc);
/**
Eject media in CD drive if there is a routine to do so.
Eject media in CD drive if there is a routine to do so.
@param p_cdio the CD object to be acted upon.
If the CD is ejected *p_cdio is free'd and p_cdio set to NULL.
@ -272,7 +271,7 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
driver_return_code_t cdio_eject_media (CdIo_t **p_cdio);
/**
Eject media in CD drive if there is a routine to do so.
Eject media in CD drive if there is a routine to do so.
@param psz_drive the name of the device to be acted upon.
If NULL is given as the drive, we'll use the default driver device.
@ -282,7 +281,7 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
/**
Free device list returned by cdio_get_devices or
cdio_get_devices_with_cap.
@param device_list list returned by cdio_get_devices or
cdio_get_devices_with_cap
@ -293,9 +292,9 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
/**
Get the default CD device.
if p_cdio is NULL (we haven't initialized a specific device driver),
if p_cdio is NULL (we haven't initialized a specific device driver),
then find a suitable one and return the default device for that.
@param p_cdio the CD object queried
@return a string containing the default CD device or NULL is
if we couldn't get a default device.
@ -310,7 +309,7 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
Return a string containing the default CD device if none is specified.
if p_driver_id is DRIVER_UNKNOWN or DRIVER_DEVICE
then find a suitable one set the default device for that.
NULL is returned if we couldn't get a default device.
*/
char * cdio_get_default_device_driver (/*in/out*/ driver_id_t *p_driver_id);
@ -319,7 +318,7 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
devices for a driver, give that device. If you want hardware
devices, give DRIVER_DEVICE and if you want all possible devices,
image drivers and hardware drivers give DRIVER_UNKNOWN.
NULL is returned if we couldn't return a list of devices.
In some situations of drivers or OS's we can't find a CD device if
@ -335,30 +334,30 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
Capabilities have two parts to them, a "filesystem" part and an
"analysis" part.
The filesystem part is mutually exclusive. For example either the
filesystem is at most one of the High-Sierra, UFS, or HFS,
ISO9660, fileystems. Valid combinations of say HFS and ISO9660
are specified as a separate "filesystem".
Capabilities on the other hand are not mutually exclusive. For
example a filesystem may have none, either, or both of the XA or
Rock-Ridge extension properties.
If "b_any" is set false then every capability listed in the
analysis portion of capabilities (i.e. not the basic filesystem)
must be satisified. If no analysis capabilities are specified,
that's a match.
If "b_any" is set true, then if any of the analysis capabilities
matches, we call that a success.
matches, we call that a success.
In either case, in the filesystem portion different filesystem
either specify 0 to match any filesystem or the specific
filesystem type.
To find a CD-drive of any type, use the mask CDIO_FS_MATCH_ALL.
@return the array of device names or NULL if we couldn't get a
default device. It is also possible to return a non NULL but
after dereferencing the the value is NULL. This also means nothing
@ -374,7 +373,7 @@ 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,
cdio_fs_anal_t capabilities,
bool b_any,
/*out*/ driver_id_t *p_driver_id);
@ -385,33 +384,33 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
afterwards. Giving the driver back facilitates this, and speeds
things up for libcdio as well.
*/
char ** cdio_get_devices_ret (/*in/out*/ driver_id_t *p_driver_id);
/**
Get the what kind of device we've got.
@param p_cdio the CD object queried
@param p_read_cap pointer to return read capabilities
@param p_write_cap pointer to return write capabilities
@param p_misc_cap pointer to return miscellaneous other capabilities
In some situations of drivers or OS's we can't find a CD device if
there is no media in it. In this situation capabilities will show up as
there is no media in it. In this situation capabilities will show up as
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);
/**
Get the drive capabilities for a specified device.
Return a list of device capabilities.
In some situations of drivers or OS's we can't find a CD device if
there is no media in it. In this situation capabilities will show up as
there is no media in it. In this situation capabilities will show up as
NULL even though there isa hardware CD-ROM.
*/
void cdio_get_drive_cap_dev (const char *device,
@ -421,33 +420,41 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
/**
Get a string containing the name of the driver in use.
@return a string with driver name or NULL if CdIo_t is NULL (we
haven't initialized a specific device.
*/
const char * cdio_get_driver_name (const CdIo_t *p_cdio);
/**
Get the driver id.
if CdIo_t is NULL (we haven't initialized a specific device driver),
Return a string containing the name of the driver in use from the driver_id.
if CdIo is NULL (we haven't initialized a specific device driver),
then return NULL.
*/
const char * cdio_get_driver_name_from_id (driver_id_t driver_id);
/**
Get the driver id.
if CdIo_t is NULL (we haven't initialized a specific device driver),
then return DRIVER_UNKNOWN.
@return the driver id..
*/
driver_id_t cdio_get_driver_id (const CdIo_t *p_cdio);
/**
/**
Get the CD-ROM hardware info via a SCSI MMC INQUIRY command.
False is returned if we had an error getting the information.
*/
bool cdio_get_hwinfo ( const CdIo_t *p_cdio,
bool cdio_get_hwinfo ( const CdIo_t *p_cdio,
/*out*/ cdio_hwinfo_t *p_hw_info );
/**
Get the LSN of the first track of the last session of
on the CD.
@param p_cdio the CD object to be acted upon.
@param i_last_session pointer to the session number to be returned.
*/
@ -477,20 +484,20 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
void cdio_destroy (CdIo_t *p_cdio);
/**
Get a string decribing driver_id.
Get a string decribing driver_id.
@param driver_id the driver you want the description for
@return a string of driver description
*/
const char *cdio_driver_describe (driver_id_t driver_id);
/**
Sets up to read from place specified by psz_source and
driver_id. This or cdio_open_* should be called before using any
other routine, except cdio_init or any routine that accesses the
CD-ROM drive by name. cdio_open will call cdio_init, if that
hasn't been done previously.
@return the cdio object or NULL on error or no device. If NULL
is given as the source, we'll use the default driver device.
*/
@ -502,50 +509,50 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
other routine, except cdio_init or any routine that accesses the
CD-ROM drive by name. This will call cdio_init, if that hasn't
been done previously.
If NULL is given as the source, we'll use the default driver device.
@return the cdio object or NULL on error or no device.
*/
CdIo_t * cdio_open_am (const char *psz_source,
CdIo_t * cdio_open_am (const char *psz_source,
driver_id_t driver_id, const char *psz_access_mode);
/**
Set up BIN/CUE CD disk-image for reading. Source is the .bin or
Set up BIN/CUE CD disk-image for reading. Source is the .bin or
.cue file
@return the cdio object or NULL on error or no device.
*/
CdIo_t * cdio_open_bincue (const char *psz_cue_name);
/**
Set up BIN/CUE CD disk-image for reading. Source is the .bin or
Set up BIN/CUE CD disk-image for reading. Source is the .bin or
.cue file
@return the cdio object or NULL on error or no device..
*/
CdIo_t * cdio_open_am_bincue (const char *psz_cue_name,
CdIo_t * cdio_open_am_bincue (const char *psz_cue_name,
const char *psz_access_mode);
/**
Set up cdrdao CD disk-image for reading. Source is the .toc file
@return the cdio object or NULL on error or no device.
*/
CdIo_t * cdio_open_cdrdao (const char *psz_toc_name);
/**
Set up cdrdao CD disk-image for reading. Source is the .toc file
@return the cdio object or NULL on error or no device..
*/
CdIo_t * cdio_open_am_cdrdao (const char *psz_toc_name,
CdIo_t * cdio_open_am_cdrdao (const char *psz_toc_name,
const char *psz_access_mode);
/**
Return a string containing the default CUE file that would
be used when none is specified.
@return the cdio object or NULL on error or no device.
*/
char * cdio_get_default_device_bincue(void);
@ -564,8 +571,8 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
/**
Set up CD-ROM for reading. The device_name is
the some sort of device name.
@return the cdio object for subsequent operations.
@return the cdio object for subsequent operations.
NULL on error or there is no driver for a some sort of hardware CD-ROM.
*/
CdIo_t * cdio_open_cd (const char *device_name);
@ -573,8 +580,8 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
/**
Set up CD-ROM for reading. The device_name is
the some sort of device name.
@return the cdio object for subsequent operations.
@return the cdio object for subsequent operations.
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,
@ -582,8 +589,8 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
/**
CDRWIN BIN/CUE CD disc-image routines. Source is the .cue file
@return the cdio object for subsequent operations.
@return the cdio object for subsequent operations.
NULL on error.
*/
CdIo_t * cdio_open_cue (const char *cue_name);
@ -591,31 +598,31 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
/**
Set up CD-ROM for reading using the AIX driver. The device_name is
the some sort of device name.
@return the cdio object for subsequent operations.
@return the cdio object for subsequent operations.
NULL on error or there is no AIX driver.
@see cdio_open
*/
CdIo_t * cdio_open_am_aix (const char *psz_source,
const char *psz_access_mode);
/**
Set up CD-ROM for reading using the AIX driver. The device_name is
the some sort of device name.
@return the cdio object for subsequent operations.
@return the cdio object for subsequent operations.
NULL on error or there is no AIX driver.
@see cdio_open
*/
CdIo_t * cdio_open_aix (const char *psz_source);
/**
Return a string containing the default device name that the AIX
driver would use when none is specified.
@return the cdio object for subsequent operations.
@return the cdio object for subsequent operations.
NULL on error or there is no AIX driver.
@see cdio_open_cd, cdio_open
@ -631,36 +638,36 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
return NULL even though there may be a hardware CD-ROM.
*/
char **cdio_get_devices_aix(void);
/**
Set up CD-ROM for reading using the BSDI driver. The device_name
is the some sort of device name.
@param psz_source the name of the device to open
@return the cdio object for subsequent operations.
@return the cdio object for subsequent operations.
NULL on error or there is no BSDI driver.
@see cdio_open
*/
CdIo_t * cdio_open_bsdi (const char *psz_source);
/**
Set up CD-ROM for reading using the BSDI driver. The device_name
is the some sort of device name.
@return the cdio object for subsequent operations.
@return the cdio object for subsequent operations.
NULL on error or there is no BSDI driver.
@see cdio_open
*/
CdIo_t * cdio_open_am_bsdi (const char *psz_source,
const char *psz_access_mode);
/**
Return a string containing the default device name that the BSDI
driver would use when none is specified.
@return the cdio object for subsequent operations.
@return the cdio object for subsequent operations.
NULL on error or there is no BSDI driver.
@see cdio_open_cd, cdio_open
@ -676,7 +683,7 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
return NULL even though there may be a hardware CD-ROM.
*/
char **cdio_get_devices_bsdi(void);
/**
Set up CD-ROM for reading using the FreeBSD driver. The
device_name is the some sort of device name.
@ -686,7 +693,7 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
@see cdio_open_cd, cdio_open
*/
CdIo_t * cdio_open_freebsd (const char *paz_psz_source);
/**
Set up CD-ROM for reading using the FreeBSD driver. The
device_name is the some sort of device name.
@ -697,7 +704,7 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
*/
CdIo_t * cdio_open_am_freebsd (const char *psz_source,
const char *psz_access_mode);
/**
Return a string containing the default device name that the
FreeBSD driver would use when none is specified.
@ -711,12 +718,12 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
driver can find.
*/
char **cdio_get_devices_freebsd(void);
/**
Set up CD-ROM for reading using the GNU/Linux driver. The
device_name is the some sort of device name.
@return the cdio object for subsequent operations.
@return the cdio object for subsequent operations.
NULL on error or there is no GNU/Linux driver.
In some situations of drivers or OS's we can't find a CD device if
@ -729,7 +736,7 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
Set up CD-ROM for reading using the GNU/Linux driver. The
device_name is the some sort of device name.
@return the cdio object for subsequent operations.
@return the cdio object for subsequent operations.
NULL on error or there is no GNU/Linux driver.
*/
CdIo_t * cdio_open_am_linux (const char *psz_source,
@ -755,26 +762,26 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
driver can find.
*/
char **cdio_get_devices_linux(void);
/**
Set up CD-ROM for reading using the Sun Solaris driver. The
device_name is the some sort of device name.
@return the cdio object for subsequent operations.
@return the cdio object for subsequent operations.
NULL on error or there is no Solaris driver.
*/
CdIo_t * cdio_open_solaris (const char *psz_source);
/**
Set up CD-ROM for reading using the Sun Solaris driver. The
device_name is the some sort of device name.
@return the cdio object for subsequent operations.
@return the cdio object for subsequent operations.
NULL on error or there is no Solaris driver.
*/
CdIo_t * cdio_open_am_solaris (const char *psz_source,
CdIo_t * cdio_open_am_solaris (const char *psz_source,
const char *psz_access_mode);
/**
Return a string containing the default device name that the
Solaris driver would use when none is specified. A scan is made
@ -789,13 +796,13 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
@see cdio_open_cd, cdio_open
*/
char * cdio_get_default_device_solaris(void);
/**
Return a list of all of the CD-ROM devices that the Solaris
driver can find.
*/
char **cdio_get_devices_solaris(void);
/**
Set up CD-ROM for reading using the Apple OSX driver. The
device_name is the some sort of device name.
@ -831,13 +838,13 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
NULL even though there may be a hardware CD-ROM.
*/
char * cdio_get_default_device_osx(void);
/**
Return a list of all of the CD-ROM devices that the OSX driver
can find.
*/
char **cdio_get_devices_osx(void);
/**
Set up CD-ROM for reading using the Microsoft Windows driver. The
device_name is the some sort of device name.
@ -847,7 +854,7 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
NULL even though there may be a hardware CD-ROM.
*/
CdIo_t * cdio_open_win32 (const char *psz_source);
/**
Set up CD-ROM for reading using the Microsoft Windows driver. The
device_name is the some sort of device name.
@ -856,9 +863,9 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
*/
CdIo_t * cdio_open_am_win32 (const char *psz_source,
const char *psz_access_mode);
/**
Return a string containing the default device name that the
Return a string containing the default device name that the
Win32 driver would use when none is specified. A scan is made
for CD-ROM drives with CDs in them.
@ -871,7 +878,7 @@ LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use
char * cdio_get_default_device_win32(void);
char **cdio_get_devices_win32(void);
/**
Set up CD-ROM for reading using the IBM OS/2 driver. The
device_name is the some sort of device name.
@ -918,19 +925,19 @@ Return a list of all of the CD-ROM devices that the OS/2 driver
Set up CD-ROM for reading using the Nero driver. The device_name
is the some sort of device name.
@return true on success; NULL on error or there is no Nero driver.
@return true on success; NULL on error or there is no Nero driver.
*/
CdIo_t * cdio_open_nrg (const char *psz_source);
/**
Set up CD-ROM for reading using the Nero driver. The device_name
is the some sort of device name.
@return true on success; NULL on error or there is no Nero 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);
/**
Get a string containing the default device name that the NRG
driver would use when none is specified. A scan is made for NRG
@ -946,21 +953,21 @@ Return a list of all of the CD-ROM devices that the OS/2 driver
/**
Determine if bin_name is the bin file part of a CDRWIN CD disk image.
@param bin_name location of presumed CDRWIN bin image file.
@return the corresponding CUE file if bin_name is a BIN file or
NULL if not a BIN file.
*/
char *cdio_is_binfile(const char *bin_name);
/**
Determine if cue_name is the cue sheet for a CDRWIN CD disk image.
@return corresponding BIN file if cue_name is a CDRWIN cue file or
NULL if not a CUE file.
*/
char *cdio_is_cuefile(const char *cue_name);
/**
Determine if psg_nrg is a Nero CD disc image.
@ -969,36 +976,36 @@ Return a list of all of the CD-ROM devices that the OS/2 driver
if not a NRG image.
*/
bool cdio_is_nrg(const char *psz_nrg);
/**
Determine if psz_toc is a TOC file for a cdrdao CD disc image.
@param psz_toc location of presumed TOC image file.
@return true if toc_name is a cdrdao TOC file or false
if not a TOC file.
*/
bool cdio_is_tocfile(const char *psz_toc);
/**
Determine if psz_source refers to a real hardware CD-ROM.
@param psz_source location name of object
@param driver_id driver for reading object. Use DRIVER_UNKNOWN if you
don't know what driver to use.
@return true if psz_source is a device; If false is returned we
could have a CD disk image.
could have a CD disk image.
*/
bool cdio_is_device(const char *psz_source, driver_id_t driver_id);
/**
Set the blocksize for subsequent reads.
Set the blocksize for subsequent reads.
*/
driver_return_code_t cdio_set_blocksize ( const CdIo_t *p_cdio,
driver_return_code_t cdio_set_blocksize ( const CdIo_t *p_cdio,
int i_blocksize );
/**
Set the drive speed.
Set the drive speed.
@param p_cdio CD structure set by cdio_open().
@param i_drive_speed speed in CD-ROM speed units. Note this not
@ -1012,12 +1019,12 @@ 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,
driver_return_code_t cdio_set_speed ( const CdIo_t *p_cdio,
int i_drive_speed );
/**
Get the value associatied with key.
Get the value associatied with key.
@param p_cdio the CD object queried
@param key the key to retrieve
@return the value associatd with "key" or NULL if p_cdio is NULL
@ -1027,19 +1034,19 @@ Return a list of all of the CD-ROM devices that the OS/2 driver
/**
Set the arg "key" with "value" in "p_cdio".
@param p_cdio the CD object to set
@param key the key to set
@param value the value to assocaiate with key
*/
driver_return_code_t cdio_set_arg (CdIo_t *p_cdio, const char key[],
driver_return_code_t cdio_set_arg (CdIo_t *p_cdio, const char key[],
const char value[]);
/**
Initialize CD Reading and control routines. Should be called first.
*/
bool cdio_init(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -16,9 +16,9 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/** \file logging.h
/** \file logging.h
* \brief Header to control logging and level of detail of output.
*
*
*/
#ifndef CDIO_LOGGING_H_
@ -35,7 +35,7 @@ extern "C" {
*/
typedef enum {
CDIO_LOG_DEBUG = 1, /**< Debug-level messages - helps debug what's up. */
CDIO_LOG_INFO, /**< Informational - indicates perhaps something of
CDIO_LOG_INFO, /**< Informational - indicates perhaps something of
interest. */
CDIO_LOG_WARN, /**< Warning conditions - something that looks funny. */
CDIO_LOG_ERROR, /**< Error conditions - may terminate program. */
@ -43,7 +43,7 @@ typedef enum {
} cdio_log_level_t;
/**
* The place to save the preference concerning how much verbosity
* The place to save the preference concerning how much verbosity
* is desired. This is used by the internal default log handler, but
* it could be use by applications which provide their own log handler.
*/
@ -60,9 +60,17 @@ extern cdio_log_level_t cdio_loglevel_default;
* @param level The log level.
* @param message The log message.
*/
typedef void (*cdio_log_handler_t) (cdio_log_level_t level,
typedef void (*cdio_log_handler_t) (cdio_log_level_t level,
const char message[]);
/**
* The initial or default log handler in effect.
*
* @param level The log level.
* @param message The log message.
*/
extern void cdio_default_log_handler(cdio_log_level_t level, const char message[]);
/**
* Set a custom log handler for libcdio. The return value is the log
* handler being replaced. If the provided parameter is NULL, then
@ -87,7 +95,7 @@ cdio_log_handler_t cdio_log_set_handler (cdio_log_handler_t new_handler);
* @param format printf-style format string
* @param ... remaining arguments needed by format string
*/
void cdio_log (cdio_log_level_t level,
void cdio_log (cdio_log_level_t level,
const char format[], ...) GNUC_PRINTF(2, 3);
#if defined(__GNUC__)
/* See http://clang-analyzer.llvm.org/annotations.html#custom_assertions */
@ -129,7 +137,7 @@ void cdio_error (const char format[], ...) GNUC_PRINTF(1,2);
#endif /* CDIO_LOGGING_H_ */
/*
/*
* Local variables:
* c-file-style: "gnu"
* tab-width: 8

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2004, 2005, 2006, 2008, 2009, 2012
Copyright (C) 2004-2006, 2008-2009, 2012-2013
Rocky Bernstein <rocky@gnu.org>
This program is free software: you can redistribute it and/or modify
@ -32,7 +32,7 @@
#ifdef HAVE_STDBOOL_H
# include <stdbool.h>
#endif
#endif
#ifdef __cplusplus
extern "C" {
@ -49,7 +49,7 @@ extern "C" {
bool init; /**< True if structure has been initialized */
bool toc_init; /**< True if TOC read in */
bool b_cdtext_error; /**< True if trouble reading CD-Text */
int ioctls_debugged; /**< for debugging */
/* Only one of data_source or fd is used; fd is for CD-ROM
@ -61,16 +61,16 @@ extern "C" {
track_t i_first_track; /**< The starting track number. */
track_t i_tracks; /**< The number of tracks. */
uint8_t i_joliet_level; /**< 0 = no Joliet extensions.
uint8_t u_joliet_level; /**< 0 = no Joliet extensions.
1-3: Joliet level. */
iso9660_pvd_t pvd;
iso9660_svd_t svd;
iso9660_pvd_t pvd;
iso9660_svd_t svd;
CdIo_t *cdio; /**< a way to call general cdio routines. */
cdtext_t *cdtext; /**< CD-Text for disc. */
track_flags_t track_flags[CDIO_CD_MAX_TRACKS+1];
/* Memorized sense reply of the most recent SCSI command.
Recorded by driver implementations of cdio_funcs_t.run_mmc_cmd().
Recorded by driver implementations of cdio_funcs_t.run_mmc_cmd().
Read by API function mmc_get_cmd_scsi_sense().
*/
unsigned char scsi_mmc_sense[263]; /* See SPC-3 4.5.3 : 252 bytes legal
@ -91,29 +91,29 @@ extern "C" {
/*!
Bogus eject media when there is no ejectable media, e.g. a disk image
We always return 2. Should we also free resources?
We always return 2. Should we also free resources?
*/
driver_return_code_t cdio_generic_unimplemented_eject_media (void *p_env);
/*!
Set the blocksize for subsequent reads.
Set the blocksize for subsequent reads.
@return -2 since it's not implemented.
*/
driver_return_code_t
cdio_generic_unimplemented_set_blocksize (void *p_user_data,
driver_return_code_t
cdio_generic_unimplemented_set_blocksize (void *p_user_data,
uint16_t i_blocksize);
/*!
Set the drive speed.
@return -2 since it's not implemented.
*/
driver_return_code_t cdio_generic_unimplemented_set_speed (void *p_user_data,
int i_speed);
/*!
Release and free resources associated with cd.
Release and free resources associated with cd.
*/
void cdio_generic_free (void *p_env);
@ -124,31 +124,31 @@ extern "C" {
/*!
Reads into buf the next size bytes.
Returns -1 on error.
Returns -1 on error.
Is in fact libc's read().
*/
off_t cdio_generic_lseek (void *p_env, off_t offset, int whence);
/*!
Reads into buf the next size bytes.
Returns -1 on error.
Returns -1 on error.
Is in fact libc's read().
*/
ssize_t cdio_generic_read (void *p_env, void *p_buf, size_t size);
/*!
Reads a single form1 sector from cd device into data starting
from lsn. Returns 0 if no error.
from lsn. Returns 0 if no error.
*/
int cdio_generic_read_form1_sector (void * user_data, void *data,
int cdio_generic_read_form1_sector (void * user_data, void *data,
lsn_t lsn);
/*!
Release and free resources associated with stream or disk image.
*/
void cdio_generic_stdio_free (void *env);
/*!
/*!
Return true if source_name could be a device containing a CD-ROM on
Win32
*/
@ -160,22 +160,22 @@ extern "C" {
*/
bool cdio_is_device_os2(const char *source_name);
/*!
/*!
Return true if source_name could be a device containing a CD-ROM on
most Unix servers with block and character devices.
*/
bool cdio_is_device_generic(const char *source_name);
/*!
/*!
Like above, but don't give a warning device doesn't exist.
*/
bool cdio_is_device_quiet_generic(const char *source_name);
/*!
/*!
Get cdtext information for a CdIo object .
@param obj the CD object that may contain CD-TEXT information.
@return the CD-TEXT object or NULL if obj is NULL
or CD-TEXT information does not exist.
@ -183,7 +183,7 @@ extern "C" {
cdtext_t *get_cdtext_generic (void *p_user_data);
/*!
Return the number of of the first track.
Return the number of of the first track.
CDIO_INVALID_TRACK is returned on error.
*/
track_t get_first_track_num_generic(void *p_user_data);
@ -192,51 +192,51 @@ extern "C" {
Return the number of tracks in the current medium.
*/
track_t get_num_tracks_generic(void *p_user_data);
/*!
/*!
Get disc type associated with cd object.
*/
discmode_t get_discmode_generic (void *p_user_data );
/*!
/*!
Same as above but only handles CD cases
*/
discmode_t get_discmode_cd_generic (void *p_user_data );
/*! Return 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.
*/
int get_track_channels_generic(const void *p_user_data, track_t i_track);
/*! Return 1 if copy is permitted on the track, 0 if not, or -1 for error.
Is this meaningful if not an audio track?
*/
track_flag_t get_track_copy_permit_generic(void *p_user_data,
track_flag_t get_track_copy_permit_generic(void *p_user_data,
track_t i_track);
/*! Return 1 if track has pre-emphasis, 0 if not, or -1 for error.
Is this meaningful if not an audio track?
pre-emphasis is a non linear frequency response.
*/
track_flag_t get_track_preemphasis_generic(const void *p_user_data,
track_flag_t get_track_preemphasis_generic(const void *p_user_data,
track_t i_track);
/*!
Read cdtext information for a CdIo object .
return true on success, false on error or CD-Text information does
not exist.
*/
uint8_t * read_cdtext_generic (void *p_env);
void set_track_flags(track_flags_t *p_track_flag, uint8_t flag);
/*! Read mode 1 or mode2 sectors (using cooked mode). */
driver_return_code_t read_data_sectors_generic (void *p_user_data,
void *p_buf, lsn_t i_lsn,
uint16_t i_blocksize,
driver_return_code_t read_data_sectors_generic (void *p_user_data,
void *p_buf, lsn_t i_lsn,
uint16_t i_blocksize,
uint32_t i_blocks);
#ifdef __cplusplus
}
@ -245,7 +245,7 @@ extern "C" {
#endif /* CDIO_DRIVER_GENERIC_H_ */
/*
/*
* Local variables:
* c-file-style: "gnu"
* tab-width: 8

View File

@ -38,8 +38,8 @@
cdio_log_level_t cdio_loglevel_default = CDIO_LOG_WARN;
static void
default_cdio_log_handler(cdio_log_level_t level, const char message[])
extern void
cdio_default_log_handler(cdio_log_level_t level, const char message[])
{
switch (level)
{
@ -80,7 +80,7 @@ default_cdio_log_handler(cdio_log_level_t level, const char message[])
fflush (stdout);
}
static cdio_log_handler_t _handler = default_cdio_log_handler;
cdio_log_handler_t _handler = cdio_default_log_handler;
cdio_log_handler_t
cdio_log_set_handler(cdio_log_handler_t new_handler)
@ -102,7 +102,7 @@ cdio_logv(cdio_log_level_t level, const char format[], va_list args)
cdio_assert_not_reached ();
in_recursion = 1;
vsnprintf(buf, sizeof(buf)-1, format, args);
_handler(level, buf);
@ -127,7 +127,7 @@ cdio_ ## level (const char format[], ...) \
va_start (args, format); \
cdio_logv (CDIO_LOG_ ## LEVEL, format, args); \
va_end (args); \
}
}
CDIO_LOG_TEMPLATE(debug, DEBUG)
CDIO_LOG_TEMPLATE(info, INFO)
@ -137,7 +137,7 @@ CDIO_LOG_TEMPLATE(error, ERROR)
#undef CDIO_LOG_TEMPLATE
/*
/*
* Local variables:
* c-file-style: "gnu"
* tab-width: 8

View File

@ -14,7 +14,7 @@
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 read.h
/** \file read.h
*
* \brief sector (block, frame)-related libcdio routines.
*/
@ -27,7 +27,7 @@
#ifdef HAVE_STDBOOL_H
# include <stdbool.h>
#endif
#endif
#include <cdio/cdio.h>
#include <cdio/logging.h>
@ -41,7 +41,7 @@
#define check_read_parms(p_cdio, p_buf, i_lsn) \
if (!p_cdio) return DRIVER_OP_UNINIT; \
if (!p_buf || CDIO_INVALID_LSN == i_lsn) \
return DRIVER_OP_ERROR;
return DRIVER_OP_ERROR;
#define check_lsn(i_lsn) \
check_read_parms(p_cdio, p_buf, i_lsn); \
@ -76,14 +76,14 @@
/*!
lseek - reposition read/write file offset
Returns (off_t) -1 on error.
Returns (off_t) -1 on error.
Similar to (if not the same as) libc's lseek()
*/
off_t
cdio_lseek (const CdIo_t *p_cdio, off_t offset, int whence)
{
if (!p_cdio) return DRIVER_OP_UNINIT;
if (p_cdio->op.lseek)
return (p_cdio->op.lseek) (p_cdio->env, offset, whence);
return DRIVER_OP_UNSUPPORTED;
@ -99,13 +99,13 @@ cdio_lseek (const CdIo_t *p_cdio, off_t offset, int whence)
this location can store at least i_size bytes.
@param i_size number of bytes to read
@return (ssize_t) -1 on error.
@return (ssize_t) -1 on error.
*/
ssize_t
cdio_read (const CdIo_t *p_cdio, void *p_buf, size_t i_size)
{
if (!p_cdio) return DRIVER_OP_UNINIT;
if (p_cdio->op.read)
return (p_cdio->op.read) (p_cdio->env, p_buf, i_size);
return DRIVER_OP_UNSUPPORTED;
@ -113,10 +113,10 @@ cdio_read (const CdIo_t *p_cdio, void *p_buf, size_t i_size)
/*!
Reads an audio sector from cd device into data starting
from lsn. Returns DRIVER_OP_SUCCESS if no error.
from lsn. Returns DRIVER_OP_SUCCESS if no error.
*/
driver_return_code_t
cdio_read_audio_sector (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn)
cdio_read_audio_sector (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn)
{
check_lsn(i_lsn);
if (p_cdio->op.read_audio_sectors)
@ -126,57 +126,64 @@ cdio_read_audio_sector (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn)
/*!
Reads audio sectors from cd device into data starting
from lsn. Returns DRIVER_OP_SUCCESS if no error.
from lsn. Returns DRIVER_OP_SUCCESS if no error.
*/
driver_return_code_t
cdio_read_audio_sectors (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn,
uint32_t i_blocks)
uint32_t i_blocks)
{
check_lsn_blocks(i_lsn, i_blocks);
if (0 == i_blocks) return DRIVER_OP_SUCCESS;
if (p_cdio->op.read_audio_sectors)
return (p_cdio->op.read_audio_sectors) (p_cdio->env, p_buf, i_lsn,
if (p_cdio->op.read_audio_sectors) {
cdio_debug("Reading audio sector(s) lsn %u for %d blocks",
i_lsn, i_blocks);
return (p_cdio->op.read_audio_sectors) (p_cdio->env, p_buf, i_lsn,
i_blocks);
}
return DRIVER_OP_UNSUPPORTED;
}
/*!
Reads an audio sector from cd device into data starting
from lsn. Returns DRIVER_OP_SUCCESS if no error.
from lsn. Returns DRIVER_OP_SUCCESS if no error.
*/
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)
uint16_t i_blocksize, uint32_t i_blocks)
{
check_lsn(i_lsn);
if (0 == i_blocks) return DRIVER_OP_SUCCESS;
if (p_cdio->op.read_data_sectors)
return p_cdio->op.read_data_sectors (p_cdio->env, p_buf, i_lsn,
if (p_cdio->op.read_data_sectors) {
cdio_debug("Reading data sector(s) lsn, %u blocksize %d, for %d blocks",
i_lsn, i_blocksize, i_blocks);
return p_cdio->op.read_data_sectors (p_cdio->env, p_buf, i_lsn,
i_blocksize, i_blocks);
}
return DRIVER_OP_UNSUPPORTED;
}
#ifndef SEEK_SET
#define SEEK_SET 0
#endif
#endif
/*!
Reads a single mode1 form1 or form2 sector from cd device
into data starting from lsn. Returns DRIVER_OP_SUCCESS if no error.
Reads a single mode1 form1 or form2 sector from cd device
into data starting from lsn. Returns DRIVER_OP_SUCCESS if no error.
*/
driver_return_code_t
cdio_read_mode1_sector (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn,
cdio_read_mode1_sector (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn,
bool b_form2)
{
uint32_t size = b_form2 ? M2RAW_SECTOR_SIZE : CDIO_CD_FRAMESIZE ;
check_lsn(i_lsn);
if (p_cdio->op.read_mode1_sector) {
cdio_debug("Reading mode 1 secto lsn %u", i_lsn);
return p_cdio->op.read_mode1_sector(p_cdio->env, p_buf, i_lsn, b_form2);
} else if (p_cdio->op.lseek && p_cdio->op.read) {
char buf[M2RAW_SECTOR_SIZE] = { 0, };
@ -186,23 +193,23 @@ cdio_read_mode1_sector (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn,
return -1;
memcpy (p_buf, buf, size);
return DRIVER_OP_SUCCESS;
}
}
return DRIVER_OP_UNSUPPORTED;
}
/*!
Reads mode 1 sectors
@param p_cdio object to read from
@param buf place to read data into
@param lsn sector to read
@param b_form2 true for reading mode 1 form 2 sectors or false for
@param b_form2 true for reading mode 1 form 2 sectors or false for
mode 1 form 1 sectors.
@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,
cdio_read_mode1_sectors (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn,
bool b_form2, uint32_t i_blocks)
{
check_lsn_blocks(i_lsn, i_blocks);
@ -217,15 +224,15 @@ cdio_read_mode1_sectors (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn,
/*!
Reads a mode 2 sector
@param p_cdio object to read from
@param buf place to read data into
@param lsn sector to read
@param b_form2 true for reading mode 2 form 2 sectors or false for
@param b_form2 true for reading mode 2 form 2 sectors or false for
mode 2 form 1 sectors.
*/
driver_return_code_t
cdio_read_mode2_sector (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn,
cdio_read_mode2_sector (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn,
bool b_form2)
{
check_lsn(i_lsn);
@ -240,35 +247,35 @@ cdio_read_mode2_sector (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn,
/*!
Reads mode 2 sectors
@param p_cdio object to read from
@param buf place to read data into
@param lsn sector to read
@param b_form2 true for reading mode2 form 2 sectors or false for
@param b_form2 true for reading mode2 form 2 sectors or false for
mode 2 form 1 sectors.
@param i_blocks number of sectors to read
*/
driver_return_code_t
cdio_read_mode2_sectors (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn,
cdio_read_mode2_sectors (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn,
bool b_form2, uint32_t i_blocks)
{
check_lsn_blocks(i_lsn, i_blocks);
if (0 == i_blocks) return DRIVER_OP_SUCCESS;
if (p_cdio->op.read_mode2_sectors)
if (p_cdio->op.read_mode2_sectors)
return (p_cdio->op.read_mode2_sectors) (p_cdio->env, p_buf, i_lsn,
b_form2, i_blocks);
return DRIVER_OP_UNSUPPORTED;
}
/** 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,
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)
{
return cdio_read_sectors(p_cdio, p_buf, i_lsn, read_mode, 1);
@ -276,7 +283,7 @@ cdio_read_sector(const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn,
/*!
Reads a number of sectors (AKA blocks).
@param p_buf place to read data into. The caller should make sure
this location is large enough. See below for size information.
@param read_mode the kind of "mode" to use in reading.
@ -284,14 +291,14 @@ cdio_read_sector(const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn,
@param i_blocks number of sectors to read
@return DRIVER_OP_SUCCESS (0) if no error, other (negative) enumerations
are returned on error.
If read_mode is CDIO_MODE_AUDIO,
*p_buf should hold at least CDIO_FRAMESIZE_RAW * i_blocks bytes.
If read_mode is CDIO_MODE_DATA,
*p_buf should hold at least i_blocks times either ISO_BLOCKSIZE,
M1RAW_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,
*p_buf should hold at least i_blocks times either ISO_BLOCKSIZE,
M1RAW_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
which is M2RAW_SECTOR_SIZE.
@ -303,8 +310,8 @@ cdio_read_sector(const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn,
*/
driver_return_code_t
cdio_read_sectors(const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn,
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)
{
switch(read_mode) {
@ -320,10 +327,10 @@ cdio_read_sectors(const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn,
return cdio_read_mode2_sectors (p_cdio, p_buf, i_lsn, true, i_blocks);
}
/* Can't happen. Just to shut up gcc. */
return DRIVER_OP_ERROR;
return DRIVER_OP_ERROR;
}
/*
/*
* Local variables:
* c-file-style: "gnu"
* tab-width: 8

View File

@ -144,7 +144,7 @@ cdio_get_joliet_level(const CdIo_t *p_cdio)
{
const generic_img_private_t *p_env
= (generic_img_private_t *) (p_cdio->env);
return p_env->i_joliet_level;
return p_env->u_joliet_level;
}
}

View File

@ -310,7 +310,7 @@ bool cdio_charset_from_utf8(cdio_utf8_t * src, char ** dst,
}
bool cdio_charset_to_utf8(const char *src, size_t src_len, cdio_utf8_t **dst,
const char * src_charset)
const char *src_charset)
{
wchar_t* le_src;
int i;

View File

@ -1,6 +1,5 @@
/*
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2003-2009, 2013 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
@ -19,7 +18,7 @@
/*! String inside frame which identifies an ISO 9660 filesystem. This
string is the "id" field of an iso9660_pvd_t or an iso9660_svd_t.
Note should come *before* #include <cdio/iso9660.h> which does
Note should come *before* #include <cdio/iso9660.h> which does
a #define of this name.
*/
const char ISO_STANDARD_ID[] = {'C', 'D', '0', '0', '1'};
@ -77,7 +76,7 @@ timegm(struct tm *tm)
{
time_t ret;
char *tz;
tz = getenv("TZ");
setenv("TZ", "UTC", 1);
tzset();
@ -158,11 +157,11 @@ strip_trail (const char str[], size_t n)
}
static void
pathtable_get_size_and_entries(const void *pt, unsigned int *size,
pathtable_get_size_and_entries(const void *pt, unsigned int *size,
unsigned int *entries);
/*!
Get time structure from structure in an ISO 9660 directory index
Get time structure from structure in an ISO 9660 directory index
record. Even though tm_wday and tm_yday fields are not explicitly in
idr_date, the are calculated from the other fields.
@ -175,10 +174,10 @@ iso9660_get_dtime (const iso9660_dtime_t *idr_date, bool b_localtime,
{
if (!idr_date) return false;
/*
Section 9.1.5 of ECMA 119 says:
/*
Section 9.1.5 of ECMA 119 says:
If all seven numbers are zero, it shall mean that the date and
time are not specified.
time are not specified.
HACK: However we've seen it happen that everything except gmtoff
is zero and the expected date is the beginning of the epoch. So
@ -192,11 +191,11 @@ iso9660_get_dtime (const iso9660_dtime_t *idr_date, bool b_localtime,
time_t t = 0;
struct tm temp_tm;
localtime_r(&t, &temp_tm);
memcpy(p_tm, &temp_tm, sizeof(struct tm));
return true;
}
memset(p_tm, 0, sizeof(struct tm));
p_tm->tm_year = idr_date->dt_year;
@ -214,7 +213,7 @@ iso9660_get_dtime (const iso9660_dtime_t *idr_date, bool b_localtime,
struct tm temp_tm;
t = timegm(p_tm);
if (b_localtime)
localtime_r(&t, &temp_tm);
else
@ -227,7 +226,7 @@ iso9660_get_dtime (const iso9660_dtime_t *idr_date, bool b_localtime,
return true;
}
/*
/*
A note regarding the strange strtol() testing below as pointed out SMS.
From man strtol:
@ -253,13 +252,13 @@ iso9660_get_dtime (const iso9660_dtime_t *idr_date, bool b_localtime,
return false; \
p_tm->TM_FIELD = tmp + ADD_CONSTANT; \
}
/*!
Get "long" time in format used in ISO 9660 primary volume descriptor
from a Unix time structure.
from a Unix time structure.
*/
bool
iso9660_get_ltime (const iso9660_ltime_t *p_ldate,
iso9660_get_ltime (const iso9660_ltime_t *p_ldate,
/*out*/ struct tm *p_tm)
{
if (!p_tm) return false;
@ -297,10 +296,10 @@ iso9660_get_ltime (const iso9660_ltime_t *p_ldate,
/*!
Set time in format used in ISO 9660 directory index record
from a Unix time structure. timezone is given as an offset
correction in minutes.
correction in minutes.
*/
void
iso9660_set_dtime_with_timezone (const struct tm *p_tm,
iso9660_set_dtime_with_timezone (const struct tm *p_tm,
int time_zone,
/*out*/ iso9660_dtime_t *p_idr_date)
{
@ -320,12 +319,12 @@ iso9660_set_dtime_with_timezone (const struct tm *p_tm,
p_idr_date->dt_gmtoff = time_zone / 15;
if (p_idr_date->dt_gmtoff < -48 ) {
cdio_warn ("Converted ISO 9660 timezone %d is less than -48. Adjusted",
cdio_warn ("Converted ISO 9660 timezone %d is less than -48. Adjusted",
p_idr_date->dt_gmtoff);
p_idr_date->dt_gmtoff = -48;
} else if (p_idr_date->dt_gmtoff > 52) {
cdio_warn ("Converted ISO 9660 timezone %d is over 52. Adjusted",
cdio_warn ("Converted ISO 9660 timezone %d is over 52. Adjusted",
p_idr_date->dt_gmtoff);
p_idr_date->dt_gmtoff = 52;
}
@ -342,7 +341,7 @@ iso9660_set_dtime(const struct tm *p_tm, /*out*/ iso9660_dtime_t *p_idr_date)
#ifdef HAVE_TM_GMTOFF
/* Convert seconds to minutes */
time_zone = p_tm->tm_gmtoff / 60;
#else
#else
time_zone = (p_tm->tm_isdst > 0) ? -60 : 0;
#endif
}
@ -352,21 +351,21 @@ iso9660_set_dtime(const struct tm *p_tm, /*out*/ iso9660_dtime_t *p_idr_date)
/*!
Set "long" time in format used in ISO 9660 primary volume descriptor
from a Unix time structure. timezone is given as an offset
correction in minutes.
correction in minutes.
*/
void
iso9660_set_ltime_with_timezone(const struct tm *p_tm,
iso9660_set_ltime_with_timezone(const struct tm *p_tm,
int time_zone,
/*out*/ iso9660_ltime_t *pvd_date)
{
char *_pvd_date = (char *) pvd_date;
char *_pvd_date = (char *) pvd_date;
memset (_pvd_date, '0', 16);
pvd_date->lt_gmtoff = (iso712_t) 0; /* Start out with time zone GMT. */
if (!p_tm) return;
snprintf(_pvd_date, 17,
snprintf(_pvd_date, 17,
"%4.4d%2.2d%2.2d" "%2.2d%2.2d%2.2d" "%2.2d",
p_tm->tm_year + 1900, p_tm->tm_mon + 1, p_tm->tm_mday,
p_tm->tm_hour, p_tm->tm_min, p_tm->tm_sec,
@ -375,12 +374,12 @@ iso9660_set_ltime_with_timezone(const struct tm *p_tm,
/* Set time zone in 15-minute interval encoding. */
pvd_date->lt_gmtoff -= (time_zone / 15);
if (pvd_date->lt_gmtoff < -48 ) {
cdio_warn ("Converted ISO 9660 timezone %d is less than -48. Adjusted",
cdio_warn ("Converted ISO 9660 timezone %d is less than -48. Adjusted",
(int) pvd_date->lt_gmtoff);
pvd_date->lt_gmtoff = -48;
} else if (pvd_date->lt_gmtoff > 52) {
cdio_warn ("Converted ISO 9660 timezone %d is over 52. Adjusted",
cdio_warn ("Converted ISO 9660 timezone %d is over 52. Adjusted",
(int) pvd_date->lt_gmtoff);
pvd_date->lt_gmtoff = 52;
}
@ -416,7 +415,7 @@ iso9660_set_ltime(const struct tm *p_tm, /*out*/ iso9660_ltime_t *pvd_date)
@return length of the translated string is returned. It will be no greater
than the length of psz_oldname.
*/
int
int
iso9660_name_translate(const char *psz_oldname, char *psz_newname)
{
return iso9660_name_translate_ext(psz_oldname, psz_newname, 0);
@ -432,14 +431,14 @@ iso9660_name_translate(const char *psz_oldname, char *psz_newname)
@param psz_oldname the ISO-9660 filename to be translated.
@param psz_newname returned string. The caller allocates this and
it should be at least the size of psz_oldname.
@param i_joliet_level 0 if not using Joliet Extension. Otherwise the
@param u_joliet_level 0 if not using Joliet Extension. Otherwise the
Joliet level.
@return length of the translated string is returned. It will be no greater
than the length of psz_oldname.
*/
int
iso9660_name_translate_ext(const char *psz_oldname, char *psz_newname,
uint8_t i_joliet_level)
int
iso9660_name_translate_ext(const char *psz_oldname, char *psz_newname,
uint8_t u_joliet_level)
{
int len = strlen(psz_oldname);
int i;
@ -449,35 +448,35 @@ iso9660_name_translate_ext(const char *psz_oldname, char *psz_newname,
unsigned char c = psz_oldname[i];
if (!c)
break;
/* Lower case, unless we have Joliet extensions. */
if (!i_joliet_level && isupper(c)) c = tolower(c);
if (!u_joliet_level && isupper(c)) c = tolower(c);
/* Drop trailing '.;1' (ISO 9660:1988 7.5.1 requires period) */
if (c == '.' && i == len - 3
if (c == '.' && i == len - 3
&& psz_oldname[i + 1] == ';' && psz_oldname[i + 2] == '1')
break;
/* Drop trailing ';1' */
if (c == ';' && i == len - 2 && psz_oldname[i + 1] == '1')
break;
/* Convert remaining ';' to '.' */
if (c == ';')
c = '.';
psz_newname[i] = c;
}
psz_newname[i] = '\0';
return i;
}
/*!
/*!
Pad string src with spaces to size len and copy this to dst. If
len is less than the length of src, dst will be truncated to the
first len characters of src.
src can also be scanned to see if it contains only ACHARs, DCHARs,
src can also be scanned to see if it contains only ACHARs, DCHARs,
7-bit ASCII chars depending on the enumeration _check.
In addition to getting changed, dst is the return value.
@ -503,7 +502,7 @@ iso9660_strncpy_pad(char dst[], const char src[], size_t len,
for (idx = 0; src[idx]; idx++)
if ((int8_t) src[idx] < 0)
{
cdio_warn ("string '%s' fails 7bit constraint (pos = %d)",
cdio_warn ("string '%s' fails 7bit constraint (pos = %d)",
src, idx);
break;
}
@ -537,7 +536,7 @@ iso9660_strncpy_pad(char dst[], const char src[], size_t len,
rlen = strlen (src);
if (rlen > len)
cdio_warn ("string '%s' is getting truncated to %d characters",
cdio_warn ("string '%s' is getting truncated to %d characters",
src, (unsigned int) len);
strncpy (dst, src, len);
@ -564,9 +563,9 @@ iso9660_is_dchar (int c)
/*!
Return true if c is an ACHAR -
These are the DCHAR's plus some ASCII symbols including the space
symbol.
Return true if c is an ACHAR -
These are the DCHAR's plus some ASCII symbols including the space
symbol.
*/
bool
iso9660_is_achar (int c)
@ -580,7 +579,7 @@ iso9660_is_achar (int c)
return true;
}
void
void
iso9660_set_evd(void *pd)
{
iso_volume_descriptor_t ied;
@ -588,11 +587,11 @@ iso9660_set_evd(void *pd)
cdio_assert (sizeof(iso_volume_descriptor_t) == ISO_BLOCKSIZE);
cdio_assert (pd != NULL);
memset(&ied, 0, sizeof(ied));
ied.type = to_711(ISO_VD_END);
iso9660_strncpy_pad (ied.id, ISO_STANDARD_ID, sizeof(ied.id),
iso9660_strncpy_pad (ied.id, ISO_STANDARD_ID, sizeof(ied.id),
ISO9660_DCHARS);
ied.version = to_711(ISO_VERSION);
@ -642,25 +641,25 @@ iso9660_set_pvd(void *pd,
ipd.logical_block_size = to_723(ISO_BLOCKSIZE);
ipd.path_table_size = to_733(path_table_size);
ipd.type_l_path_table = to_731(path_table_l_extent);
ipd.type_m_path_table = to_732(path_table_m_extent);
ipd.type_l_path_table = to_731(path_table_l_extent);
ipd.type_m_path_table = to_732(path_table_m_extent);
/* root_directory_record doesn't contain the 1-byte filename,
so we add one for that. */
cdio_assert (sizeof(ipd.root_directory_record) == 33);
memcpy(&(ipd.root_directory_record), root_dir,
memcpy(&(ipd.root_directory_record), root_dir,
sizeof(ipd.root_directory_record));
ipd.root_directory_filename='\0';
ipd.root_directory_record.length = sizeof(ipd.root_directory_record)+1;
iso9660_strncpy_pad (ipd.volume_set_id, VOLUME_SET_ID,
iso9660_strncpy_pad (ipd.volume_set_id, VOLUME_SET_ID,
ISO_MAX_VOLUMESET_ID, ISO9660_DCHARS);
iso9660_strncpy_pad (ipd.publisher_id, publisher_id, ISO_MAX_PUBLISHER_ID,
iso9660_strncpy_pad (ipd.publisher_id, publisher_id, ISO_MAX_PUBLISHER_ID,
ISO9660_ACHARS);
iso9660_strncpy_pad (ipd.preparer_id, preparer_id, ISO_MAX_PREPARER_ID,
iso9660_strncpy_pad (ipd.preparer_id, preparer_id, ISO_MAX_PREPARER_ID,
ISO9660_ACHARS);
iso9660_strncpy_pad (ipd.application_id, application_id,
ISO_MAX_APPLICATION_ID, ISO9660_ACHARS);
iso9660_strncpy_pad (ipd.application_id, application_id,
ISO_MAX_APPLICATION_ID, ISO9660_ACHARS);
iso9660_strncpy_pad (ipd.copyright_file_id , "", 37, ISO9660_DCHARS);
iso9660_strncpy_pad (ipd.abstract_file_id , "", 37, ISO9660_DCHARS);
@ -698,7 +697,7 @@ iso9660_dir_calc_record_size(unsigned int namelen, unsigned int su_len)
void
iso9660_dir_add_entry_su(void *dir,
const char filename[],
const char filename[],
uint32_t extent,
uint32_t size,
uint8_t file_flags,
@ -716,7 +715,7 @@ iso9660_dir_add_entry_su(void *dir,
if (!dsize && !idr->length)
dsize = ISO_BLOCKSIZE; /* for when dir lacks '.' entry */
cdio_assert (dsize > 0 && !(dsize % ISO_BLOCKSIZE));
cdio_assert (dir != NULL);
cdio_assert (extent > 17);
@ -759,23 +758,23 @@ iso9660_dir_add_entry_su(void *dir,
cdio_assert (offset + length <= dsize);
idr = (iso9660_dir_t *) &dir8[offset];
cdio_assert (offset+length < dsize);
cdio_assert (offset+length < dsize);
memset(idr, 0, length);
idr->length = to_711(length);
idr->extent = to_733(extent);
idr->size = to_733(size);
gmtime_r(entry_time, &temp_tm);
iso9660_set_dtime (&temp_tm, &(idr->recording_time));
idr->file_flags = to_711(file_flags);
idr->volume_sequence_number = to_723(1);
idr->filename.len = to_711(strlen(filename)
idr->filename.len = to_711(strlen(filename)
? strlen(filename) : 1); /* working hack! */
memcpy(&idr->filename.str[1], filename, from_711(idr->filename.len));
@ -790,11 +789,11 @@ iso9660_dir_init_new (void *dir,
uint32_t psize,
const time_t *dir_time)
{
iso9660_dir_init_new_su (dir, self, ssize, NULL, 0, parent, psize, NULL,
iso9660_dir_init_new_su (dir, self, ssize, NULL, 0, parent, psize, NULL,
0, dir_time);
}
void
void
iso9660_dir_init_new_su (void *dir,
uint32_t self,
uint32_t ssize,
@ -813,40 +812,40 @@ iso9660_dir_init_new_su (void *dir,
memset (dir, 0, ssize);
/* "\0" -- working hack due to padding */
iso9660_dir_add_entry_su (dir, "\0", self, ssize, ISO_DIRECTORY, ssu_data,
ssu_size, dir_time);
iso9660_dir_add_entry_su (dir, "\0", self, ssize, ISO_DIRECTORY, ssu_data,
ssu_size, dir_time);
iso9660_dir_add_entry_su (dir, "\1", parent, psize, ISO_DIRECTORY, psu_data,
iso9660_dir_add_entry_su (dir, "\1", parent, psize, ISO_DIRECTORY, psu_data,
psu_size, dir_time);
}
/* Zero's out pathable. Do this first. */
void
void
iso9660_pathtable_init (void *pt)
{
cdio_assert (sizeof (iso_path_table_t) == 8);
cdio_assert (pt != NULL);
memset (pt, 0, ISO_BLOCKSIZE); /* fixme */
}
/*!
Returns POSIX mode bitstring for a given file.
*/
mode_t
iso9660_get_posix_filemode(const iso9660_stat_t *p_iso_dirent)
mode_t
iso9660_get_posix_filemode(const iso9660_stat_t *p_iso_dirent)
{
mode_t mode = 0;
#ifdef HAVE_ROCK
if (yep == p_iso_dirent->rr.b3_rock) {
return iso9660_get_posix_filemode_from_rock(&p_iso_dirent->rr);
} else
#endif
if (p_iso_dirent->b_xa) {
return iso9660_get_posix_filemode_from_xa(p_iso_dirent->xa.attributes);
}
#ifdef HAVE_ROCK
if (yep == p_iso_dirent->rr.b3_rock) {
return iso9660_get_posix_filemode_from_rock(&p_iso_dirent->rr);
} else
#endif
if (p_iso_dirent->b_xa) {
return iso9660_get_posix_filemode_from_xa(p_iso_dirent->xa.attributes);
}
return mode;
}
@ -859,7 +858,7 @@ pathtable_get_entry (const void *pt, unsigned int entrynum)
cdio_assert (pt != NULL);
while (from_711 (*tmp))
while (from_711 (*tmp))
{
if (count == entrynum)
break;
@ -881,7 +880,7 @@ pathtable_get_entry (const void *pt, unsigned int entrynum)
}
void
pathtable_get_size_and_entries (const void *pt,
pathtable_get_size_and_entries (const void *pt,
unsigned int *size,
unsigned int *entries)
{
@ -891,7 +890,7 @@ pathtable_get_size_and_entries (const void *pt,
cdio_assert (pt != NULL);
while (from_711 (*tmp))
while (from_711 (*tmp))
{
offset += sizeof (iso_path_table_t);
offset += from_711 (*tmp);
@ -916,13 +915,13 @@ iso9660_pathtable_get_size (const void *pt)
return size;
}
uint16_t
iso9660_pathtable_l_add_entry (void *pt,
const char name[],
uint32_t extent,
uint16_t
iso9660_pathtable_l_add_entry (void *pt,
const char name[],
uint32_t extent,
uint16_t parent)
{
iso_path_table_t *ipt =
iso_path_table_t *ipt =
(iso_path_table_t *)((char *)pt + iso9660_pathtable_get_size (pt));
size_t name_len = strlen (name) ? strlen (name) : 1;
unsigned int entrynum = 0;
@ -940,21 +939,21 @@ iso9660_pathtable_l_add_entry (void *pt,
if (entrynum > 1)
{
const iso_path_table_t *ipt2
const iso_path_table_t *ipt2
= pathtable_get_entry (pt, entrynum - 2);
cdio_assert (ipt2 != NULL);
cdio_assert (from_721 (ipt2->parent) <= parent);
}
return entrynum;
}
uint16_t
iso9660_pathtable_m_add_entry (void *pt,
const char name[],
uint32_t extent,
uint16_t
iso9660_pathtable_m_add_entry (void *pt,
const char name[],
uint32_t extent,
uint16_t parent)
{
iso_path_table_t *ipt =
@ -975,7 +974,7 @@ iso9660_pathtable_m_add_entry (void *pt,
if (entrynum > 1)
{
const iso_path_table_t *ipt2
const iso_path_table_t *ipt2
= pathtable_get_entry (pt, entrynum - 2);
cdio_assert (ipt2 != NULL);
@ -989,10 +988,10 @@ iso9660_pathtable_m_add_entry (void *pt,
/*!
Check that pathname is a valid ISO-9660 directory name.
A valid directory name should not start out with a slash (/),
dot (.) or null byte, should be less than 37 characters long,
have no more than 8 characters in a directory component
which is separated by a /, and consist of only DCHARs.
A valid directory name should not start out with a slash (/),
dot (.) or null byte, should be less than 37 characters long,
have no more than 8 characters in a directory component
which is separated by a /, and consist of only DCHARs.
*/
bool
iso9660_dirname_valid_p (const char pathname[])
@ -1007,7 +1006,7 @@ iso9660_dirname_valid_p (const char pathname[])
if (strlen (pathname) > MAX_ISOPATHNAME)
return false;
len = 0;
for (; *p; p++)
if (iso9660_is_dchar (*p))
@ -1032,14 +1031,14 @@ iso9660_dirname_valid_p (const char pathname[])
}
/*!
Check that pathname is a valid ISO-9660 pathname.
Check that pathname is a valid ISO-9660 pathname.
A valid pathname contains a valid directory name, if one appears and
the filename portion should be no more than 8 characters for the
file prefix and 3 characters in the extension (or portion after a
dot). There should be exactly one dot somewhere in the filename
portion and the filename should be composed of only DCHARs.
True is returned if pathname is valid.
*/
bool
@ -1053,7 +1052,7 @@ iso9660_pathname_valid_p (const char pathname[])
{
bool rc;
char *_tmp = strdup (pathname);
*strrchr (_tmp, '/') = '\0';
rc = iso9660_dirname_valid_p (_tmp);
@ -1101,7 +1100,7 @@ iso9660_pathname_valid_p (const char pathname[])
return true;
}
/*!
/*!
Take pathname and a version number and turn that into a ISO-9660
pathname. (That's just the pathname followd by ";" and the version
number. For example, mydir/file.ext -> mydir/file.ext;1 for version
@ -1111,7 +1110,7 @@ char *
iso9660_pathname_isofy (const char pathname[], uint16_t version)
{
char tmpbuf[1024] = { 0, };
cdio_assert (strlen (pathname) < (sizeof (tmpbuf) - sizeof (";65535")));
snprintf (tmpbuf, sizeof(tmpbuf), "%s;%d", pathname, version);
@ -1121,9 +1120,9 @@ iso9660_pathname_isofy (const char pathname[], uint16_t version)
/*!
Return the PVD's application ID.
NULL is returned if there is some problem in getting this.
NULL is returned if there is some problem in getting this.
*/
char *
char *
iso9660_get_application_id(iso9660_pvd_t *p_pvd)
{
if (NULL==p_pvd) return NULL;
@ -1132,7 +1131,7 @@ iso9660_get_application_id(iso9660_pvd_t *p_pvd)
#ifdef FIXME
lsn_t
iso9660_get_dir_extent(const iso9660_dir_t *idr)
iso9660_get_dir_extent(const iso9660_dir_t *idr)
{
if (NULL == idr) return 0;
return from_733(idr->extent);
@ -1140,7 +1139,7 @@ iso9660_get_dir_extent(const iso9660_dir_t *idr)
#endif
uint8_t
iso9660_get_dir_len(const iso9660_dir_t *idr)
iso9660_get_dir_len(const iso9660_dir_t *idr)
{
if (NULL == idr) return 0;
return idr->length;
@ -1148,7 +1147,7 @@ iso9660_get_dir_len(const iso9660_dir_t *idr)
#ifdef FIXME
uint8_t
iso9660_get_dir_size(const iso9660_dir_t *idr)
iso9660_get_dir_size(const iso9660_dir_t *idr)
{
if (NULL == idr) return 0;
return from_733(idr->size);
@ -1156,50 +1155,50 @@ iso9660_get_dir_size(const iso9660_dir_t *idr)
#endif
uint8_t
iso9660_get_pvd_type(const iso9660_pvd_t *pvd)
iso9660_get_pvd_type(const iso9660_pvd_t *pvd)
{
if (NULL == pvd) return 255;
return(pvd->type);
}
const char *
iso9660_get_pvd_id(const iso9660_pvd_t *pvd)
iso9660_get_pvd_id(const iso9660_pvd_t *pvd)
{
if (NULL == pvd) return "ERR";
return(pvd->id);
}
int
iso9660_get_pvd_space_size(const iso9660_pvd_t *pvd)
iso9660_get_pvd_space_size(const iso9660_pvd_t *pvd)
{
if (NULL == pvd) return 0;
return from_733(pvd->volume_space_size);
}
int
iso9660_get_pvd_block_size(const iso9660_pvd_t *pvd)
iso9660_get_pvd_block_size(const iso9660_pvd_t *pvd)
{
if (NULL == pvd) return 0;
return from_723(pvd->logical_block_size);
}
/*! Return the primary volume id version number (of pvd).
If there is an error 0 is returned.
If there is an error 0 is returned.
*/
int
iso9660_get_pvd_version(const iso9660_pvd_t *pvd)
iso9660_get_pvd_version(const iso9660_pvd_t *pvd)
{
if (NULL == pvd) return 0;
return pvd->version;
}
/*! Return the LSN of the root directory for pvd.
If there is an error CDIO_INVALID_LSN is returned.
If there is an error CDIO_INVALID_LSN is returned.
*/
lsn_t
iso9660_get_root_lsn(const iso9660_pvd_t *pvd)
iso9660_get_root_lsn(const iso9660_pvd_t *pvd)
{
if (NULL == pvd)
if (NULL == pvd)
return CDIO_INVALID_LSN;
else {
const iso9660_dir_t *idr = &(pvd->root_directory_record);
@ -1245,7 +1244,7 @@ iso9660_get_system_id(const iso9660_pvd_t *pvd)
Return the PVD's volume ID.
*/
char *
iso9660_get_volume_id(const iso9660_pvd_t *pvd)
iso9660_get_volume_id(const iso9660_pvd_t *pvd)
{
if (NULL == pvd) return NULL;
return strdup(strip_trail(pvd->volume_id, ISO_MAX_VOLUME_ID));
@ -1253,7 +1252,7 @@ iso9660_get_volume_id(const iso9660_pvd_t *pvd)
/*!
Return the PVD's volumeset ID.
NULL is returned if there is some problem in getting this.
NULL is returned if there is some problem in getting this.
*/
char *
iso9660_get_volumeset_id(const iso9660_pvd_t *pvd)
@ -1263,7 +1262,7 @@ iso9660_get_volumeset_id(const iso9660_pvd_t *pvd)
}
/*
/*
* Local variables:
* c-file-style: "gnu"
* tab-width: 8

File diff suppressed because it is too large Load Diff

View File

@ -30,7 +30,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 206, 329
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW
CAPTION "Rufus v1.3.4.279"
CAPTION "Rufus v1.4.0.280"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "Start",IDC_START,94,291,50,14
@ -278,8 +278,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,3,4,279
PRODUCTVERSION 1,3,4,279
FILEVERSION 1,4,0,280
PRODUCTVERSION 1,4,0,280
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -296,13 +296,13 @@ BEGIN
BEGIN
VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)"
VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "1.3.4.279"
VALUE "FileVersion", "1.4.0.280"
VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2013 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
VALUE "OriginalFilename", "rufus.exe"
VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "1.3.4.279"
VALUE "ProductVersion", "1.4.0.280"
END
END
BLOCK "VarFileInfo"