


curs_kernel(3X)                                   curs_kernel(3X)


NNAAMMEE
       ccuurrss__kkeerrnneell:         ddeeff__pprroogg__mmooddee,        ddeeff__sshheellll__mmooddee,
       rreesseett__pprroogg__mmooddee, rreesseett__sshheellll__mmooddee, rreesseettttyy, ssaavveettttyy,  ggeett--
       ssyyxx,  sseettssyyxx,  rriippoofffflliinnee,  ccuurrss__sseett,  nnaappmmss  -  low-level
       xxssccuurrsseess routines

SSYYNNOOPPSSIISS
       ##iinncclluuddee <<ccuurrsseess..hh>>

       iinntt ddeeff__pprroogg__mmooddee((vvooiidd));;
       iinntt ddeeff__sshheellll__mmooddee((vvooiidd));;
       iinntt rreesseett__pprroogg__mmooddee((vvooiidd));;
       iinntt rreesseett__sshheellll__mmooddee((vvooiidd));;
       iinntt rreesseettttyy((vvooiidd));;
       iinntt ssaavveettttyy((vvooiidd));;
       iinntt ggeettssyyxx((iinntt yy,, iinntt xx));;
       iinntt sseettssyyxx((iinntt yy,, iinntt xx));;
       iinntt rriippoofffflliinnee((iinntt lliinnee,, iinntt ((**iinniitt))((WWIINNDDOOWW **,, iinntt))));;
       iinntt ccuurrss__sseett((iinntt vviissiibbiilliittyy));;
       iinntt nnaappmmss((iinntt mmss));;

DDEESSCCRRIIPPTTIIOONN
       The following routines give low-level  access  to  various
       ccuurrsseess  capabilities.   Theses routines typically are used
       inside library routines.

       The ddeeff__pprroogg__mmooddee and  ddeeff__sshheellll__mmooddee  routines  save  the
       current  terminal  modes  as  the "program" (in ccuurrsseess) or
       "shell"  (not  in   ccuurrsseess)   state   for   use   by   the
       rreesseett__pprroogg__mmooddee  and  rreesseett__sshheellll__mmooddee  routines.  This is
       done automatically by iinniittssccrr.  There  is  one  such  save
       area for each screen context allocated by nneewwtteerrmm(()).

       The  rreesseett__pprroogg__mmooddee and rreesseett__sshheellll__mmooddee routines restore
       the terminal to "program" (in ccuurrsseess) or "shell"  (out  of
       ccuurrsseess)  state.   These  are  done automatically by eennddwwiinn
       and, after an eennddwwiinn, by ddoouuppddaattee, so  they  normally  are
       not called.

       The  rreesseettttyy  and  ssaavveettttyy  routines  save and restore the
       state of the terminal modes.  ssaavveettttyy  saves  the  current
       state  in  a buffer and rreesseettttyy restores the state to what
       it was at the last call to ssaavveettttyy.

       The ggeettssyyxx routine returns the current coordinates of  the
       virtual screen cursor in _y and _x.  If lleeaavveeookk is currently
       TTRRUUEE, then --11,--11 is returned.  If lines have been  removed
       from  the  top  of  the  screen, using rriippoofffflliinnee, _y and _x
       include these lines; therefore, _y and  _x  should  be  used
       only as arguments for sseettssyyxx.

       The sseettssyyxx routine sets the virtual screen cursor to _y, _x.
       If _y and _x are both --11, then lleeaavveeookk is set.  The two rou-
       tines  ggeettssyyxx  and  sseettssyyxx  are  designed  to be used by a



                                                                1





curs_kernel(3X)                                   curs_kernel(3X)


       library routine, which manipulates ccuurrsseess windows but does
       not  want  to change the current position of the program's
       cursor.  The library routine  would  call  ggeettssyyxx  at  the
       beginning,  do  its  manipulation of its own windows, do a
       wwnnoouuttrreeffrreesshh on its windows, call sseettssyyxx,  and  then  call
       ddoouuppddaattee.

       The  rriippoofffflliinnee routine provides access to the same facil-
       ity that ssllkk__iinniitt [see curs_slk(3X)] uses  to  reduce  the
       size  of  the  screen.   rriippoofffflliinnee  must be called before
       iinniittssccrr or nneewwtteerrmm is called.  If _l_i_n_e is positive, a line
       is  removed from the top of ssttddssccrr; if _l_i_n_e is negative, a
       line is removed from the bottom.  When this is done inside
       iinniittssccrr, the routine iinniitt (supplied by the user) is called
       with two arguments: a window pointer to the one-line  win-
       dow that has been allocated and an integer with the number
       of columns in the window.  Inside this initialization rou-
       tine,  the  integer  variables  LLIINNEESS and CCOOLLSS (defined in
       <<ccuurrsseess..hh>>) are not guaranteed to be accurate and wwrreeffrreesshh
       or  ddoouuppddaattee  must not be called.  It is allowable to call
       wwnnoouuttrreeffrreesshh during the initialization routine.

       rriippoofffflliinnee can be called up to five times  before  calling
       iinniittssccrr or nneewwtteerrmm.

       The  ccuurrss__sseett  routine  sets  the  cursor  state is set to
       invisible, normal, or very visible for vviissiibbiilliittyy equal to
       00,  11,  or  22  respectively.  If the terminal supports the
       _v_i_s_i_b_i_l_i_t_y  requested,  the  previous  _c_u_r_s_o_r   state   is
       returned; otherwise, EERRRR is returned.

       The nnaappmmss routine is used to sleep for _m_s milliseconds.

RREETTUURRNN VVAALLUUEE
       Except  for  ccuurrss__sseett,  these  routines  always return OOKK.
       ccuurrss__sseett returns the previous cursor state, or EERRRR if  the
       requested _v_i_s_i_b_i_l_i_t_y is not supported.

NNOOTTEESS
       Note  that ggeettssyyxx is a macro, so && is not necessary before
       the variables _y and _x.

       The SVr4 man pages warn that the return value of  ccuurrss__sseett
       "is  currently  incorrect".   This  implementation gets it
       right, but it may be unwise to count on the correctness of
       the return value anywhere else.

PPOORRTTAABBIILLIITTYY
       The  functions  sseettssyyxx and ggeettssyyxx are not described in the
       XSI Curses standard, Issue 4.  All other functions are  as
       described in XSI Curses.

SSEEEE AALLSSOO
       ccuurrsseess(3X),       ccuurrss__iinniittssccrr(3X),      ccuurrss__oouuttooppttss(3X),



                                                                2





curs_kernel(3X)                                   curs_kernel(3X)


       ccuurrss__rreeffrreesshh(3X), ccuurrss__ssccrr__dduummpp(3X), ccuurrss__ssllkk(3X)
























































                                                                3


