mirror of
https://github.com/vbatts/go-mtree.git
synced 2024-11-15 13:18:45 +00:00
16 lines
262 B
Go
16 lines
262 B
Go
|
package mtree
|
||
|
|
||
|
// #include "vis.h"
|
||
|
import "C"
|
||
|
import "fmt"
|
||
|
|
||
|
func Unvis(str string) (string, error) {
|
||
|
dst := new(C.char)
|
||
|
ret := C.strunvis(dst, C.CString(str))
|
||
|
if ret == 0 {
|
||
|
return "", fmt.Errorf("failed to encode string")
|
||
|
}
|
||
|
|
||
|
return C.GoString(dst), nil
|
||
|
}
|