mirror of
https://github.com/johndoe6345789/typthon.git
synced 2026-04-25 14:15:29 +00:00
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>
47 lines
1.6 KiB
C
47 lines
1.6 KiB
C
/* Tuple object interface */
|
|
|
|
#ifndef Ty_TUPLEOBJECT_H
|
|
#define Ty_TUPLEOBJECT_H
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/*
|
|
Another generally useful object type is a tuple of object pointers.
|
|
For Python, this is an immutable type. C code can change the tuple items
|
|
(but not their number), and even use tuples as general-purpose arrays of
|
|
object references, but in general only brand new tuples should be mutated,
|
|
not ones that might already have been exposed to Python code.
|
|
|
|
*** WARNING *** TyTuple_SetItem does not increment the new item's reference
|
|
count, but does decrement the reference count of the item it replaces,
|
|
if not nil. It does *decrement* the reference count if it is *not*
|
|
inserted in the tuple. Similarly, TyTuple_GetItem does not increment the
|
|
returned item's reference count.
|
|
*/
|
|
|
|
PyAPI_DATA(TyTypeObject) TyTuple_Type;
|
|
PyAPI_DATA(TyTypeObject) PyTupleIter_Type;
|
|
|
|
#define TyTuple_Check(op) \
|
|
TyType_FastSubclass(Ty_TYPE(op), Ty_TPFLAGS_TUPLE_SUBCLASS)
|
|
#define TyTuple_CheckExact(op) Ty_IS_TYPE((op), &TyTuple_Type)
|
|
|
|
PyAPI_FUNC(TyObject *) TyTuple_New(Ty_ssize_t size);
|
|
PyAPI_FUNC(Ty_ssize_t) TyTuple_Size(TyObject *);
|
|
PyAPI_FUNC(TyObject *) TyTuple_GetItem(TyObject *, Ty_ssize_t);
|
|
PyAPI_FUNC(int) TyTuple_SetItem(TyObject *, Ty_ssize_t, TyObject *);
|
|
PyAPI_FUNC(TyObject *) TyTuple_GetSlice(TyObject *, Ty_ssize_t, Ty_ssize_t);
|
|
PyAPI_FUNC(TyObject *) TyTuple_Pack(Ty_ssize_t, ...);
|
|
|
|
#ifndef Ty_LIMITED_API
|
|
# define Ty_CPYTHON_TUPLEOBJECT_H
|
|
# include "cpython/tupleobject.h"
|
|
# undef Ty_CPYTHON_TUPLEOBJECT_H
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif /* !Ty_TUPLEOBJECT_H */
|