Debian Codegraph @

upstream/debian-trixie/man3/attr.3ncurses

raw
1 '\" t
2 .\"***************************************************************************
3 .\" Copyright 2018-2024,2025 Thomas E. Dickey *
4 .\" Copyright 1998-2016,2017 Free Software Foundation, Inc. *
5 .\" *
6 .\" Permission is hereby granted, free of charge, to any person obtaining a *
7 .\" copy of this software and associated documentation files (the *
8 .\" "Software"), to deal in the Software without restriction, including *
9 .\" without limitation the rights to use, copy, modify, merge, publish, *
10 .\" distribute, distribute with modifications, sublicense, and/or sell *
11 .\" copies of the Software, and to permit persons to whom the Software is *
12 .\" furnished to do so, subject to the following conditions: *
13 .\" *
14 .\" The above copyright notice and this permission notice shall be included *
15 .\" in all copies or substantial portions of the Software. *
16 .\" *
17 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
18 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
19 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
20 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
21 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
22 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
23 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
24 .\" *
25 .\" Except as contained in this notice, the name(s) of the above copyright *
26 .\" holders shall not be used in advertising or otherwise to promote the *
27 .\" sale, use or other dealings in this Software without prior written *
28 .\" authorization. *
29 .\"***************************************************************************
30 .\"
31 .\" $Id: curs_attr.3x,v 1.136 2025/02/15 19:35:37 tom Exp $
32 .TH attr 3NCURSES 2025-02-15 "ncurses 6.5" "Library calls"
33 .ie \n(.g \{\
34 .ds `` \(lq
35 .ds '' \(rq
36 .\}
37 .el \{\
38 .ie t .ds `` ``
39 .el .ds `` ""
40 .ie t .ds '' ''
41 .el .ds '' ""
42 .\}
43 .
44 .de bP
45 .ie n .IP \(bu 4
46 .el .IP \(bu 2
47 ..
48 .\" ---------------------------------------------------------------------------
49 .SH NAME
50 \fB\%attr_get\fP,
51 \fB\%wattr_get\fP,
52 \fB\%attr_set\fP,
53 \fB\%wattr_set\fP,
54 \fB\%attr_off\fP,
55 \fB\%wattr_off\fP,
56 \fB\%attr_on\fP,
57 \fB\%wattr_on\fP,
58 \fB\%attroff\fP,
59 \fB\%wattroff\fP,
60 \fB\%attron\fP,
61 \fB\%wattron\fP,
62 \fB\%attrset\fP,
63 \fB\%wattrset\fP,
64 \fB\%chgat\fP,
65 \fB\%wchgat\fP,
66 \fB\%mvchgat\fP,
67 \fB\%mvwchgat\fP,
68 \fB\%color_set\fP,
69 \fB\%wcolor_set\fP,
70 \fB\%standend\fP,
71 \fB\%wstandend\fP,
72 \fB\%standout\fP,
73 \fB\%wstandout\fP \-
74 manipulate attributes of character cells in \fIcurses\fR windows
75 .\" ---------------------------------------------------------------------------
76 .SH SYNOPSIS
77 .nf
78 \fB#include <curses.h>
79 .PP
80 \fBint attr_get(attr_t *\fIattrs\fP, short *\fIpair\fP, void *\fIopts\fP);
81 \fBint wattr_get(WINDOW *\fIwin\fP, attr_t *\fIattrs\fP, short *\fIpair\fP,\fR \fPvoid *\fIopts\fP);
82 \fBint attr_set(attr_t \fIattrs\fP, short \fIpair\fP, void *\fIopts\fP);
83 \fBint wattr_set(WINDOW *\fIwin\fP, attr_t \fIattrs\fP, short \fIpair\fP, void *\fIopts\fP);
84 .PP
85 \fBint attr_off(attr_t \fIattrs\fP, void *\fIopts\fP);
86 \fBint wattr_off(WINDOW *\fIwin\fP, attr_t \fIattrs\fP, void *\fIopts\fP);
87 \fBint attr_on(attr_t \fIattrs\fP, void *\fIopts\fP);
88 \fBint wattr_on(WINDOW *\fIwin\fP, attr_t \fIattrs\fP, void *\fIopts\fP);
89 .PP
90 \fBint attroff(int \fIattrs\fP);
91 \fBint wattroff(WINDOW *\fIwin\fP, int \fIattrs\fP);
92 \fBint attron(int \fIattrs\fP);
93 \fBint wattron(WINDOW *\fIwin\fP, int \fIattrs\fP);
94 \fBint attrset(int \fIattrs\fP);
95 \fBint wattrset(WINDOW *\fIwin\fP, int \fIattrs\fP);
96 .PP
97 \fBint chgat(int \fIn\fP, attr_t \fIattr\fP, short \fIpair\fP,\fR \fPconst void *\fIopts\fP);
98 \fBint wchgat(WINDOW *\fIwin\fP,
99 \fBint \fIn\fB, attr_t \fIattr\fB,\fR \fBshort \fIpair\fB, const void *\fIopts\fB);\fR
100 \fBint mvchgat(int \fIy\fB, int \fIx\fB,\fR
101 \fBint \fIn\fB, attr_t \fIattr\fB, short \fIpair\fB, const void *\fIopts\fB);\fR
102 \fBint mvwchgat(WINDOW *\fIwin\fB, int \fIy\fB, int \fIx\fB,\fR
103 \fBint \fIn\fB, attr_t \fIattr\fB, short \fIpair\fB, const void *\fIopts\fB);\fR
104 .PP
105 \fBint color_set(short \fIpair\fB, void* \fIopts\fB);\fR
106 \fBint wcolor_set(WINDOW *\fIwin\fB, short \fIpair\fB,\fR \fBvoid* \fIopts\fP);\fR
107 .PP
108 \fBint standend(void);\fP
109 \fBint wstandend(WINDOW *\fIwin\fB);\fR
110 \fBint standout(void);\fP
111 \fBint wstandout(WINDOW *\fIwin\fB);\fR
112 .fi
113 .\" ---------------------------------------------------------------------------
114 .SH DESCRIPTION
115 These routines manipulate the current attributes of the named window,
116 which then apply to all characters that are written into
117 the window with \fBwaddch\fP, \fBwaddstr\fP and \fBwprintw\fP.
118 Attributes are
119 a property of the character, and move with the character through any scrolling
120 and insert/delete line/character operations.
121 To the extent possible, they are
122 displayed as appropriate modifications to the graphic rendition of characters
123 put on the screen.
124 .PP
125 These routines do not affect the attributes used
126 when erasing portions of the window.
127 See \fB\%bkgd\fP(3NCURSES) for functions which modify the attributes used for
128 erasing and clearing.
129 .\" ---------------------------------------------------------------------------
130 .SS "Window Attributes"
131 There are two sets of functions:
132 .bP
133 functions for manipulating the window attributes and color:
134 \fBwattr_set\fP and \fBwattr_get\fP.
135 .bP
136 functions for manipulating only the window attributes (not color):
137 \fBwattr_on\fP and \fBwattr_off\fP.
138 .PP
139 The \fBwattr_set\fP function sets the current attributes
140 of the given window to \fIattrs\fP, with color specified by \fIpair\fP.
141 .PP
142 Use \fBwattr_get\fP to retrieve attributes for the given window.
143 .PP
144 Use \fBattr_on\fP and \fBwattr_on\fP to turn on window attributes, i.e.,
145 values logically \*(``or\*(''-ed together in \fIattr\fP,
146 without affecting other attributes.
147 Use \fBattr_off\fP and \fBwattr_off\fP to turn off window attributes,
148 again values logically \*(``or\*(''-ed together in \fIattr\fP,
149 without affecting other attributes.
150 .\" ---------------------------------------------------------------------------
151 .SS "Legacy Window Attributes"
152 The X/Open window attribute routines which \fIset\fP or \fIget\fP,
153 turn \fIon\fP or \fIoff\fP
154 are extensions of older routines
155 which assume that color pairs are logically \*(``or\*(''-ed
156 into the attribute parameter.
157 These newer routines use similar names, because
158 X/Open simply added an underscore (\fB_\fP) for the newer names.
159 .PP
160 The
161 .I int
162 datatype used in the legacy routines is treated as if
163 it is the same size as
164 .I \%chtype
165 (used by \fB\%addch\fP(3NCURSES)).
166 It holds the common video attributes (such as bold, reverse),
167 as well as a few bits for color.
168 Those bits correspond to the \fBA_COLOR\fP symbol.
169 The \fBCOLOR_PAIR\fP macro provides a value which can be
170 logically \*(``or\*(''-ed into the attribute parameter.
171 For example,
172 as long as that value fits into the \fBA_COLOR\fP mask,
173 then these calls produce similar results:
174 .PP
175 .RS 4
176 .EX
177 attrset(A_BOLD | COLOR_PAIR(\fIpair\fP));
178 attr_set(A_BOLD, \fIpair\fP, NULL);
179 .EE
180 .RE
181 .PP
182 However, if the value does not fit, then the \fBCOLOR_PAIR\fP macro
183 uses only the bits that fit.
184 For example,
185 because in
186 .I \%ncurses
187 \fBA_COLOR\fP has eight (8) bits,
188 then \fBCOLOR_PAIR(\fI259\fB)\fR is 4
189 (i.e., 259 is 4 more than the limit 255).
190 .PP
191 The \fBPAIR_NUMBER\fP macro extracts a pair number from an
192 .I int
193 (or
194 .IR \%chtype ")."
195 For example, the \fIinput\fP and \fIoutput\fP values in these statements
196 would be the same:
197 .PP
198 .RS 4
199 .EX
200 int value = A_BOLD | COLOR_PAIR(\fIinput\fP);
201 int \fIoutput\fP = PAIR_NUMBER(value);
202 .EE
203 .RE
204 .PP
205 The \fBattrset\fP routine is a legacy feature predating SVr4
206 .I curses
207 but kept in X/Open Curses for the same reason that SVr4
208 .I curses
209 kept it:
210 compatibility.
211 .PP
212 The remaining \fBattr\fP* functions operate exactly like the corresponding
213 \fBattr_\fP* functions, except that they take arguments of type
214 .I int
215 rather than
216 .IR \%attr_t "."
217 .PP
218 There is no corresponding \fB\%attrget\fP function as such
219 in X/Open Curses,
220 although
221 .I \%ncurses
222 provides \fB\%getattrs\fP
223 (see \fB\%legacy\fP(3NCURSES)).
224 .\" ---------------------------------------------------------------------------
225 .SS "Change Character Rendition"
226 The routine \fBchgat\fP changes the attributes of a given number of characters
227 starting at the current cursor location of \fBstdscr\fP.
228 It does not update
229 the cursor and does not perform wrapping.
230 A character count of \-1 or greater
231 than the remaining window width means to change attributes all the way to the
232 end of the current line.
233 The \fBwchgat\fP function generalizes this to any window;
234 the \fBmvwchgat\fP function does a cursor move before acting.
235 .PP
236 In these functions,
237 the color \fIpair\fP argument is a color pair index
238 (as in the first argument of \fBinit_pair\fP, see \fB\%color\fP(3NCURSES)).
239 .\" ---------------------------------------------------------------------------
240 .SS "Change Window Color"
241 The routine \fBcolor_set\fP sets the current color of the given window to the
242 foreground/background combination described by the color \fIpair\fP parameter.
243 .\" ---------------------------------------------------------------------------
244 .SS Standout
245 The routine \fBstandout\fP is
246 the same as \fBattron(A_STANDOUT)\fP.
247 The routine \fBstandend\fP is the same
248 as \fBattrset(A_NORMAL)\fP or \fBattrset(0)\fP, that is, it turns off all
249 attributes.
250 .PP
251 X/Open Curses does not mark these \*(``restricted\*('', because
252 .bP
253 they have well established legacy use, and
254 .bP
255 there is no ambiguity about the way the attributes
256 might be combined with a color pair.
257 .\" ---------------------------------------------------------------------------
258 .SS "Video Attributes"
259 The following video attributes,
260 defined in
261 .IR \%curses.h ","
262 can be passed to
263 .BR \%attron ","
264 .BR \%attroff ","
265 .BR \%attrset ","
266 and
267 logically \*(``or\*(''-ed with characters passed to \fB\%addch\fP(3NCURSES).
268 .PP
269 .if t .ne 15
270 .if n .ne 16
271 .RS
272 .TS
273 Lb Lb
274 Lb Lx.
275 Name Description
276 _
277 A_NORMAL Normal display (no highlight)
278 A_STANDOUT Best highlighting mode available
279 A_UNDERLINE Underlining
280 A_REVERSE Reverse video
281 A_BLINK Blinking
282 A_DIM Half bright
283 A_BOLD Extra bright or bold
284 A_PROTECT Protected mode
285 A_INVIS Invisible or blank mode
286 A_ALTCHARSET Alternate character set
287 A_ITALIC Italics (non-X/Open extension)
288 A_ATTRIBUTES Mask to extract character code
289 A_CHARTEXT Mask to extract attributes
290 A_COLOR Mask to extract color pair identifier
291 .TE
292 .RE
293 .PP
294 .BR \%attr_on ","
295 .BR \%attr_off ","
296 and
297 .B \%attr_set
298 support the foregoing as well as the following additional attributes.
299 .PP
300 .if t .ne 7
301 .if n .ne 8
302 .RS
303 .TS
304 Lb Lb
305 Lb Lx.
306 Name Description
307 _
308 WA_HORIZONTAL Horizontal highlight
309 WA_LEFT Left highlight
310 WA_LOW Low highlight
311 WA_RIGHT Right highlight
312 WA_TOP Top highlight
313 WA_VERTICAL Vertical highlight
314 .TE
315 .RE
316 .\" ---------------------------------------------------------------------------
317 .SH RETURN VALUE
318 These functions return
319 .B OK
320 on success and
321 .B ERR
322 on failure.
323 .PP
324 In
325 .IR \%ncurses ","
326 they return
327 .B ERR
328 if
329 .I win
330 is
331 .IR NULL "."
332 .PP
333 .B \%wcolor_set
334 returns
335 .B ERR
336 if
337 .I pair
338 is outside the range
339 .BR 0 .\|. COLOR_PAIRS\-1 .
340 .PP
341 .B \%wattr_get
342 does
343 .I not
344 fail if its
345 .I \%attrs
346 or
347 .I \%pair
348 parameter is
349 .IR NULL "."
350 .PP
351 Functions prefixed with \*(``mv\*('' first perform cursor movement and
352 fail if the position
353 .RI ( y ,
354 .IR x )
355 is outside the window boundaries.
356 .\" ---------------------------------------------------------------------------
357 .SH NOTES
358 .BR \%attr_on ","
359 .BR \%attr_off ","
360 .BR \%attr_set ","
361 .BR \%wattr_set ","
362 .BR \%chgat ","
363 .BR \%mvchgat ","
364 .BR \%mvwchgat ","
365 .BR \%wchgat ","
366 and
367 .B \%color_set
368 are part of
369 .IR \%ncurses "'s"
370 wide-character API,
371 and are not available in its non-wide configuration.
372 .PP
373 .BR \%attron ","
374 .BR \%wattron ","
375 .BR \%attroff ","
376 .BR \%wattroff ","
377 .BR \%attrset ","
378 .BR \%wattrset ","
379 .BR \%standout ","
380 and
381 .B \%standend
382 may be implemented as macros.
383 .PP
384 Color pair values may be logically \*(``or\*(''-ed with attributes
385 if the pair number is less than 256.
386 The alternate functions such as \fBcolor_set\fP can pass a color pair
387 value directly.
388 However,
389 .I \%ncurses
390 ABI 4 and 5 simply logically \*(``or\*('' this value
391 within the alternate functions.
392 You must use
393 .I \%ncurses
394 ABI 6 to support more than 256 color pairs.
395 .\" ---------------------------------------------------------------------------
396 .SH EXTENSIONS
397 This implementation provides the \fBA_ITALIC\fP attribute for terminals
398 which have the \fBenter_italics_mode\fP (\fBsitm\fP)
399 and \fBexit_italics_mode\fP (\fBritm\fP) capabilities.
400 Italics are not mentioned in X/Open Curses.
401 Unlike the other video attributes, \fBA_ITALIC\fP is unrelated
402 to the \fBset_attributes\fP capabilities.
403 This implementation makes the assumption that
404 \fBexit_attribute_mode\fP may also reset italics.
405 .PP
406 Each of the functions added by XSI Curses has a parameter \fIopts\fP,
407 which X/Open Curses still (after more than twenty years) documents
408 as reserved for future use, saying that it should be
409 .IR NULL "."
410 This implementation uses that parameter in ABI 6 for the functions which
411 have a color pair parameter to support \fIextended color pairs\fP:
412 .bP
413 For functions which modify the color, e.g.,
414 \fBwattr_set\fP and \fBwattr_on\fP,
415 if \fIopts\fP is set it is treated as a pointer to
416 .IR int ","
417 and used to set the color pair instead of the
418 .I short
419 .I pair
420 parameter.
421 .bP
422 For functions which retrieve the color, e.g.,
423 \fBwattr_get\fP,
424 if \fIopts\fP is set it is treated as a pointer to
425 .IR int ","
426 and used to retrieve the color pair as an
427 .I int
428 value,
429 in addition to
430 retrieving it via the standard pointer to
431 .I short
432 parameter.
433 .bP
434 For functions which turn attributes off, e.g.,
435 \fBwattr_off\fP,
436 the \fIopts\fP parameter is ignored except to check that it is
437 .IR NULL "."
438 .\" ---------------------------------------------------------------------------
439 .SH PORTABILITY
440 These functions are described in X/Open Curses Issue\ 4.
441 It specifies no error conditions for them.
442 .PP
443 The standard defined the dedicated type for highlights,
444 .IR \%attr_t ","
445 which was not defined in SVr4
446 .IR curses "."
447 The functions taking
448 .I \%attr_t
449 arguments were not supported under SVr4.
450 .PP
451 SVr4 describes the functions not taking
452 .I \%attr_t
453 or
454 .I pair
455 arguments as always returning
456 .BR 1 "." \" Courier roman in source; SVID 4, vol. 3, p. 480
457 .PP
458 Very old versions of this library did not force an update of the screen
459 when changing the attributes.
460 Use \fBtouchwin\fP to force the screen to match the updated attributes.
461 .PP
462 X/Open Curses states that whether the traditional functions
463 \fBattron\fP/\fBattroff\fP/\fBattrset\fP can manipulate attributes other than
464 \fBA_BLINK\fP, \fBA_BOLD\fP, \fBA_DIM\fP, \fBA_REVERSE\fP, \fBA_STANDOUT\fP, or
465 \fBA_UNDERLINE\fP is \*(``unspecified\*(''.
466 Under this implementation as well as
467 SVr4
468 .IR curses ","
469 these functions correctly manipulate all other highlights
470 (specifically, \fBA_ALTCHARSET\fP, \fBA_PROTECT\fP, and \fBA_INVIS\fP).
471 .PP
472 X/Open Curses added these entry points:
473 .sp
474 .RS
475 \fBattr_get\fP, \fBattr_on\fP,
476 \fBattr_off\fP, \fBattr_set\fP, \fBwattr_on\fP, \fBwattr_off\fP,
477 \fBwattr_get\fP, \fBwattr_set\fP
478 .RE
479 .PP
480 The new functions are intended to work with
481 a new series of highlight macros prefixed with \fBWA_\fP.
482 The older macros have direct counterparts in the newer set of names:
483 .PP
484 .RS
485 .ne 9
486 .TS
487 Lb Lb
488 Lb Lx.
489 Name Description
490 _
491 WA_NORMAL Normal display (no highlight)
492 WA_STANDOUT T{
493 Best highlighting mode of the terminal
494 T}
495 WA_UNDERLINE Underlining
496 WA_REVERSE Reverse video
497 WA_BLINK Blinking
498 WA_DIM Half bright
499 WA_BOLD Extra bright or bold
500 WA_ALTCHARSET Alternate character set
501 .TE
502 .RE
503 .PP
504 X/Open Curses does not assign values to these symbols,
505 nor does it state whether or not they are related to the
506 similarly-named A_NORMAL, etc.:
507 .bP
508 X/Open Curses specifies that each pair of corresponding \fBA_\fP
509 and \fBWA_\fP-using functions operates on the same current-highlight
510 information.
511 .bP
512 However, in some implementations, those symbols have unrelated values.
513 .IP
514 For example, the Solaris \fIxpg4\fP (X/Open)
515 .I curses
516 declares
517 .I \%attr_t
518 to be an unsigned short integer (16-bits),
519 while
520 .I \%chtype
521 is a unsigned integer (32-bits).
522 The \fBWA_\fP symbols in this case are different from the \fBA_\fP symbols
523 because they are used for a smaller datatype which does not
524 represent \fBA_CHARTEXT\fP or \fBA_COLOR\fP.
525 .IP
526 In this implementation (as in many others), the values happen to be
527 the same because it simplifies copying information between
528 .I \%chtype
529 and
530 .I \%cchar_t
531 variables.
532 .bP
533 Because
534 .IR \%ncurses 's
535 .I \%attr_t
536 can hold a color pair
537 (in the \fBA_COLOR\fP field),
538 a call to
539 \fBwattr_on\fP,
540 \fBwattr_off\fP, or
541 \fBwattr_set\fP
542 may alter the window's color.
543 If the color pair information in the attribute parameter is zero,
544 no change is made to the window's color.
545 .IP
546 This is consistent with SVr4
547 .IR curses ";"
548 X/Open Curses does not specify this.
549 .PP
550 The X/Open Curses extended conformance level adds new highlights
551 \fBA_HORIZONTAL\fP, \fBA_LEFT\fP, \fBA_LOW\fP, \fBA_RIGHT\fP, \fBA_TOP\fP,
552 \fBA_VERTICAL\fP (and corresponding \fBWA_\fP macros for each).
553 As of August 2013,
554 no known terminal provides these highlights
555 (i.e., via the \fBsgr1\fP capability).
556 .\" ---------------------------------------------------------------------------
557 .SH HISTORY
558 4BSD (1980)
559 used a
560 .I char
561 to represent each cell of the terminal screen.
562 It assumed 7-bit character codes,
563 employing the eighth bit of a byte to represent a
564 .I \%standout
565 attribute
566 (often implemented as bold and/or reverse video).
567 It introduced
568 .IR \%standout ","
569 .IR \%standend ","
570 .IR \%wstandout ","
571 and
572 .I \%wstandend
573 functions to manipulate this bit.
574 Despite their inflexibility,
575 they carried over into System\ V
576 .I curses
577 and ultimately X/Open Curses
578 due to their pervasive use in legacy applications.
579 While some 1980s terminals supported a variety of video attributes,
580 BSD
581 .I curses
582 could do nothing with them.
583 .PP
584 SVr2 (1984)
585 provided an improved
586 .I curses
587 library,
588 introducing
589 .I \%chtype
590 to create the abstract notion of a
591 .I curses
592 character;
593 this was by default an
594 .IR "unsigned short" ","
595 with a provision for compile-time redefinition to other integral types
596 (a freedom not necessarily available to users of shared libraries,
597 and in any event a source license was necessary to exercise it).
598 It added the functions
599 .IR \%attron ","
600 .IR \%attroff ","
601 .IR \%attrset ","
602 .IR \%wattron ","
603 .IR \%wattroff ","
604 and
605 .IR \%wattrset ","
606 and defined the
607 .I A_
608 macros listed above
609 (except for
610 .I \%A_ITALIC
611 and
612 .IR \%A_COLOR ")"
613 for use by applications to manipulate other attributes.
614 The values of these macros
615 were not necessarily the same in different systems,
616 even among those certified as System\ V.
617 .PP
618 SVr3.2 (1988)
619 added the
620 .I \%A_COLOR
621 macro along with a color system;
622 see \fB\%color\fP(3NCURSES).
623 .PP
624 X/Open Curses Issue\ 4 (1995) is largely based on SVr4
625 .IR curses ","
626 but recognized that the
627 .I \%wchar_t
628 type of ISO C95 was intended to house only a single character code,
629 not a sequence of codes combining with a base character,
630 let alone could it reliably offer room for a color pair identifier
631 and a set of attribute bits with a potential for further growth \(em
632 thus the standard invented the
633 .I curses
634 complex character type
635 .I \%cchar_t
636 and a separate type
637 .I \%attr_t
638 for storage of attribute bits.
639 The new types brought along several new functions to manipulate them,
640 some corresponding to existing
641 .IR chtype -based
642 functions
643 .RI \%( attr_on ,
644 .IR \%attr_off ","
645 .IR \%attr_set ","
646 .IR \%wattr_on ","
647 .IR \%wattr_off ","
648 and
649 .IR \%wattr_set "),"
650 and some new
651 .RI \%( chgat
652 and its variants,
653 .IR \%color_set ","
654 and
655 .IR \%wcolor_set ")."
656 .PP
657 Different Unix systems used differently sized bit fields in
658 .I \%chtype
659 for the character code and the color pair identifier,
660 and took into account platforms' different integer sizes
661 (32- versus 64-bit).
662 .PP
663 The following table showing the number of bits for
664 .I \%A_COLOR
665 and
666 .I \%A_CHARTEXT
667 was gleaned from the
668 .I curses
669 header files for various operating systems and architectures.
670 The inferred architecture and notes
671 reflect the format and size of the defined constants
672 as well as clues such as the alternate character set implementation.
673 A 32-bit library can be used on a 64-bit system,
674 but not necessarily the converse.
675 .PP
676 .TS
677 Lb Lb Lb Cb S Lb
678 Lb2 Lb Lb2 Lb2 Lb2 Lb
679 L L L L L Lx.
680 \& \& \& Bits \&
681 Year System Arch Color Char Notes
682 _
683 1992 Solaris 5.2 32 6 17 SVr4 \fIcurses\fP
684 1992 HP-UX 9 32 no 8 SVr2 \fIcurses\fP
685 1992 AIX 3.2 32 no 23 SVr2 \fIcurses\fP
686 1994 OSF/1 r3 32 no 23 SVr2 \fIcurses\fP
687 1995 HP-UX 10.00 32 6 16 SVr3 \fIcurses_colr\fP
688 1995 HP-UX 10.00 32 6 8 SVr4, X/Open \fIcurses\fP
689 1995 Solaris 5.4 32/64 7 16 X/Open \fIcurses\fP
690 1996 AIX 4.2 32 7 16 X/Open \fIcurses\fP
691 1996 OSF/1 r4 32 6 16 X/Open \fIcurses\fP
692 1997 HP-UX 11.00 32 6 8 X/Open \fIcurses\fP
693 2000 UWIN 32/64 7/31 16 uses \fIchtype\fP
694 .TE
695 .PP
696 Notes:
697 .RS 3
698 .PP
699 Regarding HP-UX,
700 .bP
701 HP-UX 10.20 (1996) added support for 64-bit PA-RISC processors in 1996.
702 .bP
703 HP-UX 10.30 (1997) marked \*(``curses_colr\*('' obsolete.
704 That version of
705 .I curses
706 was dropped with HP-UX 11.30 in 2006.
707 .PP
708 Regarding OSF/1 (and Tru64),
709 .bP
710 These used 64-bit hardware.
711 Like
712 .IR \%ncurses ","
713 the OSF/1
714 .I curses
715 interface is not customized for 32-bit and 64-bit
716 versions.
717 .bP
718 Unlike other systems which evolved from AT&T code,
719 OSF/1 provided a new implementation for X/Open Curses.
720 .PP
721 Regarding Solaris,
722 .bP
723 The initial release of Solaris was in 1992.
724 .bP
725 Its XPG4
726 (X/Open Curses-conforming)
727 .I xcurses
728 library was developed by Mortice Kern Systems from 1990 to 1995.
729 Sun's copyright began in 1996.
730 .bP
731 Sun updated the X/Open Curses interface
732 after 64-bit support was introduced in 1997,
733 but did not modify the SVr4
734 .I curses
735 interface.
736 .PP
737 Regarding UWIN,
738 .bP
739 Development of the
740 .I curses
741 library began in 1991, stopped in 2000.
742 .bP
743 Color support was added in 1998.
744 .bP
745 The library uses only
746 .I \%chtype
747 (not
748 .IR \%cchar_t ")."
749 .RE
750 .PP
751 Once X/Open Curses was adopted in the mid-1990s, the constraint of
752 a 32-bit interface with many colors and wide-characters for
753 .I \%chtype
754 became a moot point.
755 The
756 .I \%cchar_t
757 structure
758 (whose size and members are not specified in X/Open Curses)
759 could be extended as needed.
760 .PP
761 Other interfaces are rarely used now.
762 .bP
763 BSD
764 .I curses
765 was improved slightly in 1993/1994 using Keith Bostic's
766 modification to make the library 8-bit clean for \fInvi\fP(1).
767 He moved the
768 .I \%standout
769 attribute to a structure member.
770 The resulting 4.4BSD
771 .I curses
772 was replaced by
773 .I \%ncurses
774 over the next ten years.
775 .bP
776 UWIN has been defunct since 2012.
777 .PP
778 .I \%ncurses
779 6.0 (2015)
780 added the
781 .I A_ITALIC
782 macro.
783 .\" ---------------------------------------------------------------------------
784 .SH SEE ALSO
785 \fB\%ncurses\fP(3NCURSES),
786 \fB\%addch\fP(3NCURSES),
787 \fB\%addstr\fP(3NCURSES),
788 \fB\%bkgd\fP(3NCURSES),
789 \fB\%printw\fP(3NCURSES),
790 \fB\%curses_variables\fP(3NCURSES)