From 710d86d31cd278583ee3d74b36595f4148a72133 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 5 Jun 2010 00:03:49 +0200 Subject: 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() --- src/java/com/jogamp/common/os/NativeLibrary.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/java/com/jogamp/common/os/NativeLibrary.java') 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(). */ -- cgit v1.2.3