ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
fw_if_fs_ra8_vfs_contracts_internal.h
Go to the documentation of this file.
1
15#pragma once
16
17#include "fw_if_fs_ra8_vfs.h"
18
35
52static uint16_t internal_len(const char* text, uint16_t cap);
53
72static ra8_err_t internal_full_path(fw_fs_ra8_vfs_state_t* state, const char* path, char* out);
73
93static ra8_err_t internal_stat(void* ctx, const char* path, fw_fs_stat_t* out);
94
113static ra8_err_t
114internal_dir_open(void* ctx, const char* path, void* directory_state, uint32_t state_bytes);
115
134static ra8_err_t
135internal_dir_next(void* ctx, void* directory_state, fw_fs_dirent_value_t* out, bool* out_entry);
136
153static ra8_err_t internal_dir_close(void* ctx, void* directory_state);
154
177 const char* path,
178 uint32_t max_entries,
179 fw_fs_list_fn_t callback,
180 void* callback_ctx,
181 uint32_t* out_count,
182 bool* out_complete);
183
199static ra8_err_t internal_mkdir(void* ctx, const char* path);
200
216static ra8_err_t internal_unlink(void* ctx, const char* path);
217
233static ra8_err_t internal_rmdir(void* ctx, const char* path);
234
254static ra8_err_t
255internal_rename(void* ctx, const char* old_path, const char* new_path, bool replace);
256
273static ra8_err_t internal_space(void* ctx, fw_fs_space_t* out);
274
292
314static ra8_err_t internal_open(void* ctx,
315 const char* path,
317 void* file_state,
318 uint32_t state_bytes);
319
339static ra8_err_t
340internal_read(void* ctx, void* file_state, uint8_t* dst, uint32_t cap, uint32_t* out_read);
341
361static ra8_err_t internal_write(void* ctx,
362 void* file_state,
363 const uint8_t* src,
364 uint32_t len,
365 uint32_t* out_written);
366
383static ra8_err_t internal_seek(void* ctx, void* file_state, uint64_t offset);
384
401static ra8_err_t internal_tell(void* ctx, void* file_state, uint64_t* out_offset);
402
419static ra8_err_t internal_size(void* ctx, void* file_state, uint64_t* out_size);
420
437static ra8_err_t internal_close(void* ctx, void* file_state);
438
455static ra8_err_t internal_copy_path(char* out, const char* path);
456
474static ra8_err_t internal_stage_path(const char* destination, uint32_t id, char* out);
475
499 void* transaction_state,
500 uint32_t state_bytes,
501 const char* destination,
503
525 void* transaction_state,
526 const uint8_t* src,
527 uint32_t len,
528 uint32_t* out_written);
529
549static ra8_err_t internal_txn_seek(void* ctx, void* transaction_state, uint64_t offset);
550
571 void* transaction_state,
572 fw_fs_validate_fn_t validator,
573 void* validator_ctx);
574
593static ra8_err_t internal_txn_commit(void* ctx, void* transaction_state, bool* out_published);
594
611static ra8_err_t internal_txn_abort(void* ctx, void* transaction_state);
612
629static ra8_err_t internal_mount_name(fw_fs_ra8_vfs_state_t* state, const char* name);
static uint32_t internal_read(void)
Read current GPT counter ticks, or return UINT32_MAX on err.
Definition main.c:150
Firmware filesystem-port adapter over ra8_io_vfs and ra8_fs.
static ra8_err_t internal_stage_path(const char *destination, uint32_t id, char *out)
Build an 8.3-compatible sibling transaction stage path.
static ra8_err_t internal_txn_commit(void *ctx, void *transaction_state, bool *out_published)
Publish an absent-destination stage by same-mount no-replace rename.
static ra8_err_t internal_seek(void *ctx, void *file_state, uint64_t offset)
Seek an open native VFS file to an absolute byte offset.
static ra8_err_t internal_txn_begin(void *ctx, void *transaction_state, uint32_t state_bytes, const char *destination, fw_fs_transaction_policy_t policy)
Begin a create-new transaction without touching the destination.
static ra8_err_t internal_rename(void *ctx, const char *old_path, const char *new_path, bool replace)
Rename without replacement inside the bound VFS mount.
static ra8_err_t internal_full_path(fw_fs_ra8_vfs_state_t *state, const char *path, char *out)
Prefix one portable path with the bound VFS mount name.
static ra8_err_t internal_space(void *ctx, fw_fs_space_t *out)
Query free space directly from the matching live mount.
static ra8_err_t internal_txn_validate(void *ctx, void *transaction_state, fw_fs_validate_fn_t validator, void *validator_ctx)
Close and reopen the VFS stage so a validator reads stable bytes.
static ra8_err_t internal_write(void *ctx, void *file_state, const uint8_t *src, uint32_t len, uint32_t *out_written)
Write one all-or-error span to an open native VFS file.
static ra8_err_t internal_dir_close(void *ctx, void *directory_state)
Close one repository-filesystem directory cursor.
static uint16_t internal_len(const char *text, uint16_t cap)
Measure a string without reading beyond a fixed byte cap.
static ra8_err_t internal_close(void *ctx, void *file_state)
Close and consume an open native VFS file state.
static ra8_err_t internal_mkdir(void *ctx, const char *path)
Create one directory inside the bound VFS mount.
static ra8_err_t internal_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 a VFS directory while bounding callback delivery.
static ra8_err_t internal_txn_abort(void *ctx, void *transaction_state)
Close and unlink a VFS stage while preserving the destination.
static ra8_err_t internal_txn_seek(void *ctx, void *transaction_state, uint64_t offset)
Seek within the open VFS stage for bounded header or table backfill.
static ra8_err_t internal_copy_path(char *out, const char *path)
Copy one portable path within the fixed binding capacity.
static ra8_err_t internal_rmdir(void *ctx, const char *path)
Remove one empty directory inside the bound VFS mount.
static ra8_err_t internal_mount_name(fw_fs_ra8_vfs_state_t *state, const char *name)
Validate and copy a VFS mount name into adapter state.
static ra8_err_t internal_size(void *ctx, void *file_state, uint64_t *out_size)
Report an open native VFS file's current size.
static ra8_err_t internal_txn_write(void *ctx, void *transaction_state, const uint8_t *src, uint32_t len, uint32_t *out_written)
Write transaction bytes to the open VFS stage.
static ra8_err_t internal_mode(fw_fs_open_mode_t mode, ra8_fs_mode_t *out)
Map portable open modes to the native VFS mode set.
static ra8_err_t internal_tell(void *ctx, void *file_state, uint64_t *out_offset)
Report an open native VFS file's absolute byte offset.
static fw_fs_timestamp_t internal_timestamp(const ra8_fs_timestamp_t *native)
Translate one decoded FAT/exFAT civil timestamp without an epoch.
static ra8_err_t internal_unlink(void *ctx, const char *path)
Unlink one file inside the bound VFS mount.
static ra8_err_t internal_dir_next(void *ctx, void *directory_state, fw_fs_dirent_value_t *out, bool *out_entry)
Copy one native cursor entry and translate its attributes.
static ra8_err_t internal_dir_open(void *ctx, const char *path, void *directory_state, uint32_t state_bytes)
Open an independent repository-filesystem directory cursor.
static ra8_err_t internal_stat(void *ctx, const char *path, fw_fs_stat_t *out)
Convert one VFS stat result to portable metadata.
static ra8_err_t internal_open(void *ctx, const char *path, fw_fs_open_mode_t mode, void *file_state, uint32_t state_bytes)
Open a VFS file into caller-owned workspace.
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.
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.
Definition ra8_err.h:546
ra8_fs_mode_t
File-open modes accepted by ra8_fs_open().
Stable caller-owned value returned by fw_fs_dir_next.
Caller-owned adapter context.
Portable volume usage snapshot.
Result of a portable metadata query.
One portable timestamp and independent availability facts.
One decoded on-disk timestamp plus availability facts.