FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cpython/Include/cpython/initconfig.h at main · python/cpython · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
python
/
cpython
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
35.3k
Star
74.9k
Code
Issues
5k+
Pull requests
2.6k
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
cpython
/
Include
/
cpython
/
initconfig.h
Copy path
More file actions
More file actions
Latest commit
History
History
History
335 lines (269 loc) · 9.79 KB
Breadcrumbs
cpython
/
Include
/
cpython
/
initconfig.h
Copy path
File metadata and controls
335 lines (269 loc) · 9.79 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
#ifndef
Py_PYCORECONFIG_H
#define
Py_PYCORECONFIG_H
#ifndef
Py_LIMITED_API
#ifdef
__cplusplus
extern
"C"
{
#endif
/* --- PyStatus ----------------------------------------------- */
typedef
struct
{
enum
{
_PyStatus_TYPE_OK
=
0
,
_PyStatus_TYPE_ERROR
=
1
,
_PyStatus_TYPE_EXIT
=
2
}
_type
;
const
char
*
func
;
const
char
*
err_msg
;
int
exitcode
;
}
PyStatus
;
PyAPI_FUNC
(
PyStatus
)
PyStatus_Ok
(
void
);
PyAPI_FUNC
(
PyStatus
)
PyStatus_Error
(
const
char
*
err_msg
);
PyAPI_FUNC
(
PyStatus
)
PyStatus_NoMemory
(
void
);
PyAPI_FUNC
(
PyStatus
)
PyStatus_Exit
(
int
exitcode
);
PyAPI_FUNC
(
int
)
PyStatus_IsError
(
PyStatus
err
);
PyAPI_FUNC
(
int
)
PyStatus_IsExit
(
PyStatus
err
);
PyAPI_FUNC
(
int
)
PyStatus_Exception
(
PyStatus
err
);
/* --- PyWideStringList ------------------------------------------------ */
typedef
struct
{
/* If length is greater than zero, items must be non-NULL
and all items strings must be non-NULL */
Py_ssize_t
length
;
wchar_t
*
*
items
;
}
PyWideStringList
;
PyAPI_FUNC
(
PyStatus
)
PyWideStringList_Append
(
PyWideStringList
*
list
,
const
wchar_t
*
item
);
PyAPI_FUNC
(
PyStatus
)
PyWideStringList_Insert
(
PyWideStringList
*
list
,
Py_ssize_t
index
,
const
wchar_t
*
item
);
/* --- PyPreConfig ----------------------------------------------- */
typedef
struct
PyPreConfig
{
int
_config_init
;
/* _PyConfigInitEnum value */
/* Parse Py_PreInitializeFromBytesArgs() arguments?
See PyConfig.parse_argv */
int
parse_argv
;
/* If greater than 0, enable isolated mode: sys.path contains
neither the script's directory nor the user's site-packages directory.
Set to 1 by the -I command line option. If set to -1 (default), inherit
Py_IsolatedFlag value. */
int
isolated
;
/* If greater than 0: use environment variables.
Set to 0 by -E command line option. If set to -1 (default), it is
set to !Py_IgnoreEnvironmentFlag. */
int
use_environment
;
/* Set the LC_CTYPE locale to the user preferred locale? If equals to 0,
set coerce_c_locale and coerce_c_locale_warn to 0. */
int
configure_locale
;
/* Coerce the LC_CTYPE locale if it's equal to "C"? (PEP 538)
Set to 0 by PYTHONCOERCECLOCALE=0. Set to 1 by PYTHONCOERCECLOCALE=1.
Set to 2 if the user preferred LC_CTYPE locale is "C".
If it is equal to 1, LC_CTYPE locale is read to decide if it should be
coerced or not (ex: PYTHONCOERCECLOCALE=1). Internally, it is set to 2
if the LC_CTYPE locale must be coerced.
Disable by default (set to 0). Set it to -1 to let Python decide if it
should be enabled or not. */
int
coerce_c_locale
;
/* Emit a warning if the LC_CTYPE locale is coerced?
Set to 1 by PYTHONCOERCECLOCALE=warn.
Disable by default (set to 0). Set it to -1 to let Python decide if it
should be enabled or not. */
int
coerce_c_locale_warn
;
#ifdef
MS_WINDOWS
/* If greater than 1, use the "mbcs" encoding instead of the UTF-8
encoding for the filesystem encoding.
Set to 1 if the PYTHONLEGACYWINDOWSFSENCODING environment variable is
set to a non-empty string. If set to -1 (default), inherit
Py_LegacyWindowsFSEncodingFlag value.
See PEP 529 for more details. */
int
legacy_windows_fs_encoding
;
#endif
/* Enable UTF-8 mode? (PEP 540)
If equal to 1, use the UTF-8 encoding and use "surrogateescape" for the
stdin & stdout error handlers.
Enabled by default (equal to 1; PEP 686), or if Py_UTF8Mode=1,
or if "-X utf8=1" or PYTHONUTF8=1.
Set to 0 by "-X utf8=0" or PYTHONUTF8=0.
*/
int
utf8_mode
;
/* If non-zero, enable the Python Development Mode.
Set to 1 by the -X dev command line option. Set by the PYTHONDEVMODE
environment variable. */
int
dev_mode
;
/* Memory allocator: PYTHONMALLOC env var.
See PyMemAllocatorName for valid values. */
int
allocator
;
}
PyPreConfig
;
PyAPI_FUNC
(
void
)
PyPreConfig_InitPythonConfig
(
PyPreConfig
*
config
);
PyAPI_FUNC
(
void
)
PyPreConfig_InitIsolatedConfig
(
PyPreConfig
*
config
);
/* --- PyConfig ---------------------------------------------- */
/* This structure is best documented in the Doc/c-api/init_config.rst file. */
typedef
struct
PyConfig
{
int
_config_init
;
/* _PyConfigInitEnum value */
int
isolated
;
int
use_environment
;
int
dev_mode
;
int
install_signal_handlers
;
int
use_hash_seed
;
unsigned long
hash_seed
;
int
faulthandler
;
int
tracemalloc
;
int
perf_profiling
;
int
remote_debug
;
int
import_time
;
int
code_debug_ranges
;
int
show_ref_count
;
int
dump_refs
;
wchar_t
*
dump_refs_file
;
int
malloc_stats
;
int
pymalloc_hugepages
;
wchar_t
*
filesystem_encoding
;
wchar_t
*
filesystem_errors
;
wchar_t
*
pycache_prefix
;
int
parse_argv
;
PyWideStringList
orig_argv
;
PyWideStringList
argv
;
PyWideStringList
xoptions
;
PyWideStringList
warnoptions
;
int
site_import
;
int
bytes_warning
;
int
warn_default_encoding
;
int
inspect
;
int
interactive
;
int
optimization_level
;
int
parser_debug
;
int
write_bytecode
;
int
verbose
;
int
quiet
;
int
user_site_directory
;
int
configure_c_stdio
;
int
buffered_stdio
;
wchar_t
*
stdio_encoding
;
wchar_t
*
stdio_errors
;
#ifdef
MS_WINDOWS
int
legacy_windows_stdio
;
#endif
wchar_t
*
check_hash_pycs_mode
;
int
use_frozen_modules
;
int
safe_path
;
int
int_max_str_digits
;
int
thread_inherit_context
;
int
context_aware_warnings
;
#ifdef
__APPLE__
int
use_system_logger
;
#endif
int
cpu_count
;
#ifdef
Py_GIL_DISABLED
int
enable_gil
;
int
tlbc_enabled
;
#endif
int
lazy_imports
;
/* --- Path configuration inputs ------------ */
int
pathconfig_warnings
;
wchar_t
*
program_name
;
wchar_t
*
pythonpath_env
;
wchar_t
*
home
;
wchar_t
*
platlibdir
;
/* --- Path configuration outputs ----------- */
int
module_search_paths_set
;
PyWideStringList
module_search_paths
;
wchar_t
*
stdlib_dir
;
wchar_t
*
executable
;
wchar_t
*
base_executable
;
wchar_t
*
prefix
;
wchar_t
*
base_prefix
;
wchar_t
*
exec_prefix
;
wchar_t
*
base_exec_prefix
;
/* --- Parameter only used by Py_Main() ---------- */
int
skip_source_first_line
;
wchar_t
*
run_command
;
wchar_t
*
run_module
;
wchar_t
*
run_filename
;
/* --- Set by Py_Main() -------------------------- */
wchar_t
*
sys_path_0
;
/* --- Private fields ---------------------------- */
// Install importlib? If equals to 0, importlib is not initialized at all.
// Needed by freeze_importlib.
int
_install_importlib
;
// If equal to 0, stop Python initialization before the "main" phase.
int
_init_main
;
// If non-zero, we believe we're running from a source tree.
int
_is_python_build
;
#ifdef
Py_STATS
// If non-zero, turns on statistics gathering.
int
_pystats
;
#endif
#ifdef
Py_DEBUG
// If not empty, import a non-__main__ module before site.py is executed.
// PYTHON_PRESITE=package.module or -X presite=package.module
wchar_t
*
run_presite
;
#endif
}
PyConfig
;
PyAPI_FUNC
(
void
)
PyConfig_InitPythonConfig
(
PyConfig
*
config
);
PyAPI_FUNC
(
void
)
PyConfig_InitIsolatedConfig
(
PyConfig
*
config
);
PyAPI_FUNC
(
void
)
PyConfig_Clear
(
PyConfig
*
);
PyAPI_FUNC
(
PyStatus
)
PyConfig_SetString
(
PyConfig
*
config
,
wchar_t
*
*
config_str
,
const
wchar_t
*
str
);
PyAPI_FUNC
(
PyStatus
)
PyConfig_SetBytesString
(
PyConfig
*
config
,
wchar_t
*
*
config_str
,
const
char
*
str
);
PyAPI_FUNC
(
PyStatus
)
PyConfig_Read
(
PyConfig
*
config
);
PyAPI_FUNC
(
PyStatus
)
PyConfig_SetBytesArgv
(
PyConfig
*
config
,
Py_ssize_t
argc
,
char
*
const
*
argv
);
PyAPI_FUNC
(
PyStatus
)
PyConfig_SetArgv
(
PyConfig
*
config
,
Py_ssize_t
argc
,
wchar_t
*
const
*
argv
);
PyAPI_FUNC
(
PyStatus
)
PyConfig_SetWideStringList
(
PyConfig
*
config
,
PyWideStringList
*
list
,
Py_ssize_t
length
,
wchar_t
*
*
items
);
/* --- PyConfig_Get() ----------------------------------------- */
PyAPI_FUNC
(
PyObject
*
)
PyConfig_Get
(
const
char
*
name
);
PyAPI_FUNC
(
int
)
PyConfig_GetInt
(
const
char
*
name
,
int
*
value
);
PyAPI_FUNC
(
PyObject
*
)
PyConfig_Names
(
void
);
PyAPI_FUNC
(
int
)
PyConfig_Set
(
const
char
*
name
,
PyObject
*
value
);
/* --- Helper functions --------------------------------------- */
/* Get the original command line arguments, before Python modified them.
See also PyConfig.orig_argv. */
PyAPI_FUNC
(
void
)
Py_GetArgcArgv
(
int
*
argc
,
wchar_t
*
*
*
argv
);
// --- PyInitConfig ---------------------------------------------------------
typedef
struct
PyInitConfig
PyInitConfig
;
PyAPI_FUNC
(
PyInitConfig
*
)
PyInitConfig_Create
(
void
);
PyAPI_FUNC
(
void
)
PyInitConfig_Free
(
PyInitConfig
*
config
);
PyAPI_FUNC
(
int
)
PyInitConfig_GetError
(
PyInitConfig
*
config
,
const
char
*
*
err_msg
);
PyAPI_FUNC
(
int
)
PyInitConfig_GetExitCode
(
PyInitConfig
*
config
,
int
*
exitcode
);
PyAPI_FUNC
(
int
)
PyInitConfig_HasOption
(
PyInitConfig
*
config
,
const
char
*
name
);
PyAPI_FUNC
(
int
)
PyInitConfig_GetInt
(
PyInitConfig
*
config
,
const
char
*
name
,
int64_t
*
value
);
PyAPI_FUNC
(
int
)
PyInitConfig_GetStr
(
PyInitConfig
*
config
,
const
char
*
name
,
char
*
*
value
);
PyAPI_FUNC
(
int
)
PyInitConfig_GetStrList
(
PyInitConfig
*
config
,
const
char
*
name
,
size_t
*
length
,
char
*
*
*
items
);
PyAPI_FUNC
(
void
)
PyInitConfig_FreeStrList
(
size_t
length
,
char
*
*
items
);
PyAPI_FUNC
(
int
)
PyInitConfig_SetInt
(
PyInitConfig
*
config
,
const
char
*
name
,
int64_t
value
);
PyAPI_FUNC
(
int
)
PyInitConfig_SetStr
(
PyInitConfig
*
config
,
const
char
*
name
,
const
char
*
value
);
PyAPI_FUNC
(
int
)
PyInitConfig_SetStrList
(
PyInitConfig
*
config
,
const
char
*
name
,
size_t
length
,
char
*
const
*
items
);
PyAPI_FUNC
(
int
)
PyInitConfig_AddModule
(
PyInitConfig
*
config
,
const
char
*
name
,
PyObject
*
(
*
initfunc
)(
void
));
PyAPI_FUNC
(
int
)
Py_InitializeFromInitConfig
(
PyInitConfig
*
config
);
#ifdef
__cplusplus
}
#endif
#endif
/* !Py_LIMITED_API */
#endif
/* !Py_PYCORECONFIG_H */
Back
|
FazBrowse Home
|
New Git URL