/****************************************************************************** * 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_PLATFORM_FILE_H #define MINIFFS_PLATFORM_FILE_H #include #include #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 */