49 lines
1.1 KiB
C
Raw Normal View History

#pragma once
#include "common.h"
2016-02-16 16:15:08 +01:00
typedef enum {
T_FAT_ROOT,
T_FAT_DIR,
T_FAT_FILE
2016-02-16 16:15:08 +01:00
} EntryType;
#define MAX_ENTRIES 1024
2016-02-16 16:15:08 +01:00
typedef struct {
char* name; // should point to the correct portion of the path
char path[256];
2016-02-27 19:58:41 +01:00
u64 size;
EntryType type;
2016-02-27 19:58:41 +01:00
u8 marked;
2016-02-16 16:15:08 +01:00
} DirEntry;
typedef struct {
u32 n_entries;
DirEntry entry[MAX_ENTRIES];
} DirStruct;
bool InitFS();
void DeinitFS();
2016-02-26 19:43:30 +01:00
/** Create / overwrite file and write the provided data to it **/
bool FileCreate(const char* path, u8* data, u32 size);
/** Recursively copy a file or directory **/
bool PathCopy(const char* destdir, const char* orig);
/** Recursively delete a file or directory **/
bool PathDelete(const char* path);
2016-02-26 19:43:30 +01:00
/** Create a screenshot of the current framebuffer **/
void CreateScreenshot();
2016-02-26 19:43:30 +01:00
/** Get directory content under a given path **/
2016-02-29 16:14:39 +01:00
void GetDirContents(DirStruct* contents, const char* path);
2016-02-27 19:58:41 +01:00
/** Gets remaining space in filesystem in bytes */
uint64_t GetFreeSpace(const char* path);
2016-02-27 19:58:41 +01:00
/** Gets total spacein filesystem in bytes */
uint64_t GetTotalSpace(const char* path);