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