46 ra8_err_t (*
dir_open)(
void* ctx,
const char* path,
void* directory_state, uint32_t state_bytes);
49 void* directory_state,
61 ra8_err_t (*
rename)(
void* ctx,
const char* old_path,
const char* new_path,
bool replace);
78 uint32_t state_bytes);
80 ra8_err_t (*
read)(
void* ctx,
void* file_state, uint8_t* dst, uint32_t cap, uint32_t* out_read);
83 *
write)(
void* ctx,
void* file_state,
const uint8_t* src, uint32_t len, uint32_t* out_written);
85 ra8_err_t (*
seek)(
void* ctx,
void* file_state, uint64_t absolute_offset);
106 void* transaction_state,
107 uint32_t state_bytes,
108 const char* destination,
112 void* transaction_state,
115 uint32_t* out_written);
117 ra8_err_t (*
seek)(
void* ctx,
void* transaction_state, uint64_t absolute_offset);
120 void* transaction_state,
122 void* validator_ctx);
Architecture-neutral filesystem namespace, stream, and transaction ports.
ra8_err_t fw_fs_bind(fw_fs_t *out, const fw_fs_namespace_iface_t *namespace_iface, const fw_fs_stream_iface_t *stream_iface, const fw_fs_transaction_iface_t *transaction_iface, void *ctx, const fw_fs_caps_t *caps)
Bind segregated vtables and one context into a complete facade.
struct fw_fs_stream_iface fw_fs_stream_iface_t
struct fw_fs_transaction_iface fw_fs_transaction_iface_t
ra8_err_t(* fw_fs_validate_fn_t)(void *ctx, fw_fs_file_t *staged)
Validate staged bytes through a read-only generic file handle.
struct fw_fs_namespace_iface fw_fs_namespace_iface_t
fw_fs_open_mode_t
Open intent for fw_fs_open.
ra8_err_t(* fw_fs_list_fn_t)(void *ctx, const fw_fs_dirent_t *entry, bool *out_continue)
Bounded list callback.
fw_fs_transaction_policy_t
Destination policy for a staged transaction.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Static properties and workspace requirements of one bound port.
Stable caller-owned value returned by fw_fs_dir_next.
Namespace backend operations.
ra8_err_t(* mkdir)(void *ctx, const char *path)
Create one directory leaf.
ra8_err_t(* listdir)(void *ctx, const char *path, uint32_t max_entries, fw_fs_list_fn_t callback, void *callback_ctx, uint32_t *out_count, bool *out_complete)
Enumerate at most the requested number of directory entries.
ra8_err_t(* rmdir)(void *ctx, const char *path)
Remove one empty directory leaf.
ra8_err_t(* rename)(void *ctx, const char *old_path, const char *new_path, bool replace)
Rename one leaf within the backend volume.
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(* stat)(void *ctx, const char *path, fw_fs_stat_t *out)
Query one path without following a symbolic-link leaf.
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(* space)(void *ctx, fw_fs_space_t *out)
Query the volume capacity and available byte count.
ra8_err_t(* dir_close)(void *ctx, void *directory_state)
Close a directory cursor and consume its backend state.
ra8_err_t(* unlink)(void *ctx, const char *path)
Remove one regular-file leaf.
Portable volume usage snapshot.
Result of a portable metadata query.
Open-file backend operations over caller-supplied state.
ra8_err_t(* tell)(void *ctx, void *file_state, uint64_t *out_offset)
Report the current absolute stream position.
ra8_err_t(* close)(void *ctx, void *file_state)
Close the file and release its caller workspace.
ra8_err_t(* open)(void *ctx, const char *path, fw_fs_open_mode_t mode, void *file_state, uint32_t state_bytes)
Initialize caller workspace for one path and open mode.
ra8_err_t(* size)(void *ctx, void *file_state, uint64_t *out_size)
Report the current file length.
ra8_err_t(* read)(void *ctx, void *file_state, uint8_t *dst, uint32_t cap, uint32_t *out_read)
Read bytes at the current stream position.
ra8_err_t(* sync)(void *ctx, void *file_state)
Request backend file durability when supported.
ra8_err_t(* seek)(void *ctx, void *file_state, uint64_t absolute_offset)
Set the absolute stream position.
One complete composition-root filesystem binding.
Staged-publication backend operations over caller-supplied state.
ra8_err_t(* abort)(void *ctx, void *transaction_state)
Close and remove an unpublished private stage.
ra8_err_t(* validate)(void *ctx, void *transaction_state, fw_fs_validate_fn_t validator, void *validator_ctx)
Run a caller validator against the staged stream.
ra8_err_t(* begin)(void *ctx, void *transaction_state, uint32_t state_bytes, const char *destination, fw_fs_transaction_policy_t policy)
Create a private stage for the requested destination policy.
ra8_err_t(* seek)(void *ctx, void *transaction_state, uint64_t absolute_offset)
Set the absolute position within the staged stream.
ra8_err_t(* commit)(void *ctx, void *transaction_state, bool *out_published)
Publish the validated stage under the destination path.