HP-UX Reference (11i v3 07/02) - 3 Library Functions A-M (vol 6)

c
curses_intro(3X) curses_intro(3X)
(X/Open CURSES)
s
Y means these functions perform special-character processing (see Special Characters). N means
they do not. ? means the results are unspecified when these functions are applied to special
characters.
w Y means these functions perform wrapping (see Truncation, Wrapping and Scrolling). N means
they do not.
c Y means these functions advance the cursor (see Truncation, Wrapping and Scrolling). N means
they do not.
- The attribute specified by this column does not apply to these functions.
Interfaces Implemented as Macros
The following interfaces with arguments must be implemented as macros. The relevance to the application
programmer is that the & character cannot be used before the arguments.
Macros Manpage
COLOR_PAIR() can_change_color(3X)
getbegyx(), getmaxyx(), getparyx(), getyx() getbegyx(3X)
The header file reference manpages list other macros, like COLOR_BLACK , that do not take arguments.
Initialised Curses Environment
Before executing an application that uses Curses, the terminal must be prepared as follows:
If the terminal has hardware tab stops, they should be set.
Any initialisation strings defined for the terminal must be output to the terminal.
The resulting state of the terminal must be compatible with the model of the terminal that Curses has, as
reflected in the terminal’s entry in the terminfo database (see terminfo(4)).
To initialise Curses, the application must call initscr() or newterm() before calling any of the other
functions that deal with windows and screens, and it must call endwin() before exiting. To get
character-at-a-time input without echoing (most interactive, screen-oriented programs want this), the fol-
lowing sequence should be used:
initscr();
cbreak();
noecho();
Most programs would additionally use the sequence:
nonl();
intrflush( stdscr , FALSE);
keypad( stdscr , TRUE);
Synchronous and Networked Asynchronous Terminals
This section indicates to the application writer some considerations to be borne in mind when driving syn-
chronous, networked asynchronous (NWA) or nonstandard directly connected asynchronous terminals.
Such terminals are often used in a mainframe environment and communicate to the host in block mode.
That is, the user types characters at the terminal then presses a special key to initiate transmission of the
characters to the host.
Frequently, although it may be possible to send arbitrary sized blocks to the host, it is not possible or desir-
able to cause a character to be transmitted with only a single keystroke.
This can cause severe problems to an application wishing to make use of single-character input; see Input
Processing.
Output
The Curses interface can be used in the normal way for all operations pertaining to output to the terminal,
with the possible exception that on some terminals the
refresh() routine may have to redraw the entire
screen contents in order to perform any update.
If it is additionally necessary to clear the screen before each such operation, the result could be undesirable.
258 Hewlett-Packard Company 13 HP-UX 11i Version 3: February 2007