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

  1. /**
  2. *
  3. * Name        gvrdrect -- Read contents of rectangular region
  4. *                from the current display page
  5. *                via BIOS or directly
  6. *
  7. * Synopsis    num_read = gvrdrect(u_row,u_col,l_row,l_col,buffer,option);
  8. *
  9. *        int  num_read    Number of character cells actually read
  10. *        int  u_row    Top row to read (0 = top of screen)
  11. *        int  u_col    Leftmost column to read (0 = left edge)
  12. *        int  l_row    Bottom row to read
  13. *        int  l_col    Rightmost column to read
  14. *        char *buffer    Space in which to put the data
  15. *        int  option    One bit in the option value tells
  16. *                SCRDRECT how the buffer is constructed.
  17. *                The two possible values for this bit are:
  18. *
  19. *              Value        Meaning
  20. *              -----------   ------------------------------------
  21. *              CHARS_ONLY    Buffer contains characters only.
  22. *              CHAR_ATTR     Buffer contains (char,attr) pairs.
  23. *
  24. * Description    This function reads the contents of a rectangular region
  25. *        on the current display page with or without the
  26. *        corresponding video attributes.  The cursor is not
  27. *        moved.    The data is read row by row.
  28. *
  29. *        The upper left corner of the region is (u_row,u_col),
  30. *        where (0,0) represents the upper left corner of the
  31. *        entire screen.    The lower right corner of the region is
  32. *        (l_row,l_col), where (24,79) is the lower right corner
  33. *        of an 80-by-25 screen.
  34. *
  35. *        The returned value reports the number of "character
  36. *        cells" read, where "character cells" means the number of
  37. *        physical spaces on the screen.    (If CHAR_ATTR is
  38. *        specified, twice this number of bytes will be returned
  39. *        in the buffer.)
  40. *
  41. *        If CHAR_ATTR is specified and the screen is in a
  42. *        graphics mode, then 1 will be returned as the attribute
  43. *        value regardless of the colors of the displayed
  44. *        characters.
  45. *
  46. *        Be aware that this function does NOT add a trailing NUL
  47. *        ('\0') at the end of the buffer, and that any 8-bit
  48. *        character may be present in the buffer, depending on
  49. *        what is in video memory.
  50. *
  51. *        This function is available in two versions.  These call
  52. *        SCRDRECT (which uses BIOS only) or VIRDRECT (direct from
  53. *        video memory) depending on the value of the symbol
  54. *        GV_OPTION.  These versions are therefore subject to
  55. *        differing limitations.
  56. *
  57. * Returns    num_read    Number of character cells read
  58. *        *buffer     Characters read from the display page
  59. *                (perhaps with their attributes)
  60. *
  61. * Version    3.0  (C)Copyright Blaise Computing Inc. 1986
  62. *
  63. **/
  64.  
  65. #include <bgenvid.h>
  66.  
  67. int gvrdrect(u_row,u_col,l_row,l_col,buffer,option)
  68. int  u_row,u_col,l_row,l_col;
  69. char *buffer;
  70. int  option;
  71. {
  72. #if (GV_OPTION) == (GV_BIOS)
  73.  
  74.     return scrdrect(u_row,u_col,l_row,l_col,buffer,option);
  75.  
  76. #else
  77.  
  78.     return virdrect(u_row,u_col,l_row,l_col,buffer,option);
  79.  
  80. #endif
  81. }
  82.