aboutsummaryrefslogtreecommitdiffstats
path: root/src/socket.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/socket.h')
-rw-r--r--src/socket.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/socket.h b/src/socket.h
new file mode 100644
index 0000000..e0c5955
--- /dev/null
+++ b/src/socket.h
@@ -0,0 +1,21 @@
+#ifndef _RUNES_SOCKET_H
+#define _RUNES_SOCKET_H
+
+#include <sys/un.h>
+
+struct runes_socket {
+ RunesLoop *loop;
+ char *name;
+ int sock;
+ int client_sock;
+};
+
+void runes_socket_init(RunesSocket *sock, RunesLoop *loop);
+void runes_socket_init_loop(RunesSocket *sock, RunesLoop *loop);
+void runes_socket_send_client_message(int argc, char **argv);
+void runes_socket_cleanup(RunesSocket *sock);
+
+#define MAX_SOCKET_PATH_LEN \
+ (sizeof(struct sockaddr_un) - offsetof(struct sockaddr_un, sun_path))
+
+#endif