home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 332_01 / move.c < prev    next >
C/C++ Source or Header  |  1990-01-06  |  2KB  |  49 lines

  1. /****************************************************************/
  2. /* Wmove() routine of the PCcurses package            */
  3. /*                                */
  4. /****************************************************************/
  5. /* This version of curses is based on ncurses, a curses version    */
  6. /* originally written by Pavel Curtis at Cornell University.    */
  7. /* I have made substantial changes to make it run on IBM PC's,    */
  8. /* and therefore consider myself free to make it public domain.    */
  9. /*                Bjorn Larsson (bl@infovox.se)    */
  10. /****************************************************************/
  11. /* 1.4:  Use of short wherever possible. Portability        */
  12. /*     improvements:                    900114    */
  13. /* 1.3:     MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  14. /* 1.2:     Max limits off by 1. Fixed thanks to S. Creps:    881002    */
  15. /* 1.0:     Release:                    870515    */
  16. /****************************************************************/
  17.  
  18. #include <curses.h>
  19. #include <curspriv.h>
  20.  
  21. char _curses_move_rcsid[] = "@(#)move.c       v.1.4  - 900114";
  22.  
  23. /****************************************************************/
  24. /* Wmove() moves the cursor in window 'win' to position (x,y).    */
  25. /****************************************************************/
  26.  
  27. int    wmove(win,y,x)
  28.   WINDOW    *win;
  29.   int         y;
  30.   int         x;
  31.   {
  32.   if ((x < 0)||(x >= win->_maxx)||(y < win->_regtop)||(y > win->_regbottom))
  33.     return(ERR);
  34.   win->_curx = x;
  35.   win->_cury = y;
  36.   return(OK);
  37.   } /* wmove */
  38.  
  39. /****************************************************************/
  40. /* Move() moves the cursor in stdscr to position (x,y).        */
  41. /****************************************************************/
  42.  
  43. int move(y,x)
  44.   int y;
  45.   int x;
  46.   {
  47.   return(wmove(stdscr,y,x));
  48.   } /* move */
  49.