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