home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / PROCWRKB.ZIP / BENCH1.ZIP / PRINT / PRTTEST.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-08-07  |  3.0 KB  |  80 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. PROTO (void main, (int, char **));
  22.  
  23. /* main program for testing prt support system */
  24. void main(argc, argv)
  25. int argc;
  26. char **argv;
  27. {
  28.     int i;
  29.  
  30. #ifdef MSDOS
  31.     take24();
  32. #endif
  33.  
  34.     get_print(PRINTER);                /* get prtcap entry for PRINTER */
  35.  
  36.     if (open_p(PRT_DEV, PRT_PARAM) == FALSE)     /* open device */
  37.         abort_mess("Unable to open device (%s).\n", PRT_DEV);
  38.     else
  39.         fprintf(stderr, "Opened device (%s).\n", PRT_DEV);
  40.                                                  /* initialize prt system */
  41.     init_p((unsigned char)*prtdef[NUM_LINES], (unsigned char)*prtdef[NUM_COLS]);
  42.  
  43.     box_p(1, 1, P_NORMAL, 9, 78);
  44.     for(i = 0; i < 4; i++)
  45.     {
  46.         boxset_p = i;
  47.         box_p(2, 2 + i * 19, P_BOLD, 7, 19);
  48.         center_p(3, 3 + i * 19, P_BOLD | P_UNDER, 17, "Box set # %d", i);
  49.         underln_p(4, 2 + i * 19, P_BOLD, 19);
  50.         upperln_p(4, 12 + i * 19, P_BOLD, 5);
  51.         underln_p(6, 2 + i * 19, P_BOLD, 19);
  52.         poke_p(6, 12 + i * 19, P_BOLD | P_BOX, BOX_CROSS(boxset_p));
  53.     }
  54.  
  55.     disp_p(10, 5, P_NORMAL, "This is NORMAL text...");
  56.     disp_p(11, 5, P_ITALIC, "This is ITALIC text...");
  57.     disp_p(12, 5, P_BOLD, "This is BOLD text...");
  58.     disp_p(13, 5, P_UNDER, "This is UNDER text...");
  59.     disp_p(14, 5, P_LQ, "This is LQ text...");
  60.     disp_p(15, 5, P_PS, "This is PS text...");
  61.     disp_p(16, 5, P_SUBSCRIPT, "This is SUBSCRIPT text...");
  62.     disp_p(17, 5, P_SUPERSCRIPT, "This is SUPERSCRIPT text...");
  63.     disp_p(18, 5, P_DBL_WIDE, "This is DBL_WIDE text...");
  64.     disp_p(19, 5, P_DBL_HIGH, "This is DBL_HIGH text...");
  65.     disp_p(20, 5, P_CONDENSED, "This is CONDENSED text...");
  66.     disp_p(21, 5, P_CPI5, "This is CPI5 text...");
  67.     disp_p(22, 5, P_CPI10, "This is CPI10 text...");
  68.     disp_p(23, 5, P_CPI12, "This is CPI12 text...");
  69.     disp_p(24, 5, P_CPI16, "This is CPI16 text...");
  70.  
  71.     flushprt();
  72.     clear_p();
  73.  
  74.     disp_p(10, 5, P_BOLD | P_ITALIC | P_CPI5 | P_PS, "This should be on page 2...");
  75.  
  76.     flushprt();
  77.  
  78.     end_p(TRUE);                                 /* end prt system */
  79. }
  80.