2 #ifndef Py_DESCROBJECT_H
3 #define Py_DESCROBJECT_H
8 typedef PyObject
*(*getter
)(PyObject
*, void *);
9 typedef int (*setter
)(PyObject
*, PyObject
*, void *);
11 typedef struct PyGetSetDef
{
19 typedef PyObject
*(*wrapperfunc
)(PyObject
*self
, PyObject
*args
,
22 typedef PyObject
*(*wrapperfunc_kwds
)(PyObject
*self
, PyObject
*args
,
23 void *wrapped
, PyObject
*kwds
);
32 PyObject
*name_strobj
;
35 /* Flags for above struct */
36 #define PyWrapperFlag_KEYWORDS 1 /* wrapper function takes keyword args */
38 /* Various kinds of descriptor objects */
40 #define PyDescr_COMMON \
42 PyTypeObject *d_type; \
51 PyMethodDef
*d_method
;
52 } PyMethodDescrObject
;
56 struct PyMemberDef
*d_member
;
57 } PyMemberDescrObject
;
61 PyGetSetDef
*d_getset
;
62 } PyGetSetDescrObject
;
66 struct wrapperbase
*d_base
;
67 void *d_wrapped
; /* This can be any function pointer */
68 } PyWrapperDescrObject
;
70 PyAPI_DATA(PyTypeObject
) PyWrapperDescr_Type
;
72 PyAPI_FUNC(PyObject
*) PyDescr_NewMethod(PyTypeObject
*, PyMethodDef
*);
73 PyAPI_FUNC(PyObject
*) PyDescr_NewClassMethod(PyTypeObject
*, PyMethodDef
*);
74 PyAPI_FUNC(PyObject
*) PyDescr_NewMember(PyTypeObject
*,
75 struct PyMemberDef
*);
76 PyAPI_FUNC(PyObject
*) PyDescr_NewGetSet(PyTypeObject
*,
77 struct PyGetSetDef
*);
78 PyAPI_FUNC(PyObject
*) PyDescr_NewWrapper(PyTypeObject
*,
79 struct wrapperbase
*, void *);
80 #define PyDescr_IsData(d) ((d)->ob_type->tp_descr_set != NULL)
82 PyAPI_FUNC(PyObject
*) PyDictProxy_New(PyObject
*);
83 PyAPI_FUNC(PyObject
*) PyWrapper_New(PyObject
*, PyObject
*);
86 PyAPI_DATA(PyTypeObject
) PyProperty_Type
;
90 #endif /* !Py_DESCROBJECT_H */