diff options
Diffstat (limited to 'src/java/jogamp/common/os/MacOSXDynamicLinkerImpl.java')
-rw-r--r-- | src/java/jogamp/common/os/MacOSXDynamicLinkerImpl.java | 51 |
1 files changed, 13 insertions, 38 deletions
diff --git a/src/java/jogamp/common/os/MacOSXDynamicLinkerImpl.java b/src/java/jogamp/common/os/MacOSXDynamicLinkerImpl.java index 95f7e63..09ee48d 100644 --- a/src/java/jogamp/common/os/MacOSXDynamicLinkerImpl.java +++ b/src/java/jogamp/common/os/MacOSXDynamicLinkerImpl.java @@ -1,32 +1,20 @@ -/* !---- DO NOT EDIT: This file autogenerated by com\sun\gluegen\JavaEmitter.java on Mon Jul 31 16:27:00 PDT 2006 ----! */ - package jogamp.common.os; -import com.jogamp.common.os.DynamicLinker; import com.jogamp.common.util.SecurityUtil; +/** + * Mac OS X specialization of {@link UnixDynamicLinkerImpl} + * utilizing OS X 's non POSIX flags and mode values. + */ +public class MacOSXDynamicLinkerImpl extends UnixDynamicLinkerImpl { -public class MacOSXDynamicLinkerImpl implements DynamicLinker { - - public static final long RTLD_DEFAULT = -2; - - public static final int RTLD_LAZY = 0x1; - public static final int RTLD_NOW = 0x2; - public static final int RTLD_LOCAL = 0x4; - public static final int RTLD_GLOBAL = 0x8; - - /** Interface to C language function: <br> <code> int dlclose(void * __handle); </code> */ - private static native int dlclose(long __handle); - - /** Interface to C language function: <br> <code> char * dlerror(void); </code> */ - private static native java.lang.String dlerror(); - - /** Interface to C language function: <br> <code> void * dlopen(const char * __path, int __mode); </code> */ - private static native long dlopen(java.lang.String __path, int __mode); - - /** Interface to C language function: <br> <code> void * dlsym(void * __handle, const char * __symbol); </code> */ - private static native long dlsym(long __handle, java.lang.String __symbol); + private static final long RTLD_DEFAULT = -2L; + // static final long RTLD_NEXT = -1L; + private static final int RTLD_LAZY = 0x00001; + // static final int RTLD_NOW = 0x00002; + private static final int RTLD_LOCAL = 0x00004; + private static final int RTLD_GLOBAL = 0x00008; // --- Begin CustomJavaCode .cfg declarations public long openLibraryLocal(String pathname, boolean debug) throws SecurityException { @@ -53,25 +41,12 @@ public class MacOSXDynamicLinkerImpl implements DynamicLinker { return dlopen(pathname, RTLD_LAZY | RTLD_GLOBAL); } - public long lookupSymbol(long libraryHandle, String symbolName) { - final long addr = dlsym(libraryHandle, symbolName); - if(DEBUG_LOOKUP) { - System.err.println("MaxOSXDynamicLinkerImpl.lookupSymbol(0x"+Long.toHexString(libraryHandle)+", "+symbolName+") -> 0x"+Long.toHexString(addr)); - } - return addr; - } - public long lookupSymbolGlobal(String symbolName) { final long addr = dlsym(RTLD_DEFAULT, symbolName); if(DEBUG_LOOKUP) { - System.err.println("MacOSXDynamicLinkerImpl.lookupSymbolGlobal("+symbolName+") -> 0x"+Long.toHexString(addr)); + System.err.println("DynamicLinkerImpl.lookupSymbolGlobal("+symbolName+") -> 0x"+Long.toHexString(addr)); } return addr; } - public void closeLibrary(long libraryHandle) { - dlclose(libraryHandle); - } - // ---- End CustomJavaCode .cfg declarations - -} // end of class MacOSXDynamicLinkerImpl +} |