2 * This is an example written by Alexander V. Lukyanov <lav@yars.free.net>,
3 * to demonstrate an inconsistency between ncurses and SVr4 curses.
5 * $Id: testaddch.c,v 1.3 1997/10/18 21:35:15 tom Exp $
9 static void attr_addstr(const char *s, chtype a)
12 addch(((unsigned char)(*s++))|a);
18 char *argv[] GCC_UNUSED)
25 init_pair(1,COLOR_WHITE,COLOR_BLUE);
26 init_pair(2,COLOR_WHITE,COLOR_RED);
27 init_pair(3,COLOR_BLACK,COLOR_MAGENTA);
28 init_pair(4,COLOR_BLACK,COLOR_GREEN);
29 init_pair(5,COLOR_BLACK,COLOR_CYAN);
30 init_pair(6,COLOR_BLACK,COLOR_YELLOW);
31 init_pair(7,COLOR_BLACK,COLOR_WHITE);
35 back = (i&1) ? A_BOLD|'B' : ' ';
36 set = (i&2) ? A_REVERSE : 0;
37 attr = (i&4) ? COLOR_PAIR(4) : 0;
42 attr_addstr("Test string with spaces -> <-\n",attr);
47 back = (i&1) ? A_BOLD|'B'|COLOR_PAIR(1) : ' ';
48 set = (i&2) ? A_REVERSE|COLOR_PAIR(2) : 0;
49 attr = (i&4) ? COLOR_PAIR(4) : 0;
54 attr_addstr("Test string with spaces -> <-\n",attr);