bug-ncurses
[Top][All Lists]
Advanced

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

is_wintouched() and is_linetouched() cannot return ERR


From: Midolikawa H.
Subject: is_wintouched() and is_linetouched() cannot return ERR
Date: Tue, 14 Nov 2017 21:00:29 +0900
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0

Thank you for developing, maintaining and supporting ncurses.

... and I have noticed that
the manual page declares is_wintouched() and is_linetouched() to be bool,
but also says they return the integer ERR upon failure.

Acutally, is_wintouched() returns 0 when window pointer is null.
is_linetouched returns 1 if window pointer is null or line is not valid.

Test code (touch_test2.c) is here:
----------------------------------------
#include <curses.h>
#include <locale.h>
#include <stdlib.h>

//compile:
// gcc -I/usr/include/ncursesw/ -D_XOPEN_SOURCE_EXTENDED touch_test2.c -lncursesw

int main()
{
int ret, ret2, ret3;

setlocale(LC_ALL,"");
initscr();
cbreak(); noecho(); halfdelay(100);

printw("%s\n\n", curses_version() );

printw("TRUE  %d\n",  TRUE);
printw("FALSE %d\n",  FALSE);
printw("OK    %d\n",  OK);
printw("ERR   %d\n\n",ERR);

touchwin(stdscr);
//untouchwin(stdscr);

printw("is_wintouched(stdscr)    = %d\n",
        is_wintouched(stdscr) );
printw("is_linetouched(stdscr,0) = %d\n\n",
        is_linetouched(stdscr,0) );

printw("is_wintouched((WINDOW *)NULL)    = %d\n",
        is_wintouched((WINDOW *)NULL) );
printw("is_linetouched((WINDOW *)NULL,0) = %d\n",
        is_linetouched((WINDOW *)NULL,0) );
printw("is_linetouched(stdscr,999)       = %d\n\n",
        is_linetouched(stdscr,999) );

refresh();
getch();

endwin();

return(0);
}
----------------------------------------

PC:  DELL OPTIPLEX780
OS:  Ubuntu 16.04 LTS 64bit (Japanese Remix by Japanese Team)
APP: GNOME Terminal 3.18.3 / XTerm(322)
VER: ncurses 6.0.20160213

Thanks foward,

--
(^v^) (.. )(o^< >^o)
(( ))//^ ))(( ))(( ))
//mm //mm //mm //mm ================================^
.                        yaneno-suzume (as handle) // \



reply via email to

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