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

Private validation seam shared by RABOOK pipeline entry points. More...

Include dependency graph for ra8_rabook_pipeline_internal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

ra8_err_t priv_rabook_pipeline_check_common (const epub_book_t *epub, const ra8_rabook_buffers_t *bufs, const ra8_rabook_pipeline_scratch_t *scr)
 Validate arguments common to both RABOOK pipeline entry points.

Detailed Description

Private validation seam shared by RABOOK pipeline entry points.

Keeps the buffer compiler independent of the optional ra8_fs publication wrapper while preserving one argument/profile policy.

[Ring 4 / EPUB Compiler] {World: NS}

Since
0.1.0

Definition in file ra8_rabook_pipeline_internal.h.

Function Documentation

◆ priv_rabook_pipeline_check_common()

ra8_err_t priv_rabook_pipeline_check_common ( const epub_book_t * epub,
const ra8_rabook_buffers_t * bufs,
const ra8_rabook_pipeline_scratch_t * scr )

Validate arguments common to both RABOOK pipeline entry points.

Checks the reader lifecycle plus every builder and scratch span required by the buffer compiler before it mutates output state.

Parameters
[in]epubOpen streamed or resident EPUB reader.
[in]bufsComplete caller-owned builder arenas.
[in]scrComplete caller-owned parser/raster scratch.
Returns
Shared argument and lifecycle status.
Return values
k_ra8_okThe compiler may consume every supplied view.
k_ra8_err_null_ptrA required pointer or nested span is NULL.
k_ra8_err_invalid_stateThe EPUB reader is not open.
Precondition
Pointer arguments may be NULL because this is the validating seam.
Non-NULL nested spans carry their declared writable capacities.
Postcondition
Success changes no caller state.
Failure performs no builder or filesystem mutation.
Note
Thread-safe across distinct immutable argument objects.
Since
0.1.0

Validate arguments common to both RABOOK pipeline entry points.

Centralises the shared null guards so each public function stays flat; the FS-write entry adds its own mount / out_path guards, the buffer entry its own out_blob / out_len guards.

Parameters
[in]epubOpen book pointer to validate.
[in]bufsBuilder arenas pointer to validate.
[in]scrScratch buffers pointer to validate.
Returns
Error code.
Return values
k_ra8_okAll three arguments are non-NULL.
k_ra8_err_null_ptrOne of the arguments is NULL.
Precondition
The pointers, if non-NULL, address valid objects for the call.
Called once at the top of a compile entry point.
Postcondition
No argument is modified (read-only validation).
On k_ra8_ok the three arguments are guaranteed non-NULL.
Note
Not thread-safe.
Since
Version 0.1.0

Definition at line 298 of file ra8_rabook_pipeline.c.

References k_ra8_ok, RA8_CHECK_NULL_PTR, RA8_PRIV, s_tag, and ra8_rabook_pipeline_scratch_t::xml_workspace.

Referenced by rabook_compile_from_epub(), and rabook_compile_from_epub_to_buffer().