// Package gio was automatically generated by github.com/bnema/puregotk DO NOT EDIT package gio import ( "structs" "unsafe" "github.com/ebitengine/purego" "github.com/bnema/puregotk/pkg/core" "github.com/bnema/puregotk/v4/gobject" "github.com/bnema/puregotk/v4/gobject/types" ) type InetSocketAddressClass struct { _ structs.HostLayout ParentClass SocketAddressClass } func (x *InetSocketAddressClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } type InetSocketAddressPrivate struct { _ structs.HostLayout } func (x *InetSocketAddressPrivate) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // An IPv4 or IPv6 socket address. That is, the combination of a // [class@Gio.InetAddress] and a port number. // // In UNIX terms, `GInetSocketAddress` corresponds to a // [`struct sockaddr_in` or `struct sockaddr_in6`](man:sockaddr(3type)). type InetSocketAddress struct { SocketAddress } var xInetSocketAddressGLibType func() types.GType func InetSocketAddressGLibType() types.GType { return xInetSocketAddressGLibType() } func InetSocketAddressNewFromInternalPtr(ptr uintptr) *InetSocketAddress { cls := &InetSocketAddress{} cls.Ptr = ptr return cls } var xNewInetSocketAddress func(uintptr, uint16) uintptr // Creates a new #GInetSocketAddress for @address and @port. func NewInetSocketAddress(AddressVar *InetAddress, PortVar uint16) *InetSocketAddress { var cls *InetSocketAddress cret := xNewInetSocketAddress(AddressVar.GoPointer(), PortVar) if cret == 0 { return nil } cls = &InetSocketAddress{} cls.Ptr = cret return cls } var xNewInetSocketAddressFromString func(string, uint) uintptr // Creates a new #GInetSocketAddress for @address and @port. // // If @address is an IPv6 address, it can also contain a scope ID // (separated from the address by a `%`). Note that currently this // behavior is platform specific. This may change in a future release. func NewInetSocketAddressFromString(AddressVar string, PortVar uint) *InetSocketAddress { var cls *InetSocketAddress cret := xNewInetSocketAddressFromString(AddressVar, PortVar) if cret == 0 { return nil } cls = &InetSocketAddress{} cls.Ptr = cret return cls } var xInetSocketAddressGetAddress func(uintptr) uintptr // Gets @address's #GInetAddress. func (x *InetSocketAddress) GetAddress() *InetAddress { var cls *InetAddress cret := xInetSocketAddressGetAddress(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &InetAddress{} cls.Ptr = cret return cls } var xInetSocketAddressGetFlowinfo func(uintptr) uint32 // Gets the `sin6_flowinfo` field from @address, // which must be an IPv6 address. // // If not overridden this value will be inherited from [property@Gio.InetSocketAddress:address]. func (x *InetSocketAddress) GetFlowinfo() uint32 { cret := xInetSocketAddressGetFlowinfo(x.GoPointer()) return cret } var xInetSocketAddressGetPort func(uintptr) uint16 // Gets @address's port. func (x *InetSocketAddress) GetPort() uint16 { cret := xInetSocketAddressGetPort(x.GoPointer()) return cret } var xInetSocketAddressGetScopeId func(uintptr) uint32 // Gets the `sin6_scope_id` field from @address, // which must be an IPv6 address. // // If not overridden this value will be inherited from [property@Gio.InetSocketAddress:address]. func (x *InetSocketAddress) GetScopeId() uint32 { cret := xInetSocketAddressGetScopeId(x.GoPointer()) return cret } func (c *InetSocketAddress) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *InetSocketAddress) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // SetPropertyFlowinfo sets the "flowinfo" property. // The `sin6_flowinfo` field, for IPv6 addresses. // // If unset this property is inherited from [property@Gio.InetSocketAddress:address]. func (x *InetSocketAddress) SetPropertyFlowinfo(value uint) { var v gobject.Value v.Init(gobject.TypeUintVal) v.SetUint(value) x.SetProperty("flowinfo", &v) } // GetPropertyFlowinfo gets the "flowinfo" property. // The `sin6_flowinfo` field, for IPv6 addresses. // // If unset this property is inherited from [property@Gio.InetSocketAddress:address]. func (x *InetSocketAddress) GetPropertyFlowinfo() uint { var v gobject.Value x.GetProperty("flowinfo", &v) return v.GetUint() } // SetPropertyPort sets the "port" property. // The port. func (x *InetSocketAddress) SetPropertyPort(value uint) { var v gobject.Value v.Init(gobject.TypeUintVal) v.SetUint(value) x.SetProperty("port", &v) } // GetPropertyPort gets the "port" property. // The port. func (x *InetSocketAddress) GetPropertyPort() uint { var v gobject.Value x.GetProperty("port", &v) return v.GetUint() } // SetPropertyScopeId sets the "scope-id" property. // The `sin6_scope_id` field, for IPv6 addresses. // // If unset this property is inherited from [property@Gio.InetSocketAddress:address]. func (x *InetSocketAddress) SetPropertyScopeId(value uint) { var v gobject.Value v.Init(gobject.TypeUintVal) v.SetUint(value) x.SetProperty("scope-id", &v) } // GetPropertyScopeId gets the "scope-id" property. // The `sin6_scope_id` field, for IPv6 addresses. // // If unset this property is inherited from [property@Gio.InetSocketAddress:address]. func (x *InetSocketAddress) GetPropertyScopeId() uint { var v gobject.Value x.GetProperty("scope-id", &v) return v.GetUint() } // Creates a #GSocketAddressEnumerator for @connectable. func (x *InetSocketAddress) Enumerate() *SocketAddressEnumerator { var cls *SocketAddressEnumerator cret := XGSocketConnectableEnumerate(x.GoPointer()) if cret == 0 { return nil } cls = &SocketAddressEnumerator{} cls.Ptr = cret return cls } // Creates a #GSocketAddressEnumerator for @connectable that will // return a #GProxyAddress for each of its addresses that you must connect // to via a proxy. // // If @connectable does not implement // g_socket_connectable_proxy_enumerate(), this will fall back to // calling g_socket_connectable_enumerate(). func (x *InetSocketAddress) ProxyEnumerate() *SocketAddressEnumerator { var cls *SocketAddressEnumerator cret := XGSocketConnectableProxyEnumerate(x.GoPointer()) if cret == 0 { return nil } cls = &SocketAddressEnumerator{} cls.Ptr = cret return cls } // Format a #GSocketConnectable as a string. This is a human-readable format for // use in debugging output, and is not a stable serialization format. It is not // suitable for use in user interfaces as it exposes too much information for a // user. // // If the #GSocketConnectable implementation does not support string formatting, // the implementation’s type name will be returned as a fallback. func (x *InetSocketAddress) ToString() string { cret := XGSocketConnectableToString(x.GoPointer()) return cret } func init() { core.SetPackageName("GIO", "gio-2.0") core.SetSharedLibraries("GIO", []string{"libgio-2.0.so.0"}) var libs []uintptr for _, libPath := range core.GetPaths("GIO") { lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) if err != nil { panic(err) } libs = append(libs, lib) } core.PuregoSafeRegister(&xInetSocketAddressGLibType, libs, "g_inet_socket_address_get_type") core.PuregoSafeRegister(&xNewInetSocketAddress, libs, "g_inet_socket_address_new") core.PuregoSafeRegister(&xNewInetSocketAddressFromString, libs, "g_inet_socket_address_new_from_string") core.PuregoSafeRegister(&xInetSocketAddressGetAddress, libs, "g_inet_socket_address_get_address") core.PuregoSafeRegister(&xInetSocketAddressGetFlowinfo, libs, "g_inet_socket_address_get_flowinfo") core.PuregoSafeRegister(&xInetSocketAddressGetPort, libs, "g_inet_socket_address_get_port") core.PuregoSafeRegister(&xInetSocketAddressGetScopeId, libs, "g_inet_socket_address_get_scope_id") }