| 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.Structs.Module
Description
The Module 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.
Synopsis
- newtype Module = Module (ManagedPtr Module)
- type family ResolveModuleMethod (t :: Symbol) o where ...
- moduleBuildPath :: (HasCallStack, MonadIO m) => Maybe Text -> Text -> m Text
- data ModuleCloseMethodInfo
- moduleClose :: (HasCallStack, MonadIO m) => Module -> m Bool
- moduleError :: (HasCallStack, MonadIO m) => m Text
- moduleErrorQuark :: (HasCallStack, MonadIO m) => m Word32
- data ModuleMakeResidentMethodInfo
- moduleMakeResident :: (HasCallStack, MonadIO m) => Module -> m ()
- data ModuleNameMethodInfo
- moduleName :: (HasCallStack, MonadIO m) => Module -> m Text
- moduleSupported :: (HasCallStack, MonadIO m) => m Bool
- data ModuleSymbolMethodInfo
- moduleSymbol :: (HasCallStack, MonadIO m) => Module -> Text -> m (Bool, Ptr ())
Exported types
Memory-managed wrapper type.
Constructors
| Module (ManagedPtr Module) |
Instances
Methods
Click to display all available methods, including inherited ones
type family ResolveModuleMethod (t :: Symbol) o where ... Source #
Equations
| ResolveModuleMethod "close" o = ModuleCloseMethodInfo | |
| ResolveModuleMethod "makeResident" o = ModuleMakeResidentMethodInfo | |
| ResolveModuleMethod "name" o = ModuleNameMethodInfo | |
| ResolveModuleMethod "symbol" o = ModuleSymbolMethodInfo | |
| ResolveModuleMethod l o = MethodResolutionFailed l o :: Type |
buildPath
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Maybe Text |
|
| -> Text |
|
| -> m Text | Returns: the complete path of the module, including the standard library prefix and suffix. This should be freed when no longer needed |
Deprecated: (Since version 2.76)Use g_module_open() instead with moduleName as thebasename of the file_name argument. See MODULE_SUFFIX for why.
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 Nothing 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 moduleBuildPath on a Linux system with a
directory of /lib and a moduleName of "mylibrary" will return
/lib/libmylibrary.so. On a Windows system, using \Windows as the
directory it will return \Windows\mylibrary.dll.
close
data ModuleCloseMethodInfo Source #
Instances
| (signature ~ m Bool, MonadIO m) => OverloadedMethod ModuleCloseMethodInfo Module signature Source # | |
Defined in GI.GModule.Structs.Module Methods overloadedMethod :: Module -> signature # | |
| OverloadedMethodInfo ModuleCloseMethodInfo Module Source # | |
Defined in GI.GModule.Structs.Module Methods | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Module |
|
| -> m Bool | Returns: |
Closes a module.
error
Arguments
| :: (HasCallStack, MonadIO m) | |
| => m Text | Returns: a string describing the last module error |
Gets a string describing the last module error.
errorQuark
moduleErrorQuark :: (HasCallStack, MonadIO m) => m Word32 Source #
No description available in the introspection data.
makeResident
data ModuleMakeResidentMethodInfo Source #
Instances
| (signature ~ m (), MonadIO m) => OverloadedMethod ModuleMakeResidentMethodInfo Module signature Source # | |
Defined in GI.GModule.Structs.Module Methods overloadedMethod :: Module -> signature # | |
| OverloadedMethodInfo ModuleMakeResidentMethodInfo Module Source # | |
Defined in GI.GModule.Structs.Module Methods | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Module |
|
| -> m () |
Ensures that a module will never be unloaded.
Any future moduleClose calls on the module will be ignored.
name
data ModuleNameMethodInfo Source #
Instances
| (signature ~ m Text, MonadIO m) => OverloadedMethod ModuleNameMethodInfo Module signature Source # | |
Defined in GI.GModule.Structs.Module Methods overloadedMethod :: Module -> signature # | |
| OverloadedMethodInfo ModuleNameMethodInfo Module Source # | |
Defined in GI.GModule.Structs.Module Methods | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Module |
|
| -> m Text | Returns: the filename of the module |
Returns the filename that the module was opened with.
If module refers to the application itself, "main" is returned.
supported
Arguments
| :: (HasCallStack, MonadIO m) | |
| => m Bool | Returns: |
Checks if modules are supported on the current platform.
symbol
data ModuleSymbolMethodInfo Source #
Instances
| (signature ~ (Text -> m (Bool, Ptr ())), MonadIO m) => OverloadedMethod ModuleSymbolMethodInfo Module signature Source # | |
Defined in GI.GModule.Structs.Module Methods overloadedMethod :: Module -> signature # | |
| OverloadedMethodInfo ModuleSymbolMethodInfo Module Source # | |
Defined in GI.GModule.Structs.Module Methods | |