33 return inode_new(fs, eOsNodeFile, name, data);
38 return inode_new(fs, eOsNodeDir, name, data);
60 return inode->
type == type;
79 if (index != SIZE_MAX)
fs_inode_t gInvalidFileNode
const char * inode_name(const fs_inode_t *inode)
void * inode_data(fs_inode_t *inode)
os_error_t mkdir_recursive(const char *path, arena_t *arena)
fs_inode_t * inode_new(fs_t *fs, os_dirent_t type, const char *name, const void *data)
fs_inode_t * inode_file(fs_t *fs, const char *name, const void *data)
fs_inode_t * inode_dir(fs_t *fs, const char *name, const void *data)
fs_t * fs_new(void *root, const fs_callbacks_t *cb, const void *data, size_t size, arena_t *arena)
bool inode_is(const fs_inode_t *inode, os_dirent_t type)
void * iter_data(fs_iter_t *iter)
os_dirent_t
directory entry type
CT_NOALIAS CT_BASE_API void * ctu_memcpy(STA_WRITES(size) void *CT_RESTRICT dst, STA_READS(size) const void *CT_RESTRICT src, size_t size)
copy memory from one location to another equivalent to memcpy but with safety checks
#define CT_PATH_SEPERATORS
CT_NODISCARD CT_ARENA_API char * arena_strdup(const char *str, arena_t *arena)
allocate a copy of a string from a custom allocator
CT_NODISCARD CT_ARENA_API char * arena_strndup(STA_READS(len) const char *str, size_t len, arena_t *arena)
allocate a copy of a string with a maximum length from a custom allocator
#define ARENA_MALLOC(size, name, parent, arena)
allocate memory from a custom allocator
#define CT_ASSERT_RANGE(value, min, max)
assert that a value is in a range inclusive bounds check
#define CTASSERT(expr)
assert a condition, prints the condition as a message
CT_PUREFN CT_STD_API size_t str_rfind_any(const char *str, const char *letters)
find the first instance of a set of characters in a string
CT_OS_API os_error_t os_dir_create(const char *path)
check if a directory exists
const fs_callbacks_t * cb
callbacks
fs_inode_t * root
root inode