summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-09-03 16:23:29 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-09-03 16:23:29 (GMT)
commite4ea994f20a7fb1d505fca48295a196645dce9b6 (patch)
treed35048d0d39fd256a36fffe5f2b77833f360d532 /Doc
parent46408606d80347108a6550805d29402d2771bda3 (diff)
downloadcpython-e4ea994f20a7fb1d505fca48295a196645dce9b6.zip
cpython-e4ea994f20a7fb1d505fca48295a196645dce9b6.tar.gz
cpython-e4ea994f20a7fb1d505fca48295a196645dce9b6.tar.bz2
Document PyUnicode_AsUnicodeCopy()
Diffstat (limited to 'Doc')
-rw-r--r--Doc/c-api/unicode.rst8
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst
index 4b89f49..4533279 100644
--- a/Doc/c-api/unicode.rst
+++ b/Doc/c-api/unicode.rst
@@ -335,6 +335,14 @@ APIs:
buffer, *NULL* if *unicode* is not a Unicode object.
+.. cfunction:: Py_UNICODE* PyUnicode_AsUnicodeCopy(PyObject *unicode)
+
+ Create a copy of a unicode string ending with a nul character. Return *NULL*
+ and raise a :exc:`MemoryError` exception on memory allocation failure,
+ otherwise return a new allocated buffer (use :cfunc:`PyMem_Free` to free the
+ buffer).
+
+
.. cfunction:: Py_ssize_t PyUnicode_GetSize(PyObject *unicode)
Return the length of the Unicode object.