aboutsummaryrefslogtreecommitdiff
path: root/filesystem/include/filesystem.h
blob: 3dce87f01e5e5e660482ed62859293e53db5bc11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/*
 * Various filesystem utilities.
 */
#pragma once

#include <stdbool.h>
#include <stddef.h>
#include <stdio.h>

/// Get the file's size.
size_t get_file_size(FILE* file);

/// Read the entire contents of the file into memory.
void* read_file(const char* filepath);

/// Make a path relative to the parent directory of a file.
bool make_relative_path(
    const char* filepath, const char* path, char* relative,
    size_t relative_length);