Skip to content

Commit 18fdc87

Browse files
bpo-33126: Document PyBuffer_ToContiguous() (pythonGH-6292) (pythonGH-6293)
(cherry picked from commit aa50bf0) Co-authored-by: Antoine Pitrou <pitrou@free.fr>
1 parent 9dad016 commit 18fdc87

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

Doc/c-api/buffer.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,15 @@ Buffer-related functions
473473
(*order* is ``'A'``). Return ``0`` otherwise.
474474
475475
476+
.. c:function:: int PyBuffer_ToContiguous(void *buf, Py_buffer *src, Py_ssize_t len, char order)
477+
478+
Copy *len* bytes from *src* to its contiguous representation in *buf*.
479+
*order* can be ``'C'`` or ``'F'`` (for C-style or Fortran-style ordering).
480+
``0`` is returned on success, ``-1`` on error.
481+
482+
This function fails if *len* != *src->len*.
483+
484+
476485
.. c:function:: void PyBuffer_FillContiguousStrides(int ndims, Py_ssize_t *shape, Py_ssize_t *strides, int itemsize, char order)
477486
478487
Fill the *strides* array with byte-strides of a :term:`contiguous` (C-style if
@@ -497,6 +506,3 @@ Buffer-related functions
497506
If this function is used as part of a :ref:`getbufferproc <buffer-structs>`,
498507
*exporter* MUST be set to the exporting object and *flags* must be passed
499508
unmodified. Otherwise, *exporter* MUST be NULL.
500-
501-
502-
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Document PyBuffer_ToContiguous().

0 commit comments

Comments
 (0)