From d36719f5c99324b1c37e32b217e4aff845683d59 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 2 Aug 2016 22:00:19 -0400 Subject: ensure that include order of headers does not matter --- src/busctl/busctl-introspect.h | 1 + src/grp-boot/systemd-boot/console.h | 2 + src/grp-boot/systemd-boot/disk.h | 2 + src/grp-boot/systemd-boot/graphics.h | 2 + src/grp-boot/systemd-boot/linux.h | 2 + src/grp-boot/systemd-boot/measure.h | 2 + src/grp-boot/systemd-boot/pefile.h | 2 + src/grp-boot/systemd-boot/splash.h | 2 + src/grp-boot/systemd-boot/util.h | 2 +- .../systemd-journal-upload/journal-upload.h | 1 + src/grp-login/liblogind-core/logind-button.h | 4 +- .../liblogind-core/logind-session-device.h | 5 +- src/grp-login/liblogind-core/logind-user.h | 3 +- src/grp-login/liblogind-core/logind.h | 198 +++++++++++++++++++++ src/grp-login/systemd-logind/logind.h | 197 -------------------- .../grp-import/systemd-import/import-common.h | 2 + .../systemd-resolved/resolved-dns-server.h | 20 +-- src/grp-system/libcore/busname.h | 1 - src/grp-system/libcore/cgroup.h | 1 - src/grp-system/libcore/dbus-automount.h | 1 + src/grp-system/libcore/dbus-busname.h | 1 + src/grp-system/libcore/dbus-path.h | 2 +- src/grp-system/libcore/device.h | 2 + src/grp-system/libcore/killall.h | 2 + src/grp-system/libcore/machine-id-setup.h | 2 + src/grp-system/libcore/scope.h | 1 + src/grp-system/libcore/service.h | 3 +- src/grp-system/libcore/slice.h | 2 + src/grp-system/libcore/smack-setup.h | 2 + src/grp-system/libcore/socket.h | 1 - src/grp-system/libcore/swap.h | 2 + src/grp-system/libcore/target.h | 6 +- src/grp-system/libcore/timer.h | 2 + src/grp-system/libcore/unit.h | 2 + src/grp-udev/scsi_id/scsi.h | 1 + src/libbasic/include/basic/btrfs-ctree.h | 1 + src/libbasic/include/basic/missing_syscall.h | 4 + src/libbasic/include/basic/rm-rf.h | 3 + src/libshared/include/shared/test-tables.h | 2 + src/libsystemd/include/systemd/sd-bus-vtable.h | 3 +- src/libsystemd/src/sd-bus/bus-signature.h | 1 + src/libsystemd/src/sd-bus/bus-socket.h | 2 + src/libsystemd/src/sd-bus/bus-track.h | 2 + src/libsystemd/src/sd-journal/mmap-cache.h | 2 + src/libsystemd/src/sd-network/network-util.h | 2 + src/systemd-nspawn/nspawn-mount.h | 1 + src/systemd-shutdown/umount.h | 2 + 47 files changed, 283 insertions(+), 223 deletions(-) create mode 100644 src/grp-login/liblogind-core/logind.h delete mode 100644 src/grp-login/systemd-logind/logind.h (limited to 'src') diff --git a/src/busctl/busctl-introspect.h b/src/busctl/busctl-introspect.h index d922e352db..3dd1df4e47 100644 --- a/src/busctl/busctl-introspect.h +++ b/src/busctl/busctl-introspect.h @@ -20,6 +20,7 @@ ***/ #include +#include typedef struct XMLIntrospectOps { int (*on_path)(const char *path, void *userdata); diff --git a/src/grp-boot/systemd-boot/console.h b/src/grp-boot/systemd-boot/console.h index 3fe0ce5ec4..887995a9cc 100644 --- a/src/grp-boot/systemd-boot/console.h +++ b/src/grp-boot/systemd-boot/console.h @@ -16,6 +16,8 @@ #ifndef __SDBOOT_CONSOLE_H #define __SDBOOT_CONSOLE_H +#include + #define EFI_SHIFT_STATE_VALID 0x80000000 #define EFI_RIGHT_CONTROL_PRESSED 0x00000004 #define EFI_LEFT_CONTROL_PRESSED 0x00000008 diff --git a/src/grp-boot/systemd-boot/disk.h b/src/grp-boot/systemd-boot/disk.h index af91a9c674..5804b8881a 100644 --- a/src/grp-boot/systemd-boot/disk.h +++ b/src/grp-boot/systemd-boot/disk.h @@ -15,5 +15,7 @@ #ifndef __SDBOOT_DISK_H #define __SDBOOT_DISK_H +#include + EFI_STATUS disk_get_part_uuid(EFI_HANDLE *handle, CHAR16 uuid[37]); #endif diff --git a/src/grp-boot/systemd-boot/graphics.h b/src/grp-boot/systemd-boot/graphics.h index cf48e647e7..d8e5adfcd8 100644 --- a/src/grp-boot/systemd-boot/graphics.h +++ b/src/grp-boot/systemd-boot/graphics.h @@ -18,5 +18,7 @@ #ifndef __SDBOOT_GRAPHICS_H #define __SDBOOT_GRAPHICS_H +#include + EFI_STATUS graphics_mode(BOOLEAN on); #endif diff --git a/src/grp-boot/systemd-boot/linux.h b/src/grp-boot/systemd-boot/linux.h index d9e6ed7955..b87a7f0d38 100644 --- a/src/grp-boot/systemd-boot/linux.h +++ b/src/grp-boot/systemd-boot/linux.h @@ -15,6 +15,8 @@ #ifndef __SDBOOT_kernel_H #define __SDBOOT_kernel_H +#include + EFI_STATUS linux_exec(EFI_HANDLE *image, CHAR8 *cmdline, UINTN cmdline_size, UINTN linux_addr, diff --git a/src/grp-boot/systemd-boot/measure.h b/src/grp-boot/systemd-boot/measure.h index a2cfe817d0..ddd686a8fd 100644 --- a/src/grp-boot/systemd-boot/measure.h +++ b/src/grp-boot/systemd-boot/measure.h @@ -13,6 +13,8 @@ #ifndef __SDBOOT_MEASURE_H #define __SDBOOT_MEASURE_H +#include + #ifndef SD_TPM_PCR #define SD_TPM_PCR 8 #endif diff --git a/src/grp-boot/systemd-boot/pefile.h b/src/grp-boot/systemd-boot/pefile.h index 2e445ede17..bc2d73fea9 100644 --- a/src/grp-boot/systemd-boot/pefile.h +++ b/src/grp-boot/systemd-boot/pefile.h @@ -15,6 +15,8 @@ #ifndef __SDBOOT_PEFILE_H #define __SDBOOT_PEFILE_H +#include + EFI_STATUS pefile_locate_sections(EFI_FILE *dir, CHAR16 *path, CHAR8 **sections, UINTN *addrs, UINTN *offsets, UINTN *sizes); #endif diff --git a/src/grp-boot/systemd-boot/splash.h b/src/grp-boot/systemd-boot/splash.h index 09b543fb47..362ff22643 100644 --- a/src/grp-boot/systemd-boot/splash.h +++ b/src/grp-boot/systemd-boot/splash.h @@ -16,5 +16,7 @@ #ifndef __SDBOOT_SPLASH_H #define __SDBOOT_SPLASH_H +#include + EFI_STATUS graphics_splash(UINT8 *content, UINTN len, const EFI_GRAPHICS_OUTPUT_BLT_PIXEL *background); #endif diff --git a/src/grp-boot/systemd-boot/util.h b/src/grp-boot/systemd-boot/util.h index e673cdf9a0..e2da8b3fee 100644 --- a/src/grp-boot/systemd-boot/util.h +++ b/src/grp-boot/systemd-boot/util.h @@ -22,7 +22,7 @@ #define ELEMENTSOF(x) (sizeof(x)/sizeof((x)[0])) static inline const CHAR16 *yes_no(BOOLEAN b) { - return b ? L"yes" : L"no"; + return b ? (CHAR16*)L"yes" : (CHAR16*)L"no"; } EFI_STATUS parse_boolean(CHAR8 *v, BOOLEAN *b); diff --git a/src/grp-journal/grp-remote/systemd-journal-upload/journal-upload.h b/src/grp-journal/grp-remote/systemd-journal-upload/journal-upload.h index 2decc7b22e..9eeb8d2123 100644 --- a/src/grp-journal/grp-remote/systemd-journal-upload/journal-upload.h +++ b/src/grp-journal/grp-remote/systemd-journal-upload/journal-upload.h @@ -1,5 +1,6 @@ #pragma once +#include #include #include diff --git a/src/grp-login/liblogind-core/logind-button.h b/src/grp-login/liblogind-core/logind-button.h index 876e4d3cdf..f30cba2959 100644 --- a/src/grp-login/liblogind-core/logind-button.h +++ b/src/grp-login/liblogind-core/logind-button.h @@ -19,10 +19,10 @@ along with systemd; If not, see . ***/ -#include "logind.h" - typedef struct Button Button; +#include "logind.h" + struct Button { Manager *manager; diff --git a/src/grp-login/liblogind-core/logind-session-device.h b/src/grp-login/liblogind-core/logind-session-device.h index c20962f21c..4a22decb1d 100644 --- a/src/grp-login/liblogind-core/logind-session-device.h +++ b/src/grp-login/liblogind-core/logind-session-device.h @@ -19,12 +19,13 @@ along with systemd; If not, see . ***/ -typedef enum DeviceType DeviceType; #include "basic/list.h" -#include "logind.h" +typedef enum DeviceType DeviceType; typedef struct SessionDevice SessionDevice; +#include "logind.h" + enum DeviceType { DEVICE_TYPE_UNKNOWN, DEVICE_TYPE_DRM, diff --git a/src/grp-login/liblogind-core/logind-user.h b/src/grp-login/liblogind-core/logind-user.h index 8663be3994..b23c59fa1d 100644 --- a/src/grp-login/liblogind-core/logind-user.h +++ b/src/grp-login/liblogind-core/logind-user.h @@ -20,10 +20,11 @@ ***/ #include "basic/list.h" -#include "logind.h" typedef struct User User; +#include "logind.h" + typedef enum UserState { USER_OFFLINE, /* Not logged in at all */ USER_OPENING, /* Is logging in */ diff --git a/src/grp-login/liblogind-core/logind.h b/src/grp-login/liblogind-core/logind.h new file mode 100644 index 0000000000..effc498118 --- /dev/null +++ b/src/grp-login/liblogind-core/logind.h @@ -0,0 +1,198 @@ +#pragma once + +/*** + This file is part of systemd. + + Copyright 2011 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#include + +#include +#include +#include + +#include "basic/hashmap.h" +#include "basic/list.h" +#include "basic/set.h" + +typedef struct Manager Manager; + +#include "logind-action.h" +#include "logind-button.h" +#include "logind-device.h" +#include "logind-inhibit.h" + +struct Manager { + sd_event *event; + sd_bus *bus; + + Hashmap *devices; + Hashmap *seats; + Hashmap *sessions; + Hashmap *users; + Hashmap *inhibitors; + Hashmap *buttons; + + LIST_HEAD(Seat, seat_gc_queue); + LIST_HEAD(Session, session_gc_queue); + LIST_HEAD(User, user_gc_queue); + + struct udev *udev; + struct udev_monitor *udev_seat_monitor, *udev_device_monitor, *udev_vcsa_monitor, *udev_button_monitor; + + sd_event_source *console_active_event_source; + sd_event_source *udev_seat_event_source; + sd_event_source *udev_device_event_source; + sd_event_source *udev_vcsa_event_source; + sd_event_source *udev_button_event_source; + + int console_active_fd; + + unsigned n_autovts; + + unsigned reserve_vt; + int reserve_vt_fd; + + Seat *seat0; + + char **kill_only_users, **kill_exclude_users; + bool kill_user_processes; + + unsigned long session_counter; + unsigned long inhibit_counter; + + Hashmap *session_units; + Hashmap *user_units; + + usec_t inhibit_delay_max; + + /* If an action is currently being executed or is delayed, + * this is != 0 and encodes what is being done */ + InhibitWhat action_what; + + /* If a shutdown/suspend was delayed due to a inhibitor this + contains the unit name we are supposed to start after the + delay is over */ + const char *action_unit; + + /* If a shutdown/suspend is currently executed, then this is + * the job of it */ + char *action_job; + sd_event_source *inhibit_timeout_source; + + char *scheduled_shutdown_type; + usec_t scheduled_shutdown_timeout; + sd_event_source *scheduled_shutdown_timeout_source; + uid_t scheduled_shutdown_uid; + char *scheduled_shutdown_tty; + sd_event_source *nologin_timeout_source; + bool unlink_nologin; + + char *wall_message; + unsigned enable_wall_messages; + sd_event_source *wall_message_timeout_source; + + bool shutdown_dry_run; + + sd_event_source *idle_action_event_source; + usec_t idle_action_usec; + usec_t idle_action_not_before_usec; + HandleAction idle_action; + + HandleAction handle_power_key; + HandleAction handle_suspend_key; + HandleAction handle_hibernate_key; + HandleAction handle_lid_switch; + HandleAction handle_lid_switch_docked; + + bool power_key_ignore_inhibited; + bool suspend_key_ignore_inhibited; + bool hibernate_key_ignore_inhibited; + bool lid_switch_ignore_inhibited; + + bool remove_ipc; + + Hashmap *polkit_registry; + + usec_t holdoff_timeout_usec; + sd_event_source *lid_switch_ignore_event_source; + + size_t runtime_dir_size; + uint64_t user_tasks_max; + uint64_t sessions_max; + uint64_t inhibitors_max; +}; + +int manager_add_device(Manager *m, const char *sysfs, bool master, Device **_device); +int manager_add_button(Manager *m, const char *name, Button **_button); +int manager_add_seat(Manager *m, const char *id, Seat **_seat); +int manager_add_session(Manager *m, const char *id, Session **_session); +int manager_add_user(Manager *m, uid_t uid, gid_t gid, const char *name, User **_user); +int manager_add_user_by_name(Manager *m, const char *name, User **_user); +int manager_add_user_by_uid(Manager *m, uid_t uid, User **_user); +int manager_add_inhibitor(Manager *m, const char* id, Inhibitor **_inhibitor); + +int manager_process_seat_device(Manager *m, struct udev_device *d); +int manager_process_button_device(Manager *m, struct udev_device *d); + +int manager_spawn_autovt(Manager *m, unsigned int vtnr); + +bool manager_shall_kill(Manager *m, const char *user); + +int manager_get_idle_hint(Manager *m, dual_timestamp *t); + +int manager_get_user_by_pid(Manager *m, pid_t pid, User **user); +int manager_get_session_by_pid(Manager *m, pid_t pid, Session **session); + +bool manager_is_docked_or_external_displays(Manager *m); + +extern const sd_bus_vtable manager_vtable[]; + +int match_job_removed(sd_bus_message *message, void *userdata, sd_bus_error *error); +int match_unit_removed(sd_bus_message *message, void *userdata, sd_bus_error *error); +int match_properties_changed(sd_bus_message *message, void *userdata, sd_bus_error *error); +int match_reloading(sd_bus_message *message, void *userdata, sd_bus_error *error); +int match_name_owner_changed(sd_bus_message *message, void *userdata, sd_bus_error *error); + +int bus_manager_shutdown_or_sleep_now_or_later(Manager *m, const char *unit_name, InhibitWhat w, sd_bus_error *error); + +int manager_send_changed(Manager *manager, const char *property, ...) _sentinel_; + +int manager_start_slice(Manager *manager, const char *slice, const char *description, const char *after, const char *after2, uint64_t tasks_max, sd_bus_error *error, char **job); +int manager_start_scope(Manager *manager, const char *scope, pid_t pid, const char *slice, const char *description, const char *after, const char *after2, uint64_t tasks_max, sd_bus_error *error, char **job); +int manager_start_unit(Manager *manager, const char *unit, sd_bus_error *error, char **job); +int manager_stop_unit(Manager *manager, const char *unit, sd_bus_error *error, char **job); +int manager_abandon_scope(Manager *manager, const char *scope, sd_bus_error *error); +int manager_kill_unit(Manager *manager, const char *unit, KillWho who, int signo, sd_bus_error *error); +int manager_unit_is_active(Manager *manager, const char *unit); +int manager_job_is_active(Manager *manager, const char *path); + +/* gperf lookup function */ +const struct ConfigPerfItem* logind_gperf_lookup(const char *key, unsigned length); + +int manager_set_lid_switch_ignore(Manager *m, usec_t until); + +int config_parse_tmpfs_size(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); + +int manager_get_session_from_creds(Manager *m, sd_bus_message *message, const char *name, sd_bus_error *error, Session **ret); +int manager_get_user_from_creds(Manager *m, sd_bus_message *message, uid_t uid, sd_bus_error *error, User **ret); +int manager_get_seat_from_creds(Manager *m, sd_bus_message *message, const char *name, sd_bus_error *error, Seat **ret); + +int manager_setup_wall_message_timer(Manager *m); +bool logind_wall_tty_filter(const char *tty, void *userdata); + +int manager_dispatch_delayed(Manager *manager, bool timeout); diff --git a/src/grp-login/systemd-logind/logind.h b/src/grp-login/systemd-logind/logind.h deleted file mode 100644 index 378e86a31f..0000000000 --- a/src/grp-login/systemd-logind/logind.h +++ /dev/null @@ -1,197 +0,0 @@ -#pragma once - -/*** - This file is part of systemd. - - Copyright 2011 Lennart Poettering - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include - -#include -#include -#include - -#include "basic/hashmap.h" -#include "basic/list.h" -#include "basic/set.h" -#include "logind-action.h" -#include "logind-button.h" -#include "logind-device.h" -#include "logind-inhibit.h" - -typedef struct Manager Manager; - -struct Manager { - sd_event *event; - sd_bus *bus; - - Hashmap *devices; - Hashmap *seats; - Hashmap *sessions; - Hashmap *users; - Hashmap *inhibitors; - Hashmap *buttons; - - LIST_HEAD(Seat, seat_gc_queue); - LIST_HEAD(Session, session_gc_queue); - LIST_HEAD(User, user_gc_queue); - - struct udev *udev; - struct udev_monitor *udev_seat_monitor, *udev_device_monitor, *udev_vcsa_monitor, *udev_button_monitor; - - sd_event_source *console_active_event_source; - sd_event_source *udev_seat_event_source; - sd_event_source *udev_device_event_source; - sd_event_source *udev_vcsa_event_source; - sd_event_source *udev_button_event_source; - - int console_active_fd; - - unsigned n_autovts; - - unsigned reserve_vt; - int reserve_vt_fd; - - Seat *seat0; - - char **kill_only_users, **kill_exclude_users; - bool kill_user_processes; - - unsigned long session_counter; - unsigned long inhibit_counter; - - Hashmap *session_units; - Hashmap *user_units; - - usec_t inhibit_delay_max; - - /* If an action is currently being executed or is delayed, - * this is != 0 and encodes what is being done */ - InhibitWhat action_what; - - /* If a shutdown/suspend was delayed due to a inhibitor this - contains the unit name we are supposed to start after the - delay is over */ - const char *action_unit; - - /* If a shutdown/suspend is currently executed, then this is - * the job of it */ - char *action_job; - sd_event_source *inhibit_timeout_source; - - char *scheduled_shutdown_type; - usec_t scheduled_shutdown_timeout; - sd_event_source *scheduled_shutdown_timeout_source; - uid_t scheduled_shutdown_uid; - char *scheduled_shutdown_tty; - sd_event_source *nologin_timeout_source; - bool unlink_nologin; - - char *wall_message; - unsigned enable_wall_messages; - sd_event_source *wall_message_timeout_source; - - bool shutdown_dry_run; - - sd_event_source *idle_action_event_source; - usec_t idle_action_usec; - usec_t idle_action_not_before_usec; - HandleAction idle_action; - - HandleAction handle_power_key; - HandleAction handle_suspend_key; - HandleAction handle_hibernate_key; - HandleAction handle_lid_switch; - HandleAction handle_lid_switch_docked; - - bool power_key_ignore_inhibited; - bool suspend_key_ignore_inhibited; - bool hibernate_key_ignore_inhibited; - bool lid_switch_ignore_inhibited; - - bool remove_ipc; - - Hashmap *polkit_registry; - - usec_t holdoff_timeout_usec; - sd_event_source *lid_switch_ignore_event_source; - - size_t runtime_dir_size; - uint64_t user_tasks_max; - uint64_t sessions_max; - uint64_t inhibitors_max; -}; - -int manager_add_device(Manager *m, const char *sysfs, bool master, Device **_device); -int manager_add_button(Manager *m, const char *name, Button **_button); -int manager_add_seat(Manager *m, const char *id, Seat **_seat); -int manager_add_session(Manager *m, const char *id, Session **_session); -int manager_add_user(Manager *m, uid_t uid, gid_t gid, const char *name, User **_user); -int manager_add_user_by_name(Manager *m, const char *name, User **_user); -int manager_add_user_by_uid(Manager *m, uid_t uid, User **_user); -int manager_add_inhibitor(Manager *m, const char* id, Inhibitor **_inhibitor); - -int manager_process_seat_device(Manager *m, struct udev_device *d); -int manager_process_button_device(Manager *m, struct udev_device *d); - -int manager_spawn_autovt(Manager *m, unsigned int vtnr); - -bool manager_shall_kill(Manager *m, const char *user); - -int manager_get_idle_hint(Manager *m, dual_timestamp *t); - -int manager_get_user_by_pid(Manager *m, pid_t pid, User **user); -int manager_get_session_by_pid(Manager *m, pid_t pid, Session **session); - -bool manager_is_docked_or_external_displays(Manager *m); - -extern const sd_bus_vtable manager_vtable[]; - -int match_job_removed(sd_bus_message *message, void *userdata, sd_bus_error *error); -int match_unit_removed(sd_bus_message *message, void *userdata, sd_bus_error *error); -int match_properties_changed(sd_bus_message *message, void *userdata, sd_bus_error *error); -int match_reloading(sd_bus_message *message, void *userdata, sd_bus_error *error); -int match_name_owner_changed(sd_bus_message *message, void *userdata, sd_bus_error *error); - -int bus_manager_shutdown_or_sleep_now_or_later(Manager *m, const char *unit_name, InhibitWhat w, sd_bus_error *error); - -int manager_send_changed(Manager *manager, const char *property, ...) _sentinel_; - -int manager_start_slice(Manager *manager, const char *slice, const char *description, const char *after, const char *after2, uint64_t tasks_max, sd_bus_error *error, char **job); -int manager_start_scope(Manager *manager, const char *scope, pid_t pid, const char *slice, const char *description, const char *after, const char *after2, uint64_t tasks_max, sd_bus_error *error, char **job); -int manager_start_unit(Manager *manager, const char *unit, sd_bus_error *error, char **job); -int manager_stop_unit(Manager *manager, const char *unit, sd_bus_error *error, char **job); -int manager_abandon_scope(Manager *manager, const char *scope, sd_bus_error *error); -int manager_kill_unit(Manager *manager, const char *unit, KillWho who, int signo, sd_bus_error *error); -int manager_unit_is_active(Manager *manager, const char *unit); -int manager_job_is_active(Manager *manager, const char *path); - -/* gperf lookup function */ -const struct ConfigPerfItem* logind_gperf_lookup(const char *key, unsigned length); - -int manager_set_lid_switch_ignore(Manager *m, usec_t until); - -int config_parse_tmpfs_size(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); - -int manager_get_session_from_creds(Manager *m, sd_bus_message *message, const char *name, sd_bus_error *error, Session **ret); -int manager_get_user_from_creds(Manager *m, sd_bus_message *message, uid_t uid, sd_bus_error *error, User **ret); -int manager_get_seat_from_creds(Manager *m, sd_bus_message *message, const char *name, sd_bus_error *error, Seat **ret); - -int manager_setup_wall_message_timer(Manager *m); -bool logind_wall_tty_filter(const char *tty, void *userdata); - -int manager_dispatch_delayed(Manager *manager, bool timeout); diff --git a/src/grp-machine/grp-import/systemd-import/import-common.h b/src/grp-machine/grp-import/systemd-import/import-common.h index 07d3250e71..3abd62e8c3 100644 --- a/src/grp-machine/grp-import/systemd-import/import-common.h +++ b/src/grp-machine/grp-import/systemd-import/import-common.h @@ -19,6 +19,8 @@ along with systemd; If not, see . ***/ +#include + int import_make_read_only_fd(int fd); int import_make_read_only(const char *path); diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-server.h b/src/grp-resolve/systemd-resolved/resolved-dns-server.h index 2855c97faa..bfbf692c64 100644 --- a/src/grp-resolve/systemd-resolved/resolved-dns-server.h +++ b/src/grp-resolve/systemd-resolved/resolved-dns-server.h @@ -23,16 +23,6 @@ typedef struct DnsServer DnsServer; -typedef enum DnsServerType { - DNS_SERVER_SYSTEM, - DNS_SERVER_FALLBACK, - DNS_SERVER_LINK, -} DnsServerType; -#define _DNS_SERVER_TYPE_MAX (DNS_SERVER_LINK + 1) - -const char* dns_server_type_to_string(DnsServerType i) _const_; -DnsServerType dns_server_type_from_string(const char *s) _pure_; - typedef enum DnsServerFeatureLevel { DNS_SERVER_FEATURE_LEVEL_TCP, DNS_SERVER_FEATURE_LEVEL_UDP, @@ -52,6 +42,16 @@ int dns_server_feature_level_from_string(const char *s) _pure_; #include "resolved-link.h" #include "resolved-manager.h" +typedef enum DnsServerType { + DNS_SERVER_SYSTEM, + DNS_SERVER_FALLBACK, + DNS_SERVER_LINK, +} DnsServerType; +#define _DNS_SERVER_TYPE_MAX (DNS_SERVER_LINK + 1) + +const char* dns_server_type_to_string(DnsServerType i) _const_; +DnsServerType dns_server_type_from_string(const char *s) _pure_; + struct DnsServer { Manager *manager; diff --git a/src/grp-system/libcore/busname.h b/src/grp-system/libcore/busname.h index aa7f0ecb1b..95a356bddc 100644 --- a/src/grp-system/libcore/busname.h +++ b/src/grp-system/libcore/busname.h @@ -20,7 +20,6 @@ ***/ typedef struct BusName BusName; -typedef struct BusNamePolicy BusNamePolicy; #include "bus-policy.h" #include "unit.h" diff --git a/src/grp-system/libcore/cgroup.h b/src/grp-system/libcore/cgroup.h index f0072986b6..36699fb21b 100644 --- a/src/grp-system/libcore/cgroup.h +++ b/src/grp-system/libcore/cgroup.h @@ -115,7 +115,6 @@ struct CGroupContext { bool delegate; }; -#include "basic/cgroup-util.h" #include "unit.h" void cgroup_context_init(CGroupContext *c); diff --git a/src/grp-system/libcore/dbus-automount.h b/src/grp-system/libcore/dbus-automount.h index 7b51eb973a..d1168c8188 100644 --- a/src/grp-system/libcore/dbus-automount.h +++ b/src/grp-system/libcore/dbus-automount.h @@ -19,5 +19,6 @@ along with systemd; If not, see . ***/ +#include extern const sd_bus_vtable bus_automount_vtable[]; diff --git a/src/grp-system/libcore/dbus-busname.h b/src/grp-system/libcore/dbus-busname.h index 8643d1a404..c6aa90a424 100644 --- a/src/grp-system/libcore/dbus-busname.h +++ b/src/grp-system/libcore/dbus-busname.h @@ -19,5 +19,6 @@ along with systemd; If not, see . ***/ +#include extern const sd_bus_vtable bus_busname_vtable[]; diff --git a/src/grp-system/libcore/dbus-path.h b/src/grp-system/libcore/dbus-path.h index d3c19e0c2b..f24b1d5d3d 100644 --- a/src/grp-system/libcore/dbus-path.h +++ b/src/grp-system/libcore/dbus-path.h @@ -19,6 +19,6 @@ along with systemd; If not, see . ***/ - +#include extern const sd_bus_vtable bus_path_vtable[]; diff --git a/src/grp-system/libcore/device.h b/src/grp-system/libcore/device.h index 184a1a349b..60d5122966 100644 --- a/src/grp-system/libcore/device.h +++ b/src/grp-system/libcore/device.h @@ -21,6 +21,8 @@ typedef struct Device Device; +#include "unit.h" + typedef enum DeviceFound { DEVICE_NOT_FOUND = 0, DEVICE_FOUND_UDEV = 1, diff --git a/src/grp-system/libcore/killall.h b/src/grp-system/libcore/killall.h index acc2439f00..bbb101c863 100644 --- a/src/grp-system/libcore/killall.h +++ b/src/grp-system/libcore/killall.h @@ -19,4 +19,6 @@ along with systemd; If not, see . ***/ +#include + void broadcast_signal(int sig, bool wait_for_exit, bool send_sighup); diff --git a/src/grp-system/libcore/machine-id-setup.h b/src/grp-system/libcore/machine-id-setup.h index a7e7678ed9..c5dd8d7790 100644 --- a/src/grp-system/libcore/machine-id-setup.h +++ b/src/grp-system/libcore/machine-id-setup.h @@ -19,5 +19,7 @@ along with systemd; If not, see . ***/ +#include + int machine_id_commit(const char *root); int machine_id_setup(const char *root, sd_id128_t machine_id); diff --git a/src/grp-system/libcore/scope.h b/src/grp-system/libcore/scope.h index 2dc86325c5..f0cb3bd3e2 100644 --- a/src/grp-system/libcore/scope.h +++ b/src/grp-system/libcore/scope.h @@ -22,6 +22,7 @@ typedef struct Scope Scope; #include "kill.h" +#include "unit.h" typedef enum ScopeResult { SCOPE_SUCCESS, diff --git a/src/grp-system/libcore/service.h b/src/grp-system/libcore/service.h index ba9086d8cd..aa7d1de8b6 100644 --- a/src/grp-system/libcore/service.h +++ b/src/grp-system/libcore/service.h @@ -27,6 +27,7 @@ typedef struct ServiceFDStore ServiceFDStore; #include "kill.h" #include "path.h" +#include "socket.h" typedef enum ServiceRestart { SERVICE_RESTART_NO, @@ -199,7 +200,7 @@ struct Service { extern const UnitVTable service_vtable; -int service_set_socket_fd(Service *s, int fd, struct Socket *socket, bool selinux_context_net); +int service_set_socket_fd(Service *s, int fd, Socket *socket, bool selinux_context_net); void service_close_socket_fd(Service *s); const char* service_restart_to_string(ServiceRestart i) _const_; diff --git a/src/grp-system/libcore/slice.h b/src/grp-system/libcore/slice.h index c9f3f61067..71e05a4d6a 100644 --- a/src/grp-system/libcore/slice.h +++ b/src/grp-system/libcore/slice.h @@ -21,6 +21,8 @@ typedef struct Slice Slice; +#include "unit.h" + struct Slice { Unit meta; diff --git a/src/grp-system/libcore/smack-setup.h b/src/grp-system/libcore/smack-setup.h index 78164c85e6..f8c62ce067 100644 --- a/src/grp-system/libcore/smack-setup.h +++ b/src/grp-system/libcore/smack-setup.h @@ -21,4 +21,6 @@ along with systemd; If not, see . ***/ +#include + int mac_smack_setup(bool *loaded_policy); diff --git a/src/grp-system/libcore/socket.h b/src/grp-system/libcore/socket.h index 3b214946e0..232d653fbe 100644 --- a/src/grp-system/libcore/socket.h +++ b/src/grp-system/libcore/socket.h @@ -23,7 +23,6 @@ typedef struct Socket Socket; -#include "mount.h" #include "service.h" typedef enum SocketExecCommand { diff --git a/src/grp-system/libcore/swap.h b/src/grp-system/libcore/swap.h index c2cbfc5d2a..52e22e22e8 100644 --- a/src/grp-system/libcore/swap.h +++ b/src/grp-system/libcore/swap.h @@ -24,6 +24,8 @@ typedef struct Swap Swap; +#include "unit.h" + typedef enum SwapExecCommand { SWAP_EXEC_ACTIVATE, SWAP_EXEC_DEACTIVATE, diff --git a/src/grp-system/libcore/target.h b/src/grp-system/libcore/target.h index 9ac560ab17..406b80019c 100644 --- a/src/grp-system/libcore/target.h +++ b/src/grp-system/libcore/target.h @@ -19,12 +19,10 @@ along with systemd; If not, see . ***/ -#if __INCLUDE_LEVEL__ <= 1 -#error "Do not include target.h directly; use unit.h, which includes target.h." -#endif - typedef struct Target Target; +#include "unit.h" + struct Target { Unit meta; diff --git a/src/grp-system/libcore/timer.h b/src/grp-system/libcore/timer.h index 99b47c3880..710ef126f0 100644 --- a/src/grp-system/libcore/timer.h +++ b/src/grp-system/libcore/timer.h @@ -23,6 +23,8 @@ typedef struct Timer Timer; +#include "unit.h" + typedef enum TimerBase { TIMER_ACTIVE, TIMER_BOOT, diff --git a/src/grp-system/libcore/unit.h b/src/grp-system/libcore/unit.h index 9321537fe6..72ceed1fef 100644 --- a/src/grp-system/libcore/unit.h +++ b/src/grp-system/libcore/unit.h @@ -259,8 +259,10 @@ typedef enum UnitSetPropertiesMode { #include "automount.h" #include "busname.h" #include "device.h" +#include "mount.h" #include "path.h" #include "scope.h" +#include "service.h" #include "slice.h" #include "socket.h" #include "swap.h" diff --git a/src/grp-udev/scsi_id/scsi.h b/src/grp-udev/scsi_id/scsi.h index a27a84a40a..497cfe3e31 100644 --- a/src/grp-udev/scsi_id/scsi.h +++ b/src/grp-udev/scsi_id/scsi.h @@ -13,6 +13,7 @@ */ #include +#include struct scsi_ioctl_command { unsigned int inlen; /* excluding scsi command length */ diff --git a/src/libbasic/include/basic/btrfs-ctree.h b/src/libbasic/include/basic/btrfs-ctree.h index 66bdf9736e..15e6d5582c 100644 --- a/src/libbasic/include/basic/btrfs-ctree.h +++ b/src/libbasic/include/basic/btrfs-ctree.h @@ -1,6 +1,7 @@ #pragma once #include "macro.h" +#include "missing.h" /* for BTRFS_UUID_SIZE */ #include "sparse-endian.h" /* Stolen from btrfs' ctree.h */ diff --git a/src/libbasic/include/basic/missing_syscall.h b/src/libbasic/include/basic/missing_syscall.h index d502d3b9ca..2929123679 100644 --- a/src/libbasic/include/basic/missing_syscall.h +++ b/src/libbasic/include/basic/missing_syscall.h @@ -22,6 +22,10 @@ /* Missing glibc definitions to access certain kernel APIs */ +#if __INCLUDE_LEVEL__ <= 1 +#error "Do not include missing_syscall.h directly; include it through missing.h." +#endif + #if !HAVE_DECL_PIVOT_ROOT static inline int pivot_root(const char *new_root, const char *put_old) { return syscall(SYS_pivot_root, new_root, put_old); diff --git a/src/libbasic/include/basic/rm-rf.h b/src/libbasic/include/basic/rm-rf.h index f693a5bb7c..8d315792ac 100644 --- a/src/libbasic/include/basic/rm-rf.h +++ b/src/libbasic/include/basic/rm-rf.h @@ -19,8 +19,11 @@ along with systemd; If not, see . ***/ +#include #include +#include "macro.h" + typedef enum RemoveFlags { REMOVE_ONLY_DIRECTORIES = 1, REMOVE_ROOT = 2, diff --git a/src/libshared/include/shared/test-tables.h b/src/libshared/include/shared/test-tables.h index 228e510104..bf286bede5 100644 --- a/src/libshared/include/shared/test-tables.h +++ b/src/libshared/include/shared/test-tables.h @@ -20,6 +20,8 @@ #include #include +#include "basic/macro.h" + typedef const char* (*lookup_t)(int); typedef int (*reverse_t)(const char*); diff --git a/src/libsystemd/include/systemd/sd-bus-vtable.h b/src/libsystemd/include/systemd/sd-bus-vtable.h index f91e787424..e8f84eb545 100644 --- a/src/libsystemd/include/systemd/sd-bus-vtable.h +++ b/src/libsystemd/include/systemd/sd-bus-vtable.h @@ -21,12 +21,13 @@ ***/ #include "_sd-common.h" -#include "sd-bus.h" _SD_BEGIN_DECLARATIONS; typedef struct sd_bus_vtable sd_bus_vtable; +#include "sd-bus.h" + enum { _SD_BUS_VTABLE_START = '<', _SD_BUS_VTABLE_END = '>', diff --git a/src/libsystemd/src/sd-bus/bus-signature.h b/src/libsystemd/src/sd-bus/bus-signature.h index 1e0cd7f587..8b7a45cef5 100644 --- a/src/libsystemd/src/sd-bus/bus-signature.h +++ b/src/libsystemd/src/sd-bus/bus-signature.h @@ -20,6 +20,7 @@ ***/ #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/src/sd-bus/bus-socket.h b/src/libsystemd/src/sd-bus/bus-socket.h index 6e1d32e6a7..712e37bcc0 100644 --- a/src/libsystemd/src/sd-bus/bus-socket.h +++ b/src/libsystemd/src/sd-bus/bus-socket.h @@ -19,6 +19,8 @@ along with systemd; If not, see . ***/ +#include + #include void bus_socket_setup(sd_bus *b); diff --git a/src/libsystemd/src/sd-bus/bus-track.h b/src/libsystemd/src/sd-bus/bus-track.h index 7d93a727d6..73b7503ae5 100644 --- a/src/libsystemd/src/sd-bus/bus-track.h +++ b/src/libsystemd/src/sd-bus/bus-track.h @@ -19,4 +19,6 @@ along with systemd; If not, see . ***/ +#include + void bus_track_dispatch(sd_bus_track *track); diff --git a/src/libsystemd/src/sd-journal/mmap-cache.h b/src/libsystemd/src/sd-journal/mmap-cache.h index 199d944647..d7eca3c237 100644 --- a/src/libsystemd/src/sd-journal/mmap-cache.h +++ b/src/libsystemd/src/sd-journal/mmap-cache.h @@ -20,7 +20,9 @@ ***/ #include +#include #include +#include /* One context per object type, plus one of the header, plus one "additional" one */ #define MMAP_CACHE_MAX_CONTEXTS 9 diff --git a/src/libsystemd/src/sd-network/network-util.h b/src/libsystemd/src/sd-network/network-util.h index 26780dce28..902be2b2e8 100644 --- a/src/libsystemd/src/sd-network/network-util.h +++ b/src/libsystemd/src/sd-network/network-util.h @@ -19,6 +19,8 @@ along with systemd; If not, see . ***/ +#include + #include "sd-network.h" bool network_is_online(void); diff --git a/src/systemd-nspawn/nspawn-mount.h b/src/systemd-nspawn/nspawn-mount.h index 0daf145412..0b3f3fbefa 100644 --- a/src/systemd-nspawn/nspawn-mount.h +++ b/src/systemd-nspawn/nspawn-mount.h @@ -20,6 +20,7 @@ ***/ #include +#include typedef enum VolatileMode { VOLATILE_NO, diff --git a/src/systemd-shutdown/umount.h b/src/systemd-shutdown/umount.h index 4e2215a47d..ce2fd9ec58 100644 --- a/src/systemd-shutdown/umount.h +++ b/src/systemd-shutdown/umount.h @@ -19,6 +19,8 @@ along with systemd; If not, see . ***/ +#include + int umount_all(bool *changed); int swapoff_all(bool *changed); -- cgit v1.2.3-54-g00ecf