From beab78097de6a53430bb16310e41b93d74546cb9 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 15 Feb 2011 17:59:12 +0300 Subject: * Add ability to add descriptions for symbols --- src/cfg_xml.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/cfg_xml.c') diff --git a/src/cfg_xml.c b/src/cfg_xml.c index a85b77777..aa91bfda0 100644 --- a/src/cfg_xml.c +++ b/src/cfg_xml.c @@ -805,7 +805,7 @@ handle_metric_action (struct config_file *cfg, struct rspamd_xml_userdata *ctx, gboolean handle_metric_symbol (struct config_file *cfg, struct rspamd_xml_userdata *ctx, GHashTable *attrs, gchar *data, gpointer user_data, gpointer dest_struct, gint offset) { - gchar *strval, *err; + gchar *strval, *err, *desc; double *value; GList *metric_list; struct metric *metric = ctx->section_pointer; @@ -824,6 +824,13 @@ handle_metric_symbol (struct config_file *cfg, struct rspamd_xml_userdata *ctx, } } + if (attrs != NULL) { + desc = g_hash_table_lookup (attrs, "description"); + if (desc) { + g_hash_table_insert (metric->descriptions, data, memory_pool_strdup (cfg->cfg_pool, desc)); + } + } + g_hash_table_insert (metric->symbols, data, value); if ((metric_list = g_hash_table_lookup (cfg->metrics_symbols, data)) == NULL) { -- cgit v1.2.3