Made the memory backend, should somewhat work

This commit is contained in:
Godzil
2022-05-26 15:18:16 +01:00
parent 8fd7ab33fc
commit 52c1735ea1
7 changed files with 268 additions and 28 deletions

View File

@@ -15,8 +15,8 @@
#ifdef BUILD_HOST_TOOLS
typedef struct fs_fent_t
{
char name[8];
char ext[3];
char name[MINIFFS_FILENAME_LENGTH];
char ext[MINIFFS_EXTENSION_LENGTH];
bool deleted;
bool mapped;
uint32_t size;
@@ -27,6 +27,7 @@ typedef struct fs_fent_t
typedef struct miniffs_t
{
miniffs_header_t *header;
#ifdef BUILD_HOST_TOOLS
uint32_t file_count; /***< Number of valid files in the list */
uint32_t file_list_count; /***< Number of items in the list */
@@ -35,9 +36,11 @@ typedef struct miniffs_t
#endif
} miniffs_t;
size_t host_map_file(char *filename, char **dest);
void host_unmap_file(char **dest, size_t length);
miniffs_t *miniffs_openfs(char *host_file); /***< Open a MiniFFS filesystem */
#ifdef __miniffs_internal
size_t host_map_file(char *filename, char **dest);
void host_unmap_file(char **dest, size_t length);
#endif
#endif /* MINIFFS_PLATFORM_FILE_H */

View File

@@ -15,4 +15,6 @@ typedef struct miniffs_t
void *memoryOffset;
} miniffs_t;
miniffs_t *miniffs_openfs(uintptr_t address); /***< Open a MiniFFS filesystem */
#endif /* MINIFFS_PLATFORM_MEMORY_H */