gi-gmodule-2.0.2: GModule bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

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

Exported types

newtype Module Source #

Memory-managed wrapper type.

Constructors

Module (ManagedPtr Module) 

Instances

Instances details
Eq Module Source # 
Instance details

Defined in GI.GModule.Structs.Module

Methods

(==) :: Module -> Module -> Bool #

(/=) :: Module -> Module -> Bool #

BoxedPtr Module Source # 
Instance details

Defined in GI.GModule.Structs.Module

ManagedPtrNewtype Module Source # 
Instance details

Defined in GI.GModule.Structs.Module

Methods

Click to display all available methods, including inherited ones

Expand

Methods

close, makeResident, name, symbol.

Getters

None.

Setters

None.

buildPath

moduleBuildPath Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Maybe Text

directory: the directory where the module is. This can be Nothing or the empty string to indicate that the standard platform-specific directories will be used, though that is not recommended

-> Text

moduleName: the name of the module

-> m Text

Returns: the complete path of the module, including the standard library prefix and suffix. This should be freed when no longer needed

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

moduleClose Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Module

module: a Module to close

-> m Bool

Returns: True on success

Closes a module.

error

moduleError Source #

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

moduleMakeResident Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Module

module: a Module to make permanently resident

-> m () 

Ensures that a module will never be unloaded. Any future moduleClose calls on the module will be ignored.

name

moduleName Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Module

module: a 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

moduleSupported Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m Bool

Returns: True if modules are supported

Checks if modules are supported on the current platform.

symbol

moduleSymbol Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Module

module: a Module

-> Text

symbolName: the name of the symbol to find

-> m (Bool, Ptr ())

Returns: True on success

Gets a symbol pointer from a module, such as one exported by G_MODULE_EXPORT. Note that a valid symbol can be Nothing.