Debian Codegraph @

upstream/mageia-cauldron/man3/curs_attr.3x

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.138 2025/04/05 21:56:26 tom Exp $
32 .TH curs_attr 3X 2025-04-05 "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 \fBcurs_bkgd\fP(3X) 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 \fBaddch\fP(3X)).
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 .nf
178 attrset(A_BOLD | COLOR_PAIR(\fIpair\fP));
179 attr_set(A_BOLD, \fIpair\fP, NULL);
180 .fi
181 .EE
182 .RE
183 .PP
184 However, if the value does not fit, then the \fBCOLOR_PAIR\fP macro
185 uses only the bits that fit.
186 For example,
187 because in
188 .I \%ncurses
189 \fBA_COLOR\fP has eight (8) bits,
190 then \fBCOLOR_PAIR(\fI259\fB)\fR is 4
191 (i.e., 259 is 4 more than the limit 255).
192 .PP
193 The \fBPAIR_NUMBER\fP macro extracts a pair number from an
194 .I int
195 (or
196 .IR \%chtype ")."
197 For example, the \fIinput\fP and \fIoutput\fP values in these statements
198 would be the same:
199 .PP
200 .RS 4
201 .EX
202 .nf
203 int value = A_BOLD | COLOR_PAIR(\fIinput\fP);
204 int \fIoutput\fP = PAIR_NUMBER(value);
205 .fi
206 .EE
207 .RE
208 .PP
209 The \fBattrset\fP routine is a legacy feature predating SVr4
210 .I curses
211 but kept in X/Open Curses for the same reason that SVr4
212 .I curses
213 kept it:
214 compatibility.
215 .PP
216 The remaining \fBattr\fP* functions operate exactly like the corresponding
217 \fBattr_\fP* functions, except that they take arguments of type
218 .I int
219 rather than
220 .IR \%attr_t "."
221 .PP
222 There is no corresponding \fB\%attrget\fP function as such
223 in X/Open Curses,
224 although
225 .I \%ncurses
226 provides \fB\%getattrs\fP
227 (see \fB\%curs_legacy\fP(3X)).
228 .\" ---------------------------------------------------------------------------
229 .SS "Change Character Rendition"
230 The routine \fBchgat\fP changes the attributes of a given number of characters
231 starting at the current cursor location of \fBstdscr\fP.
232 It does not update
233 the cursor and does not perform wrapping.
234 A character count of \-1 or greater
235 than the remaining window width means to change attributes all the way to the
236 end of the current line.
237 The \fBwchgat\fP function generalizes this to any window;
238 the \fBmvwchgat\fP function does a cursor move before acting.
239 .PP
240 In these functions,
241 the color \fIpair\fP argument is a color pair index
242 (as in the first argument of \fBinit_pair\fP, see \fBcurs_color\fP(3X)).
243 .\" ---------------------------------------------------------------------------
244 .SS "Change Window Color"
245 The routine \fBcolor_set\fP sets the current color of the given window to the
246 foreground/background combination described by the color \fIpair\fP parameter.
247 .\" ---------------------------------------------------------------------------
248 .SS Standout
249 The routine \fBstandout\fP is
250 the same as \fBattron(A_STANDOUT)\fP.
251 The routine \fBstandend\fP is the same
252 as \fBattrset(A_NORMAL)\fP or \fBattrset(0)\fP, that is, it turns off all
253 attributes.
254 .PP
255 X/Open Curses does not mark these \*(``restricted\*('', because
256 .bP
257 they have well established legacy use, and
258 .bP
259 there is no ambiguity about the way the attributes
260 might be combined with a color pair.
261 .\" ---------------------------------------------------------------------------
262 .SS "Video Attributes"
263 The following video attributes,
264 defined in
265 .IR \%curses.h ","
266 can be passed to
267 .BR \%attron ","
268 .BR \%attroff ","
269 .BR \%attrset ","
270 and
271 logically \*(``or\*(''-ed with characters passed to \fBaddch\fP(3X).
272 .PP
273 .if t .ne 15
274 .if n .ne 16
275 .RS
276 .TS
277 Lb Lb
278 Lb Lx.
279 Name Description
280 _
281 A_NORMAL Normal display (no highlight)
282 A_STANDOUT Best highlighting mode available
283 A_UNDERLINE Underlining
284 A_REVERSE Reverse video
285 A_BLINK Blinking
286 A_DIM Half bright
287 A_BOLD Extra bright or bold
288 A_PROTECT Protected mode
289 A_INVIS Invisible or blank mode
290 A_ALTCHARSET Alternate character set
291 A_ITALIC Italics (non-X/Open extension)
292 A_ATTRIBUTES Mask to extract character code
293 A_CHARTEXT Mask to extract attributes
294 A_COLOR Mask to extract color pair identifier
295 .TE
296 .RE
297 .PP
298 .BR \%attr_on ","
299 .BR \%attr_off ","
300 and
301 .B \%attr_set
302 support the foregoing as well as the following additional attributes.
303 .PP
304 .if t .ne 7
305 .if n .ne 8
306 .RS
307 .TS
308 Lb Lb
309 Lb Lx.
310 Name Description
311 _
312 WA_HORIZONTAL Horizontal highlight
313 WA_LEFT Left highlight
314 WA_LOW Low highlight
315 WA_RIGHT Right highlight
316 WA_TOP Top highlight
317 WA_VERTICAL Vertical highlight
318 .TE
319 .RE
320 .\" ---------------------------------------------------------------------------
321 .SH RETURN VALUE
322 These functions return
323 .B OK
324 on success and
325 .B ERR
326 on failure.
327 .PP
328 In
329 .IR \%ncurses ","
330 they return
331 .B ERR
332 if
333 .I win
334 is
335 .IR NULL "."
336 .PP
337 .B \%wcolor_set
338 returns
339 .B ERR
340 if
341 .I pair
342 is outside the range
343 .BR 0 .\|. COLOR_PAIRS\-1 .
344 .PP
345 .B \%wattr_get
346 does
347 .I not
348 fail if its
349 .I \%attrs
350 or
351 .I \%pair
352 parameter is
353 .IR NULL "."
354 .PP
355 Functions prefixed with \*(``mv\*('' first perform cursor movement and
356 fail if the position
357 .RI ( y ,
358 .IR x )
359 is outside the window boundaries.
360 .\" ---------------------------------------------------------------------------
361 .SH NOTES
362 .BR \%attr_on ","
363 .BR \%attr_off ","
364 .BR \%attr_set ","
365 .BR \%wattr_set ","
366 .BR \%chgat ","
367 .BR \%mvchgat ","
368 .BR \%mvwchgat ","
369 .BR \%wchgat ","
370 and
371 .B \%color_set
372 are part of
373 .IR \%ncurses "'s"
374 wide-character API,
375 and are not available in its non-wide configuration.
376 .PP
377 .BR \%attron ","
378 .BR \%wattron ","
379 .BR \%attroff ","
380 .BR \%wattroff ","
381 .BR \%attrset ","
382 .BR \%wattrset ","
383 .BR \%standout ","
384 and
385 .B \%standend
386 may be implemented as macros.
387 .PP
388 Color pair values may be logically \*(``or\*(''-ed with attributes
389 if the pair number is less than 256.
390 The alternate functions such as \fBcolor_set\fP can pass a color pair
391 value directly.
392 However,
393 .I \%ncurses
394 ABI 4 and 5 simply logically \*(``or\*('' this value
395 within the alternate functions.
396 You must use
397 .I \%ncurses
398 ABI 6 to support more than 256 color pairs.
399 .\" ---------------------------------------------------------------------------
400 .SH EXTENSIONS
401 This implementation provides the \fBA_ITALIC\fP attribute for terminals
402 which have the \fBenter_italics_mode\fP (\fBsitm\fP)
403 and \fBexit_italics_mode\fP (\fBritm\fP) capabilities.
404 Italics are not mentioned in X/Open Curses.
405 Unlike the other video attributes, \fBA_ITALIC\fP is unrelated
406 to the \fBset_attributes\fP capabilities.
407 This implementation makes the assumption that
408 \fBexit_attribute_mode\fP may also reset italics.
409 .PP
410 Each of the functions added by XSI Curses has a parameter \fIopts\fP,
411 which X/Open Curses still (after more than twenty years) documents
412 as reserved for future use, saying that it should be
413 .IR NULL "."
414 This implementation uses that parameter in ABI 6 for the functions which
415 have a color pair parameter to support \fIextended color pairs\fP:
416 .bP
417 For functions which modify the color, e.g.,
418 \fBwattr_set\fP and \fBwattr_on\fP,
419 if \fIopts\fP is set it is treated as a pointer to
420 .IR int ","
421 and used to set the color pair instead of the
422 .I short
423 .I pair
424 parameter.
425 .bP
426 For functions which retrieve the color, e.g.,
427 \fBwattr_get\fP,
428 if \fIopts\fP is set it is treated as a pointer to
429 .IR int ","
430 and used to retrieve the color pair as an
431 .I int
432 value,
433 in addition to
434 retrieving it via the standard pointer to
435 .I short
436 parameter.
437 .bP
438 For functions which turn attributes off, e.g.,
439 \fBwattr_off\fP,
440 the \fIopts\fP parameter is ignored except to check that it is
441 .IR NULL "."
442 .\" ---------------------------------------------------------------------------
443 .SH PORTABILITY
444 These functions are described in X/Open Curses Issue\ 4.
445 It specifies no error conditions for them.
446 .PP
447 The standard defined the dedicated type for highlights,
448 .IR \%attr_t ","
449 which was not defined in SVr4
450 .IR curses "."
451 The functions taking
452 .I \%attr_t
453 arguments were not supported under SVr4.
454 .PP
455 SVr4 describes the functions not taking
456 .I \%attr_t
457 or
458 .I pair
459 arguments as always returning
460 .BR 1 "." \" Courier roman in source; SVID 4, vol. 3, p. 480
461 .PP
462 Very old versions of this library did not force an update of the screen
463 when changing the attributes.
464 Use \fBtouchwin\fP to force the screen to match the updated attributes.
465 .PP
466 X/Open Curses states that whether the traditional functions
467 \fBattron\fP/\fBattroff\fP/\fBattrset\fP can manipulate attributes other than
468 \fBA_BLINK\fP, \fBA_BOLD\fP, \fBA_DIM\fP, \fBA_REVERSE\fP, \fBA_STANDOUT\fP, or
469 \fBA_UNDERLINE\fP is \*(``unspecified\*(''.
470 Under this implementation as well as
471 SVr4
472 .IR curses ","
473 these functions correctly manipulate all other highlights
474 (specifically, \fBA_ALTCHARSET\fP, \fBA_PROTECT\fP, and \fBA_INVIS\fP).
475 .PP
476 X/Open Curses added these entry points:
477 .sp
478 .RS
479 \fBattr_get\fP, \fBattr_on\fP,
480 \fBattr_off\fP, \fBattr_set\fP, \fBwattr_on\fP, \fBwattr_off\fP,
481 \fBwattr_get\fP, \fBwattr_set\fP
482 .RE
483 .PP
484 The new functions are intended to work with
485 a new series of highlight macros prefixed with \fBWA_\fP.
486 The older macros have direct counterparts in the newer set of names:
487 .PP
488 .RS
489 .ne 9
490 .TS
491 Lb Lb
492 Lb Lx.
493 Name Description
494 _
495 WA_NORMAL Normal display (no highlight)
496 WA_STANDOUT T{
497 Best highlighting mode of the terminal
498 T}
499 WA_UNDERLINE Underlining
500 WA_REVERSE Reverse video
501 WA_BLINK Blinking
502 WA_DIM Half bright
503 WA_BOLD Extra bright or bold
504 WA_ALTCHARSET Alternate character set
505 .TE
506 .RE
507 .PP
508 X/Open Curses does not assign values to these symbols,
509 nor does it state whether or not they are related to the
510 similarly-named A_NORMAL, etc.:
511 .bP
512 X/Open Curses specifies that each pair of corresponding \fBA_\fP
513 and \fBWA_\fP-using functions operates on the same current-highlight
514 information.
515 .bP
516 However, in some implementations, those symbols have unrelated values.
517 .IP
518 For example, the Solaris \fIxpg4\fP (X/Open)
519 .I curses
520 declares
521 .I \%attr_t
522 to be an unsigned short integer (16-bits),
523 while
524 .I \%chtype
525 is a unsigned integer (32-bits).
526 The \fBWA_\fP symbols in this case are different from the \fBA_\fP symbols
527 because they are used for a smaller datatype which does not
528 represent \fBA_CHARTEXT\fP or \fBA_COLOR\fP.
529 .IP
530 In this implementation (as in many others), the values happen to be
531 the same because it simplifies copying information between
532 .I \%chtype
533 and
534 .I \%cchar_t
535 variables.
536 .bP
537 Because
538 .IR \%ncurses 's
539 .I \%attr_t
540 can hold a color pair
541 (in the \fBA_COLOR\fP field),
542 a call to
543 \fBwattr_on\fP,
544 \fBwattr_off\fP, or
545 \fBwattr_set\fP
546 may alter the window's color.
547 If the color pair information in the attribute parameter is zero,
548 no change is made to the window's color.
549 .IP
550 This is consistent with SVr4
551 .IR curses ";"
552 X/Open Curses does not specify this.
553 .PP
554 The X/Open Curses extended conformance level adds new highlights
555 \fBA_HORIZONTAL\fP, \fBA_LEFT\fP, \fBA_LOW\fP, \fBA_RIGHT\fP, \fBA_TOP\fP,
556 \fBA_VERTICAL\fP (and corresponding \fBWA_\fP macros for each).
557 As of August 2013,
558 no known terminal provides these highlights
559 (i.e., via the \fBsgr1\fP capability).
560 .\" ---------------------------------------------------------------------------
561 .SH HISTORY
562 4BSD (1980)
563 used a
564 .I char
565 to represent each cell of the terminal screen.
566 It assumed 7-bit character codes,
567 employing the eighth bit of a byte to represent a
568 .I \%standout
569 attribute
570 (often implemented as bold and/or reverse video).
571 It introduced
572 .IR \%standout ","
573 .IR \%standend ","
574 .IR \%wstandout ","
575 and
576 .I \%wstandend
577 functions to manipulate this bit.
578 Despite their inflexibility,
579 they carried over into System\ V
580 .I curses
581 and ultimately X/Open Curses
582 due to their pervasive use in legacy applications.
583 While some 1980s terminals supported a variety of video attributes,
584 BSD
585 .I curses
586 could do nothing with them.
587 .PP
588 SVr2 (1984)
589 provided an improved
590 .I curses
591 library,
592 introducing
593 .I \%chtype
594 to create the abstract notion of a
595 .I curses
596 character;
597 this was by default an
598 .IR "unsigned short" ","
599 with a provision for compile-time redefinition to other integral types
600 (a freedom not necessarily available to users of shared libraries,
601 and in any event a source license was necessary to exercise it).
602 It added the functions
603 .IR \%attron ","
604 .IR \%attroff ","
605 .IR \%attrset ","
606 .IR \%wattron ","
607 .IR \%wattroff ","
608 and
609 .IR \%wattrset ","
610 and defined the
611 .I A_
612 macros listed above
613 (except for
614 .I \%A_ITALIC
615 and
616 .IR \%A_COLOR ")"
617 for use by applications to manipulate other attributes.
618 The values of these macros
619 were not necessarily the same in different systems,
620 even among those certified as System\ V.
621 .PP
622 SVr3.2 (1988)
623 added the
624 .I \%A_COLOR
625 macro along with a color system;
626 see \fBcurs_color\fP(3X).
627 .PP
628 X/Open Curses Issue\ 4 (1995) is largely based on SVr4
629 .IR curses ","
630 but recognized that the
631 .I \%wchar_t
632 type of ISO C95 was intended to house only a single character code,
633 not a sequence of codes combining with a base character,
634 let alone could it reliably offer room for a color pair identifier
635 and a set of attribute bits with a potential for further growth \(em
636 thus the standard invented the
637 .I curses
638 complex character type
639 .I \%cchar_t
640 and a separate type
641 .I \%attr_t
642 for storage of attribute bits.
643 The new types brought along several new functions to manipulate them,
644 some corresponding to existing
645 .IR chtype -based
646 functions
647 .RI \%( attr_on ,
648 .IR \%attr_off ","
649 .IR \%attr_set ","
650 .IR \%wattr_on ","
651 .IR \%wattr_off ","
652 and
653 .IR \%wattr_set "),"
654 and some new
655 .RI \%( chgat
656 and its variants,
657 .IR \%color_set ","
658 and
659 .IR \%wcolor_set ")."
660 .PP
661 Different Unix systems used differently sized bit fields in
662 .I \%chtype
663 for the character code and the color pair identifier,
664 and took into account platforms' different integer sizes
665 (32- versus 64-bit).
666 .PP
667 The following table showing the number of bits for
668 .I \%A_COLOR
669 and
670 .I \%A_CHARTEXT
671 was gleaned from the
672 .I curses
673 header files for various operating systems and architectures.
674 The inferred architecture and notes
675 reflect the format and size of the defined constants
676 as well as clues such as the alternate character set implementation.
677 A 32-bit library can be used on a 64-bit system,
678 but not necessarily the converse.
679 .PP
680 .TS
681 Lb Lb Lb Cb S Lb
682 Lb2 Lb Lb2 Lb2 Lb2 Lb
683 L L L L L Lx.
684 \& \& \& Bits \&
685 Year System Arch Color Char Notes
686 _
687 1992 Solaris 5.2 32 6 17 SVr4 \fIcurses\fP
688 1992 HP-UX 9 32 no 8 SVr2 \fIcurses\fP
689 1992 AIX 3.2 32 no 23 SVr2 \fIcurses\fP
690 1994 OSF/1 r3 32 no 23 SVr2 \fIcurses\fP
691 1995 HP-UX 10.00 32 6 16 SVr3 \fIcurses_colr\fP
692 1995 HP-UX 10.00 32 6 8 SVr4, X/Open \fIcurses\fP
693 1995 Solaris 5.4 32/64 7 16 X/Open \fIcurses\fP
694 1996 AIX 4.2 32 7 16 X/Open \fIcurses\fP
695 1996 OSF/1 r4 32 6 16 X/Open \fIcurses\fP
696 1997 HP-UX 11.00 32 6 8 X/Open \fIcurses\fP
697 2000 UWIN 32/64 7/31 16 uses \fIchtype\fP
698 .TE
699 .PP
700 Notes:
701 .RS 3
702 .PP
703 Regarding HP-UX,
704 .bP
705 HP-UX 10.20 (1996) added support for 64-bit PA-RISC processors in 1996.
706 .bP
707 HP-UX 10.30 (1997) marked \*(``curses_colr\*('' obsolete.
708 That version of
709 .I curses
710 was dropped with HP-UX 11.30 in 2006.
711 .PP
712 Regarding OSF/1 (and Tru64),
713 .bP
714 These used 64-bit hardware.
715 Like
716 .IR \%ncurses ","
717 the OSF/1
718 .I curses
719 interface is not customized for 32-bit and 64-bit
720 versions.
721 .bP
722 Unlike other systems which evolved from AT&T code,
723 OSF/1 provided a new implementation for X/Open Curses.
724 .PP
725 Regarding Solaris,
726 .bP
727 The initial release of Solaris was in 1992.
728 .bP
729 Its XPG4
730 (X/Open Curses-conforming)
731 .I xcurses
732 library was developed by Mortice Kern Systems from 1990 to 1995.
733 Sun's copyright began in 1996.
734 .bP
735 Sun updated the X/Open Curses interface
736 after 64-bit support was introduced in 1997,
737 but did not modify the SVr4
738 .I curses
739 interface.
740 .PP
741 Regarding UWIN,
742 .bP
743 Development of the
744 .I curses
745 library began in 1991, stopped in 2000.
746 .bP
747 Color support was added in 1998.
748 .bP
749 The library uses only
750 .I \%chtype
751 (not
752 .IR \%cchar_t ")."
753 .RE
754 .PP
755 Once X/Open Curses was adopted in the mid-1990s, the constraint of
756 a 32-bit interface with many colors and wide-characters for
757 .I \%chtype
758 became a moot point.
759 The
760 .I \%cchar_t
761 structure
762 (whose size and members are not specified in X/Open Curses)
763 could be extended as needed.
764 .PP
765 Other interfaces are rarely used now.
766 .bP
767 BSD
768 .I curses
769 was improved slightly in 1993/1994 using Keith Bostic's
770 modification to make the library 8-bit clean for \fInvi\fP(1).
771 He moved the
772 .I \%standout
773 attribute to a structure member.
774 The resulting 4.4BSD
775 .I curses
776 was replaced by
777 .I \%ncurses
778 over the next ten years.
779 .bP
780 UWIN has been defunct since 2012.
781 .PP
782 .I \%ncurses
783 6.0 (2015)
784 added the
785 .I A_ITALIC
786 macro.
787 .\" ---------------------------------------------------------------------------
788 .SH SEE ALSO
789 \fB\%curses\fP(3X),
790 \fB\%curs_addch\fP(3X),
791 \fB\%curs_addstr\fP(3X),
792 \fB\%curs_bkgd\fP(3X),
793 \fB\%curs_printw\fP(3X),
794 \fB\%curs_variables\fP(3X)