static PyObject *
mmap_close_method (mmap_object * self, PyObject * args)
{
+ if (!PyArg_NoArgs(args))
+ return NULL;
#ifdef MS_WIN32
UnmapViewOfFile (self->data);
CloseHandle (self->map_handle);
char value;
char * where;
CHECK_VALID(NULL);
+ if (!PyArg_NoArgs(args))
+ return NULL;
if (self->pos >= 0 && self->pos < self->size) {
where = self->data + self->pos;
value = (char) *(where);
static PyObject *
mmap_read_line_method (mmap_object * self,
- PyObject * args)
+ PyObject * args)
{
char * start = self->data+self->pos;
char * eof = self->data+self->size;
PyObject * result;
CHECK_VALID(NULL);
+ if (!PyArg_NoArgs(args))
+ return NULL;
eol = memchr(start, '\n', self->size - self->pos);
if (!eol)
static PyObject *
mmap_read_method (mmap_object * self,
- PyObject * args)
+ PyObject * args)
{
long num_bytes;
PyObject *result;
static PyObject *
mmap_write_byte_method (mmap_object * self,
- PyObject * args)
+ PyObject * args)
{
char value;
static PyObject *
mmap_size_method (mmap_object * self,
- PyObject * args)
+ PyObject * args)
{
CHECK_VALID(NULL);
+ if (!PyArg_NoArgs(args))
+ return NULL;
#ifdef MS_WIN32
if (self->file_handle != (HFILE) 0xFFFFFFFF) {
mmap_tell_method (mmap_object * self, PyObject * args)
{
CHECK_VALID(NULL);
+ if (!PyArg_NoArgs(args))
+ return NULL;
return (Py_BuildValue ("l", self->pos) );
}
/* Functions for treating an mmap'ed file as a buffer */
static int
-mmap_buffer_getreadbuf(self, index, ptr)
- mmap_object *self;
-int index;
-const void **ptr;
+mmap_buffer_getreadbuf(mmap_object *self, int index, const void **ptr)
{
CHECK_VALID(-1);
if ( index != 0 ) {
#endif /* MS_WIN32 */
}
+