summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2012-07-31 10:33:27 +0200
committerThomas Martitz <kugel@rockbox.org>2012-07-31 10:33:27 +0200
commitefe73e143ad8997a791b895c9ee21a68b6570429 (patch)
treed206dd97632286975a271ea1502f35b56165767f /apps
parentb358bcfc25272cb03dc95809c0c82688943f0f84 (diff)
downloadrockbox-efe73e143ad8997a791b895c9ee21a68b6570429.tar.gz
rockbox-efe73e143ad8997a791b895c9ee21a68b6570429.zip
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
Diffstat (limited to 'apps')
-rw-r--r--apps/tagcache.c14
-rw-r--r--apps/tagcache.h6
2 files changed, 15 insertions, 5 deletions
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)
822 return result; 822 return result;
823 } 823 }
824 } 824 }
825#else
826 (void)idx_id;
825#endif 827#endif
826 828
827 return idx->tag_seek[tag]; 829 return idx->tag_seek[tag];
@@ -3110,7 +3112,10 @@ static bool commit(void)
3110 return true; 3112 return true;
3111} 3113}
3112 3114
3115#ifndef __PCTOOL__
3113static int tempbuf_handle; 3116static int tempbuf_handle;
3117#endif
3118
3114static void allocate_tempbuf(void) 3119static void allocate_tempbuf(void)
3115{ 3120{
3116 /* Yeah, malloc would be really nice now :) */ 3121 /* Yeah, malloc would be really nice now :) */
@@ -4483,8 +4488,11 @@ void tagcache_screensync_enable(bool state)
4483 tc_stat.syncscreen = state; 4488 tc_stat.syncscreen = state;
4484} 4489}
4485 4490
4486 4491#ifndef __PCTOOL__
4487static void do_tagcache_build(const char *path[]) 4492/* this is called by the database tool to not pull in global_settings */
4493static
4494#endif
4495void do_tagcache_build(const char *path[])
4488{ 4496{
4489 struct tagcache_header header; 4497 struct tagcache_header header;
4490 bool ret; 4498 bool ret;
@@ -4595,6 +4603,7 @@ static void do_tagcache_build(const char *path[])
4595 cpu_boost(false); 4603 cpu_boost(false);
4596} 4604}
4597 4605
4606#ifndef __PCTOOL__
4598void tagcache_build(void) 4607void tagcache_build(void)
4599{ 4608{
4600 char *vect[MAX_STATIC_ROOTS + 1]; /* +1 to ensure NULL sentinel */ 4609 char *vect[MAX_STATIC_ROOTS + 1]; /* +1 to ensure NULL sentinel */
@@ -4606,6 +4615,7 @@ void tagcache_build(void)
4606 4615
4607 do_tagcache_build((const char**)vect); 4616 do_tagcache_build((const char**)vect);
4608} 4617}
4618#endif
4609 4619
4610#ifdef HAVE_TC_RAMCACHE 4620#ifdef HAVE_TC_RAMCACHE
4611static void load_ramcache(void) 4621static 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 {
203 203
204#ifdef __PCTOOL__ 204#ifdef __PCTOOL__
205void tagcache_reverse_scan(void); 205void tagcache_reverse_scan(void);
206/* call this directly instead of tagcache_build in order to not pull
207 * on global_settings */
208void do_tagcache_build(const char *path[]);
206#endif 209#endif
207 210
208const char* tagcache_tag_to_str(int tag); 211const char* tagcache_tag_to_str(int tag);
209 212
210#ifdef CPU_SH
211bool tagcache_is_numeric_tag(int type);
212#endif
213bool tagcache_find_index(struct tagcache_search *tcs, const char *filename); 213bool tagcache_find_index(struct tagcache_search *tcs, const char *filename);
214bool tagcache_check_clauses(struct tagcache_search *tcs, 214bool tagcache_check_clauses(struct tagcache_search *tcs,
215 struct tagcache_search_clause **clause, int count); 215 struct tagcache_search_clause **clause, int count);