22#if __has_include("ra8_fs.h")
34 if ((io ==
nullptr) || (io->file ==
nullptr) || (buf ==
nullptr)) {
37 if (offset > (uint64_t)UINT32_MAX) {
44 const uint32_t want = (len > (size_t)UINT32_MAX) ? UINT32_MAX : (uint32_t)len;
58 if ((mount ==
nullptr) || (path ==
nullptr) || (io ==
nullptr) || (out_book ==
nullptr)) {
77 const uint32_t size = (size64 <= (uint64_t)UINT32_MAX) ? (uint32_t)size64 : 0U;
83 .size = (uint64_t)size,
96 if ((io ==
nullptr) || (book ==
nullptr)) {
100 if (io->file !=
nullptr) {
ra8_err_t epub_close(epub_book_t *book)
Close a previously opened EPUB book.
ra8_err_t epub_open_streamed(const epub_stream_media_t *media, const char *path, epub_book_t *out_book)
Open an EPUB book from a seekable stream, with no whole-file residency (#151).
ra8_fs -> epub bridge: open a .epub straight off a filesystem.
ra8_err_t epub_open_streamed_fs(ra8_fs_mount_t *mount, const char *path, epub_stream_fs_ctx_t *io, epub_book_t *out_book)
Stream-open an EPUB directly off a mounted ra8_fs volume, no residency (#151).
ra8_err_t epub_close_streamed_fs(epub_stream_fs_ctx_t *io, epub_book_t *book)
Close a book opened by epub_open_streamed_fs() and its source file.
Test-access surface for the EPUB filesystem stream callback.
size_t priv_epub_fs_stream_read(void *ctx, uint64_t offset, void *buf, size_t len)
Read one bounded span from a live streamed-filesystem context.
Annotation-attribute framework macros for ra8-firmware.
#define RA8_PRIV
Module-private helper: shared across TUs but only inside one library.
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
@ k_ra8_err_null_ptr
Pointer was NULL where a valid pointer was required.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
ra8_err_t ra8_fs_size(const ra8_fs_file_t *file, uint64_t *out_bytes)
Report the file's size in bytes (64-bit on exFAT, #676).
ra8_err_t ra8_fs_read(ra8_fs_file_t *file, uint8_t *buf, uint32_t max_len, uint32_t *got_len)
Read up to max_len bytes; advance the cluster chain on cluster crossings.
ra8_err_t ra8_fs_open(ra8_fs_mount_t *handle, const char *path, ra8_fs_mode_t mode, ra8_fs_file_t **out_file)
Open or create a file by path, 8.3 or long.
ra8_err_t ra8_fs_close(ra8_fs_file_t *file)
Close an open file, stamping its final modification time.
ra8_err_t ra8_fs_seek(ra8_fs_file_t *file, uint64_t offset_bytes)
Move the file offset to offset_bytes (clamped to size).
@ k_ra8_fs_mode_read
Read-only, must exist.
Backing state for a streamed ra8_fs EPUB open (#151).
Cached parse of one mounted FAT volume.