Files
libaaruformat/include/aaruformat/context.h

98 lines
3.6 KiB
C
Raw Normal View History

2022-05-28 12:57:21 +01:00
/*
* This file is part of the Aaru Data Preservation Suite.
* Copyright (c) 2019-2022 Natalia Portillo.
*
* 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-03-01 19:53:05 +00:00
#ifndef LIBAARUFORMAT_CONTEXT_H
#define LIBAARUFORMAT_CONTEXT_H
2022-10-02 16:05:25 +01:00
#include "lru.h"
2022-05-28 12:10:04 +01:00
#include "structs.h"
2020-03-01 19:51:13 +00:00
typedef struct aaruformatContext
{
2019-03-31 20:52:06 +01:00
uint64_t magic;
uint8_t libraryMajorVersion;
uint8_t libraryMinorVersion;
2019-08-03 01:58:19 +01:00
FILE* imageStream;
2020-03-01 19:55:22 +00:00
AaruHeader header;
2019-08-03 01:58:19 +01:00
struct dataLinkedList* mediaTagsHead;
struct dataLinkedList* mediaTagsTail;
uint8_t* sectorPrefix;
uint8_t* sectorPrefixCorrected;
uint8_t* sectorSuffix;
uint8_t* sectorSuffixCorrected;
uint8_t* sectorSubchannel;
uint8_t* mode2Subheaders;
2019-03-31 20:52:06 +01:00
uint8_t shift;
bool inMemoryDdt;
2019-08-03 01:58:19 +01:00
uint64_t* userDataDdt;
2019-03-31 20:52:06 +01:00
size_t mappedMemoryDdtSize;
2019-08-03 01:58:19 +01:00
uint32_t* sectorPrefixDdt;
uint32_t* sectorSuffixDdt;
2019-03-31 20:52:06 +01:00
GeometryBlockHeader geometryBlock;
MetadataBlockHeader metadataBlockHeader;
2019-08-03 01:58:19 +01:00
uint8_t* metadataBlock;
2019-03-31 20:52:06 +01:00
TracksHeader tracksHeader;
2019-08-03 01:58:19 +01:00
TrackEntry* trackEntries;
2019-03-31 20:52:06 +01:00
CicmMetadataBlock cicmBlockHeader;
2019-08-03 01:58:19 +01:00
uint8_t* cicmBlock;
2019-03-31 20:52:06 +01:00
DumpHardwareHeader dumpHardwareHeader;
2019-08-03 01:58:19 +01:00
struct DumpHardwareEntriesWithData* dumpHardwareEntriesWithData;
2019-03-31 20:52:06 +01:00
struct ImageInfo imageInfo;
2019-08-03 01:58:19 +01:00
CdEccContext* eccCdContext;
2019-03-31 20:52:06 +01:00
uint8_t numberOfDataTracks;
2019-08-03 01:58:19 +01:00
TrackEntry* dataTracks;
bool* readableSectorTags;
2022-10-02 16:05:25 +01:00
struct CacheHeader blockHeaderCache;
struct CacheHeader blockCache;
2020-03-01 19:51:13 +00:00
} aaruformatContext;
2019-03-17 21:14:40 +00:00
typedef struct dataLinkedList
{
2019-08-03 01:58:19 +01:00
struct dataLinkedList* previous;
struct dataLinkedList* next;
uint8_t* data;
2019-03-31 20:52:06 +01:00
int32_t type;
uint32_t length;
2019-03-17 21:14:40 +00:00
} dataLinkedList;
2019-03-20 00:23:30 +00:00
typedef struct DumpHardwareEntriesWithData
{
2019-03-31 20:52:06 +01:00
DumpHardwareEntry entry;
2019-08-03 01:58:19 +01:00
struct DumpExtent* extents;
uint8_t* manufacturer;
uint8_t* model;
uint8_t* revision;
uint8_t* firmware;
uint8_t* serial;
uint8_t* softwareName;
uint8_t* softwareVersion;
uint8_t* softwareOperatingSystem;
2019-03-20 00:23:30 +00:00
} DumpHardwareEntriesWithData;
#pragma pack(push, 1)
typedef struct DumpExtent
{
uint64_t start;
uint64_t end;
} DumpExtent;
#pragma pack(pop)
2020-03-01 19:53:05 +00:00
#endif // LIBAARUFORMAT_CONTEXT_H