| extern "C" { | |
| /* Interface to map C struct members to Python object attributes */ | |
| /* An array of PyMemberDef structures defines the name, type and offset | |
| of selected members of a C structure. These can be read by | |
| PyMember_GetOne() and set by PyMember_SetOne() (except if their READONLY | |
| flag is set). The array must be terminated with an entry whose name | |
| pointer is NULL. */ | |
| typedef struct PyMemberDef { | |
| const char *name; | |
| int type; | |
| Py_ssize_t offset; | |
| int flags; | |
| const char *doc; | |
| } PyMemberDef; | |
| /* Types */ | |
| /* XXX the ordering here is weird for binary compatibility */ | |
| /* unsigned variants: */ | |
| /* Added by Jack: strings contained in the structure */ | |
| /* Added by Lillo: bools contained in the structure (assumed char) */ | |
| /* Flags */ | |
| /* Current API, use this */ | |
| PyAPI_FUNC(PyObject *) PyMember_GetOne(const char *, struct PyMemberDef *); | |
| PyAPI_FUNC(int) PyMember_SetOne(char *, struct PyMemberDef *, PyObject *); | |
| } | |