Mercurial > hg > octave-kai > gnulib-hg
changeset 2826:072e4df7a070
*** empty log message ***
author | Jim Meyering <jim@meyering.net> |
---|---|
date | Fri, 25 Aug 2000 07:39:22 +0000 |
parents | d516b8a06130 |
children | c1065c54878c |
files | lib/__fpending.c |
diffstat | 1 files changed, 43 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
new file mode 100644 --- /dev/null +++ b/lib/__fpending.c @@ -0,0 +1,43 @@ +size_t +__fpending (FILE *fp) +{ +#if FPENDING_GLIBC2 + return fp->_IO_write_ptr - fp->_IO_write_base; +#endif + +#if FPENDING__PTR + /* Traditional Unix */ + return fp->_ptr - fp->_base; +#endif + +#if FPENDING__P + /* BSD */ + return fp->_p - fp->_bf._base; +#endif + +#if FPENDING__P + /* SCO, Unixware */ + return fp->__ptr - fp->__base; +#endif + +#if FPENDING__BUFP + /* old glibc? */ + return fp->__bufp - fp->__buffer; +#endif + +#if FPENDING__PPTR + /* old glibc iostream? */ + return fp->_pptr - fp->_pbase; +#endif + +#if FPENDING__PTR_DEREF + /* VMS */ + return (*fp)->_ptr - (*fp)->_base; +#endif + +#if FPENDING_NOT_AVAILABLE + /* e.g., DGUX R4.11 */ + return 1; /* i.e. the info is not available */ +#endif + +}