v0.2.1 c0399be

gqsort.go RawHistoryFolder

1// Package glib was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package glib
3
4import (
5	"unsafe"
6
7	"github.com/ebitengine/purego"
8
9	"github.com/bnema/puregotk/pkg/core"
10)
11
12var xQsortWithData func(uintptr, int, uint, uintptr, uintptr)
13
14// This is just like the standard C [`qsort()`](man:qsort(3)) function, but
15// the comparison routine accepts a user data argument
16// (like [`qsort_r()`](man:qsort_r(3))).
17//
18// Unlike `qsort()`, this is guaranteed to be a stable sort (since GLib 2.32).
19func QsortWithData(PbaseVar uintptr, TotalElemsVar int, SizeVar uint, CompareFuncVar *CompareDataFunc, UserDataVar uintptr) {
20
21	var CompareFuncVarRef uintptr
22	if CompareFuncVar != nil {
23		CompareFuncVarPtr := uintptr(unsafe.Pointer(CompareFuncVar))
24		if cbRefPtr, ok := GetCallback(CompareFuncVarPtr); ok {
25			CompareFuncVarRef = cbRefPtr
26		} else {
27			fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) int {
28				cbFn := *CompareFuncVar
29				return cbFn(arg0, arg1, arg2)
30			}
31			CompareFuncVarRef = purego.NewCallback(fcb)
32			SaveCallbackWithClosure(CompareFuncVarPtr, CompareFuncVarRef, CompareFuncVar)
33		}
34	}
35
36	xQsortWithData(PbaseVar, TotalElemsVar, SizeVar, CompareFuncVarRef, UserDataVar)
37
38}
39
40var xSortArray func([]uintptr, uint, uint, uintptr, uintptr)
41
42// This is just like the standard C [`qsort()`](man:qsort(3)) function, but
43// the comparison routine accepts a user data argument
44// (like [`qsort_r()`](man:qsort_r(3))).
45//
46// Unlike `qsort()`, this is guaranteed to be a stable sort.
47func SortArray(ArrayVar []uintptr, NElementsVar uint, ElementSizeVar uint, CompareFuncVar *CompareDataFunc, UserDataVar uintptr) {
48
49	var CompareFuncVarRef uintptr
50	if CompareFuncVar != nil {
51		CompareFuncVarPtr := uintptr(unsafe.Pointer(CompareFuncVar))
52		if cbRefPtr, ok := GetCallback(CompareFuncVarPtr); ok {
53			CompareFuncVarRef = cbRefPtr
54		} else {
55			fcb := func(arg0 uintptr, arg1 uintptr, arg2 uintptr) int {
56				cbFn := *CompareFuncVar
57				return cbFn(arg0, arg1, arg2)
58			}
59			CompareFuncVarRef = purego.NewCallback(fcb)
60			SaveCallbackWithClosure(CompareFuncVarPtr, CompareFuncVarRef, CompareFuncVar)
61		}
62	}
63
64	xSortArray(ArrayVar, NElementsVar, ElementSizeVar, CompareFuncVarRef, UserDataVar)
65
66}
67
68func init() {
69	core.SetPackageName("GLIB", "glib-2.0")
70	core.SetSharedLibraries("GLIB", []string{"libgobject-2.0.so.0", "libglib-2.0.so.0"})
71	var libs []uintptr
72	for _, libPath := range core.GetPaths("GLIB") {
73		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
74		if err != nil {
75			panic(err)
76		}
77		libs = append(libs, lib)
78	}
79
80	core.PuregoSafeRegister(&xQsortWithData, libs, "g_qsort_with_data")
81	core.PuregoSafeRegister(&xSortArray, libs, "g_sort_array")
82
83}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 102

↑↓ moveenter openesc close