summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-12-01 17:27:09 (GMT)
committerGitHub <noreply@github.com>2017-12-01 17:27:09 (GMT)
commitb64de46aae148cfab0980e0ad478da7aafc44900 (patch)
tree08df481be4201aeb0c8875c115168d4c4e055140 /Include
parent8f5c28b19374df47ebe3d665e54c1dda5c2d7dca (diff)
downloadcpython-b64de46aae148cfab0980e0ad478da7aafc44900.zip
cpython-b64de46aae148cfab0980e0ad478da7aafc44900.tar.gz
cpython-b64de46aae148cfab0980e0ad478da7aafc44900.tar.bz2
bpo-32030: Cleanup "path config" code (#4663)
* Rename PyPathConfig structure to _PyPathConfig and move it to Include/internal/pystate.h * Rename path_config to _Py_path_config * _PyPathConfig: Rename program_name field to program_full_path * Add assert(str != NULL); to _PyMem_RawWcsdup(), _PyMem_RawStrdup() and _PyMem_Strdup(). * Rename calculate_path() to pathconfig_global_init(). The function now does nothing if it's already initiallized.
Diffstat (limited to 'Include')
-rw-r--r--Include/internal/pystate.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/Include/internal/pystate.h b/Include/internal/pystate.h
index 7056e10..50ad2fc 100644
--- a/Include/internal/pystate.h
+++ b/Include/internal/pystate.h
@@ -37,6 +37,22 @@ struct _gilstate_runtime_state {
#define _PyGILState_check_enabled _PyRuntime.gilstate.check_enabled
+typedef struct {
+ /* Full path to the Python program */
+ wchar_t *program_full_path;
+ wchar_t *prefix;
+#ifdef MS_WINDOWS
+ wchar_t *dll_path;
+#else
+ wchar_t *exec_prefix;
+#endif
+ /* Set by Py_SetPath(), or computed by _PyPathConfig_Init() */
+ wchar_t *module_search_path;
+} _PyPathConfig;
+
+#define _PyPathConfig_INIT {.module_search_path = NULL}
+
+
/* Full Python runtime state */
typedef struct pyruntimestate {