diff options
author | Thomas Martitz <kugel@rockbox.org> | 2011-06-20 20:12:42 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2011-06-20 20:12:42 +0000 |
commit | af7aaae478b5c7382ae5505abab233a97aa3e658 (patch) | |
tree | 566d2e728aefb9f0e6b19edfd3519bf2826339e3 /firmware/include/dircache.h | |
parent | 0b9c57d33e59a26b1f341632b990aff0dffd0fcb (diff) |
Dircache: Don't expose struct dircache_entry and pointers into the cache, use IDs instead.
Only integer IDs are exposed from dircache with this. This way the cache is isolated from other modules.
This is needed for my buflib gsoc project.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30038 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/include/dircache.h')
-rw-r--r-- | firmware/include/dircache.h | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/firmware/include/dircache.h b/firmware/include/dircache.h index 908165cf3c..585bb10fbc 100644 --- a/firmware/include/dircache.h +++ b/firmware/include/dircache.h @@ -47,22 +47,6 @@ struct travel_data { int pathpos; }; -#define MAX_PENDING_BINDINGS 2 -struct fdbind_queue { - char path[MAX_PATH]; - int fd; -}; - -/* Exported structures. */ -struct dircache_entry { - struct dirinfo info; - struct dircache_entry *next; - struct dircache_entry *up; - struct dircache_entry *down; - long startcluster; - char *d_name; -}; - struct dirent_cached { struct dirinfo info; char *d_name; @@ -72,7 +56,7 @@ struct dirent_cached { typedef struct { bool busy; struct dirent_cached theent; /* .attribute is set to -1 on init(opendir) */ - struct dircache_entry *internal_entry; /* the current entry in the directory */ + int internal_entry; /* the current entry in the directory */ DIR_UNCACHED *regulardir; } DIR_CACHED; @@ -90,8 +74,12 @@ int dircache_get_cache_size(void); int dircache_get_reserve_used(void); int dircache_get_build_ticks(void); void dircache_disable(void); -const struct dircache_entry *dircache_get_entry_ptr(const char *filename); -size_t dircache_copy_path(const struct dircache_entry *entry, char *buf, size_t size); +int dircache_get_entry_id(const char *filename); +size_t dircache_copy_path(int index, char *buf, size_t size); + +/* the next two are internal for file.c */ +long _dircache_get_entry_startcluster(int id); +struct dirinfo* _dircache_get_entry_dirinfo(int id); void dircache_bind(int fd, const char *path); void dircache_update_filesize(int fd, long newsize, long startcluster); |