blob: 5a205f3e7c66ce525fc7cb641f9a487103e11960 [file] [log] [blame]
Guido van Rossum2e19bd71998-10-07 14:36:10 +00001/***********************************************************
Guido van Rossumfd71b9e2000-06-30 23:50:40 +00002Copyright (c) 2000, BeOpen.com.
3Copyright (c) 1995-2000, Corporation for National Research Initiatives.
4Copyright (c) 1990-1995, Stichting Mathematisch Centrum.
5All rights reserved.
Guido van Rossum2e19bd71998-10-07 14:36:10 +00006
Guido van Rossumfd71b9e2000-06-30 23:50:40 +00007See the file "Misc/COPYRIGHT" for information on usage and
8redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
Guido van Rossum2e19bd71998-10-07 14:36:10 +00009******************************************************************/
10
11/* Buffer object interface */
12
13/* Note: the object's structure is private */
14
Fred Drakeea9cb5a2000-07-09 00:20:36 +000015#ifndef Py_BUFFEROBJECT_H
16#define Py_BUFFEROBJECT_H
17#ifdef __cplusplus
18extern "C" {
19#endif
20
Guido van Rossum2e19bd71998-10-07 14:36:10 +000021
22extern 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 Drakeea9cb5a2000-07-09 00:20:36 +000028extern DL_IMPORT(PyObject *) PyBuffer_FromObject(PyObject *base,
29 int offset, int size);
30extern DL_IMPORT(PyObject *) PyBuffer_FromReadWriteObject(PyObject *base,
31 int offset,
32 int size);
Guido van Rossum2e19bd71998-10-07 14:36:10 +000033
Fred Drakeea9cb5a2000-07-09 00:20:36 +000034extern DL_IMPORT(PyObject *) PyBuffer_FromMemory(void *ptr, int size);
35extern DL_IMPORT(PyObject *) PyBuffer_FromReadWriteMemory(void *ptr, int size);
Guido van Rossum2e19bd71998-10-07 14:36:10 +000036
Fred Drakeea9cb5a2000-07-09 00:20:36 +000037extern DL_IMPORT(PyObject *) PyBuffer_New(int size);
Guido van Rossum2e19bd71998-10-07 14:36:10 +000038
39#ifdef __cplusplus
40}
41#endif
42#endif /* !Py_BUFFEROBJECT_H */