diff options
author | Victor Stinner <vstinner@redhat.com> | 2019-03-15 14:08:05 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-15 14:08:05 (GMT) |
commit | 74f6568bbd3e70806ea3219e8bacb386ad802ccf (patch) | |
tree | 98516f3e71020f12109372492180a835307e129f /Include/internal/pycore_getopt.h | |
parent | 86082c22d23285995a32aabb491527c9f5629556 (diff) | |
download | cpython-74f6568bbd3e70806ea3219e8bacb386ad802ccf.zip cpython-74f6568bbd3e70806ea3219e8bacb386ad802ccf.tar.gz cpython-74f6568bbd3e70806ea3219e8bacb386ad802ccf.tar.bz2 |
bpo-36301: Add _PyWstrList structure (GH-12343)
Replace messy _Py_wstrlist_xxx() functions with a new clean
_PyWstrList structure and new _PyWstrList_xxx() functions.
Changes:
* Add _PyCoreConfig.use_module_search_paths to decide if
_PyCoreConfig.module_search_paths should be computed or not, to
support empty search path list.
* _PyWstrList_Clear() sets length to 0 and items to NULL, whereas
_Py_wstrlist_clear() only freed memory.
* _PyWstrList_Append() returns an int, whereas _Py_wstrlist_append()
returned _PyInitError.
* _PyWstrList uses Py_ssize_t for the length, instead of int.
* Replace (int, wchar_t**) with _PyWstrList in:
* _PyPreConfig
* _PyCoreConfig
* _PyPreCmdline
* _PyCmdline
* Replace "int orig_argv; wchar_t **orig_argv;"
with "_PyWstrList orig_argv".
* _PyCmdline and _PyPreCmdline now also copy wchar_argv.
* Rename _PyArgv_Decode() to _PyArgv_AsWstrList().
* PySys_SetArgvEx() now pass the fixed (argc, argv) to
_PyPathConfig_ComputeArgv0() (don't pass negative argc or NULL
argv).
* _PyOS_GetOpt() uses Py_ssize_t
Diffstat (limited to 'Include/internal/pycore_getopt.h')
-rw-r--r-- | Include/internal/pycore_getopt.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Include/internal/pycore_getopt.h b/Include/internal/pycore_getopt.h index 1d30f5b..0d1897c 100644 --- a/Include/internal/pycore_getopt.h +++ b/Include/internal/pycore_getopt.h @@ -6,8 +6,8 @@ #endif extern int _PyOS_opterr; -extern int _PyOS_optind; -extern wchar_t *_PyOS_optarg; +extern Py_ssize_t _PyOS_optind; +extern const wchar_t *_PyOS_optarg; extern void _PyOS_ResetGetOpt(void); @@ -17,6 +17,6 @@ typedef struct { int val; } _PyOS_LongOption; -extern int _PyOS_GetOpt(int argc, wchar_t **argv, int *longindex); +extern int _PyOS_GetOpt(Py_ssize_t argc, wchar_t **argv, int *longindex); #endif /* !Py_INTERNAL_PYGETOPT_H */ |