X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2F__fpending.c;h=221aee69de9f7b1f72db2d0a9a88512ad16d926b;hb=f213651e6fa01f6a6ea19c0c6f71124d41035213;hp=5b6e3e38170e571d036555c35901d469ac0e6e6f;hpb=7d63675124d7e90e3075443f004b138b0af4c02f;p=gnulib.git diff --git a/lib/__fpending.c b/lib/__fpending.c index 5b6e3e381..221aee69d 100644 --- a/lib/__fpending.c +++ b/lib/__fpending.c @@ -1,43 +1,30 @@ -size_t -__fpending (FILE *fp) -{ -#if STREAM_FPENDING_GLIBC2 - return fp->_IO_write_ptr - fp->_IO_write_base; -#endif - -#if STREAM_FPENDING__PTR - /* Traditional Unix */ - return fp->_ptr - fp->_base; -#endif +/* __fpending.c -- return the number of pending output bytes on a stream + Copyright (C) 2000, 2004, 2006 Free Software Foundation, Inc. -#if STREAM_FPENDING__P - /* BSD */ - return fp->_p - fp->_bf._base; -#endif + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. -#if STREAM_FPENDING__P - /* SCO, Unixware */ - return fp->__ptr - fp->__base; -#endif + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -#if STREAM_FPENDING__BUFP - /* old glibc? */ - return fp->__bufp - fp->__buffer; -#endif + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#if STREAM_FPENDING__PPTR - /* old glibc iostream? */ - return fp->_pptr - fp->_pbase; -#endif +/* Written by Jim Meyering. */ -#if STREAM_FPENDING__PTR_DEREF - /* VMS */ - return (*fp)->_ptr - (*fp)->_base; -#endif +#include -#if STREAM_FPENDING_NOT_AVAILABLE - /* e.g., DGUX R4.11 */ - return 1; /* i.e. the info is not available */ -#endif +#include "__fpending.h" +/* Return the number of pending (aka buffered, unflushed) + bytes on the stream, FP, that is open for writing. */ +size_t +__fpending (FILE *fp) +{ + return PENDING_OUTPUT_N_BYTES; }