mirror of
https://github.com/python/cpython.git
synced 2025-10-02 05:12:23 +00:00
bpo-33126: Document PyBuffer_ToContiguous() (GH-6292) (GH-6294)
(cherry picked from commit aa50bf08e6
)
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
This commit is contained in:
parent
6cb556ffa6
commit
6124d8ec0d
2 changed files with 10 additions and 3 deletions
|
@ -473,6 +473,15 @@ Buffer-related functions
|
||||||
(*order* is ``'A'``). Return ``0`` otherwise.
|
(*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)
|
.. 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
|
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>`,
|
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
|
*exporter* MUST be set to the exporting object and *flags* must be passed
|
||||||
unmodified. Otherwise, *exporter* MUST be NULL.
|
unmodified. Otherwise, *exporter* MUST be NULL.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Document PyBuffer_ToContiguous().
|
Loading…
Add table
Add a link
Reference in a new issue