2019-03-17 22:41:04 +00:00
|
|
|
// /***************************************************************************
|
|
|
|
|
// The Disc Image Chef
|
|
|
|
|
// ----------------------------------------------------------------------------
|
2019-03-17 20:39:40 +00:00
|
|
|
//
|
2019-03-17 22:41:04 +00:00
|
|
|
// Filename : context.h
|
|
|
|
|
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
2019-03-17 20:39:40 +00:00
|
|
|
//
|
2019-03-17 22:41:04 +00:00
|
|
|
// 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
|
|
|
|
|
// ****************************************************************************/
|
2019-03-17 20:39:40 +00:00
|
|
|
#ifndef LIBDICFORMAT_CONTEXT_H
|
|
|
|
|
#define LIBDICFORMAT_CONTEXT_H
|
|
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
#include <stdio.h>
|
2019-03-17 23:25:45 +00:00
|
|
|
#include <stdbool.h>
|
2019-03-17 20:39:40 +00:00
|
|
|
|
|
|
|
|
typedef struct dicformatContext
|
|
|
|
|
{
|
2019-03-20 00:23:30 +00:00
|
|
|
uint64_t magic;
|
|
|
|
|
uint8_t libraryMajorVersion;
|
|
|
|
|
uint8_t libraryMinorVersion;
|
|
|
|
|
FILE *imageStream;
|
|
|
|
|
DicHeader header;
|
|
|
|
|
struct dataLinkedList *mediaTagsHead;
|
|
|
|
|
struct dataLinkedList *mediaTagsTail;
|
|
|
|
|
unsigned char *sectorPrefix;
|
|
|
|
|
unsigned char *sectorPrefixCorrected;
|
|
|
|
|
unsigned char *sectorSuffix;
|
|
|
|
|
unsigned char *sectorSuffixCorrected;
|
|
|
|
|
unsigned char *sectorSubchannel;
|
|
|
|
|
unsigned char *mode2Subheaders;
|
|
|
|
|
unsigned char shift;
|
2019-03-18 22:06:10 +00:00
|
|
|
bool inMemoryDdt;
|
2019-03-20 00:23:30 +00:00
|
|
|
uint64_t *userDataDdt;
|
|
|
|
|
size_t mappedMemoryDdtSize;
|
|
|
|
|
uint32_t *sectorPrefixDdt;
|
|
|
|
|
uint32_t *sectorSuffixDdt;
|
|
|
|
|
GeometryBlockHeader geometryBlock;
|
|
|
|
|
MetadataBlockHeader metadataBlockHeader;
|
|
|
|
|
unsigned char *metadataBlock;
|
|
|
|
|
TracksHeader tracksHeader;
|
|
|
|
|
TrackEntry *trackEntries;
|
|
|
|
|
CicmMetadataBlock cicmBlockHeader;
|
|
|
|
|
unsigned char *cicmBlock;
|
|
|
|
|
DumpHardwareHeader dumpHardwareHeader;
|
|
|
|
|
struct DumpHardwareEntriesWithData *dumpHardwareEntriesWithData;
|
2019-03-17 20:39:40 +00:00
|
|
|
} dicformatContext;
|
|
|
|
|
|
2019-03-17 21:14:40 +00:00
|
|
|
typedef struct dataLinkedList
|
|
|
|
|
{
|
|
|
|
|
struct dataLinkedList *previous;
|
|
|
|
|
struct dataLinkedList *next;
|
|
|
|
|
unsigned char *data;
|
|
|
|
|
int type;
|
|
|
|
|
} dataLinkedList;
|
|
|
|
|
|
2019-03-20 00:23:30 +00:00
|
|
|
typedef struct DumpHardwareEntriesWithData
|
|
|
|
|
{
|
|
|
|
|
DumpHardwareEntry entry;
|
|
|
|
|
struct DumpExtent *extents;
|
|
|
|
|
unsigned char *manufacturer;
|
|
|
|
|
unsigned char *model;
|
|
|
|
|
unsigned char *revision;
|
|
|
|
|
unsigned char *firmware;
|
|
|
|
|
unsigned char *serial;
|
|
|
|
|
unsigned char *softwareName;
|
|
|
|
|
unsigned char *softwareVersion;
|
|
|
|
|
unsigned char *softwareOperatingSystem;
|
|
|
|
|
} DumpHardwareEntriesWithData;
|
|
|
|
|
|
|
|
|
|
#pragma pack(push, 1)
|
|
|
|
|
|
|
|
|
|
typedef struct DumpExtent
|
|
|
|
|
{
|
|
|
|
|
uint64_t start;
|
|
|
|
|
uint64_t end;
|
|
|
|
|
} DumpExtent;
|
|
|
|
|
|
|
|
|
|
#pragma pack(pop)
|
|
|
|
|
|
2019-03-17 20:39:40 +00:00
|
|
|
#endif //LIBDICFORMAT_CONTEXT_H
|