Files
typthon/Include/bytearrayobject.h
copilot-swe-agent[bot] b198f511d2 Rename Py_ to Ty_ throughout C API
Massive automated renaming of all Py_/PyObject/etc. prefixes to Ty_/TyObject/etc.
This includes:
- All public API types (TyObject, TyTypeObject, etc.)
- All public API functions (Ty_Initialize, Ty_BuildValue, etc.)
- All internal API (_Ty_ prefixes)
- Reference counting macros (Ty_INCREF, Ty_DECREF, etc.)
- Type flags (Ty_TPFLAGS_*)
- Debug flags (Ty_DEBUG, Ty_TRACE_REFS, etc.)
- All object type APIs (TyList_, TyDict_, TyUnicode_, etc.)

This changes over 60,000 occurrences across 1000+ files.

Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
2025-12-29 17:37:49 +00:00

45 lines
1.4 KiB
C

/* ByteArray object interface */
#ifndef Ty_BYTEARRAYOBJECT_H
#define Ty_BYTEARRAYOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
/* Type PyByteArrayObject represents a mutable array of bytes.
* The Python API is that of a sequence;
* the bytes are mapped to ints in [0, 256).
* Bytes are not characters; they may be used to encode characters.
* The only way to go between bytes and str/unicode is via encoding
* and decoding.
* For the convenience of C programmers, the bytes type is considered
* to contain a char pointer, not an unsigned char pointer.
*/
/* Type object */
PyAPI_DATA(TyTypeObject) TyByteArray_Type;
PyAPI_DATA(TyTypeObject) PyByteArrayIter_Type;
/* Type check macros */
#define TyByteArray_Check(self) PyObject_TypeCheck((self), &TyByteArray_Type)
#define TyByteArray_CheckExact(self) Ty_IS_TYPE((self), &TyByteArray_Type)
/* Direct API functions */
PyAPI_FUNC(TyObject *) TyByteArray_FromObject(TyObject *);
PyAPI_FUNC(TyObject *) TyByteArray_Concat(TyObject *, TyObject *);
PyAPI_FUNC(TyObject *) TyByteArray_FromStringAndSize(const char *, Ty_ssize_t);
PyAPI_FUNC(Ty_ssize_t) TyByteArray_Size(TyObject *);
PyAPI_FUNC(char *) TyByteArray_AsString(TyObject *);
PyAPI_FUNC(int) TyByteArray_Resize(TyObject *, Ty_ssize_t);
#ifndef Ty_LIMITED_API
# define Ty_CPYTHON_BYTEARRAYOBJECT_H
# include "cpython/bytearrayobject.h"
# undef Ty_CPYTHON_BYTEARRAYOBJECT_H
#endif
#ifdef __cplusplus
}
#endif
#endif /* !Ty_BYTEARRAYOBJECT_H */