package gextras
import "github.com/diamondburned/gotk4/pkg/core/gextras"
Package gextras contains supplemental types to gotk3.
Index ¶
- Variables
- func HashTableSize(ptr unsafe.Pointer) int
- func ListSize(ptr unsafe.Pointer) int
- func MoveHashTable(ptr unsafe.Pointer, rm bool, f func(k, v unsafe.Pointer))
- func MoveList(ptr unsafe.Pointer, rm bool, f func(v unsafe.Pointer))
- func MoveSList(ptr unsafe.Pointer, rm bool, f func(v unsafe.Pointer))
- func NewStructNative(native unsafe.Pointer) unsafe.Pointer
- func SListSize(ptr unsafe.Pointer) int
- func SetStructNative(dst, native unsafe.Pointer)
- func StructIntern(ptr unsafe.Pointer) *struct{ C unsafe.Pointer }
- func StructNative(ptr unsafe.Pointer) unsafe.Pointer
Variables ¶
ZeroString points to a null-terminated string of length 0.
Functions ¶
func HashTableSize ¶
HashTableSize returns the size of the *GHashTable.
func ListSize ¶
ListSize returns the length of the list.
func MoveHashTable ¶
MoveHashTable calls f on every value of the given *GHashTable and frees each element in the process if rm is true.
func MoveList ¶
MoveList calls f on every value of the given *GList. If rm is true, then the GList is freed.
func MoveSList ¶
MoveSList is similar to MoveList, except it's used for singly-linked lists.
func NewStructNative ¶
NewStructNative creates a new Go struct from the given native pointer. The finalizer is NOT set.
func SListSize ¶
SListSize returns the length of the singly-linked list.
func SetStructNative ¶
SetStructNative sets the native value inside the Go struct value that the given dst pointer points to. It can be used like so:
var rec Record SetStructNative(&rec, cvalue) // T(cvalue) = *namespace_record
func StructIntern ¶
StructIntern returns the given struct's internal struct pointer.
func StructNative ¶
StructNative returns the underlying C pointer of the given Go record struct pointer. It can be used like so:
rec := NewRecord(...) // T = *Record c := (*namespace_record)(StructPtr(unsafe.Pointer(rec)))
Source Files ¶
- Version
- v0.3.1 (latest)
- Published
- Jul 31, 2024
- Platform
- linux/amd64
- Imports
- 2 packages
- Last checked
- 3 weeks ago –
Tools for package owners.