diff options
| author | Nikola Pajkovsky <npajkovs@redhat.com> | 2011-03-30 13:40:45 +0200 |
|---|---|---|
| committer | Nikola Pajkovsky <npajkovs@redhat.com> | 2011-03-30 15:14:25 +0200 |
| commit | b21745640ee0852ce0cdc3f430371769a60d9317 (patch) | |
| tree | 8ad6516c5ec735c165673ff58f99ae8026750255 /src/lib | |
| parent | 37960b280bc5fe60465ace007645d5d339c61040 (diff) | |
| download | abrt-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/lib')
| -rw-r--r-- | src/lib/event_config.c | 54 |
1 files changed, 27 insertions, 27 deletions
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; +} |
