aboutsummaryrefslogtreecommitdiff
path: root/include/seat.h
diff options
context:
space:
mode:
authorKenny Levinsen <kl@kl.wtf>2020-07-31 00:22:18 +0200
committerKenny Levinsen <kl@kl.wtf>2020-07-31 00:22:18 +0200
commit61716a2c77dfde9addf6b41a6d72d26a8584150e (patch)
tree537cd84661955497bdb304f88896e36896df4e5f /include/seat.h
parentf85434de666f10da0cbcaccdbb7d88917c5fa887 (diff)
Initial implementation of seatd and libseat
Diffstat (limited to 'include/seat.h')
-rw-r--r--include/seat.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/include/seat.h b/include/seat.h
new file mode 100644
index 0000000..e52a961
--- /dev/null
+++ b/include/seat.h
@@ -0,0 +1,47 @@
+#ifndef _SEATD_SEAT_H
+#define _SEATD_SEAT_H
+
+#include "list.h"
+#include <stdbool.h>
+#include <stdint.h>
+#include <sys/types.h>
+
+struct client;
+
+struct seat_device {
+ int device_id;
+ int fd;
+ int ref_cnt;
+ bool active;
+ char *path;
+ dev_t dev;
+};
+
+struct seat {
+ char *seat_name;
+ struct list clients;
+ struct client *active_client;
+ struct client *next_client;
+
+ bool vt_bound;
+ bool vt_pending_ack;
+ int next_vt;
+};
+
+struct seat *seat_create(const char *name, bool vt_bound);
+void seat_destroy(struct seat *seat);
+
+int seat_add_client(struct seat *seat, struct client *client);
+int seat_remove_client(struct seat *seat, struct client *client);
+int seat_open_client(struct seat *seat, struct client *client);
+int seat_close_client(struct seat *seat, struct client *client);
+
+struct seat_device *seat_open_device(struct client *client, const char *path);
+int seat_close_device(struct client *client, struct seat_device *seat_device);
+struct seat_device *seat_find_device(struct client *client, int device_id);
+
+int seat_set_next_session(struct seat *seat, int session);
+int seat_activate(struct seat *seat);
+int seat_prepare_vt_switch(struct seat *seat);
+
+#endif