cdef extern from "Python.h": void PyErr_Clear() int PyObject_AsCharBuffer(object obj, char **buffer, int *buffer_len) except -1 int PyObject_AsReadBuffer(object obj, char **buffer, int *buffer_len) except -1 int PyObject_AsWriteBuffer(object obj, char **buffer, int *buffer_len) except -1 int PyObject_CheckReadBuffer(object obj) except -1 int PyMac_GetStr255(object obj, Str255 pbuf) except 0 int PyString_AsStringAndSize(object obj, char **buffer, int *length) except -1 object PyString_FromStringAndSize(char *v, int len) object PyUnicode_FromUnicode(UniChar *u, int size) cdef UniChar* PyUnicode_AS_UNICODE(object o) void* PyMem_Realloc(void *p, int n) void* PyMem_Malloc(int n) void PyMem_Free(void *p)