bug-ncurses
[Top][All Lists]
Advanced

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

-2 in numeric and string capabilities


From: Florian Weimer
Subject: -2 in numeric and string capabilities
Date: Mon, 20 Jul 2020 20:54:00 +0200

term(5) says this:

| Short integers are stored in two 8-bit bytes.  The first byte contains
| the least significant 8 bits of the value, and the second byte
| contains the most significant 8 bits.  (Thus, the value represented is
| 256*second+first.)  The value -1 is represented by the two bytes 0377,
| 0377; other negative values are illegal. […]
|
| The numbers section is similar to the flags section.  Each capability
| takes up two bytes, and is stored as a little-endian short integer.
| If the value represented is -1, the capability is taken to be
| missing.
|
| The strings section is also similar.  Each capability is stored as a
| short integer, in the format above.  A value of -1 means the
| capability is missing.  Otherwise, the value is taken as an offset
| from the beginning of the string table. […]

But the value -2 occurs in practice, too.

It seems to me that these represent “canceled” capabilities, which
appear to be an internal implementation detail of the terminfo
compiler.  I expect that applications should treat them as absent, so
like -1.  But this should probably be mentioned in term(5).



reply via email to

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