diff options
author | Guido van Rossum <guido@python.org> | 2000-03-10 22:35:06 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2000-03-10 22:35:06 (GMT) |
commit | fd9eed33aae55e57c84c654493c470e4ad78bc82 (patch) | |
tree | 6e99dcaa623933cf489d326aff78511e763ad2e3 | |
parent | bd7dfbc146deb31c520d886415ffd2d00f6970b0 (diff) | |
download | cpython-fd9eed33aae55e57c84c654493c470e4ad78bc82.zip cpython-fd9eed33aae55e57c84c654493c470e4ad78bc82.tar.gz cpython-fd9eed33aae55e57c84c654493c470e4ad78bc82.tar.bz2 |
Marc-Andre Lemburg: added declarations for PyObject_AsCharBuffer,
PyObject_AsReadBuffer, PyObject_AsWriteBuffer.
-rw-r--r-- | Include/abstract.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/Include/abstract.h b/Include/abstract.h index 0d6744d..12d799d 100644 --- a/Include/abstract.h +++ b/Include/abstract.h @@ -436,6 +436,52 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ This is the equivalent of the Python statement: del o[key]. */ + DL_IMPORT(int) PyObject_AsCharBuffer(PyObject *obj, + const char **buffer, + int *buffer_len); + + /* + Takes an arbitrary object which must support the (character, + single segment) buffer interface and returns a pointer to a + read-only memory location useable as character based input + for subsequent processing. + + 0 is returned on success. buffer and buffer_len are only + set in case no error occurrs. Otherwise, -1 is returned and + an exception set. + + */ + + DL_IMPORT(int) PyObject_AsReadBuffer(PyObject *obj, + const void **buffer, + int *buffer_len); + + /* + Same as PyObject_AsCharBuffer() except that this API expects + (readable, single segment) buffer interface and returns a + pointer to a read-only memory location which can contain + arbitrary data. + + 0 is returned on success. buffer and buffer_len are only + set in case no error occurrs. Otherwise, -1 is returned and + an exception set. + + */ + + DL_IMPORT(int) PyObject_AsWriteBuffer(PyObject *obj, + void **buffer, + int *buffer_len); + + /* + Takes an arbitrary object which must support the (writeable, + single segment) buffer interface and returns a pointer to a + writeable memory location in buffer of size buffer_len. + + 0 is returned on success. buffer and buffer_len are only + set in case no error occurrs. Otherwise, -1 is returned and + an exception set. + + */ /* Number Protocol:*/ |