aboutsummaryrefslogtreecommitdiff
path: root/filesystem/include/filesystem.h
diff options
context:
space:
mode:
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);