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