Add an optional size argument to _Py_char2wchar()

_Py_char2wchar() callers usually need the result size in characters. Since it's
trivial to compute it in _Py_char2wchar() (O(1) whereas wcslen() is O(n)), add
an option to get it.
This commit is contained in:
Victor Stinner 2010-10-16 23:16:16 +00:00
parent 0a1b8cba90
commit 168e117e0a
5 changed files with 26 additions and 17 deletions

View file

@ -6,7 +6,8 @@ extern "C" {
#endif
PyAPI_FUNC(wchar_t *) _Py_char2wchar(
const char *arg);
const char *arg,
size_t *size);
PyAPI_FUNC(char*) _Py_wchar2char(
const wchar_t *text);