ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
reflow_parse.c File Reference

HTML-subset parser entry point for reflow. More...

#include <stddef.h>
#include <stdint.h>
#include "ra8_err.h"
#include "reflow.h"
#include "reflow_tokenize_internal.h"
Include dependency graph for reflow_parse.c:

Go to the source code of this file.

Functions

ra8_err_t reflow_parse_xhtml (reflow_t *engine, const uint8_t *xhtml_buf, size_t xhtml_len)
 Parse the XHTML buffer into the engine's token stream.

Detailed Description

HTML-subset parser entry point for reflow.

The actual scan lives in reflow_tokenize.c (a no-heap streaming tokenizer). This C TU is the public entry point: reflow_layout_chapter() dispatches into reflow_parse_xhtml(), which validates arguments, resets the pools, and forwards to priv_reflow_xml_walk().

Keeping this entry point small lets clang-tidy's readability-function-size rule act on a single small function.

[Ring 4 / Reflow] {World: NS}

Since
0.1.0

Definition in file reflow_parse.c.

Function Documentation

◆ reflow_parse_xhtml()

ra8_err_t reflow_parse_xhtml ( reflow_t * engine,
const uint8_t * xhtml_buf,
size_t xhtml_len )
nodiscard

Parse the XHTML buffer into the engine's token stream.

Internal helper used by reflow_layout_chapter(). Implemented by the no-heap streaming tokenizer in reflow_tokenize.c. Declared here so reflow_layout.c can call it without a forward declaration.

Parameters
[in,out]engineEngine whose token / text pools will be populated.
[in]xhtml_bufXHTML source bytes.
[in]xhtml_lenLength of xhtml_buf.
Returns
ra8_err_t
Return values
k_ra8_okTokens emitted.
k_ra8_err_validation_failedXHTML did not parse.
k_ra8_err_no_memToken or text pool full.
Since
0.1.0

Definition at line 38 of file reflow_parse.c.