CFFI documentation¶

C Foreign Function Interface for Python. Interact with almost any C code from Python, based on C-like declarations that you can often copy-paste from header files or documentation.

  • Goals
  • Comments and bugs
  • What’s New
    • v1.17.1
    • v1.17.0
    • v1.16.0
    • v1.15.1
    • v1.15.0
    • v1.14.6
    • v1.14.5
    • v1.14.4
    • v1.14.3
    • v1.14.2
    • v1.14.1
    • v1.14
    • v1.13.2
    • v1.13.1
    • v1.13
    • Older Versions
  • Installation and Status
    • Platform-specific instructions
  • Overview
    • Main mode of usage
    • Other CFFI modes
    • Embedding
    • What actually happened?
    • ABI versus API
  • Using the ffi/lib objects
    • Working with pointers, structures and arrays
    • Python 3 support
    • An example of calling a main-like thing
    • Function calls
    • Variadic function calls
    • Memory pressure (PyPy)
    • Extern “Python” (new-style callbacks)
    • Callbacks (old style)
    • Windows: calling conventions
    • FFI Interface
  • CFFI Reference
    • FFI Interface
    • Conversions
  • Preparing and Distributing modules
    • ffi/ffibuilder.cdef(): declaring types and functions
    • ffi.dlopen(): loading libraries in ABI mode
    • ffibuilder.set_source(): preparing out-of-line modules
    • Letting the C compiler fill the gaps
    • ffibuilder.compile() etc.: compiling out-of-line modules
    • ffi/ffibuilder.include(): combining multiple CFFI interfaces
    • ffi.cdef() limitations
    • Debugging dlopen’ed C libraries
    • ffi.verify(): in-line API-mode
    • Upgrading from CFFI 0.9 to CFFI 1.0
  • Using CFFI for embedding
    • Usage
    • More reading
    • Troubleshooting
    • Issues about using the .so
    • Using multiple CFFI-made DLLs
    • Multithreading
    • Testing
    • Embedding and Extending

CFFI

Navigation

  • Goals
  • Comments and bugs
  • What’s New
  • Installation and Status
  • Overview
  • Using the ffi/lib objects
  • CFFI Reference
  • Preparing and Distributing modules
  • Using CFFI for embedding

Related Topics

  • Documentation overview
    • Next: Goals
©2012-2018, Armin Rigo, Maciej Fijalkowski. | Powered by Sphinx 8.0.2 & Alabaster 1.0.0 | Page source