summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2017-05-24 06:00:52 (GMT)
committerGitHub <noreply@github.com>2017-05-24 06:00:52 (GMT)
commitc7ec9985bbdbb2b073f2c37febd18268817da29a (patch)
tree4e3c90c24c8ec2aa0143949ab129d3d98258f9ef /Include
parent9e98cd0383d9e7f06c0537038a32459bf5efa97a (diff)
downloadcpython-c7ec9985bbdbb2b073f2c37febd18268817da29a.zip
cpython-c7ec9985bbdbb2b073f2c37febd18268817da29a.tar.gz
cpython-c7ec9985bbdbb2b073f2c37febd18268817da29a.tar.bz2
bpo-22257: Private C-API for main interpreter initialization (PEP 432). (#1729)
(patch by Nick Coghlan)
Diffstat (limited to 'Include')
-rw-r--r--Include/pylifecycle.h3
-rw-r--r--Include/pystate.h13
2 files changed, 15 insertions, 1 deletions
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 @@ PyAPI_FUNC(int) Py_SetStandardStreamEncoding(const char *encoding,
/* 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 @@ typedef struct {
#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 @@ typedef struct _is {
int fscodec_initialized;
_PyCoreConfig core_config;
+ _PyMainInterpreterConfig config;
#ifdef HAVE_DLOPEN
int dlopenflags;
#endif