move-only: Move settings to the common library

The background of this commit is an ongoing effort to decouple the
libbitcoinkernel library from code that is not strictly required by it.
The settings code belongs into the common library and namespace, since
the kernel library should not depend on it. See doc/design/libraries.md
for more information on this rationale.

Changing the namespace of the moved functions is scripted in the
following commit.
This commit is contained in:
TheCharlatan 2023-05-24 15:55:53 +02:00
parent c2dae5d7d8
commit c27e4bdc35
No known key found for this signature in database
GPG Key ID: 9B79B45691DB4173
13 changed files with 21 additions and 17 deletions

View File

@ -143,6 +143,7 @@ BITCOIN_CORE_H = \
compat/compat.h \
compat/cpuid.h \
compat/endian.h \
common/settings.h \
common/system.h \
compressor.h \
consensus/consensus.h \
@ -309,7 +310,6 @@ BITCOIN_CORE_H = \
util/readwritefile.h \
util/result.h \
util/serfloat.h \
util/settings.h \
util/sock.h \
util/spanparsing.h \
util/string.h \
@ -663,6 +663,7 @@ libbitcoin_common_a_SOURCES = \
common/init.cpp \
common/interfaces.cpp \
common/run_command.cpp \
common/settings.cpp \
common/system.cpp \
compressor.cpp \
core_read.cpp \
@ -733,7 +734,6 @@ libbitcoin_util_a_SOURCES = \
util/moneystr.cpp \
util/rbf.cpp \
util/readwritefile.cpp \
util/settings.cpp \
util/thread.cpp \
util/threadinterrupt.cpp \
util/threadnames.cpp \

View File

@ -9,6 +9,7 @@
#include <chainparams.h>
#include <clientversion.h>
#include <common/args.h>
#include <common/settings.h>
#include <cstdint>
#include <hash.h>
#include <logging.h>
@ -21,7 +22,6 @@
#include <univalue.h>
#include <util/fs.h>
#include <util/fs_helpers.h>
#include <util/settings.h>
#include <util/translation.h>
namespace {

View File

@ -6,6 +6,7 @@
#include <common/args.h>
#include <chainparamsbase.h>
#include <common/settings.h>
#include <logging.h>
#include <sync.h>
#include <tinyformat.h>
@ -14,7 +15,6 @@
#include <util/check.h>
#include <util/fs.h>
#include <util/fs_helpers.h>
#include <util/settings.h>
#include <util/strencodings.h>
#ifdef WIN32

View File

@ -5,11 +5,11 @@
#ifndef BITCOIN_COMMON_ARGS_H
#define BITCOIN_COMMON_ARGS_H
#include <common/settings.h>
#include <compat/compat.h>
#include <sync.h>
#include <util/chaintype.h>
#include <util/fs.h>
#include <util/settings.h>
#include <iosfwd>
#include <list>

View File

@ -4,13 +4,13 @@
#include <common/args.h>
#include <common/settings.h>
#include <logging.h>
#include <sync.h>
#include <tinyformat.h>
#include <univalue.h>
#include <util/chaintype.h>
#include <util/fs.h>
#include <util/settings.h>
#include <util/string.h>
#include <algorithm>

View File

@ -2,15 +2,18 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <util/fs.h>
#include <util/settings.h>
#include <common/settings.h>
#include <tinyformat.h>
#include <univalue.h>
#include <util/fs.h>
#include <algorithm>
#include <fstream>
#include <iterator>
#include <map>
#include <string>
#include <utility>
#include <vector>
namespace util {

View File

@ -2,11 +2,12 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_UTIL_SETTINGS_H
#define BITCOIN_UTIL_SETTINGS_H
#ifndef BITCOIN_COMMON_SETTINGS_H
#define BITCOIN_COMMON_SETTINGS_H
#include <util/fs.h>
#include <cstddef>
#include <map>
#include <string>
#include <vector>
@ -111,4 +112,4 @@ auto FindKey(Map&& map, Key&& key) -> decltype(&map.at(key))
} // namespace util
#endif // BITCOIN_UTIL_SETTINGS_H
#endif // BITCOIN_COMMON_SETTINGS_H

View File

@ -6,8 +6,8 @@
#define BITCOIN_INTERFACES_CHAIN_H
#include <blockfilter.h>
#include <common/settings.h>
#include <primitives/transaction.h> // For CTransactionRef
#include <util/settings.h> // For util::SettingsValue
#include <functional>
#include <memory>

View File

@ -5,13 +5,13 @@
#ifndef BITCOIN_INTERFACES_NODE_H
#define BITCOIN_INTERFACES_NODE_H
#include <common/settings.h>
#include <consensus/amount.h> // For CAmount
#include <net.h> // For NodeId
#include <net_types.h> // For banmap_t
#include <netaddress.h> // For Network
#include <netbase.h> // For ConnectionDirection
#include <support/allocators/secure.h> // For SecureString
#include <util/settings.h> // For util::SettingsValue
#include <util/translation.h>
#include <functional>

View File

@ -5,9 +5,9 @@
#ifndef BITCOIN_QT_TEST_OPTIONTESTS_H
#define BITCOIN_QT_TEST_OPTIONTESTS_H
#include <common/settings.h>
#include <qt/optionsmodel.h>
#include <univalue.h>
#include <util/settings.h>
#include <QObject>

View File

@ -5,6 +5,7 @@
#include <blockfilter.h>
#include <clientversion.h>
#include <common/args.h>
#include <common/settings.h>
#include <common/system.h>
#include <common/url.h>
#include <netbase.h>
@ -22,7 +23,6 @@
#include <test/fuzz/util.h>
#include <util/error.h>
#include <util/fees.h>
#include <util/settings.h>
#include <util/strencodings.h>
#include <util/string.h>
#include <util/translation.h>

View File

@ -3,10 +3,10 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <common/args.h>
#include <common/settings.h>
#include <logging.h>
#include <test/util/setup_common.h>
#include <univalue.h>
#include <util/settings.h>
#include <util/strencodings.h>
#include <limits>

View File

@ -2,7 +2,7 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <util/settings.h>
#include <common/settings.h>
#include <test/util/setup_common.h>
#include <test/util/str.h>