swaylock/include/comm.h

31 lines
675 B
C
Raw Normal View History

2019-01-16 16:35:14 -06:00
#ifndef _SWAYLOCK_COMM_H
#define _SWAYLOCK_COMM_H
2019-01-17 05:42:13 -06:00
#include <stdbool.h>
struct swaylock_password;
2024-11-09 10:05:16 -06:00
enum conn_reply_kind {
REPLY_SUCCESS,
REPLY_AUTH_ERR,
REPLY_CONTINUE,
REPLY_MSG,
};
struct comm_reply {
enum conn_reply_kind kind;
char pam_msg[256];
};
2019-01-16 16:35:14 -06:00
bool spawn_comm_child(void);
ssize_t read_comm_request(char **buf_ptr);
2024-11-09 10:05:16 -06:00
bool write_comm_reply(struct comm_reply reply);
2019-01-17 05:42:13 -06:00
// Requests the provided password to be checked. The password is always cleared
// when the function returns.
bool write_comm_request(struct swaylock_password *pw);
2024-11-09 10:05:16 -06:00
struct comm_reply read_comm_reply(void);
2019-01-17 05:42:13 -06:00
// FD to poll for password authentication replies.
int get_comm_reply_fd(void);
2019-01-16 16:35:14 -06:00
#endif