]> git.sur5r.net Git - i3/i3/blob - include/config_parser.h
Introduce support for specifying variables from X resources. (#2286)
[i3/i3] / include / config_parser.h
1 /*
2  * vim:ts=4:sw=4:expandtab
3  *
4  * i3 - an improved dynamic tiling window manager
5  * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
6  *
7  * config_parser.h: config parser-related definitions
8  *
9  */
10 #pragma once
11
12 #include <yajl/yajl_gen.h>
13
14 SLIST_HEAD(variables_head, Variable);
15 extern pid_t config_error_nagbar_pid;
16
17 /*
18  * An intermediate reprsentation of the result of a parse_config call.
19  * Currently unused, but the JSON output will be useful in the future when we
20  * implement a config parsing IPC command.
21  *
22  */
23 struct ConfigResultIR {
24     /* The JSON generator to append a reply to. */
25     yajl_gen json_gen;
26
27     /* The next state to transition to. Passed to the function so that we can
28      * determine the next state as a result of a function call, like
29      * cfg_criteria_pop_state() does. */
30     int next_state;
31 };
32
33 struct ConfigResultIR *parse_config(const char *input, struct context *context);
34
35 /**
36  * launch nagbar to indicate errors in the configuration file.
37  */
38 void start_config_error_nagbar(const char *configpath, bool has_errors);
39
40 /**
41  * Parses the given file by first replacing the variables, then calling
42  * parse_config and launching i3-nagbar if use_nagbar is true.
43  *
44  * The return value is a boolean indicating whether there were errors during
45  * parsing.
46  *
47  */
48 bool parse_file(const char *f, bool use_nagbar);