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