Hi Robin, all,
On 2/1/26 19:34, Robin Haberkorn wrote:> On Sat Jan 31, 2026 at 18:02:01
GMT +01, Bill Gray wrote:>> However, looking at your example, it
seems to me that any curses
implementation that has getcchar( ) ought to define CCHARW_MAX.
Good idea. Could you add it to PDCursesMod?
Done.
@Bill Gray
But then looking at PDCursesMod, that's exactly what you are
doing as well.
You are reserving PDC_COLOR_BITS bits for the color pair
which is >= 15 only on systems with 64-bit chtype.
You could also have as little as 5 bits.
So not even 8 bits is a given.
True. But I think that on any curses implementation, you have to
look at COLOR_PAIRS. On PDCursesMod, that value can be (at most) 32,
256, 4096, 8192, or 1048576, depending on whether 5, 8, 12, 13,
or 20 bits are available for storing color pairs.
The end result is that (in PDCurses and PDCursesMod, at least) the
COLOR_PAIR and PAIR_NUMBER macros will always work for pair indices from
0 to COLOR_PAIRS - 1.
-- Bill
You should be explicit about such restrictions in the
documentation.
Seriously, I don't know what to make of this.
Since I also need to know the maximum number of pairs
I'd need a few ifdefs per curses implementation including
secret knowledge about implementation details or undocumented
macros...
Best regards,
Robin