147 const char* entry_local,
Private contracts for streamed EPUB XML consumers.
static void internal_ncx_event(priv_ncx_ctx_t *ctx, const xml_event_t *event)
Consume one event from the selected NCX navigation map.
static ra8_err_t internal_nav_has_list(const uint8_t *source, size_t length, epub_xml_workspace_t *workspace, const xml_event_t *selected)
Require a direct ordered-list child before TOC mutation.
static ra8_err_t internal_toc_capacity(const uint8_t *source, size_t length, epub_xml_workspace_t *workspace, const xml_event_t *selected, const char *entry_local, bool require_list)
Prove a selected TOC subtree fits before changing the book.
static uint16_t internal_toc_reserve(const uint8_t *source, size_t source_len, const xml_event_t *event, xml_reader_t *reader, epub_book_t *book, const char *local)
Reserve one preflight-proven TOC slot and mark its frame.
static uint16_t internal_toc_marker(const xml_reader_t *reader, uint16_t depth)
Find the nearest marked ancestor frame.
static xml_span_t internal_ancestor_name(const xml_reader_t *reader, uint16_t depth, uint16_t levels)
Return a checked ancestor name span.
static void internal_nav_event(priv_nav_ctx_t *ctx, const xml_event_t *event)
Consume one event from the selected EPUB navigation subtree.
static ra8_err_t internal_select_nav(const uint8_t *source, size_t length, epub_xml_workspace_t *workspace, xml_event_t *out)
Select typed TOC nav, falling back to the first nav descendant.
static uint8_t internal_ancestor_depth(const uint8_t *source, size_t source_len, const xml_reader_t *reader, uint16_t depth, const char *local)
Count local-name ancestors of a TOC entry type.
Annotation-attribute framework macros for ra8-firmware.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Per-book bounded storage for strict OPF/container/TOC parsing.
Mutable state for one validated EPUB navigation pass.
bool saw_ol
Selected navigation contains its list.
xml_event_t selected
Selected navigation element.
xml_reader_t * reader
Reader whose live frames carry markers.
size_t source_len
Navigation-document byte count.
bool active
Selected subtree has begun.
epub_book_t * book
TOC output being populated.
const uint8_t * source
Immutable navigation document.
Mutable state for one validated NCX navigation-map pass.
xml_reader_t * reader
Reader whose live frames carry markers.
epub_book_t * book
TOC output being populated.
bool active
Selected subtree has begun.
xml_event_t selected
Selected navigation-map element.
size_t source_len
NCX-document byte count.
const uint8_t * source
Immutable NCX document.
Pull-reader state; initialise before each pass.
Immutable byte span expressed relative to the source.
Bounded, caller-owned, no-heap XML pull reader.