dvtm

dynamic virtual terminal manager - with my changes
git clone https://pi.duncano.de/git/dvtm.git
Log | Files | Refs | README | LICENSE

commit 03fb2f67cf44efbf39fc08dc9659bf3034a25fb9
parent 93d2f0015f2fed69a2e2ec2633a0bc6c80a3b483
Author: Marc Andre Tanner <mat@brain-dump.org>
Date:   Sun, 12 Jun 2011 14:08:09 +0200

madtty: fix compilation against BSD curses

Signed-off-by: Marc Andre Tanner <mat@brain-dump.org>

Diffstat:
madtty.c | 7+++++++
madtty.h | 4++++
2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/madtty.c b/madtty.c @@ -50,6 +50,11 @@ # define NCURSES_ATTR_SHIFT 8 #endif +/* hack for BSD curses */ +#ifndef NCURSES_ACS +# define NCURSES_ACS(c) (_acs_map[(unsigned char)(c)]) +#endif + #define IS_CONTROL(ch) !((ch) & 0xffffff60UL) #define min(x, y) ((x) < (y) ? (x) : (y)) #define COLOR_PALETTE_START 1 @@ -1421,6 +1426,7 @@ void madtty_keypress(madtty_t *t, int keycode) void madtty_mouse(madtty_t *t, int x, int y, mmask_t mask) { +#ifdef NCURSES_MOUSE_VERSION char seq[6] = { '\e', '[', 'M' }, state = 0, button = 0; if (!t->mousetrack) @@ -1454,6 +1460,7 @@ void madtty_mouse(madtty_t *t, int x, int y, mmask_t mask) seq[3] = 32 + button + state; madtty_write(t, seq, sizeof seq); } +#endif /* NCURSES_MOUSE_VERSION */ } static unsigned color_hash(short f, short b) diff --git a/madtty.h b/madtty.h @@ -31,6 +31,10 @@ #include <unistd.h> #include <wchar.h> +#ifndef NCURSES_MOUSE_VERSION +#define mmask_t unsigned long +#endif + enum { /* means escape sequence was handled */ MADTTY_HANDLER_OK,