summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorTravis E. Oliphant <oliphant@enthought.com>2007-09-23 02:00:13 (GMT)
committerTravis E. Oliphant <oliphant@enthought.com>2007-09-23 02:00:13 (GMT)
commit8ae62b60940ae0f33b1792703f3255e9c6a6a88a (patch)
treea7046041eb8d6943b159827500114aa855f69678 /Include
parent3f993c3b52f9799a010b889d20f1bc129eb89704 (diff)
downloadcpython-8ae62b60940ae0f33b1792703f3255e9c6a6a88a.zip
cpython-8ae62b60940ae0f33b1792703f3255e9c6a6a88a.tar.gz
cpython-8ae62b60940ae0f33b1792703f3255e9c6a6a88a.tar.bz2
Change PyBuffer to Py_buffer to be consistent with other non-object structures like Py_complex. Add some more functionality to the memoryview object.
Diffstat (limited to 'Include')
-rw-r--r--Include/abstract.h14
-rw-r--r--Include/memoryobject.h4
-rw-r--r--Include/object.h6
3 files changed, 12 insertions, 12 deletions
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 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
/* 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 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
- 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 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
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 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
- 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 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
/* 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 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
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);
diff --git a/Include/memoryobject.h b/Include/memoryobject.h
index 1713e8f..4426cd8 100644
--- a/Include/memoryobject.h
+++ b/Include/memoryobject.h
@@ -10,7 +10,7 @@ extern "C" {
typedef struct {
PyObject_HEAD
PyObject *base;
- PyBuffer view;
+ Py_buffer view;
} PyMemoryViewObject;
@@ -57,7 +57,7 @@ PyAPI_FUNC(PyObject *) PyMemoryView_GetContiguous(PyObject *base, int buffertype
PyAPI_FUNC(PyObject *) PyMemoryView_FromObject(PyObject *base);
-PyAPI_FUNC(PyObject *) PyMemoryView_FromMemory(PyBuffer *info);
+PyAPI_FUNC(PyObject *) PyMemoryView_FromMemory(Py_buffer *info);
/* create new if bufptr is NULL
will be a new bytesobject in base */
diff --git a/Include/object.h b/Include/object.h
index d03c888..88a3b84 100644
--- a/Include/object.h
+++ b/Include/object.h
@@ -153,10 +153,10 @@ typedef struct bufferinfo {
Py_ssize_t *strides;
Py_ssize_t *suboffsets;
void *internal;
-} PyBuffer;
+} Py_buffer;
-typedef int (*getbufferproc)(PyObject *, PyBuffer *, int);
-typedef void (*releasebufferproc)(PyObject *, PyBuffer *);
+typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
+typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
/* Flags for getting buffers */
#define PyBUF_SIMPLE 0