X/Open Curses is largely based on SVr4 curses, adding support for
'wide-characters' (not specific to Unicode). Some of the X/Open
differences from SVr4 curses address the way video attributes can
be applied to wide-characters. But aside from that, attrset
and
attr_set
are similar. SVr4 curses provided the basic features
for manipulating video attributes. However, earlier versions of
curses provided a part of these features.
As seen in 2.8BSD, curses assumed 7-bit characters, using the
eighth bit of a byte to represent the standout feature (often
implemented as bold and/or reverse video). The BSD curses
library provided functions standout
and standend
which were
carried along into X/Open Curses due to their pervasive use in
legacy applications.
Some terminals in the 1980s could support a variety of video
attributes, although the BSD curses library could do nothing with
those. System V (1983) provided an improved curses library. It
defined the A_
symbols for use by applications to manipulate the
other attributes. There are few useful references for the
chronology.
Goodheart's book UNIX Curses Explained (1991) describes SVr3
(1987), commenting on several functions:
• the attron
, attroff
, attrset
functions (and most of the
functions found in SVr4 but not in BSD curses) were
introduced by System V,
• the alternate character set feature with A_ALTCHARSET
was
added in SVr2 and improved in SVr3 (by adding acs_map[]
),
• start_color
and related color-functions were introduced by
System V.3.2,
• pads, soft-keys were added in SVr3, and
Goodheart did not mention the background character or the cchar_t
type. Those are respectively SVr4 and X/Open features. He did
mention the A_
constants, but did not indicate their values.
Those were not the same in different systems, even for those
marked as System V.
Different Unix systems used different sizes for the bit-fields in
chtype
for characters and colors, and took into account the
different integer sizes (32-bit versus 64-bit).
This table showing the number of bits for A_COLOR
and A_CHARTEXT
was gleaned from the curses header files for various operating
systems and architectures. The inferred architecture and notes
reflect the format and size of the defined constants as well as
clues such as the alternate character set implementation. A
32-bit library can be used on a 64-bit system, but not
necessarily the reverse.
Year System Arch Color Char Notes
────────────────────────────────────────────────────────────────
1992 Solaris 5.2 32 6 17 SVr4 curses
1992 HPUX 9 32 no 8 SVr2 curses
1992 AIX 3.2 32 no 23 SVr2 curses
1994 OSF/1 r3 32 no 23 SVr2 curses
1995 HP-UX 10.00 32 6 16 SVr3 'curses_colr'
1995 HP-UX 10.00 32 6 8 SVr4, X/Open curses
1995 Solaris 5.4 32/64 7 16 X/Open curses
1996 AIX 4.2 32 7 16 X/Open curses
1996 OSF/1 r4 32 6 16 X/Open curses
1997 HP-UX 11.00 32 6 8 X/Open curses
2000 U/Win 32/64 7/31 16 uses chtype
Notes:
Regarding HP-UX,
• HP-UX 10.20 (1996) added support for 64-bit PA-RISC
processors in 1996.
• HP-UX 10.30 (1997) marked 'curses_colr' obsolete. That
version of curses was dropped with HP-UX 11.30 in 2006.
Regarding OSF/1 (and Tru64),
• These used 64-bit hardware. Like ncurses, the OSF/1
curses interface is not customized for 32-bit and 64-bit
versions.
• Unlike other systems which evolved from AT&T code, OSF/1
provided a new implementation for X/Open curses.
Regarding Solaris,
• The initial release of Solaris was in 1992.
• The xpg4 (X/Open) curses was developed by MKS from 1990 to
1995. Sun's copyright began in 1996.
• Sun updated the X/Open curses interface after 64-bit
support was introduced in 1997, but did not modify the
SVr4 curses interface.
Regarding U/Win,
• Development of the curses library began in 1991, stopped
in 2000.
• Color support was added in 1998.
• The library uses only chtype
(no cchar_t
).
Once X/Open curses was adopted in the mid-1990s, the constraint
of a 32-bit interface with many colors and wide-characters for
chtype
became a moot point. The cchar_t
structure (whose size
and members are not specified in X/Open Curses) could be extended
as needed.
Other interfaces are rarely used now:
• BSD curses was improved slightly in 1993/1994 using Keith
Bostic's modification to make the library 8-bit clean for
nvi
. He moved standout attribute to a structure member.
The resulting 4.4BSD curses was replaced by ncurses over the
next ten years.
• U/Win is rarely used now.