v0.2.1 c0399be

gslice.go RawHistoryFolder

1// Package glib was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package glib
3
4import (
5	"github.com/ebitengine/purego"
6
7	"github.com/bnema/puregotk/pkg/core"
8)
9
10type SliceConfig int
11
12const (
13	GSliceConfigAlwaysMallocValue SliceConfig = 1
14
15	GSliceConfigBypassMagazinesValue SliceConfig = 2
16
17	GSliceConfigWorkingSetMsecsValue SliceConfig = 3
18
19	GSliceConfigColorIncrementValue SliceConfig = 4
20
21	GSliceConfigChunkSizesValue SliceConfig = 5
22
23	GSliceConfigContentionCounterValue SliceConfig = 6
24)
25
26var xSliceAlloc func(uint) uintptr
27
28// Allocates a block of memory from the libc allocator.
29//
30// The block address handed out can be expected to be aligned
31// to at least `1 * sizeof (void*)`.
32//
33// Since GLib 2.76 this always uses the system malloc() implementation
34// internally.
35func SliceAlloc(BlockSizeVar uint) uintptr {
36
37	cret := xSliceAlloc(BlockSizeVar)
38
39	return cret
40}
41
42var xSliceAlloc0 func(uint) uintptr
43
44// Allocates a block of memory via g_slice_alloc() and initializes
45// the returned memory to 0.
46//
47// Since GLib 2.76 this always uses the system malloc() implementation
48// internally.
49func SliceAlloc0(BlockSizeVar uint) uintptr {
50
51	cret := xSliceAlloc0(BlockSizeVar)
52
53	return cret
54}
55
56var xSliceCopy func(uint, uintptr) uintptr
57
58// Allocates a block of memory from the slice allocator
59// and copies @block_size bytes into it from @mem_block.
60//
61// @mem_block must be non-%NULL if @block_size is non-zero.
62//
63// Since GLib 2.76 this always uses the system malloc() implementation
64// internally.
65func SliceCopy(BlockSizeVar uint, MemBlockVar uintptr) uintptr {
66
67	cret := xSliceCopy(BlockSizeVar, MemBlockVar)
68
69	return cret
70}
71
72var xSliceFree1 func(uint, uintptr)
73
74// Frees a block of memory.
75//
76// The memory must have been allocated via g_slice_alloc() or
77// g_slice_alloc0() and the @block_size has to match the size
78// specified upon allocation. Note that the exact release behaviour
79// can be changed with the [`G_DEBUG=gc-friendly`](running.html#environment-variables) environment
80// variable.
81//
82// If @mem_block is %NULL, this function does nothing.
83//
84// Since GLib 2.76 this always uses the system free_sized() implementation
85// internally.
86func SliceFree1(BlockSizeVar uint, MemBlockVar uintptr) {
87
88	xSliceFree1(BlockSizeVar, MemBlockVar)
89
90}
91
92var xSliceFreeChainWithOffset func(uint, uintptr, uint)
93
94// Frees a linked list of memory blocks of structure type @type.
95//
96// The memory blocks must be equal-sized, allocated via
97// g_slice_alloc() or g_slice_alloc0() and linked together by a
98// @next pointer (similar to #GSList). The offset of the @next
99// field in each block is passed as third argument.
100// Note that the exact release behaviour can be changed with the
101// [`G_DEBUG=gc-friendly`](running.html#environment-variables) environment variable.
102//
103// If @mem_chain is %NULL, this function does nothing.
104//
105// Since GLib 2.76 this always uses the system free_sized() implementation
106// internally.
107func SliceFreeChainWithOffset(BlockSizeVar uint, MemChainVar uintptr, NextOffsetVar uint) {
108
109	xSliceFreeChainWithOffset(BlockSizeVar, MemChainVar, NextOffsetVar)
110
111}
112
113var xSliceGetConfig func(SliceConfig) int64
114
115func SliceGetConfig(CkeyVar SliceConfig) int64 {
116
117	cret := xSliceGetConfig(CkeyVar)
118
119	return cret
120}
121
122var xSliceGetConfigState func(SliceConfig, int64, uint) int64
123
124func SliceGetConfigState(CkeyVar SliceConfig, AddressVar int64, NValuesVar uint) int64 {
125
126	cret := xSliceGetConfigState(CkeyVar, AddressVar, NValuesVar)
127
128	return cret
129}
130
131var xSliceSetConfig func(SliceConfig, int64)
132
133func SliceSetConfig(CkeyVar SliceConfig, ValueVar int64) {
134
135	xSliceSetConfig(CkeyVar, ValueVar)
136
137}
138
139func init() {
140	core.SetPackageName("GLIB", "glib-2.0")
141	core.SetSharedLibraries("GLIB", []string{"libgobject-2.0.so.0", "libglib-2.0.so.0"})
142	var libs []uintptr
143	for _, libPath := range core.GetPaths("GLIB") {
144		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
145		if err != nil {
146			panic(err)
147		}
148		libs = append(libs, lib)
149	}
150
151	core.PuregoSafeRegister(&xSliceAlloc, libs, "g_slice_alloc")
152	core.PuregoSafeRegister(&xSliceAlloc0, libs, "g_slice_alloc0")
153	core.PuregoSafeRegister(&xSliceCopy, libs, "g_slice_copy")
154	core.PuregoSafeRegister(&xSliceFree1, libs, "g_slice_free1")
155	core.PuregoSafeRegister(&xSliceFreeChainWithOffset, libs, "g_slice_free_chain_with_offset")
156	core.PuregoSafeRegister(&xSliceGetConfig, libs, "g_slice_get_config")
157	core.PuregoSafeRegister(&xSliceGetConfigState, libs, "g_slice_get_config_state")
158	core.PuregoSafeRegister(&xSliceSetConfig, libs, "g_slice_set_config")
159
160}

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