File indexing completed on 2025-11-19 09:50:41
0001 #ifndef Py_PYCORECONFIG_H
0002 #define Py_PYCORECONFIG_H
0003 #ifndef Py_LIMITED_API
0004 #ifdef __cplusplus
0005 extern "C" {
0006 #endif
0007
0008
0009
0010 typedef struct {
0011 enum {
0012 _PyStatus_TYPE_OK=0,
0013 _PyStatus_TYPE_ERROR=1,
0014 _PyStatus_TYPE_EXIT=2
0015 } _type;
0016 const char *func;
0017 const char *err_msg;
0018 int exitcode;
0019 } PyStatus;
0020
0021 PyAPI_FUNC(PyStatus) PyStatus_Ok(void);
0022 PyAPI_FUNC(PyStatus) PyStatus_Error(const char *err_msg);
0023 PyAPI_FUNC(PyStatus) PyStatus_NoMemory(void);
0024 PyAPI_FUNC(PyStatus) PyStatus_Exit(int exitcode);
0025 PyAPI_FUNC(int) PyStatus_IsError(PyStatus err);
0026 PyAPI_FUNC(int) PyStatus_IsExit(PyStatus err);
0027 PyAPI_FUNC(int) PyStatus_Exception(PyStatus err);
0028
0029
0030
0031 typedef struct {
0032
0033
0034 Py_ssize_t length;
0035 wchar_t **items;
0036 } PyWideStringList;
0037
0038 PyAPI_FUNC(PyStatus) PyWideStringList_Append(PyWideStringList *list,
0039 const wchar_t *item);
0040 PyAPI_FUNC(PyStatus) PyWideStringList_Insert(PyWideStringList *list,
0041 Py_ssize_t index,
0042 const wchar_t *item);
0043
0044
0045
0046
0047 typedef struct PyPreConfig {
0048 int _config_init;
0049
0050
0051
0052 int parse_argv;
0053
0054
0055
0056
0057
0058
0059 int isolated;
0060
0061
0062
0063
0064 int use_environment;
0065
0066
0067
0068 int configure_locale;
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081 int coerce_c_locale;
0082
0083
0084
0085
0086
0087
0088
0089 int coerce_c_locale_warn;
0090
0091 #ifdef MS_WINDOWS
0092
0093
0094
0095
0096
0097
0098
0099
0100 int legacy_windows_fs_encoding;
0101 #endif
0102
0103
0104
0105
0106
0107
0108
0109
0110
0111
0112
0113
0114 int utf8_mode;
0115
0116
0117
0118
0119
0120 int dev_mode;
0121
0122
0123
0124 int allocator;
0125 } PyPreConfig;
0126
0127 PyAPI_FUNC(void) PyPreConfig_InitPythonConfig(PyPreConfig *config);
0128 PyAPI_FUNC(void) PyPreConfig_InitIsolatedConfig(PyPreConfig *config);
0129
0130
0131
0132
0133
0134 typedef struct PyConfig {
0135 int _config_init;
0136
0137 int isolated;
0138 int use_environment;
0139 int dev_mode;
0140 int install_signal_handlers;
0141 int use_hash_seed;
0142 unsigned long hash_seed;
0143 int faulthandler;
0144 int tracemalloc;
0145 int perf_profiling;
0146 int import_time;
0147 int code_debug_ranges;
0148 int show_ref_count;
0149 int dump_refs;
0150 wchar_t *dump_refs_file;
0151 int malloc_stats;
0152 wchar_t *filesystem_encoding;
0153 wchar_t *filesystem_errors;
0154 wchar_t *pycache_prefix;
0155 int parse_argv;
0156 PyWideStringList orig_argv;
0157 PyWideStringList argv;
0158 PyWideStringList xoptions;
0159 PyWideStringList warnoptions;
0160 int site_import;
0161 int bytes_warning;
0162 int warn_default_encoding;
0163 int inspect;
0164 int interactive;
0165 int optimization_level;
0166 int parser_debug;
0167 int write_bytecode;
0168 int verbose;
0169 int quiet;
0170 int user_site_directory;
0171 int configure_c_stdio;
0172 int buffered_stdio;
0173 wchar_t *stdio_encoding;
0174 wchar_t *stdio_errors;
0175 #ifdef MS_WINDOWS
0176 int legacy_windows_stdio;
0177 #endif
0178 wchar_t *check_hash_pycs_mode;
0179 int use_frozen_modules;
0180 int safe_path;
0181 int int_max_str_digits;
0182
0183 int cpu_count;
0184 #ifdef Py_GIL_DISABLED
0185 int enable_gil;
0186 #endif
0187
0188
0189 int pathconfig_warnings;
0190 wchar_t *program_name;
0191 wchar_t *pythonpath_env;
0192 wchar_t *home;
0193 wchar_t *platlibdir;
0194
0195
0196 int module_search_paths_set;
0197 PyWideStringList module_search_paths;
0198 wchar_t *stdlib_dir;
0199 wchar_t *executable;
0200 wchar_t *base_executable;
0201 wchar_t *prefix;
0202 wchar_t *base_prefix;
0203 wchar_t *exec_prefix;
0204 wchar_t *base_exec_prefix;
0205
0206
0207 int skip_source_first_line;
0208 wchar_t *run_command;
0209 wchar_t *run_module;
0210 wchar_t *run_filename;
0211
0212
0213 wchar_t *sys_path_0;
0214
0215
0216
0217
0218
0219 int _install_importlib;
0220
0221
0222 int _init_main;
0223
0224
0225 int _is_python_build;
0226
0227 #ifdef Py_STATS
0228
0229 int _pystats;
0230 #endif
0231
0232 #ifdef Py_DEBUG
0233
0234
0235 wchar_t *run_presite;
0236 #endif
0237 } PyConfig;
0238
0239 PyAPI_FUNC(void) PyConfig_InitPythonConfig(PyConfig *config);
0240 PyAPI_FUNC(void) PyConfig_InitIsolatedConfig(PyConfig *config);
0241 PyAPI_FUNC(void) PyConfig_Clear(PyConfig *);
0242 PyAPI_FUNC(PyStatus) PyConfig_SetString(
0243 PyConfig *config,
0244 wchar_t **config_str,
0245 const wchar_t *str);
0246 PyAPI_FUNC(PyStatus) PyConfig_SetBytesString(
0247 PyConfig *config,
0248 wchar_t **config_str,
0249 const char *str);
0250 PyAPI_FUNC(PyStatus) PyConfig_Read(PyConfig *config);
0251 PyAPI_FUNC(PyStatus) PyConfig_SetBytesArgv(
0252 PyConfig *config,
0253 Py_ssize_t argc,
0254 char * const *argv);
0255 PyAPI_FUNC(PyStatus) PyConfig_SetArgv(PyConfig *config,
0256 Py_ssize_t argc,
0257 wchar_t * const *argv);
0258 PyAPI_FUNC(PyStatus) PyConfig_SetWideStringList(PyConfig *config,
0259 PyWideStringList *list,
0260 Py_ssize_t length, wchar_t **items);
0261
0262
0263
0264
0265
0266
0267
0268 PyAPI_FUNC(void) Py_GetArgcArgv(int *argc, wchar_t ***argv);
0269
0270 #ifdef __cplusplus
0271 }
0272 #endif
0273 #endif
0274 #endif