Change PyBuffer to Py_buffer to be consistent with other non-object structures like Py_complex. Add some more functionality to the memoryview object.
diff --git a/Include/abstract.h b/Include/abstract.h
index c3c8fd1..38628bb 100644
--- a/Include/abstract.h
+++ b/Include/abstract.h
@@ -542,7 +542,7 @@
/* Return 1 if the getbuffer function is available, otherwise
return 0 */
- PyAPI_FUNC(int) PyObject_GetBuffer(PyObject *obj, PyBuffer *view,
+ PyAPI_FUNC(int) PyObject_GetBuffer(PyObject *obj, Py_buffer *view,
int flags);
/* This is a C-API version of the getbuffer function call. It checks
@@ -552,7 +552,7 @@
*/
- PyAPI_FUNC(void) PyObject_ReleaseBuffer(PyObject *obj, PyBuffer *view);
+ PyAPI_FUNC(void) PyObject_ReleaseBuffer(PyObject *obj, Py_buffer *view);
/* C-API version of the releasebuffer function call. It
@@ -570,7 +570,7 @@
buffer
*/
- PyAPI_FUNC(void *) PyBuffer_GetPointer(PyBuffer *view, Py_ssize_t *indices);
+ PyAPI_FUNC(void *) PyBuffer_GetPointer(Py_buffer *view, Py_ssize_t *indices);
/* Get the memory area pointed to by the indices for the buffer given.
Note that view->ndim is the assumed size of indices
@@ -583,10 +583,10 @@
- PyAPI_FUNC(int) PyBuffer_ToContiguous(void *buf, PyBuffer *view,
+ PyAPI_FUNC(int) PyBuffer_ToContiguous(void *buf, Py_buffer *view,
Py_ssize_t len, char fort);
- PyAPI_FUNC(int) PyBuffer_FromContiguous(PyBuffer *view, void *buf,
+ PyAPI_FUNC(int) PyBuffer_FromContiguous(Py_buffer *view, void *buf,
Py_ssize_t len, char fort);
@@ -611,7 +611,7 @@
/* Copy the data from the src buffer to the buffer of destination
*/
- PyAPI_FUNC(int) PyBuffer_IsContiguous(PyBuffer *view, char fortran);
+ PyAPI_FUNC(int) PyBuffer_IsContiguous(Py_buffer *view, char fortran);
PyAPI_FUNC(void) PyBuffer_FillContiguousStrides(int ndims,
@@ -626,7 +626,7 @@
per element.
*/
- PyAPI_FUNC(int) PyBuffer_FillInfo(PyBuffer *view, void *buf,
+ PyAPI_FUNC(int) PyBuffer_FillInfo(Py_buffer *view, void *buf,
Py_ssize_t len, int readonly,
int flags);