dlsym<T extends NativeType> method

Pointer<T>? dlsym<T extends NativeType>(
  1. DynamicLibrary handle,
  2. String symbol
)

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.

Implementation

Pointer<T>? dlsym<T extends NativeType>(DynamicLibrary handle, String symbol) {
  try {
    _lastError = null;
    return handle.lookup<T>(symbol);
  } catch (e) {
    _lastError = e.toString();
    return null;
  }
}