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