aboutsummaryrefslogtreecommitdiffstats
path: root/src/storage
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-10-07 19:45:40 +0200
committerMax Kellermann <max@duempel.org>2014-10-09 07:45:25 +0200
commit3d2558bde6cebd6b628935f2852572cc7bb6eeab (patch)
treea2dcb1624f8d24cde3918c9ee955aae911c45417 /src/storage
parent1aac0b10c9499db77cbe39e43a0abc8cccc72079 (diff)
downloadmpd-3d2558bde6cebd6b628935f2852572cc7bb6eeab.tar.gz
mpd-3d2558bde6cebd6b628935f2852572cc7bb6eeab.tar.xz
mpd-3d2558bde6cebd6b628935f2852572cc7bb6eeab.zip
StoragePlugin: pass EventLoop to constructor
Diffstat (limited to '')
-rw-r--r--src/storage/Configured.cxx9
-rw-r--r--src/storage/Configured.hxx3
-rw-r--r--src/storage/Registry.cxx4
-rw-r--r--src/storage/Registry.hxx3
-rw-r--r--src/storage/StoragePlugin.hxx4
-rw-r--r--src/storage/plugins/NfsStorage.cxx3
-rw-r--r--src/storage/plugins/SmbclientStorage.cxx3
7 files changed, 18 insertions, 11 deletions
diff --git a/src/storage/Configured.cxx b/src/storage/Configured.cxx
index 800a18ba0..41541673b 100644
--- a/src/storage/Configured.cxx
+++ b/src/storage/Configured.cxx
@@ -31,9 +31,10 @@
#include <assert.h>
static Storage *
-CreateConfiguredStorageUri(const char *uri, Error &error)
+CreateConfiguredStorageUri(EventLoop &event_loop, const char *uri,
+ Error &error)
{
- Storage *storage = CreateStorageURI(uri, error);
+ Storage *storage = CreateStorageURI(event_loop, uri, error);
if (storage == nullptr && !error.IsDefined())
error.Format(config_domain,
"Unrecognized storage URI: %s", uri);
@@ -63,13 +64,13 @@ CreateConfiguredStorageLocal(Error &error)
}
Storage *
-CreateConfiguredStorage(Error &error)
+CreateConfiguredStorage(EventLoop &event_loop, Error &error)
{
assert(!error.IsDefined());
auto uri = config_get_string(CONF_MUSIC_DIR, nullptr);
if (uri != nullptr && uri_has_scheme(uri))
- return CreateConfiguredStorageUri(uri, error);
+ return CreateConfiguredStorageUri(event_loop, uri, error);
return CreateConfiguredStorageLocal(error);
}
diff --git a/src/storage/Configured.hxx b/src/storage/Configured.hxx
index d78857a26..828a192c3 100644
--- a/src/storage/Configured.hxx
+++ b/src/storage/Configured.hxx
@@ -25,6 +25,7 @@
class Error;
class Storage;
+class EventLoop;
/**
* Read storage configuration settings and create a #Storage instance
@@ -32,7 +33,7 @@ class Storage;
* (no #Error set in that case).
*/
Storage *
-CreateConfiguredStorage(Error &error);
+CreateConfiguredStorage(EventLoop &event_loop, Error &error);
/**
* Returns true if there is configuration for a #Storage instance.
diff --git a/src/storage/Registry.cxx b/src/storage/Registry.cxx
index b3fdd1642..d8e273fd5 100644
--- a/src/storage/Registry.cxx
+++ b/src/storage/Registry.cxx
@@ -52,7 +52,7 @@ GetStoragePluginByName(const char *name)
}
Storage *
-CreateStorageURI(const char *uri, Error &error)
+CreateStorageURI(EventLoop &event_loop, const char *uri, Error &error)
{
assert(!error.IsDefined());
@@ -62,7 +62,7 @@ CreateStorageURI(const char *uri, Error &error)
if (plugin.create_uri == nullptr)
continue;
- Storage *storage = plugin.create_uri(uri, error);
+ Storage *storage = plugin.create_uri(event_loop, uri, error);
if (storage != nullptr || error.IsDefined())
return storage;
}
diff --git a/src/storage/Registry.hxx b/src/storage/Registry.hxx
index 9696b3de1..cb3a78f11 100644
--- a/src/storage/Registry.hxx
+++ b/src/storage/Registry.hxx
@@ -26,6 +26,7 @@
struct StoragePlugin;
class Storage;
class Error;
+class EventLoop;
/**
* nullptr terminated list of all storage plugins which were enabled at
@@ -39,6 +40,6 @@ GetStoragePluginByName(const char *name);
gcc_nonnull_all gcc_malloc
Storage *
-CreateStorageURI(const char *uri, Error &error);
+CreateStorageURI(EventLoop &event_loop, const char *uri, Error &error);
#endif
diff --git a/src/storage/StoragePlugin.hxx b/src/storage/StoragePlugin.hxx
index d91caf24b..15f431105 100644
--- a/src/storage/StoragePlugin.hxx
+++ b/src/storage/StoragePlugin.hxx
@@ -24,11 +24,13 @@
class Error;
class Storage;
+class EventLoop;
struct StoragePlugin {
const char *name;
- Storage *(*create_uri)(const char *uri, Error &error);
+ Storage *(*create_uri)(EventLoop &event_loop, const char *uri,
+ Error &error);
};
#endif
diff --git a/src/storage/plugins/NfsStorage.cxx b/src/storage/plugins/NfsStorage.cxx
index 273d0aacc..e28e41a67 100644
--- a/src/storage/plugins/NfsStorage.cxx
+++ b/src/storage/plugins/NfsStorage.cxx
@@ -203,7 +203,8 @@ NfsStorage::OpenDirectory(const char *uri_utf8, Error &error)
}
static Storage *
-CreateNfsStorageURI(const char *base, Error &error)
+CreateNfsStorageURI(gcc_unused EventLoop &event_loop, const char *base,
+ Error &error)
{
if (memcmp(base, "nfs://", 6) != 0)
return nullptr;
diff --git a/src/storage/plugins/SmbclientStorage.cxx b/src/storage/plugins/SmbclientStorage.cxx
index 6eda05073..70a6e16bb 100644
--- a/src/storage/plugins/SmbclientStorage.cxx
+++ b/src/storage/plugins/SmbclientStorage.cxx
@@ -180,7 +180,8 @@ SmbclientDirectoryReader::GetInfo(gcc_unused bool follow, FileInfo &info,
}
static Storage *
-CreateSmbclientStorageURI(const char *base, Error &error)
+CreateSmbclientStorageURI(gcc_unused EventLoop &event_loop, const char *base,
+ Error &error)
{
if (memcmp(base, "smb://", 6) != 0)
return nullptr;