Add PyObject_CheckReadBuffer(), which returns true if its argument

supports the single-segment readable buffer interface.

Add documentation for this and other PyObject_XXXBuffer() calls.
This commit is contained in:
Jeremy Hylton 2001-11-09 21:59:42 +00:00
parent da4ffeecf5
commit 89c3a22a27
3 changed files with 83 additions and 29 deletions

View file

@ -468,6 +468,15 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
DL_IMPORT(int) PyObject_CheckReadBuffer(PyObject *obj);
/*
Checks whether an arbitrary object supports the (character,
single segment) buffer interface. Returns 1 on success, 0
on failure.
*/
DL_IMPORT(int) PyObject_AsReadBuffer(PyObject *obj,
const void **buffer,
int *buffer_len);