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 
12 /**
13  * Initialise console environment
14  *
15  * @ret *win return pointer to stdscr
16  */
17 WINDOW *initscr ( void ) {
18  /* determine console size */
19  /* initialise screen */
20  stdscr->scr->init( stdscr->scr );
21  stdscr->height = LINES;
22  stdscr->width = COLS;
23  move ( 0, 0 );
24  return stdscr;
25 }
26 
27 /**
28  * Finalise console environment
29  *
30  */
31 int endwin ( void ) {
32  attrset ( 0 );
33  color_set ( 0, NULL );
34  curs_set ( 1 );
35  mvprintw ( ( LINES - 1 ), 0, "\n" );
36  stdscr->scr->exit( stdscr->scr );
37  return OK;
38 }
MuCurses header file.
static int attrset(int attrs)
Definition: curses.h:516
Curses Window struct.
Definition: curses.h:89
int endwin(void)
Finalise console environment.
Definition: wininit.c:31
#define mvprintw(y, x, fmt,...)
Definition: curses.h:648
#define LINES(...)
Define inline lines.
Definition: linebuf_test.c:44
Definition: sis900.h:208
WINDOW * initscr(void)
Initialise console environment.
Definition: wininit.c:17
#define stdscr
Definition: curses.h:110
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
#define COLS
Definition: curses.h:111
int curs_set(int visibility)
Set cursor visibility.
Definition: mucurses.c:153
static int move(int y, int x)
Definition: curses.h:593
#define color_set(cpno, opts)
Definition: curses.h:240
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321