directory: don't pass fd to traverseAllIn() callbacks

Database traversal should be generic, and not bound to a client
connection.  This is the first step: no file descriptor for the
callback functions forEachSong() and forEachDir().  If a callback
needs the file descriptor, it has to be passed in the void*data
pointer somehow; some callbacks might need a new struct for passing
more than one parameter.  This might look a bit cumbersome right now,
but our goal is to have a clean API.
This commit is contained in:
Max Kellermann
2008-09-07 13:48:24 +02:00
parent d8ef33b710
commit 528be8a0a9
4 changed files with 81 additions and 51 deletions

View File

@@ -37,7 +37,7 @@ struct visited {
static struct visited *visited_heads[TAG_NUM_OF_ITEM_TYPES];
static unsigned num_visited[TAG_NUM_OF_ITEM_TYPES];
static int visit_tag_items(int fd mpd_unused, Song *song, void *data)
static int visit_tag_items(Song *song, void *data)
{
enum tag_type type = (enum tag_type)(size_t)data;
unsigned i;