libaaruformat 1.0 Aaru Data Preservation Suite - Format Library

Loading...
Searching...
No Matches
index.h
Go to the documentation of this file.
1/*
2 * This file is part of the Aaru Data Preservation Suite.
3 * Copyright (c) 2019-2025 Natalia Portillo.
4 *
5 * This library is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as
7 * published by the Free Software Foundation; either version 2.1 of the
8 * License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef LIBAARUFORMAT_INDEX_H
20#define LIBAARUFORMAT_INDEX_H
21
22#pragma pack(push, 1)
23
60
66 typedef struct IndexHeader
67{
68 uint32_t identifier;
69 uint16_t entries;
70 uint64_t crc64;
71} IndexHeader;
72
78 typedef struct IndexHeader2
79{
80 uint32_t identifier;
81 uint64_t entries;
82 uint64_t crc64;
83} IndexHeader2;
84
92 typedef struct IndexHeader3
93{
94 uint32_t identifier;
95 uint64_t entries;
96 uint64_t crc64;
97 uint64_t previous;
98} IndexHeader3;
99
108 typedef struct IndexEntry
109{
110 uint32_t blockType;
111 uint16_t dataType;
112 uint64_t offset;
113} IndexEntry;
114
115#pragma pack(pop)
116
117#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