From 5a56ce4a0e820fefcd598b94715a7ff7e199858d Mon Sep 17 00:00:00 2001 From: Hai Shi Date: Wed, 11 Sep 2019 11:38:47 -0500 Subject: [PATCH] bpo-37750: Add doc of PyBuffer_FromContiguous (GH-15988) https://bugs.python.org/issue37750 Automerge-Triggered-By: @matrixise --- Doc/c-api/buffer.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Doc/c-api/buffer.rst b/Doc/c-api/buffer.rst index 2536c743b24..fb9d47b16c9 100644 --- a/Doc/c-api/buffer.rst +++ b/Doc/c-api/buffer.rst @@ -483,6 +483,13 @@ Buffer-related functions *indices* must point to an array of ``view->ndim`` indices. +.. c:function:: int PyBuffer_FromContiguous(Py_buffer *view, void *buf, Py_ssize_t len, char fort) + + Copy contiguous *len* bytes from *buf* to *view*. + *fort* can be ``'C'`` or ``'F'`` (for C-style or Fortran-style ordering). + ``0`` is returned on success, ``-1`` on error. + + .. 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*.