home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c005 / 4.ddi / C / SCREAD.C < prev    next >
Encoding:
C/C++ Source or Header  |  1986-08-05  |  1.0 KB  |  45 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    3.0    (C)Copyright Blaise Computing Inc. 1983, 1984, 1986
  24. *
  25. **/
  26.  
  27. #include <bscreen.h>
  28.  
  29. char scread(pfore,pback)
  30. int *pfore;
  31. int *pback;
  32. {
  33.     int ax,bx,cx,dx,flags;
  34.  
  35.     ax = utbyword(8,0);
  36.     bx = utbyword(b_curpage,0);
  37.  
  38.     bios(16,&ax,&bx,&cx,&dx,&flags);
  39.  
  40.     *pfore = utlonyb(uthibyte(ax));
  41.     *pback = uthinyb(uthibyte(ax));
  42.  
  43.     return((char) utlobyte(ax));
  44. }
  45.