blob: ed2c91db5f6b3287da7166e6232d2df44e42d265 [file] [log] [blame]
Guido van Rossum2e19bd71998-10-07 14:36:10 +00001
2/* Buffer object interface */
3
4/* Note: the object's structure is private */
5
Fred Drakeea9cb5a2000-07-09 00:20:36 +00006#ifndef Py_BUFFEROBJECT_H
7#define Py_BUFFEROBJECT_H
8#ifdef __cplusplus
9extern "C" {
10#endif
11
Guido van Rossum2e19bd71998-10-07 14:36:10 +000012
Mark Hammond91a681d2002-08-12 07:21:58 +000013PyAPI_DATA(PyTypeObject) PyBuffer_Type;
Guido van Rossum2e19bd71998-10-07 14:36:10 +000014
15#define PyBuffer_Check(op) ((op)->ob_type == &PyBuffer_Type)
16
17#define Py_END_OF_BUFFER (-1)
18
Mark Hammond91a681d2002-08-12 07:21:58 +000019PyAPI_FUNC(PyObject *) PyBuffer_FromObject(PyObject *base,
Fred Drakeea9cb5a2000-07-09 00:20:36 +000020 int offset, int size);
Mark Hammond91a681d2002-08-12 07:21:58 +000021PyAPI_FUNC(PyObject *) PyBuffer_FromReadWriteObject(PyObject *base,
Fred Drakeea9cb5a2000-07-09 00:20:36 +000022 int offset,
23 int size);
Guido van Rossum2e19bd71998-10-07 14:36:10 +000024
Mark Hammond91a681d2002-08-12 07:21:58 +000025PyAPI_FUNC(PyObject *) PyBuffer_FromMemory(void *ptr, int size);
26PyAPI_FUNC(PyObject *) PyBuffer_FromReadWriteMemory(void *ptr, int size);
Guido van Rossum2e19bd71998-10-07 14:36:10 +000027
Mark Hammond91a681d2002-08-12 07:21:58 +000028PyAPI_FUNC(PyObject *) PyBuffer_New(int size);
Guido van Rossum2e19bd71998-10-07 14:36:10 +000029
30#ifdef __cplusplus
31}
32#endif
33#endif /* !Py_BUFFEROBJECT_H */