]> git.sur5r.net Git - i3/i3/blobdiff - include/commands_parser.h
Refactor the interface of commands.c
[i3/i3] / include / commands_parser.h
index 77569ec5a3b8a837f551518a098ca8d81233cfc8..5a4472d8acd2b4d090642d5a85a56c919f91e6ca 100644 (file)
 #ifndef _COMMANDS_PARSER_H
 #define _COMMANDS_PARSER_H
 
-char *parse_command(const char *input);
+/*
+ * 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-serialized output of this command. */
+    char *json_output;
+
+    /* Whether the command requires calling tree_render. */
+    bool needs_tree_render;
+};
+
+struct CommandResult *parse_command(const char *input);
 
 #endif