Documentation
¶
Overview ¶
package core implements core functionality for the generated files this core lib is imported by the generated code
Index ¶
- func ByteSlice(name []string) **byte
- func CString(name string) *byte
- func GFree(ptr uintptr)
- func GFreeNullable(ptr uintptr)
- func GStrdup(s string) uintptr
- func GStrdupNullable(s *string) uintptr
- func GetPaths(name string) []string
- func GoString(c uintptr) string
- func GoStringSlice(c uintptr) []string
- func NullableStringToPtr(s *string) (uintptr, []byte)
- func PtrToNullableString(ptr uintptr) *string
- func PuregoSafeRegister(fptr interface{}, libs []uintptr, name string)
- func SetPackageName(libName, pkgName string)
- func SetSharedLibraries(libName string, sharedLibs []string)
- func TryGetPaths(name string) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ByteSlice ¶
ByteSlice creates a pointer to a byte slice of C strings This function was copied from purego
func CString ¶
CString converts a go string to *byte that can be passed to C code. This function was copied from purego
func GFreeNullable ¶
func GFreeNullable(ptr uintptr)
GFreeNullable frees a nullable GLib-allocated pointer.
func GStrdup ¶
GStrdup allocates a C-owned copy of a Go string using g_strdup. The returned pointer must be freed with g_free by the receiver or callee.
func GStrdupNullable ¶
GStrdupNullable is like GStrdup but accepts a nullable *string.
func GetPaths ¶
GetPaths gets all shared object files from a library name and panics if no matching library can be found. TODO: Hardcode a library shared object with linker -X flag. This is useful for packaging.
func GoStringSlice ¶
GoStringSlice gets a string slice from a char** array This function was copied from purego
func NullableStringToPtr ¶
NullableStringToPtr converts a nullable Go string to a C string pointer. The caller must call runtime.KeepAlive(backing) after the C call completes.
func PtrToNullableString ¶
PtrToNullableString converts a nullable char* to a Go *string.
func PuregoSafeRegister ¶
func SetPackageName ¶
func SetPackageName(libName, pkgName string)
SetPackageName registers a pkg-config package name for a library. This is used by the code generator to set package names from GIR files. It won't override existing entries to preserve defaults.
func SetSharedLibraries ¶
SetSharedLibraries registers shared library names for a library. This is used by the code generator to set library names from GIR files. It won't override existing entries to preserve defaults.
func TryGetPaths ¶ added in v0.3.0
TryGetPaths is like GetPaths but returns an empty slice instead of panicking. Use this for optional libraries that may not be installed.
Types ¶
This section is empty.