func GetString(dataRef DataRef) string { length := int(C.XPLMGetDatab(C.XPLMDataRef(dataRef), nil, 0, 0)) valueBuffer := (*C.char)(C.malloc(C.size_t(length))) defer C.free(unsafe.Pointer(valueBuffer)) C.XPLMGetDatab(C.XPLMDataRef(dataRef), unsafe.Pointer(valueBuffer), 0, C.int(length)) return C.GoString(valueBuffer) }
func SetFloatArrayData(dataRef DataRef, value []float32) { C.XPLMSetDatavf(C.XPLMDataRef(dataRef), (*C.float)(unsafe.Pointer(&value[0])), 0, C.int(len(value))) }
func GetFloatArrayData(dataRef DataRef) []float32 { length := int(C.XPLMGetDatavf(C.XPLMDataRef(dataRef), nil, 0, 0)) result := make([]float32, length) C.XPLMGetDatavf(C.XPLMDataRef(dataRef), (*C.float)(unsafe.Pointer(&result[0])), 0, C.int(length)) return result }
func SetIntArrayData(dataRef DataRef, value []int) { C.XPLMSetDatavi(C.XPLMDataRef(dataRef), (*C.int)(unsafe.Pointer(&value[0])), 0, C.int(len(value))) }
func GetIntArrayData(dataRef DataRef) []int { length := int(C.XPLMGetDatavi(C.XPLMDataRef(dataRef), nil, 0, 0)) result := make([]int, length) C.XPLMGetDatavi(C.XPLMDataRef(dataRef), (*C.int)(unsafe.Pointer(&result[0])), 0, C.int(length)) return result }
func SetDoubleData(dataRef DataRef, value float64) { C.XPLMSetDatad(C.XPLMDataRef(dataRef), C.double(value)) }
func GetDoubleData(dataRef DataRef) float64 { return float64(C.XPLMGetDatad(C.XPLMDataRef(dataRef))) }
func SetIntData(dataRef DataRef, value int) { C.XPLMSetDatai(C.XPLMDataRef(dataRef), C.int(value)) }
func GetFloatData(dataRef DataRef) float32 { return float32(C.XPLMGetDataf(C.XPLMDataRef(dataRef))) }
func GetDataRefTypes(dataRef DataRef) DataRefType { return DataRefType(C.XPLMGetDataRefTypes(C.XPLMDataRef(dataRef))) }
func GetIntData(dataRef DataRef) int { return int(C.XPLMGetDatai(C.XPLMDataRef(dataRef))) }
func IsDataRefGood(dataRef DataRef) bool { return C.XPLMIsDataRefGood(C.XPLMDataRef(dataRef)) == 1 }
func CanWriteDataRef(dataRef DataRef) bool { return C.XPLMCanWriteDataRef(C.XPLMDataRef(dataRef)) == 1 }
func SetString(dataRef DataRef, value string) { cValue := C.CString(value) defer C.free(unsafe.Pointer(cValue)) C.XPLMSetDatab(C.XPLMDataRef(dataRef), unsafe.Pointer(cValue), 0, C.int(C.strlen(cValue))) }
func GetData(dataRef DataRef) []byte { length := int(C.XPLMGetDatab(C.XPLMDataRef(dataRef), nil, 0, 0)) result := make([]byte, length) C.XPLMGetDatab(C.XPLMDataRef(dataRef), unsafe.Pointer(&result[0]), 0, C.int(length)) return result }
func SetFloatData(dataRef DataRef, value float32) { C.XPLMSetDataf(C.XPLMDataRef(dataRef), C.float(value)) }
func UnregisterDataAccessor(dataRef DataRef) { C.XPLMUnregisterDataAccessor(C.XPLMDataRef(dataRef)) }
func SetData(dataRef DataRef, value []byte) { C.XPLMSetDatab(C.XPLMDataRef(dataRef), unsafe.Pointer(&value[0]), 0, C.int(len(value))) }