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

110 lines
4.1 KiB
C#
Raw Normal View History

2017-05-19 20:28:49 +01:00
// /***************************************************************************
2020-02-27 12:31:25 +00:00
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// 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/>.
//
// ----------------------------------------------------------------------------
2020-01-03 17:51:30 +00:00
// Copyright © 2011-2020 Natalia Portillo
// ****************************************************************************/
using System.Runtime.InteropServices;
2020-02-27 00:33:26 +00:00
namespace Aaru.Filesystems.AppleDOS
{
public partial class AppleDOS
{
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct Vtoc
{
public byte unused1;
public byte catalogTrack;
public byte catalogSector;
public byte dosRelease;
2018-06-22 08:08:38 +01:00
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
public byte[] unused2;
public byte volumeNumber;
2018-06-22 08:08:38 +01:00
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public byte[] unused3;
public byte maxTrackSectorPairsPerSector;
2018-06-22 08:08:38 +01:00
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public byte[] unused4;
public byte lastAllocatedSector;
public sbyte allocationDirection;
2018-06-22 08:08:38 +01:00
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
public byte[] unused5;
public byte tracks;
public byte sectorsPerTrack;
public ushort bytesPerSector;
2018-06-22 08:08:38 +01: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;
2018-06-22 08:08:38 +01: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;
2018-06-22 08:08:38 +01: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;
2018-06-22 08:08:38 +01:00
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
public byte[] unused2;
public ushort sectorOffset;
2018-06-22 08:08:38 +01: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
}