/**
*
*  BVIDEO.H	 Header file for Direct Video functions for TURBO C TOOLS
*
*  Version 6.00  (C)Copyright Blaise Computing Inc.  1986,1987,1989
*
**/

#ifndef DEF_BVIDEO		      /* Prevent redefinition.	      */

#include <string.h>		      /* For strlen().		      */

#include <bscreens.h>

    /* Global variables.					      */

extern int b_vifast;		      /* Nonzero if interference is   */
				      /*  to be ignored -- use fastest*/
				      /*  possible method.	      */

    /* TURBO C TOOLS functions implemented as macros		      */

#define  vidspmsg(row,col,fore,back,pmsg)		  \
		  (viwrrect((row),(col),		  \
			    (row),(col)+strlen(pmsg)-1,   \
			    (pmsg),			  \
			    (fore),(back),CHARS_ONLY))

#define  viwrrect(u_row,u_col,l_row,l_col,buffer,fore,back,option)     \
	(viwrsect((u_row),(u_col),(l_row),(l_col),(buffer),0,	       \
		  (fore),(back),(option)))

#define  virdrect(u_row,u_col,l_row,l_col,buffer,option)	       \
	(virdsect((u_row),(u_col),(l_row),(l_col),(buffer),0,(option)))

    /* Function declarations					      */

int cdecl virdsect(int,int,int,int,   /* Read rectangle from video    */
	       char *,unsigned,int);  /* memory.		      */
				      /*			      */
int cdecl viwrsect(int,int,int,int,   /* Write rectangle to video     */
  const char *,unsigned,int,int,int); /* memory.		      */
				      /*			      */
int cdecl viatrect(int,int,int,int,   /* Change attributes in	      */
		   int,int);	      /* rectangular region.	      */
				      /*			      */
int cdecl viscroll(int,int,	      /* Vertically scroll area on    */
	    int,int,int,int,int);     /* current display page.	      */
				      /*			      */
int cdecl vihoriz(int,int,	      /* Horizontally scroll area on  */
	    int,int,int,int,int);     /* current display page.	      */
				      /*			      */
char far * cdecl viptr(int,int);      /* Convert screen location to   */
				      /* physical address.	      */

    /* Declaration of internal function.			      */

int cdecl vidirec0(		      /* Perform direct access to     */
    const char far * const *,	      /* video memory.		      */
    char far * const *, 	      /*			      */
    int,int,int,int,int,unsigned);    /*			      */

    /* Aliases for older versions				      */

#define viads(row,col,pads)					       \
	(((* ((char far **) (pads)) = viptr (row, col)) != FARNIL)     \
	 ? (pads)						       \
	 : (NIL))

#define vidirect(ppfrom,ppto,num_rows,row_length,scn_width,attr,option)\
       (vidirec0((ppfrom),(ppto),(num_rows),(row_length),	       \
		 (scn_width),(attr),(option),0))

#define DEF_BVIDEO  1		      /* Prevent second reading of    */
				      /* these definitions.	      */

#endif				      /* Ends "#ifndef DEF_BVIDEO"    */
