diff options
Diffstat (limited to 'Include')
-rw-r--r-- | Include/descrobject.h | 2 | ||||
-rw-r--r-- | Include/object.h | 2 | ||||
-rw-r--r-- | Include/structmember.h | 16 |
3 files changed, 18 insertions, 2 deletions
diff --git a/Include/descrobject.h b/Include/descrobject.h index a868310..3d58181 100644 --- a/Include/descrobject.h +++ b/Include/descrobject.h @@ -21,7 +21,7 @@ struct wrapperbase { extern DL_IMPORT(PyObject *) PyDescr_NewMethod(PyTypeObject *, PyMethodDef *); extern DL_IMPORT(PyObject *) PyDescr_NewMember(PyTypeObject *, - struct memberlist *); + struct PyMemberDef *); extern DL_IMPORT(PyObject *) PyDescr_NewGetSet(PyTypeObject *, struct getsetlist *); extern DL_IMPORT(PyObject *) PyDescr_NewWrapper(PyTypeObject *, diff --git a/Include/object.h b/Include/object.h index 160331e..1d0ae5f 100644 --- a/Include/object.h +++ b/Include/object.h @@ -274,7 +274,7 @@ typedef struct _typeobject { /* Attribute descriptor and subclassing stuff */ struct PyMethodDef *tp_methods; - struct memberlist *tp_members; + struct PyMemberDef *tp_members; struct getsetlist *tp_getset; struct _typeobject *tp_base; PyObject *tp_dict; diff --git a/Include/structmember.h b/Include/structmember.h index cd35fdb..2c9f41d 100644 --- a/Include/structmember.h +++ b/Include/structmember.h @@ -28,12 +28,22 @@ extern "C" { pointer is NULL. */ struct memberlist { + /* Obsolete version, for binary backwards compatibility */ char *name; int type; int offset; int flags; }; +typedef struct PyMemberDef { + /* Current version, use this */ + char *name; + int type; + int offset; + int flags; + char *doc; +} PyMemberDef; + /* Types */ #define T_SHORT 0 #define T_INT 1 @@ -66,9 +76,15 @@ struct memberlist { #define RESTRICTED (READ_RESTRICTED | WRITE_RESTRICTED) +/* Obsolete API, for binary backwards compatibility */ DL_IMPORT(PyObject *) PyMember_Get(char *, struct memberlist *, char *); DL_IMPORT(int) PyMember_Set(char *, struct memberlist *, char *, PyObject *); +/* Current API, use this */ +DL_IMPORT(PyObject *) PyMember_GetOne(char *, struct PyMemberDef *); +DL_IMPORT(int) PyMember_SetOne(char *, struct PyMemberDef *, PyObject *); + + #ifdef __cplusplus } #endif |