home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c070 / 4.ddi / TOOLS.4 / TCTSRC1.EXE / SCCURST.C < prev    next >
Encoding:
C/C++ Source or Header  |  1989-03-31  |  1.7 KB  |  58 lines

  1. /**
  2. *
  3. * Name        sccurst -- Returns the cursor position and size from
  4. *                current display page
  5. *
  6. * Synopsis    is_off = sccurst(prow,pcol,phigh,plow);
  7. *
  8. *        int is_off      1 if cursor is off, 0 if on
  9. *        int *prow      Pointer to row value        returned
  10. *        int *pcol      Pointer to column value   returned
  11. *        int *phigh      Pointer to high scan line returned
  12. *        int *plow      Pointer to low scan line  returned
  13. *
  14. * Description    SCCURST returns the current cursor location on the
  15. *        current display device and page and the current size of
  16. *        the cursor.  It also reports whether the cursor is on or
  17. *        off.
  18. *
  19. *        Blaise C TOOLS do not record cursor sizes and on/off
  20. *        states for inactive display pages.  That is, the cursor
  21. *        size for the active page also applies to all inactive
  22. *        pages.
  23. *
  24. *        This function operates by querying BIOS about the status
  25. *        of the cursor.    Some IBM programs alter the cursor size
  26. *        without alerting BIOS about the change, so the BIOS may
  27. *        report inaccurate information about cursor size.
  28. *        SCCURST is subject to such inaccuracies.
  29. *
  30. * Returns    is_off          1 if cursor is off, 0 if on
  31. *        *prow,*pcol,*phigh,*plow
  32. *
  33. * Version    6.00 (C)Copyright Blaise Computing Inc.  1986,1987,1989
  34. *
  35. **/
  36.  
  37. #include <dos.h>
  38.  
  39. #include <bscreens.h>
  40.  
  41. int sccurst(prow,pcol,phigh,plow)
  42. int *prow,*pcol,*phigh,*plow;
  43. {
  44.     union REGS inregs,outregs;          /* Registers for BIOS call      */
  45.  
  46.     inregs.h.ah = 0x03;           /* Set up the call to the BIOS  */
  47.     inregs.h.bh = (unsigned char) b_curpage;
  48.  
  49.     int86(SC_BIOS_INT,&inregs,&outregs);
  50.  
  51.     *prow  = outregs.h.dh;
  52.     *pcol  = outregs.h.dl;
  53.     *phigh = utlonyb(outregs.h.ch);        /* Use actual values. */
  54.     *plow  = utlonyb(outregs.h.cl);
  55.  
  56.     return ((outregs.h.ch & 0x60) != 0);
  57. }
  58.