diff options
| author | Pietro Gagliardi <[email protected]> | 2015-12-12 13:07:57 -0500 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2015-12-12 13:07:57 -0500 |
| commit | a181d36b5848a826b904ac06c56f961cb88c5878 (patch) | |
| tree | 4e537041d6a8cd902e02dac217655cbc0c261fc3 /util.go | |
| parent | b6ccf2db405ed5af469d3b53d4506fe7ebb87b97 (diff) | |
Implemented some utility functions.
Diffstat (limited to 'util.go')
| -rw-r--r-- | util.go | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -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 +} |
