diff options
author | Max Kellermann <max@duempel.org> | 2015-01-21 22:13:44 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2015-01-21 23:56:33 +0100 |
commit | 4fa5538e2bed36903b403e1aaee2462d22b456dc (patch) | |
tree | 292b66e10e6b97e2363fde34a81c027a67d3a9fe /src/input/Init.cxx | |
parent | 84e74173de85a3897cfe67150297987f8c8bf52e (diff) | |
download | mpd-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/input/Init.cxx')
-rw-r--r-- | src/input/Init.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/input/Init.cxx b/src/input/Init.cxx index 0debf6d43..4ed44f100 100644 --- a/src/input/Init.cxx +++ b/src/input/Init.cxx @@ -24,7 +24,7 @@ #include "util/Error.hxx" #include "config/ConfigGlobal.hxx" #include "config/ConfigOption.hxx" -#include "config/Param.hxx" +#include "config/Block.hxx" #include "Log.hxx" #include <assert.h> @@ -33,7 +33,7 @@ bool input_stream_global_init(Error &error) { - const config_param empty; + const ConfigBlock empty; for (unsigned i = 0; input_plugins[i] != nullptr; ++i) { const InputPlugin *plugin = input_plugins[i]; @@ -42,17 +42,17 @@ input_stream_global_init(Error &error) assert(*plugin->name != 0); assert(plugin->open != nullptr); - const struct config_param *param = - config_find_block(ConfigOption::INPUT, "plugin", + const auto *block = + config_find_block(ConfigBlockOption::INPUT, "plugin", plugin->name); - if (param == nullptr) { - param = ∅ - } else if (!param->GetBlockValue("enabled", true)) + if (block == nullptr) { + block = ∅ + } else if (!block->GetBlockValue("enabled", true)) /* the plugin is disabled in mpd.conf */ continue; InputPlugin::InitResult result = plugin->init != nullptr - ? plugin->init(*param, error) + ? plugin->init(*block, error) : InputPlugin::InitResult::SUCCESS; switch (result) { |