Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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)
- moduleBuildPath :: (HasCallStack, MonadIO m) => Maybe Text -> Text -> m Text
- moduleClose :: (HasCallStack, MonadIO m) => Module -> m Bool
- moduleError :: (HasCallStack, MonadIO m) => m Text
- moduleErrorQuark :: (HasCallStack, MonadIO m) => m Word32
- moduleMakeResident :: (HasCallStack, MonadIO m) => Module -> m ()
- moduleName :: (HasCallStack, MonadIO m) => Module -> m Text
- moduleSupported :: (HasCallStack, MonadIO m) => m Bool
- moduleSymbol :: (HasCallStack, MonadIO m) => Module -> Text -> m (Bool, Ptr ())
Exported types
Memory-managed wrapper type.
Instances
Eq Module Source # | |
BoxedPtr Module Source # | |
Defined in GI.GModule.Structs.Module boxedPtrCopy :: Module -> IO Module boxedPtrFree :: Module -> IO () | |
ManagedPtrNewtype Module Source # | |
Defined in GI.GModule.Structs.Module toManagedPtr :: Module -> ManagedPtr Module |
Methods
Click to display all available methods, including inherited ones
buildPath
:: (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
Closes a module.
error
:: (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
:: (HasCallStack, MonadIO m) | |
=> Module |
|
-> m () |
Ensures that a module will never be unloaded.
Any future moduleClose
calls on the module will be ignored.
name
:: (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
:: (HasCallStack, MonadIO m) | |
=> m Bool | Returns: |
Checks if modules are supported on the current platform.