Skip to content

Commit c27e4bd

Browse files
committed
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.
1 parent c2dae5d commit c27e4bd

File tree

13 files changed

+21
-17
lines changed

13 files changed

+21
-17
lines changed

src/Makefile.am

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ BITCOIN_CORE_H = \
143143
compat/compat.h \
144144
compat/cpuid.h \
145145
compat/endian.h \
146+
common/settings.h \
146147
common/system.h \
147148
compressor.h \
148149
consensus/consensus.h \
@@ -309,7 +310,6 @@ BITCOIN_CORE_H = \
309310
util/readwritefile.h \
310311
util/result.h \
311312
util/serfloat.h \
312-
util/settings.h \
313313
util/sock.h \
314314
util/spanparsing.h \
315315
util/string.h \
@@ -663,6 +663,7 @@ libbitcoin_common_a_SOURCES = \
663663
common/init.cpp \
664664
common/interfaces.cpp \
665665
common/run_command.cpp \
666+
common/settings.cpp \
666667
common/system.cpp \
667668
compressor.cpp \
668669
core_read.cpp \
@@ -733,7 +734,6 @@ libbitcoin_util_a_SOURCES = \
733734
util/moneystr.cpp \
734735
util/rbf.cpp \
735736
util/readwritefile.cpp \
736-
util/settings.cpp \
737737
util/thread.cpp \
738738
util/threadinterrupt.cpp \
739739
util/threadnames.cpp \

src/addrdb.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <chainparams.h>
1010
#include <clientversion.h>
1111
#include <common/args.h>
12+
#include <common/settings.h>
1213
#include <cstdint>
1314
#include <hash.h>
1415
#include <logging.h>
@@ -21,7 +22,6 @@
2122
#include <univalue.h>
2223
#include <util/fs.h>
2324
#include <util/fs_helpers.h>
24-
#include <util/settings.h>
2525
#include <util/translation.h>
2626

2727
namespace {

src/common/args.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <common/args.h>
77

88
#include <chainparamsbase.h>
9+
#include <common/settings.h>
910
#include <logging.h>
1011
#include <sync.h>
1112
#include <tinyformat.h>
@@ -14,7 +15,6 @@
1415
#include <util/check.h>
1516
#include <util/fs.h>
1617
#include <util/fs_helpers.h>
17-
#include <util/settings.h>
1818
#include <util/strencodings.h>
1919

2020
#ifdef WIN32

src/common/args.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
#ifndef BITCOIN_COMMON_ARGS_H
66
#define BITCOIN_COMMON_ARGS_H
77

8+
#include <common/settings.h>
89
#include <compat/compat.h>
910
#include <sync.h>
1011
#include <util/chaintype.h>
1112
#include <util/fs.h>
12-
#include <util/settings.h>
1313

1414
#include <iosfwd>
1515
#include <list>

src/common/config.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
#include <common/args.h>
66

7+
#include <common/settings.h>
78
#include <logging.h>
89
#include <sync.h>
910
#include <tinyformat.h>
1011
#include <univalue.h>
1112
#include <util/chaintype.h>
1213
#include <util/fs.h>
13-
#include <util/settings.h>
1414
#include <util/string.h>
1515

1616
#include <algorithm>

src/util/settings.cpp renamed to src/common/settings.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,18 @@
22
// Distributed under the MIT software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

5-
#include <util/fs.h>
6-
#include <util/settings.h>
5+
#include <common/settings.h>
76

87
#include <tinyformat.h>
98
#include <univalue.h>
9+
#include <util/fs.h>
1010

11+
#include <algorithm>
1112
#include <fstream>
13+
#include <iterator>
1214
#include <map>
1315
#include <string>
16+
#include <utility>
1417
#include <vector>
1518

1619
namespace util {

src/util/settings.h renamed to src/common/settings.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
// Distributed under the MIT software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

5-
#ifndef BITCOIN_UTIL_SETTINGS_H
6-
#define BITCOIN_UTIL_SETTINGS_H
5+
#ifndef BITCOIN_COMMON_SETTINGS_H
6+
#define BITCOIN_COMMON_SETTINGS_H
77

88
#include <util/fs.h>
99

10+
#include <cstddef>
1011
#include <map>
1112
#include <string>
1213
#include <vector>
@@ -111,4 +112,4 @@ auto FindKey(Map&& map, Key&& key) -> decltype(&map.at(key))
111112

112113
} // namespace util
113114

114-
#endif // BITCOIN_UTIL_SETTINGS_H
115+
#endif // BITCOIN_COMMON_SETTINGS_H

src/interfaces/chain.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
#define BITCOIN_INTERFACES_CHAIN_H
77

88
#include <blockfilter.h>
9+
#include <common/settings.h>
910
#include <primitives/transaction.h> // For CTransactionRef
10-
#include <util/settings.h> // For util::SettingsValue
1111

1212
#include <functional>
1313
#include <memory>

src/interfaces/node.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
#ifndef BITCOIN_INTERFACES_NODE_H
66
#define BITCOIN_INTERFACES_NODE_H
77

8+
#include <common/settings.h>
89
#include <consensus/amount.h> // For CAmount
910
#include <net.h> // For NodeId
1011
#include <net_types.h> // For banmap_t
1112
#include <netaddress.h> // For Network
1213
#include <netbase.h> // For ConnectionDirection
1314
#include <support/allocators/secure.h> // For SecureString
14-
#include <util/settings.h> // For util::SettingsValue
1515
#include <util/translation.h>
1616

1717
#include <functional>

src/qt/test/optiontests.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
#ifndef BITCOIN_QT_TEST_OPTIONTESTS_H
66
#define BITCOIN_QT_TEST_OPTIONTESTS_H
77

8+
#include <common/settings.h>
89
#include <qt/optionsmodel.h>
910
#include <univalue.h>
10-
#include <util/settings.h>
1111

1212
#include <QObject>
1313

0 commit comments

Comments
 (0)