summaryrefslogtreecommitdiff
path: root/apps/tagcache.c
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2008-12-15 23:42:19 +0000
committerBjörn Stenberg <bjorn@haxx.se>2008-12-15 23:42:19 +0000
commitee46a3d88e8378e58f01ff0d521477ba0b7201fb (patch)
treead63d929d4ebb1f762faf838ee9da965cfc0ab0b /apps/tagcache.c
parent9f37f04619feb93a6a5adb36e7db6d7ace3c227c (diff)
downloadrockbox-ee46a3d88e8378e58f01ff0d521477ba0b7201fb.tar.gz
rockbox-ee46a3d88e8378e58f01ff0d521477ba0b7201fb.zip
Moved database builder into a separate directory, and gave it its' own Makefile. Now it compiles cleanly and builds a database if ran in root of music tree.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19448 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/tagcache.c')
-rw-r--r--apps/tagcache.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/apps/tagcache.c b/apps/tagcache.c
index b6cfcd5ef5..8e14b9ff17 100644
--- a/apps/tagcache.c
+++ b/apps/tagcache.c
@@ -155,10 +155,12 @@ struct tagcache_command_entry {
155 int32_t data; 155 int32_t data;
156}; 156};
157 157
158#ifndef __PCTOOL__
158static struct tagcache_command_entry command_queue[TAGCACHE_COMMAND_QUEUE_LENGTH]; 159static struct tagcache_command_entry command_queue[TAGCACHE_COMMAND_QUEUE_LENGTH];
159static volatile int command_queue_widx = 0; 160static volatile int command_queue_widx = 0;
160static volatile int command_queue_ridx = 0; 161static volatile int command_queue_ridx = 0;
161static struct mutex command_queue_mutex; 162static struct mutex command_queue_mutex;
163#endif
162 164
163/* Tag database structures. */ 165/* Tag database structures. */
164 166
@@ -633,6 +635,8 @@ static bool get_index(int masterfd, int idxid,
633 return true; 635 return true;
634} 636}
635 637
638#ifndef __PCTOOL__
639
636static bool write_index(int masterfd, int idxid, struct index_entry *idx) 640static bool write_index(int masterfd, int idxid, struct index_entry *idx)
637{ 641{
638 /* We need to exclude all memory only flags & tags when writing to disk. */ 642 /* We need to exclude all memory only flags & tags when writing to disk. */
@@ -678,6 +682,8 @@ static bool write_index(int masterfd, int idxid, struct index_entry *idx)
678 return true; 682 return true;
679} 683}
680 684
685#endif /* !__PCTOOL__ */
686
681static bool open_files(struct tagcache_search *tcs, int tag) 687static bool open_files(struct tagcache_search *tcs, int tag)
682{ 688{
683 if (tcs->idxfd[tag] < 0) 689 if (tcs->idxfd[tag] < 0)
@@ -2993,6 +2999,8 @@ static void free_tempbuf(void)
2993 tempbuf_size = 0; 2999 tempbuf_size = 0;
2994} 3000}
2995 3001
3002#ifndef __PCTOOL__
3003
2996static bool modify_numeric_entry(int masterfd, int idx_id, int tag, long data) 3004static bool modify_numeric_entry(int masterfd, int idx_id, int tag, long data)
2997{ 3005{
2998 struct index_entry idx; 3006 struct index_entry idx;
@@ -3040,6 +3048,7 @@ static bool command_queue_is_full(void)
3040 3048
3041 return (next == command_queue_ridx); 3049 return (next == command_queue_ridx);
3042} 3050}
3051
3043static bool command_queue_sync_callback(void) 3052static bool command_queue_sync_callback(void)
3044{ 3053{
3045 3054
@@ -3152,6 +3161,7 @@ void tagcache_update_numeric(int idx_id, int tag, long data)
3152{ 3161{
3153 queue_command(CMD_UPDATE_NUMERIC, idx_id, tag, data); 3162 queue_command(CMD_UPDATE_NUMERIC, idx_id, tag, data);
3154} 3163}
3164#endif /* !__PCTOOL__ */
3155 3165
3156long tagcache_get_serial(void) 3166long tagcache_get_serial(void)
3157{ 3167{
@@ -3187,6 +3197,8 @@ static bool write_tag(int fd, const char *tagstr, const char *datastr)
3187 return true; 3197 return true;
3188} 3198}
3189 3199
3200#ifndef __PCTOOL__
3201
3190static bool read_tag(char *dest, long size, 3202static bool read_tag(char *dest, long size,
3191 const char *src, const char *tagstr) 3203 const char *src, const char *tagstr)
3192{ 3204{
@@ -3326,7 +3338,6 @@ static int parse_changelog_line(int line_n, const char *buf, void *parameters)
3326 return write_index(masterfd, idx_id, &idx) ? 0 : -5; 3338 return write_index(masterfd, idx_id, &idx) ? 0 : -5;
3327} 3339}
3328 3340
3329#ifndef __PCTOOL__
3330bool tagcache_import_changelog(void) 3341bool tagcache_import_changelog(void)
3331{ 3342{
3332 struct master_header myhdr; 3343 struct master_header myhdr;
@@ -3373,7 +3384,8 @@ bool tagcache_import_changelog(void)
3373 3384
3374 return true; 3385 return true;
3375} 3386}
3376#endif 3387
3388#endif /* !__PCTOOL__ */
3377 3389
3378bool tagcache_create_changelog(struct tagcache_search *tcs) 3390bool tagcache_create_changelog(struct tagcache_search *tcs)
3379{ 3391{