24#include <libopenraw/io.h>
25#include "io_private.h"
33#define CHECK_PTR(p,r) \
34 if(p == NULL) { return r; }
43 return &posix_io_methods;
53 CHECK_PTR(methods, NULL);
54 return methods->
open(path, mode);
83int raw_seek(
IOFileRef f, off_t offset,
int whence)
97int raw_read(
IOFileRef f,
void *buf,
size_t count)
106 return f->
methods->filesize(f);
109void *raw_mmap(
IOFileRef f,
size_t l, off_t offset)
112 return f->
methods->mmap(f, l, offset);
116int raw_munmap(
IOFileRef f,
void *addr,
size_t l)
119 return f->
methods->munmap(f, addr, l);
struct io_methods * methods
int(* seek)(IOFileRef f, off_t offset, int whence)
IOFileRef(* open)(const char *path, int mode)
int(* close)(IOFileRef f)
int(* read)(IOFileRef f, void *buf, size_t count)