libaaruformat 1.0
Aaru Data Preservation Suite - Format Library
Loading...
Searching...
No Matches
data.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_DATA_H
20#define LIBAARUFORMAT_DATA_H
21
22#include <stdint.h> // Fixed width integer types used in on-disk packed structs.
23
24#pragma pack(push, 1)
25
54
70typedef struct BlockHeader
71{
72 uint32_t identifier;
73 uint16_t type;
74 uint16_t compression;
75 uint32_t sectorSize;
76 uint32_t cmpLength;
77 uint32_t length;
78 uint64_t cmpCrc64;
79 uint64_t crc64;
81
90typedef struct GeometryBlockHeader
91{
92 uint32_t identifier;
93 uint32_t cylinders;
94 uint32_t heads;
95 uint32_t sectorsPerTrack;
97
98#pragma pack(pop)
99
100#endif // LIBAARUFORMAT_DATA_H
Header preceding the compressed data payload of a data block (BlockType::DataBlock).
Definition data.h:71
uint32_t cmpLength
Size in bytes of the compressed payload immediately following this header.
Definition data.h:76
uint32_t length
Size in bytes of the uncompressed payload resulting after decompression.
Definition data.h:77
uint32_t identifier
Block identifier, must be BlockType::DataBlock.
Definition data.h:72
uint32_t sectorSize
Size in bytes of each logical sector represented in this block.
Definition data.h:75
uint64_t cmpCrc64
CRC64-ECMA of the compressed payload (cmpLength bytes).
Definition data.h:78
uint64_t crc64
CRC64-ECMA of the uncompressed payload (length bytes).
Definition data.h:79
uint16_t type
Logical data classification (value from DataType).
Definition data.h:73
uint16_t compression
Compression algorithm used (value from CompressionType).
Definition data.h:74
Legacy CHS style logical geometry metadata (BlockType::GeometryBlock).
Definition data.h:91
uint32_t identifier
Block identifier, must be BlockType::GeometryBlock.
Definition data.h:92
uint32_t cylinders
Number of cylinders.
Definition data.h:93
uint32_t heads
Number of heads (tracks per cylinder).
Definition data.h:94
uint32_t sectorsPerTrack
Number of sectors per track.
Definition data.h:95