GModule.Module - Structures - GModule 2.0 (original) (raw)
Fields¶
None
Methods¶
class | build_path (directory, module_name) |
---|---|
class | error () |
class | error_quark () |
class | supported () |
close () | |
make_resident () | |
name () | |
symbol (symbol_name) |
Details¶
class GModule.Module¶
The GModule.Module struct is an opaque data structure to represent adynamically-loaded module. It should only be accessed via the following functions.
classmethod build_path(directory, module_name)[source]¶
Parameters:
- directory (str or None) – the directory where the module is. This can beNone or the empty string to indicate that the standard platform-specific directories will be used, though that is not recommended
- module_name (str) – the name of the module
Returns:
the complete path of the module, including the standard library prefix and suffix. This should be freed when no longer needed
Return type:
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 None 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 GModule.Module.build_path() on a Linux system with adirectory of /lib
and a module_name of “mylibrary” will return/lib/libmylibrary.so
. On a Windows system, using \Windows
as the directory it will return \Windows\mylibrary.dll
.
Deprecated since version 2.76: Use g_module_open() instead with module_name as the basename of the file_name argument. See GLib.MODULE_SUFFIX for why.
Returns:
a string describing the last module error
Return type:
Gets a string describing the last module error.
classmethod error_quark()[source]¶
Return type:
classmethod supported()[source]¶
Returns:
True if modules are supported
Return type:
Checks if modules are supported on the current platform.
Returns:
True on success
Return type:
Closes a module.
Ensures that a module will never be unloaded. Any future GModule.Module.close() calls on the module will be ignored.
Returns:
the filename of the module
Return type:
Returns the filename that the module was opened with.
If self refers to the application itself, “main” is returned.
Parameters:
symbol_name (str) – the name of the symbol to find
Returns:
True on success
symbol:
returns the pointer to the symbol value
Return type:
Gets a symbol pointer from a module, such as one exported by %G_MODULE_EXPORT. Note that a valid symbol can be None.