2 #define I3__FILE__ "ipc.c"
4 * vim:ts=4:sw=4:expandtab
6 * i3 - an improved dynamic tiling window manager
7 * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
9 * ipc.c: UNIX domain socket IPC (initialization, client handling, protocol).
13 #include "yajl_utils.h"
15 #include <sys/socket.h>
20 #include <yajl/yajl_gen.h>
21 #include <yajl/yajl_parse.h>
23 char *current_socketpath = NULL;
25 TAILQ_HEAD(ipc_client_head, ipc_client) all_clients = TAILQ_HEAD_INITIALIZER(all_clients);
28 * Puts the given socket file descriptor into non-blocking mode or dies if
29 * setting O_NONBLOCK failed. Non-blocking sockets are a good idea for our
30 * IPC model because we should by no means block the window manager.
33 static void set_nonblock(int sockfd) {
34 int flags = fcntl(sockfd, F_GETFL, 0);
36 if (fcntl(sockfd, F_SETFL, flags) < 0)
37 err(-1, "Could not set O_NONBLOCK");
41 * Sends the specified event to all IPC clients which are currently connected
42 * and subscribed to this kind of event.
45 void ipc_send_event(const char *event, uint32_t message_type, const char *payload) {
47 TAILQ_FOREACH(current, &all_clients, clients) {
48 /* see if this client is interested in this event */
49 bool interested = false;
50 for (int i = 0; i < current->num_events; i++) {
51 if (strcasecmp(current->events[i], event) != 0)
59 ipc_send_message(current->fd, strlen(payload), message_type, (const uint8_t *)payload);
64 * Calls shutdown() on each socket and closes it. This function to be called
65 * when exiting or restarting only!
68 void ipc_shutdown(void) {
70 while (!TAILQ_EMPTY(&all_clients)) {
71 current = TAILQ_FIRST(&all_clients);
72 shutdown(current->fd, SHUT_RDWR);
74 TAILQ_REMOVE(&all_clients, current, clients);
80 * Executes the command and returns whether it could be successfully parsed
81 * or not (at the moment, always returns true).
84 IPC_HANDLER(command) {
85 /* To get a properly terminated buffer, we copy
86 * message_size bytes out of the buffer */
87 char *command = scalloc(message_size + 1, 1);
88 strncpy(command, (const char *)message, message_size);
89 LOG("IPC: received: *%s*\n", command);
90 yajl_gen gen = yajl_gen_alloc(NULL);
92 CommandResult *result = parse_command((const char *)command, gen);
95 if (result->needs_tree_render)
98 command_result_free(result);
100 const unsigned char *reply;
102 yajl_gen_get_buf(gen, &reply, &length);
104 ipc_send_message(fd, length, I3_IPC_REPLY_TYPE_COMMAND,
105 (const uint8_t *)reply);
110 static void dump_rect(yajl_gen gen, const char *name, Rect r) {
120 y(integer, r.height);
124 static void dump_event_state_mask(yajl_gen gen, Binding *bind) {
126 for (int i = 0; i < 20; i++) {
127 if (bind->event_state_mask & (1 << i)) {
129 case XCB_KEY_BUT_MASK_SHIFT:
132 case XCB_KEY_BUT_MASK_LOCK:
135 case XCB_KEY_BUT_MASK_CONTROL:
138 case XCB_KEY_BUT_MASK_MOD_1:
141 case XCB_KEY_BUT_MASK_MOD_2:
144 case XCB_KEY_BUT_MASK_MOD_3:
147 case XCB_KEY_BUT_MASK_MOD_4:
150 case XCB_KEY_BUT_MASK_MOD_5:
153 case XCB_KEY_BUT_MASK_BUTTON_1:
156 case XCB_KEY_BUT_MASK_BUTTON_2:
159 case XCB_KEY_BUT_MASK_BUTTON_3:
162 case XCB_KEY_BUT_MASK_BUTTON_4:
165 case XCB_KEY_BUT_MASK_BUTTON_5:
168 case (I3_XKB_GROUP_MASK_1 << 16):
171 case (I3_XKB_GROUP_MASK_2 << 16):
174 case (I3_XKB_GROUP_MASK_3 << 16):
177 case (I3_XKB_GROUP_MASK_4 << 16):
186 static void dump_binding(yajl_gen gen, Binding *bind) {
189 y(integer, bind->keycode);
192 ystr((const char *)(bind->input_type == B_KEYBOARD ? "keyboard" : "mouse"));
195 if (bind->symbol == NULL)
203 // This key is only provided for compatibility, new programs should use
204 // event_state_mask instead.
206 dump_event_state_mask(gen, bind);
208 ystr("event_state_mask");
209 dump_event_state_mask(gen, bind);
214 void dump_node(yajl_gen gen, struct Con *con, bool inplace_restart) {
217 y(integer, (long int)con);
230 case CT_FLOATING_CON:
231 ystr("floating_con");
240 DLOG("About to dump unknown container type=%d. This is a bug.\n", con->type);
245 /* provided for backwards compatibility only. */
247 if (!con_is_split(con))
250 if (con_orientation(con) == HORIZ)
256 ystr("scratchpad_state");
257 switch (con->scratchpad_state) {
258 case SCRATCHPAD_NONE:
261 case SCRATCHPAD_FRESH:
264 case SCRATCHPAD_CHANGED:
270 if (con->percent == 0.0)
273 y(double, con->percent);
276 y(bool, con->urgent);
278 if (!TAILQ_EMPTY(&(con->marks_head))) {
283 TAILQ_FOREACH(mark, &(con->marks_head), marks) {
291 y(bool, (con == focused));
294 switch (con->layout) {
296 DLOG("About to dump layout=default, this is a bug in the code.\n");
319 ystr("workspace_layout");
320 switch (con->workspace_layout) {
331 DLOG("About to dump workspace_layout=%d (none of default/stacked/tabbed), this is a bug.\n", con->workspace_layout);
336 ystr("last_split_layout");
337 switch (con->layout) {
347 switch (con->border_style) {
359 ystr("current_border_width");
360 y(integer, con->current_border_width);
362 dump_rect(gen, "rect", con->rect);
363 dump_rect(gen, "deco_rect", con->deco_rect);
364 dump_rect(gen, "window_rect", con->window_rect);
365 dump_rect(gen, "geometry", con->geometry);
368 if (con->window && con->window->name)
369 ystr(i3string_as_utf8(con->window->name));
370 else if (con->name != NULL)
375 if (con->title_format != NULL) {
376 ystr("title_format");
377 ystr(con->title_format);
380 if (con->type == CT_WORKSPACE) {
382 y(integer, con->num);
387 y(integer, con->window->id);
391 if (con->window && !inplace_restart) {
392 /* Window properties are useless to preserve when restarting because
393 * they will be queried again anyway. However, for i3-save-tree(1),
394 * they are very useful and save i3-save-tree dealing with X11. */
395 ystr("window_properties");
398 #define DUMP_PROPERTY(key, prop_name) \
400 if (con->window->prop_name != NULL) { \
402 ystr(con->window->prop_name); \
406 DUMP_PROPERTY("class", class_class);
407 DUMP_PROPERTY("instance", class_instance);
408 DUMP_PROPERTY("window_role", role);
410 if (con->window->name != NULL) {
412 ystr(i3string_as_utf8(con->window->name));
415 ystr("transient_for");
416 if (con->window->transient_for == XCB_NONE)
419 y(integer, con->window->transient_for);
427 if (con->type != CT_DOCKAREA || !inplace_restart) {
428 TAILQ_FOREACH(node, &(con->nodes_head), nodes) {
429 dump_node(gen, node, inplace_restart);
434 ystr("floating_nodes");
436 TAILQ_FOREACH(node, &(con->floating_head), floating_windows) {
437 dump_node(gen, node, inplace_restart);
443 TAILQ_FOREACH(node, &(con->focus_head), focused) {
444 y(integer, (long int)node);
448 ystr("fullscreen_mode");
449 y(integer, con->fullscreen_mode);
452 y(bool, con->sticky);
455 switch (con->floating) {
456 case FLOATING_AUTO_OFF:
459 case FLOATING_AUTO_ON:
462 case FLOATING_USER_OFF:
465 case FLOATING_USER_ON:
473 TAILQ_FOREACH(match, &(con->swallow_head), matches) {
474 /* We will generate a new restart_mode match specification after this
475 * loop, so skip this one. */
476 if (match->restart_mode)
479 if (match->dock != -1) {
481 y(integer, match->dock);
482 ystr("insert_where");
483 y(integer, match->insert_where);
486 #define DUMP_REGEX(re_name) \
488 if (match->re_name != NULL) { \
490 ystr(match->re_name->pattern); \
495 DUMP_REGEX(instance);
496 DUMP_REGEX(window_role);
503 if (inplace_restart) {
504 if (con->window != NULL) {
507 y(integer, con->window->id);
508 ystr("restart_mode");
515 if (inplace_restart && con->window != NULL) {
517 y(integer, con->depth);
523 static void dump_bar_bindings(yajl_gen gen, Barconfig *config) {
524 if (TAILQ_EMPTY(&(config->bar_bindings)))
530 struct Barbinding *current;
531 TAILQ_FOREACH(current, &(config->bar_bindings), bindings) {
535 y(integer, current->input_code);
537 ystr(current->command);
545 static void dump_bar_config(yajl_gen gen, Barconfig *config) {
551 if (config->num_outputs > 0) {
554 for (int c = 0; c < config->num_outputs; c++)
555 ystr(config->outputs[c]);
559 if (!TAILQ_EMPTY(&(config->tray_outputs))) {
560 ystr("tray_outputs");
563 struct tray_output_t *tray_output;
564 TAILQ_FOREACH(tray_output, &(config->tray_outputs), tray_outputs) {
565 ystr(tray_output->output);
571 #define YSTR_IF_SET(name) \
573 if (config->name) { \
575 ystr(config->name); \
579 ystr("tray_padding");
580 y(integer, config->tray_padding);
582 YSTR_IF_SET(socket_path);
585 switch (config->mode) {
598 ystr("hidden_state");
599 switch (config->hidden_state) {
610 switch (config->modifier) {
639 dump_bar_bindings(gen, config);
642 if (config->position == P_BOTTOM)
647 YSTR_IF_SET(status_command);
650 if (config->separator_symbol) {
651 ystr("separator_symbol");
652 ystr(config->separator_symbol);
655 ystr("workspace_buttons");
656 y(bool, !config->hide_workspace_buttons);
658 ystr("strip_workspace_numbers");
659 y(bool, config->strip_workspace_numbers);
661 ystr("binding_mode_indicator");
662 y(bool, !config->hide_binding_mode_indicator);
665 y(bool, config->verbose);
668 #define YSTR_IF_SET(name) \
670 if (config->colors.name) { \
672 ystr(config->colors.name); \
678 YSTR_IF_SET(background);
679 YSTR_IF_SET(statusline);
680 YSTR_IF_SET(separator);
681 YSTR_IF_SET(focused_background);
682 YSTR_IF_SET(focused_statusline);
683 YSTR_IF_SET(focused_separator);
684 YSTR_IF_SET(focused_workspace_border);
685 YSTR_IF_SET(focused_workspace_bg);
686 YSTR_IF_SET(focused_workspace_text);
687 YSTR_IF_SET(active_workspace_border);
688 YSTR_IF_SET(active_workspace_bg);
689 YSTR_IF_SET(active_workspace_text);
690 YSTR_IF_SET(inactive_workspace_border);
691 YSTR_IF_SET(inactive_workspace_bg);
692 YSTR_IF_SET(inactive_workspace_text);
693 YSTR_IF_SET(urgent_workspace_border);
694 YSTR_IF_SET(urgent_workspace_bg);
695 YSTR_IF_SET(urgent_workspace_text);
696 YSTR_IF_SET(binding_mode_border);
697 YSTR_IF_SET(binding_mode_bg);
698 YSTR_IF_SET(binding_mode_text);
706 setlocale(LC_NUMERIC, "C");
707 yajl_gen gen = ygenalloc();
708 dump_node(gen, croot, false);
709 setlocale(LC_NUMERIC, "");
711 const unsigned char *payload;
713 y(get_buf, &payload, &length);
715 ipc_send_message(fd, length, I3_IPC_REPLY_TYPE_TREE, payload);
720 * Formats the reply message for a GET_WORKSPACES request and sends it to the
724 IPC_HANDLER(get_workspaces) {
725 yajl_gen gen = ygenalloc();
728 Con *focused_ws = con_get_workspace(focused);
731 TAILQ_FOREACH(output, &(croot->nodes_head), nodes) {
732 if (con_is_internal(output))
735 TAILQ_FOREACH(ws, &(output_get_content(output)->nodes_head), nodes) {
736 assert(ws->type == CT_WORKSPACE);
746 y(bool, workspace_is_visible(ws));
749 y(bool, ws == focused_ws);
754 y(integer, ws->rect.x);
756 y(integer, ws->rect.y);
758 y(integer, ws->rect.width);
760 y(integer, ws->rect.height);
775 const unsigned char *payload;
777 y(get_buf, &payload, &length);
779 ipc_send_message(fd, length, I3_IPC_REPLY_TYPE_WORKSPACES, payload);
784 * Formats the reply message for a GET_OUTPUTS request and sends it to the
788 IPC_HANDLER(get_outputs) {
789 yajl_gen gen = ygenalloc();
793 TAILQ_FOREACH(output, &outputs, outputs) {
800 y(bool, output->active);
803 y(bool, output->primary);
808 y(integer, output->rect.x);
810 y(integer, output->rect.y);
812 y(integer, output->rect.width);
814 y(integer, output->rect.height);
817 ystr("current_workspace");
819 if (output->con && (ws = con_get_fullscreen_con(output->con, CF_OUTPUT)))
829 const unsigned char *payload;
831 y(get_buf, &payload, &length);
833 ipc_send_message(fd, length, I3_IPC_REPLY_TYPE_OUTPUTS, payload);
838 * Formats the reply message for a GET_MARKS request and sends it to the
842 IPC_HANDLER(get_marks) {
843 yajl_gen gen = ygenalloc();
847 TAILQ_FOREACH(con, &all_cons, all_cons) {
849 TAILQ_FOREACH(mark, &(con->marks_head), marks) {
856 const unsigned char *payload;
858 y(get_buf, &payload, &length);
860 ipc_send_message(fd, length, I3_IPC_REPLY_TYPE_MARKS, payload);
865 * Returns the version of i3
868 IPC_HANDLER(get_version) {
869 yajl_gen gen = ygenalloc();
873 y(integer, MAJOR_VERSION);
876 y(integer, MINOR_VERSION);
879 y(integer, PATCH_VERSION);
881 ystr("human_readable");
884 ystr("loaded_config_file_name");
885 ystr(current_configpath);
889 const unsigned char *payload;
891 y(get_buf, &payload, &length);
893 ipc_send_message(fd, length, I3_IPC_REPLY_TYPE_VERSION, payload);
898 * Formats the reply message for a GET_BAR_CONFIG request and sends it to the
902 IPC_HANDLER(get_bar_config) {
903 yajl_gen gen = ygenalloc();
905 /* If no ID was passed, we return a JSON array with all IDs */
906 if (message_size == 0) {
909 TAILQ_FOREACH(current, &barconfigs, configs) {
914 const unsigned char *payload;
916 y(get_buf, &payload, &length);
918 ipc_send_message(fd, length, I3_IPC_REPLY_TYPE_BAR_CONFIG, payload);
923 /* To get a properly terminated buffer, we copy
924 * message_size bytes out of the buffer */
926 sasprintf(&bar_id, "%.*s", message_size, message);
927 LOG("IPC: looking for config for bar ID \"%s\"\n", bar_id);
928 Barconfig *current, *config = NULL;
929 TAILQ_FOREACH(current, &barconfigs, configs) {
930 if (strcmp(current->id, bar_id) != 0)
939 /* If we did not find a config for the given ID, the reply will contain
940 * a null 'id' field. */
948 dump_bar_config(gen, config);
951 const unsigned char *payload;
953 y(get_buf, &payload, &length);
955 ipc_send_message(fd, length, I3_IPC_REPLY_TYPE_BAR_CONFIG, payload);
960 * Callback for the YAJL parser (will be called when a string is parsed).
963 static int add_subscription(void *extra, const unsigned char *s,
965 ipc_client *client = extra;
967 DLOG("should add subscription to extra %p, sub %.*s\n", client, (int)len, s);
968 int event = client->num_events;
970 client->num_events++;
971 client->events = srealloc(client->events, client->num_events * sizeof(char *));
972 /* We copy the string because it is not null-terminated and strndup()
973 * is missing on some BSD systems */
974 client->events[event] = scalloc(len + 1, 1);
975 memcpy(client->events[event], s, len);
977 DLOG("client is now subscribed to:\n");
978 for (int i = 0; i < client->num_events; i++)
979 DLOG("event %s\n", client->events[i]);
986 * Subscribes this connection to the event types which were given as a JSON
987 * serialized array in the payload field of the message.
990 IPC_HANDLER(subscribe) {
993 ipc_client *current, *client = NULL;
995 /* Search the ipc_client structure for this connection */
996 TAILQ_FOREACH(current, &all_clients, clients) {
997 if (current->fd != fd)
1004 if (client == NULL) {
1005 ELOG("Could not find ipc_client data structure for fd %d\n", fd);
1009 /* Setup the JSON parser */
1010 static yajl_callbacks callbacks = {
1011 .yajl_string = add_subscription,
1014 p = yalloc(&callbacks, (void *)client);
1015 stat = yajl_parse(p, (const unsigned char *)message, message_size);
1016 if (stat != yajl_status_ok) {
1018 err = yajl_get_error(p, true, (const unsigned char *)message,
1020 ELOG("YAJL parse error: %s\n", err);
1021 yajl_free_error(p, err);
1023 const char *reply = "{\"success\":false}";
1024 ipc_send_message(fd, strlen(reply), I3_IPC_REPLY_TYPE_SUBSCRIBE, (const uint8_t *)reply);
1029 const char *reply = "{\"success\":true}";
1030 ipc_send_message(fd, strlen(reply), I3_IPC_REPLY_TYPE_SUBSCRIBE, (const uint8_t *)reply);
1033 /* The index of each callback function corresponds to the numeric
1034 * value of the message type (see include/i3/ipc.h) */
1035 handler_t handlers[8] = {
1037 handle_get_workspaces,
1042 handle_get_bar_config,
1047 * Handler for activity on a client connection, receives a message from a
1050 * For now, the maximum message size is 2048. I’m not sure for what the
1051 * IPC interface will be used in the future, thus I’m not implementing a
1052 * mechanism for arbitrarily long messages, as it seems like overkill
1056 static void ipc_receive_message(EV_P_ struct ev_io *w, int revents) {
1057 uint32_t message_type;
1058 uint32_t message_length;
1059 uint8_t *message = NULL;
1061 int ret = ipc_recv_message(w->fd, &message_type, &message_length, &message);
1062 /* EOF or other error */
1064 /* Was this a spurious read? See ev(3) */
1065 if (ret == -1 && errno == EAGAIN) {
1070 /* If not, there was some kind of error. We don’t bother
1071 * and close the connection */
1074 /* Delete the client from the list of clients */
1075 ipc_client *current;
1076 TAILQ_FOREACH(current, &all_clients, clients) {
1077 if (current->fd != w->fd)
1080 for (int i = 0; i < current->num_events; i++)
1081 free(current->events[i]);
1082 /* We can call TAILQ_REMOVE because we break out of the
1083 * TAILQ_FOREACH afterwards */
1084 TAILQ_REMOVE(&all_clients, current, clients);
1089 ev_io_stop(EV_A_ w);
1093 DLOG("IPC: client disconnected\n");
1097 if (message_type >= (sizeof(handlers) / sizeof(handler_t)))
1098 DLOG("Unhandled message type: %d\n", message_type);
1100 handler_t h = handlers[message_type];
1101 h(w->fd, message, 0, message_length, message_type);
1108 * Handler for activity on the listening socket, meaning that a new client
1109 * has just connected and we should accept() him. Sets up the event handler
1110 * for activity on the new connection and inserts the file descriptor into
1111 * the list of clients.
1114 void ipc_new_client(EV_P_ struct ev_io *w, int revents) {
1115 struct sockaddr_un peer;
1116 socklen_t len = sizeof(struct sockaddr_un);
1118 if ((client = accept(w->fd, (struct sockaddr *)&peer, &len)) < 0) {
1126 /* Close this file descriptor on exec() */
1127 (void)fcntl(client, F_SETFD, FD_CLOEXEC);
1129 set_nonblock(client);
1131 struct ev_io *package = scalloc(1, sizeof(struct ev_io));
1132 ev_io_init(package, ipc_receive_message, client, EV_READ);
1133 ev_io_start(EV_A_ package);
1135 DLOG("IPC: new client connected on fd %d\n", w->fd);
1137 ipc_client *new = scalloc(1, sizeof(ipc_client));
1140 TAILQ_INSERT_TAIL(&all_clients, new, clients);
1144 * Creates the UNIX domain socket at the given path, sets it to non-blocking
1145 * mode, bind()s and listen()s on it.
1148 int ipc_create_socket(const char *filename) {
1151 FREE(current_socketpath);
1153 char *resolved = resolve_tilde(filename);
1154 DLOG("Creating IPC-socket at %s\n", resolved);
1155 char *copy = sstrdup(resolved);
1156 const char *dir = dirname(copy);
1157 if (!path_exists(dir))
1158 mkdirp(dir, DEFAULT_DIR_MODE);
1161 /* Unlink the unix domain socket before */
1164 if ((sockfd = socket(AF_LOCAL, SOCK_STREAM, 0)) < 0) {
1170 (void)fcntl(sockfd, F_SETFD, FD_CLOEXEC);
1172 struct sockaddr_un addr;
1173 memset(&addr, 0, sizeof(struct sockaddr_un));
1174 addr.sun_family = AF_LOCAL;
1175 strncpy(addr.sun_path, resolved, sizeof(addr.sun_path) - 1);
1176 if (bind(sockfd, (struct sockaddr *)&addr, sizeof(struct sockaddr_un)) < 0) {
1182 set_nonblock(sockfd);
1184 if (listen(sockfd, 5) < 0) {
1190 current_socketpath = resolved;
1195 * Generates a json workspace event. Returns a dynamically allocated yajl
1196 * generator. Free with yajl_gen_free().
1198 yajl_gen ipc_marshal_workspace_event(const char *change, Con *current, Con *old) {
1199 setlocale(LC_NUMERIC, "C");
1200 yajl_gen gen = ygenalloc();
1208 if (current == NULL)
1211 dump_node(gen, current, false);
1217 dump_node(gen, old, false);
1221 setlocale(LC_NUMERIC, "");
1227 * For the workspace events we send, along with the usual "change" field, also
1228 * the workspace container in "current". For focus events, we send the
1229 * previously focused workspace in "old".
1231 void ipc_send_workspace_event(const char *change, Con *current, Con *old) {
1232 yajl_gen gen = ipc_marshal_workspace_event(change, current, old);
1234 const unsigned char *payload;
1236 y(get_buf, &payload, &length);
1238 ipc_send_event("workspace", I3_IPC_EVENT_WORKSPACE, (const char *)payload);
1244 * For the window events we send, along the usual "change" field,
1245 * also the window container, in "container".
1247 void ipc_send_window_event(const char *property, Con *con) {
1248 DLOG("Issue IPC window %s event (con = %p, window = 0x%08x)\n",
1249 property, con, (con->window ? con->window->id : XCB_WINDOW_NONE));
1251 setlocale(LC_NUMERIC, "C");
1252 yajl_gen gen = ygenalloc();
1260 dump_node(gen, con, false);
1264 const unsigned char *payload;
1266 y(get_buf, &payload, &length);
1268 ipc_send_event("window", I3_IPC_EVENT_WINDOW, (const char *)payload);
1270 setlocale(LC_NUMERIC, "");
1274 * For the barconfig update events, we send the serialized barconfig.
1276 void ipc_send_barconfig_update_event(Barconfig *barconfig) {
1277 DLOG("Issue barconfig_update event for id = %s\n", barconfig->id);
1278 setlocale(LC_NUMERIC, "C");
1279 yajl_gen gen = ygenalloc();
1281 dump_bar_config(gen, barconfig);
1283 const unsigned char *payload;
1285 y(get_buf, &payload, &length);
1287 ipc_send_event("barconfig_update", I3_IPC_EVENT_BARCONFIG_UPDATE, (const char *)payload);
1289 setlocale(LC_NUMERIC, "");
1293 * For the binding events, we send the serialized binding struct.
1295 void ipc_send_binding_event(const char *event_type, Binding *bind) {
1296 DLOG("Issue IPC binding %s event (sym = %s, code = %d)\n", event_type, bind->symbol, bind->keycode);
1298 setlocale(LC_NUMERIC, "C");
1300 yajl_gen gen = ygenalloc();
1308 dump_binding(gen, bind);
1312 const unsigned char *payload;
1314 y(get_buf, &payload, &length);
1316 ipc_send_event("binding", I3_IPC_EVENT_BINDING, (const char *)payload);
1319 setlocale(LC_NUMERIC, "");