return ret < 0 ? ret : 1;
}
-bool config_parsed_get_version(struct config_parsed *config,
+bool config_parsed_get_version(const struct config_parsed *config,
const char **version_r)
{
*version_r = config->dovecot_config_version;
}
const ARRAY_TYPE(const_string) *
-config_parsed_get_errors(struct config_parsed *config)
+config_parsed_get_errors(const struct config_parsed *config)
{
return &config->errors;
}
struct config_filter_parser *
-config_parsed_get_global_filter_parser(struct config_parsed *config)
+config_parsed_get_global_filter_parser(const struct config_parsed *config)
{
return config->filter_parsers[0];
}
struct config_filter_parser *
-config_parsed_get_global_default_filter_parser(struct config_parsed *config)
+config_parsed_get_global_default_filter_parser(const struct config_parsed *config)
{
return config->filter_parsers[1];
}
struct config_filter_parser *const *
-config_parsed_get_filter_parsers(struct config_parsed *config)
+config_parsed_get_filter_parsers(const struct config_parsed *config)
{
return config->filter_parsers;
}
HASH_TABLE_TYPE(config_key)
-config_parsed_get_all_keys(struct config_parsed *config)
+config_parsed_get_all_keys(const struct config_parsed *config)
{
return config->all_keys;
}
}
static const char *
-config_parsed_get_setting_full(struct config_parsed *config,
+config_parsed_get_setting_full(const struct config_parsed *config,
const char *info_name, const char *key,
unsigned int *change_counter_r)
{
}
const char *
-config_parsed_get_setting(struct config_parsed *config,
+config_parsed_get_setting(const struct config_parsed *config,
const char *info_name, const char *key)
{
return config_parsed_get_setting_full(config, info_name, key, NULL);
}
unsigned int
-config_parsed_get_setting_change_counter(struct config_parsed *config,
+config_parsed_get_setting_change_counter(const struct config_parsed *config,
const char *info_name, const char *key)
{
unsigned int change_counter;
}
const struct setting_define *
-config_parsed_key_lookup(struct config_parsed *config, const char *key)
+config_parsed_key_lookup(const struct config_parsed *config, const char *key)
{
struct config_parser_key *config_key =
hash_table_lookup(config->all_keys, key);
return FALSE;
}
-bool config_parsed_get_includes(struct config_parsed *config,
+bool config_parsed_get_includes(const struct config_parsed *config,
const struct config_filter_parser *filter,
unsigned int parser_idx,
ARRAY_TYPE(config_include_group) *groups)
}
const ARRAY_TYPE(config_path) *
-config_parsed_get_paths(struct config_parsed *config)
+config_parsed_get_paths(const struct config_parsed *config)
{
return &config->seen_paths;
}
struct config_parsed **config_r,
const char **error_r)
ATTR_NULL(3);
-bool config_parsed_get_version(struct config_parsed *config,
+bool config_parsed_get_version(const struct config_parsed *config,
const char **version_r);
/* Return all errors found while parsing the config file. */
const ARRAY_TYPE(const_string) *
-config_parsed_get_errors(struct config_parsed *config);
+config_parsed_get_errors(const struct config_parsed *config);
/* Returns the global filter */
struct config_filter_parser *
-config_parsed_get_global_filter_parser(struct config_parsed *config);
+config_parsed_get_global_filter_parser(const struct config_parsed *config);
/* Returns the global default filter */
struct config_filter_parser *
-config_parsed_get_global_default_filter_parser(struct config_parsed *config);
+config_parsed_get_global_default_filter_parser(const struct config_parsed *config);
/* Returns all filters */
struct config_filter_parser *const *
-config_parsed_get_filter_parsers(struct config_parsed *config);
+config_parsed_get_filter_parsers(const struct config_parsed *config);
/* Fill settings parser with settings from the given module parser. */
void config_fill_set_parser(struct setting_parser_context *parser,
const struct config_module_parser *p,
bool expand_values);
HASH_TABLE_TYPE(config_key)
-config_parsed_get_all_keys(struct config_parsed *config);
+config_parsed_get_all_keys(const struct config_parsed *config);
/* Returns the value for a specified setting. The setting must be found and it
must be a string, or the function panics. */
const char *
-config_parsed_get_setting(struct config_parsed *config,
+config_parsed_get_setting(const struct config_parsed *config,
const char *info_name, const char *key);
/* Return the change_counter for the specified setting. */
unsigned int
-config_parsed_get_setting_change_counter(struct config_parsed *config,
+config_parsed_get_setting_change_counter(const struct config_parsed *config,
const char *info_name,
const char *key);
/* Lookup setting with the specified key. */
const struct setting_define *
-config_parsed_key_lookup(struct config_parsed *config, const char *key);
+config_parsed_key_lookup(const struct config_parsed *config, const char *key);
/* Get the list of filter's include groups that have any settings in the given
module parser index. Returns TRUE if any groups were returned. */
-bool config_parsed_get_includes(struct config_parsed *config,
+bool config_parsed_get_includes(const struct config_parsed *config,
const struct config_filter_parser *filter,
unsigned int parser_idx,
ARRAY_TYPE(config_include_group) *groups);
/* Get all paths used for generating the config */
const ARRAY_TYPE(config_path) *
-config_parsed_get_paths(struct config_parsed *config);
+config_parsed_get_paths(const struct config_parsed *config);
void config_parsed_free(struct config_parsed **config);
void config_parse_load_modules(bool dump_config_import);