lib: fs: add library for implementing a filesystem service

This commit is contained in:
2026-03-06 20:17:23 +00:00
parent c4fd252f86
commit 5658e27445
15 changed files with 1506 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
#ifndef FS_ALLOCATOR_H_
#define FS_ALLOCATOR_H_
#include <stddef.h>
struct fs_allocator {
void *fs_arg;
void *(*fs_alloc)(struct fs_allocator *, size_t);
void *(*fs_calloc)(struct fs_allocator *, size_t, size_t);
void *(*fs_realloc)(struct fs_allocator *, void *, size_t);
void (*fs_free)(struct fs_allocator *, void *);
};
extern void *fs_alloc(struct fs_allocator *alloc, size_t count);
extern void *fs_calloc(struct fs_allocator *alloc, size_t count, size_t sz);
extern void *fs_realloc(struct fs_allocator *alloc, void *p, size_t count);
extern void fs_free(struct fs_allocator *alloc, void *p);
#endif