Guido van Rossum | 2e19bd7 | 1998-10-07 14:36:10 +0000 | [diff] [blame] | 1 | |
| 2 | /* Buffer object interface */ |
| 3 | |
| 4 | /* Note: the object's structure is private */ |
| 5 | |
Fred Drake | ea9cb5a | 2000-07-09 00:20:36 +0000 | [diff] [blame] | 6 | #ifndef Py_BUFFEROBJECT_H |
| 7 | #define Py_BUFFEROBJECT_H |
| 8 | #ifdef __cplusplus |
| 9 | extern "C" { |
| 10 | #endif |
| 11 | |
Guido van Rossum | 2e19bd7 | 1998-10-07 14:36:10 +0000 | [diff] [blame] | 12 | |
Mark Hammond | 91a681d | 2002-08-12 07:21:58 +0000 | [diff] [blame] | 13 | PyAPI_DATA(PyTypeObject) PyBuffer_Type; |
Guido van Rossum | 2e19bd7 | 1998-10-07 14:36:10 +0000 | [diff] [blame] | 14 | |
| 15 | #define PyBuffer_Check(op) ((op)->ob_type == &PyBuffer_Type) |
| 16 | |
| 17 | #define Py_END_OF_BUFFER (-1) |
| 18 | |
Mark Hammond | 91a681d | 2002-08-12 07:21:58 +0000 | [diff] [blame] | 19 | PyAPI_FUNC(PyObject *) PyBuffer_FromObject(PyObject *base, |
Fred Drake | ea9cb5a | 2000-07-09 00:20:36 +0000 | [diff] [blame] | 20 | int offset, int size); |
Mark Hammond | 91a681d | 2002-08-12 07:21:58 +0000 | [diff] [blame] | 21 | PyAPI_FUNC(PyObject *) PyBuffer_FromReadWriteObject(PyObject *base, |
Fred Drake | ea9cb5a | 2000-07-09 00:20:36 +0000 | [diff] [blame] | 22 | int offset, |
| 23 | int size); |
Guido van Rossum | 2e19bd7 | 1998-10-07 14:36:10 +0000 | [diff] [blame] | 24 | |
Mark Hammond | 91a681d | 2002-08-12 07:21:58 +0000 | [diff] [blame] | 25 | PyAPI_FUNC(PyObject *) PyBuffer_FromMemory(void *ptr, int size); |
| 26 | PyAPI_FUNC(PyObject *) PyBuffer_FromReadWriteMemory(void *ptr, int size); |
Guido van Rossum | 2e19bd7 | 1998-10-07 14:36:10 +0000 | [diff] [blame] | 27 | |
Mark Hammond | 91a681d | 2002-08-12 07:21:58 +0000 | [diff] [blame] | 28 | PyAPI_FUNC(PyObject *) PyBuffer_New(int size); |
Guido van Rossum | 2e19bd7 | 1998-10-07 14:36:10 +0000 | [diff] [blame] | 29 | |
| 30 | #ifdef __cplusplus |
| 31 | } |
| 32 | #endif |
| 33 | #endif /* !Py_BUFFEROBJECT_H */ |