setsyx() -> void, after ncurses; simplified.

This commit is contained in:
William McBrine
2018-12-13 13:03:22 -05:00
parent 0bf83a8123
commit 03212c5e17
2 changed files with 7 additions and 18 deletions

View File

@@ -1220,7 +1220,7 @@ PDCEX int draino(int);
PDCEX int resetterm(void);
PDCEX int fixterm(void);
PDCEX int saveterm(void);
PDCEX int setsyx(int, int);
PDCEX void setsyx(int, int);
PDCEX int mouse_set(unsigned long);
PDCEX int mouse_on(unsigned long);

View File

@@ -15,7 +15,7 @@ getyx
void getmaxyx(WINDOW *win, int y, int x);
void getsyx(int y, int x);
int setsyx(int y, int x);
void setsyx(int y, int x);
int getbegy(WINDOW *win);
int getbegx(WINDOW *win);
@@ -43,7 +43,7 @@ getyx
values should only be used with setsyx().
setsyx() sets the virtual screen cursor to the y, x coordinates.
If y, x are -1, -1, leaveok() is set TRUE.
If either y or x is -1, leaveok() is set TRUE, else it's set FALSE.
getsyx() and setsyx() are meant to be used by a library routine
that manipulates curses windows without altering the position of
@@ -128,23 +128,12 @@ int getmaxx(WINDOW *win)
return win ? win->_maxx : ERR;
}
int setsyx(int y, int x)
void setsyx(int y, int x)
{
PDC_LOG(("setsyx() - called\n"));
if (y == -1 && x == -1)
{
curscr->_leaveit = TRUE;
return OK;
}
else if (y == -1 || x == -1)
{
return OK;
}
else
{
curscr->_leaveit = FALSE;
curscr->_leaveit = y == -1 || x == -1;
if (!curscr->_leaveit)
wmove(curscr, y, x);
return OK;
}
}