diff options
author | Kenny Levinsen <kl@kl.wtf> | 2020-07-31 00:22:18 +0200 |
---|---|---|
committer | Kenny Levinsen <kl@kl.wtf> | 2020-07-31 00:22:18 +0200 |
commit | 61716a2c77dfde9addf6b41a6d72d26a8584150e (patch) | |
tree | 537cd84661955497bdb304f88896e36896df4e5f /include/backend.h | |
parent | f85434de666f10da0cbcaccdbb7d88917c5fa887 (diff) |
Initial implementation of seatd and libseat
Diffstat (limited to 'include/backend.h')
-rw-r--r-- | include/backend.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/include/backend.h b/include/backend.h new file mode 100644 index 0000000..e310a49 --- /dev/null +++ b/include/backend.h @@ -0,0 +1,32 @@ +#ifndef _SEATD_BACKEND_H +#define _SEATD_BACKEND_H + +#include "libseat.h" + +struct libseat_impl; +struct libseat_seat_listener; + +struct libseat { + const struct libseat_impl *impl; +}; + +struct named_backend { + const char *name; + const struct libseat_impl *backend; +}; + +struct libseat_impl { + struct libseat *(*open_seat)(struct libseat_seat_listener *listener, void *data); + int (*disable_seat)(struct libseat *seat); + int (*close_seat)(struct libseat *seat); + const char *(*seat_name)(struct libseat *seat); + + int (*open_device)(struct libseat *seat, const char *path, int *fd); + int (*close_device)(struct libseat *seat, int device_id); + int (*switch_session)(struct libseat *seat, int session); + + int (*get_fd)(struct libseat *seat); + int (*dispatch)(struct libseat *seat, int timeout); +}; + +#endif |