gextras

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2024 License: MPL-2.0, ISC Imports: 2 Imported by: 38

Documentation

Overview

Package gextras contains supplemental types to gotk3.

Index

Constants

This section is empty.

Variables

View Source
var ZeroString unsafe.Pointer

ZeroString points to a null-terminated string of length 0.

Functions

func HashTableSize

func HashTableSize(ptr unsafe.Pointer) int

HashTableSize returns the size of the *GHashTable.

func ListSize

func ListSize(ptr unsafe.Pointer) int

ListSize returns the length of the list.

func MoveHashTable

func MoveHashTable(ptr unsafe.Pointer, rm bool, f func(k, v unsafe.Pointer))

MoveHashTable calls f on every value of the given *GHashTable and frees each element in the process if rm is true.

func MoveList

func MoveList(ptr unsafe.Pointer, rm bool, f func(v unsafe.Pointer))

MoveList calls f on every value of the given *GList. If rm is true, then the GList is freed.

func MoveSList

func MoveSList(ptr unsafe.Pointer, rm bool, f func(v unsafe.Pointer))

MoveSList is similar to MoveList, except it's used for singly-linked lists.

func NewStructNative

func NewStructNative(native unsafe.Pointer) unsafe.Pointer

NewStructNative creates a new Go struct from the given native pointer. The finalizer is NOT set.

func SListSize

func SListSize(ptr unsafe.Pointer) int

SListSize returns the length of the singly-linked list.

func SetStructNative

func SetStructNative(dst, native unsafe.Pointer)

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

func StructIntern(ptr unsafe.Pointer) *struct{ C unsafe.Pointer }

StructIntern returns the given struct's internal struct pointer.

func StructNative

func StructNative(ptr unsafe.Pointer) unsafe.Pointer

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)))

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL