Split out of #37344.
#include <fcntl.h>
#include <getopt.h>
#include <stdio.h>
-#include <stdlib.h>
#include <unistd.h>
#include "sd-bus.h"
#include "bus-error.h"
#include "bus-locator.h"
#include "bus-util.h"
+#include "errno-util.h"
#include "fd-util.h"
#include "format-table.h"
-#include "format-util.h"
#include "log.h"
#include "main-func.h"
#include "pager.h"
#include "polkit-agent.h"
#include "pretty-print.h"
#include "process-util.h"
+#include "runtime-scope.h"
#include "signal-util.h"
+#include "string-util.h"
#include "strv.h"
#include "terminal-util.h"
#include "user-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <errno.h>
#include <getopt.h>
#include <locale.h>
#include <unistd.h>
#include "sd-bus.h"
+#include "sd-journal.h"
#include "alloc-util.h"
#include "build.h"
#include "cgroup-show.h"
#include "cgroup-util.h"
#include "format-table.h"
+#include "format-util.h"
#include "log.h"
#include "logs-show.h"
-#include "macro.h"
#include "main-func.h"
-#include "memory-util.h"
#include "pager.h"
#include "parse-argument.h"
#include "parse-util.h"
#include "polkit-agent.h"
#include "pretty-print.h"
#include "process-util.h"
-#include "rlimit-util.h"
-#include "signal-util.h"
+#include "runtime-scope.h"
#include "string-table.h"
+#include "string-util.h"
#include "strv.h"
#include "sysfs-show.h"
#include "terminal-util.h"
-#include "unit-name.h"
+#include "time-util.h"
#include "user-util.h"
#include "verbs.h"
#include <unistd.h>
+#include "sd-bus.h"
#include "sd-messages.h"
#include "alloc-util.h"
#include "bitfield.h"
#include "bus-error.h"
#include "bus-unit-util.h"
-#include "bus-util.h"
#include "conf-parser.h"
+#include "extract-word.h"
#include "format-util.h"
+#include "hashmap.h"
#include "logind.h"
#include "logind-action.h"
#include "logind-dbus.h"
#include "process-util.h"
#include "special.h"
#include "string-table.h"
-#include "terminal-util.h"
#include "user-util.h"
static const HandleActionData handle_action_data_table[_HANDLE_ACTION_MAX] = {
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "conf-parser.h"
+#include "logind-forward.h"
#include "logind-inhibit.h"
#include "sleep-config.h"
_HANDLE_ACTION_INVALID = -EINVAL,
} HandleAction;
-typedef struct HandleActionData HandleActionData;
-
typedef enum HandleActionSleepMask {
HANDLE_SLEEP_SUSPEND_MASK = 1U << HANDLE_SUSPEND,
HANDLE_SLEEP_HIBERNATE_MASK = 1U << HANDLE_HIBERNATE,
return a >= _HANDLE_ACTION_SLEEP_FIRST && a <= _HANDLE_ACTION_SLEEP_LAST;
}
-struct HandleActionData {
+typedef struct HandleActionData {
HandleAction handle;
const char *target;
InhibitWhat inhibit_what;
const char* message_id;
const char* message;
const char* log_verb;
-};
+} HandleActionData;
int handle_action_get_enabled_sleep_actions(HandleActionSleepMask mask, char ***ret);
HandleAction handle_action_sleep_select(Manager *m);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "sd-bus.h"
+#include "sd-device.h"
+#include "sd-event.h"
+
+#include "alloc-util.h"
#include "bus-message-util.h"
-#include "bus-util.h"
#include "device-util.h"
+#include "format-util.h"
#include "hash-funcs.h"
#include "logind.h"
#include "logind-brightness.h"
#include "process-util.h"
+#include "set.h"
#include "stdio-util.h"
/* Brightness and LED devices tend to be very slow to write to (often being I2C and such). Writes to the
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-bus.h"
-#include "sd-device.h"
-
-typedef struct Manager Manager;
+#include "logind-forward.h"
int manager_write_brightness(Manager *m, sd_device *device, uint32_t brightness, sd_bus_message *message);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <errno.h>
#include <fcntl.h>
#include <linux/input.h>
#include <sys/ioctl.h>
#include <unistd.h>
+#include "sd-event.h"
#include "sd-messages.h"
#include "alloc-util.h"
#include "async.h"
#include "fd-util.h"
+#include "hashmap.h"
+#include "log.h"
#include "logind.h"
#include "logind-button.h"
#include "logind-dbus.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <stdbool.h>
-
-#include "sd-event.h"
-
-typedef struct Manager Manager;
+#include "logind-forward.h"
typedef enum ButtonModifierMask {
BUTTON_MODIFIER_NONE = 0,
#include <fcntl.h>
#include <linux/vt.h>
#include <sys/ioctl.h>
-#include <sys/types.h>
+#include "sd-bus.h"
#include "sd-device.h"
#include "alloc-util.h"
#include "battery-util.h"
#include "bus-error.h"
#include "bus-locator.h"
-#include "bus-util.h"
#include "cgroup-util.h"
#include "conf-parser.h"
#include "device-util.h"
#include "efi-loader.h"
#include "errno-util.h"
#include "fd-util.h"
+#include "hashmap.h"
#include "limits-util.h"
#include "logind.h"
#include "logind-button.h"
#include "logind-seat.h"
#include "logind-session.h"
#include "logind-user.h"
-#include "logind-utmp.h"
#include "parse-util.h"
-#include "path-util.h"
#include "process-util.h"
#include "stdio-util.h"
#include "strv.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <errno.h>
+#include <pwd.h>
#include <sys/stat.h>
#include <unistd.h>
+#include "sd-bus.h"
#include "sd-device.h"
#include "sd-messages.h"
#include "bus-error.h"
#include "bus-get-properties.h"
#include "bus-locator.h"
+#include "bus-object.h"
#include "bus-polkit.h"
#include "bus-unit-util.h"
#include "bus-util.h"
#include "efivars.h"
#include "env-file.h"
#include "env-util.h"
+#include "errno-util.h"
#include "escape.h"
#include "event-util.h"
#include "fd-util.h"
#include "fileio.h"
#include "format-util.h"
#include "fs-util.h"
+#include "hashmap.h"
#include "login-util.h"
+#include "logind-session.h"
#include "logind.h"
#include "logind-action.h"
#include "logind-dbus.h"
#include "logind-user-dbus.h"
#include "logind-utmp.h"
#include "mkdir-label.h"
+#include "os-util.h"
#include "parse-util.h"
#include "path-util.h"
#include "process-util.h"
#include "reboot-util.h"
-#include "selinux-util.h"
#include "serialize.h"
#include "signal-util.h"
#include "sleep-config.h"
-#include "special.h"
#include "stdio-util.h"
#include "strv.h"
#include "terminal-util.h"
#include "tmpfile-util.h"
-#include "unit-name.h"
+#include "user-record.h"
#include "user-util.h"
-#include "utmp-wtmp.h"
#include "virt.h"
#include "wall.h"
assert(m);
assert(ret);
- if (SESSION_IS_SELF(name)) /* the caller's own session */
+ if (session_is_self(name)) /* the caller's own session */
return get_sender_session(m, message, false, error, ret);
- if (SESSION_IS_AUTO(name)) /* The caller's own session if they have one, otherwise their user's display session */
+ if (session_is_auto(name)) /* The caller's own session if they have one, otherwise their user's display session */
return get_sender_session(m, message, true, error, ret);
session = hashmap_get(m->sessions, name);
assert(m);
assert(ret);
- if (SEAT_IS_SELF(name) || SEAT_IS_AUTO(name)) {
+ if (seat_is_self(name) || seat_is_auto(name)) {
Session *session;
/* Use these special seat names as session names */
} while (hashmap_contains(m->sessions, id));
/* The generated names should not clash with 'auto' or 'self' */
- assert(!SESSION_IS_SELF(id));
- assert(!SESSION_IS_AUTO(id));
+ assert(!session_is_self(id));
+ assert(!session_is_auto(id));
*ret_id = TAKE_PTR(id);
return 0;
if (!path_startswith(sysfs, "/sys"))
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Path %s is not in /sys", sysfs);
- if (SEAT_IS_SELF(seat) || SEAT_IS_AUTO(seat)) {
+ if (seat_is_self(seat) || seat_is_auto(seat)) {
Seat *found;
r = manager_get_seat_from_creds(m, message, seat, error, &found);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-bus.h"
-
-#include "bus-object.h"
-#include "logind-session.h"
-#include "macro.h"
-
-typedef struct Manager Manager;
-typedef struct User User;
-typedef struct Seat Seat;
-typedef struct HandleActionData HandleActionData;
+#include "logind-forward.h"
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);
#include <string.h>
#include "alloc-util.h"
+#include "hashmap.h"
#include "logind.h"
#include "logind-device.h"
#include "logind-seat.h"
#pragma once
#include "list.h"
+#include "logind-forward.h"
#include "time-util.h"
-typedef struct Device Device;
-typedef struct Manager Manager;
-typedef struct Seat Seat;
-typedef struct SessionDevice SessionDevice;
-
-struct Device {
+typedef struct Device {
Manager *manager;
char *sysfs;
LIST_FIELDS(Device, devices);
LIST_HEAD(SessionDevice, session_devices);
-};
+} Device;
Device* device_new(Manager *m, const char *sysfs, bool master);
void device_free(Device *d);
--- /dev/null
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#pragma once
+
+#include "conf-parser-forward.h" /* IWYU pragma: export */
+#include "forward.h" /* IWYU pragma: export */
+
+typedef enum InhibitWhat InhibitWhat;
+typedef enum KillWhom KillWhom;
+typedef enum SessionType SessionType;
+typedef enum SessionClass SessionClass;
+
+typedef struct HandleActionData HandleActionData;
+typedef struct Device Device;
+typedef struct Manager Manager;
+typedef struct Seat Seat;
+typedef struct SessionDevice SessionDevice;
+typedef struct Session Session;
+typedef struct User User;
+typedef struct Inhibitor Inhibitor;
+typedef struct Button Button;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <errno.h>
#include <fcntl.h>
#include <sys/stat.h>
-#include <sys/types.h>
#include <threads.h>
#include <unistd.h>
+#include "sd-event.h"
+
#include "alloc-util.h"
#include "env-file.h"
-#include "errno-list.h"
#include "errno-util.h"
#include "escape.h"
+#include "extract-word.h"
#include "fd-util.h"
#include "fileio.h"
#include "format-util.h"
#include "fs-util.h"
+#include "hashmap.h"
#include "io-util.h"
+#include "log.h"
+#include "logind-session.h"
#include "logind.h"
#include "logind-dbus.h"
#include "logind-inhibit.h"
#include "mkdir-label.h"
-#include "parse-util.h"
#include "path-util.h"
#include "string-table.h"
#include "string-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-event.h"
-
+#include "logind-forward.h"
#include "pidref.h"
#include "time-util.h"
-typedef struct Inhibitor Inhibitor;
-typedef struct Manager Manager;
-
typedef enum InhibitWhat {
INHIBIT_SHUTDOWN = 1 << 0,
INHIBIT_SLEEP = 1 << 1,
_INHIBIT_MODE_INVALID = -EINVAL,
} InhibitMode;
-struct Inhibitor {
+typedef struct Inhibitor {
Manager *manager;
sd_event_source *event_source;
char *fifo_path;
int fifo_fd;
-};
+} Inhibitor;
int inhibitor_new(Manager *m, const char* id, Inhibitor **ret);
Inhibitor* inhibitor_free(Inhibitor *i);
#include "bus-polkit.h"
#include "logind.h"
#include "logind-polkit.h"
-#include "user-util.h"
int check_polkit_chvt(sd_bus_message *message, Manager *manager, sd_bus_error *error) {
#if ENABLE_POLKIT
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-bus.h"
-
-#include "bus-object.h"
-
-typedef struct Manager Manager;
+#include "logind-forward.h"
int check_polkit_chvt(sd_bus_message *message, Manager *manager, sd_bus_error *error);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <errno.h>
+#include "sd-bus.h"
#include "alloc-util.h"
#include "bus-common-errors.h"
#include "bus-get-properties.h"
#include "bus-label.h"
+#include "bus-object.h"
#include "bus-polkit.h"
-#include "bus-util.h"
+#include "hashmap.h"
+#include "logind-session.h"
#include "logind.h"
#include "logind-dbus.h"
#include "logind-polkit.h"
#include "logind-seat-dbus.h"
#include "logind-session-dbus.h"
#include "logind-user.h"
+#include "string-util.h"
#include "strv.h"
#include "user-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-bus.h"
-
-#include "bus-object.h"
-#include "macro.h"
-
-typedef struct Seat Seat;
+#include "logind-forward.h"
extern const BusObjectImplementation seat_object;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <errno.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <unistd.h>
#include "fileio.h"
#include "format-util.h"
#include "fs-util.h"
+#include "hashmap.h"
#include "id128-util.h"
+#include "log.h"
#include "logind.h"
#include "logind-device.h"
#include "logind-seat.h"
#include "logind-session-device.h"
#include "logind-user.h"
#include "mkdir-label.h"
-#include "parse-util.h"
#include "path-util.h"
+#include "set.h"
#include "stdio-util.h"
#include "string-util.h"
#include "terminal-util.h"
#include "tmpfile-util.h"
+#include "user-record.h"
int seat_new(Manager *m, const char *id, Seat **ret) {
_cleanup_(seat_freep) Seat *s = NULL;
return true;
}
+
+bool seat_is_self(const char *name) {
+ return isempty(name) || streq(name, "self");
+}
+
+bool seat_is_auto(const char *name) {
+ return streq_ptr(name, "auto");
+}
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-device.h"
-
#include "list.h"
-#include "memory-util.h"
-#include "set.h"
-#include "string-util.h"
-#include "time-util.h"
-
-typedef struct Device Device;
-typedef struct Manager Manager;
-typedef struct Seat Seat;
-typedef struct Session Session;
+#include "logind-forward.h"
-struct Seat {
+typedef struct Seat {
Manager *manager;
char *id;
bool started:1;
LIST_FIELDS(Seat, gc_queue);
-};
+} Seat;
int seat_new(Manager *m, const char *id, Seat **ret);
Seat* seat_free(Seat *s);
void seat_add_to_gc_queue(Seat *s);
bool seat_name_is_valid(const char *name);
-
-static inline bool SEAT_IS_SELF(const char *name) {
- return isempty(name) || streq(name, "self");
-}
-
-static inline bool SEAT_IS_AUTO(const char *name) {
- return streq_ptr(name, "auto");
-}
+bool seat_is_self(const char *name);
+bool seat_is_auto(const char *name);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <errno.h>
#include <sys/eventfd.h>
+#include "sd-bus.h"
+#include "sd-device.h"
+
#include "alloc-util.h"
#include "bus-common-errors.h"
#include "bus-get-properties.h"
#include "bus-label.h"
+#include "bus-object.h"
#include "bus-polkit.h"
-#include "bus-util.h"
#include "device-util.h"
#include "devnum-util.h"
+#include "errno-util.h"
#include "fd-util.h"
#include "format-util.h"
+#include "hashmap.h"
+#include "log.h"
#include "logind.h"
#include "logind-brightness.h"
#include "logind-dbus.h"
#include "logind-user-dbus.h"
#include "path-util.h"
#include "signal-util.h"
+#include "string-util.h"
#include "strv.h"
#include "terminal-util.h"
+#include "user-record.h"
#include "user-util.h"
static int property_get_user(
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-bus.h"
-
-#include "bus-object.h"
-#include "macro.h"
-
-typedef struct Manager Manager;
-typedef struct Session Session;
+#include "logind-forward.h"
extern const BusObjectImplementation session_object;
#include <linux/input.h>
#include <string.h>
#include <sys/ioctl.h>
-#include <sys/types.h>
+#include <sys/sysmacros.h>
-#include "sd-daemon.h"
+#include "sd-bus.h"
#include "sd-device.h"
#include "alloc-util.h"
-#include "bus-util.h"
#include "daemon-util.h"
#include "device-util.h"
+#include "errno-util.h"
#include "fd-util.h"
+#include "hashmap.h"
#include "logind.h"
#include "logind-device.h"
#include "logind-seat.h"
#include "logind-session-dbus.h"
#include "logind-session-device.h"
#include "missing_drm.h"
-#include "parse-util.h"
+#include "string-util.h"
enum SessionDeviceNotifications {
SESSION_DEVICE_RESUME,
#pragma once
#include "list.h"
-#include "memory-util.h"
-
-typedef struct Device Device;
-typedef struct Session Session;
-typedef struct SessionDevice SessionDevice;
+#include "logind-forward.h"
typedef enum DeviceType {
DEVICE_TYPE_UNKNOWN,
DEVICE_TYPE_HIDRAW,
} DeviceType;
-struct SessionDevice {
+typedef struct SessionDevice {
Session *session;
Device *device;
bool pushed_fd:1;
LIST_FIELDS(struct SessionDevice, sd_by_device);
-};
+} SessionDevice;
int session_device_new(Session *s, dev_t dev, bool open_device, SessionDevice **ret);
SessionDevice *session_device_free(SessionDevice *sd);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <errno.h>
#include <fcntl.h>
#include <linux/kd.h>
#include <linux/vt.h>
#include <sys/stat.h>
#include <unistd.h>
+#include "sd-bus.h"
+#include "sd-event.h"
#include "sd-messages.h"
+#include "sd-varlink.h"
#include "alloc-util.h"
#include "audit-util.h"
#include "daemon-util.h"
#include "devnum-util.h"
#include "env-file.h"
+#include "errno-util.h"
#include "escape.h"
+#include "extract-word.h"
#include "fd-util.h"
#include "fileio.h"
#include "format-util.h"
#include "fs-util.h"
-#include "io-util.h"
+#include "hashmap.h"
#include "login-util.h"
#include "logind.h"
#include "logind-dbus.h"
#include "process-util.h"
#include "serialize.h"
#include "string-table.h"
-#include "strv.h"
#include "terminal-util.h"
#include "tmpfile-util.h"
-#include "uid-classification.h"
+#include "user-record.h"
#include "user-util.h"
#define RELEASE_USEC (20*USEC_PER_SEC)
return r;
}
+bool session_is_self(const char *name) {
+ return isempty(name) || streq(name, "self");
+}
+
+bool session_is_auto(const char *name) {
+ return streq_ptr(name, "auto");
+}
+
static const char* const session_state_table[_SESSION_STATE_MAX] = {
[SESSION_OPENING] = "opening",
[SESSION_ONLINE] = "online",
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-bus.h"
-#include "sd-event.h"
-#include "sd-varlink.h"
-
-#include "hashmap.h"
#include "list.h"
+#include "logind-forward.h"
#include "pidref.h"
-#include "string-util.h"
#include "time-util.h"
-typedef struct Manager Manager;
-typedef struct Seat Seat;
-typedef struct Session Session;
-typedef struct User User;
-
typedef enum SessionState {
SESSION_OPENING, /* Session scope is being created */
SESSION_ONLINE, /* Logged in */
_TTY_VALIDITY_INVALID = -EINVAL,
} TTYValidity;
-struct Session {
+typedef struct Session {
Manager *manager;
char *id;
LIST_FIELDS(Session, sessions_by_seat);
LIST_FIELDS(Session, gc_queue);
-};
+} Session;
int session_new(Manager *m, const char *id, Session **ret);
Session* session_free(Session *s);
int session_send_create_reply(Session *s, const sd_bus_error *error);
-static inline bool SESSION_IS_SELF(const char *name) {
- return isempty(name) || streq(name, "self");
-}
-
-static inline bool SESSION_IS_AUTO(const char *name) {
- return streq_ptr(name, "auto");
-}
+bool session_is_self(const char *name);
+bool session_is_auto(const char *name);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <errno.h>
+#include "sd-bus.h"
#include "alloc-util.h"
#include "bus-get-properties.h"
+#include "bus-object.h"
#include "bus-polkit.h"
-#include "bus-util.h"
#include "format-util.h"
+#include "hashmap.h"
#include "logind.h"
#include "logind-dbus.h"
+#include "logind-session.h"
#include "logind-session-dbus.h"
#include "logind-user.h"
#include "logind-user-dbus.h"
#include "signal-util.h"
+#include "string-util.h"
#include "strv.h"
+#include "user-record.h"
#include "user-util.h"
static int property_get_uid(
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-bus.h"
-
-#include "bus-object.h"
-#include "macro.h"
-
-typedef struct User User;
+#include "logind-forward.h"
extern const BusObjectImplementation user_object;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <errno.h>
#include <unistd.h>
+#include "sd-bus.h"
+#include "sd-event.h"
#include "alloc-util.h"
#include "bus-common-errors.h"
#include "bus-error.h"
#include "bus-locator.h"
#include "bus-util.h"
-#include "cgroup-util.h"
#include "clean-ipc.h"
#include "env-file.h"
+#include "errno-util.h"
#include "escape.h"
#include "fd-util.h"
#include "fileio.h"
#include "format-util.h"
#include "fs-util.h"
#include "hashmap.h"
-#include "label-util.h"
#include "limits-util.h"
+#include "logind-session.h"
#include "logind.h"
#include "logind-dbus.h"
#include "logind-seat.h"
#include "logind-user-dbus.h"
#include "mkdir-label.h"
#include "parse-util.h"
-#include "path-util.h"
#include "percent-util.h"
-#include "rm-rf.h"
#include "serialize.h"
#include "special.h"
#include "stdio-util.h"
#include "string-table.h"
+#include "string-util.h"
#include "strv.h"
#include "tmpfile-util.h"
#include "uid-classification.h"
#include "unit-name.h"
+#include "user-record.h"
#include "user-util.h"
int user_new(Manager *m, UserRecord *ur, User **ret) {
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-event.h"
-
-#include "conf-parser.h"
+#include "forward.h"
#include "list.h"
-#include "user-record.h"
-
-typedef struct Manager Manager;
-typedef struct Session Session;
-typedef struct User User;
+#include "logind-forward.h"
+#include "time-util.h"
typedef enum UserState {
USER_OFFLINE, /* Not logged in at all */
_USER_GC_MODE_INVALID = -EINVAL,
} UserGCMode;
-struct User {
+typedef struct User {
Manager *manager;
UserRecord *user_record;
LIST_HEAD(Session, sessions);
LIST_FIELDS(User, gc_queue);
-};
+} User;
int user_new(Manager *m, UserRecord *ur, User **ret);
User *user_free(User *u);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include <sys/inotify.h>
+
+#include "sd-event.h"
+
#include "log.h"
#include "logind.h"
#include "logind-session.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-typedef struct Manager Manager;
+#include "logind-forward.h"
int manager_read_utmp(Manager *m);
void manager_connect_utmp(Manager *m);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "sd-bus.h"
+#include "sd-event.h"
#include "alloc-util.h"
#include "cgroup-util.h"
-#include "fd-util.h"
#include "format-util.h"
+#include "hashmap.h"
#include "json-util.h"
+#include "logind-session.h"
#include "logind.h"
#include "logind-dbus.h"
#include "logind-seat.h"
-#include "logind-session-dbus.h"
#include "logind-user.h"
#include "logind-varlink.h"
#include "terminal-util.h"
+#include "user-record.h"
#include "user-util.h"
#include "varlink-io.systemd.Login.h"
#include "varlink-io.systemd.service.h"
/* Resolves a session name to a session object. Supports resolving the special names "self" and "auto". */
- if (SESSION_IS_SELF(name))
+ if (session_is_self(name))
return manager_varlink_get_session_by_peer(m, link, /* consult_display= */ false, ret);
- if (SESSION_IS_AUTO(name))
+ if (session_is_auto(name))
return manager_varlink_get_session_by_peer(m, link, /* consult_display= */ true, ret);
Session *session = hashmap_get(m->sessions, name);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-bus.h"
-
-typedef struct Manager Manager;
-typedef struct Session Session;
+#include "logind-forward.h"
int manager_varlink_init(Manager *m);
void manager_varlink_done(Manager *m);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <errno.h>
-#include <unistd.h>
+#include <stdio.h>
#include "sd-messages.h"
#include "alloc-util.h"
-#include "audit-util.h"
-#include "bus-common-errors.h"
-#include "bus-error.h"
-#include "bus-util.h"
#include "event-util.h"
-#include "format-util.h"
+#include "log.h"
#include "logind.h"
#include "path-util.h"
-#include "special.h"
-#include "strv.h"
-#include "unit-name.h"
+#include "string-util.h"
#include "user-util.h"
#include "wall.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <errno.h>
#include <fcntl.h>
-#include <sys/types.h>
#include <unistd.h>
+#include "sd-bus.h"
#include "sd-daemon.h"
#include "sd-device.h"
+#include "sd-event.h"
#include "alloc-util.h"
-#include "bus-error.h"
#include "bus-locator.h"
#include "bus-log-control-api.h"
-#include "bus-polkit.h"
-#include "cgroup-util.h"
+#include "bus-object.h"
#include "common-signal.h"
-#include "constants.h"
#include "daemon-util.h"
#include "device-util.h"
#include "devnum-util.h"
#include "dirent-util.h"
+#include "errno-util.h"
#include "escape.h"
#include "fd-util.h"
#include "format-util.h"
#include "fs-util.h"
+#include "hashmap.h"
+#include "label-util.h"
+#include "logind-session.h"
#include "logind.h"
#include "logind-button.h"
#include "logind-dbus.h"
#include "logind-device.h"
#include "logind-seat.h"
-#include "logind-seat-dbus.h"
-#include "logind-session-dbus.h"
#include "logind-session-device.h"
#include "logind-user.h"
-#include "logind-user-dbus.h"
#include "logind-utmp.h"
#include "logind-varlink.h"
#include "main-func.h"
#include "mkdir-label.h"
#include "parse-util.h"
#include "process-util.h"
-#include "selinux-util.h"
#include "service-util.h"
#include "signal-util.h"
#include "strv.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <stdbool.h>
#include <sys/stat.h>
-#include "sd-bus.h"
-#include "sd-device.h"
-#include "sd-event.h"
-#include "sd-varlink.h"
-
#include "calendarspec.h"
-#include "conf-parser.h"
-#include "hashmap.h"
#include "list.h"
#include "logind-action.h"
-#include "set.h"
-#include "time-util.h"
-#include "user-record.h"
-
-typedef struct Button Button;
-typedef struct Device Device;
-typedef struct Seat Seat;
-typedef struct Session Session;
-typedef struct User User;
+#include "logind-forward.h"
typedef struct Manager {
sd_event *event;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <endian.h>
-#include <errno.h>
#include <fcntl.h>
#include <pwd.h>
#include <security/_pam_macros.h>
#include <security/pam_modules.h>
#include <security/pam_modutil.h>
#include <sys/file.h>
-#if HAVE_PIDFD_OPEN
-#include <sys/pidfd.h>
-#endif
+#include "time-util.h"
#include <sys/stat.h>
#include <sys/sysmacros.h>
-#include <sys/types.h>
#include <unistd.h>
#include "sd-bus.h"
#include "sd-varlink.h"
#include "alloc-util.h"
-#include "audit-util.h"
#include "bus-common-errors.h"
#include "bus-error.h"
#include "bus-internal.h"
#include "errno-util.h"
#include "extract-word.h"
#include "fd-util.h"
-#include "fileio.h"
#include "format-util.h"
#include "fs-util.h"
#include "hostname-util.h"
#include "json-util.h"
#include "locale-util.h"
#include "login-util.h"
-#include "macro.h"
-#include "missing_syscall.h"
#include "osc-context.h"
#include "pam-util.h"
#include "parse-util.h"
#include "path-util.h"
#include "percent-util.h"
+#include "pidfd-util.h"
+#include "pidref.h"
#include "process-util.h"
#include "rlimit-util.h"
#include "socket-util.h"
#include "stdio-util.h"
+#include "string-util.h"
#include "strv.h"
#include "terminal-util.h"
#include "tmpfile-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <errno.h>
#include <security/_pam_macros.h>
#include <security/pam_ext.h>
#include <security/pam_misc.h>
#include <security/pam_modutil.h>
#include "keyring-util.h"
-#include "log.h"
-#include "macro.h"
#include "missing_syscall.h"
#include "nulstr-util.h"
#include "pam-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <errno.h>
-
#include "sd-device.h"
#include "alloc-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <sys/types.h>
-
+#include "forward.h"
#include "output-mode.h"
int show_sysfs(const char *seat, const char *prefix, unsigned columns, OutputFlags flags);
#include "sd-bus.h"
#include "bus-locator.h"
-#include "bus-util.h"
#include "fd-util.h"
-#include "macro.h"
#include "tests.h"
static int inhibit(sd_bus *bus, const char *what) {
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "login-util.h"
-#include "macro.h"
#include "tests.h"
TEST(session_id_valid) {
*/
#include <fcntl.h>
-#include <sys/stat.h>
-#include <unistd.h>
+
+#include "sd-bus.h"
#include "alloc-util.h"
+#include "argv-util.h"
#include "bus-common-errors.h"
#include "bus-locator.h"
-#include "path-util.h"
-#include "string-util.h"
-#include "terminal-util.h"
#include "tests.h"
+#include "time-util.h"
static const char *arg_tty = NULL;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <stdint.h>
#include <sys/mount.h>
#include "sd-bus.h"
#include "bus-error.h"
#include "bus-locator.h"
-#include "dev-setup.h"
#include "devnum-util.h"
+#include "errno-util.h"
#include "fd-util.h"
#include "format-util.h"
#include "fs-util.h"
#include "path-util.h"
#include "quota-util.h"
#include "rm-rf.h"
-#include "selinux-util.h"
+#include "set.h"
#include "smack-util.h"
#include "stat-util.h"
#include "stdio-util.h"