Conditional compilation of Joliet support.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
$Id: iso9660_fs.c,v 1.36 2004/10/28 11:13:40 rocky Exp $
|
$Id: iso9660_fs.c,v 1.37 2004/10/29 02:11:48 rocky Exp $
|
||||||
|
|
||||||
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
|
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
|
||||||
Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
static const char _rcsid[] = "$Id: iso9660_fs.c,v 1.36 2004/10/28 11:13:40 rocky Exp $";
|
static const char _rcsid[] = "$Id: iso9660_fs.c,v 1.37 2004/10/29 02:11:48 rocky Exp $";
|
||||||
|
|
||||||
/* Implementation of iso9660_t type */
|
/* Implementation of iso9660_t type */
|
||||||
struct _iso9660 {
|
struct _iso9660 {
|
||||||
@@ -139,6 +139,7 @@ check_pvd (const iso9660_pvd_t *p_pvd)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_JOLIET
|
||||||
static bool
|
static bool
|
||||||
ucs2be_to_locale(ICONV_CONST char *psz_ucs2be, size_t i_inlen,
|
ucs2be_to_locale(ICONV_CONST char *psz_ucs2be, size_t i_inlen,
|
||||||
char **p_psz_out, size_t i_outlen)
|
char **p_psz_out, size_t i_outlen)
|
||||||
@@ -182,7 +183,7 @@ ucs2be_to_locale(ICONV_CONST char *psz_ucs2be, size_t i_inlen,
|
|||||||
*p_psz_out = NULL;
|
*p_psz_out = NULL;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#endif /*HAVE_JOLIET*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Return the application ID. NULL is returned in psz_app_id if there
|
Return the application ID. NULL is returned in psz_app_id if there
|
||||||
@@ -196,7 +197,8 @@ iso9660_ifs_get_application_id(iso9660_t *p_iso,
|
|||||||
*p_psz_app_id = NULL;
|
*p_psz_app_id = NULL;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_JOLIET
|
||||||
if (p_iso->i_joliet_level) {
|
if (p_iso->i_joliet_level) {
|
||||||
/* TODO: check that we haven't reached the maximum size.
|
/* TODO: check that we haven't reached the maximum size.
|
||||||
If we have, perhaps we've truncated and if we can get
|
If we have, perhaps we've truncated and if we can get
|
||||||
@@ -208,7 +210,8 @@ iso9660_ifs_get_application_id(iso9660_t *p_iso,
|
|||||||
p_psz_app_id,
|
p_psz_app_id,
|
||||||
ISO_MAX_APPLICATION_ID))
|
ISO_MAX_APPLICATION_ID))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
#endif /*HAVE_JOLIET*/
|
||||||
*p_psz_app_id = iso9660_get_application_id( &(p_iso->pvd) );
|
*p_psz_app_id = iso9660_get_application_id( &(p_iso->pvd) );
|
||||||
return *p_psz_app_id != NULL && strlen(*p_psz_app_id);
|
return *p_psz_app_id != NULL && strlen(*p_psz_app_id);
|
||||||
}
|
}
|
||||||
@@ -234,7 +237,8 @@ iso9660_ifs_get_preparer_id(iso9660_t *p_iso,
|
|||||||
*p_psz_preparer_id = NULL;
|
*p_psz_preparer_id = NULL;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_JOLIET
|
||||||
if (p_iso->i_joliet_level) {
|
if (p_iso->i_joliet_level) {
|
||||||
/* TODO: check that we haven't reached the maximum size.
|
/* TODO: check that we haven't reached the maximum size.
|
||||||
If we have, perhaps we've truncated and if we can get
|
If we have, perhaps we've truncated and if we can get
|
||||||
@@ -244,7 +248,8 @@ iso9660_ifs_get_preparer_id(iso9660_t *p_iso,
|
|||||||
if ( ucs2be_to_locale(p_iso->svd.preparer_id, ISO_MAX_PREPARER_ID,
|
if ( ucs2be_to_locale(p_iso->svd.preparer_id, ISO_MAX_PREPARER_ID,
|
||||||
p_psz_preparer_id, ISO_MAX_PREPARER_ID) )
|
p_psz_preparer_id, ISO_MAX_PREPARER_ID) )
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
#endif /*HAVE_JOLIET*/
|
||||||
*p_psz_preparer_id = iso9660_get_preparer_id( &(p_iso->pvd) );
|
*p_psz_preparer_id = iso9660_get_preparer_id( &(p_iso->pvd) );
|
||||||
return *p_psz_preparer_id != NULL && strlen(*p_psz_preparer_id);
|
return *p_psz_preparer_id != NULL && strlen(*p_psz_preparer_id);
|
||||||
}
|
}
|
||||||
@@ -260,7 +265,8 @@ bool iso9660_ifs_get_publisher_id(iso9660_t *p_iso,
|
|||||||
*p_psz_publisher_id = NULL;
|
*p_psz_publisher_id = NULL;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_JOLIET
|
||||||
if (p_iso->i_joliet_level) {
|
if (p_iso->i_joliet_level) {
|
||||||
/* TODO: check that we haven't reached the maximum size.
|
/* TODO: check that we haven't reached the maximum size.
|
||||||
If we have, perhaps we've truncated and if we can get
|
If we have, perhaps we've truncated and if we can get
|
||||||
@@ -270,7 +276,8 @@ bool iso9660_ifs_get_publisher_id(iso9660_t *p_iso,
|
|||||||
if( ucs2be_to_locale(p_iso->svd.publisher_id, ISO_MAX_PUBLISHER_ID,
|
if( ucs2be_to_locale(p_iso->svd.publisher_id, ISO_MAX_PUBLISHER_ID,
|
||||||
p_psz_publisher_id, ISO_MAX_PUBLISHER_ID) )
|
p_psz_publisher_id, ISO_MAX_PUBLISHER_ID) )
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
#endif /*HAVE_JOLIET*/
|
||||||
*p_psz_publisher_id = iso9660_get_publisher_id( &(p_iso->pvd) );
|
*p_psz_publisher_id = iso9660_get_publisher_id( &(p_iso->pvd) );
|
||||||
return *p_psz_publisher_id != NULL && strlen(*p_psz_publisher_id);
|
return *p_psz_publisher_id != NULL && strlen(*p_psz_publisher_id);
|
||||||
}
|
}
|
||||||
@@ -287,7 +294,8 @@ bool iso9660_ifs_get_system_id(iso9660_t *p_iso,
|
|||||||
*p_psz_system_id = NULL;
|
*p_psz_system_id = NULL;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_JOLIET
|
||||||
if (p_iso->i_joliet_level) {
|
if (p_iso->i_joliet_level) {
|
||||||
/* TODO: check that we haven't reached the maximum size.
|
/* TODO: check that we haven't reached the maximum size.
|
||||||
If we have, perhaps we've truncated and if we can get
|
If we have, perhaps we've truncated and if we can get
|
||||||
@@ -298,6 +306,7 @@ bool iso9660_ifs_get_system_id(iso9660_t *p_iso,
|
|||||||
p_psz_system_id, ISO_MAX_SYSTEM_ID) )
|
p_psz_system_id, ISO_MAX_SYSTEM_ID) )
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
#endif /*HAVE_JOLIET*/
|
||||||
*p_psz_system_id = iso9660_get_system_id( &(p_iso->pvd) );
|
*p_psz_system_id = iso9660_get_system_id( &(p_iso->pvd) );
|
||||||
return *p_psz_system_id != NULL && strlen(*p_psz_system_id);
|
return *p_psz_system_id != NULL && strlen(*p_psz_system_id);
|
||||||
}
|
}
|
||||||
@@ -314,7 +323,8 @@ bool iso9660_ifs_get_volume_id(iso9660_t *p_iso,
|
|||||||
*p_psz_volume_id = NULL;
|
*p_psz_volume_id = NULL;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_JOLIET
|
||||||
if (p_iso->i_joliet_level) {
|
if (p_iso->i_joliet_level) {
|
||||||
/* TODO: check that we haven't reached the maximum size.
|
/* TODO: check that we haven't reached the maximum size.
|
||||||
If we have, perhaps we've truncated and if we can get
|
If we have, perhaps we've truncated and if we can get
|
||||||
@@ -324,7 +334,8 @@ bool iso9660_ifs_get_volume_id(iso9660_t *p_iso,
|
|||||||
if ( ucs2be_to_locale(p_iso->svd.volume_id, ISO_MAX_VOLUME_ID,
|
if ( ucs2be_to_locale(p_iso->svd.volume_id, ISO_MAX_VOLUME_ID,
|
||||||
p_psz_volume_id, ISO_MAX_VOLUME_ID) )
|
p_psz_volume_id, ISO_MAX_VOLUME_ID) )
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
#endif /* HAVE_JOLIET */
|
||||||
*p_psz_volume_id = iso9660_get_volume_id( &(p_iso->pvd) );
|
*p_psz_volume_id = iso9660_get_volume_id( &(p_iso->pvd) );
|
||||||
return *p_psz_volume_id != NULL && strlen(*p_psz_volume_id);
|
return *p_psz_volume_id != NULL && strlen(*p_psz_volume_id);
|
||||||
}
|
}
|
||||||
@@ -341,7 +352,8 @@ bool iso9660_ifs_get_volumeset_id(iso9660_t *p_iso,
|
|||||||
*p_psz_volumeset_id = NULL;
|
*p_psz_volumeset_id = NULL;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_JOLIET
|
||||||
if (p_iso->i_joliet_level) {
|
if (p_iso->i_joliet_level) {
|
||||||
/* TODO: check that we haven't reached the maximum size.
|
/* TODO: check that we haven't reached the maximum size.
|
||||||
If we have, perhaps we've truncated and if we can get
|
If we have, perhaps we've truncated and if we can get
|
||||||
@@ -354,6 +366,7 @@ bool iso9660_ifs_get_volumeset_id(iso9660_t *p_iso,
|
|||||||
ISO_MAX_VOLUMESET_ID) )
|
ISO_MAX_VOLUMESET_ID) )
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
#endif /*HAVE_JOLIET*/
|
||||||
*p_psz_volumeset_id = iso9660_get_volume_id( &(p_iso->pvd) );
|
*p_psz_volumeset_id = iso9660_get_volume_id( &(p_iso->pvd) );
|
||||||
return *p_psz_volumeset_id != NULL && strlen(*p_psz_volumeset_id);
|
return *p_psz_volumeset_id != NULL && strlen(*p_psz_volumeset_id);
|
||||||
}
|
}
|
||||||
@@ -595,6 +608,7 @@ _iso9660_dir_to_statbuf (iso9660_dir_t *p_iso9660_dir,
|
|||||||
else if ('\1' == p_iso9660_dir->filename[0] && 1 == filename_len)
|
else if ('\1' == p_iso9660_dir->filename[0] && 1 == filename_len)
|
||||||
strcpy (stat->filename, "..");
|
strcpy (stat->filename, "..");
|
||||||
else {
|
else {
|
||||||
|
#ifdef HAVE_JOLIET
|
||||||
if (i_joliet_level) {
|
if (i_joliet_level) {
|
||||||
int i_inlen = filename_len;
|
int i_inlen = filename_len;
|
||||||
int i_outlen = (i_inlen / 2);
|
int i_outlen = (i_inlen / 2);
|
||||||
@@ -604,6 +618,7 @@ _iso9660_dir_to_statbuf (iso9660_dir_t *p_iso9660_dir,
|
|||||||
strncpy(stat->filename, p_psz_out, filename_len);
|
strncpy(stat->filename, p_psz_out, filename_len);
|
||||||
free(p_psz_out);
|
free(p_psz_out);
|
||||||
} else
|
} else
|
||||||
|
#endif /*HAVE_JOLIET*/
|
||||||
strncpy (stat->filename, p_iso9660_dir->filename, filename_len);
|
strncpy (stat->filename, p_iso9660_dir->filename, filename_len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
$Id: cd-info.c,v 1.95 2004/10/26 07:51:49 rocky Exp $
|
$Id: cd-info.c,v 1.96 2004/10/29 02:11:48 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>
|
||||||
@@ -210,9 +210,11 @@ parse_options (int argc, const char *argv[])
|
|||||||
|
|
||||||
{"no-header", '\0', POPT_ARG_NONE, &opts.no_header,
|
{"no-header", '\0', POPT_ARG_NONE, &opts.no_header,
|
||||||
0, "Don't display header and copyright (for regression testing)"},
|
0, "Don't display header and copyright (for regression testing)"},
|
||||||
|
|
||||||
|
#ifdef HAVE_JOLIET
|
||||||
{"no-joliet", '\0', POPT_ARG_NONE, &opts.no_joliet,
|
{"no-joliet", '\0', POPT_ARG_NONE, &opts.no_joliet,
|
||||||
0, "Don't use Joliet extensions"},
|
0, "Don't use Joliet extensions"},
|
||||||
|
#endif /*HAVE_JOLIET*/
|
||||||
|
|
||||||
{"nrg-file", 'N', POPT_ARG_STRING|POPT_ARGFLAG_OPTIONAL, &psz_my_source,
|
{"nrg-file", 'N', POPT_ARG_STRING|POPT_ARGFLAG_OPTIONAL, &psz_my_source,
|
||||||
OP_SOURCE_NRG, "set Nero CD-ROM disk image file as source", "FILE"},
|
OP_SOURCE_NRG, "set Nero CD-ROM disk image file as source", "FILE"},
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
$Id: iso-info.c,v 1.14 2004/10/24 11:20:30 rocky Exp $
|
$Id: iso-info.c,v 1.15 2004/10/29 02:11:48 rocky Exp $
|
||||||
|
|
||||||
Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
|
Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
|
||||||
|
|
||||||
@@ -95,9 +95,11 @@ parse_options (int argc, const char *argv[])
|
|||||||
|
|
||||||
{"no-header", '\0', POPT_ARG_NONE, &opts.no_header,
|
{"no-header", '\0', POPT_ARG_NONE, &opts.no_header,
|
||||||
0, "Don't display header and copyright (for regression testing)"},
|
0, "Don't display header and copyright (for regression testing)"},
|
||||||
|
|
||||||
|
#ifdef HAVE_JOLIET
|
||||||
{"no-joliet", '\0', POPT_ARG_NONE, &opts.no_joliet,
|
{"no-joliet", '\0', POPT_ARG_NONE, &opts.no_joliet,
|
||||||
0, "Don't use Joliet extensions"},
|
0, "Don't use Joliet extensions"},
|
||||||
|
#endif /*HAVE_JOLIET*/
|
||||||
|
|
||||||
{"quiet", 'q', POPT_ARG_NONE, &opts.silent, 0,
|
{"quiet", 'q', POPT_ARG_NONE, &opts.silent, 0,
|
||||||
"Don't produce warning output" },
|
"Don't produce warning output" },
|
||||||
|
|||||||
Reference in New Issue
Block a user