]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
config: Added hook_config_parser_begin so plugins can change default settings.
authorTimo Sirainen <tss@iki.fi>
Thu, 24 Jun 2010 15:27:20 +0000 (16:27 +0100)
committerTimo Sirainen <tss@iki.fi>
Thu, 24 Jun 2010 15:27:20 +0000 (16:27 +0100)
--HG--
branch : HEAD

src/config/config-parser-private.h
src/config/config-parser.c

index efab0764651ebd1424cea754225e31e7cbf921a6..49849e4c6be340364b46858df37e946a8c8fbeb9 100644 (file)
@@ -54,6 +54,8 @@ struct config_parser_context {
        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,
index e57ec490a9b8f000d3fc96471ba564a32ab94fbd..5c0f9370ddfb8a8b8eca4d72e4a9b75ff2b435be 100644 (file)
@@ -35,6 +35,7 @@ static const enum settings_parser_flags settings_parser_flags =
 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 @@ int config_parse_file(const char *path, bool expand_values, const char *module,
        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) {