2023-02-21 13:36:20 +00:00
|
|
|
#pragma once
|
|
|
|
#include <stdint-gcc.h>
|
|
|
|
#include "../../../CoreLib/Path.h"
|
2023-02-23 22:54:02 +00:00
|
|
|
#include "vfs_types.h"
|
|
|
|
#include "vfs_types.h"
|
2023-02-21 13:36:20 +00:00
|
|
|
class VirtualFileSystem
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static void initialize();
|
2023-02-23 22:54:02 +00:00
|
|
|
static void Mount(filesystem* fs, const char* name);
|
|
|
|
|
|
|
|
static int register_filesystem(struct filesystem* fs);
|
|
|
|
|
2023-02-26 12:44:41 +00:00
|
|
|
static FILE* open(const char* pathname, int flags);
|
|
|
|
static int close(struct FILE* file);
|
|
|
|
static int write(struct FILE* file, const void* buf, unsigned int len);
|
|
|
|
static int read(struct FILE* file, void* buf, unsigned int len);
|
2023-02-21 13:36:20 +00:00
|
|
|
|
|
|
|
private:
|
2023-02-23 22:54:02 +00:00
|
|
|
static vfsmount* rootfs;
|
|
|
|
|
|
|
|
|
|
|
|
static int mount_number;
|
|
|
|
static int superblock_number;
|
|
|
|
static int filesystem_number;
|
|
|
|
|
|
|
|
static filesystem* filesystems[];
|
2023-02-26 12:44:41 +00:00
|
|
|
static FS_SUPER* superblocks[];
|
2023-02-23 22:54:02 +00:00
|
|
|
static vfsmount* mounts[];
|
|
|
|
|
|
|
|
};
|
|
|
|
|