diff options
author | Jesse Luehrs <doy@tozt.net> | 2016-05-02 04:21:26 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2016-05-02 04:37:17 -0400 |
commit | a513d9943fb71607ac8c0f2f3695dec9706f1ebb (patch) | |
tree | d55dacb37503fd6749009d61fa84c8866d668f5f /src/socket.h | |
parent | 957ef4d81438a74d530f2a3890bfcd0145c11fd9 (diff) | |
download | runes-a513d9943fb71607ac8c0f2f3695dec9706f1ebb.tar.gz runes-a513d9943fb71607ac8c0f2f3695dec9706f1ebb.zip |
start working on a client/server model similar to urxvtd/urxvtc
the code is still kind of a mess, and it doesn't quite work properly
yet, but it's close enough to be a start, i think
Diffstat (limited to 'src/socket.h')
-rw-r--r-- | src/socket.h | 21 |
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 |