ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
epub_xml_opf_internal.h
Go to the documentation of this file.
1
12#pragma once
13
14#include <stddef.h>
15#include <stdint.h>
16
18#include "ra8_attributes.h"
19#include "xml.h"
20
36RA8_INTERNAL static bool
37internal_font_type(const uint8_t* source, size_t source_len, priv_attr_t media);
38
53RA8_INTERNAL static void internal_manifest_item(const uint8_t* source,
54 size_t source_len,
55 const xml_event_t* event,
56 epub_book_t* book);
57
73RA8_INTERNAL static void internal_metadata_text(const uint8_t* source,
74 size_t source_len,
75 const xml_event_t* event,
76 const xml_reader_t* reader,
77 epub_book_t* book);
78
94RA8_INTERNAL static void internal_mark_metadata(const uint8_t* source,
95 size_t source_len,
96 const xml_event_t* event,
97 xml_reader_t* reader,
98 xml_span_t unique_id);
99
116internal_opf_status(ra8_err_t err, uint16_t manifest_depth, uint16_t spine_depth);
117
135RA8_INTERNAL static ra8_err_t internal_opf_first(const uint8_t* source,
136 size_t length,
137 epub_book_t* book,
138 xml_span_t* out_spine_toc);
139
157internal_collect_spine(const uint8_t* source, size_t length, epub_book_t* book);
158
178 size_t length,
179 epub_xml_workspace_t* workspace,
180 xml_span_t wanted,
181 xml_span_t* out_href);
182
200internal_opf_shape(const uint8_t* source, size_t length, epub_xml_workspace_t* workspace);
Private contracts for streamed EPUB XML consumers.
static ra8_err_t internal_manifest_lookup(const uint8_t *source, size_t length, epub_xml_workspace_t *workspace, xml_span_t wanted, xml_span_t *out_href)
Resolve one manifest identifier across the uncapped source manifest.
static void internal_mark_metadata(const uint8_t *source, size_t source_len, const xml_event_t *event, xml_reader_t *reader, xml_span_t unique_id)
Mark a metadata child frame for later text consumption.
static ra8_err_t internal_opf_status(ra8_err_t err, uint16_t manifest_depth, uint16_t spine_depth)
Preserve parser status while enforcing required OPF sections.
static ra8_err_t internal_opf_first(const uint8_t *source, size_t length, epub_book_t *book, xml_span_t *out_spine_toc)
Run the OPF metadata/manifest/cover/font/TOC-source pass.
static ra8_err_t internal_opf_shape(const uint8_t *source, size_t length, epub_xml_workspace_t *workspace)
Validate OPF structure and spine capacity before semantic mutation.
static ra8_err_t internal_collect_spine(const uint8_t *source, size_t length, epub_book_t *book)
Collect exact unprefixed spine itemrefs in source order.
static void internal_metadata_text(const uint8_t *source, size_t source_len, const xml_event_t *event, const xml_reader_t *reader, epub_book_t *book)
Record metadata text based on its live parent marker.
static void internal_manifest_item(const uint8_t *source, size_t source_len, const xml_event_t *event, epub_book_t *book)
Collect one manifest item and its derived resource roles.
static bool internal_font_type(const uint8_t *source, size_t source_len, priv_attr_t media)
Recognise one supported embedded-font media 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.
Definition ra8_err.h:546
Opened EPUB book.
Definition epub.h:286
Per-book bounded storage for strict OPF/container/TOC parsing.
Definition epub.h:105
Optional attribute span.
One XML pull event.
Definition xml.h:71
Pull-reader state; initialise before each pass.
Definition xml.h:93
Immutable byte span expressed relative to the source.
Definition xml.h:44
Bounded, caller-owned, no-heap XML pull reader.