diff options
Diffstat (limited to 'firmware/include')
-rw-r--r-- | firmware/include/dir.h | 2 | ||||
-rw-r--r-- | firmware/include/dircache.h | 17 |
2 files changed, 14 insertions, 5 deletions
diff --git a/firmware/include/dir.h b/firmware/include/dir.h index 5aa6cde35a..9ff96e3419 100644 --- a/firmware/include/dir.h +++ b/firmware/include/dir.h | |||
@@ -44,7 +44,7 @@ | |||
44 | #ifdef HAVE_DIRCACHE | 44 | #ifdef HAVE_DIRCACHE |
45 | # include "dircache.h" | 45 | # include "dircache.h" |
46 | # define DIR DIR_CACHED | 46 | # define DIR DIR_CACHED |
47 | # define dirent dircache_entry | 47 | # define dirent dirent_cached |
48 | # define opendir opendir_cached | 48 | # define opendir opendir_cached |
49 | # define closedir closedir_cached | 49 | # define closedir closedir_cached |
50 | # define readdir readdir_cached | 50 | # define readdir readdir_cached |
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 | ||
79 | struct 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 | |||
79 | typedef struct { | 88 | typedef 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); | |||
111 | void dircache_add_file(const char *path, long startcluster); | 120 | void dircache_add_file(const char *path, long startcluster); |
112 | 121 | ||
113 | DIR_CACHED* opendir_cached(const char* name); | 122 | DIR_CACHED* opendir_cached(const char* name); |
114 | struct dircache_entry* readdir_cached(DIR_CACHED* dir); | 123 | struct dirent_cached* readdir_cached(DIR_CACHED* dir); |
115 | int closedir_cached(DIR_CACHED *dir); | 124 | int closedir_cached(DIR_CACHED *dir); |
116 | int mkdir_cached(const char *name); | 125 | int mkdir_cached(const char *name); |
117 | int rmdir_cached(const char* name); | 126 | int rmdir_cached(const char* name); |