2011-05-18 Yaakov Selkowitz * libc/include/stdio_ext.h: New header. * libc/stdio/fpurge.c (__fpurge): New function. Index: libc/stdio/fpurge.c =================================================================== RCS file: /cvs/src/src/newlib/libc/stdio/fpurge.c,v retrieving revision 1.1 diff -u -r1.1 fpurge.c --- libc/stdio/fpurge.c 3 Jul 2009 11:58:04 -0000 1.1 +++ libc/stdio/fpurge.c 29 Mar 2011 01:09:05 -0000 @@ -11,6 +11,8 @@ fpurge INDEX _fpurge_r +INDEX + __fpurge ANSI_SYNOPSIS #include @@ -18,6 +20,11 @@ int _fpurge_r(struct _reent *<[reent]>, FILE *<[fp]>); + #include + #include + void __fpurge(FILE *<[fp]>); + + DESCRIPTION Use <> to clear all buffers of the given stream. For output streams, this discards data not yet written to disk. For input streams, @@ -26,6 +33,8 @@ and generally is only needed when manually altering the underlying file descriptor of a stream. +<<__fpurge>> behaves exactly like <> but does not return a value. + The alternate function <<_fpurge_r>> is a reentrant version, where the extra argument <[reent]> is a pointer to a reentrancy structure, and <[fp]> must not be NULL. @@ -42,6 +51,7 @@ #include <_ansi.h> #include +#include #include #include "local.h" @@ -87,4 +97,11 @@ return _fpurge_r (_REENT, fp); } +void +_DEFUN(__fpurge, (fp), + register FILE * fp) +{ + _fpurge_r (_REENT, fp); +} + #endif /* _REENT_ONLY */