]> diplodocus.org Git - nmh/blob - sbr/discard.c
pending-release-notes: add mhshow's "-prefer", and mh-format's %(kibi/kilo)
[nmh] / 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 /* There used to be an fpurge() here on some platforms, stdio
24 hackery on others. But it didn't seem necessary. */
25 }
26