home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / cprog / cursesp.zip / MOVE.C < prev    next >
C/C++ Source or Header  |  1991-12-02  |  2KB  |  47 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 (...mcvax!enea!infovax!bl)        */
  10. /****************************************************************/
  11. /* 1.0: Release:                                        870515  */
  12. /* 1.2: Max limits off by 1. Fixed thanks to S. Creps:  881002  */
  13. /* 1.3: MSC -W3, Turbo'C' -w -w-pro checkes:            881005  */
  14. /****************************************************************/
  15.  
  16. #include <curses.h>
  17. #include <curspriv.h>
  18.  
  19. char _curses_move_rcsid[] = "@(#)move.c v1.3 - 881005";
  20.  
  21. /****************************************************************/
  22. /* Wmove() moves the cursor in window 'win' to position (x,y).  */
  23. /****************************************************************/
  24.  
  25. int     wmove(win,y,x)
  26.   WINDOW        *win;
  27.   int            y;
  28.   int            x;
  29.   {
  30.   if ((x < 0)||(x >= win->_maxx)||(y < win->_regtop)||(y > win->_regbottom))
  31.     return(ERR);
  32.   win->_curx = x;
  33.   win->_cury = y;
  34.   return(OK);
  35.   } /* wmove */
  36.  
  37. /****************************************************************/
  38. /* Move() moves the cursor in stdscr to position (x,y).         */
  39. /****************************************************************/
  40.  
  41. int move(y,x)
  42.   int y;
  43.   int x;
  44.   {
  45.   return(wmove(stdscr,y,x));
  46.   } /* move */
  47.