mirror of
https://github.com/aaru-dps/libaaruformat.git
synced 2025-12-16 19:24:40 +00:00
Add long sector writing support and related error handling in write.c and context.h
This commit is contained in:
@@ -231,6 +231,14 @@ typedef struct aaruformatContext
|
||||
blake3_hasher *blake3_context; ///< Opaque BLAKE3 context for streaming updates
|
||||
uint8_t currentTrackType; ///< Current track type (when writing optical images with tracks, needed for block
|
||||
///< compression type).
|
||||
bool writingLong; ///< True if writing long sectors
|
||||
uint8_t *sectorPrefixBuffer; ///< Buffer for storing sector prefixes when writing optical images
|
||||
uint8_t *sectorSuffixBuffer; ///< Buffer for storing sector suffixes when writing optical images
|
||||
size_t sectorPrefixBufferLength; ///< Length of sectorPrefixBuffer
|
||||
size_t sectorSuffixBufferLength; ///< Length of sectorSuffixBuffer
|
||||
size_t sectorPrefixBufferOffset; ///< Current position in sectorPrefixBuffer
|
||||
size_t sectorSuffixBufferOffset; ///< Current position in sectorSuffixBuffer
|
||||
uint8_t *mode2_subheaders; ///< Buffer for storing MODE2 subheaders when writing MODE2 tracks
|
||||
} aaruformatContext;
|
||||
|
||||
/** \struct DumpHardwareEntriesWithData
|
||||
|
||||
@@ -94,6 +94,8 @@ AARU_EXPORT int32_t AARU_CALL aaruf_read_sector_long(void *context, uint64_t sec
|
||||
|
||||
AARU_EXPORT int32_t AARU_CALL aaruf_write_sector(void *context, uint64_t sector_address, bool negative,
|
||||
const uint8_t *data, uint8_t sector_status, uint32_t length);
|
||||
AARU_EXPORT int32_t AARU_CALL aaruf_write_sector_long(void *context, uint64_t sector_address, bool negative,
|
||||
const uint8_t *data, uint8_t sector_status, uint32_t length);
|
||||
|
||||
AARU_EXPORT int32_t AARU_CALL aaruf_verify_image(void *context);
|
||||
|
||||
|
||||
@@ -62,6 +62,7 @@
|
||||
#define AARUF_ERROR_CANNOT_WRITE_BLOCK_HEADER (-23) ///< Failure writing block header.
|
||||
#define AARUF_ERROR_CANNOT_WRITE_BLOCK_DATA (-24) ///< Failure writing block payload.
|
||||
#define AARUF_ERROR_CANNOT_SET_DDT_ENTRY (-25) ///< Failed to encode/store a DDT entry (overflow or IO).
|
||||
#define AARUF_ERROR_INCORRECT_DATA_SIZE (-26) ///< Data size does not match expected size.
|
||||
/** @} */
|
||||
|
||||
/** \name Non-fatal sector status codes (non-negative)
|
||||
|
||||
Reference in New Issue
Block a user