From bf98a552da7f7f5cf757d6f13c8eee8b22486a4c Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Sun, 4 Nov 2012 01:33:54 +0000 Subject: [PATCH] [iso] update libcdio to v0.90 --- src/iso.c | 2 +- src/libcdio/cdio/audio.h | 6 +- src/libcdio/cdio/bytesex.h | 10 +- src/libcdio/cdio/bytesex_asm.h | 22 +- src/libcdio/cdio/cdio.h | 8 +- src/libcdio/cdio/device.h | 124 ++-- src/libcdio/cdio/disc.h | 19 +- src/libcdio/cdio/ds.h | 6 +- src/libcdio/cdio/dvd.h | 45 +- src/libcdio/cdio/ecma_167.h | 884 +++++++++++++------------- src/libcdio/cdio/iso9660.h | 72 +-- src/libcdio/cdio/logging.h | 10 +- src/libcdio/cdio/posix.h | 10 +- src/libcdio/cdio/read.h | 74 ++- src/libcdio/cdio/rock.h | 22 +- src/libcdio/cdio/sector.h | 48 +- src/libcdio/cdio/track.h | 43 +- src/libcdio/cdio/types.h | 68 +- src/libcdio/cdio/udf_time.h | 4 +- src/libcdio/cdio/utf8.h | 26 +- src/libcdio/cdio/util.h | 9 +- src/libcdio/cdio/version.h | 6 +- src/libcdio/cdio/xa.h | 13 +- src/libcdio/driver/_cdio_stdio.c | 32 +- src/libcdio/driver/_cdio_stdio.h | 10 +- src/libcdio/driver/_cdio_stream.h | 11 +- src/libcdio/driver/cdio_assert.h | 10 +- src/libcdio/driver/cdio_private.h | 72 +-- src/libcdio/driver/disc.c | 8 +- src/libcdio/driver/filemode.h | 8 +- src/libcdio/driver/generic.h | 25 +- src/libcdio/driver/logging.c | 13 +- src/libcdio/driver/portable.h | 8 +- src/libcdio/driver/read.c | 6 +- src/libcdio/driver/sector.c | 4 +- src/libcdio/driver/track.c | 64 +- src/libcdio/driver/utf8.c | 32 +- src/libcdio/driver/util.c | 2 +- src/libcdio/iso9660/iso9660.c | 44 +- src/libcdio/iso9660/iso9660_fs.c | 20 +- src/libcdio/iso9660/iso9660_private.h | 12 +- src/libcdio/udf/filemode.c | 2 +- src/libcdio/udf/udf.c | 2 +- src/libcdio/udf/udf_file.c | 2 +- src/libcdio/udf/udf_fs.h | 10 +- src/libcdio/udf/udf_private.h | 12 +- src/rufus.rc | 12 +- 47 files changed, 1024 insertions(+), 928 deletions(-) diff --git a/src/iso.c b/src/iso.c index 1938cdd4..06c5bfc3 100644 --- a/src/iso.c +++ b/src/iso.c @@ -371,7 +371,7 @@ out: return r; } -BOOL ExtractISO(const char* src_iso, const char* dest_dir, bool scan) +BOOL ExtractISO(const char* src_iso, const char* dest_dir, BOOL scan) { size_t i; int j; diff --git a/src/libcdio/cdio/audio.h b/src/libcdio/cdio/audio.h index e51ba3d2..099a1236 100644 --- a/src/libcdio/cdio/audio.h +++ b/src/libcdio/cdio/audio.h @@ -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 @@ -143,4 +143,4 @@ extern "C" { } #endif /* __cplusplus */ -#endif /* __CDIO_AUDIO_H__ */ +#endif /* CDIO_AUDIO_H_ */ diff --git a/src/libcdio/cdio/bytesex.h b/src/libcdio/cdio/bytesex.h index a85b965e..696fbd41 100644 --- a/src/libcdio/cdio/bytesex.h +++ b/src/libcdio/cdio/bytesex.h @@ -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 - Copyright (C) 2005, 2008 Rocky Bernstein + Copyright (C) 2005, 2008, 2012 Rocky Bernstein 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 #include /* 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_ */ /* diff --git a/src/libcdio/cdio/bytesex_asm.h b/src/libcdio/cdio/bytesex_asm.h index 5a1ce6ac..d68b677a 100644 --- a/src/libcdio/cdio/bytesex_asm.h +++ b/src/libcdio/cdio/bytesex_asm.h @@ -1,7 +1,5 @@ /* - $Id: bytesex_asm.h,v 1.3 2008/03/25 15:59:08 karl Exp $ - - Copyright (C) 2008 Rocky Bernstein + Copyright (C) 2008, 2012 Rocky Bernstein 2001, 2004, 2005 Herbert Valerio Riedel 2001 Sven Ottemann @@ -26,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 @@ -106,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); } @@ -118,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); } @@ -130,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_ */ /* diff --git a/src/libcdio/cdio/cdio.h b/src/libcdio/cdio/cdio.h index f0d8b840..46330662 100644 --- a/src/libcdio/cdio/cdio.h +++ b/src/libcdio/cdio/cdio.h @@ -29,7 +29,7 @@ /** Application Interface or Protocol version number. If the public * interface changes, we increase this number. */ -#define CDIO_API_VERSION 5 +#define CDIO_API_VERSION 6 #include #include @@ -56,6 +56,9 @@ extern "C" { */ #include +/* CD-Text-related functions. */ +#include + /* Disc-related functions. */ #include @@ -64,9 +67,6 @@ extern "C" { */ #include -/* CD-Text-related functions. */ -#include - /* Track-related functions. */ #include diff --git a/src/libcdio/cdio/device.h b/src/libcdio/cdio/device.h index 71ef38b3..97c8a4e0 100644 --- a/src/libcdio/cdio/device.h +++ b/src/libcdio/cdio/device.h @@ -1,6 +1,6 @@ /* -*- c -*- - Copyright (C) 2005, 2006, 2008, 2009, 2010, 2011 Rocky Bernstein + Copyright (C) 2005, 2006, 2008, 2009, 2010, 2011, 2012 Rocky Bernstein This program is free software: you can redistribute it and/or modify @@ -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; @@ -200,10 +200,10 @@ extern "C" { enumeration in driver_id_t. Since we have a bogus (but useful) 0th entry above we don't have to add one. */ -#define CDIO_MIN_DRIVER DRIVER_AIX -#define CDIO_MIN_DEVICE_DRIVER CDIO_MIN_DRIVER -#define CDIO_MAX_DRIVER DRIVER_NRG -#define CDIO_MAX_DEVICE_DRIVER DRIVER_WIN32 +LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MIN_DRIVER, "please use cdio_drivers") = DRIVER_AIX; +LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MIN_DEVICE_DRIVER, "please use cdio_device_drivers") = DRIVER_AIX; +LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DRIVER, "please use cdio_drivers") = DRIVER_NRG; +LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use cdio_device_drivers") = DRIVER_WIN32; /** The following are status codes for completion of a given cdio @@ -219,30 +219,30 @@ extern "C" { */ 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 @@ extern "C" { 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 @@ extern "C" { 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 @@ extern "C" { 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 @@ extern "C" { 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 @@ extern "C" { 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 @@ extern "C" { 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 @@ extern "C" { @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 @@ extern "C" { @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 @@ extern "C" { @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 @@ extern "C" { @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 @@ extern "C" { 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 @@ extern "C" { @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 @@ extern "C" { @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 @@ extern "C" { @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 @@ extern "C" { 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 @@ extern "C" { 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 @@ extern "C" { @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 @@ extern "C" { 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_ */ diff --git a/src/libcdio/cdio/disc.h b/src/libcdio/cdio/disc.h index 638c0320..f758111c 100644 --- a/src/libcdio/cdio/disc.h +++ b/src/libcdio/cdio/disc.h @@ -1,6 +1,6 @@ /* -*- c -*- - Copyright (C) 2004, 2005, 2006, 2008, 2010 Rocky Bernstein + Copyright (C) 2004, 2005, 2006, 2008, 2010, 2012 Rocky Bernstein 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,10 +52,11 @@ 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[]; + /** Get binary CD-Text information for a CdIo_t object. @@ -133,4 +134,4 @@ extern "C" { } #endif /* __cplusplus */ -#endif /* __CDIO_DISC_H__ */ +#endif /* CDIO_DISC_H_ */ diff --git a/src/libcdio/cdio/ds.h b/src/libcdio/cdio/ds.h index 447e30df..6662c58a 100644 --- a/src/libcdio/cdio/ds.h +++ b/src/libcdio/cdio/ds.h @@ -26,8 +26,8 @@ */ -#ifndef __CDIO_DS_H__ -#define __CDIO_DS_H__ +#ifndef CDIO_DS_H_ +#define CDIO_DS_H_ #include @@ -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: diff --git a/src/libcdio/cdio/dvd.h b/src/libcdio/cdio/dvd.h index 8bb83e12..9d3f3389 100644 --- a/src/libcdio/cdio/dvd.h +++ b/src/libcdio/cdio/dvd.h @@ -27,35 +27,40 @@ */ -#ifndef __CDIO_DVD_H__ -#define __CDIO_DVD_H__ +#ifndef CDIO_DVD_H_ +#define CDIO_DVD_H_ #include /** 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_ */ diff --git a/src/libcdio/cdio/ecma_167.h b/src/libcdio/cdio/ecma_167.h index f2c15446..81a12209 100644 --- a/src/libcdio/cdio/ecma_167.h +++ b/src/libcdio/cdio/ecma_167.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2005, 2006, 2008 Rocky Bernstein + Copyright (c) 2005, 2006, 2008, 2012 Rocky Bernstein Copyright (c) 2001-2002 Ben Fennema This program is free software: you can redistribute it and/or modify @@ -49,8 +49,8 @@ * See http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-167.pdf */ -#ifndef _ECMA_167_H -#define _ECMA_167_H 1 +#ifndef CDIO_ECMA_167_H +#define CDIO_ECMA_167_H 1 #include @@ -59,11 +59,11 @@ distinct values of an enum. */ typedef enum { - VSD_STD_ID_SIZE = 5, /** Volume Structure Descriptor (ECMA 167r3 - 2/9.1) */ - UDF_REGID_ID_SIZE = 23, /**< See identifier (ECMA 167r3 1/7.4) */ + VSD_STD_ID_SIZE = 5, /** Volume Structure Descriptor (ECMA 167r3 + 2/9.1) */ + UDF_REGID_ID_SIZE = 23, /**< See identifier (ECMA 167r3 1/7.4) */ UDF_VOLID_SIZE = 32, - UDF_FID_SIZE = 38, + UDF_FID_SIZE = 38, UDF_VOLSET_ID_SIZE = 128 } ecma_167_enum1_t ; @@ -79,38 +79,38 @@ typedef enum { TAGID_UNALLOC_SPACE = 0x0007, TAGID_TERM = 0x0008, TAGID_LOGVOL_INTEGRITY = 0x0009, - TAGID_FSD = 0x0100, - TAGID_FID = 0x0101, - TAGID_AED = 0x0102, - TAGID_IE = 0x0103, - TAGID_TE = 0x0104, - TAGID_FILE_ENTRY = 0x0105, - TAGID_EAHD = 0x0106, - TAGID_USE = 0x0107, - TAGID_SBD = 0x0108, - TAGID_PIE = 0x0109, - TAGID_EFE = 0x010A, + TAGID_FSD = 0x0100, + TAGID_FID = 0x0101, + TAGID_AED = 0x0102, + TAGID_IE = 0x0103, + TAGID_TE = 0x0104, + TAGID_FILE_ENTRY = 0x0105, + TAGID_EAHD = 0x0106, + TAGID_USE = 0x0107, + TAGID_SBD = 0x0108, + TAGID_PIE = 0x0109, + TAGID_EFE = 0x010A, } tag_id_t ; /** Character Set Type (ECMA 167r3 1/7.2.1.1) */ typedef enum { - CHARSPEC_TYPE_CS0 = 0x00, /**< Section 1/7.2.2 */ - CHARSPEC_TYPE_CS1 = 0x01, /**< Section 1/7.2.3 */ - CHARSPEC_TYPE_CS2 = 0x02, /**< Section 1/7.2.4 */ - CHARSPEC_TYPE_CS3 = 0x03, /**< Section 1/7.2.5 */ - CHARSPEC_TYPE_CS4 = 0x04, /**< Section 1/7.2.6 */ - CHARSPEC_TYPE_CS5 = 0x05, /**< Section 1/7.2.7 */ - CHARSPEC_TYPE_CS6 = 0x06, /**< Section 1/7.2.8 */ - CHARSPEC_TYPE_CS7 = 0x07, /**< Section 1/7.2.9 */ + CHARSPEC_TYPE_CS0 = 0x00, /**< Section 1/7.2.2 */ + CHARSPEC_TYPE_CS1 = 0x01, /**< Section 1/7.2.3 */ + CHARSPEC_TYPE_CS2 = 0x02, /**< Section 1/7.2.4 */ + CHARSPEC_TYPE_CS3 = 0x03, /**< Section 1/7.2.5 */ + CHARSPEC_TYPE_CS4 = 0x04, /**< Section 1/7.2.6 */ + CHARSPEC_TYPE_CS5 = 0x05, /**< Section 1/7.2.7 */ + CHARSPEC_TYPE_CS6 = 0x06, /**< Section 1/7.2.8 */ + CHARSPEC_TYPE_CS7 = 0x07, /**< Section 1/7.2.9 */ - CHARSPEC_TYPE_CS8 = 0x08, /**< Section 1/7.2.10 */ + CHARSPEC_TYPE_CS8 = 0x08, /**< Section 1/7.2.10 */ } udf_charspec_enum_t; typedef uint8_t udf_Uint8_t; /*! Section 1/7/1.1 */ typedef uint16_t udf_Uint16_t; /*! Section 1/7.1.3 */ typedef uint32_t udf_Uint32_t; /*! Section 1/7.1.5 */ typedef uint64_t udf_Uint64_t; /*! Section 1/7.1.7 */ -typedef char udf_dstring; /*! Section 1/7.1.12 */ +typedef char udf_dstring; /*! Section 1/7.1.12 */ #define UDF_LENGTH_MASK 0x3fffffff @@ -119,8 +119,8 @@ PRAGMA_BEGIN_PACKED /** Character set specification (ECMA 167r3 1/7.2.1) */ struct udf_charspec_s { - udf_Uint8_t charset_type; - udf_Uint8_t charset_info[63]; + udf_Uint8_t charset_type; + udf_Uint8_t charset_info[63]; } GNUC_PACKED; typedef struct udf_charspec_s udf_charspec_t; @@ -128,16 +128,16 @@ typedef struct udf_charspec_s udf_charspec_t; /** Timestamp (ECMA 167r3 1/7.3) */ struct udf_timestamp_s { - udf_Uint16_t type_tz; - udf_Uint16_t year; - udf_Uint8_t month; - udf_Uint8_t day; - udf_Uint8_t hour; - udf_Uint8_t minute; - udf_Uint8_t second; - udf_Uint8_t centiseconds; - udf_Uint8_t hundreds_of_microseconds; - udf_Uint8_t microseconds; + udf_Uint16_t type_tz; + udf_Uint16_t year; + udf_Uint8_t month; + udf_Uint8_t day; + udf_Uint8_t hour; + udf_Uint8_t minute; + udf_Uint8_t second; + udf_Uint8_t centiseconds; + udf_Uint8_t hundreds_of_microseconds; + udf_Uint8_t microseconds; } GNUC_PACKED; typedef struct udf_timestamp_s udf_timestamp_t; @@ -148,19 +148,19 @@ typedef struct udf_timestamp_s udf_timestamp_t; distinct values of an enum. */ typedef enum { - TIMESTAMP_TYPE_CUT = 0x0000, - TIMESTAMP_TYPE_LOCAL = 0x1000, - TIMESTAMP_TYPE_AGREEMENT = 0x2000, + TIMESTAMP_TYPE_CUT = 0x0000, + TIMESTAMP_TYPE_LOCAL = 0x1000, + TIMESTAMP_TYPE_AGREEMENT = 0x2000, TIMESTAMP_TYPE_MASK = 0xF000, - TIMESTAMP_TIMEZONE_MASK = 0x0FFF, + TIMESTAMP_TIMEZONE_MASK = 0x0FFF, } ecma_167_timezone_enum_t ; -#define TIMESTAMP_TYPE_MASK 0xF000 -#define TIMESTAMP_TYPE_CUT 0x0000 -#define TIMESTAMP_TYPE_LOCAL 0x1000 -#define TIMESTAMP_TYPE_AGREEMENT 0x2000 -#define TIMESTAMP_TIMEZONE_MASK 0x0FFF +#define TIMESTAMP_TYPE_MASK 0xF000 +#define TIMESTAMP_TYPE_CUT 0x0000 +#define TIMESTAMP_TYPE_LOCAL 0x1000 +#define TIMESTAMP_TYPE_AGREEMENT 0x2000 +#define TIMESTAMP_TIMEZONE_MASK 0x0FFF struct udf_id_suffix_s { @@ -175,28 +175,28 @@ typedef struct udf_id_suffix_s udf_id_suffix_t; /** Entity identifier (ECMA 167r3 1/7.4) */ struct udf_regid_s { - udf_Uint8_t flags; - udf_Uint8_t id[UDF_REGID_ID_SIZE]; - udf_id_suffix_t id_suffix; + udf_Uint8_t flags; + udf_Uint8_t id[UDF_REGID_ID_SIZE]; + udf_id_suffix_t id_suffix; } GNUC_PACKED; typedef struct udf_regid_s udf_regid_t; /** Flags (ECMA 167r3 1/7.4.1) */ -#define ENTITYID_FLAGS_DIRTY 0x00 -#define ENTITYID_FLAGS_PROTECTED 0x01 +#define ENTITYID_FLAGS_DIRTY 0x00 +#define ENTITYID_FLAGS_PROTECTED 0x01 /** Volume Structure Descriptor (ECMA 167r3 2/9.1) */ struct vol_struct_desc_s { - udf_Uint8_t struct_type; - udf_Uint8_t std_id[VSD_STD_ID_SIZE]; - udf_Uint8_t struct_version; - udf_Uint8_t struct_data[2041]; + udf_Uint8_t struct_type; + udf_Uint8_t std_id[VSD_STD_ID_SIZE]; + udf_Uint8_t struct_version; + udf_Uint8_t struct_data[2041]; } GNUC_PACKED; /** Standard Identifier (EMCA 167r2 2/9.1.2) */ -#define VSD_STD_ID_NSR02 "NSR02" /* (3/9.1) */ +#define VSD_STD_ID_NSR02 "NSR02" /* (3/9.1) */ /** Standard Identifier (ECMA 167r3 2/9.1.2) */ @@ -209,60 +209,60 @@ extern const char VSD_STD_ID_CDW01[sizeof("CDW02")-1]; extern const char VSD_STD_ID_NSR03[sizeof("NSR03")-1]; extern const char VSD_STD_ID_TEA01[sizeof("TEA01")-1]; -#define VSD_STD_ID_BEA01 "BEA01" /**< ECMA-167 2/9.2 */ -#define VSD_STD_ID_BOOT2 "BOOT2" /**< ECMA-167 2/9.4 */ -#define VSD_STD_ID_CD001 "CD001" /**< ECMA-119 */ -#define VSD_STD_ID_CDW02 "CDW02" /**< ECMA-168 */ +#define VSD_STD_ID_BEA01 "BEA01" /**< ECMA-167 2/9.2 */ +#define VSD_STD_ID_BOOT2 "BOOT2" /**< ECMA-167 2/9.4 */ +#define VSD_STD_ID_CD001 "CD001" /**< ECMA-119 */ +#define VSD_STD_ID_CDW02 "CDW02" /**< ECMA-168 */ #define VSD_STD_ID_NSR02 "NSR02" /**< ECMA-167, 3/9.1 - NOTE: ECMA-167, 2nd edition */ -#define VSD_STD_ID_NSR03 "NSR03" /**< ECMA-167 3/9.1 */ -#define VSD_STD_ID_TEA01 "TEA01" /**< ECMA-168 2/9.3 */ + NOTE: ECMA-167, 2nd edition */ +#define VSD_STD_ID_NSR03 "NSR03" /**< ECMA-167 3/9.1 */ +#define VSD_STD_ID_TEA01 "TEA01" /**< ECMA-168 2/9.3 */ /** Beginning Extended Area Descriptor (ECMA 167r3 2/9.2) */ struct beginning_extended_area_desc_s { - udf_Uint8_t struct_type; - udf_Uint8_t std_id[VSD_STD_ID_SIZE]; - udf_Uint8_t struct_version; - udf_Uint8_t struct_data[2041]; + udf_Uint8_t struct_type; + udf_Uint8_t std_id[VSD_STD_ID_SIZE]; + udf_Uint8_t struct_version; + udf_Uint8_t struct_data[2041]; } GNUC_PACKED; /** Terminating Extended Area Descriptor (ECMA 167r3 2/9.3) */ struct terminating_extended_area_desc_s { - udf_Uint8_t struct_type; - udf_Uint8_t std_id[VSD_STD_ID_SIZE]; - udf_Uint8_t struct_version; - udf_Uint8_t struct_data[2041]; + udf_Uint8_t struct_type; + udf_Uint8_t std_id[VSD_STD_ID_SIZE]; + udf_Uint8_t struct_version; + udf_Uint8_t struct_data[2041]; } GNUC_PACKED; /** Boot Descriptor (ECMA 167r3 2/9.4) */ struct boot_desc_s { - udf_Uint8_t struct_type; - udf_Uint8_t std_ident[VSD_STD_ID_SIZE]; - udf_Uint8_t struct_version; - udf_Uint8_t reserved1; - udf_regid_t arch_type; - udf_regid_t boot_ident; - udf_Uint32_t bool_ext_location; - udf_Uint32_t bool_ext_length; - udf_Uint64_t load_address; - udf_Uint64_t start_address; - udf_timestamp_t desc_creation_time; - udf_Uint16_t flags; - udf_Uint8_t reserved2[32]; - udf_Uint8_t boot_use[1906]; + udf_Uint8_t struct_type; + udf_Uint8_t std_ident[VSD_STD_ID_SIZE]; + udf_Uint8_t struct_version; + udf_Uint8_t reserved1; + udf_regid_t arch_type; + udf_regid_t boot_ident; + udf_Uint32_t bool_ext_location; + udf_Uint32_t bool_ext_length; + udf_Uint64_t load_address; + udf_Uint64_t start_address; + udf_timestamp_t desc_creation_time; + udf_Uint16_t flags; + udf_Uint8_t reserved2[32]; + udf_Uint8_t boot_use[1906]; } GNUC_PACKED; /** Flags (ECMA 167r3 2/9.4.12) */ -#define BOOT_FLAGS_ERASE 0x01 +#define BOOT_FLAGS_ERASE 0x01 /** Extent Descriptor (ECMA 167r3 3/7.1) */ struct udf_extent_ad_s { - udf_Uint32_t len; - udf_Uint32_t loc; + udf_Uint32_t len; + udf_Uint32_t loc; } GNUC_PACKED; typedef struct udf_extent_ad_s udf_extent_ad_t; @@ -270,14 +270,14 @@ typedef struct udf_extent_ad_s udf_extent_ad_t; /** Descriptor Tag (ECMA 167r3 3/7.2) */ struct udf_tag_s { - udf_Uint16_t id; - udf_Uint16_t desc_version; - udf_Uint8_t cksum; - udf_Uint8_t reserved; - udf_Uint16_t i_serial; - udf_Uint16_t desc_CRC; - udf_Uint16_t desc_CRC_len; - udf_Uint32_t loc; + udf_Uint16_t id; + udf_Uint16_t desc_version; + udf_Uint8_t cksum; + udf_Uint8_t reserved; + udf_Uint16_t i_serial; + udf_Uint16_t desc_CRC; + udf_Uint16_t desc_CRC_len; + udf_Uint32_t loc; } GNUC_PACKED; typedef struct udf_tag_s udf_tag_t; @@ -285,52 +285,52 @@ typedef struct udf_tag_s udf_tag_t; /** NSR Descriptor (ECMA 167r3 3/9.1) */ struct NSR_desc_s { - udf_Uint8_t struct_type; - udf_Uint8_t std_id[VSD_STD_ID_SIZE]; - udf_Uint8_t struct_version; - udf_Uint8_t reserved; - udf_Uint8_t struct_data[2040]; + udf_Uint8_t struct_type; + udf_Uint8_t std_id[VSD_STD_ID_SIZE]; + udf_Uint8_t struct_version; + udf_Uint8_t reserved; + udf_Uint8_t struct_data[2040]; } GNUC_PACKED; /** Primary Volume Descriptor (ECMA 167r3 3/10.1) */ struct udf_pvd_s { - udf_tag_t tag; - udf_Uint32_t vol_desc_seq_num; - udf_Uint32_t primary_vol_desc_num; - udf_dstring vol_ident[UDF_VOLID_SIZE]; - udf_Uint16_t vol_seq_num; - udf_Uint16_t max_vol_seqnum; - udf_Uint16_t interchange_lvl; - udf_Uint16_t max_interchange_lvl; - udf_Uint32_t charset_list; - udf_Uint32_t max_charset_list; - udf_dstring volset_id[UDF_VOLSET_ID_SIZE]; + udf_tag_t tag; + udf_Uint32_t vol_desc_seq_num; + udf_Uint32_t primary_vol_desc_num; + udf_dstring vol_ident[UDF_VOLID_SIZE]; + udf_Uint16_t vol_seq_num; + udf_Uint16_t max_vol_seqnum; + udf_Uint16_t interchange_lvl; + udf_Uint16_t max_interchange_lvl; + udf_Uint32_t charset_list; + udf_Uint32_t max_charset_list; + udf_dstring volset_id[UDF_VOLSET_ID_SIZE]; udf_charspec_t desc_charset; udf_charspec_t explanatory_charset; udf_extent_ad_t vol_abstract; udf_extent_ad_t vol_copyright; - udf_regid_t app_ident; + udf_regid_t app_ident; udf_timestamp_t recording_time; - udf_regid_t imp_ident; - udf_Uint8_t imp_use[64]; - udf_Uint32_t predecessor_vol_desc_seq_location; - udf_Uint16_t flags; - udf_Uint8_t reserved[22]; + udf_regid_t imp_ident; + udf_Uint8_t imp_use[64]; + udf_Uint32_t predecessor_vol_desc_seq_location; + udf_Uint16_t flags; + udf_Uint8_t reserved[22]; } GNUC_PACKED; typedef struct udf_pvd_s udf_pvd_t; /** Flags (ECMA 167r3 3/10.1.21) */ -#define PVD_FLAGS_VSID_COMMON 0x0001 +#define PVD_FLAGS_VSID_COMMON 0x0001 /** Anchor Volume Descriptor Pointer (ECMA 167r3 3/10.2) */ struct anchor_vol_desc_ptr_s { - udf_tag_t tag; + udf_tag_t tag; udf_extent_ad_t main_vol_desc_seq_ext; udf_extent_ad_t reserve_vol_desc_seq_ext; - udf_Uint8_t reserved[480]; + udf_Uint8_t reserved[480]; } GNUC_PACKED; typedef struct anchor_vol_desc_ptr_s anchor_vol_desc_ptr_t; @@ -338,10 +338,10 @@ typedef struct anchor_vol_desc_ptr_s anchor_vol_desc_ptr_t; /** Volume Descriptor Pointer (ECMA 167r3 3/10.3) */ struct vol_desc_ptr_s { - udf_tag_t tag; - udf_Uint32_t vol_desc_seq_num; + udf_tag_t tag; + udf_Uint32_t vol_desc_seq_num; udf_extent_ad_t next_vol_desc_set_ext; - udf_Uint8_t reserved[484]; + udf_Uint8_t reserved[484]; } GNUC_PACKED; /** Implementation Use Volume Descriptor (ECMA 167r3 3/10.4) */ @@ -357,45 +357,45 @@ struct imp_use_vol_desc_s struct partition_desc_s { udf_tag_t tag; - udf_Uint32_t vol_desc_seq_num; - udf_Uint16_t flags; - udf_Uint16_t number; /**< Partition number */ - udf_regid_t contents; - udf_Uint8_t contents_use[128]; - udf_Uint32_t access_type; - udf_Uint32_t start_loc; - udf_Uint32_t part_len; - udf_regid_t imp_id; - udf_Uint8_t imp_use[128]; - udf_Uint8_t reserved[156]; + udf_Uint32_t vol_desc_seq_num; + udf_Uint16_t flags; + udf_Uint16_t number; /**< Partition number */ + udf_regid_t contents; + udf_Uint8_t contents_use[128]; + udf_Uint32_t access_type; + udf_Uint32_t start_loc; + udf_Uint32_t part_len; + udf_regid_t imp_id; + udf_Uint8_t imp_use[128]; + udf_Uint8_t reserved[156]; } GNUC_PACKED; typedef struct partition_desc_s partition_desc_t; /** Partition Flags (ECMA 167r3 3/10.5.3) */ -#define PD_PARTITION_FLAGS_ALLOC 0x0001 +#define PD_PARTITION_FLAGS_ALLOC 0x0001 /** Partition Contents (ECMA 167r2 3/10.5.3) */ -#define PD_PARTITION_CONTENTS_NSR02 "+NSR02" +#define PD_PARTITION_CONTENTS_NSR02 "+NSR02" /** Partition Contents (ECMA 167r3 3/10.5.5) */ -#define PD_PARTITION_CONTENTS_FDC01 "+FDC01" -#define PD_PARTITION_CONTENTS_CD001 "+CD001" -#define PD_PARTITION_CONTENTS_CDW02 "+CDW02" -#define PD_PARTITION_CONTENTS_NSR03 "+NSR03" +#define PD_PARTITION_CONTENTS_FDC01 "+FDC01" +#define PD_PARTITION_CONTENTS_CD001 "+CD001" +#define PD_PARTITION_CONTENTS_CDW02 "+CDW02" +#define PD_PARTITION_CONTENTS_NSR03 "+NSR03" /** Access Type (ECMA 167r3 3/10.5.7) */ -#define PD_ACCESS_TYPE_NONE 0x00000000 -#define PD_ACCESS_TYPE_READ_ONLY 0x00000001 -#define PD_ACCESS_TYPE_WRITE_ONCE 0x00000002 -#define PD_ACCESS_TYPE_REWRITABLE 0x00000003 -#define PD_ACCESS_TYPE_OVERWRITABLE 0x00000004 +#define PD_ACCESS_TYPE_NONE 0x00000000 +#define PD_ACCESS_TYPE_READ_ONLY 0x00000001 +#define PD_ACCESS_TYPE_WRITE_ONCE 0x00000002 +#define PD_ACCESS_TYPE_REWRITABLE 0x00000003 +#define PD_ACCESS_TYPE_OVERWRITABLE 0x00000004 /** Recorded Address (ECMA 167r3 4/7.1) */ struct udf_lb_addr_s { - udf_Uint32_t lba; - udf_Uint16_t partitionReferenceNum; + udf_Uint32_t lba; + udf_Uint16_t partitionReferenceNum; } GNUC_PACKED; typedef struct udf_lb_addr_s udf_lb_addr_t; @@ -403,8 +403,8 @@ typedef struct udf_lb_addr_s udf_lb_addr_t; /** Short Allocation Descriptor (ECMA 167r3 4/14.14.1) */ struct udf_short_ad_s { - udf_Uint32_t len; - udf_Uint32_t pos; + udf_Uint32_t len; + udf_Uint32_t pos; } GNUC_PACKED; typedef struct udf_short_ad_s udf_short_ad_t; @@ -412,9 +412,9 @@ typedef struct udf_short_ad_s udf_short_ad_t; /** Long Allocation Descriptor (ECMA 167r3 4/14.14.2) */ struct udf_long_ad_s { - udf_Uint32_t len; - udf_lb_addr_t loc; - udf_Uint8_t imp_use[6]; + udf_Uint32_t len; + udf_lb_addr_t loc; + udf_Uint8_t imp_use[6]; } GNUC_PACKED; typedef struct udf_long_ad_s udf_long_ad_t; @@ -423,22 +423,22 @@ typedef struct udf_long_ad_s udf_long_ad_t; struct logical_vol_desc_s { udf_tag_t tag; - udf_Uint32_t seq_num; + udf_Uint32_t seq_num; udf_charspec_t desc_charset; - udf_dstring logvol_id[128]; - udf_Uint32_t logical_blocksize; - udf_regid_t domain_id; + udf_dstring logvol_id[128]; + udf_Uint32_t logical_blocksize; + udf_regid_t domain_id; union { udf_long_ad_t fsd_loc; - udf_Uint8_t logvol_content_use[16]; + udf_Uint8_t logvol_content_use[16]; } lvd_use; - udf_Uint8_t logvol_contents_use[16]; - udf_Uint32_t maptable_len; - udf_Uint32_t i_partition_maps; - udf_regid_t imp_id; - udf_Uint8_t imp_use[128]; + udf_Uint8_t logvol_contents_use[16]; + udf_Uint32_t maptable_len; + udf_Uint32_t i_partition_maps; + udf_regid_t imp_id; + udf_Uint8_t imp_use[128]; udf_extent_ad_t integrity_seq_ext; - udf_Uint8_t partition_maps[0]; + udf_Uint8_t partition_maps[0]; } GNUC_PACKED; typedef struct logical_vol_desc_s logical_vol_desc_t; @@ -446,39 +446,39 @@ typedef struct logical_vol_desc_s logical_vol_desc_t; /** Generic Partition Map (ECMA 167r3 3/10.7.1) */ struct generic_partition_map { - udf_Uint8_t partition_map_type; - udf_Uint8_t partition_map_length; - udf_Uint8_t partition_mapping[0]; + udf_Uint8_t partition_map_type; + udf_Uint8_t partition_map_length; + udf_Uint8_t partition_mapping[0]; } GNUC_PACKED; /** Partition Map Type (ECMA 167r3 3/10.7.1.1) */ -#define GP_PARTITION_MAP_TYPE_UNDEF 0x00 -#define GP_PARTIITON_MAP_TYPE_1 0x01 -#define GP_PARTITION_MAP_TYPE_2 0x02 +#define GP_PARTITION_MAP_TYPE_UNDEF 0x00 +#define GP_PARTIITON_MAP_TYPE_1 0x01 +#define GP_PARTITION_MAP_TYPE_2 0x02 /** Type 1 Partition Map (ECMA 167r3 3/10.7.2) */ struct generic_partition_map1 { - udf_Uint8_t partition_map_type; - udf_Uint8_t partition_map_length; - udf_Uint16_t vol_seq_num; - udf_Uint16_t i_partition; + udf_Uint8_t partition_map_type; + udf_Uint8_t partition_map_length; + udf_Uint16_t vol_seq_num; + udf_Uint16_t i_partition; } GNUC_PACKED; /** Type 2 Partition Map (ECMA 167r3 3/10.7.3) */ struct generic_partition_map2 { - udf_Uint8_t partition_map_type; - udf_Uint8_t partition_map_length; - udf_Uint8_t partition_id[62]; + udf_Uint8_t partition_map_type; + udf_Uint8_t partition_map_length; + udf_Uint8_t partition_id[62]; } GNUC_PACKED; /** Unallocated Space Descriptor (ECMA 167r3 3/10.8) */ struct unalloc_space_desc_s { udf_tag_t tag; - udf_Uint32_t vol_desc_seq_num; - udf_Uint32_t i_alloc_descs; + udf_Uint32_t vol_desc_seq_num; + udf_Uint32_t i_alloc_descs; udf_extent_ad_t allocDescs[0]; } GNUC_PACKED; @@ -486,7 +486,7 @@ struct unalloc_space_desc_s struct terminating_desc_s { udf_tag_t tag; - udf_Uint8_t reserved[496]; + udf_Uint8_t reserved[496]; } GNUC_PACKED; /** Logical Volume Integrity Descriptor (ECMA 167r3 3/10.10) */ @@ -516,16 +516,16 @@ struct logvol_integrity_desc_s } GNUC_PACKED; /** Integrity Type (ECMA 167r3 3/10.10.3) */ -#define LVID_INTEGRITY_TYPE_OPEN 0x00000000 -#define LVID_INTEGRITY_TYPE_CLOSE 0x00000001 +#define LVID_INTEGRITY_TYPE_OPEN 0x00000000 +#define LVID_INTEGRITY_TYPE_CLOSE 0x00000001 /** Extended Allocation Descriptor (ECMA 167r3 4/14.14.3) */ struct udf_ext_ad_s { - udf_Uint32_t len; - udf_Uint32_t recorded_len; - udf_Uint32_t information_len; - udf_lb_addr_t ext_loc; + udf_Uint32_t len; + udf_Uint32_t recorded_len; + udf_Uint32_t information_len; + udf_lb_addr_t ext_loc; } GNUC_PACKED; typedef struct udf_ext_ad_s udf_ext_ad_t; @@ -539,23 +539,23 @@ struct udf_fsd_s { udf_tag_t tag; udf_timestamp_t recording_time; - udf_Uint16_t interchange_lvl; - udf_Uint16_t maxInterchange_lvl; - udf_Uint32_t charset_list; - udf_Uint32_t max_charset_list; - udf_Uint32_t fileset_num; - udf_Uint32_t udf_fsd_num; + udf_Uint16_t interchange_lvl; + udf_Uint16_t maxInterchange_lvl; + udf_Uint32_t charset_list; + udf_Uint32_t max_charset_list; + udf_Uint32_t fileset_num; + udf_Uint32_t udf_fsd_num; udf_charspec_t logical_vol_id_charset; - udf_dstring logical_vol_id[128]; + udf_dstring logical_vol_id[128]; udf_charspec_t fileset_charset; - udf_dstring fileSet_id[32]; - udf_dstring copyright_file_id[32]; - udf_dstring abstract_file_id[32]; - udf_long_ad_t root_icb; - udf_regid_t domain_id; - udf_long_ad_t next_ext; - udf_long_ad_t stream_directory_ICB; - udf_Uint8_t reserved[32]; + udf_dstring fileSet_id[32]; + udf_dstring copyright_file_id[32]; + udf_dstring abstract_file_id[32]; + udf_long_ad_t root_icb; + udf_regid_t domain_id; + udf_long_ad_t next_ext; + udf_long_ad_t stream_directory_ICB; + udf_Uint8_t reserved[32]; } GNUC_PACKED; typedef struct udf_fsd_s udf_fsd_t; @@ -568,7 +568,7 @@ struct partition_header_desc_s udf_short_ad_t partition_integrity_table; udf_short_ad_t freed_space_table; udf_short_ad_t freed_space_bitmap; - udf_Uint8_t reserved[88]; + udf_Uint8_t reserved[88]; } GNUC_PACKED; typedef struct partition_header_desc_s partition_header_desc_t; @@ -577,28 +577,28 @@ typedef struct partition_header_desc_s partition_header_desc_t; struct udf_fileid_desc_s { udf_tag_t tag; - udf_Uint16_t file_version_num; - udf_Uint8_t file_characteristics; - udf_Uint8_t i_file_id; - udf_long_ad_t icb; + udf_Uint16_t file_version_num; + udf_Uint8_t file_characteristics; + udf_Uint8_t i_file_id; + udf_long_ad_t icb; /* MSVC workaround for multiple zero sized arrays Unlike what is the case with GNU, and against logic, an union of zero sized arrays in the Microsoft world is not zero bytes but one byte! - Thus, for sizeof() is consistent across platforms, we have to use an + Thus, for sizeof() to be consistent across platforms, we must use an ugly workaround that attaches the union to the last non-zero member. */ union { - udf_Uint16_t i_imp_use; + udf_Uint16_t i_imp_use; struct { - udf_Uint16_t unused; - udf_Uint8_t data[0]; + udf_Uint16_t unused; + udf_Uint8_t data[0]; } imp_use; struct { - udf_Uint16_t unused; - udf_Uint8_t data[0]; + udf_Uint16_t unused; + udf_Uint8_t data[0]; } file_id; struct { - udf_Uint16_t unused; - udf_Uint8_t data[0]; + udf_Uint16_t unused; + udf_Uint8_t data[0]; } padding; } u; } GNUC_PACKED; @@ -611,11 +611,11 @@ typedef struct udf_fileid_desc_s udf_fileid_desc_t; bitmask rather than distinct values of an enum. */ typedef enum { - UDF_FILE_HIDDEN = (1 << 0), - UDF_FILE_DIRECTORY = (1 << 1), - UDF_FILE_DELETED = (1 << 2), - UDF_FILE_PARENT = (1 << 3), - UDF_FILE_METADATA = (1 << 4) + UDF_FILE_HIDDEN = (1 << 0), + UDF_FILE_DIRECTORY = (1 << 1), + UDF_FILE_DELETED = (1 << 2), + UDF_FILE_PARENT = (1 << 3), + UDF_FILE_METADATA = (1 << 4) } file_characteristics_t; /** Allocation Ext Descriptor (ECMA 167r3 4/14.5) */ @@ -629,32 +629,32 @@ struct allocExtDesc /** ICB Tag (ECMA 167r3 4/14.6) */ struct udf_icbtag_s { - udf_Uint32_t prev_num_dirs; - udf_Uint16_t strat_type; - udf_Uint16_t strat_param; - udf_Uint16_t max_num_entries; - udf_Uint8_t reserved; - udf_Uint8_t file_type; - udf_lb_addr_t parent_ICB; - udf_Uint16_t flags; + udf_Uint32_t prev_num_dirs; + udf_Uint16_t strat_type; + udf_Uint16_t strat_param; + udf_Uint16_t max_num_entries; + udf_Uint8_t reserved; + udf_Uint8_t file_type; + udf_lb_addr_t parent_ICB; + udf_Uint16_t flags; } GNUC_PACKED; typedef struct udf_icbtag_s udf_icbtag_t; -#define UDF_ICB_TAG_FLAGS_SETUID 0x40 -#define UDF_ICB_TAG_FLAGS_SETGID 0x80 -#define UDF_ICB_TAG_FLAGS_STICKY 0x100 +#define UDF_ICB_TAG_FLAGS_SETUID 0x40 +#define UDF_ICB_TAG_FLAGS_SETGID 0x80 +#define UDF_ICB_TAG_FLAGS_STICKY 0x100 /** Strategy Type (ECMA 167r3 4/14.6.2) which helpfully points largely to 4/A.x */ #define ICBTAG_STRATEGY_TYPE_UNDEF 0x0000 -#define ICBTAG_STRATEGY_TYPE_1 0x0001 /**< 4/A.2 Direct entries Uint16 */ -#define ICBTAG_STRATEGY_TYPE_2 0x0002 /**< 4/A.3 List of ICB direct entries */ -#define ICBTAG_STRATEGY_TYPE_3 0x0003 /**< 4/A.4 */ -#define ICBTAG_STRATEGY_TYPE_4 0x0004 /**< 4/A.5 Hierarchy having one - single ICB with one direct entry. - This is what's most often used. - */ +#define ICBTAG_STRATEGY_TYPE_1 0x0001 /**< 4/A.2 Direct entries Uint16 */ +#define ICBTAG_STRATEGY_TYPE_2 0x0002 /**< 4/A.3 List of ICB direct entries */ +#define ICBTAG_STRATEGY_TYPE_3 0x0003 /**< 4/A.4 */ +#define ICBTAG_STRATEGY_TYPE_4 0x0004 /**< 4/A.5 Hierarchy having one + single ICB with one direct entry. + This is what's most often used. + */ /** File Type (ECMA 167r3 4/14.6.6) @@ -662,307 +662,307 @@ typedef struct udf_icbtag_s udf_icbtag_t; distinct values of an enum. */ typedef enum { - ICBTAG_FILE_TYPE_UNDEF = 0x00, - ICBTAG_FILE_TYPE_USE = 0x01, - ICBTAG_FILE_TYPE_PIE = 0x02, - ICBTAG_FILE_TYPE_IE = 0x03, - ICBTAG_FILE_TYPE_DIRECTORY = 0x04, - ICBTAG_FILE_TYPE_REGULAR = 0x05, - ICBTAG_FILE_TYPE_BLOCK = 0x06, - ICBTAG_FILE_TYPE_CHAR = 0x07, - ICBTAG_FILE_TYPE_EA = 0x08, - ICBTAG_FILE_TYPE_FIFO = 0x09, - ICBTAG_FILE_TYPE_SOCKET = 0x0A, - ICBTAG_FILE_TYPE_TE = 0x0B, - ICBTAG_FILE_TYPE_SYMLINK = 0x0C, - ICBTAG_FILE_TYPE_STREAMDIR = 0x0D + ICBTAG_FILE_TYPE_UNDEF = 0x00, + ICBTAG_FILE_TYPE_USE = 0x01, + ICBTAG_FILE_TYPE_PIE = 0x02, + ICBTAG_FILE_TYPE_IE = 0x03, + ICBTAG_FILE_TYPE_DIRECTORY = 0x04, + ICBTAG_FILE_TYPE_REGULAR = 0x05, + ICBTAG_FILE_TYPE_BLOCK = 0x06, + ICBTAG_FILE_TYPE_CHAR = 0x07, + ICBTAG_FILE_TYPE_EA = 0x08, + ICBTAG_FILE_TYPE_FIFO = 0x09, + ICBTAG_FILE_TYPE_SOCKET = 0x0A, + ICBTAG_FILE_TYPE_TE = 0x0B, + ICBTAG_FILE_TYPE_SYMLINK = 0x0C, + ICBTAG_FILE_TYPE_STREAMDIR = 0x0D } icbtag_file_type_enum_t; /** Flags (ECMA 167r3 4/14.6.8) */ typedef enum { - ICBTAG_FLAG_AD_MASK = 0x0007, /**< "&" this to get below address - flags */ - ICBTAG_FLAG_AD_SHORT = 0x0000, /**< The allocation descriptor - field is filled with - short_ad's. If the - offset is beyond the - current extent, look for - the next extent. */ - ICBTAG_FLAG_AD_LONG = 0x0001, /**< The allocation descriptor - field is filled with - long_ad's If the offset - is beyond the current - extent, look for the next - extent. */ - ICBTAG_FLAG_AD_EXTENDED = 0x0002, - ICBTAG_FLAG_AD_IN_ICB = 0x0003, /**< This type means that the - file *data* is stored in - the allocation descriptor - field of the file entry. */ - ICBTAG_FLAG_SORTED = 0x0008, - ICBTAG_FLAG_NONRELOCATABLE = 0x0010, - ICBTAG_FLAG_ARCHIVE = 0x0020, - ICBTAG_FLAG_SETUID = 0x0040, - ICBTAG_FLAG_SETGID = 0x0080, - ICBTAG_FLAG_STICKY = 0x0100, - ICBTAG_FLAG_CONTIGUOUS = 0x0200, - ICBTAG_FLAG_SYSTEM = 0x0400, - ICBTAG_FLAG_TRANSFORMED = 0x0800, - ICBTAG_FLAG_MULTIVERSIONS = 0x1000, - ICBTAG_FLAG_STREAM = 0x2000 + ICBTAG_FLAG_AD_MASK = 0x0007, /**< "&" this to get below address + flags */ + ICBTAG_FLAG_AD_SHORT = 0x0000, /**< The allocation descriptor + field is filled with + short_ad's. If the + offset is beyond the + current extent, look for + the next extent. */ + ICBTAG_FLAG_AD_LONG = 0x0001, /**< The allocation descriptor + field is filled with + long_ad's If the offset + is beyond the current + extent, look for the next + extent. */ + ICBTAG_FLAG_AD_EXTENDED = 0x0002, + ICBTAG_FLAG_AD_IN_ICB = 0x0003, /**< This type means that the + file *data* is stored in + the allocation descriptor + field of the file entry. */ + ICBTAG_FLAG_SORTED = 0x0008, + ICBTAG_FLAG_NONRELOCATABLE = 0x0010, + ICBTAG_FLAG_ARCHIVE = 0x0020, + ICBTAG_FLAG_SETUID = 0x0040, + ICBTAG_FLAG_SETGID = 0x0080, + ICBTAG_FLAG_STICKY = 0x0100, + ICBTAG_FLAG_CONTIGUOUS = 0x0200, + ICBTAG_FLAG_SYSTEM = 0x0400, + ICBTAG_FLAG_TRANSFORMED = 0x0800, + ICBTAG_FLAG_MULTIVERSIONS = 0x1000, + ICBTAG_FLAG_STREAM = 0x2000 } icbtag_flag_enum_t; /** Indirect Entry (ECMA 167r3 4/14.7) */ struct indirect_entry_s { udf_tag_t tag; - udf_icbtag_t icb_tag; - udf_long_ad_t indirect_ICB; + udf_icbtag_t icb_tag; + udf_long_ad_t indirect_ICB; } GNUC_PACKED; /** Terminal Entry (ECMA 167r3 4/14.8) */ struct terminal_entry_s { udf_tag_t tag; - udf_icbtag_t icb_tag; + udf_icbtag_t icb_tag; } GNUC_PACKED; /** File Entry (ECMA 167r3 4/14.9) */ struct udf_file_entry_s { udf_tag_t tag; - udf_icbtag_t icb_tag; /**< 4/14.9.2 */ - udf_Uint32_t uid; /**< 4/14.9.3 */ - udf_Uint32_t gid; /**< 4/14.9.4 */ - udf_Uint32_t permissions; /**< 4/14.9.5 */ - udf_Uint16_t link_count; /**< 4/14.9.6 */ - udf_Uint8_t rec_format; /**< 4/14.9.7 */ - udf_Uint8_t rec_disp_attr; /**< 4/14.9.8 */ - udf_Uint32_t rec_len; /**< 4/14.9.9 */ - udf_Uint64_t info_len; /**< 4/14.9.10 */ - udf_Uint64_t logblks_recorded; /**< 4/14.9.11 */ + udf_icbtag_t icb_tag; /**< 4/14.9.2 */ + udf_Uint32_t uid; /**< 4/14.9.3 */ + udf_Uint32_t gid; /**< 4/14.9.4 */ + udf_Uint32_t permissions; /**< 4/14.9.5 */ + udf_Uint16_t link_count; /**< 4/14.9.6 */ + udf_Uint8_t rec_format; /**< 4/14.9.7 */ + udf_Uint8_t rec_disp_attr; /**< 4/14.9.8 */ + udf_Uint32_t rec_len; /**< 4/14.9.9 */ + udf_Uint64_t info_len; /**< 4/14.9.10 */ + udf_Uint64_t logblks_recorded; /**< 4/14.9.11 */ udf_timestamp_t access_time; /**< 4/14.9.12 - last access to - any stream of file prior to - recording file entry */ + any stream of file prior to + recording file entry */ udf_timestamp_t modification_time; /**< 4/14.9.13 - last access to - modification to any stream of - file */ + modification to any stream of + file */ udf_timestamp_t attribute_time; - udf_Uint32_t checkpoint; - udf_long_ad_t ext_attr_ICB; - udf_regid_t imp_id; - udf_Uint64_t unique_ID; - udf_Uint32_t i_extended_attr; - udf_Uint32_t i_alloc_descs; + udf_Uint32_t checkpoint; + udf_long_ad_t ext_attr_ICB; + udf_regid_t imp_id; + udf_Uint64_t unique_ID; + udf_Uint32_t i_extended_attr; + udf_Uint32_t i_alloc_descs; /* The following union allows file entry reuse without worrying about overflows, by ensuring the struct is always the maximum possible size allowed by the specs: one UDF block. */ union { - udf_Uint8_t ext_attr[0]; - udf_Uint8_t alloc_descs[0]; - udf_Uint8_t pad_to_one_block[2048-176]; + udf_Uint8_t ext_attr[0]; + udf_Uint8_t alloc_descs[0]; + udf_Uint8_t pad_to_one_block[2048-176]; } u; } GNUC_PACKED; typedef struct udf_file_entry_s udf_file_entry_t; -#define UDF_FENTRY_SIZE 176 -#define UDF_FENTRY_PERM_USER_MASK 0x07 -#define UDF_FENTRY_PERM_GRP_MASK 0xE0 -#define UDF_FENTRY_PERM_OWNER_MASK 0x1C00 +#define UDF_FENTRY_SIZE 176 +#define UDF_FENTRY_PERM_USER_MASK 0x07 +#define UDF_FENTRY_PERM_GRP_MASK 0xE0 +#define UDF_FENTRY_PERM_OWNER_MASK 0x1C00 /** Permissions (ECMA 167r3 4/14.9.5) */ -#define FE_PERM_O_EXEC 0x00000001U -#define FE_PERM_O_WRITE 0x00000002U -#define FE_PERM_O_READ 0x00000004U -#define FE_PERM_O_CHATTR 0x00000008U -#define FE_PERM_O_DELETE 0x00000010U -#define FE_PERM_G_EXEC 0x00000020U -#define FE_PERM_G_WRITE 0x00000040U -#define FE_PERM_G_READ 0x00000080U -#define FE_PERM_G_CHATTR 0x00000100U -#define FE_PERM_G_DELETE 0x00000200U -#define FE_PERM_U_EXEC 0x00000400U -#define FE_PERM_U_WRITE 0x00000800U -#define FE_PERM_U_READ 0x00001000U -#define FE_PERM_U_CHATTR 0x00002000U -#define FE_PERM_U_DELETE 0x00004000U +#define FE_PERM_O_EXEC 0x00000001U +#define FE_PERM_O_WRITE 0x00000002U +#define FE_PERM_O_READ 0x00000004U +#define FE_PERM_O_CHATTR 0x00000008U +#define FE_PERM_O_DELETE 0x00000010U +#define FE_PERM_G_EXEC 0x00000020U +#define FE_PERM_G_WRITE 0x00000040U +#define FE_PERM_G_READ 0x00000080U +#define FE_PERM_G_CHATTR 0x00000100U +#define FE_PERM_G_DELETE 0x00000200U +#define FE_PERM_U_EXEC 0x00000400U +#define FE_PERM_U_WRITE 0x00000800U +#define FE_PERM_U_READ 0x00001000U +#define FE_PERM_U_CHATTR 0x00002000U +#define FE_PERM_U_DELETE 0x00004000U /** Record Format (ECMA 167r3 4/14.9.7) */ -#define FE_RECORD_FMT_UNDEF 0x00 -#define FE_RECORD_FMT_FIXED_PAD 0x01 -#define FE_RECORD_FMT_FIXED 0x02 -#define FE_RECORD_FMT_VARIABLE8 0x03 -#define FE_RECORD_FMT_VARIABLE16 0x04 -#define FE_RECORD_FMT_VARIABLE16_MSB 0x05 -#define FE_RECORD_FMT_VARIABLE32 0x06 -#define FE_RECORD_FMT_PRINT 0x07 -#define FE_RECORD_FMT_LF 0x08 -#define FE_RECORD_FMT_CR 0x09 -#define FE_RECORD_FMT_CRLF 0x0A -#define FE_RECORD_FMT_LFCR 0x0B +#define FE_RECORD_FMT_UNDEF 0x00 +#define FE_RECORD_FMT_FIXED_PAD 0x01 +#define FE_RECORD_FMT_FIXED 0x02 +#define FE_RECORD_FMT_VARIABLE8 0x03 +#define FE_RECORD_FMT_VARIABLE16 0x04 +#define FE_RECORD_FMT_VARIABLE16_MSB 0x05 +#define FE_RECORD_FMT_VARIABLE32 0x06 +#define FE_RECORD_FMT_PRINT 0x07 +#define FE_RECORD_FMT_LF 0x08 +#define FE_RECORD_FMT_CR 0x09 +#define FE_RECORD_FMT_CRLF 0x0A +#define FE_RECORD_FMT_LFCR 0x0B /** Record Display Attributes (ECMA 167r3 4/14.9.8) */ -#define FE_RECORD_DISPLAY_ATTR_UNDEF 0x00 -#define FE_RECORD_DISPLAY_ATTR_1 0x01 -#define FE_RECORD_DISPLAY_ATTR_2 0x02 -#define FE_RECORD_DISPLAY_ATTR_3 0x03 +#define FE_RECORD_DISPLAY_ATTR_UNDEF 0x00 +#define FE_RECORD_DISPLAY_ATTR_1 0x01 +#define FE_RECORD_DISPLAY_ATTR_2 0x02 +#define FE_RECORD_DISPLAY_ATTR_3 0x03 /** Extended Attribute Header Descriptor (ECMA 167r3 4/14.10.1) */ struct extended_attr_header_desc_s { udf_tag_t tag; - udf_Uint32_t imp_attr_location; - udf_Uint32_t app_attr_location; + udf_Uint32_t imp_attr_location; + udf_Uint32_t app_attr_location; } GNUC_PACKED; /** Generic Format (ECMA 167r3 4/14.10.2) */ struct generic_format_s { - udf_Uint32_t attr_type; - udf_Uint8_t attr_subtype; - udf_Uint8_t reserved[3]; - udf_Uint32_t attrLength; - udf_Uint8_t attrData[0]; + udf_Uint32_t attr_type; + udf_Uint8_t attr_subtype; + udf_Uint8_t reserved[3]; + udf_Uint32_t attrLength; + udf_Uint8_t attrData[0]; } GNUC_PACKED; /** Character Set Information (ECMA 167r3 4/14.10.3) */ struct charSet_info_s { - udf_Uint32_t attr_type; - udf_Uint8_t attr_subtype; - udf_Uint8_t reserved[3]; - udf_Uint32_t attrLength; - udf_Uint32_t escapeSeqLength; - udf_Uint8_t charSetType; - udf_Uint8_t escapeSeq[0]; + udf_Uint32_t attr_type; + udf_Uint8_t attr_subtype; + udf_Uint8_t reserved[3]; + udf_Uint32_t attrLength; + udf_Uint32_t escapeSeqLength; + udf_Uint8_t charSetType; + udf_Uint8_t escapeSeq[0]; } GNUC_PACKED; /* Alternate Permissions (ECMA 167r3 4/14.10.4) */ struct alt_perms_s { - udf_Uint32_t attr_type; - udf_Uint8_t attr_subtype; - udf_Uint8_t reserved[3]; - udf_Uint32_t attrLength; - udf_Uint16_t owner_id; - udf_Uint16_t group_id; - udf_Uint16_t permission; + udf_Uint32_t attr_type; + udf_Uint8_t attr_subtype; + udf_Uint8_t reserved[3]; + udf_Uint32_t attrLength; + udf_Uint16_t owner_id; + udf_Uint16_t group_id; + udf_Uint16_t permission; } GNUC_PACKED; /** File Times Extended Attribute (ECMA 167r3 4/14.10.5) */ struct filetimes_ext_attr_s { - udf_Uint32_t attr_type; - udf_Uint8_t attr_subtype; - udf_Uint8_t reserved[3]; - udf_Uint32_t attrLength; - udf_Uint32_t dataLength; - udf_Uint32_t fileTimeExistence; - udf_Uint8_t fileTimes; + udf_Uint32_t attr_type; + udf_Uint8_t attr_subtype; + udf_Uint8_t reserved[3]; + udf_Uint32_t attrLength; + udf_Uint32_t dataLength; + udf_Uint32_t fileTimeExistence; + udf_Uint8_t fileTimes; } GNUC_PACKED; /** FileTimeExistence (ECMA 167r3 4/14.10.5.6) */ -#define FTE_CREATION 0x00000001 -#define FTE_DELETION 0x00000004 -#define FTE_EFFECTIVE 0x00000008 -#define FTE_BACKUP 0x00000002 +#define FTE_CREATION 0x00000001 +#define FTE_DELETION 0x00000004 +#define FTE_EFFECTIVE 0x00000008 +#define FTE_BACKUP 0x00000002 /** Information Times Extended Attribute (ECMA 167r3 4/14.10.6) */ struct infoTimesExtAttr { - udf_Uint32_t attr_type; - udf_Uint8_t attr_subtype; - udf_Uint8_t reserved[3]; - udf_Uint32_t attrLength; - udf_Uint32_t dataLength; - udf_Uint32_t infoTimeExistence; - udf_Uint8_t infoTimes[0]; + udf_Uint32_t attr_type; + udf_Uint8_t attr_subtype; + udf_Uint8_t reserved[3]; + udf_Uint32_t attrLength; + udf_Uint32_t dataLength; + udf_Uint32_t infoTimeExistence; + udf_Uint8_t infoTimes[0]; } GNUC_PACKED; /** Device Specification (ECMA 167r3 4/14.10.7) */ struct deviceSpec { - udf_Uint32_t attr_type; - udf_Uint8_t attr_subtype; - udf_Uint8_t reserved[3]; - udf_Uint32_t attrLength; - udf_Uint32_t imp_useLength; - udf_Uint32_t majorDevice_id; - udf_Uint32_t minorDevice_id; - udf_Uint8_t imp_use[0]; + udf_Uint32_t attr_type; + udf_Uint8_t attr_subtype; + udf_Uint8_t reserved[3]; + udf_Uint32_t attrLength; + udf_Uint32_t imp_useLength; + udf_Uint32_t majorDevice_id; + udf_Uint32_t minorDevice_id; + udf_Uint8_t imp_use[0]; } GNUC_PACKED; /** Implementation Use Extended Attr (ECMA 167r3 4/14.10.8) */ struct impUseExtAttr { - udf_Uint32_t attr_type; - udf_Uint8_t attr_subtype; - udf_Uint8_t reserved[3]; - udf_Uint32_t attrLength; - udf_Uint32_t imp_useLength; - udf_regid_t imp_id; - udf_Uint8_t imp_use[0]; + udf_Uint32_t attr_type; + udf_Uint8_t attr_subtype; + udf_Uint8_t reserved[3]; + udf_Uint32_t attrLength; + udf_Uint32_t imp_useLength; + udf_regid_t imp_id; + udf_Uint8_t imp_use[0]; } GNUC_PACKED; /** Application Use Extended Attribute (ECMA 167r3 4/14.10.9) */ struct appUseExtAttr { - udf_Uint32_t attr_type; - udf_Uint8_t attr_subtype; - udf_Uint8_t reserved[3]; - udf_Uint32_t attrLength; - udf_Uint32_t appUseLength; - udf_regid_t app_id; - udf_Uint8_t appUse[0]; + udf_Uint32_t attr_type; + udf_Uint8_t attr_subtype; + udf_Uint8_t reserved[3]; + udf_Uint32_t attrLength; + udf_Uint32_t appUseLength; + udf_regid_t app_id; + udf_Uint8_t appUse[0]; } GNUC_PACKED; -#define EXTATTR_CHAR_SET 1 -#define EXTATTR_ALT_PERMS 3 -#define EXTATTR_FILE_TIMES 5 -#define EXTATTR_INFO_TIMES 6 -#define EXTATTR_DEV_SPEC 12 -#define EXTATTR_IMP_USE 2048 -#define EXTATTR_APP_USE 65536 +#define EXTATTR_CHAR_SET 1 +#define EXTATTR_ALT_PERMS 3 +#define EXTATTR_FILE_TIMES 5 +#define EXTATTR_INFO_TIMES 6 +#define EXTATTR_DEV_SPEC 12 +#define EXTATTR_IMP_USE 2048 +#define EXTATTR_APP_USE 65536 /** Unallocated Space Entry (ECMA 167r3 4/14.11) */ struct unallocSpaceEntry { udf_tag_t tag; - udf_icbtag_t icb_tag; - udf_Uint32_t lengthAllocDescs; - udf_Uint8_t allocDescs[0]; + udf_icbtag_t icb_tag; + udf_Uint32_t lengthAllocDescs; + udf_Uint8_t allocDescs[0]; } GNUC_PACKED; /** Space Bitmap Descriptor (ECMA 167r3 4/14.12) */ struct spaceBitmapDesc { udf_tag_t tag; - udf_Uint32_t i_bits; - udf_Uint32_t i_bytes; - udf_Uint8_t bitmap[0]; + udf_Uint32_t i_bits; + udf_Uint32_t i_bytes; + udf_Uint8_t bitmap[0]; } GNUC_PACKED; /** Partition Integrity Entry (ECMA 167r3 4/14.13) */ struct partitionIntegrityEntry { udf_tag_t tag; - udf_icbtag_t icb_tag; + udf_icbtag_t icb_tag; udf_timestamp_t recording_time; - udf_Uint8_t integrityType; - udf_Uint8_t reserved[175]; - udf_regid_t imp_id; - udf_Uint8_t imp_use[256]; + udf_Uint8_t integrityType; + udf_Uint8_t reserved[175]; + udf_regid_t imp_id; + udf_Uint8_t imp_use[256]; } GNUC_PACKED; /** Short Allocation Descriptor (ECMA 167r3 4/14.14.1) */ /** Extent Length (ECMA 167r3 4/14.14.1.1) */ -#define EXT_RECORDED_ALLOCATED 0x00000000 -#define EXT_NOT_RECORDED_ALLOCATED 0x40000000 -#define EXT_NOT_RECORDED_NOT_ALLOCATED 0x80000000 -#define EXT_NEXT_EXTENT_ALLOCDECS 0xC0000000 +#define EXT_RECORDED_ALLOCATED 0x00000000 +#define EXT_NOT_RECORDED_ALLOCATED 0x40000000 +#define EXT_NOT_RECORDED_NOT_ALLOCATED 0x80000000 +#define EXT_NEXT_EXTENT_ALLOCDECS 0xC0000000 /** Long Allocation Descriptor (ECMA 167r3 4/14.14.2) */ @@ -971,8 +971,8 @@ struct partitionIntegrityEntry /** Logical Volume Header Descriptor (ECMA 167r3 4/14.15) */ struct logical_vol_header_desc_s { - udf_Uint64_t uniqueID; - udf_Uint8_t reserved[24]; + udf_Uint64_t uniqueID; + udf_Uint8_t reserved[24]; } GNUC_PACKED; typedef struct logical_vol_header_desc_s logical_vol_header_desc_t; @@ -980,16 +980,16 @@ typedef struct logical_vol_header_desc_s logical_vol_header_desc_t; /** Path Component (ECMA 167r3 4/14.16.1) */ struct pathComponent { - udf_Uint8_t component_type; - udf_Uint8_t lengthComponent_id; - udf_Uint16_t componentFileVersionNum; - udf_dstring component_id[0]; + udf_Uint8_t component_type; + udf_Uint8_t lengthComponent_id; + udf_Uint16_t componentFileVersionNum; + udf_dstring component_id[0]; } GNUC_PACKED; /** File Entry (ECMA 167r3 4/14.17) */ struct extended_file_entry { - udf_tag_t tag; /**< 4/14.17.1 - id = 266 */ + udf_tag_t tag; /**< 4/14.17.1 - id = 266 */ udf_icbtag_t icb_tag; /**< 4/14.17.2 & 4/14.9.2 */ udf_Uint32_t uid; /**< 4/14.17.3 & 4/14.9.3 */ udf_Uint32_t gid; /**< 4/14.17.4 & 4/14.9.4 */ @@ -1002,14 +1002,14 @@ struct extended_file_entry udf_Uint64_t object_size; /**< 4/14.17.11 */ udf_Uint64_t logblks_recorded; /**< 4/14.17.12 & 4/14.9.11 */ udf_timestamp_t access_time; /**< 4/14.17.13 & 4/14.9.12 - last - access to any stream of file */ + access to any stream of file */ udf_timestamp_t modification_time; /**< 4/14.17.14 & 4/14.9.13 - last - modification to any stream of - file*/ + modification to any stream of + file*/ udf_timestamp_t create_time; /**< 4/14.17.15 */ udf_timestamp_t attribute_time; /**< 4/14.17.16 & 4/14.9.14 - - most recent create or modify - time */ + most recent create or modify + time */ udf_Uint32_t checkpoint; udf_Uint32_t reserved; /**< #00 bytes */ udf_long_ad_t ext_attr_ICB; @@ -1021,7 +1021,7 @@ struct extended_file_entry union { /* MSVC workaround for multiple zero sized arrays */ udf_Uint8_t ext_attr[0]; udf_Uint8_t alloc_descs[0]; - udf_Uint8_t pad_to_one_block[2048-216]; + udf_Uint8_t pad_to_one_block[2048-216]; } u; } GNUC_PACKED; @@ -1039,4 +1039,4 @@ extern icbtag_flag_enum_t debug_flag_enum; extern ecma_167_enum1_t debug_ecma_167_enum1; extern ecma_167_timezone_enum_t debug_ecma_167_timezone_enum; -#endif /* _ECMA_167_H */ +#endif /* CDIO_ECMA_167_H */ diff --git a/src/libcdio/cdio/iso9660.h b/src/libcdio/cdio/iso9660.h index 942c52d8..e52e8ebc 100644 --- a/src/libcdio/cdio/iso9660.h +++ b/src/libcdio/cdio/iso9660.h @@ -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 Copyright (C) 2000 Herbert Valerio Riedel @@ -33,8 +31,8 @@ */ -#ifndef __CDIO_ISO9660_H__ -#define __CDIO_ISO9660_H__ +#ifndef CDIO_ISO9660_H_ +#define CDIO_ISO9660_H_ #include @@ -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: diff --git a/src/libcdio/cdio/logging.h b/src/libcdio/cdio/logging.h index ad1f5d95..fe81f4ed 100644 --- a/src/libcdio/cdio/logging.h +++ b/src/libcdio/cdio/logging.h @@ -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 + Copyright (C) 2003, 2004, 2008, 2012 Rocky Bernstein Copyright (C) 2000 Herbert Valerio Riedel 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 @@ -128,7 +126,7 @@ void cdio_error (const char format[], ...) GNUC_PRINTF(1,2); } #endif -#endif /* __LOGGING_H__ */ +#endif /* CDIO_LOGGING_H_ */ /* diff --git a/src/libcdio/cdio/posix.h b/src/libcdio/cdio/posix.h index 89e0ad37..54e503c2 100644 --- a/src/libcdio/cdio/posix.h +++ b/src/libcdio/cdio/posix.h @@ -1,7 +1,5 @@ /* - $Id: posix.h,v 1.2 2008/03/25 15:59:09 karl Exp $ - - Copyright (C) 2005, 2008 Rocky Bernstein + Copyright (C) 2005, 2008, 2012 Rocky Bernstein 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_ */ /* diff --git a/src/libcdio/cdio/read.h b/src/libcdio/cdio/read.h index bc13b5f7..80731780 100644 --- a/src/libcdio/cdio/read.h +++ b/src/libcdio/cdio/read.h @@ -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 + Copyright (C) 2005, 2006, 2007, 2008, 2012 Rocky Bernstein 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 @@ -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_ */ diff --git a/src/libcdio/cdio/rock.h b/src/libcdio/cdio/rock.h index 3a24f911..8ae66807 100644 --- a/src/libcdio/cdio/rock.h +++ b/src/libcdio/cdio/rock.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2005, 2006 2008 Rocky Bernstein + Copyright (C) 2005, 2006 2008, 2012 Rocky Bernstein 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 @@ -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: diff --git a/src/libcdio/cdio/sector.h b/src/libcdio/cdio/sector.h index 6e308338..c26fbd10 100644 --- a/src/libcdio/cdio/sector.h +++ b/src/libcdio/cdio/sector.h @@ -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 + Copyright (C) 2003, 2004, 2005, 2006, 2008, 2012 + Rocky Bernstein Copyright (C) 2000 Herbert Valerio Riedel 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 @@ -151,7 +153,7 @@ #define CDIO_CD_FRAMESIZE_RAW 2352 /**< bytes per frame, "raw" mode */ #define CDIO_CD_FRAMESIZE_RAWER 2646 /**< The maximum possible returned bytes */ -#define CDIO_CD_FRAMESIZE_RAW1 (CDIO_CD_CD_FRAMESIZE_RAW-CDIO_CD_SYNC_SIZE) /*2340*/ +#define CDIO_CD_FRAMESIZE_RAW1 (CDIO_CD_FRAMESIZE_RAW-CDIO_CD_SYNC_SIZE) /*2340*/ #define CDIO_CD_FRAMESIZE_RAW0 (CDIO_CD_FRAMESIZE_RAW-CDIO_CD_SYNC_SIZE-CDIO_CD_HEADER_SIZE) /*2336*/ /*! "before data" part of raw XA (green, mode2) frame */ @@ -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_ */ /* diff --git a/src/libcdio/cdio/track.h b/src/libcdio/cdio/track.h index 8eccfdd8..e5b9461a 100644 --- a/src/libcdio/cdio/track.h +++ b/src/libcdio/cdio/track.h @@ -1,7 +1,5 @@ /* - $Id: track.h,v 1.14 2008/03/25 15:59:09 karl Exp $ - - Copyright (C) 2005, 2006, 2008 Rocky Bernstein + Copyright (C) 2005, 2006, 2008, 2012 Rocky Bernstein 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 @@ -20,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" { @@ -36,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; @@ -53,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 @@ -72,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, @@ -88,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; /*! @@ -132,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. @@ -230,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 @@ -252,5 +250,4 @@ extern "C" { } #endif /* __cplusplus */ -#endif /* __CDIO_TRACK_H__ */ - +#endif /* CDIO_TRACK_H_ */ diff --git a/src/libcdio/cdio/types.h b/src/libcdio/cdio/types.h index 2a6a70d8..d00c3590 100644 --- a/src/libcdio/cdio/types.h +++ b/src/libcdio/cdio/types.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002, 2003, 2004, 2005, 2006, 2008 + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2008, 2012 Rocky Bernstein Copyright (C) 2000 Herbert Valerio Riedel @@ -22,8 +22,8 @@ */ -#ifndef __CDIO_TYPES_H__ -#define __CDIO_TYPES_H__ +#ifndef CDIO_TYPES_H_ +#define CDIO_TYPES_H_ #ifdef __cplusplus extern "C" { @@ -116,7 +116,7 @@ typedef uint8_t ubyte; #ifdef _Bool #define bool _Bool #else -#define bool int +#define bool unsigned char #endif #define true 1 #define false 0 @@ -151,21 +151,21 @@ typedef uint8_t ubyte; #define GNUC_PACKED #endif /* !__GNUC__ */ -#if defined(__GNUC__) - /* for GCC we try to use GNUC_PACKED */ -# define PRAGMA_BEGIN_PACKED -# define PRAGMA_END_PACKED +#if defined(__MINGW32__) +# define PRAGMA_BEGIN_PACKED _Pragma("pack(push)") \ + _Pragma("pack(1)") +# define PRAGMA_END_PACKED _Pragma("pack(pop)") #elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901) - /* should work with most EDG-frontend based compilers */ -# define PRAGMA_BEGIN_PACKED _Pragma("pack(1)") -# define PRAGMA_END_PACKED _Pragma("pack()") + /* should work with most EDG-frontend based compilers */ +# define PRAGMA_BEGIN_PACKED _Pragma("pack(1)") +# define PRAGMA_END_PACKED _Pragma("pack()") #elif defined(_MSC_VER) -# define PRAGMA_BEGIN_PACKED __pragma(pack(push, 1)) -# define PRAGMA_END_PACKED __pragma(pack(pop)) +# define PRAGMA_BEGIN_PACKED __pragma(pack(push, 1)) +# define PRAGMA_END_PACKED __pragma(pack(pop)) #else /* neither gcc nor _Pragma() available... */ - /* ...so let's be naive and hope the regression testsuite is run... */ -# define PRAGMA_BEGIN_PACKED -# define PRAGMA_END_PACKED + /* ...so let's be naive and hope the regression testsuite is run... */ +# define PRAGMA_BEGIN_PACKED +# define PRAGMA_END_PACKED #endif /* @@ -182,8 +182,22 @@ typedef uint8_t ubyte; #ifndef NULL # define NULL ((void*) 0) #endif - - /* our own offsetof()-like macro */ + + /** Provide a notice for deprecated elements. Before gcc 4.5 'deprecated' + takes no arguments. */ +#if defined(__GNUC__) +# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 5) +# define LIBCDIO_DEPRECATED(object, notice) object __attribute__ ((deprecated(notice))) +# else +# define LIBCDIO_DEPRECATED(object, notice) object __attribute__ ((deprecated)) +# endif +#elif defined(_MSC_VER) +#define LIBCDIO_DEPRECATED(object, notice) __declspec(deprecated(notice)) object +#else +#define LIBCDIO_DEPRECATED(object, notice) +#endif + + /** our own offsetof()-like macro */ #define __cd_offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) /*! @@ -251,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. */ @@ -311,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_ */ /* diff --git a/src/libcdio/cdio/udf_time.h b/src/libcdio/cdio/udf_time.h index 289a8de3..33b2f8c4 100644 --- a/src/libcdio/cdio/udf_time.h +++ b/src/libcdio/cdio/udf_time.h @@ -1,7 +1,5 @@ /* - $Id: udf_time.h,v 1.5 2008/03/25 15:59:09 karl Exp $ - - Copyright (C) 2005, 2008 Rocky Bernstein + Copyright (C) 2005, 2008, 2012 Rocky Bernstein 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 diff --git a/src/libcdio/cdio/utf8.h b/src/libcdio/cdio/utf8.h index 236105e9..e29cc819 100644 --- a/src/libcdio/cdio/utf8.h +++ b/src/libcdio/cdio/utf8.h @@ -1,7 +1,5 @@ /* - $Id: utf8.h,v 1.2 2008/03/25 15:59:09 karl Exp $ - - Copyright (C) 2008 Rocky Bernstein + Copyright (C) 2008, 2012 Rocky Bernstein Copyright (C) 2006 Burkhard Plaum This program is free software: you can redistribute it and/or modify @@ -17,7 +15,10 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -/* UTF-8 support */ +/** \file utf8.h + * + * \brief UTF-8 support + */ #include @@ -87,6 +88,21 @@ bool cdio_charset_from_utf8(cdio_utf8_t * src, char ** dst, */ -bool cdio_charset_to_utf8(char *src, size_t src_len, cdio_utf8_t **dst, +bool cdio_charset_to_utf8(const char *src, size_t src_len, cdio_utf8_t **dst, const char * src_charset); +#ifdef _WIN32 +/** \brief Convert an UTF8 string to UTF-16 (allocate returned string) + * \param str Source string + * \returns NULL if the conversion was unsuccesful. Caller must free the + * returned string. + * This is a convenience function available on Windows platforms only. + */ +wchar_t* cdio_utf8_to_wchar(const char* str); + +#include /* for FILE */ +/** \brief Provides an UTF-8 compliant version of fopen for Windows + * The parameters and return value are the same as fopen(). + */ +FILE* fopen_utf8(const char* filename, const char* mode); +#endif diff --git a/src/libcdio/cdio/util.h b/src/libcdio/cdio/util.h index 37010a74..4ac8f9b9 100644 --- a/src/libcdio/cdio/util.h +++ b/src/libcdio/cdio/util.h @@ -1,5 +1,6 @@ /* - Copyright (C) 2004, 2005, 2006, 2008, 2010 Rocky Bernstein + Copyright (C) 2004, 2005, 2006, 2008, 2010, 2012 + Rocky Bernstein Copyright (C) 2000 Herbert Valerio Riedel This program is free software: you can redistribute it and/or modify @@ -16,8 +17,8 @@ along with this program. If not, see . */ -#ifndef __CDIO_UTIL_H__ -#define __CDIO_UTIL_H__ +#ifndef CDIO_UTIL_H_ +#define CDIO_UTIL_H_ /*! \file util.h @@ -128,7 +129,7 @@ char *cdio_realpath (const char *psz_src, char *psz_dst); } #endif -#endif /* __CDIO_UTIL_H__ */ +#endif /* CDIO_UTIL_H_ */ /* diff --git a/src/libcdio/cdio/version.h b/src/libcdio/cdio/version.h index 0e5db066..59b6c622 100644 --- a/src/libcdio/cdio/version.h +++ b/src/libcdio/cdio/version.h @@ -2,19 +2,19 @@ /** \file version.h * * \brief A file containing the libcdio package version - * number (84) and OS build name. + * number (90) and OS build name. */ /*! CDIO_VERSION is a C-Preprocessor macro of a string that shows what version is used. cdio_version_string has the same value, but it is a constant variable that can be accessed at run time. */ -#define CDIO_VERSION "0.84git i686-pc-mingw32" +#define CDIO_VERSION "0.90 i686-pc-mingw32" extern const char *cdio_version_string; /**< = CDIO_VERSION */ /*! LIBCDIO_VERSION_NUM is a C-Preprocessor macro that can be used for testing in the C preprocessor. libcdio_version_num has the same value, but it is a constant variable that can be accessed at run time. */ -#define LIBCDIO_VERSION_NUM 84 +#define LIBCDIO_VERSION_NUM 90 extern const unsigned int libcdio_version_num; /**< = LIBCDIO_VERSION_NUM */ diff --git a/src/libcdio/cdio/xa.h b/src/libcdio/cdio/xa.h index 13b21c8f..7dc95d88 100644 --- a/src/libcdio/cdio/xa.h +++ b/src/libcdio/cdio/xa.h @@ -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 + Copyright (C) 2003, 2004, 2005, 2006, 2008, 2012 + Rocky Bernstein Copyright (C) 2000 Herbert Valerio Riedel 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: diff --git a/src/libcdio/driver/_cdio_stdio.c b/src/libcdio/driver/_cdio_stdio.c index 4d696170..3912c8cd 100644 --- a/src/libcdio/driver/_cdio_stdio.c +++ b/src/libcdio/driver/_cdio_stdio.c @@ -56,39 +56,29 @@ #define CDIO_FSEEK fseek #endif -/* Windows'd fopen is not UTF-8 compliant - make it so */ -#if !defined(_WIN32) -#define CDIO_FOPEN fopen +/* Windows' fopen is not UTF-8 compliant, so we use our own */ +#if defined(_WIN32) +#include +#define CDIO_FOPEN fopen_utf8 #else -#define CDIO_FOPEN fopenU -extern wchar_t* cdio_utf8_to_wchar(const char* str); -static inline FILE* fopenU(const char* filename, const char* mode) -{ - FILE* ret = NULL; - wchar_t* wfilename = cdio_utf8_to_wchar(filename); - wchar_t* wmode = cdio_utf8_to_wchar(mode); - ret = _wfopen(wfilename, wmode); - free(wfilename); - free(wmode); - return ret; -} +#define CDIO_FOPEN fopen #endif /* Use _stati64 if needed, on platforms that don't have transparent LFS support */ #if defined(HAVE__STATI64) && defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64) #define CDIO_STAT_STRUCT _stati64 -#if !defined(_WIN32) -#define CDIO_STAT_CALL _stati64 -#else -#define CDIO_STAT_CALL _stati64U -/* Once more, we have to provide an UTF-8 compliant version on Windows */ -static inline int _stati64U(const char *path, struct _stati64 *buffer) { +#if defined(_WIN32) +/* Once again, use our own UTF-8 compliant version */ +static inline int _stati64_utf8(const char *path, struct _stati64 *buffer) { int ret; wchar_t* wpath = cdio_utf8_to_wchar(path); ret = _wstati64(wpath, buffer); free(wpath); return ret; } +#define CDIO_STAT_CALL _stati64_utf8 +#else +#define CDIO_STAT_CALL _stati64 #endif #else #define CDIO_STAT_STRUCT stat diff --git a/src/libcdio/driver/_cdio_stdio.h b/src/libcdio/driver/_cdio_stdio.h index a2cd4c02..d3f805f1 100644 --- a/src/libcdio/driver/_cdio_stdio.h +++ b/src/libcdio/driver/_cdio_stdio.h @@ -1,7 +1,5 @@ /* - $Id: _cdio_stdio.h,v 1.3 2008/04/22 15:29:11 karl Exp $ - - Copyright (C) 2003, 2008 Rocky Bernstein + Copyright (C) 2003, 2008, 2012 Rocky Bernstein Copyright (C) 2000 Herbert Valerio Riedel This program is free software: you can redistribute it and/or modify @@ -19,8 +17,8 @@ */ -#ifndef __CDIO_STDIO_H__ -#define __CDIO_STDIO_H__ +#ifndef CDIO_STDIO_H_ +#define CDIO_STDIO_H_ #include "_cdio_stream.h" @@ -39,7 +37,7 @@ CdioDataSource_t * cdio_stdio_new(const char psz_path[]); void cdio_stdio_destroy(CdioDataSource_t *p_obj); -#endif /* __CDIO_STREAM_STDIO_H__ */ +#endif /* CDIO_STDIO_H_ */ /* diff --git a/src/libcdio/driver/_cdio_stream.h b/src/libcdio/driver/_cdio_stream.h index 9bc77311..defe1f2c 100644 --- a/src/libcdio/driver/_cdio_stream.h +++ b/src/libcdio/driver/_cdio_stream.h @@ -1,7 +1,6 @@ /* - $Id: _cdio_stream.h,v 1.5 2008/04/22 15:29:11 karl Exp $ - - Copyright (C) 2003, 2004, 2005, 2006, 2008 Rocky Bernstein + Copyright (C) 2003, 2004, 2005, 2006, 2008, 2012 + Rocky Bernstein Copyright (C) 2000 Herbert Valerio Riedel This program is free software: you can redistribute it and/or modify @@ -19,8 +18,8 @@ */ -#ifndef __CDIO_STREAM_H__ -#define __CDIO_STREAM_H__ +#ifndef CDIO_STREAM_H_ +#define CDIO_STREAM_H_ #include #include "cdio_private.h" @@ -127,7 +126,7 @@ extern "C" { } #endif /* __cplusplus */ -#endif /* __CDIO_STREAM_H__ */ +#endif /* CDIO_STREAM_H_ */ /* diff --git a/src/libcdio/driver/cdio_assert.h b/src/libcdio/driver/cdio_assert.h index d9f4f811..644a047f 100644 --- a/src/libcdio/driver/cdio_assert.h +++ b/src/libcdio/driver/cdio_assert.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2008, 2011 Rocky Bernstein + Copyright (C) 2008, 2011, 2012 Rocky Bernstein Copyright (C) 2000 Herbert Valerio Riedel This program is free software: you can redistribute it and/or modify @@ -16,8 +16,8 @@ along with this program. If not, see . */ -#ifndef __CDIO_ASSERT_H__ -#define __CDIO_ASSERT_H__ +#ifndef CDIO_ASSERT_H_ +#define CDIO_ASSERT_H_ #if defined(__GNUC__) && !defined(__MINGW32__) @@ -43,7 +43,7 @@ __FILE__, __LINE__, __PRETTY_FUNCTION__); \ } -#else /* non GNU C or MinGW */ +#else /* non GNU C */ #include @@ -55,4 +55,4 @@ #endif -#endif /* __CDIO_ASSERT_H__ */ +#endif /* CDIO_ASSERT_H_ */ diff --git a/src/libcdio/driver/cdio_private.h b/src/libcdio/driver/cdio_private.h index 53568f06..c3e831ea 100644 --- a/src/libcdio/driver/cdio_private.h +++ b/src/libcdio/driver/cdio_private.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2003, 2004, 2005, 2008, 2009, 2011 + Copyright (C) 2003, 2004, 2005, 2008, 2009, 2011, 2012 Rocky Bernstein This program is free software: you can redistribute it and/or modify @@ -19,8 +19,8 @@ /* Internal routines for CD I/O drivers. */ -#ifndef __CDIO_PRIVATE_H__ -#define __CDIO_PRIVATE_H__ +#ifndef CDIO_DRIVER_PRIVATE_H_ +#define CDIO_DRIVER_PRIVATE_H_ #if defined(HAVE_CONFIG_H) && !defined(LIBCDIO_CONFIG_H) # include "config.h" @@ -62,7 +62,7 @@ extern "C" { */ driver_return_code_t (*audio_get_volume) - (void *p_env, /*out*/ cdio_audio_volume_t *p_volume); + (void *p_env, /*out*/ cdio_audio_volume_t *p_volume); /*! Pause playing CD through analog output @@ -77,8 +77,8 @@ extern "C" { @param p_env the CD object to be acted upon. */ driver_return_code_t (*audio_play_msf) ( void *p_env, - msf_t *p_start_msf, - msf_t *p_end_msf ); + msf_t *p_start_msf, + msf_t *p_end_msf ); /*! Playing CD through analog output @@ -86,7 +86,7 @@ extern "C" { @param p_env the CD object to be acted upon. */ driver_return_code_t (*audio_play_track_index) - ( void *p_env, cdio_track_index_t *p_track_index ); + ( void *p_env, cdio_track_index_t *p_track_index ); /*! Get subchannel information. @@ -94,7 +94,7 @@ extern "C" { @param p_env the CD object to be acted upon. */ driver_return_code_t (*audio_read_subchannel) - ( void *p_env, cdio_subchannel_t *subchannel ); + ( void *p_env, cdio_subchannel_t *subchannel ); /*! Resume playing an audio CD. @@ -111,7 +111,7 @@ extern "C" { */ driver_return_code_t (*audio_set_volume) - ( void *p_env, cdio_audio_volume_t *p_volume ); + ( void *p_env, cdio_audio_volume_t *p_volume ); /*! Stop playing an audio CD. @@ -204,9 +204,9 @@ extern "C" { See cd_types.h for a list of bitmasks for the drive type; */ void (*get_drive_cap) (const void *p_env, - 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); /*! Return the number of of the first track. CDIO_INVALID_TRACK is returned on error. @@ -218,16 +218,16 @@ extern "C" { False is returned if we had an error getting the information. */ bool (*get_hwinfo) - ( const CdIo_t *p_cdio, /* out*/ cdio_hwinfo_t *p_hw_info ); + ( 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. */ driver_return_code_t (*get_last_session) - ( void *p_env, /*out*/ lsn_t *i_last_session ); + ( void *p_env, /*out*/ lsn_t *i_last_session ); /*! Find out if media has changed since the last call. @@ -315,7 +315,7 @@ extern "C" { audio track? */ track_flag_t (*get_track_preemphasis) - ( const void *p_env, track_t i_track ); + ( const void *p_env, track_t i_track ); /*! lseek - reposition read/write file offset @@ -336,7 +336,7 @@ extern "C" { from lsn. Returns 0 if no error. */ int (*read_audio_sectors) ( void *p_env, void *p_buf, lsn_t i_lsn, - unsigned int i_blocks ); + unsigned int i_blocks ); /*! Read a data sector @@ -356,15 +356,15 @@ extern "C" { M2RAW_SECTOR_SIZE, or M2F2_SECTOR_SIZE. See comment above under p_buf. */ driver_return_code_t (*read_data_sectors) - ( void *p_env, void *p_buf, lsn_t i_lsn, uint16_t i_blocksize, - uint32_t i_blocks ); + ( void *p_env, void *p_buf, lsn_t i_lsn, uint16_t i_blocksize, + uint32_t i_blocks ); /*! Reads a single mode2 sector from cd device into buf starting from lsn. Returns 0 if no error. */ int (*read_mode2_sector) - ( void *p_env, void *p_buf, lsn_t i_lsn, bool b_mode2_form2 ); + ( void *p_env, void *p_buf, lsn_t i_lsn, bool b_mode2_form2 ); /*! Reads i_blocks of mode2 sectors from cd device into data starting @@ -372,15 +372,15 @@ extern "C" { Returns 0 if no error. */ int (*read_mode2_sectors) - ( void *p_env, void *p_buf, lsn_t i_lsn, bool b_mode2_form2, - unsigned int i_blocks ); + ( void *p_env, void *p_buf, lsn_t i_lsn, bool b_mode2_form2, + unsigned int i_blocks ); /*! Reads a single mode1 sector from cd device into buf starting from lsn. Returns 0 if no error. */ int (*read_mode1_sector) - ( void *p_env, void *p_buf, lsn_t i_lsn, bool mode1_form2 ); + ( void *p_env, void *p_buf, lsn_t i_lsn, bool mode1_form2 ); /*! Reads i_blocks of mode1 sectors from cd device into data starting @@ -388,24 +388,24 @@ extern "C" { Returns 0 if no error. */ int (*read_mode1_sectors) - ( void *p_env, void *p_buf, lsn_t i_lsn, bool mode1_form2, - unsigned int i_blocks ); + ( void *p_env, void *p_buf, lsn_t i_lsn, bool mode1_form2, + unsigned int i_blocks ); bool (*read_toc) ( void *p_env ) ; /*! Run a SCSI MMC command. - cdio CD structure set by cdio_open(). + cdio CD structure set by cdio_open(). i_timeout_ms time in milliseconds we will wait for the command to complete. cdb_len number of bytes in cdb (6, 10, or 12). - cdb CDB bytes. All values that are needed should be set on + cdb CDB bytes. All values that are needed should be set on input. - b_return_data TRUE if the command expects data to be returned in + b_return_data TRUE if the command expects data to be returned in the buffer - len Size of buffer - buf Buffer for data, both sending and receiving + len Size of buffer + buf Buffer for data, both sending and receiving Returns 0 if command completed successfully. */ @@ -420,7 +420,7 @@ extern "C" { Set the blocksize for subsequent reads. */ driver_return_code_t (*set_blocksize) ( void *p_env, - uint16_t i_blocksize ); + uint16_t i_blocksize ); /*! Set the drive speed. @@ -437,7 +437,7 @@ extern "C" { struct _CdIo { driver_id_t driver_id; /**< Particular driver opened. */ cdio_funcs_t op; /**< driver-specific routines handling - implementation*/ + implementation*/ void *env; /**< environment. Passed to routine above. */ }; @@ -464,7 +464,7 @@ extern "C" { bool (*have_driver) (void); CdIo_t *(*driver_open) (const char *psz_source_name); CdIo_t *(*driver_open_am) (const char *psz_source_name, - const char *psz_access_mode); + const char *psz_access_mode); char *(*get_default_device) (void); bool (*is_device) (const char *psz_source_name); char **(*get_devices) (void); @@ -489,7 +489,7 @@ extern "C" { Use cdio_free_device_list() to free this device_list. */ void cdio_add_device_list(char **device_list[], const char *psz_drive, - unsigned int *i_drives); + unsigned int *i_drives); driver_return_code_t close_tray_bsdi (const char *psz_drive); driver_return_code_t close_tray_freebsd (const char *psz_drive); @@ -512,7 +512,7 @@ extern "C" { @see cdio_open_cd, cdio_open */ CdIo_t * cdio_open_am_netbsd (const char *psz_source, - const char *psz_access_mode); + const char *psz_access_mode); /*! DEPRICATED: use cdio_have_driver(). True if AIX driver is available. */ @@ -559,4 +559,4 @@ extern "C" { } #endif /* __cplusplus */ -#endif /* __CDIO_PRIVATE_H__ */ +#endif /* CDIO_DRIVER_PRIVATE_H_ */ diff --git a/src/libcdio/driver/disc.c b/src/libcdio/driver/disc.c index 3c66ea95..02adb327 100644 --- a/src/libcdio/driver/disc.c +++ b/src/libcdio/driver/disc.c @@ -1,5 +1,5 @@ /* - Copyright (C) 2003, 2004, 2005, 2008, 2011 + Copyright (C) 2003, 2004, 2005, 2008, 2011, 2012 Rocky Bernstein Copyright (C) 2001 Herbert Valerio Riedel @@ -23,6 +23,10 @@ # define __CDIO_CONFIG_H__ 1 #endif +#ifdef HAVE_STDBOOL_H +# include +#endif + #include #include "cdio_private.h" @@ -124,7 +128,7 @@ cdio_get_discmode (CdIo_t *cd_obj) char * cdio_get_mcn (const CdIo_t *p_cdio) { - if (p_cdio->op.get_mcn) { + if (p_cdio && p_cdio->op.get_mcn) { return p_cdio->op.get_mcn (p_cdio->env); } else { return NULL; diff --git a/src/libcdio/driver/filemode.h b/src/libcdio/driver/filemode.h index 7ca25ba7..a06f72c9 100644 --- a/src/libcdio/driver/filemode.h +++ b/src/libcdio/driver/filemode.h @@ -1,7 +1,7 @@ /* filemode.h -- file modes common definitions - Copyright (C) 2005, 2008, 2011 Rocky Bernstein + Copyright (C) 2005, 2008, 2011, 2012 Rocky Bernstein Copyright (C) 1985, 1990, 1993, 1998-2000 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -18,8 +18,8 @@ along with this program. If not, see . */ -#ifndef __FILEMODE_H__ -#define __FILEMODE_H__ +#ifndef CDIO_DRIVER_FILEMODE_H_ +#define CDIO_DRIVER_FILEMODE_H_ #ifdef HAVE_SYS_STAT_H #include @@ -131,4 +131,4 @@ # define S_ISCTG(m) (((m) & S_IFMT) == S_IFCTG) #endif -#endif /* __FILEMODE_H__ */ +#endif /* CDIO_DRIVER_FILEMODE_H_ */ diff --git a/src/libcdio/driver/generic.h b/src/libcdio/driver/generic.h index e0dd2618..407b1866 100644 --- a/src/libcdio/driver/generic.h +++ b/src/libcdio/driver/generic.h @@ -1,5 +1,6 @@ /* - Copyright (C) 2004, 2005, 2006, 2008, 2009 Rocky Bernstein + Copyright (C) 2004, 2005, 2006, 2008, 2009, 2012 + Rocky Bernstein 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 +19,8 @@ /* Internal routines for CD I/O drivers. */ -#ifndef __CDIO_GENERIC_H__ -#define __CDIO_GENERIC_H__ +#ifndef CDIO_DRIVER_GENERIC_H_ +#define CDIO_DRIVER_GENERIC_H_ #if defined(HAVE_CONFIG_H) && !defined(LIBCDIO_CONFIG_H) # include "config.h" @@ -29,6 +30,10 @@ #include #include +#ifdef HAVE_STDBOOL_H +# include +#endif + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ @@ -57,7 +62,7 @@ extern "C" { track_t i_tracks; /**< The number of tracks. */ uint8_t i_joliet_level; /**< 0 = no Joliet extensions. - 1-3: Joliet level. */ + 1-3: Joliet level. */ iso9660_pvd_t pvd; iso9660_svd_t svd; CdIo_t *cdio; /**< a way to call general cdio routines. */ @@ -208,7 +213,7 @@ extern "C" { Is this meaningful if not an audio track? */ track_flag_t get_track_copy_permit_generic(void *p_user_data, - track_t i_track); + 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? @@ -216,7 +221,7 @@ extern "C" { pre-emphasis is a non linear frequency response. */ track_flag_t get_track_preemphasis_generic(const void *p_user_data, - track_t i_track); + track_t i_track); /*! Read cdtext information for a CdIo object . @@ -230,14 +235,14 @@ extern "C" { /*! 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, - uint32_t i_blocks); + void *p_buf, lsn_t i_lsn, + uint16_t i_blocksize, + uint32_t i_blocks); #ifdef __cplusplus } #endif /* __cplusplus */ -#endif /* __CDIO_GENERIC_H__ */ +#endif /* CDIO_DRIVER_GENERIC_H_ */ /* diff --git a/src/libcdio/driver/logging.c b/src/libcdio/driver/logging.c index 82114fa0..f91ea7fc 100644 --- a/src/libcdio/driver/logging.c +++ b/src/libcdio/driver/logging.c @@ -1,5 +1,6 @@ /* - Copyright (C) 2003, 2004, 2008, 2011 Rocky Bernstein + Copyright (C) 2003, 2004, 2008, 2011, 2012 + Rocky Bernstein Copyright (C) 2000 Herbert Valerio Riedel This program is free software: you can redistribute it and/or modify @@ -35,12 +36,10 @@ #include "cdio_assert.h" #include "portable.h" -static const char _rcsid[] = "$Id: logging.c,v 1.2 2008/04/22 15:29:12 karl Exp $"; - cdio_log_level_t cdio_loglevel_default = CDIO_LOG_WARN; static void -default_cdio_log_handler (cdio_log_level_t level, const char message[]) +default_cdio_log_handler(cdio_log_level_t level, const char message[]) { switch (level) { @@ -84,7 +83,7 @@ default_cdio_log_handler (cdio_log_level_t level, const char message[]) static cdio_log_handler_t _handler = default_cdio_log_handler; cdio_log_handler_t -cdio_log_set_handler (cdio_log_handler_t new_handler) +cdio_log_set_handler(cdio_log_handler_t new_handler) { cdio_log_handler_t old_handler = _handler; @@ -94,7 +93,7 @@ cdio_log_set_handler (cdio_log_handler_t new_handler) } static void -cdio_logv (cdio_log_level_t level, const char format[], va_list args) +cdio_logv(cdio_log_level_t level, const char format[], va_list args) { char buf[1024] = { 0, }; static int in_recursion = 0; @@ -112,7 +111,7 @@ cdio_logv (cdio_log_level_t level, const char format[], va_list args) } void -cdio_log (cdio_log_level_t level, const char format[], ...) +cdio_log(cdio_log_level_t level, const char format[], ...) { va_list args; va_start (args, format); diff --git a/src/libcdio/driver/portable.h b/src/libcdio/driver/portable.h index f0516d65..8b0ad7ba 100644 --- a/src/libcdio/driver/portable.h +++ b/src/libcdio/driver/portable.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2006, 2008, 2011 Rocky Bernstein + Copyright (C) 2006, 2008, 2011, 2012 Rocky Bernstein 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 @@ included other routines can be more portable. */ -#ifndef __CDIO_PORTABLE_H__ -#define __CDIO_PORTABLE_H__ +#ifndef CDIO_DRIVER_PORTABLE_H_ +#define CDIO_DRIVER_PORTABLE_H_ #if defined(HAVE_CONFIG_H) && !defined(__CDIO_CONFIG_H__) # include "config.h" @@ -51,4 +51,4 @@ # define drand48() (rand() / (double)RAND_MAX) #endif -#endif /* __CDIO_PORTABLE_H__ */ +#endif /* CDIO_DRIVER_PORTABLE_H_ */ diff --git a/src/libcdio/driver/read.c b/src/libcdio/driver/read.c index fd7134e0..da3faea1 100644 --- a/src/libcdio/driver/read.c +++ b/src/libcdio/driver/read.c @@ -1,5 +1,5 @@ /* - Copyright (C) 2005, 2008, 2011 Rocky Bernstein + Copyright (C) 2005, 2008, 2011, 2012 Rocky Bernstein 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,6 +25,10 @@ # define __CDIO_CONFIG_H__ 1 #endif +#ifdef HAVE_STDBOOL_H +# include +#endif + #include #include #include "cdio_private.h" diff --git a/src/libcdio/driver/sector.c b/src/libcdio/driver/sector.c index 930b8b21..d24a7511 100644 --- a/src/libcdio/driver/sector.c +++ b/src/libcdio/driver/sector.c @@ -1,5 +1,5 @@ /* - Copyright (C) 2004, 2005, 2011 Rocky Bernstein + Copyright (C) 2004, 2005, 2011, 2012 Rocky Bernstein Copyright (C) 2000 Herbert Valerio Riedel This program is free software; you can redistribute it and/or modify @@ -195,7 +195,7 @@ cdio_mmssff_to_lba (const char *psz_mmssff) { int psz_field; lba_t ret; - char c; + unsigned char c; if (0 == strcmp (psz_mmssff, "0")) return 0; diff --git a/src/libcdio/driver/track.c b/src/libcdio/driver/track.c index 31fd423f..b4953fd2 100644 --- a/src/libcdio/driver/track.c +++ b/src/libcdio/driver/track.c @@ -1,5 +1,6 @@ /* - Copyright (C) 2003, 2004, 2005, 2008, 2011 Rocky Bernstein + Copyright (C) 2003, 2004, 2005, 2008, 2011, 2012 + Rocky Bernstein Copyright (C) 2001 Herbert Valerio Riedel This program is free software: you can redistribute it and/or modify @@ -20,10 +21,14 @@ #ifdef HAVE_CONFIG_H # include "config.h" -# define __CDIO_CONFIG_H__ 1 #endif +#ifdef HAVE_STDBOOL_H +# include +#endif + #include +#include #include "cdio_private.h" const char *track_format2str[6] = @@ -39,9 +44,13 @@ enum cdio_track_enums; CDIO_INVALID_TRACK is returned on error. */ track_t -cdio_get_first_track_num (const CdIo_t *p_cdio) +cdio_get_first_track_num(const CdIo_t *p_cdio) { - if (NULL == p_cdio) return CDIO_INVALID_TRACK; + if (NULL == p_cdio) { + cdio_info("Null CdIo object passed\n"); + return CDIO_INVALID_TRACK; + } + if (p_cdio->op.get_first_track_num) { return p_cdio->op.get_first_track_num (p_cdio->env); @@ -57,7 +66,11 @@ cdio_get_first_track_num (const CdIo_t *p_cdio) track_t cdio_get_last_track_num (const CdIo_t *p_cdio) { - if (NULL == p_cdio) return CDIO_INVALID_TRACK; + if (NULL == p_cdio) { + cdio_info("Null CdIo object passed\n"); + return CDIO_INVALID_TRACK; + } + { const track_t i_first_track = cdio_get_first_track_num(p_cdio); if ( CDIO_INVALID_TRACK != i_first_track ) { @@ -76,6 +89,15 @@ cdio_get_last_track_num (const CdIo_t *p_cdio) int cdio_get_track_channels(const CdIo_t *p_cdio, track_t i_track) { + if (NULL == p_cdio) { + cdio_info("Null CdIo object passed\n"); + return -1; + } + if (i_track > CDIO_CD_MAX_TRACKS) { + cdio_log(CDIO_LOG_WARN, "Number of tracks exceeds maximum (%d vs. %d)\n", + i_track, CDIO_CD_MAX_TRACKS); + return -1; + } if (p_cdio->op.get_track_channels) { return p_cdio->op.get_track_channels (p_cdio->env, i_track); } else { @@ -209,7 +231,10 @@ cdio_get_track_green(const CdIo_t *p_cdio, track_t i_track) lba_t cdio_get_track_lba(const CdIo_t *p_cdio, track_t i_track) { - if (!p_cdio) return CDIO_INVALID_LBA; + if (NULL == p_cdio) { + cdio_info("Null CdIo object passed\n"); + return CDIO_INVALID_LBA; + } if (p_cdio->op.get_track_lba) { return p_cdio->op.get_track_lba (p_cdio->env, i_track); @@ -232,7 +257,16 @@ cdio_get_track_lba(const CdIo_t *p_cdio, track_t i_track) lsn_t cdio_get_track_lsn(const CdIo_t *p_cdio, track_t i_track) { - if (p_cdio == NULL) return CDIO_INVALID_LSN; + if (NULL == p_cdio) { + cdio_info("Null CdIo object passed\n"); + return CDIO_INVALID_LSN; + } + if (i_track > CDIO_CD_MAX_TRACKS && i_track != CDIO_CDROM_LEADOUT_TRACK) { + cdio_log(CDIO_LOG_WARN, "Number of tracks exceeds maximum (%d vs. %d)\n", + i_track, CDIO_CD_MAX_TRACKS); + return CDIO_INVALID_LSN; + } + if (p_cdio->op.get_track_lba) { return cdio_lba_to_lsn(p_cdio->op.get_track_lba (p_cdio->env, i_track)); @@ -254,7 +288,16 @@ cdio_get_track_lsn(const CdIo_t *p_cdio, track_t i_track) char * cdio_get_track_isrc (const CdIo_t *p_cdio, track_t i_track) { - if (p_cdio == NULL) return NULL; + if (NULL == p_cdio) { + cdio_info("Null CdIo object passed\n"); + return NULL; + } + + if (i_track > CDIO_CD_MAX_TRACKS) { + cdio_log(CDIO_LOG_WARN, "Number of tracks exceeds maximum (%d vs. %d)\n", + i_track, CDIO_CD_MAX_TRACKS); + return NULL; + } if (p_cdio->op.get_track_isrc) { return p_cdio->op.get_track_isrc (p_cdio->env, i_track); @@ -271,7 +314,10 @@ cdio_get_track_isrc (const CdIo_t *p_cdio, track_t i_track) lba_t cdio_get_track_pregap_lba(const CdIo_t *p_cdio, track_t i_track) { - if (p_cdio == NULL) return CDIO_INVALID_LBA; + if (NULL == p_cdio) { + cdio_info("Null CdIo object passed\n"); + return CDIO_INVALID_LBA; + } if (p_cdio->op.get_track_pregap_lba) { return p_cdio->op.get_track_pregap_lba (p_cdio->env, i_track); diff --git a/src/libcdio/driver/utf8.c b/src/libcdio/driver/utf8.c index 51647d48..5279d063 100644 --- a/src/libcdio/driver/utf8.c +++ b/src/libcdio/driver/utf8.c @@ -23,8 +23,12 @@ # include "config.h" #endif +#ifdef HAVE_STDIO_H +#include +#endif + #ifdef HAVE_STRING_H -# include +#include #endif #ifdef HAVE_STDLIB_H @@ -38,10 +42,6 @@ #include #include -#ifdef HAVE_STDIO_H -#include -#endif - /* Windows requires some basic UTF-8 support outside of Joliet */ #if defined(_WIN32) #include @@ -55,7 +55,7 @@ * Converts an UTF-16 string to UTF8 (allocate returned string) * Returns NULL on error */ -char* cdio_wchar_to_utf8(const wchar_t* wstr) +static inline char* cdio_wchar_to_utf8(const wchar_t* wstr) { int size = 0; char* str = NULL; @@ -99,6 +99,18 @@ wchar_t* cdio_utf8_to_wchar(const char* str) } return wstr; } + +/* UTF-8 compliant version of fopen() */ +FILE* fopen_utf8(const char* filename, const char* mode) +{ + FILE* ret = NULL; + wchar_t* wfilename = cdio_utf8_to_wchar(filename); + wchar_t* wmode = cdio_utf8_to_wchar(mode); + ret = _wfopen(wfilename, wmode); + free(wfilename); + free(wmode); + return ret; +} #endif #ifdef HAVE_JOLIET @@ -155,7 +167,7 @@ void cdio_charset_converter_destroy(cdio_charset_coverter_t*cnv) #define BYTES_INCREMENT 16 static bool -do_convert(iconv_t cd, char * src, int src_len, +do_convert(iconv_t cd, const char * src, int src_len, char ** dst, int *dst_len) { char * ret; @@ -182,7 +194,7 @@ do_convert(iconv_t cd, char * src, int src_len, ret = malloc(alloc_size); - inbuf = src; + inbuf = (char *)src; outbuf = ret; while(1) @@ -257,7 +269,7 @@ bool cdio_charset_from_utf8(cdio_utf8_t * src, char ** dst, -bool cdio_charset_to_utf8(char *src, size_t src_len, cdio_utf8_t **dst, +bool cdio_charset_to_utf8(const char *src, size_t src_len, cdio_utf8_t **dst, const char * src_charset) { iconv_t ic; @@ -297,7 +309,7 @@ bool cdio_charset_from_utf8(cdio_utf8_t * src, char ** dst, return true; } -bool cdio_charset_to_utf8(char *src, size_t src_len, cdio_utf8_t **dst, +bool cdio_charset_to_utf8(const char *src, size_t src_len, cdio_utf8_t **dst, const char * src_charset) { wchar_t* le_src; diff --git a/src/libcdio/driver/util.c b/src/libcdio/driver/util.c index bb170792..39d4b8fe 100644 --- a/src/libcdio/driver/util.c +++ b/src/libcdio/driver/util.c @@ -130,7 +130,7 @@ _cdio_strdup_upper (const char str[]) while (*p) { - *p = toupper (*p); + *p = toupper ((unsigned char) *p); p++; } } diff --git a/src/libcdio/iso9660/iso9660.c b/src/libcdio/iso9660/iso9660.c index 60d42cc7..1b5e6a16 100644 --- a/src/libcdio/iso9660/iso9660.c +++ b/src/libcdio/iso9660/iso9660.c @@ -36,19 +36,19 @@ const char ISO_STANDARD_ID[] = {'C', 'D', '0', '0', '1'}; #include #include #ifdef HAVE_STRING_H -#include +# include #endif #ifdef HAVE_STDIO_H -#include +# include #endif #ifdef HAVE_LIMITS_H -#include +# include #endif #ifdef HAVE_STDLIB_H -#include +# include #endif #ifdef HAVE_SYS_STAT_H -#include +# include #endif #ifdef HAVE_ERRNO_H @@ -335,15 +335,17 @@ iso9660_set_dtime_with_timezone (const struct tm *p_tm, Set time in format used in ISO 9660 directory index record from a Unix time structure. */ void -iso9660_set_dtime (const struct tm *p_tm, /*out*/ iso9660_dtime_t *p_idr_date) +iso9660_set_dtime(const struct tm *p_tm, /*out*/ iso9660_dtime_t *p_idr_date) { - int time_zone; + int time_zone = 0; + if (p_tm) { #ifdef HAVE_TM_GMTOFF - /* Convert seconds to minutes */ - time_zone = p_tm->tm_gmtoff / 60; + /* Convert seconds to minutes */ + time_zone = p_tm->tm_gmtoff / 60; #else - time_zone = (p_tm->tm_isdst > 0) ? -60 : 0; + time_zone = (p_tm->tm_isdst > 0) ? -60 : 0; #endif + } iso9660_set_dtime_with_timezone (p_tm, time_zone, p_idr_date); } @@ -353,9 +355,9 @@ iso9660_set_dtime (const struct tm *p_tm, /*out*/ iso9660_dtime_t *p_idr_date) correction in minutes. */ void -iso9660_set_ltime_with_timezone (const struct tm *p_tm, - int time_zone, - /*out*/ iso9660_ltime_t *pvd_date) +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; @@ -388,15 +390,17 @@ iso9660_set_ltime_with_timezone (const struct tm *p_tm, Set "long" time in format used in ISO 9660 primary volume descriptor from a Unix time structure. */ void -iso9660_set_ltime (const struct tm *p_tm, /*out*/ iso9660_ltime_t *pvd_date) +iso9660_set_ltime(const struct tm *p_tm, /*out*/ iso9660_ltime_t *pvd_date) { - int time_zone; + int time_zone = 0; + if (p_tm) { #ifdef HAVE_TM_GMTOFF - /* Set time zone in 15-minute interval encoding. */ - time_zone = p_tm->tm_gmtoff / 60; + /* Set time zone in 15-minute interval encoding. */ + time_zone = p_tm->tm_gmtoff / 60; #else - time_zone = (p_tm->tm_isdst > 0) ? -60 : 0; + time_zone = (p_tm->tm_isdst > 0) ? -60 : 0; #endif + } iso9660_set_ltime_with_timezone (p_tm, time_zone, pvd_date); } @@ -667,8 +671,8 @@ iso9660_set_pvd(void *pd, iso9660_set_ltime (&temp_tm, &(ipd.creation_date)); gmtime_r(pvd_time, &temp_tm); iso9660_set_ltime (&temp_tm, &(ipd.modification_date)); - iso9660_set_ltime (&temp_tm, &(ipd.expiration_date)); - iso9660_set_ltime (&temp_tm, &(ipd.effective_date)); + iso9660_set_ltime (NULL, &(ipd.expiration_date)); + iso9660_set_ltime (NULL, &(ipd.effective_date)); ipd.file_structure_version = to_711(1); diff --git a/src/libcdio/iso9660/iso9660_fs.c b/src/libcdio/iso9660/iso9660_fs.c index 82da45aa..3eb06b57 100644 --- a/src/libcdio/iso9660/iso9660_fs.c +++ b/src/libcdio/iso9660/iso9660_fs.c @@ -1,5 +1,5 @@ /* - Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2011 + Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2011, 2012 Rocky Bernstein Copyright (C) 2001 Herbert Valerio Riedel @@ -19,16 +19,24 @@ /* iso9660 filesystem-based routines */ #if defined(HAVE_CONFIG_H) && !defined(__CDIO_CONFIG_H__) -# include "config.h" -# define __CDIO_CONFIG_H__ 1 +#include "config.h" +#define __CDIO_CONFIG_H__ 1 +#endif + +#ifdef HAVE_STDBOOL_H +# include +#endif + +#ifdef HAVE_STDIO_H +#include #endif #ifdef HAVE_STRING_H -# include +#include #endif #ifdef HAVE_ERRNO_H -# include +#include #endif #ifdef HAVE_LANGINFO_CODESET @@ -46,8 +54,6 @@ #include "_cdio_stdio.h" #include "cdio_private.h" -#include - static const char _rcsid[] = "$Id: iso9660_fs.c,v 1.47 2008/04/18 16:02:09 karl Exp $"; /* Implementation of iso9660_t type */ diff --git a/src/libcdio/iso9660/iso9660_private.h b/src/libcdio/iso9660/iso9660_private.h index 20ea2b4e..c5e13935 100644 --- a/src/libcdio/iso9660/iso9660_private.h +++ b/src/libcdio/iso9660/iso9660_private.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2003, 2004, 2005, 2008, 2011 + Copyright (C) 2003, 2004, 2005, 2008, 2011, 2012 Rocky Bernstein Copyright (C) 2000 Herbert Valerio Riedel @@ -22,8 +22,8 @@ along with this program. If not, see . */ -#ifndef __CDIO_ISO9660_PRIVATE_H__ -#define __CDIO_ISO9660_PRIVATE_H__ +#ifndef CDIO_ISO9660_ISO9660_PRIVATE_H_ +#define CDIO_ISO9660_ISO9660_PRIVATE_H_ #if defined(HAVE_CONFIG_H) && !defined(__CDIO_CONFIG_H__) # include "config.h" @@ -32,6 +32,10 @@ #include +#ifdef HAVE_STDBOOL_H +# include +#endif + #define ISO_VERSION 1 PRAGMA_BEGIN_PACKED @@ -71,7 +75,7 @@ typedef struct iso_path_table_s { PRAGMA_END_PACKED -#endif /* __CDIO_ISO9660_PRIVATE_H__ */ +#endif /* CDIO_ISO0660_ISO9660_PRIVATE_H_ */ /* diff --git a/src/libcdio/udf/filemode.c b/src/libcdio/udf/filemode.c index f24e25f5..de6a6215 100644 --- a/src/libcdio/udf/filemode.c +++ b/src/libcdio/udf/filemode.c @@ -1,7 +1,7 @@ /* filemode.c -- make a string describing file modes - Copyright (C) 2005, 2008, 2011 Rocky Bernstein + Copyright (C) 2005, 2008, 2011, 2012 Rocky Bernstein Copyright (C) 1985, 1990, 1993, 1998-2000 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/src/libcdio/udf/udf.c b/src/libcdio/udf/udf.c index 42cb8a5e..bd8cb868 100644 --- a/src/libcdio/udf/udf.c +++ b/src/libcdio/udf/udf.c @@ -1,5 +1,5 @@ /* - Copyright (C) 2005, 2008, 2010 Rocky Bernstein + Copyright (C) 2005, 2008, 2010, 2012 Rocky Bernstein 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 diff --git a/src/libcdio/udf/udf_file.c b/src/libcdio/udf/udf_file.c index c9b29a33..d969dcf0 100644 --- a/src/libcdio/udf/udf_file.c +++ b/src/libcdio/udf/udf_file.c @@ -1,5 +1,5 @@ /* - Copyright (C) 2005, 2006, 2008, 2010 Rocky Bernstein + Copyright (C) 2005, 2006, 2008, 2010, 2012 Rocky Bernstein 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 diff --git a/src/libcdio/udf/udf_fs.h b/src/libcdio/udf/udf_fs.h index 80e99554..913953b8 100644 --- a/src/libcdio/udf/udf_fs.h +++ b/src/libcdio/udf/udf_fs.h @@ -1,7 +1,5 @@ /* - $Id: udf_fs.h,v 1.3 2008/04/18 16:02:10 karl Exp $ - - Copyright (C) 2006, 2008 Rocky Bernstein + Copyright (C) 2006, 2008, 2012 Rocky Bernstein 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 @@ -17,8 +15,8 @@ along with this program. If not, see . */ -#ifndef __CDIO_UDF_FS_H__ -#define __CDIO_UDF_FS_H__ +#ifndef CDIO_UDF_UDF_FS_H_ +#define CDIO_UDF_UDF_FS_H_ #include /** @@ -27,7 +25,7 @@ */ int udf_checktag(const udf_tag_t *p_tag, udf_Uint16_t tag_id); -#endif /* __CDIO_UDF_FS_H__ */ +#endif /* CDIO_UDF_UDF_FS_H_ */ /* diff --git a/src/libcdio/udf/udf_private.h b/src/libcdio/udf/udf_private.h index cfc40763..d958ec85 100644 --- a/src/libcdio/udf/udf_private.h +++ b/src/libcdio/udf/udf_private.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2005, 2006, 2008, 2011 Rocky Bernstein + Copyright (C) 2005, 2006, 2008, 2011, 2012 Rocky Bernstein 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,18 @@ along with this program. If not, see . */ -#ifndef __CDIO_UDF_PRIVATE_H__ -#define __CDIO_UDF_PRIVATE_H__ +#ifndef CDIO_UDF_UDF_PRIVATE_H_ +#define CDIO_UDF_UDF_PRIVATE_H_ #if defined(HAVE_CONFIG_H) && !defined(LIBCDIO_CONFIG_H) && !defined(__CDIO_CONFIG_H__) # include "config.h" # define __CDIO_CONFIG_H__ 1 #endif +#ifdef HAVE_STDBOOL_H +# include +#endif + #include #include #include @@ -43,7 +47,7 @@ struct udf_s { uint32_t fsd_offset; /* lba of fileset descriptor */ }; -#endif /* __CDIO_UDF_PRIVATE_H__ */ +#endif /* CDIO_UDF_UDF_PRIVATE_H_ */ /* diff --git a/src/rufus.rc b/src/rufus.rc index 8b8ae660..6eb2d1ce 100644 --- a/src/rufus.rc +++ b/src/rufus.rc @@ -30,7 +30,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL IDD_DIALOG DIALOGEX 12, 12, 206, 316 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_APPWINDOW -CAPTION "Rufus v1.2.0.188" +CAPTION "Rufus v1.2.0.189" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "Start",IDC_START,94,278,50,14 @@ -77,7 +77,7 @@ BEGIN DEFPUSHBUTTON "OK",IDOK,231,175,50,14,WS_GROUP CONTROL "http://rufus.akeo.ie",IDC_ABOUT_RUFUS_URL, "SysLink",WS_TABSTOP,46,47,114,9 - LTEXT "Version 1.2.0 (Build 188)",IDC_STATIC,46,19,78,8 + LTEXT "Version 1.2.0 (Build 189)",IDC_STATIC,46,19,78,8 PUSHBUTTON "License...",IDC_ABOUT_LICENSE,46,175,50,14,WS_GROUP EDITTEXT IDC_ABOUT_COPYRIGHTS,46,107,235,63,ES_MULTILINE | ES_READONLY | WS_VSCROLL LTEXT "Report bugs or request enhancements at:",IDC_STATIC,46,66,187,8 @@ -237,8 +237,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,2,0,188 - PRODUCTVERSION 1,2,0,188 + FILEVERSION 1,2,0,189 + PRODUCTVERSION 1,2,0,189 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -255,13 +255,13 @@ BEGIN BEGIN VALUE "CompanyName", "akeo.ie" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "1.2.0.188" + VALUE "FileVersion", "1.2.0.189" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "© 2011 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html" VALUE "OriginalFilename", "rufus.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "1.2.0.188" + VALUE "ProductVersion", "1.2.0.189" END END BLOCK "VarFileInfo"