diff --git a/configure.ac b/configure.ac index 78f7423e..b6dad625 100644 --- a/configure.ac +++ b/configure.ac @@ -19,7 +19,7 @@ define(RELEASE_NUM, 72) define(CDIO_VERSION_STR, 0.$1cvs) AC_PREREQ(2.52) -AC_REVISION([$Id: configure.ac,v 1.119 2004/12/18 17:29:32 rocky Exp $])dnl +AC_REVISION([$Id: configure.ac,v 1.120 2004/12/18 21:24:25 rocky Exp $])dnl AC_INIT(libcdio, CDIO_VERSION_STR(RELEASE_NUM)) AC_CONFIG_SRCDIR(src/cd-info.c) AM_INIT_AUTOMAKE @@ -36,22 +36,34 @@ AM_MAINTAINER_MODE AM_SANITY_CHECK +AC_ARG_WITH(cd_drive, +[ --without-cd-drive build program cd-drive (enabled by default)], +enable_cd_drive="${withval}", enable_cd_drive=yes) + AC_ARG_WITH(cd_info, -[ --without-cd-info build program cd-info (enabled by default)], +[ --without-cd-info build program cd-info (enabled by default)], enable_cd_info="${withval}", enable_cd_info=yes) +AC_ARG_WITH(cd_paranoia, +[ --without-cd-paranoia build program cd-paranoia (enabled by default)], +enable_cd_paranoia="${withval}", enable_cd_paranoia=yes) + AC_ARG_WITH(cd_read, -[ --without-cd-read build program cd-read (enabled by default)], +[ --without-cd-read build program cd-read (enabled by default)], enable_cd_read="${withval}", enable_cd_read=yes) +AC_ARG_WITH(iso_info, +[ --without-iso-info build program iso-info (enabled by default)], +enable_iso_info="${withval}", enable_iso_info=yes) + +AC_ARG_WITH(iso_read, +[ --without-iso-read build program iso-read (enabled by default)], +enable_iso_read="${withval}", enable_iso_read=yes) + AC_ARG_WITH(versioned_libs, [ --without-versioned-libs build versioned library symbols (enabled by default if you have GNU ld)], enable_versioned_libs="${withval}", enable_versioned_libs=yes) -AC_ARG_WITH(cd_info, -[ --without-cd-info build program cd-info (enabled by default)], -enable_cd_info="${withval}", enable_cd_info=yes) - AC_ARG_ENABLE(vcd_info, [ --disable-cpp don't make C++ example programs], enable_cpp=no, @@ -117,7 +129,11 @@ AC_SUBST(DIFF_OPTS) AM_PATH_LIBPOPT(, [AC_MSG_WARN([Diagnostic programs cd-drive, cd-info, cd-read, iso-info, and is-read will not get built.]) - enable_cd_info=no]) + enable_cd_info=no; + enable_cd_drive=no; + enable_cd_read=no; + enable_iso_info=no; + enable_iso_read=no]) dnl headers @@ -233,7 +249,12 @@ if test "x$enable_versioned_libs" = "xyes" ; then fi AM_CONDITIONAL(CYGWIN, test "x$CYGWIN" = "xyes") +AM_CONDITIONAL(BUILD_CD_DRIVE, test "x$enable_cd_drive" = "xyes") AM_CONDITIONAL(BUILD_CDINFO, test "x$enable_cd_info" = "xyes") +AM_CONDITIONAL(BUILD_CD_READ, test "x$enable_cd_read" = "xyes") +AM_CONDITIONAL(BUILD_CD_PARANOIA, test "x$enable_cd_paranoia" = "xyes") +AM_CONDITIONAL(BUILD_ISO_INFO, test "x$enable_iso_info" = "xyes") +AM_CONDITIONAL(BUILD_ISO_READ, test "x$enable_iso_read" = "xyes") AM_CONDITIONAL(BUILD_CDINFO_LINUX, test "x$enable_cd_info_linux" = "xyes") AM_CONDITIONAL(BUILD_CDIOTEST, test "x$enable_cdiotest" = "xyes") AM_CONDITIONAL(BUILD_VERSIONED_LIBS, test "x$enable_versioned_libs" = "xyes") diff --git a/src/Makefile.am b/src/Makefile.am index c0ad8f6a..a0d2840c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,4 @@ -# $Id: Makefile.am,v 1.27 2004/12/18 17:29:32 rocky Exp $ +# $Id: Makefile.am,v 1.28 2004/12/18 21:24:25 rocky Exp $ # # Copyright (C) 2003, 2004 Rocky Bernstein # @@ -33,18 +33,27 @@ endif if BUILD_CDINFO cd_info_SOURCES = cd-info.c util.c util.h cd_info_LDADD = $(LIBISO9660_LIBS) $(LIBCDIO_LIBS) $(LIBPOPT_LIBS) $(CDDB_LIBS) $(VCDINFO_LIBS) $(LIBICONV) +endif +if BUILD_CD_DRIVE cd_drive_SOURCES = cd-drive.c util.c util.h cd_drive_LDADD = $(LIBCDIO_LIBS) $(LIBPOPT_LIBS) $(LIBICONV) +endif +if BUILD_CD_READ cd_read_SOURCES = cd-read.c util.c util.h cd_read_LDADD = $(LIBCDIO_LIBS) $(LIBPOPT_LIBS) $(LIBICONV) +endif +if BUILD_ISO_INFO iso_info_SOURCES = iso-info.c util.c util.h iso_info_LDADD = $(LIBISO9660_LIBS) $(LIBCDIO_LIBS) $(LIBPOPT_LIBS) $(LIBICONV) +endif +if BUILD_ISO_READ iso_read_SOURCES = iso-read.c util.c util.h iso_read_LDADD = $(LIBISO9660_LIBS) $(LIBCDIO_LIBS) $(LIBPOPT_LIBS) $(LIBICONV) +endif if BUILD_CDINFO_LINUX cdinfo_linux_SOURCES = cdinfo-linux.c @@ -54,10 +63,6 @@ else bin_PROGRAMS = cd-drive cd-info cd-read iso-info iso-read EXTRA_DIST = cdinfo-linux.c $(man_MANS) endif -else -EXTRA_DIST = cdinfo-linux.c cd-drive.c cd-info.c cd-read.c $(man_MANS) -man_MANS = -endif # Put LIBPOPT_CFLAGS after local include in case LIBPOPT has headers common # to those in LIBCDIO_CFLAGS diff --git a/src/cd-info.c b/src/cd-info.c index ba3ff09b..3fb9a08b 100644 --- a/src/cd-info.c +++ b/src/cd-info.c @@ -1,5 +1,5 @@ /* - $Id: cd-info.c,v 1.102 2004/12/18 17:29:32 rocky Exp $ + $Id: cd-info.c,v 1.103 2004/12/18 21:24:25 rocky Exp $ Copyright (C) 2003, 2004 Rocky Bernstein Copyright (C) 1996, 1997, 1998 Gerd Knorr @@ -1061,10 +1061,17 @@ main(int argc, const char *argv[]) if (i == CDIO_CDROM_LEADOUT_TRACK) { if (!opts.no_tracks) { lsn_t lsn= cdio_msf_to_lsn(&msf); - long unsigned int i_mb = ( lsn * CDIO_CD_FRAMESIZE_RAW ) / - (1024 * 1024); - printf( "%3d: %8s %06lu leadout (%lu MB)\n", (int) i, psz_msf, - (long unsigned int) lsn, i_mb ); + long unsigned int i_bytes = lsn * CDIO_CD_FRAMESIZE_RAW; + + printf( "%3d: %8s %06lu leadout ", (int) i, psz_msf, + (long unsigned int) lsn ); + + if (i_bytes < 1024) + printf( "(%lu bytes)\n", i_bytes ); + if (i_bytes < 1024 * 1024) + printf( "(%lu KB)\n", i_bytes / 1024 ); + else + printf( "(%lu MB)\n", i_bytes / (1024 * 1024) ); } free(psz_msf); break; diff --git a/src/cd-paranoia/Makefile.am b/src/cd-paranoia/Makefile.am index 6fb5455c..c1a33c6e 100644 --- a/src/cd-paranoia/Makefile.am +++ b/src/cd-paranoia/Makefile.am @@ -1,4 +1,4 @@ -# $Id: Makefile.am,v 1.1 2004/12/18 17:29:32 rocky Exp $ +# $Id: Makefile.am,v 1.2 2004/12/18 21:24:25 rocky Exp $ # # Copyright (C) 2004 Rocky Bernstein # Copyright (C) 1998 Monty xiphmont@mit.edu @@ -19,6 +19,7 @@ # ############################################################################### +if BUILD_CD_PARANOIA cd_paranoia_SOURCES = cd-paranoia.c \ buffering_write.c buffering_write.h \ header.c header.h \ @@ -32,3 +33,5 @@ man_MANS = cd-paranoia.1 cd-paranoia.1.jp EXTRA_DIST = $(man_MANS) INCLUDES = -I$(top_srcdir) $(LIBCDIO_CFLAGS) +endif + diff --git a/src/iso-info.c b/src/iso-info.c index 58b71ca2..5068d594 100644 --- a/src/iso-info.c +++ b/src/iso-info.c @@ -1,5 +1,5 @@ /* - $Id: iso-info.c,v 1.17 2004/11/04 10:08:23 rocky Exp $ + $Id: iso-info.c,v 1.18 2004/12/18 21:24:25 rocky Exp $ Copyright (C) 2004 Rocky Bernstein @@ -61,12 +61,12 @@ struct arguments { uint32_t debug_level; - int no_analysis; int version_only; int silent; int no_header; int no_joliet; int print_iso9660; + int print_iso9660_short; } opts; /* Configuration option codes */ @@ -90,8 +90,14 @@ parse_options (int argc, const char *argv[]) {"debug", 'd', POPT_ARG_INT, &opts.debug_level, 0, "Set debugging to LEVEL"}, - {"iso9660", '\0', POPT_ARG_NONE, &opts.print_iso9660, 0, - "print directory contents of any ISO-9660 filesystems"}, + {"input", 'i', POPT_ARG_STRING|POPT_ARGFLAG_OPTIONAL, &source_name, 0, + "Filename to read ISO-9960 image from", "FILE"}, + + {'\0', 'f', POPT_ARG_NONE, &opts.print_iso9660_short, 0, + "Generate output similar to 'find . -print'"}, + + {"iso9660", 'l', POPT_ARG_NONE, &opts.print_iso9660, 0, + "Generate output similar to 'ls -lR'"}, {"no-header", '\0', POPT_ARG_NONE, &opts.no_header, 0, "Don't display header and copyright (for regression testing)"}, @@ -166,7 +172,9 @@ print_iso9660_recurse (iso9660_t *p_iso, const char pathname[]) entlist = iso9660_ifs_readdir (p_iso, pathname); - printf ("%s:\n", pathname); + if (opts.print_iso9660) { + printf ("%s:\n", pathname); + } if (NULL == entlist) { report( stderr, "Error getting above directory information\n" ); @@ -196,32 +204,36 @@ print_iso9660_recurse (iso9660_t *p_iso, const char pathname[]) && strcmp (iso_name, "..")) _cdio_list_append (dirlist, strdup (_fullname)); -#if 1 - if (iso9660_ifs_is_xa(p_iso)) { - printf ( " %c %s %d %d [fn %.2d] [LSN %6lu] ", - (statbuf->type == _STAT_DIR) ? 'd' : '-', - iso9660_get_xa_attr_str (statbuf->xa.attributes), - uint16_from_be (statbuf->xa.user_id), - uint16_from_be (statbuf->xa.group_id), - statbuf->xa.filenum, - (long unsigned int) statbuf->lsn); - - if (uint16_from_be(statbuf->xa.attributes) & XA_ATTR_MODE2FORM2) { - printf ("%9u (%9u)", - (unsigned int) statbuf->secsize * M2F2_SECTOR_SIZE, - (unsigned int) statbuf->size); - } else { - printf ("%9u", (unsigned int) statbuf->size); + if (opts.print_iso9660) { + if (iso9660_ifs_is_xa(p_iso)) { + printf ( " %c %s %d %d [fn %.2d] [LSN %6lu] ", + (statbuf->type == _STAT_DIR) ? 'd' : '-', + iso9660_get_xa_attr_str (statbuf->xa.attributes), + uint16_from_be (statbuf->xa.user_id), + uint16_from_be (statbuf->xa.group_id), + statbuf->xa.filenum, + (long unsigned int) statbuf->lsn); + + if (uint16_from_be(statbuf->xa.attributes) & XA_ATTR_MODE2FORM2) { + printf ("%9u (%9u)", + (unsigned int) statbuf->secsize * M2F2_SECTOR_SIZE, + (unsigned int) statbuf->size); + } else { + printf ("%9u", (unsigned int) statbuf->size); + } } - } -#endif - strftime(date_str, DATESTR_SIZE, "%b %d %Y %H:%M ", &statbuf->tm); - printf (" %s %s\n", date_str, translated_name); + strftime(date_str, DATESTR_SIZE, "%b %d %Y %H:%M ", &statbuf->tm); + printf (" %s %s\n", date_str, translated_name); + } else + if ( strcmp (iso_name, ".") && strcmp (iso_name, "..")) + printf("%s%s\n", pathname, translated_name); } _cdio_list_free (entlist, true); - printf ("\n"); + if (opts.print_iso9660) { + printf ("\n"); + } /* Now recurse over the directories. */ @@ -249,11 +261,12 @@ init(void) gl_default_cdio_log_handler = cdio_log_set_handler (_log_handler); /* Default option values. */ - opts.silent = false; - opts.no_header = false; - opts.no_joliet = false; - opts.debug_level = 0; - opts.print_iso9660 = 0; + opts.silent = false; + opts.no_header = false; + opts.no_joliet = false; + opts.debug_level = 0; + opts.print_iso9660 = 0; + opts.print_iso9660_short = 0; } #define print_vd_info(title, fn) \ @@ -313,8 +326,12 @@ main(int argc, const char *argv[]) print_vd_info("Volume Set ", iso9660_ifs_get_volumeset_id); } - if (!opts.no_analysis) { + if (opts.print_iso9660 || opts.print_iso9660_short) { printf(STRONG "ISO-9660 Information\n" NORMAL); + if (opts.print_iso9660 && opts.print_iso9660_short) { + printf("Note: both -f and -l options given -- " + "-l (long listing) takes precidence\n"); + } print_iso9660_fs(p_iso); } diff --git a/test/cdda-mcn.right b/test/cdda-mcn.right index a53d4f2b..d6ab30ca 100644 --- a/test/cdda-mcn.right +++ b/test/cdda-mcn.right @@ -7,7 +7,7 @@ Disc mode is listed as: CD-DA CD-ROM Track List (1 - 1) #: MSF LSN Type Green? 1: 00:02:00 000000 audio false -170: 00:09:64 000589 leadout +170: 00:09:64 000589 leadout (1 MB) Media Catalog Number (MCN): 123456789ABCD __________________________________ CD Analysis Report diff --git a/test/cdda.right b/test/cdda.right index 17c31423..3250d440 100644 --- a/test/cdda.right +++ b/test/cdda.right @@ -7,7 +7,7 @@ Disc mode is listed as: CD-DA CD-ROM Track List (1 - 1) #: MSF LSN Type Green? 1: 00:02:00 000000 audio false -170: 00:06:02 000302 leadout +170: 00:06:02 000302 leadout (693 KB) Media Catalog Number (MCN): 0000010271955 __________________________________ CD Analysis Report diff --git a/test/check_opts2.right b/test/check_opts2.right index deed4039..fbb488d5 100644 --- a/test/check_opts2.right +++ b/test/check_opts2.right @@ -7,5 +7,5 @@ Disc mode is listed as: CD-DATA (Mode 1) CD-ROM Track List (1 - 1) #: MSF LSN Type Green? 1: 00:02:00 000000 data false -170: 00:06:02 000302 leadout +170: 00:06:02 000302 leadout (693 KB) Media Catalog Number (MCN): not available diff --git a/test/check_opts3.right b/test/check_opts3.right index deed4039..fbb488d5 100644 --- a/test/check_opts3.right +++ b/test/check_opts3.right @@ -7,5 +7,5 @@ Disc mode is listed as: CD-DATA (Mode 1) CD-ROM Track List (1 - 1) #: MSF LSN Type Green? 1: 00:02:00 000000 data false -170: 00:06:02 000302 leadout +170: 00:06:02 000302 leadout (693 KB) Media Catalog Number (MCN): not available diff --git a/test/check_opts4.right b/test/check_opts4.right index 29b507a9..22ed3f98 100644 --- a/test/check_opts4.right +++ b/test/check_opts4.right @@ -7,7 +7,7 @@ Disc mode is listed as: CD-DATA (Mode 1) CD-ROM Track List (1 - 1) #: MSF LSN Type Green? 1: 00:02:00 000000 data false -170: 00:06:02 000302 leadout +170: 00:06:02 000302 leadout (693 KB) Media Catalog Number (MCN): not available __________________________________ CD Analysis Report diff --git a/test/check_opts5.right b/test/check_opts5.right index 29b507a9..22ed3f98 100644 --- a/test/check_opts5.right +++ b/test/check_opts5.right @@ -7,7 +7,7 @@ Disc mode is listed as: CD-DATA (Mode 1) CD-ROM Track List (1 - 1) #: MSF LSN Type Green? 1: 00:02:00 000000 data false -170: 00:06:02 000302 leadout +170: 00:06:02 000302 leadout (693 KB) Media Catalog Number (MCN): not available __________________________________ CD Analysis Report diff --git a/test/check_opts6.right b/test/check_opts6.right index 29b507a9..22ed3f98 100644 --- a/test/check_opts6.right +++ b/test/check_opts6.right @@ -7,7 +7,7 @@ Disc mode is listed as: CD-DATA (Mode 1) CD-ROM Track List (1 - 1) #: MSF LSN Type Green? 1: 00:02:00 000000 data false -170: 00:06:02 000302 leadout +170: 00:06:02 000302 leadout (693 KB) Media Catalog Number (MCN): not available __________________________________ CD Analysis Report diff --git a/test/check_opts7.right b/test/check_opts7.right index 29b507a9..22ed3f98 100644 --- a/test/check_opts7.right +++ b/test/check_opts7.right @@ -7,7 +7,7 @@ Disc mode is listed as: CD-DATA (Mode 1) CD-ROM Track List (1 - 1) #: MSF LSN Type Green? 1: 00:02:00 000000 data false -170: 00:06:02 000302 leadout +170: 00:06:02 000302 leadout (693 KB) Media Catalog Number (MCN): not available __________________________________ CD Analysis Report diff --git a/test/isofs-m1.right b/test/isofs-m1.right index 86c78cb3..d8fca194 100644 --- a/test/isofs-m1.right +++ b/test/isofs-m1.right @@ -6,7 +6,7 @@ __________________________________ CD-ROM Track List (1 - 1) #: MSF LSN Type Green? 1: 00:02:00 000000 data false -170: 00:06:02 000302 leadout +170: 00:06:02 000302 leadout (693 KB) Media Catalog Number (MCN): not available __________________________________ CD Analysis Report diff --git a/test/monvoisin.right b/test/monvoisin.right index f741a9ce..810175c8 100644 --- a/test/monvoisin.right +++ b/test/monvoisin.right @@ -8,7 +8,7 @@ CD-ROM Track List (1 - 2) #: MSF LSN Type Green? 1: 00:02:00 000000 XA true 2: 00:18:51 001251 XA true -170: 00:39:71 002846 leadout +170: 00:39:71 002846 leadout (6 MB) Media Catalog Number (MCN): not available __________________________________ CD Analysis Report diff --git a/test/svcd_ogt_test_ntsc.right b/test/svcd_ogt_test_ntsc.right index a015a4e7..9a347167 100644 --- a/test/svcd_ogt_test_ntsc.right +++ b/test/svcd_ogt_test_ntsc.right @@ -7,7 +7,7 @@ CD-ROM Track List (1 - 2) #: MSF LSN Type Green? 1: 00:02:00 000000 XA true 2: 00:09:01 000526 XA true -170: 00:56:56 004106 leadout +170: 00:56:56 004106 leadout (9 MB) Media Catalog Number (MCN): not available __________________________________ CD Analysis Report diff --git a/test/svcdgs.right b/test/svcdgs.right index 591de2fc..a90f15db 100644 --- a/test/svcdgs.right +++ b/test/svcdgs.right @@ -8,7 +8,7 @@ CD-ROM Track List (1 - 2) #: MSF LSN Type Green? 1: 00:02:00 000000 XA true 2: 00:22:53 001553 XA true -170: 01:17:62 005687 leadout +170: 01:17:62 005687 leadout (12 MB) Media Catalog Number (MCN): __________________________________ CD Analysis Report diff --git a/test/vcd_demo_vcdinfo.right b/test/vcd_demo_vcdinfo.right index 2b03f448..ddb1d7b3 100644 --- a/test/vcd_demo_vcdinfo.right +++ b/test/vcd_demo_vcdinfo.right @@ -8,7 +8,7 @@ CD-ROM Track List (1 - 3) 1: 00:02:00 000000 XA true 2: 00:17:57 001182 XA true 3: 00:24:71 001721 XA true -170: 00:30:10 002110 leadout +170: 00:30:10 002110 leadout (4 MB) Media Catalog Number (MCN): not available __________________________________ CD Analysis Report diff --git a/test/videocd.right b/test/videocd.right index 24d7077d..fd1fa4da 100644 --- a/test/videocd.right +++ b/test/videocd.right @@ -11,7 +11,7 @@ CD-ROM Track List (1 - 5) 3: 00:16:01 001051 XA true 4: 00:19:01 001276 XA true 5: 00:22:01 001501 XA true -170: 00:25:01 001726 leadout +170: 00:25:01 001726 leadout (3 MB) Media Catalog Number (MCN): not available __________________________________ CD Analysis Report