summaryrefslogtreecommitdiff
path: root/apps/tagcache.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/tagcache.h')
-rw-r--r--apps/tagcache.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/apps/tagcache.h b/apps/tagcache.h
index ddbb8e1dac..052d71b42b 100644
--- a/apps/tagcache.h
+++ b/apps/tagcache.h
@@ -39,14 +39,30 @@ enum tag_type { tag_artist = 0, tag_album, tag_genre, tag_title,
39 39
40#define SEEK_LIST_SIZE 50 40#define SEEK_LIST_SIZE 50
41#define TAGCACHE_MAX_FILTERS 3 41#define TAGCACHE_MAX_FILTERS 3
42#define TAGCACHE_MAX_CLAUSES 10
43
44enum clause { clause_none, clause_is, clause_gt, clause_gteq, clause_lt,
45 clause_lteq, clause_contains, clause_begins_with, clause_ends_with };
46enum modifies { clause_mod_none, clause_mod_not };
47
48struct tagcache_search_clause
49{
50 int tag;
51 int type;
52 bool numeric;
53 long numeric_data;
54 char str[32];
55};
42 56
43struct tagcache_search { 57struct tagcache_search {
44 /* For internal use only. */ 58 /* For internal use only. */
45 int fd; 59 int fd, masterfd;
46 long seek_list[SEEK_LIST_SIZE]; 60 long seek_list[SEEK_LIST_SIZE];
47 long filter_tag[TAGCACHE_MAX_FILTERS]; 61 long filter_tag[TAGCACHE_MAX_FILTERS];
48 long filter_seek[TAGCACHE_MAX_FILTERS]; 62 long filter_seek[TAGCACHE_MAX_FILTERS];
49 int filter_count; 63 int filter_count;
64 struct tagcache_search_clause *clause[TAGCACHE_MAX_CLAUSES];
65 int clause_count;
50 int seek_list_count; 66 int seek_list_count;
51 int seek_pos; 67 int seek_pos;
52 int idx_id; 68 int idx_id;
@@ -62,9 +78,12 @@ struct tagcache_search {
62 long result_seek; 78 long result_seek;
63}; 79};
64 80
81bool tagcache_is_numeric_tag(int type);
65bool tagcache_search(struct tagcache_search *tcs, int tag); 82bool tagcache_search(struct tagcache_search *tcs, int tag);
66bool tagcache_search_add_filter(struct tagcache_search *tcs, 83bool tagcache_search_add_filter(struct tagcache_search *tcs,
67 int tag, int seek); 84 int tag, int seek);
85bool tagcache_search_add_clause(struct tagcache_search *tcs,
86 struct tagcache_search_clause *clause);
68bool tagcache_get_next(struct tagcache_search *tcs); 87bool tagcache_get_next(struct tagcache_search *tcs);
69void tagcache_search_finish(struct tagcache_search *tcs); 88void tagcache_search_finish(struct tagcache_search *tcs);
70long tagcache_get_numeric(const struct tagcache_search *tcs, int tag); 89long tagcache_get_numeric(const struct tagcache_search *tcs, int tag);