summaryrefslogtreecommitdiff
path: root/src/core/vfs.h
diff options
context:
space:
mode:
authoromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-07-19 14:33:34 +1000
committeromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-07-19 14:33:34 +1000
commit82515f9d90ac149984013f0d64c1cab37b349b29 (patch)
tree6da445874d055e3e66ab1825d4aa3bb784955fc9 /src/core/vfs.h
parent5359c011a08ef2e06ed54104cc16c32868ca88ff (diff)
chore clang format + tidy
Diffstat (limited to 'src/core/vfs.h')
-rw-r--r--src/core/vfs.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/core/vfs.h b/src/core/vfs.h
new file mode 100644
index 0000000..41033f5
--- /dev/null
+++ b/src/core/vfs.h
@@ -0,0 +1,38 @@
+#pragma once
+#include "defines.h"
+
+#define MAX_VIRTUAL_FILENAME_LEN 256
+
+typedef struct VFS_Pack VFS_Pack;
+
+const char VFS_OpenErr_DoesNotExist[] = "PATH DOES NOT EXIST";
+
+typedef struct VFS_File {
+ size_t n_bytes;
+ void* data;
+} VFS_File;
+
+// virtual file open result
+typedef struct VFS_FileRes {
+ bool success;
+ const char* error_reason;
+ VFS_File file;
+} VFS_FileRes;
+
+VFS_Pack* VFS_Open(const char* filepath);
+
+bool VFS_Close(VFS_Pack*);
+
+VFS_FileRes VFS_VirtualRead(VFS_Pack* vfs, const char* unique_path);
+
+typedef struct VFS_PackBuilder {
+ const char* pack_filename;
+} VFS_PackBuilder;
+
+typedef struct VFS_FileEntry {
+ char filename[MAX_VIRTUAL_FILENAME_LEN];
+ size_t offset;
+ size_t size;
+} VFS_FileEntry;
+
+VFS_PackBuilder VFS_Pack_Create(); \ No newline at end of file