src/util/vfile.h (view raw)
1#ifndef VFILE_H
2#define VFILE_H
3
4#include "common.h"
5
6struct VFile {
7 bool (*close)(struct VFile* vf);
8 size_t (*seek)(struct VFile* vf, off_t offset, int whence);
9 size_t (*read)(struct VFile* vf, void* buffer, size_t size);
10 size_t (*readline)(struct VFile* vf, char* buffer, size_t size);
11 size_t (*write)(struct VFile* vf, void* buffer, size_t size);
12};
13
14struct VFile* VFileOpen(const char* path, int flags);
15struct VFile* VFileFromFD(int fd);
16
17#endif