diff options
Diffstat (limited to 'src/java/com/jogamp/common/os/NativeLibrary.java')
-rwxr-xr-x | src/java/com/jogamp/common/os/NativeLibrary.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/java/com/jogamp/common/os/NativeLibrary.java b/src/java/com/jogamp/common/os/NativeLibrary.java index 2de8bc9..97aabae 100755 --- a/src/java/com/jogamp/common/os/NativeLibrary.java +++ b/src/java/com/jogamp/common/os/NativeLibrary.java @@ -62,7 +62,8 @@ public class NativeLibrary implements DynamicLookupHelper { private static final int WINDOWS = 1; private static final int UNIX = 2; private static final int MACOSX = 3; - private static boolean DEBUG; + protected static boolean DEBUG; + protected static boolean DEBUG_LOOKUP; private static int platform; private static DynamicLinker dynLink; private static String[] prefixes; @@ -81,7 +82,8 @@ public class NativeLibrary implements DynamicLookupHelper { platform = UNIX; } - DEBUG = (System.getProperty("gluegen.debug.NativeLibrary") != null); + DEBUG = (System.getProperty("jogamp.debug.NativeLibrary") != null); + DEBUG_LOOKUP = (System.getProperty("jogamp.debug.NativeLibrary.Lookup") != null); return null; } @@ -122,6 +124,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 +215,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(). */ |