Changed error message to say that blind lists aren't
[mmh] / sbr / discard.c
1
2 /*
3  * discard.c -- discard output on a file pointer
4  *
5  * This code is Copyright (c) 2002, by the authors of nmh.  See the
6  * COPYRIGHT file in the root directory of the nmh distribution for
7  * complete copyright information.
8  */
9
10 #include <h/mh.h>
11
12 #include <termios.h>
13
14
15 void
16 discard (FILE *io)
17 {
18     if (io == NULL)
19         return;
20
21     tcflush (fileno(io), TCOFLUSH);
22
23 #if defined(_FSTDIO) || defined(__DragonFly__)
24     fpurge (io);
25 #else
26 # ifdef LINUX_STDIO
27     io->_IO_write_ptr = io->_IO_write_base;
28 # else
29     if ((io->_ptr = io->_base))
30         io->_cnt = 0;
31 # endif
32 #endif
33 }
34