diff options
Diffstat (limited to 'new/init_unix.c')
| -rw-r--r-- | new/init_unix.c | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/new/init_unix.c b/new/init_unix.c index 60abc91..b10c05b 100644 --- a/new/init_unix.c +++ b/new/init_unix.c @@ -1,31 +1,23 @@ // 6 april 2015 #include "uipriv_unix.h" -struct uiInitError { - GError *err; -}; - uiInitOptions options; -uiInitError *uiInit(uiInitOptions *o) +const char *uiInit(uiInitOptions *o) { - uiInitError *err; + GError *err = NULL; + const char *msg; options = *o; - err = uiNew(uiInitError); - if (gtk_init_with_args(NULL, NULL, NULL, NULL, NULL, &(err->err)) == FALSE) - return err; - uiFree(err); + if (gtk_init_with_args(NULL, NULL, NULL, NULL, NULL, &err) == FALSE) { + msg = g_strdup(err->message); + g_error_free(err); + return msg; + } return NULL; } -const char *uiInitErrorMessage(uiInitError *err) -{ - return err->err->message; -} - -void uiInitErrorFree(uiInitError *err) +void uiFreeInitError(const char *err) { - g_error_free(err->err); - uiFree(err); + g_free((gpointer) err); } |
