27typedef enum : uint32_t {
74[[gnu::section(
".sdram_data"),
77[[gnu::section(
".sdram_data"),
84[[gnu::section(
".sdram_data"),
93[[gnu::section(
".sdram_data"),
96[[gnu::section(
".sdram_data"),
99[[gnu::section(
".sdram_data"),
130 .stylesheet_cap = 1U,
159 .raster = {.stb_arena = stb,
162 .rgba_cap =
sizeof s_rgba,
164 .gray_cap =
sizeof s_gray},
181 .container = container,
186 .flat_cap =
sizeof s_flat,
210 const uint8_t* source =
nullptr;
211 size_t source_size = 0U;
220 .page_id =
"source-image",
221 .metadata = {.title =
"Downloaded image",
222 .author =
"C6 HTTPS source",
224 .identifier =
"urn:ra8:media-download:image"},
253 uint16_t written = 0U;
256 if ((err ==
k_ra8_ok) && (written != length)) {
283 uint64_t packed_size,
284 const char* destination)
286 if ((packed_size == 0U) || (packed_size >
sizeof s_packed) || (transfer->
chunk_bytes == 0U)) {
294 uint64_t offset = 0U;
295 while ((err ==
k_ra8_ok) && (offset < packed_size)) {
296 uint64_t remaining = packed_size - offset;
298 if (remaining < (uint64_t)chunk) {
299 chunk = (uint16_t)remaining;
302 offset += (err ==
k_ra8_ok) ? chunk : 0U;
340 if (transfer ==
nullptr) {
355 const char* destination,
358 if ((link ==
nullptr) || (url ==
nullptr) || (destination ==
nullptr)) {
364 source_transfer = *transfer;
375 uint64_t packed_size = 0U;
Flat, execute-in-place container for a build-time "compiled" e-book.
@ k_book_pixfmt_gray4
4bpp packed grayscale, 2px/byte (default; every pre-field blob).
static uint8_t s_packed[k_ez_packed_bytes]
Composite scratch: the dithered strip packed to 4 bpp (SRAM).
static book_node_t s_nodes[k_arena_nodes]
static book_stylesheet_t s_styles[k_arena_styles]
static book_image_t s_images[k_arena_images]
static book_chapter_t s_chapters[k_arena_chapters]
static book_attr_t s_attrs[k_arena_attrs]
#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).
struct ra8_c6link ra8_c6link_t
ra8_err_t ra8_c6link_mdl_transfer(ra8_c6link_t *link, const char *url, const char *destination, const ra8_mdl_transfer_config_t *config, ra8_mdl_transfer_result_t *result)
Fetch, verify, and atomically publish one remote byte stream.
struct ra8_mdl_transfer_config ra8_mdl_transfer_config_t
struct ra8_mdl_transfer_result ra8_mdl_transfer_result_t
App-domain DEFLATE compress / decompress (zero-heap, firmware-safe).
@ k_ra8_compress_scratch_bytes
Minimum compress scratch size (one miniz tdefl_compressor).
@ k_ra8_err_not_supported
Requested feature not compiled in, not wired, or not supported by this MCU variant.
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
@ k_ra8_err_null_ptr
Pointer was NULL where a valid pointer was required.
@ k_ra8_err_invalid_size
Invalid size parameter (too large, too small, or misaligned).
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Heap-free scratch allocator hooks for the stb_image single-TU build.
@ k_ra8_mdl_sha256_bytes
SHA-256 digest size in bytes.
Caller-buffer transaction adapter for verified C6 media sources.
ra8_err_t ra8_mdl_storage_ram_view(const ra8_mdl_storage_ram_t *storage, const uint8_t **data, size_t *length)
Expose the complete committed source as an immutable byte view.
ra8_err_t ra8_mdl_storage_ram_init(ra8_mdl_storage_ram_t *storage, ra8_mdl_storage_iface_t *output, uint8_t *data, size_t capacity)
Bind a caller buffer as one transactional media destination.
Heap-free scratch allocator hooks for the vendored libwebp decoder.
One name="value" attribute on an element.
One spine document (a renderable chapter) plus its TOC label.
Descriptor for one transcoded image in the image pool.
A preserved CSS stylesheet and the chapter it scopes to.
Aligned caller-owned miniz compressor storage.
uint8_t bytes[k_ra8_compress_scratch_bytes]
Compressor state bytes.
Caller-owned bump arena backing a single image decode.
ra8_err_t(* update)(void *ctx, const uint8_t *data, uint16_t len)
Feed one ordered byte span to the running hash.
ra8_err_t(* init)(void *ctx)
Reset the caller-owned context for a SHA-256 operation.
void * ctx
Hash context passed to every function.
ra8_err_t(* final)(void *ctx, uint8_t out[k_ra8_mdl_sha256_bytes])
Finalise the hash into the caller-provided digest.
ra8_err_t(* write)(void *ctx, const uint8_t *data, uint16_t len, uint16_t *written)
Append len bytes and report the exact number persisted.
ra8_err_t(* commit)(void *ctx)
Atomically publish the complete temporary object.
void * ctx
Backend context passed to every function.
ra8_err_t(* begin)(void *ctx, const char *destination)
Create private temporary state for destination.
ra8_err_t(* validate)(void *ctx, uint64_t total_bytes, const uint8_t sha256[k_ra8_mdl_sha256_bytes])
Validate artifact identity and structure before publication.
ra8_err_t(* abort)(void *ctx)
Destroy temporary state; valid after every successful begin.
Mutable transaction over one caller-owned destination span.
ra8_mdl_sha256_iface_t sha256
Independent running digest.
mdl_format_t format
Requested and validated artifact.
uint16_t chunk_bytes
Maximum bytes requested per pull.
ra8_mdl_storage_iface_t storage
Transactional RA8-local destination.
Caller-owned, fixed-capacity arenas the builder appends into (no heap).
Caller-owned arenas retained for one streaming comic build.
Caller-owned transient storage for one RBKC write.
Caller-owned bump arena backing a single WebP decode.