Send proper error messages upon parser failures, use yajl for generating command replies

Fixes: #693
This commit is contained in:
Michael Stapelberg
2012-05-02 22:01:50 +02:00
parent 87cb664236
commit bbe607899c
8 changed files with 192 additions and 108 deletions

View File

@ -10,6 +10,8 @@
#ifndef _COMMANDS_PARSER_H
#define _COMMANDS_PARSER_H
#include <yajl/yajl_gen.h>
/*
* Holds the result of a call to any command. When calling
* parse_command("floating enable, border none"), the parser will internally
@ -20,8 +22,8 @@
*
*/
struct CommandResult {
/* The JSON-serialized output of this command. */
char *json_output;
/* The JSON generator to append a reply to. */
yajl_gen json_gen;
/* Whether the command requires calling tree_render. */
bool needs_tree_render;