Signed-off-by: Nikola Pajkovsky npajkovs@redhat.com --- src/gui-wizard-gtk/wizard.c | 34 ---------------------------------- src/include/report/event_config.h | 12 ++++++++++++ src/lib/event_config.c | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 34 deletions(-)
diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c index 07ebcb5..31c7bb2 100644 --- a/src/gui-wizard-gtk/wizard.c +++ b/src/gui-wizard-gtk/wizard.c @@ -619,40 +619,6 @@ enum { LOGSTATE_MIDLINE, };
-static GList *export_event_config(const char *event_name) -{ - GList *env_list = NULL; - - event_config_t *config = get_event_config(event_name); - if (config) - { - for (GList *lopt = config->options; lopt; lopt = lopt->next) - { - event_option_t *opt = lopt->data; - if (!opt->value) - continue; - char *var_val = xasprintf("%s=%s", opt->name, opt->value); - VERB3 log("Exporting '%s'", var_val); - env_list = g_list_prepend(env_list, var_val); - putenv(var_val); - } - } - - return env_list; -} - -static void unexport_event_config(GList *env_list) -{ - while (env_list) - { - char *var_val = env_list->data; -VERB3 log("Unexporting '%s'", var_val); - safe_unsetenv(var_val); - env_list = g_list_remove(env_list, var_val); - free(var_val); - } -} - static int spawn_next_command_in_evd(struct analyze_event_data *evd) { evd->env_list = export_event_config(evd->event_name); diff --git a/src/include/report/event_config.h b/src/include/report/event_config.h index 75f357d..cc6c15b 100644 --- a/src/include/report/event_config.h +++ b/src/include/report/event_config.h @@ -21,6 +21,11 @@ #ifndef EVENT_CONFIG_H #define EVENT_CONFIG_H
+ +#ifdef __cplusplus +extern "C" { +#endif + typedef enum { OPTION_TYPE_TEXT, @@ -80,4 +85,11 @@ event_option_t *get_event_option_from_list(const char *option_name, GList *event
extern GHashTable *g_event_config_list; // for iterating through entire list of all loaded configs
+GList *export_event_config(const char *event_name); +void unexport_event_config(GList *env_list); + +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/lib/event_config.c b/src/lib/event_config.c index 43c9e76..3f76021 100644 --- a/src/lib/event_config.c +++ b/src/lib/event_config.c @@ -246,3 +246,37 @@ event_config_t *get_event_config(const char *name) } return g_hash_table_lookup(g_event_config_list, name); } + +GList *export_event_config(const char *event_name) +{ + GList *env_list = NULL; + + event_config_t *config = get_event_config(event_name); + if (config) + { + for (GList *lopt = config->options; lopt; lopt = lopt->next) + { + event_option_t *opt = lopt->data; + if (!opt->value) + continue; + char *var_val = xasprintf("%s=%s", opt->name, opt->value); + VERB3 log("Exporting '%s'", var_val); + env_list = g_list_prepend(env_list, var_val); + putenv(var_val); + } + } + + return env_list; +} + +void unexport_event_config(GList *env_list) +{ + while (env_list) + { + char *var_val = env_list->data; + VERB3 log("Unexporting '%s'", var_val); + safe_unsetenv(var_val); + env_list = g_list_remove(env_list, var_val); + free(var_val); + } +}
On Thu, 2011-03-17 at 10:54 +0100, Nikola Pajkovsky wrote:
Signed-off-by: Nikola Pajkovsky npajkovs@redhat.com
Looks ok, please apply.
crash-catcher@lists.fedorahosted.org