diff --git a/doc/libcdio.texi b/doc/libcdio.texi index 15645c8a..abece34e 100644 --- a/doc/libcdio.texi +++ b/doc/libcdio.texi @@ -46,7 +46,7 @@ development.'' @titlepage @title GNU libcdio library -@subtitle $Id: libcdio.texi,v 1.50 2006/04/12 10:17:49 rocky Exp $ +@subtitle $Id: libcdio.texi,v 1.51 2006/04/16 02:34:08 rocky Exp $ @author Rocky Bernstein et al. @page @@ -1732,14 +1732,14 @@ is and what CD drives are available. A program eject a CD from a CD-ROM drive and then close the door again. -@item @code{iso1.c} +@item @code{isolist.c} A program to show using @code{libiso9660} to list files in a directory of an ISO-9660 image. -@item @code{C++/iso1.cpp} +@item @code{C++/isolist.cpp} -The same program as @code{iso1.c} written in C++. +The same program as @code{isolist.c} written in C++. @item @code{iso2.c} diff --git a/example/Makefile.am b/example/Makefile.am index 9b14d2bf..1cd2b08b 100644 --- a/example/Makefile.am +++ b/example/Makefile.am @@ -1,4 +1,4 @@ -# $Id: Makefile.am,v 1.35 2006/04/15 16:18:33 rocky Exp $ +# $Id: Makefile.am,v 1.36 2006/04/16 02:34:09 rocky Exp $ # # Copyright (C) 2003, 2004, 2005 Rocky Bernstein # @@ -29,7 +29,7 @@ endif noinst_PROGRAMS = audio cdchange cdtext device drives eject \ isofile isofile2 isofuzzy isolist \ mmc1 mmc2 mmc2a $(paranoia_progs) tracks \ - sample3 sample4 udf1 udf2 + sample3 sample4 udf1 udffile INCLUDES = -I$(top_srcdir) $(LIBCDIO_CFLAGS) @@ -81,8 +81,8 @@ tracks_LDADD = $(LIBCDIO_LIBS) udf1_DEPENDENCIES = $(LIBUDF_LIBS) $(LIBCDIO_DEPS) udf1_LDADD = $(LIBUDF_LIBS) $(LIBCDIO_LIBS) -udf2_DEPENDENCIES = $(LIBUDF_LIBS) $(LIBCDIO_DEPS) -udf2_LDADD = $(LIBUDF_LIBS) $(LIBCDIO_LIBS) +udffile_DEPENDENCIES = $(LIBUDF_LIBS) $(LIBCDIO_DEPS) +udffile_LDADD = $(LIBUDF_LIBS) $(LIBCDIO_LIBS) # iso programs create file "copying" diff --git a/include/cdio/ecma_167.h b/include/cdio/ecma_167.h index 07f16a0e..f73cc651 100644 --- a/include/cdio/ecma_167.h +++ b/include/cdio/ecma_167.h @@ -67,12 +67,6 @@ typedef enum { UDF_VOLSET_ID_SIZE = 128 } ecma_167_enum1_t ; -/** This variable is trickery to force the above enum symbol values to - be recorded in debug symbol tables. It is used to allow one refer - to above enumeration values in a debugger and debugger - expressions */ -extern ecma_167_enum1_t debug_ecma_167_enums1; - /** Tag Identifier (ECMA 167r3 3/7.2.1) */ typedef enum { @@ -161,12 +155,6 @@ typedef enum { TIMESTAMP_TIMEZONE_MASK = 0x0FFF, } ecma_167_timezone_enum_t ; -/** This variable is trickery to force the above enum symbol values to - be recorded in debug symbol tables. It is used to allow one refer - to above enumeration values in a debugger and debugger - expressions */ -extern ecma_167_timezone_enum_t debug_ecma_167_timezone_enum; - #define TIMESTAMP_TYPE_MASK 0xF000 #define TIMESTAMP_TYPE_CUT 0x0000 @@ -990,9 +978,15 @@ PRAGMA_END_PACKED allow one refer to the enumeration value names in the typedefs above in a debugger and in debugger expressions. */ -extern file_characteristics_t debug_file_characteristics; -extern tag_id_t debug_tagid; -extern icbtag_file_type_enum_t debug_icbtag_file_type_enum; -extern icbtag_flag_enum_t debug_flag_enum; - +typedef union +{ + tag_id_t debug_tagid; + file_characteristics_t debug_file_characteristics; + icbtag_file_type_enum_t debug_icbtag_file_type_enum; + icbtag_flag_enum_t debug_flag_enum; + ecma_167_enum1_t debug_ecma_167_enum1; + ecma_167_timezone_enum_t debug_ecma_167_timezone_enum; +} debug_ecma167_t; +extern debug_ecma167_t debug_ecma_167; + #endif /* _ECMA_167_H */ diff --git a/include/cdio/udf.h b/include/cdio/udf.h index 8507e7c5..2a369797 100644 --- a/include/cdio/udf.h +++ b/include/cdio/udf.h @@ -1,5 +1,5 @@ /* - $Id: udf.h,v 1.20 2006/01/14 09:44:53 rocky Exp $ + $Id: udf.h,v 1.21 2006/04/16 02:34:10 rocky Exp $ Copyright (C) 2005, 2006 Rocky Bernstein This program is free software; you can redistribute it and/or modify @@ -51,7 +51,7 @@ typedef enum { be recorded in debug symbol tables. It is used to allow one refer to above enumeration values in a debugger and debugger expressions */ -extern udf_enum1_t debug_udf_enums1; +extern udf_enum1_t debug_udf_enum1; #ifdef __cplusplus extern "C" { diff --git a/lib/udf/udf.c b/lib/udf/udf.c index f1b70f36..5b5341e0 100644 --- a/lib/udf/udf.c +++ b/lib/udf/udf.c @@ -1,5 +1,5 @@ /* - $Id: udf.c,v 1.9 2006/04/11 00:26:54 rocky Exp $ + $Id: udf.c,v 1.10 2006/04/16 02:34:10 rocky Exp $ Copyright (C) 2005 Rocky Bernstein @@ -35,13 +35,10 @@ to the enumeration value names in the typedefs above in a debugger and debugger expressions */ -tag_id_t debug_tagid; -file_characteristics_t debug_file_characteristics; +extern debug_ecma167_t debug_ecma_167; + udf_enum1_t debug_udf_enum1; -icbtag_file_type_enum_t debug_icbtag_file_type_enum; -icbtag_flag_enum_t debug_flag_enum; -ecma_167_enum1_t ecma167_enum1; -ecma_167_timezone_enum_t debug_ecma_167_timezone_enum; + /*! Returns POSIX mode bitstring for a given file. diff --git a/lib/udf/udf_file.c b/lib/udf/udf_file.c index a1ac66a3..47676aba 100644 --- a/lib/udf/udf_file.c +++ b/lib/udf/udf_file.c @@ -1,5 +1,5 @@ /* - $Id: udf_file.c,v 1.10 2006/04/15 03:05:14 rocky Exp $ + $Id: udf_file.c,v 1.11 2006/04/16 02:34:10 rocky Exp $ Copyright (C) 2005, 2006 Rocky Bernstein @@ -29,7 +29,7 @@ #include /* Remove when adding cdio/logging.h */ -#define MIN(a, b) (a>b) ? (a) : (b) +#define MIN(a, b) (ap_udf; - uint8_t data[UDF_BLOCKSIZE]; - const udf_file_entry_t *p_udf_fe = (udf_file_entry_t *) data; + const udf_file_entry_t *p_udf_fe = (udf_file_entry_t *) p_udf_dirent->data; driver_return_code_t ret; const unsigned long int i_file_length = udf_get_file_length(p_udf_dirent); - - ret = udf_read_sectors(p_udf, data, p_udf_dirent->fe.unique_ID, 1); - if (ret == DRIVER_OP_SUCCESS) { + + if (0 == p_udf->i_position) { + ret = udf_read_sectors(p_udf, p_udf_dirent->data, + p_udf_dirent->fe.unique_ID, 1); + if (ret != DRIVER_OP_SUCCESS) return DRIVER_OP_ERROR; + } + { if (!udf_checktag(&p_udf_fe->tag, TAGID_FILE_ENTRY)) { uint32_t i_lba_start, i_lba_end; udf_get_lba( p_udf_fe, &i_lba_start, &i_lba_end); @@ -140,9 +144,6 @@ udf_read_block(const udf_dirent_t *p_udf_dirent, void * buf, size_t count) return i_read_len; } } - - } else { - return DRIVER_OP_ERROR; } } return ret; diff --git a/lib/udf/udf_private.h b/lib/udf/udf_private.h index d665be63..088877b7 100644 --- a/lib/udf/udf_private.h +++ b/lib/udf/udf_private.h @@ -1,5 +1,5 @@ /* - $Id: udf_private.h,v 1.9 2006/04/15 03:05:14 rocky Exp $ + $Id: udf_private.h,v 1.10 2006/04/16 02:34:10 rocky Exp $ Copyright (C) 2005, 2006 Rocky Bernstein @@ -60,6 +60,7 @@ struct udf_dirent_s uint8_t *sector; udf_file_entry_t fe; udf_fileid_desc_t *fid; + uint8_t data[UDF_BLOCKSIZE]; }; bool udf_get_lba(const udf_file_entry_t *p_udf_fe,