49typedef enum : uint32_t {
99 const uint8_t extractable = (is_store || is_rar5) ? 1U : 0U;
bool priv_comic_is_page_name(const char *name, uint16_t len)
Whether an archive entry name is a decodable comic page image.
ra8_err_t priv_comic_page_add(comic_t *c, const char *name, uint16_t name_len, uint64_t raw_size, uint8_t extractable, uint8_t method, uint32_t zip_index, uint64_t data_off, uint64_t pack_size)
Append one image member to the resident page index.
Unified demand-paged reader for comic-book archives – CBZ (ZIP) and CBR (RAR).
ra8_err_t priv_comic_cbr_extract(comic_t *c, const comic_page_t *p, uint8_t *buf, size_t cap, size_t *got)
Extract one CBR page's encoded image (STORE copy or RAR5 decode).
cbr_limits_t
Name scratch size and the hard block-walk bound.
@ k_cbr_max_blocks
Static upper bound on blocks walked.
@ k_cbr_name_max
Longest member name indexed (bytes, incl.
static const char *const s_tag_cbr
Log tag for CBR-backend diagnostics.
static ra8_err_t internal_add_member(comic_t *c, const ra8_rar_entry_t *ent, const char *name, uint16_t nlen)
Index one RAR block if it is a decodable page-image file member.
ra8_err_t priv_comic_cbr_open(comic_t *c)
Open the CBR (RAR) backend: walk the archive + build the page index.
Cross-TU seams between the comic facade and its CBZ / CBR backends.
Annotation-attribute framework macros for ra8-firmware.
#define RA8_PRIV
Module-private helper: shared across TUs but only inside one library.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
Validation and Error-Checking Macros for ra8-firmware.
#define RA8_CHECK_NULL_PTR(ptr, tag, message)
Reject nullptr pointer, returning k_ra8_err_null_ptr.
Unified decompression-limits policy: one bound set for every decoder.
ra8_decomp_limits_t ra8_decomp_limits_default(void)
The owner-approved default decompression policy.
ra8_err_t ra8_decomp_check_declared(const ra8_decomp_limits_t *limits, uint64_t comp_size, uint64_t out_size)
Header-level check of a member's declared sizes against a policy.
ra8_err_t ra8_decomp_budget_charge_entry(ra8_decomp_budget_t *b)
Charge one enumerated archive entry against the entry cap.
@ k_ra8_err_not_supported
Requested feature not compiled in, not wired, or not supported by this MCU variant.
@ k_ra8_err_invalid_state
Module in wrong state for requested operation.
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Clean-room, read-only RAR archive walker (RAR4 + RAR5 headers, STORE data).
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.
@ k_ra8_rar_ver_none
Not a recognised RAR archive.
@ 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.
@ k_ra8_rar_method_store
Uncompressed: data area is the file bytes.
One entry in the resident, sorted page index.
uint64_t raw_size
Encoded image length in bytes (decoder input).
uint64_t data_off
CBR: absolute offset of the member data area.
uint64_t pack_size
CBR: packed member size in bytes.
uint8_t extractable
1 if this reader can decode the page's bytes.
uint8_t rar_method
CBR: ra8_rar_method_t (0 = store); 0 for CBZ.
One open comic archive: backing, kind, page index, and backend state.
ra8_rar_t rar
CBR walker state.
ra8_rar5_state_t rar5_state
CBR RAR5 decompressor scratch (no heap).
Running consumption tracker charged by a decoder against its policy.
ra8_decomp_limits_t limits
Policy in force for this budget.
One decompression policy: the five resource bounds decoders enforce.
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.
uint64_t size
Container length in bytes.
uint64_t first_off
Offset of the first block past the signature.
ra8_rar_version_t version
Detected container generation.