#include "bus-util.h"
#include "conf-parser.h"
#include "format-util.h"
+#include "logind.h"
#include "logind-action.h"
#include "logind-dbus.h"
#include "logind-seat-dbus.h"
#pragma once
#include "conf-parser.h"
+#include "logind-inhibit.h"
+#include "sleep-config.h"
typedef enum HandleAction {
HANDLE_IGNORE,
#define HANDLE_ACTION_SLEEP_MASK_DEFAULT (HANDLE_SLEEP_SUSPEND_THEN_HIBERNATE_MASK|HANDLE_SLEEP_SUSPEND_MASK|HANDLE_SLEEP_HIBERNATE_MASK)
-#include "logind-inhibit.h"
-#include "logind.h"
-#include "sleep-config.h"
-
static inline bool handle_action_valid(HandleAction a) {
return a >= 0 && a < _HANDLE_ACTION_MAX;
}
#include "sd-bus.h"
#include "sd-device.h"
-#include "logind.h"
+typedef struct Manager Manager;
int manager_write_brightness(Manager *m, sd_device *device, uint32_t brightness, sd_bus_message *message);
#include "alloc-util.h"
#include "async.h"
#include "fd-util.h"
+#include "logind.h"
#include "logind-button.h"
#include "logind-dbus.h"
#include "string-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-typedef struct Button Button;
+#include <stdbool.h>
-#include "logind.h"
+#include "sd-event.h"
+
+typedef struct Manager Manager;
typedef enum ButtonModifierMask {
BUTTON_MODIFIER_NONE = 0,
#define BUTTON_MODIFIER_HAS_CTRL(modifier) (((modifier) & (BUTTON_MODIFIER_LEFT_CTRL|BUTTON_MODIFIER_RIGHT_CTRL)) != 0)
#define BUTTON_MODIFIER_HAS_ALT(modifier) (((modifier) & (BUTTON_MODIFIER_LEFT_ALT|BUTTON_MODIFIER_RIGHT_ALT)) != 0)
-struct Button {
+typedef struct Button {
Manager *manager;
sd_event_source *io_event_source;
bool lid_closed;
bool docked;
-};
+} Button;
Button* button_new(Manager *m, const char *name);
Button *button_free(Button *b);
#include "fd-util.h"
#include "limits-util.h"
#include "logind.h"
+#include "logind-button.h"
+#include "logind-device.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 "fileio.h"
#include "format-util.h"
#include "fs-util.h"
+#include "login-util.h"
#include "logind.h"
#include "logind-action.h"
#include "logind-dbus.h"
#include "logind-polkit.h"
+#include "logind-seat.h"
#include "logind-seat-dbus.h"
#include "logind-session-dbus.h"
+#include "logind-user.h"
#include "logind-user-dbus.h"
#include "logind-utmp.h"
#include "mkdir-label.h"
#include "sd-bus.h"
#include "bus-object.h"
-#include "logind-action.h"
#include "logind-session.h"
-#include "logind-user.h"
-#include "logind.h"
+#include "macro.h"
+
+typedef struct Manager Manager;
+typedef struct User User;
+typedef struct Seat Seat;
+typedef struct HandleActionData HandleActionData;
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 "logind.h"
#include "logind-device.h"
+#include "logind-seat.h"
#include "logind-seat-dbus.h"
+#include "logind-session-device.h"
Device* device_new(Manager *m, const char *sysfs, bool master) {
Device *d;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-typedef struct Device Device;
-
#include "list.h"
-#include "logind-seat.h"
-#include "logind-session-device.h"
+#include "time-util.h"
+
+typedef struct Device Device;
+typedef struct Manager Manager;
+typedef struct Seat Seat;
+typedef struct SessionDevice SessionDevice;
struct Device {
Manager *manager;
#include <stddef.h>
#include "conf-parser.h"
#include "logind.h"
+#include "logind-user.h"
%}
struct ConfigPerfItem;
%null_strings
#include "format-util.h"
#include "fs-util.h"
#include "io-util.h"
+#include "logind.h"
#include "logind-dbus.h"
#include "logind-inhibit.h"
#include "mkdir-label.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
+#include "sd-event.h"
+
#include "pidref.h"
+#include "time-util.h"
typedef struct Inhibitor Inhibitor;
+typedef struct Manager Manager;
typedef enum InhibitWhat {
INHIBIT_SHUTDOWN = 1 << 0,
_INHIBIT_MODE_INVALID = -EINVAL,
} InhibitMode;
-#include "logind.h"
-
struct Inhibitor {
Manager *manager;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "bus-polkit.h"
+#include "logind.h"
#include "logind-polkit.h"
#include "user-util.h"
#include "sd-bus.h"
#include "bus-object.h"
-#include "logind.h"
+
+typedef struct Manager Manager;
int check_polkit_chvt(sd_bus_message *message, Manager *manager, sd_bus_error *error);
#include "logind-seat-dbus.h"
#include "logind-seat.h"
#include "logind-session-dbus.h"
+#include "logind-user.h"
#include "logind.h"
#include "strv.h"
#include "user-util.h"
#include "sd-bus.h"
#include "bus-object.h"
-#include "logind-seat.h"
+#include "macro.h"
+
+typedef struct Seat Seat;
extern const BusObjectImplementation seat_object;
#include "fileio.h"
#include "format-util.h"
#include "fs-util.h"
+#include "logind.h"
+#include "logind-device.h"
#include "logind-seat-dbus.h"
#include "logind-seat.h"
+#include "logind-session.h"
#include "logind-session-dbus.h"
+#include "logind-session-device.h"
+#include "logind-user.h"
#include "mkdir-label.h"
#include "parse-util.h"
#include "path-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-typedef struct Seat Seat;
-
#include "list.h"
-#include "logind-session.h"
+#include "memory-util.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;
struct Seat {
Manager *manager;
#include "logind-brightness.h"
#include "logind-dbus.h"
#include "logind-polkit.h"
+#include "logind-seat.h"
#include "logind-seat-dbus.h"
#include "logind-session-dbus.h"
#include "logind-session-device.h"
#include "logind-session.h"
+#include "logind-user.h"
#include "logind-user-dbus.h"
#include "logind.h"
#include "path-util.h"
#include "sd-bus.h"
#include "bus-object.h"
-#include "logind-session.h"
+#include "macro.h"
+
+typedef struct Manager Manager;
+typedef struct Session Session;
extern const BusObjectImplementation session_object;
#include "daemon-util.h"
#include "device-util.h"
#include "fd-util.h"
+#include "logind.h"
+#include "logind-device.h"
+#include "logind-seat.h"
+#include "logind-session.h"
#include "logind-session-dbus.h"
#include "logind-session-device.h"
#include "missing_drm.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-typedef enum DeviceType DeviceType;
-typedef struct SessionDevice SessionDevice;
-
#include "list.h"
-#include "logind.h"
+#include "memory-util.h"
-enum DeviceType {
+typedef struct Device Device;
+typedef struct Session Session;
+typedef struct SessionDevice SessionDevice;
+
+typedef enum DeviceType {
DEVICE_TYPE_UNKNOWN,
DEVICE_TYPE_DRM,
DEVICE_TYPE_EVDEV,
DEVICE_TYPE_HIDRAW,
-};
+} DeviceType;
struct SessionDevice {
Session *session;
#include "format-util.h"
#include "fs-util.h"
#include "io-util.h"
+#include "login-util.h"
+#include "logind.h"
#include "logind-dbus.h"
+#include "logind-seat.h"
#include "logind-seat-dbus.h"
#include "logind-session-dbus.h"
+#include "logind-session-device.h"
#include "logind-session.h"
+#include "logind-user.h"
#include "logind-user-dbus.h"
#include "logind-varlink.h"
#include "mkdir-label.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-typedef struct Session Session;
-typedef enum KillWhom KillWhom;
+#include "sd-bus.h"
+#include "sd-event.h"
+#include "sd-varlink.h"
+#include "hashmap.h"
#include "list.h"
-#include "login-util.h"
-#include "logind-user.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 */
#define SESSION_TYPE_IS_GRAPHICAL(type) IN_SET(type, SESSION_X11, SESSION_WAYLAND, SESSION_MIR)
-enum KillWhom {
+typedef enum KillWhom {
KILL_LEADER,
KILL_ALL,
_KILL_WHOM_MAX,
_KILL_WHOM_INVALID = -EINVAL,
-};
+} KillWhom;
typedef enum TTYValidity {
TTY_FROM_PAM,
#include "sd-bus.h"
-#include "logind-user.h"
+#include "bus-object.h"
+#include "macro.h"
+
+typedef struct User User;
extern const BusObjectImplementation user_object;
#include "hashmap.h"
#include "label-util.h"
#include "limits-util.h"
+#include "logind.h"
#include "logind-dbus.h"
+#include "logind-seat.h"
#include "logind-user-dbus.h"
#include "logind-user.h"
#include "mkdir-label.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-typedef struct User User;
+#include "sd-event.h"
#include "conf-parser.h"
#include "list.h"
-#include "logind.h"
#include "user-record.h"
+typedef struct Manager Manager;
+typedef struct Session Session;
+typedef struct User User;
+
typedef enum UserState {
USER_OFFLINE, /* Not logged in at all */
USER_OPENING, /* Is logging in */
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "log.h"
+#include "logind.h"
+#include "logind-session.h"
#include "logind-utmp.h"
#include "path-util.h"
#include "process-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "logind.h"
+typedef struct Manager Manager;
int manager_read_utmp(Manager *m);
void manager_connect_utmp(Manager *m);
#include "json-util.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-util.h"
#include "sd-bus.h"
-#include "logind.h"
-#include "logind-session.h"
+typedef struct Manager Manager;
+typedef struct Session Session;
int manager_varlink_init(Manager *m);
void manager_varlink_done(Manager *m);
#include "format-util.h"
#include "fs-util.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 "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 Manager Manager;
-
-#include "logind-action.h"
-#include "logind-button.h"
-#include "logind-device.h"
-#include "logind-inhibit.h"
+typedef struct Button Button;
+typedef struct Device Device;
+typedef struct Seat Seat;
+typedef struct Session Session;
+typedef struct User User;
-struct Manager {
+typedef struct Manager {
sd_event *event;
sd_bus *bus;
dual_timestamp init_ts;
sd_varlink_server *varlink_server;
-};
+} Manager;
void manager_reset_config(Manager *m);
int manager_parse_config_file(Manager *m);
#include "logind-action.h"
#include "logind-session.h"
+#include "logind-user.h"
#include "sleep-config.h"
#include "test-tables.h"
#include "tests.h"