{
    "mode": "pydoc",
    "parameter": "_cffi_backend",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/pydoc/_cffi_backend/json",
    "generated": "2026-06-02T15:54:29Z",
    "sections": {
        "NAME": {
            "content": "cffibackend\n",
            "subsections": []
        },
        "CLASSES": {
            "content": "builtins.object\nCField\nCLibrary\nCType\nFFI\nLib\nbuffer\n",
            "subsections": [
                {
                    "name": "class CField",
                    "content": "|  Methods defined here:\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  bitshift\n|\n|  bitsize\n|\n|  flags\n|\n|  offset\n|\n|  type\n"
                },
                {
                    "name": "class CLibrary",
                    "content": "|  Methods defined here:\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  closelib(...)\n|\n|  loadfunction(...)\n|\n|  readvariable(...)\n|\n|  writevariable(...)\n"
                },
                {
                    "name": "class CType",
                    "content": "|  Methods defined here:\n|\n|  dir(...)\n|      Default dir() implementation.\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  abi\n|      function ABI\n|\n|  args\n|      function argument types\n|\n|  cname\n|      C name\n|\n|  elements\n|      enum elements\n|\n|  ellipsis\n|      function has '...'\n|\n|  fields\n|      struct or union fields\n|\n|  item\n|      pointer to, or array of\n|\n|  kind\n|      kind\n|\n|  length\n|      array length or None\n|\n|  relements\n|      enum elements, reverse\n|\n|  result\n|      function result type\n"
                },
                {
                    "name": "class FFI",
                    "content": "|  Methods defined here:\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  addressof(...)\n|      Limited equivalent to the '&' operator in C:\n|\n|      1. ffi.addressof(<cdata 'struct-or-union'>) returns a cdata that is a\n|      pointer to this struct or union.\n|\n|      2. ffi.addressof(<cdata>, field-or-index...) returns the address of a\n|      field or array item inside the given structure or array, recursively\n|      in case of nested structures or arrays.\n|\n|      3. ffi.addressof(<library>, \"name\") returns the address of the named\n|      function or global variable.\n|\n|  alignof(...)\n|      Return the natural alignment size in bytes of the argument.\n|      It can be a string naming a C type, or a 'cdata' instance.\n|\n|  callback(...)\n|      Return a callback object or a decorator making such a callback object.\n|      'cdecl' must name a C function pointer type.  The callback invokes the\n|      specified 'pythoncallable' (which may be provided either directly or\n|      via a decorator).  Important: the callback object must be manually\n|      kept alive for as long as the callback may be invoked from the C code.\n|\n|  cast(...)\n|      Similar to a C cast: returns an instance of the named C\n|      type initialized with the given 'source'.  The source is\n|      casted between integers or pointers of any type.\n|\n|  defextern(...)\n|      A decorator.  Attaches the decorated Python function to the C code\n|      generated for the 'extern \"Python\"' function of the same name.\n|      Calling the C function will then invoke the Python function.\n|\n|      Optional arguments: 'name' is the name of the C function, if\n|      different from the Python function; and 'error' and 'onerror'\n|      handle what occurs if the Python function raises an exception\n|      (see the docs for details).\n|\n|  dlclose(...)\n|      Close a library obtained with ffi.dlopen().  After this call, access to\n|      functions or variables from the library will fail (possibly with a\n|      segmentation fault).\n|\n|  dlopen(...)\n|      Load and return a dynamic library identified by 'name'.  The standard\n|      C library can be loaded by passing None.\n|\n|      Note that functions and types declared with 'ffi.cdef()' are not\n|      linked to a particular library, just like C headers.  In the library\n|      we only look for the actual (untyped) symbols at the time of their\n|      first access.\n|\n|  frombuffer(...)\n|      Return a <cdata 'char[]'> that points to the data of the given Python\n|      object, which must support the buffer interface.  Note that this is\n|      not meant to be used on the built-in types str or unicode\n|      (you can build 'char[]' arrays explicitly) but only on objects\n|      containing large quantities of raw data in some other format, like\n|      'array.array' or numpy arrays.\n|\n|  fromhandle(...)\n|      Cast a 'void *' back to a Python object.  Must be used *only* on the\n|      pointers returned by newhandle(), and *only* as long as the exact\n|      cdata object returned by newhandle() is still alive (somewhere else\n|      in the program).  Failure to follow these rules will crash.\n|\n|  gc(...)\n|      Return a new cdata object that points to the same data.\n|      Later, when this new cdata object is garbage-collected,\n|      'destructor(oldcdataobject)' will be called.\n|\n|      The optional 'size' gives an estimate of the size, used to\n|      trigger the garbage collection more eagerly.  So far only used\n|      on PyPy.  It tells the GC that the returned object keeps alive\n|      roughly 'size' bytes of external memory.\n|\n|  getctype(...)\n|      Return a string giving the C type 'cdecl', which may be itself a\n|      string or a <ctype> object.  If 'replacewith' is given, it gives\n|      extra text to append (or insert for more complicated C types), like a\n|      variable name, or '*' to get actually the C type 'pointer-to-cdecl'.\n|\n|  initonce(...)\n|      initonce(function, tag): run function() once.  More precisely,\n|      'function()' is called the first time we see a given 'tag'.\n|\n|      The return value of function() is remembered and returned by the current\n|      and all future initonce() with the same tag.  If initonce() is called\n|      from multiple threads in parallel, all calls block until the execution\n|      of function() is done.  If function() raises an exception, it is\n|      propagated and nothing is cached.\n|\n|  integerconst(...)\n|      Get the value of an integer constant.\n|\n|      'ffi.integerconst(\"xxx\")' is equivalent to 'lib.xxx' if xxx names an\n|      integer constant.  The point of this function is limited to use cases\n|      where you have an 'ffi' object but not any associated 'lib' object.\n|\n|  listtypes(...)\n|      Returns the user type names known to this FFI instance.\n|      This returns a tuple containing three lists of names:\n|      (typedefnames, namesofstructs, namesofunions)\n|\n|  memmove(...)\n|      ffi.memmove(dest, src, n) copies n bytes of memory from src to dest.\n|\n|      Like the C function memmove(), the memory areas may overlap;\n|      apart from that it behaves like the C function memcpy().\n|\n|      'src' can be any cdata ptr or array, or any Python buffer object.\n|      'dest' can be any cdata ptr or array, or a writable Python buffer\n|      object.  The size to copy, 'n', is always measured in bytes.\n|\n|      Unlike other methods, this one supports all Python buffer including\n|      byte strings and bytearrays---but it still does not support\n|      non-contiguous buffers.\n|\n|  new(...)\n|      Allocate an instance according to the specified C type and return a\n|      pointer to it.  The specified C type must be either a pointer or an\n|      array: ``new('X *')`` allocates an X and returns a pointer to it,\n|      whereas ``new('X[n]')`` allocates an array of n X'es and returns an\n|      array referencing it (which works mostly like a pointer, like in C).\n|      You can also use ``new('X[]', n)`` to allocate an array of a\n|      non-constant length n.\n|\n|      The memory is initialized following the rules of declaring a global\n|      variable in C: by default it is zero-initialized, but an explicit\n|      initializer can be given which can be used to fill all or part of the\n|      memory.\n|\n|      When the returned <cdata> object goes out of scope, the memory is\n|      freed.  In other words the returned <cdata> object has ownership of\n|      the value of type 'cdecl' that it points to.  This means that the raw\n|      data can be used as long as this object is kept alive, but must not be\n|      used for a longer time.  Be careful about that when copying the\n|      pointer to the memory somewhere else, e.g. into another structure.\n|\n|  newallocator(...)\n|      Return a new allocator, i.e. a function that behaves like ffi.new()\n|      but uses the provided low-level 'alloc' and 'free' functions.\n|\n|      'alloc' is called with the size as argument.  If it returns NULL, a\n|      MemoryError is raised.  'free' is called with the result of 'alloc'\n|      as argument.  Both can be either Python functions or directly C\n|      functions.  If 'free' is None, then no free function is called.\n|      If both 'alloc' and 'free' are None, the default is used.\n|\n|      If 'shouldclearafteralloc' is set to False, then the memory\n|      returned by 'alloc' is assumed to be already cleared (or you are\n|      fine with garbage); otherwise CFFI will clear it.\n|\n|  newhandle(...)\n|      Return a non-NULL cdata of type 'void *' that contains an opaque\n|      reference to the argument, which can be any Python object.  To cast it\n|      back to the original object, use fromhandle().  You must keep alive\n|      the cdata object returned by newhandle()!\n|\n|  offsetof(...)\n|      Return the offset of the named field inside the given structure or\n|      array, which must be given as a C type name.  You can give several\n|      field names in case of nested structures.  You can also give numeric\n|      values which correspond to array items, in case of an array type.\n|\n|  release(...)\n|      Release now the resources held by a 'cdata' object from ffi.new(),\n|      ffi.gc() or ffi.frombuffer().  The cdata object must not be used\n|      afterwards.\n|\n|      'ffi.release(cdata)' is equivalent to 'cdata.exit()'.\n|\n|      Note that on CPython this method has no effect (so far) on objects\n|      returned by ffi.new(), because the memory is allocated inline with the\n|      cdata object and cannot be freed independently.  It might be fixed in\n|      future releases of cffi.\n|\n|  sizeof(...)\n|      Return the size in bytes of the argument.\n|      It can be a string naming a C type, or a 'cdata' instance.\n|\n|  string(...)\n|      Return a Python string (or unicode string) from the 'cdata'.  If\n|      'cdata' is a pointer or array of characters or bytes, returns the\n|      null-terminated string.  The returned string extends until the first\n|      null character, or at most 'maxlen' characters.  If 'cdata' is an\n|      array then 'maxlen' defaults to its length.\n|\n|      If 'cdata' is a pointer or array of wchart, returns a unicode string\n|      following the same rules.\n|\n|      If 'cdata' is a single character or byte or a wchart, returns it as a\n|      string or unicode string.\n|\n|      If 'cdata' is an enum, returns the value of the enumerator as a\n|      string, or 'NUMBER' if the value is out of range.\n|\n|  typeof(...)\n|      Parse the C type given as a string and return the\n|      corresponding <ctype> object.\n|      It can also be used on 'cdata' instance to get its C type.\n|\n|  unpack(...)\n|      Unpack an array of C data of the given length,\n|      returning a Python string/unicode/list.\n|\n|      If 'cdata' is a pointer to 'char', returns a byte string.\n|      It does not stop at the first null.  This is equivalent to:\n|      ffi.buffer(cdata, length)[:]\n|\n|      If 'cdata' is a pointer to 'wchart', returns a unicode string.\n|      'length' is measured in wchart's; it is not the size in bytes.\n|\n|      If 'cdata' is a pointer to anything else, returns a list of\n|      'length' items.  This is a faster equivalent to:\n|      [cdata[i] for i in range(length)]\n|\n|  ----------------------------------------------------------------------\n|  Static methods defined here:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  errno\n|      the value of 'errno' from/to the C calls\n|\n|  ----------------------------------------------------------------------\n|  Data and other attributes defined here:\n|\n|  CData = <class 'cffibackend.CDataBase'>\n|      The internal base type for CData objects.  Use FFI.CData to access it.  Always check with isinstance(): subtypes are sometimes returned on CPython, for performance reasons.\n|\n|\n|  CType = <class 'cffibackend.CType'>\n|\n|  NULL = <cdata 'void *' NULL>\n|\n|  RTLDDEEPBIND = 8\n|\n|  RTLDGLOBAL = 256\n|\n|  RTLDLAZY = 1\n|\n|  RTLDLOCAL = 0\n|\n|  RTLDNODELETE = 4096\n|\n|  RTLDNOLOAD = 4\n|\n|  RTLDNOW = 2\n|\n|  buffer = <class 'cffibackend.buffer'>\n|      ffi.buffer(cdata[, bytesize]):\n|      Return a read-write buffer object that references the raw C data\n|      pointed to by the given 'cdata'.  The 'cdata' must be a pointer or an\n|      array.  Can be passed to functions expecting a buffer, or directly\n|      manipulated with:\n|\n|          buf[:]          get a copy of it in a regular string, or\n|          buf[idx]        as a single character\n|          buf[:] = ...\n|          buf[idx] = ...  change the content\n|\n|\n|  error = <class 'ffi.error'>\n"
                },
                {
                    "name": "class Lib",
                    "content": "|  Methods defined here:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  dir(...)\n|      Default dir() implementation.\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n"
                },
                {
                    "name": "class buffer",
                    "content": "|  ffi.buffer(cdata[, bytesize]):\n|  Return a read-write buffer object that references the raw C data\n|  pointed to by the given 'cdata'.  The 'cdata' must be a pointer or an\n|  array.  Can be passed to functions expecting a buffer, or directly\n|  manipulated with:\n|\n|      buf[:]          get a copy of it in a regular string, or\n|      buf[idx]        as a single character\n|      buf[:] = ...\n|      buf[idx] = ...  change the content\n|\n|  Methods defined here:\n|\n|  delitem(self, key, /)\n|      Delete self[key].\n|\n|  eq(self, value, /)\n|      Return self==value.\n|\n|  ge(self, value, /)\n|      Return self>=value.\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  getitem(self, key, /)\n|      Return self[key].\n|\n|  gt(self, value, /)\n|      Return self>value.\n|\n|  le(self, value, /)\n|      Return self<=value.\n|\n|  len(self, /)\n|      Return len(self).\n|\n|  lt(self, value, /)\n|      Return self<value.\n|\n|  ne(self, value, /)\n|      Return self!=value.\n|\n|  setitem(self, key, value, /)\n|      Set self[key] to value.\n|\n|  ----------------------------------------------------------------------\n|  Static methods defined here:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Data and other attributes defined here:\n|\n|  hash = None\n"
                }
            ]
        },
        "FUNCTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "alignof",
                    "content": ""
                },
                {
                    "name": "callback",
                    "content": ""
                },
                {
                    "name": "cast",
                    "content": ""
                },
                {
                    "name": "complete_struct_or_union",
                    "content": ""
                },
                {
                    "name": "from_buffer",
                    "content": ""
                },
                {
                    "name": "from_handle",
                    "content": ""
                },
                {
                    "name": "gcp",
                    "content": ""
                },
                {
                    "name": "get_errno",
                    "content": ""
                },
                {
                    "name": "getcname",
                    "content": ""
                },
                {
                    "name": "load_library",
                    "content": ""
                },
                {
                    "name": "memmove",
                    "content": ""
                },
                {
                    "name": "new_array_type",
                    "content": ""
                },
                {
                    "name": "new_enum_type",
                    "content": ""
                },
                {
                    "name": "new_function_type",
                    "content": ""
                },
                {
                    "name": "new_pointer_type",
                    "content": ""
                },
                {
                    "name": "new_primitive_type",
                    "content": ""
                },
                {
                    "name": "new_struct_type",
                    "content": ""
                },
                {
                    "name": "new_union_type",
                    "content": ""
                },
                {
                    "name": "new_void_type",
                    "content": ""
                },
                {
                    "name": "newp",
                    "content": ""
                },
                {
                    "name": "newp_handle",
                    "content": ""
                },
                {
                    "name": "rawaddressof",
                    "content": ""
                },
                {
                    "name": "release",
                    "content": ""
                },
                {
                    "name": "set_errno",
                    "content": ""
                },
                {
                    "name": "sizeof",
                    "content": ""
                },
                {
                    "name": "string",
                    "content": ""
                },
                {
                    "name": "typeof",
                    "content": ""
                },
                {
                    "name": "typeoffsetof",
                    "content": ""
                },
                {
                    "name": "unpack",
                    "content": ""
                }
            ]
        },
        "DATA": {
            "content": "FFICDECL = 2\nFFIDEFAULTABI = 2\nRTLDDEEPBIND = 8\nRTLDGLOBAL = 256\nRTLDLAZY = 1\nRTLDLOCAL = 0\nRTLDNODELETE = 4096\nRTLDNOLOAD = 4\nRTLDNOW = 2\n",
            "subsections": []
        },
        "VERSION": {
            "content": "1.15.0\n",
            "subsections": []
        },
        "FILE": {
            "content": "/usr/lib/python3/dist-packages/cffibackend.cpython-310-x8664-linux-gnu.so\n\n",
            "subsections": []
        }
    },
    "summary": "cffibackend",
    "flags": [],
    "examples": [],
    "see_also": []
}