In Files

  • ruby-3.1.2/ext/fiddle/lib/fiddle/import.rb

Parent

Files

Class/Module Index [+]

Quicksearch

Fiddle::CompositeHandler

Used internally by Fiddle::Importer

Public Class Methods

new(handlers) click to toggle source

Create a new handler with the open handlers

Used internally by Fiddle::Importer.dlload

 
               # File ruby-3.1.2/ext/fiddle/lib/fiddle/import.rb, line 13
def initialize(handlers)
  @handlers = handlers
end
            

Public Instance Methods

[](symbol) click to toggle source

See Fiddle::CompositeHandler.sym

 
               # File ruby-3.1.2/ext/fiddle/lib/fiddle/import.rb, line 40
def [](symbol)
  sym(symbol)
end
            
handlers() click to toggle source

Array of the currently loaded libraries.

 
               # File ruby-3.1.2/ext/fiddle/lib/fiddle/import.rb, line 18
def handlers()
  @handlers
end
            
sym(symbol) click to toggle source

Returns the address as an Integer from any handlers with the function named symbol.

Raises a DLError if the handle is closed.

 
               # File ruby-3.1.2/ext/fiddle/lib/fiddle/import.rb, line 26
def sym(symbol)
  @handlers.each{|handle|
    if( handle )
      begin
        addr = handle.sym(symbol)
        return addr
      rescue DLError
      end
    end
  }
  return nil
end