From 0d706ae72ceefd74053ad6cb0900ecce6cf1f085 Mon Sep 17 00:00:00 2001 From: auric Date: Sat, 21 Feb 2026 11:08:36 -0600 Subject: Add Umbrella 0.1.5 --- src/client.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/client.h (limited to 'src/client.h') diff --git a/src/client.h b/src/client.h new file mode 100644 index 0000000..fa607e1 --- /dev/null +++ b/src/client.h @@ -0,0 +1,42 @@ +#ifndef UMBRELLA_CLIENT_H +#define UMBRELLA_CLIENT_H + +#include "umbrella.h" + +/* + * client_listen: create and bind the Unix domain socket. + * Returns the listening fd, or -1 on error. + */ +int client_listen(void); + +/* + * client_accept: accept a new client connection from listen_fd. + * Adds the client to g.clients and registers it with epoll. + * Returns 0 on success, -1 on error. + */ +int client_accept(int listen_fd); + +/* + * client_handle: read and dispatch one message from a client fd. + * Returns 0 to keep the connection, -1 to close it. + */ +int client_handle(int fd); + +/* + * client_remove: close a client connection and remove from g.clients. + */ +void client_remove(int fd); + +/* + * client_find: find a Client by fd. + * Returns pointer into g.clients, or NULL. + */ +Client *client_find(int fd); + +/* + * client_broadcast_output: send output to all clients attached to unit_name. + */ +void client_broadcast_output(const char *unit_name, + const char *data, int history); + +#endif /* UMBRELLA_CLIENT_H */ -- cgit v1.2.3