1: /* discard.c - discard output on a file pointer */
   2: 
   3: #include "../h/mh.h"
   4: #include <stdio.h>
   5: #ifndef SYS5
   6: #include <sgtty.h>
   7: #else   SYS5
   8: #include <sys/types.h>
   9: #include <termio.h>
  10: #include <sys/ioctl.h>
  11: #endif	SYS5
  12: 
  13: 
  14: void    discard (io)
  15: FILE   *io;
  16: {
  17: #ifndef SYS5
  18:     struct sgttyb   sg;
  19: #else   SYS5
  20:     struct termio   sg;
  21: #endif	SYS5
  22: 
  23:     if (io == NULL)
  24:     return;
  25: 
  26: #ifndef SYS5
  27:     if (ioctl (fileno (io), TIOCGETP, (char *) &sg) != NOTOK)
  28:     (void) ioctl (fileno (io), TIOCSETP, (char *) &sg);
  29: #else   SYS5
  30:     if (ioctl (fileno (io), TCGETA, &sg) != NOTOK)
  31:     (void) ioctl (fileno (io), TCSETA, &sg);
  32: #endif	SYS5
  33: 
  34:     if (io -> _ptr = io -> _base)
  35:     io -> _cnt = 0;
  36: }

Defined functions

discard defined in line 14; never used
Last modified: 1985-09-18
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 822
Valid CSS Valid XHTML 1.0 Strict