aboutsummaryrefslogtreecommitdiffstats
path: root/src/database.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-08-08 08:19:30 +0200
committerMax Kellermann <max@duempel.org>2012-08-08 09:28:13 +0200
commitaa55d759f555782dc9cf2f9f6d489502310490a6 (patch)
tree1e9a8c602cb2b1c5dcecc91909fa74084337cafd /src/database.h
parent2043579f71b4f5204272ed8615cffe1c3c4d8473 (diff)
downloadmpd-aa55d759f555782dc9cf2f9f6d489502310490a6.tar.gz
mpd-aa55d759f555782dc9cf2f9f6d489502310490a6.tar.xz
mpd-aa55d759f555782dc9cf2f9f6d489502310490a6.zip
DatabaseGlue: add function db_is_simple()
Preparing for non-"simple" database plugins.
Diffstat (limited to 'src/database.h')
-rw-r--r--src/database.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/database.h b/src/database.h
index 20d132ea1..a22fea823 100644
--- a/src/database.h
+++ b/src/database.h
@@ -44,8 +44,18 @@ void
db_finish(void);
/**
+ * Check whether the default #SimpleDatabasePlugin is used. This
+ * allows using db_get_root(), db_save(), db_get_mtime() and
+ * db_exists().
+ */
+bool
+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.
*/
gcc_pure
struct directory *
@@ -64,18 +74,26 @@ gcc_pure
struct song *
db_get_song(const char *file);
+/**
+ * May only be used if db_is_simple() returns true.
+ */
bool
db_save(GError **error_r);
bool
db_load(GError **error);
+/**
+ * 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.
*/
gcc_pure
static inline bool