aboutsummaryrefslogtreecommitdiffstats
path: root/src/cfg_xml.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2013-05-30 14:38:24 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2013-05-30 14:38:24 +0100
commit7b3682ce3c78d26dd75782f931611bd09bcc76a5 (patch)
tree03bf5e112472081877f31d50de26613df8d95207 /src/cfg_xml.h
parentedb41f2b5d018399dacf229555e659720f7a97a8 (diff)
downloadrspamd-7b3682ce3c78d26dd75782f931611bd09bcc76a5.tar.gz
rspamd-7b3682ce3c78d26dd75782f931611bd09bcc76a5.zip
Add support for meta options for modules.
This is preliminary patch that enables meta options for modules which would simplify complex options passing.
Diffstat (limited to 'src/cfg_xml.h')
-rw-r--r--src/cfg_xml.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/cfg_xml.h b/src/cfg_xml.h
index ed41c7515..48eac018d 100644
--- a/src/cfg_xml.h
+++ b/src/cfg_xml.h
@@ -12,10 +12,13 @@
#define XML_UNMATCHED_TAG 4
#define XML_INVALID_ATTR 5
+#define MAX_INHERIT 5
+
enum xml_read_state {
XML_READ_START,
XML_READ_PARAM,
XML_READ_MODULE,
+ XML_READ_MODULE_META,
XML_READ_MODULES,
XML_READ_CLASSIFIER,
XML_READ_STATFILE,
@@ -51,7 +54,7 @@ struct rspamd_xml_userdata {
struct config_file *cfg; /*< configuration object */
gchar section_name[MAX_NAME]; /*< current section */
gpointer section_pointer; /*< pointer to object related with section */
- gpointer parent_pointer; /*< parent's section object */
+ gpointer parent_pointer[MAX_INHERIT]; /*< parent's section object */
GHashTable *cur_attrs; /*< attributes of current tag */
GQueue *if_stack; /*< stack of if elements */
};
@@ -126,6 +129,7 @@ gboolean handle_metric_action (struct config_file *cfg, struct rspamd_xml_userda
/* Handle common module option */
gboolean handle_module_opt (struct config_file *cfg, struct rspamd_xml_userdata *ctx, const gchar *tag, GHashTable *attrs, gchar *data, gpointer user_data, gpointer dest_struct, gint offset);
+gboolean handle_module_meta (struct config_file *cfg, struct rspamd_xml_userdata *ctx, const gchar *tag, GHashTable *attrs, gchar *data, gpointer user_data, gpointer dest_struct, gint offset);
/* Handle loging params */
gboolean handle_log_type (struct config_file *cfg, struct rspamd_xml_userdata *ctx, GHashTable *attrs, gchar *data, gpointer user_data, gpointer dest_struct, gint offset);