iPXE
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)
#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)
#define COLOR_PAIR(n)
#define PAIR_NUMBER(attrs)
#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()
#define color_content(c, r, g, b)
#define color_set(cpno, opts)
#define init_color   ( c, r, g, b ) init_colour ( (c), (r), (g), (b) )
#define slk_color(c)
#define start_color()
#define wcolor_set(w, s, v)
#define mvprintw(y, x, fmt, ...)
#define mvwprintw(win, y, x, fmt, ...)
#define printw(fmt, ...)
#define standend()
#define standout()

Typedefs

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

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 FILE_SECBOOT (PERMITTED)
int baudrate (void)
int beep (void)
 Audible signal.
int box (WINDOW *, chtype, chtype) __nonnull
 Draw borders from single-byte characters and renditions around a window.
int cbreak (void)
int colour_content (short, short *, short *, short *) __nonnull
 Identify the RGB components of a given colour value.
int copywin (const WINDOW *, WINDOW *, int, int, int, int, int, int, int)
int curs_set (int)
 Set cursor visibility.
int def_prog_mode (void)
int def_shell_mode (void)
int delay_output (int)
void delscreen (SCREEN *)
int delwin (WINDOW *) __nonnull
 Delete a window.
WINDOWderwin (WINDOW *, int, int, int, int) __nonnull
 Create a new derived window.
WINDOWdupwin (WINDOW *) __nonnull
 Create a duplicate of the specified window.
int echo (void)
int echochar (const chtype)
int endwin (void)
 Finalise console environment.
char erasechar (void)
int erase (void)
 Completely clear the screen.
void filter (void)
 Receive packet filter.
int flash (void)
int flushinp (void)
__pure chtype getbkgd (WINDOW *) __nonnull
 Get the background rendition attributes for a window.
int halfdelay (int)
bool has_ic (void)
bool has_il (void)
void idcok (WINDOW *, bool)
int idlok (WINDOW *, bool)
WINDOWinitscr (void)
 Initialise console environment.
int init_colour (short, short, short, short)
int init_pair (short, short, short)
 Initialise colour pair.
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.
int napms (int)
WINDOWnewwin (int, int, int, int)
 Create new WINDOW.
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.
int printw (char *,...)
int putp (const char *)
void qiflush (void)
int raw (void)
 Raw version number.
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.
int slk_attr_on (const attr_t, void *)
int slk_attron (const chtype)
 Turn on soft function key attributes.
int slk_attr_set (const attr_t, short, void *)
int slk_attrset (const chtype)
 Set soft function key attributes.
int slk_clear (void)
 Clear the soft function key labels from the screen.
int slk_colour (short)
 Set soft label colour pair.
int slk_init (int)
 Initialise the soft function keys.
char * slk_label (int)
 Return the label for the specified soft key.
int slk_noutrefresh (void)
int slk_restore (void)
 Restore soft function key labels to the screen.
int slk_set (int, const char *, int) __nonnull
 Configure specified soft key.
int slk_touch (void)
WINDOWsubwin (WINDOW *, int, int, int, int) __nonnull
 Create a new sub-window.
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.
int waddch (WINDOW *, const chtype) __nonnull
 Add a single-byte character and rendition to a window and advance the cursor.
int waddchnstr (WINDOW *, const chtype *, int) __nonnull
 Add string of single-byte characters and renditions to a window.
int waddnstr (WINDOW *, const char *, int) __nonnull
 Add string of single-byte characters to a window.
int wattroff (WINDOW *, int) __nonnull
 Turn off attributes in a window.
int wattron (WINDOW *, int) __nonnull
 Turn on attributes in a window.
int wattrset (WINDOW *, int) __nonnull
 Set attributes in a window.
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.
int wclrtobot (WINDOW *) __nonnull
 Clear a window to the bottom from current cursor position.
int wclrtoeol (WINDOW *) __nonnull
 Clear a window to the end of the current line.
void wcursyncup (WINDOW *)
int wcolour_set (WINDOW *, short, void *)
int wdelch (WINDOW *) __nonnull
 Delete character under the cursor in a window.
int wdeleteln (WINDOW *) __nonnull
 Delete line under a window's cursor.
int wechochar (WINDOW *, const chtype)
int werase (WINDOW *) __nonnull
 Completely clear a window.
int wgetch (WINDOW *)
 Pop a character from the FIFO into a window.
int wgetnstr (WINDOW *, char *, int)
 Read at most n characters from the FIFO into a window.
int whline (WINDOW *, chtype, int) __nonnull
 Create a horizontal line in a window.
int wmove (WINDOW *, int, int)
 Move a window's cursor to the specified position.
int wprintw (WINDOW *, const char *,...) __nonnull
 Print formatted output to a window.
void wsyncup (WINDOW *)
void wsyncdown (WINDOW *)
void wtimeout (WINDOW *, int)
int wvline (WINDOW *, chtype, int) __nonnull
 Create a vertical line in a window.
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

◆ FALSE

#define FALSE   (0)

Definition at line 22 of file curses.h.

◆ OK

◆ TRUE

#define TRUE   (1)

Definition at line 28 of file curses.h.

◆ stdscr

◆ COLS

#define COLS   console_width

Definition at line 112 of file curses.h.

◆ LINES

#define LINES   console_height

Definition at line 113 of file curses.h.

◆ MUCURSES_BITS

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

Definition at line 115 of file curses.h.

◆ CPAIR_SHIFT

#define CPAIR_SHIFT   8

Definition at line 116 of file curses.h.

Referenced by slk_attr_set(), and slk_colour().

◆ ATTRS_SHIFT

#define ATTRS_SHIFT   16

Definition at line 117 of file curses.h.

◆ WA_DEFAULT

#define WA_DEFAULT   ( 0x0000 << ATTRS_SHIFT )

Definition at line 119 of file curses.h.

◆ WA_ALTCHARSET

#define WA_ALTCHARSET   ( 0x0001 << ATTRS_SHIFT )

Definition at line 120 of file curses.h.

◆ WA_BLINK

#define WA_BLINK   ( 0x0002 << ATTRS_SHIFT )

Definition at line 121 of file curses.h.

◆ WA_BOLD

#define WA_BOLD   ( 0x0004 << ATTRS_SHIFT )

Definition at line 122 of file curses.h.

◆ WA_DIM

#define WA_DIM   ( 0x0008 << ATTRS_SHIFT )

Definition at line 123 of file curses.h.

◆ WA_INVIS

#define WA_INVIS   ( 0x0010 << ATTRS_SHIFT )

Definition at line 124 of file curses.h.

◆ WA_PROTECT

#define WA_PROTECT   ( 0x0020 << ATTRS_SHIFT )

Definition at line 125 of file curses.h.

◆ WA_REVERSE

#define WA_REVERSE   ( 0x0040 << ATTRS_SHIFT )

Definition at line 126 of file curses.h.

◆ WA_STANDOUT

#define WA_STANDOUT   ( 0x0080 << ATTRS_SHIFT )

Definition at line 127 of file curses.h.

◆ WA_UNDERLINE

#define WA_UNDERLINE   ( 0x0100 << ATTRS_SHIFT )

Definition at line 128 of file curses.h.

◆ WA_HORIZONTAL

#define WA_HORIZONTAL   ( 0x0200 << ATTRS_SHIFT )

Definition at line 129 of file curses.h.

◆ WA_VERTICAL

#define WA_VERTICAL   ( 0x0400 << ATTRS_SHIFT )

Definition at line 130 of file curses.h.

◆ WA_LEFT

#define WA_LEFT   ( 0x0800 << ATTRS_SHIFT )

Definition at line 131 of file curses.h.

◆ WA_RIGHT

#define WA_RIGHT   ( 0x1000 << ATTRS_SHIFT )

Definition at line 132 of file curses.h.

◆ WA_LOW

#define WA_LOW   ( 0x2000 << ATTRS_SHIFT )

Definition at line 133 of file curses.h.

◆ WA_TOP

#define WA_TOP   ( 0x4000 << ATTRS_SHIFT )

Definition at line 134 of file curses.h.

◆ A_DEFAULT

#define A_DEFAULT   WA_DEFAULT

Definition at line 136 of file curses.h.

Referenced by slk_init(), and wstandend().

◆ A_ALTCHARSET

#define A_ALTCHARSET   WA_ALTCHARSET

Definition at line 137 of file curses.h.

◆ A_BLINK

#define A_BLINK   WA_BLINK

Definition at line 138 of file curses.h.

◆ A_BOLD

#define A_BOLD   WA_BOLD

◆ A_DIM

#define A_DIM   WA_DIM

Definition at line 140 of file curses.h.

◆ A_INVIS

#define A_INVIS   WA_INVIS

Definition at line 141 of file curses.h.

◆ A_PROTECT

#define A_PROTECT   WA_PROTECT

Definition at line 142 of file curses.h.

◆ A_REVERSE

#define A_REVERSE   WA_REVERSE

Definition at line 143 of file curses.h.

◆ A_STANDOUT

#define A_STANDOUT   WA_STANDOUT

Definition at line 144 of file curses.h.

Referenced by wstandout().

◆ A_UNDERLINE

#define A_UNDERLINE   WA_UNDERLINE

Definition at line 145 of file curses.h.

◆ A_ATTRIBUTES

#define A_ATTRIBUTES   ( 0xffff << ATTRS_SHIFT )

◆ A_CHARTEXT

#define A_CHARTEXT   ( 0xff )

Definition at line 148 of file curses.h.

Referenced by ansiscr_putc().

◆ A_COLOUR

#define A_COLOUR   ( 0xff << CPAIR_SHIFT )

Definition at line 149 of file curses.h.

◆ A_COLOR

#define A_COLOR   A_COLOUR

Definition at line 150 of file curses.h.

Referenced by ansiscr_putc(), and wattrset().

◆ COLOUR_PAIR

#define COLOUR_PAIR ( n)
Value:
( (n) << CPAIR_SHIFT )
#define CPAIR_SHIFT
Definition curses.h:116

Definition at line 152 of file curses.h.

Referenced by wattr_set(), and wcolour_set().

◆ COLOR_PAIR

#define COLOR_PAIR ( n)
Value:
#define COLOUR_PAIR(n)
Definition curses.h:152

Definition at line 153 of file curses.h.

◆ PAIR_NUMBER

#define PAIR_NUMBER ( attrs)
Value:
( ( (attrs) & A_COLOUR ) >> CPAIR_SHIFT )
#define A_COLOUR
Definition curses.h:149

Definition at line 154 of file curses.h.

Referenced by ansiscr_attrs(), and wattr_get().

◆ COLOUR_PAIRS

#define COLOUR_PAIRS   8 /* Arbitrary limit */

Definition at line 156 of file curses.h.

Referenced by init_pair(), pair_content(), and wcolour_set().

◆ COLOR_PAIRS

#define COLOR_PAIRS   COLOUR_PAIRS

Definition at line 157 of file curses.h.

◆ ACS_ULCORNER

#define ACS_ULCORNER   '+'

Definition at line 159 of file curses.h.

◆ ACS_LLCORNER

#define ACS_LLCORNER   '+'

Definition at line 160 of file curses.h.

◆ ACS_URCORNER

#define ACS_URCORNER   '+'

Definition at line 161 of file curses.h.

◆ ACS_LRCORNER

#define ACS_LRCORNER   '+'

Definition at line 162 of file curses.h.

◆ ACS_RTEE

#define ACS_RTEE   '+'

Definition at line 163 of file curses.h.

◆ ACS_LTEE

#define ACS_LTEE   '+'

Definition at line 164 of file curses.h.

◆ ACS_BTEE

#define ACS_BTEE   '+'

Definition at line 165 of file curses.h.

◆ ACS_TTEE

#define ACS_TTEE   '+'

Definition at line 166 of file curses.h.

◆ ACS_HLINE

#define ACS_HLINE   '-'

Definition at line 167 of file curses.h.

◆ ACS_VLINE

#define ACS_VLINE   '|'

Definition at line 168 of file curses.h.

◆ ACS_PLUS

#define ACS_PLUS   '+'

Definition at line 169 of file curses.h.

◆ ACS_S1

#define ACS_S1   '-'

Definition at line 170 of file curses.h.

◆ ACS_S9

#define ACS_S9   '_'

Definition at line 171 of file curses.h.

◆ ACS_DIAMOND

#define ACS_DIAMOND   '+'

Definition at line 172 of file curses.h.

◆ ACS_CKBOARD

#define ACS_CKBOARD   ':'

Definition at line 173 of file curses.h.

◆ ACS_DEGREE

#define ACS_DEGREE   '\''

Definition at line 174 of file curses.h.

◆ ACS_PLMINUS

#define ACS_PLMINUS   '#'

Definition at line 175 of file curses.h.

◆ ACS_BULLET

#define ACS_BULLET   'o'

Definition at line 176 of file curses.h.

◆ ACS_LARROW

#define ACS_LARROW   '<'

Definition at line 177 of file curses.h.

◆ ACS_RARROW

#define ACS_RARROW   '>'

Definition at line 178 of file curses.h.

◆ ACS_DARROW

#define ACS_DARROW   'v'

Definition at line 179 of file curses.h.

◆ ACS_UARROW

#define ACS_UARROW   '^'

Definition at line 180 of file curses.h.

◆ ACS_BOARD

#define ACS_BOARD   '#'

Definition at line 181 of file curses.h.

◆ ACS_LANTERN

#define ACS_LANTERN   '#'

Definition at line 182 of file curses.h.

◆ ACS_BLOCK

#define ACS_BLOCK   '#'

Definition at line 183 of file curses.h.

◆ COLOUR_BLACK

#define COLOUR_BLACK   0

Definition at line 185 of file curses.h.

◆ COLOUR_RED

#define COLOUR_RED   1

Definition at line 186 of file curses.h.

Referenced by colour_content().

◆ COLOUR_GREEN

#define COLOUR_GREEN   2

Definition at line 187 of file curses.h.

Referenced by colour_content().

◆ COLOUR_YELLOW

#define COLOUR_YELLOW   3

Definition at line 188 of file curses.h.

◆ COLOUR_BLUE

#define COLOUR_BLUE   4

Definition at line 189 of file curses.h.

Referenced by colour_content().

◆ COLOUR_MAGENTA

#define COLOUR_MAGENTA   5

Definition at line 190 of file curses.h.

◆ COLOUR_CYAN

#define COLOUR_CYAN   6

Definition at line 191 of file curses.h.

◆ COLOUR_WHITE

#define COLOUR_WHITE   7

Definition at line 192 of file curses.h.

◆ COLOURS

#define COLOURS   7

Definition at line 193 of file curses.h.

◆ COLOUR_FG

#define COLOUR_FG   30

Definition at line 195 of file curses.h.

◆ COLOUR_BG

#define COLOUR_BG   40

Definition at line 196 of file curses.h.

◆ COLOR_FG

#define COLOR_FG   COLOUR_FG

Definition at line 197 of file curses.h.

◆ COLOR_BG

#define COLOR_BG   COLOUR_BG

Definition at line 198 of file curses.h.

◆ COLOR_BLACK

#define COLOR_BLACK   COLOUR_BLACK

Definition at line 200 of file curses.h.

◆ COLOR_BLUE

#define COLOR_BLUE   COLOUR_BLUE

Definition at line 201 of file curses.h.

◆ COLOR_GREEN

#define COLOR_GREEN   COLOUR_GREEN

Definition at line 202 of file curses.h.

◆ COLOR_CYAN

#define COLOR_CYAN   COLOUR_CYAN

Definition at line 203 of file curses.h.

◆ COLOR_RED

#define COLOR_RED   COLOUR_RED

Definition at line 204 of file curses.h.

◆ COLOR_MAGENTA

#define COLOR_MAGENTA   COLOUR_MAGENTA

Definition at line 205 of file curses.h.

◆ COLOR_YELLOW

#define COLOR_YELLOW   COLOUR_YELLOW

Definition at line 206 of file curses.h.

◆ COLOR_WHITE

#define COLOR_WHITE   COLOUR_WHITE

Definition at line 207 of file curses.h.

◆ COLORS

#define COLORS   COLOURS

Definition at line 208 of file curses.h.

Referenced by slk_attr_set(), and slk_colour().

◆ can_change_color

#define can_change_color ( )
Value:
static bool can_change_colour(void)
Definition curses.h:546

Definition at line 234 of file curses.h.

◆ color_content

#define color_content ( c,
r,
g,
b )
Value:
colour_content( (c), (r), (g), (b) )
int colour_content(short colour, short *red, short *green, short *blue)
Identify the RGB components of a given colour value.
Definition colour.c:23
static const uint8_t r[3][4]
MD4 shift amounts.
Definition md4.c:54

Definition at line 239 of file curses.h.

◆ color_set

#define color_set ( cpno,
opts )
Value:
colour_set( (cpno), (opts) )
static union @024010030001061367220137227263210031030210157031 opts
"cert<xxx>" option list
static int colour_set(short colour_pair_number, void *opts)
Definition curses.h:558

Definition at line 241 of file curses.h.

Referenced by draw_editbox(), draw_errors(), draw_form(), draw_info_row(), draw_menu_item(), draw_menu_items(), draw_setting_rows(), endwin(), main_loop(), pxe_menu_draw_item(), pxe_menu_select(), settings_ui(), show_form(), show_menu(), and valert().

◆ init_color

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

Definition at line 280 of file curses.h.

◆ slk_color

#define slk_color ( c)
Value:
slk_colour( (c) )
int slk_colour(short colour_pair_number)
Set soft label colour pair.
Definition slk.c:223

Definition at line 386 of file curses.h.

◆ start_color

#define start_color ( )
Value:
static int start_colour(void)
Definition curses.h:729

Definition at line 397 of file curses.h.

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

◆ wcolor_set

#define wcolor_set ( w,
s,
v )
Value:
wcolour_set((w),(s),(v))
int wcolour_set(WINDOW *win, short colour_pair_number, void *opts __unused)
Set colour pair for a window.
Definition winattrs.c:125

Definition at line 449 of file curses.h.

◆ mvprintw

#define mvprintw ( y,
x,
fmt,
... )
Value:
( wmove(stdscr,(y),(x)) == OK \
? wprintw( stdscr,(fmt), ## __VA_ARGS__ ) : ERR )
#define stdscr
Definition curses.h:111
#define ERR
Definition curses.h:19
#define OK
Definition curses.h:25
int wmove(WINDOW *win, int y, int x) __nonnull
Move a window's cursor to the specified position.
Definition mucurses.c:136
static unsigned int unsigned int y
Definition pixbuf.h:63
static unsigned int x
Definition pixbuf.h:63
int wprintw(WINDOW *win, const char *fmt,...)
Print formatted output to a window.
Definition print.c:79
int ssize_t const char * fmt
Definition vsprintf.h:73

Definition at line 649 of file curses.h.

649#define mvprintw( y, x, fmt, ... ) \
650 ( wmove(stdscr,(y),(x)) == OK \
651 ? wprintw( stdscr,(fmt), ## __VA_ARGS__ ) : ERR )

Referenced by draw_editbox(), draw_setting_row(), endwin(), pxe_menu_draw_item(), show_menu(), and vmsg().

◆ mvwprintw

#define mvwprintw ( win,
y,
x,
fmt,
... )
Value:
( wmove((win),(y),(x)) == OK \
? wprintw((win),(fmt), ## __VA_ARGS__) : ERR )

Definition at line 708 of file curses.h.

708#define mvwprintw( win, y, x, fmt, ... ) \
709 ( wmove((win),(y),(x)) == OK \
710 ? wprintw((win),(fmt), ## __VA_ARGS__) : ERR )

◆ printw

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

Definition at line 717 of file curses.h.

Referenced by draw_menu_item().

◆ standend

int standend ( )
Value:
static int wstandend(WINDOW *win)
Definition curses.h:758

Definition at line 726 of file curses.h.

◆ standout

int standout ( )
Value:
static int wstandout(WINDOW *win)
Definition curses.h:762

Definition at line 727 of file curses.h.

Typedef Documentation

◆ chtype

typedef uint32_t chtype

Definition at line 30 of file curses.h.

◆ attr_t

typedef uint32_t attr_t

Definition at line 31 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 )

◆ FILE_SECBOOT()

FILE_SECBOOT ( PERMITTED )

◆ baudrate()

int baudrate ( void )
extern

References __nonnull.

◆ beep()

int beep ( void )
extern

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:465

References OK, and printf().

Referenced by wgetch(), and wgetnstr().

◆ box()

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

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}
uint32_t chtype
Definition curses.h:30
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:94

References _curses_window::attrs, and wborder().

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

◆ cbreak()

int cbreak ( void )
extern

References __nonnull.

◆ colour_content()

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

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
Colour for debug messages.
Definition acpi.c:42
#define COLOUR_GREEN
Definition curses.h:187
#define COLOUR_RED
Definition curses.h:186
#define COLOUR_BLUE
Definition curses.h:189

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

◆ copywin()

int copywin ( const WINDOW * ,
WINDOW * ,
int ,
int ,
int ,
int ,
int ,
int ,
int  )
extern

◆ curs_set()

int curs_set ( int visibility)
extern

Set cursor visibility.

Parameters
visibilitycursor visibility

Definition at line 154 of file mucurses.c.

154 {
155 stdscr->scr->cursor ( stdscr->scr, visibility );
156 return OK;
157}

References OK, and stdscr.

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

◆ def_prog_mode()

int def_prog_mode ( void )
extern

◆ def_shell_mode()

int def_shell_mode ( void )
extern

◆ delay_output()

int delay_output ( int )
extern

◆ delscreen()

void delscreen ( SCREEN * )
extern

References __nonnull.

◆ delwin()

int delwin ( WINDOW * win)
extern

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}
void _wputch(WINDOW *win, chtype ch, int wrap) __nonnull
Write a single character rendition to a window.
Definition mucurses.c:51
#define WRAP
Definition mucurses.h:13
static void(* free)(struct refcnt *refcnt))
Definition refcnt.h:55
unsigned int curs_x
window cursor position
Definition curses.h:98
unsigned int curs_y
Definition curses.h:98

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 )
extern

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}
#define NULL
NULL pointer (VOID *)
Definition Base.h:322
struct _curses_window WINDOW
Curses Window struct.
void * malloc(size_t size)
Allocate memory.
Definition malloc.c:621
unsigned int ori_x
window origin coordinates
Definition curses.h:96
unsigned int width
window dimensions
Definition curses.h:100
unsigned int height
Definition curses.h:100
unsigned int ori_y
Definition curses.h:96
struct _curses_window * parent
parent window
Definition curses.h:102
SCREEN * scr
screen with which window associates
Definition curses.h:92

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)
extern

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}

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 )
extern

◆ echochar()

int echochar ( const chtype )
extern

◆ endwin()

int endwin ( void )
extern

Finalise console environment.

Definition at line 32 of file wininit.c.

32 {
33 attrset ( 0 );
34 color_set ( 0, NULL );
35 curs_set ( 1 );
36 mvprintw ( ( LINES - 1 ), 0, "\n" );
37 stdscr->scr->exit( stdscr->scr );
38 return OK;
39}
static int attrset(int attrs)
Definition curses.h:517
#define mvprintw(y, x, fmt,...)
Definition curses.h:649
#define color_set(cpno, opts)
Definition curses.h:241
#define LINES(...)
Define inline lines.
int curs_set(int visibility)
Set cursor visibility.
Definition mucurses.c:154

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

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

◆ erasechar()

char erasechar ( void )
extern

◆ erase()

int erase ( void )
extern

Completely clear the screen.

Return values
rcreturn status code

Definition at line 98 of file clear.c.

98 {
99 stdscr->scr->erase( stdscr->scr, stdscr->attrs );
100 return OK;
101}

References OK, and stdscr.

Referenced by draw_form(), fdt_set(), settings_ui(), and show_menu().

◆ filter()

void filter ( void )
extern

Receive packet filter.

This field takes the same values as s_PXENV_UNDI_OPEN::PktFilter.

Note
Yes, this field is a different size to s_PXENV_UNDI_OPEN::PktFilter. Blame "the managers at Intel who apparently let a consultant come up with the spec without any kind of adult supervision" (quote from hpa).

Definition at line 11 of file pxe_api.h.

Referenced by ath5k_hw_get_rx_filter(), ath5k_hw_set_power(), ath5k_hw_set_rx_filter(), ecm_open(), efi_null_pxe_set_ip_filter(), efi_null_vlan_find(), efi_pxe_ip_filter(), efi_pxe_set_ip_filter(), efi_vlan_find(), png_unfilter_pass(), rndis_filter(), and sky2_set_multicast().

◆ flash()

int flash ( void )
extern

Referenced by bnx2_init_nvram().

◆ flushinp()

int flushinp ( void )
extern

References __nonnull, and __pure.

◆ getbkgd()

__pure chtype getbkgd ( WINDOW * win)
externinline

Get the background rendition attributes for a window.

Parameters
*winsubject window
Return values
chchtype rendition representation

Definition at line 18 of file winattrs.c.

18 {
19 return win->attrs;
20}

References _curses_window::attrs.

◆ halfdelay()

int halfdelay ( int )
extern

◆ has_ic()

bool has_ic ( void )
extern

◆ has_il()

bool has_il ( void )
extern

◆ idcok()

void idcok ( WINDOW * ,
bool  )
extern

◆ idlok()

int idlok ( WINDOW * ,
bool  )
extern

◆ initscr()

WINDOW * initscr ( void )
extern

Initialise console environment.

Return values
*winreturn pointer to stdscr

Definition at line 18 of file wininit.c.

18 {
19 /* determine console size */
20 /* initialise screen */
21 stdscr->scr->init( stdscr->scr );
22 stdscr->height = LINES;
23 stdscr->width = COLS;
24 move ( 0, 0 );
25 return stdscr;
26}
static int move(int y, int x)
Definition curses.h:594
#define COLS
Definition vga.h:27

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

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

◆ init_colour()

int init_colour ( short ,
short ,
short ,
short  )
extern

◆ init_pair()

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

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}
static struct colour_pair cpairs[COLOUR_PAIRS]
Definition colour.c:10
#define COLOUR_PAIRS
Definition curses.h:156
short fcol
Definition colour.c:6
short bcol
Definition colour.c:7

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

◆ intrflush()

int intrflush ( WINDOW * ,
bool  )
extern

◆ isendwin()

bool isendwin ( void )
extern

◆ keyname()

char * keyname ( int )
extern

◆ keypad()

int keypad ( WINDOW * ,
bool  )
extern

Referenced by usbkbd_map().

◆ killchar()

char killchar ( void )
extern

◆ leaveok()

int leaveok ( WINDOW * ,
bool  )
extern

◆ longname()

char * longname ( void )
extern

◆ meta()

int meta ( WINDOW * ,
bool  )
extern

◆ mvcur()

int mvcur ( int ,
int ,
int ,
int  )
extern

◆ mvderwin()

int mvderwin ( WINDOW * ,
int ,
int  )
extern

References __nonnull.

◆ mvwin()

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

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}

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

◆ napms()

int napms ( int )
extern

◆ newwin()

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

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}

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 )
extern

Referenced by REQUIRE_KEYMAP().

◆ nocbreak()

int nocbreak ( void )
extern

◆ nodelay()

int nodelay ( WINDOW * ,
bool  )
extern

◆ noecho()

int noecho ( void )
extern

Definition at line 141 of file kb.c.

141 {
142 m_echo = FALSE;
143 return OK;
144}
#define FALSE
Definition tlan.h:45

References FALSE, m_echo, and OK.

◆ nonl()

int nonl ( void )
extern

◆ noqiflush()

void noqiflush ( void )
extern

◆ noraw()

int noraw ( void )
extern

◆ notimeout()

int notimeout ( WINDOW * ,
bool  )
extern

◆ overlay()

int overlay ( const WINDOW * ,
WINDOW *  )
extern

◆ overwrite()

int overwrite ( const WINDOW * ,
WINDOW *  )
extern

References __nonnull.

Referenced by efi_null_pxe_mtftp(), and efi_pxe_mtftp().

◆ pair_content()

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

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}

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

◆ printw()

int printw ( char * ,
... )
extern

◆ putp()

int putp ( const char * )
extern

◆ qiflush()

void qiflush ( void )
extern

◆ raw()

int raw ( void )
extern

Raw version number.

Definition at line 0 of file CIB_PRM.h.

Referenced by asn1_generalized_time(), base64_encode(), certstore_init(), cms_parse_certificates(), cms_parse_cipher_algorithm(), cms_parse_content_type(), cms_parse_digest_algorithm(), cms_parse_encrypted(), cms_parse_enveloped(), cms_parse_identifier(), cms_parse_mac(), cms_parse_participant(), cms_parse_participants(), cms_parse_pubkey_algorithm(), cms_parse_signed(), cms_parse_value(), deflate_alphabet(), deflate_decode(), der_asn1(), dhcp_create_request(), ecdsa_parse_key(), ecdsa_parse_signature(), efipci_discover_one(), efipci_ioremap(), fbcon_picture_init(), fetchf_setting(), fetchn_setting(), format_base64_setting(), format_busdevfn_setting(), format_dnssl_setting(), format_hex_colon_setting(), format_hex_hyphen_setting(), format_hex_raw_setting(), format_int_setting(), format_ipv4_setting(), format_ipv4_setting(), format_ipv4_setting(), format_ipv6_setting(), format_ipv6_setting(), format_ipv6_setting(), format_string_setting(), format_uint_setting(), format_uristring_setting(), format_uuid_setting(), hex_encode(), ice_context_rx(), icert_cert(), intelvf_mbox_read(), intelvf_mbox_write(), intelxl_admin_mac_write(), iscsi_large_binary_decode(), lldp_fetch(), ntlm_data_okx(), numerate_int_setting(), numeric_setting_value(), ocsp_parse_basic_response(), ocsp_parse_cert_id(), ocsp_parse_certs(), ocsp_parse_responder_id(), ocsp_parse_response(), ocsp_parse_response_bytes(), ocsp_parse_response_status(), ocsp_parse_response_type(), ocsp_parse_responses(), ocsp_parse_tbs_response_data(), parse_uri(), peerdist_info_v1(), peerdist_info_v1_block(), peerdist_info_v1_blocks(), peerdist_info_v1_segment(), peerdist_info_v2(), peerdist_info_v2_cursor_next(), peerdist_info_v2_segment(), png_pixel(), png_pixels_pass(), pxebs_list(), rdtsc_raw(), rsa_parse_mod_exp(), setting_format(), setting_numerate(), storef_setting(), storen_setting(), uri_encode(), vmbus_initiate_contact(), x509_certificate(), x509_check_alt_name(), x509_check_dnsname(), x509_check_ipaddress(), x509_find(), x509_parse(), x509_parse_access_description(), x509_parse_authority_info_access(), x509_parse_basic_constraints(), x509_parse_common_name(), x509_parse_extended_key_usage(), x509_parse_extension(), x509_parse_extensions(), x509_parse_issuer(), x509_parse_key_purpose(), x509_parse_key_usage(), x509_parse_ocsp(), x509_parse_public_key(), x509_parse_serial(), x509_parse_subject(), x509_parse_subject_alt_name(), x509_parse_tbscertificate(), x509_parse_validity(), x509_parse_version(), xhci_port_protocol(), and xsmp_rx_xve_install().

◆ reset_prog_mode()

int reset_prog_mode ( void )
extern

◆ reset_shell_mode()

int reset_shell_mode ( void )
extern

◆ resetty()

int resetty ( void )
extern

◆ ripoffline()

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

◆ savetty()

int savetty ( void )
extern

◆ set_term()

SCREEN * set_term ( SCREEN * )
extern

◆ setupterm()

int setupterm ( char * ,
int ,
int *  )
extern

◆ slk_attr_off()

int slk_attr_off ( const attr_t ,
void *  )
extern

◆ slk_attroff()

int slk_attroff ( const chtype attrs)
extern

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:147
static struct _softlabelkeys * slks
Definition slk.c:55

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

Referenced by slk_attr_off().

◆ slk_attr_on()

int slk_attr_on ( const attr_t ,
void *  )
extern

◆ slk_attron()

int slk_attron ( const chtype attrs)
extern

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}

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

Referenced by slk_attr_on().

◆ slk_attr_set()

int slk_attr_set ( const attr_t ,
short ,
void *  )
extern

◆ slk_attrset()

int slk_attrset ( const chtype attrs)
extern

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}

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

◆ slk_clear()

int slk_clear ( void )
extern

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}
int wclrtoeol(WINDOW *win)
Clear a window to the end of the current line.
Definition clear.c:38
static void _enter_slk(void)
Definition slk.c:64
static void _leave_slk(void)
Definition slk.c:72

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

Referenced by slk_refresh().

◆ slk_colour()

int slk_colour ( short colour_pair_number)
extern

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 COLORS
Definition curses.h:208

References A_ATTRIBUTES, COLORS, CPAIR_SHIFT, ERR, NULL, OK, and slks.

◆ slk_init()

int slk_init ( int fmt)
extern

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;
278 slks->maj_space_len = MIN_SPACE_SIZE +
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}
#define A_DEFAULT
Definition curses.h:136
#define MIN_SPACE_SIZE
Definition slk.c:16
static void *__malloc calloc(size_t nmemb, size_t size)
Allocate cleared memory.
Definition stdlib.h:46

References A_DEFAULT, calloc(), COLS, ERR, fmt, LINES, MIN_SPACE_SIZE, OK, and slks.

◆ slk_label()

char * slk_label ( int labnum)
extern

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}

References NULL, and slks.

◆ slk_noutrefresh()

int slk_noutrefresh ( void )
extern

References __nonnull.

◆ slk_restore()

int slk_restore ( void )
extern

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}
#define NOWRAP
Definition mucurses.h:14
static void _print_label(struct _softlabel sl)
Definition slk.c:78

References _enter_slk(), _leave_slk(), _print_label(), _wputch(), COLS, ERR, NOWRAP, NULL, OK, slks, and stdscr.

Referenced by slk_refresh().

◆ slk_set()

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

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}
char * strncpy(char *dest, const char *src, size_t max)
Copy string.
Definition string.c:361
A text label widget.
Definition label.h:16

References ERR, fmt, NULL, OK, slks, and strncpy().

◆ slk_touch()

int slk_touch ( void )
extern

◆ subwin()

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

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}
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  )
extern

◆ termattrs()

chtype termattrs ( void )
extern

◆ term_attrs()

attr_t term_attrs ( void )
extern

◆ termname()

char * termname ( void )
extern

◆ tigetflag()

int tigetflag ( char * )
extern

◆ tigetnum()

int tigetnum ( char * )
extern

◆ tigetstr()

char * tigetstr ( char * )
extern

◆ timeout()

◆ tparm()

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

◆ typeahead()

int typeahead ( int )
extern

◆ use_env()

void use_env ( bool )
extern

◆ vid_attr()

int vid_attr ( attr_t ,
short ,
void *  )
extern

◆ vidattr()

int vidattr ( chtype )
extern

◆ vid_puts()

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

◆ vidputs()

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

References __nonnull.

◆ vw_printw()

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

Print formatted output in a window.

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

Definition at line 62 of file print.c.

62 {
63 struct printw_context wctx;
64
65 wctx.win = win;
66 wctx.ctx.handler = _printw_handler;
67 vcprintf ( &(wctx.ctx), fmt, varglist );
68 return OK;
69}
static void _printw_handler(struct printf_context *ctx, unsigned int c)
Definition print.c:47
WINDOW * win
Definition print.c:44
size_t vcprintf(struct printf_context *ctx, const char *fmt, va_list args)
Write a formatted string to a printf context.
Definition vsprintf.c:188

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 )
extern

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 24 of file print.c.

24 {
25 _wputch( win, ch, WRAP );
26 return OK;
27}
uint8_t ch
Definition registers.h:1

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

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

◆ waddchnstr()

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

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}
static void _store_curs_pos(WINDOW *win, struct cursor_pos *pos)
Store cursor position for later restoration.
Definition cursor.h:33
static void _restore_curs_pos(WINDOW *win, struct cursor_pos *pos)
Restore cursor position from encoded backup variable.
Definition cursor.h:23
void _wputchstr(WINDOW *win, const chtype *chstr, int wrap, int n) __nonnull
Write a chtype string to a window.
Definition mucurses.c:108

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

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

◆ waddnstr()

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

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 37 of file print.c.

37 {
38 _wputstr( win, str, WRAP, n );
39 return OK;
40}
void _wputstr(WINDOW *win, const char *str, int wrap, int n) __nonnull
Write a standard c-style string to a window.
Definition mucurses.c:122

References _wputstr(), OK, and WRAP.

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

◆ wattroff()

int wattroff ( WINDOW * win,
int attrs )
extern

Turn off attributes in a window.

Parameters
winsubject window
attrsattributes to enable
Return values
rcreturn status code

Definition at line 29 of file winattrs.c.

29 {
30 win->attrs &= ~attrs;
31 return OK;
32}

References _curses_window::attrs, and OK.

Referenced by attroff(), and wattr_off().

◆ wattron()

int wattron ( WINDOW * win,
int attrs )
extern

Turn on attributes in a window.

Parameters
winsubject window
attrsattributes to enable
Return values
rcreturn status code

Definition at line 41 of file winattrs.c.

41 {
42 win->attrs |= attrs;
43 return OK;
44}

References _curses_window::attrs, and OK.

Referenced by attron(), and wattr_on().

◆ wattrset()

int wattrset ( WINDOW * win,
int attrs )
extern

Set attributes in a window.

Parameters
winsubject window
attrsattributes to enable
Return values
rcreturn status code

Definition at line 53 of file winattrs.c.

53 {
54 win->attrs = ( attrs | ( win->attrs & A_COLOR ) );
55 return OK;
56}
#define A_COLOR
Definition curses.h:150

References A_COLOR, _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 *  )
extern

Referenced by attr_get().

◆ wattr_off()

int wattr_off ( WINDOW * ,
attr_t ,
void *  )
extern

Referenced by attr_off().

◆ wattr_on()

int wattr_on ( WINDOW * ,
attr_t ,
void *  )
extern

Referenced by attr_on().

◆ wattr_set()

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

References __nonnull.

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 )
extern

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}
uint8_t bl
Definition registers.h:0

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)
extern

Clear a window to the bottom from current cursor position.

Parameters
*winsubject window
Return values
rcreturn status code

Definition at line 20 of file clear.c.

20 {
21 struct cursor_pos pos;
22
23 _store_curs_pos( win, &pos );
24 do {
25 _wputc( win, ' ', WRAP );
26 } while ( win->curs_y + win->curs_x );
27 _restore_curs_pos( win, &pos );
28
29 return OK;
30}
void _wputc(WINDOW *win, char c, int wrap) __nonnull
Write a single character to a window.
Definition mucurses.c:78

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)
extern

Clear a window to the end of the current line.

Parameters
*winsubject window
Return values
rcreturn status code

Definition at line 38 of file clear.c.

38 {
39 struct cursor_pos pos;
40
41 _store_curs_pos( win, &pos );
42 while ( ( win->curs_y - pos.y ) == 0 ) {
43 _wputc( win, ' ', WRAP );
44 }
45 _restore_curs_pos( win, &pos );
46
47 return OK;
48}

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 * )
extern

◆ wcolour_set()

int wcolour_set ( WINDOW * ,
short ,
void *  )
extern

Referenced by colour_set().

◆ wdelch()

int wdelch ( WINDOW * win)
extern

Delete character under the cursor in a window.

Parameters
*winsubject window
Return values
rcreturn status code

Definition at line 56 of file clear.c.

56 {
57 _wputc( win, ' ', NOWRAP );
58 _wcursback( win );
59
60 return OK;
61}
void _wcursback(WINDOW *win) __nonnull
Retreat the cursor back one position (useful for a whole host of ops)
Definition mucurses.c:88

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

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

◆ wdeleteln()

int wdeleteln ( WINDOW * win)
extern

Delete line under a window's cursor.

Parameters
*winsubject window
Return values
rcreturn status code

Definition at line 69 of file clear.c.

69 {
70 struct cursor_pos pos;
71
72 _store_curs_pos( win, &pos );
73 /* let's just set the cursor to the beginning of the line and
74 let wclrtoeol do the work :) */
75 wmove( win, win->curs_y, 0 );
76 wclrtoeol( win );
77 _restore_curs_pos( win, &pos );
78 return OK;
79}

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

Referenced by deleteln().

◆ wechochar()

int wechochar ( WINDOW * ,
const chtype  )
extern

References __nonnull.

◆ werase()

int werase ( WINDOW * win)
extern

Completely clear a window.

Parameters
*winsubject window
Return values
rcreturn status code

Definition at line 87 of file clear.c.

87 {
88 wmove( win, 0, 0 );
89 wclrtobot( win );
90 return OK;
91}
int wclrtobot(WINDOW *win)
Clear a window to the bottom from current cursor position.
Definition clear.c:20

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

◆ wgetch()

int wgetch ( WINDOW * win)
extern

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}
int beep(void)
Audible signal.
Definition alert.c:17
int wdelch(WINDOW *win)
Delete character under the cursor in a window.
Definition clear.c:56
static int _wgetc(WINDOW *win)
Definition kb.c:24
#define KEY_BACKSPACE
Definition keys.h:128
#define KEY_MIN
Minimum value for special keypresses.
Definition keys.h:70
#define KEY_LEFT
Left arrow.
Definition keys.h:109

References _wcursback(), _wgetc(), _wputch(), _curses_window::attrs, beep(), 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 )
extern

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:129

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

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

◆ whline()

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

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}

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

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

◆ wmove()

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

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 136 of file mucurses.c.

136 {
137 /* chech for out-of-bounds errors */
138 if ( ( (unsigned)y >= win->height ) ||
139 ( (unsigned)x >= win->width ) ) {
140 return ERR;
141 }
142
143 win->curs_y = y;
144 win->curs_x = x;
145 _wupdcurs(win);
146 return OK;
147}
static void _wupdcurs(WINDOW *win) __nonnull
Update cursor position.
Definition mucurses.c:39

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

Referenced by _enter_slk(), _restore_curs_pos(), delwin(), 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,
... )
extern

Print formatted output to a window.

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

Definition at line 79 of file print.c.

79 {
80 va_list args;
81 int i;
82
83 va_start ( args, fmt );
84 i = vw_printw ( win, fmt, args );
85 va_end ( args );
86 return i;
87}
int vw_printw(WINDOW *win, const char *fmt, va_list varglist)
Print formatted output in a window.
Definition print.c:62
#define va_end(ap)
Definition stdarg.h:10
#define va_start(ap, last)
Definition stdarg.h:8
__builtin_va_list va_list
Definition stdarg.h:7

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

◆ wsyncup()

void wsyncup ( WINDOW * )
extern

References wsyncup().

Referenced by wsyncup().

◆ wsyncdown()

void wsyncdown ( WINDOW * )
extern

References wsyncdown().

Referenced by wsyncdown().

◆ wtimeout()

void wtimeout ( WINDOW * ,
int  )
extern

References __nonnull, wtimeout(), and wvline().

Referenced by wtimeout().

◆ wvline()

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

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}

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

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

◆ addch()

int addch ( const chtype ch)
inlinestatic

Definition at line 489 of file curses.h.

489 {
490 return waddch( stdscr, ch );
491}
int waddch(WINDOW *, const chtype) __nonnull
Add a single-byte character and rendition to a window and advance the cursor.
Definition print.c:24

References addch(), ch, inline, stdscr, and waddch().

Referenced by addch().

◆ addchnstr()

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

Definition at line 493 of file curses.h.

493 {
494 return waddchnstr ( stdscr, chstr, n );
495}
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().

◆ addchstr()

int addchstr ( const chtype * chstr)
inlinestatic

Definition at line 497 of file curses.h.

497 {
498 return waddchnstr ( stdscr, chstr, -1 );
499}

References stdscr, and waddchnstr().

◆ addnstr()

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

Definition at line 501 of file curses.h.

501 {
502 return waddnstr ( stdscr, str, n );
503}
int waddnstr(WINDOW *, const char *, int) __nonnull
Add string of single-byte characters to a window.
Definition print.c:37

References stdscr, and waddnstr().

◆ addstr()

int addstr ( const char * str)
inlinestatic

Definition at line 505 of file curses.h.

505 {
506 return waddnstr ( stdscr, str, -1 );
507}

References stdscr, and waddnstr().

◆ attroff()

int attroff ( int attrs)
inlinestatic

Definition at line 509 of file curses.h.

509 {
510 return wattroff ( stdscr, attrs );
511}
int wattroff(WINDOW *, int) __nonnull
Turn off attributes in a window.
Definition winattrs.c:29

References _curses_window::attrs, stdscr, and wattroff().

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

◆ attron()

int attron ( int attrs)
inlinestatic

Definition at line 513 of file curses.h.

513 {
514 return wattron ( stdscr, attrs );
515}
int wattron(WINDOW *, int) __nonnull
Turn on attributes in a window.
Definition winattrs.c:41

References _curses_window::attrs, stdscr, and wattron().

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

◆ attrset()

int attrset ( int attrs)
inlinestatic

Definition at line 517 of file curses.h.

517 {
518 return wattrset ( stdscr, attrs );
519}
int wattrset(WINDOW *, int) __nonnull
Set attributes in a window.
Definition winattrs.c:53

References _curses_window::attrs, stdscr, and wattrset().

Referenced by endwin().

◆ attr_get()

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

Definition at line 521 of file curses.h.

521 {
522 return wattr_get ( stdscr, attrs, pair, opts );
523}
int wattr_get(WINDOW *, attr_t *, short *, void *)

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

◆ attr_off()

int attr_off ( attr_t attrs,
void * opts )
inlinestatic

Definition at line 525 of file curses.h.

525 {
526 return wattr_off ( stdscr, attrs, opts );
527}
int wattr_off(WINDOW *, attr_t, void *)

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

◆ attr_on()

int attr_on ( attr_t attrs,
void * opts )
inlinestatic

Definition at line 529 of file curses.h.

529 {
530 return wattr_on ( stdscr, attrs, opts );
531}
int wattr_on(WINDOW *, attr_t, void *)

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

◆ attr_set()

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

Definition at line 533 of file curses.h.

533 {
534 return wattr_set ( stdscr, attrs, cpair, opts );
535}
int wattr_set(WINDOW *, attr_t, short, void *)

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

◆ bkgdset()

void bkgdset ( chtype ch)
inlinestatic

Definition at line 537 of file curses.h.

537 {
538 wattrset ( stdscr, ch );
539}

References ch, stdscr, and wattrset().

◆ border()

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

Definition at line 541 of file curses.h.

542 {
543 return wborder ( stdscr, ls, rs, ts, bs, tl, tr, bl, br );
544}
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

References bl, stdscr, and wborder().

◆ can_change_colour()

bool can_change_colour ( void )
inlinestatic

Definition at line 546 of file curses.h.

546 {
547 return FALSE;
548}

References FALSE.

◆ clrtobot()

int clrtobot ( void )
inlinestatic

Definition at line 550 of file curses.h.

550 {
551 return wclrtobot( stdscr );
552}
int wclrtobot(WINDOW *) __nonnull
Clear a window to the bottom from current cursor position.
Definition clear.c:20

References stdscr, and wclrtobot().

◆ clrtoeol()

int clrtoeol ( void )
inlinestatic

Definition at line 554 of file curses.h.

554 {
555 return wclrtoeol( stdscr );
556}
int wclrtoeol(WINDOW *) __nonnull
Clear a window to the end of the current line.
Definition clear.c:38

References stdscr, and wclrtoeol().

Referenced by clearmsg(), and draw_menu_item().

◆ colour_set()

int colour_set ( short colour_pair_number,
void * opts )
inlinestatic

Definition at line 558 of file curses.h.

558 {
559 return wcolour_set ( stdscr, colour_pair_number, opts );
560}
int wcolour_set(WINDOW *, short, void *)

References opts, stdscr, and wcolour_set().

◆ delch()

int delch ( void )
inlinestatic

Definition at line 562 of file curses.h.

562 {
563 return wdelch ( stdscr );
564}
int wdelch(WINDOW *) __nonnull
Delete character under the cursor in a window.
Definition clear.c:56

References stdscr, and wdelch().

◆ deleteln()

int deleteln ( void )
inlinestatic

Definition at line 566 of file curses.h.

566 {
567 return wdeleteln( stdscr );
568}
int wdeleteln(WINDOW *) __nonnull
Delete line under a window's cursor.
Definition clear.c:69

References stdscr, and wdeleteln().

◆ getch()

int getch ( void )
inlinestatic

Definition at line 570 of file curses.h.

570 {
571 return wgetch ( stdscr );
572}
int wgetch(WINDOW *)
Pop a character from the FIFO into a window.
Definition kb.c:55

References stdscr, and wgetch().

◆ getnstr()

int getnstr ( char * str,
int n )
inlinestatic

Definition at line 574 of file curses.h.

574 {
575 return wgetnstr ( stdscr, str, n );
576}
int wgetnstr(WINDOW *, char *, int)
Read at most n characters from the FIFO into a window.
Definition kb.c:88

References stdscr, and wgetnstr().

◆ getstr()

int getstr ( char * str)
inlinestatic

Definition at line 578 of file curses.h.

578 {
579 return wgetnstr ( stdscr, str, -1 );
580}

References stdscr, and wgetnstr().

◆ has_colors()

bool has_colors ( void )
inlinestatic

Definition at line 582 of file curses.h.

582 {
583 return TRUE;
584}

References TRUE.

◆ has_key()

int has_key ( int kc __unused)
inlinestatic

Definition at line 586 of file curses.h.

586 {
587 return TRUE;
588}

References __unused, and TRUE.

◆ hline()

int hline ( chtype ch,
int n )
inlinestatic

Definition at line 590 of file curses.h.

590 {
591 return whline ( stdscr, ch, n );
592}
int whline(WINDOW *, chtype, int) __nonnull
Create a horizontal line in a window.
Definition edging.c:82

References ch, stdscr, and whline().

◆ move()

int move ( int y,
int x )
inlinestatic

Definition at line 594 of file curses.h.

594 {
595 return wmove ( stdscr, y, x );
596}
int wmove(WINDOW *, int, int)
Move a window's cursor to the specified position.
Definition mucurses.c:136

References stdscr, wmove(), x, and y.

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

◆ mvaddch()

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

Definition at line 598 of file curses.h.

598 {
599 return ( wmove ( stdscr, y, x ) == OK
600 ? waddch( stdscr, ch ) : ERR );
601}

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

◆ mvaddchnstr()

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

Definition at line 603 of file curses.h.

603 {
604 return ( wmove ( stdscr, y, x ) == OK
605 ? waddchnstr ( stdscr, chstr, n ) : ERR );
606}
int waddchnstr(WINDOW *win, const chtype *chstr, int n)
Add string of single-byte characters and renditions to a window.
Definition print_nadv.c:21

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

◆ mvaddchstr()

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

Definition at line 608 of file curses.h.

608 {
609 return ( wmove ( stdscr, y, x ) == OK
610 ? waddchnstr ( stdscr, chstr, -1 ) : ERR );
611}

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

◆ mvaddnstr()

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

Definition at line 613 of file curses.h.

613 {
614 return ( wmove ( stdscr, y, x ) == OK
615 ? waddnstr ( stdscr, str, n ) : ERR );
616}
int waddnstr(WINDOW *win, const char *str, int n)
Add string of single-byte characters to a window.
Definition print.c:37

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

◆ mvaddstr()

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

Definition at line 618 of file curses.h.

618 {
619 return ( wmove ( stdscr, y, x ) == OK
620 ? waddnstr ( stdscr, str, -1 ) : ERR );
621}

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

Referenced by draw_menu_items(), and draw_setting_rows().

◆ mvdelch()

int mvdelch ( int y,
int x )
inlinestatic

Definition at line 623 of file curses.h.

623 {
624 return ( wmove ( stdscr, y, x ) == OK
625 ? wdelch ( stdscr ) : ERR );
626}

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

◆ mvgetch()

int mvgetch ( int y,
int x )
inlinestatic

Definition at line 628 of file curses.h.

628 {
629 return ( wmove ( stdscr, y, x ) == OK
630 ? wgetch ( stdscr ) : ERR );
631}
int wgetch(WINDOW *win)
Pop a character from the FIFO into a window.
Definition kb.c:55

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

◆ mvgetnstr()

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

Definition at line 633 of file curses.h.

633 {
634 return ( wmove ( stdscr, y, x ) == OK
635 ? wgetnstr ( stdscr, str, n ) : ERR );
636}
int wgetnstr(WINDOW *win, char *str, int n)
Read at most n characters from the FIFO into a window.
Definition kb.c:88

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

◆ mvgetstr()

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

Definition at line 638 of file curses.h.

638 {
639 return ( wmove ( stdscr, y, x ) == OK
640 ? wgetnstr ( stdscr, str, -1 ) : ERR );
641}

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

◆ mvhline()

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

Definition at line 643 of file curses.h.

643 {
644 return ( wmove ( stdscr, y, x ) == OK
645 ? whline ( stdscr, ch, n ) : ERR );
646}
int whline(WINDOW *win, chtype ch, int n)
Create a horizontal line in a window.
Definition edging.c:82

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

◆ mvvline()

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

Definition at line 653 of file curses.h.

653 {
654 return ( wmove ( stdscr, y, x ) == OK
655 ? wvline ( stdscr, ch, n ) : ERR );
656}
int wvline(WINDOW *win, chtype ch, int n)
Create a vertical line in a window.
Definition edging.c:102

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

◆ mvwaddch()

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

Definition at line 658 of file curses.h.

658 {
659 return ( wmove( win, y, x ) == OK
660 ? waddch ( win, ch ) : ERR );
661}
int waddch(WINDOW *win, const chtype ch)
Add a single-byte character and rendition to a window and advance the cursor.
Definition print.c:24

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

◆ mvwaddchnstr()

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

Definition at line 663 of file curses.h.

663 {
664 return ( wmove ( win, y, x ) == OK
665 ? waddchnstr ( win, chstr, n ) : ERR );
666}

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

◆ mvwaddchstr()

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

Definition at line 668 of file curses.h.

668 {
669 return ( wmove ( win, y, x ) == OK
670 ? waddchnstr ( win, chstr, -1 ) : ERR );
671}

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

◆ mvwaddnstr()

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

Definition at line 673 of file curses.h.

673 {
674 return ( wmove ( win, y, x ) == OK
675 ? waddnstr ( win, str, n ) : ERR );
676}

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

◆ mvwaddstr()

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

Definition at line 678 of file curses.h.

678 {
679 return ( wmove ( win, y, x ) == OK
680 ? waddnstr ( win, str, -1 ) : ERR );
681}

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

◆ mvwdelch()

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

Definition at line 683 of file curses.h.

683 {
684 return ( wmove ( win, y, x ) == OK
685 ? wdelch ( win ) : ERR );
686}

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

◆ mvwgetch()

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

Definition at line 688 of file curses.h.

688 {
689 return ( wmove ( win, y, x ) == OK
690 ? wgetch ( win ) : ERR );
691}

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

◆ mvwgetnstr()

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

Definition at line 693 of file curses.h.

693 {
694 return ( wmove ( win, y, x ) == OK
695 ? wgetnstr ( win, str, n ) : ERR );
696}

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

◆ mvwgetstr()

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

Definition at line 698 of file curses.h.

698 {
699 return ( wmove ( win, y, x ) == OK
700 ? wgetnstr ( win, str, -1 ) : ERR );
701}

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

◆ mvwhline()

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

Definition at line 703 of file curses.h.

703 {
704 return ( wmove ( win, y, x ) == OK
705 ? whline ( win, ch, n ) : ERR );
706}

References ch, ERR, OK, whline(), wmove(), x, and y.

◆ mvwvline()

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

Definition at line 712 of file curses.h.

712 {
713 return ( wmove ( win, y, x ) == OK
714 ? wvline ( win, ch, n ) : ERR );
715}

References ch, ERR, OK, wmove(), wvline(), x, and y.

◆ slk_refresh()

int slk_refresh ( void )
inlinestatic

Definition at line 719 of file curses.h.

719 {
720 if ( slk_clear() == OK )
721 return slk_restore();
722 else
723 return ERR;
724}
int slk_clear(void)
Clear the soft function key labels from the screen.
Definition slk.c:209
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()

int start_colour ( void )
inlinestatic

Definition at line 729 of file curses.h.

729 {
730 return OK;
731}

References OK.

◆ vline()

int vline ( chtype ch,
int n )
inlinestatic

Definition at line 733 of file curses.h.

733 {
734 return wvline ( stdscr, ch, n );
735}
int wvline(WINDOW *, chtype, int) __nonnull
Create a vertical line in a window.
Definition edging.c:102

References ch, stdscr, and wvline().

◆ vwprintw()

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

Definition at line 738 of file curses.h.

738 {
739 return vw_printw ( win, fmt, varglist );
740}
int vw_printw(WINDOW *, const char *, va_list) __nonnull
Print formatted output in a window.
Definition print.c:62

References fmt, and vw_printw().

◆ waddchstr()

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

Definition at line 742 of file curses.h.

742 {
743 return waddchnstr ( win, chstr, -1 );
744}

References waddchnstr().

◆ waddstr()

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

Definition at line 746 of file curses.h.

746 {
747 return waddnstr ( win, str, -1 );
748}

References waddnstr().

◆ wbkgdset()

int wbkgdset ( WINDOW * win,
chtype ch )
inlinestatic

Definition at line 750 of file curses.h.

750 {
751 return wattrset( win, ch );
752}

References ch, and wattrset().

◆ wgetstr()

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

Definition at line 754 of file curses.h.

754 {
755 return wgetnstr ( win, str, -1 );
756}

References wgetnstr().

◆ wstandend()

int wstandend ( WINDOW * win)
inlinestatic

Definition at line 758 of file curses.h.

758 {
759 return wattrset ( win, A_DEFAULT );
760}

References A_DEFAULT, and wattrset().

◆ wstandout()

int wstandout ( WINDOW * win)
inlinestatic

Definition at line 762 of file curses.h.

762 {
763 return wattrset ( win, A_STANDOUT );
764}
#define A_STANDOUT
Definition curses.h:144

References A_STANDOUT, and wattrset().

Variable Documentation

◆ _stdscr

WINDOW _stdscr
extern

Definition at line 21 of file mucurses.c.

21 {
22 .attrs = A_DEFAULT,
23 .ori_y = 0,
24 .ori_x = 0,
25 .curs_y = 0,
26 .curs_x = 0,
27 .scr = &_ansi_screen,
28};
SCREEN _ansi_screen
Definition ansi_screen.c:94