Files
libaaruformat/include/dicformat/context.h

110 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/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2019 Natalia Portillo
// ****************************************************************************/
#ifndef LIBDICFORMAT_CONTEXT_H
#define LIBDICFORMAT_CONTEXT_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;
FILE * imageStream;
DicHeader header;
struct dataLinkedList * mediaTagsHead;
struct dataLinkedList * mediaTagsTail;
uint8_t * sectorPrefix;
uint8_t * sectorPrefixCorrected;
uint8_t * sectorSuffix;
uint8_t * sectorSuffixCorrected;
uint8_t * sectorSubchannel;
uint8_t * mode2Subheaders;
uint8_t shift;
bool inMemoryDdt;
uint64_t * userDataDdt;
size_t mappedMemoryDdtSize;
uint32_t * sectorPrefixDdt;
uint32_t * sectorSuffixDdt;
GeometryBlockHeader geometryBlock;
MetadataBlockHeader metadataBlockHeader;
uint8_t * metadataBlock;
TracksHeader tracksHeader;
TrackEntry * trackEntries;
CicmMetadataBlock cicmBlockHeader;
uint8_t * cicmBlock;
DumpHardwareHeader dumpHardwareHeader;
2019-03-20 00:23:30 +00:00
struct DumpHardwareEntriesWithData *dumpHardwareEntriesWithData;
2019-03-31 20:52:06 +01:00
struct ImageInfo imageInfo;
CdEccContext * eccCdContext;
uint8_t numberOfDataTracks;
TrackEntry * dataTracks;
bool * readableSectorTags;
} dicformatContext;
2019-03-17 21:14:40 +00:00
typedef struct dataLinkedList
{
struct dataLinkedList *previous;
struct dataLinkedList *next;
2019-03-31 20:52:06 +01:00
uint8_t * data;
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-03-20 00:23:30 +00:00
struct DumpExtent *extents;
2019-03-31 20:52:06 +01:00
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