


      CCCCUUUURRRRSSSSEEEESSSS((((3333XXXX))))                  ((((UUUUNNNNIIIIXXXX 5555....2222))))                 CCCCUUUURRRRSSSSEEEESSSS((((3333XXXX))))



      NNNNAAAAMMMMEEEE
           curses - CRT screen handling and optimization package

      SSSSYYYYNNNNTTTTAAAAXXXX
           ####iiiinnnncccclllluuuuddddeeee <<<<ccccuuuurrrrsssseeeessss....hhhh>>>>
           cccccccc [ flags ] files ----llllccccuuuurrrrsssseeeessss [ libraries ]

      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
           These routines give the user a method of updating screens
           with reasonable optimization.  In order to initialize the
           routines, the routine _i_n_i_t_s_c_r() must be called before any of
           the other routines that deal with windows and screens are
           used.  The routine _e_n_d_w_i_n() should be called before exiting.
           To get character-at-a-time input without echoing, (most
           interactive, screen oriented-programs want this) after
           calling _i_n_i_t_s_c_r() you should call ``_n_o_n_l(); _c_b_r_e_a_k();
           _n_o_e_c_h_o();''

           The full curses interface permits manipulation of data
           structures called _w_i_n_d_o_w_s which can be thought of as two
           dimensional arrays of characters representing all or part of
           a CRT screen.  A default window called ssssttttddddssssccccrrrr is supplied,
           and others can be created with nnnneeeewwwwwwwwiiiinnnn.  Windows are referred
           to by variables declared ``WINDOW *'', the type WINDOW is
           defined in curses.h to be a C structure.  These data
           structures are manipulated with functions described below,
           among which the most basic are mmmmoooovvvveeee, and aaaaddddddddcccchhhh.  (More
           general versions of these functions are included with names
           beginning with `w', allowing you to specify a window.  The
           routines not beginning with `w' affect ssssttttddddssssccccrrrr.) Then
           _r_e_f_r_e_s_h() is called, telling the routines to make the users
           CRT screen look like ssssttttddddssssccccrrrr.

           If the environment variable TERMINFO is defined, any program
           using curses will check for a local terminal definition
           before checking in the standard place.  For example, if the
           standard place is ////uuuussssrrrr////lllliiiibbbb////tttteeeerrrrmmmmiiiinnnnffffoooo, and TERM is set to
           ``vt100'', then normally the compiled file is found in
           ////uuuussssrrrr////lllliiiibbbb////tttteeeerrrrmmmmiiiinnnnffffoooo////vvvv////vvvvtttt111100000000.  (The ``v'' is copied from the
           first letter of ``vt100'' to avoid creation of huge
           directories.) However, if TERMINFO is set to
           ////uuuussssrrrr////mmmmaaaarrrrkkkk////mmmmyyyytttteeeerrrrmmmmssss, curses will first check
           ////ooooppppuuuussssrrrr////mmmmaaaarrrrkkkk////mmmmyyyytttteeeerrrrmmmmssss////vvvv////vvvvtttt111100000000, and if that fails, will then
           check ////uuuussssrrrr////lllliiiibbbb////tttteeeerrrrmmmmiiiinnnnffffoooo////vvvv////vvvvtttt111100000000.  This is useful for
           developing experimental definitions or when write permission
           in ////uuuussssrrrr////lllliiiibbbb////tttteeeerrrrmmmmiiiinnnnffffoooo is not available.

      SSSSEEEEEEEE AAAALLLLSSSSOOOO
           terminfo(4).

      FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNNSSSS
           Routines listed here may be called when using the full



      Page 1                                                   (9010-E)






      CCCCUUUURRRRSSSSEEEESSSS((((3333XXXX))))                  ((((UUUUNNNNIIIIXXXX 5555....2222))))                 CCCCUUUURRRRSSSSEEEESSSS((((3333XXXX))))



           curses.

           addch(ch)                add a character to _s_t_d_s_c_r
                                    (like putchar) (wraps to next
                                    line at end of line)
           addstr(str)              calls addch with each character in _s_t_r
           attroff(attrs)           turn off attributes named
           attron(attrs)            turn on attributes named
           attrset(attrs)           set current attributes to _a_t_t_r_s
           baudrate()               current terminal speed
           beep()                   sound beep on terminal
           box(win, vert, hor)      draw a box around edges of _w_i_n
                                    _v_e_r_t and _h_o_r are chars to use for vert.
                                    and hor. edges of box
           clear()                  clear _s_t_d_s_c_r
           clearok(win, bf)         clear screen before next redraw of _w_i_n
           clrtobot()               clear to bottom of _s_t_d_s_c_r
           clrtoeol()               clear to end of line on _s_t_d_s_c_r
           cbreak()                 set cbreak mode
           delay_output(ms)         insert ms millisecond pause in output
           delch()                  delete a character
           deleteln()               delete a line
           delwin(win)              delete _w_i_n
           doupdate()               update screen from all wnooutrefresh
           echo()                   set echo mode
           endwin()                 end window modes
           erase()                  erase _s_t_d_s_c_r
           erasechar()              return user's erase character
           fixterm()                restore tty to "in curses" state
           flash()                  flash screen or beep
           flushinp()               throw away any typeahead
           getch()                  get a char from tty
           getstr(str)              get a string through _s_t_d_s_c_r
           gettmode()               establish current tty modes
           getyx(win, y, x)         get (y, x) co-ordinates
           has_ic()                 true if terminal can do insert character
           has_il()                 true if terminal can do insert line
           idlok(win, bf)           use terminal's insert/delete line if bf != 0
           inch()                   get char at current (y, x) co-ordinates
           initscr()                initialize screens
           insch(c)                 insert a char
           insertln()               insert a line
           intrflush(win, bf)       interrupts flush output if bf is TRUE
           keypad(win, bf)          enable keypad input
           killchar()               return current user's kill character
           leaveok(win, flag)       OK to leave cursor anywhere after refresh if
                                    flag!=0 for _w_i_n, otherwise cursor must be left
                                    at current position.
           longname()               return verbose name of terminal
           meta(win, flag)          allow meta characters on input if flag != 0
           move(y, x)               move to (y, x) on _s_t_d_s_c_r
           mvaddch(y, x, ch)        move(y, x) then addch(ch)



      Page 2                                                   (9010-E)






      CCCCUUUURRRRSSSSEEEESSSS((((3333XXXX))))                  ((((UUUUNNNNIIIIXXXX 5555....2222))))                 CCCCUUUURRRRSSSSEEEESSSS((((3333XXXX))))



           mvaddstr(y, x, str)      similar...
           mvcur(oldrow, oldcol, newrow, newcol)
                                    low level cursor motion
           mvdelch(y, x)            like delch, but move(y, x) first
           mvgetch(y, x)            etc.
           mvgetstr(y, x)
           mvinch(y, x)
           mvinsch(y, x, c)
           mvprintw(y, x, fmt, args)
           mvscanw(y, x, fmt, args)
           mvwaddch(win, y, x, ch)
           mvwaddstr(win, y, x, str)
           mvwdelch(win, y, x)
           mvwgetch(win, y, x)
           mvwgetstr(win, y, x)
           mvwin(win, by, bx)
           mvwinch(win, y, x)
           mvwinsch(win, y, x, c)
           mvwprintw(win, y, x, fmt, args)
           mvwscanw(win, y, x, fmt, args)
           newpad(nlines, ncols)    create a new pad with given dimensions
           newterm(type, fd)        set up new terminal of given type to output on fd
           newwin(lines, cols, begin_y, begin_x)
                                    create a new window
           nl()                     set newline mapping
           nocbreak()               unset cbreak mode
           nodelay(win, bf)         enable nodelay input mode through getch
           noecho()                 unset echo mode
           nonl()                   unset newline mapping
           noraw()                  unset raw mode
           overlay(win1, win2)      overlay win1 on win2
           overwrite(win1, win2)    overwrite win1 on top of win2
           pnoutrefresh(pad, pminrow, pmincol, sminrow,
           smincol, smaxrow, smaxcol)
                                    like prefresh but with no output until doupdate called
           prefresh(pad, pminrow, pmincol, sminrow,
           smincol, smaxrow, smaxcol)
                                    refresh from pad starting with given upper left
                                    corner of pad with output to given
                                    portion of screen
           printw(fmt, arg1, arg2, ...)
                                    printf on _s_t_d_s_c_r
           raw()                    set raw mode
           refresh()                make current screen look like _s_t_d_s_c_r
           resetterm()              set tty modes to "out of curses" state
           resetty()                reset tty flags to stored value
           saveterm()               save current modes as "in curses" state
           savetty()                store current tty flags
           scanw(fmt, arg1, arg2, ...)
                                    scanf through _s_t_d_s_c_r
           scroll(win)              scroll _w_i_n one line
           scrollok(win, flag)      allow terminal to scroll if flag != 0



      Page 3                                                   (9010-E)






      CCCCUUUURRRRSSSSEEEESSSS((((3333XXXX))))                  ((((UUUUNNNNIIIIXXXX 5555....2222))))                 CCCCUUUURRRRSSSSEEEESSSS((((3333XXXX))))



           set_term(new)            now talk to terminal new
           setscrreg(t, b)          set user scrolling region to lines t through b
           setterm(type)            establish terminal with given type
           setupterm(term, filenum, errret)
           standend()               clear standout mode attribute
           standout()               set standout mode attribute
           subwin(win, lines, cols, begin_y, begin_x)
                                    create a subwindow
           touchwin(win)            change all of _w_i_n
           traceoff()               turn off debugging trace output
           traceon()                turn on debugging trace output
           typeahead(fd)            use file descriptor fd to check typeahead
           unctrl(ch)               printable version of _c_h
           waddch(win, ch)          add char to _w_i_n
           waddstr(win, str)        add string to _w_i_n
           wattroff(win, attrs)     turn off _a_t_t_r_s in _w_i_n
           wattron(win, attrs)      turn on _a_t_t_r_s in _w_i_n
           wattrset(win, attrs)     set attrs in _w_i_n to _a_t_t_r_s
           wclear(win)              clear _w_i_n
           wclrtobot(win)           clear to bottom of _w_i_n
           wclrtoeol(win)           clear to end of line on _w_i_n
           wdelch(win, c)           delete char from _w_i_n
           wdeleteln(win)           delete line from _w_i_n
           werase(win)              erase _w_i_n
           wgetch(win)              get a char through _w_i_n
           wgetstr(win, str)        get a string through _w_i_n
           winch(win)               get char at current (y, x) in _w_i_n
           winsch(win, c)           insert char into _w_i_n
           winsertln(win)           insert line into _w_i_n
           wmove(win, y, x)         set current (y, x) co-ordinates on _w_i_n
           wnoutrefresh(win)        refresh but no screen output
           wprintw(win, fmt, arg1, arg2, ...)
                                    printf on _w_i_n
           wrefresh(win)            make screen look like _w_i_n
           wscanw(win, fmt, arg1, arg2, ...)
                                    scanf through _w_i_n
           wsetscrreg(win, t, b)    set scrolling region of _w_i_n
           wstandend(win)           clear standout attribute in _w_i_n
           wstandout(win)           set standout attribute in _w_i_n

      TTTTEEEERRRRMMMMIIIINNNNFFFFOOOO LLLLEEEEVVVVEEEELLLL RRRROOOOUUUUTTTTIIIINNNNEEEESSSS
           These routines should be called by programs wishing to deal
           directly with the terminfo database.  Due to the low level
           of this interface, it is discouraged.  Initially, _s_e_t_u_p_t_e_r_m
           should be called.  This will define the set of terminal
           dependent variables defined in terminfo(4).  The include
           files <curses.h> and <term.h> should be included to get the
           definitions for these strings, numbers, and flags.
           Parmeterized strings should be passed through _t_p_a_r_m to
           instantiate them.  All terminfo strings (including the
           output of tparm) should be printed with _t_p_u_t_s or _p_u_t_p .
           Before exiting, _r_e_s_e_t_t_e_r_m should be called to restore the



      Page 4                                                   (9010-E)






      CCCCUUUURRRRSSSSEEEESSSS((((3333XXXX))))                  ((((UUUUNNNNIIIIXXXX 5555....2222))))                 CCCCUUUURRRRSSSSEEEESSSS((((3333XXXX))))



           tty modes.  (Programs desiring shell escapes or suspending
           with control Z can call _r_e_s_e_t_t_e_r_m before the shell is called
           and _f_i_x_t_e_r_m after returning from the shell.)
           fixterm()                restore tty modes for terminfo use
                                    (called by setupterm)
           resetterm()              reset tty modes to state before program entry
           setupterm(term, fd, rc)  read in database.  Terminal type is the
                                    character string _t_e_r_m, all output is to UNIX
                                    System file descriptor _f_d.  A status value is
                                    returned in the integer pointed to by _r_c: 1
                                    is normal.  The simplest call would be
                                    _s_e_t_u_p_t_e_r_m(_0, _1, _0) which uses all defaults.
           tparm(str, p1, p2, ..., p9)
                                    instantiate string str with parms p9i8.
           tputs(str, affcnt, putc) apply padding info to string _s_t_r.
                                    _a_f_f_c_n_t is the number of lines affected,
                                    or 1 if not applicable.  _P_u_t_c is a
                                    putchar-like function to which the characters
                                    are passed, one at a time.
           putp(str)                handy function that calls tputs
                                    (str, 1, putchar)
           vidputs(attrs, putc)     output the string to put terminal in video
                                    attribute mode _a_t_t_r_s, which is any
                                    combination of the attributes listed below.
                                    Chars are passed to putchar-like
                                    function _p_u_t_c.
           vidattr(attrs)           Like vidputs but outputs through
                                    putchar

      TTTTEEEERRRRMMMMCCCCAAAAPPPP CCCCOOOOMMMMPPPPAAAATTTTIIIIBBBBIIIILLLLIIIITTTTYYYY RRRROOOOUUUUTTTTIIIINNNNEEEESSSS
           These routines were included as a conversion aid for
           programs that use termcap.  Their parameters are the same as
           for termcap.  They are emulated using the _t_e_r_m_i_n_f_o database.
           They may go away at a later date.
           tgetent(bp, name)        look up termcap entry for name
           tgetflag(id)             get boolean entry for id
           tgetnum(id)              get numeric entry for id
           tgetstr(id, area)        get string entry for id
           tgoto(cap, col, row)     apply parms to given cap
           tputs(cap, affcnt, fn)   apply padding to cap calling fn as putchar

      AAAATTTTTTTTRRRRIIIIBBBBUUUUTTTTEEEESSSS
           The following video attributes can be passed to the
           functions _a_t_t_r_o_n,_a_t_t_r_o_f_f,_a_t_t_r_s_e_t.
           A_STANDOUT     Terminal's best highlighting mode
           A_UNDERLINE    Underlining
           A_REVERSE      Reverse video
           A_BLINK        Blinking
           A_DIM          Half bright
           A_BOLD         Extra bright or bold
           A_BLANK        Blanking (invisible)
           A_PROTECT      Protected



      Page 5                                                   (9010-E)






      CCCCUUUURRRRSSSSEEEESSSS((((3333XXXX))))                  ((((UUUUNNNNIIIIXXXX 5555....2222))))                 CCCCUUUURRRRSSSSEEEESSSS((((3333XXXX))))



           A_ALTCHARSET   Alternate character set

      FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNN KKKKEEEEYYYYSSSS
           The following function keys might be returned by _g_e_t_c_h if
           _k_e_y_p_a_d has been enabled.  Note that not all of these are
           currently supported, due to lack of definitions in _t_e_r_m_i_n_f_o
           or the terminal not transmitting a unique code when the key
           is pressed.
           _N_a_m_e           _V_a_l_u_e    _K_e_y _n_a_m_e
           KEY_BREAK      0401     break key (unreliable)
           KEY_DOWN       0402     The four arrow keys ...
           KEY_UP         0403
           KEY_LEFT       0404
           KEY_RIGHT      0405     ...
           KEY_HOME       0406     Home key (upward+left arrow)
           KEY_BACKSPACE  0407     backspace (unreliable)
           KEY_F0         0410     Function keys.  Space for 64 is reserved.
           KEY_F(n)       (KEY_F0+(n))     Formula for fn.
           KEY_DL         0510     Delete line
           KEY_IL         0511     Insert line
           KEY_DC         0512     Delete character
           KEY_IC         0513     Insert char or enter insert mode
           KEY_EIC        0514     Exit insert char mode
           KEY_CLEAR      0515     Clear screen
           KEY_EOS        0516     Clear to end of screen
           KEY_EOL        0517     Clear to end of line
           KEY_SF         0520     Scroll 1 line forward
           KEY_SR         0521     Scroll 1 line backwards (reverse)
           KEY_NPAGE      0522     Next page
           KEY_PPAGE      0523     Previous page
           KEY_STAB       0524     Set tab
           KEY_CTAB       0525     Clear tab
           KEY_CATAB      0526     Clear all tabs
           KEY_ENTER      0527     Enter or send (unreliable)
           KEY_SRESET     0530     soft (partial) reset (unreliable)
           KEY_RESET      0531     reset or hard reset (unreliable)
           KEY_PRINT      0532     print or copy
           KEY_LL         0533     home down or bottom (lower left)

      WWWWAAAARRRRNNNNIIIINNNNGGGG
           The plotting library _p_l_o_t(3X) and the curses library
           _c_u_r_s_e_s(3X) both use the names erase() and move().  The
           curses versions are macros.  If you need both libraries, put
           the _p_l_o_t(3X) code in a different source file than the
           _c_u_r_s_e_s(3X) code, and/or #undef move() and erase() in the
           _p_l_o_t(3X) code.









      Page 6                                                   (9010-E)



