diff options
Diffstat (limited to '')
-rw-r--r-- | src/DatabaseSimple.hxx (renamed from src/database.h) | 61 |
1 files changed, 24 insertions, 37 deletions
diff --git a/src/database.h b/src/DatabaseSimple.hxx index f877b74d3..e57ae41bf 100644 --- a/src/database.h +++ b/src/DatabaseSimple.hxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2011 The Music Player Daemon Project + * Copyright (C) 2003-2013 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -17,8 +17,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef MPD_DATABASE_H -#define MPD_DATABASE_H +#ifndef MPD_DATABASE_SIMPLE_HXX +#define MPD_DATABASE_SIMPLE_HXX #include "gcc.h" @@ -28,68 +28,55 @@ #include <stdbool.h> struct config_param; -struct directory; +struct Directory; struct db_selection; struct db_visitor; /** - * Initialize the database library. - * - * @param path the absolute path of the database file + * Check whether the default #SimpleDatabasePlugin is used. This + * allows using db_get_root(), db_save(), db_get_mtime() and + * db_exists(). */ bool -db_init(const struct config_param *path, GError **error_r); - -void -db_finish(void); +db_is_simple(void); /** * Returns the root directory object. Returns NULL if there is no * configured music directory. + * + * May only be used if db_is_simple() returns true. */ -G_GNUC_PURE -struct directory * +gcc_pure +Directory * db_get_root(void); /** * Caller must lock the #db_mutex. */ gcc_nonnull(1) -G_GNUC_PURE -struct directory * +gcc_pure +Directory * db_get_directory(const char *name); -gcc_nonnull(1) -G_GNUC_PURE -struct song * -db_get_song(const char *file); - -gcc_nonnull(1,2) -bool -db_visit(const struct db_selection *selection, - const struct db_visitor *visitor, void *ctx, - GError **error_r); - -gcc_nonnull(1,2) -bool -db_walk(const char *uri, - const struct db_visitor *visitor, void *ctx, - GError **error_r); - +/** + * May only be used if db_is_simple() returns true. + */ bool db_save(GError **error_r); -bool -db_load(GError **error); - -G_GNUC_PURE +/** + * May only be used if db_is_simple() returns true. + */ +gcc_pure time_t db_get_mtime(void); /** * Returns true if there is a valid database file on the disk. + * + * May only be used if db_is_simple() returns true. */ -G_GNUC_PURE +gcc_pure static inline bool db_exists(void) { |