{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Objects.InetAddressMask
(
InetAddressMask(..) ,
IsInetAddressMask ,
toInetAddressMask ,
#if defined(ENABLE_OVERLOADING)
ResolveInetAddressMaskMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
InetAddressMaskEqualMethodInfo ,
#endif
inetAddressMaskEqual ,
#if defined(ENABLE_OVERLOADING)
InetAddressMaskGetAddressMethodInfo ,
#endif
inetAddressMaskGetAddress ,
#if defined(ENABLE_OVERLOADING)
InetAddressMaskGetFamilyMethodInfo ,
#endif
inetAddressMaskGetFamily ,
#if defined(ENABLE_OVERLOADING)
InetAddressMaskGetLengthMethodInfo ,
#endif
inetAddressMaskGetLength ,
#if defined(ENABLE_OVERLOADING)
InetAddressMaskMatchesMethodInfo ,
#endif
inetAddressMaskMatches ,
inetAddressMaskNew ,
inetAddressMaskNewFromString ,
#if defined(ENABLE_OVERLOADING)
InetAddressMaskToStringMethodInfo ,
#endif
inetAddressMaskToString ,
#if defined(ENABLE_OVERLOADING)
InetAddressMaskAddressPropertyInfo ,
#endif
clearInetAddressMaskAddress ,
constructInetAddressMaskAddress ,
getInetAddressMaskAddress ,
#if defined(ENABLE_OVERLOADING)
inetAddressMaskAddress ,
#endif
setInetAddressMaskAddress ,
#if defined(ENABLE_OVERLOADING)
InetAddressMaskFamilyPropertyInfo ,
#endif
getInetAddressMaskFamily ,
#if defined(ENABLE_OVERLOADING)
inetAddressMaskFamily ,
#endif
#if defined(ENABLE_OVERLOADING)
InetAddressMaskLengthPropertyInfo ,
#endif
constructInetAddressMaskLength ,
getInetAddressMaskLength ,
#if defined(ENABLE_OVERLOADING)
inetAddressMaskLength ,
#endif
setInetAddressMaskLength ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R
import qualified Data.Word as DW
import qualified Data.Int as DI
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT
#if MIN_VERSION_base(4,18,0)
import qualified GI.GLib.Callbacks as GLib.Callbacks
import qualified GI.GLib.Structs.PollFD as GLib.PollFD
import qualified GI.GLib.Structs.Source as GLib.Source
import qualified GI.GObject.Callbacks as GObject.Callbacks
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.GObject.Structs.Parameter as GObject.Parameter
import {-# SOURCE #-} qualified GI.Gio.Enums as Gio.Enums
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Initable as Gio.Initable
import {-# SOURCE #-} qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import {-# SOURCE #-} qualified GI.Gio.Objects.InetAddress as Gio.InetAddress
#else
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gio.Enums as Gio.Enums
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Initable as Gio.Initable
import {-# SOURCE #-} qualified GI.Gio.Objects.InetAddress as Gio.InetAddress
#endif
newtype InetAddressMask = InetAddressMask (SP.ManagedPtr InetAddressMask)
deriving (InetAddressMask -> InetAddressMask -> Bool
(InetAddressMask -> InetAddressMask -> Bool)
-> (InetAddressMask -> InetAddressMask -> Bool)
-> Eq InetAddressMask
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: InetAddressMask -> InetAddressMask -> Bool
== :: InetAddressMask -> InetAddressMask -> Bool
$c/= :: InetAddressMask -> InetAddressMask -> Bool
/= :: InetAddressMask -> InetAddressMask -> Bool
Eq)
instance SP.ManagedPtrNewtype InetAddressMask where
toManagedPtr :: InetAddressMask -> ManagedPtr InetAddressMask
toManagedPtr (InetAddressMask ManagedPtr InetAddressMask
p) = ManagedPtr InetAddressMask
p
foreign import ccall "g_inet_address_mask_get_type"
c_g_inet_address_mask_get_type :: IO B.Types.GType
instance B.Types.TypedObject InetAddressMask where
glibType :: IO GType
glibType = IO GType
c_g_inet_address_mask_get_type
instance B.Types.GObject InetAddressMask
class (SP.GObject o, O.IsDescendantOf InetAddressMask o) => IsInetAddressMask o
instance (SP.GObject o, O.IsDescendantOf InetAddressMask o) => IsInetAddressMask o
instance O.HasParentTypes InetAddressMask
type instance O.ParentTypes InetAddressMask = '[GObject.Object.Object, Gio.Initable.Initable]
toInetAddressMask :: (MIO.MonadIO m, IsInetAddressMask o) => o -> m InetAddressMask
toInetAddressMask :: forall (m :: * -> *) o.
(MonadIO m, IsInetAddressMask o) =>
o -> m InetAddressMask
toInetAddressMask = IO InetAddressMask -> m InetAddressMask
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO InetAddressMask -> m InetAddressMask)
-> (o -> IO InetAddressMask) -> o -> m InetAddressMask
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr InetAddressMask -> InetAddressMask)
-> o -> IO InetAddressMask
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr InetAddressMask -> InetAddressMask
InetAddressMask
instance B.GValue.IsGValue (Maybe InetAddressMask) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_g_inet_address_mask_get_type
gvalueSet_ :: Ptr GValue -> Maybe InetAddressMask -> IO ()
gvalueSet_ Ptr GValue
gv Maybe InetAddressMask
P.Nothing = Ptr GValue -> Ptr InetAddressMask -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr InetAddressMask
forall a. Ptr a
FP.nullPtr :: FP.Ptr InetAddressMask)
gvalueSet_ Ptr GValue
gv (P.Just InetAddressMask
obj) = InetAddressMask -> (Ptr InetAddressMask -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr InetAddressMask
obj (Ptr GValue -> Ptr InetAddressMask -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe InetAddressMask)
gvalueGet_ Ptr GValue
gv = do
ptr <- Ptr GValue -> IO (Ptr InetAddressMask)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr InetAddressMask)
if ptr /= FP.nullPtr
then P.Just <$> B.ManagedPtr.newObject InetAddressMask ptr
else return P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveInetAddressMaskMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveInetAddressMaskMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveInetAddressMaskMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveInetAddressMaskMethod "equal" o = InetAddressMaskEqualMethodInfo
ResolveInetAddressMaskMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveInetAddressMaskMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveInetAddressMaskMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveInetAddressMaskMethod "init" o = Gio.Initable.InitableInitMethodInfo
ResolveInetAddressMaskMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveInetAddressMaskMethod "matches" o = InetAddressMaskMatchesMethodInfo
ResolveInetAddressMaskMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveInetAddressMaskMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveInetAddressMaskMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveInetAddressMaskMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveInetAddressMaskMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveInetAddressMaskMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveInetAddressMaskMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveInetAddressMaskMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveInetAddressMaskMethod "toString" o = InetAddressMaskToStringMethodInfo
ResolveInetAddressMaskMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveInetAddressMaskMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveInetAddressMaskMethod "getAddress" o = InetAddressMaskGetAddressMethodInfo
ResolveInetAddressMaskMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveInetAddressMaskMethod "getFamily" o = InetAddressMaskGetFamilyMethodInfo
ResolveInetAddressMaskMethod "getLength" o = InetAddressMaskGetLengthMethodInfo
ResolveInetAddressMaskMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveInetAddressMaskMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveInetAddressMaskMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveInetAddressMaskMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveInetAddressMaskMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveInetAddressMaskMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveInetAddressMaskMethod t InetAddressMask, O.OverloadedMethod info InetAddressMask p) => OL.IsLabel t (InetAddressMask -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveInetAddressMaskMethod t InetAddressMask, O.OverloadedMethod info InetAddressMask p, R.HasField t InetAddressMask p) => R.HasField t InetAddressMask p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveInetAddressMaskMethod t InetAddressMask, O.OverloadedMethodInfo info InetAddressMask) => OL.IsLabel t (O.MethodProxy info InetAddressMask) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
getInetAddressMaskAddress :: (MonadIO m, IsInetAddressMask o) => o -> m Gio.InetAddress.InetAddress
getInetAddressMaskAddress :: forall (m :: * -> *) o.
(MonadIO m, IsInetAddressMask o) =>
o -> m InetAddress
getInetAddressMaskAddress o
obj = IO InetAddress -> m InetAddress
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO InetAddress -> m InetAddress)
-> IO InetAddress -> m InetAddress
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe InetAddress) -> IO InetAddress
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getInetAddressMaskAddress" (IO (Maybe InetAddress) -> IO InetAddress)
-> IO (Maybe InetAddress) -> IO InetAddress
forall a b. (a -> b) -> a -> b
$ o
-> String
-> (ManagedPtr InetAddress -> InetAddress)
-> IO (Maybe InetAddress)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"address" ManagedPtr InetAddress -> InetAddress
Gio.InetAddress.InetAddress
setInetAddressMaskAddress :: (MonadIO m, IsInetAddressMask o, Gio.InetAddress.IsInetAddress a) => o -> a -> m ()
setInetAddressMaskAddress :: forall (m :: * -> *) o a.
(MonadIO m, IsInetAddressMask o, IsInetAddress a) =>
o -> a -> m ()
setInetAddressMaskAddress o
obj a
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
o -> String -> Maybe a -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj String
"address" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)
constructInetAddressMaskAddress :: (IsInetAddressMask o, MIO.MonadIO m, Gio.InetAddress.IsInetAddress a) => a -> m (GValueConstruct o)
constructInetAddressMaskAddress :: forall o (m :: * -> *) a.
(IsInetAddressMask o, MonadIO m, IsInetAddress a) =>
a -> m (GValueConstruct o)
constructInetAddressMaskAddress a
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"address" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)
clearInetAddressMaskAddress :: (MonadIO m, IsInetAddressMask o) => o -> m ()
clearInetAddressMaskAddress :: forall (m :: * -> *) o.
(MonadIO m, IsInetAddressMask o) =>
o -> m ()
clearInetAddressMaskAddress o
obj = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe InetAddress -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj String
"address" (Maybe InetAddress
forall a. Maybe a
Nothing :: Maybe Gio.InetAddress.InetAddress)
#if defined(ENABLE_OVERLOADING)
data InetAddressMaskAddressPropertyInfo
instance AttrInfo InetAddressMaskAddressPropertyInfo where
type AttrAllowedOps InetAddressMaskAddressPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint InetAddressMaskAddressPropertyInfo = IsInetAddressMask
type AttrSetTypeConstraint InetAddressMaskAddressPropertyInfo = Gio.InetAddress.IsInetAddress
type AttrTransferTypeConstraint InetAddressMaskAddressPropertyInfo = Gio.InetAddress.IsInetAddress
type AttrTransferType InetAddressMaskAddressPropertyInfo = Gio.InetAddress.InetAddress
type AttrGetType InetAddressMaskAddressPropertyInfo = Gio.InetAddress.InetAddress
type AttrLabel InetAddressMaskAddressPropertyInfo = "address"
type AttrOrigin InetAddressMaskAddressPropertyInfo = InetAddressMask
attrGet = getInetAddressMaskAddress
attrSet = setInetAddressMaskAddress
attrTransfer _ v = do
unsafeCastTo Gio.InetAddress.InetAddress v
attrConstruct = constructInetAddressMaskAddress
attrClear = clearInetAddressMaskAddress
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.InetAddressMask.address"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-InetAddressMask.html#g:attr:address"
})
#endif
getInetAddressMaskFamily :: (MonadIO m, IsInetAddressMask o) => o -> m Gio.Enums.SocketFamily
getInetAddressMaskFamily :: forall (m :: * -> *) o.
(MonadIO m, IsInetAddressMask o) =>
o -> m SocketFamily
getInetAddressMaskFamily o
obj = IO SocketFamily -> m SocketFamily
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO SocketFamily -> m SocketFamily)
-> IO SocketFamily -> m SocketFamily
forall a b. (a -> b) -> a -> b
$ o -> String -> IO SocketFamily
forall a b. (GObject a, Enum b, BoxedEnum b) => a -> String -> IO b
B.Properties.getObjectPropertyEnum o
obj String
"family"
#if defined(ENABLE_OVERLOADING)
data InetAddressMaskFamilyPropertyInfo
instance AttrInfo InetAddressMaskFamilyPropertyInfo where
type AttrAllowedOps InetAddressMaskFamilyPropertyInfo = '[ 'AttrGet]
type AttrBaseTypeConstraint InetAddressMaskFamilyPropertyInfo = IsInetAddressMask
type AttrSetTypeConstraint InetAddressMaskFamilyPropertyInfo = (~) ()
type AttrTransferTypeConstraint InetAddressMaskFamilyPropertyInfo = (~) ()
type AttrTransferType InetAddressMaskFamilyPropertyInfo = ()
type AttrGetType InetAddressMaskFamilyPropertyInfo = Gio.Enums.SocketFamily
type AttrLabel InetAddressMaskFamilyPropertyInfo = "family"
type AttrOrigin InetAddressMaskFamilyPropertyInfo = InetAddressMask
attrGet = getInetAddressMaskFamily
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.InetAddressMask.family"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-InetAddressMask.html#g:attr:family"
})
#endif
getInetAddressMaskLength :: (MonadIO m, IsInetAddressMask o) => o -> m Word32
getInetAddressMaskLength :: forall (m :: * -> *) o.
(MonadIO m, IsInetAddressMask o) =>
o -> m Word32
getInetAddressMaskLength o
obj = IO Word32 -> m Word32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Word32
forall a. GObject a => a -> String -> IO Word32
B.Properties.getObjectPropertyUInt32 o
obj String
"length"
setInetAddressMaskLength :: (MonadIO m, IsInetAddressMask o) => o -> Word32 -> m ()
setInetAddressMaskLength :: forall (m :: * -> *) o.
(MonadIO m, IsInetAddressMask o) =>
o -> Word32 -> m ()
setInetAddressMaskLength o
obj Word32
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
o -> String -> Word32 -> IO ()
forall a. GObject a => a -> String -> Word32 -> IO ()
B.Properties.setObjectPropertyUInt32 o
obj String
"length" Word32
val
constructInetAddressMaskLength :: (IsInetAddressMask o, MIO.MonadIO m) => Word32 -> m (GValueConstruct o)
constructInetAddressMaskLength :: forall o (m :: * -> *).
(IsInetAddressMask o, MonadIO m) =>
Word32 -> m (GValueConstruct o)
constructInetAddressMaskLength Word32
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Word32 -> IO (GValueConstruct o)
forall o. String -> Word32 -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyUInt32 String
"length" Word32
val
#if defined(ENABLE_OVERLOADING)
data InetAddressMaskLengthPropertyInfo
instance AttrInfo InetAddressMaskLengthPropertyInfo where
type AttrAllowedOps InetAddressMaskLengthPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint InetAddressMaskLengthPropertyInfo = IsInetAddressMask
type AttrSetTypeConstraint InetAddressMaskLengthPropertyInfo = (~) Word32
type AttrTransferTypeConstraint InetAddressMaskLengthPropertyInfo = (~) Word32
type AttrTransferType InetAddressMaskLengthPropertyInfo = Word32
type AttrGetType InetAddressMaskLengthPropertyInfo = Word32
type AttrLabel InetAddressMaskLengthPropertyInfo = "length"
type AttrOrigin InetAddressMaskLengthPropertyInfo = InetAddressMask
attrGet = getInetAddressMaskLength
attrSet = setInetAddressMaskLength
attrTransfer _ v = do
return v
attrConstruct = constructInetAddressMaskLength
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.InetAddressMask.length"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-InetAddressMask.html#g:attr:length"
})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList InetAddressMask
type instance O.AttributeList InetAddressMask = InetAddressMaskAttributeList
type InetAddressMaskAttributeList = ('[ '("address", InetAddressMaskAddressPropertyInfo), '("family", InetAddressMaskFamilyPropertyInfo), '("length", InetAddressMaskLengthPropertyInfo)] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
inetAddressMaskAddress :: AttrLabelProxy "address"
inetAddressMaskAddress = AttrLabelProxy
inetAddressMaskFamily :: AttrLabelProxy "family"
inetAddressMaskFamily = AttrLabelProxy
inetAddressMaskLength :: AttrLabelProxy "length"
inetAddressMaskLength = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList InetAddressMask = InetAddressMaskSignalList
type InetAddressMaskSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "g_inet_address_mask_new" g_inet_address_mask_new ::
Ptr Gio.InetAddress.InetAddress ->
Word32 ->
Ptr (Ptr GError) ->
IO (Ptr InetAddressMask)
inetAddressMaskNew ::
(B.CallStack.HasCallStack, MonadIO m, Gio.InetAddress.IsInetAddress a) =>
a
-> Word32
-> m InetAddressMask
inetAddressMaskNew :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsInetAddress a) =>
a -> Word32 -> m InetAddressMask
inetAddressMaskNew a
addr Word32
length_ = IO InetAddressMask -> m InetAddressMask
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO InetAddressMask -> m InetAddressMask)
-> IO InetAddressMask -> m InetAddressMask
forall a b. (a -> b) -> a -> b
$ do
addr' <- a -> IO (Ptr InetAddress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
addr
onException (do
result <- propagateGError $ g_inet_address_mask_new addr' length_
checkUnexpectedReturnNULL "inetAddressMaskNew" result
result' <- (wrapObject InetAddressMask) result
touchManagedPtr addr
return result'
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_inet_address_mask_new_from_string" g_inet_address_mask_new_from_string ::
CString ->
Ptr (Ptr GError) ->
IO (Ptr InetAddressMask)
inetAddressMaskNewFromString ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m InetAddressMask
inetAddressMaskNewFromString :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> m InetAddressMask
inetAddressMaskNewFromString Text
maskString = IO InetAddressMask -> m InetAddressMask
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO InetAddressMask -> m InetAddressMask)
-> IO InetAddressMask -> m InetAddressMask
forall a b. (a -> b) -> a -> b
$ do
maskString' <- Text -> IO CString
textToCString Text
maskString
onException (do
result <- propagateGError $ g_inet_address_mask_new_from_string maskString'
checkUnexpectedReturnNULL "inetAddressMaskNewFromString" result
result' <- (wrapObject InetAddressMask) result
freeMem maskString'
return result'
) (do
freeMem maskString'
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_inet_address_mask_equal" g_inet_address_mask_equal ::
Ptr InetAddressMask ->
Ptr InetAddressMask ->
IO CInt
inetAddressMaskEqual ::
(B.CallStack.HasCallStack, MonadIO m, IsInetAddressMask a, IsInetAddressMask b) =>
a
-> b
-> m Bool
inetAddressMaskEqual :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsInetAddressMask a,
IsInetAddressMask b) =>
a -> b -> m Bool
inetAddressMaskEqual a
mask b
mask2 = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
mask' <- a -> IO (Ptr InetAddressMask)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mask
mask2' <- unsafeManagedPtrCastPtr mask2
result <- g_inet_address_mask_equal mask' mask2'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr mask
touchManagedPtr mask2
return result'
#if defined(ENABLE_OVERLOADING)
data InetAddressMaskEqualMethodInfo
instance (signature ~ (b -> m Bool), MonadIO m, IsInetAddressMask a, IsInetAddressMask b) => O.OverloadedMethod InetAddressMaskEqualMethodInfo a signature where
overloadedMethod = inetAddressMaskEqual
instance O.OverloadedMethodInfo InetAddressMaskEqualMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.InetAddressMask.inetAddressMaskEqual",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-InetAddressMask.html#v:inetAddressMaskEqual"
})
#endif
foreign import ccall "g_inet_address_mask_get_address" g_inet_address_mask_get_address ::
Ptr InetAddressMask ->
IO (Ptr Gio.InetAddress.InetAddress)
inetAddressMaskGetAddress ::
(B.CallStack.HasCallStack, MonadIO m, IsInetAddressMask a) =>
a
-> m Gio.InetAddress.InetAddress
inetAddressMaskGetAddress :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsInetAddressMask a) =>
a -> m InetAddress
inetAddressMaskGetAddress a
mask = IO InetAddress -> m InetAddress
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO InetAddress -> m InetAddress)
-> IO InetAddress -> m InetAddress
forall a b. (a -> b) -> a -> b
$ do
mask' <- a -> IO (Ptr InetAddressMask)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mask
result <- g_inet_address_mask_get_address mask'
checkUnexpectedReturnNULL "inetAddressMaskGetAddress" result
result' <- (newObject Gio.InetAddress.InetAddress) result
touchManagedPtr mask
return result'
#if defined(ENABLE_OVERLOADING)
data InetAddressMaskGetAddressMethodInfo
instance (signature ~ (m Gio.InetAddress.InetAddress), MonadIO m, IsInetAddressMask a) => O.OverloadedMethod InetAddressMaskGetAddressMethodInfo a signature where
overloadedMethod = inetAddressMaskGetAddress
instance O.OverloadedMethodInfo InetAddressMaskGetAddressMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.InetAddressMask.inetAddressMaskGetAddress",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-InetAddressMask.html#v:inetAddressMaskGetAddress"
})
#endif
foreign import ccall "g_inet_address_mask_get_family" g_inet_address_mask_get_family ::
Ptr InetAddressMask ->
IO CUInt
inetAddressMaskGetFamily ::
(B.CallStack.HasCallStack, MonadIO m, IsInetAddressMask a) =>
a
-> m Gio.Enums.SocketFamily
inetAddressMaskGetFamily :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsInetAddressMask a) =>
a -> m SocketFamily
inetAddressMaskGetFamily a
mask = IO SocketFamily -> m SocketFamily
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SocketFamily -> m SocketFamily)
-> IO SocketFamily -> m SocketFamily
forall a b. (a -> b) -> a -> b
$ do
mask' <- a -> IO (Ptr InetAddressMask)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mask
result <- g_inet_address_mask_get_family mask'
let result' = (Int -> SocketFamily
forall a. Enum a => Int -> a
toEnum (Int -> SocketFamily) -> (CUInt -> Int) -> CUInt -> SocketFamily
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
touchManagedPtr mask
return result'
#if defined(ENABLE_OVERLOADING)
data InetAddressMaskGetFamilyMethodInfo
instance (signature ~ (m Gio.Enums.SocketFamily), MonadIO m, IsInetAddressMask a) => O.OverloadedMethod InetAddressMaskGetFamilyMethodInfo a signature where
overloadedMethod = inetAddressMaskGetFamily
instance O.OverloadedMethodInfo InetAddressMaskGetFamilyMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.InetAddressMask.inetAddressMaskGetFamily",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-InetAddressMask.html#v:inetAddressMaskGetFamily"
})
#endif
foreign import ccall "g_inet_address_mask_get_length" g_inet_address_mask_get_length ::
Ptr InetAddressMask ->
IO Word32
inetAddressMaskGetLength ::
(B.CallStack.HasCallStack, MonadIO m, IsInetAddressMask a) =>
a
-> m Word32
inetAddressMaskGetLength :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsInetAddressMask a) =>
a -> m Word32
inetAddressMaskGetLength a
mask = IO Word32 -> m Word32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
mask' <- a -> IO (Ptr InetAddressMask)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mask
result <- g_inet_address_mask_get_length mask'
touchManagedPtr mask
return result
#if defined(ENABLE_OVERLOADING)
data InetAddressMaskGetLengthMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsInetAddressMask a) => O.OverloadedMethod InetAddressMaskGetLengthMethodInfo a signature where
overloadedMethod = inetAddressMaskGetLength
instance O.OverloadedMethodInfo InetAddressMaskGetLengthMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.InetAddressMask.inetAddressMaskGetLength",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-InetAddressMask.html#v:inetAddressMaskGetLength"
})
#endif
foreign import ccall "g_inet_address_mask_matches" g_inet_address_mask_matches ::
Ptr InetAddressMask ->
Ptr Gio.InetAddress.InetAddress ->
IO CInt
inetAddressMaskMatches ::
(B.CallStack.HasCallStack, MonadIO m, IsInetAddressMask a, Gio.InetAddress.IsInetAddress b) =>
a
-> b
-> m Bool
inetAddressMaskMatches :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsInetAddressMask a, IsInetAddress b) =>
a -> b -> m Bool
inetAddressMaskMatches a
mask b
address = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
mask' <- a -> IO (Ptr InetAddressMask)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mask
address' <- unsafeManagedPtrCastPtr address
result <- g_inet_address_mask_matches mask' address'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr mask
touchManagedPtr address
return result'
#if defined(ENABLE_OVERLOADING)
data InetAddressMaskMatchesMethodInfo
instance (signature ~ (b -> m Bool), MonadIO m, IsInetAddressMask a, Gio.InetAddress.IsInetAddress b) => O.OverloadedMethod InetAddressMaskMatchesMethodInfo a signature where
overloadedMethod = inetAddressMaskMatches
instance O.OverloadedMethodInfo InetAddressMaskMatchesMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.InetAddressMask.inetAddressMaskMatches",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-InetAddressMask.html#v:inetAddressMaskMatches"
})
#endif
foreign import ccall "g_inet_address_mask_to_string" g_inet_address_mask_to_string ::
Ptr InetAddressMask ->
IO CString
inetAddressMaskToString ::
(B.CallStack.HasCallStack, MonadIO m, IsInetAddressMask a) =>
a
-> m T.Text
inetAddressMaskToString :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsInetAddressMask a) =>
a -> m Text
inetAddressMaskToString a
mask = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
mask' <- a -> IO (Ptr InetAddressMask)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mask
result <- g_inet_address_mask_to_string mask'
checkUnexpectedReturnNULL "inetAddressMaskToString" result
result' <- cstringToText result
freeMem result
touchManagedPtr mask
return result'
#if defined(ENABLE_OVERLOADING)
data InetAddressMaskToStringMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsInetAddressMask a) => O.OverloadedMethod InetAddressMaskToStringMethodInfo a signature where
overloadedMethod = inetAddressMaskToString
instance O.OverloadedMethodInfo InetAddressMaskToStringMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.InetAddressMask.inetAddressMaskToString",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-InetAddressMask.html#v:inetAddressMaskToString"
})
#endif