diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2014-09-09 18:06:34 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2014-09-09 18:06:34 +0200 |
| commit | 0e05ad063f643c34359bcdf8253984bdcaed4b8c (patch) | |
| tree | 6951a19fdff360b4b71b47679cee49973cdd80c9 /main.c | |
| parent | 1e3f7a23e009d431fa8e3771e9ee411c2d142359 (diff) | |
| download | vis-0e05ad063f643c34359bcdf8253984bdcaed4b8c.tar.gz vis-0e05ad063f643c34359bcdf8253984bdcaed4b8c.tar.xz | |
Add infrastructure for commands
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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); |
