3 <<stdio_ext>>,<<__fbufsize>>,<<__fpending>>,<<__flbf>>,<<__freadable>>,<<__fwritable>>,<<__freading>>,<<__fwriting>>---access internals of FILE structure
22 #include <stdio_ext.h>
23 size_t __fbufsize(FILE *<[fp]>);
24 size_t __fpending(FILE *<[fp]>);
25 int __flbf(FILE *<[fp]>);
26 int __freadable(FILE *<[fp]>);
27 int __fwritable(FILE *<[fp]>);
28 int __freading(FILE *<[fp]>);
29 int __fwriting(FILE *<[fp]>);
32 These functions provides access to the internals of the FILE structure <[fp]>.
35 <<__fbufsize>> returns the number of bytes in the buffer of stream <[fp]>.
37 <<__fpending>> returns the number of bytes in the output buffer of stream <[fp]>.
39 <<__flbf>> returns nonzero if stream <[fp]> is line-buffered, and <<0>> if not.
41 <<__freadable>> returns nonzero if stream <[fp]> may be read, and <<0>> if not.
43 <<__fwritable>> returns nonzero if stream <[fp]> may be written, and <<0>> if not.
45 <<__freading>> returns nonzero if stream <[fp]> if the last operation on
46 it was a read, or if it read-only, and <<0>> if not.
48 <<__fwriting>> returns nonzero if stream <[fp]> if the last operation on
49 it was a write, or if it write-only, and <<0>> if not.
52 These functions originate from Solaris and are also provided by GNU libc.
54 No supporting OS subroutines are required.
62 /* Subroutine versions of the inline or macro functions. */
65 __fbufsize (FILE * fp
)
67 return (size_t) fp
->_bf
._size
;
71 __fpending (FILE * fp
)
73 return fp
->_p
- fp
->_bf
._base
;
79 return (fp
->_flags
& __SLBF
) != 0;
83 __freadable (FILE * fp
)
85 return (fp
->_flags
& (__SRD
| __SRW
)) != 0;
89 __fwritable (FILE * fp
)
91 return (fp
->_flags
& (__SWR
| __SRW
)) != 0;
95 __freading (FILE * fp
)
97 return (fp
->_flags
& __SRD
) != 0;
101 __fwriting (FILE * fp
)
103 return (fp
->_flags
& __SWR
) != 0;
106 #endif /* __rtems__ */