src/core/config/parser.c
/**
 * Resolve a variable found in the configuration file
 *
 * Once we have read and parsed a configuration item pointing to a variable
 * we need to resolve the variable.
 *
 * First we find the variable in the parser's variable map then we copy the
 * value.
 */
Resolve a variable found in the configuration file
Once we have read and parsed a configuration item pointing to a variable
we need to resolve the variable.

First we find the variable in the parser's variable map then we copy the
value.
Resolve a variable found in the configuration file Once we have read and parsed a configuration item pointing to a variable we need to resolve the variable . First we find the variable in the parser ' s variable map then we copy the value .
static struct config_value *parser_resolve_variable(const struct parser *parser,
                                                    const char *variable_key)
{
        const struct config_value *variable = parser_find_variable(parser, variable_key);
        if (variable == NULL) {
                LOG_ERROR(natwm_logger,
                          "'%s' is not defined - Line: %zu",
                          variable_key,
                          parser->line_num);
                return NULL;
        }
        struct config_value *new = config_value_duplicate(variable);
        if (new == NULL) {
                LOG_ERROR(natwm_logger,
                          "Failed to resolve variable '%s' - Line: %zu",
                          variable_key,
                          parser->line_num);
                return NULL;
        }
        return new;
}
static struct config_value * parser_resolve_variable ( const struct parser * parser , const char * variable_key ) { const struct config_value * variable = parser_find_variable ( parser , variable_key ) ; if ( variable == NULL ) { LOG_ERROR ( natwm_logger , " " , variable_key , parser -> line_num ) ; return NULL ; } struct config_value * new = config_value_duplicate ( variable ) ; if ( new == NULL ) { LOG_ERROR ( natwm_logger , " " , variable_key , parser -> line_num ) ; return NULL ; } return new ; }
Resolve a variable found in the configuration file
 Once we have read and parsed a configuration item pointing to a variable
 we need to resolve the variable.
Resolve a variable found in the configuration file Once we have read and parsed a configuration item pointing to a variable we need to resolve the variable .