+
+static vi_file *file_open(const char *path, unsigned int flags)
+{
+ struct file *file;
+ const char *attr;
+
+ switch(flags & 0xff) {
+ case VI_RDONLY:
+ attr = "rb";
+ break;
+
+ case VI_WRONLY:
+ attr = (flags & VI_CREAT) ? "w+b" : "wb";
+ break;
+
+ case VI_RDWR:
+ attr = (flags & VI_CREAT) ? "w+b" : "r+b";
+ break;
+
+ default:
+ return 0;
+ }
+
+
+ if(!(file = calloc(1, sizeof *file))) {
+ return 0;
+ }
+ if(!(file->fp = fopen(path, attr))) {
+ free(file);
+ return 0;
+ }
+ return file;
+}
+
+static void file_close(vi_file *file)
+{
+}
+
+static long file_size(vi_file *file)
+{
+ return -1;
+}
+
+static void *file_map(vi_file *file)
+{
+ return 0;
+}
+
+static void file_unmap(vi_file *file)
+{
+}
+
+static long file_read(vi_file *file, void *buf, long count)
+{
+ return -1;
+}
+
+static long file_write(vi_file *file, void *buf, long count)
+{
+ return -1;
+}
+
+static long file_seek(vi_file *file, long offs, int whence)
+{
+ return -1;
+}