func charToBytes(data *C.char, len C.size_t) []byte {
	var value []byte
	header := (*reflect.SliceHeader)(unsafe.Pointer(&value))
	header.Cap, header.Len, header.Data = int(len), int(len), uintptr(unsafe.Pointer(data))
	return value
}
charToBytes converts a *C.char to a byte slice.
package rocksdb
import "C"
import (
	"reflect"
	"unsafe"
)
func btoi(b bool) int {
	if b {
		return 1
	}
	return 0
}
func boolToUchar(b bool) C.uchar {
	if b {
		return C.uchar(1)
	}
	return C.uchar(0)
}
func bytesToChar(b []byte) *C.char {
	var c *C.char
	if len(b) > 0 {
		c = (*C.char)(unsafe.Pointer(&b[0]))
	}
	return c
}
func cByteSlice(b []byte) *C.char {
	var c *C.char
	if len(b) > 0 {
		cData := C.malloc(C.size_t(len(b)))
		copy((*[1 << 24]byte)(cData)[0:len(b)], b)
		c = (*C.char)(cData)
	}
	return c
}