2008-08-19 20:22:14 +02:00
|
|
|
/* Memory view object. In Python this is available as "memoryview". */
|
2007-08-18 13:21:56 +02:00
|
|
|
|
|
|
|
#ifndef Py_MEMORYOBJECT_H
|
|
|
|
#define Py_MEMORYOBJECT_H
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
PyAPI_DATA(PyTypeObject) PyMemoryView_Type;
|
|
|
|
|
2022-06-16 13:49:43 +02:00
|
|
|
#define PyMemoryView_Check(op) Py_IS_TYPE((op), &PyMemoryView_Type)
|
2008-08-19 20:22:14 +02:00
|
|
|
|
2007-08-18 13:21:56 +02:00
|
|
|
PyAPI_FUNC(PyObject *) PyMemoryView_FromObject(PyObject *base);
|
2016-12-27 13:57:39 +01:00
|
|
|
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
|
2012-02-25 12:24:21 +01:00
|
|
|
PyAPI_FUNC(PyObject *) PyMemoryView_FromMemory(char *mem, Py_ssize_t size,
|
|
|
|
int flags);
|
2016-12-27 13:57:39 +01:00
|
|
|
#endif
|
2022-02-02 16:03:10 +01:00
|
|
|
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030b0000
|
2021-12-22 14:07:46 +01:00
|
|
|
PyAPI_FUNC(PyObject *) PyMemoryView_FromBuffer(const Py_buffer *info);
|
2011-01-06 20:15:47 +01:00
|
|
|
#endif
|
2012-02-25 12:24:21 +01:00
|
|
|
PyAPI_FUNC(PyObject *) PyMemoryView_GetContiguous(PyObject *base,
|
|
|
|
int buffertype,
|
|
|
|
char order);
|
2009-01-03 20:20:36 +01:00
|
|
|
|
2010-12-03 21:14:31 +01:00
|
|
|
#ifndef Py_LIMITED_API
|
2022-11-23 15:44:42 +01:00
|
|
|
# define Py_CPYTHON_MEMORYOBJECT_H
|
|
|
|
# include "cpython/memoryobject.h"
|
|
|
|
# undef Py_CPYTHON_MEMORYOBJECT_H
|
2010-12-03 21:14:31 +01:00
|
|
|
#endif
|
2008-08-19 20:22:14 +02:00
|
|
|
|
2007-08-18 13:21:56 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif /* !Py_MEMORYOBJECT_H */
|