'Load and return a dynamic library identified by \'name\'.
The standard C library can be loaded by passing None.
Note that functions and types declared by \'ffi.cdef()\' are not
linked to a particular library, just like C headers; in the
library we only look for the actual (untyped) symbols.'

def dlopen(self, name, flags=0):

    assert (isinstance(name, basestring) or (name is None))
    with self._lock:
        (lib, function_cache) = _make_ffi_library(self, name, flags)
        self._function_caches.append(function_cache)
        self._libraries.append(lib)
    return lib
