9 .. cfunction:: int PyObject_AsCharBuffer(PyObject *obj, const char **buffer, Py_ssize_t *buffer_len)
11 Returns a pointer to a read-only memory location usable as character-based
12 input. The *obj* argument must support the single-segment character buffer
13 interface. On success, returns ``0``, sets *buffer* to the memory location and
14 *buffer_len* to the buffer length. Returns ``-1`` and sets a :exc:`TypeError`
20 .. cfunction:: int PyObject_AsReadBuffer(PyObject *obj, const void **buffer, Py_ssize_t *buffer_len)
22 Returns a pointer to a read-only memory location containing arbitrary data. The
23 *obj* argument must support the single-segment readable buffer interface. On
24 success, returns ``0``, sets *buffer* to the memory location and *buffer_len* to
25 the buffer length. Returns ``-1`` and sets a :exc:`TypeError` on error.
30 .. cfunction:: int PyObject_CheckReadBuffer(PyObject *o)
32 Returns ``1`` if *o* supports the single-segment readable buffer interface.
33 Otherwise returns ``0``.
38 .. cfunction:: int PyObject_AsWriteBuffer(PyObject *obj, void **buffer, Py_ssize_t *buffer_len)
40 Returns a pointer to a writeable memory location. The *obj* argument must
41 support the single-segment, character buffer interface. On success, returns
42 ``0``, sets *buffer* to the memory location and *buffer_len* to the buffer
43 length. Returns ``-1`` and sets a :exc:`TypeError` on error.