blob: 0bdc4c5a43e07d53e0543756240911a925cd0cee [file] [log] [blame]
Guido van Rossum2e19bd71998-10-07 14:36:10 +00001#ifndef Py_BUFFEROBJECT_H
2#define Py_BUFFEROBJECT_H
3#ifdef __cplusplus
4extern "C" {
5#endif
6
7/***********************************************************
8Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
9The Netherlands.
10
11 All Rights Reserved
12
13Permission to use, copy, modify, and distribute this software and its
14documentation for any purpose and without fee is hereby granted,
15provided that the above copyright notice appear in all copies and that
16both that copyright notice and this permission notice appear in
17supporting documentation, and that the names of Stichting Mathematisch
18Centrum or CWI or Corporation for National Research Initiatives or
19CNRI not be used in advertising or publicity pertaining to
20distribution of the software without specific, written prior
21permission.
22
23While CWI is the initial source for this software, a modified version
24is made available by the Corporation for National Research Initiatives
25(CNRI) at the Internet address ftp://ftp.python.org.
26
27STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH
28REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
29MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH
30CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
31DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
32PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
33TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
34PERFORMANCE OF THIS SOFTWARE.
35
36******************************************************************/
37
38/* Buffer object interface */
39
40/* Note: the object's structure is private */
41
42
43extern DL_IMPORT(PyTypeObject) PyBuffer_Type;
44
45#define PyBuffer_Check(op) ((op)->ob_type == &PyBuffer_Type)
46
47#define Py_END_OF_BUFFER (-1)
48
Guido van Rossum43466ec1998-12-04 18:48:25 +000049extern DL_IMPORT(PyObject *) PyBuffer_FromObject Py_PROTO((PyObject *base, int offset, int size));
50extern DL_IMPORT(PyObject *) PyBuffer_FromReadWriteObject Py_PROTO((PyObject *base, int offset, int size));
Guido van Rossum2e19bd71998-10-07 14:36:10 +000051
Guido van Rossum43466ec1998-12-04 18:48:25 +000052extern DL_IMPORT(PyObject *) PyBuffer_FromMemory Py_PROTO((void *ptr, int size));
53extern DL_IMPORT(PyObject *) PyBuffer_FromReadWriteMemory Py_PROTO((void *ptr, int size));
Guido van Rossum2e19bd71998-10-07 14:36:10 +000054
Guido van Rossum43466ec1998-12-04 18:48:25 +000055extern DL_IMPORT(PyObject *) PyBuffer_New Py_PROTO((int size));
Guido van Rossum2e19bd71998-10-07 14:36:10 +000056
57#ifdef __cplusplus
58}
59#endif
60#endif /* !Py_BUFFEROBJECT_H */
61