aboutsummaryrefslogtreecommitdiffstats
path: root/src/database.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/database.h')
-rw-r--r--src/database.h40
1 files changed, 26 insertions, 14 deletions
diff --git a/src/database.h b/src/database.h
index 67149b20b..9c50bb15e 100644
--- a/src/database.h
+++ b/src/database.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2010 The Music Player Daemon Project
+ * Copyright (C) 2003-2011 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -20,52 +20,64 @@
#ifndef MPD_DATABASE_H
#define MPD_DATABASE_H
+#include "gcc.h"
+
#include <glib.h>
#include <sys/time.h>
#include <stdbool.h>
+struct config_param;
struct directory;
+struct db_selection;
+struct db_visitor;
/**
* Initialize the database library.
*
* @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.
*/
struct directory *
db_get_root(void);
+/**
+ * Caller must lock the #db_mutex.
+ */
+gcc_nonnull(1)
struct directory *
db_get_directory(const char *name);
+gcc_nonnull(1)
struct song *
db_get_song(const char *file);
-int db_walk(const char *name,
- int (*forEachSong)(struct song *, void *),
- int (*forEachDir)(struct directory *, void *), void *data);
+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);
bool
-db_check(void);
+db_check(GError **error_r);
bool
-db_save(void);
+db_save(GError **error_r);
bool
db_load(GError **error);