gi-gmodule-2.0.6: GModule bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.GModule.Callbacks

Contents

- Signals
  - ModuleCheckInit
  - ModuleUnload

Description

Synopsis

- type C_ModuleCheckInit = Ptr Module -> IO CString
- type ModuleCheckInit = Module -> IO Text
- dynamic_ModuleCheckInit :: (HasCallStack, MonadIO m) => FunPtr C_ModuleCheckInit -> Module -> m Text
- genClosure_ModuleCheckInit :: MonadIO m => ModuleCheckInit -> m (GClosure C_ModuleCheckInit)
- mk_ModuleCheckInit :: C_ModuleCheckInit -> IO (FunPtr C_ModuleCheckInit)
- noModuleCheckInit :: Maybe ModuleCheckInit
- wrap_ModuleCheckInit :: Maybe (Ptr (FunPtr C_ModuleCheckInit)) -> ModuleCheckInit -> C_ModuleCheckInit
- type C_ModuleUnload = Ptr Module -> IO ()
- type ModuleUnload = Module -> IO ()
- dynamic_ModuleUnload :: (HasCallStack, MonadIO m) => FunPtr C_ModuleUnload -> Module -> m ()
- genClosure_ModuleUnload :: MonadIO m => ModuleUnload -> m (GClosure C_ModuleUnload)
- mk_ModuleUnload :: C_ModuleUnload -> IO (FunPtr C_ModuleUnload)
- noModuleUnload :: Maybe ModuleUnload
- wrap_ModuleUnload :: Maybe (Ptr (FunPtr C_ModuleUnload)) -> ModuleUnload -> C_ModuleUnload

# Signals

## ModuleCheckInit

type C_ModuleCheckInit = Ptr Module -> IO CString Source #

Type for the callback on the (unwrapped) C side.

type ModuleCheckInit Source #

Arguments

= Module | `module`: the `Module` corresponding to the module which has just been loaded
-> IO Text | Returns: `Nothing` on success, or a string describing the initialization error

Specifies the type of the module initialization function. If a module contains a function named `g_module_check_init()` it is called automatically when the module is loaded. It is passed the `Module` structure and should return `Nothing` on success or a string describing the initialization error.

dynamic_ModuleCheckInit Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> FunPtr C_ModuleCheckInit |
-> Module | `module`: the `Module` corresponding to the module which has just been loaded
-> m Text | Returns: `Nothing` on success, or a string describing the initialization error

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

genClosure_ModuleCheckInit :: MonadIO m => ModuleCheckInit -> m (GClosure C_ModuleCheckInit) Source #

Wrap the callback into a `GClosure`.

mk_ModuleCheckInit :: C_ModuleCheckInit -> IO (FunPtr C_ModuleCheckInit) Source #

Generate a function pointer callable from C code, from a `C_ModuleCheckInit`.

noModuleCheckInit :: Maybe ModuleCheckInit Source #

A convenience synonym for ``Nothing` :: `Maybe` `ModuleCheckInit``.

wrap_ModuleCheckInit :: Maybe (Ptr (FunPtr C_ModuleCheckInit)) -> ModuleCheckInit -> C_ModuleCheckInit Source #

Wrap a `ModuleCheckInit` into a `C_ModuleCheckInit`.

## ModuleUnload

type C_ModuleUnload = Ptr Module -> IO () Source #

Type for the callback on the (unwrapped) C side.

type ModuleUnload Source #

Arguments

= Module | `module`: the `Module` about to be unloaded
-> IO () |

Specifies the type of the module function called when it is unloaded. If a module contains a function named `g_module_unload()` it is called automatically when the module is unloaded. It is passed the `Module` structure.

dynamic_ModuleUnload Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> FunPtr C_ModuleUnload |
-> Module | `module`: the `Module` about to be unloaded
-> m () |

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

genClosure_ModuleUnload :: MonadIO m => ModuleUnload -> m (GClosure C_ModuleUnload) Source #

Wrap the callback into a `GClosure`.

mk_ModuleUnload :: C_ModuleUnload -> IO (FunPtr C_ModuleUnload) Source #

Generate a function pointer callable from C code, from a `C_ModuleUnload`.

noModuleUnload :: Maybe ModuleUnload Source #

A convenience synonym for ``Nothing` :: `Maybe` `ModuleUnload``.

wrap_ModuleUnload :: Maybe (Ptr (FunPtr C_ModuleUnload)) -> ModuleUnload -> C_ModuleUnload Source #

Wrap a `ModuleUnload` into a `C_ModuleUnload`.