Module: FFI_Yajl

### Home Classes Methods

### In Files

- lib/ffi_yajl/benchmark/encode.rb
- lib/ffi_yajl/benchmark/encode_profile.rb
- lib/ffi_yajl/benchmark/parse_profile.rb
- lib/ffi_yajl/benchmark/parse_profile_ruby_prof.rb
- lib/ffi_yajl/encoder.rb
- lib/ffi_yajl/ext.rb
- lib/ffi_yajl/ffi.rb
- lib/ffi_yajl/ffi/encoder.rb
- lib/ffi_yajl/ffi/parser.rb
- lib/ffi_yajl/parser.rb
- lib/ffi_yajl/platform.rb
- lib/ffi_yajl/version.rb

### Namespace

- MODULE FFI_Yajl::FFI
- MODULE FFI_Yajl::Platform
- CLASS FFI_Yajl::Benchmark
- CLASS FFI_Yajl::EncodeError
- CLASS FFI_Yajl::Encoder
- CLASS FFI_Yajl::ParseError
- CLASS FFI_Yajl::Parser
- CLASS FFI_Yajl::YajlCallbacks

### Methods

- ::try_dl_dlopen
- ::try_ffi_dlopen
- ::try_fiddle_dlopen

### Files

- LICENSE
- MIT-LICENSE

### Class/Module Index

Quicksearch

- FFI_Yajl
- FFI_Yajl::Benchmark
- FFI_Yajl::Benchmark::Encode
- FFI_Yajl::Benchmark::EncodeProfile
- FFI_Yajl::Benchmark::Parse
- FFI_Yajl::Benchmark::ParseProfile
- FFI_Yajl::Benchmark::ParseProfileRubyProf
- FFI_Yajl::EncodeError
- FFI_Yajl::Encoder
- FFI_Yajl::FFI
- FFI_Yajl::FFI::Encoder
- FFI_Yajl::FFI::Parser
- FFI_Yajl::ParseError
- FFI_Yajl::Parser
- FFI_Yajl::Platform
- FFI_Yajl::YajlCallbacks
- JSON
- JSON::GeneratorError
- JSON::JSONError
- JSON::ParserError
- Array
- Bignum
- Date
- DateTime
- FalseClass
- Fixnum
- Float
- Hash
- Kernel
- NilClass
- Object
- String
- Symbol
- Time
- TrueClass

No matching classes.

# FFI_Yajl

### Constants

VERSION

### Public Class Methods

try_dl_dlopen(libpath) click to toggle source

    # File lib/ffi_yajl/ext.rb, line 38
    def self.try_dl_dlopen(libpath)
      require 'dl'
      if defined?(DL) && DL.respond_to?(:dlopen)
        ::DL.dlopen(libpath)
        true
      else
        false
      end
    rescue LoadError
      return false
    end

try_ffi_dlopen(libpath) click to toggle source

    # File lib/ffi_yajl/ext.rb, line 50
    def self.try_ffi_dlopen(libpath)
      require 'ffi'
      require 'rbconfig'
      extend ::FFI::Library
      ffi_lib 'dl'
      attach_function 'dlopen', :dlopen, [:string, :int], :void
      if  RbConfig::CONFIG['host_os'] =~ /linux/
        dlopen libpath, 0x102  # linux: RTLD_GLOBAL | RTLD_NOW
      else
        dlopen libpath, 0
      end
      true
    rescue LoadError
      return false
    end

try_fiddle_dlopen(libpath) click to toggle source

FFS, what exactly was so wrong with DL.dlopen that ruby had to get rid of it???

    # File lib/ffi_yajl/ext.rb, line 26
    def self.try_fiddle_dlopen(libpath)
      require 'fiddle'
      if defined?(Fiddle) && Fiddle.respond_to?(:dlopen)
        ::Fiddle.dlopen(libpath)
        true
      else
        false
      end
    rescue LoadError
      return false
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.