structmember.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef Py_STRUCTMEMBER_H
  2. #define Py_STRUCTMEMBER_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. /* Interface to map C struct members to Python object attributes
  7. *
  8. * This header is deprecated: new code should not use stuff from here.
  9. * New definitions are in descrobject.h.
  10. *
  11. * However, there's nothing wrong with old code continuing to use it,
  12. * and there's not much mainenance overhead in maintaining a few aliases.
  13. * So, don't be too eager to convert old code.
  14. *
  15. * It uses names not prefixed with Py_.
  16. * It is also *not* included from Python.h and must be included individually.
  17. */
  18. #include <stddef.h> /* For offsetof (not always provided by Python.h) */
  19. /* Types */
  20. #define T_SHORT Py_T_SHORT
  21. #define T_INT Py_T_INT
  22. #define T_LONG Py_T_LONG
  23. #define T_FLOAT Py_T_FLOAT
  24. #define T_DOUBLE Py_T_DOUBLE
  25. #define T_STRING Py_T_STRING
  26. #define T_OBJECT _Py_T_OBJECT
  27. #define T_CHAR Py_T_CHAR
  28. #define T_BYTE Py_T_BYTE
  29. #define T_UBYTE Py_T_UBYTE
  30. #define T_USHORT Py_T_USHORT
  31. #define T_UINT Py_T_UINT
  32. #define T_ULONG Py_T_ULONG
  33. #define T_STRING_INPLACE Py_T_STRING_INPLACE
  34. #define T_BOOL Py_T_BOOL
  35. #define T_OBJECT_EX Py_T_OBJECT_EX
  36. #define T_LONGLONG Py_T_LONGLONG
  37. #define T_ULONGLONG Py_T_ULONGLONG
  38. #define T_PYSSIZET Py_T_PYSSIZET
  39. #define T_NONE _Py_T_NONE
  40. /* Flags */
  41. #define READONLY Py_READONLY
  42. #define PY_AUDIT_READ Py_AUDIT_READ
  43. #define READ_RESTRICTED Py_AUDIT_READ
  44. #define PY_WRITE_RESTRICTED _Py_WRITE_RESTRICTED
  45. #define RESTRICTED (READ_RESTRICTED | PY_WRITE_RESTRICTED)
  46. #ifdef __cplusplus
  47. }
  48. #endif
  49. #endif /* !Py_STRUCTMEMBER_H */