1
0
mirror of https://github.com/mist-devel/mist-board.git synced 2026-02-07 08:27:07 +00:00
Files
mist-devel.mist-board/tests/verilator/sdcard/simpledir.h
2014-12-15 13:29:26 +00:00

25 lines
1017 B
C

#pragma once
#include "simplefile.h"
// Extends simple dir with way of opening files and looking at dirs!
// Not all systems provide this...
struct SimpleDirEntry;
enum SimpleFileStatus file_open_name(char const * path, struct SimpleFile * file);
enum SimpleFileStatus file_open_name_in_dir(struct SimpleDirEntry * entries, char const * filename, struct SimpleFile * file);
enum SimpleFileStatus file_open_dir(struct SimpleDirEntry * filename, struct SimpleFile * file);
// Reads entire dir into memory (i.e. give it a decent chunk of sdram)
enum SimpleFileStatus dir_init(void * mem, int space);
struct SimpleDirEntry * dir_entries_filtered(char const * dirPath, int (*filter)(struct SimpleDirEntry *));
struct SimpleDirEntry * dir_entries(char const * dirPath);
char const * dir_filename(struct SimpleDirEntry *);
char const * dir_path(struct SimpleDirEntry *);
int dir_filesize(struct SimpleDirEntry *);
struct SimpleDirEntry * dir_next(struct SimpleDirEntry *);
int dir_is_subdir(struct SimpleDirEntry *);