func DCDecode(s string) string { cs := C.CString(s) defer C.free(unsafe.Pointer(cs)) buf := C.malloc(255) defer C.free(buf) n := C.dc_decode((*_Ctype_char)(buf), cs, (_Ctype_int)(len(s))) if n > 0 { return C.GoStringN((*_Ctype_char)(buf), n) } return s }
func (dc *Codec) Decode(src string) (dst string, idx int) { n := C.dc_decode(dc.cdc, dc.buf, BUFSIZE, C.CString(src), C.int(len(src))) return C.GoStringN(dc.buf, n), 1 }