blob: e4109aeb134a43e4e2d0d401d72faa27d89f5baf [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
13extern 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 Drakeea9cb5a2000-07-09 00:20:36 +000019extern DL_IMPORT(PyObject *) PyBuffer_FromObject(PyObject *base,
20 int offset, int size);
21extern DL_IMPORT(PyObject *) PyBuffer_FromReadWriteObject(PyObject *base,
22 int offset,
23 int size);
Guido van Rossum2e19bd71998-10-07 14:36:10 +000024
Fred Drakeea9cb5a2000-07-09 00:20:36 +000025extern DL_IMPORT(PyObject *) PyBuffer_FromMemory(void *ptr, int size);
26extern DL_IMPORT(PyObject *) PyBuffer_FromReadWriteMemory(void *ptr, int size);
Guido van Rossum2e19bd71998-10-07 14:36:10 +000027
Fred Drakeea9cb5a2000-07-09 00:20:36 +000028extern DL_IMPORT(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 */