aboutsummaryrefslogtreecommitdiffstats
path: root/src/cfg_xml.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2010-03-27 05:12:35 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2010-03-27 05:12:35 +0300
commit7dbdebbca0dace0f7c1f1a82f38a99ca489b0180 (patch)
treefb5c948313e0466bda328db7b99324d017c7e0a7 /src/cfg_xml.h
parent2f2642851746b0985f67e8dde58e2458eae07cca (diff)
downloadrspamd-7dbdebbca0dace0f7c1f1a82f38a99ca489b0180.tar.gz
rspamd-7dbdebbca0dace0f7c1f1a82f38a99ca489b0180.zip
* New syntax parser that should make syntax check of XML configs
* Rework of config structure types (use glib types) * TODO: - implement the whole syntax of rspamd in XML - implement custom handlers that modules can install - write missing handlers
Diffstat (limited to 'src/cfg_xml.h')
-rw-r--r--src/cfg_xml.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/cfg_xml.h b/src/cfg_xml.h
index 3e1a4bcd4..5bac52f86 100644
--- a/src/cfg_xml.h
+++ b/src/cfg_xml.h
@@ -4,6 +4,8 @@
#include "config.h"
#include "cfg_file.h"
+#define MAX_NAME 8192
+
#define XML_START_MISSING 1
#define XML_PARAM_MISSING 2
#define XML_EXTRA_ELEMENT 3
@@ -30,10 +32,14 @@ enum xml_read_state {
struct rspamd_xml_userdata {
enum xml_read_state state;
struct config_file *cfg;
- gchar *section_name;
+ gchar section_name[MAX_NAME];
gpointer other_data;
+ GHashTable *cur_attrs;
};
+/* Text is NULL terminated here */
+typedef gboolean (*element_handler_func) (struct config_file *cfg, struct rspamd_xml_userdata *ctx, GHashTable *attrs, const gchar *data, gpointer user_data, gpointer dest_struct, int offset);
+
/* Called for open tags <foo bar="baz"> */
void rspamd_xml_start_element (GMarkupParseContext *context,
const gchar *element_name,