summaryrefslogtreecommitdiff
path: root/Doc/c-api/buffer.rst
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-03-28 08:47:34 -0700
committerAntoine Pitrou <pitrou@free.fr>2018-03-28 17:47:34 +0200
commit18fdc87207ea65b3906f07cb47c51a609e442f93 (patch)
treec6f38808da6b1d35ec8d4f36987a40845fe3aac4 /Doc/c-api/buffer.rst
parent9dad016784848a53d9f2557292025f7a4104c5a5 (diff)
downloadcpython-git-18fdc87207ea65b3906f07cb47c51a609e442f93.tar.gz
bpo-33126: Document PyBuffer_ToContiguous() (GH-6292) (GH-6293)
(cherry picked from commit aa50bf08e64f49d57917ab0b1aadf4308a3168a6) Co-authored-by: Antoine Pitrou <pitrou@free.fr>
Diffstat (limited to 'Doc/c-api/buffer.rst')
-rw-r--r--Doc/c-api/buffer.rst12
1 files changed, 9 insertions, 3 deletions
diff --git a/Doc/c-api/buffer.rst b/Doc/c-api/buffer.rst
index 8c2de9691f..5a9a46fc67 100644
--- a/Doc/c-api/buffer.rst
+++ b/Doc/c-api/buffer.rst
@@ -473,6 +473,15 @@ Buffer-related functions
(*order* is ``'A'``). Return ``0`` otherwise.
+.. 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*.
+ *order* can be ``'C'`` or ``'F'`` (for C-style or Fortran-style ordering).
+ ``0`` is returned on success, ``-1`` on error.
+
+ This function fails if *len* != *src->len*.
+
+
.. c:function:: void PyBuffer_FillContiguousStrides(int ndims, Py_ssize_t *shape, Py_ssize_t *strides, int itemsize, char order)
Fill the *strides* array with byte-strides of a :term:`contiguous` (C-style if
@@ -497,6 +506,3 @@ Buffer-related functions
If this function is used as part of a :ref:`getbufferproc <buffer-structs>`,
*exporter* MUST be set to the exporting object and *flags* must be passed
unmodified. Otherwise, *exporter* MUST be NULL.
-
-
-