/** * Loads a native library and links the methods defined in {@code interfaceClass} * to native methods in the library. * * @deprecated see {@link LibraryLoader} for the preferred interface to loading libraries. * @param <T> the interface class. * @param libraryName the name of the library to load * @param interfaceClass the interface that describes the native library interface * @return an instance of {@code interfaceclass} that will call the native methods. */ public static <T> T loadLibrary(String libraryName, Class<T> interfaceClass) { return loadLibrary(interfaceClass, libraryName); }
/** * Loads a native library and links the methods defined in {@code interfaceClass} * to native methods in the library. * * @deprecated see {@link LibraryLoader} for the preferred interface to loading libraries. * @param libraryName the name of the library to load * @param interfaceClass the interface that describes the native library interface * @return an instance of {@code interfaceclass} that will call the native methods. */ public static <T> T loadLibrary(String libraryName, Class<T> interfaceClass) { return loadLibrary(interfaceClass, libraryName); }
/** * Loads a native library and links the methods defined in {@code interfaceClass} * to native methods in the library. * * @deprecated see {@link LibraryLoader} for the preferred interface to loading libraries. * @param <T> the interface class. * @param libraryName the name of the library to load * @param interfaceClass the interface that describes the native library interface * @return an instance of {@code interfaceclass} that will call the native methods. */ public static <T> T loadLibrary(String libraryName, Class<T> interfaceClass) { return loadLibrary(interfaceClass, libraryName); }
/** * Loads a native library and links the methods defined in {@code interfaceClass} * to native methods in the library. * * @deprecated see {@link LibraryLoader} for the preferred interface to loading libraries. * @param libraryName the name of the library to load * @param interfaceClass the interface that describes the native library interface * @param libraryOptions options * @return an instance of {@code interfaceclass} that will call the native methods. */ public static <T> T loadLibrary(String libraryName, Class<T> interfaceClass, Map<LibraryOption, ?> libraryOptions) { return loadLibrary(interfaceClass, libraryOptions, libraryName); }
/** * Loads a native library and links the methods defined in {@code interfaceClass} * to native methods in the library. * * @deprecated see {@link LibraryLoader} for the preferred interface to loading libraries. * @param <T> the interface type. * @param libraryName the name of the library to load * @param interfaceClass the interface that describes the native library interface * @param libraryOptions options * @return an instance of {@code interfaceclass} that will call the native methods. */ public static <T> T loadLibrary(String libraryName, Class<T> interfaceClass, Map<LibraryOption, ?> libraryOptions) { return loadLibrary(interfaceClass, libraryOptions, libraryName); }
/** * Loads a native library and links the methods defined in {@code interfaceClass} * to native methods in the library. * * @deprecated see {@link LibraryLoader} for the preferred interface to loading libraries. * @param <T> the interface type. * @param libraryName the name of the library to load * @param interfaceClass the interface that describes the native library interface * @param libraryOptions options * @return an instance of {@code interfaceclass} that will call the native methods. */ public static <T> T loadLibrary(String libraryName, Class<T> interfaceClass, Map<LibraryOption, ?> libraryOptions) { return loadLibrary(interfaceClass, libraryOptions, libraryName); }
/** * Loads a native library and links the methods defined in {@code interfaceClass} * to native methods in the library. * * @deprecated see {@link LibraryLoader} for the preferred interface to loading libraries. * @param libraryNames the name of the library to load * @param interfaceClass the interface that describes the native library interface * @return an instance of {@code interfaceclass} that will call the native methods. */ public static <T> T loadLibrary(Class<T> interfaceClass, String... libraryNames) { final Map<LibraryOption, ?> options = Collections.emptyMap(); return loadLibrary(interfaceClass, options, libraryNames); }
/** * Loads a native library and links the methods defined in {@code interfaceClass} * to native methods in the library. * * @deprecated see {@link LibraryLoader} for the preferred interface to loading libraries. * @param <T> the interface type. * @param libraryNames the name of the library to load * @param interfaceClass the interface that describes the native library interface * @return an instance of {@code interfaceclass} that will call the native methods. */ public static <T> T loadLibrary(Class<T> interfaceClass, String... libraryNames) { final Map<LibraryOption, ?> options = Collections.emptyMap(); return loadLibrary(interfaceClass, options, libraryNames); }
/** * Loads a native library and links the methods defined in {@code interfaceClass} * to native methods in the library. * * @deprecated see {@link LibraryLoader} for the preferred interface to loading libraries. * @param <T> the interface type. * @param libraryNames the name of the library to load * @param interfaceClass the interface that describes the native library interface * @return an instance of {@code interfaceclass} that will call the native methods. */ public static <T> T loadLibrary(Class<T> interfaceClass, String... libraryNames) { final Map<LibraryOption, ?> options = Collections.emptyMap(); return loadLibrary(interfaceClass, options, libraryNames); }
Map<LibraryOption, Object> options = new HashMap<LibraryOption, Object>(); options.put(LibraryOption.CallingConvention, CallingConvention.STDCALL); lib = Library.loadLibrary(LibProto.class, options, "Ws2_32"); } else { String[] libnames = os.equals(SOLARIS) : new String[]{"c"}; lib = os.equals(LINUX) ? Library.loadLibrary(LinuxLibProto.class, libnames) : Library.loadLibrary(LibProto.class, libnames);
Map<LibraryOption, Object> options = new HashMap<LibraryOption, Object>(); options.put(LibraryOption.CallingConvention, CallingConvention.STDCALL); lib = Library.loadLibrary(LibServices.class, options, "Ws2_32"); lib = Library.loadLibrary(LinuxLibServices.class, libnames); } else { lib = Library.loadLibrary(LibServices.class, libnames);
Library.loadLibrary("c", MicroC.class).kill(status.getChildPid(), 15);
Pointer NULL = Pointer.wrap(runtime, 0L); SmallC sc = Library.loadLibrary("c", SmallC.class);