Manual Pages for UNIX Darwin command on man curs_initscr
MyWebUniversity

Manual Pages for UNIX Darwin command on man curs_initscr

cursinitscr(3X) cursinitscr(3X)

NAME

iinniittssccrr, nneewwtteerrmm, eennddwwiinn, iisseennddwwiinn, sseetttteerrmm, ddeellssccrreeeenn - ccuurrsseess screen

initialization and manipulation routines

SYNOPSIS

##iinncclluuddee <>

WWIINNDDOOWW **iinniittssccrr((vvooiidd));; iinntt eennddwwiinn((vvooiidd));; bbooooll iisseennddwwiinn((vvooiidd));; SSCCRREEEENN **nneewwtteerrmm((cchhaarr **ttyyppee,, FFIILLEE **oouuttffdd,, FFIILLEE **iinnffdd));; SSCCRREEEENN **sseetttteerrmm((SSCCRREEEENN **nneeww));; vvooiidd ddeellssccrreeeenn((SSCCRREEEENN** sspp));;

DESCRIPTION

iinniittssccrr is normally the first ccuurrsseess routine to call when initializing a program. A few special routines sometimes need to be called before

it; these are ssllkkiinniitt, ffiilltteerr, rriippoofffflliinnee, uusseeeennvv. For multiple-ter-

minal applications, nneewwtteerrmm may be called before iinniittssccrr.

The initscr code determines the terminal type and initializes all ccuurrss-

eess data structures. iinniittssccrr also causes the first call to rreeffrreesshh to clear the screen. If errors occur, iinniittssccrr writes an appropriate error message to standard error and exits; otherwise, a pointer is returned to ssttddssccrr. A program that outputs to more than one terminal should use the nneewwtteerrmm routine for each terminal instead of iinniittssccrr. A program that needs to

inspect capabilities, so it can continue to run in a line-oriented mode

if the terminal cannot support a screen-oriented program, would also

use nneewwtteerrmm. The routine nneewwtteerrmm should be called once for each termi-

nal. It returns a variable of type SSCCRREEEENN ** which should be saved as a reference to that terminal. The arguments are the type of the terminal

to be used in place of $$TTEERRMM, a file pointer for output to the termi-

nal, and another file pointer for input from the terminal (if type is

NNUULLLL, $$TTEERRMM will be used). The program must also call eennddwwiinn for each

terminal being used before exiting from ccuurrsseess. If nneewwtteerrmm is called more than once for the same terminal, the first terminal referred to must be the last one for which eennddwwiinn is called. A program should always call eennddwwiinn before exiting or escaping from ccuurrsseess mode temporarily. This routine restores tty modes, moves the

cursor to the lower left-hand corner of the screen and resets the ter-

minal into the proper non-visual mode. Calling rreeffrreesshh or ddoouuppddaattee af-

ter a temporary escape causes the program to resume visual mode. The iisseennddwwiinn routine returns TTRRUUEE if eennddwwiinn has been called without any subsequent calls to wwrreeffrreesshh, and FFAALLSSEE otherwise. The sseetttteerrmm routine is used to switch between different terminals.

The screen reference nneeww becomes the new current terminal. The previ-

ous terminal is returned by the routine. This is the only routine which manipulates SSCCRREEEENN pointers; all other routines affect only the current terminal. The ddeellssccrreeeenn routine frees storage associated with the SSCCRREEEENN data structure. The eennddwwiinn routine does not do this, so ddeellssccrreeeenn should be called after eennddwwiinn if a particular SSCCRREEEENN is no longer needed. RREETTUURRNN VVAALLUUEE

eennddwwiinn returns the integer EERRRR upon failure and OOKK upon successful com-

pletion. Routines that return pointers always return NNUULLLL on error.

X/Open defines no error conditions. In this implementation eennddwwiinn re-

turns an error if the terminal was not initialized. NNOOTTEESS Note that iinniittssccrr and nneewwtteerrmm may be macros. PPOORRTTAABBIILLIITTYY These functions are described in the XSI Curses standard, Issue 4. It specifies that portable applications must not call iinniittssccrr more than once. Old versions of curses, e.g., BSD 4.4, may have returned a null pointer from iinniittssccrr when an error is detected, rather than exiting. It is safe but redundant to check the return value of iinniittssccrr in XSI Curses.

SEE ALSO

ccuurrsseess(3X), ccuurrsskkeerrnneell(3X), ccuurrssrreeffrreesshh(3X), ccuurrssssllkk(3X), ccuurrssuuttiill(3X) cursinitscr(3X)




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