Files
libaaruformat/include/aaruformat/context.h

112 lines
4.2 KiB
C
Raw Normal View History

// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : context.h
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : libdicformat.
//
// --[ Description ] ----------------------------------------------------------
//
// Describes context to be passed between libdicformat functions.
//
// --[ 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:47:47 +00:00
// Copyright © 2011-2020 Natalia Portillo
// ****************************************************************************/
#ifndef LIBDICFORMAT_CONTEXT_H
#define LIBDICFORMAT_CONTEXT_H
2019-08-03 01:33:22 +01:00
#include "structs.h"
2019-03-31 20:52:06 +01:00
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
typedef struct dicformatContext
{
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;
2019-03-31 20:52:06 +01:00
DicHeader 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;
} dicformatContext;
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)
2019-03-31 20:52:06 +01:00
#endif // LIBDICFORMAT_CONTEXT_H