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 | |
| 13 | extern DL_IMPORT(PyTypeObject) PyBuffer_Type; |
| 14 | |
| 15 | #define PyBuffer_Check(op) ((op)->ob_type == &PyBuffer_Type) |
| 16 | |
| 17 | #define Py_END_OF_BUFFER (-1) |
| 18 | |
Fred Drake | ea9cb5a | 2000-07-09 00:20:36 +0000 | [diff] [blame] | 19 | extern DL_IMPORT(PyObject *) PyBuffer_FromObject(PyObject *base, |
| 20 | int offset, int size); |
| 21 | extern DL_IMPORT(PyObject *) PyBuffer_FromReadWriteObject(PyObject *base, |
| 22 | int offset, |
| 23 | int size); |
Guido van Rossum | 2e19bd7 | 1998-10-07 14:36:10 +0000 | [diff] [blame] | 24 | |
Fred Drake | ea9cb5a | 2000-07-09 00:20:36 +0000 | [diff] [blame] | 25 | extern DL_IMPORT(PyObject *) PyBuffer_FromMemory(void *ptr, int size); |
| 26 | extern DL_IMPORT(PyObject *) PyBuffer_FromReadWriteMemory(void *ptr, int size); |
Guido van Rossum | 2e19bd7 | 1998-10-07 14:36:10 +0000 | [diff] [blame] | 27 | |
Fred Drake | ea9cb5a | 2000-07-09 00:20:36 +0000 | [diff] [blame] | 28 | extern DL_IMPORT(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 */ |