From fea3e8dbd03045a3840ba83f29e5e6ca9bf53997 Mon Sep 17 00:00:00 2001 From: hai shi Date: Mon, 29 Jul 2019 02:07:14 +0800 Subject: [PATCH 1/2] Add doc of PyBuffer_GetPointer --- Doc/c-api/buffer.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Doc/c-api/buffer.rst b/Doc/c-api/buffer.rst index 7553efc2cfbc1e..735f321502228b 100644 --- a/Doc/c-api/buffer.rst +++ b/Doc/c-api/buffer.rst @@ -475,6 +475,11 @@ Buffer-related functions (*order* is ``'A'``). Return ``0`` otherwise. This function always succeeds. +.. c:function:: void* PyBuffer_GetPointer(Py_buffer *view, Py_ssize_t *indices) + + Return the memory area pointer by the *indices* for the *view* buffer given. + + .. c:function:: int PyBuffer_ToContiguous(void *buf, Py_buffer *src, Py_ssize_t len, char order) Copy *len* bytes from *src* to its contiguous representation in *buf*. From e8f7e9030c1580def9a3137828df7991bb7caa66 Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Wed, 31 Jul 2019 16:39:59 +0200 Subject: [PATCH 2/2] Fix wording --- Doc/c-api/buffer.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/c-api/buffer.rst b/Doc/c-api/buffer.rst index 735f321502228b..fdb8bd19d218d2 100644 --- a/Doc/c-api/buffer.rst +++ b/Doc/c-api/buffer.rst @@ -477,7 +477,8 @@ Buffer-related functions .. c:function:: void* PyBuffer_GetPointer(Py_buffer *view, Py_ssize_t *indices) - Return the memory area pointer by the *indices* for the *view* buffer given. + Get the memory area pointed to by the *indices* inside the given *view*. + *indices* must point to an array of ``view->ndim`` indices. .. c:function:: int PyBuffer_ToContiguous(void *buf, Py_buffer *src, Py_ssize_t len, char order)