trafgen: fix NULL pointer dereference in -i option parsing
[netsniff-ng.git] / screen.h
blobf5a15d4accbc430a930f694251fb3ca5167330d7
1 #ifndef SCREEN_H
2 #define SCREEN_H
4 #include <curses.h>
6 enum colors {
7 BLACK = COLOR_BLACK,
8 RED = COLOR_RED,
9 GREEN = COLOR_GREEN,
10 YELLOW = COLOR_YELLOW,
11 BLUE = COLOR_BLUE,
12 MAGENTA = COLOR_MAGENTA,
13 CYAN = COLOR_CYAN,
14 WHITE = COLOR_WHITE,
17 #define COLOR_MASK(fg, bg) ((fg) + (bg) * (COLOR_WHITE + 1))
18 #define COLOR(fg, bg) COLOR_PAIR(COLOR_MASK((fg), (bg)))
19 #define INIT_COLOR(fg, bg) init_pair(COLOR_MASK((fg), (bg)), (fg), (bg))
20 #define COLOR_ON(fg, bg) attron(COLOR(fg, bg))
21 #define COLOR_OFF(fg, bg) attroff(COLOR(fg, bg))
23 extern WINDOW *screen_init(bool israw);
24 extern void screen_end(void);
26 #endif /* SCREEN_H */