diff --git a/lib/udf/udf_file.c b/lib/udf/udf_file.c index 3949abe4..325aa123 100644 --- a/lib/udf/udf_file.c +++ b/lib/udf/udf_file.c @@ -1,5 +1,5 @@ /* - $Id: udf_file.c,v 1.5 2005/11/02 03:49:15 rocky Exp $ + $Id: udf_file.c,v 1.6 2006/01/26 04:41:50 rocky Exp $ Copyright (C) 2005 Rocky Bernstein @@ -30,7 +30,7 @@ const char * udf_get_filename(const udf_dirent_t *p_udf_dirent) { if (!p_udf_dirent) return NULL; - if (!p_udf_dirent->psz_name) return "."; + if (!p_udf_dirent->psz_name) return ".."; return p_udf_dirent->psz_name; } @@ -90,3 +90,18 @@ udf_is_dir(const udf_dirent_t *p_udf_dirent) { return p_udf_dirent->b_dir; } + +/*! + Attempts to read up to count bytes from file descriptor fd into + the buffer starting at buf. + + If count is zero, read() returns zero and has no other results. If + count is greater than SSIZE_MAX, the result is unspecified. +*/ +driver_return_code_t +udf_read_block(const udf_dirent_t *p_udf_dirent, void * buf, size_t count) +{ + const udf_t *p_udf = p_udf_dirent->p_udf; + return udf_read_sectors(p_udf, buf, + p_udf->i_part_start+p_udf_dirent->dir_lba, count); +} diff --git a/lib/udf/udf_fs.c b/lib/udf/udf_fs.c index 2e675770..926b8a22 100644 --- a/lib/udf/udf_fs.c +++ b/lib/udf/udf_fs.c @@ -1,5 +1,5 @@ /* - $Id: udf_fs.c,v 1.13 2005/11/02 03:42:50 rocky Exp $ + $Id: udf_fs.c,v 1.14 2006/01/26 04:41:50 rocky Exp $ Copyright (C) 2005 Rocky Bernstein @@ -143,7 +143,7 @@ udf_checktag(udf_tag_t *p_tag, udf_Uint16_t tag_id) return -1; } -static bool +bool udf_get_lba(const udf_file_entry_t *p_udf_fe, /*out*/ uint32_t *start, /*out*/ uint32_t *end) { diff --git a/lib/udf/udf_private.h b/lib/udf/udf_private.h index ed9c1994..1621a39e 100644 --- a/lib/udf/udf_private.h +++ b/lib/udf/udf_private.h @@ -1,5 +1,5 @@ /* - $Id: udf_private.h,v 1.5 2006/01/23 20:31:11 rocky Exp $ + $Id: udf_private.h,v 1.6 2006/01/26 04:41:50 rocky Exp $ Copyright (C) 2005, 2006 Rocky Bernstein @@ -21,6 +21,10 @@ #ifndef __CDIO_UDF_PRIVATE_H__ #define __CDIO_UDF_PRIVATE_H__ +#if defined(HAVE_CONFIG_H) && !defined(LIBCDIO_CONFIG_H) +#include "config.h" +#endif + #include #include #include