diff options
author | Tom Hubrecht <github@mail.hubrecht.ovh> | 2024-05-28 16:53:21 +0200 |
---|---|---|
committer | Tom Hubrecht <github@mail.hubrecht.ovh> | 2024-05-29 12:38:51 +0200 |
commit | a39ba22ff7112cd3984bbf28d8610d84dd525a0f (patch) | |
tree | 234f26a44798f318baf3b6a3c318390d30c50b0e /src/libutil | |
parent | f0eb650ee8a0eb5244c15fab3b152a1f70e1506e (diff) |
util.hh: Delete remaining file and clean up headers
Change-Id: Ic1f68e6af658e94ef7922841dd3ad4c69551ef56
Diffstat (limited to 'src/libutil')
-rw-r--r-- | src/libutil/archive.cc | 2 | ||||
-rw-r--r-- | src/libutil/args.cc | 1 | ||||
-rw-r--r-- | src/libutil/args.hh | 8 | ||||
-rw-r--r-- | src/libutil/comparator.hh | 2 | ||||
-rw-r--r-- | src/libutil/compression.cc | 3 | ||||
-rw-r--r-- | src/libutil/config-impl.hh | 2 | ||||
-rw-r--r-- | src/libutil/config.cc | 1 | ||||
-rw-r--r-- | src/libutil/error.cc | 2 | ||||
-rw-r--r-- | src/libutil/experimental-features.cc | 1 | ||||
-rw-r--r-- | src/libutil/file-descriptor.cc | 1 | ||||
-rw-r--r-- | src/libutil/file-system.cc | 1 | ||||
-rw-r--r-- | src/libutil/hash.cc | 3 | ||||
-rw-r--r-- | src/libutil/logging.cc | 3 | ||||
-rw-r--r-- | src/libutil/meson.build | 1 | ||||
-rw-r--r-- | src/libutil/references.cc | 4 | ||||
-rw-r--r-- | src/libutil/serialise.cc | 1 | ||||
-rw-r--r-- | src/libutil/serialise.hh | 1 | ||||
-rw-r--r-- | src/libutil/signals.cc | 1 | ||||
-rw-r--r-- | src/libutil/signals.hh | 2 | ||||
-rw-r--r-- | src/libutil/split.hh | 2 | ||||
-rw-r--r-- | src/libutil/suggestions.cc | 1 | ||||
-rw-r--r-- | src/libutil/suggestions.hh | 5 | ||||
-rw-r--r-- | src/libutil/tarfile.cc | 1 | ||||
-rw-r--r-- | src/libutil/thread-pool.cc | 1 | ||||
-rw-r--r-- | src/libutil/thread-pool.hh | 3 | ||||
-rw-r--r-- | src/libutil/url-name.cc | 1 | ||||
-rw-r--r-- | src/libutil/url-name.hh | 3 | ||||
-rw-r--r-- | src/libutil/util.hh | 40 |
28 files changed, 26 insertions, 71 deletions
diff --git a/src/libutil/archive.cc b/src/libutil/archive.cc index c3f39d4b3..1b42ee4b5 100644 --- a/src/libutil/archive.cc +++ b/src/libutil/archive.cc @@ -13,8 +13,8 @@ #include "archive.hh" #include "file-system.hh" -#include "util.hh" #include "config.hh" +#include "logging.hh" #include "signals.hh" namespace nix { diff --git a/src/libutil/args.cc b/src/libutil/args.cc index bcff653c5..4983e49af 100644 --- a/src/libutil/args.cc +++ b/src/libutil/args.cc @@ -5,6 +5,7 @@ #include "environment-variables.hh" #include "experimental-features-json.hh" +#include "logging.hh" #include <glob.h> diff --git a/src/libutil/args.hh b/src/libutil/args.hh index 77f7ff2a8..35a5238c0 100644 --- a/src/libutil/args.hh +++ b/src/libutil/args.hh @@ -1,13 +1,17 @@ #pragma once ///@file -#include <iostream> +#include "experimental-features.hh" +#include "types.hh" +#include <functional> #include <map> #include <memory> +#include <limits> #include <nlohmann/json_fwd.hpp> +#include <optional> +#include <set> -#include "util.hh" namespace nix { diff --git a/src/libutil/comparator.hh b/src/libutil/comparator.hh index cbc2bb4fd..136a3f742 100644 --- a/src/libutil/comparator.hh +++ b/src/libutil/comparator.hh @@ -1,6 +1,8 @@ #pragma once ///@file +#include <tuple> + #define DECLARE_ONE_CMP(PRE, QUAL, COMPARATOR, MY_TYPE) \ PRE bool QUAL operator COMPARATOR(const MY_TYPE & other) const; #define DECLARE_EQUAL(prefix, qualification, my_type) \ diff --git a/src/libutil/compression.cc b/src/libutil/compression.cc index 575a03712..678557a58 100644 --- a/src/libutil/compression.cc +++ b/src/libutil/compression.cc @@ -1,7 +1,5 @@ #include "compression.hh" #include "tarfile.hh" -#include "util.hh" -#include "finally.hh" #include "signals.hh" #include "logging.hh" @@ -13,7 +11,6 @@ #include <brotli/decode.h> #include <brotli/encode.h> -#include <iostream> namespace nix { diff --git a/src/libutil/config-impl.hh b/src/libutil/config-impl.hh index 9f69e8444..756175f95 100644 --- a/src/libutil/config-impl.hh +++ b/src/libutil/config-impl.hh @@ -12,7 +12,9 @@ * instantiation. */ +#include "args.hh" #include "config.hh" +#include "logging.hh" namespace nix { diff --git a/src/libutil/config.cc b/src/libutil/config.cc index 729b4e596..8180886ce 100644 --- a/src/libutil/config.cc +++ b/src/libutil/config.cc @@ -3,6 +3,7 @@ #include "abstract-setting-to-json.hh" #include "experimental-features.hh" #include "file-system.hh" +#include "logging.hh" #include "strings.hh" #include "config-impl.hh" diff --git a/src/libutil/error.cc b/src/libutil/error.cc index 2a7fd3d0e..e5d6a9fa8 100644 --- a/src/libutil/error.cc +++ b/src/libutil/error.cc @@ -1,11 +1,11 @@ #include "environment-variables.hh" #include "error.hh" +#include "logging.hh" #include "position.hh" #include "terminal.hh" #include <iostream> #include <optional> -#include "serialise.hh" #include <sstream> namespace nix { diff --git a/src/libutil/experimental-features.cc b/src/libutil/experimental-features.cc index 8ebec2956..f1cbfdb16 100644 --- a/src/libutil/experimental-features.cc +++ b/src/libutil/experimental-features.cc @@ -2,7 +2,6 @@ // Required for instances of to_json and from_json for ExperimentalFeature #include "experimental-features-json.hh" #include "strings.hh" -#include "util.hh" #include "nlohmann/json.hpp" diff --git a/src/libutil/file-descriptor.cc b/src/libutil/file-descriptor.cc index ec22f17ab..a19ceaf2a 100644 --- a/src/libutil/file-descriptor.cc +++ b/src/libutil/file-descriptor.cc @@ -1,5 +1,6 @@ #include "file-system.hh" #include "finally.hh" +#include "logging.hh" #include "serialise.hh" #include "signals.hh" diff --git a/src/libutil/file-system.cc b/src/libutil/file-system.cc index 721bf97e2..d573b22b4 100644 --- a/src/libutil/file-system.cc +++ b/src/libutil/file-system.cc @@ -6,6 +6,7 @@ #include "file-descriptor.hh" #include "file-system.hh" #include "finally.hh" +#include "logging.hh" #include "serialise.hh" #include "signals.hh" #include "types.hh" diff --git a/src/libutil/hash.cc b/src/libutil/hash.cc index 2c36d9d94..006b5000c 100644 --- a/src/libutil/hash.cc +++ b/src/libutil/hash.cc @@ -1,4 +1,3 @@ -#include <iostream> #include <cstring> #include <openssl/crypto.h> @@ -8,8 +7,8 @@ #include "args.hh" #include "hash.hh" #include "archive.hh" +#include "logging.hh" #include "split.hh" -#include "util.hh" #include <sys/types.h> #include <sys/stat.h> diff --git a/src/libutil/logging.cc b/src/libutil/logging.cc index 8d9e18d09..febbfdb55 100644 --- a/src/libutil/logging.cc +++ b/src/libutil/logging.cc @@ -1,15 +1,12 @@ #include "environment-variables.hh" #include "file-descriptor.hh" #include "logging.hh" -#include "util.hh" #include "config.hh" -#include "source-path.hh" #include "position.hh" #include "terminal.hh" #include <atomic> #include <nlohmann/json.hpp> -#include <iostream> namespace nix { diff --git a/src/libutil/meson.build b/src/libutil/meson.build index 64d84c714..96450fbe2 100644 --- a/src/libutil/meson.build +++ b/src/libutil/meson.build @@ -110,7 +110,6 @@ libutil_headers = files( 'url-name.hh', 'url.hh', 'users.hh', - 'util.hh', 'variant-wrapper.hh', 'xml-writer.hh', ) diff --git a/src/libutil/references.cc b/src/libutil/references.cc index 7f59b4c09..6189f69b9 100644 --- a/src/libutil/references.cc +++ b/src/libutil/references.cc @@ -1,9 +1,7 @@ #include "references.hh" #include "hash.hh" -#include "util.hh" -#include "archive.hh" +#include "logging.hh" -#include <map> #include <cstdlib> #include <mutex> #include <algorithm> diff --git a/src/libutil/serialise.cc b/src/libutil/serialise.cc index a6cc919d2..3a8a01f16 100644 --- a/src/libutil/serialise.cc +++ b/src/libutil/serialise.cc @@ -1,5 +1,4 @@ #include "serialise.hh" -#include "util.hh" #include "signals.hh" #include <cstring> diff --git a/src/libutil/serialise.hh b/src/libutil/serialise.hh index e46c5624a..c9294ba2d 100644 --- a/src/libutil/serialise.hh +++ b/src/libutil/serialise.hh @@ -5,7 +5,6 @@ #include "strings.hh" #include "types.hh" -#include "util.hh" #include "file-descriptor.hh" namespace boost::context { struct stack_context; } diff --git a/src/libutil/signals.cc b/src/libutil/signals.cc index c0e66f6ed..a94c2802a 100644 --- a/src/libutil/signals.cc +++ b/src/libutil/signals.cc @@ -1,5 +1,4 @@ #include "signals.hh" -#include "util.hh" #include "error.hh" #include "sync.hh" #include "terminal.hh" diff --git a/src/libutil/signals.hh b/src/libutil/signals.hh index 71593df95..02f8d2ca3 100644 --- a/src/libutil/signals.hh +++ b/src/libutil/signals.hh @@ -1,7 +1,6 @@ #pragma once /// @file -#include "types.hh" #include "error.hh" #include <sys/types.h> @@ -12,7 +11,6 @@ #include <atomic> #include <functional> -#include <sstream> namespace nix { diff --git a/src/libutil/split.hh b/src/libutil/split.hh index 4ff940eef..5455b6bff 100644 --- a/src/libutil/split.hh +++ b/src/libutil/split.hh @@ -4,8 +4,6 @@ #include <optional> #include <string_view> -#include "util.hh" - namespace nix { /** diff --git a/src/libutil/suggestions.cc b/src/libutil/suggestions.cc index 63dcf84b5..cae52cf29 100644 --- a/src/libutil/suggestions.cc +++ b/src/libutil/suggestions.cc @@ -4,6 +4,7 @@ #include <algorithm> #include <ostream> +#include <vector> namespace nix { diff --git a/src/libutil/suggestions.hh b/src/libutil/suggestions.hh index 9abf5ee5f..3cac1371e 100644 --- a/src/libutil/suggestions.hh +++ b/src/libutil/suggestions.hh @@ -2,8 +2,11 @@ ///@file #include "comparator.hh" -#include "types.hh" + #include <set> +#include <string_view> +#include <string> +#include <variant> namespace nix { diff --git a/src/libutil/tarfile.cc b/src/libutil/tarfile.cc index cabb7af9b..760a5a65a 100644 --- a/src/libutil/tarfile.cc +++ b/src/libutil/tarfile.cc @@ -2,6 +2,7 @@ #include <archive_entry.h> #include "file-system.hh" +#include "logging.hh" #include "serialise.hh" #include "tarfile.hh" diff --git a/src/libutil/thread-pool.cc b/src/libutil/thread-pool.cc index a25769d9b..0ff83e997 100644 --- a/src/libutil/thread-pool.cc +++ b/src/libutil/thread-pool.cc @@ -1,4 +1,5 @@ #include "thread-pool.hh" +#include "logging.hh" #include "signals.hh" namespace nix { diff --git a/src/libutil/thread-pool.hh b/src/libutil/thread-pool.hh index 0e09fae97..3db7ce88f 100644 --- a/src/libutil/thread-pool.hh +++ b/src/libutil/thread-pool.hh @@ -1,13 +1,12 @@ #pragma once ///@file +#include "error.hh" #include "sync.hh" -#include "util.hh" #include <queue> #include <functional> #include <thread> -#include <map> #include <atomic> namespace nix { diff --git a/src/libutil/url-name.cc b/src/libutil/url-name.cc index 7c526752c..12c55db9a 100644 --- a/src/libutil/url-name.cc +++ b/src/libutil/url-name.cc @@ -1,4 +1,3 @@ -#include <iostream> #include <regex> #include "url-name.hh" diff --git a/src/libutil/url-name.hh b/src/libutil/url-name.hh index 3a3f88e76..dabd23ca1 100644 --- a/src/libutil/url-name.hh +++ b/src/libutil/url-name.hh @@ -5,9 +5,6 @@ #include <optional> #include "url.hh" -#include "url-parts.hh" -#include "util.hh" -#include "split.hh" namespace nix { diff --git a/src/libutil/util.hh b/src/libutil/util.hh deleted file mode 100644 index 1066f212a..000000000 --- a/src/libutil/util.hh +++ /dev/null @@ -1,40 +0,0 @@ -#pragma once -///@file - -#include "types.hh" -#include "error.hh" -#include "logging.hh" -#include "ansicolor.hh" - -#include <sys/types.h> -#include <sys/stat.h> -#include <sys/resource.h> -#include <dirent.h> -#include <unistd.h> -#include <signal.h> - -#include <boost/lexical_cast.hpp> - -#include <atomic> -#include <functional> -#include <map> -#include <sstream> -#include <optional> - -#ifndef HAVE_STRUCT_DIRENT_D_TYPE -#define DT_UNKNOWN 0 -#define DT_REG 1 -#define DT_LNK 2 -#define DT_DIR 3 -#endif - -namespace nix { - -struct Sink; -struct Source; - - - - - -} |