aboutsummaryrefslogtreecommitdiffstats
path: root/src/socket.h
blob: e0c5955e7d6e57cb10f1202f9e75846f8b7be41c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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