From af7aaae478b5c7382ae5505abab233a97aa3e658 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Mon, 20 Jun 2011 20:12:42 +0000 Subject: 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 --- uisimulator/common/io.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'uisimulator') diff --git a/uisimulator/common/io.c b/uisimulator/common/io.c index d094feee6b..71da4fc2ce 100644 --- a/uisimulator/common/io.c +++ b/uisimulator/common/io.c @@ -148,8 +148,7 @@ extern int _wrmdir(const wchar_t*); #ifdef HAVE_DIRCACHE -struct dircache_entry; -const struct dircache_entry *dircache_get_entry_ptr(const char *filename); +int dircache_get_entry_id(const char *filename); void dircache_add_file(const char *name, long startcluster); void dircache_remove(const char *name); void dircache_rename(const char *oldname, const char *newname); @@ -409,7 +408,7 @@ int sim_open(const char *name, int o, ...) mode_t mode = va_arg(ap, unsigned int); ret = OPEN(get_sim_pathname(name), opts, mode); #ifdef HAVE_DIRCACHE - if (ret >= 0 && !dircache_get_entry_ptr(name)) + if (ret >= 0 && (dircache_get_entry_id(name) < 0)) dircache_add_file(name, 0); #endif va_end(ap); @@ -436,7 +435,7 @@ int sim_creat(const char *name, mode_t mode) int ret = OPEN(get_sim_pathname(name), O_BINARY | O_WRONLY | O_CREAT | O_TRUNC, mode); #ifdef HAVE_DIRCACHE - if (ret >= 0 && !dircache_get_entry_ptr(name)) + if (ret >= 0 && (dircache_get_entry_id(name) < 0)) dircache_add_file(name, 0); #endif return ret; -- cgit v1.2.3