Curses Functions

Compiled by Peter Jay Salzman

C may be a `small' language, but curses is huge!

curs_addch(3X)<\dt>
int addch(chtype ch)<\dt>
int waddch(WINDOW *win, chtype ch)<\dt>
int mvaddch(int y, int x, chtype ch)<\dt>
int mvwaddch(WINDOW *win, int y, int x, chtype ch);<\dt>
int echochar(chtype ch)<\dt>
int wechochar(WINDOW *win, chtype ch)<\dt>
Add a character (with attributes) to a curses window, then advance the cursor.<\dd>

curs_addchstr (3x)<\dt>
int addchstr(const chtype *chstr)<\dt>
int addchnstr(const chtype *chstr, int n)<\dt>
int waddchstr(WINDOW *win, const chtype *chstr)<\dt>
int waddchnstr(WINDOW *win, const chtype *chstr, int n)<\dt>
int mvaddchstr(int y, int x, const chtype *chstr)<\dt>
int mvaddchnstr(int y, int x, const chtype *chstr, int n)<\dt>
int mvwaddchstr(WINDOW *win, int y, int x, const chtype *chstr)<\dt>
int mvwaddchnstr(WINDOW *win, int y, int x, const chtype *chstr, int n)<\dt>
Add a string of characters (and attributes) to acurses window.<\dd>

curs_attr (3x)<\dt>
int attroff(int attrs)<\dt>
int wattroff(WINDOW *win, int attrs)<\dt>
int attron(int attrs)<\dt>
int wattron(WINDOW *win, int attrs)<\dt>
int attrset(int attrs)<\dt>
int wattrset(WINDOW *win, int attrs)<\dt>
int standend(void)<\dt>
int wstandend(WINDOW *win)<\dt>
int standout(void)<\dt>
int wstandout(WINDOW *win)<\dt>
attr_t attr_get(void)<\dt>
attr_t wattr_get(WINDOW *)<\dt>
int attr_off(attr_t attrs)<\dt>
int wattr_off(WINDOW *, attr_t attrs)<\dt>
int attr_on(attr_t attrs)<\dt>
int wattr_on(WINDOW *, attr_t attrs)<\dt>
int attr_set(attr_t attrs)<\dt>
int wattr_set(WINDOW *, attr_t attrs)<\dt>
int chgat(int n, attr_t attr, short color, const void *opts)<\dt>
int wchgat(WINDOW *, int n, attr_t attr, short color, const void *opts)<\dt>
int mvchgat(int y, int x, int n, attr_t attr, short color, const void *opts)<\dt>
int mvwchgat(WINDOW *, int y, int x, int n, attr_t attr, short color, const void *opts)<\dt>
Curses character and window attribute control routines.<\dd>

curs_beep (3x)<\dt>
int beep(void)<\dt>
int flash(void)<\dt>
Curses bell and screen flash routines.<\dd>

curs_bkgd (3x)<\dt>
void bkgdset(const chtype ch)<\dt>
void wbkgdset(WINDOW *win, const chtype ch)<\dt>
int bkgd(const chtype ch)<\dt>
int wbkgd(WINDOW *win, const chtype ch)<\dt>
chtype getbkgd(WINDOW *win)<\dt>
Curses window background manipulation routines.<\dd>

curs_border (3x)<\dt>
int border(chtype ls, chtype rs, chtype ts, chtype bs, chtype tl, chtype tr, chtype bl, chtype br)<\dt>
int wborder(WINDOW *win, chtype ls, chtype rs, chtype ts, chtype bs, chtype tl, chtype tr, chtype bl, chtype br)<\dt>
int box(WINDOW *win, chtype verch, chtype horch)<\dt>
int hline(chtype ch, int n)<\dt>
int whline(WINDOW *win, chtype ch, int n)<\dt>
int vline(chtype ch, int n)<\dt>
int wvline(WINDOW *win, chtype ch, int n)<\dt>
mvhline(int y, int x, chtype ch, int n)<\dt>
mvwhline(WINDOW *, int y, int x, chtype ch, int n)<\dt>
int mvvline(int y, int x, chtype ch, int n)<\dt>
int mvwvline(WINDOW *, int y, int x, chtype ch, int n)<\dt>
Create curses borders, horizontal and vertical lines.<\dd>

curs_clear (3x)<\dt>
int erase(void)<\dt>
int werase(WINDOW *win)<\dt>
int clear(void)<\dt>
int wclear(WINDOW *win)<\dt>
int clrtobot(void)<\dt>
int wclrtobot(WINDOW *win)<\dt>
int clrtoeol(void)<\dt>
int wclrtoeol(WINDOW *win)<\dt>
Clear all or part of a curses window.<\dd>

curs_color (3x)<\dt>
int start_color(void)<\dt>
int init_pair(short pair, short f, short b)<\dt>
int init_color(short color, short r, short g, short b)<\dt>
bool has_colors(void)<\dt>
bool can_change_color(void)<\dt>
int color_content(short color, short *r, short *g, short *b)<\dt>
int pair_content(short pair, short *f, short *b)<\dt>
Curses color manipulation routines.<\dd>

curs_delch (3x)<\dt>
int delch(void)<\dt>
int wdelch(WINDOW *win)<\dt>
int mvdelch(int y, int x)<\dt>
int mvwdelch(WINDOW *win, int y, int x)<\dt>
Delete character under the cursor in a curses window.<\dd>

curs_deleteln (3x)<\dt>
int deleteln(void)<\dt>
int wdeleteln(WINDOW *win)<\dt>
int insdelln(int n)<\dt>
int winsdelln(WINDOW *win, int n)<\dt>
int insertln(void)<\dt>
int winsertln(WINDOW *win)<\dt>
Delete and insert lines in a curses window.<\dd>

curs_getch (3x)<\dt>
int getch(void)<\dt>
int wgetch(WINDOW *win)<\dt>
int mvgetch(int y, int x)<\dt>
int mvwgetch(WINDOW *win, int y, int x)<\dt>
int ungetch(int ch)<\dt>
int has_key(int ch)<\dt>
Get (or push back) characters fromcurses terminal keyboard.<\dd>

curs_getstr (3x)<\dt>
int getstr(char *str)<\dt>
int getnstr(char *str, int n)<\dt>
int wgetstr(WINDOW *win, char *str)<\dt>
int mvgetstr(int y, int x, char *str)<\dt>
int mvwgetstr(WINDOW *win, int y, int x, char *str)<\dt>
int mvgetnstr(int y, int x, char *str, int n)<\dt>
int mvwgetnstr(WINDOW *, int y, int x, char *str, int n)<\dt>
int wgetnstr(WINDOW *win, char *str, int n)<\dt>
Accept character strings fromcurses terminal keyboard.<\dd>

curs_getyx (3x) <\dt>
void getyx(WINDOW *win, int y, int x)<\dt>
void getparyx(WINDOW *win, int y, int x)<\dt>
void getbegyx(WINDOW *win, int y, int x)<\dt>
void getmaxyx(WINDOW *win, int y, int x)<\dt>
Get curses cursor and window coordinates.<\dd>

curs_inch (3x)<\dt>
chtype inch(void)<\dt>
chtype winch(WINDOW *win)<\dt>
chtype mvinch(int y, int x)<\dt>
chtype mvwinch(WINDOW *win, int y, int x)<\dt>
Get a character and attributes from a curses window.<\dd>

curs_inchstr (3x)<\dt>
int inchstr(chtype *chstr)<\dt>
int inchnstr(chtype *chstr, int n)<\dt>
int winchstr(WINDOW *win, chtype *chstr)<\dt>
int winchnstr(WINDOW *win, chtype *chstr, int n)<\dt>
int mvinchstr(int y, int x, chtype *chstr)<\dt>
int mvinchnstr(int y, int x, chtype *chstr, int n)<\dt>
int mvwinchstr(WINDOW *win, int y, int x, chtype *chstr)<\dt>
int mvwinchnstr(WINDOW *win, int y, int x, chtype *chstr, int n)<\dt>
Get a string of characters (and attributes) from acurses window.<\dd>

curs_initscr (3x)<\dt>
WINDOW *initscr(void)<\dt>
int endwin(void)<\dt>
int isendwin(void)<\dt>
SCREEN *newterm(const char *type, FILE *outfd, FILE *infd)<\dt>
SCREEN *set_term(SCREEN *new)<\dt>
void delscreen(SCREEN* sp)<\dt>
curses screen initialization and manipulation routines.<\dd>

curs_inopts (3x)<\dt>
int cbreak(void)<\dt>
int nocbreak(void)<\dt>
int echo(void)<\dt>
int noecho(void)<\dt>
int halfdelay(int tenths)<\dt>
int intrflush(WINDOW *win, bool bf)<\dt>
int keypad(WINDOW *win, bool bf)<\dt>
int meta(WINDOW *win, bool bf)<\dt>
int nodelay(WINDOW *win, bool bf)<\dt>
int raw(void)<\dt>
int noraw(void)<\dt>
void noqiflush(void)<\dt>
void qiflush(void)<\dt>
int notimeout(WINDOW *win, bool bf)<\dt>
void timeout(int delay)<\dt>
void wtimeout(WINDOW *win, int delay)<\dt>
int typeahead(int fd)<\dt>
Curses input options.<\dd>

curs_insch (3x)<\dt>
int insch(chtype ch)<\dt>
int winsch(WINDOW *win, chtype ch)<\dt>
int mvinsch(int y, int x, chtype ch)<\dt>
int mvwinsch(WINDOW *win, int y, int x, chtype ch)<\dt>
Insert a character before cursor in a curses window.<\dd>

curs_insstr (3x)<\dt>
int insstr(const char *str)<\dt>
int insnstr(const char *str, int n)<\dt>
int winsstr(WINDOW *win, const char *str)<\dt>
int winsnstr(WINDOW *win, const char *str, int n)<\dt>
int mvinsstr(int y, int x, const char *str)<\dt>
int mvinsnstr(int y, int x, const char *str, int n)<\dt>
int mvwinsstr(WINDOW *win, int y, int x, const char *str)<\dt>
int mvwinsnstr(WINDOW *win, int y, int x, const char *str, int n)<\dt>
Insert string before cursor in a curses window.<\dd>

curs_instr (3x)<\dt>
int instr(char *str)<\dt>
int innstr(char *str, int n)<\dt>
int winstr(WINDOW *win, char *str)<\dt>
int winnstr(WINDOW *win, char *str, int n)<\dt>
int mvinstr(int y, int x, char *str)<\dt>
int mvinnstr(int y, int x, char *str, int n)<\dt>
int mvwinstr(WINDOW *win, int y, int x, char *str)<\dt>
int mvwinnstr(WINDOW *win, int y, int x, char *str, int n)<\dt>
Get a string of characters from a curses window.<\dd>

curs_kernel (3x)<\dt>
int def_prog_mode(void)<\dt>
int def_shell_mode(void)<\dt>
int reset_prog_mode(void)<\dt>
int reset_shell_mode(void)<\dt>
int resetty(void)<\dt>
int savetty(void)<\dt>
void getsyx(int y, int x)<\dt>
void setsyx(int y, int x)<\dt>
int ripoffline(int line, int (*init)(WINDOW *, int))<\dt>
int curs_set(int visibility)<\dt>
int napms(int ms)<\dt>
Low-level curses routines.<\dd>

curs_mouse (3x)<\dt>
int getmouse(MEVENT *event)<\dt>
int ungetmouse(MEVENT *event)<\dt>
mmask_t mousemask(mmask_t newmask, mmask_t *oldmask)<\dt>
bool wenclose(WINDOW *win, int y, int x)<\dt>
int mouseinterval(int erval)<\dt>
Mouse interface through curses.<\dd>

curs_move (3x)<\dt>
int move(int y, int x)<\dt>
int wmove(WINDOW *win, int y, int x)<\dt>
Move curses window cursor.<\dd>

curs_outopts (3x)<\dt>
int clearok(WINDOW *win, bool bf)<\dt>
int idlok(WINDOW *win, bool bf)<\dt>
void idcok(WINDOW *win, bool bf)<\dt>
void immedok(WINDOW *win, bool bf)<\dt>
int leaveok(WINDOW *win, bool bf)<\dt>
int setscrreg(int top, int bot)<\dt>
int wsetscrreg(WINDOW *win, int top, int bot)<\dt>
int scrollok(WINDOW *win, bool bf)<\dt>
int nl(void)<\dt>
int nonl(void)<\dt>
Curses output options.<\dd>

curs_overlay (3x)<\dt>
int overlay(const WINDOW *srcwin, WINDOW *dstwin)<\dt>
int overwrite(const WINDOW *srcwin, WINDOW *dstwin)<\dt>
int copywin(WINDOW *srcwin, WINDOW *dstwin, int sminrow, int smincol, int dminrow, int dmincol, int dmaxrow, int dmaxcol, int overlay)<\dt>
Overlay and manipulate overlapped curses windows.<\dd>

curs_refresh (3x)<\dt>
int refresh(void)<\dt>
int wrefresh(WINDOW *win)<\dt>
int wnoutrefresh(WINDOW *win)<\dt>
int doupdate(void)<\dt>
int redrawwin(WINDOW *win)<\dt>
int wredrawln(WINDOW *win, int beg_line, int num_lines)<\dt>
Refreshcurses windows and lines.<\dd>

curs_scanw (3x)<\dt>
int scanw(char *fmt [, arg] ...)<\dt>
int wscanw(WINDOW *win, char *fmt [, arg] ...)<\dt>
int mvscanw(int y, int x, char *fmt [, arg] ...)<\dt>
int mvwscanw(WINDOW *win, int y, int x, char *fmt [, arg] ...)<\dt>
int vwscanw(WINDOW *win, char *fmt, va_list varglist)<\dt>
Convert formatted input from acurses widow.<\dd>

curs_slk (3x)<\dt>
int slk_init(int fmt)<\dt>
int slk_set(int labnum, const char *label, int fmt)<\dt>
int slk_refresh(void)<\dt>
int slk_noutrefresh(void)<\dt>
char *slk_label(int labnum)<\dt>
int slk_clear(void)<\dt>
int slk_restore(void)<\dt>
int slk_touch(void)<\dt>
int slk_attron(attr_t attrs)<\dt>
int slk_attrset(attr_t attrs)<\dt>
attr_t slk_attr(void)<\dt>
int slk_attroff(attr_t attrs)<\dt>
Curses soft label routines.<\dd>

curs_terminfo (3x) <\dt>
int setupterm(const char *term, int fildes, int *errret)<\dt>
int setterm(const char *term)<\dt>
TERMINAL *set_curterm(TERMINAL *nterm)<\dt>
int del_curterm(TERMINAL *oterm)<\dt>
int restartterm(const char *term, int fildes, int *errret)<\dt>
char *tparm(const char *str, ...)<\dt>
int tputs(const char *str, int affcnt, int (*putc)(int))<\dt>
int putp(const char *str)<\dt>
int vidputs(chtype attrs, int (*putc)(char))<\dt>
int vidattr(chtype attrs)<\dt>
int mvcur(int oldrow, int oldcol, int newrow, int newcol)<\dt>
int tigetflag(const char *capname)<\dt>
int tigetnum(const char *capname)<\dt>
char *tigetstr(const char *capname)<\dt>
curses interfaces to terminfo database.<\dd>

curs_touch (3x)<\dt>
int touchwin(WINDOW *win)<\dt>
int touchline(WINDOW *win, int start, int count)<\dt>
int untouchwin(WINDOW *win)<\dt>
int wtouchln(WINDOW *win, int y, int n, int changed)<\dt>
int is_linetouched(WINDOW *win, int line)<\dt>
int is_wintouched(WINDOW *win)<\dt>
Curses refresh control routines.<\dd>

curs_util (3x)<\dt>
char *unctrl(chtype c)<\dt>
char *keyname(int c)<\dt>
void filter(void)<\dt>
void use_env(char bool)<\dt>
int putwin(WINDOW *win, FILE *filep)<\dt>
WINDOW *getwin(FILE *filep)<\dt>
int delay_output(int ms)<\dt>
int flushinp(void)<\dt>
Miscellaneous curses utility routines.<\dd>

curs_window (3x)<\dt>
WINDOW *newwin(int nlines, int ncols, int begin_y, intbegin_x)<\dt>
int delwin(WINDOW *win)<\dt>
int mvwin(WINDOW *win, int y, int x)<\dt>
WINDOW *subwin(WINDOW *orig, int nlines, int ncols, int begin_y, int begin_x)<\dt>
WINDOW *derwin(WINDOW *orig, int nlines, int ncols, int begin_y, int begin_x)<\dt>
int mvderwin(WINDOW *win, int par_y, int par_x)<\dt>
WINDOW *dupwin(WINDOW *win)<\dt>
void wsyncup(WINDOW *win)<\dt>
int syncok(WINDOW *win, bool bf)<\dt>
void wcursyncup(WINDOW *win)<\dt>
void wsyncdown(WINDOW *win)<\dt>
Create curses windows.<\dd>

resizeterm (3x)<\dt>
int resizeterm(int lines, int columns)
Change the curses terminal size.<\dd>

wresize (3x)<\dt>
int wresize(WINDOW *win, int lines, int columns)
Resize a curses window.<\dd>

curs_pad (3x)<\dt>
WINDOW *newpad(int nlines, int ncols)<\dt>
WINDOW *subpad(WINDOW *orig, int nlines, int ncols, int begin_y, int begin_x)<\dt>
int prefresh(WINDOW *pad, int pminrow, int pmincol, int sminrow, int smincol, int smaxrow, int smaxcol)<\dt>
int pnoutrefresh(WINDOW *pad, int pminrow, int pmincol, int sminrow, int smincol, int smaxrow, int smaxcol)<\dt>
int pechochar(WINDOW *pad, chtype ch)<\dt>
Create and display curses pads.<\dd>

curs_printw (3x)<\dt>
int printw(char *fmt [, arg] ...)<\dt>
int wprintw(WINDOW *win, char *fmt [, arg] ...)<\dt>
int mvprintw(int y, int x, char *fmt [, arg] ...)<\dt>
int mvwprintw(WINDOW *win, int y, int x, char *fmt [, arg] ...)<\dt>
Print formatted output in curses windows.<\dd>

curs_scr_dmp (3x)<\dt>
int scr_dump(const char *filename)<\dt>
int scr_restore(const char *filename)<\dt>
int scr_init(const char *filename)<\dt>
int scr_set(const char *filename)<\dt>
Read (write) a curses screen from (to) a file.<\dd>

curs_scroll (3x)<\dt>
int scroll(WINDOW *win)<\dt>
int scrl(int n)<\dt>
int wscrl(WINDOW *win, int n)<\dt>
Scroll a curses window.<\dd>

curs_termattrs (3x)<\dt>
int baudrate(void)<\dt>
char erasechar(void)<\dt>
int has_ic(void)<\dt>
int has_il(void)<\dt>
char killchar(void)<\dt>
char *longname(void)<\dt>
attr_t termattrs(void)<\dt>
char *termname(void)<\dt>
Curses environment query routines.<\dd>

curs_termcap (3x)<\dt>
int tgetent(const char *bp, char *name)<\dt>
int tgetflag(const char *id)<\dt>
int tgetnum(const char *id)<\dt>
char *tgetstr(const char *id, char **area)<\dt>
char *tgoto(const char *cap, int col, int row)<\dt>
int tputs(const char *str, int affcnt, int (*putc)(int))<\dt>
Direct curses interface to the terminfo capability database.<\dd>

ncurses (3x) <\dt>
CRT screen handling and optimization package.<\dd>

panel (3x) <\dt>
Panel stack extension for curses.<\dd>

form (3x) <\dt>
curses extension for programming forms<\dd>

menu (3x) <\dt>
curses extension for programming menus<\dd>