Let's make sure all of our headers include everything they require.
#include <sys/uio.h>
#include "macro.h"
+#include "memory-util.h"
struct iovec_wrapper {
struct iovec *iovec;
/* 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 */
/* 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
#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);
#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
#include <stdint.h>
#include <sys/types.h>
-#include "macro.h"
+#include "memory-util.h"
struct strbuf {
char *buf;
#include <stdbool.h>
#include <stdint.h>
+#include "hashmap.h"
#include "macro.h"
#include "stdio-util.h"
#include "string-util.h"
#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);
#include <stdbool.h>
#include <sys/types.h>
-#include "macro.h"
+#include "memory-util.h"
typedef struct UIDRangeEntry {
uid_t start, nr;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
+#include "efi.h"
+
char16_t *disk_get_url(EFI_HANDLE *handle);
/* 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"
#include <stdbool.h>
+#include "crash-handler.h"
+
extern bool arg_dump_core;
extern int arg_crash_chvt;
extern bool arg_crash_shell;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
+#include <stdarg.h>
#include <stdbool.h>
#include "macro.h"
Nathaniel Chen <nathaniel.chen@intel.com>
***/
+#include <stdbool.h>
+
int mac_smack_setup(bool *loaded_policy);
#include <sys/types.h>
+#include "ask-password-api.h"
#include "cryptsetup-util.h"
#include "log.h"
#include "time-util.h"
/* 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);
#pragma once
+#include <stddef.h>
+
struct crypt_device;
int acquire_luks2_key(
/* 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 */
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "bus-util.h"
+#include "bus-object.h"
extern const BusObjectImplementation manager_object;
#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);
#include "sd-event.h"
#include "import-compress.h"
-#include "macro.h"
+#include "memory-util.h"
typedef struct RawExport RawExport;
#include "sd-event.h"
#include "import-compress.h"
-#include "macro.h"
+#include "memory-util.h"
typedef struct TarExport TarExport;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
+#include <errno.h>
+#include <stdbool.h>
#include <sys/types.h>
#include "sd-event.h"
#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"
#include "sd-event.h"
#include "import-common.h"
-#include "import-util.h"
-#include "macro.h"
+#include "memory-util.h"
typedef struct RawImport RawImport;
#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"
#include "sd-event.h"
#include "import-common.h"
-#include "import-util.h"
-#include "macro.h"
+#include "memory-util.h"
typedef struct TarImport TarImport;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <curl/curl.h>
#include <fcntl.h>
#include <getopt.h>
#include <stdio.h>
#pragma once
+#include <curl/curl.h>
#include <inttypes.h>
#include "sd-event.h"
#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
#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);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
+#include <stdbool.h>
+
#include "sd-bus.h"
void bus_socket_setup(sd_bus *b);
/* 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);
/* 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;
#include <sys/stat.h>
#include "journal-def.h"
+#include "memory-util.h"
typedef struct MMapCache MMapCache;
typedef struct MMapFileDescriptor MMapFileDescriptor;
#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. */
/* 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,
#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);
#include "libudev.h"
-#include "macro.h"
+#include "memory-util.h"
struct udev_list;
#pragma once
#include <inttypes.h>
+#include <net/ethernet.h>
#include "conf-parser.h"
#include "in-addr-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
+#include <stdbool.h>
+
typedef struct Address Address;
typedef struct Link Link;
/* 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);
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,
#include "ndisc-option.h"
#include "networkd-util.h"
+typedef struct Address Address;
typedef struct Link Link;
typedef struct Network Network;
#include <stdbool.h>
#include "conf-parser.h"
+#include "in-addr-util.h"
typedef struct Link Link;
typedef struct Manager Manager;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
+#include <stdbool.h>
+
typedef struct Link Link;
typedef struct Manager Manager;
#include <inttypes.h>
#include "sd-device.h"
+#include "sd-netlink.h"
#include "macro.h"
#pragma once
#include <stdbool.h>
+#include <stddef.h>
+#include <sys/types.h>
#include "volatile-util.h"
/* 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);
/* 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);
/* 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
#include <stdbool.h>
+#include "assert-util.h"
+
int _nss_systemd_block(bool b);
bool _nss_systemd_is_blocked(void);
#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"
/* 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.
#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. */
#include <sys/types.h>
+#include "ask-password-api.h"
#include "cryptsetup-util.h"
#include "libfido2-util.h"
#include "log.h"
#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"
#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);
#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;
/* 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 */
#pragma once
+#include <errno.h>
#include <stdbool.h>
#include "sd-id128.h"
#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);
#include "sd-device.h"
-#include "macro.h"
+#include "memory-util.h"
#include "time-util.h"
typedef struct LoopDevice LoopDevice;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
+#include <stdbool.h>
#include <sys/types.h>
typedef struct MachineCredential {
#include <stdbool.h>
+#include "sd-id128.h"
+
typedef enum MachineIdSetupFlags {
MACHINE_ID_SETUP_FORCE_TRANSIENT = 1 << 0,
MACHINE_ID_SETUP_FORCE_FIRMWARE = 1 << 1,
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
+#include <stdbool.h>
#include <stdint.h>
#include "sd-bus.h"
/* 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,
#include <linux/if_link.h>
#include "sd-device.h"
+#include "sd-netlink.h"
#include "conf-parser.h"
#include "ether-addr-util.h"
#pragma once
#include <security/pam_modules.h>
+#include <syslog.h>
+#include "macro.h"
#include "sd-bus.h"
void pam_log_setup(void);
#include <pwquality.h>
#include "dlfcn-util.h"
+#include "memory-util.h"
extern DLSYM_PROTOTYPE(pwquality_check);
extern DLSYM_PROTOTYPE(pwquality_default_settings);
#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);
#include "sd-event.h"
-#include "macro.h"
+#include "memory-util.h"
typedef struct PTYForward PTYForward;
/* 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);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
+#include <errno.h>
+
typedef enum VolatileMode {
VOLATILE_NO,
VOLATILE_YES,
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
+#include <sys/stat.h>
#include <sys/types.h>
#include "architecture.h"
/* 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);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
+#include "macro.h"
#include "sparse-endian.h"
/* NTP protocol, packet header */
/* Copyright (C) IBM Corp. 2003 */
#include <scsi/scsi.h>
+#include <sys/types.h>
struct scsi_ioctl_command {
unsigned inlen; /* excluding scsi command length */
#include "sd-device.h"
+#include "time-util.h"
#include "udev-def.h"
int find_device(const char *id, const char *prefix, sd_device **ret);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include <stdbool.h>
+
#include "sd-bus.h"
#include "sd-id128.h"
#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