◐ Shell
reader mode source ↗
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
22 changes: 18 additions & 4 deletions Include/cpython/coreconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ typedef struct {
int _config_version; /* Internal configuration version,
used for ABI compatibility */

/* If greater than 0, enable isolated mode: sys.path contains
neither the script's directory nor the user's site-packages directory.

Expand Down Expand Up @@ -111,8 +115,9 @@ typedef struct {

int dev_mode; /* Development mode. PYTHONDEVMODE, -X dev */

/* Memory allocator: PYTHONMALLOC env var */
PyMemAllocatorName allocator;
} _PyPreConfig;

PyAPI_FUNC(void) _PyPreConfig_InitPythonConfig(_PyPreConfig *config);
@@ -121,9 +126,16 @@ PyAPI_FUNC(void) _PyPreConfig_InitIsolatedConfig(_PyPreConfig *config);

/* --- _PyCoreConfig ---------------------------------------------- */

typedef struct {
int _config_version; /* Internal configuration version,
used for ABI compatibility */

int isolated; /* Isolated mode? see _PyPreConfig.isolated */
int use_environment; /* Use environment variables? see _PyPreConfig.use_environment */
Expand Up @@ -401,19 +413,21 @@ PyAPI_FUNC(_PyInitError) _PyCoreConfig_InitPythonConfig(_PyCoreConfig *config);
PyAPI_FUNC(_PyInitError) _PyCoreConfig_InitIsolatedConfig(_PyCoreConfig *config);
PyAPI_FUNC(void) _PyCoreConfig_Clear(_PyCoreConfig *);
PyAPI_FUNC(_PyInitError) _PyCoreConfig_SetString(
wchar_t **config_str,
const wchar_t *str);
PyAPI_FUNC(_PyInitError) _PyCoreConfig_DecodeLocale(
wchar_t **config_str,
const char *str);
PyAPI_FUNC(_PyInitError) _PyCoreConfig_Read(_PyCoreConfig *config);
PyAPI_FUNC(_PyInitError) _PyCoreConfig_SetArgv(
_PyCoreConfig *config,
Py_ssize_t argc,
char **argv);
PyAPI_FUNC(_PyInitError) _PyCoreConfig_SetWideArgv(_PyCoreConfig *config,
Py_ssize_t argc,
wchar_t **argv);

#ifdef __cplusplus
}
Expand Down
10 changes: 8 additions & 2 deletions Include/internal/pycore_coreconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ PyAPI_FUNC(int) _PyWstrList_Extend(_PyWstrList *list,
typedef struct {
Py_ssize_t argc;
int use_bytes_argv;
char **bytes_argv;
wchar_t **wchar_argv;
} _PyArgv;

PyAPI_FUNC(_PyInitError) _PyArgv_AsWstrList(const _PyArgv *args,
Expand Down Expand Up @@ -121,6 +121,12 @@ PyAPI_FUNC(_PyInitError) _PyPreCmdline_Read(_PyPreCmdline *cmdline,
/* --- _PyPreConfig ----------------------------------------------- */

PyAPI_FUNC(void) _PyPreConfig_Init(_PyPreConfig *config);
PyAPI_FUNC(void) _PyPreConfig_Copy(_PyPreConfig *config,
const _PyPreConfig *config2);
PyAPI_FUNC(PyObject*) _PyPreConfig_AsDict(const _PyPreConfig *config);
Loading
Toggle all file notes Toggle all file annotations