aboutsummaryrefslogtreecommitdiff
path: root/filesystem/include/filesystem.h
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2023-07-11 18:37:45 -0700
committer3gg <3gg@shellblade.net>2023-07-11 18:38:04 -0700
commitfc5886c75ab2626acbc0d7b3db475d17d2cbe01f (patch)
tree1f84aabf268a40ddc6b4f5deef2450fca2171f6e /filesystem/include/filesystem.h
parent2a016de1c2eb45fc5f9c8cebf6b3c726b01ec340 (diff)
Add filesystem library.
Diffstat (limited to 'filesystem/include/filesystem.h')
-rw-r--r--filesystem/include/filesystem.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/filesystem/include/filesystem.h b/filesystem/include/filesystem.h
new file mode 100644
index 0000000..62bd7f0
--- /dev/null
+++ b/filesystem/include/filesystem.h
@@ -0,0 +1,19 @@
1/*
2 * Various filesystem utilities.
3 */
4#pragma once
5
6#include <stdbool.h>
7#include <stddef.h>
8#include <stdio.h>
9
10/// Get the file's size.
11size_t get_file_size(FILE* file);
12
13/// Read the entire contents of the file into memory.
14void* read_file(const char* filepath);
15
16/// Make a path relative to the parent directory of a file.
17bool make_relative_path(
18 size_t max_path_length, const char* filepath, const char* path,
19 char* relative);