module FFIDB::SymbolTable

Public Instance Methods

each(&block)
Alias for: each_symbol
each_enum(&block) click to toggle source

@yield [enum] @yieldparam [enum] Enum @return [Enumerator]

# File lib/ffidb/symbol_table.rb, line 58
def each_enum(&block)
  return self.to_enum(:each_enum) unless block_given?
  self.enums.each(&block)
end
each_function(&block) click to toggle source

@yield [function] @yieldparam [function] Function @return [Enumerator]

# File lib/ffidb/symbol_table.rb, line 85
def each_function(&block)
  return self.to_enum(:each_function) unless block_given?
  self.functions.each(&block)
end
each_struct(&block) click to toggle source

@yield [struct] @yieldparam [struct] Struct @return [Enumerator]

# File lib/ffidb/symbol_table.rb, line 67
def each_struct(&block)
  return self.to_enum(:each_struct) unless block_given?
  self.structs.each(&block)
end
each_symbol(&block) click to toggle source

@yield [symbol] @yieldparam [symbol] Symbolic @return [Enumerator]

# File lib/ffidb/symbol_table.rb, line 35
def each_symbol(&block)
  return self.to_enum(:each_symbol) unless block_given?
  self.each_typedef(&block)
  self.each_enum(&block)
  self.each_struct(&block)
  self.each_union(&block)
  self.each_function(&block)
end
Also aliased as: each
each_type(&block) click to toggle source

@yield [type] @yieldparam [type] Type @return [Enumerator]

# File lib/ffidb/symbol_table.rb, line 19
def each_type(&block)
  return self.to_enum(:each_type) unless block_given?
  types = {}
  self.each_function do |function| # TODO: each_symbol
    types[function.type.to_s] ||= function.type
    function.parameters.each_value do |parameter|
      types[parameter.type.to_s] ||= parameter.type
    end
  end
  types.values.sort.each(&block)
end
each_typedef(&block) click to toggle source

@yield [typedef] @yieldparam [symbol] Symbolic @return [Enumerator]

# File lib/ffidb/symbol_table.rb, line 49
def each_typedef(&block)
  return self.to_enum(:each_typedef) unless block_given?
  self.typedefs.each(&block)
end
each_union(&block) click to toggle source

@yield [union] @yieldparam [union] Union @return [Enumerator]

# File lib/ffidb/symbol_table.rb, line 76
def each_union(&block)
  return self.to_enum(:each_union) unless block_given?
  self.unions.each(&block)
end
types() click to toggle source

@return [Array<Type>]

# File lib/ffidb/symbol_table.rb, line 11
def types
  self.each_type.to_a
end