chiark / gitweb /
logind: introduce session-devices
[elogind.git] / src / login / logind-session.h
index e2a46d5907f554007b703e86d5187826477e4c48..f175a8995ee4e29509626bacfe21ab130e874fc6 100644 (file)
@@ -28,7 +28,9 @@ typedef enum KillWho KillWho;
 #include "util.h"
 #include "logind.h"
 #include "logind-seat.h"
+#include "logind-session-device.h"
 #include "logind-user.h"
+#include "login-shared.h"
 
 typedef enum SessionState {
         SESSION_OPENING,  /* Session scope is being created */
@@ -101,9 +103,13 @@ struct Session {
 
         bool in_gc_queue:1;
         bool started:1;
+        bool closing:1;
 
         DBusMessage *create_message;
 
+        char *controller;
+        Hashmap *devices;
+
         LIST_FIELDS(Session, sessions_by_user);
         LIST_FIELDS(Session, sessions_by_seat);
 
@@ -123,6 +129,7 @@ int session_create_fifo(Session *s);
 void session_remove_fifo(Session *s);
 int session_start(Session *s);
 int session_stop(Session *s);
+int session_finalize(Session *s);
 int session_save(Session *s);
 int session_load(Session *s);
 int session_kill(Session *s, KillWho who, int signo);
@@ -151,3 +158,7 @@ SessionClass session_class_from_string(const char *s) _pure_;
 
 const char *kill_who_to_string(KillWho k) _const_;
 KillWho kill_who_from_string(const char *s) _pure_;
+
+bool session_is_controller(Session *s, const char *sender);
+int session_set_controller(Session *s, const char *sender, bool force);
+void session_drop_controller(Session *s);