summaryrefslogtreecommitdiff
path: root/util.go
diff options
context:
space:
mode:
Diffstat (limited to 'util.go')
-rw-r--r--util.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/util.go b/util.go
new file mode 100644
index 0000000..cfcb677
--- /dev/null
+++ b/util.go
@@ -0,0 +1,25 @@
+// 12 december 2015
+
+package ui
+
+import (
+ "unsafe"
+)
+
+// #include <stdlib.h>
+import "C"
+
+func freestr(str *C.char) {
+ C.free(unsafe.Pointer(str))
+}
+
+func tobool(b C.int) bool {
+ return b != 0
+}
+
+func frombool(b bool) C.int {
+ if b {
+ return 1
+ }
+ return 0
+}