diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-09-11 17:09:57 (GMT) |
---|---|---|
committer | Stéphane Wirtel <stephane@wirtel.be> | 2019-09-11 17:09:57 (GMT) |
commit | 4cab7eb9e1f4afc44bac4889de034e031d462e7a (patch) | |
tree | ed48ca7cddcab479ecbc6196e80eb7773ba80a25 | |
parent | 0b7f3706e6a4d72f7e9988cebc4826ad2c4c4753 (diff) | |
download | cpython-4cab7eb9e1f4afc44bac4889de034e031d462e7a.zip cpython-4cab7eb9e1f4afc44bac4889de034e031d462e7a.tar.gz cpython-4cab7eb9e1f4afc44bac4889de034e031d462e7a.tar.bz2 |
bpo-37750: Add doc of PyBuffer_FromContiguous (GH-15988) (GH-15990)
https://bugs.python.org/issue37750
Automerge-Triggered-By: @matrixise
(cherry picked from commit 5a56ce4a0e820fefcd598b94715a7ff7e199858d)
Co-authored-by: Hai Shi <shihai1992@gmail.com>
-rw-r--r-- | Doc/c-api/buffer.rst | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Doc/c-api/buffer.rst b/Doc/c-api/buffer.rst index fdb8bd1..06941e1 100644 --- a/Doc/c-api/buffer.rst +++ b/Doc/c-api/buffer.rst @@ -481,6 +481,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*. |