@Override public final boolean isFunctionAvailable(final String funcName) { if ( 0 == libraryHandle ) { throw new RuntimeException("Library is not open"); } return 0 != dynLink.lookupSymbol(libraryHandle, funcName); }
/** Looks up the given function name in all loaded libraries. */ public static final boolean isFunctionAvailableGlobal(final String funcName) { return 0 != dynLink.lookupSymbolGlobal(funcName); }
try { if(global) { res = dynLink.openLibraryGlobal(path, DEBUG); } else { res = dynLink.openLibraryLocal(path, DEBUG); errstr = dynLink.getLastError(); } catch (final Throwable t2) { errstr=null; } System.err.println("NativeLibrary.open: Last error "+errstr);
/** Closes this native library. Further lookup operations are not allowed after calling this method. */ public final void close() { if (DEBUG) { System.err.println("NativeLibrary.close(): closing " + this); } if ( 0 == libraryHandle ) { throw new RuntimeException("Library already closed"); } final long handle = libraryHandle; libraryHandle = 0; dynLink.closeLibrary(handle); if (DEBUG) { System.err.println("NativeLibrary.close(): Successfully closed " + this); Thread.dumpStack(); } }
@Override public final long dynamicLookupFunction(final String funcName) { if ( 0 == libraryHandle ) { throw new RuntimeException("Library is not open"); } return dynLink.lookupSymbol(libraryHandle, funcName); }
/** Looks up the given function name in all loaded libraries. */ public static final long dynamicLookupFunctionGlobal(final String funcName) { return dynLink.lookupSymbolGlobal(funcName); }