jpayne@69: /* PickleBuffer object. This is built-in for ease of use from third-party jpayne@69: * C extensions. jpayne@69: */ jpayne@69: jpayne@69: #ifndef Py_PICKLEBUFOBJECT_H jpayne@69: #define Py_PICKLEBUFOBJECT_H jpayne@69: #ifdef __cplusplus jpayne@69: extern "C" { jpayne@69: #endif jpayne@69: jpayne@69: #ifndef Py_LIMITED_API jpayne@69: jpayne@69: PyAPI_DATA(PyTypeObject) PyPickleBuffer_Type; jpayne@69: jpayne@69: #define PyPickleBuffer_Check(op) (Py_TYPE(op) == &PyPickleBuffer_Type) jpayne@69: jpayne@69: /* Create a PickleBuffer redirecting to the given buffer-enabled object */ jpayne@69: PyAPI_FUNC(PyObject *) PyPickleBuffer_FromObject(PyObject *); jpayne@69: /* Get the PickleBuffer's underlying view to the original object jpayne@69: * (NULL if released) jpayne@69: */ jpayne@69: PyAPI_FUNC(const Py_buffer *) PyPickleBuffer_GetBuffer(PyObject *); jpayne@69: /* Release the PickleBuffer. Returns 0 on success, -1 on error. */ jpayne@69: PyAPI_FUNC(int) PyPickleBuffer_Release(PyObject *); jpayne@69: jpayne@69: #endif /* !Py_LIMITED_API */ jpayne@69: jpayne@69: #ifdef __cplusplus jpayne@69: } jpayne@69: #endif jpayne@69: #endif /* !Py_PICKLEBUFOBJECT_H */