2016-02-13 17:29:56 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "common.h"
|
|
|
|
|
2016-02-16 16:15:08 +01:00
|
|
|
typedef enum {
|
2016-02-25 16:57:01 +01:00
|
|
|
T_NAND_BASE, // might not be needed
|
|
|
|
T_NONFAT_ROOT, // might not be needed
|
2016-02-16 16:15:08 +01:00
|
|
|
T_FAT_ROOT,
|
|
|
|
T_FAT_FILE,
|
|
|
|
T_FAT_DIR
|
|
|
|
} EntryType;
|
|
|
|
|
2016-02-25 16:57:01 +01:00
|
|
|
#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];
|
|
|
|
u32 size;
|
2016-02-25 16:57:01 +01:00
|
|
|
EntryType type;
|
2016-02-16 16:15:08 +01:00
|
|
|
} DirEntry;
|
|
|
|
|
2016-02-25 16:57:01 +01:00
|
|
|
typedef struct {
|
|
|
|
u32 n_entries;
|
|
|
|
DirEntry entry[MAX_ENTRIES];
|
|
|
|
} DirStruct;
|
|
|
|
|
2016-02-13 17:29:56 +01:00
|
|
|
bool InitFS();
|
|
|
|
void DeinitFS();
|
|
|
|
|
2016-02-25 16:57:01 +01:00
|
|
|
/** Get directory content under a given path **/
|
|
|
|
DirStruct* GetDirContents(const char* path);
|
2016-02-13 17:29:56 +01:00
|
|
|
|
|
|
|
/** Gets remaining space on SD card in bytes */
|
|
|
|
uint64_t RemainingStorageSpace();
|
|
|
|
|
|
|
|
/** Gets total space on SD card in bytes */
|
|
|
|
uint64_t TotalStorageSpace();
|