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

  1. /**
  2. *
  3. * Name        scread -- Return the displayed character and attribute
  4. *
  5. * Synopsis    ch = scread(pfore,pback);
  6. *
  7. *        char ch       Returned character
  8. *        int *pfore      Foreground attribute
  9. *        int *pback      Background attribute
  10. *
  11. * Description    This function returns the character at the current
  12. *        cursor position on the current display page.
  13. *
  14. *        The display attribute byte at the current position is
  15. *        returned as the foreground and background display
  16. *        attributes.  However, these values are undefined if the
  17. *        screen is in a graphics mode.
  18. *
  19. * Returns    ch          Character read
  20. *        *pfore          Foreground attribute
  21. *        *pback          Background attribute
  22. *
  23. * Version    6.00 (C)Copyright Blaise Computing Inc.  1983,1987,1989
  24. *
  25. **/
  26.  
  27. #include <dos.h>
  28.  
  29. #include <bscreens.h>
  30.  
  31. char scread(pfore,pback)
  32. int *pfore;
  33. int *pback;
  34. {
  35.     union REGS inregs,outregs;
  36.  
  37.     inregs.h.ah = 8;
  38.     inregs.h.bh = (unsigned char) b_curpage;
  39.  
  40.     int86(SC_BIOS_INT,&inregs,&outregs);
  41.  
  42.     *pfore = utlonyb(outregs.h.ah);
  43.     *pback = uthinyb(outregs.h.ah);
  44.  
  45.     return outregs.h.al;
  46. }
  47.