home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c005 / 5.ddi / C / WNCURPOS.C < prev    next >
Encoding:
C/C++ Source or Header  |  1986-08-05  |  1.1 KB  |  46 lines

  1. /**
  2. *
  3. * Name        wncurpos -- Return the current window's cursor position.
  4. *
  5. * Synopsis    presult = wncurpos(prow,pcolumn);
  6. *
  7. *        BWINDOW *presult  Pointer to current window structure,
  8. *                  or NIL if failure.
  9. *        int *prow      Row (relative to top row of window) of
  10. *                  cursor
  11. *        int *pcolumn      Column (relative to leftmost column of
  12. *                  window) of cursor
  13. *
  14. * Description    This function returns the position of the current
  15. *        window's own cursor relative to the upper left-hand
  16. *        corner of the window's data area.
  17. *
  18. * Returns    presult       Pointer to current BWINDOW
  19. *                  structure, or NIL if failure.
  20. *        *prow,*pcolumn      Position of cursor.
  21. *        b_wnerr       Possible values:
  22. *                  (No change)       Success.
  23. *                  WN_BAD_WIN       No window designated
  24. *                           as current.
  25. *
  26. * Version    3.0  (C)Copyright Blaise Computing Inc. 1986
  27. *
  28. **/
  29.  
  30. #include <bwindow.h>
  31.  
  32. BWINDOW *wncurpos(prow,pcolumn)
  33. int *prow,*pcolumn;
  34. {
  35.     if (wnvalwin(b_pcurwin) == NIL)
  36.     {
  37.     wnerror(WN_BAD_WIN);
  38.     return NIL;
  39.     }
  40.  
  41.     *prow    = b_pcurwin->cur_loc.row;
  42.     *pcolumn = b_pcurwin->cur_loc.col;
  43.  
  44.     return b_pcurwin;
  45. }
  46.