28typedef enum : uint16_t {
34typedef enum : uint8_t {
319 const char* directory,
322 const char* destination,
Package a downloaded chapter folder into a reader-openable container.
struct mdl_export_workspace mdl_export_workspace_t
Caller-owned bounded arena for all exporter scratch state.
ra8_err_t priv_mdl_export_rabook(mdl_storage_t *storage, const char *directory, char names[][k_name_max], size_t count, const char *destination, const mdl_export_meta_t *meta, mdl_export_workspace_t *workspace)
Compile one page directory into a strict chunked RABOOK artifact.
ra8_err_t priv_mdl_export_cbz(mdl_storage_t *storage, const char *dir, char names[][k_name_max], size_t count, mdl_export_output_t *output, const mdl_export_meta_t *meta, mdl_export_workspace_t *ws)
Write a CBZ into a caller-owned staged output.
ra8_err_t priv_mdl_export_tar_gzip(mdl_storage_t *storage, const char *dir, char names[][k_name_max], size_t count, mdl_export_output_t *output, const mdl_export_meta_t *meta, mdl_export_workspace_t *ws)
Write a gzip-wrapped CBT archive.
ra8_err_t priv_mdl_zip_workspace_error(const mdl_zip_allocator_t *alloc)
Classify a miniz writer failure.
ra8_err_t priv_mdl_export_jof(mdl_storage_t *storage, const char *dir, const char names[][k_name_max], size_t count, mdl_export_workspace_t *ws)
Convert every page in a chapter directory to a sibling .jof atlas.
ra8_err_t priv_mdl_export_validate_source_url(const char *url)
Validate an optional bounded source-attribution URL.
mdl_cover_bounds_t
Fixed storage used to describe a validated external cover.
@ k_cover_mime_bytes
Canonical image MIME buffer.
@ k_cover_entry_bytes
Canonical archive member path.
@ k_cover_ext_bytes
Canonical image extension buffer.
void priv_mdl_zip_workspace_bind(mz_zip_archive *zip, mdl_zip_allocator_t *alloc, mdl_export_workspace_t *ws)
Bind a miniz archive to caller-owned bounded storage.
mdl_export_limits_t
Fixed bounds on the per-chapter page list.
@ k_max_pages
Maximum page entries per chapter.
@ k_name_max
Maximum entry-name bytes.
ra8_err_t priv_mdl_export_epub(mdl_storage_t *storage, const char *dir, char names[][k_name_max], size_t count, mdl_export_output_t *output, const mdl_export_meta_t *meta, mdl_export_workspace_t *ws)
Write a fixed-layout EPUB3 archive.
void priv_mdl_zip_workspace_release(mdl_zip_allocator_t *alloc)
Restore a workspace after a miniz writer ends.
ra8_err_t priv_mdl_export_tar(mdl_storage_t *storage, const char *dir, char names[][k_name_max], size_t count, mdl_export_output_t *output, const mdl_export_meta_t *meta)
Write an uncompressed CBT tar archive.
bool priv_mdl_export_snprintf_fit(int written, size_t cap)
Report whether an snprintf result fit its destination.
ra8_err_t priv_mdl_export_prepare_cover(mdl_storage_t *storage, const mdl_export_meta_t *meta, const char names[][k_name_max], size_t count, mdl_external_cover_t *cover)
Validate and canonicalize an external cover.
Private portable byte-stream contracts for media exporters.
Annotation-attribute framework macros for ra8-firmware.
#define RA8_PRIV
Module-private helper: shared across TUs but only inside one library.
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
One validated staged publication, including random ZIP backfill.
Validated external cover details retained without owning storage.
const char * source
Trusted caller-owned source path.
char entry[k_cover_entry_bytes]
Canonical relative member path.
char mime[k_cover_mime_bytes]
MIME derived from magic bytes.
bool external
True when a separate cover exists.
One non-reentrant downloader filesystem dependency bundle.
Per-writer adapter from miniz callbacks to one caller workspace.
size_t floor
Cursor restored after writer end.
mdl_export_workspace_t * ws
Exclusive caller-owned workspace.
mdl_zip_block_t * first
First miniz block, or NULL.
bool exhausted
A callback exceeded bounded space.
Metadata stored immediately before each bounded miniz allocation.
size_t bytes
Requested payload bytes currently preserved.
bool free
Whether this block can satisfy a later request.
max_align_t alignment
Forces following payload to maximum alignment.
size_t span
Aligned header-plus-payload bytes in this block.