All structure tags now end in _s and we have typedefs for all of them

(ending in _t).
iso9660.h: abc -> a.b.c for ISO fields.
This commit is contained in:
rocky
2005-02-12 10:23:18 +00:00
parent 1c74eb78fd
commit 521fb446a9
5 changed files with 91 additions and 91 deletions

View File

@@ -1,5 +1,5 @@
/* /*
$Id: iso9660.h,v 1.60 2005/02/05 12:37:35 rocky Exp $ $Id: iso9660.h,v 1.61 2005/02/12 10:23:18 rocky Exp $
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org> Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com> Copyright (C) 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com>
@@ -188,7 +188,7 @@ PRAGMA_BEGIN_PACKED
@see iso9660_dtime @see iso9660_dtime
*/ */
struct iso9660_dtime { struct iso9660_dtime_s {
uint8_t dt_year; uint8_t dt_year;
uint8_t dt_month; /**< Has value in range 1..12. Note starts uint8_t dt_month; /**< Has value in range 1..12. Note starts
at 1, not 0 like a tm struct. */ at 1, not 0 like a tm struct. */
@@ -200,14 +200,14 @@ struct iso9660_dtime {
intervals */ intervals */
} GNUC_PACKED; } GNUC_PACKED;
typedef struct iso9660_dtime iso9660_dtime_t; typedef struct iso9660_dtime_s iso9660_dtime_t;
/*! /*!
\brief ISO-9660 longer-format time structure. \brief ISO-9660 longer-format time structure.
@see iso9660_ltime @see iso9660_ltime
*/ */
struct iso9660_ltime { struct iso9660_ltime_s {
char lt_year [_delta( 1, 4)]; /**< Add 1900 to value char lt_year [_delta( 1, 4)]; /**< Add 1900 to value
for the Julian for the Julian
year */ year */
@@ -225,7 +225,7 @@ struct iso9660_ltime {
int8_t lt_gmtoff [_delta( 17, 17)]; int8_t lt_gmtoff [_delta( 17, 17)];
} GNUC_PACKED; } GNUC_PACKED;
typedef struct iso9660_ltime iso9660_ltime_t; typedef struct iso9660_ltime_s iso9660_ltime_t;
/*! \brief Format of an ISO-9660 directory record /*! \brief Format of an ISO-9660 directory record
@@ -239,43 +239,43 @@ typedef struct iso9660_ltime iso9660_ltime_t;
@see iso9660_stat @see iso9660_stat
*/ */
struct iso9660_dir { struct iso9660_dir_s {
uint8_t length; /*! 711 encoded */ uint8_t length; /*! 7.1.1 encoded */
uint8_t xa_length; /*! 711 encoded */ uint8_t xa_length; /*! 7.1.1 encoded */
uint64_t extent; /*! 733 encoded */ uint64_t extent; /*! 7.3.3 encoded */
uint64_t size; /*! 733 encoded */ uint64_t size; /*! 7.3.3 encoded */
iso9660_dtime_t recording_time; /*! 7 711-encoded units */ iso9660_dtime_t recording_time; /*! 7 7.1.1-encoded units */
uint8_t file_flags; uint8_t file_flags;
uint8_t file_unit_size; /*! 711 encoded */ uint8_t file_unit_size; /*! 7.1.1 encoded */
uint8_t interleave_gap; /*! 711 encoded */ uint8_t interleave_gap; /*! 7.1.1 encoded */
uint32_t volume_sequence_number; /*! 723 encoded */ uint32_t volume_sequence_number; /*! 7.2.3 encoded */
uint8_t filename_len; /*! 711 encoded */ uint8_t filename_len; /*! 7.1.1 encoded */
char filename[EMPTY_ARRAY_SIZE]; char filename[EMPTY_ARRAY_SIZE];
} GNUC_PACKED; } GNUC_PACKED;
typedef struct iso9660_dir iso9660_dir_t; typedef struct iso9660_dir_s iso9660_dir_t;
/*! /*!
\brief ISO-9660 Primary Volume Descriptor. \brief ISO-9660 Primary Volume Descriptor.
*/ */
struct iso9660_pvd { struct iso9660_pvd_s {
uint8_t type; /**< 711 encoded */ uint8_t type; /**< 7.1.1 encoded */
char id[5]; char id[5];
uint8_t version; /**< 711 encoded */ uint8_t version; /**< 7.1.1 encoded */
char unused1[1]; char unused1[1];
char system_id[ISO_MAX_SYSTEM_ID]; /**< each char is an achar */ char system_id[ISO_MAX_SYSTEM_ID]; /**< each char is an achar */
char volume_id[ISO_MAX_VOLUME_ID]; /**< each char is a dchar */ char volume_id[ISO_MAX_VOLUME_ID]; /**< each char is a dchar */
char unused2[8]; char unused2[8];
uint64_t volume_space_size; /**< 733 encoded */ uint64_t volume_space_size; /**< 7.3.3 encoded */
char unused3[32]; char unused3[32];
uint32_t volume_set_size; /**< 723 encoded */ uint32_t volume_set_size; /**< 7.2.3 encoded */
uint32_t volume_sequence_number; /**< 723 encoded */ uint32_t volume_sequence_number; /**< 7.2.3 encoded */
uint32_t logical_block_size; /**< 723 encoded */ uint32_t logical_block_size; /**< 7.2.3 encoded */
uint64_t path_table_size; /**< 733 encoded */ uint64_t path_table_size; /**< 7.3.3 encoded */
uint32_t type_l_path_table; /**< 731 encoded */ uint32_t type_l_path_table; /**< 7.3.1 encoded */
uint32_t opt_type_l_path_table; /**< 731 encoded */ uint32_t opt_type_l_path_table; /**< 7.3.1 encoded */
uint32_t type_m_path_table; /**< 732 encoded */ uint32_t type_m_path_table; /**< 7.3.2 encoded */
uint32_t opt_type_m_path_table; /**< 732 encoded */ uint32_t opt_type_m_path_table; /**< 7.3.2 encoded */
iso9660_dir_t root_directory_record; /**< See section 9.1 of iso9660_dir_t root_directory_record; /**< See section 9.1 of
ISO 9660 spec. */ ISO 9660 spec. */
char root_directory_filename; /**< Is '\\0' */ char root_directory_filename; /**< Is '\\0' */
@@ -300,13 +300,13 @@ struct iso9660_pvd {
ISO 9660 spec. */ ISO 9660 spec. */
iso9660_ltime_t effective_date; /**< See section 8.4.26.1 of iso9660_ltime_t effective_date; /**< See section 8.4.26.1 of
ISO 9660 spec. */ ISO 9660 spec. */
uint8_t file_structure_version; /**< 711 encoded */ uint8_t file_structure_version; /**< 7.1.1 encoded */
char unused4[1]; char unused4[1];
char application_data[512]; char application_data[512];
char unused5[653]; char unused5[653];
} GNUC_PACKED; } GNUC_PACKED;
typedef struct iso9660_pvd iso9660_pvd_t; typedef struct iso9660_pvd_s iso9660_pvd_t;
/*! /*!
\brief ISO-9660 Supplementary Volume Descriptor. \brief ISO-9660 Supplementary Volume Descriptor.
@@ -315,24 +315,24 @@ typedef struct iso9660_pvd iso9660_pvd_t;
the primary descriptor but two unused fields, "unused1" and "unused3 the primary descriptor but two unused fields, "unused1" and "unused3
become "flags and "escape_sequences" respectively. become "flags and "escape_sequences" respectively.
*/ */
struct iso9660_svd { struct iso9660_svd_s {
uint8_t type; /**< 711 encoded */ uint8_t type; /**< 7.1.1 encoded */
char id[5]; char id[5];
uint8_t version; /**< 711 encoded */ uint8_t version; /**< 7.1.1 encoded */
char flags; /**< 853 */ char flags; /**< 8.5.3 */
char system_id[ISO_MAX_SYSTEM_ID]; /**< each char is an achar */ char system_id[ISO_MAX_SYSTEM_ID]; /**< each char is an achar */
char volume_id[ISO_MAX_VOLUME_ID]; /**< each char is a dchar */ char volume_id[ISO_MAX_VOLUME_ID]; /**< each char is a dchar */
char unused2[8]; char unused2[8];
uint64_t volume_space_size; /**< 733 encoded */ uint64_t volume_space_size; /**< 7.3.3 encoded */
char escape_sequences[32]; /**< 856 */ char escape_sequences[32]; /**< 8.5.6 */
uint32_t volume_set_size; /**< 723 encoded */ uint32_t volume_set_size; /**< 7.2.3 encoded */
uint32_t volume_sequence_number; /**< 723 encoded */ uint32_t volume_sequence_number; /**< 7.2.3 encoded */
uint32_t logical_block_size; /**< 723 encoded */ uint32_t logical_block_size; /**< 7.2.3 encoded */
uint64_t path_table_size; /**< 733 encoded */ uint64_t path_table_size; /**< 7.3.3 encoded */
uint32_t type_l_path_table; /**< 731 encoded */ uint32_t type_l_path_table; /**< 7.3.1 encoded */
uint32_t opt_type_l_path_table; /**< 731 encoded */ uint32_t opt_type_l_path_table; /**< 7.3.1 encoded */
uint32_t type_m_path_table; /**< 732 encoded */ uint32_t type_m_path_table; /**< 7.3.2 encoded */
uint32_t opt_type_m_path_table; /**< 732 encoded */ uint32_t opt_type_m_path_table; /**< 7.3.2 encoded */
iso9660_dir_t root_directory_record; /**< See section 9.1 of iso9660_dir_t root_directory_record; /**< See section 9.1 of
ISO 9660 spec. */ ISO 9660 spec. */
char volume_set_id[ISO_MAX_VOLUMESET_ID]; /**< dchars */ char volume_set_id[ISO_MAX_VOLUMESET_ID]; /**< dchars */
@@ -356,13 +356,13 @@ struct iso9660_svd {
ISO 9660 spec. */ ISO 9660 spec. */
iso9660_ltime_t effective_date; /**< See section 8.4.26.1 of iso9660_ltime_t effective_date; /**< See section 8.4.26.1 of
ISO 9660 spec. */ ISO 9660 spec. */
uint8_t file_structure_version; /**< 711 encoded */ uint8_t file_structure_version; /**< 7.1.1 encoded */
char unused4[1]; char unused4[1];
char application_data[512]; char application_data[512];
char unused5[653]; char unused5[653];
} GNUC_PACKED; } GNUC_PACKED;
typedef struct iso9660_svd iso9660_svd_t; typedef struct iso9660_svd_s iso9660_svd_t;
PRAGMA_END_PACKED PRAGMA_END_PACKED
@@ -375,7 +375,7 @@ PRAGMA_END_PACKED
@see iso9660_dir @see iso9660_dir
*/ */
struct iso9660_stat { /* big endian!! */ struct iso9660_stat_s { /* big endian!! */
struct tm tm; /**< time on entry */ struct tm tm; /**< time on entry */
lsn_t lsn; /**< start logical sector number */ lsn_t lsn; /**< start logical sector number */
uint32_t size; /**< total size in bytes */ uint32_t size; /**< total size in bytes */
@@ -385,7 +385,7 @@ struct iso9660_stat { /* big endian!! */
char filename[EMPTY_ARRAY_SIZE]; /**< filename */ char filename[EMPTY_ARRAY_SIZE]; /**< filename */
}; };
typedef struct iso9660_stat iso9660_stat_t; typedef struct iso9660_stat_s iso9660_stat_t;
/** A mask used in iso9660_ifs_read_vd which allows what kinds /** A mask used in iso9660_ifs_read_vd which allows what kinds
@@ -407,7 +407,7 @@ typedef uint8_t iso_extension_mask_t;
/** This is an opaque structure. */ /** This is an opaque structure. */
typedef struct _iso9660 iso9660_t; typedef struct _iso9660_s iso9660_t;
/*! /*!
Open an ISO 9660 image for reading. Maybe in the future we will have Open an ISO 9660 image for reading. Maybe in the future we will have

View File

@@ -1,5 +1,5 @@
/* /*
$Id: iso9660.c,v 1.2 2005/02/05 12:37:35 rocky Exp $ $Id: iso9660.c,v 1.3 2005/02/12 10:23:18 rocky Exp $
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org> Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com> Copyright (C) 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com>
@@ -37,7 +37,7 @@
#include <stdio.h> #include <stdio.h>
#endif #endif
static const char _rcsid[] = "$Id: iso9660.c,v 1.2 2005/02/05 12:37:35 rocky Exp $"; static const char _rcsid[] = "$Id: iso9660.c,v 1.3 2005/02/12 10:23:18 rocky Exp $";
/* Variables to hold debugger-helping enumerations */ /* Variables to hold debugger-helping enumerations */
enum iso_enums1 iso_enums1; enum iso_enums1 iso_enums1;
@@ -353,9 +353,9 @@ iso9660_isachar (int c)
void void
iso9660_set_evd(void *pd) iso9660_set_evd(void *pd)
{ {
struct iso_volume_descriptor ied; iso_volume_descriptor_t ied;
cdio_assert (sizeof(struct iso_volume_descriptor) == ISO_BLOCKSIZE); cdio_assert (sizeof(iso_volume_descriptor_t) == ISO_BLOCKSIZE);
cdio_assert (pd != NULL); cdio_assert (pd != NULL);
@@ -583,14 +583,14 @@ iso9660_dir_init_new_su (void *dir,
void void
iso9660_pathtable_init (void *pt) iso9660_pathtable_init (void *pt)
{ {
cdio_assert (sizeof (struct iso_path_table) == 8); cdio_assert (sizeof (iso_path_table_t) == 8);
cdio_assert (pt != NULL); cdio_assert (pt != NULL);
memset (pt, 0, ISO_BLOCKSIZE); /* fixme */ memset (pt, 0, ISO_BLOCKSIZE); /* fixme */
} }
static const struct iso_path_table* static const iso_path_table_t *
pathtable_get_entry (const void *pt, unsigned int entrynum) pathtable_get_entry (const void *pt, unsigned int entrynum)
{ {
const uint8_t *tmp = pt; const uint8_t *tmp = pt;
@@ -606,7 +606,7 @@ pathtable_get_entry (const void *pt, unsigned int entrynum)
cdio_assert (count < entrynum); cdio_assert (count < entrynum);
offset += sizeof (struct iso_path_table); offset += sizeof (iso_path_table_t);
offset += from_711 (*tmp); offset += from_711 (*tmp);
if (offset % 2) if (offset % 2)
offset++; offset++;
@@ -633,7 +633,7 @@ pathtable_get_size_and_entries (const void *pt,
while (from_711 (*tmp)) while (from_711 (*tmp))
{ {
offset += sizeof (struct iso_path_table); offset += sizeof (iso_path_table_t);
offset += from_711 (*tmp); offset += from_711 (*tmp);
if (offset % 2) if (offset % 2)
offset++; offset++;
@@ -662,14 +662,14 @@ iso9660_pathtable_l_add_entry (void *pt,
uint32_t extent, uint32_t extent,
uint16_t parent) uint16_t parent)
{ {
struct iso_path_table *ipt = iso_path_table_t *ipt =
(struct iso_path_table*)((char *)pt + iso9660_pathtable_get_size (pt)); (iso_path_table_t *)((char *)pt + iso9660_pathtable_get_size (pt));
size_t name_len = strlen (name) ? strlen (name) : 1; size_t name_len = strlen (name) ? strlen (name) : 1;
unsigned int entrynum = 0; unsigned int entrynum = 0;
cdio_assert (iso9660_pathtable_get_size (pt) < ISO_BLOCKSIZE); /*fixme */ cdio_assert (iso9660_pathtable_get_size (pt) < ISO_BLOCKSIZE); /*fixme */
memset (ipt, 0, sizeof (struct iso_path_table) + name_len); /* paranoia */ memset (ipt, 0, sizeof (iso_path_table_t) + name_len); /* paranoia */
ipt->name_len = to_711 (name_len); ipt->name_len = to_711 (name_len);
ipt->extent = to_731 (extent); ipt->extent = to_731 (extent);
@@ -680,7 +680,7 @@ iso9660_pathtable_l_add_entry (void *pt,
if (entrynum > 1) if (entrynum > 1)
{ {
const struct iso_path_table *ipt2 const iso_path_table_t *ipt2
= pathtable_get_entry (pt, entrynum - 2); = pathtable_get_entry (pt, entrynum - 2);
cdio_assert (ipt2 != NULL); cdio_assert (ipt2 != NULL);
@@ -697,14 +697,14 @@ iso9660_pathtable_m_add_entry (void *pt,
uint32_t extent, uint32_t extent,
uint16_t parent) uint16_t parent)
{ {
struct iso_path_table *ipt = iso_path_table_t *ipt =
(struct iso_path_table*)((char *)pt + iso9660_pathtable_get_size (pt)); (iso_path_table_t *)((char *)pt + iso9660_pathtable_get_size (pt));
size_t name_len = strlen (name) ? strlen (name) : 1; size_t name_len = strlen (name) ? strlen (name) : 1;
unsigned int entrynum = 0; unsigned int entrynum = 0;
cdio_assert (iso9660_pathtable_get_size(pt) < ISO_BLOCKSIZE); /* fixme */ cdio_assert (iso9660_pathtable_get_size(pt) < ISO_BLOCKSIZE); /* fixme */
memset(ipt, 0, sizeof (struct iso_path_table) + name_len); /* paranoia */ memset(ipt, 0, sizeof (iso_path_table_t) + name_len); /* paranoia */
ipt->name_len = to_711 (name_len); ipt->name_len = to_711 (name_len);
ipt->extent = to_732 (extent); ipt->extent = to_732 (extent);
@@ -715,7 +715,7 @@ iso9660_pathtable_m_add_entry (void *pt,
if (entrynum > 1) if (entrynum > 1)
{ {
const struct iso_path_table *ipt2 const iso_path_table_t *ipt2
= pathtable_get_entry (pt, entrynum - 2); = pathtable_get_entry (pt, entrynum - 2);
cdio_assert (ipt2 != NULL); cdio_assert (ipt2 != NULL);

View File

@@ -1,5 +1,5 @@
/* /*
$Id: iso9660_fs.c,v 1.11 2005/02/10 01:59:06 rocky Exp $ $Id: iso9660_fs.c,v 1.12 2005/02/12 10:23:18 rocky Exp $
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org> Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com> Copyright (C) 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com>
@@ -51,10 +51,10 @@
#include <stdio.h> #include <stdio.h>
static const char _rcsid[] = "$Id: iso9660_fs.c,v 1.11 2005/02/10 01:59:06 rocky Exp $"; static const char _rcsid[] = "$Id: iso9660_fs.c,v 1.12 2005/02/12 10:23:18 rocky Exp $";
/* Implementation of iso9660_t type */ /* Implementation of iso9660_t type */
struct _iso9660 { struct _iso9660_s {
CdioDataSource_t *stream; /* Stream pointer */ CdioDataSource_t *stream; /* Stream pointer */
bool_3way_t b_xa; /* true if has XA attributes. If true bool_3way_t b_xa; /* true if has XA attributes. If true
b_mode2 should be set true as well. b_mode2 should be set true as well.
@@ -168,7 +168,7 @@ iso9660_open_ext_private (const char *pathname,
iso_extension_mask_t iso_extension_mask, iso_extension_mask_t iso_extension_mask,
uint16_t i_fuzz, bool b_fuzzy) uint16_t i_fuzz, bool b_fuzzy)
{ {
iso9660_t *p_iso = (iso9660_t *) calloc(1, sizeof(struct _iso9660)) ; iso9660_t *p_iso = (iso9660_t *) calloc(1, sizeof(iso9660_t)) ;
bool b_have_superblock; bool b_have_superblock;
if (!p_iso) return NULL; if (!p_iso) return NULL;

View File

@@ -1,8 +1,8 @@
/* /*
$Id: iso9660_private.h,v 1.2 2005/02/05 04:25:14 rocky Exp $ $Id: iso9660_private.h,v 1.3 2005/02/12 10:23:18 rocky Exp $
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org> Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com> Copyright (C) 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com>
See also iso9660.h by Eric Youngdale (1993). See also iso9660.h by Eric Youngdale (1993).
@@ -37,16 +37,16 @@
PRAGMA_BEGIN_PACKED PRAGMA_BEGIN_PACKED
struct iso_volume_descriptor { typedef struct iso_volume_descriptor_s {
uint8_t type; /* 711 */ uint8_t type; /**< 7.1.1 */
char id[5]; /* "CD001" (ISO_STANDARD_ID) */ char id[5]; /**< "CD001" (ISO_STANDARD_ID) */
uint8_t version; /* 711 */ uint8_t version; /**< 7.1.1 */
char data[2041]; char data[2041];
} GNUC_PACKED; } GNUC_PACKED iso_volume_descriptor_t;
#define struct_iso_volume_descriptor_SIZEOF ISO_BLOCKSIZE #define iso_volume_descriptor_t_SIZEOF ISO_BLOCKSIZE
#define struct_iso9660_pvd_SIZEOF ISO_BLOCKSIZE #define iso9660_pvd_t_SIZEOF ISO_BLOCKSIZE
/* /*
* XXX JS: The next structure has an odd length! * XXX JS: The next structure has an odd length!
@@ -59,17 +59,17 @@ struct iso_volume_descriptor {
/* We use this to help us look up the parent inode numbers. */ /* We use this to help us look up the parent inode numbers. */
struct iso_path_table { typedef struct iso_path_table_s {
uint8_t name_len; /* 711 */ uint8_t name_len; /* 7.1.1 */
uint8_t xa_len; /* 711 */ uint8_t xa_len; /* 7.1.1 */
uint32_t extent; /* 731/732 */ uint32_t extent; /* 7.3.1/7.3.2 */
uint16_t parent; /* 721/722 */ uint16_t parent; /* 7.2.1/7.2.2 */
char name[EMPTY_ARRAY_SIZE]; char name[EMPTY_ARRAY_SIZE];
} GNUC_PACKED; } GNUC_PACKED iso_path_table_t;
#define struct_iso_path_table_SIZEOF 8 #define iso_path_table_t_SIZEOF 8
#define struct_iso9660_dir_SIZEOF 33 #define iso9660_dir_t_SIZEOF 33
PRAGMA_END_PACKED PRAGMA_END_PACKED

View File

@@ -1,5 +1,5 @@
/* /*
$Id: check_sizeof.c,v 1.3 2003/08/31 08:42:11 rocky Exp $ $Id: check_sizeof.c,v 1.4 2005/02/12 10:23:18 rocky Exp $
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org> Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
@@ -60,10 +60,10 @@ int main (int argc, const char *argv[])
CHECK_SIZEOF(msf_t); CHECK_SIZEOF(msf_t);
/* "iso9660_private.h" */ /* "iso9660_private.h" */
CHECK_SIZEOF_STRUCT(iso_volume_descriptor); CHECK_SIZEOF(iso_volume_descriptor_t);
CHECK_SIZEOF_STRUCT(iso9660_pvd); CHECK_SIZEOF(iso9660_pvd_t);
CHECK_SIZEOF_STRUCT(iso_path_table); CHECK_SIZEOF(iso_path_table_t);
CHECK_SIZEOF_STRUCT(iso9660_dir); CHECK_SIZEOF(iso9660_dir_t);
#define iso9660_xa_t_SIZEOF 14 #define iso9660_xa_t_SIZEOF 14