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