mirror of
https://github.com/aaru-dps/libaaruformat.git
synced 2026-07-08 18:06:18 +00:00
refactor: split close.c into reader/writer
Separate writer finalization from resource cleanup in close.c to enable a future reader-only library target (aaruformatread). close_write.c contains all write_* helpers and aaruf_finalize_write(). close.c retains aaruf_close() with cleanup only, dispatching writer finalization via a function pointer set by aaruf_create()/aaruf_open(). Zero behavioral change — same tests pass, same error semantics.
This commit is contained in:
@@ -296,6 +296,7 @@ typedef struct aaruformat_context
|
||||
bool rewinded; ///< True if stream has been rewound after open (write path).
|
||||
bool writing_long; ///< True if writing long sectors
|
||||
bool block_zero_written; ///< True if block zero has been written (writing path).
|
||||
int32_t (*finalize_write)(struct aaruformat_context *ctx); ///< Writer finalization hook (NULL for reader).
|
||||
|
||||
/* Options */
|
||||
uint32_t lzma_dict_size; ///< LZMA dictionary size (writing path).
|
||||
|
||||
@@ -63,6 +63,7 @@ bool set_ddt_tape(aaruformat_context *ctx, uint64_t sector_address, uint64_t
|
||||
aaru_options parse_options(const char *options, bool *table_shift_found);
|
||||
uint64_t get_filetime_uint64();
|
||||
int32_t aaruf_close_current_block(aaruformat_context *ctx);
|
||||
int32_t aaruf_finalize_write(aaruformat_context *ctx);
|
||||
int compare_extents(const void *a, const void *b);
|
||||
void generate_random_bytes(uint8_t *buffer, size_t length);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user