// Package glib was automatically generated by github.com/bnema/puregotk DO NOT EDIT package glib import ( "structs" "unsafe" "github.com/ebitengine/purego" "github.com/bnema/puregotk/pkg/core" ) // The #GList struct is used for each element in a doubly-linked list. type List struct { _ structs.HostLayout Data uintptr Next *List Prev *List } func (x *List) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } var xClearList func(**List, uintptr) // Clears a pointer to a #GList, freeing it and, optionally, freeing its elements using @destroy. // // @list_ptr must be a valid pointer. If @list_ptr points to a null #GList, this does nothing. func ClearList(ListPtrVar **List, DestroyVar *DestroyNotify) { var DestroyVarRef uintptr if DestroyVar != nil { DestroyVarPtr := uintptr(unsafe.Pointer(DestroyVar)) if cbRefPtr, ok := GetCallback(DestroyVarPtr); ok { DestroyVarRef = cbRefPtr } else { fcb := func(arg0 uintptr) { cbFn := *DestroyVar cbFn(arg0) } DestroyVarRef = purego.NewCallback(fcb) SaveCallbackWithClosure(DestroyVarPtr, DestroyVarRef, DestroyVar) } } xClearList(ListPtrVar, DestroyVarRef) } func init() { core.SetPackageName("GLIB", "glib-2.0") core.SetSharedLibraries("GLIB", []string{"libgobject-2.0.so.0", "libglib-2.0.so.0"}) var libs []uintptr for _, libPath := range core.GetPaths("GLIB") { lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) if err != nil { panic(err) } libs = append(libs, lib) } core.PuregoSafeRegister(&xClearList, libs, "g_clear_list") }