Checkin of Jack's buffer mods.

Not really checked, but didn't fail any tests either...
This commit is contained in:
Guido van Rossum 1997-05-05 22:15:02 +00:00
parent 8290e07509
commit fdf95dd525
5 changed files with 232 additions and 27 deletions

View file

@ -146,6 +146,9 @@ typedef PyObject *(*intintargfunc) Py_PROTO((PyObject *, int, int));
typedef int(*intobjargproc) Py_PROTO((PyObject *, int, PyObject *));
typedef int(*intintobjargproc) Py_PROTO((PyObject *, int, int, PyObject *));
typedef int(*objobjargproc) Py_PROTO((PyObject *, PyObject *, PyObject *));
typedef int (*getreadbufferproc) Py_PROTO((PyObject *, int, void **));
typedef int (*getwritebufferproc) Py_PROTO((PyObject *, int, void **));
typedef int (*getsegcountproc) Py_PROTO((PyObject *, int *));
typedef struct {
binaryfunc nb_add;
@ -189,6 +192,13 @@ typedef struct {
objobjargproc mp_ass_subscript;
} PyMappingMethods;
typedef struct {
getreadbufferproc bf_getreadbuffer;
getwritebufferproc bf_getwritebuffer;
getsegcountproc bf_getsegcount;
} PyBufferProcs;
typedef void (*destructor) Py_PROTO((PyObject *));
typedef int (*printfunc) Py_PROTO((PyObject *, FILE *, int));
typedef PyObject *(*getattrfunc) Py_PROTO((PyObject *, char *));
@ -227,8 +237,10 @@ typedef struct _typeobject {
getattrofunc tp_getattro;
setattrofunc tp_setattro;
/* Functions to access object as input/output buffer */
PyBufferProcs *tp_as_buffer;
/* Space for future expansion */
long tp_xxx3;
long tp_xxx4;
char *tp_doc; /* Documentation string */