File indexing completed on 2025-01-18 10:06:48
0001
0002
0003
0004 #ifndef Py_BYTESOBJECT_H
0005 #define Py_BYTESOBJECT_H
0006 #ifdef __cplusplus
0007 extern "C" {
0008 #endif
0009
0010 #include <stdarg.h> // va_list
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027 PyAPI_DATA(PyTypeObject) PyBytes_Type;
0028 PyAPI_DATA(PyTypeObject) PyBytesIter_Type;
0029
0030 #define PyBytes_Check(op) \
0031 PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_BYTES_SUBCLASS)
0032 #define PyBytes_CheckExact(op) Py_IS_TYPE((op), &PyBytes_Type)
0033
0034 PyAPI_FUNC(PyObject *) PyBytes_FromStringAndSize(const char *, Py_ssize_t);
0035 PyAPI_FUNC(PyObject *) PyBytes_FromString(const char *);
0036 PyAPI_FUNC(PyObject *) PyBytes_FromObject(PyObject *);
0037 PyAPI_FUNC(PyObject *) PyBytes_FromFormatV(const char*, va_list)
0038 Py_GCC_ATTRIBUTE((format(printf, 1, 0)));
0039 PyAPI_FUNC(PyObject *) PyBytes_FromFormat(const char*, ...)
0040 Py_GCC_ATTRIBUTE((format(printf, 1, 2)));
0041 PyAPI_FUNC(Py_ssize_t) PyBytes_Size(PyObject *);
0042 PyAPI_FUNC(char *) PyBytes_AsString(PyObject *);
0043 PyAPI_FUNC(PyObject *) PyBytes_Repr(PyObject *, int);
0044 PyAPI_FUNC(void) PyBytes_Concat(PyObject **, PyObject *);
0045 PyAPI_FUNC(void) PyBytes_ConcatAndDel(PyObject **, PyObject *);
0046 PyAPI_FUNC(PyObject *) PyBytes_DecodeEscape(const char *, Py_ssize_t,
0047 const char *, Py_ssize_t,
0048 const char *);
0049
0050
0051
0052
0053
0054 PyAPI_FUNC(int) PyBytes_AsStringAndSize(
0055 PyObject *obj,
0056 char **s,
0057 Py_ssize_t *len
0058 );
0059
0060 #ifndef Py_LIMITED_API
0061 # define Py_CPYTHON_BYTESOBJECT_H
0062 # include "cpython/bytesobject.h"
0063 # undef Py_CPYTHON_BYTESOBJECT_H
0064 #endif
0065
0066 #ifdef __cplusplus
0067 }
0068 #endif
0069 #endif