iPXE
print_nadv.c
Go to the documentation of this file.
1 #include <curses.h>
2 #include "mucurses.h"
3 #include "cursor.h"
4 
5 /** @file
6  *
7  * MuCurses printing functions (no cursor advance)
8  *
9  */
10 
11 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
12 
13 /**
14  * Add string of single-byte characters and renditions to a window
15  *
16  * @v *win window to be rendered in
17  * @v *chstr pointer to first chtype in "string"
18  * @v n max number of chars from chstr to render
19  * @ret rc return status code
20  */
21 int waddchnstr ( WINDOW *win, const chtype *chstr, int n ) {
22  struct cursor_pos pos;
23 
24  _store_curs_pos( win, &pos );
25  _wputchstr( win, chstr, NOWRAP, n );
26  _restore_curs_pos( win, &pos );
27  return OK;
28 }
MuCurses header file.
Curses Window struct.
Definition: curses.h:89
MuCurses cursor implementation specific header file.
MuCurses core implementation specific header file.
Definition: sis900.h:208
void _wputchstr(WINDOW *win, const chtype *chstr, int wrap, int n) __nonnull
Write a chtype string to a window.
Definition: mucurses.c:107
#define NOWRAP
Definition: mucurses.h:13
WINDOW * win
Definition: print.c:43
uint32_t chtype
Definition: curses.h:29
static void _restore_curs_pos(WINDOW *win, struct cursor_pos *pos)
Restore cursor position from encoded backup variable.
Definition: cursor.h:22
static void _store_curs_pos(WINDOW *win, struct cursor_pos *pos)
Store cursor position for later restoration.
Definition: cursor.h:32