122672Sdist /*
2*67082Sbostic * Copyright (c) 1981, 1993, 1994
361270Sbostic * The Regents of the University of California. All rights reserved.
434677Sbostic *
542653Sbostic * %sccs.include.redist.c%
622672Sdist */
722672Sdist
822672Sdist #ifndef lint
9*67082Sbostic static char sccsid[] = "@(#)move.c 8.2 (Berkeley) 05/04/94";
1055967Sbostic #endif /* not lint */
1122672Sdist
12*67082Sbostic #include "curses.h"
1311739Sarnold
1411739Sarnold /*
1555967Sbostic * wmove --
1655967Sbostic * Moves the cursor to the given point.
1711739Sarnold */
1855967Sbostic int
wmove(win,y,x)1911739Sarnold wmove(win, y, x)
2055967Sbostic register WINDOW *win;
2155967Sbostic register int y, x;
2255967Sbostic {
2311739Sarnold
2455967Sbostic #ifdef DEBUG
2560058Sbostic __CTRACE("wmove: (%d, %d)\n", y, x);
2655967Sbostic #endif
2725110Sbloom if (x < 0 || y < 0)
2857472Sbostic return (ERR);
2956238Selan if (x >= win->maxx || y >= win->maxy)
3057472Sbostic return (ERR);
3156238Selan win->curx = x;
3259061Selan win->lines[win->cury]->flags &= ~__ISPASTEOL;
3356238Selan win->cury = y;
3456296Selan win->lines[y]->flags &= ~__ISPASTEOL;
3557472Sbostic return (OK);
3611739Sarnold }
37