{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Objects.Resolver
(
Resolver(..) ,
IsResolver ,
toResolver ,
noResolver ,
#if defined(ENABLE_OVERLOADING)
ResolveResolverMethod ,
#endif
resolverGetDefault ,
#if defined(ENABLE_OVERLOADING)
ResolverLookupByAddressMethodInfo ,
#endif
resolverLookupByAddress ,
#if defined(ENABLE_OVERLOADING)
ResolverLookupByAddressAsyncMethodInfo ,
#endif
resolverLookupByAddressAsync ,
#if defined(ENABLE_OVERLOADING)
ResolverLookupByAddressFinishMethodInfo ,
#endif
resolverLookupByAddressFinish ,
#if defined(ENABLE_OVERLOADING)
ResolverLookupByNameMethodInfo ,
#endif
resolverLookupByName ,
#if defined(ENABLE_OVERLOADING)
ResolverLookupByNameAsyncMethodInfo ,
#endif
resolverLookupByNameAsync ,
#if defined(ENABLE_OVERLOADING)
ResolverLookupByNameFinishMethodInfo ,
#endif
resolverLookupByNameFinish ,
#if defined(ENABLE_OVERLOADING)
ResolverLookupByNameWithFlagsMethodInfo ,
#endif
resolverLookupByNameWithFlags ,
#if defined(ENABLE_OVERLOADING)
ResolverLookupByNameWithFlagsAsyncMethodInfo,
#endif
resolverLookupByNameWithFlagsAsync ,
#if defined(ENABLE_OVERLOADING)
ResolverLookupByNameWithFlagsFinishMethodInfo,
#endif
resolverLookupByNameWithFlagsFinish ,
#if defined(ENABLE_OVERLOADING)
ResolverLookupRecordsMethodInfo ,
#endif
resolverLookupRecords ,
#if defined(ENABLE_OVERLOADING)
ResolverLookupRecordsAsyncMethodInfo ,
#endif
resolverLookupRecordsAsync ,
#if defined(ENABLE_OVERLOADING)
ResolverLookupRecordsFinishMethodInfo ,
#endif
resolverLookupRecordsFinish ,
#if defined(ENABLE_OVERLOADING)
ResolverLookupServiceMethodInfo ,
#endif
resolverLookupService ,
#if defined(ENABLE_OVERLOADING)
ResolverLookupServiceAsyncMethodInfo ,
#endif
resolverLookupServiceAsync ,
#if defined(ENABLE_OVERLOADING)
ResolverLookupServiceFinishMethodInfo ,
#endif
resolverLookupServiceFinish ,
#if defined(ENABLE_OVERLOADING)
ResolverSetDefaultMethodInfo ,
#endif
resolverSetDefault ,
C_ResolverReloadCallback ,
ResolverReloadCallback ,
#if defined(ENABLE_OVERLOADING)
ResolverReloadSignalInfo ,
#endif
afterResolverReload ,
genClosure_ResolverReload ,
mk_ResolverReloadCallback ,
noResolverReloadCallback ,
onResolverReload ,
wrap_ResolverReloadCallback ,
) 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.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
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 Data.Text as T
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 GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import {-# SOURCE #-} qualified GI.Gio.Enums as Gio.Enums
import {-# SOURCE #-} qualified GI.Gio.Flags as Gio.Flags
import {-# SOURCE #-} qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import {-# SOURCE #-} qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import {-# SOURCE #-} qualified GI.Gio.Objects.InetAddress as Gio.InetAddress
import {-# SOURCE #-} qualified GI.Gio.Structs.SrvTarget as Gio.SrvTarget
newtype Resolver = Resolver (ManagedPtr Resolver)
deriving (Resolver -> Resolver -> Bool
(Resolver -> Resolver -> Bool)
-> (Resolver -> Resolver -> Bool) -> Eq Resolver
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Resolver -> Resolver -> Bool
$c/= :: Resolver -> Resolver -> Bool
== :: Resolver -> Resolver -> Bool
$c== :: Resolver -> Resolver -> Bool
Eq)
foreign import ccall "g_resolver_get_type"
c_g_resolver_get_type :: IO GType
instance GObject Resolver where
gobjectType :: IO GType
gobjectType = IO GType
c_g_resolver_get_type
instance B.GValue.IsGValue Resolver where
toGValue :: Resolver -> IO GValue
toGValue o :: Resolver
o = do
GType
gtype <- IO GType
c_g_resolver_get_type
Resolver -> (Ptr Resolver -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Resolver
o (GType
-> (GValue -> Ptr Resolver -> IO ()) -> Ptr Resolver -> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr Resolver -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO Resolver
fromGValue gv :: GValue
gv = do
Ptr Resolver
ptr <- GValue -> IO (Ptr Resolver)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr Resolver)
(ManagedPtr Resolver -> Resolver) -> Ptr Resolver -> IO Resolver
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Resolver -> Resolver
Resolver Ptr Resolver
ptr
class (GObject o, O.IsDescendantOf Resolver o) => IsResolver o
instance (GObject o, O.IsDescendantOf Resolver o) => IsResolver o
instance O.HasParentTypes Resolver
type instance O.ParentTypes Resolver = '[GObject.Object.Object]
toResolver :: (MonadIO m, IsResolver o) => o -> m Resolver
toResolver :: o -> m Resolver
toResolver = IO Resolver -> m Resolver
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Resolver -> m Resolver)
-> (o -> IO Resolver) -> o -> m Resolver
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Resolver -> Resolver) -> o -> IO Resolver
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr Resolver -> Resolver
Resolver
noResolver :: Maybe Resolver
noResolver :: Maybe Resolver
noResolver = Maybe Resolver
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveResolverMethod (t :: Symbol) (o :: *) :: * where
ResolveResolverMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveResolverMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveResolverMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveResolverMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveResolverMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveResolverMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveResolverMethod "lookupByAddress" o = ResolverLookupByAddressMethodInfo
ResolveResolverMethod "lookupByAddressAsync" o = ResolverLookupByAddressAsyncMethodInfo
ResolveResolverMethod "lookupByAddressFinish" o = ResolverLookupByAddressFinishMethodInfo
ResolveResolverMethod "lookupByName" o = ResolverLookupByNameMethodInfo
ResolveResolverMethod "lookupByNameAsync" o = ResolverLookupByNameAsyncMethodInfo
ResolveResolverMethod "lookupByNameFinish" o = ResolverLookupByNameFinishMethodInfo
ResolveResolverMethod "lookupByNameWithFlags" o = ResolverLookupByNameWithFlagsMethodInfo
ResolveResolverMethod "lookupByNameWithFlagsAsync" o = ResolverLookupByNameWithFlagsAsyncMethodInfo
ResolveResolverMethod "lookupByNameWithFlagsFinish" o = ResolverLookupByNameWithFlagsFinishMethodInfo
ResolveResolverMethod "lookupRecords" o = ResolverLookupRecordsMethodInfo
ResolveResolverMethod "lookupRecordsAsync" o = ResolverLookupRecordsAsyncMethodInfo
ResolveResolverMethod "lookupRecordsFinish" o = ResolverLookupRecordsFinishMethodInfo
ResolveResolverMethod "lookupService" o = ResolverLookupServiceMethodInfo
ResolveResolverMethod "lookupServiceAsync" o = ResolverLookupServiceAsyncMethodInfo
ResolveResolverMethod "lookupServiceFinish" o = ResolverLookupServiceFinishMethodInfo
ResolveResolverMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveResolverMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveResolverMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveResolverMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveResolverMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveResolverMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveResolverMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveResolverMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveResolverMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveResolverMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveResolverMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveResolverMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveResolverMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveResolverMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveResolverMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveResolverMethod "setDefault" o = ResolverSetDefaultMethodInfo
ResolveResolverMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveResolverMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveResolverMethod t Resolver, O.MethodInfo info Resolver p) => OL.IsLabel t (Resolver -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
type ResolverReloadCallback =
IO ()
noResolverReloadCallback :: Maybe ResolverReloadCallback
noResolverReloadCallback :: Maybe (IO ())
noResolverReloadCallback = Maybe (IO ())
forall a. Maybe a
Nothing
type C_ResolverReloadCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_ResolverReloadCallback :: C_ResolverReloadCallback -> IO (FunPtr C_ResolverReloadCallback)
genClosure_ResolverReload :: MonadIO m => ResolverReloadCallback -> m (GClosure C_ResolverReloadCallback)
genClosure_ResolverReload :: IO () -> m (GClosure C_ResolverReloadCallback)
genClosure_ResolverReload cb :: IO ()
cb = IO (GClosure C_ResolverReloadCallback)
-> m (GClosure C_ResolverReloadCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_ResolverReloadCallback)
-> m (GClosure C_ResolverReloadCallback))
-> IO (GClosure C_ResolverReloadCallback)
-> m (GClosure C_ResolverReloadCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_ResolverReloadCallback
cb' = IO () -> C_ResolverReloadCallback
wrap_ResolverReloadCallback IO ()
cb
C_ResolverReloadCallback -> IO (FunPtr C_ResolverReloadCallback)
mk_ResolverReloadCallback C_ResolverReloadCallback
cb' IO (FunPtr C_ResolverReloadCallback)
-> (FunPtr C_ResolverReloadCallback
-> IO (GClosure C_ResolverReloadCallback))
-> IO (GClosure C_ResolverReloadCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_ResolverReloadCallback
-> IO (GClosure C_ResolverReloadCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_ResolverReloadCallback ::
ResolverReloadCallback ->
C_ResolverReloadCallback
wrap_ResolverReloadCallback :: IO () -> C_ResolverReloadCallback
wrap_ResolverReloadCallback _cb :: IO ()
_cb _ _ = do
IO ()
_cb
onResolverReload :: (IsResolver a, MonadIO m) => a -> ResolverReloadCallback -> m SignalHandlerId
onResolverReload :: a -> IO () -> m SignalHandlerId
onResolverReload obj :: a
obj cb :: IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_ResolverReloadCallback
cb' = IO () -> C_ResolverReloadCallback
wrap_ResolverReloadCallback IO ()
cb
FunPtr C_ResolverReloadCallback
cb'' <- C_ResolverReloadCallback -> IO (FunPtr C_ResolverReloadCallback)
mk_ResolverReloadCallback C_ResolverReloadCallback
cb'
a
-> Text
-> FunPtr C_ResolverReloadCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "reload" FunPtr C_ResolverReloadCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterResolverReload :: (IsResolver a, MonadIO m) => a -> ResolverReloadCallback -> m SignalHandlerId
afterResolverReload :: a -> IO () -> m SignalHandlerId
afterResolverReload obj :: a
obj cb :: IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_ResolverReloadCallback
cb' = IO () -> C_ResolverReloadCallback
wrap_ResolverReloadCallback IO ()
cb
FunPtr C_ResolverReloadCallback
cb'' <- C_ResolverReloadCallback -> IO (FunPtr C_ResolverReloadCallback)
mk_ResolverReloadCallback C_ResolverReloadCallback
cb'
a
-> Text
-> FunPtr C_ResolverReloadCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "reload" FunPtr C_ResolverReloadCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data ResolverReloadSignalInfo
instance SignalInfo ResolverReloadSignalInfo where
type HaskellCallbackType ResolverReloadSignalInfo = ResolverReloadCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_ResolverReloadCallback cb
cb'' <- mk_ResolverReloadCallback cb'
connectSignalFunPtr obj "reload" cb'' connectMode detail
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Resolver
type instance O.AttributeList Resolver = ResolverAttributeList
type ResolverAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Resolver = ResolverSignalList
type ResolverSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo), '("reload", ResolverReloadSignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_resolver_lookup_by_address" g_resolver_lookup_by_address ::
Ptr Resolver ->
Ptr Gio.InetAddress.InetAddress ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CString
resolverLookupByAddress ::
(B.CallStack.HasCallStack, MonadIO m, IsResolver a, Gio.InetAddress.IsInetAddress b, Gio.Cancellable.IsCancellable c) =>
a
-> b
-> Maybe (c)
-> m T.Text
resolverLookupByAddress :: a -> b -> Maybe c -> m Text
resolverLookupByAddress resolver :: a
resolver address :: b
address cancellable :: Maybe c
cancellable = IO Text -> m Text
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
Ptr Resolver
resolver' <- a -> IO (Ptr Resolver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resolver
Ptr InetAddress
address' <- b -> IO (Ptr InetAddress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
address
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: c
jCancellable -> do
Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO Text -> IO () -> IO Text
forall a b. IO a -> IO b -> IO a
onException (do
CString
result <- (Ptr (Ptr GError) -> IO CString) -> IO CString
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CString) -> IO CString)
-> (Ptr (Ptr GError) -> IO CString) -> IO CString
forall a b. (a -> b) -> a -> b
$ Ptr Resolver
-> Ptr InetAddress
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CString
g_resolver_lookup_by_address Ptr Resolver
resolver' Ptr InetAddress
address' Ptr Cancellable
maybeCancellable
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "resolverLookupByAddress" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
resolver
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
address
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data ResolverLookupByAddressMethodInfo
instance (signature ~ (b -> Maybe (c) -> m T.Text), MonadIO m, IsResolver a, Gio.InetAddress.IsInetAddress b, Gio.Cancellable.IsCancellable c) => O.MethodInfo ResolverLookupByAddressMethodInfo a signature where
overloadedMethod = resolverLookupByAddress
#endif
foreign import ccall "g_resolver_lookup_by_address_async" g_resolver_lookup_by_address_async ::
Ptr Resolver ->
Ptr Gio.InetAddress.InetAddress ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
resolverLookupByAddressAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsResolver a, Gio.InetAddress.IsInetAddress b, Gio.Cancellable.IsCancellable c) =>
a
-> b
-> Maybe (c)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
resolverLookupByAddressAsync :: a -> b -> Maybe c -> Maybe AsyncReadyCallback -> m ()
resolverLookupByAddressAsync resolver :: a
resolver address :: b
address cancellable :: Maybe c
cancellable callback :: Maybe AsyncReadyCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Resolver
resolver' <- a -> IO (Ptr Resolver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resolver
Ptr InetAddress
address' <- b -> IO (Ptr InetAddress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
address
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: c
jCancellable -> do
Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just jCallback :: AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Resolver
-> Ptr InetAddress
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
g_resolver_lookup_by_address_async Ptr Resolver
resolver' Ptr InetAddress
address' Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
resolver
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
address
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ResolverLookupByAddressAsyncMethodInfo
instance (signature ~ (b -> Maybe (c) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsResolver a, Gio.InetAddress.IsInetAddress b, Gio.Cancellable.IsCancellable c) => O.MethodInfo ResolverLookupByAddressAsyncMethodInfo a signature where
overloadedMethod = resolverLookupByAddressAsync
#endif
foreign import ccall "g_resolver_lookup_by_address_finish" g_resolver_lookup_by_address_finish ::
Ptr Resolver ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CString
resolverLookupByAddressFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsResolver a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m T.Text
resolverLookupByAddressFinish :: a -> b -> m Text
resolverLookupByAddressFinish resolver :: a
resolver result_ :: b
result_ = IO Text -> m Text
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
Ptr Resolver
resolver' <- a -> IO (Ptr Resolver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resolver
Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
IO Text -> IO () -> IO Text
forall a b. IO a -> IO b -> IO a
onException (do
CString
result <- (Ptr (Ptr GError) -> IO CString) -> IO CString
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CString) -> IO CString)
-> (Ptr (Ptr GError) -> IO CString) -> IO CString
forall a b. (a -> b) -> a -> b
$ Ptr Resolver -> Ptr AsyncResult -> Ptr (Ptr GError) -> IO CString
g_resolver_lookup_by_address_finish Ptr Resolver
resolver' Ptr AsyncResult
result_'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "resolverLookupByAddressFinish" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
resolver
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data ResolverLookupByAddressFinishMethodInfo
instance (signature ~ (b -> m T.Text), MonadIO m, IsResolver a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo ResolverLookupByAddressFinishMethodInfo a signature where
overloadedMethod = resolverLookupByAddressFinish
#endif
foreign import ccall "g_resolver_lookup_by_name" g_resolver_lookup_by_name ::
Ptr Resolver ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr (GList (Ptr Gio.InetAddress.InetAddress)))
resolverLookupByName ::
(B.CallStack.HasCallStack, MonadIO m, IsResolver a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> Maybe (b)
-> m [Gio.InetAddress.InetAddress]
resolverLookupByName :: a -> Text -> Maybe b -> m [InetAddress]
resolverLookupByName resolver :: a
resolver hostname :: Text
hostname cancellable :: Maybe b
cancellable = IO [InetAddress] -> m [InetAddress]
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
Ptr Resolver
resolver' <- a -> IO (Ptr Resolver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resolver
CString
hostname' <- Text -> IO CString
textToCString Text
hostname
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO [InetAddress] -> IO () -> IO [InetAddress]
forall a b. IO a -> IO b -> IO a
onException (do
Ptr (GList (Ptr InetAddress))
result <- (Ptr (Ptr GError) -> IO (Ptr (GList (Ptr InetAddress))))
-> IO (Ptr (GList (Ptr InetAddress)))
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr (GList (Ptr InetAddress))))
-> IO (Ptr (GList (Ptr InetAddress))))
-> (Ptr (Ptr GError) -> IO (Ptr (GList (Ptr InetAddress))))
-> IO (Ptr (GList (Ptr InetAddress)))
forall a b. (a -> b) -> a -> b
$ Ptr Resolver
-> CString
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO (Ptr (GList (Ptr InetAddress)))
g_resolver_lookup_by_name Ptr Resolver
resolver' CString
hostname' Ptr Cancellable
maybeCancellable
[Ptr InetAddress]
result' <- Ptr (GList (Ptr InetAddress)) -> IO [Ptr InetAddress]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr InetAddress))
result
[InetAddress]
result'' <- (Ptr InetAddress -> IO InetAddress)
-> [Ptr InetAddress] -> IO [InetAddress]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr InetAddress -> InetAddress)
-> Ptr InetAddress -> IO InetAddress
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr InetAddress -> InetAddress
Gio.InetAddress.InetAddress) [Ptr InetAddress]
result'
Ptr (GList (Ptr InetAddress)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr InetAddress))
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
resolver
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
hostname'
[InetAddress] -> IO [InetAddress]
forall (m :: * -> *) a. Monad m => a -> m a
return [InetAddress]
result''
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
hostname'
)
#if defined(ENABLE_OVERLOADING)
data ResolverLookupByNameMethodInfo
instance (signature ~ (T.Text -> Maybe (b) -> m [Gio.InetAddress.InetAddress]), MonadIO m, IsResolver a, Gio.Cancellable.IsCancellable b) => O.MethodInfo ResolverLookupByNameMethodInfo a signature where
overloadedMethod = resolverLookupByName
#endif
foreign import ccall "g_resolver_lookup_by_name_async" g_resolver_lookup_by_name_async ::
Ptr Resolver ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
resolverLookupByNameAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsResolver a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
resolverLookupByNameAsync :: a -> Text -> Maybe b -> Maybe AsyncReadyCallback -> m ()
resolverLookupByNameAsync resolver :: a
resolver hostname :: Text
hostname cancellable :: Maybe b
cancellable callback :: Maybe AsyncReadyCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Resolver
resolver' <- a -> IO (Ptr Resolver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resolver
CString
hostname' <- Text -> IO CString
textToCString Text
hostname
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just jCallback :: AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Resolver
-> CString
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
g_resolver_lookup_by_name_async Ptr Resolver
resolver' CString
hostname' Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
resolver
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
hostname'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ResolverLookupByNameAsyncMethodInfo
instance (signature ~ (T.Text -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsResolver a, Gio.Cancellable.IsCancellable b) => O.MethodInfo ResolverLookupByNameAsyncMethodInfo a signature where
overloadedMethod = resolverLookupByNameAsync
#endif
foreign import ccall "g_resolver_lookup_by_name_finish" g_resolver_lookup_by_name_finish ::
Ptr Resolver ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr (GList (Ptr Gio.InetAddress.InetAddress)))
resolverLookupByNameFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsResolver a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m [Gio.InetAddress.InetAddress]
resolverLookupByNameFinish :: a -> b -> m [InetAddress]
resolverLookupByNameFinish resolver :: a
resolver result_ :: b
result_ = IO [InetAddress] -> m [InetAddress]
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
Ptr Resolver
resolver' <- a -> IO (Ptr Resolver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resolver
Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
IO [InetAddress] -> IO () -> IO [InetAddress]
forall a b. IO a -> IO b -> IO a
onException (do
Ptr (GList (Ptr InetAddress))
result <- (Ptr (Ptr GError) -> IO (Ptr (GList (Ptr InetAddress))))
-> IO (Ptr (GList (Ptr InetAddress)))
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr (GList (Ptr InetAddress))))
-> IO (Ptr (GList (Ptr InetAddress))))
-> (Ptr (Ptr GError) -> IO (Ptr (GList (Ptr InetAddress))))
-> IO (Ptr (GList (Ptr InetAddress)))
forall a b. (a -> b) -> a -> b
$ Ptr Resolver
-> Ptr AsyncResult
-> Ptr (Ptr GError)
-> IO (Ptr (GList (Ptr InetAddress)))
g_resolver_lookup_by_name_finish Ptr Resolver
resolver' Ptr AsyncResult
result_'
[Ptr InetAddress]
result' <- Ptr (GList (Ptr InetAddress)) -> IO [Ptr InetAddress]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr InetAddress))
result
[InetAddress]
result'' <- (Ptr InetAddress -> IO InetAddress)
-> [Ptr InetAddress] -> IO [InetAddress]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr InetAddress -> InetAddress)
-> Ptr InetAddress -> IO InetAddress
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr InetAddress -> InetAddress
Gio.InetAddress.InetAddress) [Ptr InetAddress]
result'
Ptr (GList (Ptr InetAddress)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr InetAddress))
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
resolver
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
[InetAddress] -> IO [InetAddress]
forall (m :: * -> *) a. Monad m => a -> m a
return [InetAddress]
result''
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data ResolverLookupByNameFinishMethodInfo
instance (signature ~ (b -> m [Gio.InetAddress.InetAddress]), MonadIO m, IsResolver a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo ResolverLookupByNameFinishMethodInfo a signature where
overloadedMethod = resolverLookupByNameFinish
#endif
foreign import ccall "g_resolver_lookup_by_name_with_flags" g_resolver_lookup_by_name_with_flags ::
Ptr Resolver ->
CString ->
CUInt ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr (GList (Ptr Gio.InetAddress.InetAddress)))
resolverLookupByNameWithFlags ::
(B.CallStack.HasCallStack, MonadIO m, IsResolver a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> [Gio.Flags.ResolverNameLookupFlags]
-> Maybe (b)
-> m [Gio.InetAddress.InetAddress]
resolverLookupByNameWithFlags :: a
-> Text -> [ResolverNameLookupFlags] -> Maybe b -> m [InetAddress]
resolverLookupByNameWithFlags resolver :: a
resolver hostname :: Text
hostname flags :: [ResolverNameLookupFlags]
flags cancellable :: Maybe b
cancellable = IO [InetAddress] -> m [InetAddress]
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
Ptr Resolver
resolver' <- a -> IO (Ptr Resolver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resolver
CString
hostname' <- Text -> IO CString
textToCString Text
hostname
let flags' :: CUInt
flags' = [ResolverNameLookupFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [ResolverNameLookupFlags]
flags
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO [InetAddress] -> IO () -> IO [InetAddress]
forall a b. IO a -> IO b -> IO a
onException (do
Ptr (GList (Ptr InetAddress))
result <- (Ptr (Ptr GError) -> IO (Ptr (GList (Ptr InetAddress))))
-> IO (Ptr (GList (Ptr InetAddress)))
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr (GList (Ptr InetAddress))))
-> IO (Ptr (GList (Ptr InetAddress))))
-> (Ptr (Ptr GError) -> IO (Ptr (GList (Ptr InetAddress))))
-> IO (Ptr (GList (Ptr InetAddress)))
forall a b. (a -> b) -> a -> b
$ Ptr Resolver
-> CString
-> CUInt
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO (Ptr (GList (Ptr InetAddress)))
g_resolver_lookup_by_name_with_flags Ptr Resolver
resolver' CString
hostname' CUInt
flags' Ptr Cancellable
maybeCancellable
[Ptr InetAddress]
result' <- Ptr (GList (Ptr InetAddress)) -> IO [Ptr InetAddress]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr InetAddress))
result
[InetAddress]
result'' <- (Ptr InetAddress -> IO InetAddress)
-> [Ptr InetAddress] -> IO [InetAddress]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr InetAddress -> InetAddress)
-> Ptr InetAddress -> IO InetAddress
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr InetAddress -> InetAddress
Gio.InetAddress.InetAddress) [Ptr InetAddress]
result'
Ptr (GList (Ptr InetAddress)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr InetAddress))
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
resolver
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
hostname'
[InetAddress] -> IO [InetAddress]
forall (m :: * -> *) a. Monad m => a -> m a
return [InetAddress]
result''
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
hostname'
)
#if defined(ENABLE_OVERLOADING)
data ResolverLookupByNameWithFlagsMethodInfo
instance (signature ~ (T.Text -> [Gio.Flags.ResolverNameLookupFlags] -> Maybe (b) -> m [Gio.InetAddress.InetAddress]), MonadIO m, IsResolver a, Gio.Cancellable.IsCancellable b) => O.MethodInfo ResolverLookupByNameWithFlagsMethodInfo a signature where
overloadedMethod = resolverLookupByNameWithFlags
#endif
foreign import ccall "g_resolver_lookup_by_name_with_flags_async" g_resolver_lookup_by_name_with_flags_async ::
Ptr Resolver ->
CString ->
CUInt ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
resolverLookupByNameWithFlagsAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsResolver a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> [Gio.Flags.ResolverNameLookupFlags]
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
resolverLookupByNameWithFlagsAsync :: a
-> Text
-> [ResolverNameLookupFlags]
-> Maybe b
-> Maybe AsyncReadyCallback
-> m ()
resolverLookupByNameWithFlagsAsync resolver :: a
resolver hostname :: Text
hostname flags :: [ResolverNameLookupFlags]
flags cancellable :: Maybe b
cancellable callback :: Maybe AsyncReadyCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Resolver
resolver' <- a -> IO (Ptr Resolver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resolver
CString
hostname' <- Text -> IO CString
textToCString Text
hostname
let flags' :: CUInt
flags' = [ResolverNameLookupFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [ResolverNameLookupFlags]
flags
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just jCallback :: AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Resolver
-> CString
-> CUInt
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
g_resolver_lookup_by_name_with_flags_async Ptr Resolver
resolver' CString
hostname' CUInt
flags' Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
resolver
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
hostname'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ResolverLookupByNameWithFlagsAsyncMethodInfo
instance (signature ~ (T.Text -> [Gio.Flags.ResolverNameLookupFlags] -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsResolver a, Gio.Cancellable.IsCancellable b) => O.MethodInfo ResolverLookupByNameWithFlagsAsyncMethodInfo a signature where
overloadedMethod = resolverLookupByNameWithFlagsAsync
#endif
foreign import ccall "g_resolver_lookup_by_name_with_flags_finish" g_resolver_lookup_by_name_with_flags_finish ::
Ptr Resolver ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr (GList (Ptr Gio.InetAddress.InetAddress)))
resolverLookupByNameWithFlagsFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsResolver a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m [Gio.InetAddress.InetAddress]
resolverLookupByNameWithFlagsFinish :: a -> b -> m [InetAddress]
resolverLookupByNameWithFlagsFinish resolver :: a
resolver result_ :: b
result_ = IO [InetAddress] -> m [InetAddress]
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
Ptr Resolver
resolver' <- a -> IO (Ptr Resolver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resolver
Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
IO [InetAddress] -> IO () -> IO [InetAddress]
forall a b. IO a -> IO b -> IO a
onException (do
Ptr (GList (Ptr InetAddress))
result <- (Ptr (Ptr GError) -> IO (Ptr (GList (Ptr InetAddress))))
-> IO (Ptr (GList (Ptr InetAddress)))
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr (GList (Ptr InetAddress))))
-> IO (Ptr (GList (Ptr InetAddress))))
-> (Ptr (Ptr GError) -> IO (Ptr (GList (Ptr InetAddress))))
-> IO (Ptr (GList (Ptr InetAddress)))
forall a b. (a -> b) -> a -> b
$ Ptr Resolver
-> Ptr AsyncResult
-> Ptr (Ptr GError)
-> IO (Ptr (GList (Ptr InetAddress)))
g_resolver_lookup_by_name_with_flags_finish Ptr Resolver
resolver' Ptr AsyncResult
result_'
[Ptr InetAddress]
result' <- Ptr (GList (Ptr InetAddress)) -> IO [Ptr InetAddress]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr InetAddress))
result
[InetAddress]
result'' <- (Ptr InetAddress -> IO InetAddress)
-> [Ptr InetAddress] -> IO [InetAddress]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr InetAddress -> InetAddress)
-> Ptr InetAddress -> IO InetAddress
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr InetAddress -> InetAddress
Gio.InetAddress.InetAddress) [Ptr InetAddress]
result'
Ptr (GList (Ptr InetAddress)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr InetAddress))
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
resolver
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
[InetAddress] -> IO [InetAddress]
forall (m :: * -> *) a. Monad m => a -> m a
return [InetAddress]
result''
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data ResolverLookupByNameWithFlagsFinishMethodInfo
instance (signature ~ (b -> m [Gio.InetAddress.InetAddress]), MonadIO m, IsResolver a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo ResolverLookupByNameWithFlagsFinishMethodInfo a signature where
overloadedMethod = resolverLookupByNameWithFlagsFinish
#endif
foreign import ccall "g_resolver_lookup_records" g_resolver_lookup_records ::
Ptr Resolver ->
CString ->
CUInt ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr (GList (Ptr GVariant)))
resolverLookupRecords ::
(B.CallStack.HasCallStack, MonadIO m, IsResolver a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> Gio.Enums.ResolverRecordType
-> Maybe (b)
-> m [GVariant]
resolverLookupRecords :: a -> Text -> ResolverRecordType -> Maybe b -> m [GVariant]
resolverLookupRecords resolver :: a
resolver rrname :: Text
rrname recordType :: ResolverRecordType
recordType cancellable :: Maybe b
cancellable = IO [GVariant] -> m [GVariant]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [GVariant] -> m [GVariant]) -> IO [GVariant] -> m [GVariant]
forall a b. (a -> b) -> a -> b
$ do
Ptr Resolver
resolver' <- a -> IO (Ptr Resolver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resolver
CString
rrname' <- Text -> IO CString
textToCString Text
rrname
let recordType' :: CUInt
recordType' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (ResolverRecordType -> Int) -> ResolverRecordType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ResolverRecordType -> Int
forall a. Enum a => a -> Int
fromEnum) ResolverRecordType
recordType
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO [GVariant] -> IO () -> IO [GVariant]
forall a b. IO a -> IO b -> IO a
onException (do
Ptr (GList (Ptr GVariant))
result <- (Ptr (Ptr GError) -> IO (Ptr (GList (Ptr GVariant))))
-> IO (Ptr (GList (Ptr GVariant)))
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr (GList (Ptr GVariant))))
-> IO (Ptr (GList (Ptr GVariant))))
-> (Ptr (Ptr GError) -> IO (Ptr (GList (Ptr GVariant))))
-> IO (Ptr (GList (Ptr GVariant)))
forall a b. (a -> b) -> a -> b
$ Ptr Resolver
-> CString
-> CUInt
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO (Ptr (GList (Ptr GVariant)))
g_resolver_lookup_records Ptr Resolver
resolver' CString
rrname' CUInt
recordType' Ptr Cancellable
maybeCancellable
[Ptr GVariant]
result' <- Ptr (GList (Ptr GVariant)) -> IO [Ptr GVariant]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr GVariant))
result
[GVariant]
result'' <- (Ptr GVariant -> IO GVariant) -> [Ptr GVariant] -> IO [GVariant]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM Ptr GVariant -> IO GVariant
B.GVariant.wrapGVariantPtr [Ptr GVariant]
result'
Ptr (GList (Ptr GVariant)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr GVariant))
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
resolver
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
rrname'
[GVariant] -> IO [GVariant]
forall (m :: * -> *) a. Monad m => a -> m a
return [GVariant]
result''
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
rrname'
)
#if defined(ENABLE_OVERLOADING)
data ResolverLookupRecordsMethodInfo
instance (signature ~ (T.Text -> Gio.Enums.ResolverRecordType -> Maybe (b) -> m [GVariant]), MonadIO m, IsResolver a, Gio.Cancellable.IsCancellable b) => O.MethodInfo ResolverLookupRecordsMethodInfo a signature where
overloadedMethod = resolverLookupRecords
#endif
foreign import ccall "g_resolver_lookup_records_async" g_resolver_lookup_records_async ::
Ptr Resolver ->
CString ->
CUInt ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
resolverLookupRecordsAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsResolver a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> Gio.Enums.ResolverRecordType
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
resolverLookupRecordsAsync :: a
-> Text
-> ResolverRecordType
-> Maybe b
-> Maybe AsyncReadyCallback
-> m ()
resolverLookupRecordsAsync resolver :: a
resolver rrname :: Text
rrname recordType :: ResolverRecordType
recordType cancellable :: Maybe b
cancellable callback :: Maybe AsyncReadyCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Resolver
resolver' <- a -> IO (Ptr Resolver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resolver
CString
rrname' <- Text -> IO CString
textToCString Text
rrname
let recordType' :: CUInt
recordType' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (ResolverRecordType -> Int) -> ResolverRecordType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ResolverRecordType -> Int
forall a. Enum a => a -> Int
fromEnum) ResolverRecordType
recordType
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just jCallback :: AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Resolver
-> CString
-> CUInt
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
g_resolver_lookup_records_async Ptr Resolver
resolver' CString
rrname' CUInt
recordType' Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
resolver
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
rrname'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ResolverLookupRecordsAsyncMethodInfo
instance (signature ~ (T.Text -> Gio.Enums.ResolverRecordType -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsResolver a, Gio.Cancellable.IsCancellable b) => O.MethodInfo ResolverLookupRecordsAsyncMethodInfo a signature where
overloadedMethod = resolverLookupRecordsAsync
#endif
foreign import ccall "g_resolver_lookup_records_finish" g_resolver_lookup_records_finish ::
Ptr Resolver ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr (GList (Ptr GVariant)))
resolverLookupRecordsFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsResolver a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m [GVariant]
resolverLookupRecordsFinish :: a -> b -> m [GVariant]
resolverLookupRecordsFinish resolver :: a
resolver result_ :: b
result_ = IO [GVariant] -> m [GVariant]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [GVariant] -> m [GVariant]) -> IO [GVariant] -> m [GVariant]
forall a b. (a -> b) -> a -> b
$ do
Ptr Resolver
resolver' <- a -> IO (Ptr Resolver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resolver
Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
IO [GVariant] -> IO () -> IO [GVariant]
forall a b. IO a -> IO b -> IO a
onException (do
Ptr (GList (Ptr GVariant))
result <- (Ptr (Ptr GError) -> IO (Ptr (GList (Ptr GVariant))))
-> IO (Ptr (GList (Ptr GVariant)))
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr (GList (Ptr GVariant))))
-> IO (Ptr (GList (Ptr GVariant))))
-> (Ptr (Ptr GError) -> IO (Ptr (GList (Ptr GVariant))))
-> IO (Ptr (GList (Ptr GVariant)))
forall a b. (a -> b) -> a -> b
$ Ptr Resolver
-> Ptr AsyncResult
-> Ptr (Ptr GError)
-> IO (Ptr (GList (Ptr GVariant)))
g_resolver_lookup_records_finish Ptr Resolver
resolver' Ptr AsyncResult
result_'
[Ptr GVariant]
result' <- Ptr (GList (Ptr GVariant)) -> IO [Ptr GVariant]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr GVariant))
result
[GVariant]
result'' <- (Ptr GVariant -> IO GVariant) -> [Ptr GVariant] -> IO [GVariant]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM Ptr GVariant -> IO GVariant
B.GVariant.wrapGVariantPtr [Ptr GVariant]
result'
Ptr (GList (Ptr GVariant)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr GVariant))
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
resolver
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
[GVariant] -> IO [GVariant]
forall (m :: * -> *) a. Monad m => a -> m a
return [GVariant]
result''
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data ResolverLookupRecordsFinishMethodInfo
instance (signature ~ (b -> m [GVariant]), MonadIO m, IsResolver a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo ResolverLookupRecordsFinishMethodInfo a signature where
overloadedMethod = resolverLookupRecordsFinish
#endif
foreign import ccall "g_resolver_lookup_service" g_resolver_lookup_service ::
Ptr Resolver ->
CString ->
CString ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr (GList (Ptr Gio.SrvTarget.SrvTarget)))
resolverLookupService ::
(B.CallStack.HasCallStack, MonadIO m, IsResolver a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> T.Text
-> T.Text
-> Maybe (b)
-> m [Gio.SrvTarget.SrvTarget]
resolverLookupService :: a -> Text -> Text -> Text -> Maybe b -> m [SrvTarget]
resolverLookupService resolver :: a
resolver service :: Text
service protocol :: Text
protocol domain :: Text
domain cancellable :: Maybe b
cancellable = IO [SrvTarget] -> m [SrvTarget]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [SrvTarget] -> m [SrvTarget])
-> IO [SrvTarget] -> m [SrvTarget]
forall a b. (a -> b) -> a -> b
$ do
Ptr Resolver
resolver' <- a -> IO (Ptr Resolver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resolver
CString
service' <- Text -> IO CString
textToCString Text
service
CString
protocol' <- Text -> IO CString
textToCString Text
protocol
CString
domain' <- Text -> IO CString
textToCString Text
domain
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO [SrvTarget] -> IO () -> IO [SrvTarget]
forall a b. IO a -> IO b -> IO a
onException (do
Ptr (GList (Ptr SrvTarget))
result <- (Ptr (Ptr GError) -> IO (Ptr (GList (Ptr SrvTarget))))
-> IO (Ptr (GList (Ptr SrvTarget)))
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr (GList (Ptr SrvTarget))))
-> IO (Ptr (GList (Ptr SrvTarget))))
-> (Ptr (Ptr GError) -> IO (Ptr (GList (Ptr SrvTarget))))
-> IO (Ptr (GList (Ptr SrvTarget)))
forall a b. (a -> b) -> a -> b
$ Ptr Resolver
-> CString
-> CString
-> CString
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO (Ptr (GList (Ptr SrvTarget)))
g_resolver_lookup_service Ptr Resolver
resolver' CString
service' CString
protocol' CString
domain' Ptr Cancellable
maybeCancellable
[Ptr SrvTarget]
result' <- Ptr (GList (Ptr SrvTarget)) -> IO [Ptr SrvTarget]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr SrvTarget))
result
[SrvTarget]
result'' <- (Ptr SrvTarget -> IO SrvTarget)
-> [Ptr SrvTarget] -> IO [SrvTarget]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr SrvTarget -> SrvTarget)
-> Ptr SrvTarget -> IO SrvTarget
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr SrvTarget -> SrvTarget
Gio.SrvTarget.SrvTarget) [Ptr SrvTarget]
result'
Ptr (GList (Ptr SrvTarget)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr SrvTarget))
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
resolver
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
service'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
protocol'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
domain'
[SrvTarget] -> IO [SrvTarget]
forall (m :: * -> *) a. Monad m => a -> m a
return [SrvTarget]
result''
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
service'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
protocol'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
domain'
)
#if defined(ENABLE_OVERLOADING)
data ResolverLookupServiceMethodInfo
instance (signature ~ (T.Text -> T.Text -> T.Text -> Maybe (b) -> m [Gio.SrvTarget.SrvTarget]), MonadIO m, IsResolver a, Gio.Cancellable.IsCancellable b) => O.MethodInfo ResolverLookupServiceMethodInfo a signature where
overloadedMethod = resolverLookupService
#endif
foreign import ccall "g_resolver_lookup_service_async" g_resolver_lookup_service_async ::
Ptr Resolver ->
CString ->
CString ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
resolverLookupServiceAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsResolver a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> T.Text
-> T.Text
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
resolverLookupServiceAsync :: a
-> Text
-> Text
-> Text
-> Maybe b
-> Maybe AsyncReadyCallback
-> m ()
resolverLookupServiceAsync resolver :: a
resolver service :: Text
service protocol :: Text
protocol domain :: Text
domain cancellable :: Maybe b
cancellable callback :: Maybe AsyncReadyCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Resolver
resolver' <- a -> IO (Ptr Resolver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resolver
CString
service' <- Text -> IO CString
textToCString Text
service
CString
protocol' <- Text -> IO CString
textToCString Text
protocol
CString
domain' <- Text -> IO CString
textToCString Text
domain
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just jCallback :: AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Resolver
-> CString
-> CString
-> CString
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
g_resolver_lookup_service_async Ptr Resolver
resolver' CString
service' CString
protocol' CString
domain' Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
resolver
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
service'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
protocol'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
domain'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ResolverLookupServiceAsyncMethodInfo
instance (signature ~ (T.Text -> T.Text -> T.Text -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsResolver a, Gio.Cancellable.IsCancellable b) => O.MethodInfo ResolverLookupServiceAsyncMethodInfo a signature where
overloadedMethod = resolverLookupServiceAsync
#endif
foreign import ccall "g_resolver_lookup_service_finish" g_resolver_lookup_service_finish ::
Ptr Resolver ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr (GList (Ptr Gio.SrvTarget.SrvTarget)))
resolverLookupServiceFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsResolver a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m [Gio.SrvTarget.SrvTarget]
resolverLookupServiceFinish :: a -> b -> m [SrvTarget]
resolverLookupServiceFinish resolver :: a
resolver result_ :: b
result_ = IO [SrvTarget] -> m [SrvTarget]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [SrvTarget] -> m [SrvTarget])
-> IO [SrvTarget] -> m [SrvTarget]
forall a b. (a -> b) -> a -> b
$ do
Ptr Resolver
resolver' <- a -> IO (Ptr Resolver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resolver
Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
IO [SrvTarget] -> IO () -> IO [SrvTarget]
forall a b. IO a -> IO b -> IO a
onException (do
Ptr (GList (Ptr SrvTarget))
result <- (Ptr (Ptr GError) -> IO (Ptr (GList (Ptr SrvTarget))))
-> IO (Ptr (GList (Ptr SrvTarget)))
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr (GList (Ptr SrvTarget))))
-> IO (Ptr (GList (Ptr SrvTarget))))
-> (Ptr (Ptr GError) -> IO (Ptr (GList (Ptr SrvTarget))))
-> IO (Ptr (GList (Ptr SrvTarget)))
forall a b. (a -> b) -> a -> b
$ Ptr Resolver
-> Ptr AsyncResult
-> Ptr (Ptr GError)
-> IO (Ptr (GList (Ptr SrvTarget)))
g_resolver_lookup_service_finish Ptr Resolver
resolver' Ptr AsyncResult
result_'
[Ptr SrvTarget]
result' <- Ptr (GList (Ptr SrvTarget)) -> IO [Ptr SrvTarget]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr SrvTarget))
result
[SrvTarget]
result'' <- (Ptr SrvTarget -> IO SrvTarget)
-> [Ptr SrvTarget] -> IO [SrvTarget]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr SrvTarget -> SrvTarget)
-> Ptr SrvTarget -> IO SrvTarget
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr SrvTarget -> SrvTarget
Gio.SrvTarget.SrvTarget) [Ptr SrvTarget]
result'
Ptr (GList (Ptr SrvTarget)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr SrvTarget))
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
resolver
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
[SrvTarget] -> IO [SrvTarget]
forall (m :: * -> *) a. Monad m => a -> m a
return [SrvTarget]
result''
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data ResolverLookupServiceFinishMethodInfo
instance (signature ~ (b -> m [Gio.SrvTarget.SrvTarget]), MonadIO m, IsResolver a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo ResolverLookupServiceFinishMethodInfo a signature where
overloadedMethod = resolverLookupServiceFinish
#endif
foreign import ccall "g_resolver_set_default" g_resolver_set_default ::
Ptr Resolver ->
IO ()
resolverSetDefault ::
(B.CallStack.HasCallStack, MonadIO m, IsResolver a) =>
a
-> m ()
resolverSetDefault :: a -> m ()
resolverSetDefault resolver :: a
resolver = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Resolver
resolver' <- a -> IO (Ptr Resolver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resolver
Ptr Resolver -> IO ()
g_resolver_set_default Ptr Resolver
resolver'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
resolver
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ResolverSetDefaultMethodInfo
instance (signature ~ (m ()), MonadIO m, IsResolver a) => O.MethodInfo ResolverSetDefaultMethodInfo a signature where
overloadedMethod = resolverSetDefault
#endif
foreign import ccall "g_resolver_get_default" g_resolver_get_default ::
IO (Ptr Resolver)
resolverGetDefault ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Resolver
resolverGetDefault :: m Resolver
resolverGetDefault = IO Resolver -> m Resolver
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Resolver -> m Resolver) -> IO Resolver -> m Resolver
forall a b. (a -> b) -> a -> b
$ do
Ptr Resolver
result <- IO (Ptr Resolver)
g_resolver_get_default
Text -> Ptr Resolver -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "resolverGetDefault" Ptr Resolver
result
Resolver
result' <- ((ManagedPtr Resolver -> Resolver) -> Ptr Resolver -> IO Resolver
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Resolver -> Resolver
Resolver) Ptr Resolver
result
Resolver -> IO Resolver
forall (m :: * -> *) a. Monad m => a -> m a
return Resolver
result'
#if defined(ENABLE_OVERLOADING)
#endif