X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=include%2Fcommands_parser.h;h=795cb0265715c44a5d41319a561d161682dc490f;hb=bbe607899cac72d8cbc0222a1a8b502a5932fef8;hp=77569ec5a3b8a837f551518a098ca8d81233cfc8;hpb=2daa8d422ae63d55e4b952070e8e894c0963618f;p=i3%2Fi3 diff --git a/include/commands_parser.h b/include/commands_parser.h index 77569ec5..795cb026 100644 --- a/include/commands_parser.h +++ b/include/commands_parser.h @@ -10,6 +10,25 @@ #ifndef _COMMANDS_PARSER_H #define _COMMANDS_PARSER_H -char *parse_command(const char *input); +#include + +/* + * Holds the result of a call to any command. When calling + * parse_command("floating enable, border none"), the parser will internally + * use a struct CommandResult when calling cmd_floating and cmd_border. + * parse_command will also return another struct CommandResult, whose + * json_output is set to a map of individual json_outputs and whose + * needs_tree_trender is true if any individual needs_tree_render was true. + * + */ +struct CommandResult { + /* The JSON generator to append a reply to. */ + yajl_gen json_gen; + + /* Whether the command requires calling tree_render. */ + bool needs_tree_render; +}; + +struct CommandResult *parse_command(const char *input); #endif