From cfa01e2eded5e91a9272d1578e48540199c8b2d8 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Sat, 9 Aug 2008 14:41:29 +0200 Subject: - Rename list to lookup, and change it, so a generic lookup callback that will be called with the retrieved data can be specified. - Add filepath to the database schema. --- include/mp3fs.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'include/mp3fs.h') diff --git a/include/mp3fs.h b/include/mp3fs.h index 46d4deb..aac7435 100644 --- a/include/mp3fs.h +++ b/include/mp3fs.h @@ -17,7 +17,7 @@ void traverse_hierarchy(char *, traverse_fn_t); traverse_fn_t mp3_scan; /* - * Data passed to mp3_list. + * Data passed to mp3_lookup. */ struct filler_data { void *buf; @@ -27,13 +27,17 @@ struct filler_data { #define LIST_DATATYPE_STRING 1 #define LIST_DATATYPE_INT 2 -struct listhandle; -struct listhandle *mp3_list_start(int, struct filler_data *, const char *); -void mp3_list_insert(struct listhandle *, void *, int); -void mp3_list_finish(struct listhandle *); +typedef void lookup_fn_t(void *, const char *); +lookup_fn_t mp3_lookup_list; +struct lookuphandle; -void mp3_list_artist(const char *, struct filler_data *); -void mp3_list_genre(const char *, struct filler_data *); +struct lookuphandle *mp3_lookup_start(int, void *, lookup_fn_t *, const char *); +void mp3_lookup_insert(struct lookuphandle *, void *, int); +void mp3_lookup_finish(struct lookuphandle *); + +void mp3_lookup_artist(const char *, struct filler_data *); +void mp3_lookup_genre(const char *, struct filler_data *); char *mp3_gettoken(const char *, int); int mp3_numtoken(const char *); + #endif -- cgit v1.2.3