tree-wide: Make sure all headers are standalone

Let's make sure all of our headers include everything they require.
This commit is contained in:
Daan De Meyer
2025-04-23 10:33:38 +02:00
parent 44de729cdc
commit 401a22bfc1
81 changed files with 128 additions and 27 deletions
+2
View 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.
+1 -1
View 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. */
+1
View 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"
+1
View 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"
+1 -1
View 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);
+3
View 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;
+3
View 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 */
+1
View File
@@ -2,6 +2,7 @@
#pragma once
#include <errno.h>
#include <stdbool.h>
#include "sd-id128.h"
+1
View 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);
+1 -1
View File
@@ -5,7 +5,7 @@
#include "sd-device.h"
#include "macro.h"
#include "memory-util.h"
#include "time-util.h"
typedef struct LoopDevice LoopDevice;
+1
View 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 {
+2
View 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,
+1
View 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"
+3
View 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,
+1
View 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"
+2
View 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);
@@ -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);
+1 -1
View 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);
+1 -1
View File
@@ -5,7 +5,7 @@
#include "sd-event.h"
#include "macro.h"
#include "memory-util.h"
typedef struct PTYForward PTYForward;
+2 -2
View 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);
+2
View 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,
+1
View 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"