From e659f5994875275d4eb46e745676a3d84e27d1e9 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 3 Aug 2011 11:56:40 +0200 Subject: Hide DynamicLinker impl.; Remove public AndroidPackageUtil ; GluegenVersionActivity uses ApplicationContext Hide DynamicLinker impl.: - com.jogamp.common.os.*DynamicLinkerImpl -> jogamp.common.os --- .../jogamp/common/os/UnixDynamicLinkerImpl.java | 65 ++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100755 src/java/jogamp/common/os/UnixDynamicLinkerImpl.java (limited to 'src/java/jogamp/common/os/UnixDynamicLinkerImpl.java') diff --git a/src/java/jogamp/common/os/UnixDynamicLinkerImpl.java b/src/java/jogamp/common/os/UnixDynamicLinkerImpl.java new file mode 100755 index 0000000..677df32 --- /dev/null +++ b/src/java/jogamp/common/os/UnixDynamicLinkerImpl.java @@ -0,0 +1,65 @@ +/* !---- DO NOT EDIT: This file autogenerated by com\sun\gluegen\JavaEmitter.java on Mon Jul 31 16:26:59 PDT 2006 ----! */ + +package jogamp.common.os; + +import com.jogamp.common.os.DynamicLinker; + + +public class UnixDynamicLinkerImpl implements DynamicLinker { + + public static final long RTLD_DEFAULT = 0; + public static final int RTLD_LAZY = 0x00001; + public static final int RTLD_NOW = 0x00002; + public static final int RTLD_GLOBAL = 0x00100; + public static final int RTLD_LOCAL = 0x00000; + + /** Interface to C language function:
int dlclose(void * ); */ + private static native int dlclose(long arg0); + + /** Interface to C language function:
char * dlerror(void); */ + private static native java.lang.String dlerror(); + + /** Interface to C language function:
void * dlopen(const char * , int); */ + private static native long dlopen(java.lang.String arg0, int arg1); + + /** Interface to C language function:
void * dlsym(void * , const char * ); */ + private static native long dlsym(long arg0, java.lang.String arg1); + + + // --- Begin CustomJavaCode .cfg declarations + public long openLibraryLocal(String pathname, boolean debug) { + // Note we use RTLD_GLOBAL visibility to _NOT_ allow this functionality to + // be used to pre-resolve dependent libraries of JNI code without + // requiring that all references to symbols in those libraries be + // looked up dynamically via the ProcAddressTable mechanism; in + // other words, one can actually link against the library instead of + // having to dlsym all entry points. System.loadLibrary() uses + // RTLD_LOCAL visibility so can't be used for this purpose. + return dlopen(pathname, RTLD_LAZY | RTLD_LOCAL); + } + + public long openLibraryGlobal(String pathname, boolean debug) { + // Note we use RTLD_GLOBAL visibility to allow this functionality to + // be used to pre-resolve dependent libraries of JNI code without + // requiring that all references to symbols in those libraries be + // looked up dynamically via the ProcAddressTable mechanism; in + // other words, one can actually link against the library instead of + // having to dlsym all entry points. System.loadLibrary() uses + // RTLD_LOCAL visibility so can't be used for this purpose. + return dlopen(pathname, RTLD_LAZY | RTLD_GLOBAL); + } + + public long lookupSymbol(long libraryHandle, String symbolName) { + return dlsym(libraryHandle, symbolName); + } + + public long lookupSymbolGlobal(String symbolName) { + return dlsym(RTLD_DEFAULT, symbolName); + } + + public void closeLibrary(long libraryHandle) { + dlclose(libraryHandle); + } + // ---- End CustomJavaCode .cfg declarations + +} // end of class UnixDynamicLinkerImpl -- cgit v1.2.3