Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions Doc/c-api/buffer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.



Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Document PyBuffer_ToContiguous().