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 #include <stdbool.h>
00017 #include <yajl/yajl_gen.h>
00018 #include <yajl/yajl_parse.h>
00019
00020 #include "data.h"
00021 #include "tree.h"
00022
00023 #include "i3/ipc.h"
00024
00025 extern char *current_socketpath;
00026
00027 typedef struct ipc_client {
00028 int fd;
00029
00030
00031 int num_events;
00032 char **events;
00033
00034 TAILQ_ENTRY(ipc_client) clients;
00035 } ipc_client;
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047 typedef void(*handler_t)(int, uint8_t*, int, uint32_t, uint32_t);
00048
00049
00050 #define IPC_HANDLER(name) \
00051 static void handle_ ## name (int fd, uint8_t *message, \
00052 int size, uint32_t message_size, \
00053 uint32_t message_type)
00054
00062 void ipc_new_client(EV_P_ struct ev_io *w, int revents);
00063
00069 int ipc_create_socket(const char *filename);
00070
00076 void ipc_send_event(const char *event, uint32_t message_type, const char *payload);
00077
00083 void ipc_shutdown();
00084
00085 void dump_node(yajl_gen gen, Con *con, bool inplace_restart);
00086
00087 #endif