method

extern

Importance_0
Ruby latest stable (v2_5_5) - 0 notes - Class: Importer

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v2_1_10) is shown here.

These similar methods exist in v2_5_5:

extern(signature, *opts) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File ext/dl/lib/dl/import.rb, line 131
    def extern(signature, *opts)
      @type_alias ||= nil
      symname, ctype, argtype = parse_signature(signature, @type_alias)
      opt = parse_bind_options(opts)
      f = import_function(symname, ctype, argtype, opt[:call_type])
      name = symname.gsub(/@.+/,'')
      @func_map[name] = f
      # define_method(name){|*args,&block| f.call(*args,&block)}
      begin
        /^(.+?):(\d+)/ =~ caller.first
        file, line = $1, $2.to_i
      rescue
        file, line = __FILE__, __LINE__+3
      end
      module_eval(        def #{name}(*args, &block)          @func_map['#{name}'].call(*args,&block)        end, file, line)
      module_function(name)
      f
    end
Register or log in to add new notes.