2016-11-15 23:06:01 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "common.h"
|
|
|
|
|
2018-05-11 17:47:41 +02:00
|
|
|
#define MAX_DIR_ENTRIES 2048
|
2016-11-15 23:06:01 +01:00
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
T_ROOT,
|
|
|
|
T_DIR,
|
|
|
|
T_FILE,
|
|
|
|
T_DOTDOT
|
|
|
|
} EntryType;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
char* name; // should point to the correct portion of the path
|
|
|
|
char path[256];
|
|
|
|
u64 size;
|
|
|
|
EntryType type;
|
|
|
|
u8 marked;
|
2018-10-01 23:51:05 +02:00
|
|
|
u8 p_name;
|
2016-11-15 23:06:01 +01:00
|
|
|
} DirEntry;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
u32 n_entries;
|
|
|
|
DirEntry entry[MAX_DIR_ENTRIES];
|
|
|
|
} DirStruct;
|
|
|
|
|
|
|
|
void DirEntryCpy(DirEntry* dest, const DirEntry* orig);
|
|
|
|
void SortDirStruct(DirStruct* contents);
|