home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c222 / 1.ddi / DEMOS / PR_TEST.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-05-22  |  3.1 KB  |  110 lines

  1. /*********************
  2.  *
  3.  *  pr_test.c - printer functions test program.
  4.  *
  5.  *  Purpose: This file contains printer test functions.
  6.  *
  7.  *  Blackstar C Function Library
  8.  *  (c) Copyright 1985 Sterling Castle Software
  9.  *
  10.  *******/
  11.  
  12. #include <stdio.h>
  13. #include <stdlib.h>
  14. #include "sc_head.h"
  15. #include "blackstr.h"
  16. #include "kb_head.h"
  17. #include "pr_head.h"
  18.  
  19. void pratrtest(void);
  20.  
  21. void quit() 
  22. {
  23.     sc_color(WHITE,BLACK);
  24.     sc_clr();
  25. }
  26.  
  27. void main()
  28. {
  29.     extern int hour_,minute_,sec_,hsec_,year_,month_,day_;
  30.  
  31.     /***************************************************************
  32.      INITIALIZE THE SCREEN AND SAY HELLO
  33.     ***************************************************************/
  34.     sc_init(MO_CO80,BLUE,WHITE);            /* init screen */
  35.     sc_clr();
  36.     sc_puts("Hello from PRINTER test.\n\n");
  37.     sy_gtime();
  38.     sy_gdate();
  39.     sc_printf("Time is %d:%d:%d.%d\n",hour_,minute_,sec_,hsec_);
  40.     sc_printf("Date is %d/%d/%d\n\n",month_,day_,year_);
  41.     sc_puts("Printer tests: Make sure printer is on line.\n");
  42.     sc_printf("Strike any key when ready...");
  43.     kb_getc();
  44.     if (pr_puts("\nPut a string on the printer.\n") == 0) {
  45.     sc_color(WHITE,BLUE);
  46.     sc_clr();
  47.     sc_printf("\nSorry, your printer isn't online.\n");
  48.     quit();
  49.     }
  50.     pr_putl("Put a line on the printer.\n");
  51.  
  52.     /***************************************************************
  53.      SET UP A WINDOW AND GRAB THE PRINT SCREEN VECTOR
  54.     ***************************************************************/
  55.     pr_signal(TRUE);
  56.     sc_puts("\n\nPrinter interrupt enabled  --  ESC to disable\n");
  57.     sc_puts("Shift-PrtSc now calls pr_prtsc()\n");
  58.     while(kb_getch()!=ESC) ;
  59.     pr_signal(FALSE);
  60.     sc_puts("printer interrupt disabled\n");
  61.     sc_puts("\nnow printing a form feed.\n");
  62.     pr_putff();
  63.     sc_puts("hit any key to continue...\n");
  64.     kb_getc();
  65.  
  66.     /***************************************************************
  67.      PRINTER ATTRIBUTE TESTS
  68.     ***************************************************************/
  69.     sc_puts("\n\r<EPSON RX80>");
  70.     sc_puts("\n\rhit any key to continue...");
  71.     kb_getc();
  72.     pr_putl("TEST FOR EPSONRX80");
  73.     pr_init(EPSONRX80);
  74.     pratrtest();
  75.     quit();
  76. }
  77.  
  78. /*************
  79.  pratrtest()           do printer attribute test
  80. **************/
  81. void pratrtest(void)
  82. {
  83.     pr_sattr(PICA);
  84.     pr_puts("this is pica\n\r");
  85.     pr_sattr(ELITE);
  86.     pr_puts("This is elite\n\r");
  87.     pr_sattr(PICA);
  88.     pr_sattr(CONDENS);
  89.     pr_puts("this is condensed\n\r");
  90.     pr_sattr(NOCONDENS);
  91.     pr_sattr(ITALIC);
  92.     pr_putl("this is italic");
  93.     pr_sattr(NOITALIC);
  94.     pr_sattr(PROPOR);
  95.     pr_putl("this is done proportionally.");
  96.     pr_sattr(NOPROPOR);
  97.     pr_sattr(BOLD);
  98.     pr_putl("this is BOLD");
  99.     pr_sattr(NOBOLD);
  100.     pr_putl("this is not bold");
  101.     pr_sattr(DWIDE);
  102.     pr_putl("this is double wide");
  103.     pr_sattr(NODWIDE);
  104.     pr_putl("this is not double wide");
  105.     pr_sattr(LETTER);
  106.     pr_putl("this is letter quality");
  107.     pr_sattr(NOLETTER);
  108.     pr_putl("this is not letter quality");
  109. }
  110.