+++ /dev/null
-#ifndef Py_STRUCTMEMBER_H\r
-#define Py_STRUCTMEMBER_H\r
-#ifdef __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-\r
-/* Interface to map C struct members to Python object attributes */\r
-\r
-#include <stddef.h> /* For offsetof */\r
-\r
-/* The offsetof() macro calculates the offset of a structure member\r
- in its structure. Unfortunately this cannot be written down\r
- portably, hence it is provided by a Standard C header file.\r
- For pre-Standard C compilers, here is a version that usually works\r
- (but watch out!): */\r
-\r
-#ifndef offsetof\r
-#define offsetof(type, member) ( (int) & ((type*)0) -> member )\r
-#endif\r
-\r
-/* An array of memberlist structures defines the name, type and offset\r
- of selected members of a C structure. These can be read by\r
- PyMember_Get() and set by PyMember_Set() (except if their READONLY flag\r
- is set). The array must be terminated with an entry whose name\r
- pointer is NULL. */\r
-\r
-struct memberlist {\r
- /* Obsolete version, for binary backwards compatibility */\r
- char *name;\r
- int type;\r
- int offset;\r
- int flags;\r
-};\r
-\r
-typedef struct PyMemberDef {\r
- /* Current version, use this */\r
- char *name;\r
- int type;\r
- Py_ssize_t offset;\r
- int flags;\r
- char *doc;\r
-} PyMemberDef;\r
-\r
-/* Types */\r
-#define T_SHORT 0\r
-#define T_INT 1\r
-#define T_LONG 2\r
-#define T_FLOAT 3\r
-#define T_DOUBLE 4\r
-#define T_STRING 5\r
-#define T_OBJECT 6\r
-/* XXX the ordering here is weird for binary compatibility */\r
-#define T_CHAR 7 /* 1-character string */\r
-#define T_BYTE 8 /* 8-bit signed int */\r
-/* unsigned variants: */\r
-#define T_UBYTE 9\r
-#define T_USHORT 10\r
-#define T_UINT 11\r
-#define T_ULONG 12\r
-\r
-/* Added by Jack: strings contained in the structure */\r
-#define T_STRING_INPLACE 13\r
-\r
-/* Added by Lillo: bools contained in the structure (assumed char) */\r
-#define T_BOOL 14\r
-\r
-#define T_OBJECT_EX 16 /* Like T_OBJECT, but raises AttributeError\r
- when the value is NULL, instead of\r
- converting to None. */\r
-#ifdef HAVE_LONG_LONG\r
-#define T_LONGLONG 17\r
-#define T_ULONGLONG 18\r
-#endif /* HAVE_LONG_LONG */\r
-\r
-#define T_PYSSIZET 19 /* Py_ssize_t */\r
-\r
-\r
-/* Flags */\r
-#define READONLY 1\r
-#define RO READONLY /* Shorthand */\r
-#define READ_RESTRICTED 2\r
-#define PY_WRITE_RESTRICTED 4\r
-#define RESTRICTED (READ_RESTRICTED | PY_WRITE_RESTRICTED)\r
-\r
-\r
-/* Obsolete API, for binary backwards compatibility */\r
-PyAPI_FUNC(PyObject *) PyMember_Get(const char *, struct memberlist *, const char *);\r
-PyAPI_FUNC(int) PyMember_Set(char *, struct memberlist *, const char *, PyObject *);\r
-\r
-/* Current API, use this */\r
-PyAPI_FUNC(PyObject *) PyMember_GetOne(const char *, struct PyMemberDef *);\r
-PyAPI_FUNC(int) PyMember_SetOne(char *, struct PyMemberDef *, PyObject *);\r
-\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-#endif /* !Py_STRUCTMEMBER_H */\r