File indexing completed on 2025-01-18 10:06:49
0001
0002 #ifndef Py_DESCROBJECT_H
0003 #define Py_DESCROBJECT_H
0004 #ifdef __cplusplus
0005 extern "C" {
0006 #endif
0007
0008 typedef PyObject *(*getter)(PyObject *, void *);
0009 typedef int (*setter)(PyObject *, PyObject *, void *);
0010
0011 struct PyGetSetDef {
0012 const char *name;
0013 getter get;
0014 setter set;
0015 const char *doc;
0016 void *closure;
0017 };
0018
0019 PyAPI_DATA(PyTypeObject) PyClassMethodDescr_Type;
0020 PyAPI_DATA(PyTypeObject) PyGetSetDescr_Type;
0021 PyAPI_DATA(PyTypeObject) PyMemberDescr_Type;
0022 PyAPI_DATA(PyTypeObject) PyMethodDescr_Type;
0023 PyAPI_DATA(PyTypeObject) PyWrapperDescr_Type;
0024 PyAPI_DATA(PyTypeObject) PyDictProxy_Type;
0025 PyAPI_DATA(PyTypeObject) PyProperty_Type;
0026
0027 PyAPI_FUNC(PyObject *) PyDescr_NewMethod(PyTypeObject *, PyMethodDef *);
0028 PyAPI_FUNC(PyObject *) PyDescr_NewClassMethod(PyTypeObject *, PyMethodDef *);
0029 PyAPI_FUNC(PyObject *) PyDescr_NewMember(PyTypeObject *, PyMemberDef *);
0030 PyAPI_FUNC(PyObject *) PyDescr_NewGetSet(PyTypeObject *, PyGetSetDef *);
0031
0032 PyAPI_FUNC(PyObject *) PyDictProxy_New(PyObject *);
0033 PyAPI_FUNC(PyObject *) PyWrapper_New(PyObject *, PyObject *);
0034
0035
0036
0037
0038
0039
0040
0041 struct PyMemberDef {
0042 const char *name;
0043 int type;
0044 Py_ssize_t offset;
0045 int flags;
0046 const char *doc;
0047 };
0048
0049
0050
0051
0052
0053 #define Py_T_SHORT 0
0054 #define Py_T_INT 1
0055 #define Py_T_LONG 2
0056 #define Py_T_FLOAT 3
0057 #define Py_T_DOUBLE 4
0058 #define Py_T_STRING 5
0059 #define _Py_T_OBJECT 6
0060
0061 #define Py_T_CHAR 7
0062 #define Py_T_BYTE 8
0063
0064 #define Py_T_UBYTE 9
0065 #define Py_T_USHORT 10
0066 #define Py_T_UINT 11
0067 #define Py_T_ULONG 12
0068
0069
0070 #define Py_T_STRING_INPLACE 13
0071
0072
0073 #define Py_T_BOOL 14
0074
0075 #define Py_T_OBJECT_EX 16
0076 #define Py_T_LONGLONG 17
0077 #define Py_T_ULONGLONG 18
0078
0079 #define Py_T_PYSSIZET 19
0080 #define _Py_T_NONE 20
0081
0082
0083 #define Py_READONLY 1
0084 #define Py_AUDIT_READ 2
0085 #define _Py_WRITE_RESTRICTED 4
0086 #define Py_RELATIVE_OFFSET 8
0087
0088 PyAPI_FUNC(PyObject *) PyMember_GetOne(const char *, PyMemberDef *);
0089 PyAPI_FUNC(int) PyMember_SetOne(char *, PyMemberDef *, PyObject *);
0090
0091 #ifndef Py_LIMITED_API
0092 # define Py_CPYTHON_DESCROBJECT_H
0093 # include "cpython/descrobject.h"
0094 # undef Py_CPYTHON_DESCROBJECT_H
0095 #endif
0096
0097 #ifdef __cplusplus
0098 }
0099 #endif
0100 #endif