21#ifndef LIBOPENRAW_IO_H_
22#define LIBOPENRAW_IO_H_
34typedef struct _IOFile *IOFileRef;
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);
55extern struct io_methods* get_default_io_methods(
void);
57extern IOFileRef raw_open(
struct io_methods * methods,
const char *path,
59extern int raw_close(IOFileRef f);
60extern int raw_seek(IOFileRef f, off_t offset,
int whence);
61extern int raw_read(IOFileRef f,
void *buf,
size_t count);
62extern off_t raw_filesize(IOFileRef f);
63extern void *raw_mmap(IOFileRef f,
size_t l, off_t offset);
64extern int raw_munmap(IOFileRef f,
void *addr,
size_t l);
66extern int raw_get_error(IOFileRef f);
67extern char *raw_get_path(IOFileRef f);
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)