diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-04-01 19:45:35 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-04-01 19:45:35 +0400 |
commit | 6be82def714f297d54302953286223b4afb07208 (patch) | |
tree | b156eea2e245efeb95702cc6bae6beaa02341440 /src/cfg_xml.h | |
parent | a43a37453f497a919fb4a5358615d89f18706935 (diff) | |
download | rspamd-6be82def714f297d54302953286223b4afb07208.tar.gz rspamd-6be82def714f297d54302953286223b4afb07208.zip |
* Add dumper to XML file (not all sections yet)
* Add checksum to config files
* Some config parsing reorganizations:
- post_load_config should be called after xml initialization
- xml state machine is corrected to read main section variables
- some linting is added to xml (checking of elements parity)
Diffstat (limited to 'src/cfg_xml.h')
-rw-r--r-- | src/cfg_xml.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/cfg_xml.h b/src/cfg_xml.h index 513cf0f03..38c86c3d6 100644 --- a/src/cfg_xml.h +++ b/src/cfg_xml.h @@ -21,11 +21,9 @@ enum xml_read_state { XML_READ_METRIC, XML_READ_WORKER, XML_READ_VARIABLE, - XML_READ_PIDFILE, - XML_READ_STATFILE_POOL, - XML_READ_FILTERS, XML_READ_LOGGING, XML_ERROR, + XML_READ_VALUE, XML_END }; @@ -40,6 +38,8 @@ struct rspamd_xml_userdata { /* Text is NULL terminated here */ typedef gboolean (*element_handler_func) (struct config_file *cfg, struct rspamd_xml_userdata *ctx, GHashTable *attrs, gchar *data, gpointer user_data, gpointer dest_struct, int offset); +/* Callbacks */ + /* Called for open tags <foo bar="baz"> */ void rspamd_xml_start_element (GMarkupParseContext *context, const gchar *element_name, @@ -92,4 +92,9 @@ gboolean handle_factor (struct config_file *cfg, struct rspamd_xml_userdata *ctx gboolean handle_module_opt (struct config_file *cfg, struct rspamd_xml_userdata *ctx, GHashTable *attrs, gchar *data, gpointer user_data, gpointer dest_struct, int offset); gboolean handle_log_type (struct config_file *cfg, struct rspamd_xml_userdata *ctx, GHashTable *attrs, gchar *data, gpointer user_data, gpointer dest_struct, int offset); gboolean handle_log_level (struct config_file *cfg, struct rspamd_xml_userdata *ctx, GHashTable *attrs, gchar *data, gpointer user_data, gpointer dest_struct, int offset); + + +/* Dumper functions */ +gboolean xml_dump_config (struct config_file *cfg, const char *filename); + #endif |