Package org.lwjgl.system.linux
Class DynamicLinkLoader
java.lang.Object
org.lwjgl.system.linux.DynamicLinkLoader
Native bindings to <dlfcn.h>.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Themode
argument todlopen(java.nio.ByteBuffer, int)
contains one of the following.static final int
Themode
argument todlopen(java.nio.ByteBuffer, int)
contains one of the following.static final int
If the following bit is set in themode
argument todlopen(java.nio.ByteBuffer, int)
, the symbols of the loaded object and its dependencies are made visible as if the object were linked directly into the program.static final int
Themode
argument todlopen(java.nio.ByteBuffer, int)
contains one of the following.static final int
Unix98 demands the following flag which is the inverse toRTLD_GLOBAL
.static final int
Do not delete object when closed.static final int
Themode
argument todlopen(java.nio.ByteBuffer, int)
contains one of the following.static final int
Themode
argument todlopen(java.nio.ByteBuffer, int)
contains one of the following. -
Method Summary
Modifier and TypeMethodDescriptionstatic int
dlclose
(long handle) Decrements the reference count on the dynamic library handle handle.static String
dlerror()
Returns a human readable string describing the most recent error that occurred fromdlopen(java.nio.ByteBuffer, int)
,dlsym(long, java.nio.ByteBuffer)
ordlclose(long)
since the last call todlerror()
.static long
dlopen
(CharSequence filename, int mode) Loads the dynamic library file named by the null-terminated stringfilename
and returns an opaque "handle" for the dynamic library.static long
dlopen
(ByteBuffer filename, int mode) Loads the dynamic library file named by the null-terminated stringfilename
and returns an opaque "handle" for the dynamic library.static long
dlsym
(long handle, CharSequence name) Takes a "handle" of a dynamic library returned bydlopen(java.nio.ByteBuffer, int)
and the null-terminated symbol name, returning the address where that symbol is loaded into memory.static long
dlsym
(long handle, ByteBuffer name) Takes a "handle" of a dynamic library returned bydlopen(java.nio.ByteBuffer, int)
and the null-terminated symbol name, returning the address where that symbol is loaded into memory.static int
ndlclose
(long handle) Unsafe version of:dlclose(long)
static long
ndlerror()
Unsafe version of:dlerror()
static long
ndlopen
(long filename, int mode) Unsafe version of:dlopen(java.nio.ByteBuffer, int)
static long
ndlsym
(long handle, long name) Unsafe version of:dlsym(long, java.nio.ByteBuffer)
-
Field Details
-
RTLD_LAZY
public static final int RTLD_LAZYThemode
argument todlopen(java.nio.ByteBuffer, int)
contains one of the following.- See Also:
-
RTLD_NOW
public static final int RTLD_NOWThemode
argument todlopen(java.nio.ByteBuffer, int)
contains one of the following.- See Also:
-
RTLD_BINDING_MASK
public static final int RTLD_BINDING_MASKThemode
argument todlopen(java.nio.ByteBuffer, int)
contains one of the following.- See Also:
-
RTLD_NOLOAD
public static final int RTLD_NOLOADThemode
argument todlopen(java.nio.ByteBuffer, int)
contains one of the following.- See Also:
-
RTLD_DEEPBIND
public static final int RTLD_DEEPBINDThemode
argument todlopen(java.nio.ByteBuffer, int)
contains one of the following.- See Also:
-
RTLD_GLOBAL
public static final int RTLD_GLOBALIf the following bit is set in themode
argument todlopen(java.nio.ByteBuffer, int)
, the symbols of the loaded object and its dependencies are made visible as if the object were linked directly into the program.- See Also:
-
RTLD_LOCAL
public static final int RTLD_LOCALUnix98 demands the following flag which is the inverse toRTLD_GLOBAL
. The implementation does this by default and so we can define the value to zero.- See Also:
-
RTLD_NODELETE
public static final int RTLD_NODELETEDo not delete object when closed.- See Also:
-
-
Method Details
-
ndlopen
public static long ndlopen(long filename, int mode) Unsafe version of:dlopen(java.nio.ByteBuffer, int)
-
dlopen
Loads the dynamic library file named by the null-terminated stringfilename
and returns an opaque "handle" for the dynamic library. Iffilename
isNULL
, then the returned handle is for the main program.- Parameters:
filename
- the name of the dynamic library to open, orNULL
mode
- a bitfield. One or more of:RTLD_LAZY
RTLD_NOW
RTLD_BINDING_MASK
RTLD_NOLOAD
RTLD_DEEPBIND
RTLD_GLOBAL
RTLD_LOCAL
RTLD_NODELETE
-
dlopen
Loads the dynamic library file named by the null-terminated stringfilename
and returns an opaque "handle" for the dynamic library. Iffilename
isNULL
, then the returned handle is for the main program.- Parameters:
filename
- the name of the dynamic library to open, orNULL
mode
- a bitfield. One or more of:RTLD_LAZY
RTLD_NOW
RTLD_BINDING_MASK
RTLD_NOLOAD
RTLD_DEEPBIND
RTLD_GLOBAL
RTLD_LOCAL
RTLD_NODELETE
-
ndlerror
public static long ndlerror()Unsafe version of:dlerror()
-
dlerror
Returns a human readable string describing the most recent error that occurred fromdlopen(java.nio.ByteBuffer, int)
,dlsym(long, java.nio.ByteBuffer)
ordlclose(long)
since the last call todlerror()
. It returnsNULL
if no errors have occurred since initialization or since it was last called. -
ndlsym
public static long ndlsym(long handle, long name) Unsafe version of:dlsym(long, java.nio.ByteBuffer)
-
dlsym
Takes a "handle" of a dynamic library returned bydlopen(java.nio.ByteBuffer, int)
and the null-terminated symbol name, returning the address where that symbol is loaded into memory. If the symbol is not found, in the specified library or any of the libraries that were automatically loaded bydlopen(java.nio.ByteBuffer, int)
when that library was loaded,dlsym()
returnsNULL
.- Parameters:
handle
- the dynamic library handlename
- the symbol name
-
dlsym
Takes a "handle" of a dynamic library returned bydlopen(java.nio.ByteBuffer, int)
and the null-terminated symbol name, returning the address where that symbol is loaded into memory. If the symbol is not found, in the specified library or any of the libraries that were automatically loaded bydlopen(java.nio.ByteBuffer, int)
when that library was loaded,dlsym()
returnsNULL
.- Parameters:
handle
- the dynamic library handlename
- the symbol name
-
ndlclose
public static int ndlclose(long handle) Unsafe version of:dlclose(long)
-
dlclose
public static int dlclose(long handle) Decrements the reference count on the dynamic library handle handle. If the reference count drops to zero and no other loaded libraries use symbols in it, then the dynamic library is unloaded.- Parameters:
handle
- the dynamic library to close
-