home *** CD-ROM | disk | FTP | other *** search
- /*********************
- *
- * pr_test.c - printer functions test program.
- *
- * Purpose: This file contains printer test functions.
- *
- * Blackstar C Function Library
- * (c) Copyright 1985 Sterling Castle Software
- *
- *******/
-
- #include <stdio.h>
- #include <stdlib.h>
- #include "sc_head.h"
- #include "blackstr.h"
- #include "kb_head.h"
- #include "pr_head.h"
-
- void pratrtest(void);
-
- void quit()
- {
- sc_color(WHITE,BLACK);
- sc_clr();
- }
-
- void main()
- {
- extern int hour_,minute_,sec_,hsec_,year_,month_,day_;
-
- /***************************************************************
- INITIALIZE THE SCREEN AND SAY HELLO
- ***************************************************************/
- sc_init(MO_CO80,BLUE,WHITE); /* init screen */
- sc_clr();
- sc_puts("Hello from PRINTER test.\n\n");
- sy_gtime();
- sy_gdate();
- sc_printf("Time is %d:%d:%d.%d\n",hour_,minute_,sec_,hsec_);
- sc_printf("Date is %d/%d/%d\n\n",month_,day_,year_);
- sc_puts("Printer tests: Make sure printer is on line.\n");
- sc_printf("Strike any key when ready...");
- kb_getc();
- if (pr_puts("\nPut a string on the printer.\n") == 0) {
- sc_color(WHITE,BLUE);
- sc_clr();
- sc_printf("\nSorry, your printer isn't online.\n");
- quit();
- }
- pr_putl("Put a line on the printer.\n");
-
- /***************************************************************
- SET UP A WINDOW AND GRAB THE PRINT SCREEN VECTOR
- ***************************************************************/
- pr_signal(TRUE);
- sc_puts("\n\nPrinter interrupt enabled -- ESC to disable\n");
- sc_puts("Shift-PrtSc now calls pr_prtsc()\n");
- while(kb_getch()!=ESC) ;
- pr_signal(FALSE);
- sc_puts("printer interrupt disabled\n");
- sc_puts("\nnow printing a form feed.\n");
- pr_putff();
- sc_puts("hit any key to continue...\n");
- kb_getc();
-
- /***************************************************************
- PRINTER ATTRIBUTE TESTS
- ***************************************************************/
- sc_puts("\n\r<EPSON RX80>");
- sc_puts("\n\rhit any key to continue...");
- kb_getc();
- pr_putl("TEST FOR EPSONRX80");
- pr_init(EPSONRX80);
- pratrtest();
- quit();
- }
-
- /*************
- pratrtest() do printer attribute test
- **************/
- void pratrtest(void)
- {
- pr_sattr(PICA);
- pr_puts("this is pica\n\r");
- pr_sattr(ELITE);
- pr_puts("This is elite\n\r");
- pr_sattr(PICA);
- pr_sattr(CONDENS);
- pr_puts("this is condensed\n\r");
- pr_sattr(NOCONDENS);
- pr_sattr(ITALIC);
- pr_putl("this is italic");
- pr_sattr(NOITALIC);
- pr_sattr(PROPOR);
- pr_putl("this is done proportionally.");
- pr_sattr(NOPROPOR);
- pr_sattr(BOLD);
- pr_putl("this is BOLD");
- pr_sattr(NOBOLD);
- pr_putl("this is not bold");
- pr_sattr(DWIDE);
- pr_putl("this is double wide");
- pr_sattr(NODWIDE);
- pr_putl("this is not double wide");
- pr_sattr(LETTER);
- pr_putl("this is letter quality");
- pr_sattr(NOLETTER);
- pr_putl("this is not letter quality");
- }
-