blob: 57933211bb937c65406150d7890f6b9c033f41ba [file] [log] [blame]
Victor Stinner6c785c02018-08-01 17:56:14 +02001#ifndef Py_PYCORECONFIG_H
2#define Py_PYCORECONFIG_H
Victor Stinnerf684d832019-03-01 03:44:13 +01003#ifndef Py_LIMITED_API
Victor Stinner6c785c02018-08-01 17:56:14 +02004
Victor Stinner331a6a52019-05-27 16:39:22 +02005/* --- PyStatus ----------------------------------------------- */
Victor Stinner6c785c02018-08-01 17:56:14 +02006
Victor Stinner6c785c02018-08-01 17:56:14 +02007typedef struct {
Victor Stinnerdb719752019-05-01 05:35:33 +02008 enum {
Victor Stinner331a6a52019-05-27 16:39:22 +02009 _PyStatus_TYPE_OK=0,
10 _PyStatus_TYPE_ERROR=1,
11 _PyStatus_TYPE_EXIT=2
Victor Stinnerdb719752019-05-01 05:35:33 +020012 } _type;
Victor Stinner331a6a52019-05-27 16:39:22 +020013 const char *func;
Victor Stinnerdb719752019-05-01 05:35:33 +020014 const char *err_msg;
Victor Stinnerdfe88472019-03-01 12:14:41 +010015 int exitcode;
Victor Stinner331a6a52019-05-27 16:39:22 +020016} PyStatus;
Victor Stinner6c785c02018-08-01 17:56:14 +020017
Victor Stinner331a6a52019-05-27 16:39:22 +020018PyAPI_FUNC(PyStatus) PyStatus_Ok(void);
19PyAPI_FUNC(PyStatus) PyStatus_Error(const char *err_msg);
20PyAPI_FUNC(PyStatus) PyStatus_NoMemory(void);
21PyAPI_FUNC(PyStatus) PyStatus_Exit(int exitcode);
22PyAPI_FUNC(int) PyStatus_IsError(PyStatus err);
23PyAPI_FUNC(int) PyStatus_IsExit(PyStatus err);
24PyAPI_FUNC(int) PyStatus_Exception(PyStatus err);
Victor Stinner6c785c02018-08-01 17:56:14 +020025
Victor Stinner331a6a52019-05-27 16:39:22 +020026/* --- PyWideStringList ------------------------------------------------ */
Victor Stinner74f65682019-03-15 15:08:05 +010027
28typedef struct {
29 /* If length is greater than zero, items must be non-NULL
30 and all items strings must be non-NULL */
31 Py_ssize_t length;
32 wchar_t **items;
Victor Stinner331a6a52019-05-27 16:39:22 +020033} PyWideStringList;
34
35PyAPI_FUNC(PyStatus) PyWideStringList_Append(PyWideStringList *list,
36 const wchar_t *item);
Victor Stinner3842f292019-08-23 16:57:54 +010037PyAPI_FUNC(PyStatus) PyWideStringList_Insert(PyWideStringList *list,
38 Py_ssize_t index,
39 const wchar_t *item);
Victor Stinner74f65682019-03-15 15:08:05 +010040
Victor Stinner74f65682019-03-15 15:08:05 +010041
Victor Stinner331a6a52019-05-27 16:39:22 +020042/* --- PyPreConfig ----------------------------------------------- */
Victor Stinner022be022019-05-22 23:58:50 +020043
Victor Stinner6c785c02018-08-01 17:56:14 +020044typedef struct {
Victor Stinner022be022019-05-22 23:58:50 +020045 int _config_init; /* _PyConfigInitEnum value */
Victor Stinner373893c2019-05-02 14:46:29 -040046
Victor Stinner331a6a52019-05-27 16:39:22 +020047 /* Parse Py_PreInitializeFromBytesArgs() arguments?
48 See PyConfig.parse_argv */
Victor Stinner6d1c4672019-05-20 11:02:00 +020049 int parse_argv;
50
Victor Stinnercad1f742019-03-05 02:01:27 +010051 /* If greater than 0, enable isolated mode: sys.path contains
52 neither the script's directory nor the user's site-packages directory.
53
54 Set to 1 by the -I command line option. If set to -1 (default), inherit
55 Py_IsolatedFlag value. */
56 int isolated;
Victor Stinner6c785c02018-08-01 17:56:14 +020057
58 /* If greater than 0: use environment variables.
59 Set to 0 by -E command line option. If set to -1 (default), it is
60 set to !Py_IgnoreEnvironmentFlag. */
61 int use_environment;
Victor Stinner5a02e0d2019-03-05 12:32:09 +010062
Victor Stinnerbcfbbd72019-05-17 22:44:16 +020063 /* Set the LC_CTYPE locale to the user preferred locale? If equals to 0,
64 set coerce_c_locale and coerce_c_locale_warn to 0. */
65 int configure_locale;
66
Victor Stinnerd929f182019-03-27 18:28:46 +010067 /* Coerce the LC_CTYPE locale if it's equal to "C"? (PEP 538)
68
69 Set to 0 by PYTHONCOERCECLOCALE=0. Set to 1 by PYTHONCOERCECLOCALE=1.
70 Set to 2 if the user preferred LC_CTYPE locale is "C".
Victor Stinnerf72346c2019-03-25 17:54:58 +010071
MandarJKulkarni33ce3f02019-05-29 04:25:05 +053072 If it is equal to 1, LC_CTYPE locale is read to decide if it should be
Victor Stinnerf72346c2019-03-25 17:54:58 +010073 coerced or not (ex: PYTHONCOERCECLOCALE=1). Internally, it is set to 2
Victor Stinnercab5d072019-05-17 19:01:14 +020074 if the LC_CTYPE locale must be coerced.
75
MandarJKulkarni33ce3f02019-05-29 04:25:05 +053076 Disable by default (set to 0). Set it to -1 to let Python decide if it
Victor Stinnercab5d072019-05-17 19:01:14 +020077 should be enabled or not. */
Victor Stinnerf72346c2019-03-25 17:54:58 +010078 int coerce_c_locale;
Victor Stinnerd929f182019-03-27 18:28:46 +010079
80 /* Emit a warning if the LC_CTYPE locale is coerced?
81
Victor Stinnercab5d072019-05-17 19:01:14 +020082 Set to 1 by PYTHONCOERCECLOCALE=warn.
83
MandarJKulkarni33ce3f02019-05-29 04:25:05 +053084 Disable by default (set to 0). Set it to -1 to let Python decide if it
Victor Stinnercab5d072019-05-17 19:01:14 +020085 should be enabled or not. */
Victor Stinnerd929f182019-03-27 18:28:46 +010086 int coerce_c_locale_warn;
Victor Stinner5a02e0d2019-03-05 12:32:09 +010087
88#ifdef MS_WINDOWS
89 /* If greater than 1, use the "mbcs" encoding instead of the UTF-8
90 encoding for the filesystem encoding.
91
92 Set to 1 if the PYTHONLEGACYWINDOWSFSENCODING environment variable is
93 set to a non-empty string. If set to -1 (default), inherit
94 Py_LegacyWindowsFSEncodingFlag value.
95
96 See PEP 529 for more details. */
97 int legacy_windows_fs_encoding;
98#endif
99
Victor Stinnerd929f182019-03-27 18:28:46 +0100100 /* Enable UTF-8 mode? (PEP 540)
101
102 Disabled by default (equals to 0).
103
104 Set to 1 by "-X utf8" and "-X utf8=1" command line options.
105 Set to 1 by PYTHONUTF8=1 environment variable.
106
107 Set to 0 by "-X utf8=0" and PYTHONUTF8=0.
108
109 If equals to -1, it is set to 1 if the LC_CTYPE locale is "C" or
Victor Stinner022be022019-05-22 23:58:50 +0200110 "POSIX", otherwise it is set to 0. Inherit Py_UTF8Mode value value. */
Victor Stinner5a02e0d2019-03-05 12:32:09 +0100111 int utf8_mode;
Victor Stinnerb35be4b2019-03-05 17:37:44 +0100112
Victor Stinnerb9783d22020-01-24 10:22:18 +0100113 /* If non-zero, enable the Python Development Mode.
114
115 Set to 1 by the -X dev command line option. Set by the PYTHONDEVMODE
116 environment variable. */
117 int dev_mode;
Victor Stinnerb16b4e42019-05-17 15:20:52 +0200118
Victor Stinner6d1c4672019-05-20 11:02:00 +0200119 /* Memory allocator: PYTHONMALLOC env var.
120 See PyMemAllocatorName for valid values. */
121 int allocator;
Victor Stinner331a6a52019-05-27 16:39:22 +0200122} PyPreConfig;
Victor Stinnercad1f742019-03-05 02:01:27 +0100123
Victor Stinner3c30a762019-10-01 10:56:37 +0200124PyAPI_FUNC(void) PyPreConfig_InitPythonConfig(PyPreConfig *config);
125PyAPI_FUNC(void) PyPreConfig_InitIsolatedConfig(PyPreConfig *config);
Victor Stinnercab5d072019-05-17 19:01:14 +0200126
Victor Stinnercad1f742019-03-05 02:01:27 +0100127
Victor Stinner331a6a52019-05-27 16:39:22 +0200128/* --- PyConfig ---------------------------------------------- */
Victor Stinnercad1f742019-03-05 02:01:27 +0100129
130typedef struct {
Victor Stinner022be022019-05-22 23:58:50 +0200131 int _config_init; /* _PyConfigInitEnum value */
Victor Stinner373893c2019-05-02 14:46:29 -0400132
Victor Stinner331a6a52019-05-27 16:39:22 +0200133 int isolated; /* Isolated mode? see PyPreConfig.isolated */
134 int use_environment; /* Use environment variables? see PyPreConfig.use_environment */
Victor Stinnerb9783d22020-01-24 10:22:18 +0100135 int dev_mode; /* Python Development Mode? See PyPreConfig.dev_mode */
Victor Stinnercad1f742019-03-05 02:01:27 +0100136
137 /* Install signal handlers? Yes by default. */
138 int install_signal_handlers;
Victor Stinner6c785c02018-08-01 17:56:14 +0200139
140 int use_hash_seed; /* PYTHONHASHSEED=x */
141 unsigned long hash_seed;
142
Victor Stinner6c785c02018-08-01 17:56:14 +0200143 /* Enable faulthandler?
144 Set to 1 by -X faulthandler and PYTHONFAULTHANDLER. -1 means unset. */
145 int faulthandler;
146
Pablo Galindoc5fc1562020-04-22 23:29:27 +0100147 /* Enable PEG parser?
148 1 by default, set to 0 by -X oldparser and PYTHONOLDPARSER */
Victor Stinner1def7752020-04-23 03:03:24 +0200149 int _use_peg_parser;
Pablo Galindoc5fc1562020-04-22 23:29:27 +0100150
Victor Stinner6c785c02018-08-01 17:56:14 +0200151 /* Enable tracemalloc?
152 Set by -X tracemalloc=N and PYTHONTRACEMALLOC. -1 means unset */
153 int tracemalloc;
154
155 int import_time; /* PYTHONPROFILEIMPORTTIME, -X importtime */
156 int show_ref_count; /* -X showrefcount */
Victor Stinner6c785c02018-08-01 17:56:14 +0200157 int dump_refs; /* PYTHONDUMPREFS */
158 int malloc_stats; /* PYTHONMALLOCSTATS */
Victor Stinner6c785c02018-08-01 17:56:14 +0200159
Victor Stinnerde427552018-08-29 23:26:55 +0200160 /* Python filesystem encoding and error handler:
Victor Stinnerb2457ef2018-08-29 13:25:36 +0200161 sys.getfilesystemencoding() and sys.getfilesystemencodeerrors().
162
Victor Stinnerde427552018-08-29 23:26:55 +0200163 Default encoding and error handler:
164
165 * if Py_SetStandardStreamEncoding() has been called: they have the
166 highest priority;
167 * PYTHONIOENCODING environment variable;
168 * The UTF-8 Mode uses UTF-8/surrogateescape;
Victor Stinner905f1ac2018-10-30 12:58:10 +0100169 * If Python forces the usage of the ASCII encoding (ex: C locale
170 or POSIX locale on FreeBSD or HP-UX), use ASCII/surrogateescape;
pxinwrf4b0a1c2019-03-04 17:02:06 +0800171 * locale encoding: ANSI code page on Windows, UTF-8 on Android and
172 VxWorks, LC_CTYPE locale encoding on other platforms;
Victor Stinnerde427552018-08-29 23:26:55 +0200173 * On Windows, "surrogateescape" error handler;
174 * "surrogateescape" error handler if the LC_CTYPE locale is "C" or "POSIX";
175 * "surrogateescape" error handler if the LC_CTYPE locale has been coerced
176 (PEP 538);
177 * "strict" error handler.
178
179 Supported error handlers: "strict", "surrogateescape" and
180 "surrogatepass". The surrogatepass error handler is only supported
181 if Py_DecodeLocale() and Py_EncodeLocale() use directly the UTF-8 codec;
182 it's only used on Windows.
183
184 initfsencoding() updates the encoding to the Python codec name.
185 For example, "ANSI_X3.4-1968" is replaced with "ascii".
186
187 On Windows, sys._enablelegacywindowsfsencoding() sets the
188 encoding/errors to mbcs/replace at runtime.
189
Victor Stinnerb2457ef2018-08-29 13:25:36 +0200190
191 See Py_FileSystemDefaultEncoding and Py_FileSystemDefaultEncodeErrors.
192 */
Victor Stinner709d23d2019-05-02 14:56:30 -0400193 wchar_t *filesystem_encoding;
194 wchar_t *filesystem_errors;
Victor Stinnerb2457ef2018-08-29 13:25:36 +0200195
Victor Stinner74f65682019-03-15 15:08:05 +0100196 wchar_t *pycache_prefix; /* PYTHONPYCACHEPREFIX, -X pycache_prefix=PATH */
Victor Stinnerae239f62019-05-16 17:02:56 +0200197 int parse_argv; /* Parse argv command line arguments? */
198
199 /* Command line arguments (sys.argv).
200
Victor Stinnercab5d072019-05-17 19:01:14 +0200201 Set parse_argv to 1 to parse argv as Python command line arguments
202 and then strip Python arguments from argv.
Victor Stinnerae239f62019-05-16 17:02:56 +0200203
204 If argv is empty, an empty string is added to ensure that sys.argv
205 always exists and is never empty. */
Victor Stinner331a6a52019-05-27 16:39:22 +0200206 PyWideStringList argv;
Victor Stinnerae239f62019-05-16 17:02:56 +0200207
Victor Stinnerfed02e12019-05-17 11:12:09 +0200208 /* Program name:
209
210 - If Py_SetProgramName() was called, use its value.
211 - On macOS, use PYTHONEXECUTABLE environment variable if set.
212 - If WITH_NEXT_FRAMEWORK macro is defined, use __PYVENV_LAUNCHER__
213 environment variable is set.
214 - Use argv[0] if available and non-empty.
215 - Use "python" on Windows, or "python3 on other platforms. */
216 wchar_t *program_name;
Victor Stinnerae239f62019-05-16 17:02:56 +0200217
Victor Stinner331a6a52019-05-27 16:39:22 +0200218 PyWideStringList xoptions; /* Command line -X options */
Victor Stinnerfb4ae152019-09-30 01:40:17 +0200219
220 /* Warnings options: lowest to highest priority. warnings.filters
221 is built in the reverse order (highest to lowest priority). */
222 PyWideStringList warnoptions;
Victor Stinner6c785c02018-08-01 17:56:14 +0200223
Victor Stinner6c785c02018-08-01 17:56:14 +0200224 /* If equal to zero, disable the import of the module site and the
225 site-dependent manipulations of sys.path that it entails. Also disable
226 these manipulations if site is explicitly imported later (call
227 site.main() if you want them to be triggered).
228
229 Set to 0 by the -S command line option. If set to -1 (default), it is
230 set to !Py_NoSiteFlag. */
231 int site_import;
232
233 /* Bytes warnings:
234
235 * If equal to 1, issue a warning when comparing bytes or bytearray with
236 str or bytes with int.
237 * If equal or greater to 2, issue an error.
238
239 Incremented by the -b command line option. If set to -1 (default), inherit
240 Py_BytesWarningFlag value. */
241 int bytes_warning;
242
243 /* If greater than 0, enable inspect: when a script is passed as first
244 argument or the -c option is used, enter interactive mode after
245 executing the script or the command, even when sys.stdin does not appear
246 to be a terminal.
247
248 Incremented by the -i command line option. Set to 1 if the PYTHONINSPECT
249 environment variable is non-empty. If set to -1 (default), inherit
250 Py_InspectFlag value. */
251 int inspect;
252
253 /* If greater than 0: enable the interactive mode (REPL).
254
255 Incremented by the -i command line option. If set to -1 (default),
256 inherit Py_InteractiveFlag value. */
257 int interactive;
258
259 /* Optimization level.
260
261 Incremented by the -O command line option. Set by the PYTHONOPTIMIZE
262 environment variable. If set to -1 (default), inherit Py_OptimizeFlag
263 value. */
264 int optimization_level;
265
266 /* If greater than 0, enable the debug mode: turn on parser debugging
267 output (for expert only, depending on compilation options).
268
269 Incremented by the -d command line option. Set by the PYTHONDEBUG
270 environment variable. If set to -1 (default), inherit Py_DebugFlag
271 value. */
272 int parser_debug;
273
274 /* If equal to 0, Python won't try to write ``.pyc`` files on the
275 import of source modules.
276
277 Set to 0 by the -B command line option and the PYTHONDONTWRITEBYTECODE
278 environment variable. If set to -1 (default), it is set to
279 !Py_DontWriteBytecodeFlag. */
280 int write_bytecode;
281
282 /* If greater than 0, enable the verbose mode: print a message each time a
283 module is initialized, showing the place (filename or built-in module)
284 from which it is loaded.
285
286 If greater or equal to 2, print a message for each file that is checked
287 for when searching for a module. Also provides information on module
288 cleanup at exit.
289
290 Incremented by the -v option. Set by the PYTHONVERBOSE environment
291 variable. If set to -1 (default), inherit Py_VerboseFlag value. */
292 int verbose;
293
294 /* If greater than 0, enable the quiet mode: Don't display the copyright
295 and version messages even in interactive mode.
296
297 Incremented by the -q option. If set to -1 (default), inherit
298 Py_QuietFlag value. */
299 int quiet;
300
301 /* If greater than 0, don't add the user site-packages directory to
302 sys.path.
303
304 Set to 0 by the -s and -I command line options , and the PYTHONNOUSERSITE
305 environment variable. If set to -1 (default), it is set to
306 !Py_NoUserSiteDirectory. */
307 int user_site_directory;
308
Victor Stinner54b43bb2019-05-16 18:30:15 +0200309 /* If non-zero, configure C standard steams (stdio, stdout,
310 stderr):
311
312 - Set O_BINARY mode on Windows.
313 - If buffered_stdio is equal to zero, make streams unbuffered.
314 Otherwise, enable streams buffering if interactive is non-zero. */
315 int configure_c_stdio;
316
Victor Stinner6c785c02018-08-01 17:56:14 +0200317 /* If equal to 0, enable unbuffered mode: force the stdout and stderr
318 streams to be unbuffered.
319
320 Set to 0 by the -u option. Set by the PYTHONUNBUFFERED environment
321 variable.
322 If set to -1 (default), it is set to !Py_UnbufferedStdioFlag. */
323 int buffered_stdio;
324
Victor Stinnerdfe0dc72018-08-29 11:47:29 +0200325 /* Encoding of sys.stdin, sys.stdout and sys.stderr.
326 Value set from PYTHONIOENCODING environment variable and
327 Py_SetStandardStreamEncoding() function.
328 See also 'stdio_errors' attribute. */
Victor Stinner709d23d2019-05-02 14:56:30 -0400329 wchar_t *stdio_encoding;
Victor Stinnerdfe0dc72018-08-29 11:47:29 +0200330
331 /* Error handler of sys.stdin and sys.stdout.
332 Value set from PYTHONIOENCODING environment variable and
333 Py_SetStandardStreamEncoding() function.
334 See also 'stdio_encoding' attribute. */
Victor Stinner709d23d2019-05-02 14:56:30 -0400335 wchar_t *stdio_errors;
Victor Stinnerdfe0dc72018-08-29 11:47:29 +0200336
Victor Stinner6c785c02018-08-01 17:56:14 +0200337#ifdef MS_WINDOWS
Victor Stinner6c785c02018-08-01 17:56:14 +0200338 /* If greater than zero, use io.FileIO instead of WindowsConsoleIO for sys
339 standard streams.
340
341 Set to 1 if the PYTHONLEGACYWINDOWSSTDIO environment variable is set to
342 a non-empty string. If set to -1 (default), inherit
343 Py_LegacyWindowsStdioFlag value.
344
345 See PEP 528 for more details. */
346 int legacy_windows_stdio;
347#endif
348
Victor Stinner331a6a52019-05-27 16:39:22 +0200349 /* Value of the --check-hash-based-pycs command line option:
350
351 - "default" means the 'check_source' flag in hash-based pycs
352 determines invalidation
353 - "always" causes the interpreter to hash the source file for
354 invalidation regardless of value of 'check_source' bit
355 - "never" causes the interpreter to always assume hash-based pycs are
356 valid
357
358 The default value is "default".
359
360 See PEP 552 "Deterministic pycs" for more details. */
361 wchar_t *check_hash_pycs_mode;
362
Victor Stinnerae239f62019-05-16 17:02:56 +0200363 /* --- Path configuration inputs ------------ */
364
Victor Stinner331a6a52019-05-27 16:39:22 +0200365 /* If greater than 0, suppress _PyPathConfig_Calculate() warnings on Unix.
366 The parameter has no effect on Windows.
367
368 If set to -1 (default), inherit !Py_FrozenFlag value. */
369 int pathconfig_warnings;
370
371 wchar_t *pythonpath_env; /* PYTHONPATH environment variable */
Victor Stinnerae239f62019-05-16 17:02:56 +0200372 wchar_t *home; /* PYTHONHOME environment variable,
373 see also Py_SetPythonHome(). */
374
375 /* --- Path configuration outputs ----------- */
376
Victor Stinner331a6a52019-05-27 16:39:22 +0200377 int module_search_paths_set; /* If non-zero, use module_search_paths */
378 PyWideStringList module_search_paths; /* sys.path paths. Computed if
379 module_search_paths_set is equal
Victor Stinnerae239f62019-05-16 17:02:56 +0200380 to zero. */
381
Steve Dower9048c492019-06-29 10:34:11 -0700382 wchar_t *executable; /* sys.executable */
383 wchar_t *base_executable; /* sys._base_executable */
384 wchar_t *prefix; /* sys.prefix */
385 wchar_t *base_prefix; /* sys.base_prefix */
386 wchar_t *exec_prefix; /* sys.exec_prefix */
Victor Stinnerae239f62019-05-16 17:02:56 +0200387 wchar_t *base_exec_prefix; /* sys.base_exec_prefix */
Sandro Mani8f023a22020-06-08 17:28:11 +0200388 wchar_t *platlibdir; /* sys.platlibdir */
Victor Stinnerae239f62019-05-16 17:02:56 +0200389
Victor Stinner62be7632019-03-01 13:10:14 +0100390 /* --- Parameter only used by Py_Main() ---------- */
391
392 /* Skip the first line of the source ('run_filename' parameter), allowing use of non-Unix forms of
393 "#!cmd". This is intended for a DOS specific hack only.
394
395 Set by the -x command line option. */
396 int skip_source_first_line;
397
398 wchar_t *run_command; /* -c command line argument */
399 wchar_t *run_module; /* -m command line argument */
400 wchar_t *run_filename; /* Trailing command line argument without -c or -m */
401
402 /* --- Private fields ---------------------------- */
Victor Stinner6c785c02018-08-01 17:56:14 +0200403
404 /* Install importlib? If set to 0, importlib is not initialized at all.
405 Needed by freeze_importlib. */
406 int _install_importlib;
407
Victor Stinner9ef5dca2019-05-16 17:38:16 +0200408 /* If equal to 0, stop Python initialization before the "main" phase */
409 int _init_main;
Victor Stinner252346a2020-05-01 11:33:44 +0200410
411 /* If non-zero, disallow threads, subprocesses, and fork.
412 Default: 0. */
413 int _isolated_interpreter;
Victor Stinnere81f6e62020-06-08 18:12:59 +0200414
415 /* Original command line arguments. If _orig_argv is empty and _argv is
416 not equal to [''], PyConfig_Read() copies the configuration 'argv' list
417 into '_orig_argv' list before modifying 'argv' list (if parse_argv
418 is non-zero).
419
420 _PyConfig_Write() initializes Py_GetArgcArgv() to this list. */
421 PyWideStringList _orig_argv;
Victor Stinner331a6a52019-05-27 16:39:22 +0200422} PyConfig;
Victor Stinner6c785c02018-08-01 17:56:14 +0200423
Victor Stinner8462a492019-10-01 12:06:16 +0200424PyAPI_FUNC(void) PyConfig_InitPythonConfig(PyConfig *config);
425PyAPI_FUNC(void) PyConfig_InitIsolatedConfig(PyConfig *config);
Victor Stinner331a6a52019-05-27 16:39:22 +0200426PyAPI_FUNC(void) PyConfig_Clear(PyConfig *);
427PyAPI_FUNC(PyStatus) PyConfig_SetString(
428 PyConfig *config,
Victor Stinnerbab0db62019-05-18 03:21:27 +0200429 wchar_t **config_str,
430 const wchar_t *str);
Victor Stinner331a6a52019-05-27 16:39:22 +0200431PyAPI_FUNC(PyStatus) PyConfig_SetBytesString(
432 PyConfig *config,
Victor Stinnerbab0db62019-05-18 03:21:27 +0200433 wchar_t **config_str,
434 const char *str);
Victor Stinner331a6a52019-05-27 16:39:22 +0200435PyAPI_FUNC(PyStatus) PyConfig_Read(PyConfig *config);
436PyAPI_FUNC(PyStatus) PyConfig_SetBytesArgv(
437 PyConfig *config,
Victor Stinnerbab0db62019-05-18 03:21:27 +0200438 Py_ssize_t argc,
Victor Stinner6d1c4672019-05-20 11:02:00 +0200439 char * const *argv);
Victor Stinner331a6a52019-05-27 16:39:22 +0200440PyAPI_FUNC(PyStatus) PyConfig_SetArgv(PyConfig *config,
Victor Stinnerbab0db62019-05-18 03:21:27 +0200441 Py_ssize_t argc,
Victor Stinner6d1c4672019-05-20 11:02:00 +0200442 wchar_t * const *argv);
Victor Stinner36242fd2019-07-01 19:13:50 +0200443PyAPI_FUNC(PyStatus) PyConfig_SetWideStringList(PyConfig *config,
444 PyWideStringList *list,
445 Py_ssize_t length, wchar_t **items);
Victor Stinnercab5d072019-05-17 19:01:14 +0200446
Victor Stinnere81f6e62020-06-08 18:12:59 +0200447
448/* --- Helper functions --------------------------------------- */
449
450/* Get the original command line arguments, before Python modified them.
451
452 See also PyConfig._orig_argv. */
453PyAPI_FUNC(void) Py_GetArgcArgv(int *argc, wchar_t ***argv);
454
Victor Stinnerf684d832019-03-01 03:44:13 +0100455#endif /* !Py_LIMITED_API */
Victor Stinner6c785c02018-08-01 17:56:14 +0200456#endif /* !Py_PYCORECONFIG_H */