[Top][All Lists]

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

Re: putp in non-screen app

From: Thomas Dickey
Subject: Re: putp in non-screen app
Date: Fri, 20 Nov 2009 17:56:46 -0500 (EST)

On Fri, 20 Nov 2009, Charles Wilson wrote:

With --enable-sp-funcs, it appears that putp can't be used in non-screen
apps anymore (such as tput.exe).

This is because, when NCURSES_SP_FUNCS, putp is;

putp(const char *string)
   return NCURSES_SP_NAME(putp) (CURRENT_SCREEN, string);

perhaps that should be CURRENT_SCREEN_PRE, which covers cases like this.


So, to use putp, you need to call initscr() (and possibly various other
setup functions) when NCURSES_SP_FUNCS.  However, the man page for putp
only says you need to call setupterm().

Is this change in the behavior/requirements of putp intended (when
--enable-sp-funcs), or is this a bug?  If it is intended, then tput

It's a bug - now that I have everything in one source, I'm intending to
work through things like this.  (Bugs in the non-sp-funcs "original"
flavor do get higher priority, of course).

needs the following change (or something similar):

--- progs/tput.c    2009-10-26 17:49:12.971112200 -0400
+++ progs/tput.c    2009-11-20 13:14:16.700000000 -0500
@@ -345,8 +345,7 @@ tput(int argc, char *argv[])

-       /* use putp() in order to perform padding */
-       putp(s);
+       tputs(s, 1, putchar);

that looks like it's in the right direction, though it's preferable to make the library entrypoints behave the same (will see).

Thomas E. Dickey

reply via email to

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