MyWebUniversity.com Home Page
 



OpenSolaris man pages main menu


Curses Library Functions                     curskernel(3CURSES)



NAME
     curskernel, defprogmode, defshellmode, resetprogmode,
     resetshellmode,  resetty, savetty, getsyx, setsyx, ripoff-
     line, cursset, napms - low-level curses routines

SYNOPSIS
     cc [ flag ... ] file ... -lcurses [ library ... ]
     #include 

     int defprogmode(void);


     int defshellmode(void);


     int resetprogmode(void);


     int resetshellmode(void);


     int resetty(void);


     int savetty(void);


     int getsyx(int y, int x);


     int setsyx(int y, int x);


     int ripoffline(int line, int (*init)(WINDOW *, int));


     int cursset(int visibility);


     int napms(int ms);


DESCRIPTION
     The following routines  give  low-level  access  to  various
     curses  functionality.  Theses  routines  typically are used
     inside library routines.


     The defprogmode() and defshellmode() routines  save  the
     current  terminal  modes  as  the ``program'' (in curses) or
     ``shell''  (not  in  curses  )  state   for   use   by   the
     resetprogmode()  and  resetshellmode() routines. This is



SunOS 5.11          Last change: 31 Dec 1996                    1






Curses Library Functions                     curskernel(3CURSES)



     done automatically by initscr().


     The  resetprogmode()   and   resetshellmode()   routines
     restore the terminal to ``program'' (in curses) or ``shell''
     (out of curses)  state.  These  are  done  automatically  by
     endwin() and, after an endwin(), by doupdate(), so they nor-
     mally are not called.


     The resetty() and savetty() routines save  and  restore  the
     state  of  the  terminal  modes. savetty() saves the current
     state in a buffer and resetty() restores the state  to  what
     it was at the last call to savetty().


     With the getsyx() routine, the current  coordinates  of  the
     virtual  screen cursor are returned in y and x. If leaveok()
     is currently TRUE, then -1,-1 is  returned.  If  lines  have
     been removed from the top of the screen, using ripoffline(),
     y and x include these lines; therefore, y and  x  should  be
     used only as arguments for  setsyx().


     With the setsyx() routine, the virtual screen cursor is  set
     to  y, x. If y and x are both -1, then leaveok() is set. The
     two routines getsyx() and setsyx() are designed to  be  used
     by  a  library routine, which manipulates curses windows but
     does  not  want  to  change  the  current  position  of  the
     program's cursor. The library routine would call getsyx() at
     the beginning, do its manipulation of its own windows, do  a
     wnoutrefresh()  on its windows, call setsyx(), and then call
     doupdate().


     The ripoffline() routine provides access to the same  facil-
     ity  that  slkinit() (see cursslk(3CURSES)) uses to reduce
     the size of the screen. ripoffline() must be  called  before
     initscr()  or  newterm()  is  called. If line is positive, a
     line is removed from the top of stdscr(); if line  is  nega-
     tive,  a  line is removed from the bottom. When this is done
     inside initscr(), the routine init() (supplied by the  user)
     is  called  with two arguments: a window pointer to the one-
     line window that has been allocated and an integer with  the
     number  of columns in the window. Inside this initialization
     routine, the integer variables LINES and  COLS  (defined  in
     ) are not guaranteed to be accurate and wrefresh()
     or doupdate() must not be called. It is  allowable  to  call
     wnoutrefresh() during the initialization routine.






SunOS 5.11          Last change: 31 Dec 1996                    2






Curses Library Functions                     curskernel(3CURSES)



     ripoffline() can be called up to five times  before  calling
     initscr() or newterm().


     With the cursset() routine, the  cursor  state  is  set  to
     invisible,  normal,  or very visible for visibility equal to
     0, 1, or 2 respectively. If the terminal supports the  visi-
     bility  requested,  the  previous  cursor state is returned;
     otherwise, ER is returned.


     The napms() routine is used to sleep for ms milliseconds.

RETURN VALUES
     Except for cursset(),  these  routines  always  return  OK.
     cursset()  returns the previous cursor state, or ER if the
     requested visibility is not supported.

ATRIBUTES
     See attributes(5) for descriptions of the  following  attri-
     butes:



     
           ATRIBUTE TYPE               ATRIBUTE VALUE       
    
     MT-Level                     Unsafe                      
    


SEE ALSO
     cursinitscr(3CURSES),                cursoutopts(3CURSES),
     cursrefresh(3CURSES),               cursscrdump(3CURSES),
     cursslk(3CURSES), curses(3CURSES), attributes(5)

NOTES
     The header   automatically  includes  the  headers
      and .


     Note that getsyx() is a macro, so an ampersand  (&)  is  not
     necessary before the variables y and x.












SunOS 5.11          Last change: 31 Dec 1996                    3



OpenSolaris man pages main menu

Contact us      |       About us      |       Term of use      |       Copyright © 2000-2010 MyWebUniversity.com ™