summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNikola Pajkovsky <npajkovs@redhat.com>2011-03-30 13:40:45 +0200
committerNikola Pajkovsky <npajkovs@redhat.com>2011-03-30 15:14:25 +0200
commitb21745640ee0852ce0cdc3f430371769a60d9317 (patch)
tree8ad6516c5ec735c165673ff58f99ae8026750255 /src
parent37960b280bc5fe60465ace007645d5d339c61040 (diff)
downloadabrt-b21745640ee0852ce0cdc3f430371769a60d9317.tar.gz
abrt-b21745640ee0852ce0cdc3f430371769a60d9317.tar.xz
abrt-b21745640ee0852ce0cdc3f430371769a60d9317.zip
make validate_event_option static
Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/include/report/event_config.h1
-rw-r--r--src/lib/event_config.c54
2 files changed, 27 insertions, 28 deletions
diff --git a/src/include/report/event_config.h b/src/include/report/event_config.h
index 72b1d8c1..8dcfb9f6 100644
--- a/src/include/report/event_config.h
+++ b/src/include/report/event_config.h
@@ -90,7 +90,6 @@ GList *export_event_config(const char *event_name);
void unexport_event_config(GList *env_list);
GHashTable *validate_event(const char *event_name);
-char *validate_event_option(event_option_t *opt);
#ifdef __cplusplus
}
diff --git a/src/lib/event_config.c b/src/lib/event_config.c
index a84aae0c..7a8b5e31 100644
--- a/src/lib/event_config.c
+++ b/src/lib/event_config.c
@@ -284,34 +284,8 @@ void unexport_event_config(GList *env_list)
}
}
-GHashTable *validate_event(const char *event_name)
-{
- event_config_t *config = get_event_config(event_name);
- if (!config)
- return NULL;
-
-
- GHashTable *errors = g_hash_table_new_full(g_str_hash, g_str_equal, free, free);
- GList *li;
-
- for (li = config->options; li; li = li->next)
- {
- event_option_t *opt = (event_option_t *)li->data;
- char *err = validate_event_option(opt);
- if (err)
- g_hash_table_insert(errors, xstrdup(opt->name), err);
- }
-
- if (g_hash_table_size(errors))
- return errors;
-
- g_hash_table_destroy(errors);
-
- return NULL;
-}
-
/* return NULL if successful otherwise appropriate error message */
-char *validate_event_option(event_option_t *opt)
+static char *validate_event_option(event_option_t *opt)
{
if (!opt->allow_empty && (!opt->value || !opt->value[0]))
return xstrdup(_("Missing mandatory value"));
@@ -353,3 +327,29 @@ char *validate_event_option(event_option_t *opt)
return NULL;
}
+
+GHashTable *validate_event(const char *event_name)
+{
+ event_config_t *config = get_event_config(event_name);
+ if (!config)
+ return NULL;
+
+
+ GHashTable *errors = g_hash_table_new_full(g_str_hash, g_str_equal, free, free);
+ GList *li;
+
+ for (li = config->options; li; li = li->next)
+ {
+ event_option_t *opt = (event_option_t *)li->data;
+ char *err = validate_event_option(opt);
+ if (err)
+ g_hash_table_insert(errors, xstrdup(opt->name), err);
+ }
+
+ if (g_hash_table_size(errors))
+ return errors;
+
+ g_hash_table_destroy(errors);
+
+ return NULL;
+}