@@@ lbuf needs test
[mLib-python] / defs.pxi
index 903a6d0..86cd72e 100644 (file)
--- a/defs.pxi
+++ b/defs.pxi
@@ -96,8 +96,14 @@ cdef extern from 'Python.h':
     pass
 
   int PyObject_AsReadBuffer(obj, void **buf, Py_ssize_t *len) except -1
+  IF PYVERSION >= (3,):
+    object PyUnicode_DecodeUTF8Stateful(const char *s, Py_ssize_t sz,
+                                        const char *errors,
+                                        Py_ssize_t *used_out)
+
   object PyInt_FromLong(long i)
   object PyLong_FromUnsignedLong(unsigned long i)
+
   void PyErr_Clear()
 
   void Py_INCREF(PyObject *obj)
@@ -278,9 +284,11 @@ cdef extern from 'array.h':
 
 cdef extern from 'mLib/lbuf.h':
   cdef struct lbuf:
-    int f
-    int delim
+    unsigned f
+    unsigned delim
+    size_t len
     size_t sz
+    char *buf
   enum:
     LBUF_ENABLE
     _LBUF_CRLF "LBUF_CRLF"