mmap_move_method(mmap_object *self, PyObject *args) { unsigned long dest, src, count; CHECK_VALID(NULL); if (!PyArg_ParseTuple (args, "iii:move", &dest, &src, &count) || !is_writeable(self)) { return NULL; } else { /* bounds check the values */ if (/* end of source after end of data?? */ ((src+count) > self->size) /* dest will fit? */ || (dest+count > self->size)) { PyErr_SetString (PyExc_ValueError, "source or destination out of range"); return NULL; } else { memmove (self->data+dest, self->data+src, count); Py_INCREF (Py_None); return Py_None; } } }