diff options
| author | Amaury Pouly <pamaury@rockbox.org> | 2010-02-16 22:49:11 +0000 |
|---|---|---|
| committer | Amaury Pouly <pamaury@rockbox.org> | 2010-02-16 22:49:11 +0000 |
| commit | 53b1af7a61898ac76a94018fc1863c2a2abf9d3c (patch) | |
| tree | e76ff6264625ca97ccdd02348a687bda0aa38f55 /firmware/include/dircache.h | |
| parent | f82c021b8b382613a8bb5e8915c218bc2277a8c1 (diff) | |
| download | rockbox-53b1af7a61898ac76a94018fc1863c2a2abf9d3c.zip rockbox-53b1af7a61898ac76a94018fc1863c2a2abf9d3c.tar.gz rockbox-53b1af7a61898ac76a94018fc1863c2a2abf9d3c.tar.bz2 rockbox-53b1af7a61898ac76a94018fc1863c2a2abf9d3c.tar.xz | |
-Cosmetic change in a comparison
-Move fat_dir structure out of dircache stack to RAM. Reduce dircache stack size (max level depth should stay be around 20). This should fix nano2g dircache stkov of FS#10679
-Change the structure returned by readdir_cached to match the one returned by readdir_uncached: remove useless fields to save space and avoid any potential incoherence
-Remove one field from the internal structure used by {opend,read,close}dir_cached because it was mostly redundant.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24708 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/include/dircache.h')
| -rw-r--r-- | firmware/include/dircache.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/firmware/include/dircache.h b/firmware/include/dircache.h index b5b1b72..0950d00 100644 --- a/firmware/include/dircache.h +++ b/firmware/include/dircache.h @@ -76,11 +76,20 @@ struct dircache_entry { char *d_name; }; +struct dirent_cached { + char *d_name; + int attribute; + long size; + long startcluster; + unsigned short wrtdate; /* Last write date */ + unsigned short wrttime; /* Last write time */ +}; + typedef struct { bool busy; - struct dircache_entry *entry; - struct dircache_entry *internal_entry; - struct dircache_entry secondary_entry; + struct dirent_cached theent; /* .attribute is set to -1 on init(opendir) */ + /* the two following field can't be used at the same time so have an union */ + struct dircache_entry *internal_entry; /* the current entry in the directory */ DIR_UNCACHED *regulardir; } DIR_CACHED; @@ -111,7 +120,7 @@ void dircache_rename(const char *oldpath, const char *newpath); void dircache_add_file(const char *path, long startcluster); DIR_CACHED* opendir_cached(const char* name); -struct dircache_entry* readdir_cached(DIR_CACHED* dir); +struct dirent_cached* readdir_cached(DIR_CACHED* dir); int closedir_cached(DIR_CACHED *dir); int mkdir_cached(const char *name); int rmdir_cached(const char* name); |