method

extern

Importance_0
v1_9_3_125 - Show latest stable - 0 notes - Class: Importer
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 130
    def extern(signature, *opts)
      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.