Library Search Paths A search for a given library will scan the following locations:
jna.library.path User-customizable path
jna.platform.library.path Platform-specific paths
| Modifier and Type | Field and Description |
|---|---|
| private final Map | |
| private long | |
| private static final Map | |
| private String | |
| private String | |
| private static final List | |
| private static final Map |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static final void | addSearchPath(String
The name of the library to use the path for libraryName, String The path to use when trying to load the library path)Add a path to search for the specified library, ahead of any system paths |
| private static native void | |
| protected void | |
| private static String | findLibraryPath(String libName, List<E> searchPath)
Use standard library search paths to find the library. |
| private static native long | |
| public File | |
| public Function | getFunction(String
Name of the native function to be linked with functionName)Create a new |
| public Function | getFunction(String
Name of the native function to be linked with functionName, int Calling convention used by the native function callingConvention)Create a new @{link Function} that is linked with a native function that follows a given calling convention. |
| public Pointer | Returns: Pointer representing the global variable addressLook up the given global variable within this library. |
| public static final NativeLibrary | getInstance(String
The library name to load.
This can be short form (e.g. "c"),
an explicit version (e.g. "libc.so.6"), or
the full path to the library (e.g. "/lib/libc.so.6"). libraryName)Returns an instance of NativeLibrary for the specified name. |
| private String | |
| public String | |
| pack-priv long | |
| private static List | |
| private static NativeLibrary | |
| private static String | |
| private static String | |
| private static native long | |
| public String |
| functions | back to summary |
|---|---|
| private final Map<K, V> functions | |
| handle | back to summary |
|---|---|
| private long handle | |
| libraries | back to summary |
|---|---|
| private static final Map<K, V> libraries | |
| libraryName | back to summary |
|---|---|
| private String libraryName | |
| libraryPath | back to summary |
|---|---|
| private String libraryPath | |
| librarySearchPath | back to summary |
|---|---|
| private static final List<E> librarySearchPath | |
| searchPaths | back to summary |
|---|---|
| private static final Map<K, V> searchPaths | |
| NativeLibrary | back to summary |
|---|---|
| private NativeLibrary(String libraryName, String libraryPath, long handle) | |
| addSearchPath | back to summary |
|---|---|
| public static final void addSearchPath(String libraryName, String path) Add a path to search for the specified library, ahead of any system paths | |
| close | back to summary |
|---|---|
| private static native void close(long handle) | |
| finalize | back to summary |
|---|---|
| protected void finalize() Overrides java. Close the library when it is no longer referenced. | |
| findLibraryPath | back to summary |
|---|---|
| private static String findLibraryPath(String libName, List<E> searchPath) Use standard library search paths to find the library. | |
| findSymbol | back to summary |
|---|---|
| private static native long findSymbol(long handle, String name) | |
| getFile | back to summary |
|---|---|
| public File getFile() Returns the file on disk corresponding to this NativeLibrary instacne. | |
| getFunction | back to summary |
|---|---|
| public Function getFunction(String functionName) Create a new The allocated instance represents a pointer to the named native function from the library, called with the standard "C" calling convention.
| |
| getFunction | back to summary |
|---|---|
| public Function getFunction(String functionName, int callingConvention) Create a new @{link Function} that is linked with a native function that follows a given calling convention. The allocated instance represents a pointer to the named native function from the library, called with the named calling convention.
| |
| getGlobalVariableAddress | back to summary |
|---|---|
| public Pointer getGlobalVariableAddress(String symbolName) Look up the given global variable within this library.
| |
| getInstance | back to summary |
|---|---|
| public static final NativeLibrary getInstance(String libraryName) Returns an instance of NativeLibrary for the specified name. The library is loaded if not already loaded. If already loaded, the existing instance is returned. More than one name may map to the same NativeLibrary instance; only a single instance will be provided for any given unique file path.
| |
| getLibraryName | back to summary |
|---|---|
| private String getLibraryName(String libraryName) | |
| getName | back to summary |
|---|---|
| public String getName() Returns the simple name of this library. | |
| getSymbolAddress | back to summary |
|---|---|
| pack-priv long getSymbolAddress(String name) Used by the Function class to locate a symbol
| |
| initPaths | back to summary |
|---|---|
| private static List | |
| loadLibrary | back to summary |
|---|---|
| private static NativeLibrary loadLibrary(String libraryName) | |
| mapLibraryName | back to summary |
|---|---|
| private static String mapLibraryName(String libName) | |
| matchLibrary | back to summary |
|---|---|
| private static String matchLibrary(final String libName, List<E> searchPath) matchLibrary is very Linux specific. It is here to deal with the case where there is no /usr/lib/libc.so, or it is not a valid symlink to /lib/libc.so.6. | |
| open | back to summary |
|---|---|
| private static native long open(String name) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
| |