iPXE
Data Structures | Macros | Typedefs | Functions | Variables
curses.h File Reference

MuCurses header file. More...

#include <stdint.h>
#include <stdbool.h>
#include <stdarg.h>
#include <ipxe/console.h>
#include <ipxe/keys.h>

Go to the source code of this file.

Data Structures

struct  _curses_screen
 Curses SCREEN object. More...
 
struct  _curses_window
 Curses Window struct. More...
 

Macros

#define ERR   (-1)
 
#define FALSE   (0)
 
#define OK   (0)
 
#define TRUE   (1)
 
#define stdscr   ( &_stdscr )
 
#define COLS   console_width
 
#define LINES   console_height
 
#define MUCURSES_BITS(mask, shift)   (( mask ) << (shift))
 
#define CPAIR_SHIFT   8
 
#define ATTRS_SHIFT   16
 
#define WA_DEFAULT   ( 0x0000 << ATTRS_SHIFT )
 
#define WA_ALTCHARSET   ( 0x0001 << ATTRS_SHIFT )
 
#define WA_BLINK   ( 0x0002 << ATTRS_SHIFT )
 
#define WA_BOLD   ( 0x0004 << ATTRS_SHIFT )
 
#define WA_DIM   ( 0x0008 << ATTRS_SHIFT )
 
#define WA_INVIS   ( 0x0010 << ATTRS_SHIFT )
 
#define WA_PROTECT   ( 0x0020 << ATTRS_SHIFT )
 
#define WA_REVERSE   ( 0x0040 << ATTRS_SHIFT )
 
#define WA_STANDOUT   ( 0x0080 << ATTRS_SHIFT )
 
#define WA_UNDERLINE   ( 0x0100 << ATTRS_SHIFT )
 
#define WA_HORIZONTAL   ( 0x0200 << ATTRS_SHIFT )
 
#define WA_VERTICAL   ( 0x0400 << ATTRS_SHIFT )
 
#define WA_LEFT   ( 0x0800 << ATTRS_SHIFT )
 
#define WA_RIGHT   ( 0x1000 << ATTRS_SHIFT )
 
#define WA_LOW   ( 0x2000 << ATTRS_SHIFT )
 
#define WA_TOP   ( 0x4000 << ATTRS_SHIFT )
 
#define A_DEFAULT   WA_DEFAULT
 
#define A_ALTCHARSET   WA_ALTCHARSET
 
#define A_BLINK   WA_BLINK
 
#define A_BOLD   WA_BOLD
 
#define A_DIM   WA_DIM
 
#define A_INVIS   WA_INVIS
 
#define A_PROTECT   WA_PROTECT
 
#define A_REVERSE   WA_REVERSE
 
#define A_STANDOUT   WA_STANDOUT
 
#define A_UNDERLINE   WA_UNDERLINE
 
#define A_ATTRIBUTES   ( 0xffff << ATTRS_SHIFT )
 
#define A_CHARTEXT   ( 0xff )
 
#define A_COLOUR   ( 0xff << CPAIR_SHIFT )
 
#define A_COLOR   A_COLOUR
 
#define COLOUR_PAIR(n)   ( (n) << CPAIR_SHIFT )
 
#define COLOR_PAIR(n)   COLOUR_PAIR(n)
 
#define PAIR_NUMBER(attrs)   ( ( (attrs) & A_COLOUR ) >> CPAIR_SHIFT )
 
#define COLOUR_PAIRS   8 /* Arbitrary limit */
 
#define COLOR_PAIRS   COLOUR_PAIRS
 
#define ACS_ULCORNER   '+'
 
#define ACS_LLCORNER   '+'
 
#define ACS_URCORNER   '+'
 
#define ACS_LRCORNER   '+'
 
#define ACS_RTEE   '+'
 
#define ACS_LTEE   '+'
 
#define ACS_BTEE   '+'
 
#define ACS_TTEE   '+'
 
#define ACS_HLINE   '-'
 
#define ACS_VLINE   '|'
 
#define ACS_PLUS   '+'
 
#define ACS_S1   '-'
 
#define ACS_S9   '_'
 
#define ACS_DIAMOND   '+'
 
#define ACS_CKBOARD   ':'
 
#define ACS_DEGREE   '\''
 
#define ACS_PLMINUS   '#'
 
#define ACS_BULLET   'o'
 
#define ACS_LARROW   '<'
 
#define ACS_RARROW   '>'
 
#define ACS_DARROW   'v'
 
#define ACS_UARROW   '^'
 
#define ACS_BOARD   '#'
 
#define ACS_LANTERN   '#'
 
#define ACS_BLOCK   '#'
 
#define COLOUR_BLACK   0
 
#define COLOUR_RED   1
 
#define COLOUR_GREEN   2
 
#define COLOUR_YELLOW   3
 
#define COLOUR_BLUE   4
 
#define COLOUR_MAGENTA   5
 
#define COLOUR_CYAN   6
 
#define COLOUR_WHITE   7
 
#define COLOURS   7
 
#define COLOUR_FG   30
 
#define COLOUR_BG   40
 
#define COLOR_FG   COLOUR_FG
 
#define COLOR_BG   COLOUR_BG
 
#define COLOR_BLACK   COLOUR_BLACK
 
#define COLOR_BLUE   COLOUR_BLUE
 
#define COLOR_GREEN   COLOUR_GREEN
 
#define COLOR_CYAN   COLOUR_CYAN
 
#define COLOR_RED   COLOUR_RED
 
#define COLOR_MAGENTA   COLOUR_MAGENTA
 
#define COLOR_YELLOW   COLOUR_YELLOW
 
#define COLOR_WHITE   COLOUR_WHITE
 
#define COLORS   COLOURS
 
#define can_change_color()   can_change_colour()
 
#define color_content(c, r, g, b)   colour_content( (c), (r), (g), (b) )
 
#define color_set(cpno, opts)   colour_set( (cpno), (opts) )
 
#define init_color   ( c, r, g, b ) init_colour ( (c), (r), (g), (b) )
 
#define slk_color(c)   slk_colour( (c) )
 
#define start_color()   start_colour()
 
#define wcolor_set(w, s, v)   wcolour_set((w),(s),(v))
 
#define mvprintw(y, x, fmt, ...)
 
#define mvwprintw(win, y, x, fmt, ...)
 
#define printw(fmt, ...)   wprintw(stdscr,(fmt), ## __VA_ARGS__ )
 
#define standend()   wstandend( stdscr )
 
#define standout()   wstandout( stdscr )
 

Typedefs

typedef uint32_t chtype
 
typedef uint32_t attr_t
 
typedef struct _curses_screen SCREEN
 Curses SCREEN object. More...
 
typedef struct _curses_window WINDOW
 Curses Window struct. More...
 

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 
int baudrate (void)
 
int beep (void)
 Audible signal. More...
 
int box (WINDOW *, chtype, chtype) __nonnull
 Draw borders from single-byte characters and renditions around a window. More...
 
int cbreak (void)
 
int colour_content (short, short *, short *, short *) __nonnull
 Identify the RGB components of a given colour value. More...
 
int copywin (const WINDOW *, WINDOW *, int, int, int, int, int, int, int)
 
int curs_set (int)
 Set cursor visibility. More...
 
int def_prog_mode (void)
 
int def_shell_mode (void)
 
int delay_output (int)
 
void delscreen (SCREEN *)
 
int delwin (WINDOW *) __nonnull
 Delete a window. More...
 
WINDOWderwin (WINDOW *, int, int, int, int) __nonnull
 Create a new derived window. More...
 
WINDOWdupwin (WINDOW *) __nonnull
 Create a duplicate of the specified window. More...
 
int echo (void)
 
int echochar (const chtype)
 
int endwin (void)
 Finalise console environment. More...
 
char erasechar (void)
 
int erase (void)
 Completely clear the screen. More...
 
void filter (void)
 
int flash (void)
 
int flushinp (void)
 
__pure chtype getbkgd (WINDOW *) __nonnull
 Get the background rendition attributes for a window. More...
 
int halfdelay (int)
 
bool has_ic (void)
 
bool has_il (void)
 
void idcok (WINDOW *, bool)
 
int idlok (WINDOW *, bool)
 
WINDOWinitscr (void)
 Initialise console environment. More...
 
int init_colour (short, short, short, short)
 
int init_pair (short, short, short)
 Initialise colour pair. More...
 
int intrflush (WINDOW *, bool)
 
bool isendwin (void)
 
char * keyname (int)
 
int keypad (WINDOW *, bool)
 
char killchar (void)
 
int leaveok (WINDOW *, bool)
 
char * longname (void)
 
int meta (WINDOW *, bool)
 
int mvcur (int, int, int, int)
 
int mvderwin (WINDOW *, int, int)
 
int mvwin (WINDOW *, int, int) __nonnull
 Move window origin to specified coordinates. More...
 
int napms (int)
 
WINDOWnewwin (int, int, int, int)
 Create new WINDOW. More...
 
int nl (void)
 
int nocbreak (void)
 
int nodelay (WINDOW *, bool)
 
int noecho (void)
 
int nonl (void)
 
void noqiflush (void)
 
int noraw (void)
 
int notimeout (WINDOW *, bool)
 
int overlay (const WINDOW *, WINDOW *)
 
int overwrite (const WINDOW *, WINDOW *)
 
int pair_content (short, short *, short *) __nonnull
 Get colours of colour pair. More...
 
int printw (char *,...)
 
int putp (const char *)
 
void qiflush (void)
 
int raw (void)
 
int reset_prog_mode (void)
 
int reset_shell_mode (void)
 
int resetty (void)
 
int ripoffline (int, int(*)(WINDOW *, int))
 
int savetty (void)
 
SCREENset_term (SCREEN *)
 
int setupterm (char *, int, int *)
 
int slk_attr_off (const attr_t, void *)
 
int slk_attroff (const chtype)
 Turn off soft function key attributes. More...
 
int slk_attr_on (const attr_t, void *)
 
int slk_attron (const chtype)
 Turn on soft function key attributes. More...
 
int slk_attr_set (const attr_t, short, void *)
 
int slk_attrset (const chtype)
 Set soft function key attributes. More...
 
int slk_clear (void)
 Clear the soft function key labels from the screen. More...
 
int slk_colour (short)
 Set soft label colour pair. More...
 
int slk_init (int)
 Initialise the soft function keys. More...
 
char * slk_label (int)
 Return the label for the specified soft key. More...
 
int slk_noutrefresh (void)
 
int slk_restore (void)
 Restore soft function key labels to the screen. More...
 
int slk_set (int, const char *, int) __nonnull
 Configure specified soft key. More...
 
int slk_touch (void)
 
WINDOWsubwin (WINDOW *, int, int, int, int) __nonnull
 Create a new sub-window. More...
 
int syncok (WINDOW *, bool)
 
chtype termattrs (void)
 
attr_t term_attrs (void)
 
char * termname (void)
 
int tigetflag (char *)
 
int tigetnum (char *)
 
char * tigetstr (char *)
 
void timeout (int)
 
char * tparm (char *, long, long, long, long, long, long, long, long, long)
 
int typeahead (int)
 
void use_env (bool)
 
int vid_attr (attr_t, short, void *)
 
int vidattr (chtype)
 
int vid_puts (attr_t, short, void *, int(*)(int))
 
int vidputs (chtype, int(*)(int))
 
int vw_printw (WINDOW *, const char *, va_list) __nonnull
 Print formatted output in a window. More...
 
int waddch (WINDOW *, const chtype) __nonnull
 Add a single-byte character and rendition to a window and advance the cursor. More...
 
int waddchnstr (WINDOW *, const chtype *, int) __nonnull
 Add string of single-byte characters and renditions to a window. More...
 
int waddnstr (WINDOW *, const char *, int) __nonnull
 Add string of single-byte characters to a window. More...
 
int wattroff (WINDOW *, int) __nonnull
 Turn off attributes in a window. More...
 
int wattron (WINDOW *, int) __nonnull
 Turn on attributes in a window. More...
 
int wattrset (WINDOW *, int) __nonnull
 Set attributes in a window. More...
 
int wattr_get (WINDOW *, attr_t *, short *, void *)
 
int wattr_off (WINDOW *, attr_t, void *)
 
int wattr_on (WINDOW *, attr_t, void *)
 
int wattr_set (WINDOW *, attr_t, short, void *)
 
int wborder (WINDOW *, chtype, chtype, chtype, chtype, chtype, chtype, chtype, chtype) __nonnull
 Draw borders from single-byte characters and renditions around a window. More...
 
int wclrtobot (WINDOW *) __nonnull
 Clear a window to the bottom from current cursor position. More...
 
int wclrtoeol (WINDOW *) __nonnull
 Clear a window to the end of the current line. More...
 
void wcursyncup (WINDOW *)
 
int wcolour_set (WINDOW *, short, void *)
 
int wdelch (WINDOW *) __nonnull
 Delete character under the cursor in a window. More...
 
int wdeleteln (WINDOW *) __nonnull
 Delete line under a window's cursor. More...
 
int wechochar (WINDOW *, const chtype)
 
int werase (WINDOW *) __nonnull
 Completely clear a window. More...
 
int wgetch (WINDOW *)
 Pop a character from the FIFO into a window. More...
 
int wgetnstr (WINDOW *, char *, int)
 Read at most n characters from the FIFO into a window. More...
 
int whline (WINDOW *, chtype, int) __nonnull
 Create a horizontal line in a window. More...
 
int wmove (WINDOW *, int, int)
 Move a window's cursor to the specified position. More...
 
int wprintw (WINDOW *, const char *,...) __nonnull
 Print formatted output to a window. More...
 
void wsyncup (WINDOW *)
 
void wsyncdown (WINDOW *)
 
void wtimeout (WINDOW *, int)
 
int wvline (WINDOW *, chtype, int) __nonnull
 Create a vertical line in a window. More...
 
static int addch (const chtype ch)
 
static int addchnstr (const chtype *chstr, int n)
 
static int addchstr (const chtype *chstr)
 
static int addnstr (const char *str, int n)
 
static int addstr (const char *str)
 
static int attroff (int attrs)
 
static int attron (int attrs)
 
static int attrset (int attrs)
 
static int attr_get (attr_t *attrs, short *pair, void *opts)
 
static int attr_off (attr_t attrs, void *opts)
 
static int attr_on (attr_t attrs, void *opts)
 
static int attr_set (attr_t attrs, short cpair, void *opts)
 
static void bkgdset (chtype ch)
 
static int border (chtype ls, chtype rs, chtype ts, chtype bs, chtype tl, chtype tr, chtype bl, chtype br)
 
static bool can_change_colour (void)
 
static int clrtobot (void)
 
static int clrtoeol (void)
 
static int colour_set (short colour_pair_number, void *opts)
 
static int delch (void)
 
static int deleteln (void)
 
static int getch (void)
 
static int getnstr (char *str, int n)
 
static int getstr (char *str)
 
static bool has_colors (void)
 
static int has_key (int kc __unused)
 
static int hline (chtype ch, int n)
 
static int move (int y, int x)
 
static int mvaddch (int y, int x, const chtype ch)
 
static int mvaddchnstr (int y, int x, const chtype *chstr, int n)
 
static int mvaddchstr (int y, int x, const chtype *chstr)
 
static int mvaddnstr (int y, int x, const char *str, int n)
 
static int mvaddstr (int y, int x, const char *str)
 
static int mvdelch (int y, int x)
 
static int mvgetch (int y, int x)
 
static int mvgetnstr (int y, int x, char *str, int n)
 
static int mvgetstr (int y, int x, char *str)
 
static int mvhline (int y, int x, chtype ch, int n)
 
static int mvvline (int y, int x, chtype ch, int n)
 
static int mvwaddch (WINDOW *win, int y, int x, const chtype ch)
 
static int mvwaddchnstr (WINDOW *win, int y, int x, const chtype *chstr, int n)
 
static int mvwaddchstr (WINDOW *win, int y, int x, const chtype *chstr)
 
static int mvwaddnstr (WINDOW *win, int y, int x, const char *str, int n)
 
static int mvwaddstr (WINDOW *win, int y, int x, const char *str)
 
static int mvwdelch (WINDOW *win, int y, int x)
 
static int mvwgetch (WINDOW *win, int y, int x)
 
static int mvwgetnstr (WINDOW *win, int y, int x, char *str, int n)
 
static int mvwgetstr (WINDOW *win, int y, int x, char *str)
 
static int mvwhline (WINDOW *win, int y, int x, chtype ch, int n)
 
static int mvwvline (WINDOW *win, int y, int x, chtype ch, int n)
 
static int slk_refresh (void)
 
static int start_colour (void)
 
static int vline (chtype ch, int n)
 
static int vwprintw (WINDOW *win, const char *fmt, va_list varglist)
 
static int waddchstr (WINDOW *win, const chtype *chstr)
 
static int waddstr (WINDOW *win, const char *str)
 
static int wbkgdset (WINDOW *win, chtype ch)
 
static int wgetstr (WINDOW *win, char *str)
 
static int wstandend (WINDOW *win)
 
static int wstandout (WINDOW *win)
 

Variables

WINDOW _stdscr
 

Detailed Description

MuCurses header file.

Definition in file curses.h.

Macro Definition Documentation

◆ ERR

#define ERR   (-1)

Definition at line 18 of file curses.h.

◆ FALSE

#define FALSE   (0)

Definition at line 21 of file curses.h.

◆ OK

#define OK   (0)

Definition at line 24 of file curses.h.

◆ TRUE

#define TRUE   (1)

Definition at line 27 of file curses.h.

◆ stdscr

#define stdscr   ( &_stdscr )

Definition at line 110 of file curses.h.

◆ COLS

#define COLS   console_width

Definition at line 111 of file curses.h.

◆ LINES

#define LINES   console_height

Definition at line 112 of file curses.h.

◆ MUCURSES_BITS

#define MUCURSES_BITS (   mask,
  shift 
)    (( mask ) << (shift))

Definition at line 114 of file curses.h.

◆ CPAIR_SHIFT

#define CPAIR_SHIFT   8

Definition at line 115 of file curses.h.

◆ ATTRS_SHIFT

#define ATTRS_SHIFT   16

Definition at line 116 of file curses.h.

◆ WA_DEFAULT

#define WA_DEFAULT   ( 0x0000 << ATTRS_SHIFT )

Definition at line 118 of file curses.h.

◆ WA_ALTCHARSET

#define WA_ALTCHARSET   ( 0x0001 << ATTRS_SHIFT )

Definition at line 119 of file curses.h.

◆ WA_BLINK

#define WA_BLINK   ( 0x0002 << ATTRS_SHIFT )

Definition at line 120 of file curses.h.

◆ WA_BOLD

#define WA_BOLD   ( 0x0004 << ATTRS_SHIFT )

Definition at line 121 of file curses.h.

◆ WA_DIM

#define WA_DIM   ( 0x0008 << ATTRS_SHIFT )

Definition at line 122 of file curses.h.

◆ WA_INVIS

#define WA_INVIS   ( 0x0010 << ATTRS_SHIFT )

Definition at line 123 of file curses.h.

◆ WA_PROTECT

#define WA_PROTECT   ( 0x0020 << ATTRS_SHIFT )

Definition at line 124 of file curses.h.

◆ WA_REVERSE

#define WA_REVERSE   ( 0x0040 << ATTRS_SHIFT )

Definition at line 125 of file curses.h.

◆ WA_STANDOUT

#define WA_STANDOUT   ( 0x0080 << ATTRS_SHIFT )

Definition at line 126 of file curses.h.

◆ WA_UNDERLINE

#define WA_UNDERLINE   ( 0x0100 << ATTRS_SHIFT )

Definition at line 127 of file curses.h.

◆ WA_HORIZONTAL

#define WA_HORIZONTAL   ( 0x0200 << ATTRS_SHIFT )

Definition at line 128 of file curses.h.

◆ WA_VERTICAL

#define WA_VERTICAL   ( 0x0400 << ATTRS_SHIFT )

Definition at line 129 of file curses.h.

◆ WA_LEFT

#define WA_LEFT   ( 0x0800 << ATTRS_SHIFT )

Definition at line 130 of file curses.h.

◆ WA_RIGHT

#define WA_RIGHT   ( 0x1000 << ATTRS_SHIFT )

Definition at line 131 of file curses.h.

◆ WA_LOW

#define WA_LOW   ( 0x2000 << ATTRS_SHIFT )

Definition at line 132 of file curses.h.

◆ WA_TOP

#define WA_TOP   ( 0x4000 << ATTRS_SHIFT )

Definition at line 133 of file curses.h.

◆ A_DEFAULT

#define A_DEFAULT   WA_DEFAULT

Definition at line 135 of file curses.h.

◆ A_ALTCHARSET

#define A_ALTCHARSET   WA_ALTCHARSET

Definition at line 136 of file curses.h.

◆ A_BLINK

#define A_BLINK   WA_BLINK

Definition at line 137 of file curses.h.

◆ A_BOLD

#define A_BOLD   WA_BOLD

Definition at line 138 of file curses.h.

◆ A_DIM

#define A_DIM   WA_DIM

Definition at line 139 of file curses.h.

◆ A_INVIS

#define A_INVIS   WA_INVIS

Definition at line 140 of file curses.h.

◆ A_PROTECT

#define A_PROTECT   WA_PROTECT

Definition at line 141 of file curses.h.

◆ A_REVERSE

#define A_REVERSE   WA_REVERSE

Definition at line 142 of file curses.h.

◆ A_STANDOUT

#define A_STANDOUT   WA_STANDOUT

Definition at line 143 of file curses.h.

◆ A_UNDERLINE

#define A_UNDERLINE   WA_UNDERLINE

Definition at line 144 of file curses.h.

◆ A_ATTRIBUTES

#define A_ATTRIBUTES   ( 0xffff << ATTRS_SHIFT )

Definition at line 146 of file curses.h.

◆ A_CHARTEXT

#define A_CHARTEXT   ( 0xff )

Definition at line 147 of file curses.h.

◆ A_COLOUR

#define A_COLOUR   ( 0xff << CPAIR_SHIFT )

Definition at line 148 of file curses.h.

◆ A_COLOR

#define A_COLOR   A_COLOUR

Definition at line 149 of file curses.h.

◆ COLOUR_PAIR

#define COLOUR_PAIR (   n)    ( (n) << CPAIR_SHIFT )

Definition at line 151 of file curses.h.

◆ COLOR_PAIR

#define COLOR_PAIR (   n)    COLOUR_PAIR(n)

Definition at line 152 of file curses.h.

◆ PAIR_NUMBER

#define PAIR_NUMBER (   attrs)    ( ( (attrs) & A_COLOUR ) >> CPAIR_SHIFT )

Definition at line 153 of file curses.h.

◆ COLOUR_PAIRS

#define COLOUR_PAIRS   8 /* Arbitrary limit */

Definition at line 155 of file curses.h.

◆ COLOR_PAIRS

#define COLOR_PAIRS   COLOUR_PAIRS

Definition at line 156 of file curses.h.

◆ ACS_ULCORNER

#define ACS_ULCORNER   '+'

Definition at line 158 of file curses.h.

◆ ACS_LLCORNER

#define ACS_LLCORNER   '+'

Definition at line 159 of file curses.h.

◆ ACS_URCORNER

#define ACS_URCORNER   '+'

Definition at line 160 of file curses.h.

◆ ACS_LRCORNER

#define ACS_LRCORNER   '+'

Definition at line 161 of file curses.h.

◆ ACS_RTEE

#define ACS_RTEE   '+'

Definition at line 162 of file curses.h.

◆ ACS_LTEE

#define ACS_LTEE   '+'

Definition at line 163 of file curses.h.

◆ ACS_BTEE

#define ACS_BTEE   '+'

Definition at line 164 of file curses.h.

◆ ACS_TTEE

#define ACS_TTEE   '+'

Definition at line 165 of file curses.h.

◆ ACS_HLINE

#define ACS_HLINE   '-'

Definition at line 166 of file curses.h.

◆ ACS_VLINE

#define ACS_VLINE   '|'

Definition at line 167 of file curses.h.

◆ ACS_PLUS

#define ACS_PLUS   '+'

Definition at line 168 of file curses.h.

◆ ACS_S1

#define ACS_S1   '-'

Definition at line 169 of file curses.h.

◆ ACS_S9

#define ACS_S9   '_'

Definition at line 170 of file curses.h.

◆ ACS_DIAMOND

#define ACS_DIAMOND   '+'

Definition at line 171 of file curses.h.

◆ ACS_CKBOARD

#define ACS_CKBOARD   ':'

Definition at line 172 of file curses.h.

◆ ACS_DEGREE

#define ACS_DEGREE   '\''

Definition at line 173 of file curses.h.

◆ ACS_PLMINUS

#define ACS_PLMINUS   '#'

Definition at line 174 of file curses.h.

◆ ACS_BULLET

#define ACS_BULLET   'o'

Definition at line 175 of file curses.h.

◆ ACS_LARROW

#define ACS_LARROW   '<'

Definition at line 176 of file curses.h.

◆ ACS_RARROW

#define ACS_RARROW   '>'

Definition at line 177 of file curses.h.

◆ ACS_DARROW

#define ACS_DARROW   'v'

Definition at line 178 of file curses.h.

◆ ACS_UARROW

#define ACS_UARROW   '^'

Definition at line 179 of file curses.h.

◆ ACS_BOARD

#define ACS_BOARD   '#'

Definition at line 180 of file curses.h.

◆ ACS_LANTERN

#define ACS_LANTERN   '#'

Definition at line 181 of file curses.h.

◆ ACS_BLOCK

#define ACS_BLOCK   '#'

Definition at line 182 of file curses.h.

◆ COLOUR_BLACK

#define COLOUR_BLACK   0

Definition at line 184 of file curses.h.

◆ COLOUR_RED

#define COLOUR_RED   1

Definition at line 185 of file curses.h.

◆ COLOUR_GREEN

#define COLOUR_GREEN   2

Definition at line 186 of file curses.h.

◆ COLOUR_YELLOW

#define COLOUR_YELLOW   3

Definition at line 187 of file curses.h.

◆ COLOUR_BLUE

#define COLOUR_BLUE   4

Definition at line 188 of file curses.h.

◆ COLOUR_MAGENTA

#define COLOUR_MAGENTA   5

Definition at line 189 of file curses.h.

◆ COLOUR_CYAN

#define COLOUR_CYAN   6

Definition at line 190 of file curses.h.

◆ COLOUR_WHITE

#define COLOUR_WHITE   7

Definition at line 191 of file curses.h.

◆ COLOURS

#define COLOURS   7

Definition at line 192 of file curses.h.

◆ COLOUR_FG

#define COLOUR_FG   30

Definition at line 194 of file curses.h.

◆ COLOUR_BG

#define COLOUR_BG   40

Definition at line 195 of file curses.h.

◆ COLOR_FG

#define COLOR_FG   COLOUR_FG

Definition at line 196 of file curses.h.

◆ COLOR_BG

#define COLOR_BG   COLOUR_BG

Definition at line 197 of file curses.h.

◆ COLOR_BLACK

#define COLOR_BLACK   COLOUR_BLACK

Definition at line 199 of file curses.h.

◆ COLOR_BLUE

#define COLOR_BLUE   COLOUR_BLUE

Definition at line 200 of file curses.h.

◆ COLOR_GREEN

#define COLOR_GREEN   COLOUR_GREEN

Definition at line 201 of file curses.h.

◆ COLOR_CYAN

#define COLOR_CYAN   COLOUR_CYAN

Definition at line 202 of file curses.h.

◆ COLOR_RED

#define COLOR_RED   COLOUR_RED

Definition at line 203 of file curses.h.

◆ COLOR_MAGENTA

#define COLOR_MAGENTA   COLOUR_MAGENTA

Definition at line 204 of file curses.h.

◆ COLOR_YELLOW

#define COLOR_YELLOW   COLOUR_YELLOW

Definition at line 205 of file curses.h.

◆ COLOR_WHITE

#define COLOR_WHITE   COLOUR_WHITE

Definition at line 206 of file curses.h.

◆ COLORS

#define COLORS   COLOURS

Definition at line 207 of file curses.h.

◆ can_change_color

#define can_change_color ( )    can_change_colour()

Definition at line 233 of file curses.h.

◆ color_content

#define color_content (   c,
  r,
  g,
 
)    colour_content( (c), (r), (g), (b) )

Definition at line 238 of file curses.h.

◆ color_set

#define color_set (   cpno,
  opts 
)    colour_set( (cpno), (opts) )

Definition at line 240 of file curses.h.

◆ init_color

#define init_color   ( c, r, g, b ) init_colour ( (c), (r), (g), (b) )

Definition at line 279 of file curses.h.

◆ slk_color

#define slk_color (   c)    slk_colour( (c) )

Definition at line 385 of file curses.h.

◆ start_color

#define start_color ( )    start_colour()

Definition at line 396 of file curses.h.

◆ wcolor_set

#define wcolor_set (   w,
  s,
 
)    wcolour_set((w),(s),(v))

Definition at line 448 of file curses.h.

◆ mvprintw

#define mvprintw (   y,
  x,
  fmt,
  ... 
)
Value:
( wmove(stdscr,(y),(x)) == OK \
? wprintw( stdscr,(fmt), ## __VA_ARGS__ ) : ERR )
int wmove(WINDOW *, int, int)
Move a window's cursor to the specified position.
Definition: mucurses.c:135
int wprintw(WINDOW *, const char *,...) __nonnull
Print formatted output to a window.
Definition: print.c:78
#define ERR
Definition: curses.h:18
#define stdscr
Definition: curses.h:110
#define OK
Definition: curses.h:24
int ssize_t const char * fmt
Definition: vsprintf.h:72

Definition at line 648 of file curses.h.

◆ mvwprintw

#define mvwprintw (   win,
  y,
  x,
  fmt,
  ... 
)
Value:
( wmove((win),(y),(x)) == OK \
? wprintw((win),(fmt), ## __VA_ARGS__) : ERR )
int wmove(WINDOW *, int, int)
Move a window's cursor to the specified position.
Definition: mucurses.c:135
int wprintw(WINDOW *, const char *,...) __nonnull
Print formatted output to a window.
Definition: print.c:78
#define ERR
Definition: curses.h:18
#define OK
Definition: curses.h:24
int ssize_t const char * fmt
Definition: vsprintf.h:72

Definition at line 707 of file curses.h.

◆ printw

#define printw (   fmt,
  ... 
)    wprintw(stdscr,(fmt), ## __VA_ARGS__ )

Definition at line 716 of file curses.h.

◆ standend

int standend ( )    wstandend( stdscr )

Definition at line 725 of file curses.h.

◆ standout

int standout ( )    wstandout( stdscr )

Definition at line 726 of file curses.h.

Typedef Documentation

◆ chtype

typedef uint32_t chtype

Definition at line 29 of file curses.h.

◆ attr_t

typedef uint32_t attr_t

Definition at line 30 of file curses.h.

◆ SCREEN

typedef struct _curses_screen SCREEN

Curses SCREEN object.

◆ WINDOW

typedef struct _curses_window WINDOW

Curses Window struct.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ baudrate()

int baudrate ( void  )

◆ beep()

int beep ( void  )

Audible signal.

Return values
rcreturn status code

Definition at line 17 of file alert.c.

17  {
18  printf("\a");
19  return OK;
20 }
int printf(const char *fmt,...)
Write a formatted string to the console.
Definition: vsprintf.c:464
Definition: sis900.h:208

References OK, and printf().

Referenced by wgetch(), and wgetnstr().

◆ box()

int box ( WINDOW win,
chtype  verch,
chtype  horch 
)

Draw borders from single-byte characters and renditions around a window.

Parameters
*winwindow to be bordered
verchvertical chtype
horchhorizontal chtype
Return values
rcreturn status code

Definition at line 22 of file edging.c.

22  {
23  chtype corner = '+' | win->attrs; /* default corner character */
24  return wborder( win, verch, verch, horch, horch,
25  corner, corner, corner, corner );
26 }
int wborder(WINDOW *win, chtype ls, chtype rs, chtype ts, chtype bs, chtype tl, chtype tr, chtype bl, chtype br)
Draw borders from single-byte characters and renditions around a window.
Definition: edging.c:43
attr_t attrs
window attributes
Definition: curses.h:93
uint32_t chtype
Definition: curses.h:29

References _curses_window::attrs, and wborder().

Referenced by draw_editbox(), edit_editbox(), and init_editbox().

◆ cbreak()

int cbreak ( void  )

◆ colour_content()

int colour_content ( short  colour,
short *  red,
short *  green,
short *  blue 
)

Identify the RGB components of a given colour value.

Parameters
colourcolour value
*redaddress to store red component
*greenaddress to store green component
*blueaddress to store blue component
Return values
rcreturn status code

Definition at line 23 of file colour.c.

23  {
24  *red = ( ( colour & COLOUR_RED ) ? 1 : 0 );
25  *green = ( ( colour & COLOUR_GREEN ) ? 1 : 0 );
26  *blue = ( ( colour & COLOUR_BLUE ) ? 1 : 0 );
27  return OK;
28 }
#define COLOUR_RED
Definition: curses.h:185
Definition: sis900.h:208
#define COLOUR_GREEN
Definition: curses.h:186
#define colour
Colour for debug messages.
Definition: init.c:40
#define COLOUR_BLUE
Definition: curses.h:188

References colour, COLOUR_BLUE, COLOUR_GREEN, COLOUR_RED, and OK.

◆ copywin()

int copywin ( const WINDOW ,
WINDOW ,
int  ,
int  ,
int  ,
int  ,
int  ,
int  ,
int   
)

◆ curs_set()

int curs_set ( int  visibility)

Set cursor visibility.

Parameters
visibilitycursor visibility

Definition at line 153 of file mucurses.c.

153  {
154  stdscr->scr->cursor ( stdscr->scr, visibility );
155  return OK;
156 }
Definition: sis900.h:208
#define stdscr
Definition: curses.h:110

References OK, and stdscr.

Referenced by endwin(), main_loop(), settings_ui(), and show_menu().

◆ def_prog_mode()

int def_prog_mode ( void  )

◆ def_shell_mode()

int def_shell_mode ( void  )

◆ delay_output()

int delay_output ( int  )

◆ delscreen()

void delscreen ( SCREEN )

◆ delwin()

int delwin ( WINDOW win)

Delete a window.

Parameters
*winpointer to window being deleted
Return values
rcreturn status code

Definition at line 20 of file windows.c.

20  {
21  /* I think we should blank the region covered by the window -
22  ncurses doesn't do this, but they have a buffer, so they
23  may just be deleting from an offscreen context whereas we
24  are guaranteed to be deleting something onscreen */
25  wmove( win, 0, 0 );
26  chtype killch = (chtype)' ';
27  do {
28  _wputch( win, killch, WRAP );
29  } while ( win->curs_x + win->curs_y );
30 
31  free( win );
32 
33  wmove ( stdscr, 0, 0 );
34 
35  return OK;
36 }
int wmove(WINDOW *win, int y, int x) __nonnull
Move a window's cursor to the specified position.
Definition: mucurses.c:135
unsigned int curs_y
Definition: curses.h:97
Definition: sis900.h:208
#define stdscr
Definition: curses.h:110
static void(* free)(struct refcnt *refcnt))
Definition: refcnt.h:54
void _wputch(WINDOW *win, chtype ch, int wrap) __nonnull
Write a single character rendition to a window.
Definition: mucurses.c:50
uint32_t chtype
Definition: curses.h:29
#define WRAP
Definition: mucurses.h:12
unsigned int curs_x
window cursor position
Definition: curses.h:97

References _wputch(), _curses_window::curs_x, _curses_window::curs_y, free, OK, stdscr, wmove(), and WRAP.

◆ derwin()

WINDOW* derwin ( WINDOW parent,
int  nlines,
int  ncols,
int  begin_y,
int  begin_x 
)

Create a new derived window.

Parameters
parentparent window
nlineswindow height
ncolswindow width
begin_ywindow y origin (relative to parent)
begin_xwindow x origin (relative to parent)
Return values
ptrreturn pointer to child window

Definition at line 48 of file windows.c.

49  {
50  WINDOW *child;
51  if ( ( (unsigned)ncols > parent->width ) ||
52  ( (unsigned)nlines > parent->height ) )
53  return NULL;
54  if ( ( child = malloc( sizeof( WINDOW ) ) ) == NULL )
55  return NULL;
56  child->ori_y = parent->ori_y + begin_y;
57  child->ori_x = parent->ori_x + begin_x;
58  child->height = nlines;
59  child->width = ncols;
60  child->parent = parent;
61  child->scr = parent->scr;
62  return child;
63 }
Curses Window struct.
Definition: curses.h:89
unsigned int height
Definition: curses.h:99
unsigned int width
window dimensions
Definition: curses.h:99
SCREEN * scr
screen with which window associates
Definition: curses.h:91
void * malloc(size_t size)
Allocate memory.
Definition: malloc.c:583
struct _curses_window * parent
parent window
Definition: curses.h:101
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362
unsigned int ori_x
window origin coordinates
Definition: curses.h:95
unsigned int ori_y
Definition: curses.h:95

References _curses_window::height, malloc(), NULL, _curses_window::ori_x, _curses_window::ori_y, _curses_window::parent, _curses_window::scr, and _curses_window::width.

◆ dupwin()

WINDOW* dupwin ( WINDOW orig)

Create a duplicate of the specified window.

Parameters
origoriginal window
Return values
ptrpointer to duplicate window

Definition at line 71 of file windows.c.

71  {
72  WINDOW *copy;
73  if ( ( copy = malloc( sizeof( WINDOW ) ) ) == NULL )
74  return NULL;
75  copy->scr = orig->scr;
76  copy->attrs = orig->attrs;
77  copy->ori_y = orig->ori_y;
78  copy->ori_x = orig->ori_x;
79  copy->curs_y = orig->curs_y;
80  copy->curs_x = orig->curs_x;
81  copy->height = orig->height;
82  copy->width = orig->width;
83  return copy;
84 }
Curses Window struct.
Definition: curses.h:89
unsigned int curs_y
Definition: curses.h:97
unsigned int height
Definition: curses.h:99
unsigned int width
window dimensions
Definition: curses.h:99
SCREEN * scr
screen with which window associates
Definition: curses.h:91
attr_t attrs
window attributes
Definition: curses.h:93
void * malloc(size_t size)
Allocate memory.
Definition: malloc.c:583
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362
unsigned int curs_x
window cursor position
Definition: curses.h:97
unsigned int ori_x
window origin coordinates
Definition: curses.h:95
unsigned int ori_y
Definition: curses.h:95

References _curses_window::attrs, _curses_window::curs_x, _curses_window::curs_y, _curses_window::height, malloc(), NULL, _curses_window::ori_x, _curses_window::ori_y, _curses_window::scr, and _curses_window::width.

◆ echo()

int echo ( void  )

Definition at line 133 of file kb.c.

133  {
134  m_echo = TRUE;
135  return OK;
136 }
Definition: sis900.h:208
bool m_echo
Definition: kb.c:21
#define TRUE
Definition: tlan.h:46

References m_echo, OK, and TRUE.

Referenced by fc_els_echo_detect(), fc_els_echo_rx_request(), fc_els_echo_rx_response(), fc_els_echo_tx(), icmp_rx_echo_reply(), icmp_rx_echo_request(), icmp_tx_echo(), icmp_tx_echo_reply(), icmp_tx_echo_request(), ping_deliver(), and ping_rx().

◆ echochar()

int echochar ( const  chtype)

◆ endwin()

int endwin ( void  )

Finalise console environment.

Definition at line 31 of file wininit.c.

31  {
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 }
static int attrset(int attrs)
Definition: curses.h:516
#define mvprintw(y, x, fmt,...)
Definition: curses.h:648
#define LINES(...)
Define inline lines.
Definition: linebuf_test.c:44
Definition: sis900.h:208
#define stdscr
Definition: curses.h:110
int curs_set(int visibility)
Set cursor visibility.
Definition: mucurses.c:153
#define color_set(cpno, opts)
Definition: curses.h:240
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362

References attrset(), color_set, curs_set(), LINES, mvprintw, NULL, OK, and stdscr.

Referenced by login_ui(), pxe_menu_select(), settings_ui(), and show_menu().

◆ erasechar()

char erasechar ( void  )

◆ erase()

int erase ( void  )

Completely clear the screen.

Return values
rcreturn status code

Definition at line 97 of file clear.c.

97  {
98  stdscr->scr->erase( stdscr->scr, stdscr->attrs );
99  return OK;
100 }
Definition: sis900.h:208
#define stdscr
Definition: curses.h:110

References OK, and stdscr.

Referenced by login_ui(), settings_ui(), and show_menu().

◆ filter()

void filter ( void  )

◆ flash()

int flash ( void  )

Referenced by bnx2_init_nvram().

◆ flushinp()

int flushinp ( void  )

◆ getbkgd()

__pure chtype getbkgd ( WINDOW win)
inline

Get the background rendition attributes for a window.

Parameters
*winsubject window
Return values
chchtype rendition representation

Definition at line 17 of file winattrs.c.

17  {
18  return win->attrs;
19 }
attr_t attrs
window attributes
Definition: curses.h:93

References _curses_window::attrs.

◆ halfdelay()

int halfdelay ( int  )

◆ has_ic()

bool has_ic ( void  )

◆ has_il()

bool has_il ( void  )

◆ idcok()

void idcok ( WINDOW ,
bool   
)

◆ idlok()

int idlok ( WINDOW ,
bool   
)

◆ initscr()

WINDOW* initscr ( void  )

Initialise console environment.

Return values
*winreturn pointer to stdscr

Definition at line 17 of file wininit.c.

17  {
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 }
#define LINES(...)
Define inline lines.
Definition: linebuf_test.c:44
#define stdscr
Definition: curses.h:110
#define COLS
Definition: curses.h:111
static int move(int y, int x)
Definition: curses.h:593

References COLS, LINES, move(), and stdscr.

Referenced by login_ui(), pxe_menu_select(), settings_ui(), and show_menu().

◆ init_colour()

int init_colour ( short  ,
short  ,
short  ,
short   
)

◆ init_pair()

int init_pair ( short  pair,
short  fcol,
short  bcol 
)

Initialise colour pair.

Parameters
paircolour pair number
fcolforeground colour
bcolbackground colour

Definition at line 37 of file colour.c.

37  {
38  struct colour_pair *cpair;
39 
40  if ( ( pair < 1 ) || ( pair >= COLOUR_PAIRS ) )
41  return ERR;
42 
43  cpair = &cpairs[pair];
44  cpair->fcol = fcol;
45  cpair->bcol = bcol;
46  return OK;
47 }
#define COLOUR_PAIRS
Definition: curses.h:155
Definition: sis900.h:208
#define ERR
Definition: curses.h:18
short bcol
Definition: colour.c:7
short fcol
Definition: colour.c:6
static struct colour_pair cpairs[COLOUR_PAIRS]
Definition: colour.c:10

References colour_pair::bcol, COLOUR_PAIRS, cpairs, ERR, colour_pair::fcol, and OK.

◆ intrflush()

int intrflush ( WINDOW ,
bool   
)

◆ isendwin()

bool isendwin ( void  )

◆ keyname()

char* keyname ( int  )

◆ keypad()

int keypad ( WINDOW ,
bool   
)

Referenced by usbkbd_map().

◆ killchar()

char killchar ( void  )

◆ leaveok()

int leaveok ( WINDOW ,
bool   
)

◆ longname()

char* longname ( void  )

◆ meta()

int meta ( WINDOW ,
bool   
)

◆ mvcur()

int mvcur ( int  ,
int  ,
int  ,
int   
)

◆ mvderwin()

int mvderwin ( WINDOW ,
int  ,
int   
)

◆ mvwin()

int mvwin ( WINDOW win,
int  y,
int  x 
)

Move window origin to specified coordinates.

Parameters
*winwindow to move
yY position
xX position
Return values
rcreturn status code

Definition at line 94 of file windows.c.

94  {
95  if ( ( ( (unsigned)y + win->height ) > LINES ) ||
96  ( ( (unsigned)x + win->width ) > COLS ) )
97  return ERR;
98 
99  win->ori_y = y;
100  win->ori_x = x;
101 
102  return OK;
103 }
#define LINES(...)
Define inline lines.
Definition: linebuf_test.c:44
unsigned int height
Definition: curses.h:99
unsigned int width
window dimensions
Definition: curses.h:99
Definition: sis900.h:208
#define ERR
Definition: curses.h:18
#define COLS
Definition: curses.h:111
unsigned int ori_x
window origin coordinates
Definition: curses.h:95
unsigned int ori_y
Definition: curses.h:95

References COLS, ERR, _curses_window::height, LINES, OK, _curses_window::ori_x, _curses_window::ori_y, and _curses_window::width.

◆ napms()

int napms ( int  )

◆ newwin()

WINDOW* newwin ( int  nlines,
int  ncols,
int  begin_y,
int  begin_x 
)

Create new WINDOW.

Parameters
nlinesnumber of lines
ncolsnumber of columns
begin_ycolumn origin
begin_xline origin
Return values
*winreturn pointer to new window

Definition at line 114 of file windows.c.

114  {
115  WINDOW *win;
116  if ( ( (unsigned)( begin_y + nlines ) > stdscr->height ) &&
117  ( (unsigned)( begin_x + ncols ) > stdscr->width ) )
118  return NULL;
119  if ( ( win = malloc( sizeof(WINDOW) ) ) == NULL )
120  return NULL;
121  win->ori_y = begin_y;
122  win->ori_x = begin_x;
123  win->height = nlines;
124  win->width = ncols;
125  win->scr = stdscr->scr;
126  win->parent = stdscr;
127  return win;
128 }
Curses Window struct.
Definition: curses.h:89
unsigned int height
Definition: curses.h:99
unsigned int width
window dimensions
Definition: curses.h:99
#define stdscr
Definition: curses.h:110
SCREEN * scr
screen with which window associates
Definition: curses.h:91
void * malloc(size_t size)
Allocate memory.
Definition: malloc.c:583
struct _curses_window * parent
parent window
Definition: curses.h:101
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362
unsigned int ori_x
window origin coordinates
Definition: curses.h:95
unsigned int ori_y
Definition: curses.h:95

References _curses_window::height, malloc(), NULL, _curses_window::ori_x, _curses_window::ori_y, _curses_window::parent, _curses_window::scr, stdscr, and _curses_window::width.

Referenced by subwin().

◆ nl()

int nl ( void  )

◆ nocbreak()

int nocbreak ( void  )

◆ nodelay()

int nodelay ( WINDOW ,
bool   
)

◆ noecho()

int noecho ( void  )

Definition at line 141 of file kb.c.

141  {
142  m_echo = FALSE;
143  return OK;
144 }
Definition: sis900.h:208
bool m_echo
Definition: kb.c:21
#define FALSE
Definition: tlan.h:45

References FALSE, m_echo, and OK.

◆ nonl()

int nonl ( void  )

◆ noqiflush()

void noqiflush ( void  )

◆ noraw()

int noraw ( void  )

◆ notimeout()

int notimeout ( WINDOW ,
bool   
)

◆ overlay()

int overlay ( const WINDOW ,
WINDOW  
)

◆ overwrite()

int overwrite ( const WINDOW ,
WINDOW  
)

Referenced by efi_pxe_mtftp().

◆ pair_content()

int pair_content ( short  pair,
short *  fcol,
short *  bcol 
)

Get colours of colour pair.

Parameters
paircolour pair number
Return values
fcolforeground colour
bcolbackground colour

Definition at line 56 of file colour.c.

56  {
57  struct colour_pair *cpair;
58 
59  if ( ( pair < 0 ) || ( pair >= COLOUR_PAIRS ) )
60  return ERR;
61 
62  cpair = &cpairs[pair];
63  *fcol = cpair->fcol;
64  *bcol = cpair->bcol;
65  return OK;
66 }
#define COLOUR_PAIRS
Definition: curses.h:155
Definition: sis900.h:208
#define ERR
Definition: curses.h:18
short bcol
Definition: colour.c:7
short fcol
Definition: colour.c:6
static struct colour_pair cpairs[COLOUR_PAIRS]
Definition: colour.c:10

References colour_pair::bcol, COLOUR_PAIRS, cpairs, ERR, colour_pair::fcol, and OK.

◆ printw()

int printw ( char *  ,
  ... 
)

Referenced by draw_menu_item().

◆ putp()

int putp ( const char *  )

◆ qiflush()

void qiflush ( void  )

◆ raw()

int raw ( void  )

◆ reset_prog_mode()

int reset_prog_mode ( void  )

◆ reset_shell_mode()

int reset_shell_mode ( void  )

◆ resetty()

int resetty ( void  )

◆ ripoffline()

int ripoffline ( int  ,
int(*)(WINDOW *, int)   
)

◆ savetty()

int savetty ( void  )

◆ set_term()

SCREEN* set_term ( SCREEN )

◆ setupterm()

int setupterm ( char *  ,
int  ,
int *   
)

◆ slk_attr_off()

int slk_attr_off ( const  attr_t,
void *   
)

◆ slk_attroff()

int slk_attroff ( const chtype  attrs)

Turn off soft function key attributes.

Parameters
attrsattribute bit mask
Return values
rcreturn status code

Definition at line 128 of file slk.c.

128  {
129  if ( slks == NULL )
130  return ERR;
131  slks->attrs &= ~( attrs & A_ATTRIBUTES );
132  return OK;
133 }
#define A_ATTRIBUTES
Definition: curses.h:146
attr_t attrs
Definition: slk.c:37
Definition: sis900.h:208
#define ERR
Definition: curses.h:18
uint32_t attrs
Extended attributes (optional)
Definition: memmap.c:32
static struct _softlabelkeys * slks
Definition: slk.c:55
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362

References A_ATTRIBUTES, attrs, _softlabelkeys::attrs, ERR, NULL, OK, and slks.

Referenced by slk_attr_off().

◆ slk_attr_on()

int slk_attr_on ( const  attr_t,
void *   
)

◆ slk_attron()

int slk_attron ( const chtype  attrs)

Turn on soft function key attributes.

Parameters
attrsattribute bit mask
Return values
rcreturn status code

Definition at line 141 of file slk.c.

141  {
142  if ( slks == NULL )
143  return ERR;
144  slks->attrs |= ( attrs & A_ATTRIBUTES );
145  return OK;
146 }
#define A_ATTRIBUTES
Definition: curses.h:146
attr_t attrs
Definition: slk.c:37
Definition: sis900.h:208
#define ERR
Definition: curses.h:18
uint32_t attrs
Extended attributes (optional)
Definition: memmap.c:32
static struct _softlabelkeys * slks
Definition: slk.c:55
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362

References A_ATTRIBUTES, attrs, _softlabelkeys::attrs, ERR, NULL, OK, and slks.

Referenced by slk_attr_on().

◆ slk_attr_set()

int slk_attr_set ( const  attr_t,
short  ,
void *   
)

◆ slk_attrset()

int slk_attrset ( const chtype  attrs)

Set soft function key attributes.

Parameters
attrsattribute bit mask
Return values
rcreturn status code

Definition at line 154 of file slk.c.

154  {
155  if ( slks == NULL )
156  return ERR;
157  slks->attrs = ( attrs & A_ATTRIBUTES );
158  return OK;
159 }
#define A_ATTRIBUTES
Definition: curses.h:146
attr_t attrs
Definition: slk.c:37
Definition: sis900.h:208
#define ERR
Definition: curses.h:18
uint32_t attrs
Extended attributes (optional)
Definition: memmap.c:32
static struct _softlabelkeys * slks
Definition: slk.c:55
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362

References A_ATTRIBUTES, attrs, _softlabelkeys::attrs, ERR, NULL, OK, and slks.

◆ slk_clear()

int slk_clear ( void  )

Clear the soft function key labels from the screen.

Return values
rcreturn status code

Definition at line 209 of file slk.c.

209  {
210  if ( slks == NULL )
211  return ERR;
212 
213  _enter_slk();
214  wclrtoeol ( stdscr );
215  _leave_slk();
216 
217  return OK;
218 }
static void _leave_slk(void)
Definition: slk.c:72
Definition: sis900.h:208
#define ERR
Definition: curses.h:18
static struct _softlabelkeys * slks
Definition: slk.c:55
#define stdscr
Definition: curses.h:110
static void _enter_slk(void)
Definition: slk.c:64
int wclrtoeol(WINDOW *win)
Clear a window to the end of the current line.
Definition: clear.c:37
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362

References _enter_slk(), _leave_slk(), ERR, NULL, OK, slks, stdscr, and wclrtoeol().

Referenced by slk_refresh().

◆ slk_colour()

int slk_colour ( short  )

Set soft label colour pair.

Definition at line 223 of file slk.c.

223  {
224  if ( slks == NULL )
225  return ERR;
226  if ( ( unsigned short )colour_pair_number > COLORS )
227  return ERR;
228 
229  slks->attrs = ( (unsigned short)colour_pair_number << CPAIR_SHIFT )
230  | ( slks->attrs & A_ATTRIBUTES );
231 
232  return OK;
233 }
#define A_ATTRIBUTES
Definition: curses.h:146
attr_t attrs
Definition: slk.c:37
#define COLORS
Definition: curses.h:207
Definition: sis900.h:208
#define ERR
Definition: curses.h:18
static struct _softlabelkeys * slks
Definition: slk.c:55
#define CPAIR_SHIFT
Definition: curses.h:115
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362

References A_ATTRIBUTES, _softlabelkeys::attrs, COLORS, CPAIR_SHIFT, ERR, NULL, OK, and slks.

◆ slk_init()

int slk_init ( int  fmt)

Initialise the soft function keys.

Parameters
fmtformat of keys
Return values
rcreturn status code

Definition at line 241 of file slk.c.

241  {
242  unsigned short nmaj, nmin, nblocks, available_width;
243 
244  if ( (unsigned)fmt > 3 ) {
245  return ERR;
246  }
247 
248  /* There seems to be no API call to free this data structure... */
249  if ( ! slks )
250  slks = calloc(1,sizeof(*slks));
251  if ( ! slks )
252  return ERR;
253 
254  slks->attrs = A_DEFAULT;
255  slks->fmt = fmt;
256  switch(fmt) {
257  case 0:
258  nblocks = 8; nmaj = 2; nmin = 5;
259  slks->spaces[0] = 2; slks->spaces[1] = 4;
260  break;
261  case 1:
262  nblocks = 8; nmaj = 1; nmin = 6;
263  slks->spaces[0] = 3;
264  break;
265  case 2:
266  // same allocations as format 3
267  case 3:
268  nblocks = 12; nmaj = 2; nmin = 9;
269  slks->spaces[0] = 3; slks->spaces[1] = 7;
270  break;
271  default:
272  return ERR;
273  }
274 
275  // determine maximum label length and major space size
276  available_width = COLS - ( ( MIN_SPACE_SIZE * nmaj ) + nmin );
277  slks->max_label_len = available_width / nblocks;
279  ( available_width % nblocks ) / nmaj;
280  slks->num_spaces = nmaj;
281  slks->num_labels = nblocks;
282 
283  // strip a line from the screen
284  LINES -= 1;
285 
286  return OK;
287 }
unsigned int maj_space_len
Definition: slk.c:46
unsigned int num_labels
Definition: slk.c:47
attr_t attrs
Definition: slk.c:37
#define A_DEFAULT
Definition: curses.h:135
#define LINES(...)
Define inline lines.
Definition: linebuf_test.c:44
Definition: sis900.h:208
unsigned int num_spaces
Definition: slk.c:48
unsigned int max_label_len
Definition: slk.c:45
#define ERR
Definition: curses.h:18
static void *__malloc calloc(size_t nmemb, size_t size)
Allocate cleared memory.
Definition: stdlib.h:45
static struct _softlabelkeys * slks
Definition: slk.c:55
unsigned int spaces[SLK_MAX_NUM_SPACES]
Definition: slk.c:49
#define MIN_SPACE_SIZE
Definition: slk.c:16
#define COLS
Definition: curses.h:111
int ssize_t const char * fmt
Definition: vsprintf.h:72
unsigned int fmt
Definition: slk.c:44

References A_DEFAULT, _softlabelkeys::attrs, calloc(), COLS, ERR, _softlabelkeys::fmt, fmt, LINES, _softlabelkeys::maj_space_len, _softlabelkeys::max_label_len, MIN_SPACE_SIZE, _softlabelkeys::num_labels, _softlabelkeys::num_spaces, OK, slks, and _softlabelkeys::spaces.

◆ slk_label()

char* slk_label ( int  labnum)

Return the label for the specified soft key.

Parameters
labnumsoft key identifier
Return values
labelreturn label

Definition at line 295 of file slk.c.

295  {
296  if ( slks == NULL )
297  return NULL;
298 
299  return slks->fkeys[labnum].label;
300 }
struct _softlabel fkeys[SLK_MAX_NUM_LABELS]
Definition: slk.c:36
char label[SLK_MAX_LABEL_LEN]
Definition: slk.c:26
static struct _softlabelkeys * slks
Definition: slk.c:55
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362

References _softlabelkeys::fkeys, _softlabel::label, NULL, and slks.

◆ slk_noutrefresh()

int slk_noutrefresh ( void  )

◆ slk_restore()

int slk_restore ( void  )

Restore soft function key labels to the screen.

Return values
rcreturn status code

Definition at line 307 of file slk.c.

307  {
308  unsigned int i, j, pos_x,
309  *next_space, *last_space;
310  chtype space_ch;
311 
312  if ( slks == NULL )
313  return ERR;
314 
315  pos_x = 0;
316 
317  _enter_slk();
318 
319  space_ch = (chtype)' ' | slks->attrs;
320  next_space = &(slks->spaces[0]);
321  last_space = &(slks->spaces[slks->num_spaces-1]);
322 
323  for ( i = 0; i < slks->num_labels ; i++ ) {
324  _print_label( slks->fkeys[i] );
325  pos_x += slks->max_label_len;
326 
327  if ( i == *next_space ) {
328  for ( j = 0; j < slks->maj_space_len; j++, pos_x++ )
329  _wputch ( stdscr, space_ch, NOWRAP );
330  if ( next_space < last_space )
331  next_space++;
332  } else {
333  if ( pos_x < COLS )
334  _wputch ( stdscr, space_ch, NOWRAP );
335  pos_x++;
336  }
337  }
338 
339  _leave_slk();
340 
341  return OK;
342 }
unsigned int maj_space_len
Definition: slk.c:46
unsigned int num_labels
Definition: slk.c:47
struct _softlabel fkeys[SLK_MAX_NUM_LABELS]
Definition: slk.c:36
static void _leave_slk(void)
Definition: slk.c:72
attr_t attrs
Definition: slk.c:37
Definition: sis900.h:208
unsigned int num_spaces
Definition: slk.c:48
unsigned int max_label_len
Definition: slk.c:45
#define ERR
Definition: curses.h:18
static void _print_label(struct _softlabel sl)
Definition: slk.c:78
static struct _softlabelkeys * slks
Definition: slk.c:55
#define stdscr
Definition: curses.h:110
#define NOWRAP
Definition: mucurses.h:13
static void _enter_slk(void)
Definition: slk.c:64
unsigned int spaces[SLK_MAX_NUM_SPACES]
Definition: slk.c:49
void _wputch(WINDOW *win, chtype ch, int wrap) __nonnull
Write a single character rendition to a window.
Definition: mucurses.c:50
#define COLS
Definition: curses.h:111
uint32_t chtype
Definition: curses.h:29
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362

References _enter_slk(), _leave_slk(), _print_label(), _wputch(), _softlabelkeys::attrs, COLS, ERR, _softlabelkeys::fkeys, _softlabelkeys::maj_space_len, _softlabelkeys::max_label_len, NOWRAP, NULL, _softlabelkeys::num_labels, _softlabelkeys::num_spaces, OK, slks, _softlabelkeys::spaces, and stdscr.

Referenced by slk_refresh().

◆ slk_set()

int slk_set ( int  labnum,
const char *  label,
int  fmt 
)

Configure specified soft key.

Parameters
labnumsoft label position to configure
*labelstring to use as soft key label
fmtjustification format of label
Return values
rcreturn status code

Definition at line 352 of file slk.c.

352  {
353  if ( slks == NULL )
354  return ERR;
355  if ( (unsigned short)labnum >= slks->num_labels )
356  return ERR;
357  if ( (unsigned short)fmt >= 3 )
358  return ERR;
359 
360  strncpy(slks->fkeys[labnum].label, label,
361  (sizeof(slks->fkeys[labnum].label) - 1));
362  slks->fkeys[labnum].fmt = fmt;
363 
364  return OK;
365 }
unsigned int num_labels
Definition: slk.c:47
struct _softlabel fkeys[SLK_MAX_NUM_LABELS]
Definition: slk.c:36
char label[SLK_MAX_LABEL_LEN]
Definition: slk.c:26
Definition: sis900.h:208
char * strncpy(char *dest, const char *src, size_t max)
Copy string.
Definition: string.c:317
#define ERR
Definition: curses.h:18
static struct _softlabelkeys * slks
Definition: slk.c:55
unsigned int fmt
Definition: slk.c:32
int ssize_t const char * fmt
Definition: vsprintf.h:72
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362

References ERR, _softlabelkeys::fkeys, _softlabel::fmt, fmt, _softlabel::label, NULL, _softlabelkeys::num_labels, OK, slks, and strncpy().

◆ slk_touch()

int slk_touch ( void  )

◆ subwin()

WINDOW* subwin ( WINDOW parent,
int  nlines,
int  ncols,
int  begin_y,
int  begin_x 
)

Create a new sub-window.

Parameters
origparent window
nlineswindow height
ncolswindow width
begin_ywindow y origin (absolute)
begin_xwindow x origin (absolute)
Return values
ptrreturn pointer to child window

Definition at line 140 of file windows.c.

141  {
142  WINDOW *child;
143  child = newwin( nlines, ncols, begin_y, begin_x );
144  child->parent = parent;
145  child->scr = parent->scr;
146  return child;
147 }
Curses Window struct.
Definition: curses.h:89
SCREEN * scr
screen with which window associates
Definition: curses.h:91
struct _curses_window * parent
parent window
Definition: curses.h:101
WINDOW * newwin(int nlines, int ncols, int begin_y, int begin_x)
Create new WINDOW.
Definition: windows.c:114

References newwin(), _curses_window::parent, and _curses_window::scr.

◆ syncok()

int syncok ( WINDOW ,
bool   
)

◆ termattrs()

chtype termattrs ( void  )

◆ term_attrs()

attr_t term_attrs ( void  )

◆ termname()

char* termname ( void  )

◆ tigetflag()

int tigetflag ( char *  )

◆ tigetnum()

int tigetnum ( char *  )

◆ tigetstr()

char* tigetstr ( char *  )

◆ timeout()

void timeout ( int  )

◆ tparm()

char* tparm ( char *  ,
long  ,
long  ,
long  ,
long  ,
long  ,
long  ,
long  ,
long  ,
long   
)

◆ typeahead()

int typeahead ( int  )

◆ use_env()

void use_env ( bool  )

◆ vid_attr()

int vid_attr ( attr_t  ,
short  ,
void *   
)

◆ vidattr()

int vidattr ( chtype  )

◆ vid_puts()

int vid_puts ( attr_t  ,
short  ,
void *  ,
int(*)(int)   
)

◆ vidputs()

int vidputs ( chtype  ,
int(*)(int)   
)

◆ vw_printw()

int vw_printw ( WINDOW win,
const char *  fmt,
va_list  varglist 
)

Print formatted output in a window.

Parameters
*winsubject window
*fmtformatted string
varglistargument list
Return values
rcreturn status code

Definition at line 61 of file print.c.

61  {
62  struct printw_context wctx;
63 
64  wctx.win = win;
65  wctx.ctx.handler = _printw_handler;
66  vcprintf ( &(wctx.ctx), fmt, varglist );
67  return OK;
68 }
Definition: sis900.h:208
WINDOW * win
Definition: print.c:43
int ssize_t const char * fmt
Definition: vsprintf.h:72
size_t vcprintf(struct printf_context *ctx, const char *fmt, va_list args)
Write a formatted string to a printf context.
Definition: vsprintf.c:187

References _printw_handler(), printw_context::ctx, fmt, printf_context::handler, OK, vcprintf(), and printw_context::win.

Referenced by vwprintw(), and wprintw().

◆ waddch()

int waddch ( WINDOW win,
const chtype  ch 
)

Add a single-byte character and rendition to a window and advance the cursor.

Parameters
*winwindow to be rendered in
chcharacter to be added at cursor
Return values
rcreturn status code

Definition at line 23 of file print.c.

23  {
24  _wputch( win, ch, WRAP );
25  return OK;
26 }
Definition: sis900.h:208
uint8_t ch
Definition: registers.h:83
WINDOW * win
Definition: print.c:43
void _wputch(WINDOW *win, chtype ch, int wrap) __nonnull
Write a single character rendition to a window.
Definition: mucurses.c:50
#define WRAP
Definition: mucurses.h:12

References _wputch(), ch, OK, and WRAP.

Referenced by addch(), mvaddch(), and mvwaddch().

◆ waddchnstr()

int waddchnstr ( WINDOW win,
const chtype chstr,
int  n 
)

Add string of single-byte characters and renditions to a window.

Parameters
*winwindow to be rendered in
*chstrpointer to first chtype in "string"
nmax number of chars from chstr to render
Return values
rcreturn status code

Definition at line 21 of file print_nadv.c.

21  {
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 }
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
unsigned int n
Definition: entropy.h:159
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

References _restore_curs_pos(), _store_curs_pos(), _wputchstr(), n, NOWRAP, and OK.

Referenced by addchnstr(), addchstr(), mvaddchnstr(), mvaddchstr(), mvwaddchnstr(), mvwaddchstr(), and waddchstr().

◆ waddnstr()

int waddnstr ( WINDOW win,
const char *  str,
int  n 
)

Add string of single-byte characters to a window.

Parameters
*winwindow to be rendered in
*strstandard c-style string
nmax number of chars from string to render
Return values
rcreturn status code

Definition at line 36 of file print.c.

36  {
37  _wputstr( win, str, WRAP, n );
38  return OK;
39 }
void _wputstr(WINDOW *win, const char *str, int wrap, int n) __nonnull
Write a standard c-style string to a window.
Definition: mucurses.c:121
Definition: sis900.h:208
unsigned int n
Definition: entropy.h:159
#define WRAP
Definition: mucurses.h:12

References _wputstr(), n, OK, and WRAP.

Referenced by addnstr(), addstr(), mvaddnstr(), mvaddstr(), mvwaddnstr(), mvwaddstr(), and waddstr().

◆ wattroff()

int wattroff ( WINDOW win,
int  attrs 
)

Turn off attributes in a window.

Parameters
winsubject window
attrsattributes to enable
Return values
rcreturn status code

Definition at line 28 of file winattrs.c.

28  {
29  win->attrs &= ~attrs;
30  return OK;
31 }
Definition: sis900.h:208
uint32_t attrs
Extended attributes (optional)
Definition: memmap.c:32
attr_t attrs
window attributes
Definition: curses.h:93

References attrs, _curses_window::attrs, and OK.

Referenced by attroff(), and wattr_off().

◆ wattron()

int wattron ( WINDOW win,
int  attrs 
)

Turn on attributes in a window.

Parameters
winsubject window
attrsattributes to enable
Return values
rcreturn status code

Definition at line 40 of file winattrs.c.

40  {
41  win->attrs |= attrs;
42  return OK;
43 }
Definition: sis900.h:208
uint32_t attrs
Extended attributes (optional)
Definition: memmap.c:32
attr_t attrs
window attributes
Definition: curses.h:93

References attrs, _curses_window::attrs, and OK.

Referenced by attron(), and wattr_on().

◆ wattrset()

int wattrset ( WINDOW win,
int  attrs 
)

Set attributes in a window.

Parameters
winsubject window
attrsattributes to enable
Return values
rcreturn status code

Definition at line 52 of file winattrs.c.

52  {
53  win->attrs = ( attrs | ( win->attrs & A_COLOR ) );
54  return OK;
55 }
Definition: sis900.h:208
uint32_t attrs
Extended attributes (optional)
Definition: memmap.c:32
attr_t attrs
window attributes
Definition: curses.h:93
#define A_COLOR
Definition: curses.h:149

References A_COLOR, attrs, _curses_window::attrs, and OK.

Referenced by _enter_slk(), attrset(), bkgdset(), wattr_set(), wbkgdset(), wstandend(), and wstandout().

◆ wattr_get()

int wattr_get ( WINDOW ,
attr_t ,
short *  ,
void *   
)

Referenced by attr_get().

◆ wattr_off()

int wattr_off ( WINDOW ,
attr_t  ,
void *   
)

Referenced by attr_off().

◆ wattr_on()

int wattr_on ( WINDOW ,
attr_t  ,
void *   
)

Referenced by attr_on().

◆ wattr_set()

int wattr_set ( WINDOW ,
attr_t  ,
short  ,
void *   
)

Referenced by attr_set().

◆ wborder()

int wborder ( WINDOW win,
chtype  ls,
chtype  rs,
chtype  ts,
chtype  bs,
chtype  tl,
chtype  tr,
chtype  bl,
chtype  br 
)

Draw borders from single-byte characters and renditions around a window.

Parameters
*winwindow to be bordered
lsleft side
rsright side
tstop
bsbottom
tltop left corner
trtop right corner
blbottom left corner
brbottom right corner
Return values
rcreturn status code

Definition at line 43 of file edging.c.

45  {
46  struct cursor_pos pos;
47 
48  _store_curs_pos( win, &pos );
49  wmove(win,0,0);
50 
51  _wputch(win,tl,WRAP);
52  while ( ( win->width - 1 ) - win->curs_x ) {
53  _wputch(win,ts,WRAP);
54  }
55  _wputch(win,tr,WRAP);
56 
57  while ( ( win->height - 1 ) - win->curs_y ) {
58  _wputch(win,ls,WRAP);
59  wmove(win,win->curs_y,(win->width)-1);
60  _wputch(win,rs,WRAP);
61  }
62 
63  _wputch(win,bl,WRAP);
64  while ( ( win->width -1 ) - win->curs_x ) {
65  _wputch(win,bs,WRAP);
66  }
67  _wputch(win,br,NOWRAP); /* do not wrap last char to leave
68  cursor in last position */
69  _restore_curs_pos( win, &pos );
70 
71  return OK;
72 }
int wmove(WINDOW *win, int y, int x) __nonnull
Move a window's cursor to the specified position.
Definition: mucurses.c:135
unsigned int curs_y
Definition: curses.h:97
uint8_t bl
Definition: registers.h:78
unsigned int height
Definition: curses.h:99
unsigned int width
window dimensions
Definition: curses.h:99
Definition: sis900.h:208
#define NOWRAP
Definition: mucurses.h:13
void _wputch(WINDOW *win, chtype ch, int wrap) __nonnull
Write a single character rendition to a window.
Definition: mucurses.c:50
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
#define WRAP
Definition: mucurses.h:12
unsigned int curs_x
window cursor position
Definition: curses.h:97

References _restore_curs_pos(), _store_curs_pos(), _wputch(), bl, _curses_window::curs_x, _curses_window::curs_y, _curses_window::height, NOWRAP, OK, _curses_window::width, wmove(), and WRAP.

Referenced by border(), and box().

◆ wclrtobot()

int wclrtobot ( WINDOW win)

Clear a window to the bottom from current cursor position.

Parameters
*winsubject window
Return values
rcreturn status code

Definition at line 19 of file clear.c.

19  {
20  struct cursor_pos pos;
21 
22  _store_curs_pos( win, &pos );
23  do {
24  _wputc( win, ' ', WRAP );
25  } while ( win->curs_y + win->curs_x );
26  _restore_curs_pos( win, &pos );
27 
28  return OK;
29 }
unsigned int curs_y
Definition: curses.h:97
Definition: sis900.h:208
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
void _wputc(WINDOW *win, char c, int wrap) __nonnull
Write a single character to a window.
Definition: mucurses.c:77
#define WRAP
Definition: mucurses.h:12
unsigned int curs_x
window cursor position
Definition: curses.h:97

References _restore_curs_pos(), _store_curs_pos(), _wputc(), _curses_window::curs_x, _curses_window::curs_y, OK, and WRAP.

Referenced by clrtobot(), and werase().

◆ wclrtoeol()

int wclrtoeol ( WINDOW win)

Clear a window to the end of the current line.

Parameters
*winsubject window
Return values
rcreturn status code

Definition at line 37 of file clear.c.

37  {
38  struct cursor_pos pos;
39 
40  _store_curs_pos( win, &pos );
41  while ( ( win->curs_y - pos.y ) == 0 ) {
42  _wputc( win, ' ', WRAP );
43  }
44  _restore_curs_pos( win, &pos );
45 
46  return OK;
47 }
unsigned int curs_y
Definition: curses.h:97
Definition: sis900.h:208
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
void _wputc(WINDOW *win, char c, int wrap) __nonnull
Write a single character to a window.
Definition: mucurses.c:77
#define WRAP
Definition: mucurses.h:12

References _restore_curs_pos(), _store_curs_pos(), _wputc(), _curses_window::curs_y, OK, WRAP, and cursor_pos::y.

Referenced by clrtoeol(), slk_clear(), and wdeleteln().

◆ wcursyncup()

void wcursyncup ( WINDOW )

◆ wcolour_set()

int wcolour_set ( WINDOW ,
short  ,
void *   
)

Referenced by colour_set().

◆ wdelch()

int wdelch ( WINDOW win)

Delete character under the cursor in a window.

Parameters
*winsubject window
Return values
rcreturn status code

Definition at line 55 of file clear.c.

55  {
56  _wputc( win, ' ', NOWRAP );
57  _wcursback( win );
58 
59  return OK;
60 }
Definition: sis900.h:208
#define NOWRAP
Definition: mucurses.h:13
void _wcursback(WINDOW *win) __nonnull
Retreat the cursor back one position (useful for a whole host of ops)
Definition: mucurses.c:87
void _wputc(WINDOW *win, char c, int wrap) __nonnull
Write a single character to a window.
Definition: mucurses.c:77

References _wcursback(), _wputc(), NOWRAP, and OK.

Referenced by delch(), mvdelch(), mvwdelch(), wgetch(), and wgetnstr().

◆ wdeleteln()

int wdeleteln ( WINDOW win)

Delete line under a window's cursor.

Parameters
*winsubject window
Return values
rcreturn status code

Definition at line 68 of file clear.c.

68  {
69  struct cursor_pos pos;
70 
71  _store_curs_pos( win, &pos );
72  /* let's just set the cursor to the beginning of the line and
73  let wclrtoeol do the work :) */
74  wmove( win, win->curs_y, 0 );
75  wclrtoeol( win );
76  _restore_curs_pos( win, &pos );
77  return OK;
78 }
int wmove(WINDOW *win, int y, int x) __nonnull
Move a window's cursor to the specified position.
Definition: mucurses.c:135
unsigned int curs_y
Definition: curses.h:97
Definition: sis900.h:208
int wclrtoeol(WINDOW *win)
Clear a window to the end of the current line.
Definition: clear.c:37
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

References _restore_curs_pos(), _store_curs_pos(), _curses_window::curs_y, OK, wclrtoeol(), and wmove().

Referenced by deleteln().

◆ wechochar()

int wechochar ( WINDOW ,
const  chtype 
)

◆ werase()

int werase ( WINDOW win)

Completely clear a window.

Parameters
*winsubject window
Return values
rcreturn status code

Definition at line 86 of file clear.c.

86  {
87  wmove( win, 0, 0 );
88  wclrtobot( win );
89  return OK;
90 }
int wmove(WINDOW *win, int y, int x) __nonnull
Move a window's cursor to the specified position.
Definition: mucurses.c:135
Definition: sis900.h:208
int wclrtobot(WINDOW *win)
Clear a window to the bottom from current cursor position.
Definition: clear.c:19

References OK, wclrtobot(), and wmove().

◆ wgetch()

int wgetch ( WINDOW win)

Pop a character from the FIFO into a window.

Parameters
*winwindow in which to echo input
Return values
cchar from input stream

Definition at line 55 of file kb.c.

55  {
56  int c;
57 
58  c = _wgetc( win );
59 
60  if ( m_echo ) {
61  if ( c >= KEY_MIN ) {
62  switch(c) {
63  case KEY_LEFT :
64  case KEY_BACKSPACE :
65  _wcursback( win );
66  wdelch( win );
67  break;
68  default :
69  beep();
70  break;
71  }
72  } else {
73  _wputch( win, (chtype)( c | win->attrs ), WRAP );
74  }
75  }
76 
77  return c;
78 }
static int _wgetc(WINDOW *win)
Definition: kb.c:24
static __always_inline void off_t int c
Definition: efi_uaccess.h:87
#define KEY_MIN
Definition: keys.h:64
attr_t attrs
window attributes
Definition: curses.h:93
bool m_echo
Definition: kb.c:21
int wdelch(WINDOW *win)
Delete character under the cursor in a window.
Definition: clear.c:55
void _wputch(WINDOW *win, chtype ch, int wrap) __nonnull
Write a single character rendition to a window.
Definition: mucurses.c:50
void _wcursback(WINDOW *win) __nonnull
Retreat the cursor back one position (useful for a whole host of ops)
Definition: mucurses.c:87
uint32_t chtype
Definition: curses.h:29
#define KEY_BACKSPACE
Definition: keys.h:87
int beep(void)
Audible signal.
Definition: alert.c:17
#define WRAP
Definition: mucurses.h:12
#define KEY_LEFT
Left arrow.
Definition: keys.h:68

References _wcursback(), _wgetc(), _wputch(), _curses_window::attrs, beep(), c, KEY_BACKSPACE, KEY_LEFT, KEY_MIN, m_echo, wdelch(), and WRAP.

Referenced by getch(), mvgetch(), and mvwgetch().

◆ wgetnstr()

int wgetnstr ( WINDOW win,
char *  str,
int  n 
)

Read at most n characters from the FIFO into a window.

Parameters
*winwindow in which to echo input
*strpointer to string in which to store result
nmaximum number of characters to read into string (inc. NUL)
Return values
rcreturn status code

Definition at line 88 of file kb.c.

88  {
89  char *_str;
90  int c;
91 
92  if ( n == 0 ) {
93  *str = '\0';
94  return OK;
95  }
96 
97  _str = str;
98 
99  while ( ( c = _wgetc( win ) ) != ERR ) {
100  /* termination enforcement - don't let us go past the
101  end of the allocated buffer... */
102  if ( n == 0 && ( c >= 32 && c <= 126 ) ) {
103  _wcursback( win );
104  wdelch( win );
105  } else {
106  if ( c >= 32 && c <= 126 ) {
107  *(_str++) = c; n--;
108  } else {
109  switch(c) {
110  case KEY_LEFT :
111  case KEY_BACKSPACE :
112  _wcursback( win );
113  wdelch( win );
114  break;
115  case KEY_ENTER :
116  *_str = '\0';
117  return OK;
118  default :
119  beep();
120  break;
121  }
122  }
123  }
124  }
125 
126  return ERR;
127 }
#define KEY_ENTER
Definition: keys.h:88
static int _wgetc(WINDOW *win)
Definition: kb.c:24
static __always_inline void off_t int c
Definition: efi_uaccess.h:87
Definition: sis900.h:208
#define ERR
Definition: curses.h:18
int wdelch(WINDOW *win)
Delete character under the cursor in a window.
Definition: clear.c:55
void _wcursback(WINDOW *win) __nonnull
Retreat the cursor back one position (useful for a whole host of ops)
Definition: mucurses.c:87
unsigned int n
Definition: entropy.h:159
#define KEY_BACKSPACE
Definition: keys.h:87
int beep(void)
Audible signal.
Definition: alert.c:17
#define KEY_LEFT
Left arrow.
Definition: keys.h:68

References _wcursback(), _wgetc(), beep(), c, ERR, KEY_BACKSPACE, KEY_ENTER, KEY_LEFT, n, OK, and wdelch().

Referenced by getnstr(), getstr(), mvgetnstr(), mvgetstr(), mvwgetnstr(), mvwgetstr(), and wgetstr().

◆ whline()

int whline ( WINDOW win,
chtype  ch,
int  n 
)

Create a horizontal line in a window.

Parameters
*winsubject window
chrendition and character
nmax number of chars (wide) to render
Return values
rcreturn status code

Definition at line 82 of file edging.c.

82  {
83  struct cursor_pos pos;
84 
85  _store_curs_pos ( win, &pos );
86  while ( ( win->curs_x - win->width ) && n-- ) {
87  _wputch ( win, ch, NOWRAP );
88  }
89  _restore_curs_pos ( win, &pos );
90 
91  return OK;
92 }
unsigned int width
window dimensions
Definition: curses.h:99
Definition: sis900.h:208
uint8_t ch
Definition: registers.h:83
#define NOWRAP
Definition: mucurses.h:13
void _wputch(WINDOW *win, chtype ch, int wrap) __nonnull
Write a single character rendition to a window.
Definition: mucurses.c:50
unsigned int n
Definition: entropy.h:159
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
unsigned int curs_x
window cursor position
Definition: curses.h:97

References _restore_curs_pos(), _store_curs_pos(), _wputch(), ch, _curses_window::curs_x, n, NOWRAP, OK, and _curses_window::width.

Referenced by hline(), mvhline(), and mvwhline().

◆ wmove()

int wmove ( WINDOW win,
int  y,
int  x 
)

Move a window's cursor to the specified position.

Parameters
*winwindow to be operated on
yY position
xX position
Return values
rcreturn status code

Definition at line 135 of file mucurses.c.

135  {
136  /* chech for out-of-bounds errors */
137  if ( ( (unsigned)y >= win->height ) ||
138  ( (unsigned)x >= win->width ) ) {
139  return ERR;
140  }
141 
142  win->curs_y = y;
143  win->curs_x = x;
144  _wupdcurs(win);
145  return OK;
146 }
unsigned int curs_y
Definition: curses.h:97
unsigned int height
Definition: curses.h:99
unsigned int width
window dimensions
Definition: curses.h:99
Definition: sis900.h:208
#define ERR
Definition: curses.h:18
unsigned int y
Definition: cursor.h:13
unsigned int x
Definition: cursor.h:13
static void _wupdcurs(WINDOW *win) __nonnull
Update cursor position.
Definition: mucurses.c:38
unsigned int curs_x
window cursor position
Definition: curses.h:97

References _wupdcurs(), _curses_window::curs_x, _curses_window::curs_y, ERR, _curses_window::height, OK, _curses_window::width, cursor_pos::x, and cursor_pos::y.

Referenced by _enter_slk(), _restore_curs_pos(), delwin(), draw_editbox(), move(), mvaddch(), mvaddchnstr(), mvaddchstr(), mvaddnstr(), mvaddstr(), mvdelch(), mvgetch(), mvgetnstr(), mvgetstr(), mvhline(), mvvline(), mvwaddch(), mvwaddchnstr(), mvwaddchstr(), mvwaddnstr(), mvwaddstr(), mvwdelch(), mvwgetch(), mvwgetnstr(), mvwgetstr(), mvwhline(), mvwvline(), wborder(), wdeleteln(), werase(), and wvline().

◆ wprintw()

int wprintw ( WINDOW win,
const char *  fmt,
  ... 
)

Print formatted output to a window.

Parameters
*winsubject window
*fmtformatted string
...string arguments
Return values
rcreturn status code

Definition at line 78 of file print.c.

78  {
79  va_list args;
80  int i;
81 
82  va_start ( args, fmt );
83  i = vw_printw ( win, fmt, args );
84  va_end ( args );
85  return i;
86 }
#define va_end(ap)
Definition: stdarg.h:9
__builtin_va_list va_list
Definition: stdarg.h:6
int ssize_t const char * fmt
Definition: vsprintf.h:72
#define va_start(ap, last)
Definition: stdarg.h:7

References fmt, va_end, va_start, vw_printw(), and printw_context::win.

◆ wsyncup()

void wsyncup ( WINDOW )

◆ wsyncdown()

void wsyncdown ( WINDOW )

◆ wtimeout()

void wtimeout ( WINDOW ,
int   
)

◆ wvline()

int wvline ( WINDOW win,
chtype  ch,
int  n 
)

Create a vertical line in a window.

Parameters
*winsubject window
chrendition and character
nmax number of chars (high) to render
Return values
rcreturn status code

Definition at line 102 of file edging.c.

102  {
103  struct cursor_pos pos;
104 
105  _store_curs_pos ( win, &pos );
106  while ( ( win->curs_y - win->height ) && n-- ) {
107  _wputch ( win, ch, NOWRAP );
108  wmove( win, ++(win->curs_y), pos.x);
109  }
110  _restore_curs_pos ( win, &pos );
111 
112  return OK;
113 }
int wmove(WINDOW *win, int y, int x) __nonnull
Move a window's cursor to the specified position.
Definition: mucurses.c:135
unsigned int curs_y
Definition: curses.h:97
unsigned int height
Definition: curses.h:99
Definition: sis900.h:208
uint8_t ch
Definition: registers.h:83
#define NOWRAP
Definition: mucurses.h:13
void _wputch(WINDOW *win, chtype ch, int wrap) __nonnull
Write a single character rendition to a window.
Definition: mucurses.c:50
unsigned int n
Definition: entropy.h:159
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

References _restore_curs_pos(), _store_curs_pos(), _wputch(), ch, _curses_window::curs_y, _curses_window::height, n, NOWRAP, OK, wmove(), and cursor_pos::x.

Referenced by mvvline(), mvwvline(), and vline().

◆ addch()

static int addch ( const chtype  ch)
inlinestatic

Definition at line 488 of file curses.h.

488  {
489  return waddch( stdscr, ch );
490 }
uint8_t ch
Definition: registers.h:83
int waddch(WINDOW *, const chtype) __nonnull
Add a single-byte character and rendition to a window and advance the cursor.
Definition: print.c:23
#define stdscr
Definition: curses.h:110

References ch, stdscr, and waddch().

◆ addchnstr()

static int addchnstr ( const chtype chstr,
int  n 
)
inlinestatic

Definition at line 492 of file curses.h.

492  {
493  return waddchnstr ( stdscr, chstr, n );
494 }
#define stdscr
Definition: curses.h:110
int waddchnstr(WINDOW *, const chtype *, int) __nonnull
Add string of single-byte characters and renditions to a window.
Definition: print_nadv.c:21
unsigned int n
Definition: entropy.h:159

References n, stdscr, and waddchnstr().

◆ addchstr()

static int addchstr ( const chtype chstr)
inlinestatic

Definition at line 496 of file curses.h.

496  {
497  return waddchnstr ( stdscr, chstr, -1 );
498 }
#define stdscr
Definition: curses.h:110
int waddchnstr(WINDOW *, const chtype *, int) __nonnull
Add string of single-byte characters and renditions to a window.
Definition: print_nadv.c:21

References stdscr, and waddchnstr().

◆ addnstr()

static int addnstr ( const char *  str,
int  n 
)
inlinestatic

Definition at line 500 of file curses.h.

500  {
501  return waddnstr ( stdscr, str, n );
502 }
#define stdscr
Definition: curses.h:110
int waddnstr(WINDOW *, const char *, int) __nonnull
Add string of single-byte characters to a window.
Definition: print.c:36
unsigned int n
Definition: entropy.h:159

References n, stdscr, and waddnstr().

◆ addstr()

static int addstr ( const char *  str)
inlinestatic

Definition at line 504 of file curses.h.

504  {
505  return waddnstr ( stdscr, str, -1 );
506 }
#define stdscr
Definition: curses.h:110
int waddnstr(WINDOW *, const char *, int) __nonnull
Add string of single-byte characters to a window.
Definition: print.c:36

References stdscr, and waddnstr().

◆ attroff()

static int attroff ( int  attrs)
inlinestatic

Definition at line 508 of file curses.h.

508  {
509  return wattroff ( stdscr, attrs );
510 }
uint32_t attrs
Extended attributes (optional)
Definition: memmap.c:32
#define stdscr
Definition: curses.h:110
int wattroff(WINDOW *, int) __nonnull
Turn off attributes in a window.
Definition: winattrs.c:28

References attrs, stdscr, and wattroff().

Referenced by draw_info_row(), draw_menu_item(), draw_setting_row(), draw_title_row(), login_ui(), and show_menu().

◆ attron()

static int attron ( int  attrs)
inlinestatic

Definition at line 512 of file curses.h.

512  {
513  return wattron ( stdscr, attrs );
514 }
uint32_t attrs
Extended attributes (optional)
Definition: memmap.c:32
#define stdscr
Definition: curses.h:110
int wattron(WINDOW *, int) __nonnull
Turn on attributes in a window.
Definition: winattrs.c:40

References attrs, stdscr, and wattron().

Referenced by draw_info_row(), draw_menu_item(), draw_setting_row(), draw_title_row(), login_ui(), and show_menu().

◆ attrset()

static int attrset ( int  attrs)
inlinestatic

Definition at line 516 of file curses.h.

516  {
517  return wattrset ( stdscr, attrs );
518 }
int wattrset(WINDOW *, int) __nonnull
Set attributes in a window.
Definition: winattrs.c:52
uint32_t attrs
Extended attributes (optional)
Definition: memmap.c:32
#define stdscr
Definition: curses.h:110

References attrs, stdscr, and wattrset().

Referenced by endwin().

◆ attr_get()

static int attr_get ( attr_t attrs,
short *  pair,
void *  opts 
)
inlinestatic

Definition at line 520 of file curses.h.

520  {
521  return wattr_get ( stdscr, attrs, pair, opts );
522 }
int wattr_get(WINDOW *, attr_t *, short *, void *)
uint32_t attrs
Extended attributes (optional)
Definition: memmap.c:32
static union @423 opts
"cert<xxx>" option list
#define stdscr
Definition: curses.h:110

References attrs, opts, stdscr, and wattr_get().

◆ attr_off()

static int attr_off ( attr_t  attrs,
void *  opts 
)
inlinestatic

Definition at line 524 of file curses.h.

524  {
525  return wattr_off ( stdscr, attrs, opts );
526 }
int wattr_off(WINDOW *, attr_t, void *)
uint32_t attrs
Extended attributes (optional)
Definition: memmap.c:32
static union @423 opts
"cert<xxx>" option list
#define stdscr
Definition: curses.h:110

References attrs, opts, stdscr, and wattr_off().

◆ attr_on()

static int attr_on ( attr_t  attrs,
void *  opts 
)
inlinestatic

Definition at line 528 of file curses.h.

528  {
529  return wattr_on ( stdscr, attrs, opts );
530 }
int wattr_on(WINDOW *, attr_t, void *)
uint32_t attrs
Extended attributes (optional)
Definition: memmap.c:32
static union @423 opts
"cert<xxx>" option list
#define stdscr
Definition: curses.h:110

References attrs, opts, stdscr, and wattr_on().

◆ attr_set()

static int attr_set ( attr_t  attrs,
short  cpair,
void *  opts 
)
inlinestatic

Definition at line 532 of file curses.h.

532  {
533  return wattr_set ( stdscr, attrs, cpair, opts );
534 }
uint32_t attrs
Extended attributes (optional)
Definition: memmap.c:32
static union @423 opts
"cert<xxx>" option list
#define stdscr
Definition: curses.h:110
int wattr_set(WINDOW *, attr_t, short, void *)

References attrs, opts, stdscr, and wattr_set().

◆ bkgdset()

static void bkgdset ( chtype  ch)
inlinestatic

Definition at line 536 of file curses.h.

536  {
537  wattrset ( stdscr, ch );
538 }
uint8_t ch
Definition: registers.h:83
int wattrset(WINDOW *, int) __nonnull
Set attributes in a window.
Definition: winattrs.c:52
#define stdscr
Definition: curses.h:110

References ch, stdscr, and wattrset().

◆ border()

static int border ( chtype  ls,
chtype  rs,
chtype  ts,
chtype  bs,
chtype  tl,
chtype  tr,
chtype  bl,
chtype  br 
)
inlinestatic

Definition at line 540 of file curses.h.

541  {
542  return wborder ( stdscr, ls, rs, ts, bs, tl, tr, bl, br );
543 }
uint8_t bl
Definition: registers.h:78
int wborder(WINDOW *, chtype, chtype, chtype, chtype, chtype, chtype, chtype, chtype) __nonnull
Draw borders from single-byte characters and renditions around a window.
Definition: edging.c:43
#define stdscr
Definition: curses.h:110

References bl, stdscr, and wborder().

◆ can_change_colour()

static bool can_change_colour ( void  )
inlinestatic

Definition at line 545 of file curses.h.

545  {
546  return FALSE;
547 }
#define FALSE
Definition: curses.h:21

References FALSE.

◆ clrtobot()

static int clrtobot ( void  )
inlinestatic

Definition at line 549 of file curses.h.

549  {
550  return wclrtobot( stdscr );
551 }
#define stdscr
Definition: curses.h:110
int wclrtobot(WINDOW *) __nonnull
Clear a window to the bottom from current cursor position.
Definition: clear.c:19

References stdscr, and wclrtobot().

◆ clrtoeol()

static int clrtoeol ( void  )
inlinestatic

Definition at line 553 of file curses.h.

553  {
554  return wclrtoeol( stdscr );
555 }
int wclrtoeol(WINDOW *) __nonnull
Clear a window to the end of the current line.
Definition: clear.c:37
#define stdscr
Definition: curses.h:110

References stdscr, and wclrtoeol().

Referenced by clearmsg(), and draw_menu_item().

◆ colour_set()

static int colour_set ( short  colour_pair_number,
void *  opts 
)
inlinestatic

Definition at line 557 of file curses.h.

557  {
558  return wcolour_set ( stdscr, colour_pair_number, opts );
559 }
int wcolour_set(WINDOW *, short, void *)
static union @423 opts
"cert<xxx>" option list
#define stdscr
Definition: curses.h:110

References opts, stdscr, and wcolour_set().

◆ delch()

static int delch ( void  )
inlinestatic

Definition at line 561 of file curses.h.

561  {
562  return wdelch ( stdscr );
563 }
#define stdscr
Definition: curses.h:110
int wdelch(WINDOW *) __nonnull
Delete character under the cursor in a window.
Definition: clear.c:55

References stdscr, and wdelch().

◆ deleteln()

static int deleteln ( void  )
inlinestatic

Definition at line 565 of file curses.h.

565  {
566  return wdeleteln( stdscr );
567 }
#define stdscr
Definition: curses.h:110
int wdeleteln(WINDOW *) __nonnull
Delete line under a window's cursor.
Definition: clear.c:68

References stdscr, and wdeleteln().

◆ getch()

static int getch ( void  )
inlinestatic

Definition at line 569 of file curses.h.

569  {
570  return wgetch ( stdscr );
571 }
#define stdscr
Definition: curses.h:110
int wgetch(WINDOW *)
Pop a character from the FIFO into a window.
Definition: kb.c:55

References stdscr, and wgetch().

◆ getnstr()

static int getnstr ( char *  str,
int  n 
)
inlinestatic

Definition at line 573 of file curses.h.

573  {
574  return wgetnstr ( stdscr, str, n );
575 }
int wgetnstr(WINDOW *, char *, int)
Read at most n characters from the FIFO into a window.
Definition: kb.c:88
#define stdscr
Definition: curses.h:110
unsigned int n
Definition: entropy.h:159

References n, stdscr, and wgetnstr().

◆ getstr()

static int getstr ( char *  str)
inlinestatic

Definition at line 577 of file curses.h.

577  {
578  return wgetnstr ( stdscr, str, -1 );
579 }
int wgetnstr(WINDOW *, char *, int)
Read at most n characters from the FIFO into a window.
Definition: kb.c:88
#define stdscr
Definition: curses.h:110

References stdscr, and wgetnstr().

◆ has_colors()

static bool has_colors ( void  )
inlinestatic

Definition at line 581 of file curses.h.

581  {
582  return TRUE;
583 }
#define TRUE
Definition: curses.h:27

References TRUE.

◆ has_key()

static int has_key ( int kc  __unused)
inlinestatic

Definition at line 585 of file curses.h.

585  {
586  return TRUE;
587 }
#define TRUE
Definition: curses.h:27

References TRUE.

◆ hline()

static int hline ( chtype  ch,
int  n 
)
inlinestatic

Definition at line 589 of file curses.h.

589  {
590  return whline ( stdscr, ch, n );
591 }
uint8_t ch
Definition: registers.h:83
#define stdscr
Definition: curses.h:110
int whline(WINDOW *, chtype, int) __nonnull
Create a horizontal line in a window.
Definition: edging.c:82
unsigned int n
Definition: entropy.h:159

References ch, n, stdscr, and whline().

◆ move()

static int move ( int  y,
int  x 
)
inlinestatic

Definition at line 593 of file curses.h.

593  {
594  return wmove ( stdscr, y, x );
595 }
int wmove(WINDOW *, int, int)
Move a window's cursor to the specified position.
Definition: mucurses.c:135
#define stdscr
Definition: curses.h:110
unsigned int y
Definition: cursor.h:13
unsigned int x
Definition: cursor.h:13

References stdscr, and wmove().

Referenced by clearmsg(), draw_menu_item(), draw_setting_row(), initscr(), jump_scroll_move(), main_loop(), menu_loop(), and pxe_menu_draw_item().

◆ mvaddch()

static int mvaddch ( int  y,
int  x,
const chtype  ch 
)
inlinestatic

Definition at line 597 of file curses.h.

597  {
598  return ( wmove ( stdscr, y, x ) == OK
599  ? waddch( stdscr, ch ) : ERR );
600 }
int wmove(WINDOW *, int, int)
Move a window's cursor to the specified position.
Definition: mucurses.c:135
uint8_t ch
Definition: registers.h:83
#define ERR
Definition: curses.h:18
int waddch(WINDOW *, const chtype) __nonnull
Add a single-byte character and rendition to a window and advance the cursor.
Definition: print.c:23
#define stdscr
Definition: curses.h:110
unsigned int y
Definition: cursor.h:13
#define OK
Definition: curses.h:24
unsigned int x
Definition: cursor.h:13

References ch, ERR, OK, stdscr, waddch(), and wmove().

◆ mvaddchnstr()

static int mvaddchnstr ( int  y,
int  x,
const chtype chstr,
int  n 
)
inlinestatic

Definition at line 602 of file curses.h.

602  {
603  return ( wmove ( stdscr, y, x ) == OK
604  ? waddchnstr ( stdscr, chstr, n ) : ERR );
605 }
int wmove(WINDOW *, int, int)
Move a window's cursor to the specified position.
Definition: mucurses.c:135
#define ERR
Definition: curses.h:18
#define stdscr
Definition: curses.h:110
int waddchnstr(WINDOW *, const chtype *, int) __nonnull
Add string of single-byte characters and renditions to a window.
Definition: print_nadv.c:21
unsigned int y
Definition: cursor.h:13
#define OK
Definition: curses.h:24
unsigned int n
Definition: entropy.h:159
unsigned int x
Definition: cursor.h:13

References ERR, n, OK, stdscr, waddchnstr(), and wmove().

◆ mvaddchstr()

static int mvaddchstr ( int  y,
int  x,
const chtype chstr 
)
inlinestatic

Definition at line 607 of file curses.h.

607  {
608  return ( wmove ( stdscr, y, x ) == OK
609  ? waddchnstr ( stdscr, chstr, -1 ) : ERR );
610 }
int wmove(WINDOW *, int, int)
Move a window's cursor to the specified position.
Definition: mucurses.c:135
#define ERR
Definition: curses.h:18
#define stdscr
Definition: curses.h:110
int waddchnstr(WINDOW *, const chtype *, int) __nonnull
Add string of single-byte characters and renditions to a window.
Definition: print_nadv.c:21
unsigned int y
Definition: cursor.h:13
#define OK
Definition: curses.h:24
unsigned int x
Definition: cursor.h:13

References ERR, OK, stdscr, waddchnstr(), and wmove().

◆ mvaddnstr()

static int mvaddnstr ( int  y,
int  x,
const char *  str,
int  n 
)
inlinestatic

Definition at line 612 of file curses.h.

612  {
613  return ( wmove ( stdscr, y, x ) == OK
614  ? waddnstr ( stdscr, str, n ) : ERR );
615 }
int wmove(WINDOW *, int, int)
Move a window's cursor to the specified position.
Definition: mucurses.c:135
#define ERR
Definition: curses.h:18
#define stdscr
Definition: curses.h:110
unsigned int y
Definition: cursor.h:13
#define OK
Definition: curses.h:24
int waddnstr(WINDOW *, const char *, int) __nonnull
Add string of single-byte characters to a window.
Definition: print.c:36
unsigned int n
Definition: entropy.h:159
unsigned int x
Definition: cursor.h:13

References ERR, n, OK, stdscr, waddnstr(), and wmove().

◆ mvaddstr()

static int mvaddstr ( int  y,
int  x,
const char *  str 
)
inlinestatic

Definition at line 617 of file curses.h.

617  {
618  return ( wmove ( stdscr, y, x ) == OK
619  ? waddnstr ( stdscr, str, -1 ) : ERR );
620 }
int wmove(WINDOW *, int, int)
Move a window's cursor to the specified position.
Definition: mucurses.c:135
#define ERR
Definition: curses.h:18
#define stdscr
Definition: curses.h:110
unsigned int y
Definition: cursor.h:13
#define OK
Definition: curses.h:24
int waddnstr(WINDOW *, const char *, int) __nonnull
Add string of single-byte characters to a window.
Definition: print.c:36
unsigned int x
Definition: cursor.h:13

References ERR, OK, stdscr, waddnstr(), and wmove().

Referenced by draw_menu_items(), and draw_setting_rows().

◆ mvdelch()

static int mvdelch ( int  y,
int  x 
)
inlinestatic

Definition at line 622 of file curses.h.

622  {
623  return ( wmove ( stdscr, y, x ) == OK
624  ? wdelch ( stdscr ) : ERR );
625 }
int wmove(WINDOW *, int, int)
Move a window's cursor to the specified position.
Definition: mucurses.c:135
#define ERR
Definition: curses.h:18
#define stdscr
Definition: curses.h:110
unsigned int y
Definition: cursor.h:13
#define OK
Definition: curses.h:24
int wdelch(WINDOW *) __nonnull
Delete character under the cursor in a window.
Definition: clear.c:55
unsigned int x
Definition: cursor.h:13

References ERR, OK, stdscr, wdelch(), and wmove().

◆ mvgetch()

static int mvgetch ( int  y,
int  x 
)
inlinestatic

Definition at line 627 of file curses.h.

627  {
628  return ( wmove ( stdscr, y, x ) == OK
629  ? wgetch ( stdscr ) : ERR );
630 }
int wmove(WINDOW *, int, int)
Move a window's cursor to the specified position.
Definition: mucurses.c:135
#define ERR
Definition: curses.h:18
#define stdscr
Definition: curses.h:110
unsigned int y
Definition: cursor.h:13
#define OK
Definition: curses.h:24
int wgetch(WINDOW *)
Pop a character from the FIFO into a window.
Definition: kb.c:55
unsigned int x
Definition: cursor.h:13

References ERR, OK, stdscr, wgetch(), and wmove().

◆ mvgetnstr()

static int mvgetnstr ( int  y,
int  x,
char *  str,
int  n 
)
inlinestatic

Definition at line 632 of file curses.h.

632  {
633  return ( wmove ( stdscr, y, x ) == OK
634  ? wgetnstr ( stdscr, str, n ) : ERR );
635 }
int wgetnstr(WINDOW *, char *, int)
Read at most n characters from the FIFO into a window.
Definition: kb.c:88
int wmove(WINDOW *, int, int)
Move a window's cursor to the specified position.
Definition: mucurses.c:135
#define ERR
Definition: curses.h:18
#define stdscr
Definition: curses.h:110
unsigned int y
Definition: cursor.h:13
#define OK
Definition: curses.h:24
unsigned int n
Definition: entropy.h:159
unsigned int x
Definition: cursor.h:13

References ERR, n, OK, stdscr, wgetnstr(), and wmove().

◆ mvgetstr()

static int mvgetstr ( int  y,
int  x,
char *  str 
)
inlinestatic

Definition at line 637 of file curses.h.

637  {
638  return ( wmove ( stdscr, y, x ) == OK
639  ? wgetnstr ( stdscr, str, -1 ) : ERR );
640 }
int wgetnstr(WINDOW *, char *, int)
Read at most n characters from the FIFO into a window.
Definition: kb.c:88
int wmove(WINDOW *, int, int)
Move a window's cursor to the specified position.
Definition: mucurses.c:135
#define ERR
Definition: curses.h:18
#define stdscr
Definition: curses.h:110
unsigned int y
Definition: cursor.h:13
#define OK
Definition: curses.h:24
unsigned int x
Definition: cursor.h:13

References ERR, OK, stdscr, wgetnstr(), and wmove().

◆ mvhline()

static int mvhline ( int  y,
int  x,
chtype  ch,
int  n 
)
inlinestatic

Definition at line 642 of file curses.h.

642  {
643  return ( wmove ( stdscr, y, x ) == OK
644  ? whline ( stdscr, ch, n ) : ERR );
645 }
int wmove(WINDOW *, int, int)
Move a window's cursor to the specified position.
Definition: mucurses.c:135
uint8_t ch
Definition: registers.h:83
#define ERR
Definition: curses.h:18
#define stdscr
Definition: curses.h:110
unsigned int y
Definition: cursor.h:13
#define OK
Definition: curses.h:24
int whline(WINDOW *, chtype, int) __nonnull
Create a horizontal line in a window.
Definition: edging.c:82
unsigned int n
Definition: entropy.h:159
unsigned int x
Definition: cursor.h:13

References ch, ERR, n, OK, stdscr, whline(), and wmove().

◆ mvvline()

static int mvvline ( int  y,
int  x,
chtype  ch,
int  n 
)
inlinestatic

Definition at line 652 of file curses.h.

652  {
653  return ( wmove ( stdscr, y, x ) == OK
654  ? wvline ( stdscr, ch, n ) : ERR );
655 }
int wvline(WINDOW *, chtype, int) __nonnull
Create a vertical line in a window.
Definition: edging.c:102
int wmove(WINDOW *, int, int)
Move a window's cursor to the specified position.
Definition: mucurses.c:135
uint8_t ch
Definition: registers.h:83
#define ERR
Definition: curses.h:18
#define stdscr
Definition: curses.h:110
unsigned int y
Definition: cursor.h:13
#define OK
Definition: curses.h:24
unsigned int n
Definition: entropy.h:159
unsigned int x
Definition: cursor.h:13

References ch, ERR, n, OK, stdscr, wmove(), and wvline().

◆ mvwaddch()

static int mvwaddch ( WINDOW win,
int  y,
int  x,
const chtype  ch 
)
inlinestatic

Definition at line 657 of file curses.h.

657  {
658  return ( wmove( win, y, x ) == OK
659  ? waddch ( win, ch ) : ERR );
660 }
int wmove(WINDOW *, int, int)
Move a window's cursor to the specified position.
Definition: mucurses.c:135
uint8_t ch
Definition: registers.h:83
#define ERR
Definition: curses.h:18
int waddch(WINDOW *, const chtype) __nonnull
Add a single-byte character and rendition to a window and advance the cursor.
Definition: print.c:23
unsigned int y
Definition: cursor.h:13
#define OK
Definition: curses.h:24
unsigned int x
Definition: cursor.h:13

References ch, ERR, OK, waddch(), and wmove().

◆ mvwaddchnstr()

static int mvwaddchnstr ( WINDOW win,
int  y,
int  x,
const chtype chstr,
int  n 
)
inlinestatic

Definition at line 662 of file curses.h.

662  {
663  return ( wmove ( win, y, x ) == OK
664  ? waddchnstr ( win, chstr, n ) : ERR );
665 }
int wmove(WINDOW *, int, int)
Move a window's cursor to the specified position.
Definition: mucurses.c:135
#define ERR
Definition: curses.h:18
int waddchnstr(WINDOW *, const chtype *, int) __nonnull
Add string of single-byte characters and renditions to a window.
Definition: print_nadv.c:21
unsigned int y
Definition: cursor.h:13
#define OK
Definition: curses.h:24
unsigned int n
Definition: entropy.h:159
unsigned int x
Definition: cursor.h:13

References ERR, n, OK, waddchnstr(), and wmove().

◆ mvwaddchstr()

static int mvwaddchstr ( WINDOW win,
int  y,
int  x,
const chtype chstr 
)
inlinestatic

Definition at line 667 of file curses.h.

667  {
668  return ( wmove ( win, y, x ) == OK
669  ? waddchnstr ( win, chstr, -1 ) : ERR );
670 }
int wmove(WINDOW *, int, int)
Move a window's cursor to the specified position.
Definition: mucurses.c:135
#define ERR
Definition: curses.h:18
int waddchnstr(WINDOW *, const chtype *, int) __nonnull
Add string of single-byte characters and renditions to a window.
Definition: print_nadv.c:21
unsigned int y
Definition: cursor.h:13
#define OK
Definition: curses.h:24
unsigned int x
Definition: cursor.h:13

References ERR, OK, waddchnstr(), and wmove().

◆ mvwaddnstr()

static int mvwaddnstr ( WINDOW win,
int  y,
int  x,
const char *  str,
int  n 
)
inlinestatic

Definition at line 672 of file curses.h.

672  {
673  return ( wmove ( win, y, x ) == OK
674  ? waddnstr ( win, str, n ) : ERR );
675 }
int wmove(WINDOW *, int, int)
Move a window's cursor to the specified position.
Definition: mucurses.c:135
#define ERR
Definition: curses.h:18
unsigned int y
Definition: cursor.h:13
#define OK
Definition: curses.h:24
int waddnstr(WINDOW *, const char *, int) __nonnull
Add string of single-byte characters to a window.
Definition: print.c:36
unsigned int n
Definition: entropy.h:159
unsigned int x
Definition: cursor.h:13

References ERR, n, OK, waddnstr(), and wmove().

◆ mvwaddstr()

static int mvwaddstr ( WINDOW win,
int  y,
int  x,
const char *  str 
)
inlinestatic

Definition at line 677 of file curses.h.

677  {
678  return ( wmove ( win, y, x ) == OK
679  ? waddnstr ( win, str, -1 ) : ERR );
680 }
int wmove(WINDOW *, int, int)
Move a window's cursor to the specified position.
Definition: mucurses.c:135
#define ERR
Definition: curses.h:18
unsigned int y
Definition: cursor.h:13
#define OK
Definition: curses.h:24
int waddnstr(WINDOW *, const char *, int) __nonnull
Add string of single-byte characters to a window.
Definition: print.c:36
unsigned int x
Definition: cursor.h:13

References ERR, OK, waddnstr(), and wmove().

◆ mvwdelch()

static int mvwdelch ( WINDOW win,
int  y,
int  x 
)
inlinestatic

Definition at line 682 of file curses.h.

682  {
683  return ( wmove ( win, y, x ) == OK
684  ? wdelch ( win ) : ERR );
685 }
int wmove(WINDOW *, int, int)
Move a window's cursor to the specified position.
Definition: mucurses.c:135
#define ERR
Definition: curses.h:18
unsigned int y
Definition: cursor.h:13
#define OK
Definition: curses.h:24
int wdelch(WINDOW *) __nonnull
Delete character under the cursor in a window.
Definition: clear.c:55
unsigned int x
Definition: cursor.h:13

References ERR, OK, wdelch(), and wmove().

◆ mvwgetch()

static int mvwgetch ( WINDOW win,
int  y,
int  x 
)
inlinestatic

Definition at line 687 of file curses.h.

687  {
688  return ( wmove ( win, y, x ) == OK
689  ? wgetch ( win ) : ERR );
690 }
int wmove(WINDOW *, int, int)
Move a window's cursor to the specified position.
Definition: mucurses.c:135
#define ERR
Definition: curses.h:18
unsigned int y
Definition: cursor.h:13
#define OK
Definition: curses.h:24
int wgetch(WINDOW *)
Pop a character from the FIFO into a window.
Definition: kb.c:55
unsigned int x
Definition: cursor.h:13

References ERR, OK, wgetch(), and wmove().

◆ mvwgetnstr()

static int mvwgetnstr ( WINDOW win,
int  y,
int  x,
char *  str,
int  n 
)
inlinestatic

Definition at line 692 of file curses.h.

692  {
693  return ( wmove ( win, y, x ) == OK
694  ? wgetnstr ( win, str, n ) : ERR );
695 }
int wgetnstr(WINDOW *, char *, int)
Read at most n characters from the FIFO into a window.
Definition: kb.c:88
int wmove(WINDOW *, int, int)
Move a window's cursor to the specified position.
Definition: mucurses.c:135
#define ERR
Definition: curses.h:18
unsigned int y
Definition: cursor.h:13
#define OK
Definition: curses.h:24
unsigned int n
Definition: entropy.h:159
unsigned int x
Definition: cursor.h:13

References ERR, n, OK, wgetnstr(), and wmove().

◆ mvwgetstr()

static int mvwgetstr ( WINDOW win,
int  y,
int  x,
char *  str 
)
inlinestatic

Definition at line 697 of file curses.h.

697  {
698  return ( wmove ( win, y, x ) == OK
699  ? wgetnstr ( win, str, -1 ) : ERR );
700 }
int wgetnstr(WINDOW *, char *, int)
Read at most n characters from the FIFO into a window.
Definition: kb.c:88
int wmove(WINDOW *, int, int)
Move a window's cursor to the specified position.
Definition: mucurses.c:135
#define ERR
Definition: curses.h:18
unsigned int y
Definition: cursor.h:13
#define OK
Definition: curses.h:24
unsigned int x
Definition: cursor.h:13

References ERR, OK, wgetnstr(), and wmove().

◆ mvwhline()

static int mvwhline ( WINDOW win,
int  y,
int  x,
chtype  ch,
int  n 
)
inlinestatic

Definition at line 702 of file curses.h.

702  {
703  return ( wmove ( win, y, x ) == OK
704  ? whline ( win, ch, n ) : ERR );
705 }
int wmove(WINDOW *, int, int)
Move a window's cursor to the specified position.
Definition: mucurses.c:135
uint8_t ch
Definition: registers.h:83
#define ERR
Definition: curses.h:18
unsigned int y
Definition: cursor.h:13
#define OK
Definition: curses.h:24
int whline(WINDOW *, chtype, int) __nonnull
Create a horizontal line in a window.
Definition: edging.c:82
unsigned int n
Definition: entropy.h:159
unsigned int x
Definition: cursor.h:13

References ch, ERR, n, OK, whline(), and wmove().

◆ mvwvline()

static int mvwvline ( WINDOW win,
int  y,
int  x,
chtype  ch,
int  n 
)
inlinestatic

Definition at line 711 of file curses.h.

711  {
712  return ( wmove ( win, y, x ) == OK
713  ? wvline ( win, ch, n ) : ERR );
714 }
int wvline(WINDOW *, chtype, int) __nonnull
Create a vertical line in a window.
Definition: edging.c:102
int wmove(WINDOW *, int, int)
Move a window's cursor to the specified position.
Definition: mucurses.c:135
uint8_t ch
Definition: registers.h:83
#define ERR
Definition: curses.h:18
unsigned int y
Definition: cursor.h:13
#define OK
Definition: curses.h:24
unsigned int n
Definition: entropy.h:159
unsigned int x
Definition: cursor.h:13

References ch, ERR, n, OK, wmove(), and wvline().

◆ slk_refresh()

static int slk_refresh ( void  )
inlinestatic

Definition at line 718 of file curses.h.

718  {
719  if ( slk_clear() == OK )
720  return slk_restore();
721  else
722  return ERR;
723 }
#define ERR
Definition: curses.h:18
int slk_clear(void)
Clear the soft function key labels from the screen.
Definition: slk.c:209
#define OK
Definition: curses.h:24
int slk_restore(void)
Restore soft function key labels to the screen.
Definition: slk.c:307

References ERR, OK, slk_clear(), and slk_restore().

◆ start_colour()

static int start_colour ( void  )
inlinestatic

Definition at line 728 of file curses.h.

728  {
729  return OK;
730 }
#define OK
Definition: curses.h:24

References OK.

◆ vline()

static int vline ( chtype  ch,
int  n 
)
inlinestatic

Definition at line 732 of file curses.h.

732  {
733  return wvline ( stdscr, ch, n );
734 }
int wvline(WINDOW *, chtype, int) __nonnull
Create a vertical line in a window.
Definition: edging.c:102
uint8_t ch
Definition: registers.h:83
#define stdscr
Definition: curses.h:110
unsigned int n
Definition: entropy.h:159

References ch, n, stdscr, and wvline().

◆ vwprintw()

static int vwprintw ( WINDOW win,
const char *  fmt,
va_list  varglist 
)
inlinestatic

Definition at line 737 of file curses.h.

737  {
738  return vw_printw ( win, fmt, varglist );
739 }
int vw_printw(WINDOW *, const char *, va_list) __nonnull
Print formatted output in a window.
Definition: print.c:61
int ssize_t const char * fmt
Definition: vsprintf.h:72

References fmt, and vw_printw().

◆ waddchstr()

static int waddchstr ( WINDOW win,
const chtype chstr 
)
inlinestatic

Definition at line 741 of file curses.h.

741  {
742  return waddchnstr ( win, chstr, -1 );
743 }
int waddchnstr(WINDOW *, const chtype *, int) __nonnull
Add string of single-byte characters and renditions to a window.
Definition: print_nadv.c:21

References waddchnstr().

◆ waddstr()

static int waddstr ( WINDOW win,
const char *  str 
)
inlinestatic

Definition at line 745 of file curses.h.

745  {
746  return waddnstr ( win, str, -1 );
747 }
int waddnstr(WINDOW *, const char *, int) __nonnull
Add string of single-byte characters to a window.
Definition: print.c:36

References waddnstr().

◆ wbkgdset()

static int wbkgdset ( WINDOW win,
chtype  ch 
)
inlinestatic

Definition at line 749 of file curses.h.

749  {
750  return wattrset( win, ch );
751 }
uint8_t ch
Definition: registers.h:83
int wattrset(WINDOW *, int) __nonnull
Set attributes in a window.
Definition: winattrs.c:52

References ch, and wattrset().

◆ wgetstr()

static int wgetstr ( WINDOW win,
char *  str 
)
inlinestatic

Definition at line 753 of file curses.h.

753  {
754  return wgetnstr ( win, str, -1 );
755 }
int wgetnstr(WINDOW *, char *, int)
Read at most n characters from the FIFO into a window.
Definition: kb.c:88

References wgetnstr().

◆ wstandend()

static int wstandend ( WINDOW win)
inlinestatic

Definition at line 757 of file curses.h.

757  {
758  return wattrset ( win, A_DEFAULT );
759 }
#define A_DEFAULT
Definition: curses.h:135
int wattrset(WINDOW *, int) __nonnull
Set attributes in a window.
Definition: winattrs.c:52

References A_DEFAULT, and wattrset().

◆ wstandout()

static int wstandout ( WINDOW win)
inlinestatic

Definition at line 761 of file curses.h.

761  {
762  return wattrset ( win, A_STANDOUT );
763 }
int wattrset(WINDOW *, int) __nonnull
Set attributes in a window.
Definition: winattrs.c:52
#define A_STANDOUT
Definition: curses.h:143

References A_STANDOUT, and wattrset().

Variable Documentation

◆ _stdscr

WINDOW _stdscr

Definition at line 20 of file mucurses.c.