[Aaru.Filesystems] Reformat and cleanup.

This commit is contained in:
2023-10-03 23:22:08 +01:00
parent 51f35c80d9
commit 7a608e0061
296 changed files with 21000 additions and 18286 deletions

View File

@@ -33,6 +33,8 @@ namespace Aaru.Filesystems;
public sealed partial class ISO9660
{
#region Nested type: AmigaEntry
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct AmigaEntry
{
@@ -45,6 +47,10 @@ public sealed partial class ISO9660
// Followed by length-prefixed string for comment if present
}
#endregion
#region Nested type: AmigaProtection
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct AmigaProtection
{
@@ -53,4 +59,6 @@ public sealed partial class ISO9660
public readonly AmigaMultiuser Multiuser;
public readonly AmigaAttributes Protection;
}
#endregion
}

View File

@@ -33,48 +33,7 @@ namespace Aaru.Filesystems;
public sealed partial class ISO9660
{
// Little-endian
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct AppleProDOSSystemUse
{
public readonly ushort signature;
public readonly byte length;
public readonly AppleId id;
public readonly byte type;
public readonly ushort aux_type;
}
// Big-endian
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct AppleHFSSystemUse
{
public readonly ushort signature;
public readonly byte length;
public readonly AppleId id;
public readonly uint type;
public readonly uint creator;
public readonly AppleCommon.FinderFlags finder_flags;
}
// Little-endian
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct AppleProDOSOldSystemUse
{
public readonly ushort signature;
public readonly AppleOldId id;
public readonly byte type;
public readonly ushort aux_type;
}
// Big-endian
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct AppleHFSTypeCreatorSystemUse
{
public readonly ushort signature;
public readonly AppleOldId id;
public readonly uint type;
public readonly uint creator;
}
#region Nested type: AppleHFSIconSystemUse
// Big-endian
[StructLayout(LayoutKind.Sequential, Pack = 1)]
@@ -88,6 +47,10 @@ public sealed partial class ISO9660
public readonly byte[] icon;
}
#endregion
#region Nested type: AppleHFSOldSystemUse
// Big-endian
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct AppleHFSOldSystemUse
@@ -98,4 +61,65 @@ public sealed partial class ISO9660
public readonly uint creator;
public readonly ushort finder_flags;
}
#endregion
#region Nested type: AppleHFSSystemUse
// Big-endian
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct AppleHFSSystemUse
{
public readonly ushort signature;
public readonly byte length;
public readonly AppleId id;
public readonly uint type;
public readonly uint creator;
public readonly AppleCommon.FinderFlags finder_flags;
}
#endregion
#region Nested type: AppleHFSTypeCreatorSystemUse
// Big-endian
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct AppleHFSTypeCreatorSystemUse
{
public readonly ushort signature;
public readonly AppleOldId id;
public readonly uint type;
public readonly uint creator;
}
#endregion
#region Nested type: AppleProDOSOldSystemUse
// Little-endian
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct AppleProDOSOldSystemUse
{
public readonly ushort signature;
public readonly AppleOldId id;
public readonly byte type;
public readonly ushort aux_type;
}
#endregion
#region Nested type: AppleProDOSSystemUse
// Little-endian
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct AppleProDOSSystemUse
{
public readonly ushort signature;
public readonly byte length;
public readonly AppleId id;
public readonly byte type;
public readonly ushort aux_type;
}
#endregion
}

View File

@@ -90,6 +90,48 @@ public sealed partial class ISO9660
return decodedVd;
}
#region Nested type: CdiDirectoryRecord
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct CdiDirectoryRecord
{
public readonly byte length;
public readonly byte xattr_len;
public readonly uint reserved1;
public readonly uint start_lbn;
public readonly uint reserved2;
public readonly uint size;
public readonly HighSierraTimestamp date;
public readonly byte reserved3;
public readonly CdiFileFlags flags;
public readonly ushort file_unit_size;
public readonly ushort reserved4;
public readonly ushort volume_sequence_number;
public readonly byte name_len;
// Followed by name[name_len] and then CdiSystemArea until length arrives
}
#endregion
#region Nested type: CdiSystemArea
// Follows filename on directory record
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct CdiSystemArea
{
public readonly ushort group;
public readonly ushort owner;
public readonly CdiAttributes attributes;
public readonly ushort reserved1;
public readonly byte file_no;
public readonly byte reserved2;
}
#endregion
#region Nested type: FileStructureVolumeDescriptor
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct FileStructureVolumeDescriptor
{
@@ -161,35 +203,5 @@ public sealed partial class ISO9660
public readonly byte[] reserved16;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct CdiDirectoryRecord
{
public readonly byte length;
public readonly byte xattr_len;
public readonly uint reserved1;
public readonly uint start_lbn;
public readonly uint reserved2;
public readonly uint size;
public readonly HighSierraTimestamp date;
public readonly byte reserved3;
public readonly CdiFileFlags flags;
public readonly ushort file_unit_size;
public readonly ushort reserved4;
public readonly ushort volume_sequence_number;
public readonly byte name_len;
// Followed by name[name_len] and then CdiSystemArea until length arrives
}
// Follows filename on directory record
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct CdiSystemArea
{
public readonly ushort group;
public readonly ushort owner;
public readonly CdiAttributes attributes;
public readonly ushort reserved1;
public readonly byte file_no;
public readonly byte reserved2;
}
#endregion
}

View File

@@ -33,6 +33,8 @@ namespace Aaru.Filesystems;
public sealed partial class ISO9660
{
#region Nested type: ElToritoBootRecord
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct ElToritoBootRecord
{
@@ -49,17 +51,9 @@ public sealed partial class ISO9660
public readonly byte[] boot_use;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct ElToritoValidationEntry
{
public readonly ElToritoIndicator header_id;
public readonly ElToritoPlatform platform_id;
public readonly ushort reserved;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 24)]
public readonly byte[] developer_id;
public readonly ushort checksum;
public readonly ushort signature;
}
#endregion
#region Nested type: ElToritoInitialEntry
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct ElToritoInitialEntry
@@ -75,15 +69,9 @@ public sealed partial class ISO9660
public readonly byte[] reserved2;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct ElToritoSectionHeaderEntry
{
public readonly ElToritoIndicator header_id;
public readonly ElToritoPlatform platform_id;
public readonly ushort entries;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 28)]
public readonly byte[] identifier;
}
#endregion
#region Nested type: ElToritoSectionEntry
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct ElToritoSectionEntry
@@ -100,6 +88,10 @@ public sealed partial class ISO9660
public readonly byte[] selection_criterias;
}
#endregion
#region Nested type: ElToritoSectionEntryExtension
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct ElToritoSectionEntryExtension
{
@@ -108,4 +100,36 @@ public sealed partial class ISO9660
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 30)]
public readonly byte[] selection_criterias;
}
#endregion
#region Nested type: ElToritoSectionHeaderEntry
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct ElToritoSectionHeaderEntry
{
public readonly ElToritoIndicator header_id;
public readonly ElToritoPlatform platform_id;
public readonly ushort entries;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 28)]
public readonly byte[] identifier;
}
#endregion
#region Nested type: ElToritoValidationEntry
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct ElToritoValidationEntry
{
public readonly ElToritoIndicator header_id;
public readonly ElToritoPlatform platform_id;
public readonly ushort reserved;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 24)]
public readonly byte[] developer_id;
public readonly ushort checksum;
public readonly ushort signature;
}
#endregion
}

View File

@@ -87,6 +87,49 @@ public sealed partial class ISO9660
return decodedVd;
}
#region Nested type: HighSierraDirectoryRecord
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct HighSierraDirectoryRecord
{
public readonly byte length;
public readonly byte xattr_len;
public readonly uint extent;
public readonly uint extent_be;
public readonly uint size;
public readonly uint size_be;
public readonly HighSierraTimestamp date;
public readonly FileFlags flags;
public readonly byte reserved;
public readonly byte interleave_size;
public readonly byte interleave;
public readonly ushort volume_sequence_number;
public readonly ushort volume_sequence_number_be;
public readonly byte name_len;
// Followed by name[name_len] and then system area until length arrives
}
#endregion
#region Nested type: HighSierraPathTableEntry
// There are two tables one in little endian one in big endian
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct HighSierraPathTableEntry
{
public readonly uint start_lbn;
public readonly byte xattr_len;
public readonly byte name_len;
public readonly ushort parent_dirno;
// Followed by name[name_len]
}
#endregion
#region Nested type: HighSierraPrimaryVolumeDescriptor
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct HighSierraPrimaryVolumeDescriptor
{
@@ -154,26 +197,9 @@ public sealed partial class ISO9660
public readonly byte[] reserved3;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct HighSierraDirectoryRecord
{
public readonly byte length;
public readonly byte xattr_len;
public readonly uint extent;
public readonly uint extent_be;
public readonly uint size;
public readonly uint size_be;
public readonly HighSierraTimestamp date;
public readonly FileFlags flags;
public readonly byte reserved;
public readonly byte interleave_size;
public readonly byte interleave;
public readonly ushort volume_sequence_number;
public readonly ushort volume_sequence_number_be;
public readonly byte name_len;
#endregion
// Followed by name[name_len] and then system area until length arrives
}
#region Nested type: HighSierraTimestamp
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct HighSierraTimestamp
@@ -186,15 +212,5 @@ public sealed partial class ISO9660
public readonly byte Second;
}
// There are two tables one in little endian one in big endian
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct HighSierraPathTableEntry
{
public readonly uint start_lbn;
public readonly byte xattr_len;
public readonly byte name_len;
public readonly ushort parent_dirno;
// Followed by name[name_len]
}
#endregion
}

View File

@@ -44,11 +44,11 @@ public sealed partial class ISO9660
var decodedVd = new DecodedVolumeDescriptor
{
SystemIdentifier = StringHandlers.CToString(pvd.system_id, encoding).TrimEnd(),
VolumeIdentifier = StringHandlers.CToString(pvd.volume_id, encoding).TrimEnd(),
VolumeSetIdentifier = StringHandlers.CToString(pvd.volume_set_id, encoding).TrimEnd(),
PublisherIdentifier = StringHandlers.CToString(pvd.publisher_id, encoding).TrimEnd(),
DataPreparerIdentifier = StringHandlers.CToString(pvd.preparer_id, encoding).TrimEnd(),
SystemIdentifier = StringHandlers.CToString(pvd.system_id, encoding).TrimEnd(),
VolumeIdentifier = StringHandlers.CToString(pvd.volume_id, encoding).TrimEnd(),
VolumeSetIdentifier = StringHandlers.CToString(pvd.volume_set_id, encoding).TrimEnd(),
PublisherIdentifier = StringHandlers.CToString(pvd.publisher_id, encoding).TrimEnd(),
DataPreparerIdentifier = StringHandlers.CToString(pvd.preparer_id, encoding).TrimEnd(),
ApplicationIdentifier = StringHandlers.CToString(pvd.application_id, encoding).TrimEnd()
};
@@ -91,6 +91,143 @@ public sealed partial class ISO9660
return decodedVd;
}
#region Nested type: BootRecord
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct BootRecord
{
public readonly byte type;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
public readonly byte[] id;
public readonly byte version;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public readonly byte[] system_id;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public readonly byte[] boot_id;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1977)]
public readonly byte[] boot_use;
}
#endregion
#region Nested type: DirectoryRecord
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct DirectoryRecord
{
public readonly byte length;
public readonly byte xattr_len;
public readonly uint extent;
public readonly uint extent_be;
public readonly uint size;
public readonly uint size_be;
public readonly IsoTimestamp date;
public readonly FileFlags flags;
public readonly byte file_unit_size;
public readonly byte interleave;
public readonly ushort volume_sequence_number;
public readonly ushort volume_sequence_number_be;
public readonly byte name_len;
// Followed by name[name_len] and then system area until length arrives
}
#endregion
#region Nested type: ExtendedAttributeRecord
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct ExtendedAttributeRecord
{
public readonly ushort owner;
public readonly ushort owner_be;
public readonly ushort group;
public readonly ushort group_be;
public readonly Permissions permissions;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 17)]
public readonly byte[] creation_date;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 17)]
public readonly byte[] modification_date;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 17)]
public readonly byte[] expiration_date;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 17)]
public readonly byte[] effective_date;
public readonly RecordFormat record_format;
public readonly RecordAttribute record_attributes;
public readonly ushort record_length;
public readonly ushort record_length_be;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public readonly byte[] system_id;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public readonly byte[] system_use;
public readonly byte record_version;
public readonly byte escape_len;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public readonly byte[] reserved1;
public readonly ushort app_use_len;
public readonly ushort app_use_len_be;
}
#endregion
#region Nested type: IsoTimestamp
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct IsoTimestamp
{
public readonly byte Years;
public readonly byte Month;
public readonly byte Day;
public readonly byte Hour;
public readonly byte Minute;
public readonly byte Second;
public readonly sbyte GmtOffset;
}
#endregion
#region Nested type: PartitionDescriptor
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct PartitionDescriptor
{
public readonly byte type;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
public readonly byte[] id;
public readonly byte version;
public readonly byte reserved1;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public readonly byte[] system_id;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public readonly byte[] partition_id;
public readonly uint partition_location;
public readonly uint partition_location_be;
public readonly uint partition_size;
public readonly uint partition_size_be;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1960)]
public readonly byte[] system_use;
}
#endregion
#region Nested type: PathTableEntry
// There are two tables one in little endian one in big endian
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct PathTableEntry
{
public readonly byte name_len;
public readonly byte xattr_len;
public readonly uint start_lbn;
public readonly ushort parent_dirno;
// Followed by name[name_len]
}
#endregion
#region Nested type: PrimaryVolumeDescriptor
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct PrimaryVolumeDescriptor
{
@@ -156,114 +293,5 @@ public sealed partial class ISO9660
public readonly byte[] reserved3;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct BootRecord
{
public readonly byte type;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
public readonly byte[] id;
public readonly byte version;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public readonly byte[] system_id;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public readonly byte[] boot_id;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1977)]
public readonly byte[] boot_use;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct PartitionDescriptor
{
public readonly byte type;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
public readonly byte[] id;
public readonly byte version;
public readonly byte reserved1;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public readonly byte[] system_id;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public readonly byte[] partition_id;
public readonly uint partition_location;
public readonly uint partition_location_be;
public readonly uint partition_size;
public readonly uint partition_size_be;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1960)]
public readonly byte[] system_use;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct DirectoryRecord
{
public readonly byte length;
public readonly byte xattr_len;
public readonly uint extent;
public readonly uint extent_be;
public readonly uint size;
public readonly uint size_be;
public readonly IsoTimestamp date;
public readonly FileFlags flags;
public readonly byte file_unit_size;
public readonly byte interleave;
public readonly ushort volume_sequence_number;
public readonly ushort volume_sequence_number_be;
public readonly byte name_len;
// Followed by name[name_len] and then system area until length arrives
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct ExtendedAttributeRecord
{
public readonly ushort owner;
public readonly ushort owner_be;
public readonly ushort group;
public readonly ushort group_be;
public readonly Permissions permissions;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 17)]
public readonly byte[] creation_date;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 17)]
public readonly byte[] modification_date;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 17)]
public readonly byte[] expiration_date;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 17)]
public readonly byte[] effective_date;
public readonly RecordFormat record_format;
public readonly RecordAttribute record_attributes;
public readonly ushort record_length;
public readonly ushort record_length_be;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public readonly byte[] system_id;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public readonly byte[] system_use;
public readonly byte record_version;
public readonly byte escape_len;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public readonly byte[] reserved1;
public readonly ushort app_use_len;
public readonly ushort app_use_len_be;
}
// There are two tables one in little endian one in big endian
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct PathTableEntry
{
public readonly byte name_len;
public readonly byte xattr_len;
public readonly uint start_lbn;
public readonly ushort parent_dirno;
// Followed by name[name_len]
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct IsoTimestamp
{
public readonly byte Years;
public readonly byte Month;
public readonly byte Day;
public readonly byte Hour;
public readonly byte Minute;
public readonly byte Second;
public readonly sbyte GmtOffset;
}
#endregion
}

View File

@@ -35,24 +35,7 @@ namespace Aaru.Filesystems;
public sealed partial class ISO9660
{
struct DecodedVolumeDescriptor
{
public string SystemIdentifier;
public string VolumeIdentifier;
public string VolumeSetIdentifier;
public string PublisherIdentifier;
public string DataPreparerIdentifier;
public string ApplicationIdentifier;
public DateTime CreationTime;
public bool HasModificationTime;
public DateTime ModificationTime;
public bool HasExpirationTime;
public DateTime ExpirationTime;
public bool HasEffectiveTime;
public DateTime EffectiveTime;
public ushort BlockSize;
public uint Blocks;
}
#region Nested type: DecodedDirectoryEntry
sealed class DecodedDirectoryEntry
{
@@ -94,6 +77,72 @@ public sealed partial class ISO9660
public override string ToString() => Filename;
}
#endregion
#region Nested type: DecodedVolumeDescriptor
struct DecodedVolumeDescriptor
{
public string SystemIdentifier;
public string VolumeIdentifier;
public string VolumeSetIdentifier;
public string PublisherIdentifier;
public string DataPreparerIdentifier;
public string ApplicationIdentifier;
public DateTime CreationTime;
public bool HasModificationTime;
public DateTime ModificationTime;
public bool HasExpirationTime;
public DateTime ExpirationTime;
public bool HasEffectiveTime;
public DateTime EffectiveTime;
public ushort BlockSize;
public uint Blocks;
}
#endregion
#region Nested type: Iso9660DirNode
sealed class Iso9660DirNode : IDirNode
{
internal DecodedDirectoryEntry[] _entries;
internal int _position;
#region IDirNode Members
/// <inheritdoc />
public string Path { get; init; }
#endregion
}
#endregion
#region Nested type: Iso9660FileNode
sealed class Iso9660FileNode : IFileNode
{
internal DecodedDirectoryEntry _dentry;
#region IFileNode Members
/// <inheritdoc />
public string Path { get; init; }
/// <inheritdoc />
public long Length { get; init; }
/// <inheritdoc />
public long Offset { get; set; }
#endregion
}
#endregion
#region Nested type: PathTableEntryInternal
sealed class PathTableEntryInternal
{
public uint Extent;
@@ -104,22 +153,5 @@ public sealed partial class ISO9660
public override string ToString() => Name;
}
sealed class Iso9660FileNode : IFileNode
{
internal DecodedDirectoryEntry _dentry;
/// <inheritdoc />
public string Path { get; init; }
/// <inheritdoc />
public long Length { get; init; }
/// <inheritdoc />
public long Offset { get; set; }
}
sealed class Iso9660DirNode : IDirNode
{
internal DecodedDirectoryEntry[] _entries;
internal int _position;
/// <inheritdoc />
public string Path { get; init; }
}
#endregion
}

View File

@@ -35,23 +35,51 @@ namespace Aaru.Filesystems;
[SuppressMessage("ReSharper", "UnusedType.Local")]
public sealed partial class ISO9660
{
// RRIP 1.10
#region Nested type: AlternateName
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct PosixAttributesOld
readonly struct AlternateName
{
public readonly ushort signature;
public readonly byte length;
public readonly byte version;
public readonly PosixMode st_mode;
public readonly PosixMode st_mode_be;
public readonly uint st_nlink;
public readonly uint st_nlink_be;
public readonly uint st_uid;
public readonly uint st_uid_be;
public readonly uint st_gid;
public readonly uint st_gid_be;
public readonly ushort signature;
public readonly byte length;
public readonly byte version;
public readonly AlternateNameFlags flags;
// Folowed by name, can be divided in pieces
}
#endregion
#region Nested type: ChildLink
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct ChildLink
{
public readonly ushort signature;
public readonly byte length;
public readonly byte version;
public readonly uint child_dir_lba;
public readonly uint child_dir_lba_be;
}
#endregion
#region Nested type: ParentLink
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct ParentLink
{
public readonly ushort signature;
public readonly byte length;
public readonly byte version;
public readonly uint parent_dir_lba;
public readonly uint parent_dir_lba_be;
}
#endregion
#region Nested type: PosixAttributes
// RRIP 1.12
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct PosixAttributes
@@ -71,6 +99,31 @@ public sealed partial class ISO9660
public readonly uint st_ino_be;
}
#endregion
#region Nested type: PosixAttributesOld
// RRIP 1.10
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct PosixAttributesOld
{
public readonly ushort signature;
public readonly byte length;
public readonly byte version;
public readonly PosixMode st_mode;
public readonly PosixMode st_mode_be;
public readonly uint st_nlink;
public readonly uint st_nlink_be;
public readonly uint st_uid;
public readonly uint st_uid_be;
public readonly uint st_gid;
public readonly uint st_gid_be;
}
#endregion
#region Nested type: PosixDeviceNumber
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct PosixDeviceNumber
{
@@ -83,6 +136,39 @@ public sealed partial class ISO9660
public readonly uint dev_t_low_be;
}
#endregion
#region Nested type: RelocatedDirectory
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct RelocatedDirectory
{
public readonly ushort signature;
public readonly byte length;
public readonly byte version;
}
#endregion
#region Nested type: SparseFile
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct SparseFile
{
public readonly ushort signature;
public readonly byte length;
public readonly byte version;
public readonly uint virtual_size_high;
public readonly uint virtual_size_high_be;
public readonly uint virtual_size_low;
public readonly uint virtual_size_low_be;
public readonly byte table_depth;
}
#endregion
#region Nested type: SymbolicLink
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct SymbolicLink
{
@@ -94,6 +180,10 @@ public sealed partial class ISO9660
// Followed by SymbolicLinkComponent (link to /bar/foo uses at least two of these structs)
}
#endregion
#region Nested type: SymbolicLinkComponent
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct SymbolicLinkComponent
{
@@ -103,44 +193,9 @@ public sealed partial class ISO9660
// Followed by component content
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct AlternateName
{
public readonly ushort signature;
public readonly byte length;
public readonly byte version;
public readonly AlternateNameFlags flags;
#endregion
// Folowed by name, can be divided in pieces
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct ChildLink
{
public readonly ushort signature;
public readonly byte length;
public readonly byte version;
public readonly uint child_dir_lba;
public readonly uint child_dir_lba_be;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct ParentLink
{
public readonly ushort signature;
public readonly byte length;
public readonly byte version;
public readonly uint parent_dir_lba;
public readonly uint parent_dir_lba_be;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct RelocatedDirectory
{
public readonly ushort signature;
public readonly byte length;
public readonly byte version;
}
#region Nested type: Timestamps
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct Timestamps
@@ -160,16 +215,5 @@ public sealed partial class ISO9660
// Followed by effective time if present
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct SparseFile
{
public readonly ushort signature;
public readonly byte length;
public readonly byte version;
public readonly uint virtual_size_high;
public readonly uint virtual_size_high_be;
public readonly uint virtual_size_low;
public readonly uint virtual_size_low_be;
public readonly byte table_depth;
}
#endregion
}

View File

@@ -35,6 +35,8 @@ namespace Aaru.Filesystems;
public sealed partial class ISO9660
{
#region Nested type: ContinuationArea
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct ContinuationArea
{
@@ -49,13 +51,9 @@ public sealed partial class ISO9660
public readonly uint ca_length_be;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct PaddingArea
{
public readonly ushort signature;
public readonly byte length;
public readonly byte version;
}
#endregion
#region Nested type: IndicatorArea
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct IndicatorArea
@@ -67,14 +65,22 @@ public sealed partial class ISO9660
public readonly byte skipped;
}
#endregion
#region Nested type: PaddingArea
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct TerminatorArea
readonly struct PaddingArea
{
public readonly ushort signature;
public readonly byte length;
public readonly byte version;
}
#endregion
#region Nested type: ReferenceArea
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct ReferenceArea
{
@@ -91,6 +97,10 @@ public sealed partial class ISO9660
// Follows extension source for src_len bytes
}
#endregion
#region Nested type: SelectorArea
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct SelectorArea
{
@@ -99,4 +109,18 @@ public sealed partial class ISO9660
public readonly byte version;
public readonly byte sequence;
}
#endregion
#region Nested type: TerminatorArea
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct TerminatorArea
{
public readonly ushort signature;
public readonly byte length;
public readonly byte version;
}
#endregion
}

View File

@@ -37,6 +37,8 @@ namespace Aaru.Filesystems;
public sealed partial class ISO9660
{
#region Nested type: CdromXa
// Big-endian
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct CdromXa
@@ -49,4 +51,6 @@ public sealed partial class ISO9660
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
public readonly byte[] reserved;
}
#endregion
}

View File

@@ -35,15 +35,7 @@ namespace Aaru.Filesystems;
[SuppressMessage("ReSharper", "UnusedType.Local")]
public sealed partial class ISO9660
{
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct ZisofsHeader
{
public readonly ulong magic;
public readonly uint uncomp_len;
public readonly uint uncomp_len_be;
public readonly byte header_size; // Shifted >> 2
public readonly byte block_size_log; // log2(block_size)
}
#region Nested type: ZisofsEntry
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct ZisofsEntry
@@ -57,4 +49,20 @@ public sealed partial class ISO9660
public readonly uint uncomp_len;
public readonly uint uncomp_len_be;
}
#endregion
#region Nested type: ZisofsHeader
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct ZisofsHeader
{
public readonly ulong magic;
public readonly uint uncomp_len;
public readonly uint uncomp_len_be;
public readonly byte header_size; // Shifted >> 2
public readonly byte block_size_log; // log2(block_size)
}
#endregion
}