Author: Jean-Paul Calderone <[email protected]> Branch: pyarg-parsetuple-s-star-buffer Changeset: r50430:421fe5b137ea Date: 2011-12-12 10:45 -0500 http://bitbucket.org/pypy/pypy/changeset/421fe5b137ea/
Log: Add trivial buffer implementation module diff --git a/pypy/module/cpyext/buffer.py b/pypy/module/cpyext/buffer.py new file mode 100644 --- /dev/null +++ b/pypy/module/cpyext/buffer.py @@ -0,0 +1,11 @@ +from pypy.rpython.lltypesystem import rffi, lltype +from pypy.module.cpyext.api import ( + cpython_api, CANNOT_FAIL, Py_buffer) + +@cpython_api([lltype.Ptr(Py_buffer), lltype.Char], rffi.INT_real, error=CANNOT_FAIL) +def PyBuffer_IsContiguous(space, view, fortran): + """Return 1 if the memory defined by the view is C-style (fortran is + 'C') or Fortran-style (fortran is 'F') contiguous or either one + (fortran is 'A'). Return 0 otherwise.""" + # PyPy only supports contiguous Py_buffers for now. + return space.wrap(1) _______________________________________________ pypy-commit mailing list [email protected] http://mail.python.org/mailman/listinfo/pypy-commit
