home *** CD-ROM | disk | FTP | other *** search
/ Jason Aller Floppy Collection / 125.img / PRO-C4.ZIP / BENCH1.ZIP / PRINT / PRTTEST.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-05-28  |  3.0 KB  |  82 lines

  1. /*****( prttest.c )*************************************************************
  2. *                                                                              *
  3. *  Written: Brent Faulkner - May 25, 1989                                      *
  4. *  Updated: Brent Faulkner - June 13, 1989                                     *
  5. *                                                                              *
  6. ********************************************************************************
  7. *                                                                              *
  8. * Contents:        main() - main test program for prt support system           *
  9. *                                                                              *
  10. *******************************************************************************/
  11. /* include files */
  12. #include <stdio.h>
  13. #include <bench.h>
  14. #include "prt.h"
  15.  
  16. /* define prt stuff (printer type, device name, serial parameters, etc.) */
  17. #define PRINTER    argv[1]
  18. #define PRT_DEV "lpt1"     /* ie $mdm        or   $lpt */
  19. #define PRT_PARAM "2400N71"       /* ie "2400N81"   or   ""   */
  20.  
  21. #ifdef ANSI
  22. void main(int, char **);
  23. #endif
  24.  
  25. /* main program for testing prt support system */
  26. void main(argc, argv)
  27. int argc;
  28. char **argv;
  29. {
  30.     int i;
  31.  
  32. #ifdef MSDOS
  33.     take24();
  34. #endif
  35.  
  36.     get_print(PRINTER);                /* get prtcap entry for PRINTER */
  37.  
  38.     if (open_p(PRT_DEV, PRT_PARAM) == FALSE)     /* open device */
  39.         abort_mess("Unable to open device (%s).\n", PRT_DEV);
  40.     else
  41.         fprintf(stderr, "Opened device (%s).\n", PRT_DEV);
  42.                                                  /* initialize prt system */
  43.     init_p((unsigned char)*prtdef[NUM_LINES], (unsigned char)*prtdef[NUM_COLS]);
  44.  
  45.     box_p(1, 1, P_NORMAL, 9, 78);
  46.     for(i = 0; i < 4; i++)
  47.     {
  48.         boxset_p = i;
  49.         box_p(2, 2 + i * 19, P_BOLD, 7, 19);
  50.         center_p(3, 3 + i * 19, P_BOLD | P_UNDER, 17, "Box set # %d", i);
  51.         underln_p(4, 2 + i * 19, P_BOLD, 19);
  52.         upperln_p(4, 12 + i * 19, P_BOLD, 5);
  53.         underln_p(6, 2 + i * 19, P_BOLD, 19);
  54.         poke_p(6, 12 + i * 19, P_BOLD | P_BOX, BOX_CROSS(boxset_p));
  55.     }
  56.  
  57.     disp_p(10, 5, P_NORMAL, "This is NORMAL text...");
  58.     disp_p(11, 5, P_ITALIC, "This is ITALIC text...");
  59.     disp_p(12, 5, P_BOLD, "This is BOLD text...");
  60.     disp_p(13, 5, P_UNDER, "This is UNDER text...");
  61.     disp_p(14, 5, P_LQ, "This is LQ text...");
  62.     disp_p(15, 5, P_PS, "This is PS text...");
  63.     disp_p(16, 5, P_SUBSCRIPT, "This is SUBSCRIPT text...");
  64.     disp_p(17, 5, P_SUPERSCRIPT, "This is SUPERSCRIPT text...");
  65.     disp_p(18, 5, P_DBL_WIDE, "This is DBL_WIDE text...");
  66.     disp_p(19, 5, P_DBL_HIGH, "This is DBL_HIGH text...");
  67.     disp_p(20, 5, P_CONDENSED, "This is CONDENSED text...");
  68.     disp_p(21, 5, P_CPI5, "This is CPI5 text...");
  69.     disp_p(22, 5, P_CPI10, "This is CPI10 text...");
  70.     disp_p(23, 5, P_CPI12, "This is CPI12 text...");
  71.     disp_p(24, 5, P_CPI16, "This is CPI16 text...");
  72.  
  73.     flushprt();
  74.     clear_p();
  75.  
  76.     disp_p(10, 5, P_BOLD | P_ITALIC | P_CPI5 | P_PS, "This should be on page 2...");
  77.  
  78.     flushprt();
  79.  
  80.     end_p(TRUE);                                 /* end prt system */
  81. }
  82.