Loading...
Searching...
No Matches
data.h File Reference

On-disk layout structures for data-bearing and geometry blocks. More...

`#include <stdint.h>`

Go to the source code of this file.

## Data Structures

struct | BlockHeader
| Header preceding the compressed data payload of a data block (BlockType::DataBlock). More...
struct | GeometryBlockHeader
| Legacy CHS style logical geometry metadata (BlockType::GeometryBlock). More...

## Typedefs

typedef struct BlockHeader | BlockHeader
typedef struct GeometryBlockHeader | GeometryBlockHeader

## Detailed Description

On-disk layout structures for data-bearing and geometry blocks.

These packed structures describe the headers that precede variable-length payloads inside blocks whose identifiers are enumerated in BlockType. All integer fields are stored little-endian on disk. The library currently assumes a little-endian host; if ported to a big-endian architecture explicit byte swapping will be required.

Layout of a data block (BlockType::DataBlock): BlockHeader (sizeof(BlockHeader) bytes) Compressed payload (cmpLength bytes)

Payload decoding:

- Apply the algorithm indicated by BlockHeader::compression (CompressionType) to the cmpLength bytes following the header to obtain exactly BlockHeader::length bytes.
- The uncompressed data MUST be an integer multiple of BlockHeader::sectorSize.
- A CRC64-ECMA is provided for both compressed (cmpCrc64) and uncompressed (crc64) forms to allow validation at either stage of the pipeline.

Geometry block (BlockType::GeometryBlock) has a GeometryBlockHeader followed by no additional fixed payload in the current format version; it conveys legacy CHS-style logical geometry metadata.

Warning
  These structs are packed; do not take their address and assume natural alignment.

See also
  BlockType
  DataType
  CompressionType

Definition in file data.h.

## Typedef Documentation

## BlockHeader

typedef struct BlockHeader BlockHeader

## GeometryBlockHeader

typedef struct GeometryBlockHeader GeometryBlockHeader