ModuleProtocol

public protocol ModuleProtocol

The GModule struct is an opaque data structure to represent a dynamically-loaded module. It should only be accessed via the following functions.

The ModuleProtocol protocol exposes the methods and properties of an underlying GModule instance. The default implementation of these can be found in the protocol extension below. For a concrete class that implements these methods and properties, see Module. Alternatively, use ModuleRef as a lighweight, unowned reference if you already have an instance you just want to use.

  • ptr

    Untyped pointer to the underlying GModule instance.

    Declaration

    Swift

    var ptr: UnsafeMutableRawPointer! { get }
  • _ptr Default implementation

    Typed pointer to the underlying GModule instance.

    Default Implementation

    Return the stored, untyped pointer as a typed pointer to the GModule instance.

    Declaration

    Swift

    var _ptr: UnsafeMutablePointer<GModule>! { get }
  • Required Initialiser for types conforming to ModuleProtocol

    Declaration

    Swift

    init(raw: UnsafeMutableRawPointer)

Module Record: ModuleProtocol extension (methods and fields)

  • close() Extension method

    Closes a module.

    Declaration

    Swift

    @inlinable
    func close() -> Bool
  • makeResident() Extension method

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

    Declaration

    Swift

    @inlinable
    func makeResident()
  • name() Extension method

    Returns the filename that the module was opened with.

    If module refers to the application itself, “main” is returned.

    Declaration

    Swift

    @inlinable
    func name() -> String!
  • symbol(symbolName:symbol:) Extension method

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

    Declaration

    Swift

    @inlinable
    func symbol(symbolName: UnsafePointer<gchar>!, symbol: UnsafeMutablePointer<gpointer?>?) -> Bool