summaryrefslogtreecommitdiff
path: root/firmware/include/dircache.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/include/dircache.h')
-rw-r--r--firmware/include/dircache.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/firmware/include/dircache.h b/firmware/include/dircache.h
index b5b1b72c40..0950d0078b 100644
--- a/firmware/include/dircache.h
+++ b/firmware/include/dircache.h
@@ -76,11 +76,20 @@ struct dircache_entry {
76 char *d_name; 76 char *d_name;
77}; 77};
78 78
79struct dirent_cached {
80 char *d_name;
81 int attribute;
82 long size;
83 long startcluster;
84 unsigned short wrtdate; /* Last write date */
85 unsigned short wrttime; /* Last write time */
86};
87
79typedef struct { 88typedef struct {
80 bool busy; 89 bool busy;
81 struct dircache_entry *entry; 90 struct dirent_cached theent; /* .attribute is set to -1 on init(opendir) */
82 struct dircache_entry *internal_entry; 91 /* the two following field can't be used at the same time so have an union */
83 struct dircache_entry secondary_entry; 92 struct dircache_entry *internal_entry; /* the current entry in the directory */
84 DIR_UNCACHED *regulardir; 93 DIR_UNCACHED *regulardir;
85} DIR_CACHED; 94} DIR_CACHED;
86 95
@@ -111,7 +120,7 @@ void dircache_rename(const char *oldpath, const char *newpath);
111void dircache_add_file(const char *path, long startcluster); 120void dircache_add_file(const char *path, long startcluster);
112 121
113DIR_CACHED* opendir_cached(const char* name); 122DIR_CACHED* opendir_cached(const char* name);
114struct dircache_entry* readdir_cached(DIR_CACHED* dir); 123struct dirent_cached* readdir_cached(DIR_CACHED* dir);
115int closedir_cached(DIR_CACHED *dir); 124int closedir_cached(DIR_CACHED *dir);
116int mkdir_cached(const char *name); 125int mkdir_cached(const char *name);
117int rmdir_cached(const char* name); 126int rmdir_cached(const char* name);