terom@14: from qmsk.net.libc cimport ssize_t, errno terom@7: terom@7: cdef extern from "Python.h" : terom@7: struct PyObject : terom@7: pass terom@7: terom@7: ## string stuff terom@14: int PyObject_AsCharBuffer (object obj, char **buf, ssize_t *len) except -1 terom@14: terom@14: object PyString_FromStringAndSize (char *v, ssize_t len) terom@14: char* PyString_AS_STRING (object) except NULL terom@14: int _PyString_Resize (PyObject **string, ssize_t newsize) 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@14: ## custom haxes terom@14: #cdef extern from "_py.c" : terom@14: # object py_string_resize (object string, ssize_t new_size) terom@14: 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: