diff options
author | Armin Rigo <arigo@tunes.org> | 2020-01-05 13:46:20 +0100 |
---|---|---|
committer | Armin Rigo <arigo@tunes.org> | 2020-01-05 13:46:20 +0100 |
commit | 263cff26c5edcb9e77990078faec25431303c107 (patch) | |
tree | a38e038b27165ef09c7298912ddf758d0374b3c8 /doc | |
parent | 0e3aa45f0edb076fe282461509d8a19effd3d8f5 (diff) | |
download | cffi-263cff26c5edcb9e77990078faec25431303c107.tar.gz |
Issue #437
Support ffi.dlopen(<void* cdata>). See updated documentation.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/source/cdef.rst | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/doc/source/cdef.rst b/doc/source/cdef.rst index 0e460ef..dd56a7e 100644 --- a/doc/source/cdef.rst +++ b/doc/source/cdef.rst @@ -369,6 +369,16 @@ look for the library's filename. This also means that ``ffi.dlopen(None)`` no longer work on Windows; try instead ``ffi.dlopen(ctypes.util.find_library('c'))``. +*New in version 1.14:* ``ffi.dlopen(handle)``: instead of a file path, +you can give an already-opened library handle, as a cdata of type +``void *``. Such a call converts this handle into a regular FFI object +with the functions and global variables declared by ``ffi.cdef()``. +Useful if you have special needs (e.g. you need the GNU extension +``dlmopen()``, which you can itself declare and call using a different +``ffi`` object). Note that in this variant, ``dlclose()`` is not called +automatically if the FFI object is garbage-collected (but you can still +call ``ffi.dlclose()`` explicitly if needed). + ffibuilder.set_source(): preparing out-of-line modules ------------------------------------------------------ |