0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-04 10:07:27 -05:00
bitcoin-bitcoin-core/src/util
fanquake 369d4c03b7
Merge bitcoin/bitcoin#27254: refactor: Extract util/fs from util/system
00e9b97f37 refactor: Move fs.* to util/fs.* (TheCharlatan)
106b46d9d2 Add missing fs.h includes (TheCharlatan)
b202b3dd63 Add missing cstddef include in assumptions.h (TheCharlatan)
18fb36367a refactor: Extract util/fs_helpers from util/system (Ben Woosley)

Pull request description:

  This pull request is part of the `libbitcoinkernel` project https://github.com/bitcoin/bitcoin/issues/24303 https://github.com/bitcoin/bitcoin/projects/18 and more specifically its "Step 2: Decouple most non-consensus code from libbitcoinkernel". This commit was originally authored by empact and is taken from its parent PR #25152.

  #### Context

  There is an ongoing effort to decouple the `ArgsManager` used for command line parsing user-provided arguments from the libbitcoinkernel library (https://github.com/bitcoin/bitcoin/pull/25290, https://github.com/bitcoin/bitcoin/pull/25487, https://github.com/bitcoin/bitcoin/pull/25527, https://github.com/bitcoin/bitcoin/pull/25862, https://github.com/bitcoin/bitcoin/pull/26177, and https://github.com/bitcoin/bitcoin/pull/27125). The `ArgsManager` is defined in `system.h`. A similar pull request extracting functionality from `system.h` has been merged in https://github.com/bitcoin/bitcoin/pull/27238.

  #### Changes

  Next to providing better code organization, this PR removes some reliance of the tree of libbitcoinkernel header includes on `system.h` (and thus the `ArgsManager` definition) by moving filesystem related functions out of the `system.*` files.

  There is already a pair of `fs.h` / `fs.cpp` in the top-level `src/` directory. They were not combined with the files introduced here, to keep the patch cleaner and more importantly because they are often included without the utility functions. The new files are therefore named `fs_helpers` and the existing `fs` files are moved into the util directory.

  Further commits splitting more functionality out of `system.h` are still in #25152 and will be submitted in separate PRs once this PR has been processed.

ACKs for top commit:
  hebasto:
    ACK 00e9b97f37

Tree-SHA512: 31422f148d14ba3c843b99b1550a6fd77c77f350905ca324f93d4f97b652246bc58fa9696c64d1201979cf88733e40be02d262739bb7d417cf22bf506fdb7666
2023-04-03 14:41:22 +01:00
..
asmap.cpp refactor: Move fs.* to util/fs.* 2023-03-23 12:55:18 +01:00
asmap.h refactor: Move fs.* to util/fs.* 2023-03-23 12:55:18 +01:00
bip32.cpp clang-tidy: Add performance-faster-string-find check 2023-03-26 20:17:46 +01:00
bip32.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
bitdeque.h Add bitdeque, an std::deque<bool> analogue that does bit packing. 2022-08-23 11:34:10 -04:00
bytevectorhash.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
bytevectorhash.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
check.cpp refactor: Remove c_str from util/check 2023-01-24 12:09:29 +01:00
check.h refactor: Remove c_str from util/check 2023-01-24 12:09:29 +01:00
epochguard.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
error.cpp Add test for unspendable transactions and parameter 'maxburnamount' to sendrawtransaction. 2023-02-20 11:38:52 -07:00
error.h Add test for unspendable transactions and parameter 'maxburnamount' to sendrawtransaction. 2023-02-20 11:38:52 -07:00
exception.cpp refactor: Extract util/exception from util/system 2023-03-13 17:09:47 +01:00
exception.h refactor: Extract util/exception from util/system 2023-03-13 17:09:47 +01:00
fastrange.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
fees.cpp Fix clang-tidy readability-const-return-type violations 2023-02-01 11:33:35 +01:00
fees.h Fix clang-tidy readability-const-return-type violations 2023-02-01 11:33:35 +01:00
fs.cpp refactor: Move fs.* to util/fs.* 2023-03-23 12:55:18 +01:00
fs.h refactor: Move fs.* to util/fs.* 2023-03-23 12:55:18 +01:00
fs_helpers.cpp refactor: Move fs.* to util/fs.* 2023-03-23 12:55:18 +01:00
fs_helpers.h refactor: Move fs.* to util/fs.* 2023-03-23 12:55:18 +01:00
getuniquepath.cpp refactor: Move fs.* to util/fs.* 2023-03-23 12:55:18 +01:00
getuniquepath.h refactor: Move fs.* to util/fs.* 2023-03-23 12:55:18 +01:00
golombrice.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
hash_type.h move-only: Add util/hash_type 2021-05-11 10:38:18 +02:00
hasher.cpp Add deterministic mode to CCoinsViewCache 2023-02-02 09:00:15 -05:00
hasher.h Add deterministic mode to CCoinsViewCache 2023-02-02 09:00:15 -05:00
macros.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
message.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
message.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
moneystr.cpp refactor: use braced init for integer constants instead of c style casts 2023-01-03 19:31:29 -06:00
moneystr.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
overflow.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
overloaded.h refactor: Make CWalletTx sync state type-safe 2021-11-15 09:11:44 -05:00
rbf.cpp
rbf.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
readwritefile.cpp refactor: Move fs.* to util/fs.* 2023-03-23 12:55:18 +01:00
readwritefile.h refactor: Move fs.* to util/fs.* 2023-03-23 12:55:18 +01:00
result.h refactor: Replace BResult with util::Result 2022-08-03 07:33:01 -04:00
serfloat.cpp Add platform-independent float encoder/decoder 2021-05-24 16:04:44 -07:00
serfloat.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
settings.cpp refactor: Move fs.* to util/fs.* 2023-03-23 12:55:18 +01:00
settings.h refactor: Move fs.* to util/fs.* 2023-03-23 12:55:18 +01:00
sock.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
sock.h clang-tidy: Fix modernize-use-default-member-init in headers 2023-01-31 11:50:10 +00:00
spanparsing.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
spanparsing.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
strencodings.cpp util: Work around ParseHex gcc cross compiler bug 2023-03-07 11:33:42 +01:00
strencodings.h util: Return empty vector on invalid hex encoding 2023-02-27 13:39:55 +01:00
string.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
string.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
syscall_sandbox.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
syscall_sandbox.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
syserror.cpp refactor: add most of src/util to iwyu 2022-07-08 11:06:01 +01:00
syserror.h util: Replace non-threadsafe strerror 2022-04-28 10:24:06 +02:00
system.cpp refactor: Move fs.* to util/fs.* 2023-03-23 12:55:18 +01:00
system.h refactor: Move fs.* to util/fs.* 2023-03-23 12:55:18 +01:00
thread.cpp refactor: Extract util/exception from util/system 2023-03-13 17:09:47 +01:00
thread.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
threadinterrupt.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
threadinterrupt.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
threadnames.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
threadnames.h
time.cpp refactor: Replace GetTimeMicros by SystemClock 2023-03-09 15:05:11 +01:00
time.h refactor: Replace GetTimeMicros by SystemClock 2023-03-09 15:05:11 +01:00
tokenpipe.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
tokenpipe.h util: Add RAII TokenPipe 2021-03-04 18:24:00 +01:00
trace.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
translation.h Extend bilingual_str support for tinyformat 2023-02-28 12:04:47 -05:00
types.h Add util/types.h with ALWAYS_FALSE template 2021-09-07 19:19:02 +02:00
ui_change_type.h
vector.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00