Now we can generate a fairly basic FS.
Added some test material
This commit is contained in:
@@ -1,8 +1,43 @@
|
||||
//
|
||||
// Created by Manoel.Trapier on 25/05/2022.
|
||||
//
|
||||
/******************************************************************************
|
||||
* MiniFFS : Mini Flat File System
|
||||
* platform/file.h: Specific functions for the File backend
|
||||
*
|
||||
* Copyright (c) 2008-2022 986-Studio. All rights reserved.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef MINIFFS_FILE_H
|
||||
#define MINIFFS_FILE_H
|
||||
#ifndef MINIFFS_PLATFORM_FILE_H
|
||||
#define MINIFFS_PLATFORM_FILE_H
|
||||
|
||||
#endif //MINIFFS_FILE_H
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifdef BUILD_HOST_TOOLS
|
||||
typedef struct fs_fent_t
|
||||
{
|
||||
char name[8];
|
||||
char ext[3];
|
||||
bool deleted;
|
||||
bool mapped;
|
||||
uint32_t size;
|
||||
char *file_pointer;
|
||||
} fs_fent_t;
|
||||
#endif
|
||||
|
||||
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 */
|
||||
uint32_t file_list_size; /***< Size of the list */
|
||||
fs_fent_t *files; /***< File entry list */
|
||||
#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 */
|
||||
|
||||
#endif /* MINIFFS_PLATFORM_FILE_H */
|
||||
|
||||
@@ -1,8 +1,18 @@
|
||||
//
|
||||
// Created by Manoel.Trapier on 25/05/2022.
|
||||
//
|
||||
/******************************************************************************
|
||||
* MiniFFS : Mini Flat File System
|
||||
* platform/memory.h: Specific functions for the Memory backend
|
||||
*
|
||||
* Copyright (c) 2008-2022 986-Studio. All rights reserved.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef MINIFFS_PLATFORM_MEMORY_H
|
||||
#define MINIFFS_PLATFORM_MEMORY_H
|
||||
|
||||
typedef struct miniffs_t
|
||||
{
|
||||
miniffs_header_t *header;
|
||||
void *memoryOffset;
|
||||
} miniffs_t;
|
||||
|
||||
#endif /* MINIFFS_PLATFORM_MEMORY_H */
|
||||
|
||||
Reference in New Issue
Block a user