i3
config_parser.h File Reference
#include <config.h>
#include <yajl/yajl_gen.h>
Include dependency graph for config_parser.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  stack_entry
struct  stack
struct  parser_ctx
struct  ConfigResultIR
 An intermediate representation of the result of a parse_config call. More...

Enumerations

enum  parse_file_result_t { PARSE_FILE_FAILED = -1 , PARSE_FILE_SUCCESS = 0 , PARSE_FILE_CONFIG_ERRORS = 1 }

Functions

 SLIST_HEAD (variables_head, Variable)
void start_config_error_nagbar (const char *configpath, bool has_errors)
 launch nagbar to indicate errors in the configuration file.
void free_variables (struct parser_ctx *ctx)
 Releases the memory of all variables in ctx.
parse_file_result_t parse_file (struct parser_ctx *ctx, const char *f, IncludedFile *included_file)
 Parses the given file by first replacing the variables, then calling parse_config and launching i3-nagbar if use_nagbar is true.

Variables

pid_t config_error_nagbar_pid

Enumeration Type Documentation

◆ parse_file_result_t

Enumerator
PARSE_FILE_FAILED 
PARSE_FILE_SUCCESS 
PARSE_FILE_CONFIG_ERRORS 

Definition at line 91 of file config_parser.h.

Function Documentation

◆ free_variables()

void free_variables ( struct parser_ctx * ctx)

Releases the memory of all variables in ctx.

Definition at line 689 of file config_parser.c.

References ctx, FREE, Variable::key, SLIST_EMPTY, SLIST_FIRST, SLIST_REMOVE_HEAD, and Variable::value.

Referenced by load_configuration().

◆ parse_file()

parse_file_result_t parse_file ( struct parser_ctx * ctx,
const char * f,
IncludedFile * included_file )

Parses the given file by first replacing the variables, then calling parse_config and launching i3-nagbar if use_nagbar is true.

The return value is a boolean indicating whether there were errors during parsing.

Definition at line 705 of file config_parser.c.

References check_for_duplicate_bindings(), ctx, database, DLOG, ELOG, context::filename, FREE, get_resource(), context::has_errors, context::has_warnings, i3_version, Variable::key, context::line_copy, LOG, Variable::next_match, parse_config(), PARSE_FILE_CONFIG_ERRORS, PARSE_FILE_FAILED, PARSE_FILE_SUCCESS, IncludedFile::raw_contents, scalloc(), SLIST_FOREACH, sstrdup(), start_config_error_nagbar(), upsert_variable(), Variable::value, and IncludedFile::variable_replaced_contents.

Referenced by CFGFUN(), and load_configuration().

Here is the call graph for this function:

◆ SLIST_HEAD()

SLIST_HEAD ( variables_head ,
Variable  )

◆ start_config_error_nagbar()

void start_config_error_nagbar ( const char * configpath,
bool has_errors )

launch nagbar to indicate errors in the configuration file.

Launch nagbar to indicate errors in the configuration file.

launch nagbar to indicate errors in the configuration file.

Definition at line 597 of file config_parser.c.

References config, config_error_nagbar_pid, errorfilename, context::has_errors, sasprintf(), and start_nagbar().

Referenced by parse_file(), and translate_keysyms().

Here is the call graph for this function:

Variable Documentation

◆ config_error_nagbar_pid

pid_t config_error_nagbar_pid
extern