]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Document PyUnicode_AsUnicodeCopy()
authorVictor Stinner <victor.stinner@haypocalc.com>
Fri, 3 Sep 2010 16:23:29 +0000 (16:23 +0000)
committerVictor Stinner <victor.stinner@haypocalc.com>
Fri, 3 Sep 2010 16:23:29 +0000 (16:23 +0000)
Doc/c-api/unicode.rst

index 4b89f493056478366904889ed22164a4602a5413..4533279699495fc1d4848502c15786993b877241 100644 (file)
@@ -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.