Added filesystem module

This commit is contained in:
rxi
2016-09-29 19:22:29 +01:00
parent a20901c2ba
commit 2689bfc2fa
4 changed files with 501 additions and 5 deletions

30
src/filesystem.h Normal file
View File

@@ -0,0 +1,30 @@
/**
* Copyright (c) 2016 rxi
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the MIT license. See LICENSE for details.
*/
#ifndef FILESYSTEM_H
#define FILESYSTEM_H
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
enum {
FILESYSTEM_ESUCCESS = 0,
FILESYSTEM_EFAILURE = -1,
};
const char* filesystem_strerror(int err);
void filesystem_deinit(void);
int filesystem_mount(const char *path);
int filesystem_unmount(const char *path);
int filesystem_exists(const char *filename);
int filesystem_isFile(const char *filename);
int filesystem_isDirectory(const char *filename);
void* filesystem_read(const char *filename, int *size);
void filesystem_free(void *ptr);
#endif