summaryrefslogtreecommitdiffstats
path: root/Include/internal
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-02-25 15:07:14 (GMT)
committerGitHub <noreply@github.com>2022-02-25 15:07:14 (GMT)
commit8f2a337a80a283c66e1a4252839792fa229d2763 (patch)
tree0497a8e2db3ceeb7e5a4960a38dcf2c7310bfdd1 /Include/internal
parent26aba295a9c1bcb0812fe44bd7e68ddd1d8a6828 (diff)
downloadcpython-8f2a337a80a283c66e1a4252839792fa229d2763.zip
cpython-8f2a337a80a283c66e1a4252839792fa229d2763.tar.gz
cpython-8f2a337a80a283c66e1a4252839792fa229d2763.tar.bz2
bpo-45316: Move private functions to internal C API (GH-31579)
Move the unexported private functions to the internal C API: * pycore_frame.h: _PyFrame_New_NoTrack() * pycore_function.h: _PyFunction_GetVersionForCurrentState() * pycore_genobject.h: _PyAsyncGenValueWrapperNew() * pycore_genobject.h: _PyCoro_GetAwaitableIter() * pycore_genobject.h: _PyGen_yf()
Diffstat (limited to 'Include/internal')
-rw-r--r--Include/internal/pycore_frame.h2
-rw-r--r--Include/internal/pycore_function.h15
-rw-r--r--Include/internal/pycore_genobject.h3
3 files changed, 16 insertions, 4 deletions
diff --git a/Include/internal/pycore_frame.h b/Include/internal/pycore_frame.h
index 09d4122..f8b8e00 100644
--- a/Include/internal/pycore_frame.h
+++ b/Include/internal/pycore_frame.h
@@ -19,6 +19,8 @@ struct _frame {
PyObject *_f_frame_data[1];
};
+extern PyFrameObject* _PyFrame_New_NoTrack(PyCodeObject *code);
+
/* runtime lifecycle */
extern void _PyFrame_Fini(PyInterpreterState *interp);
diff --git a/Include/internal/pycore_function.h b/Include/internal/pycore_function.h
index dc4422d..1c87aa3 100644
--- a/Include/internal/pycore_function.h
+++ b/Include/internal/pycore_function.h
@@ -1,11 +1,18 @@
#ifndef Py_INTERNAL_FUNCTION_H
#define Py_INTERNAL_FUNCTION_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifndef Py_BUILD_CORE
+# error "this header requires Py_BUILD_CORE define"
+#endif
-#include "Python.h"
-
-PyFunctionObject *
-_PyFunction_FromConstructor(PyFrameConstructor *constr);
+extern PyFunctionObject* _PyFunction_FromConstructor(PyFrameConstructor *constr);
+extern uint32_t _PyFunction_GetVersionForCurrentState(PyFunctionObject *func);
+#ifdef __cplusplus
+}
+#endif
#endif /* !Py_INTERNAL_FUNCTION_H */
diff --git a/Include/internal/pycore_genobject.h b/Include/internal/pycore_genobject.h
index 74a676d..42db0d8 100644
--- a/Include/internal/pycore_genobject.h
+++ b/Include/internal/pycore_genobject.h
@@ -8,6 +8,9 @@ extern "C" {
# error "this header requires Py_BUILD_CORE define"
#endif
+extern PyObject *_PyGen_yf(PyGenObject *);
+extern PyObject *_PyCoro_GetAwaitableIter(PyObject *o);
+extern PyObject *_PyAsyncGenValueWrapperNew(PyObject *);
/* runtime lifecycle */