Lint-like things.

Add X-BOX detection courtesy of the xmbc project.
This commit is contained in:
rocky
2004-06-19 19:15:15 +00:00
parent 001bd6360b
commit e1808fb407
10 changed files with 66 additions and 34 deletions

View File

@@ -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 <rocky@panix.com> Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
Copyright (C) 1996,1997,1998 Gerd Knorr <kraxel@bytesex.org> Copyright (C) 1996,1997,1998 Gerd Knorr <kraxel@bytesex.org>
@@ -67,6 +67,11 @@ extern "C" {
*/ */
#define CDIO_FS_3DO 10 #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 #define CDIO_FS_MASK 15 /**< Note: this should be 2**n-1 and
and greater than the highest and greater than the highest
CDIO_FS number above */ CDIO_FS number above */
@@ -82,20 +87,21 @@ extern "C" {
* higher-level than the fs-type information above and may be determined * higher-level than the fs-type information above and may be determined
* based of the fs type information. * based of the fs type information.
*/ */
#define CDIO_FS_ANAL_XA 16 /**< eXtended Architecture format */ #define CDIO_FS_ANAL_XA 0x0010 /**< eXtended Architecture format */
#define CDIO_FS_ANAL_MULTISESSION 32 /**< CD has multisesion */ #define CDIO_FS_ANAL_MULTISESSION 0x0020 /**< CD has multisesion */
#define CDIO_FS_ANAL_PHOTO_CD 64 /**< Is a Kodak Photo CD */ #define CDIO_FS_ANAL_PHOTO_CD 0x0040 /**< Is a Kodak Photo CD */
#define CDIO_FS_ANAL_HIDDEN_TRACK 128 /**< Hidden track at the #define CDIO_FS_ANAL_HIDDEN_TRACK 0x0080 /**< Hidden track at the
beginning of the CD */ beginning of the CD */
#define CDIO_FS_ANAL_CDTV 256 #define CDIO_FS_ANAL_CDTV 0x0100
#define CDIO_FS_ANAL_BOOTABLE 512 /**< CD is bootable */ #define CDIO_FS_ANAL_BOOTABLE 0x0200 /**< CD is bootable */
#define CDIO_FS_ANAL_VIDEOCD 1024 /**< VCD 1.1 */ #define CDIO_FS_ANAL_VIDEOCD 0x0400 /**< VCD 1.1 */
#define CDIO_FS_ANAL_ROCKRIDGE 2048 /**< Has Rock Ridge Extensions to #define CDIO_FS_ANAL_ROCKRIDGE 0x0800 /**< Has Rock Ridge Extensions to
ISO 9660 */ ISO 9660 */
#define CDIO_FS_ANAL_JOLIET 4096 /**< Microsoft Joliet extensions #define CDIO_FS_ANAL_JOLIET 0x1000 /**< Microsoft Joliet extensions
to ISO 9660 */ to ISO 9660 */
#define CDIO_FS_ANAL_SVCD 8192 /**< Super VCD or Choiji Video CD */ #define CDIO_FS_ANAL_SVCD 0x2000 /**< Super VCD or Choiji Video CD */
#define CDIO_FS_ANAL_CVD 16384 /**< 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 * Pattern which can be used by cdio_get_devices to specify matching

View File

@@ -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 <hvr@gnu.org> Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com> Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com>
@@ -27,13 +27,17 @@
# include "config.h" # include "config.h"
#endif #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 <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif /*HAVE_UNISTD_H*/
#include <fcntl.h> #include <fcntl.h>
#include <sys/stat.h> #include <sys/stat.h>
@@ -41,6 +45,7 @@ static const char _rcsid[] = "$Id: _cdio_generic.c,v 1.16 2004/05/31 12:29:09 ro
#include <cdio/sector.h> #include <cdio/sector.h>
#include <cdio/util.h> #include <cdio/util.h>
#include <cdio/logging.h>
#include "cdio_assert.h" #include "cdio_assert.h"
#include "cdio_private.h" #include "cdio_private.h"
#include "_cdio_stdio.h" #include "_cdio_stdio.h"

View File

@@ -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 <hvr@gnu.org> Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com> Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
@@ -26,7 +26,11 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif /*HAVE_UNISTD_H*/
#include <sys/stat.h> #include <sys/stat.h>
#include <errno.h> #include <errno.h>
@@ -35,7 +39,7 @@
#include "_cdio_stream.h" #include "_cdio_stream.h"
#include "_cdio_stdio.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) #define CDIO_STDIO_BUFSIZE (128*1024)

View File

@@ -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 <rocky@panix.com> Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
@@ -66,6 +66,7 @@ static char buffer[6][CDIO_CD_FRAMESIZE_RAW]; /* for CD-Data */
#define UFS_SUPERBLOCK_SECTOR 4 /* buffer[2] */ #define UFS_SUPERBLOCK_SECTOR 4 /* buffer[2] */
#define BOOT_SECTOR 17 /* buffer[3] */ #define BOOT_SECTOR 17 /* buffer[3] */
#define VCD_INFO_SECTOR 150 /* buffer[4] */ #define VCD_INFO_SECTOR 150 /* buffer[4] */
#define XISO_SECTOR 32 /* buffer[4] */
typedef struct signature typedef struct signature
@@ -92,6 +93,7 @@ static signature_t sigs[] =
{3, 7, "EL TORITO", "BOOTABLE"}, {3, 7, "EL TORITO", "BOOTABLE"},
{4, 0, "VIDEO_CD", "VIDEO CD"}, {4, 0, "VIDEO_CD", "VIDEO CD"},
{4, 0, "SUPERVCD", "SVCD or Chaoji VCD"}, {4, 0, "SUPERVCD", "SVCD or Chaoji VCD"},
{0, 0, "MICROSOFT*XBOX*MEDIA", "XBOX CD"},
{ 0 } { 0 }
}; };
@@ -110,6 +112,7 @@ static signature_t sigs[] =
#define INDEX_BOOTABLE 10 #define INDEX_BOOTABLE 10
#define INDEX_VIDEO_CD 11 /* Video CD */ #define INDEX_VIDEO_CD 11 /* Video CD */
#define INDEX_SVCD 12 /* CVD *or* SVCD */ #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 ) 0, track_num) < 0 )
return CDIO_FS_UNKNOWN; return CDIO_FS_UNKNOWN;
if ( _cdio_is_it(INDEX_XISO) )
return CDIO_FS_ANAL_XISO;
/* We have something that smells of a filesystem. */ /* We have something that smells of a filesystem. */
if (_cdio_is_it(INDEX_CD_I) && _cdio_is_it(INDEX_CD_RTOS) if (_cdio_is_it(INDEX_CD_I) && _cdio_is_it(INDEX_CD_RTOS)
&& !_cdio_is_it(INDEX_BRIDGE) && !_cdio_is_it(INDEX_XA)) { && !_cdio_is_it(INDEX_BRIDGE) && !_cdio_is_it(INDEX_XA)) {

View File

@@ -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 <rocky@panix.com> Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org> Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
@@ -26,7 +26,9 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
@@ -37,7 +39,7 @@
#include <cdio/logging.h> #include <cdio/logging.h>
#include "cdio_private.h" #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] = const char *track_format2str[6] =

View File

@@ -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 <rocky@panix.com> Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com>
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org> Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
@@ -24,7 +24,7 @@
(*.cue). (*.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_assert.h"
#include "cdio_private.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; ssize_t skip_size = this_track->datastart + this_track->endsize;
while (size > 0) { while (size > 0) {
int rem = this_track->datasize - env->pos.buff_offset; long int rem = this_track->datasize - env->pos.buff_offset;
if (size <= rem) { if ((long int) size <= rem) {
this_size = cdio_stream_read(env->gen.data_source, buf, size, 1); this_size = cdio_stream_read(env->gen.data_source, buf, size, 1);
final_size += this_size; final_size += this_size;
memcpy (p, buf, this_size); memcpy (p, buf, this_size);
@@ -832,7 +832,7 @@ cdio_is_cuefile(const char *cue_name)
int i; int i;
char *bin_name; char *bin_name;
if (cue_name == NULL) return false; if (cue_name == NULL) return NULL;
bin_name=strdup(cue_name); bin_name=strdup(cue_name);
i=strlen(bin_name)-strlen("cue"); i=strlen(bin_name)-strlen("cue");
@@ -865,7 +865,7 @@ cdio_is_binfile(const char *bin_name)
int i; int i;
char *cue_name; char *cue_name;
if (bin_name == NULL) return false; if (bin_name == NULL) return NULL;
cue_name=strdup(bin_name); cue_name=strdup(bin_name);
i=strlen(bin_name)-strlen("bin"); i=strlen(bin_name)-strlen("bin");

View File

@@ -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 <hvr@gnu.org> Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2003 Rocky Bernstein <rocky@panix.com> Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
@@ -28,10 +28,14 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#ifdef HAVE_INTTYPES_H
#include "inttypes.h"
#endif
#include "cdio_assert.h" #include "cdio_assert.h"
#include <cdio/util.h> #include <cdio/util.h>
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 size_t
_cdio_strlenv(char **str_array) _cdio_strlenv(char **str_array)

View File

@@ -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 <rocky@panix.com> Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
Copyright (C) 1996, 1997, 1998 Gerd Knorr <kraxel@bytesex.org> Copyright (C) 1996, 1997, 1998 Gerd Knorr <kraxel@bytesex.org>
@@ -667,7 +667,7 @@ print_analysis(int ms_offset, cdio_iso_analysis_t cdio_iso_analysis,
printf("CD-ROM with Unix UFS\n"); printf("CD-ROM with Unix UFS\n");
break; break;
case CDIO_FS_EXT2: case CDIO_FS_EXT2:
printf("CD-ROM with Linux second extended filesystem\n"); printf("CD-ROM with GNU/Linux EXT2 (native) filesystem\n");
break; break;
case CDIO_FS_3DO: case CDIO_FS_3DO:
printf("CD-ROM with Panasonic 3DO filesystem\n"); 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: case CDIO_FS_UNKNOWN:
printf("CD-ROM with unknown filesystem\n"); printf("CD-ROM with unknown filesystem\n");
break; break;
case CDIO_FS_XISO:
printf("CD-ROM with Microsoft X-BOX XISO filesystem\n");
break;
} }
switch(CDIO_FSTYPE(fs)) { switch(CDIO_FSTYPE(fs)) {
case CDIO_FS_ISO_9660: case CDIO_FS_ISO_9660:

View File

@@ -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 <rocky@panix.com> Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
@@ -38,7 +38,9 @@
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif
#include <sys/types.h> #include <sys/types.h>
#include <errno.h> #include <errno.h>

View File

@@ -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 <rocky@panix.com> Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
@@ -79,7 +79,7 @@ fillout_device_name(const char *device_name)
if (0 == strncmp(device_name, DEV_PREFIX, prefix_len)) if (0 == strncmp(device_name, DEV_PREFIX, prefix_len))
return strdup(device_name); return strdup(device_name);
else { 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); sprintf(full_device_name, DEV_PREFIX "%s", device_name);
return full_device_name; return full_device_name;
} }