LEFT | RIGHT |
1 /* Descriptors */ | 1 /* Descriptors */ |
2 #ifndef Py_DESCROBJECT_H | 2 #ifndef Py_DESCROBJECT_H |
3 #define Py_DESCROBJECT_H | 3 #define Py_DESCROBJECT_H |
4 #ifdef __cplusplus | 4 #ifdef __cplusplus |
5 extern "C" { | 5 extern "C" { |
6 #endif | 6 #endif |
7 | 7 |
8 typedef PyObject *(*getter)(PyObject *, void *); | 8 typedef PyObject *(*getter)(PyObject *, void *); |
9 typedef int (*setter)(PyObject *, PyObject *, void *); | 9 typedef int (*setter)(PyObject *, PyObject *, void *); |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 #define PyDescr_COMMON \ | 40 #define PyDescr_COMMON \ |
41 PyObject_HEAD \ | 41 PyObject_HEAD \ |
42 PyTypeObject *d_type; \ | 42 PyTypeObject *d_type; \ |
43 PyObject *d_name | 43 PyObject *d_name |
44 | 44 |
45 typedef struct { | 45 typedef struct { |
46 PyDescr_COMMON; | 46 PyDescr_COMMON; |
47 } PyDescrObject; | 47 } PyDescrObject; |
48 | 48 |
49 typedef struct { | 49 typedef struct PyMethodDescrObject { |
50 PyDescr_COMMON; | 50 PyDescr_COMMON; |
51 PyMethodDef *d_method; | 51 PyMethodDef *d_method; |
52 } PyMethodDescrObject; | 52 } PyMethodDescrObject; |
53 | 53 |
54 typedef struct { | 54 typedef struct { |
55 PyDescr_COMMON; | 55 PyDescr_COMMON; |
56 struct PyMemberDef *d_member; | 56 struct PyMemberDef *d_member; |
57 } PyMemberDescrObject; | 57 } PyMemberDescrObject; |
58 | 58 |
59 typedef struct { | 59 typedef struct { |
60 PyDescr_COMMON; | 60 PyDescr_COMMON; |
61 PyGetSetDef *d_getset; | 61 PyGetSetDef *d_getset; |
62 } PyGetSetDescrObject; | 62 } PyGetSetDescrObject; |
63 | 63 |
64 typedef struct { | 64 typedef struct { |
65 PyDescr_COMMON; | 65 PyDescr_COMMON; |
66 struct wrapperbase *d_base; | 66 struct wrapperbase *d_base; |
67 void *d_wrapped; /* This can be any function pointer */ | 67 void *d_wrapped; /* This can be any function pointer */ |
68 } PyWrapperDescrObject; | 68 } PyWrapperDescrObject; |
69 | 69 |
70 PyAPI_DATA(PyTypeObject) PyWrapperDescr_Type; | 70 PyAPI_DATA(PyTypeObject) PyWrapperDescr_Type; |
| 71 PyAPI_DATA(PyTypeObject) PyDictProxy_Type; |
| 72 PyAPI_DATA(PyTypeObject) PyGetSetDescr_Type; |
| 73 PyAPI_DATA(PyTypeObject) PyMemberDescr_Type; |
71 | 74 |
72 PyAPI_FUNC(PyObject *) PyDescr_NewMethod(PyTypeObject *, PyMethodDef *); | 75 PyAPI_FUNC(PyObject *) PyDescr_NewMethod(PyTypeObject *, PyMethodDef *); |
73 PyAPI_FUNC(PyObject *) PyDescr_NewClassMethod(PyTypeObject *, PyMethodDef *); | 76 PyAPI_FUNC(PyObject *) PyDescr_NewClassMethod(PyTypeObject *, PyMethodDef *); |
74 PyAPI_FUNC(PyObject *) PyDescr_NewMember(PyTypeObject *, | 77 PyAPI_FUNC(PyObject *) PyDescr_NewMember(PyTypeObject *, |
75 struct PyMemberDef *); | 78 struct PyMemberDef *); |
76 PyAPI_FUNC(PyObject *) PyDescr_NewGetSet(PyTypeObject *, | 79 PyAPI_FUNC(PyObject *) PyDescr_NewGetSet(PyTypeObject *, |
77 struct PyGetSetDef *); | 80 struct PyGetSetDef *); |
78 PyAPI_FUNC(PyObject *) PyDescr_NewWrapper(PyTypeObject *, | 81 PyAPI_FUNC(PyObject *) PyDescr_NewWrapper(PyTypeObject *, |
79 struct wrapperbase *, void *); | 82 struct wrapperbase *, void *); |
80 #define PyDescr_IsData(d) (Py_TYPE(d)->tp_descr_set != NULL) | 83 #define PyDescr_IsData(d) (Py_TYPE(d)->tp_descr_set != NULL) |
81 | 84 |
82 PyAPI_FUNC(PyObject *) PyDictProxy_New(PyObject *); | 85 PyAPI_FUNC(PyObject *) PyDictProxy_New(PyObject *); |
83 PyAPI_FUNC(PyObject *) PyWrapper_New(PyObject *, PyObject *); | 86 PyAPI_FUNC(PyObject *) PyWrapper_New(PyObject *, PyObject *); |
84 | 87 |
85 #define PyMethodDescr_Check(d) (Py_TYPE(d) == &PyMethodDescr_Type) | 88 #define PyMethodDescr_Check(d) (Py_TYPE(d) == &PyMethodDescr_Type) |
| 89 #define PyWrapperDescr_Check(d) (Py_TYPE(d) == &PyWrapperDescr_Type) |
86 | 90 |
87 PyAPI_DATA(PyTypeObject) PyMethodDescr_Type; | 91 PyAPI_DATA(PyTypeObject) PyMethodDescr_Type; |
88 PyAPI_DATA(PyTypeObject) PyProperty_Type; | 92 PyAPI_DATA(PyTypeObject) PyProperty_Type; |
89 #ifdef __cplusplus | 93 #ifdef __cplusplus |
90 } | 94 } |
91 #endif | 95 #endif |
92 #endif /* !Py_DESCROBJECT_H */ | 96 #endif /* !Py_DESCROBJECT_H */ |
LEFT | RIGHT |