summaryrefslogtreecommitdiffstats
path: root/apps/tree.h
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2011-08-03 09:49:25 +0000
committerThomas Martitz <kugel@rockbox.org>2011-08-03 09:49:25 +0000
commit98096970e05108e723b64072f2b34187c92733de (patch)
tree14207a691999847d44f309dd6051bd646f6aea68 /apps/tree.h
parentfa5cf8edeaf57c8ad3874c10998021cc3c240df5 (diff)
downloadrockbox-98096970e05108e723b64072f2b34187c92733de.tar.gz
rockbox-98096970e05108e723b64072f2b34187c92733de.tar.bz2
rockbox-98096970e05108e723b64072f2b34187c92733de.zip
Cleanup tree.c cache handling a bit.
* Rename stuff to not re-use the term dircache * Move cache to own struct * Encapsulate retrieving entries a bit git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30242 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/tree.h')
-rw-r--r--apps/tree.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/apps/tree.h b/apps/tree.h
index 104d6c480a..c07b92f298 100644
--- a/apps/tree.h
+++ b/apps/tree.h
@@ -38,6 +38,15 @@ struct entry {
#define BROWSE_SELECTED 0x0100 /* this bit is set if user selected item */
struct tree_context;
+struct tree_cache {
+ /* A big buffer with plenty of entry structs,
+ * contains all files and dirs in the current
+ * dir (with filters applied) */
+ void* entries;
+ char* name_buffer;
+ int max_entries; /* Max entries in the cache */
+ int name_buffer_size; /* in bytes */
+};
struct browse_context {
int dirfilter;
@@ -80,14 +89,7 @@ struct tree_context {
int currtable; /* db use */
int currextra; /* db use */
#endif
- /* A big buffer with plenty of entry structs,
- * contains all files and dirs in the current
- * dir (with filters applied) */
- void* dircache;
- int dircache_count; /* Number of entries in dircache */
- char* name_buffer;
- int name_buffer_size;
- int dentry_size;
+ struct tree_cache cache;
bool dirfull;
int sort_dir; /* directory sort order */
struct browse_context *browse;