summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/comm.h18
-rw-r--r--include/swaylock.h8
2 files changed, 23 insertions, 3 deletions
diff --git a/include/comm.h b/include/comm.h
new file mode 100644
index 0000000..defc2f4
--- /dev/null
+++ b/include/comm.h
@@ -0,0 +1,18 @@
+#ifndef _SWAYLOCK_COMM_H
+#define _SWAYLOCK_COMM_H
+
+#include <stdbool.h>
+
+struct swaylock_password;
+
+bool spawn_comm_child(void);
+ssize_t read_comm_request(char **buf_ptr);
+bool write_comm_reply(bool success);
+// Requests the provided password to be checked. The password is always cleared
+// when the function returns.
+bool write_comm_request(struct swaylock_password *pw);
+bool read_comm_reply(void);
+// FD to poll for password authentication replies.
+int get_comm_reply_fd(void);
+
+#endif
diff --git a/include/swaylock.h b/include/swaylock.h
index e1b7042..32ded18 100644
--- a/include/swaylock.h
+++ b/include/swaylock.h
@@ -62,7 +62,6 @@ struct swaylock_state {
struct loop *eventloop;
struct loop_timer *clear_indicator_timer; // clears the indicator
struct loop_timer *clear_password_timer; // clears the password buffer
- struct loop_timer *verify_password_timer;
struct wl_display *display;
struct wl_compositor *compositor;
struct zwlr_layer_shell_v1 *layer_shell;
@@ -110,8 +109,11 @@ void render_frame(struct swaylock_surface *surface);
void render_frames(struct swaylock_state *state);
void damage_surface(struct swaylock_surface *surface);
void damage_state(struct swaylock_state *state);
-void initialize_pw_backend(void);
-bool attempt_password(struct swaylock_password *pw);
void clear_password_buffer(struct swaylock_password *pw);
+void schedule_indicator_clear(struct swaylock_state *state);
+
+void initialize_pw_backend(void);
+void run_pw_backend_child(void);
+void clear_buffer(char *buf, size_t size);
#endif