ModuleRef

public struct ModuleRef : 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 ModuleRef type acts as a lightweight Swift reference to an underlying GModule instance. It exposes methods that can operate on this data type through ModuleProtocol conformance. Use ModuleRef only as an unowned reference to an existing GModule instance.

  • ptr
    Untyped pointer to the underlying `GModule` instance.
    

    For type-safe access, use the generated, typed pointer _ptr property instead.

    Declaration

    Swift

    public let ptr: UnsafeMutableRawPointer!

Module Record

  • Designated initialiser from the underlying C data type

    Declaration

    Swift

    @inlinable
    init(_ p: UnsafeMutablePointer<GModule>)
  • Designated initialiser from a constant pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init(_ p: UnsafePointer<GModule>)
  • Conditional initialiser from an optional pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init!(_ maybePointer: UnsafeMutablePointer<GModule>?)
  • Conditional initialiser from an optional, non-mutable pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init!(_ maybePointer: UnsafePointer<GModule>?)
  • Conditional initialiser from an optional gpointer

    Declaration

    Swift

    @inlinable
    init!(gpointer g: gpointer?)
  • Conditional initialiser from an optional, non-mutable gconstpointer

    Declaration

    Swift

    @inlinable
    init!(gconstpointer g: gconstpointer?)
  • Reference intialiser for a related type that implements ModuleProtocol

    Declaration

    Swift

    @inlinable
    init<T>(_ other: T) where T : ModuleProtocol
  • Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to ModuleProtocol.

    Declaration

    Swift

    @inlinable
    init<T>(cPointer: UnsafeMutablePointer<T>)
  • Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to ModuleProtocol.

    Declaration

    Swift

    @inlinable
    init<T>(constPointer: UnsafePointer<T>)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to ModuleProtocol.

    Declaration

    Swift

    @inlinable
    init(mutating raw: UnsafeRawPointer)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to ModuleProtocol.

    Declaration

    Swift

    @inlinable
    init(raw: UnsafeMutableRawPointer)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to ModuleProtocol.

    Declaration

    Swift

    @inlinable
    init(opaquePointer: OpaquePointer)
  • A thin wrapper function around g_module_open_full()

    Declaration

    Swift

    @inlinable
    static func open(fileName: UnsafePointer<gchar>? = nil, flags: ModuleFlags) -> ModuleRef!
  • Opens a module. If the module has already been opened, its reference count is incremented.

    First of all g_module_open_full() tries to open file_name as a module. If that fails and file_name has the “.la”-suffix (and is a libtool archive) it tries to open the corresponding module. If that fails and it doesn’t have the proper module suffix for the platform (G_MODULE_SUFFIX), this suffix will be appended and the corresponding module will be opened. If that fails and file_name doesn’t have the “.la”-suffix, this suffix is appended and g_module_open_full() tries to open the corresponding module. If eventually that fails as well, nil is returned.

    Declaration

    Swift

    @inlinable
    static func openFull(fileName: UnsafePointer<gchar>? = nil, flags: ModuleFlags) throws -> ModuleRef!