summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-03-20 03:25:38 (GMT)
committerGitHub <noreply@github.com>2019-03-20 03:25:38 (GMT)
commitfa1537684869186da7938e4330361bf02363bac8 (patch)
tree919f5d59429afe03b6bbfd24b0f289018a8a254e /Include
parentabbdd1fc5c2017683da8d2ed3e8843e8c159bc8c (diff)
downloadcpython-fa1537684869186da7938e4330361bf02363bac8.zip
cpython-fa1537684869186da7938e4330361bf02363bac8.tar.gz
cpython-fa1537684869186da7938e4330361bf02363bac8.tar.bz2
bpo-36301: Add _PyPreCmdline internal API (GH-12458)
_PyCoreConfig_ReadFromArgv() now reuses the code parsing command line options from preconfig.c.
Diffstat (limited to 'Include')
-rw-r--r--Include/internal/pycore_coreconfig.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/Include/internal/pycore_coreconfig.h b/Include/internal/pycore_coreconfig.h
index 8c5a072..29261df 100644
--- a/Include/internal/pycore_coreconfig.h
+++ b/Include/internal/pycore_coreconfig.h
@@ -9,6 +9,30 @@ extern "C" {
#endif
+/* --- _PyPreCmdline ------------------------------------------------- */
+
+typedef struct {
+ _PyWstrList argv;
+ _PyWstrList xoptions; /* "-X value" option */
+ int use_environment; /* -E option */
+ int isolated; /* -I option */
+} _PyPreCmdline;
+
+#define _PyPreCmdline_INIT \
+ (_PyPreCmdline){ \
+ .use_environment = -1, \
+ .isolated = -1}
+/* Note: _PyPreCmdline_INIT sets other fields to 0/NULL */
+
+PyAPI_FUNC(void) _PyPreCmdline_Clear(_PyPreCmdline *cmdline);
+PyAPI_FUNC(_PyInitError) _PyPreCmdline_Init(_PyPreCmdline *cmdline,
+ const _PyArgv *args);
+PyAPI_FUNC(_PyInitError) _PyPreCmdline_Read(_PyPreCmdline *cmdline);
+PyAPI_FUNC(void) _PyPreCmdline_SetPreConfig(
+ const _PyPreCmdline *cmdline,
+ _PyPreConfig *config);
+
+
/* --- _PyWstrList ------------------------------------------------ */
#ifndef NDEBUG