func Unmarshal(d []byte) (interface{}, error) { cData := (*C.char)(unsafe.Pointer(&d[0])) ret := C.decodeString(cData, C.size_t(len(d))) if ret == nil { return nil, &SyntaxError{"failed to decode JSON", 0} } return *(*interface{})(ret), nil }
func UnmarshalUjson(d []byte) (*Ujson, error) { cData := (*C.char)(unsafe.Pointer(&d[0])) ret := C.decodeString(cData, C.size_t(len(d))) if ret == nil { return nil, &SyntaxError{"failed to decode JSON", 0} } return &Ujson{ret}, nil }