|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Optional ra8_fs publication wrapper for the RABOOK pipeline. More...
#include <stdint.h>#include "ra8_check.h"#include "ra8_fs.h"#include "ra8_rabook_pipeline.h"#include "ra8_rabook_pipeline_internal.h"Go to the source code of this file.
Functions | |
| ra8_err_t | rabook_compile_from_epub (epub_book_t *epub, const ra8_rabook_buffers_t *buffers, const ra8_rabook_pipeline_scratch_t *scratch, ra8_fs_mount_t *mount, const char *out_path) |
Compile an open EPUB into a RABOOK1 blob written to out_path on the SD filesystem. | |
Optional ra8_fs publication wrapper for the RABOOK pipeline.
Keeps filesystem linkage out of the reusable caller-buffer compiler while preserving the original public convenience entry point.
[Ring 4 / EPUB Compiler] {World: NS}
Definition in file ra8_rabook_pipeline_fs.c.
| ra8_err_t rabook_compile_from_epub | ( | epub_book_t * | epub, |
| const ra8_rabook_buffers_t * | buffers, | ||
| const ra8_rabook_pipeline_scratch_t * | scratch, | ||
| ra8_fs_mount_t * | mount, | ||
| const char * | out_path ) |
Compile an open EPUB into a RABOOK1 blob written to out_path on the SD filesystem.
Full pipeline, in order:
The stage order mirrors the desktop epub_compile.py so the emitted blob is byte-identical: stylesheets, then images (cover), then chapters, then metadata is interned last.
scratch->css and add it via ra8_rabook_add_stylesheet.scratch->img_arena), downscale to at most the caller's opt-in max_image_edge clamp (source resolution when the field is 0, the default) on the longer edge, encode to 4-bpp, and add via ra8_rabook_add_image.scratch->xhtml, look up the matching TOC entry for a title, and call ra8_rabook_xml_parse_chapter.epub and call ra8_rabook_set_metadata (interned after the chapters).out_path via ra8_fs_write_file.| [in,out] | epub | Open book (in_use == 1); chapters are extracted in-place from the ZIP. |
| [in] | buffers | Builder arenas (all non-NULL, sized for the book). |
| [in] | scratch | Scratch buffers for XHTML load + image decode + gray. |
| [in,out] | mount | Mounted filesystem volume to write out_path onto. |
| [in] | out_path | Filesystem path of the output .rabook file. |
| k_ra8_ok | Book compiled and written to out_path. |
| k_ra8_err_null_ptr | Any required pointer is NULL. |
| k_ra8_err_no_mem | An arena overflowed, a scratch buffer was too small, or a present cover failed to transcode. |
| k_ra8_err_not_found | A chapter ZIP entry referenced by the spine is missing. |
| k_ra8_err_invalid_size | The laid-out blob exceeds the output arena (propagated from ra8_rabook_finalize). |
epub->in_use == 1. out_path contains a valid RABOOK1 blob. out_path.Definition at line 21 of file ra8_rabook_pipeline_fs.c.
References k_ra8_ok, priv_rabook_pipeline_check_common(), RA8_CHECK_NULL_PTR, ra8_fs_write_file(), and rabook_compile_from_epub_to_buffer().
Referenced by rabook_import_compile_adapter().