Expose primary volume descriptor (pvd) and directory structures since
they *are* part of the spec. and be done with it.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
$Id: iso9660.c,v 1.5 2003/08/31 02:51:41 rocky Exp $
|
||||
$Id: iso9660.c,v 1.6 2003/08/31 05:00:44 rocky Exp $
|
||||
|
||||
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
|
||||
Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
|
||||
@@ -37,7 +37,7 @@
|
||||
#include "cdio_assert.h"
|
||||
#include "bytesex.h"
|
||||
|
||||
static const char _rcsid[] = "$Id: iso9660.c,v 1.5 2003/08/31 02:51:41 rocky Exp $";
|
||||
static const char _rcsid[] = "$Id: iso9660.c,v 1.6 2003/08/31 05:00:44 rocky Exp $";
|
||||
|
||||
/* some parameters... */
|
||||
#define SYSTEM_ID "CD-RTOS CD-BRIDGE"
|
||||
@@ -263,7 +263,7 @@ iso9660_dir_calc_record_size(unsigned namelen, unsigned int su_len)
|
||||
{
|
||||
unsigned length;
|
||||
|
||||
length = sizeof(struct iso_directory_record);
|
||||
length = sizeof(iso9660_dir_t);
|
||||
length += namelen;
|
||||
if (length % 2) /* pad to word boundary */
|
||||
length++;
|
||||
@@ -283,13 +283,13 @@ iso9660_dir_add_entry_su(void *dir,
|
||||
const void *su_data,
|
||||
unsigned su_size)
|
||||
{
|
||||
struct iso_directory_record *idr = dir;
|
||||
iso9660_dir_t *idr = dir;
|
||||
uint8_t *dir8 = dir;
|
||||
unsigned offset = 0;
|
||||
uint32_t dsize = from_733(idr->size);
|
||||
int length, su_offset;
|
||||
|
||||
cdio_assert (sizeof(struct iso_directory_record) == 33);
|
||||
cdio_assert (sizeof(iso9660_dir_t) == 33);
|
||||
|
||||
if (!dsize && !idr->length)
|
||||
dsize = ISO_BLOCKSIZE; /* for when dir lacks '.' entry */
|
||||
@@ -300,7 +300,7 @@ iso9660_dir_add_entry_su(void *dir,
|
||||
cdio_assert (name != NULL);
|
||||
cdio_assert (strlen(name) <= MAX_ISOPATHNAME);
|
||||
|
||||
length = sizeof(struct iso_directory_record);
|
||||
length = sizeof(iso9660_dir_t);
|
||||
length += strlen(name);
|
||||
length = _cdio_ceil2block (length, 2); /* pad to word boundary */
|
||||
su_offset = length;
|
||||
@@ -335,7 +335,7 @@ iso9660_dir_add_entry_su(void *dir,
|
||||
|
||||
cdio_assert (offset + length <= dsize);
|
||||
|
||||
idr = (struct iso_directory_record*) &dir8[offset];
|
||||
idr = (iso9660_dir_t *) &dir8[offset];
|
||||
|
||||
cdio_assert (offset+length < dsize);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
$Id: iso9660_private.h,v 1.3 2003/08/31 03:35:36 rocky Exp $
|
||||
$Id: iso9660_private.h,v 1.4 2003/08/31 05:00:44 rocky Exp $
|
||||
|
||||
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
|
||||
Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
|
||||
@@ -39,43 +39,7 @@ struct iso_volume_descriptor {
|
||||
|
||||
#define struct_iso_volume_descriptor_SIZEOF ISO_BLOCKSIZE
|
||||
|
||||
struct iso_primary_descriptor {
|
||||
uint8_t type; /* 711 */
|
||||
char id[5];
|
||||
uint8_t version; /* 711 */
|
||||
char unused1[1];
|
||||
char system_id[32]; /* achars */
|
||||
char volume_id[32]; /* dchars */
|
||||
char unused2[8];
|
||||
uint64_t volume_space_size; /* 733 */
|
||||
char escape_sequences[32];
|
||||
uint32_t volume_set_size; /* 723 */
|
||||
uint32_t volume_sequence_number; /* 723 */
|
||||
uint32_t logical_block_size; /* 723 */
|
||||
uint64_t path_table_size; /* 733 */
|
||||
uint32_t type_l_path_table; /* 731 */
|
||||
uint32_t opt_type_l_path_table; /* 731 */
|
||||
uint32_t type_m_path_table; /* 732 */
|
||||
uint32_t opt_type_m_path_table; /* 732 */
|
||||
char root_directory_record[34]; /* 9.1 */
|
||||
char volume_set_id[128]; /* dchars */
|
||||
char publisher_id[128]; /* achars */
|
||||
char preparer_id[128]; /* achars */
|
||||
char application_id[128]; /* achars */
|
||||
char copyright_file_id[37]; /* 7.5 dchars */
|
||||
char abstract_file_id[37]; /* 7.5 dchars */
|
||||
char bibliographic_file_id[37]; /* 7.5 dchars */
|
||||
char creation_date[17]; /* 8.4.26.1 */
|
||||
char modification_date[17]; /* 8.4.26.1 */
|
||||
char expiration_date[17]; /* 8.4.26.1 */
|
||||
char effective_date[17]; /* 8.4.26.1 */
|
||||
uint8_t file_structure_version; /* 711 */
|
||||
char unused4[1];
|
||||
char application_data[512];
|
||||
char unused5[653];
|
||||
} GNUC_PACKED;
|
||||
|
||||
#define struct_iso_primary_descriptor_SIZEOF ISO_BLOCKSIZE
|
||||
#define struct_iso9660_pvd_SIZEOF ISO_BLOCKSIZE
|
||||
|
||||
struct iso_path_table {
|
||||
uint8_t name_len; /* 711 */
|
||||
@@ -87,21 +51,7 @@ struct iso_path_table {
|
||||
|
||||
#define struct_iso_path_table_SIZEOF 8
|
||||
|
||||
struct iso_directory_record {
|
||||
uint8_t length; /* 711 */
|
||||
uint8_t ext_attr_length; /* 711 */
|
||||
uint64_t extent; /* 733 */
|
||||
uint64_t size; /* 733 */
|
||||
uint8_t date[7]; /* 7 by 711 */
|
||||
uint8_t flags;
|
||||
uint8_t file_unit_size; /* 711 */
|
||||
uint8_t interleave; /* 711 */
|
||||
uint32_t volume_sequence_number; /* 723 */
|
||||
uint8_t name_len; /* 711 */
|
||||
char name[EMPTY_ARRAY_SIZE];
|
||||
} GNUC_PACKED;
|
||||
|
||||
#define struct_iso_directory_record_SIZEOF 33
|
||||
#define struct_iso9660_dir_SIZEOF 33
|
||||
|
||||
PRAGMA_END_PACKED
|
||||
|
||||
|
||||
Reference in New Issue
Block a user