24 #include "libopenraw/io.h"
25 #include "io_private.h"
34 #define CHECK_PTR(p,r) \
35 if(p == NULL) { return r; }
42 struct io_methods* get_default_io_methods(
void)
44 return &posix_io_methods;
54 CHECK_PTR(methods, NULL);
55 return methods->
open(path, mode);
84 int raw_seek(
IOFileRef f, off_t offset,
int whence)
98 int raw_read(
IOFileRef f,
void *buf,
size_t count)
107 return f->
methods->filesize(f);
110 void *raw_mmap(
IOFileRef f,
size_t l, off_t offset)
113 return f->
methods->mmap(f, l, offset);
117 int raw_munmap(
IOFileRef f,
void *addr,
size_t l)
120 return f->
methods->munmap(f, addr, l);
struct io_methods * methods
int(* read)(IOFileRef f, void *buf, size_t count)
int(* close)(IOFileRef f)
int(* seek)(IOFileRef f, off_t offset, int whence)
IOFileRef(* open)(const char *path, int mode)