File indexing completed on 2025-03-13 09:20:54
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 PyAPI_FUNC(PyObject *) _PyErr_SetFromPyStatus(PyStatus status);
0029
0030
0031
0032 typedef struct {
0033
0034
0035 Py_ssize_t length;
0036 wchar_t **items;
0037 } PyWideStringList;
0038
0039 PyAPI_FUNC(PyStatus) PyWideStringList_Append(PyWideStringList *list,
0040 const wchar_t *item);
0041 PyAPI_FUNC(PyStatus) PyWideStringList_Insert(PyWideStringList *list,
0042 Py_ssize_t index,
0043 const wchar_t *item);
0044
0045
0046
0047
0048 typedef struct PyPreConfig {
0049 int _config_init;
0050
0051
0052
0053 int parse_argv;
0054
0055
0056
0057
0058
0059
0060 int isolated;
0061
0062
0063
0064
0065 int use_environment;
0066
0067
0068
0069 int configure_locale;
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082 int coerce_c_locale;
0083
0084
0085
0086
0087
0088
0089
0090 int coerce_c_locale_warn;
0091
0092 #ifdef MS_WINDOWS
0093
0094
0095
0096
0097
0098
0099
0100
0101 int legacy_windows_fs_encoding;
0102 #endif
0103
0104
0105
0106
0107
0108
0109
0110
0111
0112
0113
0114
0115 int utf8_mode;
0116
0117
0118
0119
0120
0121 int dev_mode;
0122
0123
0124
0125 int allocator;
0126 } PyPreConfig;
0127
0128 PyAPI_FUNC(void) PyPreConfig_InitPythonConfig(PyPreConfig *config);
0129 PyAPI_FUNC(void) PyPreConfig_InitIsolatedConfig(PyPreConfig *config);
0130
0131
0132
0133
0134
0135 typedef struct PyConfig {
0136 int _config_init;
0137
0138 int isolated;
0139 int use_environment;
0140 int dev_mode;
0141 int install_signal_handlers;
0142 int use_hash_seed;
0143 unsigned long hash_seed;
0144 int faulthandler;
0145 int tracemalloc;
0146 int perf_profiling;
0147 int import_time;
0148 int code_debug_ranges;
0149 int show_ref_count;
0150 int dump_refs;
0151 wchar_t *dump_refs_file;
0152 int malloc_stats;
0153 wchar_t *filesystem_encoding;
0154 wchar_t *filesystem_errors;
0155 wchar_t *pycache_prefix;
0156 int parse_argv;
0157 PyWideStringList orig_argv;
0158 PyWideStringList argv;
0159 PyWideStringList xoptions;
0160 PyWideStringList warnoptions;
0161 int site_import;
0162 int bytes_warning;
0163 int warn_default_encoding;
0164 int inspect;
0165 int interactive;
0166 int optimization_level;
0167 int parser_debug;
0168 int write_bytecode;
0169 int verbose;
0170 int quiet;
0171 int user_site_directory;
0172 int configure_c_stdio;
0173 int buffered_stdio;
0174 wchar_t *stdio_encoding;
0175 wchar_t *stdio_errors;
0176 #ifdef MS_WINDOWS
0177 int legacy_windows_stdio;
0178 #endif
0179 wchar_t *check_hash_pycs_mode;
0180 int use_frozen_modules;
0181 int safe_path;
0182 int int_max_str_digits;
0183
0184
0185 int pathconfig_warnings;
0186 wchar_t *program_name;
0187 wchar_t *pythonpath_env;
0188 wchar_t *home;
0189 wchar_t *platlibdir;
0190
0191
0192 int module_search_paths_set;
0193 PyWideStringList module_search_paths;
0194 wchar_t *stdlib_dir;
0195 wchar_t *executable;
0196 wchar_t *base_executable;
0197 wchar_t *prefix;
0198 wchar_t *base_prefix;
0199 wchar_t *exec_prefix;
0200 wchar_t *base_exec_prefix;
0201
0202
0203 int skip_source_first_line;
0204 wchar_t *run_command;
0205 wchar_t *run_module;
0206 wchar_t *run_filename;
0207
0208
0209
0210
0211
0212 int _install_importlib;
0213
0214
0215 int _init_main;
0216
0217
0218 int _is_python_build;
0219 } PyConfig;
0220
0221 PyAPI_FUNC(void) PyConfig_InitPythonConfig(PyConfig *config);
0222 PyAPI_FUNC(void) PyConfig_InitIsolatedConfig(PyConfig *config);
0223 PyAPI_FUNC(void) PyConfig_Clear(PyConfig *);
0224 PyAPI_FUNC(PyStatus) PyConfig_SetString(
0225 PyConfig *config,
0226 wchar_t **config_str,
0227 const wchar_t *str);
0228 PyAPI_FUNC(PyStatus) PyConfig_SetBytesString(
0229 PyConfig *config,
0230 wchar_t **config_str,
0231 const char *str);
0232 PyAPI_FUNC(PyStatus) PyConfig_Read(PyConfig *config);
0233 PyAPI_FUNC(PyStatus) PyConfig_SetBytesArgv(
0234 PyConfig *config,
0235 Py_ssize_t argc,
0236 char * const *argv);
0237 PyAPI_FUNC(PyStatus) PyConfig_SetArgv(PyConfig *config,
0238 Py_ssize_t argc,
0239 wchar_t * const *argv);
0240 PyAPI_FUNC(PyStatus) PyConfig_SetWideStringList(PyConfig *config,
0241 PyWideStringList *list,
0242 Py_ssize_t length, wchar_t **items);
0243
0244
0245
0246
0247
0248
0249
0250 PyAPI_FUNC(void) Py_GetArgcArgv(int *argc, wchar_t ***argv);
0251
0252 #ifdef __cplusplus
0253 }
0254 #endif
0255 #endif
0256 #endif