-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | GModule bindings
--   
--   Bindings for GModule, autogenerated by haskell-gi.
@package gi-gmodule
@version 2.0.6


-- | Build time configuration used during code generation.
module GI.GModule.Config

-- | Overrides used when generating these bindings.
overrides :: Text


module GI.GModule.Constants

-- | <i>No description available in the introspection data.</i>
pattern MODULE_IMPL_WIN32 :: Int32

-- | <i>No description available in the introspection data.</i>
pattern MODULE_IMPL_NONE :: Int32

-- | <i>No description available in the introspection data.</i>
pattern MODULE_IMPL_DL :: Int32

-- | <i>No description available in the introspection data.</i>
pattern MODULE_IMPL_AR :: Int32


module GI.GModule.Enums

-- | Errors returned by <tt><i>g_module_open_full()</i></tt>.
--   
--   <i>Since: 2.70</i>
data ModuleError

-- | there was an error loading or opening a module file
ModuleErrorFailed :: ModuleError

-- | a module returned an error from its <tt>g_module_check_init()</tt>
--   function
ModuleErrorCheckFailed :: ModuleError

-- | Catch-all for unknown values
AnotherModuleError :: Int -> ModuleError

-- | Catch exceptions of type <a>ModuleError</a>. This is a specialized
--   version of <a>catchGErrorJustDomain</a>.
catchModuleError :: IO a -> (ModuleError -> GErrorMessage -> IO a) -> IO a

-- | Handle exceptions of type <a>ModuleError</a>. This is a specialized
--   version of <a>handleGErrorJustDomain</a>.
handleModuleError :: (ModuleError -> GErrorMessage -> IO a) -> IO a -> IO a
instance GHC.Classes.Eq GI.GModule.Enums.ModuleError
instance GHC.Show.Show GI.GModule.Enums.ModuleError
instance GHC.Enum.Enum GI.GModule.Enums.ModuleError
instance GHC.Classes.Ord GI.GModule.Enums.ModuleError
instance Data.GI.Base.GError.GErrorClass GI.GModule.Enums.ModuleError


module GI.GModule.Flags

-- | Flags passed to <tt><i>g_module_open()</i></tt>. Note that these flags
--   are not supported on all platforms.
data ModuleFlags

-- | specifies that symbols are only resolved when needed. The default
--   action is to bind all symbols when the module is loaded.
ModuleFlagsLazy :: ModuleFlags

-- | specifies that symbols in the module should not be added to the global
--   name space. The default action on most platforms is to place symbols
--   in the module in the global name space, which may cause conflicts with
--   existing symbols.
ModuleFlagsLocal :: ModuleFlags

-- | mask for all flags.
ModuleFlagsMask :: ModuleFlags

-- | Catch-all for unknown values
AnotherModuleFlags :: Int -> ModuleFlags
instance GHC.Classes.Eq GI.GModule.Flags.ModuleFlags
instance GHC.Show.Show GI.GModule.Flags.ModuleFlags
instance GHC.Enum.Enum GI.GModule.Flags.ModuleFlags
instance GHC.Classes.Ord GI.GModule.Flags.ModuleFlags
instance Data.GI.Base.BasicTypes.IsGFlag GI.GModule.Flags.ModuleFlags


-- | The <a>Module</a> struct is an opaque data structure to represent a
--   [dynamically-loaded module][glib-Dynamic-Loading-of-Modules]. It
--   should only be accessed via the following functions.
module GI.GModule.Structs.Module

-- | Memory-managed wrapper type.
newtype Module
Module :: ManagedPtr Module -> Module

-- | A portable way to build the filename of a module. The
--   platform-specific prefix and suffix are added to the filename, if
--   needed, and the result is added to the directory, using the correct
--   separator character.
--   
--   The directory should specify the directory where the module can be
--   found. It can be <a>Nothing</a> or an empty string to indicate that
--   the module is in a standard platform-specific directory, though this
--   is not recommended since the wrong module may be found.
--   
--   For example, calling <a>moduleBuildPath</a> on a Linux system with a
--   <i><tt>directory</tt></i> of <tt>/lib</tt> and a
--   <i><tt>moduleName</tt></i> of "mylibrary" will return
--   <tt>/lib/libmylibrary.so</tt>. On a Windows system, using
--   <tt>\Windows</tt> as the directory it will return
--   <tt>\Windows\mylibrary.dll</tt>.

-- | <i>Deprecated: (Since version 2.76)Use <tt><i>g_module_open()</i></tt>
--   instead with <i><tt>moduleName</tt></i> as thebasename of the
--   file_name argument. See <a>MODULE_SUFFIX</a> for why.</i>
moduleBuildPath :: (HasCallStack, MonadIO m) => Maybe Text -> Text -> m Text

-- | Closes a module.
moduleClose :: (HasCallStack, MonadIO m) => Module -> m Bool

-- | Gets a string describing the last module error.
moduleError :: (HasCallStack, MonadIO m) => m Text

-- | <i>No description available in the introspection data.</i>
moduleErrorQuark :: (HasCallStack, MonadIO m) => m Word32

-- | Ensures that a module will never be unloaded. Any future
--   <a>moduleClose</a> calls on the module will be ignored.
moduleMakeResident :: (HasCallStack, MonadIO m) => Module -> m ()

-- | Returns the filename that the module was opened with.
--   
--   If <i><tt>module</tt></i> refers to the application itself, "main" is
--   returned.
moduleName :: (HasCallStack, MonadIO m) => Module -> m Text

-- | Checks if modules are supported on the current platform.
moduleSupported :: (HasCallStack, MonadIO m) => m Bool

-- | Gets a symbol pointer from a module, such as one exported by
--   <tt><i>G_MODULE_EXPORT</i></tt>. Note that a valid symbol can be
--   <a>Nothing</a>.
moduleSymbol :: (HasCallStack, MonadIO m) => Module -> Text -> m (Bool, Ptr ())
instance GHC.Classes.Eq GI.GModule.Structs.Module.Module
instance Data.GI.Base.BasicTypes.ManagedPtrNewtype GI.GModule.Structs.Module.Module
instance Data.GI.Base.BasicTypes.BoxedPtr GI.GModule.Structs.Module.Module


module GI.GModule.Structs


module GI.GModule.Callbacks

-- | Type for the callback on the (unwrapped) C side.
type C_ModuleCheckInit = Ptr Module -> IO CString

-- | Specifies the type of the module initialization function. If a module
--   contains a function named <tt><i>g_module_check_init()</i></tt> it is
--   called automatically when the module is loaded. It is passed the
--   <a>Module</a> structure and should return <a>Nothing</a> on success or
--   a string describing the initialization error.
type ModuleCheckInit = -- | /@module@/: the t'GI.GModule.Structs.Module.Module' corresponding to the module which has just been loaded Module -> -- | __Returns:__ 'P.Nothing' on success, or a string describing the initialization error IO Text

-- | Given a pointer to a foreign C function, wrap it into a function
--   callable from Haskell.
dynamic_ModuleCheckInit :: (HasCallStack, MonadIO m) => FunPtr C_ModuleCheckInit -> Module -> m Text

-- | Wrap the callback into a <a>GClosure</a>.
genClosure_ModuleCheckInit :: MonadIO m => ModuleCheckInit -> m (GClosure C_ModuleCheckInit)

-- | Generate a function pointer callable from C code, from a
--   <a>C_ModuleCheckInit</a>.
mk_ModuleCheckInit :: C_ModuleCheckInit -> IO (FunPtr C_ModuleCheckInit)

-- | A convenience synonym for <tt><a>Nothing</a> :: <a>Maybe</a>
--   <a>ModuleCheckInit</a></tt>.
noModuleCheckInit :: Maybe ModuleCheckInit

-- | Wrap a <a>ModuleCheckInit</a> into a <a>C_ModuleCheckInit</a>.
wrap_ModuleCheckInit :: Maybe (Ptr (FunPtr C_ModuleCheckInit)) -> ModuleCheckInit -> C_ModuleCheckInit

-- | Type for the callback on the (unwrapped) C side.
type C_ModuleUnload = Ptr Module -> IO ()

-- | Specifies the type of the module function called when it is unloaded.
--   If a module contains a function named
--   <tt><i>g_module_unload()</i></tt> it is called automatically when the
--   module is unloaded. It is passed the <a>Module</a> structure.
type ModuleUnload = -- | /@module@/: the t'GI.GModule.Structs.Module.Module' about to be unloaded Module -> IO ()

-- | Given a pointer to a foreign C function, wrap it into a function
--   callable from Haskell.
dynamic_ModuleUnload :: (HasCallStack, MonadIO m) => FunPtr C_ModuleUnload -> Module -> m ()

-- | Wrap the callback into a <a>GClosure</a>.
genClosure_ModuleUnload :: MonadIO m => ModuleUnload -> m (GClosure C_ModuleUnload)

-- | Generate a function pointer callable from C code, from a
--   <a>C_ModuleUnload</a>.
mk_ModuleUnload :: C_ModuleUnload -> IO (FunPtr C_ModuleUnload)

-- | A convenience synonym for <tt><a>Nothing</a> :: <a>Maybe</a>
--   <a>ModuleUnload</a></tt>.
noModuleUnload :: Maybe ModuleUnload

-- | Wrap a <a>ModuleUnload</a> into a <a>C_ModuleUnload</a>.
wrap_ModuleUnload :: Maybe (Ptr (FunPtr C_ModuleUnload)) -> ModuleUnload -> C_ModuleUnload


module GI.GModule
