Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-11-19 09:50:40

0001 #ifndef Py_CPYTHON_BYTESOBJECT_H
0002 #  error "this header file must not be included directly"
0003 #endif
0004 
0005 typedef struct {
0006     PyObject_VAR_HEAD
0007     Py_DEPRECATED(3.11) Py_hash_t ob_shash;
0008     char ob_sval[1];
0009 
0010     /* Invariants:
0011      *     ob_sval contains space for 'ob_size+1' elements.
0012      *     ob_sval[ob_size] == 0.
0013      *     ob_shash is the hash of the byte string or -1 if not computed yet.
0014      */
0015 } PyBytesObject;
0016 
0017 PyAPI_FUNC(int) _PyBytes_Resize(PyObject **, Py_ssize_t);
0018 
0019 /* Macros and static inline functions, trading safety for speed */
0020 #define _PyBytes_CAST(op) \
0021     (assert(PyBytes_Check(op)), _Py_CAST(PyBytesObject*, op))
0022 
0023 static inline char* PyBytes_AS_STRING(PyObject *op)
0024 {
0025     return _PyBytes_CAST(op)->ob_sval;
0026 }
0027 #define PyBytes_AS_STRING(op) PyBytes_AS_STRING(_PyObject_CAST(op))
0028 
0029 static inline Py_ssize_t PyBytes_GET_SIZE(PyObject *op) {
0030     PyBytesObject *self = _PyBytes_CAST(op);
0031     return Py_SIZE(self);
0032 }
0033 #define PyBytes_GET_SIZE(self) PyBytes_GET_SIZE(_PyObject_CAST(self))
0034 
0035 /* _PyBytes_Join(sep, x) is like sep.join(x).  sep must be PyBytesObject*,
0036    x must be an iterable object. */
0037 PyAPI_FUNC(PyObject*) _PyBytes_Join(PyObject *sep, PyObject *x);