Documentation ¶
Index ¶
- func BytesToC(b []byte) (p *uint8, free func())
- func BytesToPointer(b []byte) *uint8
- func BytesToString(b []byte) string
- func Malloc(size int) (bytes []byte, free func())
- func MultiStringToC(ss ...string) (p **uint8, free func())
- func PointerToBytes(p *uint8, size int) []byte
- func PointerToString(p *uint8, size int) string
- func StringToBytes(s string) []byte
- func StringToC(s string) (p *uint8, free func())
- func StringToPointer(s string) *uint8
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToPointer ¶
Convert the given byte slice to a byte pointer.
func BytesToString ¶
Reverse of StringToBytes.
Directly convert a byte slice to a string. This is highly unsafe, do not modify the original slice!
func Malloc ¶
Malloc the given number of bytes. The resulting memory is not known to the Go garbage collector. Call the resulting free function to deallocate the allocated memory.
func MultiStringToC ¶
Copy the given strings to a newly Malloc'd C buffer. It returns a list of nul-terminated C strings.
func PointerToBytes ¶
Convert the given pointer and size to a byte slice. This is highly unsafe.
func PointerToString ¶
Convert the given pointer and size to a string. This is highly unsafe.
func StringToBytes ¶
Directly convert a string to a byte slice. This is highly unsafe, do not modify the resulting slice!
func StringToPointer ¶
Convert the given string to a byte pointer. This is highly unsafe.
Types ¶
This section is empty.