Conditional compilation of Joliet support.

This commit is contained in:
rocky
2004-10-29 02:11:48 +00:00
parent ab9c002b0b
commit 749d506d08
3 changed files with 36 additions and 17 deletions

View File

@@ -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
@@ -197,6 +198,7 @@ iso9660_ifs_get_application_id(iso9660_t *p_iso,
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
@@ -209,6 +211,7 @@ iso9660_ifs_get_application_id(iso9660_t *p_iso,
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);
} }
@@ -235,6 +238,7 @@ iso9660_ifs_get_preparer_id(iso9660_t *p_iso,
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
@@ -245,6 +249,7 @@ iso9660_ifs_get_preparer_id(iso9660_t *p_iso,
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);
} }
@@ -261,6 +266,7 @@ bool iso9660_ifs_get_publisher_id(iso9660_t *p_iso,
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
@@ -271,6 +277,7 @@ bool iso9660_ifs_get_publisher_id(iso9660_t *p_iso,
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);
} }
@@ -288,6 +295,7 @@ bool iso9660_ifs_get_system_id(iso9660_t *p_iso,
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);
} }
@@ -315,6 +324,7 @@ bool iso9660_ifs_get_volume_id(iso9660_t *p_iso,
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
@@ -325,6 +335,7 @@ bool iso9660_ifs_get_volume_id(iso9660_t *p_iso,
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);
} }
@@ -342,6 +353,7 @@ bool iso9660_ifs_get_volumeset_id(iso9660_t *p_iso,
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);
} }

View File

@@ -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>
@@ -211,8 +211,10 @@ 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"},

View 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>
@@ -96,8 +96,10 @@ 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" },