]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tree-wide: Make sure all headers are standalone 37185/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sat, 19 Apr 2025 21:21:55 +0000 (23:21 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 23 Apr 2025 08:33:38 +0000 (10:33 +0200)
Let's make sure all of our headers include everything they require.

81 files changed:
src/basic/iovec-wrapper.h
src/basic/missing_xfs.h
src/basic/pcapng.h
src/basic/pthread-util.h
src/basic/raw-reboot.h
src/basic/strbuf.h
src/basic/sysctl-util.h
src/basic/uid-classification.h
src/basic/uid-range.h
src/boot/url-discovery.h
src/core/dynamic-user.h
src/core/main.h
src/core/show-status.h
src/core/smack-setup.h
src/cryptsetup/cryptsetup-pkcs11.h
src/cryptsetup/cryptsetup-tokens/cryptsetup-token.h
src/cryptsetup/cryptsetup-tokens/luks2-pkcs11.h
src/fundamental/iovec-util-fundamental.h
src/home/homed-manager-bus.h
src/home/homework-mount.h
src/import/export-raw.h
src/import/export-tar.h
src/import/import-common.h
src/import/import-raw.c
src/import/import-raw.h
src/import/import-tar.c
src/import/import-tar.h
src/journal-remote/journal-upload.c
src/journal-remote/journal-upload.h
src/journal-remote/microhttpd-util.h
src/libsystemd/sd-bus/bus-signature.h
src/libsystemd/sd-bus/bus-socket.h
src/libsystemd/sd-bus/bus-track.h
src/libsystemd/sd-bus/test-vtable-data.h
src/libsystemd/sd-journal/mmap-cache.h
src/libsystemd/sd-json/json-internal.h
src/libsystemd/sd-netlink/netlink-slot.h
src/libsystemd/sd-varlink/varlink-idl-util.h
src/libudev/libudev-list-internal.h
src/network/networkd-bridge-mdb.h
src/network/networkd-ipv4acd.h
src/network/networkd-netlabel.h
src/network/networkd-nexthop.h
src/network/networkd-radv.h
src/network/networkd-route-util.h
src/network/networkd-state-file.h
src/network/networkd-wiphy.h
src/nspawn/nspawn-mount.h
src/nspawn/nspawn-seccomp.h
src/nspawn/nspawn-setuid.h
src/nsresourced/userns-registry.h
src/nss-systemd/nss-systemd.h
src/sbsign/authenticode.h
src/shared/bpf-compat.h
src/shared/cpu-set-util.h
src/shared/cryptsetup-fido2.h
src/shared/edit-util.h
src/shared/fdisk-util.h
src/shared/hibernate-util.h
src/shared/hostname-setup.h
src/shared/id128-print.h
src/shared/libcrypt-util.h
src/shared/loop-util.h
src/shared/machine-credential.h
src/shared/machine-id-setup.h
src/shared/machine-pool.h
src/shared/macvlan-util.h
src/shared/netif-sriov.h
src/shared/pam-util.h
src/shared/password-quality-util-pwquality.h
src/shared/pkcs11-util.h
src/shared/ptyfwd.h
src/shared/securebits-util.h
src/shared/volatile-util.h
src/shared/vpick.h
src/systemctl/systemctl-list-units.h
src/timesync/timesyncd-ntp-message.h
src/udev/scsi_id/scsi.h
src/udev/udevadm-util.h
src/vmspawn/vmspawn-register.h
src/vmspawn/vmspawn-util.h

index 4778fa6b275739df24864cf44f3fdc939f300351..f45dd87b7eff52ae45b3b23f629730ff32341d65 100644 (file)
@@ -5,6 +5,7 @@
 #include <sys/uio.h>
 
 #include "macro.h"
+#include "memory-util.h"
 
 struct iovec_wrapper {
         struct iovec *iovec;
index ba5fe8128858e85ede5776992df4cf384d077e03..67c4cefb87b9a0d7946f3406080c873f7fe5a2d9 100644 (file)
@@ -1,6 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include <stdint.h>
+
 /* This is currently not exported in the public kernel headers, but the libxfs library code part of xfsprogs
  * defines it as public header */
 
index 57c3af501ae5e50f7f30ce24d0ecc00274a85671..28ad0768775fe62a54959348715de4242d1ae241 100644 (file)
@@ -1,6 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include <stdint.h>
+
 /*
  * For details about the file format see RFC:
  *   https://www.ietf.org/id/draft-tuexen-opsawg-pcapng-03.html
index 113485d044b820f37d3288a165582f63fccbac72..4707f5503aa0b099293a521e68cce7ac950234ff 100644 (file)
@@ -3,7 +3,7 @@
 
 #include <pthread.h>
 
-#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);
index e6bff300a52ca9c355190eee021f7e375707ec86..d72ae1e955cf3877a0225ca6a70d96c778491292 100644 (file)
@@ -4,6 +4,7 @@
 #include <linux/reboot.h>
 #include <sys/reboot.h>
 #include <sys/syscall.h>
+#include <unistd.h>
 
 /* 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
index 405b34717ee98bffa14b8e0ed753984fec01c4db..143e39f0f0d72ee341399b4feebc632082995d52 100644 (file)
@@ -5,7 +5,7 @@
 #include <stdint.h>
 #include <sys/types.h>
 
-#include "macro.h"
+#include "memory-util.h"
 
 struct strbuf {
         char *buf;
index bbfc4ce1ea542c0172294e4d50bddc0cdab4d099..f3ae6fe7cf21933b757a9ea92afae0dc320c9ca5 100644 (file)
@@ -4,6 +4,7 @@
 #include <stdbool.h>
 #include <stdint.h>
 
+#include "hashmap.h"
 #include "macro.h"
 #include "stdio-util.h"
 #include "string-util.h"
index 2d76be5f04c98afc45975933b917c87eb5699bdc..c60daf5dcc39b343754b3cb17567f6590585608c 100644 (file)
@@ -4,6 +4,8 @@
 #include <stdbool.h>
 #include <sys/types.h>
 
+#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);
index 21e5c7a17b4ab0f318bba6165dd3e7007358189b..197085a60b124cd905e77501dae00cb1a5628cb1 100644 (file)
@@ -4,7 +4,7 @@
 #include <stdbool.h>
 #include <sys/types.h>
 
-#include "macro.h"
+#include "memory-util.h"
 
 typedef struct UIDRangeEntry {
         uid_t start, nr;
index e4e50c387cae3131fc7f428886dd7c8cb52a5bd0..aed48b432cb5597eb84f063aecb4d8da88e34d8a 100644 (file)
@@ -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);
index 594595038d393fbf971bc31d849f921c23ec2387..3e0074defbdde700bbb792455889454d85051c17 100644 (file)
@@ -1,8 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <stdio.h>
 #include <stdbool.h>
+#include <stdio.h>
 #include <sys/types.h>
 
 #include "fdset.h"
index 3b770b5a3f2583b7cb3c5c0ab4c069d112a13a16..f637cbad7aa37a86a916a0dd1286ac2f0ba60992 100644 (file)
@@ -3,6 +3,8 @@
 
 #include <stdbool.h>
 
+#include "crash-handler.h"
+
 extern bool arg_dump_core;
 extern int arg_crash_chvt;
 extern bool arg_crash_shell;
index f441223dff6a23fe7d3685ce776fadb89d5d526f..a51616f75aa0f675d0503babf01e6fb2592c1660 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include <stdarg.h>
 #include <stdbool.h>
 
 #include "macro.h"
index d29370d1e993555a51462f5ab0d9a88084f3a1fe..6758f07cef9b829cfb278212698b864a827a5245 100644 (file)
@@ -7,4 +7,6 @@
         Nathaniel Chen <nathaniel.chen@intel.com>
 ***/
 
+#include <stdbool.h>
+
 int mac_smack_setup(bool *loaded_policy);
index 83a2b54be32ef0879272a2ba09f929dba41b2756..98fd3bcb3d59b629d486e4ed15f1528636e2b1c0 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <sys/types.h>
 
+#include "ask-password-api.h"
 #include "cryptsetup-util.h"
 #include "log.h"
 #include "time-util.h"
index effd9d887c4b88d61fd3c1b3585f2244e570d6df..c1ccb5ed3123385530242f3c37d346ef8bcb6c25 100644 (file)
@@ -1,6 +1,10 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include <stddef.h>
+
+struct crypt_device;
+
 /* for more information see libcryptsetup.h crypt-tokens section */
 
 const char* cryptsetup_token_version(void);
index 41ce9f0608d2df388f1b4f9ccd2b7454fcdef118..640685ce6fff8be7b952a3c69b851bf6e68aece1 100644 (file)
@@ -2,6 +2,8 @@
 
 #pragma once
 
+#include <stddef.h>
+
 struct crypt_device;
 
 int acquire_luks2_key(
index 4214afea9a20a547b9bea559bc57ac36f2277994..6b658c89587bb619272f1a8ff80a1177e64dc5a4 100644 (file)
@@ -1,7 +1,13 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#if !SD_BOOT
+#include <stdlib.h>
+#include <sys/uio.h>
+#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 */
index 7db29fa88fd1dcc07bdf91cd8b177e5f40758f89..56aca18b7d79f94ced5bbfcf7a4c709c3e18ded8 100644 (file)
@@ -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;
index 255df26c9ae572037cde926fccf91ae7a29322f2..615b7d36e7a4d7fb50d5565285bf1d14bacc2b3a 100644 (file)
@@ -2,6 +2,7 @@
 #pragma once
 
 #include <stdbool.h>
+#include <sys/types.h>
 
 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);
index 27009e4e350f0aff6c83e9d4d0fcf78a7aa50e9c..7c952626476a0a67d5ec59e7ab1c90c5492c2811 100644 (file)
@@ -4,7 +4,7 @@
 #include "sd-event.h"
 
 #include "import-compress.h"
-#include "macro.h"
+#include "memory-util.h"
 
 typedef struct RawExport RawExport;
 
index 3b55d12c1f9dc40a57e19441d470651ed2d3591b..729b9ef73645a6f53f2a62b2abd56e8505cdef00 100644 (file)
@@ -4,7 +4,7 @@
 #include "sd-event.h"
 
 #include "import-compress.h"
-#include "macro.h"
+#include "memory-util.h"
 
 typedef struct TarExport TarExport;
 
index 219802492d177361027d1effa5764a2e2e2520b4..d7fb77a0700ce1b2958a98f2a50f344f9fdb67cf 100644 (file)
@@ -1,6 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include <errno.h>
+#include <stdbool.h>
 #include <sys/types.h>
 
 #include "sd-event.h"
index 033f5aeb658888dee7d22d36f41fe6e400178047..3685904e03d71322fdb27c69d369700be4018a25 100644 (file)
@@ -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"
index 63384eb171f539903983f5e5cb23ec4c835e7164..1feed79a5346509ee4466a1fa7313d27fb3456e7 100644 (file)
@@ -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;
 
index 7cad83ff002c5dabdf20af7054b5ecc598ba7537..a2e7eda51b7061ebcaa1820faa1a7fbf7cdda083 100644 (file)
@@ -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"
index 63b0bd4da6cca7aef13b4dfe79e16da9ae1ef01b..d90ba1199ad246c7b331fdde204653a93a6119e3 100644 (file)
@@ -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;
 
index 7e866aea0a6656cf2db0b79ed953f8904585fff7..7bf10f4de94b37248e7db259e6bdcf539503cc64 100644 (file)
@@ -1,6 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <curl/curl.h>
 #include <fcntl.h>
 #include <getopt.h>
 #include <stdio.h>
index 67cec92dfe5736b2b4c8159db3d336e27bf958db..cd3c7a7fbecb7c58d4de264249ae023c75e864d7 100644 (file)
@@ -2,6 +2,7 @@
 
 #pragma once
 
+#include <curl/curl.h>
 #include <inttypes.h>
 
 #include "sd-event.h"
index bb888e8aedad1705686d367fe68a011d32d0a6b9..57396ad9b6968cf57ca85c797fb99b18440052b1 100644 (file)
@@ -4,7 +4,7 @@
 #include <microhttpd.h>
 #include <stdarg.h>
 
-#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
index 314fcc27c57f881c3eb77b9df3dc7319c6feea8c..0fea7507447d0801eec061d66b1df67c90c2dfb7 100644 (file)
@@ -2,6 +2,7 @@
 #pragma once
 
 #include <stdbool.h>
+#include <stddef.h>
 
 bool signature_is_single(const char *s, bool allow_dict_entry);
 bool signature_is_pair(const char *s);
index 52bc404625477367d969b9095e703be3136d38d2..fc8c1eda09a916aa20ac6222d0f10476d83491e2 100644 (file)
@@ -1,6 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include <stdbool.h>
+
 #include "sd-bus.h"
 
 void bus_socket_setup(sd_bus *b);
index 8dae1f3902446c5659c967183910938ddc17fbaa..6868cda1e2c8fbf54842219918920949d4897e35 100644 (file)
@@ -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);
index 7269a499459f8cfc6f8e0a9b26ebacc5995334a4..0bb1ae7343da87326d13544c71b92016f422d488 100644 (file)
@@ -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 <stdbool.h>
+
+#include "sd-bus-vtable.h"
 
 struct context {
         bool quit;
index 1fbc236bda9096af52b350320780c8f97ddb2fd3..3e088ef8ef8fedee5d39baf070d9e501bf5f8646 100644 (file)
@@ -6,6 +6,7 @@
 #include <sys/stat.h>
 
 #include "journal-def.h"
+#include "memory-util.h"
 
 typedef struct MMapCache MMapCache;
 typedef struct MMapFileDescriptor MMapFileDescriptor;
index 5117b39f45215fc4556d6bbfe46013b70f42ce6e..9ecdd6bb1a152763fbe6a76183ff4ba171efda3e 100644 (file)
@@ -2,8 +2,12 @@
 
 #pragma once
 
+#include <stdbool.h>
+
 #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. */
index 79de817262260c00510d6f8cd2e3db824be451a2..4098061d31fa14567ecd1752b15b99fc2941742a 100644 (file)
@@ -1,8 +1,12 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include <stdbool.h>
+
 #include "sd-netlink.h"
 
+#include "netlink-internal.h"
+
 int netlink_slot_allocate(
                 sd_netlink *nl,
                 bool floating,
index 8c9274eefa63addd10187385a574c9ca13f4acc9..9c5df26d122fb231930c29a8ba5b8ba0410b44e7 100644 (file)
@@ -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);
index 00c1d40763209cd3fbd3675f762518b4aaa4f8f7..dd4fcbc7718271b87811af3de6fb405a043f6d78 100644 (file)
@@ -3,7 +3,7 @@
 
 #include "libudev.h"
 
-#include "macro.h"
+#include "memory-util.h"
 
 struct udev_list;
 
index 3b565d7f67c293371c3d79a06d8c4a589473a91f..89c70fb68f0338d35daffa174c3d85b319929903 100644 (file)
@@ -2,6 +2,7 @@
 #pragma once
 
 #include <inttypes.h>
+#include <net/ethernet.h>
 
 #include "conf-parser.h"
 #include "in-addr-util.h"
index fc9f92d4f42794b79da865658b89f8150de61483..75b4c97a05d57551cf5835dd407b6435882b262c 100644 (file)
@@ -1,6 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include <stdbool.h>
+
 typedef struct Address Address;
 typedef struct Link Link;
 
index 2f30b8fedaeac6699a2d1ef1c23944d6362f4805..f18ad5aa14f53c90f4967a0b1f21c1a940c8d203 100644 (file)
@@ -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);
index 00120d04af6f1bc3cec12389556e9989911864b3..1b0679fc37f9bcb50a61bc0892c901c4eb9757b9 100644 (file)
@@ -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,
index ed8ee216de83d9e4ada14460347cc0e7bf6c0756..23af8a2ba5b8d59214ec81cc007e61d49fbc51b6 100644 (file)
@@ -15,6 +15,7 @@
 #include "ndisc-option.h"
 #include "networkd-util.h"
 
+typedef struct Address Address;
 typedef struct Link Link;
 typedef struct Network Network;
 
index 2905a4913b1fa8768743d1245bb41643f539bf39..dfa3bf3c6f3295b42717a82c09edc9b94f8cc0a4 100644 (file)
@@ -5,6 +5,7 @@
 #include <stdbool.h>
 
 #include "conf-parser.h"
+#include "in-addr-util.h"
 
 typedef struct Link Link;
 typedef struct Manager Manager;
index 7efd1578da09cea1d1f1946f7fbb84fe71bec87f..c45bd5308323acb7814c8321b49587a1daa4c72c 100644 (file)
@@ -1,6 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include <stdbool.h>
+
 typedef struct Link Link;
 typedef struct Manager Manager;
 
index 8f92112148ab411bec6ebb3bf0e57b4cca135458..9a42b26be6fae28b67b317bfcb69999c0f00b1ec 100644 (file)
@@ -4,6 +4,7 @@
 #include <inttypes.h>
 
 #include "sd-device.h"
+#include "sd-netlink.h"
 
 #include "macro.h"
 
index 2efcd110fcd51741c4e1d4e3b9e521dcf2e992a1..a1819f08373040cdc8287e945d30473c4745ad12 100644 (file)
@@ -2,6 +2,8 @@
 #pragma once
 
 #include <stdbool.h>
+#include <stddef.h>
+#include <sys/types.h>
 
 #include "volatile-util.h"
 
index 2690fba686580abff5e21c8eb65a552ec7198203..a2fa9a61c6568992e584c2920625e4de36c17f5d 100644 (file)
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <sys/types.h>
+#include <stdint.h>
 
 int setup_seccomp(uint64_t cap_list_retain, char **syscall_allow_list, char **syscall_deny_list);
index 192471143f1738351614f5a1ec44249d89563e59..2dc9a696065a2a34872bf99e8b410b6b991f05b6 100644 (file)
@@ -1,5 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include <stdbool.h>
+#include <sys/types.h>
+
 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);
index 72fe99007939f68fe93d0deaf6fce67299f35384..e25b402e8884c79f52962853992c0e376759d9c7 100644 (file)
@@ -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
index e97b801575528ef76552de40ccf5d3693207ced4..2b46044e14591eaf9c56c156e1350674f347947e 100644 (file)
@@ -3,6 +3,8 @@
 
 #include <stdbool.h>
 
+#include "assert-util.h"
+
 int _nss_systemd_block(bool b);
 bool _nss_systemd_is_blocked(void);
 
index 98a8374805c2fb7b2abd1bb42f2e1857ed30ee5d..04bd336e0cc7d2d9df3b238f6a171fa88258409d 100644 (file)
@@ -3,7 +3,7 @@
 
 #include <openssl/asn1t.h>
 
-#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"
index 3d94bf2e05e6f6d9e8e2be3995b566abc7f93846..27857e9d72eaa7f307105d6805de27a91c91485c 100644 (file)
@@ -1,6 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include <bpf/libbpf.h>
+
 /* libbpf has been moving quickly.
  * They added new symbols in the 0.x versions and shortly after removed
  * deprecated symbols in 1.0.
index 2c477d8a01f3cfcece9e93296d91351a36218722..d62b2d60e6d81ce4bfbc5ada1f46e292c9173460 100644 (file)
@@ -3,7 +3,7 @@
 
 #include <sched.h>
 
-#include "macro.h"
+#include "memory-util.h"
 #include "missing_syscall.h"
 
 /* This wraps the libc interface with a variable to keep the allocated size. */
index 86ac30c76640d1155729ce2fa08618ed7ee77ce5..3e08b79f7a085cb85c81470e141954050df9c917 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <sys/types.h>
 
+#include "ask-password-api.h"
 #include "cryptsetup-util.h"
 #include "libfido2-util.h"
 #include "log.h"
index 2affa7eab16838f7eff597aa716a00b50d17f22e..89b30fe19908e0295b2ece58dfd3cf2877756027 100644 (file)
@@ -2,6 +2,7 @@
 #pragma once
 
 #include <stdbool.h>
+#include <stddef.h>
 
 #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"
index a72a596f4728daff38e4f6b3ff1362fcde8a3bf3..316a763b0d392bf875a7610ebedad236d153db35 100644 (file)
@@ -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);
index 394d0b41766b42bd730578ecad84e03cbea81a48..966cc39f1ddf284b58e70b9964a47e7358ed8d00 100644 (file)
@@ -2,8 +2,11 @@
 #pragma once
 
 #include <linux/fiemap.h>
+#include <stdint.h>
 #include <sys/types.h>
 
+#include "assert-util.h"
+
 /* represents values for /sys/power/resume & /sys/power/resume_offset and the corresponding path */
 typedef struct HibernationDevice {
         dev_t devno;
index bc602acbfc477839c5c7426401e916b55c003ad1..e3601b85907744282e6f79dae250ebf441620ed1 100644 (file)
@@ -1,9 +1,12 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include <errno.h>
 #include <stdbool.h>
 #include <stdio.h>
 
+#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 */
index 7b2e593f16ca5f83b34d73fce440ccf13ef6903a..4e3b9ba4d1a472a00bd664b011a4f0f0a0d17a8e 100644 (file)
@@ -2,6 +2,7 @@
 
 #pragma once
 
+#include <errno.h>
 #include <stdbool.h>
 
 #include "sd-id128.h"
index 5b9b94562938cfed967a43d72940f65d6d0b5db2..8abaec2112cc6030b3114c5f2d1ab435ed56eea0 100644 (file)
@@ -2,6 +2,7 @@
 #pragma once
 
 #include <stdbool.h>
+#include <stddef.h>
 
 int make_salt(char **ret);
 int hash_password_full(const char *password, void **cd_data, int *cd_size, char **ret);
index 4f563172b6d040719c175ea0ddb96684a24d7f19..0f9b76e91e3e2614a69ccb432287cc3ad5f0e114 100644 (file)
@@ -5,7 +5,7 @@
 
 #include "sd-device.h"
 
-#include "macro.h"
+#include "memory-util.h"
 #include "time-util.h"
 
 typedef struct LoopDevice LoopDevice;
index 182f077fe7e4fbc01af5a5485dd4f7ed4d54e52e..f22358645016cd9d9d8f3d76536b8160d7786884 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include <stdbool.h>
 #include <sys/types.h>
 
 typedef struct MachineCredential {
index e733471afc9ae05fd8678147879c5d2188aa1173..595b1d157022a8b5ab675016d5a6a8339cca8674 100644 (file)
@@ -3,6 +3,8 @@
 
 #include <stdbool.h>
 
+#include "sd-id128.h"
+
 typedef enum MachineIdSetupFlags {
         MACHINE_ID_SETUP_FORCE_TRANSIENT = 1 << 0,
         MACHINE_ID_SETUP_FORCE_FIRMWARE  = 1 << 1,
index c57e47878fbbdb1cbb422a3a26f2e5004c78b18e..dfc553f8b6bd6c734353aa6a4990d20afb5e3682 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include <stdbool.h>
 #include <stdint.h>
 
 #include "sd-bus.h"
index b61630b789d8846d1bc34d2d16c77894401c9675..c8d7c77cc43e8d8fa42293b8808e4303dc4cad25 100644 (file)
@@ -1,8 +1,11 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include <errno.h>
 #include <linux/if_link.h>
 
+#include "macro.h"
+
 typedef enum MacVlanMode {
         NETDEV_MACVLAN_MODE_PRIVATE = MACVLAN_MODE_PRIVATE,
         NETDEV_MACVLAN_MODE_VEPA = MACVLAN_MODE_VEPA,
index 4e0b19bf3bb56090b29aca9b2c4261b3da165412..cd79980b4e07e068cd23f69ec46d869c44236854 100644 (file)
@@ -4,6 +4,7 @@
 #include <linux/if_link.h>
 
 #include "sd-device.h"
+#include "sd-netlink.h"
 
 #include "conf-parser.h"
 #include "ether-addr-util.h"
index 7dae9dd31d7e444c414f1fdee3a53e418c494c15..c6df968c4721e065fe8f7733908ec8e38de59cce 100644 (file)
@@ -2,7 +2,9 @@
 #pragma once
 
 #include <security/pam_modules.h>
+#include <syslog.h>
 
+#include "macro.h"
 #include "sd-bus.h"
 
 void pam_log_setup(void);
index 35051f7c2da1815cbfa8e41ee242f9f73fdda9af..9e3509b991fd907679032b97db9a7d05bca50947 100644 (file)
@@ -9,6 +9,7 @@
 #include <pwquality.h>
 
 #include "dlfcn-util.h"
+#include "memory-util.h"
 
 extern DLSYM_PROTOTYPE(pwquality_check);
 extern DLSYM_PROTOTYPE(pwquality_default_settings);
index 8e5475667584dc33761dbe64646e0ac33ea9d81c..386031ca54463e54e3b45d9dbf38546b58a4c7a2 100644 (file)
@@ -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);
index b276cb15c59c0e8c238a05d48beac770c0a6770b..1f1b771a399671abf58fe2a2e1615487403f7a14 100644 (file)
@@ -5,7 +5,7 @@
 
 #include "sd-event.h"
 
-#include "macro.h"
+#include "memory-util.h"
 
 typedef struct PTYForward PTYForward;
 
index a8f108e0f96943023dce17cecba248ec1c63ea7a..ee25c9330cb911b1246d0c12fb2fffd81e73b62a 100644 (file)
@@ -1,9 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <stdbool.h>
-
+#include <errno.h>
 #include <linux/securebits.h>
+#include <stdbool.h>
 
 int secure_bits_to_string_alloc(int i, char **s);
 int secure_bits_from_string(const char *s);
index 6e0206d3a0c8cda8f5df839291694ce0db0af7c1..ba3073b91318922c28ba0f3c303a383ab8f9675f 100644 (file)
@@ -1,6 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include <errno.h>
+
 typedef enum VolatileMode {
         VOLATILE_NO,
         VOLATILE_YES,
index 38251c84e8576706012b1d829332bba12809eb1a..8373821dfab3fff4009aa40fadbf44ae16fbf08b 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include <sys/stat.h>
 #include <sys/types.h>
 
 #include "architecture.h"
index cb190545e3cd037775279bbf749aad4d057dd976..74bf9cda166a08d2a34de41c836b07b1b7e6401a 100644 (file)
@@ -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);
index 76ed9ecac609336bb2cac6a9a3e7ba276fc3c325..fc122cbb9abaf172ab3a6aa3aaf26a8e3b265418 100644 (file)
@@ -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 */
index ebb8ae9008be9010f75b68a61e1426d1163ef041..1b535ea3fe79c2e2d35eea3f56fe1bab855e60f3 100644 (file)
@@ -4,6 +4,7 @@
 /* Copyright (C) IBM Corp. 2003 */
 
 #include <scsi/scsi.h>
+#include <sys/types.h>
 
 struct scsi_ioctl_command {
         unsigned inlen;        /* excluding scsi command length */
index cd0dcacf3c719077b335eab7e4250beaf096350c..f9a3b99fd7371885753be77fa0bc1fb3eb988558 100644 (file)
@@ -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);
index d46e28c7925884fa39890a337596be506c9b0a6a..c785b162ba59e1a6db363fc5907232f4a575bf78 100644 (file)
@@ -1,5 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <stdbool.h>
+
 #include "sd-bus.h"
 #include "sd-id128.h"
 
index 66c1397ceb5310a6ea8680434e16ff474519dce8..b3d72ede726c0cdfc887f26d07dd4e2025fb4f6d 100644 (file)
@@ -2,7 +2,9 @@
 #pragma once
 
 #include <stdbool.h>
-#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