Loading...
Searching...
No Matches
flux.h
Go to the documentation of this file.
/*
* This file is part of the Aaru Data Preservation Suite.
* Copyright (c) 2019-2025 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_FLUX_H
#define LIBAARUFORMAT_FLUX_H
#include <stdint.h>
#pragma pack(push, 1)
typedef struct FluxHeader
{
uint32_t identifier;
uint16_t entries;
uint8_t blockAlignmentShift;
uint64_t crc64;
} FluxHeader;
typedef struct FluxEntry
{
uint32_t head;
uint16_t track;
uint8_t subtrack;
uint32_t captureIndex;
uint64_t indexResolution;
uint64_t dataResolution;
uint64_t indexOffset;
uint64_t payloadOffset;
} FluxEntry;
typedef struct FluxCaptureMeta
{
uint32_t head;
uint16_t track;
uint8_t subtrack;
uint32_t captureIndex;
uint64_t indexResolution;
uint64_t dataResolution;
} FluxCaptureMeta;
typedef struct FluxCaptureMapEntry FluxCaptureMapEntry;
typedef struct DataStreamPayloadHeader
{
uint32_t identifier;
uint16_t dataType;
uint16_t compression;
uint32_t cmpLength;
uint32_t length;
uint64_t cmpCrc64;
uint64_t crc64;
} DataStreamPayloadHeader;
typedef struct FluxCaptureRecord
{
FluxEntry entry;
uint8_t *data_buffer;
uint32_t data_length;
uint8_t *index_buffer;
uint32_t index_length;
} FluxCaptureRecord;
typedef struct FluxCaptureKey
{
uint32_t head;
uint16_t track;
uint8_t subtrack;
uint32_t captureIndex;
} FluxCaptureKey;
#pragma pack(pop)
#endif // LIBAARUFORMAT_FLUX_H
DataStreamPayloadHeader
Header structure for a DataStreamPayloadBlock containing data stream payload.
Definition flux.h:243
DataStreamPayloadHeader::dataType
uint16_t dataType
Data type classification (value from DataType), e.g., FluxData or BitstreamData.
Definition flux.h:245
DataStreamPayloadHeader::cmpLength
uint32_t cmpLength
Compressed length in bytes (includes LZMA properties if compression = Lzma).
Definition flux.h:247
DataStreamPayloadHeader::cmpCrc64
uint64_t cmpCrc64
CRC64-ECMA checksum of the compressed payload (or same as crc64 if uncompressed).
Definition flux.h:249
DataStreamPayloadHeader::identifier
uint32_t identifier
Block identifier, must be BlockType::DataStreamPayloadBlock (0x4C505344, "DSPL").
Definition flux.h:244
DataStreamPayloadHeader::compression
uint16_t compression
Compression type: 0 = None, 1 = Lzma.
Definition flux.h:246
DataStreamPayloadHeader::length
uint32_t length
Uncompressed length in bytes.
Definition flux.h:248
DataStreamPayloadHeader::crc64
uint64_t crc64
CRC64-ECMA checksum of the uncompressed payload.
Definition flux.h:250
FluxCaptureKey
Key structure for flux capture lookup map.
Definition flux.h:297
FluxCaptureKey::track
uint16_t track
Track number identifying the capture location.
Definition flux.h:299
FluxCaptureKey::subtrack
uint8_t subtrack
Subtrack number identifying the capture location.
Definition flux.h:300
FluxCaptureKey::head
uint32_t head
Head number identifying the capture location.
Definition flux.h:298
FluxCaptureKey::captureIndex
uint32_t captureIndex
Capture index, allowing multiple captures for the same location.
Definition flux.h:301
FluxCaptureMapEntry
Internal hash table entry for flux capture lookup.
Definition flux.c:34
FluxCaptureMeta
Metadata structure returned by aaruf_get_flux_captures().
Definition flux.h:183
FluxCaptureMeta::head
uint32_t head
Head number the flux capture corresponds to.
Definition flux.h:184
FluxCaptureMeta::indexResolution
uint64_t indexResolution
Resolution in picoseconds at which the index stream was sampled.
Definition flux.h:188
FluxCaptureMeta::captureIndex
uint32_t captureIndex
Capture index, allowing multiple captures for the same location.
Definition flux.h:187
FluxCaptureMeta::subtrack
uint8_t subtrack
Subtrack number the flux capture corresponds to.
Definition flux.h:186
FluxCaptureMeta::dataResolution
uint64_t dataResolution
Resolution in picoseconds at which the data stream was sampled.
Definition flux.h:189
FluxCaptureMeta::track
uint16_t track
Track number the flux capture corresponds to.
Definition flux.h:185
FluxCaptureRecord
Internal structure for storing flux capture data during write mode.
Definition flux.h:271
FluxCaptureRecord::entry
FluxEntry entry
Flux entry metadata describing this capture.
Definition flux.h:272
FluxCaptureRecord::data_length
uint32_t data_length
Length of the data buffer in bytes.
Definition flux.h:274
FluxCaptureRecord::index_length
uint32_t index_length
Length of the index buffer in bytes.
Definition flux.h:276
FluxCaptureRecord::index_buffer
uint8_t * index_buffer
Pointer to the flux index buffer. Owned by the utarray, freed automatically.
Definition flux.h:275
FluxCaptureRecord::data_buffer
uint8_t * data_buffer
Pointer to the flux data buffer. Owned by the utarray, freed automatically.
Definition flux.h:273
FluxEntry
Metadata entry describing a single flux capture in the FluxDataBlock.
Definition flux.h:156
FluxEntry::indexResolution
uint64_t indexResolution
Resolution in picoseconds at which the index stream was sampled.
Definition flux.h:161
FluxEntry::dataResolution
uint64_t dataResolution
Resolution in picoseconds at which the data stream was sampled.
Definition flux.h:162
FluxEntry::head
uint32_t head
Head number the flux capture corresponds to. Typically 0 or 1 for double-sided media.
Definition flux.h:157
FluxEntry::payloadOffset
uint64_t payloadOffset
Block-aligned file offset where the DataStreamPayloadBlock containing this capture's data is stored,...
Definition flux.h:164
FluxEntry::track
uint16_t track
Track number the flux capture corresponds to. Track numbering is format-dependent.
Definition flux.h:158
FluxEntry::indexOffset
uint64_t indexOffset
Byte offset within the payload where the index buffer starts (equals data_length).
Definition flux.h:163
FluxEntry::subtrack
uint8_t subtrack
Subtrack number, allowing sub-stepping within a track. Used for fine positioning.
Definition flux.h:159
FluxEntry::captureIndex
uint32_t captureIndex
Capture index, allowing multiple captures for the same location (e.g., multiple revolutions).
Definition flux.h:160
FluxHeader
Header structure for a FluxDataBlock containing flux capture metadata.
Definition flux.h:117
FluxHeader::identifier
uint32_t identifier
Block identifier, must be BlockType::FluxDataBlock (0x58554C46, "FLUX").
Definition flux.h:118
FluxHeader::entries
uint16_t entries
Number of FluxEntry records following this header. Maximum value: 65535.
Definition flux.h:119
FluxHeader::crc64
uint64_t crc64
CRC64-ECMA checksum of the FluxEntry array (header excluded).
Definition flux.h:121
FluxHeader::blockAlignmentShift
uint8_t blockAlignmentShift
Block alignment shift: 2^blockAlignmentShift = block alignment boundary in bytes.
Definition flux.h:120