ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
epub_entry.h
Go to the documentation of this file.
1
30
31#pragma once
32
33#include "epub.h"
34
35#ifdef __cplusplus
36extern "C" {
37#endif
38
39/* ===========================================================================
40 * Public API -- iterative (bounded-RAM) ZIP-entry extraction (#231)
41 * ===========================================================================
42 */
43
63
93typedef struct {
94 void* iter;
96 uint64_t total;
97 uint64_t consumed;
98 uint8_t done;
102
135[[nodiscard]] ra8_err_t epub_entry_open(epub_book_t* book,
136 const char* path,
137 epub_entry_reader_t* out_reader,
138 uint64_t* out_size);
139
170[[nodiscard]] ra8_err_t
171epub_entry_read(epub_entry_reader_t* reader, uint8_t* buf, size_t cap, size_t* got);
172
196[[nodiscard]] ra8_err_t epub_entry_close(epub_entry_reader_t* reader);
197
238[[nodiscard]] ra8_err_t epub_entry_pread(epub_book_t* book,
239 const char* path,
240 uint64_t offset,
241 uint8_t* buf,
242 size_t len,
243 size_t* got);
244
245#ifdef __cplusplus
246}
247#endif
EPUB (.epub) reader and chapter iterator for ra8-firmware.
ra8_err_t epub_entry_pread(epub_book_t *book, const char *path, uint64_t offset, uint8_t *buf, size_t len, size_t *got)
Positioned read of a stored (uncompressed) archive entry – windowed random access in bounded RAM (#23...
Definition epub_entry.c:446
ra8_err_t epub_entry_read(epub_entry_reader_t *reader, uint8_t *buf, size_t cap, size_t *got)
Pull the next chunk of a streaming entry into a bounded caller buffer (#231).
Definition epub_entry.c:360
epub_entry_reader_layout_t
Fixed-layout constants for epub_entry_reader_t.
Definition epub_entry.h:59
@ k_epub_entry_reader_reserved_bytes
Padding bytes after done; rounds the tail to 8-byte alignment.
Definition epub_entry.h:60
ra8_err_t epub_entry_close(epub_entry_reader_t *reader)
Tear down a streaming-entry cursor and release its inflate state (#231).
Definition epub_entry.c:392
ra8_err_t epub_entry_open(epub_book_t *book, const char *path, epub_entry_reader_t *out_reader, uint64_t *out_size)
Begin a bounded-RAM streaming extraction of one archive entry (#231).
Definition epub_entry.c:331
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Definition ra8_err.h:546
Opened EPUB book.
Definition epub.h:286
Forward streaming cursor over one ZIP entry – inflate in bounded RAM (#231).
Definition epub_entry.h:93
uint64_t consumed
Bytes delivered to the caller so far.
Definition epub_entry.h:97
uint8_t done
1 once EOF has been reached / reported.
Definition epub_entry.h:98
epub_book_t * book
Owning book (archive + allocator); borrowed.
Definition epub_entry.h:95
uint8_t reserved[k_epub_entry_reader_reserved_bytes]
Padding; keep zero.
Definition epub_entry.h:100
void * iter
Opaque mz_zip_reader_extract_iter_state*; NULL when closed.
Definition epub_entry.h:94
uint64_t total
Entry uncompressed size, bytes.
Definition epub_entry.h:96