module FFI::Library

def typedef(current, add, info=nil)

def typedef(current, add, info=nil)
  @ffi_typedefs = Hash.new unless defined?(@ffi_typedefs)
  code = if current.kind_of?(FFI::Type)
    current
  elsif current == :enum
    if add.kind_of?(Array)
      self.enum(add)
    else
      self.enum(info, add)
    end
  else
    @ffi_typedefs[current] || FFI.find_type(current)
  end
  @ffi_typedefs[add] = code
end