diff options
author | AN Long <aisk@users.noreply.github.com> | 2022-06-06 23:47:27 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-06 23:47:27 (GMT) |
commit | 3256b178ed31ee8ed0c04a6e53f67d1ef96cb746 (patch) | |
tree | e7a0159b366291d657ebe5c101cbc46513b91850 /Modules/clinic | |
parent | bb0b7689465c3aac3b1d7f68c8990009462c1ae5 (diff) | |
download | cpython-3256b178ed31ee8ed0c04a6e53f67d1ef96cb746.zip cpython-3256b178ed31ee8ed0c04a6e53f67d1ef96cb746.tar.gz cpython-3256b178ed31ee8ed0c04a6e53f67d1ef96cb746.tar.bz2 |
bpo-42658: Use LCMapStringEx in ntpath.normcase to match OS behaviour for case-folding (GH-32010)
Diffstat (limited to 'Modules/clinic')
-rw-r--r-- | Modules/clinic/_winapi.c.h | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/Modules/clinic/_winapi.c.h b/Modules/clinic/_winapi.c.h index 4d89888..486029a 100644 --- a/Modules/clinic/_winapi.c.h +++ b/Modules/clinic/_winapi.c.h @@ -820,6 +820,43 @@ exit: return return_value; } +PyDoc_STRVAR(_winapi_LCMapStringEx__doc__, +"LCMapStringEx($module, /, locale, flags, src)\n" +"--\n" +"\n"); + +#define _WINAPI_LCMAPSTRINGEX_METHODDEF \ + {"LCMapStringEx", _PyCFunction_CAST(_winapi_LCMapStringEx), METH_FASTCALL|METH_KEYWORDS, _winapi_LCMapStringEx__doc__}, + +static PyObject * +_winapi_LCMapStringEx_impl(PyObject *module, LPCWSTR locale, DWORD flags, + LPCWSTR src); + +static PyObject * +_winapi_LCMapStringEx(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) +{ + PyObject *return_value = NULL; + static const char * const _keywords[] = {"locale", "flags", "src", NULL}; + static _PyArg_Parser _parser = {"O&kO&:LCMapStringEx", _keywords, 0}; + LPCWSTR locale; + DWORD flags; + LPCWSTR src; + + if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser, + _PyUnicode_WideCharString_Converter, &locale, &flags, _PyUnicode_WideCharString_Converter, &src)) { + goto exit; + } + return_value = _winapi_LCMapStringEx_impl(module, locale, flags, src); + +exit: + /* Cleanup for locale */ + PyMem_Free((void *)locale); + /* Cleanup for src */ + PyMem_Free((void *)src); + + return return_value; +} + PyDoc_STRVAR(_winapi_ReadFile__doc__, "ReadFile($module, /, handle, size, overlapped=False)\n" "--\n" @@ -1164,4 +1201,4 @@ _winapi__mimetypes_read_windows_registry(PyObject *module, PyObject *const *args exit: return return_value; } -/*[clinic end generated code: output=b007dde2e7f2fff8 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=6cdefec63a1d7f12 input=a9049054013a1b77]*/ |