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