*
* i3 - an improved dynamic tiling window manager
*
- * © 2009-2010 Michael Stapelberg and contributors
+ * © 2009-2011 Michael Stapelberg and contributors
*
* See file LICENSE for license information.
*
#include <ev.h>
#include <yajl/yajl_gen.h>
#include <yajl/yajl_parse.h>
+#include <yajl/yajl_version.h>
#include "queue.h"
#include "ipc.h"
if (last_focused == SLIST_END(&(c_ws->focus_stack)))
last_focused = NULL;
+#if YAJL_MAJOR >= 2
+ yajl_gen gen = yajl_gen_alloc(NULL);
+#else
yajl_gen gen = yajl_gen_alloc(NULL, NULL);
+#endif
y(array_open);
TAILQ_FOREACH(ws, workspaces, workspaces) {
y(array_close);
const unsigned char *payload;
+#if YAJL_MAJOR >= 2
+ size_t length;
+#else
unsigned int length;
+#endif
y(get_buf, &payload, &length);
ipc_send_message(fd, payload, I3_IPC_REPLY_TYPE_WORKSPACES, length);
IPC_HANDLER(get_outputs) {
Output *output;
+#if YAJL_MAJOR >= 2
+ yajl_gen gen = yajl_gen_alloc(NULL);
+#else
yajl_gen gen = yajl_gen_alloc(NULL, NULL);
+#endif
y(array_open);
TAILQ_FOREACH(output, &outputs, outputs) {
y(array_close);
const unsigned char *payload;
+#if YAJL_MAJOR >= 2
+ size_t length;
+#else
unsigned int length;
+#endif
y(get_buf, &payload, &length);
ipc_send_message(fd, payload, I3_IPC_REPLY_TYPE_OUTPUTS, length);
memset(&callbacks, 0, sizeof(yajl_callbacks));
callbacks.yajl_string = add_subscription;
+#if YAJL_MAJOR >= 2
+ p = yajl_alloc(&callbacks, NULL, (void*)client);
+#else
p = yajl_alloc(&callbacks, NULL, NULL, (void*)client);
+#endif
stat = yajl_parse(p, (const unsigned char*)message, message_size);
if (stat != yajl_status_ok) {
unsigned char *err;