#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Soup.Callbacks
(
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_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_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 ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R
import {-# SOURCE #-} qualified GI.Soup.Enums as Soup.Enums
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.ServerMessage as Soup.ServerMessage
import {-# SOURCE #-} qualified GI.Soup.Objects.WebsocketConnection as Soup.WebsocketConnection
type C_ServerWebsocketCallback =
Ptr Soup.Server.Server ->
Ptr Soup.ServerMessage.ServerMessage ->
CString ->
Ptr Soup.WebsocketConnection.WebsocketConnection ->
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.ServerMessage.IsServerMessage b, Soup.WebsocketConnection.IsWebsocketConnection c) =>
FunPtr C_ServerWebsocketCallback
-> a
-> b
-> T.Text
-> c
-> Ptr ()
-> m ()
dynamic_ServerWebsocketCallback :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsServer a, IsServerMessage b,
IsWebsocketConnection c) =>
FunPtr C_ServerWebsocketCallback
-> a -> b -> Text -> c -> Ptr () -> m ()
dynamic_ServerWebsocketCallback FunPtr C_ServerWebsocketCallback
__funPtr a
server b
msg Text
path c
connection Ptr ()
userData = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Server
server' <- a -> IO (Ptr Server)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
server
Ptr ServerMessage
msg' <- b -> IO (Ptr ServerMessage)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
msg
CString
path' <- Text -> IO CString
textToCString Text
path
Ptr WebsocketConnection
connection' <- c -> IO (Ptr WebsocketConnection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
connection
(FunPtr C_ServerWebsocketCallback -> C_ServerWebsocketCallback
__dynamic_C_ServerWebsocketCallback FunPtr C_ServerWebsocketCallback
__funPtr) Ptr Server
server' Ptr ServerMessage
msg' CString
path' Ptr WebsocketConnection
connection' Ptr ()
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
server
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
msg
c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr c
connection
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
path'
() -> IO ()
forall a. a -> IO a
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.ServerMessage.ServerMessage
-> T.Text
-> Soup.WebsocketConnection.WebsocketConnection
-> IO ()
noServerWebsocketCallback :: Maybe ServerWebsocketCallback
noServerWebsocketCallback :: Maybe ServerWebsocketCallback
noServerWebsocketCallback = Maybe ServerWebsocketCallback
forall a. Maybe a
Nothing
type ServerWebsocketCallback_WithClosures =
Soup.Server.Server
-> Soup.ServerMessage.ServerMessage
-> T.Text
-> Soup.WebsocketConnection.WebsocketConnection
-> 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 ServerMessage
msg Text
path WebsocketConnection
connection Ptr ()
_ = ServerWebsocketCallback
_f Server
server ServerMessage
msg Text
path WebsocketConnection
connection
genClosure_ServerWebsocketCallback :: MonadIO m => ServerWebsocketCallback -> m (GClosure C_ServerWebsocketCallback)
genClosure_ServerWebsocketCallback :: forall (m :: * -> *).
MonadIO m =>
ServerWebsocketCallback -> m (GClosure C_ServerWebsocketCallback)
genClosure_ServerWebsocketCallback ServerWebsocketCallback
cb = IO (GClosure C_ServerWebsocketCallback)
-> m (GClosure C_ServerWebsocketCallback)
forall a. IO a -> m a
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 a b. IO a -> (a -> IO b) -> IO b
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))
gi'funptrptr ServerWebsocketCallback_WithClosures
gi'cb Ptr Server
server Ptr ServerMessage
msg CString
path Ptr WebsocketConnection
connection 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
ServerMessage
msg' <- ((ManagedPtr ServerMessage -> ServerMessage)
-> Ptr ServerMessage -> IO ServerMessage
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr ServerMessage -> ServerMessage
Soup.ServerMessage.ServerMessage) Ptr ServerMessage
msg
Text
path' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
path
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
ServerWebsocketCallback_WithClosures
gi'cb Server
server' ServerMessage
msg' Text
path' WebsocketConnection
connection' Ptr ()
userData
Maybe (Ptr (FunPtr C_ServerWebsocketCallback)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_ServerWebsocketCallback))
gi'funptrptr
type C_ServerCallback =
Ptr Soup.Server.Server ->
Ptr Soup.ServerMessage.ServerMessage ->
CString ->
Ptr (GHashTable CString CString) ->
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.ServerMessage.IsServerMessage b) =>
FunPtr C_ServerCallback
-> a
-> b
-> T.Text
-> Maybe (Map.Map T.Text T.Text)
-> Ptr ()
-> m ()
dynamic_ServerCallback :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsServer a, IsServerMessage b) =>
FunPtr C_ServerCallback
-> a -> b -> Text -> Maybe (Map Text Text) -> Ptr () -> m ()
dynamic_ServerCallback FunPtr C_ServerCallback
__funPtr a
server b
msg Text
path Maybe (Map Text Text)
query Ptr ()
userData = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Server
server' <- a -> IO (Ptr Server)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
server
Ptr ServerMessage
msg' <- b -> IO (Ptr ServerMessage)
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 a. a -> IO a
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
B.GHT.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
B.GHT.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 a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr (GHashTable CString CString)
jQuery''''''
(FunPtr C_ServerCallback -> C_ServerCallback
__dynamic_C_ServerCallback FunPtr C_ServerCallback
__funPtr) Ptr Server
server' Ptr ServerMessage
msg' CString
path' Ptr (GHashTable CString CString)
maybeQuery Ptr ()
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
server
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
msg
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 a. a -> IO a
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.ServerMessage.ServerMessage
-> T.Text
-> Maybe (Map.Map T.Text T.Text)
-> IO ()
noServerCallback :: Maybe ServerCallback
noServerCallback :: Maybe ServerCallback
noServerCallback = Maybe ServerCallback
forall a. Maybe a
Nothing
type ServerCallback_WithClosures =
Soup.Server.Server
-> Soup.ServerMessage.ServerMessage
-> T.Text
-> Maybe (Map.Map T.Text T.Text)
-> 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 ServerMessage
msg Text
path Maybe (Map Text Text)
query Ptr ()
_ = ServerCallback
_f Server
server ServerMessage
msg Text
path Maybe (Map Text Text)
query
genClosure_ServerCallback :: MonadIO m => ServerCallback -> m (GClosure C_ServerCallback)
genClosure_ServerCallback :: forall (m :: * -> *).
MonadIO m =>
ServerCallback -> m (GClosure C_ServerCallback)
genClosure_ServerCallback ServerCallback
cb = IO (GClosure C_ServerCallback) -> m (GClosure C_ServerCallback)
forall a. IO a -> m a
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 a b. IO a -> (a -> IO b) -> IO b
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))
gi'funptrptr ServerCallback_WithClosures
gi'cb Ptr Server
server Ptr ServerMessage
msg CString
path Ptr (GHashTable CString CString)
query 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
ServerMessage
msg' <- ((ManagedPtr ServerMessage -> ServerMessage)
-> Ptr ServerMessage -> IO ServerMessage
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr ServerMessage -> ServerMessage
Soup.ServerMessage.ServerMessage) Ptr ServerMessage
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 a. a -> IO a
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
B.GHT.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
B.GHT.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 a. a -> IO a
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''''''
ServerCallback_WithClosures
gi'cb Server
server' ServerMessage
msg' Text
path' Maybe (Map Text Text)
maybeQuery Ptr ()
userData
Maybe (Ptr (FunPtr C_ServerCallback)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_ServerCallback))
gi'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 a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ 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 a. a -> IO a
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 a. IO a -> m a
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 a b. IO a -> (a -> IO b) -> IO b
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))
gi'funptrptr MessageHeadersForeachFunc_WithClosures
gi'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
gi'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))
gi'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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsLogger a) =>
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 a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ 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 a. a -> IO a
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 :: forall (m :: * -> *).
MonadIO m =>
LoggerPrinter -> m (GClosure C_LoggerPrinter)
genClosure_LoggerPrinter LoggerPrinter
cb = IO (GClosure C_LoggerPrinter) -> m (GClosure C_LoggerPrinter)
forall a. IO a -> m a
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 a b. IO a -> (a -> IO b) -> IO b
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))
gi'funptrptr LoggerPrinter_WithClosures
gi'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
gi'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))
gi'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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsLogger a, IsMessage b) =>
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 a. IO a -> m a
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 a. a -> IO a
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 :: forall (m :: * -> *).
MonadIO m =>
LoggerFilter -> m (GClosure C_LoggerFilter)
genClosure_LoggerFilter LoggerFilter
cb = IO (GClosure C_LoggerFilter) -> m (GClosure C_LoggerFilter)
forall a. IO a -> m a
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 a b. IO a -> (a -> IO b) -> IO b
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))
gi'funptrptr LoggerFilter_WithClosures
gi'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
gi'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))
gi'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 a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CUInt
result'
type C_AuthDomainGenericAuthCallback =
Ptr Soup.AuthDomain.AuthDomain ->
Ptr Soup.ServerMessage.ServerMessage ->
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.ServerMessage.IsServerMessage b) =>
FunPtr C_AuthDomainGenericAuthCallback
-> a
-> b
-> T.Text
-> Ptr ()
-> m Bool
dynamic_AuthDomainGenericAuthCallback :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsAuthDomain a, IsServerMessage b) =>
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 a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr AuthDomain
domain' <- a -> IO (Ptr AuthDomain)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
domain
Ptr ServerMessage
msg' <- b -> IO (Ptr ServerMessage)
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 ServerMessage
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 a. a -> IO a
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.ServerMessage.ServerMessage
-> 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.ServerMessage.ServerMessage
-> 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 ServerMessage
msg Text
username Ptr ()
_ = AuthDomainGenericAuthCallback
_f AuthDomain
domain ServerMessage
msg Text
username
genClosure_AuthDomainGenericAuthCallback :: MonadIO m => AuthDomainGenericAuthCallback -> m (GClosure C_AuthDomainGenericAuthCallback)
genClosure_AuthDomainGenericAuthCallback :: forall (m :: * -> *).
MonadIO m =>
AuthDomainGenericAuthCallback
-> m (GClosure C_AuthDomainGenericAuthCallback)
genClosure_AuthDomainGenericAuthCallback AuthDomainGenericAuthCallback
cb = IO (GClosure C_AuthDomainGenericAuthCallback)
-> m (GClosure C_AuthDomainGenericAuthCallback)
forall a. IO a -> m a
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 a b. IO a -> (a -> IO b) -> IO b
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))
gi'funptrptr AuthDomainGenericAuthCallback_WithClosures
gi'cb Ptr AuthDomain
domain Ptr ServerMessage
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
ServerMessage
msg' <- ((ManagedPtr ServerMessage -> ServerMessage)
-> Ptr ServerMessage -> IO ServerMessage
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr ServerMessage -> ServerMessage
Soup.ServerMessage.ServerMessage) Ptr ServerMessage
msg
Text
username' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
username
Bool
result <- AuthDomainGenericAuthCallback_WithClosures
gi'cb AuthDomain
domain' ServerMessage
msg' Text
username' Ptr ()
userData
Maybe (Ptr (FunPtr C_AuthDomainGenericAuthCallback)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_AuthDomainGenericAuthCallback))
gi'funptrptr
let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.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
P.fromEnum) Bool
result
CInt -> IO CInt
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'
type C_AuthDomainFilter =
Ptr Soup.AuthDomain.AuthDomain ->
Ptr Soup.ServerMessage.ServerMessage ->
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.ServerMessage.IsServerMessage b) =>
FunPtr C_AuthDomainFilter
-> a
-> b
-> Ptr ()
-> m Bool
dynamic_AuthDomainFilter :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsAuthDomain a, IsServerMessage b) =>
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 a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr AuthDomain
domain' <- a -> IO (Ptr AuthDomain)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
domain
Ptr ServerMessage
msg' <- b -> IO (Ptr ServerMessage)
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 ServerMessage
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 a. a -> IO a
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.ServerMessage.ServerMessage
-> IO Bool
noAuthDomainFilter :: Maybe AuthDomainFilter
noAuthDomainFilter :: Maybe AuthDomainFilter
noAuthDomainFilter = Maybe AuthDomainFilter
forall a. Maybe a
Nothing
type AuthDomainFilter_WithClosures =
Soup.AuthDomain.AuthDomain
-> Soup.ServerMessage.ServerMessage
-> 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 ServerMessage
msg Ptr ()
_ = AuthDomainFilter
_f AuthDomain
domain ServerMessage
msg
genClosure_AuthDomainFilter :: MonadIO m => AuthDomainFilter -> m (GClosure C_AuthDomainFilter)
genClosure_AuthDomainFilter :: forall (m :: * -> *).
MonadIO m =>
AuthDomainFilter -> m (GClosure C_AuthDomainFilter)
genClosure_AuthDomainFilter AuthDomainFilter
cb = IO (GClosure C_AuthDomainFilter) -> m (GClosure C_AuthDomainFilter)
forall a. IO a -> m a
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 a b. IO a -> (a -> IO b) -> IO b
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))
gi'funptrptr AuthDomainFilter_WithClosures
gi'cb Ptr AuthDomain
domain Ptr ServerMessage
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
ServerMessage
msg' <- ((ManagedPtr ServerMessage -> ServerMessage)
-> Ptr ServerMessage -> IO ServerMessage
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr ServerMessage -> ServerMessage
Soup.ServerMessage.ServerMessage) Ptr ServerMessage
msg
Bool
result <- AuthDomainFilter_WithClosures
gi'cb AuthDomain
domain' ServerMessage
msg' Ptr ()
userData
Maybe (Ptr (FunPtr C_AuthDomainFilter)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_AuthDomainFilter))
gi'funptrptr
let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.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
P.fromEnum) Bool
result
CInt -> IO CInt
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'
type C_AuthDomainDigestAuthCallback =
Ptr Soup.AuthDomainDigest.AuthDomainDigest ->
Ptr Soup.ServerMessage.ServerMessage ->
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.ServerMessage.IsServerMessage b) =>
FunPtr C_AuthDomainDigestAuthCallback
-> a
-> b
-> T.Text
-> Ptr ()
-> m (Maybe T.Text)
dynamic_AuthDomainDigestAuthCallback :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsAuthDomainDigest a,
IsServerMessage b) =>
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 a. IO a -> m a
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 ServerMessage
msg' <- b -> IO (Ptr ServerMessage)
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 ServerMessage
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 a. a -> IO a
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 a. a -> IO a
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.ServerMessage.ServerMessage
-> 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.ServerMessage.ServerMessage
-> 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 ServerMessage
msg Text
username Ptr ()
_ = AuthDomainDigestAuthCallback
_f AuthDomainDigest
domain ServerMessage
msg Text
username
genClosure_AuthDomainDigestAuthCallback :: MonadIO m => AuthDomainDigestAuthCallback -> m (GClosure C_AuthDomainDigestAuthCallback)
genClosure_AuthDomainDigestAuthCallback :: forall (m :: * -> *).
MonadIO m =>
AuthDomainDigestAuthCallback
-> m (GClosure C_AuthDomainDigestAuthCallback)
genClosure_AuthDomainDigestAuthCallback AuthDomainDigestAuthCallback
cb = IO (GClosure C_AuthDomainDigestAuthCallback)
-> m (GClosure C_AuthDomainDigestAuthCallback)
forall a. IO a -> m a
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 a b. IO a -> (a -> IO b) -> IO b
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))
gi'funptrptr AuthDomainDigestAuthCallback_WithClosures
gi'cb Ptr AuthDomainDigest
domain Ptr ServerMessage
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
ServerMessage
msg' <- ((ManagedPtr ServerMessage -> ServerMessage)
-> Ptr ServerMessage -> IO ServerMessage
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr ServerMessage -> ServerMessage
Soup.ServerMessage.ServerMessage) Ptr ServerMessage
msg
Text
username' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
username
Maybe Text
result <- AuthDomainDigestAuthCallback_WithClosures
gi'cb AuthDomainDigest
domain' ServerMessage
msg' Text
username' Ptr ()
userData
Maybe (Ptr (FunPtr C_AuthDomainDigestAuthCallback)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_AuthDomainDigestAuthCallback))
gi'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
FP.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 a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
result''
type C_AuthDomainBasicAuthCallback =
Ptr Soup.AuthDomainBasic.AuthDomainBasic ->
Ptr Soup.ServerMessage.ServerMessage ->
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.ServerMessage.IsServerMessage b) =>
FunPtr C_AuthDomainBasicAuthCallback
-> a
-> b
-> T.Text
-> T.Text
-> Ptr ()
-> m Bool
dynamic_AuthDomainBasicAuthCallback :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsAuthDomainBasic a,
IsServerMessage b) =>
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 a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr AuthDomainBasic
domain' <- a -> IO (Ptr AuthDomainBasic)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
domain
Ptr ServerMessage
msg' <- b -> IO (Ptr ServerMessage)
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 ServerMessage
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 a. a -> IO a
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.ServerMessage.ServerMessage
-> 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.ServerMessage.ServerMessage
-> 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 ServerMessage
msg Text
username Text
password Ptr ()
_ = AuthDomainBasicAuthCallback
_f AuthDomainBasic
domain ServerMessage
msg Text
username Text
password
genClosure_AuthDomainBasicAuthCallback :: MonadIO m => AuthDomainBasicAuthCallback -> m (GClosure C_AuthDomainBasicAuthCallback)
genClosure_AuthDomainBasicAuthCallback :: forall (m :: * -> *).
MonadIO m =>
AuthDomainBasicAuthCallback
-> m (GClosure C_AuthDomainBasicAuthCallback)
genClosure_AuthDomainBasicAuthCallback AuthDomainBasicAuthCallback
cb = IO (GClosure C_AuthDomainBasicAuthCallback)
-> m (GClosure C_AuthDomainBasicAuthCallback)
forall a. IO a -> m a
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 a b. IO a -> (a -> IO b) -> IO b
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))
gi'funptrptr AuthDomainBasicAuthCallback_WithClosures
gi'cb Ptr AuthDomainBasic
domain Ptr ServerMessage
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
ServerMessage
msg' <- ((ManagedPtr ServerMessage -> ServerMessage)
-> Ptr ServerMessage -> IO ServerMessage
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr ServerMessage -> ServerMessage
Soup.ServerMessage.ServerMessage) Ptr ServerMessage
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
gi'cb AuthDomainBasic
domain' ServerMessage
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))
gi'funptrptr
let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.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
P.fromEnum) Bool
result
CInt -> IO CInt
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'