diff --git a/include/cdio/cd_types.h b/include/cdio/cd_types.h index f67513ed..aa1734fa 100644 --- a/include/cdio/cd_types.h +++ b/include/cdio/cd_types.h @@ -1,5 +1,5 @@ /* - $Id: cd_types.h,v 1.8 2003/11/18 03:35:19 rocky Exp $ + $Id: cd_types.h,v 1.9 2004/06/19 19:15:15 rocky Exp $ Copyright (C) 2003 Rocky Bernstein Copyright (C) 1996,1997,1998 Gerd Knorr @@ -67,6 +67,11 @@ extern "C" { */ #define CDIO_FS_3DO 10 +/** + Microsoft X-BOX CD. + */ +#define CDIO_FS_XISO 11 + #define CDIO_FS_MASK 15 /**< Note: this should be 2**n-1 and and greater than the highest CDIO_FS number above */ @@ -82,20 +87,21 @@ extern "C" { * higher-level than the fs-type information above and may be determined * based of the fs type information. */ -#define CDIO_FS_ANAL_XA 16 /**< eXtended Architecture format */ -#define CDIO_FS_ANAL_MULTISESSION 32 /**< CD has multisesion */ -#define CDIO_FS_ANAL_PHOTO_CD 64 /**< Is a Kodak Photo CD */ -#define CDIO_FS_ANAL_HIDDEN_TRACK 128 /**< Hidden track at the +#define CDIO_FS_ANAL_XA 0x0010 /**< eXtended Architecture format */ +#define CDIO_FS_ANAL_MULTISESSION 0x0020 /**< CD has multisesion */ +#define CDIO_FS_ANAL_PHOTO_CD 0x0040 /**< Is a Kodak Photo CD */ +#define CDIO_FS_ANAL_HIDDEN_TRACK 0x0080 /**< Hidden track at the beginning of the CD */ -#define CDIO_FS_ANAL_CDTV 256 -#define CDIO_FS_ANAL_BOOTABLE 512 /**< CD is bootable */ -#define CDIO_FS_ANAL_VIDEOCD 1024 /**< VCD 1.1 */ -#define CDIO_FS_ANAL_ROCKRIDGE 2048 /**< Has Rock Ridge Extensions to +#define CDIO_FS_ANAL_CDTV 0x0100 +#define CDIO_FS_ANAL_BOOTABLE 0x0200 /**< CD is bootable */ +#define CDIO_FS_ANAL_VIDEOCD 0x0400 /**< VCD 1.1 */ +#define CDIO_FS_ANAL_ROCKRIDGE 0x0800 /**< Has Rock Ridge Extensions to ISO 9660 */ -#define CDIO_FS_ANAL_JOLIET 4096 /**< Microsoft Joliet extensions +#define CDIO_FS_ANAL_JOLIET 0x1000 /**< Microsoft Joliet extensions to ISO 9660 */ -#define CDIO_FS_ANAL_SVCD 8192 /**< Super VCD or Choiji Video CD */ -#define CDIO_FS_ANAL_CVD 16384 /**< Choiji Video CD */ +#define CDIO_FS_ANAL_SVCD 0x2000 /**< Super VCD or Choiji Video CD */ +#define CDIO_FS_ANAL_CVD 0x4000 /**< Choiji Video CD */ +#define CDIO_FS_ANAL_XISO 0x8000 /**< XBOX CD */ /** * Pattern which can be used by cdio_get_devices to specify matching diff --git a/lib/_cdio_generic.c b/lib/_cdio_generic.c index ea3b1a6a..4fefb6f9 100644 --- a/lib/_cdio_generic.c +++ b/lib/_cdio_generic.c @@ -1,5 +1,5 @@ /* - $Id: _cdio_generic.c,v 1.16 2004/05/31 12:29:09 rocky Exp $ + $Id: _cdio_generic.c,v 1.17 2004/06/19 19:15:15 rocky Exp $ Copyright (C) 2001 Herbert Valerio Riedel Copyright (C) 2002, 2003, 2004 Rocky Bernstein @@ -27,13 +27,17 @@ # include "config.h" #endif -static const char _rcsid[] = "$Id: _cdio_generic.c,v 1.16 2004/05/31 12:29:09 rocky Exp $"; +static const char _rcsid[] = "$Id: _cdio_generic.c,v 1.17 2004/06/19 19:15:15 rocky Exp $"; #include #include #include #include -#include + +#ifdef HAVE_UNISTD_H +#include +#endif /*HAVE_UNISTD_H*/ + #include #include @@ -41,6 +45,7 @@ static const char _rcsid[] = "$Id: _cdio_generic.c,v 1.16 2004/05/31 12:29:09 ro #include #include +#include #include "cdio_assert.h" #include "cdio_private.h" #include "_cdio_stdio.h" diff --git a/lib/_cdio_stdio.c b/lib/_cdio_stdio.c index c6b21f06..4b22acee 100644 --- a/lib/_cdio_stdio.c +++ b/lib/_cdio_stdio.c @@ -1,5 +1,5 @@ /* - $Id: _cdio_stdio.c,v 1.7 2004/02/21 18:29:59 rocky Exp $ + $Id: _cdio_stdio.c,v 1.8 2004/06/19 19:15:15 rocky Exp $ Copyright (C) 2000 Herbert Valerio Riedel Copyright (C) 2003, 2004 Rocky Bernstein @@ -26,7 +26,11 @@ #include #include #include + +#ifdef HAVE_UNISTD_H #include +#endif /*HAVE_UNISTD_H*/ + #include #include @@ -35,7 +39,7 @@ #include "_cdio_stream.h" #include "_cdio_stdio.h" -static const char _rcsid[] = "$Id: _cdio_stdio.c,v 1.7 2004/02/21 18:29:59 rocky Exp $"; +static const char _rcsid[] = "$Id: _cdio_stdio.c,v 1.8 2004/06/19 19:15:15 rocky Exp $"; #define CDIO_STDIO_BUFSIZE (128*1024) diff --git a/lib/cd_types.c b/lib/cd_types.c index 59c5fba3..364e6ac0 100644 --- a/lib/cd_types.c +++ b/lib/cd_types.c @@ -1,5 +1,5 @@ /* - $Id: cd_types.c,v 1.7 2003/11/05 04:12:58 rocky Exp $ + $Id: cd_types.c,v 1.8 2004/06/19 19:15:15 rocky Exp $ Copyright (C) 2003 Rocky Bernstein @@ -66,6 +66,7 @@ static char buffer[6][CDIO_CD_FRAMESIZE_RAW]; /* for CD-Data */ #define UFS_SUPERBLOCK_SECTOR 4 /* buffer[2] */ #define BOOT_SECTOR 17 /* buffer[3] */ #define VCD_INFO_SECTOR 150 /* buffer[4] */ +#define XISO_SECTOR 32 /* buffer[4] */ typedef struct signature @@ -92,6 +93,7 @@ static signature_t sigs[] = {3, 7, "EL TORITO", "BOOTABLE"}, {4, 0, "VIDEO_CD", "VIDEO CD"}, {4, 0, "SUPERVCD", "SVCD or Chaoji VCD"}, + {0, 0, "MICROSOFT*XBOX*MEDIA", "XBOX CD"}, { 0 } }; @@ -110,6 +112,7 @@ static signature_t sigs[] = #define INDEX_BOOTABLE 10 #define INDEX_VIDEO_CD 11 /* Video CD */ #define INDEX_SVCD 12 /* CVD *or* SVCD */ +#define INDEX_XISO 13 /* Microsoft X-BOX filesystem */ /* @@ -220,6 +223,9 @@ cdio_guess_cd_type(const CdIo *cdio, int start_session, track_t track_num, 0, track_num) < 0 ) return CDIO_FS_UNKNOWN; + if ( _cdio_is_it(INDEX_XISO) ) + return CDIO_FS_ANAL_XISO; + /* We have something that smells of a filesystem. */ if (_cdio_is_it(INDEX_CD_I) && _cdio_is_it(INDEX_CD_RTOS) && !_cdio_is_it(INDEX_BRIDGE) && !_cdio_is_it(INDEX_XA)) { diff --git a/lib/cdio.c b/lib/cdio.c index b9f050f9..740a134f 100644 --- a/lib/cdio.c +++ b/lib/cdio.c @@ -1,5 +1,5 @@ /* - $Id: cdio.c,v 1.55 2004/06/07 00:24:45 rocky Exp $ + $Id: cdio.c,v 1.56 2004/06/19 19:15:15 rocky Exp $ Copyright (C) 2003, 2004 Rocky Bernstein Copyright (C) 2001 Herbert Valerio Riedel @@ -26,7 +26,9 @@ #include #include +#ifdef HAVE_UNISTD_H #include +#endif #include #include @@ -37,7 +39,7 @@ #include #include "cdio_private.h" -static const char _rcsid[] = "$Id: cdio.c,v 1.55 2004/06/07 00:24:45 rocky Exp $"; +static const char _rcsid[] = "$Id: cdio.c,v 1.56 2004/06/19 19:15:15 rocky Exp $"; const char *track_format2str[6] = diff --git a/lib/image/bincue.c b/lib/image/bincue.c index 732f1209..6cd12df4 100644 --- a/lib/image/bincue.c +++ b/lib/image/bincue.c @@ -1,5 +1,5 @@ /* - $Id: bincue.c,v 1.21 2004/06/01 11:45:35 rocky Exp $ + $Id: bincue.c,v 1.22 2004/06/19 19:15:15 rocky Exp $ Copyright (C) 2002, 2003, 2004 Rocky Bernstein Copyright (C) 2001 Herbert Valerio Riedel @@ -24,7 +24,7 @@ (*.cue). */ -static const char _rcsid[] = "$Id: bincue.c,v 1.21 2004/06/01 11:45:35 rocky Exp $"; +static const char _rcsid[] = "$Id: bincue.c,v 1.22 2004/06/19 19:15:15 rocky Exp $"; #include "cdio_assert.h" #include "cdio_private.h" @@ -235,8 +235,8 @@ _read_bincue (void *user_data, void *data, size_t size) ssize_t skip_size = this_track->datastart + this_track->endsize; while (size > 0) { - int rem = this_track->datasize - env->pos.buff_offset; - if (size <= rem) { + long int rem = this_track->datasize - env->pos.buff_offset; + if ((long int) size <= rem) { this_size = cdio_stream_read(env->gen.data_source, buf, size, 1); final_size += this_size; memcpy (p, buf, this_size); @@ -832,7 +832,7 @@ cdio_is_cuefile(const char *cue_name) int i; char *bin_name; - if (cue_name == NULL) return false; + if (cue_name == NULL) return NULL; bin_name=strdup(cue_name); i=strlen(bin_name)-strlen("cue"); @@ -865,7 +865,7 @@ cdio_is_binfile(const char *bin_name) int i; char *cue_name; - if (bin_name == NULL) return false; + if (bin_name == NULL) return NULL; cue_name=strdup(bin_name); i=strlen(bin_name)-strlen("bin"); diff --git a/lib/util.c b/lib/util.c index dc38a7fa..8b866313 100644 --- a/lib/util.c +++ b/lib/util.c @@ -1,5 +1,5 @@ /* - $Id: util.c,v 1.2 2003/04/22 12:09:09 rocky Exp $ + $Id: util.c,v 1.3 2004/06/19 19:15:15 rocky Exp $ Copyright (C) 2000 Herbert Valerio Riedel Copyright (C) 2003 Rocky Bernstein @@ -28,10 +28,14 @@ #include #include +#ifdef HAVE_INTTYPES_H +#include "inttypes.h" +#endif + #include "cdio_assert.h" #include -static const char _rcsid[] = "$Id: util.c,v 1.2 2003/04/22 12:09:09 rocky Exp $"; +static const char _rcsid[] = "$Id: util.c,v 1.3 2004/06/19 19:15:15 rocky Exp $"; size_t _cdio_strlenv(char **str_array) diff --git a/src/cd-info.c b/src/cd-info.c index 8409a2b5..e5969a28 100644 --- a/src/cd-info.c +++ b/src/cd-info.c @@ -1,5 +1,5 @@ /* - $Id: cd-info.c,v 1.67 2004/06/19 10:38:07 rocky Exp $ + $Id: cd-info.c,v 1.68 2004/06/19 19:15:15 rocky Exp $ Copyright (C) 2003, 2004 Rocky Bernstein Copyright (C) 1996, 1997, 1998 Gerd Knorr @@ -667,7 +667,7 @@ print_analysis(int ms_offset, cdio_iso_analysis_t cdio_iso_analysis, printf("CD-ROM with Unix UFS\n"); break; case CDIO_FS_EXT2: - printf("CD-ROM with Linux second extended filesystem\n"); + printf("CD-ROM with GNU/Linux EXT2 (native) filesystem\n"); break; case CDIO_FS_3DO: printf("CD-ROM with Panasonic 3DO filesystem\n"); @@ -675,6 +675,9 @@ print_analysis(int ms_offset, cdio_iso_analysis_t cdio_iso_analysis, case CDIO_FS_UNKNOWN: printf("CD-ROM with unknown filesystem\n"); break; + case CDIO_FS_XISO: + printf("CD-ROM with Microsoft X-BOX XISO filesystem\n"); + break; } switch(CDIO_FSTYPE(fs)) { case CDIO_FS_ISO_9660: diff --git a/src/iso-info.c b/src/iso-info.c index 37f0447b..c150f6dd 100644 --- a/src/iso-info.c +++ b/src/iso-info.c @@ -1,5 +1,5 @@ /* - $Id: iso-info.c,v 1.8 2004/06/19 10:38:07 rocky Exp $ + $Id: iso-info.c,v 1.9 2004/06/19 19:15:15 rocky Exp $ Copyright (C) 2004 Rocky Bernstein @@ -38,7 +38,9 @@ #include #include #include +#ifdef HAVE_UNISTD_H #include +#endif #include #include diff --git a/src/util.c b/src/util.c index 9159bd51..56b98e49 100644 --- a/src/util.c +++ b/src/util.c @@ -1,5 +1,5 @@ /* - $Id: util.c,v 1.7 2004/04/25 14:07:23 rocky Exp $ + $Id: util.c,v 1.8 2004/06/19 19:15:15 rocky Exp $ Copyright (C) 2003, 2004 Rocky Bernstein @@ -75,11 +75,11 @@ fillout_device_name(const char *device_name) #if defined(HAVE_WIN32_CDROM) return strdup(device_name); #else - unsigned int prefix_len=strlen(DEV_PREFIX); + unsigned int prefix_len = strlen(DEV_PREFIX); if (0 == strncmp(device_name, DEV_PREFIX, prefix_len)) return strdup(device_name); else { - char *full_device_name=malloc(strlen(device_name)+prefix_len); + char *full_device_name = (char*) malloc(strlen(device_name)+prefix_len); sprintf(full_device_name, DEV_PREFIX "%s", device_name); return full_device_name; }