Flowdock
module
Importance_2

A libffi wrapper for Ruby.

Description

Fiddle is an extension to translate a foreign function interface (FFI) with ruby.

It wraps libffi a popular C library which provides a portable interface that allows code written in one language to call code written in another language.

Example

Here we will use Fiddle::Function to wrap floor(3) from libm

require 'fiddle'

libm = Fiddle.dlopen('/lib/libm.so.6')

floor = Fiddle::Function.new(
  libm['floor'],
  [Fiddle::TYPE_DOUBLE],
  Fiddle::TYPE_DOUBLE
)

puts floor.call(3.14159) #=> 3.0

frozen_string_literal: false


frozen_string_literal: false


frozen_string_literal: false


frozen_string_literal: false

Constants

RTLD_NOW = Handle::RTLD_NOW # :nodoc:

RTLD_LAZY = Handle::RTLD_LAZY # :nodoc:

RTLD_GLOBAL = Handle::RTLD_GLOBAL # :nodoc:

BUILD_RUBY_PLATFORM = Document-const

RUBY_FREE = Document-const

SIZEOF_UINTPTR_T = Document-const

SIZEOF_INTPTR_T = Document-const

SIZEOF_PTRDIFF_T = Document-const

SIZEOF_SSIZE_T = Document-const

SIZEOF_SIZE_T = Document-const

SIZEOF_DOUBLE = Document-const

SIZEOF_FLOAT = Document-const

SIZEOF_LONG_LONG = Document-const

SIZEOF_LONG = Document-const

SIZEOF_INT = Document-const

SIZEOF_SHORT = Document-const

SIZEOF_CHAR = Document-const

SIZEOF_VOIDP = Document-const

WINDOWS = Qtrue

ALIGN_UINTPTR_T = Document-const

ALIGN_INTPTR_T = Document-const

ALIGN_PTRDIFF_T = Document-const

ALIGN_SSIZE_T = Document-const

ALIGN_SIZE_T = Document-const

ALIGN_DOUBLE = Document-const

ALIGN_FLOAT = Document-const

ALIGN_LONG_LONG = Document-const

ALIGN_LONG = Document-const

ALIGN_INT = Document-const

ALIGN_SHORT = Document-const

ALIGN_CHAR = Document-const

ALIGN_VOIDP = Document-const

TYPE_UINTPTR_T = Document-const

TYPE_INTPTR_T = Document-const

TYPE_PTRDIFF_T = Document-const

TYPE_SSIZE_T = Document-const

TYPE_SIZE_T = Document-const

TYPE_DOUBLE = Document-const

TYPE_FLOAT = Document-const

TYPE_LONG_LONG = Document-const

TYPE_LONG = Document-const

TYPE_INT = Document-const

TYPE_SHORT = Document-const

TYPE_CHAR = Document-const

TYPE_VOIDP = Document-const

TYPE_VOID = Document-const

Attributes

Show files where this module is defined (11 files)
Register or log in to add new notes.