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 /uisimulator | |
parent | 0b9c57d33e59a26b1f341632b990aff0dffd0fcb (diff) | |
download | rockbox-af7aaae478b5c7382ae5505abab233a97aa3e658.tar.gz 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.c | 7 |
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*); | |||
148 | 148 | ||
149 | 149 | ||
150 | #ifdef HAVE_DIRCACHE | 150 | #ifdef HAVE_DIRCACHE |
151 | struct dircache_entry; | 151 | int dircache_get_entry_id(const char *filename); |
152 | const struct dircache_entry *dircache_get_entry_ptr(const char *filename); | ||
153 | void dircache_add_file(const char *name, long startcluster); | 152 | void dircache_add_file(const char *name, long startcluster); |
154 | void dircache_remove(const char *name); | 153 | void dircache_remove(const char *name); |
155 | void dircache_rename(const char *oldname, const char *newname); | 154 | void dircache_rename(const char *oldname, const char *newname); |
@@ -409,7 +408,7 @@ int sim_open(const char *name, int o, ...) | |||
409 | mode_t mode = va_arg(ap, unsigned int); | 408 | mode_t mode = va_arg(ap, unsigned int); |
410 | ret = OPEN(get_sim_pathname(name), opts, mode); | 409 | ret = OPEN(get_sim_pathname(name), opts, mode); |
411 | #ifdef HAVE_DIRCACHE | 410 | #ifdef HAVE_DIRCACHE |
412 | if (ret >= 0 && !dircache_get_entry_ptr(name)) | 411 | if (ret >= 0 && (dircache_get_entry_id(name) < 0)) |
413 | dircache_add_file(name, 0); | 412 | dircache_add_file(name, 0); |
414 | #endif | 413 | #endif |
415 | va_end(ap); | 414 | va_end(ap); |
@@ -436,7 +435,7 @@ int sim_creat(const char *name, mode_t mode) | |||
436 | int ret = OPEN(get_sim_pathname(name), | 435 | int ret = OPEN(get_sim_pathname(name), |
437 | O_BINARY | O_WRONLY | O_CREAT | O_TRUNC, mode); | 436 | O_BINARY | O_WRONLY | O_CREAT | O_TRUNC, mode); |
438 | #ifdef HAVE_DIRCACHE | 437 | #ifdef HAVE_DIRCACHE |
439 | if (ret >= 0 && !dircache_get_entry_ptr(name)) | 438 | if (ret >= 0 && (dircache_get_entry_id(name) < 0)) |
440 | dircache_add_file(name, 0); | 439 | dircache_add_file(name, 0); |
441 | #endif | 440 | #endif |
442 | return ret; | 441 | return ret; |