dlopen method

DynamicLibrary? dlopen(
  1. String? filename,
  2. int flag
)

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, it returns a handle for the main program (like DynamicLibrary.process()). flag can be a combination of RTLD_LAZY, RTLD_NOW, RTLD_GLOBAL, RTLD_LOCAL.

Implementation

DynamicLibrary? dlopen(String? filename, int flag) {
  try {
    _lastError = null;
    if (filename == null) {
      return DynamicLibrary.process();
    } else {
      return DynamicLibrary.open(filename);
    }
  } catch (e) {
    _lastError = e.toString();
    return null;
  }
}