{
    "content": [
        {
            "type": "text",
            "text": "# _ctypes (pydoc)\n\n**Summary:** ctypes - Create and manipulate C compatible data types in Python.\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **MODULE REFERENCE** (8 lines)\n- **CLASSES** (8 lines) — 5 subsections\n  - class ArgumentError (67 lines)\n  - class Array (49 lines)\n  - class CFuncPtr (49 lines)\n  - class Structure (31 lines)\n  - class Union (31 lines)\n- **FUNCTIONS** (8 lines) — 14 subsections\n  - addressof (3 lines)\n  - alignment (4 lines)\n  - buffer_info (2 lines)\n  - byref (4 lines)\n  - call_cdeclfunction (1 lines)\n  - call_function (1 lines)\n  - dlclose (2 lines)\n  - dlopen (2 lines)\n  - dlsym (2 lines)\n  - get_errno (1 lines)\n  - pointer (1 lines)\n  - resize (2 lines)\n  - set_errno (1 lines)\n  - sizeof (4 lines)\n- **DATA** (7 lines)\n- **VERSION** (2 lines)\n- **FILE** (3 lines)\n\n## Full Content\n\n### NAME\n\nctypes - Create and manipulate C compatible data types in Python.\n\n### MODULE REFERENCE\n\nhttps://docs.python.org/3.10/library/ctypes.html\n\nThe following documentation is automatically generated from the Python\nsource files.  It may be incomplete, incorrect or include features that\nare considered implementation detail and may vary between Python\nimplementations.  When in doubt, consult the module reference at the\nlocation listed above.\n\n### CLASSES\n\nCData(builtins.object)\nArray\nCFuncPtr\nStructure\nUnion\nbuiltins.Exception(builtins.BaseException)\nctypes.ArgumentError\n\n#### class ArgumentError\n\n|  Method resolution order:\n|      ArgumentError\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Data descriptors defined here:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.Exception:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.Exception:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n\n#### class Array\n\n|  XXX to be provided\n|\n|  Method resolution order:\n|      Array\n|      CData\n|      builtins.object\n|\n|  Methods defined here:\n|\n|  delitem(self, key, /)\n|      Delete self[key].\n|\n|  getitem(self, key, /)\n|      Return self[key].\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  len(self, /)\n|      Return len(self).\n|\n|  setitem(self, key, value, /)\n|      Set self[key] to value.\n|\n|  ----------------------------------------------------------------------\n|  Class methods defined here:\n|\n|  classgetitem(...) from PyCArrayType\n|      See PEP 585\n|\n|  ----------------------------------------------------------------------\n|  Static methods defined here:\n|\n|  new(*args, kwargs) from PyCArrayType\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from CData:\n|\n|  ctypesfromoutparam(...)\n|\n|  hash(self, /)\n|      Return hash(self).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  setstate(...)\n\n#### class CFuncPtr\n\n|  Function Pointer\n|\n|  Method resolution order:\n|      CFuncPtr\n|      CData\n|      builtins.object\n|\n|  Methods defined here:\n|\n|  bool(self, /)\n|      True if self else False\n|\n|  call(self, /, *args, kwargs)\n|      Call self as a function.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  ----------------------------------------------------------------------\n|  Static methods defined here:\n|\n|  new(*args, kwargs) from PyCFuncPtrType\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  argtypes\n|      specify the argument types\n|\n|  errcheck\n|      a function to check for errors\n|\n|  restype\n|      specify the result type\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from CData:\n|\n|  ctypesfromoutparam(...)\n|\n|  hash(self, /)\n|      Return hash(self).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  setstate(...)\n\n#### class Structure\n\n|  Structure base class\n|\n|  Method resolution order:\n|      Structure\n|      CData\n|      builtins.object\n|\n|  Methods defined here:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Static methods defined here:\n|\n|  new(*args, kwargs) from PyCStructType\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from CData:\n|\n|  ctypesfromoutparam(...)\n|\n|  hash(self, /)\n|      Return hash(self).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  setstate(...)\n\n#### class Union\n\n|  Union base class\n|\n|  Method resolution order:\n|      Union\n|      CData\n|      builtins.object\n|\n|  Methods defined here:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Static methods defined here:\n|\n|  new(*args, kwargs) from UnionType\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from CData:\n|\n|  ctypesfromoutparam(...)\n|\n|  hash(self, /)\n|      Return hash(self).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  setstate(...)\n\n### FUNCTIONS\n\nPOINTER(...)\n\nPyObjFromPtr(...)\n\nPyDECREF(...)\n\nPyINCREF(...)\n\n#### addressof\n\naddressof(C instance) -> integer\nReturn the address of the C instance internal buffer\n\n#### alignment\n\nalignment(C type) -> integer\nalignment(C instance) -> integer\nReturn the alignment requirements of a C instance\n\n#### buffer_info\n\nReturn buffer interface information\n\n#### byref\n\nbyref(C instance[, offset=0]) -> byref-object\nReturn a pointer lookalike to a C instance, only usable\nas function argument\n\n#### call_cdeclfunction\n\n#### call_function\n\n#### dlclose\n\ndlclose a library\n\n#### dlopen\n\ndlopen(name, flag={RTLDGLOBAL|RTLDLOCAL}) open a shared library\n\n#### dlsym\n\nfind symbol in shared library\n\n#### get_errno\n\n#### pointer\n\n#### resize\n\nResize the memory buffer of a ctypes instance\n\n#### set_errno\n\n#### sizeof\n\nsizeof(C type) -> integer\nsizeof(C instance) -> integer\nReturn the size in bytes of a C instance\n\n### DATA\n\nFUNCFLAGCDECL = 1\nFUNCFLAGPYTHONAPI = 4\nFUNCFLAGUSEERRNO = 8\nFUNCFLAGUSELASTERROR = 16\nRTLDGLOBAL = 256\nRTLDLOCAL = 0\n\n### VERSION\n\n1.1.0\n\n### FILE\n\n/usr/lib/python3.10/lib-dynload/ctypes.cpython-310-x8664-linux-gnu.so\n\n"
        }
    ],
    "structuredContent": {
        "command": "_ctypes",
        "section": "",
        "mode": "pydoc",
        "summary": "ctypes - Create and manipulate C compatible data types in Python.",
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "MODULE REFERENCE",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "CLASSES",
                "lines": 8,
                "subsections": [
                    {
                        "name": "class ArgumentError",
                        "lines": 67
                    },
                    {
                        "name": "class Array",
                        "lines": 49
                    },
                    {
                        "name": "class CFuncPtr",
                        "lines": 49
                    },
                    {
                        "name": "class Structure",
                        "lines": 31
                    },
                    {
                        "name": "class Union",
                        "lines": 31
                    }
                ]
            },
            {
                "name": "FUNCTIONS",
                "lines": 8,
                "subsections": [
                    {
                        "name": "addressof",
                        "lines": 3
                    },
                    {
                        "name": "alignment",
                        "lines": 4
                    },
                    {
                        "name": "buffer_info",
                        "lines": 2
                    },
                    {
                        "name": "byref",
                        "lines": 4
                    },
                    {
                        "name": "call_cdeclfunction",
                        "lines": 1
                    },
                    {
                        "name": "call_function",
                        "lines": 1
                    },
                    {
                        "name": "dlclose",
                        "lines": 2
                    },
                    {
                        "name": "dlopen",
                        "lines": 2
                    },
                    {
                        "name": "dlsym",
                        "lines": 2
                    },
                    {
                        "name": "get_errno",
                        "lines": 1
                    },
                    {
                        "name": "pointer",
                        "lines": 1
                    },
                    {
                        "name": "resize",
                        "lines": 2
                    },
                    {
                        "name": "set_errno",
                        "lines": 1
                    },
                    {
                        "name": "sizeof",
                        "lines": 4
                    }
                ]
            },
            {
                "name": "DATA",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "VERSION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "FILE",
                "lines": 3,
                "subsections": []
            }
        ]
    }
}