Mercurial > dovecot > core-2.2
changeset 11628:7885030184ab HEAD
config: Added hook_config_parser_begin so plugins can change default settings.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 24 Jun 2010 16:27:20 +0100 |
parents | 661b2138cb7b |
children | a07aa85f68c9 |
files | src/config/config-parser-private.h src/config/config-parser.c |
diffstat | 2 files changed, 5 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/config/config-parser-private.h Thu Jun 24 16:26:52 2010 +0100 +++ b/src/config/config-parser-private.h Thu Jun 24 16:27:20 2010 +0100 @@ -54,6 +54,8 @@ unsigned int expand_values:1; }; +extern void (*hook_config_parser_begin)(struct config_parser_context *ctx); + int config_apply_line(struct config_parser_context *ctx, const char *key, const char *line, const char *section_name); void config_parser_apply_line(struct config_parser_context *ctx,
--- a/src/config/config-parser.c Thu Jun 24 16:26:52 2010 +0100 +++ b/src/config/config-parser.c Thu Jun 24 16:27:20 2010 +0100 @@ -35,6 +35,7 @@ struct config_module_parser *config_module_parsers; struct config_filter_context *config_filter; struct module *modules; +void (*hook_config_parser_begin)(struct config_parser_context *ctx); static const char *info_type_name_find(const struct setting_parser_info *info) { @@ -818,6 +819,8 @@ ctx.cur_input->input = i_stream_create_fd(fd, (size_t)-1, TRUE); i_stream_set_return_partial_line(ctx.cur_input->input, TRUE); old_settings_init(&ctx); + if (hook_config_parser_begin != NULL) + hook_config_parser_begin(&ctx); prevfile: while ((line = i_stream_read_next_line(ctx.cur_input->input)) != NULL) {