File indexing completed on 2025-01-30 10:18:03
0001 #ifndef Py_CPYTHON_DESCROBJECT_H
0002 # error "this header file must not be included directly"
0003 #endif
0004
0005 typedef PyObject *(*wrapperfunc)(PyObject *self, PyObject *args,
0006 void *wrapped);
0007
0008 typedef PyObject *(*wrapperfunc_kwds)(PyObject *self, PyObject *args,
0009 void *wrapped, PyObject *kwds);
0010
0011 struct wrapperbase {
0012 const char *name;
0013 int offset;
0014 void *function;
0015 wrapperfunc wrapper;
0016 const char *doc;
0017 int flags;
0018 PyObject *name_strobj;
0019 };
0020
0021
0022 #define PyWrapperFlag_KEYWORDS 1
0023
0024
0025
0026 typedef struct {
0027 PyObject_HEAD
0028 PyTypeObject *d_type;
0029 PyObject *d_name;
0030 PyObject *d_qualname;
0031 } PyDescrObject;
0032
0033 #define PyDescr_COMMON PyDescrObject d_common
0034
0035 #define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type)
0036 #define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name)
0037
0038 typedef struct {
0039 PyDescr_COMMON;
0040 PyMethodDef *d_method;
0041 vectorcallfunc vectorcall;
0042 } PyMethodDescrObject;
0043
0044 typedef struct {
0045 PyDescr_COMMON;
0046 PyMemberDef *d_member;
0047 } PyMemberDescrObject;
0048
0049 typedef struct {
0050 PyDescr_COMMON;
0051 PyGetSetDef *d_getset;
0052 } PyGetSetDescrObject;
0053
0054 typedef struct {
0055 PyDescr_COMMON;
0056 struct wrapperbase *d_base;
0057 void *d_wrapped;
0058 } PyWrapperDescrObject;
0059
0060 PyAPI_DATA(PyTypeObject) _PyMethodWrapper_Type;
0061
0062 PyAPI_FUNC(PyObject *) PyDescr_NewWrapper(PyTypeObject *,
0063 struct wrapperbase *, void *);
0064 PyAPI_FUNC(int) PyDescr_IsData(PyObject *);