home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_01_01 / 1n01048a < prev    next >
Text File  |  1990-05-17  |  1KB  |  52 lines

  1. *****Listing 2*****
  2.  
  3. #include    <stdio.h>
  4.  
  5. extern    int        output_location;
  6.  
  7. #define    SCREEN        0
  8. #define    PORTRAIT    1
  9. #define    LANDSCAPE    2
  10.  
  11. /************************************************************
  12. *    init_printer() - initialize output device
  13. *
  14. *    global
  15. *        output_location (in) - SCREEN, PORTRAIT,
  16. *                                    or LANDSCAPE
  17. *
  18. *    Notes:
  19. *        1.  Compiled with Turbo C compiler version 2.0
  20. *        2.    This version does nothing if output is to the
  21. *            screen.
  22. *
  23. *    History
  24. *        Original code William H. Roetzheim, 1990
  25. **************************************************************/
  26.  
  27. void    init_printer()
  28. {
  29.     if (output_location != SCREEN)
  30.     {
  31.         /* reset the printer */
  32.         fprintf(stdprn, "\033E");
  33.  
  34.         /* select proper orientation */
  35.         if (output_location == LANDSCAPE)
  36.         {
  37.             /* landscape */
  38.             fprintf(stdprn, "\033&l1O");
  39.         }
  40.         else fprintf(stdprn, "\033&l0O");
  41.  
  42.         /* select 300 DPI resolution */
  43.         fprintf(stdprn, "\033*t300R");
  44.  
  45.         /* select default font */
  46.         fprintf(stdprn,"\033(10U");        /* PC symbol set */
  47.         fprintf(stdprn,"\033(s16.66H");    /* 16.66 cpi */
  48.         fprintf(stdprn,"\033(s0T");     /* lineprinter */
  49.     }
  50. }
  51.  
  52.