������ �������� ����(!) ������������� ����������
|
CIT Forum CD-ROM
|
|
CURSES(3X)
��������
curses - ����� ����������� ���������� ������� �� ��������
����������
�������� ������ curses �������� �� ������ ������.
� ������� ��������� ������ ���������� � ����������,
������ ���� ���������� �������� ������ � �� �����, �
����� ���������� ��������� �������� ������ � �� ����������.
� ������� �������� �������������� � ���, ��� ����� ������������ ����� curses.
� ������� ��������� ���������� �������� ���� ��������
������ curses, ��������� ��� ���� ������������� �� ��������� �����:
- ���������� ���� �������
- ���������� ������
- �����
- ����
- ��������� ������� ������
- ��������� ������� �����
- ������� � ������������
- ��������������� �����
- ��������� ������� ������
- ��������� ������ terminfo
- �������� termcap
- �������������� ���������
- ������������� curscr
����� ���� ������� ��������, �������������� �������, �������������.
���������
cc [����� ...] ���� ... -lcurses [���������� ...]
#include <curses.h> (������������� �������� <stdio.h>,
<termio.h> � <unctrl.h>)
���� ������� ��������� �������� ������ curses, ��������� ���������� ����������, � ����� ���� ���������. ���
��������� ������, ���� �� ��������� ���������, ���������� �������� ERR ��� OK ���� int. � ������ ������ ��������� ��������, ������������ ��������-���������, ����� NULL. (��������� ERR, OK � NULL ������������ ��
���������� ����� <curses.h>.)
bool bf
char **area, *boolnames [ ], *boolcodes [ ], *boolfnames [ ], *bp
char *cap, *capname, *codename [2], erasechar, *filename, *fmt
char *keyname, killchar, *label, *longname
char *name, *numnames [ ], *numcodes [ ], *numfnames [ ]
char *slk_label, *str, *strnames [ ], *strcodes [ ], strfnames [ ]
char *term, *tgetstr, *tigetstr, *tgoto, *tparm, *type
chtype attrs, ch, horch, vertch
FILE *infd, *outfd
int begin_x, begin_y, begline, bot, c, col, count
int dmaxcol, dmaxrow, dmincol, dminrow, *erret, fildes
int (*init ( )), labfmt, labnum, line
int ms, ncols, new, newcol, newrow, nlines, numlines
int oldcol, oldrow, overlay
int p1, p2, p3, p4, p5, p6, p7, p8, p9
int pmincol, pminrow, (*putc ( )), row
int smaxcol, smaxrow, smincol, sminrow, startrow
int tenths, top, visibility, x, y
SCREEN *new, *newterm, *set_term
TERMINAL *cur_term, *nterm, *oterm
va_list varglist
WINDOW *curscr, *dstwin, *initscr, *newpad, *newwin, *orig
WINDOW *pad, *srcwin, *stdscr, *subpad, *subwin, *win
addch (ch)
addstr (str)
attroff (attrs)
attron (attrs)
attrset (attrs)
baudrate ( )
beep ( )
box (win, vertch, horch)
cbreak ( )
clear ( )
clearok (win, bf)
clrtobot ( )
clrtoeol ( )
copywin (srcwin, dstwin, sminrow, smincol, dminrow, dmincol,
dmaxrow, dmaxcol, overlay)
curs_set (visibility)
def_prg_mode ( )
def_shell_mode ( )
def_curterm (oterm)
delay_output (ms)
delch ( )
deleteln ( )
delwin (win)
doupdate ( )
draino (ms)
echo ( )
echochar (ch)
endwin ( )
erase ( )
erasechar ( )
filter ( )
flash ( )
flushinp ( )
garbagedlines (win, begline, numlines)
getbegyx (win, y, x)
getch ( )
getmaxyx (win, y, x)
getstr (str)
getsyx (y, x)
getyx (win, y, x)
halfdelay (tenths)
has_ic ( )
has_il ( )
idlok (win, bf)
inch ( )
initscr ( )
insch (ch)
insertln ( )
intrflush (win, bf)
isendwin ( )
keyname (c)
keypad (win, bf)
killchar ( )
leaveok (win, bf)
longname ( )
meta (win, bf)
move (y, x)
mvaddch (y, x, ch)
mvaddstr (y, x, str)
mvcur (oldrow, oldcol, newrow, newcol)
mvdelch (y, x)
mvgetch (y, x)
mvgetstr (y, x, str)
mvinch (y, x)
mvinsch (y, x, ch)
mvprintw (y, x, fmt[, arg...])
mvscanw (y, x, fmt[, arg...])
mvwaddch (win, y, x, ch)
mvwaddstr (win, y, x, str)
mvwdelch (win, y, x)
mvwgetch (win, y, x)
mvwgetstr (win, y, x, str)
mvwin (win, y, x)
mvwinch (win, y, x)
mvwinsch (win, y, x, ch)
mvwprintw (win, y, x, fmt[, arg...])
mvwscanw (win, y, x, fmt[, arg...])
napms (ms)
newpad (nlines, ncols)
newterm (type, outfd, infd)
newwin (nlines, ncols, begin_y, begin_x)
nl ( )
nocbreak ( )
nodelay (win, bf)
noecho ( )
nonl ( )
noraw ( )
notimeout (win, bf)
overlay (srcwin, dstwin)
overwrite (srcwin, dstwin)
pechochar (pad, ch)
pnoutrefresh (pad, pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol)
prefresh (pad, pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol)
printw (fmt[, arg...])
putp (str)
raw ( )
refresh ( )
reset_prog_mode ( )
reset_shell_mode ( )
resetty ( )
restartterm (term, fildes, erret)
ripoffline (line, init)
savetty ( )
scanw (fmt[, arg...])
scr_dump (filename)
scr_init (filename)
scr_restore (filename)
scroll (win)
scrollok (win, bf)
set_curterm (nterm)
set_term (new)
setscrreg (top, bot)
setsyx (y, x)
setupterm (term, fildes, erret)
slk_clear ( )
slk_init (labfmt)
slk_label (labnum)
slk_noutrefresh ( )
slk_refresh ( )
slk_restore ( )
slk_set (labnum, label, fmt)
slk_touch ( )
standend ( )
standout ( )
subpad (orig, nlines, ncols, begin_y, begin_x)
subwin (orig, nlines, ncols, begin_y, begin_x)
tgetent (bp, name)
tgetflag (codename)
tgetnum (codename)
tgetstr (codename, area)
tgoto (cap, col, row)
tigetflag (capname)
tigetnum (capname)
tigetstr (capname)
touchline (win, start, count)
touchwin (win)
tparm (str, p1, p2, p3, p4, p5, p6, p7, p8, p9)
tputs (str, count, putc)
traceoff ( )
traceon ( )
typeahead (fildes)
unctrl (c)
ungetch (c)
vidattr (attrs)
vidputs (attrs, putc)
vwprintw (win, fmt, varglist)
vwscanw (win, fmt, varglist)
waddch (win, ch)
waddstr (win, str)
wattroff (win, attrs)
wattron (win, attrs)
wattrset (win, attrs)
wclear (win)
wclrtobot (win)
wclrtoeol (win)
wdelch (win)
wdeleteln (win)
wechochar (win, ch)
werase (win)
wgetch (win)
wgetstr (win, str)
winch (win)
winsch (win, ch)
winsertln (win)
wmove (win, y, x)
wnoutrefresh (win)
wprintw (win, fmt[, arg...])
wrefresh (win)
wscanw (win, fmt[, arg...])
wsetcrreg (win, top, bot)
wstandend (win)
wstandout (win)
��������
����� curses ���� ������������ ����������� �� ���������
����� ������ �� ����� � �������� ������������.
���������������� ��������� initscr ��� newterm ���������� ����������� ������� ������ ������� (��� ����������
�� ����� ������� ����� ������� ����). ��� ����������
������ ����� ������� ��������� endwin. ����� ��������
������� �� ������������ �� ������ (����������� ������������� �������� �������� ����� ������ ����� �����) ����� ������ ��������� initscr ���������� �������
cbreak (); noecho ()
����������� �������� ������������� ��������
nonl ();
intrflush (stdscr, FALSE); keypad (stdscr, TRUE)
����� �������� ���������, ������������ ����� curses, ��
��������� ���������� ���������� ������� ��������� �,
���� ���������, ������� ���������������� ������������������. ��� ������ �������� �������� tput init, ������
���������� ��������� TERM ������ ���� ��������������
���������� � �������� � ��������� �������� export TERM.
��������� ��. profile(4), tput(1) � ������ ��������� �
������������� � terminfo(4).
���������� curses �������� ���������, ��������������
����������� ������, ����������� ������, ������� �����
������� ��� ��������� ������� ��������, ��������������
���� ����� ��� ��� �����. ������ ������� �����������
����, �������� � �����, ���������� stdscr. ������ ����
����� ���� ������� ���������� newwin. � ���������� ��
���� ��������� � ������� ���������� ���� WINDOW *; ���
�������� WINDOW ��������� �� ���������� �����
<curses.h>. ����� ����������� ������ ����� �������������� � ������� ��������, ��������� ����, ����� �������
��������� �������� move � addch. (������ ������ �������� ���������, ����� ������� ���������� � ����� w, � ���
����� ������� ���� � �������� ���������. ���������,
����� ������� �� ���������� � ����� w, ������ ����� ���� � stdscr.) ����� ���������� ��������� refresh, ������� ���������� � ������ ����������, ����� ����� ������������ �������� ��� stdscr. ������� � ���� ����� ���
chtype, ��� ��������� ��� ������� ������� ������� �������������� ����������.
���������� ���� ������������ ���� (��������), �������
�� ���������� ��������� ������ � ���������� ������� ������� �� ������ �� ������������. ����� �������� �� ����
����� ��. ���� � ������� ���������� ������ (���������
newpad).
��� ������� ������������� �� ������ ������� ����� ����
������ �������� ������������, ��� ��������� ��������
������������ ��� ��������������� ������� �� ����������,
���������� ���������������� �������������. � �������
������ curses ����� ������� ����������������� �������.
��� ����� ��������� ������ ����� ��������������� ������������������, ���������� ��������� � ���������������
���������. �������� ������������, �����������������
������� � ���� ��� �������������� ������ ������� � ����� <curses.h>, �������� A_REVERSE, ACS_HLINE, KEY_LEFT.
� ������ curses ���������� ����� ���������� curscr ����
WINDOW *, ������� ����� ������������ � �������� ��������� ��������� �������� ������� ������, ����� ��� ����������� ������������ ������. ���� ���������� � ��������� clearok � ���������� curscr, �� ��������� ��������� � wrefresh ��� ������ ���� �������� � ������� ������ � ����� ��� ������ �����������. ���� ���������� �
��������� wrefresh � ���������� curscr, �� ����� ���������� ��������� � ������������. ������ ��� �����������
�������� ������������ ����������� ������.
���������� � �������� ������, �������� � terminfo, ����� ���� ��������� ����������� ��������� LINES �
COLUMNS, ��� ������������, ��������, ��� ��������� AT&T
5620, �������� ���������� ������ ������.
���� ���������� ���������� ��������� TERMINFO, ��������� ������ curses ������� ���� �������� ��������� �� �
����������� �����, � � ���������. ��������, ���� ���������� ��������� TERM ����� �������� att4425, �� ���������������� �������� ������������� �� ��������� ����������� �� ����� /usr/lib/terminfo/a/att4425. ������,
���� �������� ���������� ��������� TERMINFO �����
$HOME/myterms, �� curses ������� �������� ���� $HOME/
myterms/a/att4425, � ������ ���� ���� ���� �����������,
��������� � /usr/lib/terminfo/a/att4425. �������� ���������� ������ ��� ������������� � ����������, � �����
�����, ����� ��� ���� �� ������ � ������� /usr/lib/
terminfo.
�� ���������� ����� <curses.h> ���������� ����������
���������� LINES � COLS ���� int. � ��������� initscr
���� ���������� ������������� ����� ����� ������ � ����� �������� � ������ (����� ��������� ���������� ��. �
������� ��������� ������ terminfo). ��������� TRUE �
FALSE ���� 1 � 0 ��������������. ��������� ������ ���������� �������� ERR ��� OK; ����� ������� ����� ����������, ������� �� ����������� ���������. ��������� ERR �
OK ����� ���������� � ����� <curses.h>
���������
��� ������ ����������� ���� �������� ������� ���������
������. ��������� � ��������� w ����� ��������������
�������� - ����. ��������� � ��������� p ����� �������������� �������� - ��������. ��������� ��� �������� �������� � stdscr.
��������� � ��������� mv ����� �������������� ���������
- ���������� x � y �����, ���� ����� ��������� ������
����� ����������� ���������������� ��������. ��� ��������� ������� �������� move (y, x), � ����� ��������������� ��������� ��� �������� mv. �������� y ������ �������� ������ ����, � x - �������. ����� ������� ����
���� ����� ���������� (0, 0), � �� (1, 1). ��� ��������
� ��������� mvw � �������� �������������� ����������
�������� � ����, � ���������� �������. ��������, �������� ����, ������ ����������� ����� ������������.
�� ���� ���������� �������� win ������ ����, � ��������
pad - ��������. (� win, � pad ����� ��� WINDOW *.) ���
��������, ��������������� ������, �������� bf ���� bool
������ ����� �������� TRUE ��� FALSE. ���� WINDOWS *,
bool � chtype ���������� �� ���������� �����
<curses.h>. �������� ����� ���� ���������� ��������� �
������� ���������.
��� ���������, ���� �� ��������� ���������, ����������
�������� ERR ��� OK. � ������ ������ ��������� ��������, ������������ ��������-���������, ����� NULL.
���������� ���� �������
- WINDOW *initscr ( )
-
������ ���������� ���������� ����� ������ ��������
initscr. ���� ������ ��������� ��� ����������:
slk_init, filter � ripoffline. ��������� initscr
���������� ��� ��������� � �������������� ��������� ������ ������ curses. ����������� ����� ��������, ����� ������ ��������� � refresh �������� �����. ���� ���������� ������, initscr ������� ��������� � ����������� �������� � ��������� ���������; ���� ������ �� ����, ������������ ��������
stdscr. ���� ��������� ���� ������ ������������
������ �������������, ������ initscr ������� ������������ newterm. ��������� initscr ����� �������� ������ ���� ���.
-
endwin ( )
-
��������� endwin ���������� ����������� ��������
����� ����������� ���������, � �����, ��������,
����� �������� ������������ �������� shell ��� ����������� ������� system(3S). ��������� endwin
��������������� ��������� �������������� ��������
tty(7), �������� ������ � ����� ������ ���� ������
� ��������� �������� � ���������� ����� ������������. ����� ���������� ����������� ������� curses,
���������� ������� ��������� wrefresh ���
doupdate.
-
isendwin ( )
-
���������� �������� TRUE, ���� ����� ���� ��� ����� ��������� endwin, �� ��� �� ���� ������
wrefresh ��� doupdate.
-
SCREEN *newterm (type, outgf, infd)
-
���������, �������������� ����� �� ��������� ���������� ������������, ������ ������������ ��� ������������� ������� �� ��� �� initscr, � newterm.
���������, ������� ���� ����� ������������ ������
�������������, ��������, ����� ������ � ��������
������ ������ ���������, ����� ������ ������������
��� ������������� ��������� newterm. � ������ ���������� ���������� ��������� newterm ������ ����
������� ��� ������� ���������. ��������� ���������� �������� ���� SCREEN *, ������� ������ ����
��������� ��� ����������� ������ �� ��������. �������� type ������ ��� ���������, ������� �����
�������������� ������ �������� ���������� ��������� TERM, �������� outfd �������� ���������� ������, ��������� �� ����� [��. stdio(3S)], � ��������
infd - ��� ��������� ������, ��������� �� ����.
��� ���������� ��������� ������ ������� ���������
endwin ��� ������� ���������. ���� newterm ��������� ��������� ��� ��� ������ � ���� �� ���������, endwin ������ ���������� � �������, ��������
������� newterm.
-
SCREEN *set_term (new)
-
��� ��������� ������������ ��� ������������ �����
����������� �����������. ��������, �� ������� ��������� �������� new, ���������� �������. ���������
���������� ��������� �� ��������, ������ �� �����
�������. ��� ������������ ���������, ������� ������������ ����������� ���� SCREEN *; ��� ���������
��������� ��������� � �������� ���������.
���������� ������
- refresh ( )
wrefresh (win) -
��� ��������� (��� ��������� prefresh,
pnoutrefresh, wnoutrefresh ��� doupdate) ������
���������� ��� ��������� ������ �� �����, �����
��� ����������� ��������� �������� ������ ������������ ����������� ������. ��������� wrefresh �������� ��������� ���� �� ����� ���������, ��������
�� �������� ��, ��� �� ����� ��� ��������, �����
�� �������� ���������� �������� (��� ����������
������������ ������). ��������� refresh ������ ��
�� ����� ��� ������������ ���� stdscr. ���� �� ���������� ����� leaveok, ���������� ������ ��������� ���������� �� ������� ����� � ����. ���������
���������� ���������� ��������, ���������� �� ��������.
�������, ��� refresh �������� ��������.
-
wnoutrefresh (win)
doupdate ( ) -
��� ��� ��������� ������������ ����� �����������
��������� ������, ��� ������ wrefresh. ��� �������� ��������� �������.
��������� ������ curses ������ ��� ��������� ������, �������������� ����� ���������: ����������
�����, ����������� �������� ��������� ������ �
����������� �����, ����������� ��, ��� �����������
����� ������ �� ������. ��������� wrefresh �������
�������� ��������� wnoutrefresh, ������� ��������
��������� ���� �� ����������� �����, � ����� ���������� � doupdate ��� ��������� ������������ ������ � ���������� � ���������� ����������� ���������
�� ���������� ������. ���� ����������� ����� �������� ����� ��������� ����, �� ��������� �������
wrefresh �������� � ���������������� �������
wnoutrefresh � doupdate, �� ���� � ����������
��������� �� ������. ���� �� ������� ������� ��������� ������� wnoutrefresh, � ����� ���� �����
doupdate, �� �� ������ ����� ���� �������, �� �������� ����� �������� ������� ����� �������� � ��������� ����� ������ ��������.
-
WINDOW *newwin (nlines, ncols, begin_y, begin_x)
-
������� ����� ����, ���������� nlines ����� �
ncols �������, � ���������� ��������� �� ����. ����� ������� ���� ���� ���������� � ������ begin_y,
������� begin_x. ���� nlines ��� ncols ����� 0,
������ ���� ����� LINES-begin_y ����� � COLS
begin_x ������� ��������������. ����� ���� �������� � ����� ����� ��������� ������� newwin (0, 0,
0, 0).
-
mvwin (win, y, x)
-
����������� ��������� ���� ���, ����� ��� �����
������� ���� ��������� � ������� (y, x). ���� ����������� ������� ���� �� ������� ������, ��� ��������� ������� � ����������� ���� �� �����������.
-
WINDOW *subwin (orig, nlines, ncols, begin_y, begin_x)
-
������� ����� ����, ���������� nlines ����� �
ncols �������, � ���������� ��������� �� ����. ����� ������� ���� ���� ���������� � ������ begin_y,
������� begin_x (����� ������ � ������� ������������ ������, � �� ������������ ���� orig). ���������, ��� ����� ���� ������������� � ����� orig,
�� ���� ��������� � ����� ���� ������ �� ��� ����.
��� ������������� ���� ��������� ������ ���������
����� ���������� � wrefresh ������� ���������
touchwin � touchline ��� ���� orig.
-
delwin (win)
-
������� ��������� ����, ��������� ��� ������, ��������� � ���. � ������ ���������� ���� �������
������ ���� ������� ����, ��������� � ������� �������� subwin ��� subpad.
-
WINDOW *newpad (nlines, ncols)
-
������� ����� ��������, ���������� nlines ����� �
ncols �������, � ���������� ��������� �� ����.
�������� �� ���������� ��������� ������ � ���� ��
����������� ������� � �����-���� ������ ������.
�������� ������������, ����� ��������� ������� ����, �� �������� �� ������ ����� ������������ ������ �����. �������������� ����������� ��������
(��������, ��� ������������) �� ����������. �������� ������ ��������� � �������� ��������� ��������� wrefresh, ������ ����� ���������� ������������ ����������� prefresh � pnoutrefresh. �������,
��� ��� ��������� ����� �������������� ���������,
����������� ������� �������� �� ����� ��������,
������� ������ ������������, � �� ����� ������, ��
������� ������ ������������� �����������.
-
WINDOW *subpad (orig, nlines, ncols, begin_y, begin_x)
-
������� ����� ��������, ���������� nlines ����� �
ncols �������, � ���������� ��������� �� ����. �
������� �� ��������� subwin, ����� ������� ����
������ �������� �������� ������������ ��������
orig. ����� ���� ������������� � ����� orig, ��
���� ��������� � ����� ���� ������ �� ��� ����.
��� ������������� ���� ��������� ������ ���������
����� ���������� � prefresh ������� ���������
touchwin � touchline ��� ���� orig.
-
prefresh (pad, pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol)
pnoutrefresh (pad, pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol)
-
��� ��������� ���������� ���������� wrefresh �
wnoutrefresh, ������ �������� ��� ��� ����������.
�������������� ��������� ������ ����� �� ������,
���� ������ �����. ��������� pminrow � pmincol ������ ����� ������� ���� ������� ��������, �������
����� ������������; sminrow, smincol, smaxrow,
smaxcol ������ ������������� �� ������, � �������
����� �������� �����������. ������ ������ ����
������������� �������������� � �������� ����������� �� ����������� �� ������, ��� ��� �������������� ����� ���������� �������. ��� �������������� ��
������ �������� �� ������� �������� � ������. ������������� �������� pminrow, pmincol, sminrow �
smincol ���������� ��� ����.
�����
��������� ��������� ������������� ��� ������ ������ �
����.
-
addch (ch)
waddch (win, ch)
mvaddch (y, x, ch)
mvwaddch (win, y, x, ch) -
������ ch ���������� � ������� ������� ����, ������� ������� ��� ���� ���������� �� ������� ������.
�� ������ ������� ���� ���������� ��������������
������� ������, �� ������ ������ ����, ���� ���������� ����� scrollok, ���������� ������������.
���� ch �������� �������� ���������, ��������
������ ��� �������� �� ���, ����������� ��������������� �������� � ����. ��� �������� ������ �����
������������ ���������� ��������� clrtoeol. ���������, ��� ������� ��������� ����������� � ������
������� �������. ������ ����������� ������� �����
�������� � ���� ^X. (����� ��������� winch �����
������ ������������ ������� ������ �� ��� ����������� ������, � ��� �������� �������������.)
� ������� ����� ���� ��������� �������� ������������ � ������� ���������� �������� ���, ����� �����
����������������� � ����� ����������. �����������
������ � ���������� �� ������ ����� ������ � ������ ����� ���� ��������� � ������� �������� inch �
addch. ��. ���� �������� ��������� standout.
�������, ��� ch ����� ��� chtype, � �� char, �
addch, mvaddch � mvwaddch �������� ���������.
-
echochar (ch)
wechochar (win, ch)
pechochar (pad, ch) -
��� ��������� �������������� ������������ ������
addch (ch), �� ������� ������� refresh ( ), ������
waddch (win, ch), �� ������� ������� wrefresh
(win), ������ waddch (pad, ch), �� ������� �������
prefresh (pad). ��� ���� ����� ���������, ��� ��
����� ��������� ����� ���� ������, ������� �������
�� ����� ����������. ��� ��������� pechochar ������������ �� ������� ������, � ������� ���������
��� ���������� ��������� ��������.
�������, ��� ch ����� ��� chtype, � �� char, �
echochar �������� ��������.
-
addstr (str)
waddstr (win, str)
mvaddstr (y, x, str)
mvwaddstr (win, y, x, str)
��� ��������� ������� ������� �������� str, ������������ ������� ������, � ��������� ����. ��� ������������ ������ waddch ��� ������� ������� �������.
�������, ��� addstr, mvaddstr � mvwaddstr ��������
���������.
-
attroff (attrs)
wattroff (win, attrs)
attron (attrs)
wattron (win, attrs)
attrset (attrs)
wattrset (win, attrs)
standend ( )
wstandend (win)
standout ( )
wstandout (win) -
��� ��������� ������������ ���������� ������������
� ��������� ����. �������� ����� ���� ����� ����������� �� ���������: A_STANDOUT (���������),
A_REVERSE (��������), A_BOLD (���������), A_DIM
(���������� �������), A_BLINK (��������),
A_UNDERLINE (�������������), A_ALTCHARSET (�������������� ����� ��������). ��� ��������� ����������
� ����� <curses.h> � ����� ��������������� ��������� ���������� ��� (| � ����� C).
������� �������� ���� ����������� �� ���� ��������, ������� ������������ � ���� ����������
waddch. �������� ����������� ������� � ������������ ������ � �������� ��� ������������ � �������/
�������� �����/��������. ����� curses ����������
��� �������� � ��� �������, � ����� ��� ���������
���������� ��������.
��������� attrset ������������� ������� ����� ��������� ���� ������ ��������� attrs. ���������
attroff ���������� ��������� ��������, ���������
�������� ��� ���� �� ��������. ��������� attron
������������� ��������� �������� ��� ��������� ���������. ����� standout ( ) ������������ attron
(A_STANDOUT), � ����� standend ( ) ������������
attrset (0), �� ���� ���������� ��� ��������.
�������, ��� ch ����� ��� chtype, � �� char, �
attroff, attron, attrset, standend � standout �������� ���������.
-
beep ( )
flash ( ) -
��� ��������� ������������ ��� ����������� �������� ������������, �������� �� ����������. ��������� beep ������ �������� ������, ���� ��� ��������,
� ���� ���, �� ������ ������� �� ������. ���������
flash ������ ������� �� ������, ���� ��� ��������,
� ���� ���, ������ �������� ������. ���� ��������
�� ����� �������� �������� ������ � �� ����� ������ ������� �� ������, �� ������ �� ����������.
����� ��� ��������� ����� �������� �������� ������, �� ������ ��������� ����� ������ ������� ��
������.
-
box (win, vertch, horch)
-
�� ���� ���� win �������� �����. ��������� vertch
� horch - ��� �������, � ������� ������� ��������
������������ � �������������� �����. ���� vertch �
horch ����� 0, �� ������������ ������� �� ��������� - ACS_VLINE � ACS_HLINE ��������������.
�������, ��� ��������� vertch � horch ����� ���
chtype, � �� char.
-
erase ( )
werase (win) -
��� ��������� �������� ������� �� ��� ������� ����.
�������, ��� erase �������� ��������.
-
clear ( )
wclear (win) -
��� ��������� ��������� � erase ( ) � werase
(win), �� ��� ��� ������������� �������� ���������
clearok. ���������� ����� ��� ��������� ���������
� wrefresh ����� ����� ������ � �����������.
�������, ��� clear �������� ��������.
-
clrtobot ( )
wclrtobot (win) -
��� ������ ���� ������� �������, � ����� �������
������ ������ ������� �������, ������� ���� �������, ���������.
�������, ��� clrtobot �������� ��������.
-
clrtoeol ( )
wclrtoeol (win) -
������� ������ ������ ������� �������, ������� ���� �������, ���������.
�������, ��� clrtoeol �������� ��������.
-
delay_output (ms)
-
��� ������ ������� ����� �� ms �����������. �� �������������, ������, ���������� ��������� ��� ���������. ���������������� ������������ �������-�����������, � �� ����� ����������.
-
delch ( )
wdelch (win)
mvdelch (y, x)
mvwdelch (win, y, x) -
������� ������ � ���� ���������. ��� ������� ������ �� ���� ���������� �� ������� �����, � ��������� ������� ������������ ������. ������� �������
�� ���������� (����� ���� ������ ���������������
����������� � (y, x)). ����������� ��������� ��
������� ������������� ���������� ������� ��������
�������.
�������, ��� delch � mvdelch �������� ���������.
-
deleteln ( )
wdeleteln (win) -
������� ������ ���� ���������. ��� ������ ����
��������� ����������� �����. ��������� ������ ����
���������. ������� ������� �� ��������. ����������� ��������� �� ������� ������������� ����������
������� �������� ������.
�������, ��� deleteln �������� ��������.
-
getyx (win, y, x)
-
������� ������� � ���� ���������� � ��������� y �
x. ��������� getyx �������� ��������, ����� ������� ���������� �� ��������� ���� &.
-
getbegyx (win, y, x)
getmaxyx (win, y, x) -
� ���� getyx ��� ��������� ��������� �������� ���������� ������ �������� ���� ���� �� ������ � ���
�������.
�������, ��� getbegyx � getmaxyx �������� ���������.
-
insch (ch)
winsch (win, ch)
mvinsch (y, x, ch)
mvwinsch (win, y, x, ch) -
������ ch ����������� ����� �������. ��� �������
������ ��������, ������� � ��� ������� ������,
���������� ������, ��� ����, ��������, ����� ������ ������ ������ ���������. ������� ������� ��
���������� (����� ���� ������ ��������������� ����������� � (y,x)). ����������� ��������� �� ������� ������������� ���������� ������� ������� �������.
�������, ��� ch ����� ��� chtype, � �� char, �
insch, mvinsch � mvwinsch �������� ���������.
-
insertln ( )
winsertln (win) -
����� ������� ������� ���� ����������� ������.
������ ������ ���� ��������. ����������� ���������
�� ������� ������������� ���������� ������� ������� ������.
�������, ��� insertln �������� ��������.
-
move (y, x)
wmove (win, y, x) -
������� �������, ��������������� ����, ������������ � ������ y, ������� x. ���������� ������ �� ������ �� ������������ �� ��� ���, ���� �� �����
������� ��������� refresh. ������� ����������� ������������ ������ �������� ���� ����, �������� ���������� (0, 0).
�������, ��� move �������� ��������.
-
overlay (srcwin, dstwin)
overwrite (srcwin, dstwin) -
��� ��������� �������� ���� srcwin ������ ����
dstwin, �� ���� ����� �� srcwin ���������� �
dstwin. ���� �� ������� ����� ���������� ������,
���������� ������ �������������� �����. �������
����� ����� ����������� ����������� � ���, ���
overlay �� �������� �������, �������� �� ���� ����� ��, ��� ����, � overwrite ���������� ������ �����������.
-
copywin (srcwin, dstwin, sminrow, smincol, dminrow, dmincol, dmaxrow, dmaxcol, overlay)
-
��� ��������� ���� ����������� ������, ��� ��������� overlay � overwrite. ��� � � ���������
prefresh, �������� ������������� � ����-���������
(dminrow, dmincol, dmaxrow, dmaxcol) � ����� ������� ���� � ����-��������� (sminrow, smincol). ����
�������� overlay �� ����� 0, �� ������� �� ����������, ��� � overlay.
-
printw (fmt[, arg...])
wprintw (win, fmt[, arg...])
mvprintw (y, x, fmt[, arg...])
mvwprintw (win, y, x, fmt[, arg...]) -
��� ��������� ���������� printf(3S), ������ ��������������� ������� �������� ��������� � �������
waddstr � ��������� ����.
-
vwprintw (win, fmt, varglist)
-
��� ��������� ���������� vfprintf(3S). ��� �������� wprintw � ���������� ������� ����������. ������
��������, varglist, �������� ���������� �� ������
����������, ��� ��� ���������� � . O
������ �� ������� ���������� ���������� ����� ��.
vprintf(3S) � varargs(5).
-
scroll (win)
-
���� ����������� ����� �� ���� ������. ��� ����
���������� ������ � � ���������� ������, ����������� ����. ��� �����������, � ���� stdsrc, ����
����������� ���� �������, ������������ �����������
� ���������� �����.
-
touchwin (win)
touchline (win, start, count) -
������ ���������� � ���, ����� ����� ���� ���������� (��� ���������� ������������ ��� �����������
������). �������, ��� ��� ���� ������� �����������. ��� ����� ������ ���������� ��� ��������������
����, ��� ��� ��������� ����� ���� �������� ��������� � ������, �� ���������� �� ���� ���������� �
���������� ������ ������ ���� �� ����������. ��������� � touchline ������� � ���, ��� ����������
count ����� ����, ������� �� ������ � �������
start.
����
-
getch ( )
wgetch (win)
mvgetch (y, x)
mvwgetch (win, y, x) -
� ���������� ���������, ���������� � �����, ����������� ������. ���� ���������� ����� NODELAY �
������ ��� �� ������, ������������ �������� ERR.
���� ���������� ����� DELAY, ��������� ������������������ �� ��� ���, ���� ������� �� �������� ��
��������� �����. � ����������� �� ������ CBREAK
��� ����� ����� ����� ������ ������� (�����
CBREAK) ��� ����� ����� ������ ������� (�����
NOCBREAK). � ������ HALF-DELAY ��������� ������������������ �� ��� ���, ���� �� ����� ������ ������ ��� ������� ��������� ������ �������. ���� ��
���������� ����� NOECHO, �������� ������� ������������ � ��������������� ����. ����� ����������� �
move � getch, ����������� �� �������� mvgetch �
mvwgetch, �� �������� refresh.
��������� ��������� getch, wgetch, mvgetch �
mvwgetch, ������ ������������� ������������ ������
NOCBREAK � ECHO. ���������� ����� ��������� ���������������� � ������� �� ���������, � �������
��������� ������� tty(7).
���� �������������� ���� ������� ��������� keypad
(win, TRUE) � ������ �������������� �������, ��
������ ��������� �� ����� ����� ���������� ��������, �������������� ������� (��. keypad � ��������� ������� �����). �������������� ������� ���������� � <curses.h>, �� �������� ���������� � �����
0401, � ����� - � �������� KEY_. ���� ���������
������, ������� ����� ���� ������� ��������������
������� (��������, ESC), curses ��������� ������.
���� �� ��������� ����� �� ����� �������� �����������, �� ������ ���������� ��� �� ����, � ��������� ������ ������������ �������� ��������������
�������. ������� �� ������ ���������� ����� ������� ������� ESC ���������� ������� ���������,
������ ��� ��� ������� ������� ���������. �� ����
�� ������� �� ������������� ������������� ������������ ������� ESC ��� �������������� �������
���������. ��. ����� notimeout ����.
�������, ��� getch, mvgetch � mvwgetch ��������
���������.
-
getstr (str)
wgetstr (win, str)
mvgetstr (y, x, str)
mvwgetstr (win, y, x, str) -
��������� getch ���������� �� ��� ���, ���� �� ����� ������ ������� �������� ������, �������� ������� ��� ������� "����". ��������� ���������� �
������� ������, �� ������� ��������� �������� str.
��� ����� �������������� ����������� ������� erase
� kill. ��� �� ��� � � ��������� mvgetch, �����
����������� � move � getstr, ����������� �� �������� mvgetstr � mvwgetstr, �� �������� refresh.
�������, ��� getstr, mvgetstr � mvwgetstr ��������
���������.
-
flushinp ( )
-
��������������� ��� �������, ��������� ������������� � ����� �������, �� ��� �� ��������� ����������.
-
ungetch (c)
-
�������� ������ c ������� �� ������� �������, ���
��� �� ����� ������ ��������� ������� wgetch.
-
chtype inch ( )
chtype winch (win)
chtype mvinch (y, x)
chtype mvwinch (win, y, x) -
��� ��������� ���������� ������ (���� chtype),
������������� � ������� ������� ���������� ����,
������ � ���������� ���������� (��� ���������� ���
��������� � ���� �������). ��������� A_CHARTEXT �
A_ATTRIBUTES, ������������ � ����� <curses.h>,
����� ������������ � �������� "���������� �" (& �
����� C) ��� ��������� �� ������������� ��������
������ ���� ������� ��� ������ ���������.
�������, ��� inch, winch, mvinch � mvwinch �������� ���������.
-
scanw (fmt[, arg...])
wscanw (win, fmt[, arg...])
mvscanw (y, x, fmt[, arg...])
mvwscanw (win, y, x, fmt[, arg...]) -
��� ��������� ���������� scanf(3S) � �� ����������, � �� ������������ ���������. � ���� ���������� ��������� wgetstr, � ���������� ������� �������� ����������� � ������������ � ��������� ��������.
-
vwscanw (win, fmt, varglist)
-
��� ��������� ���������� ��������� vwprintw, ��������� ����. ��� �������� wscanw � ����������
������� ����������. ������ ��������, varglist, �������� ���������� �� ������ ����������, ��� ���
���������� � . O ������ �� ������� ���������� ���������� ����� ��. vprintf(3S) �
varargs(5).
��������� ������� ������
��������� ��������� ������������� ������ ������ ��� ������ curses. ��� ������ ��� ������������� ����� FALSE.
��� ������������� ����� ������� endwin ���������� ���
������ � ��������� FALSE.
-
clearok (win, bf)
-
���� �������� ��������� bf ����� TRUE, �� ��������� ����� wrefresh �������� � ������� ���� � ������ ��� �����������. ��� ������, ���� ����������
���� �����������, ����� ����, ������ ������ ����������� ���� ���� ������ ���������� ������, ���
���������.
-
idlok (win, bf)
-
���� �������� ��������� bf ����� TRUE, �� ��������� ������ curses ��� ������� � �������� ����� ����� ������������ ���������� ������� (���� ��� �������). ���� bf ����� FALSE, �� curses ����� ��������� ���������� ����� (������� �������/��������
�������� ������������ ������). ���� ����� �������
������������ ������ ���� ��� ������������� �����
��������� � ������� ������ (��������, � ���������
- �������� ���������). �� ��������� ���� �����
����� �������� FALSE, ��� ��� ���������� ���������� ������� � �������� ����� � ����������, � ������� ��� ������� �� ���������, �������� � ���������� ���������� ��������. ���� ������������� ���������� ������ ���������, �� curses ��������������
������������ ����� ���� �����.
-
leaveok (win, bf)
-
������ ���������� ������ ��������� � ������� ������� �������� ����. ���� bf ����� TRUE, �� ����������� ��������� ������ ���, ��� ��� �������� ��������� ��������� ������. ��� ������ ��� ��������,
�� ������������ ������� �������, ��� ��� ���������
������������� � ��� ������������. ���� ������������ ���� �����, �� ������ �������� ��������� (����
�������� ��� ���������).
-
setscrreg (top, bot)
wsetscrreg (win, top, bot) -
��� ��������� ��������� ���������� ����������� ������� � ����. ��������� top � bot - ��� ������
������� � ������ ������ ���������� ������� (�����
������� ������ ���� ����� 0). ���� ������ �������
������������ � ���������� ����� scrollok, �� ��
������ ������ ���� ���������� ������������ ������
�������� �������. ����������� ��������� �� �������
������������� ����������� ������������ �����, ���
��� ����� ����� � ��������� DEC vt100. ������, ���� ���������� ����� idlok � �������� ����� ����������� ������ ��� ��������� � ������� ������, ��
��� ����������� ����� ������������ ����������� ������.
�������, ��� ��� ��������� setscrreg � wsetscrreg
�������� ���������.
-
scrollok (win, bf)
-
��������� ������ ��� ������������ ������ ���������
��������, ����� ������ � ���� ������� �� �������
����������� ������� ��-�� �������� ������ � ��������� ������ ������� ��� ������ ������� � ��������� ������� ��������� ������. ���� ���� ����� ��
���������� (�������� bf ����� FALSE), ������ �������� � ��������� ������ �� ��� �� �����. ���� ����� ���������� (�������� bf ����� TRUE) ����������
����� wrefresh, � ����� ���� � ����� �����������
��������� ����������� �� ���� ������ �����. �������� ��������, ��� ��� ����, ����� ���������� ����� ������������, ���������� ���������� �����
idlok.
-
nl ( )
nonl ( ) -
��� ��������� ��������� ��������������� �������
�������� ������ � ������� ������� � ������� � ����� ������ ��� ������ � ������� �������� ������� �
������� ������ ��� �����. �� ��������� ��� �������������� �����������. ��� ������ ���� �������������� ���������� nonl ����� curses �������� ����������� ������������ ����� ������� �����������
�������, ��������� ��������� � ����� ������.
��������� ������� �����
��������� ��������� ������������� ������ ����� ��� ������ curses. ��������� ������� �������� � ���� ��������� � ���������� ������ ioctl(2) � ����� ��������� ������� �� ������ ������. ��� ������������� ����� ����������� endwin ���������� ��� ������ � ��������� ���������.
-
cbreak ( )
nocbreak ( ) -
��� ��� ��������� �������������� ������������� �
���������� ����� CBREAK. � ������ CBREAK ��������
������� ����� ���������� ���������, ��������� �������� erase � kill �� ������������. � ������
NOCBREAK ������� tty(7) ���������� �������� ������� �� ��� ���, ���� �� ����� ������ ������ �������� ������ ��� �������� �������. ������� ����������
� ���������� ��������� � ���� ������ �� ������������� [��. termio(7)]. ��������� ��������� ��������� ����� ���� �����, �������, ���� ���������, ���������� ���� ������� ��������� cbreak ���
nocbreak. ����������� ������������� ��������, ������������ curses, ������������� ����� CBREAK.
�������, ��� ��������� cbreak ������������� �����
raw. ��. ����� getch � ������� ���� �� ������ ����, ��� ����������� ��������� ��������������� �
����������� echo � noecho.
-
echo ( )
noecho ( ) -
��� ��������� ��������� ���, ������������ �� ��
������ �������, �������� �� getch. ���, ����������� ���������, ������ ��������, �� ��� ������������� ��� getch ��������������� ����� ECHO, �� ����
�������� ������� ������������. ������ �����������
������������� �������� ������������ ��������������
���������� �������� ������� � ��������� ����� ������, ���� �� ���������� �� �����, ��� ���� ���������� ��������� noecho. ��. getch � ������� ����
�� ������ ����, ��� ����������� ��������� ��������������� � ����������� cbreak � nocbreak.
-
halfdelay (tenths)
-
���� ����� ����� �� ����� CBREAK ���, ��� ��������
������� ����� ���������� ���������. ������ ���� ��
���� ������� �� ���� ������ �� ���������� tenths
������� ����� �������, ����� ���������� ��������
ERR. ����� tenths ������ ���� �� 1 �� 255. ���
���������� ����� ������ ������������ ���������
nocbreak.
-
intrflush (win, bf)
-
���� ���������� ���� �����, �� ��� ������� ������
�� �������� ���������� (interrupt, break, quit)
���� ����, ����������� � �������� tty(7), �����
��������������, ��� ��������� ������ �������������
�� ����������. ������, ��������� ������ ��� ����
����� ��������� ��������������� �������������,
���������� � ���������� curses. ������ ����� ������ ������������� ������� ������� � ��������. ��������� �������� ������� ������ ������� �� ��������� ��������. �������� win ������������.
-
keypad (win, bf)
-
��� ��������� ������������� ����� ��������� �������������� ������ �� ���������� ���������. ����
���� ����� ����������, �� ��� ������� ������������� �������������� ������� (��������, ������� �����), ��������� wgetch ��������� ���������������
���� ������� �������� (KEY_LEFT). ���� ������ ����� �� ����������, �� ������������������ �����,
���������� ��������������� ���������, �� �������������, ��������� ����� ������������ �� ����. ����
�������������� ���������� ��������� ����� ���������� ��� � ������ ��������, ��� � � ���������
������, ����� ��������� keypad �������� � ��������
���������� � ����� �������� ��� ������ ��������� �
wgetch.
-
meta (win, bf)
-
���� ���� ����� ����������, ��� 8 ��� ��������,
�������� � ����������, ���������� ���������, �����
��������� wgetch ���������� ������� ���. ����� ����� META ������� ���������, ����������, ����� �
���� ������ terminfo(4) ��� ������� ��������� ����
������ �������������� km (������� ����).
-
nodelay (win, bf)
-
���� ����� �� ��������� ��������� wgetch ������� �
��������. ���� ���� ����� ���������� � ��� �������� �������, �� ������������ �������� ERR. ���� ����� �� ����������, �� wgetch ������� ����� ���������� �������.
-
notimeout (win, bf)
-
��� ������������� �������� ����������� ������������������� ��������� wgetch ��������� ������, ������ ���������� �������. ���� ������� ���������
notimeout (win, TRUE), �� ������� ������� �� ����������. ������ ������������ ��� ���������� �������������������, ���������� �� �������������� ������, � ���������������� ������� ������� ������.
-
raw ( )
noraw ( ) -
��������������� ��� ���������� ����� RAW. �����
RAW ���������� ������ CBREAK, �������� �������
����� ���������� ���������. ������� ����������� �
���, ��� ������� ���������� (interrupt, quit), �
����� ������� ���������� ��������� (xon, xoff) ���������� ��� �������������, ������� ��� ���� ��
������������. ����� RAW ������������� ������������
���� � �����. ������� �� ������� BREAK ������� ��
������ ��� � ��������������� �������� tty(7), ���
���� ������� curses �� ���������������.
-
typeahead (fildes)
-
������ curses ��������� ��������� ��� �����������.
����� ������� �� ����� �����������, ��� �� ��� ������� ������, �, ���� ����, �� ����� �������������
�� ���������� ������ refresh ��� doupdate. ���
��������� ������� ����������� �� ������������������ ������. ������ ��� �������� ������������ ���������� �����, ����������� � �������� ���������
��������� newterm, ��� stdin, ���� �������������
����������� � ������� initscr. ��������� typeahead
��������� �������� ����������� ���� �� ���� �
������������ fildes. ���� fildes ����� -1, �� ��������� ���� ����������� �� �����������.
�������, ��� fildes - ��� ���������� �����, � ��
��������� �� ��������� ���� FILE.
������� � ������������
-
baudrate ( )
-
�������� ������ �� ��������. ������������ �����
�����, ���������� �������� �������� � ����� � �������, �������� 9600.
-
char erasechar ( )
-
������������ ������� �������� ������� erase.
-
has_ic ( )
-
������, ���� �������� ����� ��������� � �������
�������.
-
has_il ( )
-
������, ���� �������� ����� ��������� � �������
������.
-
char killchar ( )
-
������������ ������� �������� ������� kill.
-
char *longname ( )
-
��������� ���������� ��������� �� ����������� �������, ���������� ��������� �������� ������� ���������. ������������ ����� ���������� �������� 128 ��������. � ������ ��������� ����� ����������
������ ����� initscr ��� newterm. ����������� ������� ���������� ��� ����������� ������� newterm �
�� ����������������� �������� set_term, �������,
���� �������������� ������������ ���������� ���������� ��� ���������� ����������, �� �������� ���������� ����������� � ������ �����.
��������������� �����
����� curses ���� ������ � ��������������� ������ ��
��������, ������� ������� �� ��������� ����������. ���
��� ����������, �� ������� ��� ��������������� �����,
������� ����������� �� �������� � ������� ������ ����
stdscr, ��� ���� ����������� �� ������� ������ ����
stdscr � �������� ���������� LINES. Curses ������������
������ ����� �� ������ �������� ������.
-
slk_init (labfmt)
-
����� ������������ ��������������� �����, ��������� slk_init ������ ���� ������� ������ ��������
initscr � newterm. ���� ��������� initscr �����
������������ ������� ������ ������ ��� �����, ��
�������� labfmt ������ �� ������������ � ������.
���� �������� labfmt ����� 0, ����� �����������
����� �������� 3-2-3, � ���� �������� labfmt �����
1, �� ����� �������� 4-4.
-
slk_set (labnum, label, labfmt)
-
�������� labnum - ��� ����� �����, �� 1 �� 8. �������� label ������������ ����� ������� ��������
(������ �� ����� 8), ������� ���������� � ����
�����. ������ ������� ��� �����, ������ NULL, ������ ������ �����. �������� labfmt, ������ 0, 1
��� 2, ������� � ���, ��� ����� �������������� ��������� �����, ������������ ��� ��������� ������.
-
slk_refresh ( )
slk_noutrefresh ( ) -
��� ��������� ������������� ���������� wrefresh �
wnoutrefresh. ����������� �������� ��������
slk_noutrefresh, ��� ��� ������ �������� �����
���������� �������� wrefresh.
-
char *slk_label (labnum)
-
������������ ������� �������� ����� � �������
labnum, �� �������� ������� ��������� � ���������
�������.
-
slk_clear ( )
-
��������������� ����� ��������� � ������.
-
slk_restore ( )
-
��������������� �����, �������� � ������ ���������� slk_clear, �����������������.
-
slk_touch ( )
-
��� ��������� ��������� � slk_noutrefresh ���
��������������� ����� ����� �������� �� ����� ������.
��������� ������� ������
��������� ��������� ������� ������ ���� ������ � ��������� ������������ ������ curses. ������ ��� ���������
���������� �� ������������ ��������.
-
def_prog_mode ( )
def_shell_mode ( ) -
��������� ������� �������� ������������� ���������, ��� ��������, ����������� ��� ���������� �����
��������� (� ������� curses) ��� ��������� shell
(��� ������ curses) ��� ������������ �������������� ����������� reset_prog_mode �
reset_shell_mode. ��� ��������� ���������� ���������� initscr.
-
reset_prog_mode ( )
reset_shell_mode ( ) -
������������ ����������� �������� �������������
��������� ��� ����������� ������ ������ curses ���
��� ������� ��������� shell. ��� ��������� ���������� ����������� endwin � doupdate.
-
resetty ( )
savetty ( ) -
��� ��������� ���������� � ��������������� ����������� �������������� ���������. ��������� savetty
���������� �������������� � ������, � resetty
��������������� ��������� ����������� ��������������.
-
getsyx (y, x)
-
���������� y � x ������������� �������� ���������
������� �� ����������� ������. ��� � � getyx, ����� ������� ���������� �� ����� ��������� &. ����
���������� ����� leaveok, �� ���������� ������������� �������� (-1,-1). ���� ������� ������ ������
���� ������� � ������� ��������� ripoffline � ���������� �������� �������������� �� ������ �������� ��������� setyx, � ������������ ��� ���-��,
�� �������� y ������ ���� ��������������� �����
����������� �������� stdscr->_yoffset.
�������, ��� getsyx �������� ��������.
-
setsyx (y, x)
-
����������� ������ ��������������� � ������� (y,
x). ���� ��� �������� y � x ����� -1, �� ��������������� ����� leaveok. ��� ��������� getsyx �
setsyx ������� ��� ����, ����� ������������ ��������� ����� �������������� ������, �� �������� ������� ������� �������. ������������ ��������� ������� �������� getsyx, ����� ���������� �����������
��� ������, �������� ��� ���������� ����
wnoutrefresh, ����� ���� �������� setsyx � ����������� ������� doupdate.
-
ripoffline (line, init)
-
��� ��������� ��������� ��������� ������ ������,
�� ���������� ��������� slk_init. ���������
ripoffline ���������� �������� ������ ��������
initscr � newterm. ���� �������� line ������������, ��������� ���� ������ ������ ���� sdtscr, ����
������������ - ��������� ������ �����. ����� �����
�� ��������� initscr ���������� ��������� init �
����� �����������: ���������� �� ��������� ����
��������� ������ � ������� ����� ���� � ��������.
��� ������ ������ ��������� �� ������������� ������������ ���������� ���������� LINES � COLS (������������ � <curses.h>), ����� ����, �� ���� ��������� ������ ���������� � ���������� wrefresh �
doupdate, �� ����� ���������� � wnoutrefresh.
����� ���������� � initscr ��� newterm ���������
ripoffline ����� �������� ��������� ��� (�� ����).
-
scr_dump (filename)
-
������� ��������� ������������ ������ ������������
� ���� filename.
-
scr_restore (filename)
-
������� ��������� ������������ ������ ����������������� �� ����� filename, ���� ��� ������ ����
�������������� �������� �������� scr_dump. �����
�������������� ���������� ������� ���������
doupdate ��� ����������� ���������������� ���������.
-
scr_init (filename)
-
���������� ����� filename ������������ ��� ��������� ���������� � ���, ��� ���������� �� ������.
���� ������ ������� �������� �� ������������, ��
curses ��� ��������� ����������� ������ ����������
���������� ����������. ��������� scr_init ������
������������ ����� initscr � ����� ���������� ������ system(3S) ��� ���������� ��������� ������,
��������������� ������ ���������, ������� ������
��������������, ����� ��������� � endwin, ���������� � scr_dump. �������� �� ������������ ����������� � �������� ������� ����������� ����� � ���������� ������, ����� ���� � ���� ������
terminfo(4) ��� ������� ��������� ������ �������������� �������������� nrrmc.
-
curs_set (visibility)
-
������ �������� ���������, ���������� ��� �����
�����, ���� �������� visibility �����, ��������������, 0, 1 ��� 2.
-
draino (ms)
-
���������, ���� ���� �������������� ����� �� �����
�� ����� ����� ��������, �� ���� �� ��� ���������
��������� �� ����� ms �����������.
-
garbagedlines (win, begline, numlines)
-
��� ��������� �������� ������ curses, ��� �����
�������� � ������ ���� �����������. ��� ����� ����
������������, ��������, ��������� �����������,
�������� ������� ��� ����������� ��������� ������.
�������� ������� ���������, ���� �������� ����������� �� �����, �� ������� ����� �����, ������
������ ����������� ������ �������� � ��� �������
�����. ����������� ����� ������ ���� �����������
���������, ��� ��� ����� ��������� ���������.
-
napms (ms)
-
����� �� ms �����������.
��������� ������ terminfo
������ ��������� ������������ �����������, ������� ��������� ������ ��������������� � ����� ������
terminfo(4) ��� ��������� ������������� ������������
����������, ��������, ���������������� ��������������
����������. � ��������� ������� ������������� ������������ ������ ����������� ������ curses, ���������� ����.
������� ������ ���� ������� ��������� setupterm (���
��������� ������������� ���������� ����������� initscr
� newterm. � ��� ������������� �������� ���� ����������, ������������ � terminfo(4). �������� ����������
terminfo(4) lines � columns ������������� ��������� �������: ���� ���������� ���������� ��������� LINES �
COLUMNS, ������������ �� ��������. ����� ������������
��������, �������� � ���� ������ terminfo(4).
��� ����, ����� ��������� ����� ������ �� ���� ����������� ����������, ��������, ������ � ������, � ���
������ ���� �������� ����� <curses.h> � � ��������� �������. ����������������� ������� ������ ����
���������������� ���������� tparm. ��� �������
terminfo(4), ������� �������, �������� ��� tparm, ������ ���������� �� ����� ����������� tputs ��� putp. ����� ����������� ���������� ������� ���������
reset_shell_mode ��� �������������� ������������� ���������. ���������, � ������� ������������ ���������
�������, ������ ������� ������� enter_ca_mode � ������
������ � ������� exit_ca_mode ����� ������ ������ [��.
terminfo(4)]. ���������, ����������������� ������ ������������ �������� shell, ������ ������� ���������
reset_shell_mode � ������� ������� exit_ca_mode �����
�������� shell, � ����� ���������� ������������ �������� ���������� ������� ������� enter_ca_mode � �������
��������� reset_prog_mode. �������� �������� �� �������
���� ��������� �� ����������� ��������� ��� ������
curses [��. endwin].
-
setupterm (term, fildes, erret)
-
������ ���� ������ terminfo(4), ��������������
��������� ������ terminfo(4). ��������� ����������
������� ��� ������ curses ��� ���� �� ���������������. ��� ��������� �������� ���������� term, ���������� �������� ��������. ���� �������� term
����� NULL, ������������ �������� ���������� ��������� TERM. ����� ������� � ���� � ������������
fildes. ���� �������� erret �� ����� NULL, ��
setupterm ��������� �������� OK ��� ERR � ��������
� ���������� *erret ��� ����������. ���, ������ 1,
�������� ���������� ����������, 0 ��������, ���
�������� �� ������ � ���� ������, -1 ��������, ���
�� ������� ����� ���� ���� ������ terminfo(4). ���� �������� erret ����� NULL, �� � ������ �������
������ setupterm ���������� ��������� � ��� � �������� ���������. ����� �������, ����� ������� �����, ��� ������� ������������ ������ ��������������� ��������, �������� ��������� �������:
setupterm ((char *) 0, 1, (int *) 0)
��� ���������� terminfo(4) ������, ��������� �
����������� ���� ����������� � ��������� ����
TERMINAL. ����� ��������� ���������� ���������
setupterm ���������� ���������� cur_term ����
TERMINAL * ������������� �������� ��������� �� ����������� ���������. ���� ��������� ����� ����
�������� ����� ��������� ������� setupterm. ��������� ����� setupterm ��������� � ������ �����
��������� � ���������� ����� ���������� � �����
�����.
-
set_curterm (nterm)
-
�������� nterm ����� ��� TERMINAL *. ���������
set_curterm ����������� ���������� cur_term �������� nterm, ����� ����� ��� ���������� terminfo(4)
�������� ��������, �������� ��� nterm.
-
del_curterm (oterm)
-
�������� oterm ����� ��� TERMINAL *. ���������
del_curterm ����������� ������, ������� ����������, �� ������� ��������� oterm. ���� oterm ��������� � cur_term, �� ����� ����� ������ ����������
�� � ����� ���������� terminfo(4) �� ��� ���, ����
����� �� ����� ������� ��������� setupterm.
-
restartterm (term, fildes, erret)
-
�� ��, ��� � setupterm ����� �������������� ������.
-
char *tparm (str, p1, p2, p3, p4, p5, p6, p7, p8, p9)
-
����������� � ������� str ��������� p1, p2, ...
p9. ������������ ��������� �� ������� � �������������� �����������.
-
tputs (str, count, putc)
-
���������, ���� ����, ����������� � ������� str �
������� ��. ������� str ������ ���� ��������� ����� ���� ���������� ���������� terminfo(4), ����
����������� ������ �������� tparm, tsgetstr,
tigetstr ��� tgoto. �������� count ������ ���������� �����, ������� ������������� �������; ����
��� ����������, �������� 1. �������� putc - ���
���������, ����������� putchar(3S). ���� ���������
������� ���������� ���������������.
-
putp (str)
-
���������, ���������� tputs (str, 1, putchar).
-
vidputs (attrs, putc)
-
������� �������, ����������� �������� � ����� ������������ �������� � ���������� attrs - ����������� ���������, ��������� ����, � ������� ��������. ������� ���������� ��������� putc, �����������
putchar(3S).
-
mvcur (oldrow, oldcol, newrow, newcol)
-
��������� ������� ������ ��� ����������� �������.
��������� ��������� ���������� �������� �������������,
������� ���������� �� � �������� ����������, ��������
xenl.
-
tigetflag (capname)
-
���� capname �� �������� ������� ���������������,
������������ �������� -1.
-
tigetnum (capname)
-
���� capname �� �������� �������� ���������������,
������������ �������� -2.
-
char *tigetstr (capname)
-
���� capname �� �������� ���������� ���������������, ������������ �������� (char*) -1.
-
char *boolnames [ ], *boolcodes [ ], *boolfnames [ ]
char *numnames [ ], *numcodes [ ], *numfnames [ ]
char *strnames [ ], *strcodes [ ], strfnames [ ] -
��� �������, ������������� �������� �������, �������� �����, ���� termcap � ������� C-����� ���
������ ���������� terminfo(4).
�������� termcap
������ ��������� �������� ��� ����, ����� ���������
�������������� ��������, �������������� ����������
termcap. ��������� � ��� �������� ��������, �� ������
��� ����������� ����� ���� ������ terminfo(4).
-
tgetent (bp, name)
-
����� ������� termcap ��� ����� name. ��� ��������
�������� bp ������������.
-
tgetflag (codename)
-
�������� ������ �������� �������� codename.
-
tgetnum (codename)
-
�������� �������� �������� �������� codename.
-
char *tgetnum (codename, area)
-
�������� ���������� �������� �������� codename.
���� ��������� area �� ����� NULL, �� ��������� ��
�� �������� � �����, �� ������� ��������� *area, �
���������� *area. ��� ������ ������������ �������
�������� ���������� ������������ ��������� tputs.
-
char *tgoto (cap, col, row)
-
���������� ��������� � ��������� �������. ��� ������ ������������ ������� �������� ���������� ������������ ��������� tputs.
-
tputs (str, count, putc)
-
��. ���� ������ ��������� ������ terminfo.
�������������� ���������
-
traceoff ( )
traceon ( ) -
�������� � ��������� �������������� ������ ���������� ������ ���������� curses (/usr/lib/
libdcurses.a). ��� ���������� �������� ������ ���,
��� �������� �������� �� �������� ������ ������
curses.
-
unctrl (c)
-
���� ������ ����������� ������ � �������, ���������� ��� �������� �������������. ����������� ������� ������������ � ���� ^X. �������� ������� �� ����������.
�������, ��� unctrl - ��� ������, ������������ �
����� <unctrl.h>, ������������� �������������� �
<curses.h>.
-
char *keyname (c)
-
������������ ������� ��������, ���������������
������� c.
-
filter ( )
- ������ ��������� �������� ����� �� ���, �������
������ ���������� ����� initscr. ����� ���� ��������� ��������, ��� � �������� ������ curses �����
��������� ������� ��������� ������. � ����������
��������� ������ �� ����� ������������ ������������ ���������, ��������������� ������ ������ ������ �� ������.
������������� curscr
�������� curscr ����� �������������� ������ �����������
�����������. ���� ���������� � ��������� clearok � ���������� curscr, �� ��������� ��������� � wrefresh ���
������ ���� �������� � ������� ������ � ����� ��� ������ �����������. ���� ���������� � ��������� wrefresh �
���������� curscr, �� ����� ���������� ��������� � ������������. ������ ��� ����������� �������� ������������ ����������� ������. ���� curscr ����������� � �������� ��������� �������� overlay, overwite ���
copywin, �� ������ ������������ � �������� ���������
������������ ������ ���������.
���������� ���������
��������� ��������� ��������� ������ ��� ����, �����
���������� ������������� � �����������, ����������� ���
������ ������ ������ curses. ��� ��� ����� ���� �������� ���������� �����������:
crmode ( ) | ���������� �� cbreak ( )
|
fixterm ( ) | ���������� �� reset_prog_mode ( )
|
gettmode ( ) | ���������� �� ������ ���������
|
nocrmode ( ) | ���������� �� nocbreak ( )
|
resetterm ( ) | ���������� �� reset_shell_mode ( )
|
saveterm ( ) | ���������� �� def_prog_mode ( )
|
setterm ( ) | ���������� �� setupterm ( )
|
��������
��������� �������� ������������, ������������ � �����
<curses.h>, ����� ������������ � �������� ����������
���������� attron, attroff � attrset. �� ����� �����
�������� (��������� ���������� ���) � ��������, ������������ ��������� addch.
-
A_STANDOUT
-
�����, � ������� ����� ����� �������� ���������,
������������ ��������.
-
A_UNDERLINE
-
�������������.
-
A_REVERSE
-
��������.
-
A_BLINK
-
��������.
-
A_DIM
-
���������� �������.
-
A_BOLD
-
��������� - �������� ��� ���������� �������.
-
A_ALTCHARSET
-
�������������� ����� ��������.
-
A_CHARTEXT
-
������ ����� ��� ��������� ���� ������� [��.
winch].
-
A_ATTRIBUTES
-
������ ����� ��� ��������� ��������� [��. winch].
-
A_NORMAL
-
������ ����� ��� ������ ���� ��������� (��������,
attrset (A_NORMAL)).
�������������� �������
��������� ���� �������������� ������, ������������ �
����� <curses.h>, ����� ���� ���������� ����������
getch, ���� ���������� ����� keypad. �������, ��� ��
��� ������� �� ���������� ��������� ����� ��������������, �������� ���� ��� �� �������� ���������� �����, �
����� ���� ����������� ������� ����������� � ���� ������ terminfo(4).
�������� | �������� | ��������
|
---|
KEY_BREAK | 0401 | ������� ���������� (���������)
|
KEY_DOWN | 0402 | ������� ����
|
KEY_UP | 0403 | ������� �����
|
KEY_LEFT | 0404 | ������� �����
|
KEY_RIGHT | 0405 | ������� ������
|
KEY_HOME | 0406 | HOME (������� �����-�����)
|
KEY_BACKSPACE | 0407 | �����
|
KEY_F0 | 0410 | F0
|
KEY_Fn | KEY_F0+n | Fn, ���� ����� ��� 64 ������
|
KEY_DL | 0510 | DL, �������� ������
|
KEY_IL | 0511 | IL, ������� ������
|
KEY_DC | 0512 | DC, �������� �������
|
KEY_IC | 0513 | IC, ������� �������
|
KEY_EIC | 0514 | ����� �� ������ �������
|
KEY_CLEAR | 0515 | ������� ������
|
KEY_EOS | 0516 | ������� ����� ������
|
KEY_EOL | 0517 | ������� ����� ������
|
KEY_SF | 0520 | ������������ �� ������ ������
|
KEY_SR | 0521 | ������������ �� ������ �����
|
KEY_NPAGE | 0522 | ��������� ��������
|
KEY_PPAGE | 0523 | ���������� ��������
|
KEY_STAB | 0524 | ���������� ������� ���������
|
KEY_CTAB | 0525 | ����� ������� ���������
|
KEY_CATAB | 0526 | ����� ��� ������� ���������
|
KEY_ENTER | 0527 | ENTER, ����
|
KEY_SRESET | 0530 | ������ �����
|
KEY_RESET | 0531 | ������� �����
|
KEY_LL | 0533 | ������� �����-����
|
�������������� ���������� �������� ��������� �������:
|
---|
A1 ����� C1 | ����� B2 ���� | A3 ������ C3
|
---|
KEY_A1 | 0534 | A1
|
KEY_A3 | 0535 | A3
|
KEY_B2 | 0536 | B2
|
KEY_C1 | 0537 | C1
|
KEY_C3 | 0540 | C3
|
KEY_BTAB | 0541 | �������� ���������
|
KEY_BEG | 0542 | BEG
|
KEY_CANCEL | 0543 | CANCEL
|
KEY_CLOSE | 0544 | CLOSE
|
KEY_COMMAND | 0545 | CMD
|
KEY_COPY | 0546 | COPY
|
KEY_CREATE | 0547 | CREATE
|
KEY_END | 0550 | END
|
KEY_EXIT | 0551 | EXIT
|
KEY_MARK | 0554 | MARK
|
KEY_MESSAGE | 0555 | MESSAGE
|
KEY_MOVE | 0556 | MOVE
|
KEY_NEXT | 0557 | NEXT
|
KEY_OPEN | 0560 | OPEN
|
KEY_OPTIONS | 0561 | OPTIONS
|
KEY_PREVIOUS | 0562 | PREVIOUS
|
KEY_REDO | 0563 | REDO
|
KEY_REFERENCE | 0564 | REFERENCE
|
KEY_REFRESH | 0565 | REFRESH
|
KEY_REPLACE | 0566 | REPLACE
|
KEY_RESTART | 0567 | RESTART
|
KEY_RESUME | 0570 | RESUME
|
KEY_SAVE | 0571 | SAVE
|
KEY_SBEG | 0572 | SHIFT+BEG
|
KEY_SCANCEL | 0573 | SHIFT+CANCEL
|
KEY_SCOMMAND | 0574 | SHIFT+COMMAND
|
KEY_SCOPY | 0575 | SHIFT+COPY
|
KEY_SCREATE | 0576 | SHIFT+CREATE
|
KEY_SDC | 0577 | SHIFT+"������� ������"
|
KEY_SDL | 0600 | SHIFT+"������� ������"
|
KEY_SELECT | 0601 | SELECT
|
KEY_SEND | 0602 | SEND
|
KEY_SEOL | 0603 | SHIFT+EOL
|
KEY_SEXIT | 0604 | SHIFT+EXIT
|
KEY_SFIND | 0605 | SHIFT+FIND
|
KEY_SHELP | 0606 | SHIFT+HELP
|
KEY_SHOME | 0607 | SHIFT+HOME
|
KEY_SIC | 0610 | SHIFT+"�������� ������"
|
KEY_SLEFT | 0611 | SHIFT+"������� �����"
|
KEY_SMESSAGE | 0612 | SHIFT+MESSAGE
|
KEY_SMOVE | 0613 | SHIFT+MOVE
|
KEY_SNEXT | 0614 | SHIFT+NEXT
|
KEY_SOPTIONS | 0615 | SHIFT+OPTIONS
|
KEY_SPREVIOUS | 0616 | SHIFT+PREVIOUS
|
KEY_SPRINT | 0617 | SHIFT+PRINT
|
KEY_SREDO | 0620 | SHIFT+REDO
|
KEY_SREPLACE | 0621 | SHIFT+REPLACE
|
KEY_SRIGHT | 0622 | SHIFT+"������� ������"
|
KEY_SRSUME | 0623 | SHIFT+RESUME
|
KEY_SSAVE | 0624 | SHIFT+SAVE
|
KEY_SSUSPEND | 0625 | SHIFT+SUSPEND
|
KEY_SUNDO | 0626 | SHIFT+UNDO
|
KEY_SUSPEND | 0627 | SUSPEND
|
KEY_UNDO | 0630 | UNDO
|
�������������
��������� ���������� ����� ���� ������������ ��� ��������� ������� �� ������ ��������� � ������� ���������
waddch. ���� ��������������� ������ ����� ���� �������
�� ��������, �������� ���������� ����� ����� ������������� ��� A_ALTCHARSET. � ��������� ������ ����������
����� ��������������� ��������. ��������� ������ ���
������ �������� ��������� ����������� ��������� vt100.
��� | ������ �� ��������� | ��������
|
---|
ACS_ULCORNER | + | ����� ������� ����
|
ACS_LLCORNER | + | ����� ������ ����
|
ACS_URCORNER | + | ������ ������� ����
|
ACS_LRCORNER | + | ������ ������ ����
|
ACS_RTEE | + | ������ ����
|
ACS_LTEE | + | ����� ����
|
ACS_BTEE | + | ������ ����
|
ACS_TTEE | + | ������� ����
|
ACS_HLINE | - | �����������
|
ACS_VLINE | | | ���������
|
ACS_PLUS | + | �����
|
ACS_S1 | - | �������������
|
ACS_S9 | _ | �������������
|
ACS_DIAMOND | + | �����
|
ACS_CKBOARD | : | ������
|
ACS_DEGREE | ' | ���� �������
|
ACS_PLMINUS | # | ����/�����
|
ACS_BULLET | o | ������������
|
ACS_LARROW | < | ������� �����
|
ACS_RARROW | > | ������� ������
|
ACS_DARROW | v | ������� ����
|
ACS_UARROW | ^ | ������� �����
|
ACS_BOARD | # | ��������
|
ACS_LANTERN | # | �������
|
ACS_BLOCK | # | �������� ����
|
�����������
��� ���������, ��� ������� ��� �������� �� �������
������������ ��������, ���������� ����� �������� OK ���
�������� ���������� � ERR ��� �������.
��� ������� ���������� �������� �� ��, ��� � ��������������� w-���������, ����� setscrreg, wsetscrreg,
getsyx, getyx, getbegy, getmaxyx, ������������ ��������
������� ������� ����.
� ������ ������ ��������� ��������, ������������ ��������-���������, ����� (��� *) NULL.
��������
� ��������� ����� ��� ������������� ������ curses ���������� ������������ �������� ����� ����� ������ ���
�������� � �������� ������� �������, ���� �� ����� �������� �����������. �������� ����� ���������� ����� ������� ������ wgetch. � ����������, ����� �������� ��������������� ��������� �� ������� ���� ������������ �������, ��� ����� ��������. ���������, ������� ������������ ���� �� ������ curses � ���� �����������, ������
������� typeahead (-1) ��� ���������� �������� �����.
�������� ������� napms � ��������� ����� ����������� ��
���������� ������ ����� ������.
��������� draino (ms) ��������, ������ ���� �������� ms
����� 0.
���������������
��� ������ ������������ ������� 3.1 ���������� ������������ ������� curses ������ 3.1. ���������, �������������� ����� curses � ������������ ������� ������ 2 ���
���������� � ������������ ������� ������ 3.1 �������
���������� �� ������ ������ � ����� �����������
libcurses.a ������ 3.1. ���� ���� ��������� �� ���������� ������ ������������� ������ ������ 3.1, �� �� ������ ����� ����� ������� � ����������� ������ 2 � ��������� � ������������ ������� ������ 2.
���������� plot(3X) � curses(3X) ���������� ����������
����� �������� erase � move, ������ ������ ������
curses �������� ���������. ���� ��� ��������� ��������
� ������ ������������, �� ��������������� ���������
����� ��������� � ������ �������� ����� ��� ������������ � ������, ���������� � ������� plot(3X), ���������
#undef move � #undef erase.
����� �������� initscr � endwin �������� �� ����� �����
������ � ������� �������� ������ curses. �������������
��� ���� ����� �������� ������������ ������ �����/������ [��. stdio(3S)] ����� �������� � ��������������� �����������.
��. �����
ioctl(2), plot(3X), putc(3S), scanf(3S), stdio(3S),
system(3S), vprintf(3S), profile(4), term(4),
terminfo(4), varargs(5).
cc(1), ld(1) � ����������� ������������.
termio(7), tty(7) � ����������� ��������������.