Loading...
Searching...
No Matches
index.h
Go to the documentation of this file.
/*
* This file is part of the Aaru Data Preservation Suite.
* Copyright (c) 2019-2026 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/>.
*/
#ifndef LIBAARUFORMAT_INDEX_H
#define LIBAARUFORMAT_INDEX_H
#pragma pack(push, 1)
typedef struct IndexHeader
{
uint32_t identifier;
uint16_t entries;
uint64_t crc64;
} IndexHeader;
typedef struct IndexHeader2
{
uint32_t identifier;
uint64_t entries;
uint64_t crc64;
} IndexHeader2;
typedef struct IndexHeader3
{
uint32_t identifier;
uint64_t entries;
uint64_t crc64;
uint64_t previous;
} IndexHeader3;
typedef struct IndexEntry
{
uint32_t blockType;
uint16_t dataType;
uint64_t offset;
} IndexEntry;
#pragma pack(pop)
#endif // LIBAARUFORMAT_INDEX_H
IndexEntry
Single index entry describing a block's type, (optional) data classification, and file offset.
Definition index.h:109
IndexEntry::blockType
uint32_t blockType
Block identifier of the referenced block (value from BlockType).
Definition index.h:110
IndexEntry::offset
uint64_t offset
Absolute byte offset in the image where the referenced block header begins.
Definition index.h:112
IndexEntry::dataType
uint16_t dataType
Data classification (value from DataType) or unused for untyped blocks.
Definition index.h:111
IndexHeader2
Index header (version 2) with 64‑bit entry counter (identifier == IndexBlock2).
Definition index.h:79
IndexHeader2::entries
uint64_t entries
Number of IndexEntry records that follow immediately.
Definition index.h:81
IndexHeader2::identifier
uint32_t identifier
Block identifier (must be BlockType::IndexBlock2).
Definition index.h:80
IndexHeader2::crc64
uint64_t crc64
CRC64-ECMA of the entries array (legacy byte-swapped rule still applies for old versions).
Definition index.h:82
IndexHeader3
Index header (version 3) adding hierarchical chaining (identifier == IndexBlock3).
Definition index.h:93
IndexHeader3::previous
uint64_t previous
File offset of a previous IndexBlock3 header (0 if none / root segment).
Definition index.h:97
IndexHeader3::identifier
uint32_t identifier
Block identifier (must be BlockType::IndexBlock3).
Definition index.h:94
IndexHeader3::crc64
uint64_t crc64
CRC64-ECMA of the local entries array (does NOT cover subindexes or previous chains).
Definition index.h:96
IndexHeader3::entries
uint64_t entries
Number of IndexEntry records that follow in this (sub)index block.
Definition index.h:95
IndexHeader
Index header (version 1) for legacy images (identifier == IndexBlock).
Definition index.h:67
IndexHeader::crc64
uint64_t crc64
CRC64-ECMA of the entries array (legacy byte-swapped for early images).
Definition index.h:70
IndexHeader::identifier
uint32_t identifier
Block identifier (must be BlockType::IndexBlock).
Definition index.h:68
IndexHeader::entries
uint16_t entries
Number of IndexEntry records that follow immediately.
Definition index.h:69