all repos — mgba @ 7bb5e29a984c2d509b072eafddc78ec712426c5a

mGBA Game Boy Advance Emulator

src/util/vfile.h (view raw)

 1#ifndef VFILE_H
 2#define VFILE_H
 3
 4#include "common.h"
 5
 6#include "memory.h"
 7
 8struct VFile {
 9	bool (*close)(struct VFile* vf);
10	size_t (*seek)(struct VFile* vf, off_t offset, int whence);
11	size_t (*read)(struct VFile* vf, void* buffer, size_t size);
12	size_t (*readline)(struct VFile* vf, char* buffer, size_t size);
13	size_t (*write)(struct VFile* vf, void* buffer, size_t size);
14	void* (*map)(struct VFile* vf, size_t size, int flags);
15	void (*unmap)(struct VFile* vf, void* memory, size_t size);
16	void (*truncate)(struct VFile* vf, size_t size);
17};
18
19struct VFile* VFileOpen(const char* path, int flags);
20struct VFile* VFileFromFD(int fd);
21
22#endif