Skip to content

Commit b2d0def

Browse files
committed
Clarified comments on text attributes and chtypes. Updated HISTORY.md and the PDC_VER_* constants.
1 parent 44caf52 commit b2d0def

3 files changed

Lines changed: 49 additions & 45 deletions

File tree

curses.h

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ Defined by this header:
4444
#define PDC_VER_MINOR 5
4545
#define PDC_VER_CHANGE 4
4646
#define PDC_VER_YEAR 2026
47-
#define PDC_VER_MONTH 01
48-
#define PDC_VER_DAY 31
47+
#define PDC_VER_MONTH 02
48+
#define PDC_VER_DAY 25
4949

5050
#define PDC_STRINGIZE( x) #x
5151
#define PDC_stringize( x) PDC_STRINGIZE( x)
@@ -418,11 +418,10 @@ PDCEX char ttytype[]; /* terminal name/description */
418418
Text Attributes
419419
===============
420420
421-
By default, PDCursesMod uses 64-bit integers for its chtype. All chtypes
422-
have bits devoted to character data, attribute data, and color pair data.
423-
There are four configurations supported :
421+
All chtypes have bits devoted to character data, attribute data, and color
422+
pair data. There are four configurations supported :
424423
425-
Default, 64-bit chtype, both wide- and 8-bit character builds:
424+
### Default, 64-bit chtype, both wide- and 8-bit character builds:
426425
427426
color pair | unused | modifiers | character eg 'a'
428427
--------------|--------|-----------------------|--------------------
@@ -433,7 +432,11 @@ Default, 64-bit chtype, both wide- and 8-bit character builds:
433432
6 currently unused bits (38-43)
434433
20 color pair bits (44-63), enough for 1048576 color pairs
435434
436-
32-bit chtypes with wide characters (CHTYPE_32 and PDC_WIDE are #defined):
435+
As of 2025 Dec 30, WinGUI, VT, X11 and X11new, Linux framebuffer,
436+
DOSVGA, OpenGL, and SDLn can have COLOR_PAIRS = 1048576. Plan9 and
437+
WinCon may join them. DOS and OS/2 lack full-color capability.
438+
439+
### 32-bit chtypes with wide characters (CHTYPE_32 and PDC_WIDE are #defined):
437440
438441
color pair | modifiers | character eg 'a'
439442
-----------------|-----------------------|--------------------
@@ -443,37 +446,27 @@ Default, 64-bit chtype, both wide- and 8-bit character builds:
443446
8 attribute bits (16-23)
444447
8 color pair bits (24-31), for 256 color pairs
445448
446-
32-bit chtypes with narrow characters (CHTYPE_32 #defined, PDC_WIDE is not):
449+
### 32-bit chtypes with narrow characters (CHTYPE_32 #defined, PDC_WIDE is not):
447450
448451
color pair | modifiers |character
449452
--------------------|---------------------|----------------
450-
31 30 29 .. 22 21 20|19 18 17 16 .. 10 9 8|7 6 5 4 3 2 1
453+
31 30 29 .. 22 21 20|19 18 17 16 .. 10 9 8|7 6 5 4 3 2 1 0
451454
452455
8 character bits (0-7); only 8-bit charsets will work
453456
12 attribute bits (8-19)
454457
12 color pair bits (20-31), for 4096 pairs
455458
456-
16-bit chtypes (CHTYPE_16 #defined, must be narrow characters) :
459+
### 16-bit chtypes (CHTYPE_16 #defined, must be narrow characters) :
457460
458461
color pair |modifs |character
459-
--------------|-------|--------------
460-
15 14 13 12 11|10 9 8 |7 6 5 4 3 2 1
462+
--------------|-------|---------------
463+
15 14 13 12 11|10 9 8 |7 6 5 4 3 2 1 0
461464
462465
8 character bits (0-7); only 8-bit charsets will work
463466
3 attribute bits (8-10) : bold, reverse, blink
464467
5 color pair bits (11-15), for 32 pairs
465468
466-
Except for 16-bit chtypes, all attribute modifier schemes include eight
467-
"basic" bits: bold, underline, right-line, left-line, italic, reverse
468-
and blink attributes, plus the alternate character set indicator. For
469-
32-bit narrow builds, three more bits are used for overlined, dimmed,
470-
and strikeout attributes; a fourth bit is reserved.
471-
472-
Default chtypes have enough character bits to support the full range of
473-
Unicode, all attributes, and 2^20 = 1048576 color pairs. Note, though,
474-
that as of 2025 Dec 30, only WinGUI, VT, X11 and X11new, Linux
475-
framebuffer, DOSVGA, OpenGL, and SDLn have COLOR_PAIRS = 1048576.
476-
Plan9 and WinCon may join them. DOS and OS/2 lack full-color capability.
469+
This is normally used only in very low-memory situations.
477470
478471
**man-end****************************************************************/
479472

docs/HISTORY.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Generally speaking, this history mentions only the more significant
22
changes. See the git log for full details.
33

4-
PDCursesMod 4.5.4 - 2026 January 07
5-
===================================
4+
PDCursesMod 4.5.4 - 2026 February 25
5+
====================================
66

77
Minor new features
88
------------------
@@ -11,6 +11,7 @@ Minor new features
1111

1212
- chtypes can be short (16-bit) integers. This is mostly of use in very
1313
memory-restricted environments, such as in some DOS code. e215a6d4b5
14+
a3762aa3fd
1415

1516
- For the GL port, the 'resize' mode can be set via the PDC_RESIZE
1617
environment variable. b8f822040e
@@ -42,7 +43,9 @@ Minor new features
4243

4344
- DOSVGA now supports ~16 million (2^24 + 256) colors and 1M (2^20)
4445
color pairs, similar to (and using the same underlying code as)
45-
WinGUI, SDLs, GL, framebuffer/DRM, and x11new. bd4cc9c616
46+
WinGUI, SDLs, GL, framebuffer/DRM, and x11new. It also now
47+
supports blinking and a few cursor styles (caret, half-block,
48+
underscore, full block). bd4cc9c616 ac0c9459aa
4649

4750
- DOSVGA Makefile revised to simplify use of DJGPP, and to use full
4851
warnings. A few 'nuisance' warnings were corrected. 141b7f642b
@@ -74,6 +77,10 @@ Bug fixes
7477
are supported on that platform in the first place, and the font
7578
actually has glyphs for them). 3d6bc63caa
7679

80+
- wchgat( ) didn't mask out colors from 'attr'. This could lead to
81+
garbage display when those colors were ORred with those from the
82+
'color' parameter. f19bc59406d
83+
7784
PDCursesMod 4.5.3 - 2025 August 11
7885
==================================
7986

docs/MANUAL.md

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Defined by this header:
1717
Macro | Meaning / value
1818
:--------------|---------------------------------------------------
1919
PDCURSES | PDCurses-only features are available
20+
PDCURSESMOD | PDCursesMod-only features are available
2021
PDC_BUILD | API build version
2122
PDC_VER_MAJOR | major version number
2223
PDC_VER_MINOR | minor version number
@@ -34,11 +35,10 @@ Defined by this header:
3435
Text Attributes
3536
===============
3637

37-
By default, PDCurses uses 64-bit integers for its chtype. All chtypes
38-
have bits devoted to character data, attribute data, and color pair data.
39-
There are three configurations supported :
38+
All chtypes have bits devoted to character data, attribute data, and color
39+
pair data. There are four configurations supported :
4040

41-
Default, 64-bit chtype, both wide- and 8-bit character builds:
41+
### Default, 64-bit chtype, both wide- and 8-bit character builds:
4242

4343
color pair | unused | modifiers | character eg 'a'
4444
--------------|--------|-----------------------|--------------------
@@ -49,7 +49,11 @@ Default, 64-bit chtype, both wide- and 8-bit character builds:
4949
6 currently unused bits (38-43)
5050
20 color pair bits (44-63), enough for 1048576 color pairs
5151

52-
32-bit chtypes with wide characters (CHTYPE_32 and PDC_WIDE are #defined):
52+
As of 2025 Dec 30, WinGUI, VT, X11 and X11new, Linux framebuffer,
53+
DOSVGA, OpenGL, and SDLn can have COLOR_PAIRS = 1048576. Plan9 and
54+
WinCon may join them. DOS and OS/2 lack full-color capability.
55+
56+
### 32-bit chtypes with wide characters (CHTYPE_32 and PDC_WIDE are #defined):
5357

5458
color pair | modifiers | character eg 'a'
5559
-----------------|-----------------------|--------------------
@@ -59,28 +63,27 @@ Default, 64-bit chtype, both wide- and 8-bit character builds:
5963
8 attribute bits (16-23)
6064
8 color pair bits (24-31), for 256 color pairs
6165

62-
32-bit chtypes with narrow characters (CHTYPE_32 #defined, PDC_WIDE is not):
66+
### 32-bit chtypes with narrow characters (CHTYPE_32 #defined, PDC_WIDE is not):
6367

6468
color pair | modifiers |character
6569
--------------------|---------------------|----------------
66-
31 30 29 .. 22 21 20|19 18 17 16 .. 10 9 8|7 6 5 4 3 2 1
70+
31 30 29 .. 22 21 20|19 18 17 16 .. 10 9 8|7 6 5 4 3 2 1 0
6771

6872
8 character bits (0-7); only 8-bit charsets will work
6973
12 attribute bits (8-19)
7074
12 color pair bits (20-31), for 4096 pairs
7175

72-
All attribute modifier schemes include eight "basic" bits: bold, underline,
73-
right-line, left-line, italic, reverse and blink attributes, plus the
74-
alternate character set indicator. For 32-bit narrow builds, three more
75-
bits are used for overlined, dimmed, and strikeout attributes; a fourth
76-
bit is reserved.
76+
### 16-bit chtypes (CHTYPE_16 #defined, must be narrow characters) :
77+
78+
color pair |modifs |character
79+
--------------|-------|---------------
80+
15 14 13 12 11|10 9 8 |7 6 5 4 3 2 1 0
7781

78-
Default chtypes have enough character bits to support the full range of
79-
Unicode, all attributes, and 2^20 = 1048576 color pairs. Note, though,
80-
that as of 2022 Jun 17, only WinGUI, VT, X11, Linux framebuffer, OpenGL,
81-
and SDLn have COLOR_PAIRS = 1048576. Other platforms (DOSVGA, Plan9, WinCon)
82-
may join them. Some (DOS, OS/2) simply do not have full-color
83-
capability.
82+
8 character bits (0-7); only 8-bit charsets will work
83+
3 attribute bits (8-10) : bold, reverse, blink
84+
5 color pair bits (11-15), for 32 pairs
85+
86+
This is normally used only in very low-memory situations.
8487

8588

8689

@@ -2465,7 +2468,8 @@ printw
24652468
### Return Value
24662469

24672470
All functions return the number of characters printed, or ERR on
2468-
error.
2471+
error. Note that this is nonstandard; other implementations return
2472+
OK upon successful completion.
24692473

24702474
### Portability
24712475
Function | X/Open | ncurses | NetBSD

0 commit comments

Comments
 (0)