method
extern
v1_9_3_392 -
Show latest stable
- Class:
DL::Importer
extern(signature, *opts)public
No documentation available.
# 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