]> source.dussan.org Git - rspamd.git/commitdiff
Add fake handler for rcl object and options handler for config.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 1 Sep 2013 13:55:51 +0000 (14:55 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 1 Sep 2013 13:55:51 +0000 (14:55 +0100)
src/cfg_rcl.c

index 3c337d48f65248502568d1aa25d91d20b49a7185..72e9d774a283928991b01d4f2e65c1ac3af944e3 100644 (file)
@@ -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;
@@ -154,6 +155,17 @@ gboolean rspamd_rcl_logging_handler (struct config_file *cfg, rspamd_cl_object_t
        return rspamd_rcl_section_parse_defaults (section, cfg, obj, cfg, err);
 }
 
+/**
+ * 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
@@ -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;
 }