00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef _IPC_H
00013 #define _IPC_H
00014
00015 #include <ev.h>
00016
00017 #include "i3/ipc.h"
00018
00019 typedef struct ipc_client {
00020 int fd;
00021
00022
00023 int num_events;
00024 char **events;
00025
00026 TAILQ_ENTRY(ipc_client) clients;
00027 } ipc_client;
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 typedef void(*handler_t)(int, uint8_t*, int, uint32_t, uint32_t);
00040
00041
00042 #define IPC_HANDLER(name) \
00043 static void handle_ ## name (int fd, uint8_t *message, \
00044 int size, uint32_t message_size, \
00045 uint32_t message_type)
00046
00054 void ipc_new_client(EV_P_ struct ev_io *w, int revents);
00055
00061 int ipc_create_socket(const char *filename);
00062
00068 void ipc_send_event(const char *event, uint32_t message_type, const char *payload);
00069
00075 void ipc_shutdown();
00076
00077 #endif