@@ -8,7 +8,7 @@ extern "C" {
88
99#include <stdarg.h>
1010
11- /* Type PyBytesObject represents a mutable array of bytes.
11+ /* Type PyByteArrayObject represents a mutable array of bytes.
1212 * The Python API is that of a sequence;
1313 * the bytes are mapped to ints in [0, 256).
1414 * Bytes are not characters; they may be used to encode characters.
@@ -25,27 +25,27 @@ typedef struct {
2525 int ob_exports ; /* how many buffer exports */
2626 Py_ssize_t ob_alloc ; /* How many bytes allocated */
2727 char * ob_bytes ;
28- } PyBytesObject ;
28+ } PyByteArrayObject ;
2929
3030/* Type object */
31- PyAPI_DATA (PyTypeObject ) PyBytes_Type ;
32- PyAPI_DATA (PyTypeObject ) PyBytesIter_Type ;
31+ PyAPI_DATA (PyTypeObject ) PyByteArray_Type ;
32+ PyAPI_DATA (PyTypeObject ) PyByteArrayIter_Type ;
3333
3434/* Type check macros */
35- #define PyBytes_Check (self ) PyObject_TypeCheck(self, &PyBytes_Type )
36- #define PyBytes_CheckExact (self ) (Py_TYPE(self) == &PyBytes_Type )
35+ #define PyByteArray_Check (self ) PyObject_TypeCheck(self, &PyByteArray_Type )
36+ #define PyByteArray_CheckExact (self ) (Py_TYPE(self) == &PyByteArray_Type )
3737
3838/* Direct API functions */
39- PyAPI_FUNC (PyObject * ) PyBytes_FromObject (PyObject * );
40- PyAPI_FUNC (PyObject * ) PyBytes_Concat (PyObject * , PyObject * );
41- PyAPI_FUNC (PyObject * ) PyBytes_FromStringAndSize (const char * , Py_ssize_t );
42- PyAPI_FUNC (Py_ssize_t ) PyBytes_Size (PyObject * );
43- PyAPI_FUNC (char * ) PyBytes_AsString (PyObject * );
44- PyAPI_FUNC (int ) PyBytes_Resize (PyObject * , Py_ssize_t );
39+ PyAPI_FUNC (PyObject * ) PyByteArray_FromObject (PyObject * );
40+ PyAPI_FUNC (PyObject * ) PyByteArray_Concat (PyObject * , PyObject * );
41+ PyAPI_FUNC (PyObject * ) PyByteArray_FromStringAndSize (const char * , Py_ssize_t );
42+ PyAPI_FUNC (Py_ssize_t ) PyByteArray_Size (PyObject * );
43+ PyAPI_FUNC (char * ) PyByteArray_AsString (PyObject * );
44+ PyAPI_FUNC (int ) PyByteArray_Resize (PyObject * , Py_ssize_t );
4545
4646/* Macros, trading safety for speed */
47- #define PyBytes_AS_STRING (self ) (assert(PyBytes_Check (self)),((PyBytesObject *)(self))->ob_bytes)
48- #define PyBytes_GET_SIZE (self ) (assert(PyBytes_Check (self)),Py_SIZE(self))
47+ #define PyByteArray_AS_STRING (self ) (assert(PyByteArray_Check (self)),((PyByteArrayObject *)(self))->ob_bytes)
48+ #define PyByteArray_GET_SIZE (self ) (assert(PyByteArray_Check (self)),Py_SIZE(self))
4949
5050#ifdef __cplusplus
5151}
0 commit comments