cpython: 863f7c57081b (original) (raw)

Mercurial > cpython

changeset 96042:863f7c57081b

Merge: #23088: Clarify null termination of bytes and strings in C API. [#23088]

R David Murray rdmurray@bitdance.com
date Wed, 13 May 2015 20:32:19 -0400
parents 1e1bb3eb6f93(current diff)99d2f83290c0(diff)
children d56a941865fb
files Doc/c-api/unicode.rst
diffstat 3 files changed, 44 insertions(+), 31 deletions(-)[+] [-] Doc/c-api/bytearray.rst 3 Doc/c-api/bytes.rst 32 Doc/c-api/unicode.rst 40

line wrap: on

line diff

--- a/Doc/c-api/bytearray.rst +++ b/Doc/c-api/bytearray.rst @@ -64,7 +64,8 @@ Direct API functions .. c:function:: char* PyByteArray_AsString(PyObject *bytearray) Return the contents of bytearray as a char array after checking for a

.. c:function:: int PyByteArray_Resize(PyObject *bytearray, Py_ssize_t len)

--- a/Doc/c-api/bytes.rst +++ b/Doc/c-api/bytes.rst @@ -69,8 +69,8 @@ called with a non-bytes parameter. +===================+===============+================================+ | :attr:%% | n/a | The literal % character. | +-------------------+---------------+--------------------------------+

.. c:function:: PyObject* PyBytes_FromFormatV(const char format, va_list vargs) @@ -136,11 +136,13 @@ called with a non-bytes parameter. .. c:function:: char PyBytes_AsString(PyObject *o)

@@ -151,16 +153,18 @@ called with a non-bytes parameter. .. c:function:: int PyBytes_AsStringAndSize(PyObject *obj, char **buffer, Py_ssize_t *length)

@@ -168,14 +172,14 @@ called with a non-bytes parameter. Create a new bytes object in *bytes containing the contents of newpart appended to bytes; the caller will own the new reference. The reference to

.. c:function:: void PyBytes_ConcatAndDel(PyObject **bytes, PyObject *newpart)

--- a/Doc/c-api/unicode.rst +++ b/Doc/c-api/unicode.rst @@ -227,7 +227,10 @@ access internal read-only data of Unicod const char* PyUnicode_AS_DATA(PyObject *o) Return a pointer to a :c:type:Py_UNICODE representation of the object. The

@@ -689,8 +693,9 @@ 3.x, but need to be aware that their use Return a read-only pointer to the Unicode object's internal :c:type:Py_UNICODE buffer, or NULL on error. This will create the :c:type:Py_UNICODE* representation of the object if it is not yet

.. c:function:: Py_UNICODE* PyUnicode_AsUnicodeCopy(PyObject *unicode)

.. c:function:: char* PyUnicode_AsUTF8AndSize(PyObject *unicode, Py_ssize_t *size)