| 1 | /* Memory view object. In Python this is available as "memoryview". */ |
| 2 | |
| 3 | #ifndef Py_MEMORYOBJECT_H |
| 4 | #define Py_MEMORYOBJECT_H |
| 5 | #ifdef __cplusplus |
| 6 | extern "C" { |
| 7 | #endif |
| 8 | |
| 9 | PyAPI_DATA(PyTypeObject) PyMemoryView_Type; |
| 10 | |
| 11 | #define PyMemoryView_Check(op) Py_IS_TYPE((op), &PyMemoryView_Type) |
| 12 | |
| 13 | PyAPI_FUNC(PyObject *) PyMemoryView_FromObject(PyObject *base); |
| 14 | #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000 |
| 15 | PyAPI_FUNC(PyObject *) PyMemoryView_FromMemory(char *mem, Py_ssize_t size, |
| 16 | int flags); |
| 17 | #endif |
| 18 | #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030b0000 |
| 19 | PyAPI_FUNC(PyObject *) PyMemoryView_FromBuffer(const Py_buffer *info); |
| 20 | #endif |
| 21 | PyAPI_FUNC(PyObject *) PyMemoryView_GetContiguous(PyObject *base, |
| 22 | int buffertype, |
| 23 | char order); |
| 24 | |
| 25 | #ifndef Py_LIMITED_API |
| 26 | # define Py_CPYTHON_MEMORYOBJECT_H |
| 27 | # include "cpython/memoryobject.h" |
| 28 | # undef Py_CPYTHON_MEMORYOBJECT_H |
| 29 | #endif |
| 30 | |
| 31 | #ifdef __cplusplus |
| 32 | } |
| 33 | #endif |
| 34 | #endif /* !Py_MEMORYOBJECT_H */ |
| 35 | |