21 #ifndef LIBOPENRAW_IO_H_ 22 #define LIBOPENRAW_IO_H_ 24 #include <sys/types.h> 42 IOFileRef (*
open)(
const char *path,
int mode);
46 int (*
seek) (IOFileRef f, off_t offset,
int whence);
48 int (*
read) (IOFileRef f,
void *buf,
size_t count);
50 off_t (*filesize) (IOFileRef f);
51 void* (*mmap) (IOFileRef f,
size_t l, off_t offset);
52 int (*munmap) (IOFileRef f,
void *addr,
size_t l);
55 extern struct io_methods* get_default_io_methods(
void);
57 extern IOFileRef raw_open(
struct io_methods * methods,
const char *path,
59 extern int raw_close(IOFileRef f);
60 extern int raw_seek(IOFileRef f, off_t offset,
int whence);
61 extern int raw_read(IOFileRef f,
void *buf,
size_t count);
62 extern off_t raw_filesize(IOFileRef f);
63 extern void *raw_mmap(IOFileRef f,
size_t l, off_t offset);
64 extern int raw_munmap(IOFileRef f,
void *addr,
size_t l);
66 extern int raw_get_error(IOFileRef f);
67 extern char *raw_get_path(IOFileRef f);
IOFileRef(* open)(const char *path, int mode)
int(* close)(IOFileRef f)
int(* read)(IOFileRef f, void *buf, size_t count)
int(* seek)(IOFileRef f, off_t offset, int whence)