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
10FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11FILE_SECBOOT ( PERMITTED );
12
13/**
14 * Initialise console environment
15 *
16 * @ret *win return pointer to stdscr
17 */
18WINDOW *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 */
32int 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}
#define NULL
NULL pointer (VOID *)
Definition Base.h:322
MuCurses header file.
static int attrset(int attrs)
Definition curses.h:517
#define mvprintw(y, x, fmt,...)
Definition curses.h:649
#define stdscr
Definition curses.h:111
static int move(int y, int x)
Definition curses.h:594
#define OK
Definition curses.h:25
#define color_set(cpno, opts)
Definition curses.h:241
struct _curses_window WINDOW
Curses Window struct.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:926
#define LINES(...)
Define inline lines.
int curs_set(int visibility)
Set cursor visibility.
Definition mucurses.c:154
#define COLS
Definition vga.h:27
WINDOW * initscr(void)
Initialise console environment.
Definition wininit.c:18
int endwin(void)
Finalise console environment.
Definition wininit.c:32