[Top][All Lists]

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

Re: Return value of pair_content()

From: Bryan Christ
Subject: Re: Return value of pair_content()
Date: Sat, 19 Jan 2019 21:32:12 -0600

What I'm doing right now is looking for fg = 0 and bg = 0 as a hint that it's an used pair.  It' just kind of ugly.

On Sat, Jan 19, 2019 at 7:47 PM Thomas Dickey <address@hidden> wrote:
On Fri, Jan 18, 2019 at 09:59:45AM -0600, Bryan Christ wrote:
> According to the man pages the return value of pair_content() is somewhat
> undefined:
> "All other routines return the integer ERR upon failure and an OK  (SVr4
> specifies  only an integer value other than ERR”) upon successful
> completion.  X/Open defines no error conditions."

X/Open doesn't define much of any error conditions, but the SVr4 systems
do document (most) error conditions.

> I would like to kindly proposing that pair_content() return ERR if specific
> pair hasn't been set.

If a pair hasn't been set, then ncurses has initialized fg and bg to 0,
which isn't likely a useful color pair.  SVr4 curses would return ERR,
but that adds space (and would make the struct sizes not a power of 2,
wasting additional time/space...)

Thomas E. Dickey <address@hidden>


reply via email to

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