# File lib/ffi/library.rb, line 24 def self.map_library_name(lib) # Mangle the library name to reflect the native library naming conventions lib = lib.to_s unless lib.kind_of?(String) lib = Library::LIBC if lib == 'c' if lib && File.basename(lib) == lib lib = Platform::LIBPREFIX + lib unless lib =~ /^#{Platform::LIBPREFIX}/ r = Platform::IS_LINUX ? "\\.so($|\\.[1234567890]+)" : "\\.#{Platform::LIBSUFFIX}$" lib += ".#{Platform::LIBSUFFIX}" unless lib =~ /#{r}/ end lib end