drivers/wifi: Remove unnecessary data structure copy
[coreboot2.git] / payloads / libpayload / curses / PDCurses / x11 / pdcsetsc.c
blobbdcc856c00121b2209424fa04514ccaf5baf083d
1 /* Public Domain Curses */
3 #include "pdcx11.h"
5 RCSID("$Id: pdcsetsc.c,v 1.33 2008/07/14 04:24:52 wmcbrine Exp $")
7 #include <string.h>
9 /*man-start**************************************************************
11 Name: pdcsetsc
13 Synopsis:
14 int PDC_set_blink(bool blinkon);
15 void PDC_set_title(const char *title);
17 Description:
18 PDC_set_blink() toggles whether the A_BLINK attribute sets an
19 actual blink mode (TRUE), or sets the background color to high
20 intensity (FALSE). The default is platform-dependent (FALSE in
21 most cases). It returns OK if it could set the state to match
22 the given parameter, ERR otherwise. Current platforms also
23 adjust the value of COLORS according to this function -- 16 for
24 FALSE, and 8 for TRUE.
26 PDC_set_title() sets the title of the window in which the curses
27 program is running. This function may not do anything on some
28 platforms. (Currently it only works in Win32 and X11.)
30 Portability X/Open BSD SYS V
31 PDC_set_blink - - -
32 PDC_set_title - - -
34 **man-end****************************************************************/
36 int PDC_curs_set(int visibility)
38 int ret_vis = SP->visibility;
40 PDC_LOG(("PDC_curs_set() - called: visibility=%d\n", visibility));
42 if (visibility != -1)
43 SP->visibility = visibility;
45 PDC_display_cursor(SP->cursrow, SP->curscol, SP->cursrow,
46 SP->curscol, visibility);
48 return ret_vis;
51 void PDC_set_title(const char *title)
53 int len;
55 PDC_LOG(("PDC_set_title() - called:<%s>\n", title));
57 len = strlen(title) + 1; /* write nul character */
59 XCursesInstruct(CURSES_TITLE);
61 if (XC_write_display_socket_int(len) >= 0)
62 if (XC_write_socket(xc_display_sock, title, len) >= 0)
63 return;
65 XCursesExitCursesProcess(1, "exiting from PDC_set_title");
68 int PDC_set_blink(bool blinkon)
70 if (pdc_color_started)
71 COLORS = 16;
73 return blinkon ? ERR : OK;