Files
Aaru/DiscImageChef.Filesystems/AppleDOS/Structs.cs

99 lines
3.9 KiB
C#
Raw Normal View History

2017-05-19 20:28:49 +01:00
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : Structs.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : Apple DOS filesystem plugin.
//
// --[ Description ] ----------------------------------------------------------
//
// Apple DOS filesystem structures.
//
// --[ License ] --------------------------------------------------------------
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Runtime.InteropServices;
namespace DiscImageChef.Filesystems.AppleDOS
{
2017-07-01 03:26:08 +01:00
public partial class AppleDOS : Filesystem
{
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct Vtoc
{
public byte unused1;
public byte catalogTrack;
public byte catalogSector;
public byte dosRelease;
2017-12-19 20:33:03 +00:00
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] public byte[] unused2;
public byte volumeNumber;
2017-12-19 20:33:03 +00:00
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] public byte[] unused3;
public byte maxTrackSectorPairsPerSector;
2017-12-19 20:33:03 +00:00
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] public byte[] unused4;
public byte lastAllocatedSector;
public sbyte allocationDirection;
2017-12-19 20:33:03 +00:00
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] public byte[] unused5;
public byte tracks;
public byte sectorsPerTrack;
public ushort bytesPerSector;
2017-12-19 20:33:03 +00:00
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 200)] public byte[] bitmap;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct CatalogSector
{
public byte unused1;
public byte trackOfNext;
public byte sectorOfNext;
2017-12-19 20:33:03 +00:00
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] public byte[] unused2;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 7)] public FileEntry[] entries;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct FileEntry
{
public byte extentTrack;
public byte extentSector;
public byte typeAndFlags;
2017-12-19 20:33:03 +00:00
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 30)] public byte[] filename;
public ushort length;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct TrackSectorList
{
public byte unused1;
public byte nextListTrack;
public byte nextListSector;
2017-12-19 20:33:03 +00:00
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] public byte[] unused2;
public ushort sectorOffset;
2017-12-19 20:33:03 +00:00
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] public byte[] unused3;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 122)] public TrackSectorListEntry[] entries;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct TrackSectorListEntry
{
public byte track;
public byte sector;
}
}
2017-12-19 20:33:03 +00:00
}