Class DynLoad
- java.lang.Object
-
- org.lwjgl.system.dyncall.DynLoad
-
public class DynLoad extends java.lang.ObjectNative bindings to \"dynload.h\".The dynload library provides an interface to load foreign dynamic libraries and access to their symbols.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static longdlFindSymbol(long pLib, java.lang.CharSequence pSymbolName)Returns a pointer to a symbol with namepSymbolNamein the library with handlepLib, or returns a null pointer if the symbol cannot be found.static longdlFindSymbol(long pLib, java.nio.ByteBuffer pSymbolName)Returns a pointer to a symbol with namepSymbolNamein the library with handlepLib, or returns a null pointer if the symbol cannot be found.static voiddlFreeLibrary(long pLib)Frees a loaded library.static java.lang.StringdlGetLibraryPath(long pLib, int bufSize)Gets a copy of the path to the library loaded with handlepLib.static intdlGetLibraryPath(long pLib, java.nio.ByteBuffer sOut)Gets a copy of the path to the library loaded with handlepLib.static longdlLoadLibrary(java.lang.CharSequence libpath)Loads a dynamic library atlibpathand returns a handle to it.static longdlLoadLibrary(java.nio.ByteBuffer libpath)Loads a dynamic library atlibpathand returns a handle to it.static voiddlSymsCleanup(long pSyms)Frees the specifiedDLSymsobject.static intdlSymsCount(long pSyms)Returns the number of symbols exported by the specified library.static longdlSymsInit(java.lang.CharSequence libPath)Creates a newDLSymsobject.static longdlSymsInit(java.nio.ByteBuffer libPath)Creates a newDLSymsobject.static java.lang.StringdlSymsName(long pSyms, int index)Returns the symbol name exported by the specified library at the specified index.static java.lang.StringdlSymsNameFromValue(long pSyms, long value)Returns the symbol name exported by the specified library at the specified address.static longndlFindSymbol(long pLib, long pSymbolName)Unsafe version of:FindSymbolstatic voidndlFreeLibrary(long pLib)Unsafe version of:FreeLibrarystatic intndlGetLibraryPath(long pLib, long sOut, int bufSize)Unsafe version of:GetLibraryPathstatic longndlLoadLibrary(long libpath)Unsafe version of:LoadLibrarystatic voidndlSymsCleanup(long pSyms)Unsafe version of:SymsCleanupstatic intndlSymsCount(long pSyms)Unsafe version of:SymsCountstatic longndlSymsInit(long libPath)Unsafe version of:SymsInitstatic longndlSymsName(long pSyms, int index)Unsafe version of:SymsNamestatic longndlSymsNameFromValue(long pSyms, long value)Unsafe version of:SymsNameFromValue
-
-
-
Method Detail
-
ndlLoadLibrary
public static long ndlLoadLibrary(long libpath)
Unsafe version of:LoadLibrary
-
dlLoadLibrary
public static long dlLoadLibrary(java.nio.ByteBuffer libpath) public static long dlLoadLibrary(java.lang.CharSequence libpath)
Loads a dynamic library atlibpathand returns a handle to it.- Parameters:
libpath- the dynamic library path
-
ndlFreeLibrary
public static void ndlFreeLibrary(long pLib)
Unsafe version of:FreeLibrary
-
dlFreeLibrary
public static void dlFreeLibrary(long pLib)
Frees a loaded library.- Parameters:
pLib- the dynamic library to free
-
ndlFindSymbol
public static long ndlFindSymbol(long pLib, long pSymbolName)Unsafe version of:FindSymbol
-
dlFindSymbol
public static long dlFindSymbol(long pLib, java.nio.ByteBuffer pSymbolName) public static long dlFindSymbol(long pLib, java.lang.CharSequence pSymbolName)Returns a pointer to a symbol with namepSymbolNamein the library with handlepLib, or returns a null pointer if the symbol cannot be found.- Parameters:
pLib- the dynamic librarypSymbolName- the symbol name
-
ndlGetLibraryPath
public static int ndlGetLibraryPath(long pLib, long sOut, int bufSize)Unsafe version of:GetLibraryPath- Parameters:
bufSize- the size ofsOut, in bytes
-
dlGetLibraryPath
public static int dlGetLibraryPath(long pLib, java.nio.ByteBuffer sOut)Gets a copy of the path to the library loaded with handlepLib.The parameter
sOutis a pointer to a buffer of sizebufSize(in bytes), to hold the output string. The return value is the size of the buffer (in bytes) needed to hold the null-terminated string, or 0 if it can't be looked up. IfbufSize >= return value > 1, a null-terminated string with the path to the library should be insOut. If it returns 0, the library name wasn't able to be found. Please note that this might happen in some rare cases, so make sure to always check.- Parameters:
pLib- the dynamic librarysOut- pointer to a buffer where the library path will be stored
-
dlGetLibraryPath
public static java.lang.String dlGetLibraryPath(long pLib, int bufSize)Gets a copy of the path to the library loaded with handlepLib.The parameter
sOutis a pointer to a buffer of sizebufSize(in bytes), to hold the output string. The return value is the size of the buffer (in bytes) needed to hold the null-terminated string, or 0 if it can't be looked up. IfbufSize >= return value > 1, a null-terminated string with the path to the library should be insOut. If it returns 0, the library name wasn't able to be found. Please note that this might happen in some rare cases, so make sure to always check.- Parameters:
pLib- the dynamic librarybufSize- the size ofsOut, in bytes
-
ndlSymsInit
public static long ndlSymsInit(long libPath)
Unsafe version of:SymsInit
-
dlSymsInit
public static long dlSymsInit(java.nio.ByteBuffer libPath) public static long dlSymsInit(java.lang.CharSequence libPath)
Creates a newDLSymsobject.- Parameters:
libPath- the dynamic library path
-
ndlSymsCleanup
public static void ndlSymsCleanup(long pSyms)
Unsafe version of:SymsCleanup
-
dlSymsCleanup
public static void dlSymsCleanup(long pSyms)
Frees the specifiedDLSymsobject.- Parameters:
pSyms- theDLSymsobject to free
-
ndlSymsCount
public static int ndlSymsCount(long pSyms)
Unsafe version of:SymsCount
-
dlSymsCount
public static int dlSymsCount(long pSyms)
Returns the number of symbols exported by the specified library.- Parameters:
pSyms- aDLSymsobject
-
ndlSymsName
public static long ndlSymsName(long pSyms, int index)Unsafe version of:SymsName
-
dlSymsName
@Nullable public static java.lang.String dlSymsName(long pSyms, int index)Returns the symbol name exported by the specified library at the specified index.- Parameters:
pSyms- aDLSymsobject
-
ndlSymsNameFromValue
public static long ndlSymsNameFromValue(long pSyms, long value)Unsafe version of:SymsNameFromValue
-
dlSymsNameFromValue
@Nullable public static java.lang.String dlSymsNameFromValue(long pSyms, long value)Returns the symbol name exported by the specified library at the specified address.- Parameters:
pSyms- aDLSymsobjectvalue- the symbol address
-
-