88typedef size_t (*
ra8_rar_read_fn)(
void* ctx, uint64_t offset,
void* buf,
size_t len);
97typedef enum : uint8_t {
111typedef enum : uint8_t {
123typedef enum : uint16_t {
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
ra8_rar_limits_t
Fixed sizes and grammar constants for the RAR block walk.
@ k_ra8_rar_vint_max
Max bytes in one RAR5 vint (64-bit value).
@ k_ra8_rar_sig5_len
"Rar!\x1A\x07\x01\x00" signature length (RAR5).
@ k_ra8_rar_sig4_len
"Rar!\x1A\x07\x00" marker length (RAR4).
@ k_ra8_rar_hdr_scratch
Per-block header read window (fixed fields).
ra8_err_t ra8_rar_next(const ra8_rar_t *rar, uint64_t off, char *name_buf, uint16_t name_cap, ra8_rar_entry_t *out)
Decode the block header at off and advance to the next block.
ra8_err_t ra8_rar_open(ra8_rar_t *rar, ra8_rar_read_fn read, void *ctx, uint64_t size)
Detect a RAR archive's generation and locate its first block.
size_t(* ra8_rar_read_fn)(void *ctx, uint64_t offset, void *buf, size_t len)
Seek+read backing over the RAR container bytes.
ra8_rar_version_t
Which RAR container generation an archive uses.
@ k_ra8_rar_ver_none
Not a recognised RAR archive.
@ k_ra8_rar_ver_4
RAR 1.5-4.x block format ("RAR4").
@ k_ra8_rar_ver_5
RAR 5.0 block format ("RAR5").
ra8_err_t ra8_rar_extract(const ra8_rar_t *rar, const ra8_rar_entry_t *ent, uint8_t *buf, size_t cap, ra8_rar5_state_t *st, size_t *got)
Extract any file member – STORE by copy, RAR5-compressed by decode.
ra8_err_t ra8_rar_extract_stored(const ra8_rar_t *rar, const ra8_rar_entry_t *ent, uint8_t *buf, size_t cap, size_t *got)
Extract a STORE-method member's data into the caller buffer.
ra8_rar_method_t
Normalised compression method of a file member.
@ k_ra8_rar_method_compressed
Packed with a RAR compressor (not decoded).
@ k_ra8_rar_method_store
Uncompressed: data area is the file bytes.
Caller-owned zero-heap scratch for one ra8_rar5_decompress call.
One decoded RAR block: a file member, a directory, or a skipped block.
uint8_t method
ra8_rar_method_t (normalised; 0 = store).
uint8_t is_file
1 if this block is a file member header.
uint64_t unp_size
Unpacked length, bytes.
uint64_t data_off
Absolute offset of the member's data area.
uint64_t next_off
Absolute offset of the next block header.
uint16_t name_len
Name bytes copied into the caller buffer (clamped).
uint8_t is_dir
1 if the file member is a directory entry.
uint64_t pack_size
Packed (stored/compressed) data length, bytes.
One open RAR archive: the backing plus the detected generation.
uint64_t size
Container length in bytes.
uint64_t first_off
Offset of the first block past the signature.
void * ctx
Context for read.
ra8_rar_version_t version
Detected container generation.
ra8_rar_read_fn read
Byte reader over the container file.