i3
|
#include "all.h"
#include "GENERATED_command_enums.h"
#include "GENERATED_command_tokens.h"
#include "GENERATED_command_call.h"
Go to the source code of this file.
Data Structures | |
struct | token |
struct | tokenptr |
Macros | |
#define | y(x, ...) |
#define | ystr(str) |
Typedefs | |
typedef struct token | cmdp_token |
typedef struct tokenptr | cmdp_token_ptr |
Functions | |
static void | push_string (struct stack *stack, const char *identifier, char *str) |
static void | push_long (struct stack *stack, const char *identifier, long num) |
static const char * | get_string (struct stack *stack, const char *identifier) |
static long | get_long (struct stack *stack, const char *identifier) |
static void | clear_stack (struct stack *stack) |
static void | next_state (const cmdp_token *token) |
char * | parse_string (const char **walk, bool as_word) |
Parses a string (or word, if as_word is true). | |
CommandResult * | parse_command (const char *input, yajl_gen gen, ipc_client *client) |
Parses and executes the given command. | |
void | command_result_free (CommandResult *result) |
Frees a CommandResult. | |
Variables | |
static cmdp_state | state |
static Match | current_match |
static struct stack | stack |
static struct CommandResultIR | subcommand_output |
static struct CommandResultIR | command_output |
#define y | ( | x, | |
... ) |
#define ystr | ( | str | ) |
Definition at line 30 of file commands_parser.c.
Referenced by parse_command().
typedef struct token cmdp_token |
typedef struct tokenptr cmdp_token_ptr |
|
static |
Definition at line 135 of file commands_parser.c.
References stack_entry::identifier, stack_entry::num, stack::stack, stack_entry::str, stack_entry::type, and stack_entry::val.
Referenced by next_state(), and parse_command().
void command_result_free | ( | CommandResult * | result | ) |
Frees a CommandResult.
Definition at line 458 of file commands_parser.c.
References CommandResult::error_message, and FREE.
Referenced by handle_button_press(), handle_key_press(), IPC_HANDLER(), route_click(), and run_assignments().
|
static |
Definition at line 121 of file commands_parser.c.
References stack_entry::identifier, stack_entry::num, stack::stack, and stack_entry::val.
|
static |
Definition at line 108 of file commands_parser.c.
References stack_entry::identifier, stack::stack, stack_entry::str, and stack_entry::val.
|
static |
Definition at line 162 of file commands_parser.c.
References token::call_identifier, clear_stack(), CommandResultIR::client, command_output, current_match, token::extra, CommandResultIR::json_gen, CommandResultIR::needs_tree_render, CommandResultIR::next_state, token::next_state, state, and subcommand_output.
Referenced by parse_command().
CommandResult * parse_command | ( | const char * | input, |
yajl_gen | gen, | ||
ipc_client * | client ) |
Parses and executes the given command.
If a caller-allocated yajl_gen is passed, a json reply will be generated in the format specified by the ipc protocol. Pass NULL if no json reply is required.
Free the returned CommandResult with command_result_free().
Definition at line 253 of file commands_parser.c.
References tokenptr::array, clear_stack(), CommandResultIR::client, cmd_criteria_init(), command_output, current_match, DLOG, ELOG, CommandResult::error_message, token::identifier, CommandResultIR::json_gen, tokenptr::n, token::name, CommandResult::needs_tree_render, CommandResultIR::needs_tree_render, next_state(), CommandResult::parse_error, parse_string(), push_long(), push_string(), sasprintf(), scalloc(), smalloc(), sstrdup(), state, subcommand_output, y, and ystr.
Referenced by IPC_HANDLER(), run_assignments(), and run_binding().
char * parse_string | ( | const char ** | walk, |
bool | as_word ) |
Parses a string (or word, if as_word is true).
Extracted out of parse_command so that it can be used in src/workspace.c for interpreting workspace commands.
Definition at line 190 of file commands_parser.c.
References scalloc().
Referenced by extract_workspace_names_from_bindings(), and parse_command().
|
static |
Definition at line 86 of file commands_parser.c.
References stack_entry::identifier, stack_entry::num, stack::stack, stack_entry::type, and stack_entry::val.
Referenced by parse_command().
|
static |
Definition at line 64 of file commands_parser.c.
References stack_entry::identifier, stack::stack, stack_entry::str, stack_entry::type, and stack_entry::val.
Referenced by parse_command().
|
static |
Definition at line 158 of file commands_parser.c.
Referenced by next_state(), and parse_command().
|
static |
Definition at line 151 of file commands_parser.c.
Referenced by CFGFUN(), CFGFUN(), CFGFUN(), CFGFUN(), CFGFUN(), CFGFUN(), cmd_criteria_add(), cmd_criteria_match_windows(), cmd_focus(), cmd_layout_toggle(), cmd_resize(), cmd_resize_set(), cmd_scratchpad_show(), cmd_unmark(), next_state(), parse_command(), resize_set_tiling(), and TAILQ_HEAD().
|
static |
Definition at line 156 of file commands_parser.c.
Referenced by CFGFUN().
|
static |
Definition at line 150 of file commands_parser.c.
Referenced by _sync_json_int(), _sync_json_key(), _x_con_kill(), configure_notify(), display_running_version(), expose_event(), handle_event(), IPC_HANDLER(), next_state(), open_placeholder_window(), parse_command(), property_notify(), restore_connect(), restore_kill_placeholder(), sd_notify(), set_hidden_state(), set_maximized_state(), set_shape_state(), sighandler_handle_key_press(), update_placeholder_contents(), x_con_init(), x_deco_recurse(), x_mask_event_mask(), x_push_changes(), x_push_node(), x_push_node_unmaps(), x_raise_con(), x_reinit(), x_reparent_child(), x_set_name(), and x_set_shape().
|
static |
Definition at line 157 of file commands_parser.c.
Referenced by next_state(), next_state(), parse_command(), and parse_config().