annotate DEPENDENCIES/mingw32/Python27/include/bytearrayobject.h @ 118:770eb830ec19 emscripten

Typo fix
author Chris Cannam
date Wed, 18 May 2016 16:14:08 +0100
parents 2a2c65a20a8b
children
rev   line source
Chris@87 1 /* ByteArray object interface */
Chris@87 2
Chris@87 3 #ifndef Py_BYTEARRAYOBJECT_H
Chris@87 4 #define Py_BYTEARRAYOBJECT_H
Chris@87 5 #ifdef __cplusplus
Chris@87 6 extern "C" {
Chris@87 7 #endif
Chris@87 8
Chris@87 9 #include <stdarg.h>
Chris@87 10
Chris@87 11 /* Type PyByteArrayObject represents a mutable array of bytes.
Chris@87 12 * The Python API is that of a sequence;
Chris@87 13 * the bytes are mapped to ints in [0, 256).
Chris@87 14 * Bytes are not characters; they may be used to encode characters.
Chris@87 15 * The only way to go between bytes and str/unicode is via encoding
Chris@87 16 * and decoding.
Chris@87 17 * For the convenience of C programmers, the bytes type is considered
Chris@87 18 * to contain a char pointer, not an unsigned char pointer.
Chris@87 19 */
Chris@87 20
Chris@87 21 /* Object layout */
Chris@87 22 typedef struct {
Chris@87 23 PyObject_VAR_HEAD
Chris@87 24 /* XXX(nnorwitz): should ob_exports be Py_ssize_t? */
Chris@87 25 int ob_exports; /* how many buffer exports */
Chris@87 26 Py_ssize_t ob_alloc; /* How many bytes allocated */
Chris@87 27 char *ob_bytes;
Chris@87 28 } PyByteArrayObject;
Chris@87 29
Chris@87 30 /* Type object */
Chris@87 31 PyAPI_DATA(PyTypeObject) PyByteArray_Type;
Chris@87 32 PyAPI_DATA(PyTypeObject) PyByteArrayIter_Type;
Chris@87 33
Chris@87 34 /* Type check macros */
Chris@87 35 #define PyByteArray_Check(self) PyObject_TypeCheck(self, &PyByteArray_Type)
Chris@87 36 #define PyByteArray_CheckExact(self) (Py_TYPE(self) == &PyByteArray_Type)
Chris@87 37
Chris@87 38 /* Direct API functions */
Chris@87 39 PyAPI_FUNC(PyObject *) PyByteArray_FromObject(PyObject *);
Chris@87 40 PyAPI_FUNC(PyObject *) PyByteArray_Concat(PyObject *, PyObject *);
Chris@87 41 PyAPI_FUNC(PyObject *) PyByteArray_FromStringAndSize(const char *, Py_ssize_t);
Chris@87 42 PyAPI_FUNC(Py_ssize_t) PyByteArray_Size(PyObject *);
Chris@87 43 PyAPI_FUNC(char *) PyByteArray_AsString(PyObject *);
Chris@87 44 PyAPI_FUNC(int) PyByteArray_Resize(PyObject *, Py_ssize_t);
Chris@87 45
Chris@87 46 /* Macros, trading safety for speed */
Chris@87 47 #define PyByteArray_AS_STRING(self) \
Chris@87 48 (assert(PyByteArray_Check(self)), \
Chris@87 49 Py_SIZE(self) ? ((PyByteArrayObject *)(self))->ob_bytes : _PyByteArray_empty_string)
Chris@87 50 #define PyByteArray_GET_SIZE(self) (assert(PyByteArray_Check(self)),Py_SIZE(self))
Chris@87 51
Chris@87 52 PyAPI_DATA(char) _PyByteArray_empty_string[];
Chris@87 53
Chris@87 54 #ifdef __cplusplus
Chris@87 55 }
Chris@87 56 #endif
Chris@87 57 #endif /* !Py_BYTEARRAYOBJECT_H */