Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
c1f44af1
Commit
c1f44af1
authored
Nov 20, 2008
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix Sphinx table warning
parent
40e8246f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
89 additions
and
89 deletions
+89
-89
Doc/c-api/buffer.rst
Doc/c-api/buffer.rst
+89
-89
No files found.
Doc/c-api/buffer.rst
View file @
c1f44af1
...
@@ -159,95 +159,95 @@ Buffer related functions
...
@@ -159,95 +159,95 @@ Buffer related functions
The following table gives possible values to the *flags* arguments.
The following table gives possible values to the *flags* arguments.
+------------------------------+-----------------------------------------------+
+------------------------------+-----------------------------------------------
----
+
| Flag | Description |
| Flag | Description
|
+==============================+===============================================+
+==============================+===============================================
====
+
| :cmacro:`PyBUF_SIMPLE` |
This is the default flag state. The returned
|
| :cmacro:`PyBUF_SIMPLE` |
This is the default flag state. The returned
|
| |
buffer may or may not have writable memory.
|
| |
buffer may or may not have writable memory. The
|
| |
The format will be assumed to be unsigned bytes
|
| |
format of the data will be assumed to be unsigned
|
| |
. This is a "stand-alone" flag constant. It
|
| |
bytes. This is a "stand-alone" flag constant. It
|
| |
never needs to be |'d to the others. The
|
| |
never needs to be '|'d to the others. The exporter
|
| |
exporter will raise an error if it cannot
|
| |
will raise an error if it cannot provide such a
|
| |
provide such a contiguous buffer of bytes.
|
| |
contiguous buffer of bytes.
|
| | |
| |
|
+------------------------------+-----------------------------------------------+
+------------------------------+-----------------------------------------------
----
+
| :cmacro:`PyBUF_WRITABLE` |
The returned buffer must be writable. If it is
|
| :cmacro:`PyBUF_WRITABLE` |
The returned buffer must be writable. If it is
|
| |
not writable, then raise an error.
|
| |
not writable, then raise an error.
|
+------------------------------+-----------------------------------------------+
+------------------------------+-----------------------------------------------
----
+
| :cmacro:`PyBUF_STRIDES` |
This implies :cmacro:`PyBUF_ND`. The returned
|
| :cmacro:`PyBUF_STRIDES` |
This implies :cmacro:`PyBUF_ND`. The returned
|
| |
buffer must provide strides information
|
| |
buffer must provide strides information (i.e. the
|
| |
(i.e. the strides cannot be NULL). This would
|
| |
strides cannot be NULL). This would be used when
|
| |
be used when the consumer can handle strided,
|
| |
the consumer can handle strided, discontiguous
|
| |
discontiguous arrays. Handling strides
|
| |
arrays. Handling strides automatically assumes
|
| |
automatically assumes you can handle shape. The
|
| |
you can handle shape. The exporter can raise an
|
| |
exporter may raise an error if cannot provide a
|
| |
error if a strided representation of the data is
|
| |
strided-only representation of the data
|
| |
not possible (i.e. without the suboffsets).
|
| |
(i.e. without the suboffsets).
|
| |
|
+------------------------------+-----------------------------------------------+
+------------------------------+-----------------------------------------------
----
+
| :cmacro:`PyBUF_ND` |
The returned buffer must provide shape
|
| :cmacro:`PyBUF_ND` |
The returned buffer must provide shape
|
| |
information. The memory will be assumed C-style
|
| |
information. The memory will be assumed C-style
|
| |
contiguous (last dimension varies the
|
| |
contiguous (last dimension varies the
|
| |
fastest). The exporter may raise an error if it
|
| |
fastest). The exporter may raise an error if it
|
| |
cannot provide this kind of contiguous
|
| |
cannot provide this kind of contiguous buffer. If
|
| |
buffer. If this is not given then shape will be
|
| |
this is not given then shape will be *NULL*.
|
| |
*NULL*.
|
| |
|
| | |
| |
|
| | |
| |
|
+------------------------------+-----------------------------------------------+
+------------------------------+-----------------------------------------------
----
+
|:cmacro:`PyBUF_C_CONTIGUOUS` |
These flags indicate that the contiguoity
|
|:cmacro:`PyBUF_C_CONTIGUOUS` |
These flags indicate that the contiguity returned
|
|:cmacro:`PyBUF_F_CONTIGUOUS` |
returned buffer must be respectively,
|
|:cmacro:`PyBUF_F_CONTIGUOUS` |
buffer must be respectively, C-contiguous (last
|
|:cmacro:`PyBUF_ANY_CONTIGUOUS`|
C-contiguous (last dimension varies the
|
|:cmacro:`PyBUF_ANY_CONTIGUOUS`|
dimension varies the fastest), Fortran contiguous
|
| |
fastest), Fortran contiguous (first dimension
|
| |
(first dimension varies the fastest) or either
|
| |
varies the fastest) or either one. All of
|
| |
one. All of these flags imply
|
| |
these flags imply :cmacro:`PyBUF_STRIDES` and
|
| |
:cmacro:`PyBUF_STRIDES` and guarantee that the
|
| |
guarantee that the strides buffer info
|
| |
strides buffer info structure will be filled in
|
| |
structure will be filled in correctly.
|
| |
correctly.
|
| | |
| |
|
+------------------------------+-----------------------------------------------+
+------------------------------+-----------------------------------------------
----
+
| :cmacro:`PyBUF_INDIRECT` |
This implies :cmacro:`PyBUF_STRIDES`. The
|
| :cmacro:`PyBUF_INDIRECT` |
This flag indicates the returned buffer must have
|
| |
returned buffer must have suboffsets
|
| |
suboffsets information (which can be NULL if no
|
| |
information (which can be NULL if no suboffsets
|
| |
suboffsets are needed). This can be used when
|
| |
are needed). This would be used when the
|
| |
the consumer can handle indirect array
|
| |
consumer can handle indirect array referencing
|
| |
referencing implied by these suboffsets. This
|
| |
implied by these suboffsets.
|
| |
implies :cmacro:`PyBUF_STRIDES`.
|
| | |
| |
|
| | |
| |
|
| | |
| |
|
+------------------------------+-----------------------------------------------+
+------------------------------+-----------------------------------------------
----
+
| :cmacro:`PyBUF_FORMAT` |
The returned buffer must have true format
|
| :cmacro:`PyBUF_FORMAT` |
The returned buffer must have true format
|
| |
information if this flag is provided. This
|
| |
information if this flag is provided. This would
|
| |
would be used when the consumer is going to be
|
| |
be used when the consumer is going to be checking
|
| |
checking for what 'kind' of data is actually
|
| |
for what 'kind' of data is actually stored. An
|
| |
stored. An exporter should always be able to
|
| |
exporter should always be able to provide this
|
| |
provide this information if requested. If
|
| |
information if requested. If format is not
|
| |
format is not explicitly requested then the
|
| |
explicitly requested then the format must be
|
| |
format must be returned as *NULL* (which means
|
| |
returned as *NULL* (which means ``'B'``, or
|
| |
``'B'``, or unsigned bytes)
|
| |
unsigned bytes)
|
+------------------------------+-----------------------------------------------+
+------------------------------+-----------------------------------------------
----
+
| :cmacro:`PyBUF_STRIDED` |
This is equivalent to ``(PyBUF_STRIDES |
|
| :cmacro:`PyBUF_STRIDED` |
This is equivalent to ``(PyBUF_STRIDES |
|
| |
PyBUF_WRITABLE)``.
|
| |
PyBUF_WRITABLE)``.
|
+------------------------------+-----------------------------------------------+
+------------------------------+-----------------------------------------------
----
+
| :cmacro:`PyBUF_STRIDED_RO` |
This is equivalent to ``(PyBUF_STRIDES)``.
|
| :cmacro:`PyBUF_STRIDED_RO` |
This is equivalent to ``(PyBUF_STRIDES)``.
|
| | |
| |
|
+------------------------------+-----------------------------------------------+
+------------------------------+-----------------------------------------------
----
+
| :cmacro:`PyBUF_RECORDS` |
This is equivalent to ``(PyBUF_STRIDES |
|
| :cmacro:`PyBUF_RECORDS` |
This is equivalent to ``(PyBUF_STRIDES |
|
| |
PyBUF_FORMAT | PyBUF_WRITABLE)``.
|
| |
PyBUF_FORMAT | PyBUF_WRITABLE)``.
|
+------------------------------+-----------------------------------------------+
+------------------------------+-----------------------------------------------
----
+
| :cmacro:`PyBUF_RECORDS_RO` |
This is equivalent to ``(PyBUF_STRIDES |
|
| :cmacro:`PyBUF_RECORDS_RO` |
This is equivalent to ``(PyBUF_STRIDES |
|
| |
PyBUF_FORMAT)``.
|
| |
PyBUF_FORMAT)``.
|
+------------------------------+-----------------------------------------------+
+------------------------------+-----------------------------------------------
----
+
| :cmacro:`PyBUF_FULL` |
This is equivalent to ``(PyBUF_INDIRECT |
|
| :cmacro:`PyBUF_FULL` |
This is equivalent to ``(PyBUF_INDIRECT |
|
| |
PyBUF_FORMAT | PyBUF_WRITABLE)``.
|
| |
PyBUF_FORMAT | PyBUF_WRITABLE)``.
|
+------------------------------+-----------------------------------------------+
+------------------------------+-----------------------------------------------
----
+
| :cmacro:`PyBUF_FULL_RO`` |
This is equivalent to ``(PyBUF_INDIRECT |
|
| :cmacro:`PyBUF_FULL_RO`` |
This is equivalent to ``(PyBUF_INDIRECT |
|
| |
PyBUF_FORMAT)``.
|
| |
PyBUF_FORMAT)``.
|
+------------------------------+-----------------------------------------------+
+------------------------------+-----------------------------------------------
----
+
| :cmacro:`PyBUF_CONTIG` |
This is equivalent to ``(PyBUF_ND |
|
| :cmacro:`PyBUF_CONTIG` |
This is equivalent to ``(PyBUF_ND |
|
| |
PyBUF_WRITABLE)``.
|
| |
PyBUF_WRITABLE)``.
|
+------------------------------+-----------------------------------------------+
+------------------------------+-----------------------------------------------
----
+
| :cmacro:`PyBUF_CONTIG_RO` |
This is equivalent to ``(PyBUF_ND)``.
|
| :cmacro:`PyBUF_CONTIG_RO` |
This is equivalent to ``(PyBUF_ND)``.
|
| | |
| |
|
+------------------------------+-----------------------------------------------+
+------------------------------+-----------------------------------------------
----
+
.. cfunction:: void PyBuffer_Release(PyObject *obj, Py_buffer *view)
.. cfunction:: void PyBuffer_Release(PyObject *obj, Py_buffer *view)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment