terom@7: cimport libc terom@7: terom@7: cdef extern from "Python.h" : terom@7: struct PyObject : terom@7: pass terom@7: terom@7: ## string stuff terom@7: int PyObject_AsCharBuffer (object obj, char **buf, libc.ssize_t *len) except -1 terom@7: terom@7: ## except setting terom@7: PyObject* PyErr_SetFromErrno (PyObject *type) terom@7: terom@7: PyObject *PyExc_OSError terom@7: terom@7: # raise OSError with errno terom@7: # XXX: doesn't do anything with func terom@7: cdef int raise_errno (char *func) except -1 terom@7: