From 1379caca11ed925f1b61435601cfd323d57a19d9 Mon Sep 17 00:00:00 2001 From: Tyler Dauwalder Date: Tue, 25 Nov 2003 00:12:50 +0000 Subject: [PATCH] Removed "udf_" prefix from udf on-disk data structures, as they already live in the Udf:: namespace, and I'll be referencing them fully qualified in makeudfimage and don't feel like typing udf twice each time. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5474 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../udf/AllocationDescriptorList.h | 6 +- .../kernel/file_systems/udf/CachedBlock.h | 8 +- .../file_systems/udf/DirectoryIterator.cpp | 4 +- .../file_systems/udf/DiskStructures.cpp | 144 ++--- .../kernel/file_systems/udf/DiskStructures.h | 492 +++++++++--------- src/add-ons/kernel/file_systems/udf/Icb.cpp | 10 +- src/add-ons/kernel/file_systems/udf/Icb.h | 22 +- .../kernel/file_systems/udf/Recognition.cpp | 52 +- .../kernel/file_systems/udf/Recognition.h | 4 +- src/add-ons/kernel/file_systems/udf/Utils.cpp | 8 +- src/add-ons/kernel/file_systems/udf/Utils.h | 6 +- .../kernel/file_systems/udf/Volume.cpp | 43 +- src/add-ons/kernel/file_systems/udf/Volume.h | 6 +- src/add-ons/kernel/file_systems/udf/udf.cpp | 3 +- 14 files changed, 409 insertions(+), 399 deletions(-) diff --git a/src/add-ons/kernel/file_systems/udf/AllocationDescriptorList.h b/src/add-ons/kernel/file_systems/udf/AllocationDescriptorList.h index 618e988a59..1dfe873da2 100644 --- a/src/add-ons/kernel/file_systems/udf/AllocationDescriptorList.h +++ b/src/add-ons/kernel/file_systems/udf/AllocationDescriptorList.h @@ -61,7 +61,7 @@ public: \param isEmpty If set to true, indicates that the given extent is unrecorded and thus its contents should be interpreted as all zeros. */ - status_t FindExtent(off_t start, udf_long_address *extent, bool *isEmpty) { + status_t FindExtent(off_t start, long_address *extent, bool *isEmpty) { DEBUG_INIT_ETC(CF_PUBLIC | CF_FILE_OPS | CF_HIGH_VOLUME, "AllocationDescriptorList<>", ("start: %Ld, extent: %p, isEmpty: %p", start, extent, isEmpty)); off_t startBlock = start >> fVolume->BlockShift(); @@ -213,7 +213,7 @@ public: { } - typedef udf_short_address DescriptorType; + typedef short_address DescriptorType; inline uint8 GetType(DescriptorType &descriptor) const { return descriptor.type(); @@ -236,7 +236,7 @@ private: class LongDescriptorAccessor { public: - typedef udf_long_address DescriptorType; + typedef long_address DescriptorType; inline uint8 GetType(DescriptorType &descriptor) const { return descriptor.type(); diff --git a/src/add-ons/kernel/file_systems/udf/CachedBlock.h b/src/add-ons/kernel/file_systems/udf/CachedBlock.h index a46b326916..d67e76c1c9 100644 --- a/src/add-ons/kernel/file_systems/udf/CachedBlock.h +++ b/src/add-ons/kernel/file_systems/udf/CachedBlock.h @@ -43,7 +43,7 @@ class CachedBlock { inline void Keep(); inline void Unset(); inline uint8 *SetTo(off_t block, bool empty = false); - inline uint8 *SetTo(udf_long_address address, bool empty = false); + inline uint8 *SetTo(long_address address, bool empty = false); template inline uint8* SetTo(Accessor &accessor, Descriptor &descriptor, bool empty = false); @@ -126,7 +126,7 @@ CachedBlock::SetTo(off_t block, bool empty = false) } inline uint8 * -CachedBlock::SetTo(udf_long_address address, bool empty = false) +CachedBlock::SetTo(long_address address, bool empty = false) { off_t block; if (fVolume->MapBlock(address, &block) == B_OK) @@ -139,8 +139,8 @@ template inline uint8* CachedBlock::SetTo(Accessor &accessor, Descriptor &descriptor, bool empty = false) { - // Make a udf_long_address out of the descriptor and call it a day - udf_long_address address; + // Make a long_address out of the descriptor and call it a day + long_address address; address.set_to(accessor.GetBlock(descriptor), accessor.GetPartition(descriptor)); return SetTo(address, empty); diff --git a/src/add-ons/kernel/file_systems/udf/DirectoryIterator.cpp b/src/add-ons/kernel/file_systems/udf/DirectoryIterator.cpp index 747d3a8be7..287b7fa152 100644 --- a/src/add-ons/kernel/file_systems/udf/DirectoryIterator.cpp +++ b/src/add-ons/kernel/file_systems/udf/DirectoryIterator.cpp @@ -41,7 +41,7 @@ DirectoryIterator::GetNextEntry(char *name, uint32 *length, vnode_id *id) return B_ENTRY_NOT_FOUND; uint8 data[kMaxFileIdSize]; - udf_file_id_descriptor *entry = reinterpret_cast(data); + file_id_descriptor *entry = reinterpret_cast(data); uint32 block = 0; off_t offset = fPosition; @@ -51,7 +51,7 @@ DirectoryIterator::GetNextEntry(char *name, uint32 *length, vnode_id *id) // then, based on the information therein, read in the variable // length tail portion as well. error = Parent()->Read(offset, entry, &entryLength, &block); - if (!error && entryLength >= sizeof(udf_file_id_descriptor) && entry->tag().init_check(block) == B_OK) { + if (!error && entryLength >= sizeof(file_id_descriptor) && entry->tag().init_check(block) == B_OK) { PDUMP(entry); offset += entry->total_length(); diff --git a/src/add-ons/kernel/file_systems/udf/DiskStructures.cpp b/src/add-ons/kernel/file_systems/udf/DiskStructures.cpp index 2a67621789..26b1979321 100644 --- a/src/add-ons/kernel/file_systems/udf/DiskStructures.cpp +++ b/src/add-ons/kernel/file_systems/udf/DiskStructures.cpp @@ -37,16 +37,16 @@ const char* Udf::kVSDID_ECMA167_2 = "NSR02"; const char* Udf::kVSDID_ECMA167_3 = "NSR03"; const char* Udf::kVSDID_ECMA168 = "CDW02"; -// udf_entity_ids -const udf_entity_id Udf::kMetadataPartitionMapId(0, "*UDF Metadata Partition"); -const udf_entity_id Udf::kSparablePartitionMapId(0, "*UDF Sparable Partition"); -const udf_entity_id Udf::kVirtualPartitionMapId(0, "*UDF Virtual Partition"); +// entity_ids +const entity_id Udf::kMetadataPartitionMapId(0, "*UDF Metadata Partition"); +const entity_id Udf::kSparablePartitionMapId(0, "*UDF Sparable Partition"); +const entity_id Udf::kVirtualPartitionMapId(0, "*UDF Virtual Partition"); //---------------------------------------------------------------------- // Helper functions //---------------------------------------------------------------------- -const char *Udf::udf_tag_id_to_string(udf_tag_id id) +const char *Udf::tag_id_to_string(tag_id id) { switch (id) { case TAGID_UNDEFINED: @@ -103,39 +103,39 @@ const char *Udf::udf_tag_id_to_string(udf_tag_id id) //---------------------------------------------------------------------- -// udf_volume_structure_descriptor_header +// volume_structure_descriptor_header //---------------------------------------------------------------------- /*! \brief Returns true if the given \a id matches the header's id. */ bool -udf_volume_structure_descriptor_header::id_matches(const char *id) +volume_structure_descriptor_header::id_matches(const char *id) { return strncmp(this->id, id, 5) == 0; } //---------------------------------------------------------------------- -// udf_charspec +// charspec //---------------------------------------------------------------------- void -udf_charspec::dump() const +charspec::dump() const { - DUMP_INIT(CF_PUBLIC | CF_DUMP, "udf_charspec"); + DUMP_INIT(CF_PUBLIC | CF_DUMP, "charspec"); PRINT(("character_set_type: %d\n", character_set_type())); PRINT(("character_set_info: `%s'\n", character_set_info())); } //---------------------------------------------------------------------- -// udf_timestamp +// timestamp //---------------------------------------------------------------------- void -udf_timestamp::dump() const +timestamp::dump() const { - DUMP_INIT(CF_PUBLIC | CF_DUMP, "udf_timestamp"); + DUMP_INIT(CF_PUBLIC | CF_DUMP, "timestamp"); PRINT(("type: %d\n", type())); PRINT(("timezone: %d\n", timezone())); PRINT(("year: %d\n", year())); @@ -150,10 +150,10 @@ udf_timestamp::dump() const } //---------------------------------------------------------------------- -// udf_entity_id +// entity_id //---------------------------------------------------------------------- -udf_entity_id::udf_entity_id(uint8 flags, char *identifier, char *identifier_suffix) +entity_id::entity_id(uint8 flags, char *identifier, char *identifier_suffix) : _flags(flags) { if (identifier) @@ -167,19 +167,19 @@ udf_entity_id::udf_entity_id(uint8 flags, char *identifier, char *identifier_suf } void -udf_entity_id::dump() const +entity_id::dump() const { - DUMP_INIT(CF_PUBLIC | CF_DUMP, "udf_entity_id"); + DUMP_INIT(CF_PUBLIC | CF_DUMP, "entity_id"); PRINT(("flags: %d\n", flags())); PRINT(("identifier: `%.23s'\n", identifier())); PRINT(("identifier_suffix: `%s'\n", identifier_suffix())); } bool -udf_entity_id::matches(const udf_entity_id &id) const +entity_id::matches(const entity_id &id) const { bool result = true; - for (int i = 0; i < udf_entity_id::kIdentifierLength; i++) { + for (int i = 0; i < entity_id::kIdentifierLength; i++) { if (identifier()[i] != id.identifier()[i]) { result = false; break; @@ -189,29 +189,29 @@ udf_entity_id::matches(const udf_entity_id &id) const } //---------------------------------------------------------------------- -// udf_extent_address +// extent_address //---------------------------------------------------------------------- void -udf_extent_address::dump() const +extent_address::dump() const { - DUMP_INIT(CF_PUBLIC | CF_DUMP, "udf_extent_address"); + DUMP_INIT(CF_PUBLIC | CF_DUMP, "extent_address"); PRINT(("length: %ld\n", length())); PRINT(("location: %ld\n", location())); } void -udf_logical_block_address::dump() const +logical_block_address::dump() const { - DUMP_INIT(CF_PUBLIC | CF_DUMP, "udf_logical_block_address"); + DUMP_INIT(CF_PUBLIC | CF_DUMP, "logical_block_address"); PRINT(("block: %ld\n", block())); PRINT(("partition: %d\n", partition())); } void -udf_long_address::dump() const +long_address::dump() const { - DUMP_INIT(CF_PUBLIC | CF_DUMP, "udf_long_address"); + DUMP_INIT(CF_PUBLIC | CF_DUMP, "long_address"); PRINT(("length: %ld\n", length())); PRINT(("block: %ld\n", block())); PRINT(("partiton: %d\n", partition())); @@ -220,14 +220,14 @@ udf_long_address::dump() const } //---------------------------------------------------------------------- -// udf_tag +// descriptor_tag //---------------------------------------------------------------------- void -udf_tag::dump() const +descriptor_tag ::dump() const { - DUMP_INIT(CF_PUBLIC | CF_VOLUME_OPS | CF_DUMP, "udf_descriptor_tag"); - PRINT(("id: %d (%s)\n", id(), udf_tag_id_to_string(udf_tag_id(id())))); + DUMP_INIT(CF_PUBLIC | CF_VOLUME_OPS | CF_DUMP, "descriptor_tag"); + PRINT(("id: %d (%s)\n", id(), tag_id_to_string(tag_id(id())))); PRINT(("version: %d\n", version())); PRINT(("checksum: %d\n", checksum())); PRINT(("serial_number: %d\n", serial_number())); @@ -243,9 +243,9 @@ udf_tag::dump() const \todo Calc the CRC. */ status_t -udf_tag::init_check(uint32 diskBlock) +descriptor_tag ::init_check(uint32 diskBlock) { - DEBUG_INIT(CF_PUBLIC | CF_VOLUME_OPS | CF_HIGH_VOLUME, "udf_descriptor_tag"); + DEBUG_INIT(CF_PUBLIC | CF_VOLUME_OPS | CF_HIGH_VOLUME, "descriptor_tag"); PRINT(("location (paramater) == %ld\n", diskBlock)); PRINT(("location (in structure) == %ld\n", location())); status_t error = (diskBlock == location()) ? B_OK : B_NO_INIT; @@ -265,13 +265,13 @@ udf_tag::init_check(uint32 diskBlock) //---------------------------------------------------------------------- -// udf_primary_descriptor +// primary_descriptor //---------------------------------------------------------------------- void -udf_primary_descriptor::dump() const +primary_descriptor::dump() const { - DUMP_INIT(CF_PUBLIC | CF_VOLUME_OPS | CF_DUMP, "udf_primary_descriptor"); + DUMP_INIT(CF_PUBLIC | CF_VOLUME_OPS | CF_DUMP, "primary_descriptor"); CS0String string; @@ -309,13 +309,13 @@ udf_primary_descriptor::dump() const //---------------------------------------------------------------------- -// udf_anchor_volume_descriptor_pointer +// anchor_volume_descriptor_pointer //---------------------------------------------------------------------- void -udf_anchor_descriptor::dump() const +anchor_descriptor::dump() const { - DUMP_INIT(CF_PUBLIC | CF_VOLUME_OPS | CF_DUMP, "udf_anchor_descriptor"); + DUMP_INIT(CF_PUBLIC | CF_VOLUME_OPS | CF_DUMP, "anchor_descriptor"); PRINT(("tag:\n")); DUMP(tag()); PRINT(("main_vds:\n")); @@ -326,13 +326,13 @@ udf_anchor_descriptor::dump() const //---------------------------------------------------------------------- -// udf_implementation_use_descriptor +// implementation_use_descriptor //---------------------------------------------------------------------- void -udf_implementation_use_descriptor::dump() const +implementation_use_descriptor::dump() const { - DUMP_INIT(CF_PUBLIC | CF_VOLUME_OPS | CF_DUMP, "udf_implementation_use_descriptor"); + DUMP_INIT(CF_PUBLIC | CF_VOLUME_OPS | CF_DUMP, "implementation_use_descriptor"); PRINT(("tag:\n")); DUMP(tag()); PRINT(("vds_number: %ld\n", vds_number())); @@ -343,15 +343,15 @@ udf_implementation_use_descriptor::dump() const } //---------------------------------------------------------------------- -// udf_partition_descriptor +// partition_descriptor //---------------------------------------------------------------------- const uint8 Udf::kMaxPartitionDescriptors = 2; void -udf_partition_descriptor::dump() const +partition_descriptor::dump() const { - DUMP_INIT(CF_PUBLIC | CF_VOLUME_OPS | CF_DUMP, "udf_partition_descriptor"); + DUMP_INIT(CF_PUBLIC | CF_VOLUME_OPS | CF_DUMP, "partition_descriptor"); PRINT(("tag:\n")); DUMP(tag()); PRINT(("vds_number: %ld\n", vds_number())); @@ -372,13 +372,13 @@ udf_partition_descriptor::dump() const } //---------------------------------------------------------------------- -// udf_logical_descriptor +// logical_descriptor //---------------------------------------------------------------------- void -udf_logical_descriptor::dump() const +logical_descriptor::dump() const { - DUMP_INIT(CF_PUBLIC | CF_VOLUME_OPS | CF_DUMP, "udf_logical_descriptor"); + DUMP_INIT(CF_PUBLIC | CF_VOLUME_OPS | CF_DUMP, "logical_descriptor"); PRINT(("tag:\n")); DUMP(tag()); PRINT(("vds_number: %ld\n", vds_number())); @@ -418,7 +418,7 @@ udf_logical_descriptor::dump() const case 2: { PRINT((" partition_number: %d\n", *reinterpret_cast(&(maps[offset+38])))); PRINT((" entity_id:\n")); - const udf_entity_id *id = reinterpret_cast(&(maps[offset+4])); + const entity_id *id = reinterpret_cast(&(maps[offset+4])); if (id) // To kill warning when DEBUG==0 PDUMP(id); break; @@ -430,8 +430,8 @@ udf_logical_descriptor::dump() const } -udf_logical_descriptor& -udf_logical_descriptor::operator=(const udf_logical_descriptor &rhs) +logical_descriptor& +logical_descriptor::operator=(const logical_descriptor &rhs) { _tag = rhs._tag; _vds_number = rhs._vds_number; @@ -459,13 +459,13 @@ udf_logical_descriptor::operator=(const udf_logical_descriptor &rhs) //---------------------------------------------------------------------- -// udf_physical_partition_map +// physical_partition_map //---------------------------------------------------------------------- void -udf_physical_partition_map::dump() +physical_partition_map::dump() { - DUMP_INIT(CF_PUBLIC | CF_VOLUME_OPS | CF_DUMP, "udf_physical_partition_map"); + DUMP_INIT(CF_PUBLIC | CF_VOLUME_OPS | CF_DUMP, "physical_partition_map"); PRINT(("type: %d\n", type())); PRINT(("length: %d\n", length())); PRINT(("volume_sequence_number: %d\n", volume_sequence_number())); @@ -473,13 +473,13 @@ udf_physical_partition_map::dump() } //---------------------------------------------------------------------- -// udf_sparable_partition_map +// sparable_partition_map //---------------------------------------------------------------------- void -udf_sparable_partition_map::dump() +sparable_partition_map::dump() { - DUMP_INIT(CF_PUBLIC | CF_VOLUME_OPS | CF_DUMP, "udf_sparable_partition_map"); + DUMP_INIT(CF_PUBLIC | CF_VOLUME_OPS | CF_DUMP, "sparable_partition_map"); PRINT(("type: %d\n", type())); PRINT(("length: %d\n", length())); PRINT(("partition_type_id:")); @@ -494,13 +494,13 @@ udf_sparable_partition_map::dump() } //---------------------------------------------------------------------- -// udf_unallocated_space_descriptor +// unallocated_space_descriptor //---------------------------------------------------------------------- void -udf_unallocated_space_descriptor::dump() const +unallocated_space_descriptor::dump() const { - DUMP_INIT(CF_PUBLIC | CF_VOLUME_OPS | CF_DUMP, "udf_unallocated_space_descriptor"); + DUMP_INIT(CF_PUBLIC | CF_VOLUME_OPS | CF_DUMP, "unallocated_space_descriptor"); PRINT(("tag:\n")); DUMP(tag()); PRINT(("vds_number: %ld\n", vds_number())); @@ -510,25 +510,25 @@ udf_unallocated_space_descriptor::dump() const //---------------------------------------------------------------------- -// udf_terminating_descriptor +// terminating_descriptor //---------------------------------------------------------------------- void -udf_terminating_descriptor::dump() const +terminating_descriptor::dump() const { - DUMP_INIT(CF_PUBLIC | CF_VOLUME_OPS | CF_DUMP, "udf_terminating_descriptor"); + DUMP_INIT(CF_PUBLIC | CF_VOLUME_OPS | CF_DUMP, "terminating_descriptor"); PRINT(("tag:\n")); DUMP(tag()); } //---------------------------------------------------------------------- -// udf_file_set_descriptor +// file_set_descriptor //---------------------------------------------------------------------- void -udf_file_set_descriptor::dump() const +file_set_descriptor::dump() const { - DUMP_INIT(CF_PUBLIC | CF_VOLUME_OPS | CF_DUMP, "udf_file_set_descriptor"); + DUMP_INIT(CF_PUBLIC | CF_VOLUME_OPS | CF_DUMP, "file_set_descriptor"); PRINT(("tag:\n")); DUMP(tag()); PRINT(("recording_date_and_time:\n")); @@ -562,9 +562,9 @@ udf_file_set_descriptor::dump() const } void -udf_file_id_descriptor::dump() const +file_id_descriptor::dump() const { - DUMP_INIT(CF_PUBLIC | CF_VOLUME_OPS, "udf_file_id_descriptor"); + DUMP_INIT(CF_PUBLIC | CF_VOLUME_OPS, "file_id_descriptor"); PRINT(("tag:\n")); DUMP(tag()); PRINT(("version_number: %d\n", version_number())); @@ -584,9 +584,9 @@ udf_file_id_descriptor::dump() const } void -udf_icb_entry_tag::dump() const +icb_entry_tag::dump() const { - DUMP_INIT(CF_PUBLIC, "udf_icb_entry_tag"); + DUMP_INIT(CF_PUBLIC, "icb_entry_tag"); PRINT(("prior_entries: %ld\n", prior_recorded_number_of_direct_entries())); PRINT(("strategy_type: %d\n", strategy_type())); PRINT(("strategy_parameters:\n")); @@ -604,7 +604,7 @@ udf_icb_entry_tag::dump() const uint16 entry_count; uint8 reserved; uint8 file_type; - udf_logical_block_address parent_icb_location; + logical_block_address parent_icb_location; union { uint16 all_flags; struct { @@ -629,9 +629,9 @@ udf_icb_entry_tag::dump() const } void -udf_icb_header::dump() const +icb_header::dump() const { - DUMP_INIT(CF_PUBLIC | CF_DUMP, "udf_icb_header"); + DUMP_INIT(CF_PUBLIC | CF_DUMP, "icb_header"); PRINT(("tag:\n")); DUMP(tag()); diff --git a/src/add-ons/kernel/file_systems/udf/DiskStructures.h b/src/add-ons/kernel/file_systems/udf/DiskStructures.h index 902287ee64..094c78762c 100644 --- a/src/add-ons/kernel/file_systems/udf/DiskStructures.h +++ b/src/add-ons/kernel/file_systems/udf/DiskStructures.h @@ -1,5 +1,5 @@ //---------------------------------------------------------------------- -// This software is part of the OpenBeOS distribution and is covered +// This software is part of the OpenBeOS distribution and is covered // by the OpenBeOS license. // // Copyright (c) 2003 Tyler Dauwalder, tyler@dauwalder.net @@ -32,10 +32,10 @@ For lack of a better place to store this info, the structures that are allowed to have length greater than the logical block size are as follows (other length restrictions may be found in UDF-2.01 5.1): - - \c udf_logical_volume_descriptor - - \c udf_unallocated_space_descriptor - - \c udf_logical_volume_integrity_descriptor - - \c udf_space_bitmap_descriptor + - \c logical_volume_descriptor + - \c unallocated_space_descriptor + - \c logical_volume_integrity_descriptor + - \c space_bitmap_descriptor Other links of interest: - Philips UDF verifier @@ -55,7 +55,7 @@ namespace Udf { See also: ECMA 167 1/7.2.1, UDF-2.01 2.1.2 */ -struct udf_charspec { +struct charspec { public: void dump() const; @@ -70,14 +70,14 @@ private: } __attribute__((packed)); -extern const udf_charspec kCS0Charspec; +extern const charspec kCS0Charspec; /*! \brief Date and time stamp See also: ECMA 167 1/7.3, UDF-2.01 2.1.4 */ -class udf_timestamp { +class timestamp { private: union type_and_timezone_accessor { uint16 type_and_timezone; @@ -155,13 +155,13 @@ private: See also: ECMA 167 1/7.4, UDF 2.01 2.1.5 */ -struct udf_entity_id { +struct entity_id { public: - udf_entity_id(uint8 flags = 0, char *identifier = NULL, + entity_id(uint8 flags = 0, char *identifier = NULL, char *identifier_suffix = NULL); void dump() const; - bool matches(const udf_entity_id &id) const; + bool matches(const entity_id &id) const; // Get functions uint8 flags() const { return _flags; } @@ -181,9 +181,9 @@ private: char _identifier_suffix[kIdentifierSuffixLength]; } __attribute__((packed)); -extern const udf_entity_id kMetadataPartitionMapId; -extern const udf_entity_id kSparablePartitionMapId; -extern const udf_entity_id kVirtualPartitionMapId; +extern const entity_id kMetadataPartitionMapId; +extern const entity_id kSparablePartitionMapId; +extern const entity_id kVirtualPartitionMapId; //---------------------------------------------------------------------- // ECMA-167 Part 2 @@ -215,7 +215,7 @@ extern const udf_entity_id kVirtualPartitionMapId; See also: ECMA 167 2/9.1 */ -struct udf_volume_structure_descriptor_header { +struct volume_structure_descriptor_header { uint8 type; char id[5]; uint8 version; @@ -243,7 +243,7 @@ extern const char* kVSDID_ECMA168; See also: ECMA 167 3/7.1 */ -struct udf_extent_address { +struct extent_address { public: void dump() const; @@ -262,7 +262,7 @@ private: See also: ECMA 167 4/7.1 */ -struct udf_logical_block_address { +struct logical_block_address { public: void dump() const; @@ -277,12 +277,12 @@ private: uint16 _partition; //!< Numeric partition id within logical volume } __attribute__((packed)); -/*! \brief Extent types used in udf_short_address, udf_long_address, - and udf_extended_address. +/*! \brief Extent types used in short_address, long_address, + and extended_address. See also: ECMA-167 4/14.14.1.1 */ -enum udf_extent_type { +enum extent_type { EXTENT_TYPE_RECORDED = 0, //!< Allocated and recorded EXTENT_TYPE_ALLOCATED, //!< Allocated but unrecorded EXTENT_TYPE_UNALLOCATED, //!< Unallocated and unrecorded @@ -294,7 +294,7 @@ enum udf_extent_type { See also: ECMA 167 4/14.14.1 */ -struct udf_short_address { +struct short_address { private: union type_and_length_accessor { uint32 type_and_length; @@ -347,7 +347,7 @@ private: See also: ECMA 167 4/14.14.2 */ -struct udf_long_address { +struct long_address { private: union type_and_length_accessor { uint32 type_and_length; @@ -406,20 +406,20 @@ private: void set_type_and_length(uint32 value) { _type_and_length = B_HOST_TO_LENDIAN_INT32(value); } uint32 _type_and_length; - udf_logical_block_address _location; + logical_block_address _location; array _implementation_use; } __attribute__((packed)); /*! \brief Common tag found at the beginning of most udf descriptor structures. - For error checking, \c udf_tag structures have: + For error checking, \c descriptor_tag structures have: - The disk location of the tag redundantly stored in the tag itself - A checksum value for the tag - A CRC value and length See also: ECMA 167 1/7.2, UDF 2.01 2.2.1, UDF 2.01 2.3.1 */ -struct udf_tag { +struct descriptor_tag { public: void dump() const; @@ -468,9 +468,9 @@ private: } __attribute__((packed)); -/*! \c udf_tag::id values +/*! \c descriptor_tag ::id values */ -enum udf_tag_id { +enum tag_id { TAGID_UNDEFINED = 0, // ECMA 167, PART 3 @@ -501,17 +501,17 @@ enum udf_tag_id { TAGID_EXTENDED_FILE_ENTRY, }; -const char *udf_tag_id_to_string(udf_tag_id id); +const char *tag_id_to_string(tag_id id); /*! \brief Primary volume descriptor */ -struct udf_primary_descriptor { +struct primary_descriptor { public: void dump() const; // Get functions - const udf_tag& tag() const { return _tag; } - udf_tag& tag() { return _tag; } + const descriptor_tag & tag() const { return _tag; } + descriptor_tag & tag() { return _tag; } uint32 vds_number() const { return B_LENDIAN_TO_HOST_INT32(_vds_number); } uint32 primary_volume_descriptor_number() const { return B_LENDIAN_TO_HOST_INT32(_primary_volume_descriptor_number); } @@ -529,25 +529,25 @@ public: const array& volume_set_identifier() const { return _volume_set_identifier; } array& volume_set_identifier() { return _volume_set_identifier; } - const udf_charspec& descriptor_character_set() const { return _descriptor_character_set; } - udf_charspec& descriptor_character_set() { return _descriptor_character_set; } + const charspec& descriptor_character_set() const { return _descriptor_character_set; } + charspec& descriptor_character_set() { return _descriptor_character_set; } - const udf_charspec& explanatory_character_set() const { return _explanatory_character_set; } - udf_charspec& explanatory_character_set() { return _explanatory_character_set; } + const charspec& explanatory_character_set() const { return _explanatory_character_set; } + charspec& explanatory_character_set() { return _explanatory_character_set; } - const udf_extent_address& volume_abstract() const { return _volume_abstract; } - udf_extent_address& volume_abstract() { return _volume_abstract; } - const udf_extent_address& volume_copyright_notice() const { return _volume_copyright_notice; } - udf_extent_address& volume_copyright_notice() { return _volume_copyright_notice; } + const extent_address& volume_abstract() const { return _volume_abstract; } + extent_address& volume_abstract() { return _volume_abstract; } + const extent_address& volume_copyright_notice() const { return _volume_copyright_notice; } + extent_address& volume_copyright_notice() { return _volume_copyright_notice; } - const udf_entity_id& application_id() const { return _application_id; } - udf_entity_id& application_id() { return _application_id; } + const entity_id& application_id() const { return _application_id; } + entity_id& application_id() { return _application_id; } - const udf_timestamp& recording_date_and_time() const { return _recording_date_and_time; } - udf_timestamp& recording_date_and_time() { return _recording_date_and_time; } + const timestamp& recording_date_and_time() const { return _recording_date_and_time; } + timestamp& recording_date_and_time() { return _recording_date_and_time; } - const udf_entity_id& implementation_id() const { return _implementation_id; } - udf_entity_id& implementation_id() { return _implementation_id; } + const entity_id& implementation_id() const { return _implementation_id; } + entity_id& implementation_id() { return _implementation_id; } const array& implementation_use() const { return _implementation_use; } array& implementation_use() { return _implementation_use; } @@ -579,7 +579,7 @@ public: { _flags = B_HOST_TO_LENDIAN_INT16(flags); } private: - udf_tag _tag; + descriptor_tag _tag; uint32 _vds_number; uint32 _primary_volume_descriptor_number; array _volume_identifier; @@ -596,21 +596,21 @@ private: To be set to CS0. */ - udf_charspec _descriptor_character_set; + charspec _descriptor_character_set; /*! \brief Identifies the character set used in the \c volume_abstract and \c volume_copyright_notice extents. To be set to CS0. */ - udf_charspec _explanatory_character_set; + charspec _explanatory_character_set; - udf_extent_address _volume_abstract; - udf_extent_address _volume_copyright_notice; + extent_address _volume_abstract; + extent_address _volume_copyright_notice; - udf_entity_id _application_id; - udf_timestamp _recording_date_and_time; - udf_entity_id _implementation_id; + entity_id _application_id; + timestamp _recording_date_and_time; + entity_id _implementation_id; array _implementation_use; uint32 _predecessor_volume_descriptor_sequence_location; uint16 _flags; @@ -633,22 +633,22 @@ private: See also: ECMA 167 3/10.2, UDF-2.01 2.2.3 */ -struct udf_anchor_descriptor { +struct anchor_descriptor { public: void dump() const; - udf_tag& tag() { return _tag; } - const udf_tag& tag() const { return _tag; } + descriptor_tag & tag() { return _tag; } + const descriptor_tag & tag() const { return _tag; } - udf_extent_address& main_vds() { return _main_vds; } - const udf_extent_address& main_vds() const { return _main_vds; } + extent_address& main_vds() { return _main_vds; } + const extent_address& main_vds() const { return _main_vds; } - udf_extent_address& reserve_vds() { return _reserve_vds; } - const udf_extent_address& reserve_vds() const { return _reserve_vds; } + extent_address& reserve_vds() { return _reserve_vds; } + const extent_address& reserve_vds() const { return _reserve_vds; } private: - udf_tag _tag; - udf_extent_address _main_vds; //!< min length of 16 sectors - udf_extent_address _reserve_vds; //!< min length of 16 sectors + descriptor_tag _tag; + extent_address _main_vds; //!< min length of 16 sectors + extent_address _reserve_vds; //!< min length of 16 sectors char _reserved[480]; } __attribute__((packed)); @@ -659,10 +659,10 @@ private: See also: ECMA 167 3/10.3 */ -struct udf_descriptor_pointer { - udf_tag tag; +struct descriptor_pointer { + descriptor_tag tag; uint32 vds_number; - udf_extent_address next; + extent_address next; } __attribute__((packed)); @@ -670,18 +670,18 @@ struct udf_descriptor_pointer { See also: ECMA 167 3/10.4 */ -struct udf_implementation_use_descriptor { +struct implementation_use_descriptor { public: void dump() const; // Get functions - const udf_tag& tag() const { return _tag; } - udf_tag& tag() { return _tag; } + const descriptor_tag & tag() const { return _tag; } + descriptor_tag & tag() { return _tag; } uint32 vds_number() const { return B_LENDIAN_TO_HOST_INT32(_vds_number); } - const udf_entity_id& implementation_id() const { return _implementation_id; } - udf_entity_id& implementation_id() { return _implementation_id; } + const entity_id& implementation_id() const { return _implementation_id; } + entity_id& implementation_id() { return _implementation_id; } const array& implementation_use() const { return _implementation_use; } array& implementation_use() { return _implementation_use; } @@ -689,9 +689,9 @@ public: // Set functions void set_vds_number(uint32 number) { _vds_number = B_HOST_TO_LENDIAN_INT32(number); } private: - udf_tag _tag; + descriptor_tag _tag; uint32 _vds_number; - udf_entity_id _implementation_id; + entity_id _implementation_id; array _implementation_use; } __attribute__((packed)); @@ -707,7 +707,7 @@ extern const uint8 kMaxPartitionDescriptors; See also: ECMA 167 3/10.5 */ -struct udf_partition_descriptor { +struct partition_descriptor { private: union partition_flags_accessor { uint16 partition_flags; @@ -721,8 +721,8 @@ public: void dump() const; // Get functions - const udf_tag& tag() const { return _tag; } - udf_tag& tag() { return _tag; } + const descriptor_tag & tag() const { return _tag; } + descriptor_tag & tag() { return _tag; } uint32 vds_number() const { return B_LENDIAN_TO_HOST_INT32(_vds_number); } uint16 partition_flags() const { return B_LENDIAN_TO_HOST_INT16(_partition_flags); } @@ -733,8 +733,8 @@ public: } uint16 partition_number() const { return B_LENDIAN_TO_HOST_INT16(_partition_number); } - const udf_entity_id& partition_contents() const { return _partition_contents; } - udf_entity_id& partition_contents() { return _partition_contents; } + const entity_id& partition_contents() const { return _partition_contents; } + entity_id& partition_contents() { return _partition_contents; } const array& partition_contents_use() const { return _partition_contents_use; } array& partition_contents_use() { return _partition_contents_use; } @@ -743,8 +743,8 @@ public: uint32 start() const { return B_LENDIAN_TO_HOST_INT32(_start); } uint32 length() const { return B_LENDIAN_TO_HOST_INT32(_length); } - const udf_entity_id& implementation_id() const { return _implementation_id; } - udf_entity_id& implementation_id() { return _implementation_id; } + const entity_id& implementation_id() const { return _implementation_id; } + entity_id& implementation_id() { return _implementation_id; } const array& implementation_use() const { return _implementation_use; } array& implementation_use() { return _implementation_use; } @@ -764,7 +764,7 @@ public: void set_length(uint32 length) { _length = B_HOST_TO_LENDIAN_INT32(length); } private: - udf_tag _tag; + descriptor_tag _tag; uint32 _vds_number; /*! Bit 0: If 0, shall mean volume space has not been allocated. If 1, shall mean volume space has been allocated. @@ -777,7 +777,7 @@ private: - "+FDC01" Volume recorded according to ECMA-107 - "+CDW02" Volume recorded according to ECMA-168 */ - udf_entity_id _partition_contents; + entity_id _partition_contents; array _partition_contents_use; /*! See \c partition_access_type enum @@ -785,7 +785,7 @@ private: uint32 _access_type; uint32 _start; uint32 _length; - udf_entity_id _implementation_id; + entity_id _implementation_id; array _implementation_use; uint8 _reserved[156]; } __attribute__((packed)); @@ -804,43 +804,43 @@ enum partition_access_type { See also: ECMA 167 3/10.6, UDF-2.01 2.2.4 */ -struct udf_logical_descriptor { +struct logical_descriptor { void dump() const; // Get functions - const udf_tag& tag() const { return _tag; } - udf_tag& tag() { return _tag; } + const descriptor_tag & tag() const { return _tag; } + descriptor_tag & tag() { return _tag; } uint32 vds_number() const { return B_LENDIAN_TO_HOST_INT32(_vds_number); } - const udf_charspec& character_set() const { return _character_set; } - udf_charspec& character_set() { return _character_set; } + const charspec& character_set() const { return _character_set; } + charspec& character_set() { return _character_set; } const array& logical_volume_identifier() const { return _logical_volume_identifier; } array& logical_volume_identifier() { return _logical_volume_identifier; } uint32 logical_block_size() const { return B_LENDIAN_TO_HOST_INT32(_logical_block_size); } - const udf_entity_id& domain_id() const { return _domain_id; } - udf_entity_id& domain_id() { return _domain_id; } + const entity_id& domain_id() const { return _domain_id; } + entity_id& domain_id() { return _domain_id; } const array& logical_volume_contents_use() const { return _logical_volume_contents_use; } array& logical_volume_contents_use() { return _logical_volume_contents_use; } - const udf_long_address& file_set_address() const { return _file_set_address; } - udf_long_address& file_set_address() { return _file_set_address; } + const long_address& file_set_address() const { return _file_set_address; } + long_address& file_set_address() { return _file_set_address; } uint32 map_table_length() const { return B_LENDIAN_TO_HOST_INT32(_map_table_length); } uint32 partition_map_count() const { return B_LENDIAN_TO_HOST_INT32(_partition_map_count); } - const udf_entity_id& implementation_id() const { return _implementation_id; } - udf_entity_id& implementation_id() { return _implementation_id; } + const entity_id& implementation_id() const { return _implementation_id; } + entity_id& implementation_id() { return _implementation_id; } const array& implementation_use() const { return _implementation_use; } array& implementation_use() { return _implementation_use; } - const udf_extent_address& integrity_sequence_extent() const { return _integrity_sequence_extent; } - udf_extent_address& integrity_sequence_extent() { return _integrity_sequence_extent; } + const extent_address& integrity_sequence_extent() const { return _integrity_sequence_extent; } + extent_address& integrity_sequence_extent() { return _integrity_sequence_extent; } const uint8* partition_maps() const { return _partition_maps; } uint8* partition_maps() { return _partition_maps; } @@ -853,10 +853,10 @@ struct udf_logical_descriptor { void set_partition_map_count(uint32 count) { _partition_map_count = B_HOST_TO_LENDIAN_INT32(count); } // Other functions - udf_logical_descriptor& operator=(const udf_logical_descriptor &rhs); + logical_descriptor& operator=(const logical_descriptor &rhs); private: - udf_tag _tag; + descriptor_tag _tag; uint32 _vds_number; /*! \brief Identifies the character set for the @@ -864,25 +864,25 @@ private: To be set to CS0. */ - udf_charspec _character_set; + charspec _character_set; array _logical_volume_identifier; uint32 _logical_block_size; /*! \brief To be set to 0 or "*OSTA UDF Compliant". See UDF specs. */ - udf_entity_id _domain_id; + entity_id _domain_id; union { - /*! \brief For UDF, shall contain a \c udf_long_address which identifies + /*! \brief For UDF, shall contain a \c long_address which identifies the location of the logical volume's first file set. */ array _logical_volume_contents_use; - udf_long_address _file_set_address; + long_address _file_set_address; }; uint32 _map_table_length; uint32 _partition_map_count; - udf_entity_id _implementation_id; + entity_id _implementation_id; array _implementation_use; /*! \brief Logical volume integrity sequence location. @@ -892,14 +892,14 @@ private: must be added to the set if the extent fills up (since you can't chain lvis's I guess). */ - udf_extent_address _integrity_sequence_extent; + extent_address _integrity_sequence_extent; /*! \brief Restricted to maps of type 1 for normal maps and UDF type 2 for virtual maps or maps on systems not supporting defect management. Note that we actually allocate memory for the partition maps - here due to the fact that we allocate udf_logical_descriptor + here due to the fact that we allocate logical_descriptor objects on the stack sometimes. See UDF-2.01 2.2.8, 2.2.9 @@ -912,17 +912,17 @@ private: See also: ECMA-167 3/10.7.1 */ -struct udf_partition_map_header { +struct partition_map_header { public: uint8 type() const { return _type; } uint8 length() const { return _length; } uint8 *map_data() { return _map_data; } const uint8 *map_data() const { return _map_data; } - udf_entity_id& partition_type_id() - { return *reinterpret_cast(&_map_data[2]); } - const udf_entity_id& partition_type_id() const - { return *reinterpret_cast(&_map_data[2]); } + entity_id& partition_type_id() + { return *reinterpret_cast(&_map_data[2]); } + const entity_id& partition_type_id() const + { return *reinterpret_cast(&_map_data[2]); } void set_type(uint8 type) { _type = type; } void set_length(uint8 length) { _length = length; } @@ -937,7 +937,7 @@ private: See also: ECMA-167 3/10.7.2 */ -struct udf_physical_partition_map { +struct physical_partition_map { public: void dump(); @@ -971,7 +971,7 @@ private: See also: UDF-2.01 2.2.8 */ -struct udf_virtual_partition_map { +struct virtual_partition_map { uint8 type; uint8 length; uint8 reserved1[2]; @@ -980,7 +980,7 @@ struct udf_virtual_partition_map { - identifier: "*UDF Virtual Partition" - identifier_suffix: per UDF-2.01 2.1.5.3 */ - udf_entity_id partition_type_id; + entity_id partition_type_id; uint16 volume_sequence_number; /*! corresponding type 1 partition map in same logical volume @@ -991,7 +991,7 @@ struct udf_virtual_partition_map { /*! \brief Maximum number of redundant sparing tables found in - udf_sparable_partition_map structures. + sparable_partition_map structures. */ #define UDF_MAX_SPARING_TABLE_COUNT 4 @@ -1003,15 +1003,15 @@ struct udf_virtual_partition_map { See also: UDF-2.01 2.2.9 */ -struct udf_sparable_partition_map { +struct sparable_partition_map { public: void dump(); uint8 type() const { return _type; } uint8 length() const { return _length; } - udf_entity_id& partition_type_id() { return _partition_type_id; } - const udf_entity_id& partition_type_id() const { return _partition_type_id; } + entity_id& partition_type_id() { return _partition_type_id; } + const entity_id& partition_type_id() const { return _partition_type_id; } uint16 volume_sequence_number() const { return B_LENDIAN_TO_HOST_INT16(_volume_sequence_number); } @@ -1049,7 +1049,7 @@ private: - identifier: "*UDF Sparable Partition" - identifier_suffix: per UDF-2.01 2.1.5.3 */ - udf_entity_id _partition_type_id; + entity_id _partition_type_id; uint16 _volume_sequence_number; //! partition number of corresponding partition descriptor @@ -1070,7 +1070,7 @@ private: See also: UDF-2.50 2.2.10 */ -struct udf_metadata_partition_map { +struct metadata_partition_map { uint8 type; uint8 length; uint8 reserved1[2]; @@ -1079,7 +1079,7 @@ struct udf_metadata_partition_map { - identifier: "*UDF Metadata Partition" - identifier_suffix: per UDF-2.50 2.1.5 */ - udf_entity_id partition_type_id; + entity_id partition_type_id; uint16 volume_sequence_number; /*! corresponding type 1 or type 2 sparable partition @@ -1094,24 +1094,24 @@ struct udf_metadata_partition_map { See also: ECMA-167 3/10.8 */ -struct udf_unallocated_space_descriptor { +struct unallocated_space_descriptor { void dump() const; // Get functions - const udf_tag& tag() const { return _tag; } - udf_tag& tag() { return _tag; } + const descriptor_tag & tag() const { return _tag; } + descriptor_tag & tag() { return _tag; } uint32 vds_number() const { return B_LENDIAN_TO_HOST_INT32(_vds_number); } uint32 allocation_descriptor_count() const { return B_LENDIAN_TO_HOST_INT32(_allocation_descriptor_count); } - udf_extent_address* allocation_descriptors() { return _allocation_descriptors; } + extent_address* allocation_descriptors() { return _allocation_descriptors; } // Set functions void set_vds_number(uint32 number) { _vds_number = B_HOST_TO_LENDIAN_INT32(number); } void set_allocation_descriptor_count(uint32 count) { _allocation_descriptor_count = B_HOST_TO_LENDIAN_INT32(count); } private: - udf_tag _tag; + descriptor_tag _tag; uint32 _vds_number; uint32 _allocation_descriptor_count; - udf_extent_address _allocation_descriptors[0]; + extent_address _allocation_descriptors[0]; } __attribute__((packed)); @@ -1119,15 +1119,15 @@ private: See also: ECMA-167 3/10.9 */ -struct udf_terminating_descriptor { +struct terminating_descriptor { void dump() const; // Get functions - const udf_tag& tag() const { return _tag; } - udf_tag& tag() { return _tag; } + const descriptor_tag & tag() const { return _tag; } + descriptor_tag & tag() { return _tag; } private: - udf_tag _tag; + descriptor_tag _tag; uint8 _reserved[496]; } __attribute__((packed)); @@ -1136,11 +1136,11 @@ private: See also: ECMA-167 3/10.10 */ -struct udf_logical_volume_integrity_descriptor { - udf_tag tag; - udf_timestamp recording_time; +struct logical_volume_integrity_descriptor { + descriptor_tag tag; + timestamp recording_time; uint32 integrity_type; - udf_extent_address next_integrity_extent; + extent_address next_integrity_extent; array logical_volume_contents_use; uint32 partition_count; uint32 implementation_use_length; @@ -1179,15 +1179,15 @@ enum { (directly or indirectly) by any other file set. Writeable file sets may, however, reference actual file data extents that are also referenced by other file sets. */ -struct udf_file_set_descriptor { +struct file_set_descriptor { void dump() const; // Get functions - const udf_tag& tag() const { return _tag; } - udf_tag& tag() { return _tag; } + const descriptor_tag & tag() const { return _tag; } + descriptor_tag & tag() { return _tag; } - const udf_timestamp& recording_date_and_time() const { return _recording_date_and_time; } - udf_timestamp& recording_date_and_time() { return _recording_date_and_time; } + const timestamp& recording_date_and_time() const { return _recording_date_and_time; } + timestamp& recording_date_and_time() { return _recording_date_and_time; } uint16 interchange_level() const { return B_LENDIAN_TO_HOST_INT16(_interchange_level); } uint16 max_interchange_level() const { return B_LENDIAN_TO_HOST_INT16(_max_interchange_level); } @@ -1196,8 +1196,8 @@ struct udf_file_set_descriptor { uint32 file_set_number() const { return B_LENDIAN_TO_HOST_INT32(_file_set_number); } uint32 file_set_descriptor_number() const { return B_LENDIAN_TO_HOST_INT32(_file_set_descriptor_number); } - const udf_charspec& logical_volume_id_character_set() const { return _logical_volume_id_character_set; } - udf_charspec& logical_volume_id_character_set() { return _logical_volume_id_character_set; } + const charspec& logical_volume_id_character_set() const { return _logical_volume_id_character_set; } + charspec& logical_volume_id_character_set() { return _logical_volume_id_character_set; } const array& logical_volume_id() const { return _logical_volume_id; } array& logical_volume_id() { return _logical_volume_id; } @@ -1211,20 +1211,20 @@ struct udf_file_set_descriptor { const array& abstract_file_id() const { return _abstract_file_id; } array& abstract_file_id() { return _abstract_file_id; } - const udf_charspec& file_set_charspec() const { return _file_set_charspec; } - udf_charspec& file_set_charspec() { return _file_set_charspec; } + const charspec& file_set_charspec() const { return _file_set_charspec; } + charspec& file_set_charspec() { return _file_set_charspec; } - const udf_long_address& root_directory_icb() const { return _root_directory_icb; } - udf_long_address& root_directory_icb() { return _root_directory_icb; } + const long_address& root_directory_icb() const { return _root_directory_icb; } + long_address& root_directory_icb() { return _root_directory_icb; } - const udf_entity_id& domain_id() const { return _domain_id; } - udf_entity_id& domain_id() { return _domain_id; } + const entity_id& domain_id() const { return _domain_id; } + entity_id& domain_id() { return _domain_id; } - const udf_long_address& next_extent() const { return _next_extent; } - udf_long_address& next_extent() { return _next_extent; } + const long_address& next_extent() const { return _next_extent; } + long_address& next_extent() { return _next_extent; } - const udf_long_address& system_stream_directory_icb() const { return _system_stream_directory_icb; } - udf_long_address& system_stream_directory_icb() { return _system_stream_directory_icb; } + const long_address& system_stream_directory_icb() const { return _system_stream_directory_icb; } + long_address& system_stream_directory_icb() { return _system_stream_directory_icb; } // Set functions void set_interchange_level(uint16 level) { _interchange_level = B_HOST_TO_LENDIAN_INT16(level); } @@ -1234,24 +1234,24 @@ struct udf_file_set_descriptor { void set_file_set_number(uint32 number) { _file_set_number = B_HOST_TO_LENDIAN_INT32(number); } void set_file_set_descriptor_number(uint32 number) { _file_set_descriptor_number = B_HOST_TO_LENDIAN_INT32(number); } private: - udf_tag _tag; - udf_timestamp _recording_date_and_time; + descriptor_tag _tag; + timestamp _recording_date_and_time; uint16 _interchange_level; //!< To be set to 3 (see UDF-2.01 2.3.2.1) uint16 _max_interchange_level; //!< To be set to 3 (see UDF-2.01 2.3.2.2) uint32 _character_set_list; uint32 _max_character_set_list; uint32 _file_set_number; uint32 _file_set_descriptor_number; - udf_charspec _logical_volume_id_character_set; //!< To be set to kCSOCharspec + charspec _logical_volume_id_character_set; //!< To be set to kCSOCharspec array _logical_volume_id; - udf_charspec _file_set_charspec; + charspec _file_set_charspec; array _file_set_id; array _copyright_file_id; array _abstract_file_id; - udf_long_address _root_directory_icb; - udf_entity_id _domain_id; - udf_long_address _next_extent; - udf_long_address _system_stream_directory_icb; + long_address _root_directory_icb; + entity_id _domain_id; + long_address _next_extent; + long_address _system_stream_directory_icb; uint8 _reserved[32]; } __attribute__((packed)); @@ -1272,17 +1272,17 @@ private: See also: ECMA-167 4/14.3, UDF-2.01 2.2.3 */ -struct udf_partition_header_descriptor { - udf_long_address unallocated_space_table; - udf_long_address unallocated_space_bitmap; +struct partition_header_descriptor { + long_address unallocated_space_table; + long_address unallocated_space_bitmap; /*! Unused, per UDF-2.01 2.2.3 */ - udf_long_address partition_integrity_table; - udf_long_address freed_space_table; - udf_long_address freed_space_bitmap; + long_address partition_integrity_table; + long_address freed_space_table; + long_address freed_space_bitmap; uint8 reserved[88]; } __attribute__((packed)); -#define kMaxFileIdSize (sizeof(udf_file_id_descriptor)+512+3) +#define kMaxFileIdSize (sizeof(file_id_descriptor)+512+3) /*! \brief File identifier descriptor @@ -1293,12 +1293,12 @@ struct udf_partition_header_descriptor { \todo Check pointer arithmetic */ -struct udf_file_id_descriptor { +struct file_id_descriptor { public: void dump() const; - udf_tag& tag() { return _tag; } - const udf_tag& tag() const { return _tag; } + descriptor_tag & tag() { return _tag; } + const descriptor_tag & tag() const { return _tag; } uint16 version_number() const { return B_LENDIAN_TO_HOST_INT16(_version_number); } @@ -1336,13 +1336,13 @@ public: uint8 id_length() const { return _id_length; } - udf_long_address& icb() { return _icb; } - const udf_long_address& icb() const { return _icb; } + long_address& icb() { return _icb; } + const long_address& icb() const { return _icb; } uint8 implementation_use_length() const { return _implementation_use_length; } /*! If implementation_use_length is greater than 0, the first 32 - bytes of implementation_use() shall be an udf_entity_id identifying + bytes of implementation_use() shall be an entity_id identifying the implementation that generated the rest of the data in the implementation_use() field. */ @@ -1413,7 +1413,7 @@ private: } bits; }; - udf_tag _tag; + descriptor_tag _tag; /*! According to ECMA-167: 1 <= valid version_number <= 32767, 32768 <= reserved <= 65535. However, according to UDF-2.01, there shall be exactly one version of @@ -1423,7 +1423,7 @@ private: /*! \todo Check UDF-2.01 2.3.4.2 for some more restrictions. */ uint8 _characteristics; uint8 _id_length; - udf_long_address _icb; + long_address _icb; uint8 _implementation_use_length; } __attribute__((packed)); @@ -1432,13 +1432,13 @@ private: See also: ECMA-167 4/14.5 */ -struct udf_allocation_extent_descriptor { - udf_tag tag; +struct allocation_extent_descriptor { + descriptor_tag tag; uint32 previous_allocation_extent_location; uint32 length_of_allocation_descriptors; /*! \todo Check that this is really how things work: */ - uint8* allocation_descriptors() { return (uint8*)(this+sizeof(udf_allocation_extent_descriptor)); } + uint8* allocation_descriptors() { return (uint8*)(this+sizeof(allocation_extent_descriptor)); } } __attribute__((packed)); @@ -1446,7 +1446,7 @@ struct udf_allocation_extent_descriptor { See also ECMA-167 4/14.6.6 */ -enum udf_icb_file_types { +enum icb_file_types { ICB_TYPE_UNSPECIFIED = 0, ICB_TYPE_UNALLOCATED_SPACE_ENTRY, ICB_TYPE_PARTITION_INTEGRITY_ENTRY, @@ -1469,11 +1469,11 @@ enum udf_icb_file_types { ICB_TYPE_CUSTOM_END = 255, }; -/*! \brief udf_idb_entry_tag::_flags::descriptor_flags() values +/*! \brief idb_entry_tag::_flags::descriptor_flags() values See also ECMA-167 4/14.6.8 */ -enum udf_icb_descriptor_types { +enum icb_descriptor_types { ICB_DESCRIPTOR_TYPE_SHORT = 0, ICB_DESCRIPTOR_TYPE_LONG, ICB_DESCRIPTOR_TYPE_EXTENDED, @@ -1487,7 +1487,7 @@ enum udf_icb_descriptor_types { See also: ECMA-167 4/14.6, UDF-2.01 2.3.5 */ -struct udf_icb_entry_tag { +struct icb_entry_tag { private: union flags_accessor { uint16 all_flags; @@ -1519,8 +1519,8 @@ public: uint16 entry_count() const { return B_LENDIAN_TO_HOST_INT16(_entry_count); } uint8 file_type() const { return _file_type; } - udf_logical_block_address& parent_icb_location() { return _parent_icb_location; } - const udf_logical_block_address& parent_icb_location() const { return _parent_icb_location; } + logical_block_address& parent_icb_location() { return _parent_icb_location; } + const logical_block_address& parent_icb_location() const { return _parent_icb_location; } uint16 flags() const { return B_LENDIAN_TO_HOST_INT16(_flags); } @@ -1551,40 +1551,40 @@ private: uint8 _reserved; /*! \brief icb_file_type value identifying the type of this icb entry */ uint8 _file_type; - udf_logical_block_address _parent_icb_location; + logical_block_address _parent_icb_location; uint16 _flags; } __attribute__((packed)); /*! \brief Header portion of an ICB entry. */ -struct udf_icb_header { +struct icb_header { public: void dump() const; - udf_tag &tag() { return _tag; } - const udf_tag &tag() const { return _tag; } + descriptor_tag &tag() { return _tag; } + const descriptor_tag &tag() const { return _tag; } - udf_icb_entry_tag &icb_tag() { return _icb_tag; } - const udf_icb_entry_tag &icb_tag() const { return _icb_tag; } + icb_entry_tag &icb_tag() { return _icb_tag; } + const icb_entry_tag &icb_tag() const { return _icb_tag; } private: - udf_tag _tag; - udf_icb_entry_tag _icb_tag; + descriptor_tag _tag; + icb_entry_tag _icb_tag; }; /*! \brief Indirect ICB entry */ -struct udf_indirect_icb_entry { - udf_tag tag; - udf_icb_entry_tag icb_tag; - udf_long_address indirect_icb; +struct indirect_icb_entry { + descriptor_tag tag; + icb_entry_tag icb_tag; + long_address indirect_icb; } __attribute__((packed)); /*! \brief Terminal ICB entry */ -struct udf_terminal_icb_entry { - udf_tag tag; - udf_icb_entry_tag icb_tag; +struct terminal_icb_entry { + descriptor_tag tag; + icb_entry_tag icb_tag; } __attribute__((packed)); @@ -1594,13 +1594,13 @@ struct udf_terminal_icb_entry { \todo Check pointer math. */ -struct udf_file_icb_entry { +struct file_icb_entry { // get functions - udf_tag& tag() { return _tag; } - const udf_tag& tag() const { return _tag; } + descriptor_tag & tag() { return _tag; } + const descriptor_tag & tag() const { return _tag; } - udf_icb_entry_tag& icb_tag() { return _icb_tag; } - const udf_icb_entry_tag& icb_tag() const { return _icb_tag; } + icb_entry_tag& icb_tag() { return _icb_tag; } + const icb_entry_tag& icb_tag() const { return _icb_tag; } uint32 uid() { return B_LENDIAN_TO_HOST_INT32(_uid); } uint32 gid() { return B_LENDIAN_TO_HOST_INT32(_gid); } @@ -1612,29 +1612,29 @@ struct udf_file_icb_entry { uint64 information_length() { return B_LENDIAN_TO_HOST_INT64(_information_length); } uint64 logical_blocks_recorded() { return B_LENDIAN_TO_HOST_INT64(_logical_blocks_recorded); } - udf_timestamp& access_date_and_time() { return _access_date_and_time; } - const udf_timestamp& access_date_and_time() const { return _access_date_and_time; } + timestamp& access_date_and_time() { return _access_date_and_time; } + const timestamp& access_date_and_time() const { return _access_date_and_time; } - udf_timestamp& modification_date_and_time() { return _modification_date_and_time; } - const udf_timestamp& modification_date_and_time() const { return _modification_date_and_time; } + timestamp& modification_date_and_time() { return _modification_date_and_time; } + const timestamp& modification_date_and_time() const { return _modification_date_and_time; } - udf_timestamp& attribute_date_and_time() { return _attribute_date_and_time; } - const udf_timestamp& attribute_date_and_time() const { return _attribute_date_and_time; } + timestamp& attribute_date_and_time() { return _attribute_date_and_time; } + const timestamp& attribute_date_and_time() const { return _attribute_date_and_time; } uint32 checkpoint() { return B_LENDIAN_TO_HOST_INT32(_checkpoint); } - udf_long_address& extended_attribute_icb() { return _extended_attribute_icb; } - const udf_long_address& extended_attribute_icb() const { return _extended_attribute_icb; } + long_address& extended_attribute_icb() { return _extended_attribute_icb; } + const long_address& extended_attribute_icb() const { return _extended_attribute_icb; } - udf_entity_id& implementation_id() { return _implementation_id; } - const udf_entity_id& implementation_id() const { return _implementation_id; } + entity_id& implementation_id() { return _implementation_id; } + const entity_id& implementation_id() const { return _implementation_id; } uint64 unique_id() { return B_LENDIAN_TO_HOST_INT64(_unique_id); } uint32 extended_attributes_length() { return B_LENDIAN_TO_HOST_INT32(_extended_attributes_length); } uint32 allocation_descriptors_length() { return B_LENDIAN_TO_HOST_INT32(_allocation_descriptors_length); } - uint8* extended_attributes() { return ((uint8*)(this))+sizeof(udf_file_icb_entry); } - uint8* allocation_descriptors() { return ((uint8*)(this))+sizeof(udf_file_icb_entry)+extended_attributes_length(); } + uint8* extended_attributes() { return ((uint8*)(this))+sizeof(file_icb_entry); } + uint8* allocation_descriptors() { return ((uint8*)(this))+sizeof(file_icb_entry)+extended_attributes_length(); } // set functions void set_uid(uint32 uid) { _uid = B_HOST_TO_LENDIAN_INT32(uid); } @@ -1657,8 +1657,8 @@ struct udf_file_icb_entry { void set_allocation_descriptors_length(uint32 length) { _allocation_descriptors_length = B_HOST_TO_LENDIAN_INT32(length); } private: - udf_tag _tag; - udf_icb_entry_tag _icb_tag; + descriptor_tag _tag; + icb_entry_tag _icb_tag; uint32 _uid; uint32 _gid; /*! \todo List perms in comment and add handy union thingy */ @@ -1672,17 +1672,17 @@ private: uint8 _record_length; //!< To be set to 0 per UDF-2.01 2.3.6.3 uint64 _information_length; uint64 _logical_blocks_recorded; //!< To be 0 for files and dirs with embedded data - udf_timestamp _access_date_and_time; - udf_timestamp _modification_date_and_time; + timestamp _access_date_and_time; + timestamp _modification_date_and_time; // NOTE: data members following this point in the descriptor are in // different locations in extended file entries - udf_timestamp _attribute_date_and_time; + timestamp _attribute_date_and_time; /*! \brief Initially 1, may be incremented upon user request. */ uint32 _checkpoint; - udf_long_address _extended_attribute_icb; - udf_entity_id _implementation_id; + long_address _extended_attribute_icb; + entity_id _implementation_id; /*! \brief The unique id identifying this file entry The id of the root directory of a file set shall be 0. @@ -1702,13 +1702,13 @@ private: \todo Check pointer math. */ -struct udf_extended_file_icb_entry { +struct extended_file_icb_entry { // get functions - udf_tag& tag() { return _tag; } - const udf_tag& tag() const { return _tag; } + descriptor_tag & tag() { return _tag; } + const descriptor_tag & tag() const { return _tag; } - udf_icb_entry_tag& icb_tag() { return _icb_tag; } - const udf_icb_entry_tag& icb_tag() const { return _icb_tag; } + icb_entry_tag& icb_tag() { return _icb_tag; } + const icb_entry_tag& icb_tag() const { return _icb_tag; } uint32 uid() { return B_LENDIAN_TO_HOST_INT32(_uid); } uint32 gid() { return B_LENDIAN_TO_HOST_INT32(_gid); } @@ -1720,22 +1720,22 @@ struct udf_extended_file_icb_entry { uint64 information_length() { return B_LENDIAN_TO_HOST_INT64(_information_length); } uint64 logical_blocks_recorded() { return B_LENDIAN_TO_HOST_INT64(_logical_blocks_recorded); } - udf_timestamp& access_date_and_time() { return _access_date_and_time; } - const udf_timestamp& access_date_and_time() const { return _access_date_and_time; } + timestamp& access_date_and_time() { return _access_date_and_time; } + const timestamp& access_date_and_time() const { return _access_date_and_time; } - udf_timestamp& modification_date_and_time() { return _modification_date_and_time; } - const udf_timestamp& modification_date_and_time() const { return _modification_date_and_time; } + timestamp& modification_date_and_time() { return _modification_date_and_time; } + const timestamp& modification_date_and_time() const { return _modification_date_and_time; } - udf_timestamp& attribute_date_and_time() { return _attribute_date_and_time; } - const udf_timestamp& attribute_date_and_time() const { return _attribute_date_and_time; } + timestamp& attribute_date_and_time() { return _attribute_date_and_time; } + const timestamp& attribute_date_and_time() const { return _attribute_date_and_time; } uint32 checkpoint() { return B_LENDIAN_TO_HOST_INT32(_checkpoint); } - udf_long_address& extended_attribute_icb() { return _extended_attribute_icb; } - const udf_long_address& extended_attribute_icb() const { return _extended_attribute_icb; } + long_address& extended_attribute_icb() { return _extended_attribute_icb; } + const long_address& extended_attribute_icb() const { return _extended_attribute_icb; } - udf_entity_id& implementation_id() { return _implementation_id; } - const udf_entity_id& implementation_id() const { return _implementation_id; } + entity_id& implementation_id() { return _implementation_id; } + const entity_id& implementation_id() const { return _implementation_id; } uint64 unique_id() { return B_LENDIAN_TO_HOST_INT64(_unique_id); } uint32 extended_attributes_length() { return B_LENDIAN_TO_HOST_INT32(_extended_attributes_length); } @@ -1765,8 +1765,8 @@ struct udf_extended_file_icb_entry { void set_allocation_descriptors_length(uint32 length) { _allocation_descriptors_length = B_HOST_TO_LENDIAN_INT32(length); } private: - udf_tag _tag; - udf_icb_entry_tag _icb_tag; + descriptor_tag _tag; + icb_entry_tag _icb_tag; uint32 _uid; uint32 _gid; /*! \todo List perms in comment and add handy union thingy */ @@ -1780,16 +1780,16 @@ private: uint8 _record_length; //!< To be set to 0 per UDF-2.01 2.3.6.3 uint64 _information_length; uint64 _logical_blocks_recorded; //!< To be 0 for files and dirs with embedded data - udf_timestamp _access_date_and_time; - udf_timestamp _modification_date_and_time; - udf_timestamp _creation_date_and_time; // <== EXTENDED FILE ENTRY ONLY - udf_timestamp _attribute_date_and_time; + timestamp _access_date_and_time; + timestamp _modification_date_and_time; + timestamp _creation_date_and_time; // <== EXTENDED FILE ENTRY ONLY + timestamp _attribute_date_and_time; /*! \brief Initially 1, may be incremented upon user request. */ uint32 _checkpoint; uint32 _reserved; // <== EXTENDED FILE ENTRY ONLY - udf_long_address _extended_attribute_icb; - udf_long_address _stream_directory_icb; // <== EXTENDED FILE ENTRY ONLY - udf_entity_id _implementation_id; + long_address _extended_attribute_icb; + long_address _stream_directory_icb; // <== EXTENDED FILE ENTRY ONLY + entity_id _implementation_id; /*! \brief The unique id identifying this file entry The id of the root directory of a file set shall be 0. diff --git a/src/add-ons/kernel/file_systems/udf/Icb.cpp b/src/add-ons/kernel/file_systems/udf/Icb.cpp index beae8f13e4..b4fbd3d378 100644 --- a/src/add-ons/kernel/file_systems/udf/Icb.cpp +++ b/src/add-ons/kernel/file_systems/udf/Icb.cpp @@ -1,3 +1,9 @@ +//---------------------------------------------------------------------- +// This software is part of the OpenBeOS distribution and is covered +// by the OpenBeOS license. +// +// Copyright (c) 2003 Tyler Dauwalder, tyler@dauwalder.net +//--------------------------------------------------------------------- #include "Icb.h" #include "time.h" @@ -9,7 +15,7 @@ using namespace Udf; -Icb::Icb(Volume *volume, udf_long_address address) +Icb::Icb(Volume *volume, long_address address) : fVolume(volume) , fData(volume) , fInitStatus(B_NO_INIT) @@ -25,7 +31,7 @@ Icb::Icb(Volume *volume, udf_long_address address) off_t block; error = fVolume->MapBlock(address, &block); if (!error) { - udf_icb_header *header = reinterpret_cast(fData.SetTo(block)); + icb_header *header = reinterpret_cast(fData.SetTo(block)); PDUMP(header); error = header->tag().init_check(address.block()); } diff --git a/src/add-ons/kernel/file_systems/udf/Icb.h b/src/add-ons/kernel/file_systems/udf/Icb.h index 91827d1a39..c4ef5a0c6f 100644 --- a/src/add-ons/kernel/file_systems/udf/Icb.h +++ b/src/add-ons/kernel/file_systems/udf/Icb.h @@ -31,7 +31,7 @@ class DirectoryIterator; class Volume; /*! \brief Abstract interface to file entry structure members - that are not commonly accessible through udf_file_icb_entry(). + that are not commonly accessible through file_icb_entry(). This is necessary, since we can't use virtual functions in the disk structure structs themselves, since we generally @@ -62,7 +62,7 @@ private: class Icb { public: - Icb(Volume *volume, udf_long_address address); + Icb(Volume *volume, long_address address); status_t InitCheck(); vnode_id Id() { return fId; } @@ -94,18 +94,18 @@ public: private: Icb(); // unimplemented - udf_tag& Tag() { return (reinterpret_cast(fData.Block()))->tag(); } - udf_icb_entry_tag& IcbTag() { return (reinterpret_cast(fData.Block()))->icb_tag(); } + descriptor_tag & Tag() { return (reinterpret_cast(fData.Block()))->tag(); } + icb_entry_tag& IcbTag() { return (reinterpret_cast(fData.Block()))->icb_tag(); } AbstractFileEntry* AbstractEntry() { DEBUG_INIT(CF_PRIVATE | CF_HIGH_VOLUME, "Icb"); return (Tag().id() == TAGID_EXTENDED_FILE_ENTRY) -// ? reinterpret_cast(fData.Block()) -// : reinterpret_cast(fData.Block())); +// ? reinterpret_cast(fData.Block()) +// : reinterpret_cast(fData.Block())); ? &fExtendedEntry : &fFileEntry; } - udf_file_icb_entry* FileEntry() { return (reinterpret_cast(fData.Block())); } - udf_extended_file_icb_entry& ExtendedEntry() { return *(reinterpret_cast(fData.Block())); } + file_icb_entry* FileEntry() { return (reinterpret_cast(fData.Block())); } + extended_file_icb_entry& ExtendedEntry() { return *(reinterpret_cast(fData.Block())); } template status_t _Read(DescriptorList &list, off_t pos, void *buffer, size_t *length, uint32 *block); @@ -117,8 +117,8 @@ private: status_t fInitStatus; vnode_id fId; SinglyLinkedList fIteratorList; - FileEntry fFileEntry; - FileEntry fExtendedEntry; + FileEntry fFileEntry; + FileEntry fExtendedEntry; }; /*! \brief Does the dirty work of reading using the given DescriptorList object @@ -147,7 +147,7 @@ Icb::_Read(DescriptorList &list, off_t pos, void *_buffer, size_t *length, uint3 PRINT(("pos: %Ld\n", pos)); PRINT(("bytesLeft: %ld\n", bytesLeft)); - udf_long_address extent; + long_address extent; bool isEmpty = false; error = list.FindExtent(pos, &extent, &isEmpty); if (!error) { diff --git a/src/add-ons/kernel/file_systems/udf/Recognition.cpp b/src/add-ons/kernel/file_systems/udf/Recognition.cpp index a0a4e0283e..8f58c8c8a2 100644 --- a/src/add-ons/kernel/file_systems/udf/Recognition.cpp +++ b/src/add-ons/kernel/file_systems/udf/Recognition.cpp @@ -16,14 +16,14 @@ walk_volume_recognition_sequence(int device, off_t offset, static status_t walk_anchor_volume_descriptor_sequences(int device, off_t offset, off_t length, uint32 blockSize, uint32 blockShift, - udf_logical_descriptor &logicalVolumeDescriptor, - udf_partition_descriptor partitionDescriptors[], + logical_descriptor &logicalVolumeDescriptor, + partition_descriptor partitionDescriptors[], uint8 &partitionDescriptorCount); static status_t -walk_volume_descriptor_sequence(udf_extent_address descriptorSequence, +walk_volume_descriptor_sequence(extent_address descriptorSequence, int device, uint32 blockSize, uint32 blockShift, - udf_logical_descriptor &logicalVolumeDescriptor, - udf_partition_descriptor partitionDescriptors[], + logical_descriptor &logicalVolumeDescriptor, + partition_descriptor partitionDescriptors[], uint8 &partitionDescriptorCount); //------------------------------------------------------------------------------ @@ -32,8 +32,8 @@ walk_volume_descriptor_sequence(udf_extent_address descriptorSequence, status_t Udf::udf_recognize(int device, off_t offset, off_t length, uint32 blockSize, - uint32 &blockShift, udf_logical_descriptor &logicalVolumeDescriptor, - udf_partition_descriptor partitionDescriptors[], + uint32 &blockShift, logical_descriptor &logicalVolumeDescriptor, + partition_descriptor partitionDescriptors[], uint8 &partitionDescriptorCount) { DEBUG_INIT_ETC(CF_PRIVATE, NULL, ("device: %d, offset: %Ld, length: %Ld, " @@ -78,8 +78,8 @@ Udf::udf_recognize(int device, off_t offset, off_t length, uint32 blockSize, DEBUG_INIT_ETC(CF_PRIVATE, NULL, ("device: %d, offset: %Ld, length: %Ld, " "blockSize: %ld, volumeName: %p", device, offset, length, blockSize, volumeName)); - udf_logical_descriptor logicalVolumeDescriptor; - udf_partition_descriptor partitionDescriptors[Udf::kMaxPartitionDescriptors]; + logical_descriptor logicalVolumeDescriptor; + partition_descriptor partitionDescriptors[Udf::kMaxPartitionDescriptors]; uint8 partitionDescriptorCount; uint32 blockShift; status_t error = udf_recognize(device, offset, length, blockSize, blockShift, @@ -118,8 +118,8 @@ walk_volume_recognition_sequence(int device, off_t offset, uint32 blockSize, uin ssize_t bytesRead = read_pos(device, address, chunk.Data(), blockSize); if (bytesRead == (ssize_t)blockSize) { - udf_volume_structure_descriptor_header* descriptor = - reinterpret_cast(chunk.Data()); + volume_structure_descriptor_header* descriptor = + reinterpret_cast(chunk.Data()); if (descriptor->id_matches(kVSDID_ISO)) { SIMPLE_PRINT(("found ISO9660 descriptor\n")); foundISO = true; @@ -166,8 +166,8 @@ static status_t walk_anchor_volume_descriptor_sequences(int device, off_t offset, off_t length, uint32 blockSize, uint32 blockShift, - udf_logical_descriptor &logicalVolumeDescriptor, - udf_partition_descriptor partitionDescriptors[], + logical_descriptor &logicalVolumeDescriptor, + partition_descriptor partitionDescriptors[], uint8 &partitionDescriptorCount) { DEBUG_INIT(CF_PRIVATE, NULL); @@ -183,7 +183,7 @@ walk_anchor_volume_descriptor_sequences(int device, off_t offset, off_t length, off_t block = avds_locations[i]; off_t address = (offset + block) << blockShift; MemoryChunk chunk(blockSize); - udf_anchor_descriptor *anchor = NULL; + anchor_descriptor *anchor = NULL; status_t anchorErr = chunk.InitCheck(); if (!anchorErr) { @@ -195,7 +195,7 @@ walk_anchor_volume_descriptor_sequences(int device, off_t offset, off_t length, } } if (!anchorErr) { - anchor = reinterpret_cast(chunk.Data()); + anchor = reinterpret_cast(chunk.Data()); anchorErr = anchor->tag().init_check(block+offset); if (anchorErr) { PRINT(("block %Ld: invalid anchor\n", block)); @@ -235,10 +235,10 @@ walk_anchor_volume_descriptor_sequences(int device, off_t offset, off_t length, static status_t -walk_volume_descriptor_sequence(udf_extent_address descriptorSequence, +walk_volume_descriptor_sequence(extent_address descriptorSequence, int device, uint32 blockSize, uint32 blockShift, - udf_logical_descriptor &logicalVolumeDescriptor, - udf_partition_descriptor partitionDescriptors[], + logical_descriptor &logicalVolumeDescriptor, + partition_descriptor partitionDescriptors[], uint8 &partitionDescriptorCount) { DEBUG_INIT_ETC(CF_PRIVATE, NULL, ("descriptorSequence.loc:%ld, descriptorSequence.len:%ld", @@ -254,7 +254,7 @@ walk_volume_descriptor_sequence(udf_extent_address descriptorSequence, off_t block = descriptorSequence.location()+i; off_t address = block << blockShift; MemoryChunk chunk(blockSize); - udf_tag *tag = NULL; + descriptor_tag *tag = NULL; PRINT(("descriptor #%ld (block %Ld):\n", i, block)); @@ -268,7 +268,7 @@ walk_volume_descriptor_sequence(udf_extent_address descriptorSequence, } } if (!loopErr) { - tag = reinterpret_cast(chunk.Data()); + tag = reinterpret_cast(chunk.Data()); loopErr = tag->init_check(block); } if (!loopErr) { @@ -279,7 +279,7 @@ walk_volume_descriptor_sequence(udf_extent_address descriptorSequence, case TAGID_PRIMARY_VOLUME_DESCRIPTOR: { - udf_primary_descriptor *primary = reinterpret_cast(tag); + primary_descriptor *primary = reinterpret_cast(tag); PDUMP(primary); (void)primary; // kill the warning break; @@ -293,7 +293,7 @@ walk_volume_descriptor_sequence(udf_extent_address descriptorSequence, case TAGID_IMPLEMENTATION_USE_VOLUME_DESCRIPTOR: { - udf_implementation_use_descriptor *imp_use = reinterpret_cast(tag); + implementation_use_descriptor *imp_use = reinterpret_cast(tag); PDUMP(imp_use); (void)imp_use; // kill the warning break; @@ -301,7 +301,7 @@ walk_volume_descriptor_sequence(udf_extent_address descriptorSequence, case TAGID_PARTITION_DESCRIPTOR: { - udf_partition_descriptor *partition = reinterpret_cast(tag); + partition_descriptor *partition = reinterpret_cast(tag); PDUMP(partition); if (partition->tag().init_check(block) == B_OK) { // Check for a previously discovered partition descriptor with @@ -376,7 +376,7 @@ walk_volume_descriptor_sequence(udf_extent_address descriptorSequence, case TAGID_LOGICAL_VOLUME_DESCRIPTOR: { - udf_logical_descriptor *logical = reinterpret_cast(tag); + logical_descriptor *logical = reinterpret_cast(tag); PDUMP(logical); if (foundLogicalVolumeDescriptor) { // Keep the vd with the highest vds_number @@ -392,7 +392,7 @@ walk_volume_descriptor_sequence(udf_extent_address descriptorSequence, case TAGID_UNALLOCATED_SPACE_DESCRIPTOR: { - udf_unallocated_space_descriptor *unallocated = reinterpret_cast(tag); + unallocated_space_descriptor *unallocated = reinterpret_cast(tag); PDUMP(unallocated); (void)unallocated; // kill the warning break; @@ -400,7 +400,7 @@ walk_volume_descriptor_sequence(udf_extent_address descriptorSequence, case TAGID_TERMINATING_DESCRIPTOR: { - udf_terminating_descriptor *terminating = reinterpret_cast(tag); + terminating_descriptor *terminating = reinterpret_cast(tag); PDUMP(terminating); (void)terminating; // kill the warning break; diff --git a/src/add-ons/kernel/file_systems/udf/Recognition.h b/src/add-ons/kernel/file_systems/udf/Recognition.h index 1d0db34c03..4f8b675b9c 100644 --- a/src/add-ons/kernel/file_systems/udf/Recognition.h +++ b/src/add-ons/kernel/file_systems/udf/Recognition.h @@ -17,8 +17,8 @@ namespace Udf { status_t udf_recognize(int device, off_t offset, off_t length, uint32 blockSize, uint32 &blockShift, - udf_logical_descriptor &logicalVolumeDescriptor, - udf_partition_descriptor partitionDescriptors[], + logical_descriptor &logicalVolumeDescriptor, + partition_descriptor partitionDescriptors[], uint8 &partitionDescriptorCount); status_t udf_recognize(int device, off_t offset, off_t length, uint32 blockSize, char *volumeName); diff --git a/src/add-ons/kernel/file_systems/udf/Utils.cpp b/src/add-ons/kernel/file_systems/udf/Utils.cpp index ce606bf903..e4df9cfee9 100644 --- a/src/add-ons/kernel/file_systems/udf/Utils.cpp +++ b/src/add-ons/kernel/file_systems/udf/Utils.cpp @@ -23,11 +23,11 @@ extern "C" { namespace Udf { -udf_long_address +long_address to_long_address(vnode_id id, uint32 length) { DEBUG_INIT_ETC(CF_PUBLIC | CF_HELPER, NULL, ("vnode_id: %Ld (0x%Lx), length: %ld", id, id, length)); - udf_long_address result; + long_address result; result.set_block((id >> 16) & 0xffffffff); result.set_partition(id & 0xffff); result.set_length(length); @@ -36,7 +36,7 @@ to_long_address(vnode_id id, uint32 length) } vnode_id -to_vnode_id(udf_long_address address) +to_vnode_id(long_address address) { DEBUG_INIT(CF_PUBLIC | CF_HELPER, NULL); vnode_id result = address.block(); @@ -50,7 +50,7 @@ to_vnode_id(udf_long_address address) } time_t -make_time(udf_timestamp ×tamp) +make_time(timestamp ×tamp) { DEBUG_INIT_ETC(CF_HELPER | CF_HIGH_VOLUME, NULL, ("timestamp: (tnt: 0x%x, type: %d, timezone: %d = 0x%x, year: %d, " "month: %d, day: %d, hour: %d, minute: %d, second: %d)", timestamp.type_and_timezone(), diff --git a/src/add-ons/kernel/file_systems/udf/Utils.h b/src/add-ons/kernel/file_systems/udf/Utils.h index 5a4d3e32af..ad4cb52e29 100644 --- a/src/add-ons/kernel/file_systems/udf/Utils.h +++ b/src/add-ons/kernel/file_systems/udf/Utils.h @@ -24,11 +24,11 @@ extern "C" { namespace Udf { -udf_long_address to_long_address(vnode_id id, uint32 length = 0); +long_address to_long_address(vnode_id id, uint32 length = 0); -vnode_id to_vnode_id(udf_long_address address); +vnode_id to_vnode_id(long_address address); -time_t make_time(udf_timestamp ×tamp); +time_t make_time(timestamp ×tamp); } // namespace Udf diff --git a/src/add-ons/kernel/file_systems/udf/Volume.cpp b/src/add-ons/kernel/file_systems/udf/Volume.cpp index ef4b308f4c..c05686737a 100644 --- a/src/add-ons/kernel/file_systems/udf/Volume.cpp +++ b/src/add-ons/kernel/file_systems/udf/Volume.cpp @@ -72,11 +72,13 @@ Volume::Mount(const char *deviceName, off_t offset, off_t length, } } - udf_logical_descriptor logicalVolumeDescriptor; - udf_partition_descriptor partitionDescriptors[Udf::kMaxPartitionDescriptors]; + logical_descriptor logicalVolumeDescriptor; + partition_descriptor partitionDescriptors[Udf::kMaxPartitionDescriptors]; uint8 partitionDescriptorCount; uint32 blockShift; + // Run through the volume recognition and descriptor sequences to + // see if we have a potentially valid UDF volume on our hands error = udf_recognize(device, offset, length, blockSize, blockShift, logicalVolumeDescriptor, partitionDescriptors, partitionDescriptorCount); @@ -98,15 +100,15 @@ Volume::Mount(const char *deviceName, off_t offset, off_t length, && !error; i++) { uint8 *maps = logicalVolumeDescriptor.partition_maps(); - udf_partition_map_header *header = - reinterpret_cast(maps+offset); + partition_map_header *header = + reinterpret_cast(maps+offset); PRINT(("partition map %d (type %d):\n", i, header->type())); if (header->type() == 1) { PRINT(("map type: physical\n")); - udf_physical_partition_map* map = - reinterpret_cast(header); + physical_partition_map* map = + reinterpret_cast(header); // Find the corresponding partition descriptor - udf_partition_descriptor *descriptor = NULL; + partition_descriptor *descriptor = NULL; for (uint8 j = 0; j < partitionDescriptorCount; j++) { if (map->partition_number() == partitionDescriptors[j].partition_number()) @@ -135,27 +137,27 @@ Volume::Mount(const char *deviceName, off_t offset, off_t length, error = B_ERROR; } } else if (header->type() == 2) { - // Figure out what kind of partition map we have based + // Figure out what kind of type 2 partition map we have based // on the type identifier - const udf_entity_id &typeId = header->partition_type_id(); + const entity_id &typeId = header->partition_type_id(); DUMP(typeId); DUMP(kSparablePartitionMapId); if (typeId.matches(kVirtualPartitionMapId)) { PRINT(("map type: virtual\n")); - udf_virtual_partition_map* map = - reinterpret_cast(header); + virtual_partition_map* map = + reinterpret_cast(header); virtualCount++; (void)map; // kill the warning for now } else if (typeId.matches(kSparablePartitionMapId)) { PRINT(("map type: sparable\n")); - udf_sparable_partition_map* map = - reinterpret_cast(header); + sparable_partition_map* map = + reinterpret_cast(header); sparableCount++; (void)map; // kill the warning for now } else if (typeId.matches(kMetadataPartitionMapId)) { PRINT(("map type: metadata\n")); - udf_metadata_partition_map* map = - reinterpret_cast(header); + metadata_partition_map* map = + reinterpret_cast(header); metadataCount++; (void)map; // kill the warning for now } else { @@ -224,8 +226,8 @@ Volume::Mount(const char *deviceName, off_t offset, off_t length, } // See if it's valid, and if so, create the root icb if (!error) { - udf_file_set_descriptor *fileSet = - reinterpret_cast(chunk.Data()); + file_set_descriptor *fileSet = + reinterpret_cast(chunk.Data()); fileSet->tag().init_check(0); PDUMP(fileSet); fRootIcb = new Icb(this, fileSet->root_directory_icb()); @@ -267,10 +269,11 @@ Volume::Name() const { /*! \brief Maps the given logical block to a physical block. */ status_t -Volume::MapBlock(udf_long_address address, off_t *mappedBlock) +Volume::MapBlock(long_address address, off_t *mappedBlock) { - DEBUG_INIT_ETC(CF_PRIVATE | CF_HIGH_VOLUME, "Volume", ("long_address(block: %ld, partition: %d), %p", - address.block(), address.partition(), mappedBlock)); + DEBUG_INIT_ETC(CF_PRIVATE | CF_HIGH_VOLUME, "Volume", + ("partition: %d, block: %ld, mappedBlock: %p", + address.partition(), address.block(), mappedBlock)); status_t error = mappedBlock ? B_OK : B_BAD_VALUE; if (!error) { Partition *partition = _GetPartition(address.partition()); diff --git a/src/add-ons/kernel/file_systems/udf/Volume.h b/src/add-ons/kernel/file_systems/udf/Volume.h index 0cabf50a4e..f58bb0b2ba 100644 --- a/src/add-ons/kernel/file_systems/udf/Volume.h +++ b/src/add-ons/kernel/file_systems/udf/Volume.h @@ -44,8 +44,8 @@ public: status_t Unmount(); // Address mapping - status_t MapBlock(udf_long_address address, off_t *mappedBlock); - status_t MapExtent(udf_long_address logicalExtent, udf_extent_address &physicalExtent); + status_t MapBlock(long_address address, off_t *mappedBlock); + status_t MapExtent(long_address logicalExtent, extent_address &physicalExtent); // Miscellaneous info const char *Name() const; @@ -77,7 +77,7 @@ private: uint32 fBlockSize; uint32 fBlockShift; Partition *fPartitions[UDF_MAX_PARTITION_MAPS]; - Icb *fRootIcb; // Destroyed by vfs via callback to udf_release_node() + Icb *fRootIcb; // Destroyed by vfs via callback to release_node() CS0String fName; }; diff --git a/src/add-ons/kernel/file_systems/udf/udf.cpp b/src/add-ons/kernel/file_systems/udf/udf.cpp index 314cc07259..e9e1d81463 100644 --- a/src/add-ons/kernel/file_systems/udf/udf.cpp +++ b/src/add-ons/kernel/file_systems/udf/udf.cpp @@ -487,7 +487,8 @@ udf_walk(void *ns, void *_dir, const char *filename, char **resolvedPath, vnode_ int udf_ioctl(void *ns, void *node, void *cookie, int cmd, void *buffer, size_t bufferLength) { - DEBUG_INIT(CF_ENTRY | CF_VOLUME_OPS, NULL); + DEBUG_INIT_ETC(CF_ENTRY | CF_VOLUME_OPS, NULL, ("node: %p, cmd: 0x%x, " + "buf: %p, len: %ld\n", node, cmd, buffer, bufferLength)); // FUNCTION_START(("node: %p, cmd: %d, buf: %p, len: %ld\n", node, cmd, buffer, bufferLength)); RETURN(B_ERROR); }