// 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 #GSList struct is used for each element in the singly-linked // list. type SList struct { _ structs.HostLayout Data uintptr Next *SList } func (x *SList) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } var xClearSlist func(**SList, uintptr) // Clears a pointer to a #GSList, freeing it and, optionally, freeing its elements using @destroy. // // @slist_ptr must be a valid pointer. If @slist_ptr points to a null #GSList, this does nothing. func ClearSlist(SlistPtrVar **SList, 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) } } xClearSlist(SlistPtrVar, 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(&xClearSlist, libs, "g_clear_slist") }