gdtlsserverconnection.go RawHistoryFolder
1// Package gio was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package gio
3
4import (
5 "structs"
6 "unsafe"
7
8 "github.com/ebitengine/purego"
9
10 "github.com/bnema/puregotk/pkg/core"
11 "github.com/bnema/puregotk/v4/glib"
12 "github.com/bnema/puregotk/v4/gobject/types"
13)
14
15// vtable for a #GDtlsServerConnection implementation.
16type DtlsServerConnectionInterface struct {
17 _ structs.HostLayout
18
19 GIface uintptr
20}
21
22func (x *DtlsServerConnectionInterface) GoPointer() uintptr {
23 return uintptr(unsafe.Pointer(x))
24}
25
26// `GDtlsServerConnection` is the server-side subclass of
27// [iface@Gio.DtlsConnection], representing a server-side DTLS connection.
28type DtlsServerConnection interface {
29 GoPointer() uintptr
30 SetGoPointer(uintptr)
31}
32
33var xDtlsServerConnectionGLibType func() types.GType
34
35func DtlsServerConnectionGLibType() types.GType {
36 return xDtlsServerConnectionGLibType()
37}
38
39type DtlsServerConnectionBase struct {
40 Ptr uintptr
41}
42
43func (x *DtlsServerConnectionBase) GoPointer() uintptr {
44 if x == nil {
45 return 0
46 }
47 return x.Ptr
48}
49
50func (x *DtlsServerConnectionBase) SetGoPointer(ptr uintptr) {
51 x.Ptr = ptr
52}
53
54var xDtlsServerConnectionNew func(uintptr, uintptr, **glib.Error) uintptr
55
56// Creates a new #GDtlsServerConnection wrapping @base_socket.
57func DtlsServerConnectionNew(BaseSocketVar DatagramBased, CertificateVar *TlsCertificate) (*DtlsServerConnectionBase, error) {
58 var cls *DtlsServerConnectionBase
59 var cerr *glib.Error
60
61 cret := xDtlsServerConnectionNew(BaseSocketVar.GoPointer(), CertificateVar.GoPointer(), &cerr)
62
63 if cret == 0 {
64 return nil, cerr
65 }
66 cls = &DtlsServerConnectionBase{}
67 cls.Ptr = cret
68 if cerr == nil {
69 return cls, nil
70 }
71 return cls, cerr
72
73}
74
75func init() {
76 core.SetPackageName("GIO", "gio-2.0")
77 core.SetSharedLibraries("GIO", []string{"libgio-2.0.so.0"})
78 var libs []uintptr
79 for _, libPath := range core.GetPaths("GIO") {
80 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
81 if err != nil {
82 panic(err)
83 }
84 libs = append(libs, lib)
85 }
86
87 core.PuregoSafeRegister(&xDtlsServerConnectionNew, libs, "g_dtls_server_connection_new")
88
89 core.PuregoSafeRegister(&xDtlsServerConnectionGLibType, libs, "g_dtls_server_connection_get_type")
90
91}