// 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" ) // A `GTrashStack` is an efficient way to keep a stack of unused allocated // memory chunks. Each memory chunk is required to be large enough to hold // a `gpointer`. This allows the stack to be maintained without any space // overhead, since the stack pointers can be stored inside the memory chunks. // // There is no function to create a `GTrashStack`. A `NULL` `GTrashStack*` // is a perfectly valid empty stack. // // Each piece of memory that is pushed onto the stack is cast to a // `GTrashStack*`. // // There is no longer any good reason to use `GTrashStack`. If you have // extra pieces of memory, `free()` them and allocate them again later. type TrashStack struct { _ structs.HostLayout Next *TrashStack } func (x *TrashStack) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } var xTrashStackHeight func(**TrashStack) uint // Returns the height of a #GTrashStack. // // Note that execution of this function is of O(N) complexity // where N denotes the number of items on the stack. func TrashStackHeight(StackPVar **TrashStack) uint { cret := xTrashStackHeight(StackPVar) return cret } var xTrashStackPeek func(**TrashStack) uintptr // Returns the element at the top of a #GTrashStack // which may be %NULL. func TrashStackPeek(StackPVar **TrashStack) uintptr { cret := xTrashStackPeek(StackPVar) return cret } var xTrashStackPop func(**TrashStack) uintptr // Pops a piece of memory off a #GTrashStack. func TrashStackPop(StackPVar **TrashStack) uintptr { cret := xTrashStackPop(StackPVar) return cret } var xTrashStackPush func(**TrashStack, uintptr) // Pushes a piece of memory onto a #GTrashStack. func TrashStackPush(StackPVar **TrashStack, DataPVar uintptr) { xTrashStackPush(StackPVar, DataPVar) } 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(&xTrashStackHeight, libs, "g_trash_stack_height") core.PuregoSafeRegister(&xTrashStackPeek, libs, "g_trash_stack_peek") core.PuregoSafeRegister(&xTrashStackPop, libs, "g_trash_stack_pop") core.PuregoSafeRegister(&xTrashStackPush, libs, "g_trash_stack_push") }