diff --git a/meson.build b/meson.build index b5548733b..813323ff0 100644 --- a/meson.build +++ b/meson.build @@ -206,6 +206,7 @@ sources = [ 'src/decoder/DecoderPrint.cxx', 'src/client/Listener.cxx', 'src/client/Client.cxx', + 'src/client/Domain.cxx', 'src/client/Event.cxx', 'src/client/Expire.cxx', 'src/client/Global.cxx', diff --git a/src/client/Client.cxx b/src/client/Client.cxx index c141edf3c..2bb326bf8 100644 --- a/src/client/Client.cxx +++ b/src/client/Client.cxx @@ -17,14 +17,12 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "Internal.hxx" +#include "Client.hxx" #include "Partition.hxx" #include "Instance.hxx" #include "util/Domain.hxx" #include "config.h" -const Domain client_domain("client"); - Client::~Client() noexcept { if (FullyBufferedSocket::IsDefined()) diff --git a/src/client/Domain.cxx b/src/client/Domain.cxx new file mode 100644 index 000000000..7487cf1a1 --- /dev/null +++ b/src/client/Domain.cxx @@ -0,0 +1,23 @@ +/* + * Copyright 2003-2019 The Music Player Daemon Project + * http://www.musicpd.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include "Domain.hxx" +#include "util/Domain.hxx" + +const Domain client_domain("client"); diff --git a/src/client/Domain.hxx b/src/client/Domain.hxx new file mode 100644 index 000000000..6c050c835 --- /dev/null +++ b/src/client/Domain.hxx @@ -0,0 +1,25 @@ +/* + * Copyright 2003-2019 The Music Player Daemon Project + * http://www.musicpd.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef MPD_CLIENT_DOMAIN_HXX +#define MPD_CLIENT_DOMAIN_HXX + +extern const class Domain client_domain; + +#endif diff --git a/src/client/Expire.cxx b/src/client/Expire.cxx index 32adf5d54..3f6e57f6e 100644 --- a/src/client/Expire.cxx +++ b/src/client/Expire.cxx @@ -17,7 +17,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "Internal.hxx" +#include "Client.hxx" +#include "Domain.hxx" #include "Log.hxx" void diff --git a/src/client/Internal.hxx b/src/client/Internal.hxx index f9555e0cf..ff05e2a79 100644 --- a/src/client/Internal.hxx +++ b/src/client/Internal.hxx @@ -27,8 +27,6 @@ static constexpr unsigned CLIENT_MAX_SUBSCRIPTIONS = 16; static constexpr unsigned CLIENT_MAX_MESSAGES = 64; -extern const class Domain client_domain; - extern std::chrono::steady_clock::duration client_timeout; extern size_t client_max_command_list_size; extern size_t client_max_output_buffer_size; diff --git a/src/client/New.cxx b/src/client/New.cxx index 6ee1eeedb..5c21d2a7c 100644 --- a/src/client/New.cxx +++ b/src/client/New.cxx @@ -19,6 +19,7 @@ #include "config.h" #include "Internal.hxx" +#include "Domain.hxx" #include "List.hxx" #include "Partition.hxx" #include "Instance.hxx" diff --git a/src/client/Process.cxx b/src/client/Process.cxx index 1f37d6a91..f0820918c 100644 --- a/src/client/Process.cxx +++ b/src/client/Process.cxx @@ -18,6 +18,7 @@ */ #include "Internal.hxx" +#include "Domain.hxx" #include "protocol/Result.hxx" #include "command/AllCommands.hxx" #include "Log.hxx"