@@ -8,9 +8,9 @@ extern "C" {
88#endif
99
1010typedef struct {
11- PyObject_HEAD
12- PyObject * base ;
13- Py_buffer view ;
11+ PyObject_HEAD
12+ PyObject * base ;
13+ Py_buffer view ;
1414} PyMemoryViewObject ;
1515
1616
@@ -21,39 +21,40 @@ PyAPI_DATA(PyTypeObject) PyMemoryView_Type;
2121
2222#define Py_END_OF_MEMORY (-1)
2323
24- PyAPI_FUNC (PyObject * ) PyMemoryView_GetContiguous (PyObject * base , int buffertype ,
25- char fort );
24+ PyAPI_FUNC (PyObject * ) PyMemoryView_GetContiguous (PyObject * base ,
25+ int buffertype ,
26+ char fort );
2627
2728 /* Return a contiguous chunk of memory representing the buffer
2829 from an object in a memory view object. If a copy is made then the
29- base object for the memory view will be a *new* bytes object.
30-
31- Otherwise, the base-object will be the object itself and no
32- data-copying will be done.
30+ base object for the memory view will be a *new* bytes object.
31+
32+ Otherwise, the base-object will be the object itself and no
33+ data-copying will be done.
3334
34- The buffertype argument can be PyBUF_READ, PyBUF_WRITE,
35- PyBUF_UPDATEIFCOPY to determine whether the returned buffer
36- should be READONLY, WRITABLE, or set to update the
37- original buffer if a copy must be made. If buffertype is
38- PyBUF_WRITE and the buffer is not contiguous an error will
39- be raised. In this circumstance, the user can use
40- PyBUF_UPDATEIFCOPY to ensure that a a writable temporary
41- contiguous buffer is returned. The contents of this
42- contiguous buffer will be copied back into the original
43- object after the memoryview object is deleted as long as
44- the original object is writable and allows setting its
45- memory to "readonly". If this is not allowed by the
46- original object, then a BufferError is raised.
35+ The buffertype argument can be PyBUF_READ, PyBUF_WRITE,
36+ PyBUF_SHADOW to determine whether the returned buffer
37+ should be READONLY, WRITABLE, or set to update the
38+ original buffer if a copy must be made. If buffertype is
39+ PyBUF_WRITE and the buffer is not contiguous an error will
40+ be raised. In this circumstance, the user can use
41+ PyBUF_SHADOW to ensure that a a writable temporary
42+ contiguous buffer is returned. The contents of this
43+ contiguous buffer will be copied back into the original
44+ object after the memoryview object is deleted as long as
45+ the original object is writable and allows setting an
46+ exclusive write lock. If this is not allowed by the
47+ original object, then a BufferError is raised.
4748
48- If the object is multi-dimensional and if fortran is 'F',
49- the first dimension of the underlying array will vary the
50- fastest in the buffer. If fortran is 'C', then the last
51- dimension will vary the fastest (C-style contiguous). If
52- fortran is 'A', then it does not matter and you will get
53- whatever the object decides is more efficient.
49+ If the object is multi-dimensional and if fortran is 'F',
50+ the first dimension of the underlying array will vary the
51+ fastest in the buffer. If fortran is 'C', then the last
52+ dimension will vary the fastest (C-style contiguous). If
53+ fortran is 'A', then it does not matter and you will get
54+ whatever the object decides is more efficient.
5455
55- A new reference is returned that must be DECREF'd when finished.
56- */
56+ A new reference is returned that must be DECREF'd when finished.
57+ */
5758
5859PyAPI_FUNC (PyObject * ) PyMemoryView_FromObject (PyObject * base );
5960
0 commit comments