Commit bf582bd9 authored by Max Kellermann's avatar Max Kellermann

ZeroconfGlue: use struct ConfigData

parent ad866f7a
...@@ -593,7 +593,7 @@ try { ...@@ -593,7 +593,7 @@ try {
instance->neighbors->Open(); instance->neighbors->Open();
#endif #endif
ZeroconfInit(instance->event_loop); ZeroconfInit(GetGlobalConfig(), instance->event_loop);
for (auto &partition : instance->partitions) for (auto &partition : instance->partitions)
StartPlayerThread(partition.pc); StartPlayerThread(partition.pc);
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include "ZeroconfGlue.hxx" #include "ZeroconfGlue.hxx"
#include "ZeroconfAvahi.hxx" #include "ZeroconfAvahi.hxx"
#include "ZeroconfBonjour.hxx" #include "ZeroconfBonjour.hxx"
#include "config/Global.hxx" #include "config/Data.hxx"
#include "config/Option.hxx" #include "config/Option.hxx"
#include "Listen.hxx" #include "Listen.hxx"
#include "util/Domain.hxx" #include "util/Domain.hxx"
...@@ -40,11 +40,11 @@ static constexpr Domain zeroconf_domain("zeroconf"); ...@@ -40,11 +40,11 @@ static constexpr Domain zeroconf_domain("zeroconf");
static int zeroconfEnabled; static int zeroconfEnabled;
void void
ZeroconfInit(gcc_unused EventLoop &loop) ZeroconfInit(const ConfigData &config, gcc_unused EventLoop &loop)
{ {
const char *serviceName; const char *serviceName;
zeroconfEnabled = config_get_bool(ConfigOption::ZEROCONF_ENABLED, zeroconfEnabled = config.GetBool(ConfigOption::ZEROCONF_ENABLED,
DEFAULT_ZEROCONF_ENABLED); DEFAULT_ZEROCONF_ENABLED);
if (!zeroconfEnabled) if (!zeroconfEnabled)
return; return;
...@@ -56,7 +56,7 @@ ZeroconfInit(gcc_unused EventLoop &loop) ...@@ -56,7 +56,7 @@ ZeroconfInit(gcc_unused EventLoop &loop)
return; return;
} }
serviceName = config_get_string(ConfigOption::ZEROCONF_NAME, serviceName = config.GetString(ConfigOption::ZEROCONF_NAME,
SERVICE_NAME); SERVICE_NAME);
#ifdef HAVE_AVAHI #ifdef HAVE_AVAHI
......
...@@ -22,12 +22,13 @@ ...@@ -22,12 +22,13 @@
#include "check.h" #include "check.h"
struct ConfigData;
class EventLoop; class EventLoop;
#ifdef HAVE_ZEROCONF #ifdef HAVE_ZEROCONF
void void
ZeroconfInit(EventLoop &loop); ZeroconfInit(const ConfigData &config, EventLoop &loop);
void void
ZeroconfDeinit(); ZeroconfDeinit();
...@@ -35,7 +36,7 @@ ZeroconfDeinit(); ...@@ -35,7 +36,7 @@ ZeroconfDeinit();
#else /* ! HAVE_ZEROCONF */ #else /* ! HAVE_ZEROCONF */
static inline void static inline void
ZeroconfInit(EventLoop &) ZeroconfInit(const ConfigData &, EventLoop &)
{} {}
static inline void static inline void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment