+/*
+ * Returns the version of i3
+ *
+ */
+IPC_HANDLER(get_version) {
+ yajl_gen gen = ygenalloc();
+ y(map_open);
+
+ ystr("major");
+ y(integer, MAJOR_VERSION);
+
+ ystr("minor");
+ y(integer, MINOR_VERSION);
+
+ ystr("patch");
+ y(integer, PATCH_VERSION);
+
+ ystr("human_readable");
+ ystr(I3_VERSION);
+
+ y(map_close);
+
+ const unsigned char *payload;
+ ylength length;
+ y(get_buf, &payload, &length);
+
+ ipc_send_message(fd, length, I3_IPC_REPLY_TYPE_VERSION, payload);
+ y(free);
+}
+