Expand description
Minimal C ABI for Swift interop.
§Handle-based API
All functions operate on an opaque FsHandle obtained from fs_create.
The caller must eventually call fs_destroy to free the handle.
§Buffer ownership
- Buffers passed into Rust (e.g.
datainfs_write_file) are borrowed for the duration of the call. The caller retains ownership. - Buffers returned from Rust (e.g.
fs_list_rootJSON string) are allocated by Rust. The caller must free them withfs_free_string. - For
fs_read_file, the caller provides the output buffer and its capacity.
Structs§
- FsHandle
- Opaque handle to a FilesystemCore instance.
Functions§
- fs_
create ⚠ - Create a new in-memory filesystem handle.
- fs_
create_ ⚠device - Create a filesystem handle backed by a raw block device (e.g.
/dev/xvdf). - fs_
create_ ⚠dir - Create a directory at the given path.
- fs_
create_ ⚠disk - Create a filesystem handle backed by a file on disk.
- fs_
create_ ⚠file - Create a file at the given path.
- fs_
destroy ⚠ - Destroy a filesystem handle and free all associated resources.
- fs_
free_ ⚠string - Free a string previously returned by
fs_list_root. - fs_
init_ ⚠filesystem - Initialize a new filesystem on the block store.
- fs_
list_ ⚠dir - List a directory at the given path. Returns a JSON string.
- fs_
list_ ⚠root - List the root directory. Returns a JSON string.
- fs_open⚠
- Open / mount an existing filesystem from the block store.
- fs_
read_ ⚠file - Read file data into a caller-provided buffer.
- fs_
remove_ ⚠file - Remove a file (or empty directory) at the given path.
- fs_
rename ⚠ - Rename a file or directory. Both paths must share the same parent directory.
- fs_sync⚠
- Sync / flush the filesystem.
- fs_
write_ ⚠file - Write data to a file at the given path.