+static void resized(int x, int y);
+/* file operations */
+static vi_file *file_open(const char *path, unsigned int flags);
+static void file_close(vi_file *file);
+static long file_size(vi_file *file);
+static void *file_map(vi_file *file);
+static void file_unmap(vi_file *file);
+static long file_read(vi_file *file, void *buf, long count);
+static long file_write(vi_file *file, void *buf, long count);
+static long file_seek(vi_file *file, long offs, int whence);
+/* tty operations */
+static void tty_clear(void *cls);
+static void tty_clear_line(void *cls);
+static void tty_clear_line_at(int y, void *cls);
+static void tty_setcursor(int x, int y, void *cls);
+static void tty_putchar(char c, void *cls);
+static void tty_putchar_at(int x, int y, char c, void *cls);
+static void tty_scroll(int nlines, void *cls);
+static void tty_del_back(void *cls);
+static void tty_del_fwd(void *cls);
+static void tty_status(char *s, void *cls);
+static void tty_flush(void *cls);
+
+
+static struct visor *vi;
+
+static int num_fpaths;
+static char **fpaths;
+
+static struct vi_alloc alloc = {
+ malloc, free, realloc
+};
+
+static struct vi_fileops fops = {
+ file_open, file_close, file_size,
+ file_map, file_unmap,
+ file_read, file_write, file_seek
+};