libpayload: remove trailing whitespace and run dos2unix
[coreboot.git] / payloads / libpayload / curses / PDCurses-3.4 / win32 / pdcgetsc.c
1 /* Public Domain Curses */
2
3 #include "pdcwin.h"
4
5 RCSID("$Id: pdcgetsc.c,v 1.36 2008/07/14 04:24:52 wmcbrine Exp $")
6
7 /* get the cursor size/shape */
8
9 int PDC_get_cursor_mode(void)
10 {
11     CONSOLE_CURSOR_INFO ci;
12
13     PDC_LOG(("PDC_get_cursor_mode() - called\n"));
14
15     GetConsoleCursorInfo(pdc_con_out, &ci);
16
17     return ci.dwSize;
18 }
19
20 /* return number of screen rows */
21
22 int PDC_get_rows(void)
23 {
24     CONSOLE_SCREEN_BUFFER_INFO scr;
25
26     PDC_LOG(("PDC_get_rows() - called\n"));
27
28     GetConsoleScreenBufferInfo(pdc_con_out, &scr);
29
30     return scr.srWindow.Bottom - scr.srWindow.Top + 1;
31 }
32
33 /* return number of buffer rows */
34
35 int PDC_get_buffer_rows(void)
36 {
37     CONSOLE_SCREEN_BUFFER_INFO scr;
38
39     PDC_LOG(("PDC_get_buffer_rows() - called\n"));
40
41     GetConsoleScreenBufferInfo(pdc_con_out, &scr);
42
43     return scr.dwSize.Y;
44 }
45
46 /* return width of screen/viewport */
47
48 int PDC_get_columns(void)
49 {
50     CONSOLE_SCREEN_BUFFER_INFO scr;
51
52     PDC_LOG(("PDC_get_columns() - called\n"));
53
54     GetConsoleScreenBufferInfo(pdc_con_out, &scr);
55
56     return scr.srWindow.Right - scr.srWindow.Left + 1;
57 }