#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.GModule.Callbacks
(
C_ModuleCheckInit ,
ModuleCheckInit ,
dynamic_ModuleCheckInit ,
genClosure_ModuleCheckInit ,
mk_ModuleCheckInit ,
noModuleCheckInit ,
wrap_ModuleCheckInit ,
C_ModuleUnload ,
ModuleUnload ,
dynamic_ModuleUnload ,
genClosure_ModuleUnload ,
mk_ModuleUnload ,
noModuleUnload ,
wrap_ModuleUnload ,
) 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.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 GHC.Records as R
import {-# SOURCE #-} qualified GI.GModule.Structs.Module as GModule.Module
type C_ModuleUnload =
Ptr GModule.Module.Module ->
IO ()
foreign import ccall "dynamic" __dynamic_C_ModuleUnload :: FunPtr C_ModuleUnload -> C_ModuleUnload
dynamic_ModuleUnload ::
(B.CallStack.HasCallStack, MonadIO m) =>
FunPtr C_ModuleUnload
-> GModule.Module.Module
-> m ()
dynamic_ModuleUnload :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr C_ModuleUnload -> Module -> m ()
dynamic_ModuleUnload FunPtr C_ModuleUnload
__funPtr Module
module_ = 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 Module
module_' <- Module -> IO (Ptr Module)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Module
module_
(FunPtr C_ModuleUnload -> C_ModuleUnload
__dynamic_C_ModuleUnload FunPtr C_ModuleUnload
__funPtr) Ptr Module
module_'
Module -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Module
module_
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
foreign import ccall "wrapper"
mk_ModuleUnload :: C_ModuleUnload -> IO (FunPtr C_ModuleUnload)
type ModuleUnload =
GModule.Module.Module
-> IO ()
noModuleUnload :: Maybe ModuleUnload
noModuleUnload :: Maybe (Module -> IO ())
noModuleUnload = Maybe (Module -> IO ())
forall a. Maybe a
Nothing
genClosure_ModuleUnload :: MonadIO m => ModuleUnload -> m (GClosure C_ModuleUnload)
genClosure_ModuleUnload :: forall (m :: * -> *).
MonadIO m =>
(Module -> IO ()) -> m (GClosure C_ModuleUnload)
genClosure_ModuleUnload Module -> IO ()
cb = IO (GClosure C_ModuleUnload) -> m (GClosure C_ModuleUnload)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_ModuleUnload) -> m (GClosure C_ModuleUnload))
-> IO (GClosure C_ModuleUnload) -> m (GClosure C_ModuleUnload)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_ModuleUnload
cb' = Maybe (Ptr (FunPtr C_ModuleUnload))
-> (Module -> IO ()) -> C_ModuleUnload
wrap_ModuleUnload Maybe (Ptr (FunPtr C_ModuleUnload))
forall a. Maybe a
Nothing Module -> IO ()
cb
C_ModuleUnload -> IO (FunPtr C_ModuleUnload)
mk_ModuleUnload C_ModuleUnload
cb' IO (FunPtr C_ModuleUnload)
-> (FunPtr C_ModuleUnload -> IO (GClosure C_ModuleUnload))
-> IO (GClosure C_ModuleUnload)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_ModuleUnload -> IO (GClosure C_ModuleUnload)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_ModuleUnload ::
Maybe (Ptr (FunPtr C_ModuleUnload)) ->
ModuleUnload ->
C_ModuleUnload
wrap_ModuleUnload :: Maybe (Ptr (FunPtr C_ModuleUnload))
-> (Module -> IO ()) -> C_ModuleUnload
wrap_ModuleUnload Maybe (Ptr (FunPtr C_ModuleUnload))
funptrptr Module -> IO ()
_cb Ptr Module
module_ = do
Module
module_' <- ((ManagedPtr Module -> Module) -> Ptr Module -> IO Module
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr Module -> Module
GModule.Module.Module) Ptr Module
module_
Module -> IO ()
_cb Module
module_'
Maybe (Ptr (FunPtr C_ModuleUnload)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_ModuleUnload))
funptrptr
type C_ModuleCheckInit =
Ptr GModule.Module.Module ->
IO CString
foreign import ccall "dynamic" __dynamic_C_ModuleCheckInit :: FunPtr C_ModuleCheckInit -> C_ModuleCheckInit
dynamic_ModuleCheckInit ::
(B.CallStack.HasCallStack, MonadIO m) =>
FunPtr C_ModuleCheckInit
-> GModule.Module.Module
-> m T.Text
dynamic_ModuleCheckInit :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr C_ModuleCheckInit -> Module -> m Text
dynamic_ModuleCheckInit FunPtr C_ModuleCheckInit
__funPtr Module
module_ = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr Module
module_' <- Module -> IO (Ptr Module)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Module
module_
CString
result <- (FunPtr C_ModuleCheckInit -> C_ModuleCheckInit
__dynamic_C_ModuleCheckInit FunPtr C_ModuleCheckInit
__funPtr) Ptr Module
module_'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"moduleCheckInit" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
Module -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Module
module_
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
foreign import ccall "wrapper"
mk_ModuleCheckInit :: C_ModuleCheckInit -> IO (FunPtr C_ModuleCheckInit)
type ModuleCheckInit =
GModule.Module.Module
-> IO T.Text
noModuleCheckInit :: Maybe ModuleCheckInit
noModuleCheckInit :: Maybe ModuleCheckInit
noModuleCheckInit = Maybe ModuleCheckInit
forall a. Maybe a
Nothing
genClosure_ModuleCheckInit :: MonadIO m => ModuleCheckInit -> m (GClosure C_ModuleCheckInit)
genClosure_ModuleCheckInit :: forall (m :: * -> *).
MonadIO m =>
ModuleCheckInit -> m (GClosure C_ModuleCheckInit)
genClosure_ModuleCheckInit ModuleCheckInit
cb = IO (GClosure C_ModuleCheckInit) -> m (GClosure C_ModuleCheckInit)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_ModuleCheckInit) -> m (GClosure C_ModuleCheckInit))
-> IO (GClosure C_ModuleCheckInit)
-> m (GClosure C_ModuleCheckInit)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_ModuleCheckInit
cb' = Maybe (Ptr (FunPtr C_ModuleCheckInit))
-> ModuleCheckInit -> C_ModuleCheckInit
wrap_ModuleCheckInit Maybe (Ptr (FunPtr C_ModuleCheckInit))
forall a. Maybe a
Nothing ModuleCheckInit
cb
C_ModuleCheckInit -> IO (FunPtr C_ModuleCheckInit)
mk_ModuleCheckInit C_ModuleCheckInit
cb' IO (FunPtr C_ModuleCheckInit)
-> (FunPtr C_ModuleCheckInit -> IO (GClosure C_ModuleCheckInit))
-> IO (GClosure C_ModuleCheckInit)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_ModuleCheckInit -> IO (GClosure C_ModuleCheckInit)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_ModuleCheckInit ::
Maybe (Ptr (FunPtr C_ModuleCheckInit)) ->
ModuleCheckInit ->
C_ModuleCheckInit
wrap_ModuleCheckInit :: Maybe (Ptr (FunPtr C_ModuleCheckInit))
-> ModuleCheckInit -> C_ModuleCheckInit
wrap_ModuleCheckInit Maybe (Ptr (FunPtr C_ModuleCheckInit))
funptrptr ModuleCheckInit
_cb Ptr Module
module_ = do
Module
module_' <- ((ManagedPtr Module -> Module) -> Ptr Module -> IO Module
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr Module -> Module
GModule.Module.Module) Ptr Module
module_
Text
result <- ModuleCheckInit
_cb Module
module_'
Maybe (Ptr (FunPtr C_ModuleCheckInit)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_ModuleCheckInit))
funptrptr
CString
result' <- Text -> IO CString
textToCString Text
result
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
result'