Opaque type declaration for iso9660 moved into well iso9660.h (from

cdio/types.h). Opaque type for iso_directory_record defined and access
routines added to libiso9660.
This commit is contained in:
rocky
2003-08-31 01:01:39 +00:00
parent 6f48300307
commit 7a0fb58e38
4 changed files with 66 additions and 37 deletions

View File

@@ -15,7 +15,7 @@ dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
dnl 02111-1307, USA. dnl 02111-1307, USA.
AC_REVISION([$Id: configure.ac,v 1.33 2003/08/17 05:31:19 rocky Exp $])dnl AC_REVISION([$Id: configure.ac,v 1.34 2003/08/31 01:01:39 rocky Exp $])dnl
AC_INIT(lib/cdio.c) AC_INIT(lib/cdio.c)
AM_CONFIG_HEADER(config.h) AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(libcdio, 0.63) AM_INIT_AUTOMAKE(libcdio, 0.63)
@@ -88,12 +88,12 @@ AC_STDC_HEADERS
AC_CHECK_HEADERS(stdint.h inttypes.h stdbool.h) AC_CHECK_HEADERS(stdint.h inttypes.h stdbool.h)
AC_CHECK_HEADER(cddb/cddb.h, , AC_CHECK_HEADER(cddb/cddb.h, ,
[ AC_MSG_RESULT([*** CDDB support disabled from cdinfo program]) [ AC_MSG_RESULT([*** CDDB support disabled from cd-info program])
enable_cddb=no ], enable_cddb=no ],
) )
AC_CHECK_HEADER(libvcd/info.h, , AC_CHECK_HEADER(libvcd/info.h, ,
[ AC_MSG_RESULT([*** Video CD info disabled from cdinfo program]) [ AC_MSG_RESULT([*** Video CD info disabled from cd-info program])
enable_vcdinfo=no ], enable_vcdinfo=no ],
) )

View File

@@ -1,5 +1,5 @@
/* /*
$Id: iso9660.h,v 1.1 2003/08/17 05:31:19 rocky Exp $ $Id: iso9660.h,v 1.2 2003/08/31 01:01:40 rocky Exp $
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org> Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2003 Rocky Bernstein <rocky@panix.com> Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
@@ -52,6 +52,12 @@ enum strncpy_pad_check {
ISO9660_DCHARS ISO9660_DCHARS
}; };
/* Opaque types ... */
/* Defined fully in iso9660_private.h */
typedef struct iso_primary_descriptor pvd_t;
typedef struct iso_directory_record iso_directory_record_t;
char * char *
iso9660_strncpy_pad(char dst[], const char src[], size_t len, iso9660_strncpy_pad(char dst[], const char src[], size_t len,
enum strncpy_pad_check _check); enum strncpy_pad_check _check);
@@ -120,23 +126,32 @@ uint16_t
iso9660_pathtable_m_add_entry (void *pt, const char name[], uint32_t extent, iso9660_pathtable_m_add_entry (void *pt, const char name[], uint32_t extent,
uint16_t parent); uint16_t parent);
lsn_t uint8_t
iso9660_get_root_lsn(struct iso_primary_descriptor const *pvd); iso9660_get_dir_len(const iso_directory_record_t *idr);
uint8_t uint8_t
iso9660_get_pvd_type(struct iso_primary_descriptor const *pvd); iso9660_get_dir_size(const iso_directory_record_t *idr);
uint8_t
iso9660_get_dir_extent(const iso_directory_record_t *idr);
uint8_t
iso9660_get_pvd_type(const pvd_t *pvd);
const char * const char *
iso9660_get_pvd_id(struct iso_primary_descriptor const *pvd); iso9660_get_pvd_id(const pvd_t *pvd);
int int
iso9660_get_pvd_space_size(struct iso_primary_descriptor const *pvd); iso9660_get_pvd_space_size(const pvd_t *pvd);
int int
iso9660_get_pvd_block_size(struct iso_primary_descriptor const *pvd) ; iso9660_get_pvd_block_size(const pvd_t *pvd) ;
int int
iso9660_get_pvd_version(struct iso_primary_descriptor const *pvd) ; iso9660_get_pvd_version(const pvd_t *pvd) ;
lsn_t
iso9660_get_root_lsn(const pvd_t *pvd);
#endif /* __CDIO_ISO9660_H__ */ #endif /* __CDIO_ISO9660_H__ */

View File

@@ -1,5 +1,5 @@
/* /*
$Id: types.h,v 1.4 2003/08/17 05:31:19 rocky Exp $ $Id: types.h,v 1.5 2003/08/31 01:01:40 rocky Exp $
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org> Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2002,2003 Rocky Bernstein <rocky@panix.com> Copyright (C) 2002,2003 Rocky Bernstein <rocky@panix.com>
@@ -218,13 +218,6 @@ extern "C" {
*/ */
#define CDIO_INVALID_LSN 0xFFFFFFFF #define CDIO_INVALID_LSN 0xFFFFFFFF
/* Opaque types ... */
/* Defined fully in iso9660_private.h */
typedef struct iso_primary_descriptor pvd_t;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */

View File

@@ -1,5 +1,5 @@
/* /*
$Id: iso9660.c,v 1.1 2003/08/17 05:31:19 rocky Exp $ $Id: iso9660.c,v 1.2 2003/08/31 01:01:40 rocky Exp $
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org> Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2003 Rocky Bernstein <rocky@panix.com> Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
@@ -37,7 +37,7 @@
#include "cdio_assert.h" #include "cdio_assert.h"
#include "bytesex.h" #include "bytesex.h"
static const char _rcsid[] = "$Id: iso9660.c,v 1.1 2003/08/17 05:31:19 rocky Exp $"; static const char _rcsid[] = "$Id: iso9660.c,v 1.2 2003/08/31 01:01:40 rocky Exp $";
/* some parameters... */ /* some parameters... */
#define SYSTEM_ID "CD-RTOS CD-BRIDGE" #define SYSTEM_ID "CD-RTOS CD-BRIDGE"
@@ -202,9 +202,9 @@ iso9660_set_pvd(void *pd,
uint32_t path_table_m_extent, uint32_t path_table_m_extent,
uint32_t path_table_size) uint32_t path_table_size)
{ {
struct iso_primary_descriptor ipd; pvd_t ipd;
cdio_assert (sizeof(struct iso_primary_descriptor) == ISO_BLOCKSIZE); cdio_assert (sizeof(pvd_t) == ISO_BLOCKSIZE);
cdio_assert (pd != NULL); cdio_assert (pd != NULL);
cdio_assert (volume_id != NULL); cdio_assert (volume_id != NULL);
@@ -646,53 +646,74 @@ iso9660_pathname_isofy (const char pathname[], uint16_t version)
return strdup (tmpbuf); return strdup (tmpbuf);
} }
lsn_t uint8_t
iso9660_get_root_lsn(struct iso_primary_descriptor const *pvd) iso9660_get_dir_extent(const iso_directory_record_t *idr)
{ {
if (NULL == pvd) if (NULL == idr) return 0;
return CDIO_INVALID_LSN; return from_733(idr->extent);
else {
struct iso_directory_record *idr = (void *) pvd->root_directory_record;
if (NULL == idr) return CDIO_INVALID_LSN;
return(from_733 (idr->extent));
}
} }
uint8_t uint8_t
iso9660_get_pvd_type(struct iso_primary_descriptor const *pvd) iso9660_get_dir_len(const iso_directory_record_t *idr)
{
if (NULL == idr) return 0;
return idr->length;
}
uint8_t
iso9660_get_dir_size(const iso_directory_record_t *idr)
{
if (NULL == idr) return 0;
return from_733(idr->size);
}
uint8_t
iso9660_get_pvd_type(const pvd_t *pvd)
{ {
if (NULL == pvd) return 255; if (NULL == pvd) return 255;
return(pvd->type); return(pvd->type);
} }
const char * const char *
iso9660_get_pvd_id(struct iso_primary_descriptor const *pvd) iso9660_get_pvd_id(const pvd_t *pvd)
{ {
if (NULL == pvd) return "ERR"; if (NULL == pvd) return "ERR";
return(pvd->id); return(pvd->id);
} }
int int
iso9660_get_pvd_space_size(struct iso_primary_descriptor const *pvd) iso9660_get_pvd_space_size(const pvd_t *pvd)
{ {
if (NULL == pvd) return 0; if (NULL == pvd) return 0;
return from_733(pvd->volume_space_size); return from_733(pvd->volume_space_size);
} }
int int
iso9660_get_pvd_block_size(struct iso_primary_descriptor const *pvd) iso9660_get_pvd_block_size(const pvd_t *pvd)
{ {
if (NULL == pvd) return 0; if (NULL == pvd) return 0;
return from_723(pvd->logical_block_size); return from_723(pvd->logical_block_size);
} }
int int
iso9660_get_pvd_version(struct iso_primary_descriptor const *pvd) iso9660_get_pvd_version(const pvd_t *pvd)
{ {
if (NULL == pvd) return 0; if (NULL == pvd) return 0;
return pvd->version; return pvd->version;
} }
lsn_t
iso9660_get_root_lsn(const pvd_t *pvd)
{
if (NULL == pvd)
return CDIO_INVALID_LSN;
else {
iso_directory_record_t *idr = (void *) pvd->root_directory_record;
if (NULL == idr) return CDIO_INVALID_LSN;
return(from_733 (idr->extent));
}
}
/* /*
* Local variables: * Local variables: