1 /* Copyright (C) 2004 Manuel Novoa III <mjn3@codepoet.org>
3 * GNU Library General Public License (LGPL) version 2 or later.
5 * Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details.
11 /* Solaris function --
12 * Discard all buffered data whether reading or writing.
15 void __fpurge(register FILE * __restrict stream)
17 __STDIO_STREAM_VALIDATE(stream);
19 __STDIO_STREAM_DISABLE_GETC(stream);
20 __STDIO_STREAM_DISABLE_PUTC(stream);
21 __STDIO_STREAM_INIT_BUFREAD_BUFPOS(stream);
22 stream->__ungot[1] = 0;
24 #ifdef __STDIO_MBSTATE
25 __INIT_MBSTATE(&(stream->__state));
27 #ifdef __UCLIBC_HAS_WCHAR__
28 stream->__ungot_width[0] = 0;
31 stream->__modeflags &= ~(__MASK_READING|__FLAG_WRITING);
33 __STDIO_STREAM_VALIDATE(stream);