bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Question: How does ncurses store and handle "wide" characters?


From: pjfarley3
Subject: RE: Question: How does ncurses store and handle "wide" characters?
Date: Wed, 2 Jun 2021 22:20:20 -0400

> -----Original Message-----
> From: Thomas Dickey <dickey@his.com>
> Sent: Wednesday, June 2, 2021 4:08 AM
> To: pjfarley3@earthlink.net
> Cc: 'Bill Gray' <pluto@projectpluto.com>; bug-ncurses@gnu.org
> Subject: Re: Question: How does ncurses store and handle "wide"
characters?
<Snipped> 
> > I finally figured out to use a tiny c source with nothing but this:
> >
> > #define NCURSES_WIDECHAR
> > #include <ncurses.h>
> 
> that's in the manual page (which is a good starting place).

And of course I probably should have started there.

<Snipped>
> > That should not be necessary, nor is it sufficient.  IMHO PDCursesMod
> > does a better job of assisting potential bug fixers and contributors
> > by starting out with clear, basic text information showing the data
> > structures that are manipulated by the code.  IBM mainframe (non-*ix)
> > operating system documentation has done this superbly for multiple
> > decades, extracted (as Bill says that his documentation is) mostly
> > mechanically from the mainframe equivalent of "headers".
> 
> actually you're telling me that PDCurses has an unnecessary deviation from
> X/Open Curses.  Bill's comment was by the way referring to a source-file
in
> PDCurses, not relevant to IBM curses.  Just as well - AIX curses has its
own
> problems...
> 
> X/Open Curses states clearly enough that the wide-character definitions
aren't
> available by default.

I think perhaps you misunderstood my comment re:IBM documentation.  I was
referring to the IBM documentation of its own proprietary OS's, mainly those
in the MVS series, not to any IBM documentation of any curses library or
implementation thereof.

The point I tried to make (poorly) is that documented bits-and-bytes layouts
for internal data structures are immensely helpful to old hands and
newcomers alike, with Bill's documentation just another example thereof.

Reading C headers (except for the simplest) gives me (and I suspect others)
headaches.

<Snipped>
> > However, when running a simple python curses script in an *ix
environment
> that is using the ncurses library, I get this display for the values of
> curses.COLOR_PAIRS and curses.COLORS:
> >
> > pairs=65536, colors=256
> >
> > Is that the python curses implementation providing 65536 color pairs
> > (an unsigned short int's worth) or is the ncurses library providing that
many?
> > If the ncurses library is providing 65536 (presumably distinct) color
> > pairs, how is it accomplished with only a one-byte color-pair storage
> > in both wide and narrow "character" structures?
> 
> ncurses does that (python is unable to do this by itself).
> 
> again, the header file is the place to look (along with term.h, and the
release
> notes for ncurses 6.1, etc).

Thanks for the plain answer.  I thought that would be the case but wanted so
be sure.

Would it really be that harmful or difficult to describe important data
structures in text, perhaps in a man page somewhere?  Even if the headers
CAN be used to decipher the structures, it is far from an easy or
straightforward method.

Peter
--





reply via email to

[Prev in Thread] Current Thread [Next in Thread]