ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
epub_xml_consumer_internal.h
Go to the documentation of this file.
1
14#pragma once
15
16#include <stddef.h>
17#include <stdint.h>
18
20#include "ra8_attributes.h"
21#include "xml.h"
22
24typedef struct {
26 bool present;
28
44RA8_PRIV void priv_epub_xml_copy(const uint8_t* source,
45 size_t source_len,
46 xml_span_t span,
47 char* destination,
48 size_t capacity);
49
66RA8_PRIV priv_attr_t priv_epub_xml_attr(const uint8_t* source,
67 size_t source_len,
68 const xml_event_t* event,
69 const char* name);
70
87RA8_PRIV bool priv_epub_xml_attr_contains(const uint8_t* source,
88 size_t source_len,
89 priv_attr_t attribute,
90 const char* needle);
91
106RA8_PRIV xml_span_t priv_epub_xml_frame_name(const xml_reader_t* reader, uint16_t frame);
107
122RA8_PRIV bool priv_epub_xml_direct_child(uint16_t child, uint16_t parent);
123
139RA8_PRIV bool priv_epub_xml_ancestor_frame(uint16_t depth, uint16_t levels, uint16_t* out_frame);
140
157 uint16_t depth,
158 uint16_t levels);
159
178 const uint8_t* source,
179 size_t length,
180 epub_xml_workspace_t* workspace);
181
203RA8_PRIV ra8_err_t priv_epub_xml_find(const uint8_t* source,
204 size_t length,
205 epub_xml_workspace_t* workspace,
206 const char* local,
207 bool use_parent,
208 uint32_t parent_offset,
209 uint16_t parent_depth,
210 xml_event_t* out);
void priv_epub_xml_copy(const uint8_t *source, size_t source_len, xml_span_t span, char *destination, size_t capacity)
Copy decoded text into a bounded EPUB field.
xml_span_t priv_epub_xml_frame_name(const xml_reader_t *reader, uint16_t frame)
Return one live reader-frame name span.
bool priv_epub_xml_ancestor_frame(uint16_t depth, uint16_t levels, uint16_t *out_frame)
Resolve a bounded ancestor frame index.
uint16_t priv_epub_xml_ancestor_marker(const xml_reader_t *reader, uint16_t depth, uint16_t levels)
Return a checked ancestor consumer marker.
ra8_err_t priv_epub_xml_find(const uint8_t *source, size_t length, epub_xml_workspace_t *workspace, const char *local, bool use_parent, uint32_t parent_offset, uint16_t parent_depth, xml_event_t *out)
Find the first local-name element under an optional direct parent.
ra8_err_t priv_epub_xml_reader(xml_reader_t *reader, const uint8_t *source, size_t length, epub_xml_workspace_t *workspace)
Initialise another validated EPUB pull pass.
bool priv_epub_xml_attr_contains(const uint8_t *source, size_t source_len, priv_attr_t attribute, const char *needle)
Test whether a decoded attribute contains an ASCII literal.
bool priv_epub_xml_direct_child(uint16_t child, uint16_t parent)
Test whether a depth is exactly one level below another.
priv_attr_t priv_epub_xml_attr(const uint8_t *source, size_t source_len, const xml_event_t *event, const char *name)
Find an exact-name attribute on one start event.
Library-private contract for the bounded EPUB XML parser.
Annotation-attribute framework macros for ra8-firmware.
#define RA8_PRIV
Module-private helper: shared across TUs but only inside one library.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Definition ra8_err.h:546
Per-book bounded storage for strict OPF/container/TOC parsing.
Definition epub.h:105
Optional attribute span.
xml_span_t span
Value span.
bool present
Attribute existed.
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.