chiark / gitweb /
Beginnings of handling suspend/etc within logind
[elogind.git] / src / login / logind.h
index 906c8ba4082659f3628d777175924f5a1e109c6d..d1fabf5aa7f7905d78183a6df2cf0c0f73a92161 100644 (file)
@@ -63,13 +63,6 @@ struct Manager {
         sd_event_source *udev_vcsa_event_source;
         sd_event_source *udev_button_event_source;
 
-        /* Make sure the user cannot accidentally unmount our cgroup
-         * file system */
-        int pin_cgroupfs_fd;
-
-        /* Data specific to the cgroup subsystem */
-        char *cgroup_root;
-
         int console_active_fd;
 
         Seat *seat0;
@@ -90,17 +83,7 @@ struct Manager {
            contains the action we are supposed to perform after the
            delay is over */
         HandleAction pending_action;
-        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;
-
-        char *wall_message;
-        unsigned enable_wall_messages;
-        sd_event_source *wall_message_timeout_source;
+        usec_t action_timestamp;
 
         sd_event_source *idle_action_event_source;
         usec_t idle_action_usec;
@@ -120,10 +103,6 @@ struct Manager {
 
         bool remove_ipc;
 
-        char **suspend_state, **suspend_mode;
-        char **hibernate_state, **hibernate_mode;
-        char **hybrid_sleep_state, **hybrid_sleep_mode;
-
         Hashmap *polkit_registry;
 
         usec_t holdoff_timeout_usec;
@@ -132,6 +111,9 @@ struct Manager {
         size_t runtime_dir_size;
 };
 
+Manager *manager_new(void);
+void manager_free(Manager *m);
+
 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);
@@ -144,6 +126,10 @@ 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_startup(Manager *m);
+int manager_run(Manager *m);
+
+void manager_gc(Manager *m, bool drop_not_started);
 
 bool manager_shall_kill(Manager *m, const char *user);
 
@@ -152,17 +138,23 @@ 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(Manager *m);
-int manager_count_displays(Manager *m);
-bool manager_is_docked_or_multiple_displays(Manager *m);
+bool manager_is_docked_or_external_displays(Manager *m);
 
 extern const sd_bus_vtable manager_vtable[];
 
 int bus_manager_shutdown_or_sleep_now_or_later(Manager *m, HandleAction action, InhibitWhat w, sd_bus_error *error);
-int shutdown_or_sleep(Manager *m, HandleAction action);
 
 int manager_send_changed(Manager *manager, const char *property, ...) _sentinel_;
 
+int manager_dispatch_delayed(Manager *manager);
+
+int manager_start_scope(Manager *manager, const char *scope, pid_t pid, const char *slice, const char *description, const char *after, const char *after2, 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);
@@ -178,5 +170,5 @@ int manager_get_session_from_creds(Manager *m, sd_bus_message *message, const ch
 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);
\ No newline at end of file