summaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/common/os/NativeLibrary.java
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2010-06-10 18:26:45 +0200
committerMichael Bien <[email protected]>2010-06-10 18:26:45 +0200
commit336ab1ae582753bac4e53e884124c28550a2b0dc (patch)
tree0125c22248112b5fe4804cc8823a4f5b34fb139b /src/java/com/jogamp/common/os/NativeLibrary.java
parentbf388223461ceb1013e893a3e274a98f258dbc5d (diff)
parent1d9b041200dcc44a353706377bfd6ac999a14d7e (diff)
Merge branch 'master' of github.com:mbien/gluegen
Diffstat (limited to 'src/java/com/jogamp/common/os/NativeLibrary.java')
-rwxr-xr-xsrc/java/com/jogamp/common/os/NativeLibrary.java15
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(). */