sigar/go_bindings/gotoc/utils.go
ilanuriel ad47dc3b49 Go sources update
With latest changes from Lean Agent
2016-01-04 12:30:16 +02:00

29 lines
329 B
Go

package gotoc
import (
"unsafe"
)
/*
#include <stdlib.h>
*/
import "C"
const (
SIGAR_OK = 0
)
func SigarStringToGoString(cstring *C.char) string{
var theString string = C.GoString(cstring)
defer C.free(unsafe.Pointer(cstring))
return theString
}
func Free(cstring *C.char) {
C.free(unsafe.Pointer(cstring))
}