iPXE
wininit.c
Go to the documentation of this file.
1 #include <stddef.h>
2 #include <curses.h>
3 
4 /** @file
5  *
6  * MuCurses initialisation functions
7  *
8  */
9 
10 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11 FILE_SECBOOT ( PERMITTED );
12 
13 /**
14  * Initialise console environment
15  *
16  * @ret *win return pointer to stdscr
17  */
18 WINDOW *initscr ( void ) {
19  /* determine console size */
20  /* initialise screen */
21  stdscr->scr->init( stdscr->scr );
22  stdscr->height = LINES;
23  stdscr->width = COLS;
24  move ( 0, 0 );
25  return stdscr;
26 }
27 
28 /**
29  * Finalise console environment
30  *
31  */
32 int endwin ( void ) {
33  attrset ( 0 );
34  color_set ( 0, NULL );
35  curs_set ( 1 );
36  mvprintw ( ( LINES - 1 ), 0, "\n" );
37  stdscr->scr->exit( stdscr->scr );
38  return OK;
39 }
MuCurses header file.
static int attrset(int attrs)
Definition: curses.h:517
FILE_SECBOOT(PERMITTED)
Curses Window struct.
Definition: curses.h:90
int endwin(void)
Finalise console environment.
Definition: wininit.c:32
#define mvprintw(y, x, fmt,...)
Definition: curses.h:649
#define LINES(...)
Define inline lines.
Definition: linebuf_test.c:44
Definition: sis900.h:208
WINDOW * initscr(void)
Initialise console environment.
Definition: wininit.c:18
#define COLS
Definition: vga.h:27
#define stdscr
Definition: curses.h:111
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
int curs_set(int visibility)
Set cursor visibility.
Definition: mucurses.c:154
static int move(int y, int x)
Definition: curses.h:594
#define color_set(cpno, opts)
Definition: curses.h:241
#define NULL
NULL pointer (VOID *)
Definition: Base.h:322