summaryrefslogtreecommitdiffstats
path: root/uisimulator
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2011-06-20 20:12:42 +0000
committerThomas Martitz <kugel@rockbox.org>2011-06-20 20:12:42 +0000
commitaf7aaae478b5c7382ae5505abab233a97aa3e658 (patch)
tree566d2e728aefb9f0e6b19edfd3519bf2826339e3 /uisimulator
parent0b9c57d33e59a26b1f341632b990aff0dffd0fcb (diff)
downloadrockbox-af7aaae478b5c7382ae5505abab233a97aa3e658.tar.gz
rockbox-af7aaae478b5c7382ae5505abab233a97aa3e658.tar.bz2
rockbox-af7aaae478b5c7382ae5505abab233a97aa3e658.zip
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 'uisimulator')
-rw-r--r--uisimulator/common/io.c7
1 files changed, 3 insertions, 4 deletions
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;