summaryrefslogtreecommitdiffstats
path: root/Include/cpython
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2021-10-15 00:39:58 (GMT)
committerGitHub <noreply@github.com>2021-10-15 00:39:58 (GMT)
commit77b24ba505744532d7cfd721b1c92d205e145180 (patch)
tree5d4ce2941123f8da62efe2f20d4be69cf97c40bc /Include/cpython
parent37b1d607bf0f1a9c1e89b1715349efc24dc180e0 (diff)
downloadcpython-77b24ba505744532d7cfd721b1c92d205e145180.zip
cpython-77b24ba505744532d7cfd721b1c92d205e145180.tar.gz
cpython-77b24ba505744532d7cfd721b1c92d205e145180.tar.bz2
bpo-35134: Move Include/cellobject.h to Include/cpython/ (GH-28964)
Diffstat (limited to 'Include/cpython')
-rw-r--r--Include/cpython/cellobject.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/Include/cpython/cellobject.h b/Include/cpython/cellobject.h
new file mode 100644
index 0000000..8dc7b8f
--- /dev/null
+++ b/Include/cpython/cellobject.h
@@ -0,0 +1,31 @@
+/* Cell object interface */
+
+#ifndef Py_LIMITED_API
+#ifndef Py_CELLOBJECT_H
+#define Py_CELLOBJECT_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct {
+ PyObject_HEAD
+ /* Content of the cell or NULL when empty */
+ PyObject *ob_ref;
+} PyCellObject;
+
+PyAPI_DATA(PyTypeObject) PyCell_Type;
+
+#define PyCell_Check(op) Py_IS_TYPE(op, &PyCell_Type)
+
+PyAPI_FUNC(PyObject *) PyCell_New(PyObject *);
+PyAPI_FUNC(PyObject *) PyCell_Get(PyObject *);
+PyAPI_FUNC(int) PyCell_Set(PyObject *, PyObject *);
+
+#define PyCell_GET(op) (((PyCellObject *)(op))->ob_ref)
+#define PyCell_SET(op, v) ((void)(((PyCellObject *)(op))->ob_ref = v))
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* !Py_TUPLEOBJECT_H */
+#endif /* Py_LIMITED_API */