/****************************************************************************
*
*				PRINT_DD.H
*
* This include file is used in all the Printer Device Driver test cases
* to declare global variables and functions, and to define global constants.
*
* Writer: Mike Traynor
* Date:   6/28/1987
*
*****************************************************************************/

#define FALSE				 0
#define TRUE				 1
/* #define FAIL 			    1 */
/* #define PASS 			    0 */
#define BUFLEN				 3000
#define BUFFAREA			 "This is my buffer area.\n"
#define BUFFLENGTH			 40
#define PRO_PRINTER			 1
#define TIME_OUT	 (unsigned long) 50000
#define COLOR_PRINTER			 2
#define GRAPHICS_PRINTER		 3
#define SELECT_PRT			 "\x11"
#define DESELECT_PRO			 "\x1b\x51\x03"
#define PRO_OFFLINE	 (unsigned char) 0x00		/**/
#define PRO_DESELECTED	 (unsigned char) 0x80		/**/
#define PRO_PAPER_OUT	 (unsigned char) 0x28		/**/
#define DESELECT_COLOR	 "\1b\x51\x02"
#define COLOR_OFFLINE	 (unsigned char) 0x08		/**/
#define COLOR_DESELECTED (unsigned char) 0x80		/**/
#define COLOR_PAPER_OUT1 (unsigned char) 0x00		/**/
#define COLOR_PAPER_OUT2 (unsigned char) 0x10		/* Paper ran out while printing*/
#define GRAPH_OFFLINE	 (unsigned char) 0x08		/**/
#define GRAPH_DESELECTED (unsigned char) 0x90		/**/
#define GRAPH_PAPER_OUT  (unsigned char) 0x28		/**/
#define PRT_BUSY	 (unsigned char) 0x10
#define PRT_READY	 (unsigned char) 0x90
#define INIT_PRT			 0x46
#define GET_STAT			 0x66
#define PRINT_CAT			 0x05
#define SET_FRAME			 0x42
#define GET_FRAME			 0x62
#define SET_RETRY			 0x44
#define GET_RETRY			 0x64
#define RETRY_ON			 "\x01"
#define RETRY_OFF			 "\x00"
#define NORMCPI_NORMLPI 		 "\x50\x06"     /* MODE 80 (0x50),6 */
#define NORMCPI_COMPLPI 		 "\x50\x08"     /* MODE 80 (0x50),8 */
#define COMPCPI_COMPLPI 		 "\x84\x08"     /* MODE 132 (0x84),8 */
#define COMPCPI_NORMLPI 		 "\x84\x06"     /* MODE 132 (0x84),6 */
#define DATASELECTOR			 "0x002F0000"   /* Data selector for PRT_A67B */
#define CODESELECTR1			 "0x000F0000"   /* Code selector for PRT_A67D */
#define CODESELECTR2			 "0x000FFFFF"   /* Code selector for PRT_A67F */
#define ZEROPARM			 "0x00000000"   /* First parameter for PRT_A67E */
#define NORMCPI 	 (unsigned char) 0x50
#define COMPCPI 	 (unsigned char) 0x84
#define NORMLPI 	 (unsigned char) 0x06
#define COMPLPI 	 (unsigned char) 0x08
#define TIME_LENGTH			 26
#define OPEN_MODE	 (unsigned long) 0x00c2
#define OPEN_MODE2	 (unsigned long) 0x60c2


unsigned char color		     = FALSE;	 /* Boolean -- Color printer?		 */
unsigned char graphics		     = FALSE;	 /* Boolean -- Graphics printer?	 */
unsigned char proprint		     = FALSE;	 /* Boolean -- ProPrinter?		 */
unsigned char not_sel;				 /* Printer not selected code		 */
unsigned char ptrdata[2];			 /* Data Buffer for DOSDEVIOCTL 	    */
char	      *dselect; 			 /* Character string to deselect printer */
char	      response[80];			 /* ARRAY TO HOLD RESPONSES FROM USER	   */
char	      *returned 	     = response; /* ARRAY TO HOLD RETURN FROM STRCPY, ETC. */
char	      pass_fail 	     = 'P';      /* TEST WILL PASS UNLESS IT FAILS         */
char	      port[6];
char	      testtime[TIME_LENGTH];		 /* STRING TO HOLD STARTING TIME OF TEST   */
char	      ptrparm		     = '\0';     /* Parameter Buffer for DOSDEVIOCTL        */
char	      args[20]; 			 /* Arguments passed to child process from PRT_A67 */
char	      program[15];			 /* Program name passed to child process from PRT_A67 */
char	      invbuffaddr1[]	     = "0xFFFFFFFF"; /* Invalid buffer address for DOSDEVIOCTL, PRT_A67A, C */
char	      invbuffaddr2[]	     = "0x00000000"; /* Invalid buffer address for DOSDEVIOCTL, PRT_A67B, D */
char	      invbuffaddr3[]	     = "0x000F0000"; /* Invalid buffer address for DOSDEVIOCTL, PRT_A67E */
char	      buffer[BUFLEN];
char	      resp;
char	      resp2;
unsigned      rc;				 /* Store return code from all DOSCALLS     */
unsigned      handle;				 /* DOSOPEN: Handle returned		    */
unsigned      num_bytes;			 /* DOSWRITE: Bytes Written		    */
unsigned      action		     = 0;	 /* DOSOPEN: Action taken		    */
unsigned      file_attr 	     = 0x20;	 /* DOSOPEN: File attribute		    */
unsigned      open_flag 	     = 0x01;	 /* FAIL IF DOESN'T EXIST, OPEN IF IT DOES  */
unsigned long ram_sem;
long	      starttime;			 /* VARIABLES TO HOLD TIME VALUES	   */
int	      offline;				 /* Printer offline code		 */
int	      printer_on;			 /* Printer on code			 */
int	      paper_out;			 /* Printer out of paper code		 */
int	      a_paper_out;			 /* Printer out of alternate paper code  */


extern void initialize_test ();
