terminal: add helper to retrieve the seat of a session
authorDavid Herrmann <dh.herrmann@gmail.com>
Mon, 29 Sep 2014 13:36:20 +0000 (15:36 +0200)
committerDavid Herrmann <dh.herrmann@gmail.com>
Mon, 29 Sep 2014 13:37:32 +0000 (15:37 +0200)
Allow sysview users to retrieve the seat that a session is assigned to.

src/libsystemd-terminal/sysview.c
src/libsystemd-terminal/sysview.h

index 919fadf6fe544a11a34f774c4df7c9388949e1f8..70a6ca726c5184ec3decea93b37708c6309dff53 100644 (file)
@@ -267,6 +267,12 @@ const char *sysview_session_get_name(sysview_session *session) {
         return session->name;
 }
 
+sysview_seat *sysview_session_get_seat(sysview_session *session) {
+        assert_return(session, NULL);
+
+        return session->seat;
+}
+
 static int session_take_control_fn(sd_bus *bus,
                                    sd_bus_message *reply,
                                    void *userdata,
index 31b800f6985890466f7f02644adadfd5a498cd25..cad603d59fe7740d5e955fb3374c30135072a916 100644 (file)
@@ -128,6 +128,7 @@ void sysview_session_set_userdata(sysview_session *session, void *userdata);
 void *sysview_session_get_userdata(sysview_session *session);
 
 const char *sysview_session_get_name(sysview_session *session);
+sysview_seat *sysview_session_get_seat(sysview_session *session);
 
 int sysview_session_take_control(sysview_session *session);
 void sysview_session_release_control(sysview_session *session);