APIdock / Ruby
/
method

find_library

ruby latest stable - Class: Object

Method deprecated or moved

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

find_library(lib, func, *paths, &b)
public

Returns whether or not the entry point func can be found within the library lib in one of the paths specified, where paths is an array of strings. If func is nil , then the main() function is used as the entry point.

If lib is found, then the path it was found on is added to the list of library paths searched and linked against.

# File lib/mkmf.rb, line 862
def find_library(lib, func, *paths, &b)
 func = "main" if !func or func.empty?
 lib = with_config(lib+'lib', lib)
 paths = paths.collect {|path| path.split(File::PATH_SEPARATOR)}.flatten
 checking_for "#{func}() in #{LIBARG%lib}" do
 libpath = $LIBPATH
 libs = append_library($libs, lib)
 begin
 until r = try_func(func, libs, &b) or paths.empty?
 $LIBPATH = libpath | [paths.shift]
 end
 if r
 $libs = libs
 libpath = nil
 end
 ensure
 $LIBPATH = libpath if libpath
 end
 r
 end
end

AltStyle によって変換されたページ (->オリジナル) /