home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume3 / laserjet-printcap / lzcat.c < prev    next >
Encoding:
C/C++ Source or Header  |  1986-11-30  |  695 b   |  42 lines

  1. #include "stdio.h"
  2.  
  3. int nomap = 0;
  4.  
  5. main(ac, av)
  6. int ac;
  7. char **av;
  8. {
  9.  
  10.     lzinit();
  11.     lzcat();
  12.     exit(0);
  13. }
  14.  
  15. #include <sgtty.h> 
  16.  
  17. lzinit()
  18. {
  19.     struct sgttyb nbuf;
  20.     unsigned long lbits;
  21.  
  22.     setbuf(stdout, NULL);
  23.     /* Work around to by-pass bug in terminal driver and force LITOUT */
  24.     lbits = LMDMBUF|LLITOUT;
  25.     ioctl(fileno(stdout), TIOCLSET, &lbits);
  26.     ioctl(fileno(stdout), TIOCGETP, &nbuf);
  27.     nbuf.sg_flags &= ~(ECHO|XTABS|CRMOD);  /* While we're at it, set the mode */
  28.     ioctl(fileno(stdout), TIOCSETP, &nbuf);
  29.  
  30.     fputs("\033&k3G", stdout);    /* Set device to sane mode    */
  31. }
  32.  
  33. lzcat()
  34. {
  35.     register int c;
  36.  
  37.     while((c = getchar()) != EOF)
  38.     {
  39.     putchar(c);
  40.     }
  41. }
  42.