aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-10-16 23:16:16 +0000
committerVictor Stinner <victor.stinner@haypocalc.com>2010-10-16 23:16:16 +0000
commit168e117e0a8825bc3ae0c08f0b08a33ac351a14f (patch)
tree8f9e0067a2d14a362844f891815791d9d41cfb79 /Include/fileutils.h
parent_Py_wrealpath() uses _Py_char2wchar() to decode the result, to support (diff)
downloadcpython-168e117e0a8825bc3ae0c08f0b08a33ac351a14f.tar.gz
cpython-168e117e0a8825bc3ae0c08f0b08a33ac351a14f.tar.bz2
cpython-168e117e0a8825bc3ae0c08f0b08a33ac351a14f.zip
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.
Diffstat (limited to 'Include/fileutils.h')
-rw-r--r--Include/fileutils.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/Include/fileutils.h b/Include/fileutils.h
index cb15936611b..11ebebfba9c 100644
--- a/Include/fileutils.h
+++ b/Include/fileutils.h
@@ -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);