| 1 |
|
| 2 |
|
| 3 |
#ifndef Py_BYTEARRAYOBJECT_H |
| 4 |
#define Py_BYTEARRAYOBJECT_H |
| 5 |
#ifdef __cplusplus |
| 6 |
extern "C" { |
| 7 |
#endif |
| 8 |
|
| 9 |
#include <stdarg.h> |
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
typedef struct { |
| 23 |
PyObject_VAR_HEAD |
| 24 |
|
| 25 |
int ob_exports; |
| 26 |
Py_ssize_t ob_alloc; |
| 27 |
char *ob_bytes; |
| 28 |
} PyByteArrayObject; |
| 29 |
|
| 30 |
|
| 31 |
PyAPI_DATA(PyTypeObject) PyByteArray_Type; |
| 32 |
PyAPI_DATA(PyTypeObject) PyByteArrayIter_Type; |
| 33 |
|
| 34 |
|
| 35 |
#define PyByteArray_Check(self) PyObject_TypeCheck(self, &PyByteArray_Type) |
| 36 |
#define PyByteArray_CheckExact(self) (Py_TYPE(self) == &PyByteArray_Type) |
| 37 |
|
| 38 |
|
| 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); |
| 45 |
|
| 46 |
|
| 47 |
#define PyByteArray_AS_STRING(self) \ |
| 48 |
(assert(PyByteArray_Check(self)), \ |
| 49 |
Py_SIZE(self) ? ((PyByteArrayObject *)(self))->ob_bytes : _PyByteArray_empty_string) |
| 50 |
#define PyByteArray_GET_SIZE(self) (assert(PyByteArray_Check(self)),Py_SIZE(self)) |
| 51 |
|
| 52 |
PyAPI_DATA(char) _PyByteArray_empty_string[]; |
| 53 |
|
| 54 |
#ifdef __cplusplus |
| 55 |
} |
| 56 |
#endif |
| 57 |
#endif |