HP 9000 Series 300 Tutorials Manual page 225

Device i/o and user interfacing hp-ux concepts and tutorials
Hide thumbs Also See for HP 9000 Series 300:
Table of Contents

Advertisement

most routines. Subwindows share character data structures with the original
window, but have their own cursor location and other non-character data
structures. Unless indicated otherwise, all references to windows during
discussion of window routines apply equally to windows and subwindows.
Program Structure Considerations
All programs using curses should include the file <curses. h> which defines
several curses functions as macros and establishes needed global variables as
well as the datatype WINDOW (window references are always of type WINDOW*).
curses also defines the WINDOW * constants stds~r (the standard screen that
is used as a default for all routines that interact with windows) and curser
(the current screen, used as a reference for low-level operations when updating
the current display or clearing and redrawing a scrambled display. The integer
constants
LINES
and
COLS
are defined, and contain values equal to the number
of available lines and columns in the physical display. The constants
TRUE
and
FALSE
are also defined with the values 1 and 0, respectively. Two additional
constants are defined; the values returned by most curses routines. OK is
returned when the routine was able to successfully complete its assigned task.
ERR
indicates that an error occurred (such as an attempt to place the cursor
outside a defined window boundary or create a window larger than the physical
screen); thus, the task was not successfully completed.
The include file <curses. h> that must be specified at the beginning of
the program automatically includes <stdio. h> and an appropriate tty
driver interface file, presently <termio. h>. Including <stdio. h> again in a
subsequent program statement is harmless though wasteful, but including a tty
driver interface file could cause a fatal error if the file is not the same as the
one selected by curses.
Any program that uses curses should include the loader option
-lcurses
in its makefile, whether the program operates at the curses or terminfo level.
If the program only needs curses' screen output and optimization capabilities,
and no non-default windows are involved, you can improve output speed and
processing efficiency by restricting the program to the mini-curses package.
Mini-curses is selected by using the compilation flag
-DMINlCURSES
Using Curses and Terminfo
1-27

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Hp 9000 series 800

Table of Contents