From e4ea994f20a7fb1d505fca48295a196645dce9b6 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 3 Sep 2010 16:23:29 +0000 Subject: [PATCH] Document PyUnicode_AsUnicodeCopy() --- Doc/c-api/unicode.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst index 4b89f493056..45332796994 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.