summaryrefslogtreecommitdiff
path: root/new/uiinit_unix.c
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2015-04-06 12:20:51 -0400
committerPietro Gagliardi <[email protected]>2015-04-06 12:20:51 -0400
commitee1653f542f0c070afb8310c9041267496bbdf05 (patch)
treeb18654d87e569457a61ad15d0955ad9c53efd0e7 /new/uiinit_unix.c
parent50577098478ed0e7cfb3f2a417bddb16187929f6 (diff)
Started doing the C rewrite. Defined the basic initialization and main loop and window API and implemented them on GTK+.
Diffstat (limited to 'new/uiinit_unix.c')
-rw-r--r--new/uiinit_unix.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/new/uiinit_unix.c b/new/uiinit_unix.c
new file mode 100644
index 0000000..bd2463d
--- /dev/null
+++ b/new/uiinit_unix.c
@@ -0,0 +1,27 @@
+// 6 april 2015
+#include "ui_unix.h"
+
+struct uiInitError {
+ GError *err;
+};
+
+uiInitError *uiInit(uiInitOptions *o)
+{
+ uiInitError *e;
+
+ e = g_new0(uiInitError, 1);
+ if (gtk_init_with_args(NULL, NULL, NULL, NULL, NULL, &(e->err)) == FALSE)
+ return e;
+ uiInitErrorFree(e);
+ return NULL;
+}
+
+const char *uiInitErrorMessage(uiInitError *e)
+{
+ return e->err->message;
+}
+
+void uiInitErrorFree(uiInitError *e)
+{
+ g_free(e);
+}