CURSES(S) XENIX System V CURSES(S)
Name
curses - Performs screen and cursor functions.
Syntax
#include <curses.h>
WINDOW *curscr, *stdscr;
cc -DM_TERMCAP filename -ltcap -ltermlib
Description
These routines give the user a method of updating screens
with reasonable optimization. They keep an image of the
current screen, curscr. The user modifies this image by
modifying the standard screen, stdscr, or by setting up a
new screen. The refresh and wrefresh routines make the
current screen look like the modified one. In order to
initialize the routines, the routine initscr must be called
before any of the other routines that deal with windows and
screens are used.
The routines are linked with the linker options -ltcap and
-ltermlib. Programs using these routines must be compiled
with M_TERMCAP defined.
Functions
int addch(ch)
char ch;
Adds a character to stdscr
int addstr(str)
char *str;
Adds a string to stdscr
int box(win,vert,hor)
WINDOW *win;
char vert, hor;
Draws a box around a window
int crmode()
Sets cbreak mode
int clear()
Clears stdscr
int clearok(win,state)
WINDOW *win;
bool state;
Sets clear flag for win
int clrtobot()
Clears to bottom on stdscr
Page 1 (printed 8/7/87)
CURSES(S) XENIX System V CURSES(S)
int clrtoeol()
Clears to end of line on stdscr
int delch()
Deletes character from stdscr
int deleteln()
Deletes line from stdscr
int delwin(win)
WINDOW *win;
Delete win
int echo()
Sets echo mode
int endwin()
Terminates screen processing
int erase()
Erase stdscr
int getch()
Gets a char through stdscr
int getstr(str)
char *str;
Gets a string through stdscr
int gettmode()
Gets tty modes
int getyx(win,y,x)
WINDOW *win;
int y,x;
Gets current (y,x) position of win
int inch()
Gets char at current (y,x) co-ordinates
WINDOW *initscr()
Initializes screens
int insch(c)
char c;
Inserts character in stdscr
int insertln()
Inserts blank line in stdscr
int leaveok(win,state)
WINDOW *win;
Page 2 (printed 8/7/87)
CURSES(S) XENIX System V CURSES(S)
bool state;
Sets leave flag for win
int longname(termbuf,name)
char *termbuf, *name;
Gets long name from termbuf
int move(y,x)
int y,x;
Moves to (y,x) on stdscr
int mvaddch(y,x,ch)
int y,x;
char ch;
Moves to (y,x) and adds character
ch
int mvaddstr(y,x,str)
int y,x;
char *str;
Moves to (y,x) and adds string
str
int mvcur(lasty,lastx,newy,newx)
int lasty, lastx, newy, newx;
Moves cursor the from (lasty,lastx)
to (newy,newx)
int mvdelch(y,x)
int y,x;
Moves to (y,x) and deletes
character from stdscr
int mvgetch(y,x)
int y,x;
Moves to (y,x) and gets a char
through stdscr
int mvgetstr(y,x,str)
int y,x;
char *str;
Moves to (y,x) and gets a string
through stdscr
int mvinch(y,x)
int y,x;
Moves to (y,x) and gets char at
current co-ordinates
int mvinsch(y,x,c)
int y,x;
char c;
Page 3 (printed 8/7/87)
CURSES(S) XENIX System V CURSES(S)
Moves to (y,x) and inserts
character in stdscr
int mvwaddch(win, y,x,ch)
WINDOW *win;
int y,x;
char ch;
Moves to (y,x) in win and
adds character ch
int mvwaddstr(win,y,x,str)
WINDOW *win;
int y,x;
char *str;
Moves to (y,x) in win
and adds string str
int mvwdelch(win,y,x)
WINDOW *win;
int y,x;
Moves to (y,x) in win
and deletes the character
int mvwgetch(win,y,x)
WINDOW *win;
int y,x;
Moves to (y,x) in win and
gets a character
int mvwgetstr(y,x,str)
WINDOW *win;
int y,x;
char *str;
Moves to (y,x) in win
and gets a string
int mvwin(win,y,x)
WINDOW *win;
int y,x;
Moves upper corner of win to (y,x)
int mvwinch(win,y,x)
WINDOW *win;
int y,x;
Moves to (y,x) in win and
gets character at current co-ordinates
int mvwinsch(win,y,x,c)
WINDOW *win;
int y,x;
char c;
Moves to (y,x) in win and
Page 4 (printed 8/7/87)
CURSES(S) XENIX System V CURSES(S)
inserts character
WINDOW *newwin(lines,cols,begin_y,begin_x)
int lines, cols, bigin_y, begin_x;
Creates a new window
int nl()
Sets newline mapping
int nocrmode()
Unsets cbreak mode
int noecho()
Unsets echo mode
int nonl()
Unsets newline mapping
int noraw()
Unsets raw mode
int overlay(win1,win2)
WINDOW *win1, *win2;
Overlays win1 on win2
int overwrite(win1,win2)
WINDOW *win1, *win2;
Overwrites win1 on top of win2
int printw(fmt,arg1,arg2,...)
char *fmt;
Prints args on stdscr
int raw()
Sets raw mode
int refresh()
Makes current screen look like stdscr
int restty()
Resets tty flags to stored value
int savetty()
Stored current tty flags
int scanw(fmt,arg1,arg2,...)
char *fmt;
Scans for args through stdscr
int scroll(win)
WINDOW *win;
Scrolls win one line
Page 5 (printed 8/7/87)
CURSES(S) XENIX System V CURSES(S)
int scrollok(win,state)
WINDOW *win;
bool state;
Sets scroll flag
int setterm(name)
char *name;
Sets term variables for name
int standend()
Clears standout mode of stdscr
int standout()
Sets standout mode for characters in subsequent
output to stdscr
WINDOW *subwin(win,lines,cols,begin_y,begin_x)
WINDOW *win;
int lines, cols, begin_y, begin_x;
Creates a subwindow in win
int touchwin(win)
WINDOW *win;
Prepares win for complete update on
next refresh.
int unctrl(ch)
char ch;
Printable version of ch
int waddch(win,ch)
WINDOW *win;
char ch;
Adds char to win
int waddstr(win,str)
WINDOW *win;
char *str;
Adds string to win
int wclear(win)
WINDOW *win;
Clear win
int wclrtobot(win)
WINDOW *win;
Clears to bottom of win
int wclrtoeol(win)
WINDOW *win;
Clears to end of line on win
Page 6 (printed 8/7/87)
CURSES(S) XENIX System V CURSES(S)
int wdelch(win)
WINDOW *win;
Deletes current character from win
int wdeleteln(win)
WINDOW *win;
Deletes line from win
int werase(win)
WINDOW *win;
Erase win
int wgetch(win)
WINDOW *win;
Gets a char through win
int wgetstr(win,str)
WINDOW *win;
char *str;
Gets a string through win
int winch(win)
WINDOW *win;
Gets char at current (y,x) in win
int winsch(win,c)
WINDOW *win;
char c;
Inserts character c in win
int winsertln(win)
WINDOW *win;
Inserts a blank line in win
int wmove(win,y,x)
WINDOW *win;
int y,x;
Sets current (y,x) co-ordinates on
int wprintw(win,fmt,arg1,arg2,...)
WINDOW *win;
char *fmt;
Print args on win
int wrefresh(win)
WINDOW *win;
Makes screen look like win
int wscanw(win,fmt,arg1,arg2,...)
WINDOW *win;
char *fmt;
Scans for args through win
Page 7 (printed 8/7/87)
CURSES(S) XENIX System V CURSES(S)
int wstandend(win)
WINDOW *win;
Clears standout mode for win
int wstandout(win)
WINDOW *win;
Sets standout mode for characters on
subsequent output to win
See Also
termcap(M), stty(C), setenv(S), terminfo(S)
XENIX C Library Guide
Credit
This utility was developed at the University of California
at
Berkeley and is used with permission.
Page 8 (printed 8/7/87)