picklebufobject.h 848 B

12345678910111213141516171819202122232425262728293031
  1. /* PickleBuffer object. This is built-in for ease of use from third-party
  2. * C extensions.
  3. */
  4. #ifndef Py_PICKLEBUFOBJECT_H
  5. #define Py_PICKLEBUFOBJECT_H
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9. #ifndef Py_LIMITED_API
  10. PyAPI_DATA(PyTypeObject) PyPickleBuffer_Type;
  11. #define PyPickleBuffer_Check(op) Py_IS_TYPE((op), &PyPickleBuffer_Type)
  12. /* Create a PickleBuffer redirecting to the given buffer-enabled object */
  13. PyAPI_FUNC(PyObject *) PyPickleBuffer_FromObject(PyObject *);
  14. /* Get the PickleBuffer's underlying view to the original object
  15. * (NULL if released)
  16. */
  17. PyAPI_FUNC(const Py_buffer *) PyPickleBuffer_GetBuffer(PyObject *);
  18. /* Release the PickleBuffer. Returns 0 on success, -1 on error. */
  19. PyAPI_FUNC(int) PyPickleBuffer_Release(PyObject *);
  20. #endif /* !Py_LIMITED_API */
  21. #ifdef __cplusplus
  22. }
  23. #endif
  24. #endif /* !Py_PICKLEBUFOBJECT_H */