33#ifndef PROTOCORE_VFS_H
34#define PROTOCORE_VFS_H
43enum class pc_vfs_mode : uint8_t
58 int (*open)(
const char *path,
int mode);
59 int (*read)(
int handle,
void *buf,
size_t n);
60 int (*write)(
int handle,
const void *buf,
size_t n);
61 void (*close)(
int handle);
62 long (*size)(
const char *path);
63 bool (*exists)(
const char *path);
64 bool (*remove)(
const char *path);
65 bool (*rename)(
const char *from,
const char *to);
69void pc_vfs_mount(
const pc_vfs_backend *backend);
72const pc_vfs_backend *pc_vfs_ram(
void);
75void pc_vfs_ram_format(
void);
82int pc_vfs_open(
const char *path, pc_vfs_mode mode);
84int pc_vfs_read(
int handle,
void *buf,
size_t n);
86int pc_vfs_write(
int handle,
const void *buf,
size_t n);
88void pc_vfs_close(
int handle);
90long pc_vfs_size(
const char *path);
92bool pc_vfs_exists(
const char *path);
94bool pc_vfs_remove(
const char *path);
96bool pc_vfs_rename(
const char *from,
const char *to);
102long pc_vfs_read_file(
const char *path,
void *buf,
size_t cap);
105bool pc_vfs_write_file(
const char *path,
const void *buf,
size_t n);
118const pc_vfs_backend *pc_vfs_fs(fs::FS *filesystem);
User-facing configuration for ProtoCore.