]> granicus.if.org Git - python/commitdiff
bpo-37750: Add doc of PyBuffer_FromContiguous (GH-15988) (GH-15990)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 11 Sep 2019 17:09:57 +0000 (10:09 -0700)
committerStéphane Wirtel <stephane@wirtel.be>
Wed, 11 Sep 2019 17:09:57 +0000 (19:09 +0200)
https://bugs.python.org/issue37750

Automerge-Triggered-By: @matrixise
(cherry picked from commit 5a56ce4a0e820fefcd598b94715a7ff7e199858d)

Co-authored-by: Hai Shi <shihai1992@gmail.com>
Doc/c-api/buffer.rst

index fdb8bd19d218d22d9e2a1fc5bb6a42ab91a13fa0..06941e1004097f7f03506497905977218abe7ee3 100644 (file)
@@ -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*.