home *** CD-ROM | disk | FTP | other *** search
- /**
- *
- * Name gvrdrect -- Read contents of rectangular region
- * from the current display page
- * via BIOS or directly
- *
- * Synopsis num_read = gvrdrect(u_row,u_col,l_row,l_col,buffer,option);
- *
- * int num_read Number of character cells actually read
- * int u_row Top row to read (0 = top of screen)
- * int u_col Leftmost column to read (0 = left edge)
- * int l_row Bottom row to read
- * int l_col Rightmost column to read
- * char *buffer Space in which to put the data
- * int option One bit in the option value tells
- * SCRDRECT how the buffer is constructed.
- * The two possible values for this bit are:
- *
- * Value Meaning
- * ----------- ------------------------------------
- * CHARS_ONLY Buffer contains characters only.
- * CHAR_ATTR Buffer contains (char,attr) pairs.
- *
- * Description This function reads the contents of a rectangular region
- * on the current display page with or without the
- * corresponding video attributes. The cursor is not
- * moved. The data is read row by row.
- *
- * The upper left corner of the region is (u_row,u_col),
- * where (0,0) represents the upper left corner of the
- * entire screen. The lower right corner of the region is
- * (l_row,l_col), where (24,79) is the lower right corner
- * of an 80-by-25 screen.
- *
- * The returned value reports the number of "character
- * cells" read, where "character cells" means the number of
- * physical spaces on the screen. (If CHAR_ATTR is
- * specified, twice this number of bytes will be returned
- * in the buffer.)
- *
- * If CHAR_ATTR is specified and the screen is in a
- * graphics mode, then 1 will be returned as the attribute
- * value regardless of the colors of the displayed
- * characters.
- *
- * Be aware that this function does NOT add a trailing NUL
- * ('\0') at the end of the buffer, and that any 8-bit
- * character may be present in the buffer, depending on
- * what is in video memory.
- *
- * This function is available in two versions. These call
- * SCRDRECT (which uses BIOS only) or VIRDRECT (direct from
- * video memory) depending on the value of the symbol
- * GV_OPTION. These versions are therefore subject to
- * differing limitations.
- *
- * Returns num_read Number of character cells read
- * *buffer Characters read from the display page
- * (perhaps with their attributes)
- *
- * Version 3.0 (C)Copyright Blaise Computing Inc. 1986
- *
- **/
-
- #include <bgenvid.h>
-
- int gvrdrect(u_row,u_col,l_row,l_col,buffer,option)
- int u_row,u_col,l_row,l_col;
- char *buffer;
- int option;
- {
- #if (GV_OPTION) == (GV_BIOS)
-
- return scrdrect(u_row,u_col,l_row,l_col,buffer,option);
-
- #else
-
- return virdrect(u_row,u_col,l_row,l_col,buffer,option);
-
- #endif
- }