drivers/wifi: Remove unnecessary data structure copy
[coreboot2.git] / payloads / libpayload / curses / PDCurses / demos / tui.h
blob7be91237cbb67065efad679bcd8f82c125c718fa
1 /*
2 * 'textual user interface'
4 * $Id: tui.h,v 1.11 2008/07/14 12:35:23 wmcbrine Exp $
6 * Author : P.J. Kunst <kunst@prl.philips.nl>
7 * Date : 25-02-93
8 */
10 #ifndef _TUI_H_
11 #define _TUI_H_
13 #include <curses.h>
15 #ifdef A_COLOR
16 #define A_ATTR (A_ATTRIBUTES ^ A_COLOR) /* A_BLINK, A_REVERSE, A_BOLD */
17 #else
18 #define A_ATTR (A_ATTRIBUTES) /* standard UNIX attributes */
19 #endif
21 #define MAXSTRLEN 256
22 #define KEY_ESC 0x1b /* Escape */
24 typedef void (*FUNC)(void);
26 typedef struct
28 char *name; /* item label */
29 FUNC func; /* (pointer to) function */
30 char *desc; /* function description */
31 } menu;
33 /* ANSI C function prototypes: */
35 void clsbody(void);
36 int bodylen(void);
37 WINDOW *bodywin(void);
39 void rmerror(void);
40 void rmstatus(void);
42 void titlemsg(char *msg);
43 void bodymsg(char *msg);
44 void errormsg(char *msg);
45 void statusmsg(char *msg);
47 bool keypressed(void);
48 int getkey(void);
49 int waitforkey(void);
51 void DoExit(void);
52 void startmenu(menu *mp, char *title);
53 void domenu(menu *mp);
55 int weditstr(WINDOW *win, char *buf, int field);
56 WINDOW *winputbox(WINDOW *win, int nlines, int ncols);
57 int getstrings(char *desc[], char *buf[], int field);
59 #define editstr(s,f) (weditstr(stdscr,s,f))
60 #define mveditstr(y,x,s,f) (move(y,x)==ERR?ERR:editstr(s,f))
61 #define mvweditstr(w,y,x,s,f) (wmove(w,y,x)==ERR?ERR:weditstr(w,s,f))
63 #define inputbox(l,c) (winputbox(stdscr,l,c))
64 #define mvinputbox(y,x,l,c) (move(y,x)==ERR?w:inputbox(l,c))
65 #define mvwinputbox(w,y,x,l,c) (wmove(w,y,x)==ERR?w:winputbox(w,l,c))
67 #endif