Change the names of parser result structs
Change the name of structs CommandResult and ConfigResult to CommandResultIR and ConfigResultIR to show they are an intermediate representation used during parsing.
This commit is contained in:
committed by
Michael Stapelberg
parent
dda9a7f6e0
commit
45fa4b7d23
@ -12,7 +12,7 @@
|
||||
#include "commands_parser.h"
|
||||
|
||||
/** The beginning of the prototype for every cmd_ function. */
|
||||
#define I3_CMD Match *current_match, struct CommandResult *cmd_output
|
||||
#define I3_CMD Match *current_match, struct CommandResultIR *cmd_output
|
||||
|
||||
/**
|
||||
* Initializes the specified 'Match' data structure and the initial state of
|
||||
|
@ -12,15 +12,11 @@
|
||||
#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
|
||||
* 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.
|
||||
*
|
||||
* Holds an intermediate represenation of the result of a call to any command.
|
||||
* When calling parse_command("floating enable, border none"), the parser will
|
||||
* internally use this struct when calling cmd_floating and cmd_border.
|
||||
*/
|
||||
struct CommandResult {
|
||||
struct CommandResultIR {
|
||||
/* The JSON generator to append a reply to. */
|
||||
yajl_gen json_gen;
|
||||
|
||||
@ -33,4 +29,4 @@ struct CommandResult {
|
||||
bool needs_tree_render;
|
||||
};
|
||||
|
||||
struct CommandResult *parse_command(const char *input);
|
||||
struct CommandResultIR *parse_command(const char *input);
|
||||
|
@ -18,7 +18,7 @@
|
||||
uint32_t modifiers_from_str(const char *str);
|
||||
|
||||
/** The beginning of the prototype for every cfg_ function. */
|
||||
#define I3_CFG Match *current_match, struct ConfigResult *result
|
||||
#define I3_CFG Match *current_match, struct ConfigResultIR *result
|
||||
|
||||
/* Defines a configuration function, that is, anything that can be called by
|
||||
* using 'call cfg_foo()' in parser-specs/.*.spec. Useful so that we don’t need
|
||||
|
@ -14,11 +14,12 @@
|
||||
extern pid_t config_error_nagbar_pid;
|
||||
|
||||
/*
|
||||
* The result of a parse_config call. Currently unused, but the JSON output
|
||||
* will be useful in the future when we implement a config parsing IPC command.
|
||||
* An intermediate reprsentation of the result of a parse_config call.
|
||||
* Currently unused, but the JSON output will be useful in the future when we
|
||||
* implement a config parsing IPC command.
|
||||
*
|
||||
*/
|
||||
struct ConfigResult {
|
||||
struct ConfigResultIR {
|
||||
/* The JSON generator to append a reply to. */
|
||||
yajl_gen json_gen;
|
||||
|
||||
@ -28,7 +29,7 @@ struct ConfigResult {
|
||||
int next_state;
|
||||
};
|
||||
|
||||
struct ConfigResult *parse_config(const char *input, struct context *context);
|
||||
struct ConfigResultIR *parse_config(const char *input, struct context *context);
|
||||
|
||||
/**
|
||||
* Parses the given file by first replacing the variables, then calling
|
||||
|
Reference in New Issue
Block a user