diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2013-09-01 14:55:51 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2013-09-01 14:55:51 +0100 |
commit | 722d8d6a974649067f7e60405487567344d930ec (patch) | |
tree | 4b2adc4ade527de88fa8f7b0264b585ec29b0f8c | |
parent | c6eaee24a6c69bc727728b3c2b4a03aeec20c59f (diff) | |
download | rspamd-722d8d6a974649067f7e60405487567344d930ec.tar.gz rspamd-722d8d6a974649067f7e60405487567344d930ec.zip |
Add fake handler for rcl object and options handler for config.
-rw-r--r-- | src/cfg_rcl.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/cfg_rcl.c b/src/cfg_rcl.c index 3c337d48f..72e9d774a 100644 --- a/src/cfg_rcl.c +++ b/src/cfg_rcl.c @@ -27,7 +27,8 @@ /* * Common section handlers */ -gboolean rspamd_rcl_logging_handler (struct config_file *cfg, rspamd_cl_object_t *obj, +static gboolean +rspamd_rcl_logging_handler (struct config_file *cfg, rspamd_cl_object_t *obj, gpointer ud, struct rspamd_rcl_section *section, GError **err) { rspamd_cl_object_t *val; @@ -155,6 +156,17 @@ gboolean rspamd_rcl_logging_handler (struct config_file *cfg, rspamd_cl_object_t } /** + * Fake handler to parse default options only, uses struct cfg_file as pointer + * for default handlers + */ +static gboolean +rspamd_rcl_empty_handler (struct config_file *cfg, rspamd_cl_object_t *obj, + gpointer ud, struct rspamd_rcl_section *section, GError **err) +{ + return rspamd_rcl_section_parse_defaults (section, cfg, obj, cfg, err); +} + +/** * Add new section to the configuration * @param top top section * @param name the name of the section @@ -230,6 +242,11 @@ rspamd_rcl_config_init (void) G_STRUCT_OFFSET (struct config_file, debug_symbols), 0); rspamd_rcl_add_default_handler (sub, "log_color", rspamd_rcl_parse_struct_boolean, G_STRUCT_OFFSET (struct config_file, log_color), 0); + /** + * Options section + */ + sub = rspamd_rcl_add_section (new, "options", rspamd_rcl_empty_handler, RSPAMD_CL_OBJECT, + FALSE, TRUE); return new; } |