dovecot-2.0: config: Added hook_config_parser_begin so plugins c...

dovecot at dovecot.org dovecot at dovecot.org
Thu Jun 24 18:27:26 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/7885030184ab
changeset: 11628:7885030184ab
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Jun 24 16:27:20 2010 +0100
description:
config: Added hook_config_parser_begin so plugins can change default settings.

diffstat:

 src/config/config-parser-private.h |  2 ++
 src/config/config-parser.c         |  3 +++
 2 files changed, 5 insertions(+), 0 deletions(-)

diffs (32 lines):

diff -r 661b2138cb7b -r 7885030184ab src/config/config-parser-private.h
--- 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,
diff -r 661b2138cb7b -r 7885030184ab src/config/config-parser.c
--- 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) {


More information about the dovecot-cvs mailing list