Merge remote-tracking branch 'origin/main' into LCD_API
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
* @file llfs.h
|
||||
* @brief Linked List Filesystem header (llfs)
|
||||
* @author Lorenz C.
|
||||
* @version 0.1.1
|
||||
*/
|
||||
|
||||
#ifndef LLFS_H
|
||||
@@ -30,20 +31,25 @@ struct llfs_data_file {
|
||||
const struct llfs_data_file* next;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Initialize the llfs filesystem
|
||||
* @note This function should be called before any other llfs function or POSIX file operation (e.g. fopen, fread, ...)
|
||||
* @return 0 on success
|
||||
*/
|
||||
int8_t llfs_init(void);
|
||||
|
||||
/**
|
||||
* @brief Get a list of files in the filesystem
|
||||
* Get a list of all the files in the filesystem.
|
||||
*
|
||||
* Use the filter to filter out files with a filename that do not match the filter. (e.g. "*.txt" or "*.png|*.jpg") (not
|
||||
* implemented yet) Multiple filters can be used by separating them with a pipe (|).
|
||||
* Use the filter to filter out files with a filename that do not match the file extension filter.
|
||||
*
|
||||
* The following members of the llfs_file_t struct are set: name, len and data. @ref llfs_file_t
|
||||
*
|
||||
* @todo Implement file filter
|
||||
*
|
||||
* @param[out] file_list A pointer to an array of llfs_file_t to store the files in @ref llfs_file_t
|
||||
* @param[in] max_files The maximum number of files to return (size of file_list)
|
||||
* @param[in] filter A string with file extensions to filter out. (e.g. "*.txt" or "*.png|*.jpg")
|
||||
* @param[in] filter A string with the file extensions to filter out. (e.g. "*.txt" or "*.png")
|
||||
* @return The number of files returned
|
||||
*/
|
||||
size_t llfs_file_list(llfs_file_t* file_list, size_t max_files, char* filter);
|
||||
@@ -58,4 +64,23 @@ size_t llfs_file_list(llfs_file_t* file_list, size_t max_files, char* filter);
|
||||
*/
|
||||
llfs_file_t* llfs_file_open(const char* name);
|
||||
|
||||
/**
|
||||
* @brief Iterate over all files in the filesystem
|
||||
* For each call (with the same mem pointer) the next file in the filesystem is returned.
|
||||
* The first call should be with mem = NULL.
|
||||
* If a filter is specified, only files with a filename that matches the filter are returned.
|
||||
*
|
||||
* @param[in, out] mem A pointer to a void* that is used internally to keep track of the current file
|
||||
* @param[in] filter A string with file extension to filter out. (e.g. "*.txt" or "*.png")
|
||||
* @return The next file in the filesystem or NULL if there are no more files @ref llfs_file_t
|
||||
*/
|
||||
llfs_file_t* llfs_next_file(void** mem, char* filter);
|
||||
|
||||
/**
|
||||
* @brief Get the number of files in the filesystem
|
||||
*
|
||||
* @return The number of files in the filesystem
|
||||
*/
|
||||
size_t llfs_file_count(void);
|
||||
|
||||
#endif // LLFS_H
|
||||
|
||||
Reference in New Issue
Block a user