xref: /original-bsd/lib/libcurses/move.c (revision 730930d2)
1 /*
2  * Copyright (c) 1981, 1993, 1994
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  */
7 
8 #ifndef lint
9 static char sccsid[] = "@(#)move.c	8.2 (Berkeley) 05/04/94";
10 #endif	/* not lint */
11 
12 #include "curses.h"
13 
14 /*
15  * wmove --
16  *	Moves the cursor to the given point.
17  */
18 int
19 wmove(win, y, x)
20 	register WINDOW *win;
21 	register int y, x;
22 {
23 
24 #ifdef DEBUG
25 	__CTRACE("wmove: (%d, %d)\n", y, x);
26 #endif
27 	if (x < 0 || y < 0)
28 		return (ERR);
29 	if (x >= win->maxx || y >= win->maxy)
30 		return (ERR);
31 	win->curx = x;
32 	win->lines[win->cury]->flags &= ~__ISPASTEOL;
33 	win->cury = y;
34 	win->lines[y]->flags &= ~__ISPASTEOL;
35 	return (OK);
36 }
37