aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2014-09-09 18:06:34 +0200
committerMarc André Tanner <mat@brain-dump.org>2014-09-09 18:06:34 +0200
commit0e05ad063f643c34359bcdf8253984bdcaed4b8c (patch)
tree6951a19fdff360b4b71b47679cee49973cdd80c9 /main.c
parent1e3f7a23e009d431fa8e3771e9ee411c2d142359 (diff)
downloadvis-0e05ad063f643c34359bcdf8253984bdcaed4b8c.tar.gz
vis-0e05ad063f643c34359bcdf8253984bdcaed4b8c.tar.xz
Add infrastructure for commands
Diffstat (limited to 'main.c')
-rw-r--r--main.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/main.c b/main.c
index 1c4843d..b998786 100644
--- a/main.c
+++ b/main.c
@@ -5,8 +5,12 @@
#include <string.h>
#include <signal.h>
#include <errno.h>
+#include <fcntl.h>
#include <sys/select.h>
+#include <sys/types.h>
+#include <sys/stat.h>
#include <sys/ioctl.h>
+#include <sys/mman.h>
#include "vis.h"
#include "util.h"
@@ -102,6 +106,12 @@ typedef struct {
Arg arg;
} Action;
+typedef struct {
+ const char *name;
+ bool (*cmd)(const char *argv[]);
+ regex_t regex;
+} Command;
+
static Key getkey(void);
static void cursor(const Arg *arg);
static void call(const Arg *arg);