diff options
author | Sven Gothel <[email protected]> | 2010-06-05 00:03:49 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-06-05 00:03:49 +0200 |
commit | 710d86d31cd278583ee3d74b36595f4148a72133 (patch) | |
tree | cd97303c60a03b9d8f921c97043e9d97cbffe1ac /src/java/com/jogamp/common/os/NativeLibrary.java | |
parent | c9c1ab75ea5c5ef7feae32f20bed840c2e8feaf4 (diff) |
Minor additions to nio/Buffers, util/IntIntHashMap and os/NativeLibrary
Buffers add 'float[] getFloatArray(double[])' conversion,
ready to replace all JOGL InternalBufferUtil's.
NativeLibrary/DynamicLinker add global lookup method
allowing Unices and OSX to lookup a symbol globally.
However, this is not recommended, due to the lookup costs.
Windows is not supported here.
Primitive type HashMap's (IntIntHashMap): Added putAll()
Diffstat (limited to 'src/java/com/jogamp/common/os/NativeLibrary.java')
-rwxr-xr-x | src/java/com/jogamp/common/os/NativeLibrary.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/java/com/jogamp/common/os/NativeLibrary.java b/src/java/com/jogamp/common/os/NativeLibrary.java index 2de8bc9..897e240 100755 --- a/src/java/com/jogamp/common/os/NativeLibrary.java +++ b/src/java/com/jogamp/common/os/NativeLibrary.java @@ -122,6 +122,10 @@ public class NativeLibrary implements DynamicLookupHelper { this.libraryPath = libraryPath; } + public String toString() { + return "NativeLibrary[" + libraryPath + ", 0x" + Long.toHexString(libraryHandle) + "]"; + } + /** Opens the given native library, assuming it has the same base name on all platforms, looking first in the system's search path, and in the context of the specified ClassLoader, which is @@ -209,6 +213,11 @@ public class NativeLibrary implements DynamicLookupHelper { return dynLink.lookupSymbol(libraryHandle, funcName); } + /** Looks up the given function name in all loaded libraries. */ + public static long dynamicLookupFunctionGlobal(String funcName) { + return dynLink.lookupSymbolGlobal(funcName); + } + /** Retrieves the low-level library handle from this NativeLibrary object. On the Windows platform this is an HMODULE, and on Unix and Mac OS X platforms the void* result of calling dlopen(). */ |