bytearrayobject.h 769 B

1234567891011121314151617181920
  1. #ifndef Py_CPYTHON_BYTEARRAYOBJECT_H
  2. # error "this header file must not be included directly"
  3. #endif
  4. /* Object layout */
  5. typedef struct {
  6. PyObject_VAR_HEAD
  7. Py_ssize_t ob_alloc; /* How many bytes allocated in ob_bytes */
  8. char *ob_bytes; /* Physical backing buffer */
  9. char *ob_start; /* Logical start inside ob_bytes */
  10. Py_ssize_t ob_exports; /* How many buffer exports */
  11. } PyByteArrayObject;
  12. /* Macros, trading safety for speed */
  13. #define PyByteArray_AS_STRING(self) \
  14. (assert(PyByteArray_Check(self)), \
  15. Py_SIZE(self) ? ((PyByteArrayObject *)(self))->ob_start : _PyByteArray_empty_string)
  16. #define PyByteArray_GET_SIZE(self) (assert(PyByteArray_Check(self)), Py_SIZE(self))
  17. PyAPI_DATA(char) _PyByteArray_empty_string[];