bpo-22257: Private C-API for main interpreter initialization (PEP 432). (#1729)
(patch by Nick Coghlan)
diff --git a/Include/pylifecycle.h b/Include/pylifecycle.h
index f1a19c1..0d609ec 100644
--- a/Include/pylifecycle.h
+++ b/Include/pylifecycle.h
@@ -23,7 +23,8 @@
/* PEP 432 Multi-phase initialization API (Private while provisional!) */
PyAPI_FUNC(void) _Py_InitializeCore(const _PyCoreConfig *);
PyAPI_FUNC(int) _Py_IsCoreInitialized(void);
-PyAPI_FUNC(int) _Py_InitializeMainInterpreter(int install_sigs);
+PyAPI_FUNC(int) _Py_ReadMainInterpreterConfig(_PyMainInterpreterConfig *);
+PyAPI_FUNC(int) _Py_InitializeMainInterpreter(const _PyMainInterpreterConfig *);
#endif
/* Initialization and finalization */
diff --git a/Include/pystate.h b/Include/pystate.h
index 13e4d73..a58ae3d 100644
--- a/Include/pystate.h
+++ b/Include/pystate.h
@@ -33,6 +33,18 @@
#define _PyCoreConfig_INIT {0, -1, 0, 0}
+/* Placeholders while working on the new configuration API
+ *
+ * See PEP 432 for final anticipated contents
+ *
+ * For the moment, just handle the args to _Py_InitializeEx
+ */
+typedef struct {
+ int install_signal_handlers;
+} _PyMainInterpreterConfig;
+
+#define _PyMainInterpreterConfig_INIT {-1}
+
typedef struct _is {
struct _is *next;
@@ -53,6 +65,7 @@
int fscodec_initialized;
_PyCoreConfig core_config;
+ _PyMainInterpreterConfig config;
#ifdef HAVE_DLOPEN
int dlopenflags;
#endif