Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: GModule

[16:7] extends: object

The #GModule struct is an opaque data structure to represent a dynamically-loaded module. It should only be accessed via the following functions. To ensure correct lock ordering, these functions must not be called from global constructors (for example, those using GCC’s __attribute__((constructor)) attribute).

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • GModule (Handle = null)

    Creates a new Module by wrapping a native handle or another wrapper.

    • @p Handle is the native handle or another wrapper whose handle to adopt.
  • toNativeHandle (Source)

    Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from fn.call(...), another generated wrapper exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • close ()

    Closes a module.

    • @r %TRUE on success.
  • make_resident ()

    Ensures that a module will never be unloaded. Any future g_module_close() calls on the module will be ignored.

    • @r None.
  • name ()

    Returns the filename that the module was opened with. If @module refers to the application itself, "main" is returned.

    • @r the filename of the module.
  • symbol (string symbol_name)

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

    • @p symbol_name is the name of the symbol to find.
    • @p symbol is returns the pointer to the symbol value.
    • @r %TRUE on success.