|
1 /* Public Domain Curses */ |
|
2 |
|
3 #include <curspriv.h> |
|
4 |
|
5 RCSID("$Id: move.c,v 1.28 2008/07/13 16:08:18 wmcbrine Exp $") |
|
6 |
|
7 /*man-start************************************************************** |
|
8 |
|
9 Name: move |
|
10 |
|
11 Synopsis: |
|
12 int move(int y, int x); |
|
13 int wmove(WINDOW *win, int y, int x); |
|
14 |
|
15 Description: |
|
16 The cursor associated with the window is moved to the given |
|
17 location. This does not move the physical cursor of the |
|
18 terminal until refresh() is called. The position specified is |
|
19 relative to the upper left corner of the window, which is (0,0). |
|
20 |
|
21 Return Value: |
|
22 All functions return OK on success and ERR on error. |
|
23 |
|
24 Portability X/Open BSD SYS V |
|
25 move Y Y Y |
|
26 wmove Y Y Y |
|
27 |
|
28 **man-end****************************************************************/ |
|
29 |
|
30 int move(int y, int x) |
|
31 { |
|
32 PDC_LOG(("move() - called: y=%d x=%d\n", y, x)); |
|
33 |
|
34 if (!stdscr || x < 0 || y < 0 || x >= stdscr->_maxx || y >= stdscr->_maxy) |
|
35 return ERR; |
|
36 |
|
37 stdscr->_curx = x; |
|
38 stdscr->_cury = y; |
|
39 |
|
40 return OK; |
|
41 } |
|
42 |
|
43 int wmove(WINDOW *win, int y, int x) |
|
44 { |
|
45 PDC_LOG(("wmove() - called: y=%d x=%d\n", y, x)); |
|
46 |
|
47 if (!win || x < 0 || y < 0 || x >= win->_maxx || y >= win->_maxy) |
|
48 return ERR; |
|
49 |
|
50 win->_curx = x; |
|
51 win->_cury = y; |
|
52 |
|
53 return OK; |
|
54 } |