From efe73e143ad8997a791b895c9ee21a68b6570429 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Tue, 31 Jul 2012 10:33:27 +0200 Subject: Fix database tool. It was also broken functionally, probably since a while.So restore the functionality. Run it on the dap, the tcd files will be placed into .rockbox folder. Change-Id: Id7a6ce4389dfaf99799258902be80d630af0601c --- apps/tagcache.c | 14 ++++++++++++-- apps/tagcache.h | 6 +++--- 2 files changed, 15 insertions(+), 5 deletions(-) (limited to 'apps') diff --git a/apps/tagcache.c b/apps/tagcache.c index 1f11f9e49f..7034cacab4 100644 --- a/apps/tagcache.c +++ b/apps/tagcache.c @@ -822,6 +822,8 @@ static long find_tag(int tag, int idx_id, const struct index_entry *idx) return result; } } +#else + (void)idx_id; #endif return idx->tag_seek[tag]; @@ -3110,7 +3112,10 @@ static bool commit(void) return true; } +#ifndef __PCTOOL__ static int tempbuf_handle; +#endif + static void allocate_tempbuf(void) { /* Yeah, malloc would be really nice now :) */ @@ -4483,8 +4488,11 @@ void tagcache_screensync_enable(bool state) tc_stat.syncscreen = state; } - -static void do_tagcache_build(const char *path[]) +#ifndef __PCTOOL__ +/* this is called by the database tool to not pull in global_settings */ +static +#endif +void do_tagcache_build(const char *path[]) { struct tagcache_header header; bool ret; @@ -4595,6 +4603,7 @@ static void do_tagcache_build(const char *path[]) cpu_boost(false); } +#ifndef __PCTOOL__ void tagcache_build(void) { char *vect[MAX_STATIC_ROOTS + 1]; /* +1 to ensure NULL sentinel */ @@ -4606,6 +4615,7 @@ void tagcache_build(void) do_tagcache_build((const char**)vect); } +#endif #ifdef HAVE_TC_RAMCACHE static void load_ramcache(void) diff --git a/apps/tagcache.h b/apps/tagcache.h index c1d0df9bcd..dbe1c92d39 100644 --- a/apps/tagcache.h +++ b/apps/tagcache.h @@ -203,13 +203,13 @@ struct tagcache_search { #ifdef __PCTOOL__ void tagcache_reverse_scan(void); +/* call this directly instead of tagcache_build in order to not pull + * on global_settings */ +void do_tagcache_build(const char *path[]); #endif const char* tagcache_tag_to_str(int tag); -#ifdef CPU_SH -bool tagcache_is_numeric_tag(int type); -#endif bool tagcache_find_index(struct tagcache_search *tcs, const char *filename); bool tagcache_check_clauses(struct tagcache_search *tcs, struct tagcache_search_clause **clause, int count); -- cgit v1.2.3