


curs_initscr(3X)                                 curs_initscr(3X)


NNAAMMEE
       ccuurrss__iinniittssccrr:    iinniittssccrr,   nneewwtteerrmm,   eennddwwiinn,   iisseennddwwiinn,
       sseett__tteerrmm, ddeellssccrreeeenn -  ccuurrsseess  screen  initialization  and
       manipulation 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>>

       WWIINNDDOOWW **iinniittssccrr((vvooiidd));;
       iinntt eennddwwiinn((vvooiidd));;
       iinntt iisseennddwwiinn((vvooiidd));;
       SSCCRREEEENN **nneewwtteerrmm((cchhaarr **ttyyppee,, FFIILLEE **oouuttffdd,, FFIILLEE **iinnffdd));;
       SSCCRREEEENN **sseett__tteerrmm((SSCCRREEEENN **nneeww));;
       vvooiidd ddeellssccrreeeenn((SSCCRREEEENN** sspp));;

DDEESSCCRRIIPPTTIIOONN
       iinniittssccrr  is normally the first ccuurrsseess routine to call when
       initializing a program.  A few special routines  sometimes
       need  to  be called before it; these are ssllkk__iinniitt, ffiilltteerr,
       rriippoofffflliinnee, uussee__eennvv.  For multiple-terminal  applications,
       nneewwtteerrmm may be called before iinniittssccrr.

       The initscr code determines the terminal type and initial-
       izes all ccuurrsseess data structures.  iinniittssccrr also causes  the
       first  call  to  rreeffrreesshh  to  clear the screen.  If errors
       occur, iinniittssccrr writes  an  appropriate  error  message  to
       standard error and exits; otherwise, a pointer is returned
       to ssttddssccrr.

       A program that outputs to more than  one  terminal  should
       use  the  nneewwtteerrmm  routine  for  each  terminal instead of
       iinniittssccrr.  A program that needs to inspect capabilities, so
       it can continue to run in a line-oriented mode if the ter-
       minal cannot support a screen-oriented program, would also
       use  nneewwtteerrmm.   The  routine nneewwtteerrmm should be called once
       for each terminal.  It returns a variable of type SSCCRREEEENN **
       which  should  be  saved  as a reference to that terminal.
       The arguments are the _t_y_p_e of the terminal to be  used  in
       place of $$TTEERRMM, a file pointer for output to the terminal,
       and another file pointer for input from the  terminal  (if
       _t_y_p_e  is NNUULLLL, $$TTEERRMM will be used).  The program must also
       call eennddwwiinn for each terminal being  used  before  exiting
       from  ccuurrsseess.  If nneewwtteerrmm is called more than once for the
       same terminal, the first terminal referred to must be  the
       last one for which eennddwwiinn is called.

       A  program  should  always  call  eennddwwiinn before exiting or
       escaping  from  ccuurrsseess  mode  temporarily.   This  routine
       restores  tty  modes,  moves the cursor to the lower left-
       hand corner of the screen and resets the terminal into the
       proper non-visual mode.  Calling rreeffrreesshh or ddoouuppddaattee after
       a temporary escape causes the  program  to  resume  visual
       mode.




                                                                1





curs_initscr(3X)                                 curs_initscr(3X)


       The  iisseennddwwiinn  routine  returns  TTRRUUEE  if  eennddwwiinn has been
       called without any subsequent calls to wwrreeffrreesshh, and FFAALLSSEE
       otherwise.

       The  sseett__tteerrmm  routine is used to switch between different
       terminals.  The screen reference nneeww becomes the new  cur-
       rent  terminal.   The previous terminal is returned by the
       routine.  This  is  the  only  routine  which  manipulates
       SSCCRREEEENN  pointers;  all other routines affect only the cur-
       rent terminal.

       The ddeellssccrreeeenn routine frees storage  associated  with  the
       SSCCRREEEENN  data  structure.   The  eennddwwiinn routine does not do
       this, so ddeellssccrreeeenn should be called after eennddwwiinn if a par-
       ticular SSCCRREEEENN is no longer needed.

RREETTUURRNN VVAALLUUEE
       eennddwwiinn  returns  the  integer EERRRR upon failure and OOKK upon
       successful completion.

       Routines that return pointers always return NNUULLLL on error.

NNOOTTEESS
       Note that iinniittssccrr and nneewwtteerrmm may be macros.

PPOORRTTAABBIILLIITTYY
       These  functions are described in the XSI Curses standard,
       Issue 4.  It specifies that portable applications must not
       call iinniittssccrr more than once.

SSEEEE AALLSSOO
       ccuurrsseess(3X),       ccuurrss__kkeerrnneell(3X),       ccuurrss__rreeffrreesshh(3X),
       ccuurrss__ssllkk(3X), ccuurrss__uuttiill(3X)
























                                                                2


