memoryobject.h 1.1 KB

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