diff options
author | Max Kellermann <max@musicpd.org> | 2018-07-17 22:44:16 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2018-07-17 22:44:16 +0200 |
commit | bf582bd969d4f5934264c0e834fcc430e6619b19 (patch) | |
tree | 2fc557fdf036604fb45e27694dfffd3d67020b70 | |
parent | ad866f7a7d4dd02f5f109f04f20eea3aab14fb5a (diff) |
ZeroconfGlue: use struct ConfigData
-rw-r--r-- | src/Main.cxx | 2 | ||||
-rw-r--r-- | src/zeroconf/ZeroconfGlue.cxx | 12 | ||||
-rw-r--r-- | src/zeroconf/ZeroconfGlue.hxx | 5 |
3 files changed, 10 insertions, 9 deletions
diff --git a/src/Main.cxx b/src/Main.cxx index e2eb7e920..d12f0f3f3 100644 --- a/src/Main.cxx +++ b/src/Main.cxx @@ -593,7 +593,7 @@ try { instance->neighbors->Open(); #endif - ZeroconfInit(instance->event_loop); + ZeroconfInit(GetGlobalConfig(), instance->event_loop); for (auto &partition : instance->partitions) StartPlayerThread(partition.pc); diff --git a/src/zeroconf/ZeroconfGlue.cxx b/src/zeroconf/ZeroconfGlue.cxx index 9e704b8fb..e3ecb8eba 100644 --- a/src/zeroconf/ZeroconfGlue.cxx +++ b/src/zeroconf/ZeroconfGlue.cxx @@ -21,7 +21,7 @@ #include "ZeroconfGlue.hxx" #include "ZeroconfAvahi.hxx" #include "ZeroconfBonjour.hxx" -#include "config/Global.hxx" +#include "config/Data.hxx" #include "config/Option.hxx" #include "Listen.hxx" #include "util/Domain.hxx" @@ -40,12 +40,12 @@ static constexpr Domain zeroconf_domain("zeroconf"); static int zeroconfEnabled; void -ZeroconfInit(gcc_unused EventLoop &loop) +ZeroconfInit(const ConfigData &config, gcc_unused EventLoop &loop) { const char *serviceName; - zeroconfEnabled = config_get_bool(ConfigOption::ZEROCONF_ENABLED, - DEFAULT_ZEROCONF_ENABLED); + zeroconfEnabled = config.GetBool(ConfigOption::ZEROCONF_ENABLED, + DEFAULT_ZEROCONF_ENABLED); if (!zeroconfEnabled) return; @@ -56,8 +56,8 @@ ZeroconfInit(gcc_unused EventLoop &loop) return; } - serviceName = config_get_string(ConfigOption::ZEROCONF_NAME, - SERVICE_NAME); + serviceName = config.GetString(ConfigOption::ZEROCONF_NAME, + SERVICE_NAME); #ifdef HAVE_AVAHI AvahiInit(loop, serviceName); diff --git a/src/zeroconf/ZeroconfGlue.hxx b/src/zeroconf/ZeroconfGlue.hxx index 92d2097e6..34672fbc3 100644 --- a/src/zeroconf/ZeroconfGlue.hxx +++ b/src/zeroconf/ZeroconfGlue.hxx @@ -22,12 +22,13 @@ #include "check.h" +struct ConfigData; class EventLoop; #ifdef HAVE_ZEROCONF void -ZeroconfInit(EventLoop &loop); +ZeroconfInit(const ConfigData &config, EventLoop &loop); void ZeroconfDeinit(); @@ -35,7 +36,7 @@ ZeroconfDeinit(); #else /* ! HAVE_ZEROCONF */ static inline void -ZeroconfInit(EventLoop &) +ZeroconfInit(const ConfigData &, EventLoop &) {} static inline void |