]> granicus.if.org Git - python/commitdiff
bpo-33126: Document PyBuffer_ToContiguous() (#6292)
authorAntoine Pitrou <pitrou@free.fr>
Wed, 28 Mar 2018 15:26:32 +0000 (17:26 +0200)
committerGitHub <noreply@github.com>
Wed, 28 Mar 2018 15:26:32 +0000 (17:26 +0200)
Doc/c-api/buffer.rst
Misc/NEWS.d/next/Documentation/2018-03-28-17-03-17.bpo-33126.5UGkNv.rst [new file with mode: 0644]

index 8c2de9691f3e1a128a024f15c32203a43013b061..5a9a46fc67e8995c42cde4ec2bfc0c42733430db 100644 (file)
@@ -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
@@ -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.
-
-
-
diff --git a/Misc/NEWS.d/next/Documentation/2018-03-28-17-03-17.bpo-33126.5UGkNv.rst b/Misc/NEWS.d/next/Documentation/2018-03-28-17-03-17.bpo-33126.5UGkNv.rst
new file mode 100644 (file)
index 0000000..1219790
--- /dev/null
@@ -0,0 +1 @@
+Document PyBuffer_ToContiguous().