mirror of
https://github.com/johndoe6345789/typthon.git
synced 2026-04-26 06:35:15 +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>
51 lines
1.2 KiB
C
51 lines
1.2 KiB
C
/* Cell object interface */
|
|
|
|
#ifndef Ty_LIMITED_API
|
|
#ifndef Ty_CELLOBJECT_H
|
|
#define Ty_CELLOBJECT_H
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef struct {
|
|
PyObject_HEAD
|
|
/* Content of the cell or NULL when empty */
|
|
TyObject *ob_ref;
|
|
} PyCellObject;
|
|
|
|
PyAPI_DATA(TyTypeObject) TyCell_Type;
|
|
|
|
#define TyCell_Check(op) Ty_IS_TYPE((op), &TyCell_Type)
|
|
|
|
PyAPI_FUNC(TyObject *) TyCell_New(TyObject *);
|
|
PyAPI_FUNC(TyObject *) TyCell_Get(TyObject *);
|
|
PyAPI_FUNC(int) TyCell_Set(TyObject *, TyObject *);
|
|
|
|
static inline TyObject* TyCell_GET(TyObject *op) {
|
|
TyObject *res;
|
|
PyCellObject *cell;
|
|
assert(TyCell_Check(op));
|
|
cell = _Ty_CAST(PyCellObject*, op);
|
|
Ty_BEGIN_CRITICAL_SECTION(cell);
|
|
res = cell->ob_ref;
|
|
Ty_END_CRITICAL_SECTION();
|
|
return res;
|
|
}
|
|
#define TyCell_GET(op) TyCell_GET(_TyObject_CAST(op))
|
|
|
|
static inline void TyCell_SET(TyObject *op, TyObject *value) {
|
|
PyCellObject *cell;
|
|
assert(TyCell_Check(op));
|
|
cell = _Ty_CAST(PyCellObject*, op);
|
|
Ty_BEGIN_CRITICAL_SECTION(cell);
|
|
cell->ob_ref = value;
|
|
Ty_END_CRITICAL_SECTION();
|
|
}
|
|
#define TyCell_SET(op, value) TyCell_SET(_TyObject_CAST(op), (value))
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif /* !Ty_TUPLEOBJECT_H */
|
|
#endif /* Ty_LIMITED_API */
|