- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125 (0)
- 1_9_3_392 (0)
- 2_1_10 (38)
- 2_2_9 (0)
- 2_4_6 (8)
- 2_5_5 (0)
- 2_6_3 (0)
- What's this?
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: true
frozen_string_literal: true
frozen_string_literal: true
frozen_string_literal: true
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