From d874148760328786c9d12f871a27b97be0774a6d Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Mon, 7 Jul 2014 22:46:23 -0400 Subject: Fixed most compilation errors and added GTK+ string helper functions to common_unix.go. --- redo/common_unix.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 redo/common_unix.go (limited to 'redo/common_unix.go') diff --git a/redo/common_unix.go b/redo/common_unix.go new file mode 100644 index 0000000..e495063 --- /dev/null +++ b/redo/common_unix.go @@ -0,0 +1,22 @@ +// 7 july 2014 + +package ui + +import ( + "unsafe" +) + +// #include "gtk_unix.h" +import "C" + +func fromgstr(s *C.gchar) string { + return C.GoString((*C.char)(unsafe.Pointer(s))) +} + +func togstr(s string) *C.gchar { + return (*C.gchar)(unsafe.Pointer(C.CString(s))) +} + +func freegstr(s *C.gchar) { + C.free(unsafe.Pointer(s)) +} -- cgit v1.2.3