X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2F__fpending.c;h=0769f2314c1b675a9f42327512b816514529a99b;hb=7ec881d86b09cad88b3999ee314c21abe78c7eb2;hp=11f4981eaf3493b52acfd21085c8f8f9d6e1b7a7;hpb=88ac5d0ac81fe2273850bbc4fc60c0dfc3b65e94;p=gnulib.git diff --git a/lib/__fpending.c b/lib/__fpending.c index 11f4981ea..0769f2314 100644 --- a/lib/__fpending.c +++ b/lib/__fpending.c @@ -1,43 +1,32 @@ -size_t -__fpending (FILE *fp) -{ -#if FPENDING_GLIBC2 - return fp->_IO_write_ptr - fp->_IO_write_base; -#endif +/* __fpending.c -- return the number of pending output bytes on a stream + Copyright (C) 2000, 2004 Free Software Foundation, Inc. -#if FPENDING__PTR - /* Traditional Unix */ - return fp->_ptr - fp->_base; -#endif - -#if 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 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 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 FPENDING__PPTR - /* old glibc iostream? */ - return fp->_pptr - fp->_pbase; -#endif +/* Written by Jim Meyering. */ -#if FPENDING__PTR_DEREF - /* VMS */ - return (*fp)->_ptr - (*fp)->_base; +#if HAVE_CONFIG_H +# include #endif -#if 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; }