Module: FFI::GNUExtensions

Extended by:
Library
Included in:
Libfuse
Defined in:
lib/ffi/gnu_extensions.rb

Overview

Support versioned functions until https://github.com/ffi/ffi/issues/889

end

Examples:

require 'ffi'

module MyLibrary
  extend FFI::Library

  if FFI::Platform::IS_GNU
    require 'ffi/gnu_extensions'

    extend(FFI::GNUExtensions)
    # default versions for all functions
    ffi_lib_versions(%w[VERSION_X.3 VERSION_X.2])
  end

  attach_function :func_one, [:int], :int
  # override default with specific version
  attach_function :func_two, [], :int, versions ['VERSION_X.Y']

Defined Under Namespace

Modules: DLV

Instance Method Summary collapse

Instance Method Details

#dlopen(library, type) ⇒ FFI::Pointer

Returns library address, possibly NULL.

Returns:

  • (FFI::Pointer)

    library address, possibly NULL



34
# File 'lib/ffi/gnu_extensions.rb', line 34

attach_function :dlopen, %i[string int], :pointer

#dlvsym(handle) ⇒ FFI::Pointer

Returns function address, possibly NULL.

Returns:

  • (FFI::Pointer)

    function address, possibly NULL



37
# File 'lib/ffi/gnu_extensions.rb', line 37

attach_function :dlvsym, %i[pointer string string], :pointer