Top Description Fields Constructors Methods
org.lwjgl.system.linux

public Class DynamicLinkLoader

extends Object
Class Inheritance
Imports
javax.annotation.*, java.nio.*, org.lwjgl.system.*

Native bindings to <dlfcn.h>.

Field Summary

Modifier and TypeField and Description
public static final int
RTLD_BINDING_MASK

The mode argument to dlopen contains one of the following.

public static final int
RTLD_DEEPBIND

The mode argument to dlopen contains one of the following.

public static final int
RTLD_GLOBAL

If the following bit is set in the mode argument to dlopen, the symbols of the loaded object and its dependencies are made visible as if the object were linked directly into the program.

public static final int
RTLD_LAZY

The mode argument to dlopen contains one of the following.

public static final int
RTLD_LOCAL

Unix98 demands the following flag which is the inverse to RTLD_GLOBAL.

public static final int
RTLD_NODELETE

Do not delete object when closed.

public static final int
RTLD_NOLOAD

The mode argument to dlopen contains one of the following.

public static final int
RTLD_NOW

The mode argument to dlopen contains one of the following.

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static int
dlclose(long
the dynamic library to close
handle
)

Decrements the reference count on the dynamic library handle handle.

public static String
dlerror()

Returns a human readable string describing the most recent error that occurred from dlopen, dlsym or dlclose since the last call to dlerror().

public static long
dlopen(ByteBuffer
the name of the dynamic library to open, or NULL
filename
,
int mode)

Loads the dynamic library file named by the null-terminated string filename and returns an opaque "handle" for the dynamic library.

public static long
dlopen(CharSequence
the name of the dynamic library to open, or NULL
filename
,
int mode)

Loads the dynamic library file named by the null-terminated string filename and returns an opaque "handle" for the dynamic library.

public static long
dlsym(long
the dynamic library handle
handle
,
ByteBuffer
the symbol name
name
)

Takes a "handle" of a dynamic library returned by dlopen and the null-terminated symbol name, returning the address where that symbol is loaded into memory.

public static long
dlsym(long
the dynamic library handle
handle
,
CharSequence
the symbol name
name
)

Takes a "handle" of a dynamic library returned by dlopen and the null-terminated symbol name, returning the address where that symbol is loaded into memory.

public static native int
ndlclose(long handle)

Unsafe version of: dlclose

public static native long
ndlerror()

Unsafe version of: dlerror

public static native long
ndlopen(long filename, int mode)

Unsafe version of: dlopen

public static native long
ndlsym(long handle, long name)

Unsafe version of: dlsym

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

RTLD_BINDING_MASKback to summary
public static final int RTLD_BINDING_MASK

The mode argument to dlopen contains one of the following.

RTLD_DEEPBINDback to summary
public static final int RTLD_DEEPBIND

The mode argument to dlopen contains one of the following.

RTLD_GLOBALback to summary
public static final int RTLD_GLOBAL

If the following bit is set in the mode argument to dlopen, the symbols of the loaded object and its dependencies are made visible as if the object were linked directly into the program.

RTLD_LAZYback to summary
public static final int RTLD_LAZY

The mode argument to dlopen contains one of the following.

RTLD_LOCALback to summary
public static final int RTLD_LOCAL

Unix98 demands the following flag which is the inverse to RTLD_GLOBAL. The implementation does this by default and so we can define the value to zero.

RTLD_NODELETEback to summary
public static final int RTLD_NODELETE

Do not delete object when closed.

RTLD_NOLOADback to summary
public static final int RTLD_NOLOAD

The mode argument to dlopen contains one of the following.

RTLD_NOWback to summary
public static final int RTLD_NOW

The mode argument to dlopen contains one of the following.

Constructor Detail

DynamicLinkLoaderback to summary
protected DynamicLinkLoader()

Method Detail

dlcloseback to summary
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:long

the dynamic library to close

dlerrorback to summary
public static String dlerror()

Returns a human readable string describing the most recent error that occurred from dlopen, dlsym or dlclose since the last call to dlerror(). It returns NULL if no errors have occurred since initialization or since it was last called.

Annotations
@Nullable
@NativeType:char *
dlopenback to summary
public static long dlopen(ByteBuffer filename, int mode)

Loads the dynamic library file named by the null-terminated string filename and returns an opaque "handle" for the dynamic library. If filename is NULL, then the returned handle is for the main program.

Parameters
filename:ByteBuffer

the name of the dynamic library to open, or NULL

mode:int

a bitfield. One or more of:

RTLD_LAZYRTLD_NOWRTLD_BINDING_MASKRTLD_NOLOADRTLD_DEEPBINDRTLD_GLOBAL
RTLD_LOCALRTLD_NODELETE
Annotations
@NativeType:void *
dlopenback to summary
public static long dlopen(CharSequence filename, int mode)

Loads the dynamic library file named by the null-terminated string filename and returns an opaque "handle" for the dynamic library. If filename is NULL, then the returned handle is for the main program.

Parameters
filename:CharSequence

the name of the dynamic library to open, or NULL

mode:int

a bitfield. One or more of:

RTLD_LAZYRTLD_NOWRTLD_BINDING_MASKRTLD_NOLOADRTLD_DEEPBINDRTLD_GLOBAL
RTLD_LOCALRTLD_NODELETE
Annotations
@NativeType:void *
dlsymback to summary
public static long dlsym(long handle, ByteBuffer name)

Takes a "handle" of a dynamic library returned by dlopen 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 by dlopen when that library was loaded, dlsym() returns NULL.

Parameters
handle:long

the dynamic library handle

name:ByteBuffer

the symbol name

Annotations
@NativeType:void *
dlsymback to summary
public static long dlsym(long handle, CharSequence name)

Takes a "handle" of a dynamic library returned by dlopen 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 by dlopen when that library was loaded, dlsym() returns NULL.

Parameters
handle:long

the dynamic library handle

name:CharSequence

the symbol name

Annotations
@NativeType:void *
ndlcloseback to summary
public static native int ndlclose(long handle)

Unsafe version of: dlclose

ndlerrorback to summary
public static native long ndlerror()

Unsafe version of: dlerror

ndlopenback to summary
public static native long ndlopen(long filename, int mode)

Unsafe version of: dlopen

ndlsymback to summary
public static native long ndlsym(long handle, long name)

Unsafe version of: dlsym