home *** CD-ROM | disk | FTP | other *** search
- /*****( prttest.c )*************************************************************
- * *
- * Written: Brent Faulkner - May 25, 1989 *
- * Updated: Brent Faulkner - June 13, 1989 *
- * *
- ********************************************************************************
- * *
- * Contents: main() - main test program for prt support system *
- * *
- *******************************************************************************/
- /* include files */
- #include <stdio.h>
- #include <bench.h>
- #include "prt.h"
-
- /* define prt stuff (printer type, device name, serial parameters, etc.) */
- #define PRINTER argv[1]
- #define PRT_DEV "lpt1" /* ie $mdm or $lpt */
- #define PRT_PARAM "2400N71" /* ie "2400N81" or "" */
-
- #ifdef ANSI
- void main(int, char **);
- #endif
-
- /* main program for testing prt support system */
- void main(argc, argv)
- int argc;
- char **argv;
- {
- int i;
-
- #ifdef MSDOS
- take24();
- #endif
-
- get_print(PRINTER); /* get prtcap entry for PRINTER */
-
- if (open_p(PRT_DEV, PRT_PARAM) == FALSE) /* open device */
- abort_mess("Unable to open device (%s).\n", PRT_DEV);
- else
- fprintf(stderr, "Opened device (%s).\n", PRT_DEV);
- /* initialize prt system */
- init_p((unsigned char)*prtdef[NUM_LINES], (unsigned char)*prtdef[NUM_COLS]);
-
- box_p(1, 1, P_NORMAL, 9, 78);
- for(i = 0; i < 4; i++)
- {
- boxset_p = i;
- box_p(2, 2 + i * 19, P_BOLD, 7, 19);
- center_p(3, 3 + i * 19, P_BOLD | P_UNDER, 17, "Box set # %d", i);
- underln_p(4, 2 + i * 19, P_BOLD, 19);
- upperln_p(4, 12 + i * 19, P_BOLD, 5);
- underln_p(6, 2 + i * 19, P_BOLD, 19);
- poke_p(6, 12 + i * 19, P_BOLD | P_BOX, BOX_CROSS(boxset_p));
- }
-
- disp_p(10, 5, P_NORMAL, "This is NORMAL text...");
- disp_p(11, 5, P_ITALIC, "This is ITALIC text...");
- disp_p(12, 5, P_BOLD, "This is BOLD text...");
- disp_p(13, 5, P_UNDER, "This is UNDER text...");
- disp_p(14, 5, P_LQ, "This is LQ text...");
- disp_p(15, 5, P_PS, "This is PS text...");
- disp_p(16, 5, P_SUBSCRIPT, "This is SUBSCRIPT text...");
- disp_p(17, 5, P_SUPERSCRIPT, "This is SUPERSCRIPT text...");
- disp_p(18, 5, P_DBL_WIDE, "This is DBL_WIDE text...");
- disp_p(19, 5, P_DBL_HIGH, "This is DBL_HIGH text...");
- disp_p(20, 5, P_CONDENSED, "This is CONDENSED text...");
- disp_p(21, 5, P_CPI5, "This is CPI5 text...");
- disp_p(22, 5, P_CPI10, "This is CPI10 text...");
- disp_p(23, 5, P_CPI12, "This is CPI12 text...");
- disp_p(24, 5, P_CPI16, "This is CPI16 text...");
-
- flushprt();
- clear_p();
-
- disp_p(10, 5, P_BOLD | P_ITALIC | P_CPI5 | P_PS, "This should be on page 2...");
-
- flushprt();
-
- end_p(TRUE); /* end prt system */
- }
-