soc/intel/xeon_sp/util: Enhance lock_pam0123
[coreboot2.git] / payloads / libpayload / curses / PDCurses / pdcurses / outopts.c
blob9b04eb9dd7dd3deb543b106370f9a480c4e5b295
1 /* Public Domain Curses */
3 #include <curspriv.h>
5 RCSID("$Id: outopts.c,v 1.39 2008/07/14 12:22:13 wmcbrine Exp $")
7 /*man-start**************************************************************
9 Name: outopts
11 Synopsis:
12 int clearok(WINDOW *win, bool bf);
13 int idlok(WINDOW *win, bool bf);
14 void idcok(WINDOW *win, bool bf);
15 void immedok(WINDOW *win, bool bf);
16 int leaveok(WINDOW *win, bool bf);
17 int setscrreg(int top, int bot);
18 int wsetscrreg(WINDOW *win, int top, int bot);
19 int scrollok(WINDOW *win, bool bf);
21 int raw_output(bool bf);
23 Description:
24 With clearok(), if bf is TRUE, the next call to wrefresh() with
25 this window will clear the screen completely and redraw the
26 entire screen.
28 immedok(), called with a second argument of TRUE, causes an
29 automatic wrefresh() every time a change is made to the
30 specified window.
32 Normally, the hardware cursor is left at the location of the
33 window being refreshed. leaveok() allows the cursor to be
34 left wherever the update happens to leave it. It's useful
35 for applications where the cursor is not used, since it reduces
36 the need for cursor motions. If possible, the cursor is made
37 invisible when this option is enabled.
39 wsetscrreg() sets a scrolling region in a window; "top" and
40 "bot" are the line numbers for the top and bottom margins. If
41 this option and scrollok() are enabled, any attempt to move off
42 the bottom margin will cause all lines in the scrolling region
43 to scroll up one line. setscrreg() is the stdscr version.
45 idlok() and idcok() do nothing in PDCurses, but are provided for
46 compatibility with other curses implementations.
48 raw_output() enables the output of raw characters using the
49 standard *add* and *ins* curses functions (that is, it disables
50 translation of control characters).
52 Return Value:
53 All functions return OK on success and ERR on error.
55 Portability X/Open BSD SYS V
56 clearok Y Y Y
57 idlok Y Y Y
58 idcok Y - 4.0
59 immedok Y - 4.0
60 leaveok Y Y Y
61 setscrreg Y Y Y
62 wsetscrreg Y Y Y
63 scrollok Y Y Y
64 raw_output - - -
66 **man-end****************************************************************/
68 int clearok(WINDOW *win, bool bf)
70 PDC_LOG(("clearok() - called\n"));
72 if (!win)
73 return ERR;
75 win->_clear = bf;
77 return OK;
80 int idlok(WINDOW *win, bool bf)
82 PDC_LOG(("idlok() - called\n"));
84 return OK;
87 void idcok(WINDOW *win, bool bf)
89 PDC_LOG(("idcok() - called\n"));
92 void immedok(WINDOW *win, bool bf)
94 PDC_LOG(("immedok() - called\n"));
96 if (win)
97 win->_immed = bf;
100 int leaveok(WINDOW *win, bool bf)
102 PDC_LOG(("leaveok() - called\n"));
104 if (!win)
105 return ERR;
107 win->_leaveit = bf;
109 curs_set(!bf);
111 return OK;
114 int setscrreg(int top, int bottom)
116 PDC_LOG(("setscrreg() - called: top %d bottom %d\n", top, bottom));
118 return wsetscrreg(stdscr, top, bottom);
121 int wsetscrreg(WINDOW *win, int top, int bottom)
123 PDC_LOG(("wsetscrreg() - called: top %d bottom %d\n", top, bottom));
125 if (win && 0 <= top && top <= win->_cury &&
126 win->_cury <= bottom && bottom < win->_maxy)
128 win->_tmarg = top;
129 win->_bmarg = bottom;
131 return OK;
133 else
134 return ERR;
137 int scrollok(WINDOW *win, bool bf)
139 PDC_LOG(("scrollok() - called\n"));
141 if (!win)
142 return ERR;
144 win->_scroll = bf;
146 return OK;
149 int raw_output(bool bf)
151 PDC_LOG(("raw_output() - called\n"));
153 SP->raw_out = bf;
155 return OK;