Debian Codegraph @

pypy/module/cpyext/include/tupleobject.h

raw symbols SCIP
1
2 /* Tuple object interface */
3
4 #ifndef Py_TUPLEOBJECT_H
5 #define Py_TUPLEOBJECT_H
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
9
10 typedef struct {
11 PyObject_VAR_HEAD
12 PyObject *ob_item[1];
13 /* ob_item contains space for 'ob_size' elements.
14 * Items must normally not be NULL, except during construction when
15 * the tuple is not yet visible outside the function that builds it.
16 */
17 } PyTupleObject;
18
19 PyAPI_FUNC(PyObject *) PyTuple_New(Py_ssize_t size);
20 PyAPI_FUNC(void) _PyPy_tuple_dealloc(PyObject *);
21 PyAPI_FUNC(PyObject *) _PyPy_tuple_new(PyTypeObject *type, PyObject *args, PyObject *kwds);
22
23 /* defined in varargswrapper.c */
24 PyAPI_FUNC(PyObject *) PyTuple_Pack(Py_ssize_t, ...);
25
26
27 /* Macro, trading safety for speed */
28 #define PyTuple_GET_ITEM(op, i) (((PyTupleObject *)(op))->ob_item[i])
29 #define PyTuple_GET_SIZE(op) Py_SIZE(op)
30
31 /* Macro, *only* to be used to fill in brand new tuples */
32 #define PyTuple_SET_ITEM(op, i, v) (((PyTupleObject *)(op))->ob_item[i] = v)
33
34 #define PyTuple_Check(op) \
35 PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_TUPLE_SUBCLASS)
36 #define PyTuple_CheckExact(op) (Py_TYPE(op) == &PyTuple_Type)
37
38 #define _PyTuple_CAST(op) (assert(PyTuple_Check(op)), (PyTupleObject *)(op))
39
40
41 #ifdef __cplusplus
42 }
43 #endif
44 #endif /* !Py_TUPLEOBJECT_H */