db_plugin: introducing a plugin API for the song database

First draft, not really pluggable currently - hard-coded to use the
"simple" plugin, and calls several of its internal functions.

The API is very simple currently, all searches are still performed
over the root "directory" object.  Future changes to the API will move
those search implementations into the plugin, to allow more efficient
implementations, or implementations that don't have the whole tree in
memory all the time.
This commit is contained in:
Max Kellermann
2011-09-05 23:03:05 +02:00
parent 7cc6b63aac
commit 7819aa6b20
8 changed files with 531 additions and 191 deletions

View File

@@ -25,6 +25,7 @@
#include <sys/time.h>
#include <stdbool.h>
struct config_param;
struct directory;
/**
@@ -32,18 +33,12 @@ struct directory;
*
* @param path the absolute path of the database file
*/
void
db_init(const char *path);
bool
db_init(const struct config_param *path, GError **error_r);
void
db_finish(void);
/**
* Clear the database.
*/
void
db_clear(void);
/**
* Returns the root directory object. Returns NULL if there is no
* configured music directory.