From 401a22bfc192f97338cf04d49796fa9853f5353e Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Sat, 19 Apr 2025 23:21:55 +0200 Subject: [PATCH] tree-wide: Make sure all headers are standalone Let's make sure all of our headers include everything they require. --- src/basic/iovec-wrapper.h | 1 + src/basic/missing_xfs.h | 2 ++ src/basic/pcapng.h | 2 ++ src/basic/pthread-util.h | 2 +- src/basic/raw-reboot.h | 1 + src/basic/strbuf.h | 2 +- src/basic/sysctl-util.h | 1 + src/basic/uid-classification.h | 2 ++ src/basic/uid-range.h | 2 +- src/boot/url-discovery.h | 2 ++ src/core/dynamic-user.h | 2 +- src/core/main.h | 2 ++ src/core/show-status.h | 1 + src/core/smack-setup.h | 2 ++ src/cryptsetup/cryptsetup-pkcs11.h | 1 + src/cryptsetup/cryptsetup-tokens/cryptsetup-token.h | 4 ++++ src/cryptsetup/cryptsetup-tokens/luks2-pkcs11.h | 2 ++ src/fundamental/iovec-util-fundamental.h | 6 ++++++ src/home/homed-manager-bus.h | 2 +- src/home/homework-mount.h | 1 + src/import/export-raw.h | 2 +- src/import/export-tar.h | 2 +- src/import/import-common.h | 2 ++ src/import/import-raw.c | 1 + src/import/import-raw.h | 3 +-- src/import/import-tar.c | 1 + src/import/import-tar.h | 3 +-- src/journal-remote/journal-upload.c | 1 - src/journal-remote/journal-upload.h | 1 + src/journal-remote/microhttpd-util.h | 2 +- src/libsystemd/sd-bus/bus-signature.h | 1 + src/libsystemd/sd-bus/bus-socket.h | 2 ++ src/libsystemd/sd-bus/bus-track.h | 2 ++ src/libsystemd/sd-bus/test-vtable-data.h | 4 +++- src/libsystemd/sd-journal/mmap-cache.h | 1 + src/libsystemd/sd-json/json-internal.h | 4 ++++ src/libsystemd/sd-netlink/netlink-slot.h | 4 ++++ src/libsystemd/sd-varlink/varlink-idl-util.h | 2 +- src/libudev/libudev-list-internal.h | 2 +- src/network/networkd-bridge-mdb.h | 1 + src/network/networkd-ipv4acd.h | 2 ++ src/network/networkd-netlabel.h | 2 ++ src/network/networkd-nexthop.h | 1 + src/network/networkd-radv.h | 1 + src/network/networkd-route-util.h | 1 + src/network/networkd-state-file.h | 2 ++ src/network/networkd-wiphy.h | 1 + src/nspawn/nspawn-mount.h | 2 ++ src/nspawn/nspawn-seccomp.h | 2 +- src/nspawn/nspawn-setuid.h | 3 +++ src/nsresourced/userns-registry.h | 2 +- src/nss-systemd/nss-systemd.h | 2 ++ src/sbsign/authenticode.h | 2 +- src/shared/bpf-compat.h | 2 ++ src/shared/cpu-set-util.h | 2 +- src/shared/cryptsetup-fido2.h | 1 + src/shared/edit-util.h | 1 + src/shared/fdisk-util.h | 2 +- src/shared/hibernate-util.h | 3 +++ src/shared/hostname-setup.h | 3 +++ src/shared/id128-print.h | 1 + src/shared/libcrypt-util.h | 1 + src/shared/loop-util.h | 2 +- src/shared/machine-credential.h | 1 + src/shared/machine-id-setup.h | 2 ++ src/shared/machine-pool.h | 1 + src/shared/macvlan-util.h | 3 +++ src/shared/netif-sriov.h | 1 + src/shared/pam-util.h | 2 ++ src/shared/password-quality-util-pwquality.h | 1 + src/shared/pkcs11-util.h | 2 +- src/shared/ptyfwd.h | 2 +- src/shared/securebits-util.h | 4 ++-- src/shared/volatile-util.h | 2 ++ src/shared/vpick.h | 1 + src/systemctl/systemctl-list-units.h | 2 ++ src/timesync/timesyncd-ntp-message.h | 1 + src/udev/scsi_id/scsi.h | 1 + src/udev/udevadm-util.h | 1 + src/vmspawn/vmspawn-register.h | 2 ++ src/vmspawn/vmspawn-util.h | 4 +++- 81 files changed, 128 insertions(+), 27 deletions(-) diff --git a/src/basic/iovec-wrapper.h b/src/basic/iovec-wrapper.h index 4778fa6b27..f45dd87b7e 100644 --- a/src/basic/iovec-wrapper.h +++ b/src/basic/iovec-wrapper.h @@ -5,6 +5,7 @@ #include #include "macro.h" +#include "memory-util.h" struct iovec_wrapper { struct iovec *iovec; diff --git a/src/basic/missing_xfs.h b/src/basic/missing_xfs.h index ba5fe81288..67c4cefb87 100644 --- a/src/basic/missing_xfs.h +++ b/src/basic/missing_xfs.h @@ -1,6 +1,8 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once +#include + /* This is currently not exported in the public kernel headers, but the libxfs library code part of xfsprogs * defines it as public header */ diff --git a/src/basic/pcapng.h b/src/basic/pcapng.h index 57c3af501a..28ad076877 100644 --- a/src/basic/pcapng.h +++ b/src/basic/pcapng.h @@ -1,6 +1,8 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once +#include + /* * For details about the file format see RFC: * https://www.ietf.org/id/draft-tuexen-opsawg-pcapng-03.html diff --git a/src/basic/pthread-util.h b/src/basic/pthread-util.h index 113485d044..4707f5503a 100644 --- a/src/basic/pthread-util.h +++ b/src/basic/pthread-util.h @@ -3,7 +3,7 @@ #include -#include "macro.h" +#include "assert-util.h" static inline pthread_mutex_t* pthread_mutex_lock_assert(pthread_mutex_t *mutex) { assert_se(pthread_mutex_lock(mutex) == 0); diff --git a/src/basic/raw-reboot.h b/src/basic/raw-reboot.h index e6bff300a5..d72ae1e955 100644 --- a/src/basic/raw-reboot.h +++ b/src/basic/raw-reboot.h @@ -4,6 +4,7 @@ #include #include #include +#include /* glibc defines the reboot() API call, which is a wrapper around the system call of the same name, but without the * extra "arg" parameter. Since we need that parameter for some calls, let's add a "raw" wrapper that is defined the diff --git a/src/basic/strbuf.h b/src/basic/strbuf.h index 405b34717e..143e39f0f0 100644 --- a/src/basic/strbuf.h +++ b/src/basic/strbuf.h @@ -5,7 +5,7 @@ #include #include -#include "macro.h" +#include "memory-util.h" struct strbuf { char *buf; diff --git a/src/basic/sysctl-util.h b/src/basic/sysctl-util.h index bbfc4ce1ea..f3ae6fe7cf 100644 --- a/src/basic/sysctl-util.h +++ b/src/basic/sysctl-util.h @@ -4,6 +4,7 @@ #include #include +#include "hashmap.h" #include "macro.h" #include "stdio-util.h" #include "string-util.h" diff --git a/src/basic/uid-classification.h b/src/basic/uid-classification.h index 2d76be5f04..c60daf5dcc 100644 --- a/src/basic/uid-classification.h +++ b/src/basic/uid-classification.h @@ -4,6 +4,8 @@ #include #include +#include "macro.h" + /* The container base should have the last 16 bit set to zero */ assert_cc((CONTAINER_UID_BASE_MIN & 0xFFFFU) == 0); assert_cc((CONTAINER_UID_BASE_MAX & 0xFFFFU) == 0); diff --git a/src/basic/uid-range.h b/src/basic/uid-range.h index 21e5c7a17b..197085a60b 100644 --- a/src/basic/uid-range.h +++ b/src/basic/uid-range.h @@ -4,7 +4,7 @@ #include #include -#include "macro.h" +#include "memory-util.h" typedef struct UIDRangeEntry { uid_t start, nr; diff --git a/src/boot/url-discovery.h b/src/boot/url-discovery.h index e4e50c387c..aed48b432c 100644 --- a/src/boot/url-discovery.h +++ b/src/boot/url-discovery.h @@ -1,4 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once +#include "efi.h" + char16_t *disk_get_url(EFI_HANDLE *handle); diff --git a/src/core/dynamic-user.h b/src/core/dynamic-user.h index 594595038d..3e0074defb 100644 --- a/src/core/dynamic-user.h +++ b/src/core/dynamic-user.h @@ -1,8 +1,8 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once -#include #include +#include #include #include "fdset.h" diff --git a/src/core/main.h b/src/core/main.h index 3b770b5a3f..f637cbad7a 100644 --- a/src/core/main.h +++ b/src/core/main.h @@ -3,6 +3,8 @@ #include +#include "crash-handler.h" + extern bool arg_dump_core; extern int arg_crash_chvt; extern bool arg_crash_shell; diff --git a/src/core/show-status.h b/src/core/show-status.h index f441223dff..a51616f75a 100644 --- a/src/core/show-status.h +++ b/src/core/show-status.h @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once +#include #include #include "macro.h" diff --git a/src/core/smack-setup.h b/src/core/smack-setup.h index d29370d1e9..6758f07cef 100644 --- a/src/core/smack-setup.h +++ b/src/core/smack-setup.h @@ -7,4 +7,6 @@ Nathaniel Chen ***/ +#include + int mac_smack_setup(bool *loaded_policy); diff --git a/src/cryptsetup/cryptsetup-pkcs11.h b/src/cryptsetup/cryptsetup-pkcs11.h index 83a2b54be3..98fd3bcb3d 100644 --- a/src/cryptsetup/cryptsetup-pkcs11.h +++ b/src/cryptsetup/cryptsetup-pkcs11.h @@ -3,6 +3,7 @@ #include +#include "ask-password-api.h" #include "cryptsetup-util.h" #include "log.h" #include "time-util.h" diff --git a/src/cryptsetup/cryptsetup-tokens/cryptsetup-token.h b/src/cryptsetup/cryptsetup-tokens/cryptsetup-token.h index effd9d887c..c1ccb5ed31 100644 --- a/src/cryptsetup/cryptsetup-tokens/cryptsetup-token.h +++ b/src/cryptsetup/cryptsetup-tokens/cryptsetup-token.h @@ -1,6 +1,10 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once +#include + +struct crypt_device; + /* for more information see libcryptsetup.h crypt-tokens section */ const char* cryptsetup_token_version(void); diff --git a/src/cryptsetup/cryptsetup-tokens/luks2-pkcs11.h b/src/cryptsetup/cryptsetup-tokens/luks2-pkcs11.h index 41ce9f0608..640685ce6f 100644 --- a/src/cryptsetup/cryptsetup-tokens/luks2-pkcs11.h +++ b/src/cryptsetup/cryptsetup-tokens/luks2-pkcs11.h @@ -2,6 +2,8 @@ #pragma once +#include + struct crypt_device; int acquire_luks2_key( diff --git a/src/fundamental/iovec-util-fundamental.h b/src/fundamental/iovec-util-fundamental.h index 4214afea9a..6b658c8958 100644 --- a/src/fundamental/iovec-util-fundamental.h +++ b/src/fundamental/iovec-util-fundamental.h @@ -1,7 +1,13 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once +#if !SD_BOOT +#include +#include +#endif + #include "assert-fundamental.h" +#include "macro-fundamental.h" #if SD_BOOT /* struct iovec is a POSIX userspace construct. Let's introduce it also in EFI mode, it's just so useful */ diff --git a/src/home/homed-manager-bus.h b/src/home/homed-manager-bus.h index 7db29fa88f..56aca18b7d 100644 --- a/src/home/homed-manager-bus.h +++ b/src/home/homed-manager-bus.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once -#include "bus-util.h" +#include "bus-object.h" extern const BusObjectImplementation manager_object; diff --git a/src/home/homework-mount.h b/src/home/homework-mount.h index 255df26c9a..615b7d36e7 100644 --- a/src/home/homework-mount.h +++ b/src/home/homework-mount.h @@ -2,6 +2,7 @@ #pragma once #include +#include int home_mount_node(const char *node, const char *fstype, bool discard, unsigned long flags, const char *extra_mount_options); int home_unshare_and_mkdir(void); diff --git a/src/import/export-raw.h b/src/import/export-raw.h index 27009e4e35..7c95262647 100644 --- a/src/import/export-raw.h +++ b/src/import/export-raw.h @@ -4,7 +4,7 @@ #include "sd-event.h" #include "import-compress.h" -#include "macro.h" +#include "memory-util.h" typedef struct RawExport RawExport; diff --git a/src/import/export-tar.h b/src/import/export-tar.h index 3b55d12c1f..729b9ef736 100644 --- a/src/import/export-tar.h +++ b/src/import/export-tar.h @@ -4,7 +4,7 @@ #include "sd-event.h" #include "import-compress.h" -#include "macro.h" +#include "memory-util.h" typedef struct TarExport TarExport; diff --git a/src/import/import-common.h b/src/import/import-common.h index 219802492d..d7fb77a070 100644 --- a/src/import/import-common.h +++ b/src/import/import-common.h @@ -1,6 +1,8 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once +#include +#include #include #include "sd-event.h" diff --git a/src/import/import-raw.c b/src/import/import-raw.c index 033f5aeb65..3685904e03 100644 --- a/src/import/import-raw.c +++ b/src/import/import-raw.c @@ -13,6 +13,7 @@ #include "import-common.h" #include "import-compress.h" #include "import-raw.h" +#include "import-util.h" #include "install-file.h" #include "io-util.h" #include "log.h" diff --git a/src/import/import-raw.h b/src/import/import-raw.h index 63384eb171..1feed79a53 100644 --- a/src/import/import-raw.h +++ b/src/import/import-raw.h @@ -4,8 +4,7 @@ #include "sd-event.h" #include "import-common.h" -#include "import-util.h" -#include "macro.h" +#include "memory-util.h" typedef struct RawImport RawImport; diff --git a/src/import/import-tar.c b/src/import/import-tar.c index 7cad83ff00..a2e7eda51b 100644 --- a/src/import/import-tar.c +++ b/src/import/import-tar.c @@ -13,6 +13,7 @@ #include "import-common.h" #include "import-compress.h" #include "import-tar.h" +#include "import-util.h" #include "install-file.h" #include "io-util.h" #include "log.h" diff --git a/src/import/import-tar.h b/src/import/import-tar.h index 63b0bd4da6..d90ba1199a 100644 --- a/src/import/import-tar.h +++ b/src/import/import-tar.h @@ -4,8 +4,7 @@ #include "sd-event.h" #include "import-common.h" -#include "import-util.h" -#include "macro.h" +#include "memory-util.h" typedef struct TarImport TarImport; diff --git a/src/journal-remote/journal-upload.c b/src/journal-remote/journal-upload.c index 7e866aea0a..7bf10f4de9 100644 --- a/src/journal-remote/journal-upload.c +++ b/src/journal-remote/journal-upload.c @@ -1,6 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ -#include #include #include #include diff --git a/src/journal-remote/journal-upload.h b/src/journal-remote/journal-upload.h index 67cec92dfe..cd3c7a7fbe 100644 --- a/src/journal-remote/journal-upload.h +++ b/src/journal-remote/journal-upload.h @@ -2,6 +2,7 @@ #pragma once +#include #include #include "sd-event.h" diff --git a/src/journal-remote/microhttpd-util.h b/src/journal-remote/microhttpd-util.h index bb888e8aed..57396ad9b6 100644 --- a/src/journal-remote/microhttpd-util.h +++ b/src/journal-remote/microhttpd-util.h @@ -4,7 +4,7 @@ #include #include -#include "macro.h" +#include "memory-util.h" /* Those defines are added when options are renamed. If the old names * are not '#define'd, then they are not deprecated yet and there are diff --git a/src/libsystemd/sd-bus/bus-signature.h b/src/libsystemd/sd-bus/bus-signature.h index 314fcc27c5..0fea750744 100644 --- a/src/libsystemd/sd-bus/bus-signature.h +++ b/src/libsystemd/sd-bus/bus-signature.h @@ -2,6 +2,7 @@ #pragma once #include +#include bool signature_is_single(const char *s, bool allow_dict_entry); bool signature_is_pair(const char *s); diff --git a/src/libsystemd/sd-bus/bus-socket.h b/src/libsystemd/sd-bus/bus-socket.h index 52bc404625..fc8c1eda09 100644 --- a/src/libsystemd/sd-bus/bus-socket.h +++ b/src/libsystemd/sd-bus/bus-socket.h @@ -1,6 +1,8 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once +#include + #include "sd-bus.h" void bus_socket_setup(sd_bus *b); diff --git a/src/libsystemd/sd-bus/bus-track.h b/src/libsystemd/sd-bus/bus-track.h index 8dae1f3902..6868cda1e2 100644 --- a/src/libsystemd/sd-bus/bus-track.h +++ b/src/libsystemd/sd-bus/bus-track.h @@ -1,5 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once +typedef struct sd_bus_track sd_bus_track; + void bus_track_dispatch(sd_bus_track *track); void bus_track_close(sd_bus_track *track); diff --git a/src/libsystemd/sd-bus/test-vtable-data.h b/src/libsystemd/sd-bus/test-vtable-data.h index 7269a49945..0bb1ae7343 100644 --- a/src/libsystemd/sd-bus/test-vtable-data.h +++ b/src/libsystemd/sd-bus/test-vtable-data.h @@ -1,6 +1,8 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ -/* This is meant to be included in other files, hence no headers */ +#include + +#include "sd-bus-vtable.h" struct context { bool quit; diff --git a/src/libsystemd/sd-journal/mmap-cache.h b/src/libsystemd/sd-journal/mmap-cache.h index 1fbc236bda..3e088ef8ef 100644 --- a/src/libsystemd/sd-journal/mmap-cache.h +++ b/src/libsystemd/sd-journal/mmap-cache.h @@ -6,6 +6,7 @@ #include #include "journal-def.h" +#include "memory-util.h" typedef struct MMapCache MMapCache; typedef struct MMapFileDescriptor MMapFileDescriptor; diff --git a/src/libsystemd/sd-json/json-internal.h b/src/libsystemd/sd-json/json-internal.h index 5117b39f45..9ecdd6bb1a 100644 --- a/src/libsystemd/sd-json/json-internal.h +++ b/src/libsystemd/sd-json/json-internal.h @@ -2,8 +2,12 @@ #pragma once +#include + #include "sd-json.h" +#include "macro.h" + /* This header should include all prototypes only the JSON parser itself and * its tests need access to. Normal code consuming the JSON parser should not * interface with this. */ diff --git a/src/libsystemd/sd-netlink/netlink-slot.h b/src/libsystemd/sd-netlink/netlink-slot.h index 79de817262..4098061d31 100644 --- a/src/libsystemd/sd-netlink/netlink-slot.h +++ b/src/libsystemd/sd-netlink/netlink-slot.h @@ -1,8 +1,12 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once +#include + #include "sd-netlink.h" +#include "netlink-internal.h" + int netlink_slot_allocate( sd_netlink *nl, bool floating, diff --git a/src/libsystemd/sd-varlink/varlink-idl-util.h b/src/libsystemd/sd-varlink/varlink-idl-util.h index 8c9274eefa..9c5df26d12 100644 --- a/src/libsystemd/sd-varlink/varlink-idl-util.h +++ b/src/libsystemd/sd-varlink/varlink-idl-util.h @@ -4,7 +4,7 @@ #include "sd-varlink.h" #include "sd-varlink-idl.h" -#include "macro.h" +#include "memory-util.h" int varlink_idl_parse(const char *text, unsigned *ret_line, unsigned *ret_column, sd_varlink_interface **ret); sd_varlink_interface* varlink_interface_free(sd_varlink_interface *interface); diff --git a/src/libudev/libudev-list-internal.h b/src/libudev/libudev-list-internal.h index 00c1d40763..dd4fcbc771 100644 --- a/src/libudev/libudev-list-internal.h +++ b/src/libudev/libudev-list-internal.h @@ -3,7 +3,7 @@ #include "libudev.h" -#include "macro.h" +#include "memory-util.h" struct udev_list; diff --git a/src/network/networkd-bridge-mdb.h b/src/network/networkd-bridge-mdb.h index 3b565d7f67..89c70fb68f 100644 --- a/src/network/networkd-bridge-mdb.h +++ b/src/network/networkd-bridge-mdb.h @@ -2,6 +2,7 @@ #pragma once #include +#include #include "conf-parser.h" #include "in-addr-util.h" diff --git a/src/network/networkd-ipv4acd.h b/src/network/networkd-ipv4acd.h index fc9f92d4f4..75b4c97a05 100644 --- a/src/network/networkd-ipv4acd.h +++ b/src/network/networkd-ipv4acd.h @@ -1,6 +1,8 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once +#include + typedef struct Address Address; typedef struct Link Link; diff --git a/src/network/networkd-netlabel.h b/src/network/networkd-netlabel.h index 2f30b8feda..f18ad5aa14 100644 --- a/src/network/networkd-netlabel.h +++ b/src/network/networkd-netlabel.h @@ -1,5 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once +typedef struct Address Address; + void address_add_netlabel(const Address *address); void address_del_netlabel(const Address *address); diff --git a/src/network/networkd-nexthop.h b/src/network/networkd-nexthop.h index 00120d04af..1b0679fc37 100644 --- a/src/network/networkd-nexthop.h +++ b/src/network/networkd-nexthop.h @@ -17,6 +17,7 @@ typedef struct Link Link; typedef struct Manager Manager; typedef struct Network Network; typedef struct NextHop NextHop; +typedef struct Request Request; typedef int (*nexthop_netlink_handler_t)( sd_netlink *rtnl, sd_netlink_message *m, diff --git a/src/network/networkd-radv.h b/src/network/networkd-radv.h index ed8ee216de..23af8a2ba5 100644 --- a/src/network/networkd-radv.h +++ b/src/network/networkd-radv.h @@ -15,6 +15,7 @@ #include "ndisc-option.h" #include "networkd-util.h" +typedef struct Address Address; typedef struct Link Link; typedef struct Network Network; diff --git a/src/network/networkd-route-util.h b/src/network/networkd-route-util.h index 2905a4913b..dfa3bf3c6f 100644 --- a/src/network/networkd-route-util.h +++ b/src/network/networkd-route-util.h @@ -5,6 +5,7 @@ #include #include "conf-parser.h" +#include "in-addr-util.h" typedef struct Link Link; typedef struct Manager Manager; diff --git a/src/network/networkd-state-file.h b/src/network/networkd-state-file.h index 7efd1578da..c45bd53083 100644 --- a/src/network/networkd-state-file.h +++ b/src/network/networkd-state-file.h @@ -1,6 +1,8 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once +#include + typedef struct Link Link; typedef struct Manager Manager; diff --git a/src/network/networkd-wiphy.h b/src/network/networkd-wiphy.h index 8f92112148..9a42b26be6 100644 --- a/src/network/networkd-wiphy.h +++ b/src/network/networkd-wiphy.h @@ -4,6 +4,7 @@ #include #include "sd-device.h" +#include "sd-netlink.h" #include "macro.h" diff --git a/src/nspawn/nspawn-mount.h b/src/nspawn/nspawn-mount.h index 2efcd110fc..a1819f0837 100644 --- a/src/nspawn/nspawn-mount.h +++ b/src/nspawn/nspawn-mount.h @@ -2,6 +2,8 @@ #pragma once #include +#include +#include #include "volatile-util.h" diff --git a/src/nspawn/nspawn-seccomp.h b/src/nspawn/nspawn-seccomp.h index 2690fba686..a2fa9a61c6 100644 --- a/src/nspawn/nspawn-seccomp.h +++ b/src/nspawn/nspawn-seccomp.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once -#include +#include int setup_seccomp(uint64_t cap_list_retain, char **syscall_allow_list, char **syscall_deny_list); diff --git a/src/nspawn/nspawn-setuid.h b/src/nspawn/nspawn-setuid.h index 192471143f..2dc9a69606 100644 --- a/src/nspawn/nspawn-setuid.h +++ b/src/nspawn/nspawn-setuid.h @@ -1,5 +1,8 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once +#include +#include + int change_uid_gid_raw(uid_t uid, gid_t gid, const gid_t *supplementary_gids, size_t n_supplementary_gids, bool chown_stdio); int change_uid_gid(const char *user, bool chown_stdio, char **ret_home); diff --git a/src/nsresourced/userns-registry.h b/src/nsresourced/userns-registry.h index 72fe990079..e25b402e88 100644 --- a/src/nsresourced/userns-registry.h +++ b/src/nsresourced/userns-registry.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once -#include "macro.h" +#include "memory-util.h" #define USER_NAMESPACE_CGROUPS_DELEGATE_MAX 16U #define USER_NAMESPACE_NETIFS_DELEGATE_MAX 16U diff --git a/src/nss-systemd/nss-systemd.h b/src/nss-systemd/nss-systemd.h index e97b801575..2b46044e14 100644 --- a/src/nss-systemd/nss-systemd.h +++ b/src/nss-systemd/nss-systemd.h @@ -3,6 +3,8 @@ #include +#include "assert-util.h" + int _nss_systemd_block(bool b); bool _nss_systemd_is_blocked(void); diff --git a/src/sbsign/authenticode.h b/src/sbsign/authenticode.h index 98a8374805..04bd336e0c 100644 --- a/src/sbsign/authenticode.h +++ b/src/sbsign/authenticode.h @@ -3,7 +3,7 @@ #include -#include "macro.h" +#include "memory-util.h" #define SPC_INDIRECT_DATA_OBJID "1.3.6.1.4.1.311.2.1.4" #define SPC_PE_IMAGE_DATA_OBJID "1.3.6.1.4.1.311.2.1.15" diff --git a/src/shared/bpf-compat.h b/src/shared/bpf-compat.h index 3d94bf2e05..27857e9d72 100644 --- a/src/shared/bpf-compat.h +++ b/src/shared/bpf-compat.h @@ -1,6 +1,8 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once +#include + /* libbpf has been moving quickly. * They added new symbols in the 0.x versions and shortly after removed * deprecated symbols in 1.0. diff --git a/src/shared/cpu-set-util.h b/src/shared/cpu-set-util.h index 2c477d8a01..d62b2d60e6 100644 --- a/src/shared/cpu-set-util.h +++ b/src/shared/cpu-set-util.h @@ -3,7 +3,7 @@ #include -#include "macro.h" +#include "memory-util.h" #include "missing_syscall.h" /* This wraps the libc interface with a variable to keep the allocated size. */ diff --git a/src/shared/cryptsetup-fido2.h b/src/shared/cryptsetup-fido2.h index 86ac30c766..3e08b79f7a 100644 --- a/src/shared/cryptsetup-fido2.h +++ b/src/shared/cryptsetup-fido2.h @@ -3,6 +3,7 @@ #include +#include "ask-password-api.h" #include "cryptsetup-util.h" #include "libfido2-util.h" #include "log.h" diff --git a/src/shared/edit-util.h b/src/shared/edit-util.h index 2affa7eab1..89b30fe199 100644 --- a/src/shared/edit-util.h +++ b/src/shared/edit-util.h @@ -2,6 +2,7 @@ #pragma once #include +#include #define DROPIN_MARKER_START "### Anything between here and the comment below will become the contents of the drop-in file" #define DROPIN_MARKER_END "### Edits below this comment will be discarded" diff --git a/src/shared/fdisk-util.h b/src/shared/fdisk-util.h index a72a596f47..316a763b0d 100644 --- a/src/shared/fdisk-util.h +++ b/src/shared/fdisk-util.h @@ -7,7 +7,7 @@ #include "sd-id128.h" -#include "macro.h" +#include "memory-util.h" DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(struct fdisk_context*, fdisk_unref_context, NULL); DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(struct fdisk_partition*, fdisk_unref_partition, NULL); diff --git a/src/shared/hibernate-util.h b/src/shared/hibernate-util.h index 394d0b4176..966cc39f1d 100644 --- a/src/shared/hibernate-util.h +++ b/src/shared/hibernate-util.h @@ -2,8 +2,11 @@ #pragma once #include +#include #include +#include "assert-util.h" + /* represents values for /sys/power/resume & /sys/power/resume_offset and the corresponding path */ typedef struct HibernationDevice { dev_t devno; diff --git a/src/shared/hostname-setup.h b/src/shared/hostname-setup.h index bc602acbfc..e3601b8590 100644 --- a/src/shared/hostname-setup.h +++ b/src/shared/hostname-setup.h @@ -1,9 +1,12 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once +#include #include #include +#include "macro.h" + typedef enum HostnameSource { HOSTNAME_STATIC, /* from /etc/hostname */ HOSTNAME_TRANSIENT, /* a transient hostname set through systemd, hostnamed, the container manager, or otherwise */ diff --git a/src/shared/id128-print.h b/src/shared/id128-print.h index 7b2e593f16..4e3b9ba4d1 100644 --- a/src/shared/id128-print.h +++ b/src/shared/id128-print.h @@ -2,6 +2,7 @@ #pragma once +#include #include #include "sd-id128.h" diff --git a/src/shared/libcrypt-util.h b/src/shared/libcrypt-util.h index 5b9b945629..8abaec2112 100644 --- a/src/shared/libcrypt-util.h +++ b/src/shared/libcrypt-util.h @@ -2,6 +2,7 @@ #pragma once #include +#include int make_salt(char **ret); int hash_password_full(const char *password, void **cd_data, int *cd_size, char **ret); diff --git a/src/shared/loop-util.h b/src/shared/loop-util.h index 4f563172b6..0f9b76e91e 100644 --- a/src/shared/loop-util.h +++ b/src/shared/loop-util.h @@ -5,7 +5,7 @@ #include "sd-device.h" -#include "macro.h" +#include "memory-util.h" #include "time-util.h" typedef struct LoopDevice LoopDevice; diff --git a/src/shared/machine-credential.h b/src/shared/machine-credential.h index 182f077fe7..f223586450 100644 --- a/src/shared/machine-credential.h +++ b/src/shared/machine-credential.h @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once +#include #include typedef struct MachineCredential { diff --git a/src/shared/machine-id-setup.h b/src/shared/machine-id-setup.h index e733471afc..595b1d1570 100644 --- a/src/shared/machine-id-setup.h +++ b/src/shared/machine-id-setup.h @@ -3,6 +3,8 @@ #include +#include "sd-id128.h" + typedef enum MachineIdSetupFlags { MACHINE_ID_SETUP_FORCE_TRANSIENT = 1 << 0, MACHINE_ID_SETUP_FORCE_FIRMWARE = 1 << 1, diff --git a/src/shared/machine-pool.h b/src/shared/machine-pool.h index c57e47878f..dfc553f8b6 100644 --- a/src/shared/machine-pool.h +++ b/src/shared/machine-pool.h @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once +#include #include #include "sd-bus.h" diff --git a/src/shared/macvlan-util.h b/src/shared/macvlan-util.h index b61630b789..c8d7c77cc4 100644 --- a/src/shared/macvlan-util.h +++ b/src/shared/macvlan-util.h @@ -1,8 +1,11 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once +#include #include +#include "macro.h" + typedef enum MacVlanMode { NETDEV_MACVLAN_MODE_PRIVATE = MACVLAN_MODE_PRIVATE, NETDEV_MACVLAN_MODE_VEPA = MACVLAN_MODE_VEPA, diff --git a/src/shared/netif-sriov.h b/src/shared/netif-sriov.h index 4e0b19bf3b..cd79980b4e 100644 --- a/src/shared/netif-sriov.h +++ b/src/shared/netif-sriov.h @@ -4,6 +4,7 @@ #include #include "sd-device.h" +#include "sd-netlink.h" #include "conf-parser.h" #include "ether-addr-util.h" diff --git a/src/shared/pam-util.h b/src/shared/pam-util.h index 7dae9dd31d..c6df968c47 100644 --- a/src/shared/pam-util.h +++ b/src/shared/pam-util.h @@ -2,7 +2,9 @@ #pragma once #include +#include +#include "macro.h" #include "sd-bus.h" void pam_log_setup(void); diff --git a/src/shared/password-quality-util-pwquality.h b/src/shared/password-quality-util-pwquality.h index 35051f7c2d..9e3509b991 100644 --- a/src/shared/password-quality-util-pwquality.h +++ b/src/shared/password-quality-util-pwquality.h @@ -9,6 +9,7 @@ #include #include "dlfcn-util.h" +#include "memory-util.h" extern DLSYM_PROTOTYPE(pwquality_check); extern DLSYM_PROTOTYPE(pwquality_default_settings); diff --git a/src/shared/pkcs11-util.h b/src/shared/pkcs11-util.h index 8e54756675..386031ca54 100644 --- a/src/shared/pkcs11-util.h +++ b/src/shared/pkcs11-util.h @@ -15,7 +15,7 @@ #include "ask-password-api.h" #include "dlfcn-util.h" #include "log.h" -#include "macro.h" +#include "memory-util.h" #include "time-util.h" bool pkcs11_uri_valid(const char *uri); diff --git a/src/shared/ptyfwd.h b/src/shared/ptyfwd.h index b276cb15c5..1f1b771a39 100644 --- a/src/shared/ptyfwd.h +++ b/src/shared/ptyfwd.h @@ -5,7 +5,7 @@ #include "sd-event.h" -#include "macro.h" +#include "memory-util.h" typedef struct PTYForward PTYForward; diff --git a/src/shared/securebits-util.h b/src/shared/securebits-util.h index a8f108e0f9..ee25c9330c 100644 --- a/src/shared/securebits-util.h +++ b/src/shared/securebits-util.h @@ -1,9 +1,9 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once -#include - +#include #include +#include int secure_bits_to_string_alloc(int i, char **s); int secure_bits_from_string(const char *s); diff --git a/src/shared/volatile-util.h b/src/shared/volatile-util.h index 6e0206d3a0..ba3073b913 100644 --- a/src/shared/volatile-util.h +++ b/src/shared/volatile-util.h @@ -1,6 +1,8 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once +#include + typedef enum VolatileMode { VOLATILE_NO, VOLATILE_YES, diff --git a/src/shared/vpick.h b/src/shared/vpick.h index 38251c84e8..8373821dfa 100644 --- a/src/shared/vpick.h +++ b/src/shared/vpick.h @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once +#include #include #include "architecture.h" diff --git a/src/systemctl/systemctl-list-units.h b/src/systemctl/systemctl-list-units.h index cb190545e3..74bf9cda16 100644 --- a/src/systemctl/systemctl-list-units.h +++ b/src/systemctl/systemctl-list-units.h @@ -1,6 +1,8 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once +#include "time-util.h" + int verb_list_units(int argc, char *argv[], void *userdata); int verb_list_sockets(int argc, char *argv[], void *userdata); int verb_list_timers(int argc, char *argv[], void *userdata); diff --git a/src/timesync/timesyncd-ntp-message.h b/src/timesync/timesyncd-ntp-message.h index 76ed9ecac6..fc122cbb9a 100644 --- a/src/timesync/timesyncd-ntp-message.h +++ b/src/timesync/timesyncd-ntp-message.h @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once +#include "macro.h" #include "sparse-endian.h" /* NTP protocol, packet header */ diff --git a/src/udev/scsi_id/scsi.h b/src/udev/scsi_id/scsi.h index ebb8ae9008..1b535ea3fe 100644 --- a/src/udev/scsi_id/scsi.h +++ b/src/udev/scsi_id/scsi.h @@ -4,6 +4,7 @@ /* Copyright (C) IBM Corp. 2003 */ #include +#include struct scsi_ioctl_command { unsigned inlen; /* excluding scsi command length */ diff --git a/src/udev/udevadm-util.h b/src/udev/udevadm-util.h index cd0dcacf3c..f9a3b99fd7 100644 --- a/src/udev/udevadm-util.h +++ b/src/udev/udevadm-util.h @@ -3,6 +3,7 @@ #include "sd-device.h" +#include "time-util.h" #include "udev-def.h" int find_device(const char *id, const char *prefix, sd_device **ret); diff --git a/src/vmspawn/vmspawn-register.h b/src/vmspawn/vmspawn-register.h index d46e28c792..c785b162ba 100644 --- a/src/vmspawn/vmspawn-register.h +++ b/src/vmspawn/vmspawn-register.h @@ -1,5 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ +#include + #include "sd-bus.h" #include "sd-id128.h" diff --git a/src/vmspawn/vmspawn-util.h b/src/vmspawn/vmspawn-util.h index 66c1397ceb..b3d72ede72 100644 --- a/src/vmspawn/vmspawn-util.h +++ b/src/vmspawn/vmspawn-util.h @@ -2,7 +2,9 @@ #pragma once #include -#include "macro.h" + +#include "assert-util.h" +#include "memory-util.h" #if defined(__x86_64__) || defined(__i386__) || defined(__arm__) || defined(__aarch64__) # define ARCHITECTURE_SUPPORTS_SMBIOS 1