since: 2.70

Declaration [src]

g_module_open_full (
  const gchar* file_name,
  GModuleFlags flags,
  GError** error

Description [src]

Opens a module. If the module has already been opened, its reference count is incremented. If not, the module is searched in the following order:

  1. If file_name exists as a regular file, it is used as-is; else
  2. If file_name doesn’t have the correct suffix and/or prefix for the platform, then possible suffixes and prefixes will be added to the basename till a file is found and whatever is found will be used; else
  3. If file_name doesn’t have the “.la”-suffix, “.la” is appended. Either way, if a matching .la file exists (and is a libtool archive) the libtool archive is parsed to find the actual file name, and that is used.

At the end of all this, we would have a file path that we can access on disk, and it is opened as a module. If not, file_name is opened as a module verbatim in the hopes that the system implementation will somehow be able to access it.

Available since: 2.70

This function is not directly available to language bindings.



Type: const gchar*

The name or path to the file containing the module, or NULL to obtain a GModule representing the main program itself.

The argument can be NULL.
The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.

Type: GModuleFlags

The flags used for opening the module. This can be the logical OR of any of the GModuleFlags.


Type: GError **

The return location for a recoverable error.

The argument can be NULL.
If the return location is not NULL, then you must initialize it to a NULL GError*.
The argument will be left initialized to NULL by the function if there are no errors.
In case of error, the argument will be set to a newly allocated GError; the caller will take ownership of the data, and be responsible for freeing it.

Return value

Type: GModule

A GModule on success, or NULL on failure.

The data is owned by the called function.