summaryrefslogtreecommitdiff
path: root/new/init_unix.c
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2015-04-10 16:54:06 -0400
committerPietro Gagliardi <[email protected]>2015-04-10 16:54:06 -0400
commitd326407f05cadec6422fe3ccbcfcaf41a869dfde (patch)
tree0b1de9537d95626a8fe6bc7fe59ca7bc3294b962 /new/init_unix.c
parente49f6f7da880e984400966d1985b1e7103535ee6 (diff)
Decided to kill uiInitError and return the message as a const char * instead. Will need to implement on Windows.
Diffstat (limited to 'new/init_unix.c')
-rw-r--r--new/init_unix.c28
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);
}