@@ -27,6 +27,7 @@ functions should be applied to nil objects.
2727/* Caching the hash (ob_shash) saves recalculation of a string's hash value.
2828 This significantly speeds up dict lookups. */
2929
30+ #ifndef Py_LIMITED_API
3031typedef struct {
3132 PyObject_VAR_HEAD
3233 Py_hash_t ob_shash ;
@@ -38,6 +39,7 @@ typedef struct {
3839 * ob_shash is the hash of the string or -1 if not computed yet.
3940 */
4041} PyBytesObject ;
42+ #endif
4143
4244PyAPI_DATA (PyTypeObject ) PyBytes_Type ;
4345PyAPI_DATA (PyTypeObject ) PyBytesIter_Type ;
@@ -58,21 +60,27 @@ PyAPI_FUNC(char *) PyBytes_AsString(PyObject *);
5860PyAPI_FUNC (PyObject * ) PyBytes_Repr (PyObject * , int );
5961PyAPI_FUNC (void ) PyBytes_Concat (PyObject * * , PyObject * );
6062PyAPI_FUNC (void ) PyBytes_ConcatAndDel (PyObject * * , PyObject * );
63+ #ifndef Py_LIMITED_API
6164PyAPI_FUNC (int ) _PyBytes_Resize (PyObject * * , Py_ssize_t );
6265PyAPI_FUNC (PyObject * ) _PyBytes_FormatLong (PyObject * , int , int ,
6366 int , char * * , int * );
67+ #endif
6468PyAPI_FUNC (PyObject * ) PyBytes_DecodeEscape (const char * , Py_ssize_t ,
6569 const char * , Py_ssize_t ,
6670 const char * );
6771
6872/* Macro, trading safety for speed */
73+ #ifndef Py_LIMITED_API
6974#define PyBytes_AS_STRING (op ) (assert(PyBytes_Check(op)), \
7075 (((PyBytesObject *)(op))->ob_sval))
7176#define PyBytes_GET_SIZE (op ) (assert(PyBytes_Check(op)),Py_SIZE(op))
77+ #endif
7278
7379/* _PyBytes_Join(sep, x) is like sep.join(x). sep must be PyBytesObject*,
7480 x must be an iterable object. */
81+ #ifndef Py_LIMITED_API
7582PyAPI_FUNC (PyObject * ) _PyBytes_Join (PyObject * sep , PyObject * x );
83+ #endif
7684
7785/* Provides access to the internal data buffer and size of a string
7886 object or the default encoded version of an Unicode object. Passing
@@ -90,7 +98,7 @@ PyAPI_FUNC(int) PyBytes_AsStringAndSize(
9098/* Using the current locale, insert the thousands grouping
9199 into the string pointed to by buffer. For the argument descriptions,
92100 see Objects/stringlib/localeutil.h */
93-
101+ #ifndef Py_LIMITED_API
94102PyAPI_FUNC (Py_ssize_t ) _PyBytes_InsertThousandsGroupingLocale (char * buffer ,
95103 Py_ssize_t n_buffer ,
96104 char * digits ,
@@ -107,6 +115,7 @@ PyAPI_FUNC(Py_ssize_t) _PyBytes_InsertThousandsGrouping(char *buffer,
107115 Py_ssize_t min_width ,
108116 const char * grouping ,
109117 const char * thousands_sep );
118+ #endif
110119
111120/* Flags used by string formatting */
112121#define F_LJUST (1<<0)
0 commit comments