curses_intro.3x (2010 09)
c
curses_intro(3X) curses_intro(3X)
(X/Open CURSES)
All the identifiers defined in this document that have external linkage are always reserved for use as
identifiers with external linkage.
No other identifiers are reserved.
Applications must not declare or define identifiers with the same name as an identifier reserved in the
same context. Since macro names are replaced whenever found, independent of scope and name space,
macro names matching any of the reserved identifier names must not be defined if any associated header
is included.
Headers may be included in any order, and each may be included more than once in a given scope, with
no difference in effect from that of being included only once.
If used, a header must be included outside of any external declaration or definition, and it must be first
included before the first reference to any type or macro it defines, or to any function or object it declares.
However, if an identifier is declared or defined in more than one header, the second and subsequent asso-
ciated headers may be included after the initial reference to the identifier. Prior to the inclusion of a
header, the program must not define any macros with names lexically identical to symbols defined by that
header.
Interfaces Implemented as Macros (ENHANCED CURSES)
The requirements in this section are in effect only for implementations that claim Enhanced Curses com-
pliance.
The following interfaces with arguments must be implemented as macros. The relevance to the applica-
tion programmer is that the
& character cannot be used before the arguments.
Macros Manpage
COLOR_PAIR() , PAIR_NUMBER() can_change_color(3X)
getbegyx() , getmaxyx() , getparyx() , getyx() getbegyx(3X)
The descriptions in <curses.h>, <term.h>, <unctrl.h> list other macros, like COLOR_BLACK,
that do not take arguments.
Relationship to the X/Open System Interfaces and Headers, Issue 4, Version 2 Specification
Error Numbers
Most functions provide an error number in
errno, which is either a variable or macro defined in
<errno.h>; the macro expands to a modifiable lvalue of type int.
A list of valid values for
errno and advice to application writers on the use of errno
appears in the
X/Open System Interfaces and Headers, Issue 4, Version 2 specification .
Data Types
All of the data types used by Curses functions are defined by the implementation. The following list
describes these types:
attr_t An integral type that can contain at least an unsigned short. The type
attr_t is used to hold an ORed set of attributes defined in <curses.h> that
begin with the prefix WA_.
bool Boolean data type
chtype An integral type that can contain at least an unsignedchar and attributes. Values
of type chtype are formed by ORing together an unsignedchar value and zero or
more of the base attribute flags defined in <curses.h> that have the A_ prefix.
The application can extract these components of a chtype value using the base
masks defined in <curses.h> for this purpose.
The
chtype data type also contains a colour-pair. Values of type chtype are formed by ORing
together an unsignedchar value, a colour-pair, and zero or more of the attributes defined in
<curses.h> that begin with the prefix A_. The application can extract these components of a
chtype value using the masks defined in <curses.h> for this purpose.
SCREEN An opaque terminal representation.
wchar_t As described in <stddef.h>.
cchar_t A type that can reference a string of wide characters of up to an implementation-
dependent length, a colour-pair, and zero or more attributes from the set of all attri-
butes defined in this document. A null cchar_t object is an object that references
HP-UX 11i Version 3: September 2010 − 3 − Hewlett-Packard Company 3