bytearrayobject.h 949 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /* ByteArray object interface */
  2. #ifndef Py_BYTEARRAYOBJECT_H
  3. #define Py_BYTEARRAYOBJECT_H
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. #include <stdarg.h>
  8. /* Type PyByteArrayObject represents a mutable array of bytes.
  9. * The Python API is that of a sequence;
  10. * the bytes are mapped to ints in [0, 256).
  11. * Bytes are not characters; they may be used to encode characters.
  12. * The only way to go between bytes and str/unicode is via encoding
  13. * and decoding.
  14. * While CPython exposes interfaces to this object, pypy does not
  15. */
  16. #define PyByteArray_GET_SIZE(op) PyByteArray_Size((PyObject*)(op))
  17. #define PyByteArray_AS_STRING(op) PyByteArray_AsString((PyObject*)(op))
  18. /* Object layout */
  19. typedef struct {
  20. PyObject_VAR_HEAD
  21. #if 0
  22. int ob_exports; /* how many buffer exports */
  23. Py_ssize_t ob_alloc; /* How many bytes allocated */
  24. char *ob_bytes;
  25. #endif
  26. } PyByteArrayObject;
  27. #ifdef __cplusplus
  28. }
  29. #endif
  30. #endif /* !Py_BYTEARRAYOBJECT_H */