summaryrefslogtreecommitdiff
path: root/src/greetd.h
diff options
context:
space:
mode:
authorPhil Jones <philj56@gmail.com>2021-10-31 22:16:40 +0000
committerPhil Jones <philj56@gmail.com>2021-10-31 23:12:07 +0000
commit6f199dc746bd377223e9bec60467c9060d1048ff (patch)
treeacce570009d48e3efa6a1232c37070c1e0f456c8 /src/greetd.h
parent7297ac5d9cac676ed6cd4552a6b47204f9db2512 (diff)
Add actual greetd functionality.
Useable, but very barebones — not even any error message reporting.
Diffstat (limited to 'src/greetd.h')
-rw-r--r--src/greetd.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/greetd.h b/src/greetd.h
new file mode 100644
index 0000000..3901d85
--- /dev/null
+++ b/src/greetd.h
@@ -0,0 +1,43 @@
+#ifndef GREETD_H
+#define GREETD_H
+
+#include <json-c/json_object.h>
+
+enum greetd_request_type {
+ GREETD_REQUEST_CREATE_SESSION,
+ GREETD_REQUEST_POST_AUTH_MESSAGE_RESPONSE,
+ GREETD_REQUEST_START_SESSION,
+ GREETD_REQUEST_CANCEL_SESSION
+};
+
+enum greetd_response_type {
+ GREETD_RESPONSE_INVALID,
+ GREETD_RESPONSE_SUCCESS,
+ GREETD_RESPONSE_ERROR,
+ GREETD_RESPONSE_AUTH_MESSAGE
+};
+
+enum greetd_auth_message_type {
+ GREETD_AUTH_MESSAGE_INVALID,
+ GREETD_AUTH_MESSAGE_VISIBLE,
+ GREETD_AUTH_MESSAGE_SECRET,
+ GREETD_AUTH_MESSAGE_INFO,
+ GREETD_AUTH_MESSAGE_ERROR
+};
+
+enum greetd_error_type {
+ GREETD_ERROR_INVALID,
+ GREETD_ERROR_AUTH_ERROR,
+ GREETD_ERROR_ERROR
+};
+
+[[nodiscard]] struct json_object *greetd_create_session(const char *username);
+[[nodiscard]] struct json_object *greetd_post_auth_message_response(const char *response);
+[[nodiscard]] struct json_object *greetd_start_session(const char *command);
+[[nodiscard]] struct json_object *greetd_cancel_session(void);
+
+enum greetd_response_type greetd_parse_response_type(struct json_object *response);
+enum greetd_auth_message_type greetd_parse_auth_message_type(struct json_object *response);
+enum greetd_error_type greetd_parse_error_type(struct json_object *response);
+
+#endif /* GREETD_H */