43 if (names ==
nullptr) {
73 if (workspace ==
nullptr) {
79 if ((align == 0U) || (((uint32_t)align & ((uint32_t)align - 1U)) != 0U)) {
104 if (directory ==
nullptr) {
154 uint32_t workspace_size)
160 if (directory ==
nullptr) {
184 .state_bytes = workspace_size,
196 if ((out ==
nullptr) || (out_entry ==
nullptr)) {
202 bool present =
false;
205 if ((result !=
k_ra8_ok) || !present) {
Architecture-neutral filesystem namespace, stream, and transaction ports.
ra8_err_t fw_fs_path_validate(const fw_fs_caps_t *caps, const char *path)
Validate a canonical portable path against a binding's limits.
Backend-author interface for binding concrete filesystem ports.
static ra8_err_t internal_cursor_names(const fw_fs_namespace_t *names)
Validate one namespace facade used for cursor dispatch.
static ra8_err_t internal_cursor_workspace(void *workspace, uint32_t bytes, uint32_t need, uint8_t align)
Validate cursor workspace size and alignment.
static ra8_err_t internal_cursor_handle(const fw_fs_dir_t *directory)
Validate an open directory cursor before dispatch.
static ra8_err_t internal_cursor_entry(const fw_fs_caps_t *caps, const fw_fs_dirent_value_t *entry)
Validate one backend-produced stable directory value.
ra8_err_t fw_fs_dir_next(fw_fs_dir_t *directory, fw_fs_dirent_value_t *out, bool *out_entry)
Copy one stable directory entry from an open cursor.
ra8_err_t fw_fs_dir_close(fw_fs_dir_t *directory)
Close and consume an open directory cursor, including on close error.
ra8_err_t fw_fs_dir_open(const fw_fs_namespace_t *names, const char *path, fw_fs_dir_t *directory, void *workspace, uint32_t workspace_size)
Open one directory cursor into caller-owned backend workspace.
@ k_fw_fs_node_none
No node exists at the path.
@ k_fw_fs_node_directory
Directory.
@ k_fw_fs_node_other
Backend-specific non-file node.
@ k_fw_fs_path_cap
Largest portable path including its NUL.
Annotation-attribute framework macros for ra8-firmware.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
Error Code Definitions for ra8-firmware.
@ k_ra8_err_no_mem
Static buffer exhausted (no dynamic memory on this project).
@ k_ra8_err_busy
Resource busy – blocking operation cannot proceed.
@ k_ra8_err_invalid_arg
Invalid function argument.
@ k_ra8_err_invalid_state
Module in wrong state for requested operation.
@ k_ra8_err_not_initialized
Module not initialized – _init() not yet called successfully.
@ 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.
void * memcpy(void *dst, const void *src, size_t n)
Copy memory area between non-overlapping regions.
size_t strnlen(const char *s, size_t maxlen)
Calculate bounded string length.
Static properties and workspace requirements of one bound port.
uint16_t name_max_bytes
Component bytes excluding NUL.
uint8_t directory_workspace_align
Required directory-state alignment.
uint32_t directory_workspace_bytes
State bytes required by dir open.
Caller-owned open directory cursor; fields are private to the facade.
void * state
Caller workspace.
void * ctx
Adapter context.
fw_fs_caps_t caps
Immutable port caps.
bool is_open
Facade lifecycle guard.
const fw_fs_namespace_iface_t * iface
Bound namespace vtable.
Stable caller-owned value returned by fw_fs_dir_next.
uint64_t size_bytes
File length; zero for dirs.
uint16_t name_bytes
Bytes excluding the NUL.
fw_fs_node_type_t type
Entry kind.
char name[k_fw_fs_path_cap]
Copied NUL-terminated leaf.
ra8_err_t(* dir_open)(void *ctx, const char *path, void *directory_state, uint32_t state_bytes)
Open a directory cursor in caller-supplied workspace.
ra8_err_t(* dir_next)(void *ctx, void *directory_state, fw_fs_dirent_value_t *out, bool *out_entry)
Copy the next visible entry or report clean end-of-directory.
ra8_err_t(* dir_close)(void *ctx, void *directory_state)
Close a directory cursor and consume its backend state.
Independently injectable path/namespace facade.
fw_fs_caps_t caps
Immutable capabilities.
void * ctx
Backend context.
const fw_fs_namespace_iface_t * iface
Bound private vtable.