summaryrefslogtreecommitdiffstats
path: root/Modules
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 /Modules
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 'Modules')
-rw-r--r--Modules/_ctypes/_ctypes.c4
-rw-r--r--Modules/_hashopenssl.c8
-rw-r--r--Modules/_sre.c2
-rw-r--r--Modules/arraymodule.c4
-rw-r--r--Modules/mmapmodule.c4
5 files changed, 11 insertions, 11 deletions
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
index 071f4c8..67514c0 100644
--- a/Modules/_ctypes/_ctypes.c
+++ b/Modules/_ctypes/_ctypes.c
@@ -740,7 +740,7 @@ CharArray_set_raw(CDataObject *self, PyObject *value)
char *ptr;
Py_ssize_t size;
int rel = 0;
- PyBuffer view;
+ Py_buffer view;
if (PyBuffer_Check(value)) {
if (PyObject_GetBuffer(value, &view, PyBUF_SIMPLE) < 0)
@@ -2083,7 +2083,7 @@ static PyMemberDef CData_members[] = {
{ NULL },
};
-static int CData_GetBuffer(PyObject *_self, PyBuffer *view, int flags)
+static int CData_GetBuffer(PyObject *_self, Py_buffer *view, int flags)
{
CDataObject *self = (CDataObject *)_self;
return PyBuffer_FillInfo(view, self->b_ptr, self->b_size, 0, flags);
diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c
index ad38cfd..252a2ae 100644
--- a/Modules/_hashopenssl.c
+++ b/Modules/_hashopenssl.c
@@ -176,7 +176,7 @@ static PyObject *
EVP_update(EVPobject *self, PyObject *args)
{
PyObject *obj;
- PyBuffer view;
+ Py_buffer view;
if (!PyArg_ParseTuple(args, "O:update", &obj))
return NULL;
@@ -252,7 +252,7 @@ EVP_tp_init(EVPobject *self, PyObject *args, PyObject *kwds)
static char *kwlist[] = {"name", "string", NULL};
PyObject *name_obj = NULL;
PyObject *data_obj = NULL;
- PyBuffer view;
+ Py_buffer view;
char *nameStr;
const EVP_MD *digest;
@@ -397,7 +397,7 @@ EVP_new(PyObject *self, PyObject *args, PyObject *kwdict)
static char *kwlist[] = {"name", "string", NULL};
PyObject *name_obj = NULL;
PyObject *data_obj = NULL;
- PyBuffer view = { 0 };
+ Py_buffer view = { 0 };
PyObject *ret_obj;
char *name;
const EVP_MD *digest;
@@ -437,7 +437,7 @@ EVP_new(PyObject *self, PyObject *args, PyObject *kwdict)
EVP_new_ ## NAME (PyObject *self, PyObject *args) \
{ \
PyObject *data_obj = NULL; \
- PyBuffer view = { 0 }; \
+ Py_buffer view = { 0 }; \
PyObject *ret_obj; \
\
if (!PyArg_ParseTuple(args, "|O:" #NAME , &data_obj)) { \
diff --git a/Modules/_sre.c b/Modules/_sre.c
index a32539e..1868657 100644
--- a/Modules/_sre.c
+++ b/Modules/_sre.c
@@ -1672,7 +1672,7 @@ getstring(PyObject* string, Py_ssize_t* p_length, int* p_charsize)
Py_ssize_t size, bytes;
int charsize;
void* ptr;
- PyBuffer view;
+ Py_buffer view;
/* get pointer to string buffer */
view.len = -1;
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c
index afe4587..27f0365 100644
--- a/Modules/arraymodule.c
+++ b/Modules/arraymodule.c
@@ -1784,7 +1784,7 @@ static const void *emptybuf = "";
static int
-array_buffer_getbuf(arrayobject *self, PyBuffer *view, int flags)
+array_buffer_getbuf(arrayobject *self, Py_buffer *view, int flags)
{
if ((flags & PyBUF_CHARACTER)) {
PyErr_SetString(PyExc_TypeError,
@@ -1825,7 +1825,7 @@ array_buffer_getbuf(arrayobject *self, PyBuffer *view, int flags)
}
static void
-array_buffer_relbuf(arrayobject *self, PyBuffer *view)
+array_buffer_relbuf(arrayobject *self, Py_buffer *view)
{
self->ob_exports--;
}
diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c
index cbea1c4..c2ed5d1 100644
--- a/Modules/mmapmodule.c
+++ b/Modules/mmapmodule.c
@@ -601,7 +601,7 @@ static struct PyMethodDef mmap_object_methods[] = {
/* Functions for treating an mmap'ed file as a buffer */
static int
-mmap_buffer_getbuf(mmap_object *self, PyBuffer *view, int flags)
+mmap_buffer_getbuf(mmap_object *self, Py_buffer *view, int flags)
{
CHECK_VALID(-1);
if (PyBuffer_FillInfo(view, self->data, self->size,
@@ -612,7 +612,7 @@ mmap_buffer_getbuf(mmap_object *self, PyBuffer *view, int flags)
}
static void
-mmap_buffer_releasebuf(mmap_object *self, PyBuffer *view)
+mmap_buffer_releasebuf(mmap_object *self, Py_buffer *view)
{
self->exports--;
}