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

Test-access surface for the EPUB filesystem stream callback. More...

#include <stddef.h>
#include <stdint.h>
#include "epub_fs.h"
#include "ra8_attributes.h"
Include dependency graph for epub_fs_internal.h:

Go to the source code of this file.

Functions

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.

Detailed Description

Test-access surface for the EPUB filesystem stream callback.

Not part of the public API. Focused host tests include this header to drive defensive callback guards on the production source under MC/DC.

Definition in file epub_fs_internal.h.

Function Documentation

◆ priv_epub_fs_stream_read()

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.

Test-access form of the callback bound by epub_open_streamed_fs. It seeks the open ra8_fs file to offset and reads at most len bytes. Production callers keep using the public facade.

Parameters
[in,out]ctxBound epub_stream_fs_ctx_t descriptor.
[in]offsetAbsolute file offset.
[out]bufDestination for up to len bytes.
[in]lenRequested byte count.
Returns
Number of bytes read, or zero when a guard or filesystem operation fails.
Return values
0An argument guard or filesystem operation rejected the request.
lenThe full request was read.
<lenA short read reached the end of the file.
Precondition
When non-null, ctx points to a live epub_stream_fs_ctx_t.
When non-null, buf is writable for len bytes.
Postcondition
At most len bytes are written to buf.
A rejected argument guard performs no filesystem operation.
Note
Test-access only and not thread-safe; mutates the bound file cursor.
MC/DC:
The context-null / file-null / buffer-null OR has one-null-at-a-time and all-valid vectors in test_epub_fs.c.
Since
0.1.0

References RA8_PRIV.