aboutsummaryrefslogtreecommitdiffstats
path: root/src/neighbor
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2015-01-21 22:13:44 +0100
committerMax Kellermann <max@duempel.org>2015-01-21 23:56:33 +0100
commit4fa5538e2bed36903b403e1aaee2462d22b456dc (patch)
tree292b66e10e6b97e2363fde34a81c027a67d3a9fe /src/neighbor
parent84e74173de85a3897cfe67150297987f8c8bf52e (diff)
downloadmpd-4fa5538e2bed36903b403e1aaee2462d22b456dc.tar.gz
mpd-4fa5538e2bed36903b403e1aaee2462d22b456dc.tar.xz
mpd-4fa5538e2bed36903b403e1aaee2462d22b456dc.zip
config/Param: split block-specific attributes to new struct ConfigBlock
The old struct config_param remains only for top-level string options.
Diffstat (limited to 'src/neighbor')
-rw-r--r--src/neighbor/Glue.cxx16
-rw-r--r--src/neighbor/NeighborPlugin.hxx4
-rw-r--r--src/neighbor/plugins/SmbclientNeighborPlugin.cxx2
-rw-r--r--src/neighbor/plugins/UpnpNeighborPlugin.cxx2
4 files changed, 12 insertions, 12 deletions
diff --git a/src/neighbor/Glue.cxx b/src/neighbor/Glue.cxx
index 57383b1d5..4d5d7b4b0 100644
--- a/src/neighbor/Glue.cxx
+++ b/src/neighbor/Glue.cxx
@@ -24,8 +24,8 @@
#include "NeighborPlugin.hxx"
#include "Info.hxx"
#include "config/ConfigGlobal.hxx"
-#include "config/Param.hxx"
#include "config/ConfigError.hxx"
+#include "config/Block.hxx"
#include "util/Error.hxx"
NeighborGlue::Explorer::~Explorer()
@@ -37,9 +37,9 @@ NeighborGlue::~NeighborGlue() {}
static NeighborExplorer *
CreateNeighborExplorer(EventLoop &loop, NeighborListener &listener,
- const config_param &param, Error &error)
+ const ConfigBlock &block, Error &error)
{
- const char *plugin_name = param.GetBlockValue("plugin");
+ const char *plugin_name = block.GetBlockValue("plugin");
if (plugin_name == nullptr) {
error.Set(config_domain,
"Missing \"plugin\" configuration");
@@ -53,18 +53,18 @@ CreateNeighborExplorer(EventLoop &loop, NeighborListener &listener,
return nullptr;
}
- return plugin->create(loop, listener, param, error);
+ return plugin->create(loop, listener, block, error);
}
bool
NeighborGlue::Init(EventLoop &loop, NeighborListener &listener, Error &error)
{
- for (const auto *param = config_get_param(ConfigOption::NEIGHBORS);
- param != nullptr; param = param->next) {
+ for (const auto *block = config_get_block(ConfigBlockOption::NEIGHBORS);
+ block != nullptr; block = block->next) {
NeighborExplorer *explorer =
- CreateNeighborExplorer(loop, listener, *param, error);
+ CreateNeighborExplorer(loop, listener, *block, error);
if (explorer == nullptr) {
- error.FormatPrefix("Line %i: ", param->line);
+ error.FormatPrefix("Line %i: ", block->line);
return false;
}
diff --git a/src/neighbor/NeighborPlugin.hxx b/src/neighbor/NeighborPlugin.hxx
index 6ef2d88c6..116f47c50 100644
--- a/src/neighbor/NeighborPlugin.hxx
+++ b/src/neighbor/NeighborPlugin.hxx
@@ -20,7 +20,7 @@
#ifndef MPD_NEIGHBOR_PLUGIN_HXX
#define MPD_NEIGHBOR_PLUGIN_HXX
-struct config_param;
+struct ConfigBlock;
class Error;
class EventLoop;
class NeighborListener;
@@ -33,7 +33,7 @@ struct NeighborPlugin {
* Allocates and configures a #NeighborExplorer instance.
*/
NeighborExplorer *(*create)(EventLoop &loop, NeighborListener &listener,
- const config_param &param,
+ const ConfigBlock &block,
Error &error);
};
diff --git a/src/neighbor/plugins/SmbclientNeighborPlugin.cxx b/src/neighbor/plugins/SmbclientNeighborPlugin.cxx
index cf922b2db..d4c73f9a8 100644
--- a/src/neighbor/plugins/SmbclientNeighborPlugin.cxx
+++ b/src/neighbor/plugins/SmbclientNeighborPlugin.cxx
@@ -273,7 +273,7 @@ SmbclientNeighborExplorer::ThreadFunc(void *ctx)
static NeighborExplorer *
smbclient_neighbor_create(gcc_unused EventLoop &loop,
NeighborListener &listener,
- gcc_unused const config_param &param,
+ gcc_unused const ConfigBlock &block,
gcc_unused Error &error)
{
if (!SmbclientInit(error))
diff --git a/src/neighbor/plugins/UpnpNeighborPlugin.cxx b/src/neighbor/plugins/UpnpNeighborPlugin.cxx
index f04cd63df..28775df4c 100644
--- a/src/neighbor/plugins/UpnpNeighborPlugin.cxx
+++ b/src/neighbor/plugins/UpnpNeighborPlugin.cxx
@@ -127,7 +127,7 @@ UpnpNeighborExplorer::LostUPnP(const ContentDirectoryService &service)
static NeighborExplorer *
upnp_neighbor_create(gcc_unused EventLoop &loop,
NeighborListener &listener,
- gcc_unused const config_param &param,
+ gcc_unused const ConfigBlock &block,
gcc_unused Error &error)
{
return new UpnpNeighborExplorer(listener);