Guido van Rossum | 2e19bd7 | 1998-10-07 14:36:10 +0000 | [diff] [blame] | 1 | /*********************************************************** |
Guido van Rossum | fd71b9e | 2000-06-30 23:50:40 +0000 | [diff] [blame] | 2 | Copyright (c) 2000, BeOpen.com. |
| 3 | Copyright (c) 1995-2000, Corporation for National Research Initiatives. |
| 4 | Copyright (c) 1990-1995, Stichting Mathematisch Centrum. |
| 5 | All rights reserved. |
Guido van Rossum | 2e19bd7 | 1998-10-07 14:36:10 +0000 | [diff] [blame] | 6 | |
Guido van Rossum | fd71b9e | 2000-06-30 23:50:40 +0000 | [diff] [blame] | 7 | See the file "Misc/COPYRIGHT" for information on usage and |
| 8 | redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
Guido van Rossum | 2e19bd7 | 1998-10-07 14:36:10 +0000 | [diff] [blame] | 9 | ******************************************************************/ |
| 10 | |
| 11 | /* Buffer object interface */ |
| 12 | |
| 13 | /* Note: the object's structure is private */ |
| 14 | |
Fred Drake | ea9cb5a | 2000-07-09 00:20:36 +0000 | [diff] [blame] | 15 | #ifndef Py_BUFFEROBJECT_H |
| 16 | #define Py_BUFFEROBJECT_H |
| 17 | #ifdef __cplusplus |
| 18 | extern "C" { |
| 19 | #endif |
| 20 | |
Guido van Rossum | 2e19bd7 | 1998-10-07 14:36:10 +0000 | [diff] [blame] | 21 | |
| 22 | extern DL_IMPORT(PyTypeObject) PyBuffer_Type; |
| 23 | |
| 24 | #define PyBuffer_Check(op) ((op)->ob_type == &PyBuffer_Type) |
| 25 | |
| 26 | #define Py_END_OF_BUFFER (-1) |
| 27 | |
Fred Drake | ea9cb5a | 2000-07-09 00:20:36 +0000 | [diff] [blame] | 28 | extern DL_IMPORT(PyObject *) PyBuffer_FromObject(PyObject *base, |
| 29 | int offset, int size); |
| 30 | extern DL_IMPORT(PyObject *) PyBuffer_FromReadWriteObject(PyObject *base, |
| 31 | int offset, |
| 32 | int size); |
Guido van Rossum | 2e19bd7 | 1998-10-07 14:36:10 +0000 | [diff] [blame] | 33 | |
Fred Drake | ea9cb5a | 2000-07-09 00:20:36 +0000 | [diff] [blame] | 34 | extern DL_IMPORT(PyObject *) PyBuffer_FromMemory(void *ptr, int size); |
| 35 | extern DL_IMPORT(PyObject *) PyBuffer_FromReadWriteMemory(void *ptr, int size); |
Guido van Rossum | 2e19bd7 | 1998-10-07 14:36:10 +0000 | [diff] [blame] | 36 | |
Fred Drake | ea9cb5a | 2000-07-09 00:20:36 +0000 | [diff] [blame] | 37 | extern DL_IMPORT(PyObject *) PyBuffer_New(int size); |
Guido van Rossum | 2e19bd7 | 1998-10-07 14:36:10 +0000 | [diff] [blame] | 38 | |
| 39 | #ifdef __cplusplus |
| 40 | } |
| 41 | #endif |
| 42 | #endif /* !Py_BUFFEROBJECT_H */ |