#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Soup.Callbacks
(
AddressCallback ,
AddressCallback_WithClosures ,
C_AddressCallback ,
drop_closures_AddressCallback ,
dynamic_AddressCallback ,
genClosure_AddressCallback ,
mk_AddressCallback ,
noAddressCallback ,
noAddressCallback_WithClosures ,
wrap_AddressCallback ,
AuthDomainBasicAuthCallback ,
AuthDomainBasicAuthCallback_WithClosures,
C_AuthDomainBasicAuthCallback ,
drop_closures_AuthDomainBasicAuthCallback,
dynamic_AuthDomainBasicAuthCallback ,
genClosure_AuthDomainBasicAuthCallback ,
mk_AuthDomainBasicAuthCallback ,
noAuthDomainBasicAuthCallback ,
noAuthDomainBasicAuthCallback_WithClosures,
wrap_AuthDomainBasicAuthCallback ,
AuthDomainDigestAuthCallback ,
AuthDomainDigestAuthCallback_WithClosures,
C_AuthDomainDigestAuthCallback ,
drop_closures_AuthDomainDigestAuthCallback,
dynamic_AuthDomainDigestAuthCallback ,
genClosure_AuthDomainDigestAuthCallback ,
mk_AuthDomainDigestAuthCallback ,
noAuthDomainDigestAuthCallback ,
noAuthDomainDigestAuthCallback_WithClosures,
wrap_AuthDomainDigestAuthCallback ,
AuthDomainFilter ,
AuthDomainFilter_WithClosures ,
C_AuthDomainFilter ,
drop_closures_AuthDomainFilter ,
dynamic_AuthDomainFilter ,
genClosure_AuthDomainFilter ,
mk_AuthDomainFilter ,
noAuthDomainFilter ,
noAuthDomainFilter_WithClosures ,
wrap_AuthDomainFilter ,
AuthDomainGenericAuthCallback ,
AuthDomainGenericAuthCallback_WithClosures,
C_AuthDomainGenericAuthCallback ,
drop_closures_AuthDomainGenericAuthCallback,
dynamic_AuthDomainGenericAuthCallback ,
genClosure_AuthDomainGenericAuthCallback,
mk_AuthDomainGenericAuthCallback ,
noAuthDomainGenericAuthCallback ,
noAuthDomainGenericAuthCallback_WithClosures,
wrap_AuthDomainGenericAuthCallback ,
C_ChunkAllocator ,
ChunkAllocator ,
ChunkAllocator_WithClosures ,
drop_closures_ChunkAllocator ,
dynamic_ChunkAllocator ,
genClosure_ChunkAllocator ,
mk_ChunkAllocator ,
noChunkAllocator ,
noChunkAllocator_WithClosures ,
wrap_ChunkAllocator ,
C_LoggerFilter ,
LoggerFilter ,
LoggerFilter_WithClosures ,
drop_closures_LoggerFilter ,
dynamic_LoggerFilter ,
genClosure_LoggerFilter ,
mk_LoggerFilter ,
noLoggerFilter ,
noLoggerFilter_WithClosures ,
wrap_LoggerFilter ,
C_LoggerPrinter ,
LoggerPrinter ,
LoggerPrinter_WithClosures ,
drop_closures_LoggerPrinter ,
dynamic_LoggerPrinter ,
genClosure_LoggerPrinter ,
mk_LoggerPrinter ,
noLoggerPrinter ,
noLoggerPrinter_WithClosures ,
wrap_LoggerPrinter ,
C_MessageHeadersForeachFunc ,
MessageHeadersForeachFunc ,
MessageHeadersForeachFunc_WithClosures ,
drop_closures_MessageHeadersForeachFunc ,
dynamic_MessageHeadersForeachFunc ,
genClosure_MessageHeadersForeachFunc ,
mk_MessageHeadersForeachFunc ,
noMessageHeadersForeachFunc ,
noMessageHeadersForeachFunc_WithClosures,
wrap_MessageHeadersForeachFunc ,
C_PasswordManagerCallback ,
PasswordManagerCallback ,
PasswordManagerCallback_WithClosures ,
drop_closures_PasswordManagerCallback ,
dynamic_PasswordManagerCallback ,
genClosure_PasswordManagerCallback ,
mk_PasswordManagerCallback ,
noPasswordManagerCallback ,
noPasswordManagerCallback_WithClosures ,
wrap_PasswordManagerCallback ,
C_ProxyResolverCallback ,
ProxyResolverCallback ,
ProxyResolverCallback_WithClosures ,
drop_closures_ProxyResolverCallback ,
dynamic_ProxyResolverCallback ,
genClosure_ProxyResolverCallback ,
mk_ProxyResolverCallback ,
noProxyResolverCallback ,
noProxyResolverCallback_WithClosures ,
wrap_ProxyResolverCallback ,
C_ProxyURIResolverCallback ,
ProxyURIResolverCallback ,
ProxyURIResolverCallback_WithClosures ,
drop_closures_ProxyURIResolverCallback ,
dynamic_ProxyURIResolverCallback ,
genClosure_ProxyURIResolverCallback ,
mk_ProxyURIResolverCallback ,
noProxyURIResolverCallback ,
noProxyURIResolverCallback_WithClosures ,
wrap_ProxyURIResolverCallback ,
C_ServerCallback ,
ServerCallback ,
ServerCallback_WithClosures ,
drop_closures_ServerCallback ,
dynamic_ServerCallback ,
genClosure_ServerCallback ,
mk_ServerCallback ,
noServerCallback ,
noServerCallback_WithClosures ,
wrap_ServerCallback ,
C_ServerWebsocketCallback ,
ServerWebsocketCallback ,
ServerWebsocketCallback_WithClosures ,
drop_closures_ServerWebsocketCallback ,
dynamic_ServerWebsocketCallback ,
genClosure_ServerWebsocketCallback ,
mk_ServerWebsocketCallback ,
noServerWebsocketCallback ,
noServerWebsocketCallback_WithClosures ,
wrap_ServerWebsocketCallback ,
C_SessionCallback ,
SessionCallback ,
SessionCallback_WithClosures ,
drop_closures_SessionCallback ,
dynamic_SessionCallback ,
genClosure_SessionCallback ,
mk_SessionCallback ,
noSessionCallback ,
noSessionCallback_WithClosures ,
wrap_SessionCallback ,
C_SessionConnectProgressCallback ,
SessionConnectProgressCallback ,
SessionConnectProgressCallback_WithClosures,
drop_closures_SessionConnectProgressCallback,
dynamic_SessionConnectProgressCallback ,
genClosure_SessionConnectProgressCallback,
mk_SessionConnectProgressCallback ,
noSessionConnectProgressCallback ,
noSessionConnectProgressCallback_WithClosures,
wrap_SessionConnectProgressCallback ,
C_SocketCallback ,
SocketCallback ,
SocketCallback_WithClosures ,
drop_closures_SocketCallback ,
dynamic_SocketCallback ,
genClosure_SocketCallback ,
mk_SocketCallback ,
noSocketCallback ,
noSocketCallback_WithClosures ,
wrap_SocketCallback ,
) 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.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 Control.Monad.IO.Class as MIO
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.Gio.Enums as Gio.Enums
import qualified GI.Gio.Objects.IOStream as Gio.IOStream
import {-# SOURCE #-} qualified GI.Soup.Enums as Soup.Enums
import {-# SOURCE #-} qualified GI.Soup.Interfaces.PasswordManager as Soup.PasswordManager
import {-# SOURCE #-} qualified GI.Soup.Interfaces.ProxyResolver as Soup.ProxyResolver
import {-# SOURCE #-} qualified GI.Soup.Interfaces.ProxyURIResolver as Soup.ProxyURIResolver
import {-# SOURCE #-} qualified GI.Soup.Objects.Address as Soup.Address
import {-# SOURCE #-} qualified GI.Soup.Objects.Auth as Soup.Auth
import {-# SOURCE #-} qualified GI.Soup.Objects.AuthDomain as Soup.AuthDomain
import {-# SOURCE #-} qualified GI.Soup.Objects.AuthDomainBasic as Soup.AuthDomainBasic
import {-# SOURCE #-} qualified GI.Soup.Objects.AuthDomainDigest as Soup.AuthDomainDigest
import {-# SOURCE #-} qualified GI.Soup.Objects.Logger as Soup.Logger
import {-# SOURCE #-} qualified GI.Soup.Objects.Message as Soup.Message
import {-# SOURCE #-} qualified GI.Soup.Objects.Server as Soup.Server
import {-# SOURCE #-} qualified GI.Soup.Objects.Session as Soup.Session
import {-# SOURCE #-} qualified GI.Soup.Objects.Socket as Soup.Socket
import {-# SOURCE #-} qualified GI.Soup.Objects.WebsocketConnection as Soup.WebsocketConnection
import {-# SOURCE #-} qualified GI.Soup.Structs.Buffer as Soup.Buffer
import {-# SOURCE #-} qualified GI.Soup.Structs.ClientContext as Soup.ClientContext
import {-# SOURCE #-} qualified GI.Soup.Structs.URI as Soup.URI
type C_SocketCallback =
Ptr Soup.Socket.Socket ->
Word32 ->
Ptr () ->
IO ()
foreign import ccall "dynamic" __dynamic_C_SocketCallback :: FunPtr C_SocketCallback -> C_SocketCallback
dynamic_SocketCallback ::
(B.CallStack.HasCallStack, MonadIO m, Soup.Socket.IsSocket a) =>
FunPtr C_SocketCallback
-> a
-> Word32
-> Ptr ()
-> m ()
dynamic_SocketCallback :: FunPtr C_SocketCallback -> a -> Word32 -> Ptr () -> m ()
dynamic_SocketCallback FunPtr C_SocketCallback
__funPtr a
sock Word32
status Ptr ()
userData = 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 Socket
sock' <- a -> IO (Ptr Socket)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
sock
(FunPtr C_SocketCallback -> C_SocketCallback
__dynamic_C_SocketCallback FunPtr C_SocketCallback
__funPtr) Ptr Socket
sock' Word32
status Ptr ()
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
sock
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
foreign import ccall "wrapper"
mk_SocketCallback :: C_SocketCallback -> IO (FunPtr C_SocketCallback)
type SocketCallback =
Soup.Socket.Socket
-> Word32
-> IO ()
noSocketCallback :: Maybe SocketCallback
noSocketCallback :: Maybe SocketCallback
noSocketCallback = Maybe SocketCallback
forall a. Maybe a
Nothing
type SocketCallback_WithClosures =
Soup.Socket.Socket
-> Word32
-> Ptr ()
-> IO ()
noSocketCallback_WithClosures :: Maybe SocketCallback_WithClosures
noSocketCallback_WithClosures :: Maybe SocketCallback_WithClosures
noSocketCallback_WithClosures = Maybe SocketCallback_WithClosures
forall a. Maybe a
Nothing
drop_closures_SocketCallback :: SocketCallback -> SocketCallback_WithClosures
drop_closures_SocketCallback :: SocketCallback -> SocketCallback_WithClosures
drop_closures_SocketCallback SocketCallback
_f Socket
sock Word32
status Ptr ()
_ = SocketCallback
_f Socket
sock Word32
status
genClosure_SocketCallback :: MonadIO m => SocketCallback -> m (GClosure C_SocketCallback)
genClosure_SocketCallback :: SocketCallback -> m (GClosure C_SocketCallback)
genClosure_SocketCallback SocketCallback
cb = IO (GClosure C_SocketCallback) -> m (GClosure C_SocketCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_SocketCallback) -> m (GClosure C_SocketCallback))
-> IO (GClosure C_SocketCallback) -> m (GClosure C_SocketCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: SocketCallback_WithClosures
cb' = SocketCallback -> SocketCallback_WithClosures
drop_closures_SocketCallback SocketCallback
cb
let cb'' :: C_SocketCallback
cb'' = Maybe (Ptr (FunPtr C_SocketCallback))
-> SocketCallback_WithClosures -> C_SocketCallback
wrap_SocketCallback Maybe (Ptr (FunPtr C_SocketCallback))
forall a. Maybe a
Nothing SocketCallback_WithClosures
cb'
C_SocketCallback -> IO (FunPtr C_SocketCallback)
mk_SocketCallback C_SocketCallback
cb'' IO (FunPtr C_SocketCallback)
-> (FunPtr C_SocketCallback -> IO (GClosure C_SocketCallback))
-> IO (GClosure C_SocketCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_SocketCallback -> IO (GClosure C_SocketCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_SocketCallback ::
Maybe (Ptr (FunPtr C_SocketCallback)) ->
SocketCallback_WithClosures ->
C_SocketCallback
wrap_SocketCallback :: Maybe (Ptr (FunPtr C_SocketCallback))
-> SocketCallback_WithClosures -> C_SocketCallback
wrap_SocketCallback Maybe (Ptr (FunPtr C_SocketCallback))
funptrptr SocketCallback_WithClosures
_cb Ptr Socket
sock Word32
status Ptr ()
userData = do
Socket
sock' <- ((ManagedPtr Socket -> Socket) -> Ptr Socket -> IO Socket
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Socket -> Socket
Soup.Socket.Socket) Ptr Socket
sock
SocketCallback_WithClosures
_cb Socket
sock' Word32
status Ptr ()
userData
Maybe (Ptr (FunPtr C_SocketCallback)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_SocketCallback))
funptrptr
type C_SessionConnectProgressCallback =
Ptr Soup.Session.Session ->
CUInt ->
Ptr Gio.IOStream.IOStream ->
Ptr () ->
IO ()
foreign import ccall "dynamic" __dynamic_C_SessionConnectProgressCallback :: FunPtr C_SessionConnectProgressCallback -> C_SessionConnectProgressCallback
dynamic_SessionConnectProgressCallback ::
(B.CallStack.HasCallStack, MonadIO m, Soup.Session.IsSession a, Gio.IOStream.IsIOStream b) =>
FunPtr C_SessionConnectProgressCallback
-> a
-> Gio.Enums.SocketClientEvent
-> b
-> Ptr ()
-> m ()
dynamic_SessionConnectProgressCallback :: FunPtr C_SessionConnectProgressCallback
-> a -> SocketClientEvent -> b -> Ptr () -> m ()
dynamic_SessionConnectProgressCallback FunPtr C_SessionConnectProgressCallback
__funPtr a
session SocketClientEvent
event b
connection Ptr ()
userData = 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 Session
session' <- a -> IO (Ptr Session)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
session
let event' :: CUInt
event' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (SocketClientEvent -> Int) -> SocketClientEvent -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SocketClientEvent -> Int
forall a. Enum a => a -> Int
fromEnum) SocketClientEvent
event
Ptr IOStream
connection' <- b -> IO (Ptr IOStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
connection
(FunPtr C_SessionConnectProgressCallback
-> C_SessionConnectProgressCallback
__dynamic_C_SessionConnectProgressCallback FunPtr C_SessionConnectProgressCallback
__funPtr) Ptr Session
session' CUInt
event' Ptr IOStream
connection' Ptr ()
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
session
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
connection
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
foreign import ccall "wrapper"
mk_SessionConnectProgressCallback :: C_SessionConnectProgressCallback -> IO (FunPtr C_SessionConnectProgressCallback)
type SessionConnectProgressCallback =
Soup.Session.Session
-> Gio.Enums.SocketClientEvent
-> Gio.IOStream.IOStream
-> IO ()
noSessionConnectProgressCallback :: Maybe SessionConnectProgressCallback
noSessionConnectProgressCallback :: Maybe SessionConnectProgressCallback
noSessionConnectProgressCallback = Maybe SessionConnectProgressCallback
forall a. Maybe a
Nothing
type SessionConnectProgressCallback_WithClosures =
Soup.Session.Session
-> Gio.Enums.SocketClientEvent
-> Gio.IOStream.IOStream
-> Ptr ()
-> IO ()
noSessionConnectProgressCallback_WithClosures :: Maybe SessionConnectProgressCallback_WithClosures
noSessionConnectProgressCallback_WithClosures :: Maybe SessionConnectProgressCallback_WithClosures
noSessionConnectProgressCallback_WithClosures = Maybe SessionConnectProgressCallback_WithClosures
forall a. Maybe a
Nothing
drop_closures_SessionConnectProgressCallback :: SessionConnectProgressCallback -> SessionConnectProgressCallback_WithClosures
drop_closures_SessionConnectProgressCallback :: SessionConnectProgressCallback
-> SessionConnectProgressCallback_WithClosures
drop_closures_SessionConnectProgressCallback SessionConnectProgressCallback
_f Session
session SocketClientEvent
event IOStream
connection Ptr ()
_ = SessionConnectProgressCallback
_f Session
session SocketClientEvent
event IOStream
connection
genClosure_SessionConnectProgressCallback :: MonadIO m => SessionConnectProgressCallback -> m (GClosure C_SessionConnectProgressCallback)
genClosure_SessionConnectProgressCallback :: SessionConnectProgressCallback
-> m (GClosure C_SessionConnectProgressCallback)
genClosure_SessionConnectProgressCallback SessionConnectProgressCallback
cb = IO (GClosure C_SessionConnectProgressCallback)
-> m (GClosure C_SessionConnectProgressCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_SessionConnectProgressCallback)
-> m (GClosure C_SessionConnectProgressCallback))
-> IO (GClosure C_SessionConnectProgressCallback)
-> m (GClosure C_SessionConnectProgressCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: SessionConnectProgressCallback_WithClosures
cb' = SessionConnectProgressCallback
-> SessionConnectProgressCallback_WithClosures
drop_closures_SessionConnectProgressCallback SessionConnectProgressCallback
cb
let cb'' :: C_SessionConnectProgressCallback
cb'' = Maybe (Ptr (FunPtr C_SessionConnectProgressCallback))
-> SessionConnectProgressCallback_WithClosures
-> C_SessionConnectProgressCallback
wrap_SessionConnectProgressCallback Maybe (Ptr (FunPtr C_SessionConnectProgressCallback))
forall a. Maybe a
Nothing SessionConnectProgressCallback_WithClosures
cb'
C_SessionConnectProgressCallback
-> IO (FunPtr C_SessionConnectProgressCallback)
mk_SessionConnectProgressCallback C_SessionConnectProgressCallback
cb'' IO (FunPtr C_SessionConnectProgressCallback)
-> (FunPtr C_SessionConnectProgressCallback
-> IO (GClosure C_SessionConnectProgressCallback))
-> IO (GClosure C_SessionConnectProgressCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_SessionConnectProgressCallback
-> IO (GClosure C_SessionConnectProgressCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_SessionConnectProgressCallback ::
Maybe (Ptr (FunPtr C_SessionConnectProgressCallback)) ->
SessionConnectProgressCallback_WithClosures ->
C_SessionConnectProgressCallback
wrap_SessionConnectProgressCallback :: Maybe (Ptr (FunPtr C_SessionConnectProgressCallback))
-> SessionConnectProgressCallback_WithClosures
-> C_SessionConnectProgressCallback
wrap_SessionConnectProgressCallback Maybe (Ptr (FunPtr C_SessionConnectProgressCallback))
funptrptr SessionConnectProgressCallback_WithClosures
_cb Ptr Session
session CUInt
event Ptr IOStream
connection Ptr ()
userData = do
Session
session' <- ((ManagedPtr Session -> Session) -> Ptr Session -> IO Session
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Session -> Session
Soup.Session.Session) Ptr Session
session
let event' :: SocketClientEvent
event' = (Int -> SocketClientEvent
forall a. Enum a => Int -> a
toEnum (Int -> SocketClientEvent)
-> (CUInt -> Int) -> CUInt -> SocketClientEvent
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
event
IOStream
connection' <- ((ManagedPtr IOStream -> IOStream) -> Ptr IOStream -> IO IOStream
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr IOStream -> IOStream
Gio.IOStream.IOStream) Ptr IOStream
connection
SessionConnectProgressCallback_WithClosures
_cb Session
session' SocketClientEvent
event' IOStream
connection' Ptr ()
userData
Maybe (Ptr (FunPtr C_SessionConnectProgressCallback)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_SessionConnectProgressCallback))
funptrptr
type C_SessionCallback =
Ptr Soup.Session.Session ->
Ptr Soup.Message.Message ->
Ptr () ->
IO ()
foreign import ccall "dynamic" __dynamic_C_SessionCallback :: FunPtr C_SessionCallback -> C_SessionCallback
dynamic_SessionCallback ::
(B.CallStack.HasCallStack, MonadIO m, Soup.Session.IsSession a, Soup.Message.IsMessage b) =>
FunPtr C_SessionCallback
-> a
-> b
-> Ptr ()
-> m ()
dynamic_SessionCallback :: FunPtr C_SessionCallback -> a -> b -> Ptr () -> m ()
dynamic_SessionCallback FunPtr C_SessionCallback
__funPtr a
session b
msg Ptr ()
userData = 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 Session
session' <- a -> IO (Ptr Session)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
session
Ptr Message
msg' <- b -> IO (Ptr Message)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
msg
(FunPtr C_SessionCallback -> C_SessionCallback
__dynamic_C_SessionCallback FunPtr C_SessionCallback
__funPtr) Ptr Session
session' Ptr Message
msg' Ptr ()
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
session
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
msg
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
foreign import ccall "wrapper"
mk_SessionCallback :: C_SessionCallback -> IO (FunPtr C_SessionCallback)
type SessionCallback =
Soup.Session.Session
-> Soup.Message.Message
-> IO ()
noSessionCallback :: Maybe SessionCallback
noSessionCallback :: Maybe SessionCallback
noSessionCallback = Maybe SessionCallback
forall a. Maybe a
Nothing
type SessionCallback_WithClosures =
Soup.Session.Session
-> Soup.Message.Message
-> Ptr ()
-> IO ()
noSessionCallback_WithClosures :: Maybe SessionCallback_WithClosures
noSessionCallback_WithClosures :: Maybe SessionCallback_WithClosures
noSessionCallback_WithClosures = Maybe SessionCallback_WithClosures
forall a. Maybe a
Nothing
drop_closures_SessionCallback :: SessionCallback -> SessionCallback_WithClosures
drop_closures_SessionCallback :: SessionCallback -> SessionCallback_WithClosures
drop_closures_SessionCallback SessionCallback
_f Session
session Message
msg Ptr ()
_ = SessionCallback
_f Session
session Message
msg
genClosure_SessionCallback :: MonadIO m => SessionCallback -> m (GClosure C_SessionCallback)
genClosure_SessionCallback :: SessionCallback -> m (GClosure C_SessionCallback)
genClosure_SessionCallback SessionCallback
cb = IO (GClosure C_SessionCallback) -> m (GClosure C_SessionCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_SessionCallback) -> m (GClosure C_SessionCallback))
-> IO (GClosure C_SessionCallback)
-> m (GClosure C_SessionCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: SessionCallback_WithClosures
cb' = SessionCallback -> SessionCallback_WithClosures
drop_closures_SessionCallback SessionCallback
cb
let cb'' :: C_SessionCallback
cb'' = Maybe (Ptr (FunPtr C_SessionCallback))
-> SessionCallback_WithClosures -> C_SessionCallback
wrap_SessionCallback Maybe (Ptr (FunPtr C_SessionCallback))
forall a. Maybe a
Nothing SessionCallback_WithClosures
cb'
C_SessionCallback -> IO (FunPtr C_SessionCallback)
mk_SessionCallback C_SessionCallback
cb'' IO (FunPtr C_SessionCallback)
-> (FunPtr C_SessionCallback -> IO (GClosure C_SessionCallback))
-> IO (GClosure C_SessionCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_SessionCallback -> IO (GClosure C_SessionCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_SessionCallback ::
Maybe (Ptr (FunPtr C_SessionCallback)) ->
SessionCallback_WithClosures ->
C_SessionCallback
wrap_SessionCallback :: Maybe (Ptr (FunPtr C_SessionCallback))
-> SessionCallback_WithClosures -> C_SessionCallback
wrap_SessionCallback Maybe (Ptr (FunPtr C_SessionCallback))
funptrptr SessionCallback_WithClosures
_cb Ptr Session
session Ptr Message
msg Ptr ()
userData = do
Session
session' <- ((ManagedPtr Session -> Session) -> Ptr Session -> IO Session
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Session -> Session
Soup.Session.Session) Ptr Session
session
Message
msg' <- ((ManagedPtr Message -> Message) -> Ptr Message -> IO Message
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Message -> Message
Soup.Message.Message) Ptr Message
msg
SessionCallback_WithClosures
_cb Session
session' Message
msg' Ptr ()
userData
Maybe (Ptr (FunPtr C_SessionCallback)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_SessionCallback))
funptrptr
type C_ServerWebsocketCallback =
Ptr Soup.Server.Server ->
Ptr Soup.WebsocketConnection.WebsocketConnection ->
CString ->
Ptr Soup.ClientContext.ClientContext ->
Ptr () ->
IO ()
foreign import ccall "dynamic" __dynamic_C_ServerWebsocketCallback :: FunPtr C_ServerWebsocketCallback -> C_ServerWebsocketCallback
dynamic_ServerWebsocketCallback ::
(B.CallStack.HasCallStack, MonadIO m, Soup.Server.IsServer a, Soup.WebsocketConnection.IsWebsocketConnection b) =>
FunPtr C_ServerWebsocketCallback
-> a
-> b
-> T.Text
-> Soup.ClientContext.ClientContext
-> Ptr ()
-> m ()
dynamic_ServerWebsocketCallback :: FunPtr C_ServerWebsocketCallback
-> a -> b -> Text -> ClientContext -> Ptr () -> m ()
dynamic_ServerWebsocketCallback FunPtr C_ServerWebsocketCallback
__funPtr a
server b
connection Text
path ClientContext
client Ptr ()
userData = 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 Server
server' <- a -> IO (Ptr Server)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
server
Ptr WebsocketConnection
connection' <- b -> IO (Ptr WebsocketConnection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
connection
CString
path' <- Text -> IO CString
textToCString Text
path
Ptr ClientContext
client' <- ClientContext -> IO (Ptr ClientContext)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ClientContext
client
(FunPtr C_ServerWebsocketCallback -> C_ServerWebsocketCallback
__dynamic_C_ServerWebsocketCallback FunPtr C_ServerWebsocketCallback
__funPtr) Ptr Server
server' Ptr WebsocketConnection
connection' CString
path' Ptr ClientContext
client' Ptr ()
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
server
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
connection
ClientContext -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ClientContext
client
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
path'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
foreign import ccall "wrapper"
mk_ServerWebsocketCallback :: C_ServerWebsocketCallback -> IO (FunPtr C_ServerWebsocketCallback)
type ServerWebsocketCallback =
Soup.Server.Server
-> Soup.WebsocketConnection.WebsocketConnection
-> T.Text
-> Soup.ClientContext.ClientContext
-> IO ()
noServerWebsocketCallback :: Maybe ServerWebsocketCallback
noServerWebsocketCallback :: Maybe ServerWebsocketCallback
noServerWebsocketCallback = Maybe ServerWebsocketCallback
forall a. Maybe a
Nothing
type ServerWebsocketCallback_WithClosures =
Soup.Server.Server
-> Soup.WebsocketConnection.WebsocketConnection
-> T.Text
-> Soup.ClientContext.ClientContext
-> Ptr ()
-> IO ()
noServerWebsocketCallback_WithClosures :: Maybe ServerWebsocketCallback_WithClosures
noServerWebsocketCallback_WithClosures :: Maybe ServerWebsocketCallback_WithClosures
noServerWebsocketCallback_WithClosures = Maybe ServerWebsocketCallback_WithClosures
forall a. Maybe a
Nothing
drop_closures_ServerWebsocketCallback :: ServerWebsocketCallback -> ServerWebsocketCallback_WithClosures
drop_closures_ServerWebsocketCallback :: ServerWebsocketCallback -> ServerWebsocketCallback_WithClosures
drop_closures_ServerWebsocketCallback ServerWebsocketCallback
_f Server
server WebsocketConnection
connection Text
path ClientContext
client Ptr ()
_ = ServerWebsocketCallback
_f Server
server WebsocketConnection
connection Text
path ClientContext
client
genClosure_ServerWebsocketCallback :: MonadIO m => ServerWebsocketCallback -> m (GClosure C_ServerWebsocketCallback)
genClosure_ServerWebsocketCallback :: ServerWebsocketCallback -> m (GClosure C_ServerWebsocketCallback)
genClosure_ServerWebsocketCallback ServerWebsocketCallback
cb = IO (GClosure C_ServerWebsocketCallback)
-> m (GClosure C_ServerWebsocketCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_ServerWebsocketCallback)
-> m (GClosure C_ServerWebsocketCallback))
-> IO (GClosure C_ServerWebsocketCallback)
-> m (GClosure C_ServerWebsocketCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: ServerWebsocketCallback_WithClosures
cb' = ServerWebsocketCallback -> ServerWebsocketCallback_WithClosures
drop_closures_ServerWebsocketCallback ServerWebsocketCallback
cb
let cb'' :: C_ServerWebsocketCallback
cb'' = Maybe (Ptr (FunPtr C_ServerWebsocketCallback))
-> ServerWebsocketCallback_WithClosures
-> C_ServerWebsocketCallback
wrap_ServerWebsocketCallback Maybe (Ptr (FunPtr C_ServerWebsocketCallback))
forall a. Maybe a
Nothing ServerWebsocketCallback_WithClosures
cb'
C_ServerWebsocketCallback -> IO (FunPtr C_ServerWebsocketCallback)
mk_ServerWebsocketCallback C_ServerWebsocketCallback
cb'' IO (FunPtr C_ServerWebsocketCallback)
-> (FunPtr C_ServerWebsocketCallback
-> IO (GClosure C_ServerWebsocketCallback))
-> IO (GClosure C_ServerWebsocketCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_ServerWebsocketCallback
-> IO (GClosure C_ServerWebsocketCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_ServerWebsocketCallback ::
Maybe (Ptr (FunPtr C_ServerWebsocketCallback)) ->
ServerWebsocketCallback_WithClosures ->
C_ServerWebsocketCallback
wrap_ServerWebsocketCallback :: Maybe (Ptr (FunPtr C_ServerWebsocketCallback))
-> ServerWebsocketCallback_WithClosures
-> C_ServerWebsocketCallback
wrap_ServerWebsocketCallback Maybe (Ptr (FunPtr C_ServerWebsocketCallback))
funptrptr ServerWebsocketCallback_WithClosures
_cb Ptr Server
server Ptr WebsocketConnection
connection CString
path Ptr ClientContext
client Ptr ()
userData = do
Server
server' <- ((ManagedPtr Server -> Server) -> Ptr Server -> IO Server
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Server -> Server
Soup.Server.Server) Ptr Server
server
WebsocketConnection
connection' <- ((ManagedPtr WebsocketConnection -> WebsocketConnection)
-> Ptr WebsocketConnection -> IO WebsocketConnection
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr WebsocketConnection -> WebsocketConnection
Soup.WebsocketConnection.WebsocketConnection) Ptr WebsocketConnection
connection
Text
path' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
path
(ManagedPtr ClientContext -> ClientContext)
-> Ptr ClientContext -> (ClientContext -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr ClientContext -> ClientContext
Soup.ClientContext.ClientContext Ptr ClientContext
client ((ClientContext -> IO ()) -> IO ())
-> (ClientContext -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ClientContext
client' -> do
ServerWebsocketCallback_WithClosures
_cb Server
server' WebsocketConnection
connection' Text
path' ClientContext
client' Ptr ()
userData
Maybe (Ptr (FunPtr C_ServerWebsocketCallback)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_ServerWebsocketCallback))
funptrptr
type C_ServerCallback =
Ptr Soup.Server.Server ->
Ptr Soup.Message.Message ->
CString ->
Ptr (GHashTable CString CString) ->
Ptr Soup.ClientContext.ClientContext ->
Ptr () ->
IO ()
foreign import ccall "dynamic" __dynamic_C_ServerCallback :: FunPtr C_ServerCallback -> C_ServerCallback
dynamic_ServerCallback ::
(B.CallStack.HasCallStack, MonadIO m, Soup.Server.IsServer a, Soup.Message.IsMessage b) =>
FunPtr C_ServerCallback
-> a
-> b
-> T.Text
-> Maybe (Map.Map T.Text T.Text)
-> Soup.ClientContext.ClientContext
-> Ptr ()
-> m ()
dynamic_ServerCallback :: FunPtr C_ServerCallback
-> a
-> b
-> Text
-> Maybe (Map Text Text)
-> ClientContext
-> Ptr ()
-> m ()
dynamic_ServerCallback FunPtr C_ServerCallback
__funPtr a
server b
msg Text
path Maybe (Map Text Text)
query ClientContext
client Ptr ()
userData = 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 Server
server' <- a -> IO (Ptr Server)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
server
Ptr Message
msg' <- b -> IO (Ptr Message)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
msg
CString
path' <- Text -> IO CString
textToCString Text
path
Ptr (GHashTable CString CString)
maybeQuery <- case Maybe (Map Text Text)
query of
Maybe (Map Text Text)
Nothing -> Ptr (GHashTable CString CString)
-> IO (Ptr (GHashTable CString CString))
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr (GHashTable CString CString)
forall a. Ptr a
nullPtr
Just Map Text Text
jQuery -> do
let jQuery' :: [(Text, Text)]
jQuery' = Map Text Text -> [(Text, Text)]
forall k a. Map k a -> [(k, a)]
Map.toList Map Text Text
jQuery
[(CString, Text)]
jQuery'' <- (Text -> IO CString) -> [(Text, Text)] -> IO [(CString, Text)]
forall (f :: * -> *) a c b.
Applicative f =>
(a -> f c) -> [(a, b)] -> f [(c, b)]
mapFirstA Text -> IO CString
textToCString [(Text, Text)]
jQuery'
[(CString, CString)]
jQuery''' <- (Text -> IO CString)
-> [(CString, Text)] -> IO [(CString, CString)]
forall (f :: * -> *) b c a.
Applicative f =>
(b -> f c) -> [(a, b)] -> f [(a, c)]
mapSecondA Text -> IO CString
textToCString [(CString, Text)]
jQuery''
let jQuery'''' :: [(PtrWrapped CString, CString)]
jQuery'''' = (CString -> PtrWrapped CString)
-> [(CString, CString)] -> [(PtrWrapped CString, CString)]
forall a c b. (a -> c) -> [(a, b)] -> [(c, b)]
mapFirst CString -> PtrWrapped CString
cstringPackPtr [(CString, CString)]
jQuery'''
let jQuery''''' :: [(PtrWrapped CString, PtrWrapped CString)]
jQuery''''' = (CString -> PtrWrapped CString)
-> [(PtrWrapped CString, CString)]
-> [(PtrWrapped CString, PtrWrapped CString)]
forall b c a. (b -> c) -> [(a, b)] -> [(a, c)]
mapSecond CString -> PtrWrapped CString
cstringPackPtr [(PtrWrapped CString, CString)]
jQuery''''
Ptr (GHashTable CString CString)
jQuery'''''' <- GHashFunc CString
-> GEqualFunc CString
-> Maybe (GDestroyNotify CString)
-> Maybe (GDestroyNotify CString)
-> [(PtrWrapped CString, PtrWrapped CString)]
-> IO (Ptr (GHashTable CString CString))
forall a b.
GHashFunc a
-> GEqualFunc a
-> Maybe (GDestroyNotify a)
-> Maybe (GDestroyNotify b)
-> [(PtrWrapped a, PtrWrapped b)]
-> IO (Ptr (GHashTable a b))
packGHashTable GHashFunc CString
gStrHash GEqualFunc CString
gStrEqual (GDestroyNotify CString -> Maybe (GDestroyNotify CString)
forall a. a -> Maybe a
Just GDestroyNotify CString
forall a. FunPtr (Ptr a -> IO ())
ptr_to_g_free) (GDestroyNotify CString -> Maybe (GDestroyNotify CString)
forall a. a -> Maybe a
Just GDestroyNotify CString
forall a. FunPtr (Ptr a -> IO ())
ptr_to_g_free) [(PtrWrapped CString, PtrWrapped CString)]
jQuery'''''
Ptr (GHashTable CString CString)
-> IO (Ptr (GHashTable CString CString))
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr (GHashTable CString CString)
jQuery''''''
Ptr ClientContext
client' <- ClientContext -> IO (Ptr ClientContext)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ClientContext
client
(FunPtr C_ServerCallback -> C_ServerCallback
__dynamic_C_ServerCallback FunPtr C_ServerCallback
__funPtr) Ptr Server
server' Ptr Message
msg' CString
path' Ptr (GHashTable CString CString)
maybeQuery Ptr ClientContext
client' Ptr ()
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
server
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
msg
ClientContext -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ClientContext
client
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
path'
Ptr (GHashTable CString CString) -> IO ()
forall a b. Ptr (GHashTable a b) -> IO ()
unrefGHashTable Ptr (GHashTable CString CString)
maybeQuery
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
foreign import ccall "wrapper"
mk_ServerCallback :: C_ServerCallback -> IO (FunPtr C_ServerCallback)
type ServerCallback =
Soup.Server.Server
-> Soup.Message.Message
-> T.Text
-> Maybe (Map.Map T.Text T.Text)
-> Soup.ClientContext.ClientContext
-> IO ()
noServerCallback :: Maybe ServerCallback
noServerCallback :: Maybe ServerCallback
noServerCallback = Maybe ServerCallback
forall a. Maybe a
Nothing
type ServerCallback_WithClosures =
Soup.Server.Server
-> Soup.Message.Message
-> T.Text
-> Maybe (Map.Map T.Text T.Text)
-> Soup.ClientContext.ClientContext
-> Ptr ()
-> IO ()
noServerCallback_WithClosures :: Maybe ServerCallback_WithClosures
noServerCallback_WithClosures :: Maybe ServerCallback_WithClosures
noServerCallback_WithClosures = Maybe ServerCallback_WithClosures
forall a. Maybe a
Nothing
drop_closures_ServerCallback :: ServerCallback -> ServerCallback_WithClosures
drop_closures_ServerCallback :: ServerCallback -> ServerCallback_WithClosures
drop_closures_ServerCallback ServerCallback
_f Server
server Message
msg Text
path Maybe (Map Text Text)
query ClientContext
client Ptr ()
_ = ServerCallback
_f Server
server Message
msg Text
path Maybe (Map Text Text)
query ClientContext
client
genClosure_ServerCallback :: MonadIO m => ServerCallback -> m (GClosure C_ServerCallback)
genClosure_ServerCallback :: ServerCallback -> m (GClosure C_ServerCallback)
genClosure_ServerCallback ServerCallback
cb = IO (GClosure C_ServerCallback) -> m (GClosure C_ServerCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_ServerCallback) -> m (GClosure C_ServerCallback))
-> IO (GClosure C_ServerCallback) -> m (GClosure C_ServerCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: ServerCallback_WithClosures
cb' = ServerCallback -> ServerCallback_WithClosures
drop_closures_ServerCallback ServerCallback
cb
let cb'' :: C_ServerCallback
cb'' = Maybe (Ptr (FunPtr C_ServerCallback))
-> ServerCallback_WithClosures -> C_ServerCallback
wrap_ServerCallback Maybe (Ptr (FunPtr C_ServerCallback))
forall a. Maybe a
Nothing ServerCallback_WithClosures
cb'
C_ServerCallback -> IO (FunPtr C_ServerCallback)
mk_ServerCallback C_ServerCallback
cb'' IO (FunPtr C_ServerCallback)
-> (FunPtr C_ServerCallback -> IO (GClosure C_ServerCallback))
-> IO (GClosure C_ServerCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_ServerCallback -> IO (GClosure C_ServerCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_ServerCallback ::
Maybe (Ptr (FunPtr C_ServerCallback)) ->
ServerCallback_WithClosures ->
C_ServerCallback
wrap_ServerCallback :: Maybe (Ptr (FunPtr C_ServerCallback))
-> ServerCallback_WithClosures -> C_ServerCallback
wrap_ServerCallback Maybe (Ptr (FunPtr C_ServerCallback))
funptrptr ServerCallback_WithClosures
_cb Ptr Server
server Ptr Message
msg CString
path Ptr (GHashTable CString CString)
query Ptr ClientContext
client Ptr ()
userData = do
Server
server' <- ((ManagedPtr Server -> Server) -> Ptr Server -> IO Server
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Server -> Server
Soup.Server.Server) Ptr Server
server
Message
msg' <- ((ManagedPtr Message -> Message) -> Ptr Message -> IO Message
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Message -> Message
Soup.Message.Message) Ptr Message
msg
Text
path' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
path
Maybe (Map Text Text)
maybeQuery <-
if Ptr (GHashTable CString CString)
query Ptr (GHashTable CString CString)
-> Ptr (GHashTable CString CString) -> Bool
forall a. Eq a => a -> a -> Bool
== Ptr (GHashTable CString CString)
forall a. Ptr a
nullPtr
then Maybe (Map Text Text) -> IO (Maybe (Map Text Text))
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe (Map Text Text)
forall a. Maybe a
Nothing
else do
[(PtrWrapped CString, PtrWrapped CString)]
query' <- Ptr (GHashTable CString CString)
-> IO [(PtrWrapped CString, PtrWrapped CString)]
forall a b.
Ptr (GHashTable a b) -> IO [(PtrWrapped a, PtrWrapped b)]
unpackGHashTable Ptr (GHashTable CString CString)
query
let query'' :: [(CString, PtrWrapped CString)]
query'' = (PtrWrapped CString -> CString)
-> [(PtrWrapped CString, PtrWrapped CString)]
-> [(CString, PtrWrapped CString)]
forall a c b. (a -> c) -> [(a, b)] -> [(c, b)]
mapFirst PtrWrapped CString -> CString
cstringUnpackPtr [(PtrWrapped CString, PtrWrapped CString)]
query'
[(Text, PtrWrapped CString)]
query''' <- (CString -> IO Text)
-> [(CString, PtrWrapped CString)]
-> IO [(Text, PtrWrapped CString)]
forall (f :: * -> *) a c b.
Applicative f =>
(a -> f c) -> [(a, b)] -> f [(c, b)]
mapFirstA HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText [(CString, PtrWrapped CString)]
query''
let query'''' :: [(Text, CString)]
query'''' = (PtrWrapped CString -> CString)
-> [(Text, PtrWrapped CString)] -> [(Text, CString)]
forall b c a. (b -> c) -> [(a, b)] -> [(a, c)]
mapSecond PtrWrapped CString -> CString
cstringUnpackPtr [(Text, PtrWrapped CString)]
query'''
[(Text, Text)]
query''''' <- (CString -> IO Text) -> [(Text, CString)] -> IO [(Text, Text)]
forall (f :: * -> *) b c a.
Applicative f =>
(b -> f c) -> [(a, b)] -> f [(a, c)]
mapSecondA HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText [(Text, CString)]
query''''
let query'''''' :: Map Text Text
query'''''' = [(Text, Text)] -> Map Text Text
forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Text, Text)]
query'''''
Maybe (Map Text Text) -> IO (Maybe (Map Text Text))
forall (m :: * -> *) a. Monad m => a -> m a
return (Maybe (Map Text Text) -> IO (Maybe (Map Text Text)))
-> Maybe (Map Text Text) -> IO (Maybe (Map Text Text))
forall a b. (a -> b) -> a -> b
$ Map Text Text -> Maybe (Map Text Text)
forall a. a -> Maybe a
Just Map Text Text
query''''''
(ManagedPtr ClientContext -> ClientContext)
-> Ptr ClientContext -> (ClientContext -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr ClientContext -> ClientContext
Soup.ClientContext.ClientContext Ptr ClientContext
client ((ClientContext -> IO ()) -> IO ())
-> (ClientContext -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ClientContext
client' -> do
ServerCallback_WithClosures
_cb Server
server' Message
msg' Text
path' Maybe (Map Text Text)
maybeQuery ClientContext
client' Ptr ()
userData
Maybe (Ptr (FunPtr C_ServerCallback)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_ServerCallback))
funptrptr
type C_ProxyURIResolverCallback =
Ptr Soup.ProxyURIResolver.ProxyURIResolver ->
Word32 ->
Ptr Soup.URI.URI ->
Ptr () ->
IO ()
foreign import ccall "dynamic" __dynamic_C_ProxyURIResolverCallback :: FunPtr C_ProxyURIResolverCallback -> C_ProxyURIResolverCallback
dynamic_ProxyURIResolverCallback ::
(B.CallStack.HasCallStack, MonadIO m, Soup.ProxyURIResolver.IsProxyURIResolver a) =>
FunPtr C_ProxyURIResolverCallback
-> a
-> Word32
-> Soup.URI.URI
-> Ptr ()
-> m ()
dynamic_ProxyURIResolverCallback :: FunPtr C_ProxyURIResolverCallback
-> a -> Word32 -> URI -> Ptr () -> m ()
dynamic_ProxyURIResolverCallback FunPtr C_ProxyURIResolverCallback
__funPtr a
resolver Word32
status URI
proxyUri Ptr ()
userData = 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 ProxyURIResolver
resolver' <- a -> IO (Ptr ProxyURIResolver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resolver
Ptr URI
proxyUri' <- URI -> IO (Ptr URI)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr URI
proxyUri
(FunPtr C_ProxyURIResolverCallback -> C_ProxyURIResolverCallback
__dynamic_C_ProxyURIResolverCallback FunPtr C_ProxyURIResolverCallback
__funPtr) Ptr ProxyURIResolver
resolver' Word32
status Ptr URI
proxyUri' Ptr ()
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
resolver
URI -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr URI
proxyUri
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
foreign import ccall "wrapper"
mk_ProxyURIResolverCallback :: C_ProxyURIResolverCallback -> IO (FunPtr C_ProxyURIResolverCallback)
type ProxyURIResolverCallback =
Soup.ProxyURIResolver.ProxyURIResolver
-> Word32
-> Soup.URI.URI
-> IO ()
noProxyURIResolverCallback :: Maybe ProxyURIResolverCallback
noProxyURIResolverCallback :: Maybe ProxyURIResolverCallback
noProxyURIResolverCallback = Maybe ProxyURIResolverCallback
forall a. Maybe a
Nothing
type ProxyURIResolverCallback_WithClosures =
Soup.ProxyURIResolver.ProxyURIResolver
-> Word32
-> Soup.URI.URI
-> Ptr ()
-> IO ()
noProxyURIResolverCallback_WithClosures :: Maybe ProxyURIResolverCallback_WithClosures
noProxyURIResolverCallback_WithClosures :: Maybe ProxyURIResolverCallback_WithClosures
noProxyURIResolverCallback_WithClosures = Maybe ProxyURIResolverCallback_WithClosures
forall a. Maybe a
Nothing
drop_closures_ProxyURIResolverCallback :: ProxyURIResolverCallback -> ProxyURIResolverCallback_WithClosures
drop_closures_ProxyURIResolverCallback :: ProxyURIResolverCallback -> ProxyURIResolverCallback_WithClosures
drop_closures_ProxyURIResolverCallback ProxyURIResolverCallback
_f ProxyURIResolver
resolver Word32
status URI
proxyUri Ptr ()
_ = ProxyURIResolverCallback
_f ProxyURIResolver
resolver Word32
status URI
proxyUri
genClosure_ProxyURIResolverCallback :: MonadIO m => ProxyURIResolverCallback -> m (GClosure C_ProxyURIResolverCallback)
genClosure_ProxyURIResolverCallback :: ProxyURIResolverCallback -> m (GClosure C_ProxyURIResolverCallback)
genClosure_ProxyURIResolverCallback ProxyURIResolverCallback
cb = IO (GClosure C_ProxyURIResolverCallback)
-> m (GClosure C_ProxyURIResolverCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_ProxyURIResolverCallback)
-> m (GClosure C_ProxyURIResolverCallback))
-> IO (GClosure C_ProxyURIResolverCallback)
-> m (GClosure C_ProxyURIResolverCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: ProxyURIResolverCallback_WithClosures
cb' = ProxyURIResolverCallback -> ProxyURIResolverCallback_WithClosures
drop_closures_ProxyURIResolverCallback ProxyURIResolverCallback
cb
let cb'' :: C_ProxyURIResolverCallback
cb'' = Maybe (Ptr (FunPtr C_ProxyURIResolverCallback))
-> ProxyURIResolverCallback_WithClosures
-> C_ProxyURIResolverCallback
wrap_ProxyURIResolverCallback Maybe (Ptr (FunPtr C_ProxyURIResolverCallback))
forall a. Maybe a
Nothing ProxyURIResolverCallback_WithClosures
cb'
C_ProxyURIResolverCallback
-> IO (FunPtr C_ProxyURIResolverCallback)
mk_ProxyURIResolverCallback C_ProxyURIResolverCallback
cb'' IO (FunPtr C_ProxyURIResolverCallback)
-> (FunPtr C_ProxyURIResolverCallback
-> IO (GClosure C_ProxyURIResolverCallback))
-> IO (GClosure C_ProxyURIResolverCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_ProxyURIResolverCallback
-> IO (GClosure C_ProxyURIResolverCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_ProxyURIResolverCallback ::
Maybe (Ptr (FunPtr C_ProxyURIResolverCallback)) ->
ProxyURIResolverCallback_WithClosures ->
C_ProxyURIResolverCallback
wrap_ProxyURIResolverCallback :: Maybe (Ptr (FunPtr C_ProxyURIResolverCallback))
-> ProxyURIResolverCallback_WithClosures
-> C_ProxyURIResolverCallback
wrap_ProxyURIResolverCallback Maybe (Ptr (FunPtr C_ProxyURIResolverCallback))
funptrptr ProxyURIResolverCallback_WithClosures
_cb Ptr ProxyURIResolver
resolver Word32
status Ptr URI
proxyUri Ptr ()
userData = do
ProxyURIResolver
resolver' <- ((ManagedPtr ProxyURIResolver -> ProxyURIResolver)
-> Ptr ProxyURIResolver -> IO ProxyURIResolver
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr ProxyURIResolver -> ProxyURIResolver
Soup.ProxyURIResolver.ProxyURIResolver) Ptr ProxyURIResolver
resolver
(ManagedPtr URI -> URI) -> Ptr URI -> (URI -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr URI -> URI
Soup.URI.URI Ptr URI
proxyUri ((URI -> IO ()) -> IO ()) -> (URI -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \URI
proxyUri' -> do
ProxyURIResolverCallback_WithClosures
_cb ProxyURIResolver
resolver' Word32
status URI
proxyUri' Ptr ()
userData
Maybe (Ptr (FunPtr C_ProxyURIResolverCallback)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_ProxyURIResolverCallback))
funptrptr
type C_ProxyResolverCallback =
Ptr Soup.ProxyResolver.ProxyResolver ->
Ptr Soup.Message.Message ->
Word32 ->
Ptr Soup.Address.Address ->
Ptr () ->
IO ()
foreign import ccall "dynamic" __dynamic_C_ProxyResolverCallback :: FunPtr C_ProxyResolverCallback -> C_ProxyResolverCallback
dynamic_ProxyResolverCallback ::
(B.CallStack.HasCallStack, MonadIO m, Soup.ProxyResolver.IsProxyResolver a, Soup.Message.IsMessage b, Soup.Address.IsAddress c) =>
FunPtr C_ProxyResolverCallback
-> a
-> b
-> Word32
-> c
-> Ptr ()
-> m ()
dynamic_ProxyResolverCallback :: FunPtr C_ProxyResolverCallback
-> a -> b -> Word32 -> c -> Ptr () -> m ()
dynamic_ProxyResolverCallback FunPtr C_ProxyResolverCallback
__funPtr a
proxyResolver b
msg Word32
arg c
addr Ptr ()
userData = 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 ProxyResolver
proxyResolver' <- a -> IO (Ptr ProxyResolver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proxyResolver
Ptr Message
msg' <- b -> IO (Ptr Message)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
msg
Ptr Address
addr' <- c -> IO (Ptr Address)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
addr
(FunPtr C_ProxyResolverCallback -> C_ProxyResolverCallback
__dynamic_C_ProxyResolverCallback FunPtr C_ProxyResolverCallback
__funPtr) Ptr ProxyResolver
proxyResolver' Ptr Message
msg' Word32
arg Ptr Address
addr' Ptr ()
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
proxyResolver
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
msg
c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr c
addr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
foreign import ccall "wrapper"
mk_ProxyResolverCallback :: C_ProxyResolverCallback -> IO (FunPtr C_ProxyResolverCallback)
{-# DEPRECATED ProxyResolverCallback ["(Since version 2.28)","Use SoupProxyURIResolver instead"] #-}
type ProxyResolverCallback =
Soup.ProxyResolver.ProxyResolver
-> Soup.Message.Message
-> Word32
-> Soup.Address.Address
-> IO ()
noProxyResolverCallback :: Maybe ProxyResolverCallback
noProxyResolverCallback :: Maybe ProxyResolverCallback
noProxyResolverCallback = Maybe ProxyResolverCallback
forall a. Maybe a
Nothing
type ProxyResolverCallback_WithClosures =
Soup.ProxyResolver.ProxyResolver
-> Soup.Message.Message
-> Word32
-> Soup.Address.Address
-> Ptr ()
-> IO ()
noProxyResolverCallback_WithClosures :: Maybe ProxyResolverCallback_WithClosures
noProxyResolverCallback_WithClosures :: Maybe ProxyResolverCallback_WithClosures
noProxyResolverCallback_WithClosures = Maybe ProxyResolverCallback_WithClosures
forall a. Maybe a
Nothing
drop_closures_ProxyResolverCallback :: ProxyResolverCallback -> ProxyResolverCallback_WithClosures
drop_closures_ProxyResolverCallback :: ProxyResolverCallback -> ProxyResolverCallback_WithClosures
drop_closures_ProxyResolverCallback ProxyResolverCallback
_f ProxyResolver
proxyResolver Message
msg Word32
arg Address
addr Ptr ()
_ = ProxyResolverCallback
_f ProxyResolver
proxyResolver Message
msg Word32
arg Address
addr
genClosure_ProxyResolverCallback :: MonadIO m => ProxyResolverCallback -> m (GClosure C_ProxyResolverCallback)
genClosure_ProxyResolverCallback :: ProxyResolverCallback -> m (GClosure C_ProxyResolverCallback)
genClosure_ProxyResolverCallback ProxyResolverCallback
cb = IO (GClosure C_ProxyResolverCallback)
-> m (GClosure C_ProxyResolverCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_ProxyResolverCallback)
-> m (GClosure C_ProxyResolverCallback))
-> IO (GClosure C_ProxyResolverCallback)
-> m (GClosure C_ProxyResolverCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: ProxyResolverCallback_WithClosures
cb' = ProxyResolverCallback -> ProxyResolverCallback_WithClosures
drop_closures_ProxyResolverCallback ProxyResolverCallback
cb
let cb'' :: C_ProxyResolverCallback
cb'' = Maybe (Ptr (FunPtr C_ProxyResolverCallback))
-> ProxyResolverCallback_WithClosures -> C_ProxyResolverCallback
wrap_ProxyResolverCallback Maybe (Ptr (FunPtr C_ProxyResolverCallback))
forall a. Maybe a
Nothing ProxyResolverCallback_WithClosures
cb'
C_ProxyResolverCallback -> IO (FunPtr C_ProxyResolverCallback)
mk_ProxyResolverCallback C_ProxyResolverCallback
cb'' IO (FunPtr C_ProxyResolverCallback)
-> (FunPtr C_ProxyResolverCallback
-> IO (GClosure C_ProxyResolverCallback))
-> IO (GClosure C_ProxyResolverCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_ProxyResolverCallback
-> IO (GClosure C_ProxyResolverCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_ProxyResolverCallback ::
Maybe (Ptr (FunPtr C_ProxyResolverCallback)) ->
ProxyResolverCallback_WithClosures ->
C_ProxyResolverCallback
wrap_ProxyResolverCallback :: Maybe (Ptr (FunPtr C_ProxyResolverCallback))
-> ProxyResolverCallback_WithClosures -> C_ProxyResolverCallback
wrap_ProxyResolverCallback Maybe (Ptr (FunPtr C_ProxyResolverCallback))
funptrptr ProxyResolverCallback_WithClosures
_cb Ptr ProxyResolver
proxyResolver Ptr Message
msg Word32
arg Ptr Address
addr Ptr ()
userData = do
ProxyResolver
proxyResolver' <- ((ManagedPtr ProxyResolver -> ProxyResolver)
-> Ptr ProxyResolver -> IO ProxyResolver
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr ProxyResolver -> ProxyResolver
Soup.ProxyResolver.ProxyResolver) Ptr ProxyResolver
proxyResolver
Message
msg' <- ((ManagedPtr Message -> Message) -> Ptr Message -> IO Message
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Message -> Message
Soup.Message.Message) Ptr Message
msg
Address
addr' <- ((ManagedPtr Address -> Address) -> Ptr Address -> IO Address
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Address -> Address
Soup.Address.Address) Ptr Address
addr
ProxyResolverCallback_WithClosures
_cb ProxyResolver
proxyResolver' Message
msg' Word32
arg Address
addr' Ptr ()
userData
Maybe (Ptr (FunPtr C_ProxyResolverCallback)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_ProxyResolverCallback))
funptrptr
type C_PasswordManagerCallback =
Ptr Soup.PasswordManager.PasswordManager ->
Ptr Soup.Message.Message ->
Ptr Soup.Auth.Auth ->
CInt ->
Ptr () ->
IO ()
foreign import ccall "dynamic" __dynamic_C_PasswordManagerCallback :: FunPtr C_PasswordManagerCallback -> C_PasswordManagerCallback
dynamic_PasswordManagerCallback ::
(B.CallStack.HasCallStack, MonadIO m, Soup.PasswordManager.IsPasswordManager a, Soup.Message.IsMessage b, Soup.Auth.IsAuth c) =>
FunPtr C_PasswordManagerCallback
-> a
-> b
-> c
-> Bool
-> Ptr ()
-> m ()
dynamic_PasswordManagerCallback :: FunPtr C_PasswordManagerCallback
-> a -> b -> c -> Bool -> Ptr () -> m ()
dynamic_PasswordManagerCallback FunPtr C_PasswordManagerCallback
__funPtr a
passwordManager b
msg c
auth Bool
retrying Ptr ()
userData = 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 PasswordManager
passwordManager' <- a -> IO (Ptr PasswordManager)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
passwordManager
Ptr Message
msg' <- b -> IO (Ptr Message)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
msg
Ptr Auth
auth' <- c -> IO (Ptr Auth)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
auth
let retrying' :: CInt
retrying' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
retrying
(FunPtr C_PasswordManagerCallback -> C_PasswordManagerCallback
__dynamic_C_PasswordManagerCallback FunPtr C_PasswordManagerCallback
__funPtr) Ptr PasswordManager
passwordManager' Ptr Message
msg' Ptr Auth
auth' CInt
retrying' Ptr ()
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
passwordManager
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
msg
c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr c
auth
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
foreign import ccall "wrapper"
mk_PasswordManagerCallback :: C_PasswordManagerCallback -> IO (FunPtr C_PasswordManagerCallback)
type PasswordManagerCallback =
Soup.PasswordManager.PasswordManager
-> Soup.Message.Message
-> Soup.Auth.Auth
-> Bool
-> IO ()
noPasswordManagerCallback :: Maybe PasswordManagerCallback
noPasswordManagerCallback :: Maybe PasswordManagerCallback
noPasswordManagerCallback = Maybe PasswordManagerCallback
forall a. Maybe a
Nothing
type PasswordManagerCallback_WithClosures =
Soup.PasswordManager.PasswordManager
-> Soup.Message.Message
-> Soup.Auth.Auth
-> Bool
-> Ptr ()
-> IO ()
noPasswordManagerCallback_WithClosures :: Maybe PasswordManagerCallback_WithClosures
noPasswordManagerCallback_WithClosures :: Maybe PasswordManagerCallback_WithClosures
noPasswordManagerCallback_WithClosures = Maybe PasswordManagerCallback_WithClosures
forall a. Maybe a
Nothing
drop_closures_PasswordManagerCallback :: PasswordManagerCallback -> PasswordManagerCallback_WithClosures
drop_closures_PasswordManagerCallback :: PasswordManagerCallback -> PasswordManagerCallback_WithClosures
drop_closures_PasswordManagerCallback PasswordManagerCallback
_f PasswordManager
passwordManager Message
msg Auth
auth Bool
retrying Ptr ()
_ = PasswordManagerCallback
_f PasswordManager
passwordManager Message
msg Auth
auth Bool
retrying
genClosure_PasswordManagerCallback :: MonadIO m => PasswordManagerCallback -> m (GClosure C_PasswordManagerCallback)
genClosure_PasswordManagerCallback :: PasswordManagerCallback -> m (GClosure C_PasswordManagerCallback)
genClosure_PasswordManagerCallback PasswordManagerCallback
cb = IO (GClosure C_PasswordManagerCallback)
-> m (GClosure C_PasswordManagerCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_PasswordManagerCallback)
-> m (GClosure C_PasswordManagerCallback))
-> IO (GClosure C_PasswordManagerCallback)
-> m (GClosure C_PasswordManagerCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: PasswordManagerCallback_WithClosures
cb' = PasswordManagerCallback -> PasswordManagerCallback_WithClosures
drop_closures_PasswordManagerCallback PasswordManagerCallback
cb
let cb'' :: C_PasswordManagerCallback
cb'' = Maybe (Ptr (FunPtr C_PasswordManagerCallback))
-> PasswordManagerCallback_WithClosures
-> C_PasswordManagerCallback
wrap_PasswordManagerCallback Maybe (Ptr (FunPtr C_PasswordManagerCallback))
forall a. Maybe a
Nothing PasswordManagerCallback_WithClosures
cb'
C_PasswordManagerCallback -> IO (FunPtr C_PasswordManagerCallback)
mk_PasswordManagerCallback C_PasswordManagerCallback
cb'' IO (FunPtr C_PasswordManagerCallback)
-> (FunPtr C_PasswordManagerCallback
-> IO (GClosure C_PasswordManagerCallback))
-> IO (GClosure C_PasswordManagerCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_PasswordManagerCallback
-> IO (GClosure C_PasswordManagerCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_PasswordManagerCallback ::
Maybe (Ptr (FunPtr C_PasswordManagerCallback)) ->
PasswordManagerCallback_WithClosures ->
C_PasswordManagerCallback
wrap_PasswordManagerCallback :: Maybe (Ptr (FunPtr C_PasswordManagerCallback))
-> PasswordManagerCallback_WithClosures
-> C_PasswordManagerCallback
wrap_PasswordManagerCallback Maybe (Ptr (FunPtr C_PasswordManagerCallback))
funptrptr PasswordManagerCallback_WithClosures
_cb Ptr PasswordManager
passwordManager Ptr Message
msg Ptr Auth
auth CInt
retrying Ptr ()
userData = do
PasswordManager
passwordManager' <- ((ManagedPtr PasswordManager -> PasswordManager)
-> Ptr PasswordManager -> IO PasswordManager
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr PasswordManager -> PasswordManager
Soup.PasswordManager.PasswordManager) Ptr PasswordManager
passwordManager
Message
msg' <- ((ManagedPtr Message -> Message) -> Ptr Message -> IO Message
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Message -> Message
Soup.Message.Message) Ptr Message
msg
Auth
auth' <- ((ManagedPtr Auth -> Auth) -> Ptr Auth -> IO Auth
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Auth -> Auth
Soup.Auth.Auth) Ptr Auth
auth
let retrying' :: Bool
retrying' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
retrying
PasswordManagerCallback_WithClosures
_cb PasswordManager
passwordManager' Message
msg' Auth
auth' Bool
retrying' Ptr ()
userData
Maybe (Ptr (FunPtr C_PasswordManagerCallback)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_PasswordManagerCallback))
funptrptr
type =
CString ->
CString ->
Ptr () ->
IO ()
foreign import ccall "dynamic" :: FunPtr C_MessageHeadersForeachFunc -> C_MessageHeadersForeachFunc
dynamic_MessageHeadersForeachFunc ::
(B.CallStack.HasCallStack, MonadIO m) =>
FunPtr C_MessageHeadersForeachFunc
-> T.Text
-> T.Text
-> Ptr ()
-> m ()
FunPtr C_MessageHeadersForeachFunc
__funPtr Text
name Text
value Ptr ()
userData = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
CString
name' <- Text -> IO CString
textToCString Text
name
CString
value' <- Text -> IO CString
textToCString Text
value
(FunPtr C_MessageHeadersForeachFunc -> C_MessageHeadersForeachFunc
__dynamic_C_MessageHeadersForeachFunc FunPtr C_MessageHeadersForeachFunc
__funPtr) CString
name' CString
value' Ptr ()
userData
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
value'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
foreign import ccall "wrapper"
:: C_MessageHeadersForeachFunc -> IO (FunPtr C_MessageHeadersForeachFunc)
type =
T.Text
-> T.Text
-> IO ()
noMessageHeadersForeachFunc :: Maybe MessageHeadersForeachFunc
= Maybe MessageHeadersForeachFunc
forall a. Maybe a
Nothing
type =
T.Text
-> T.Text
-> Ptr ()
-> IO ()
noMessageHeadersForeachFunc_WithClosures :: Maybe MessageHeadersForeachFunc_WithClosures
= Maybe MessageHeadersForeachFunc_WithClosures
forall a. Maybe a
Nothing
drop_closures_MessageHeadersForeachFunc :: MessageHeadersForeachFunc -> MessageHeadersForeachFunc_WithClosures
MessageHeadersForeachFunc
_f Text
name Text
value Ptr ()
_ = MessageHeadersForeachFunc
_f Text
name Text
value
genClosure_MessageHeadersForeachFunc :: MonadIO m => MessageHeadersForeachFunc -> m (GClosure C_MessageHeadersForeachFunc)
MessageHeadersForeachFunc
cb = IO (GClosure C_MessageHeadersForeachFunc)
-> m (GClosure C_MessageHeadersForeachFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_MessageHeadersForeachFunc)
-> m (GClosure C_MessageHeadersForeachFunc))
-> IO (GClosure C_MessageHeadersForeachFunc)
-> m (GClosure C_MessageHeadersForeachFunc)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: MessageHeadersForeachFunc_WithClosures
cb' = MessageHeadersForeachFunc -> MessageHeadersForeachFunc_WithClosures
drop_closures_MessageHeadersForeachFunc MessageHeadersForeachFunc
cb
let cb'' :: C_MessageHeadersForeachFunc
cb'' = Maybe (Ptr (FunPtr C_MessageHeadersForeachFunc))
-> MessageHeadersForeachFunc_WithClosures
-> C_MessageHeadersForeachFunc
wrap_MessageHeadersForeachFunc Maybe (Ptr (FunPtr C_MessageHeadersForeachFunc))
forall a. Maybe a
Nothing MessageHeadersForeachFunc_WithClosures
cb'
C_MessageHeadersForeachFunc
-> IO (FunPtr C_MessageHeadersForeachFunc)
mk_MessageHeadersForeachFunc C_MessageHeadersForeachFunc
cb'' IO (FunPtr C_MessageHeadersForeachFunc)
-> (FunPtr C_MessageHeadersForeachFunc
-> IO (GClosure C_MessageHeadersForeachFunc))
-> IO (GClosure C_MessageHeadersForeachFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_MessageHeadersForeachFunc
-> IO (GClosure C_MessageHeadersForeachFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_MessageHeadersForeachFunc ::
Maybe (Ptr (FunPtr C_MessageHeadersForeachFunc)) ->
MessageHeadersForeachFunc_WithClosures ->
C_MessageHeadersForeachFunc
Maybe (Ptr (FunPtr C_MessageHeadersForeachFunc))
funptrptr MessageHeadersForeachFunc_WithClosures
_cb CString
name CString
value Ptr ()
userData = do
Text
name' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
name
Text
value' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
value
MessageHeadersForeachFunc_WithClosures
_cb Text
name' Text
value' Ptr ()
userData
Maybe (Ptr (FunPtr C_MessageHeadersForeachFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_MessageHeadersForeachFunc))
funptrptr
type C_LoggerPrinter =
Ptr Soup.Logger.Logger ->
CUInt ->
Int8 ->
CString ->
Ptr () ->
IO ()
foreign import ccall "dynamic" __dynamic_C_LoggerPrinter :: FunPtr C_LoggerPrinter -> C_LoggerPrinter
dynamic_LoggerPrinter ::
(B.CallStack.HasCallStack, MonadIO m, Soup.Logger.IsLogger a) =>
FunPtr C_LoggerPrinter
-> a
-> Soup.Enums.LoggerLogLevel
-> Int8
-> T.Text
-> Ptr ()
-> m ()
dynamic_LoggerPrinter :: FunPtr C_LoggerPrinter
-> a -> LoggerLogLevel -> Int8 -> Text -> Ptr () -> m ()
dynamic_LoggerPrinter FunPtr C_LoggerPrinter
__funPtr a
logger LoggerLogLevel
level Int8
direction Text
data_ Ptr ()
userData = 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 Logger
logger' <- a -> IO (Ptr Logger)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
logger
let level' :: CUInt
level' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (LoggerLogLevel -> Int) -> LoggerLogLevel -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LoggerLogLevel -> Int
forall a. Enum a => a -> Int
fromEnum) LoggerLogLevel
level
CString
data_' <- Text -> IO CString
textToCString Text
data_
(FunPtr C_LoggerPrinter -> C_LoggerPrinter
__dynamic_C_LoggerPrinter FunPtr C_LoggerPrinter
__funPtr) Ptr Logger
logger' CUInt
level' Int8
direction CString
data_' Ptr ()
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
logger
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
data_'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
foreign import ccall "wrapper"
mk_LoggerPrinter :: C_LoggerPrinter -> IO (FunPtr C_LoggerPrinter)
type LoggerPrinter =
Soup.Logger.Logger
-> Soup.Enums.LoggerLogLevel
-> Int8
-> T.Text
-> IO ()
noLoggerPrinter :: Maybe LoggerPrinter
noLoggerPrinter :: Maybe LoggerPrinter
noLoggerPrinter = Maybe LoggerPrinter
forall a. Maybe a
Nothing
type LoggerPrinter_WithClosures =
Soup.Logger.Logger
-> Soup.Enums.LoggerLogLevel
-> Int8
-> T.Text
-> Ptr ()
-> IO ()
noLoggerPrinter_WithClosures :: Maybe LoggerPrinter_WithClosures
noLoggerPrinter_WithClosures :: Maybe LoggerPrinter_WithClosures
noLoggerPrinter_WithClosures = Maybe LoggerPrinter_WithClosures
forall a. Maybe a
Nothing
drop_closures_LoggerPrinter :: LoggerPrinter -> LoggerPrinter_WithClosures
drop_closures_LoggerPrinter :: LoggerPrinter -> LoggerPrinter_WithClosures
drop_closures_LoggerPrinter LoggerPrinter
_f Logger
logger LoggerLogLevel
level Int8
direction Text
data_ Ptr ()
_ = LoggerPrinter
_f Logger
logger LoggerLogLevel
level Int8
direction Text
data_
genClosure_LoggerPrinter :: MonadIO m => LoggerPrinter -> m (GClosure C_LoggerPrinter)
genClosure_LoggerPrinter :: LoggerPrinter -> m (GClosure C_LoggerPrinter)
genClosure_LoggerPrinter LoggerPrinter
cb = IO (GClosure C_LoggerPrinter) -> m (GClosure C_LoggerPrinter)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_LoggerPrinter) -> m (GClosure C_LoggerPrinter))
-> IO (GClosure C_LoggerPrinter) -> m (GClosure C_LoggerPrinter)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: LoggerPrinter_WithClosures
cb' = LoggerPrinter -> LoggerPrinter_WithClosures
drop_closures_LoggerPrinter LoggerPrinter
cb
let cb'' :: C_LoggerPrinter
cb'' = Maybe (Ptr (FunPtr C_LoggerPrinter))
-> LoggerPrinter_WithClosures -> C_LoggerPrinter
wrap_LoggerPrinter Maybe (Ptr (FunPtr C_LoggerPrinter))
forall a. Maybe a
Nothing LoggerPrinter_WithClosures
cb'
C_LoggerPrinter -> IO (FunPtr C_LoggerPrinter)
mk_LoggerPrinter C_LoggerPrinter
cb'' IO (FunPtr C_LoggerPrinter)
-> (FunPtr C_LoggerPrinter -> IO (GClosure C_LoggerPrinter))
-> IO (GClosure C_LoggerPrinter)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_LoggerPrinter -> IO (GClosure C_LoggerPrinter)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_LoggerPrinter ::
Maybe (Ptr (FunPtr C_LoggerPrinter)) ->
LoggerPrinter_WithClosures ->
C_LoggerPrinter
wrap_LoggerPrinter :: Maybe (Ptr (FunPtr C_LoggerPrinter))
-> LoggerPrinter_WithClosures -> C_LoggerPrinter
wrap_LoggerPrinter Maybe (Ptr (FunPtr C_LoggerPrinter))
funptrptr LoggerPrinter_WithClosures
_cb Ptr Logger
logger CUInt
level Int8
direction CString
data_ Ptr ()
userData = do
Logger
logger' <- ((ManagedPtr Logger -> Logger) -> Ptr Logger -> IO Logger
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Logger -> Logger
Soup.Logger.Logger) Ptr Logger
logger
let level' :: LoggerLogLevel
level' = (Int -> LoggerLogLevel
forall a. Enum a => Int -> a
toEnum (Int -> LoggerLogLevel)
-> (CUInt -> Int) -> CUInt -> LoggerLogLevel
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
level
Text
data_' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
data_
LoggerPrinter_WithClosures
_cb Logger
logger' LoggerLogLevel
level' Int8
direction Text
data_' Ptr ()
userData
Maybe (Ptr (FunPtr C_LoggerPrinter)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_LoggerPrinter))
funptrptr
type C_LoggerFilter =
Ptr Soup.Logger.Logger ->
Ptr Soup.Message.Message ->
Ptr () ->
IO CUInt
foreign import ccall "dynamic" __dynamic_C_LoggerFilter :: FunPtr C_LoggerFilter -> C_LoggerFilter
dynamic_LoggerFilter ::
(B.CallStack.HasCallStack, MonadIO m, Soup.Logger.IsLogger a, Soup.Message.IsMessage b) =>
FunPtr C_LoggerFilter
-> a
-> b
-> Ptr ()
-> m Soup.Enums.LoggerLogLevel
dynamic_LoggerFilter :: FunPtr C_LoggerFilter -> a -> b -> Ptr () -> m LoggerLogLevel
dynamic_LoggerFilter FunPtr C_LoggerFilter
__funPtr a
logger b
msg Ptr ()
userData = IO LoggerLogLevel -> m LoggerLogLevel
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO LoggerLogLevel -> m LoggerLogLevel)
-> IO LoggerLogLevel -> m LoggerLogLevel
forall a b. (a -> b) -> a -> b
$ do
Ptr Logger
logger' <- a -> IO (Ptr Logger)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
logger
Ptr Message
msg' <- b -> IO (Ptr Message)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
msg
CUInt
result <- (FunPtr C_LoggerFilter -> C_LoggerFilter
__dynamic_C_LoggerFilter FunPtr C_LoggerFilter
__funPtr) Ptr Logger
logger' Ptr Message
msg' Ptr ()
userData
let result' :: LoggerLogLevel
result' = (Int -> LoggerLogLevel
forall a. Enum a => Int -> a
toEnum (Int -> LoggerLogLevel)
-> (CUInt -> Int) -> CUInt -> LoggerLogLevel
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
logger
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
msg
LoggerLogLevel -> IO LoggerLogLevel
forall (m :: * -> *) a. Monad m => a -> m a
return LoggerLogLevel
result'
foreign import ccall "wrapper"
mk_LoggerFilter :: C_LoggerFilter -> IO (FunPtr C_LoggerFilter)
type LoggerFilter =
Soup.Logger.Logger
-> Soup.Message.Message
-> IO Soup.Enums.LoggerLogLevel
noLoggerFilter :: Maybe LoggerFilter
noLoggerFilter :: Maybe LoggerFilter
noLoggerFilter = Maybe LoggerFilter
forall a. Maybe a
Nothing
type LoggerFilter_WithClosures =
Soup.Logger.Logger
-> Soup.Message.Message
-> Ptr ()
-> IO Soup.Enums.LoggerLogLevel
noLoggerFilter_WithClosures :: Maybe LoggerFilter_WithClosures
noLoggerFilter_WithClosures :: Maybe LoggerFilter_WithClosures
noLoggerFilter_WithClosures = Maybe LoggerFilter_WithClosures
forall a. Maybe a
Nothing
drop_closures_LoggerFilter :: LoggerFilter -> LoggerFilter_WithClosures
drop_closures_LoggerFilter :: LoggerFilter -> LoggerFilter_WithClosures
drop_closures_LoggerFilter LoggerFilter
_f Logger
logger Message
msg Ptr ()
_ = LoggerFilter
_f Logger
logger Message
msg
genClosure_LoggerFilter :: MonadIO m => LoggerFilter -> m (GClosure C_LoggerFilter)
genClosure_LoggerFilter :: LoggerFilter -> m (GClosure C_LoggerFilter)
genClosure_LoggerFilter LoggerFilter
cb = IO (GClosure C_LoggerFilter) -> m (GClosure C_LoggerFilter)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_LoggerFilter) -> m (GClosure C_LoggerFilter))
-> IO (GClosure C_LoggerFilter) -> m (GClosure C_LoggerFilter)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: LoggerFilter_WithClosures
cb' = LoggerFilter -> LoggerFilter_WithClosures
drop_closures_LoggerFilter LoggerFilter
cb
let cb'' :: C_LoggerFilter
cb'' = Maybe (Ptr (FunPtr C_LoggerFilter))
-> LoggerFilter_WithClosures -> C_LoggerFilter
wrap_LoggerFilter Maybe (Ptr (FunPtr C_LoggerFilter))
forall a. Maybe a
Nothing LoggerFilter_WithClosures
cb'
C_LoggerFilter -> IO (FunPtr C_LoggerFilter)
mk_LoggerFilter C_LoggerFilter
cb'' IO (FunPtr C_LoggerFilter)
-> (FunPtr C_LoggerFilter -> IO (GClosure C_LoggerFilter))
-> IO (GClosure C_LoggerFilter)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_LoggerFilter -> IO (GClosure C_LoggerFilter)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_LoggerFilter ::
Maybe (Ptr (FunPtr C_LoggerFilter)) ->
LoggerFilter_WithClosures ->
C_LoggerFilter
wrap_LoggerFilter :: Maybe (Ptr (FunPtr C_LoggerFilter))
-> LoggerFilter_WithClosures -> C_LoggerFilter
wrap_LoggerFilter Maybe (Ptr (FunPtr C_LoggerFilter))
funptrptr LoggerFilter_WithClosures
_cb Ptr Logger
logger Ptr Message
msg Ptr ()
userData = do
Logger
logger' <- ((ManagedPtr Logger -> Logger) -> Ptr Logger -> IO Logger
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Logger -> Logger
Soup.Logger.Logger) Ptr Logger
logger
Message
msg' <- ((ManagedPtr Message -> Message) -> Ptr Message -> IO Message
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Message -> Message
Soup.Message.Message) Ptr Message
msg
LoggerLogLevel
result <- LoggerFilter_WithClosures
_cb Logger
logger' Message
msg' Ptr ()
userData
Maybe (Ptr (FunPtr C_LoggerFilter)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_LoggerFilter))
funptrptr
let result' :: CUInt
result' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (LoggerLogLevel -> Int) -> LoggerLogLevel -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LoggerLogLevel -> Int
forall a. Enum a => a -> Int
fromEnum) LoggerLogLevel
result
CUInt -> IO CUInt
forall (m :: * -> *) a. Monad m => a -> m a
return CUInt
result'
type C_ChunkAllocator =
Ptr Soup.Message.Message ->
Word64 ->
Ptr () ->
IO (Ptr Soup.Buffer.Buffer)
foreign import ccall "dynamic" __dynamic_C_ChunkAllocator :: FunPtr C_ChunkAllocator -> C_ChunkAllocator
dynamic_ChunkAllocator ::
(B.CallStack.HasCallStack, MonadIO m, Soup.Message.IsMessage a) =>
FunPtr C_ChunkAllocator
-> a
-> Word64
-> Ptr ()
-> m (Maybe Soup.Buffer.Buffer)
dynamic_ChunkAllocator :: FunPtr C_ChunkAllocator
-> a -> Word64 -> Ptr () -> m (Maybe Buffer)
dynamic_ChunkAllocator FunPtr C_ChunkAllocator
__funPtr a
msg Word64
maxLen Ptr ()
userData = IO (Maybe Buffer) -> m (Maybe Buffer)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Buffer) -> m (Maybe Buffer))
-> IO (Maybe Buffer) -> m (Maybe Buffer)
forall a b. (a -> b) -> a -> b
$ do
Ptr Message
msg' <- a -> IO (Ptr Message)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
msg
Ptr Buffer
result <- (FunPtr C_ChunkAllocator -> C_ChunkAllocator
__dynamic_C_ChunkAllocator FunPtr C_ChunkAllocator
__funPtr) Ptr Message
msg' Word64
maxLen Ptr ()
userData
Maybe Buffer
maybeResult <- Ptr Buffer -> (Ptr Buffer -> IO Buffer) -> IO (Maybe Buffer)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Buffer
result ((Ptr Buffer -> IO Buffer) -> IO (Maybe Buffer))
-> (Ptr Buffer -> IO Buffer) -> IO (Maybe Buffer)
forall a b. (a -> b) -> a -> b
$ \Ptr Buffer
result' -> do
Buffer
result'' <- ((ManagedPtr Buffer -> Buffer) -> Ptr Buffer -> IO Buffer
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Buffer -> Buffer
Soup.Buffer.Buffer) Ptr Buffer
result'
Buffer -> IO Buffer
forall (m :: * -> *) a. Monad m => a -> m a
return Buffer
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
msg
Maybe Buffer -> IO (Maybe Buffer)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Buffer
maybeResult
foreign import ccall "wrapper"
mk_ChunkAllocator :: C_ChunkAllocator -> IO (FunPtr C_ChunkAllocator)
{-# DEPRECATED ChunkAllocator ["Use t'GI.Soup.Objects.Request.Request' if you want to read into your","own buffers."] #-}
type ChunkAllocator =
Soup.Message.Message
-> Word64
-> IO (Maybe Soup.Buffer.Buffer)
noChunkAllocator :: Maybe ChunkAllocator
noChunkAllocator :: Maybe ChunkAllocator
noChunkAllocator = Maybe ChunkAllocator
forall a. Maybe a
Nothing
type ChunkAllocator_WithClosures =
Soup.Message.Message
-> Word64
-> Ptr ()
-> IO (Maybe Soup.Buffer.Buffer)
noChunkAllocator_WithClosures :: Maybe ChunkAllocator_WithClosures
noChunkAllocator_WithClosures :: Maybe ChunkAllocator_WithClosures
noChunkAllocator_WithClosures = Maybe ChunkAllocator_WithClosures
forall a. Maybe a
Nothing
drop_closures_ChunkAllocator :: ChunkAllocator -> ChunkAllocator_WithClosures
drop_closures_ChunkAllocator :: ChunkAllocator -> ChunkAllocator_WithClosures
drop_closures_ChunkAllocator ChunkAllocator
_f Message
msg Word64
maxLen Ptr ()
_ = ChunkAllocator
_f Message
msg Word64
maxLen
genClosure_ChunkAllocator :: MonadIO m => ChunkAllocator -> m (GClosure C_ChunkAllocator)
genClosure_ChunkAllocator :: ChunkAllocator -> m (GClosure C_ChunkAllocator)
genClosure_ChunkAllocator ChunkAllocator
cb = IO (GClosure C_ChunkAllocator) -> m (GClosure C_ChunkAllocator)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_ChunkAllocator) -> m (GClosure C_ChunkAllocator))
-> IO (GClosure C_ChunkAllocator) -> m (GClosure C_ChunkAllocator)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: ChunkAllocator_WithClosures
cb' = ChunkAllocator -> ChunkAllocator_WithClosures
drop_closures_ChunkAllocator ChunkAllocator
cb
let cb'' :: C_ChunkAllocator
cb'' = Maybe (Ptr (FunPtr C_ChunkAllocator))
-> ChunkAllocator_WithClosures -> C_ChunkAllocator
wrap_ChunkAllocator Maybe (Ptr (FunPtr C_ChunkAllocator))
forall a. Maybe a
Nothing ChunkAllocator_WithClosures
cb'
C_ChunkAllocator -> IO (FunPtr C_ChunkAllocator)
mk_ChunkAllocator C_ChunkAllocator
cb'' IO (FunPtr C_ChunkAllocator)
-> (FunPtr C_ChunkAllocator -> IO (GClosure C_ChunkAllocator))
-> IO (GClosure C_ChunkAllocator)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_ChunkAllocator -> IO (GClosure C_ChunkAllocator)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_ChunkAllocator ::
Maybe (Ptr (FunPtr C_ChunkAllocator)) ->
ChunkAllocator_WithClosures ->
C_ChunkAllocator
wrap_ChunkAllocator :: Maybe (Ptr (FunPtr C_ChunkAllocator))
-> ChunkAllocator_WithClosures -> C_ChunkAllocator
wrap_ChunkAllocator Maybe (Ptr (FunPtr C_ChunkAllocator))
funptrptr ChunkAllocator_WithClosures
_cb Ptr Message
msg Word64
maxLen Ptr ()
userData = do
Message
msg' <- ((ManagedPtr Message -> Message) -> Ptr Message -> IO Message
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Message -> Message
Soup.Message.Message) Ptr Message
msg
Maybe Buffer
result <- ChunkAllocator_WithClosures
_cb Message
msg' Word64
maxLen Ptr ()
userData
Maybe (Ptr (FunPtr C_ChunkAllocator)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_ChunkAllocator))
funptrptr
Ptr Buffer
-> Maybe Buffer -> (Buffer -> IO (Ptr Buffer)) -> IO (Ptr Buffer)
forall (m :: * -> *) b a.
Monad m =>
b -> Maybe a -> (a -> m b) -> m b
maybeM Ptr Buffer
forall a. Ptr a
nullPtr Maybe Buffer
result ((Buffer -> IO (Ptr Buffer)) -> IO (Ptr Buffer))
-> (Buffer -> IO (Ptr Buffer)) -> IO (Ptr Buffer)
forall a b. (a -> b) -> a -> b
$ \Buffer
result' -> do
Ptr Buffer
result'' <- Buffer -> IO (Ptr Buffer)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed Buffer
result'
Ptr Buffer -> IO (Ptr Buffer)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Buffer
result''
type C_AuthDomainGenericAuthCallback =
Ptr Soup.AuthDomain.AuthDomain ->
Ptr Soup.Message.Message ->
CString ->
Ptr () ->
IO CInt
foreign import ccall "dynamic" __dynamic_C_AuthDomainGenericAuthCallback :: FunPtr C_AuthDomainGenericAuthCallback -> C_AuthDomainGenericAuthCallback
dynamic_AuthDomainGenericAuthCallback ::
(B.CallStack.HasCallStack, MonadIO m, Soup.AuthDomain.IsAuthDomain a, Soup.Message.IsMessage b) =>
FunPtr C_AuthDomainGenericAuthCallback
-> a
-> b
-> T.Text
-> Ptr ()
-> m Bool
dynamic_AuthDomainGenericAuthCallback :: FunPtr C_AuthDomainGenericAuthCallback
-> a -> b -> Text -> Ptr () -> m Bool
dynamic_AuthDomainGenericAuthCallback FunPtr C_AuthDomainGenericAuthCallback
__funPtr a
domain b
msg Text
username Ptr ()
userData = IO Bool -> m Bool
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
Ptr AuthDomain
domain' <- a -> IO (Ptr AuthDomain)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
domain
Ptr Message
msg' <- b -> IO (Ptr Message)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
msg
CString
username' <- Text -> IO CString
textToCString Text
username
CInt
result <- (FunPtr C_AuthDomainGenericAuthCallback
-> C_AuthDomainGenericAuthCallback
__dynamic_C_AuthDomainGenericAuthCallback FunPtr C_AuthDomainGenericAuthCallback
__funPtr) Ptr AuthDomain
domain' Ptr Message
msg' CString
username' Ptr ()
userData
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
domain
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
msg
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
username'
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
foreign import ccall "wrapper"
mk_AuthDomainGenericAuthCallback :: C_AuthDomainGenericAuthCallback -> IO (FunPtr C_AuthDomainGenericAuthCallback)
type AuthDomainGenericAuthCallback =
Soup.AuthDomain.AuthDomain
-> Soup.Message.Message
-> T.Text
-> IO Bool
noAuthDomainGenericAuthCallback :: Maybe AuthDomainGenericAuthCallback
noAuthDomainGenericAuthCallback :: Maybe AuthDomainGenericAuthCallback
noAuthDomainGenericAuthCallback = Maybe AuthDomainGenericAuthCallback
forall a. Maybe a
Nothing
type AuthDomainGenericAuthCallback_WithClosures =
Soup.AuthDomain.AuthDomain
-> Soup.Message.Message
-> T.Text
-> Ptr ()
-> IO Bool
noAuthDomainGenericAuthCallback_WithClosures :: Maybe AuthDomainGenericAuthCallback_WithClosures
noAuthDomainGenericAuthCallback_WithClosures :: Maybe AuthDomainGenericAuthCallback_WithClosures
noAuthDomainGenericAuthCallback_WithClosures = Maybe AuthDomainGenericAuthCallback_WithClosures
forall a. Maybe a
Nothing
drop_closures_AuthDomainGenericAuthCallback :: AuthDomainGenericAuthCallback -> AuthDomainGenericAuthCallback_WithClosures
drop_closures_AuthDomainGenericAuthCallback :: AuthDomainGenericAuthCallback
-> AuthDomainGenericAuthCallback_WithClosures
drop_closures_AuthDomainGenericAuthCallback AuthDomainGenericAuthCallback
_f AuthDomain
domain Message
msg Text
username Ptr ()
_ = AuthDomainGenericAuthCallback
_f AuthDomain
domain Message
msg Text
username
genClosure_AuthDomainGenericAuthCallback :: MonadIO m => AuthDomainGenericAuthCallback -> m (GClosure C_AuthDomainGenericAuthCallback)
genClosure_AuthDomainGenericAuthCallback :: AuthDomainGenericAuthCallback
-> m (GClosure C_AuthDomainGenericAuthCallback)
genClosure_AuthDomainGenericAuthCallback AuthDomainGenericAuthCallback
cb = IO (GClosure C_AuthDomainGenericAuthCallback)
-> m (GClosure C_AuthDomainGenericAuthCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_AuthDomainGenericAuthCallback)
-> m (GClosure C_AuthDomainGenericAuthCallback))
-> IO (GClosure C_AuthDomainGenericAuthCallback)
-> m (GClosure C_AuthDomainGenericAuthCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: AuthDomainGenericAuthCallback_WithClosures
cb' = AuthDomainGenericAuthCallback
-> AuthDomainGenericAuthCallback_WithClosures
drop_closures_AuthDomainGenericAuthCallback AuthDomainGenericAuthCallback
cb
let cb'' :: C_AuthDomainGenericAuthCallback
cb'' = Maybe (Ptr (FunPtr C_AuthDomainGenericAuthCallback))
-> AuthDomainGenericAuthCallback_WithClosures
-> C_AuthDomainGenericAuthCallback
wrap_AuthDomainGenericAuthCallback Maybe (Ptr (FunPtr C_AuthDomainGenericAuthCallback))
forall a. Maybe a
Nothing AuthDomainGenericAuthCallback_WithClosures
cb'
C_AuthDomainGenericAuthCallback
-> IO (FunPtr C_AuthDomainGenericAuthCallback)
mk_AuthDomainGenericAuthCallback C_AuthDomainGenericAuthCallback
cb'' IO (FunPtr C_AuthDomainGenericAuthCallback)
-> (FunPtr C_AuthDomainGenericAuthCallback
-> IO (GClosure C_AuthDomainGenericAuthCallback))
-> IO (GClosure C_AuthDomainGenericAuthCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_AuthDomainGenericAuthCallback
-> IO (GClosure C_AuthDomainGenericAuthCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_AuthDomainGenericAuthCallback ::
Maybe (Ptr (FunPtr C_AuthDomainGenericAuthCallback)) ->
AuthDomainGenericAuthCallback_WithClosures ->
C_AuthDomainGenericAuthCallback
wrap_AuthDomainGenericAuthCallback :: Maybe (Ptr (FunPtr C_AuthDomainGenericAuthCallback))
-> AuthDomainGenericAuthCallback_WithClosures
-> C_AuthDomainGenericAuthCallback
wrap_AuthDomainGenericAuthCallback Maybe (Ptr (FunPtr C_AuthDomainGenericAuthCallback))
funptrptr AuthDomainGenericAuthCallback_WithClosures
_cb Ptr AuthDomain
domain Ptr Message
msg CString
username Ptr ()
userData = do
AuthDomain
domain' <- ((ManagedPtr AuthDomain -> AuthDomain)
-> Ptr AuthDomain -> IO AuthDomain
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr AuthDomain -> AuthDomain
Soup.AuthDomain.AuthDomain) Ptr AuthDomain
domain
Message
msg' <- ((ManagedPtr Message -> Message) -> Ptr Message -> IO Message
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Message -> Message
Soup.Message.Message) Ptr Message
msg
Text
username' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
username
Bool
result <- AuthDomainGenericAuthCallback_WithClosures
_cb AuthDomain
domain' Message
msg' Text
username' Ptr ()
userData
Maybe (Ptr (FunPtr C_AuthDomainGenericAuthCallback)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_AuthDomainGenericAuthCallback))
funptrptr
let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'
type C_AuthDomainFilter =
Ptr Soup.AuthDomain.AuthDomain ->
Ptr Soup.Message.Message ->
Ptr () ->
IO CInt
foreign import ccall "dynamic" __dynamic_C_AuthDomainFilter :: FunPtr C_AuthDomainFilter -> C_AuthDomainFilter
dynamic_AuthDomainFilter ::
(B.CallStack.HasCallStack, MonadIO m, Soup.AuthDomain.IsAuthDomain a, Soup.Message.IsMessage b) =>
FunPtr C_AuthDomainFilter
-> a
-> b
-> Ptr ()
-> m Bool
dynamic_AuthDomainFilter :: FunPtr C_AuthDomainFilter -> a -> b -> Ptr () -> m Bool
dynamic_AuthDomainFilter FunPtr C_AuthDomainFilter
__funPtr a
domain b
msg Ptr ()
userData = IO Bool -> m Bool
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
Ptr AuthDomain
domain' <- a -> IO (Ptr AuthDomain)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
domain
Ptr Message
msg' <- b -> IO (Ptr Message)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
msg
CInt
result <- (FunPtr C_AuthDomainFilter -> C_AuthDomainFilter
__dynamic_C_AuthDomainFilter FunPtr C_AuthDomainFilter
__funPtr) Ptr AuthDomain
domain' Ptr Message
msg' Ptr ()
userData
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
domain
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
msg
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
foreign import ccall "wrapper"
mk_AuthDomainFilter :: C_AuthDomainFilter -> IO (FunPtr C_AuthDomainFilter)
type AuthDomainFilter =
Soup.AuthDomain.AuthDomain
-> Soup.Message.Message
-> IO Bool
noAuthDomainFilter :: Maybe AuthDomainFilter
noAuthDomainFilter :: Maybe AuthDomainFilter
noAuthDomainFilter = Maybe AuthDomainFilter
forall a. Maybe a
Nothing
type AuthDomainFilter_WithClosures =
Soup.AuthDomain.AuthDomain
-> Soup.Message.Message
-> Ptr ()
-> IO Bool
noAuthDomainFilter_WithClosures :: Maybe AuthDomainFilter_WithClosures
noAuthDomainFilter_WithClosures :: Maybe AuthDomainFilter_WithClosures
noAuthDomainFilter_WithClosures = Maybe AuthDomainFilter_WithClosures
forall a. Maybe a
Nothing
drop_closures_AuthDomainFilter :: AuthDomainFilter -> AuthDomainFilter_WithClosures
drop_closures_AuthDomainFilter :: AuthDomainFilter -> AuthDomainFilter_WithClosures
drop_closures_AuthDomainFilter AuthDomainFilter
_f AuthDomain
domain Message
msg Ptr ()
_ = AuthDomainFilter
_f AuthDomain
domain Message
msg
genClosure_AuthDomainFilter :: MonadIO m => AuthDomainFilter -> m (GClosure C_AuthDomainFilter)
genClosure_AuthDomainFilter :: AuthDomainFilter -> m (GClosure C_AuthDomainFilter)
genClosure_AuthDomainFilter AuthDomainFilter
cb = IO (GClosure C_AuthDomainFilter) -> m (GClosure C_AuthDomainFilter)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_AuthDomainFilter)
-> m (GClosure C_AuthDomainFilter))
-> IO (GClosure C_AuthDomainFilter)
-> m (GClosure C_AuthDomainFilter)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: AuthDomainFilter_WithClosures
cb' = AuthDomainFilter -> AuthDomainFilter_WithClosures
drop_closures_AuthDomainFilter AuthDomainFilter
cb
let cb'' :: C_AuthDomainFilter
cb'' = Maybe (Ptr (FunPtr C_AuthDomainFilter))
-> AuthDomainFilter_WithClosures -> C_AuthDomainFilter
wrap_AuthDomainFilter Maybe (Ptr (FunPtr C_AuthDomainFilter))
forall a. Maybe a
Nothing AuthDomainFilter_WithClosures
cb'
C_AuthDomainFilter -> IO (FunPtr C_AuthDomainFilter)
mk_AuthDomainFilter C_AuthDomainFilter
cb'' IO (FunPtr C_AuthDomainFilter)
-> (FunPtr C_AuthDomainFilter -> IO (GClosure C_AuthDomainFilter))
-> IO (GClosure C_AuthDomainFilter)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_AuthDomainFilter -> IO (GClosure C_AuthDomainFilter)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_AuthDomainFilter ::
Maybe (Ptr (FunPtr C_AuthDomainFilter)) ->
AuthDomainFilter_WithClosures ->
C_AuthDomainFilter
wrap_AuthDomainFilter :: Maybe (Ptr (FunPtr C_AuthDomainFilter))
-> AuthDomainFilter_WithClosures -> C_AuthDomainFilter
wrap_AuthDomainFilter Maybe (Ptr (FunPtr C_AuthDomainFilter))
funptrptr AuthDomainFilter_WithClosures
_cb Ptr AuthDomain
domain Ptr Message
msg Ptr ()
userData = do
AuthDomain
domain' <- ((ManagedPtr AuthDomain -> AuthDomain)
-> Ptr AuthDomain -> IO AuthDomain
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr AuthDomain -> AuthDomain
Soup.AuthDomain.AuthDomain) Ptr AuthDomain
domain
Message
msg' <- ((ManagedPtr Message -> Message) -> Ptr Message -> IO Message
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Message -> Message
Soup.Message.Message) Ptr Message
msg
Bool
result <- AuthDomainFilter_WithClosures
_cb AuthDomain
domain' Message
msg' Ptr ()
userData
Maybe (Ptr (FunPtr C_AuthDomainFilter)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_AuthDomainFilter))
funptrptr
let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'
type C_AuthDomainDigestAuthCallback =
Ptr Soup.AuthDomainDigest.AuthDomainDigest ->
Ptr Soup.Message.Message ->
CString ->
Ptr () ->
IO CString
foreign import ccall "dynamic" __dynamic_C_AuthDomainDigestAuthCallback :: FunPtr C_AuthDomainDigestAuthCallback -> C_AuthDomainDigestAuthCallback
dynamic_AuthDomainDigestAuthCallback ::
(B.CallStack.HasCallStack, MonadIO m, Soup.AuthDomainDigest.IsAuthDomainDigest a, Soup.Message.IsMessage b) =>
FunPtr C_AuthDomainDigestAuthCallback
-> a
-> b
-> T.Text
-> Ptr ()
-> m (Maybe T.Text)
dynamic_AuthDomainDigestAuthCallback :: FunPtr C_AuthDomainDigestAuthCallback
-> a -> b -> Text -> Ptr () -> m (Maybe Text)
dynamic_AuthDomainDigestAuthCallback FunPtr C_AuthDomainDigestAuthCallback
__funPtr a
domain b
msg Text
username Ptr ()
userData = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
Ptr AuthDomainDigest
domain' <- a -> IO (Ptr AuthDomainDigest)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
domain
Ptr Message
msg' <- b -> IO (Ptr Message)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
msg
CString
username' <- Text -> IO CString
textToCString Text
username
CString
result <- (FunPtr C_AuthDomainDigestAuthCallback
-> C_AuthDomainDigestAuthCallback
__dynamic_C_AuthDomainDigestAuthCallback FunPtr C_AuthDomainDigestAuthCallback
__funPtr) Ptr AuthDomainDigest
domain' Ptr Message
msg' CString
username' Ptr ()
userData
Maybe Text
maybeResult <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull CString
result ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \CString
result' -> do
Text
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
domain
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
msg
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
username'
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult
foreign import ccall "wrapper"
mk_AuthDomainDigestAuthCallback :: C_AuthDomainDigestAuthCallback -> IO (FunPtr C_AuthDomainDigestAuthCallback)
type AuthDomainDigestAuthCallback =
Soup.AuthDomainDigest.AuthDomainDigest
-> Soup.Message.Message
-> T.Text
-> IO (Maybe T.Text)
noAuthDomainDigestAuthCallback :: Maybe AuthDomainDigestAuthCallback
noAuthDomainDigestAuthCallback :: Maybe AuthDomainDigestAuthCallback
noAuthDomainDigestAuthCallback = Maybe AuthDomainDigestAuthCallback
forall a. Maybe a
Nothing
type AuthDomainDigestAuthCallback_WithClosures =
Soup.AuthDomainDigest.AuthDomainDigest
-> Soup.Message.Message
-> T.Text
-> Ptr ()
-> IO (Maybe T.Text)
noAuthDomainDigestAuthCallback_WithClosures :: Maybe AuthDomainDigestAuthCallback_WithClosures
noAuthDomainDigestAuthCallback_WithClosures :: Maybe AuthDomainDigestAuthCallback_WithClosures
noAuthDomainDigestAuthCallback_WithClosures = Maybe AuthDomainDigestAuthCallback_WithClosures
forall a. Maybe a
Nothing
drop_closures_AuthDomainDigestAuthCallback :: AuthDomainDigestAuthCallback -> AuthDomainDigestAuthCallback_WithClosures
drop_closures_AuthDomainDigestAuthCallback :: AuthDomainDigestAuthCallback
-> AuthDomainDigestAuthCallback_WithClosures
drop_closures_AuthDomainDigestAuthCallback AuthDomainDigestAuthCallback
_f AuthDomainDigest
domain Message
msg Text
username Ptr ()
_ = AuthDomainDigestAuthCallback
_f AuthDomainDigest
domain Message
msg Text
username
genClosure_AuthDomainDigestAuthCallback :: MonadIO m => AuthDomainDigestAuthCallback -> m (GClosure C_AuthDomainDigestAuthCallback)
genClosure_AuthDomainDigestAuthCallback :: AuthDomainDigestAuthCallback
-> m (GClosure C_AuthDomainDigestAuthCallback)
genClosure_AuthDomainDigestAuthCallback AuthDomainDigestAuthCallback
cb = IO (GClosure C_AuthDomainDigestAuthCallback)
-> m (GClosure C_AuthDomainDigestAuthCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_AuthDomainDigestAuthCallback)
-> m (GClosure C_AuthDomainDigestAuthCallback))
-> IO (GClosure C_AuthDomainDigestAuthCallback)
-> m (GClosure C_AuthDomainDigestAuthCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: AuthDomainDigestAuthCallback_WithClosures
cb' = AuthDomainDigestAuthCallback
-> AuthDomainDigestAuthCallback_WithClosures
drop_closures_AuthDomainDigestAuthCallback AuthDomainDigestAuthCallback
cb
let cb'' :: C_AuthDomainDigestAuthCallback
cb'' = Maybe (Ptr (FunPtr C_AuthDomainDigestAuthCallback))
-> AuthDomainDigestAuthCallback_WithClosures
-> C_AuthDomainDigestAuthCallback
wrap_AuthDomainDigestAuthCallback Maybe (Ptr (FunPtr C_AuthDomainDigestAuthCallback))
forall a. Maybe a
Nothing AuthDomainDigestAuthCallback_WithClosures
cb'
C_AuthDomainDigestAuthCallback
-> IO (FunPtr C_AuthDomainDigestAuthCallback)
mk_AuthDomainDigestAuthCallback C_AuthDomainDigestAuthCallback
cb'' IO (FunPtr C_AuthDomainDigestAuthCallback)
-> (FunPtr C_AuthDomainDigestAuthCallback
-> IO (GClosure C_AuthDomainDigestAuthCallback))
-> IO (GClosure C_AuthDomainDigestAuthCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_AuthDomainDigestAuthCallback
-> IO (GClosure C_AuthDomainDigestAuthCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_AuthDomainDigestAuthCallback ::
Maybe (Ptr (FunPtr C_AuthDomainDigestAuthCallback)) ->
AuthDomainDigestAuthCallback_WithClosures ->
C_AuthDomainDigestAuthCallback
wrap_AuthDomainDigestAuthCallback :: Maybe (Ptr (FunPtr C_AuthDomainDigestAuthCallback))
-> AuthDomainDigestAuthCallback_WithClosures
-> C_AuthDomainDigestAuthCallback
wrap_AuthDomainDigestAuthCallback Maybe (Ptr (FunPtr C_AuthDomainDigestAuthCallback))
funptrptr AuthDomainDigestAuthCallback_WithClosures
_cb Ptr AuthDomainDigest
domain Ptr Message
msg CString
username Ptr ()
userData = do
AuthDomainDigest
domain' <- ((ManagedPtr AuthDomainDigest -> AuthDomainDigest)
-> Ptr AuthDomainDigest -> IO AuthDomainDigest
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr AuthDomainDigest -> AuthDomainDigest
Soup.AuthDomainDigest.AuthDomainDigest) Ptr AuthDomainDigest
domain
Message
msg' <- ((ManagedPtr Message -> Message) -> Ptr Message -> IO Message
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Message -> Message
Soup.Message.Message) Ptr Message
msg
Text
username' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
username
Maybe Text
result <- AuthDomainDigestAuthCallback_WithClosures
_cb AuthDomainDigest
domain' Message
msg' Text
username' Ptr ()
userData
Maybe (Ptr (FunPtr C_AuthDomainDigestAuthCallback)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_AuthDomainDigestAuthCallback))
funptrptr
CString -> Maybe Text -> (Text -> IO CString) -> IO CString
forall (m :: * -> *) b a.
Monad m =>
b -> Maybe a -> (a -> m b) -> m b
maybeM CString
forall a. Ptr a
nullPtr Maybe Text
result ((Text -> IO CString) -> IO CString)
-> (Text -> IO CString) -> IO CString
forall a b. (a -> b) -> a -> b
$ \Text
result' -> do
CString
result'' <- Text -> IO CString
textToCString Text
result'
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
result''
type C_AuthDomainBasicAuthCallback =
Ptr Soup.AuthDomainBasic.AuthDomainBasic ->
Ptr Soup.Message.Message ->
CString ->
CString ->
Ptr () ->
IO CInt
foreign import ccall "dynamic" __dynamic_C_AuthDomainBasicAuthCallback :: FunPtr C_AuthDomainBasicAuthCallback -> C_AuthDomainBasicAuthCallback
dynamic_AuthDomainBasicAuthCallback ::
(B.CallStack.HasCallStack, MonadIO m, Soup.AuthDomainBasic.IsAuthDomainBasic a, Soup.Message.IsMessage b) =>
FunPtr C_AuthDomainBasicAuthCallback
-> a
-> b
-> T.Text
-> T.Text
-> Ptr ()
-> m Bool
dynamic_AuthDomainBasicAuthCallback :: FunPtr C_AuthDomainBasicAuthCallback
-> a -> b -> Text -> Text -> Ptr () -> m Bool
dynamic_AuthDomainBasicAuthCallback FunPtr C_AuthDomainBasicAuthCallback
__funPtr a
domain b
msg Text
username Text
password Ptr ()
userData = IO Bool -> m Bool
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
Ptr AuthDomainBasic
domain' <- a -> IO (Ptr AuthDomainBasic)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
domain
Ptr Message
msg' <- b -> IO (Ptr Message)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
msg
CString
username' <- Text -> IO CString
textToCString Text
username
CString
password' <- Text -> IO CString
textToCString Text
password
CInt
result <- (FunPtr C_AuthDomainBasicAuthCallback
-> C_AuthDomainBasicAuthCallback
__dynamic_C_AuthDomainBasicAuthCallback FunPtr C_AuthDomainBasicAuthCallback
__funPtr) Ptr AuthDomainBasic
domain' Ptr Message
msg' CString
username' CString
password' Ptr ()
userData
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
domain
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
msg
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
username'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
password'
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
foreign import ccall "wrapper"
mk_AuthDomainBasicAuthCallback :: C_AuthDomainBasicAuthCallback -> IO (FunPtr C_AuthDomainBasicAuthCallback)
type AuthDomainBasicAuthCallback =
Soup.AuthDomainBasic.AuthDomainBasic
-> Soup.Message.Message
-> T.Text
-> T.Text
-> IO Bool
noAuthDomainBasicAuthCallback :: Maybe AuthDomainBasicAuthCallback
noAuthDomainBasicAuthCallback :: Maybe AuthDomainBasicAuthCallback
noAuthDomainBasicAuthCallback = Maybe AuthDomainBasicAuthCallback
forall a. Maybe a
Nothing
type AuthDomainBasicAuthCallback_WithClosures =
Soup.AuthDomainBasic.AuthDomainBasic
-> Soup.Message.Message
-> T.Text
-> T.Text
-> Ptr ()
-> IO Bool
noAuthDomainBasicAuthCallback_WithClosures :: Maybe AuthDomainBasicAuthCallback_WithClosures
noAuthDomainBasicAuthCallback_WithClosures :: Maybe AuthDomainBasicAuthCallback_WithClosures
noAuthDomainBasicAuthCallback_WithClosures = Maybe AuthDomainBasicAuthCallback_WithClosures
forall a. Maybe a
Nothing
drop_closures_AuthDomainBasicAuthCallback :: AuthDomainBasicAuthCallback -> AuthDomainBasicAuthCallback_WithClosures
drop_closures_AuthDomainBasicAuthCallback :: AuthDomainBasicAuthCallback
-> AuthDomainBasicAuthCallback_WithClosures
drop_closures_AuthDomainBasicAuthCallback AuthDomainBasicAuthCallback
_f AuthDomainBasic
domain Message
msg Text
username Text
password Ptr ()
_ = AuthDomainBasicAuthCallback
_f AuthDomainBasic
domain Message
msg Text
username Text
password
genClosure_AuthDomainBasicAuthCallback :: MonadIO m => AuthDomainBasicAuthCallback -> m (GClosure C_AuthDomainBasicAuthCallback)
genClosure_AuthDomainBasicAuthCallback :: AuthDomainBasicAuthCallback
-> m (GClosure C_AuthDomainBasicAuthCallback)
genClosure_AuthDomainBasicAuthCallback AuthDomainBasicAuthCallback
cb = IO (GClosure C_AuthDomainBasicAuthCallback)
-> m (GClosure C_AuthDomainBasicAuthCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_AuthDomainBasicAuthCallback)
-> m (GClosure C_AuthDomainBasicAuthCallback))
-> IO (GClosure C_AuthDomainBasicAuthCallback)
-> m (GClosure C_AuthDomainBasicAuthCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: AuthDomainBasicAuthCallback_WithClosures
cb' = AuthDomainBasicAuthCallback
-> AuthDomainBasicAuthCallback_WithClosures
drop_closures_AuthDomainBasicAuthCallback AuthDomainBasicAuthCallback
cb
let cb'' :: C_AuthDomainBasicAuthCallback
cb'' = Maybe (Ptr (FunPtr C_AuthDomainBasicAuthCallback))
-> AuthDomainBasicAuthCallback_WithClosures
-> C_AuthDomainBasicAuthCallback
wrap_AuthDomainBasicAuthCallback Maybe (Ptr (FunPtr C_AuthDomainBasicAuthCallback))
forall a. Maybe a
Nothing AuthDomainBasicAuthCallback_WithClosures
cb'
C_AuthDomainBasicAuthCallback
-> IO (FunPtr C_AuthDomainBasicAuthCallback)
mk_AuthDomainBasicAuthCallback C_AuthDomainBasicAuthCallback
cb'' IO (FunPtr C_AuthDomainBasicAuthCallback)
-> (FunPtr C_AuthDomainBasicAuthCallback
-> IO (GClosure C_AuthDomainBasicAuthCallback))
-> IO (GClosure C_AuthDomainBasicAuthCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_AuthDomainBasicAuthCallback
-> IO (GClosure C_AuthDomainBasicAuthCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_AuthDomainBasicAuthCallback ::
Maybe (Ptr (FunPtr C_AuthDomainBasicAuthCallback)) ->
AuthDomainBasicAuthCallback_WithClosures ->
C_AuthDomainBasicAuthCallback
wrap_AuthDomainBasicAuthCallback :: Maybe (Ptr (FunPtr C_AuthDomainBasicAuthCallback))
-> AuthDomainBasicAuthCallback_WithClosures
-> C_AuthDomainBasicAuthCallback
wrap_AuthDomainBasicAuthCallback Maybe (Ptr (FunPtr C_AuthDomainBasicAuthCallback))
funptrptr AuthDomainBasicAuthCallback_WithClosures
_cb Ptr AuthDomainBasic
domain Ptr Message
msg CString
username CString
password Ptr ()
userData = do
AuthDomainBasic
domain' <- ((ManagedPtr AuthDomainBasic -> AuthDomainBasic)
-> Ptr AuthDomainBasic -> IO AuthDomainBasic
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr AuthDomainBasic -> AuthDomainBasic
Soup.AuthDomainBasic.AuthDomainBasic) Ptr AuthDomainBasic
domain
Message
msg' <- ((ManagedPtr Message -> Message) -> Ptr Message -> IO Message
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Message -> Message
Soup.Message.Message) Ptr Message
msg
Text
username' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
username
Text
password' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
password
Bool
result <- AuthDomainBasicAuthCallback_WithClosures
_cb AuthDomainBasic
domain' Message
msg' Text
username' Text
password' Ptr ()
userData
Maybe (Ptr (FunPtr C_AuthDomainBasicAuthCallback)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_AuthDomainBasicAuthCallback))
funptrptr
let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'
type C_AddressCallback =
Ptr Soup.Address.Address ->
Word32 ->
Ptr () ->
IO ()
foreign import ccall "dynamic" __dynamic_C_AddressCallback :: FunPtr C_AddressCallback -> C_AddressCallback
dynamic_AddressCallback ::
(B.CallStack.HasCallStack, MonadIO m, Soup.Address.IsAddress a) =>
FunPtr C_AddressCallback
-> a
-> Word32
-> Ptr ()
-> m ()
dynamic_AddressCallback :: FunPtr C_AddressCallback -> a -> Word32 -> Ptr () -> m ()
dynamic_AddressCallback FunPtr C_AddressCallback
__funPtr a
addr Word32
status Ptr ()
userData = 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 Address
addr' <- a -> IO (Ptr Address)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
addr
(FunPtr C_AddressCallback -> C_AddressCallback
__dynamic_C_AddressCallback FunPtr C_AddressCallback
__funPtr) Ptr Address
addr' Word32
status Ptr ()
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
addr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
foreign import ccall "wrapper"
mk_AddressCallback :: C_AddressCallback -> IO (FunPtr C_AddressCallback)
type AddressCallback =
Soup.Address.Address
-> Word32
-> IO ()
noAddressCallback :: Maybe AddressCallback
noAddressCallback :: Maybe AddressCallback
noAddressCallback = Maybe AddressCallback
forall a. Maybe a
Nothing
type AddressCallback_WithClosures =
Soup.Address.Address
-> Word32
-> Ptr ()
-> IO ()
noAddressCallback_WithClosures :: Maybe AddressCallback_WithClosures
noAddressCallback_WithClosures :: Maybe AddressCallback_WithClosures
noAddressCallback_WithClosures = Maybe AddressCallback_WithClosures
forall a. Maybe a
Nothing
drop_closures_AddressCallback :: AddressCallback -> AddressCallback_WithClosures
drop_closures_AddressCallback :: AddressCallback -> AddressCallback_WithClosures
drop_closures_AddressCallback AddressCallback
_f Address
addr Word32
status Ptr ()
_ = AddressCallback
_f Address
addr Word32
status
genClosure_AddressCallback :: MonadIO m => AddressCallback -> m (GClosure C_AddressCallback)
genClosure_AddressCallback :: AddressCallback -> m (GClosure C_AddressCallback)
genClosure_AddressCallback AddressCallback
cb = IO (GClosure C_AddressCallback) -> m (GClosure C_AddressCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_AddressCallback) -> m (GClosure C_AddressCallback))
-> IO (GClosure C_AddressCallback)
-> m (GClosure C_AddressCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: AddressCallback_WithClosures
cb' = AddressCallback -> AddressCallback_WithClosures
drop_closures_AddressCallback AddressCallback
cb
let cb'' :: C_AddressCallback
cb'' = Maybe (Ptr (FunPtr C_AddressCallback))
-> AddressCallback_WithClosures -> C_AddressCallback
wrap_AddressCallback Maybe (Ptr (FunPtr C_AddressCallback))
forall a. Maybe a
Nothing AddressCallback_WithClosures
cb'
C_AddressCallback -> IO (FunPtr C_AddressCallback)
mk_AddressCallback C_AddressCallback
cb'' IO (FunPtr C_AddressCallback)
-> (FunPtr C_AddressCallback -> IO (GClosure C_AddressCallback))
-> IO (GClosure C_AddressCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_AddressCallback -> IO (GClosure C_AddressCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_AddressCallback ::
Maybe (Ptr (FunPtr C_AddressCallback)) ->
AddressCallback_WithClosures ->
C_AddressCallback
wrap_AddressCallback :: Maybe (Ptr (FunPtr C_AddressCallback))
-> AddressCallback_WithClosures -> C_AddressCallback
wrap_AddressCallback Maybe (Ptr (FunPtr C_AddressCallback))
funptrptr AddressCallback_WithClosures
_cb Ptr Address
addr Word32
status Ptr ()
userData = do
Address
addr' <- ((ManagedPtr Address -> Address) -> Ptr Address -> IO Address
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Address -> Address
Soup.Address.Address) Ptr Address
addr
AddressCallback_WithClosures
_cb Address
addr' Word32
status Ptr ()
userData
Maybe (Ptr (FunPtr C_AddressCallback)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_AddressCallback))
funptrptr