File: dynlink-unix-CustomJavaCode.java

package info (click to toggle)
libjogl-java 1.1.1%2Bdak1-12
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 10,144 kB
  • sloc: java: 87,008; ansic: 12,156; xml: 1,641; cpp: 302; objc: 91; sh: 35; makefile: 23
file content (18 lines) | stat: -rw-r--r-- 744 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
public long openLibrary(String pathname) {
  // Note we use RTLD_GLOBAL visibility to allow this functionality to
  // be used to pre-resolve dependent libraries of JNI code without
  // requiring that all references to symbols in those libraries be
  // looked up dynamically via the ProcAddressTable mechanism; in
  // other words, one can actually link against the library instead of
  // having to dlsym all entry points. System.loadLibrary() uses
  // RTLD_LOCAL visibility so can't be used for this purpose.
  return dlopen(pathname, RTLD_GLOBAL);
}

public long lookupSymbol(long libraryHandle, String symbolName) {
  return dlsym(libraryHandle, symbolName);
}

public void closeLibrary(long libraryHandle) {
  dlclose(libraryHandle);
}