i3
Main Page
Data Structures
Files
File List
Globals
include
commands_parser.h
Go to the documentation of this file.
1
/*
2
* vim:ts=4:sw=4:expandtab
3
*
4
* i3 - an improved dynamic tiling window manager
5
* © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
6
*
7
* commands.c: all command functions (see commands_parser.c)
8
*
9
*/
10
#pragma once
11
12
#include <yajl/yajl_gen.h>
13
14
/*
15
* Holds an intermediate represenation of the result of a call to any command.
16
* When calling parse_command("floating enable, border none"), the parser will
17
* internally use this struct when calling cmd_floating and cmd_border.
18
*/
19
struct
CommandResultIR
{
20
/* The JSON generator to append a reply to (may be NULL). */
21
yajl_gen
json_gen
;
22
23
/* The next state to transition to. Passed to the function so that we can
24
* determine the next state as a result of a function call, like
25
* cfg_criteria_pop_state() does. */
26
int
next_state
;
27
28
/* Whether the command requires calling tree_render. */
29
bool
needs_tree_render
;
30
};
31
32
typedef
struct
CommandResult
CommandResult
;
33
40
struct
CommandResult
{
41
bool
parse_error
;
42
/* the error_message is currently only set for parse errors */
43
char
*
error_message
;
44
bool
needs_tree_render
;
45
};
46
54
CommandResult
*
parse_command
(
const
char
*input, yajl_gen gen);
55
59
void
command_result_free
(
CommandResult
*result);
CommandResultIR
Definition:
commands_parser.h:19
CommandResultIR::json_gen
yajl_gen json_gen
Definition:
commands_parser.h:21
CommandResult::parse_error
bool parse_error
Definition:
commands_parser.h:41
parse_command
CommandResult * parse_command(const char *input, yajl_gen gen)
Parses and executes the given command.
Definition:
commands_parser.c:214
CommandResult
A struct that contains useful information about the result of a command as a whole (e...
Definition:
commands_parser.h:40
CommandResult::error_message
char * error_message
Definition:
commands_parser.h:43
command_result_free
void command_result_free(CommandResult *result)
Frees a CommandResult.
Definition:
commands_parser.c:424
CommandResultIR::next_state
int next_state
Definition:
commands_parser.h:26
CommandResultIR::needs_tree_render
bool needs_tree_render
Definition:
commands_parser.h:29
CommandResult::needs_tree_render
bool needs_tree_render
Definition:
commands_parser.h:44
Generated by
1.8.6