4 * Definitions for I/O internal operations, originally from Solaris.
11 #error "<stdio_ext.h> not supported"
16 #define FSETLOCKING_QUERY 0
17 #define FSETLOCKING_INTERNAL 1
18 #define FSETLOCKING_BYCALLER 2
22 void __fpurge (FILE *);
23 int __fsetlocking (FILE *, int);
27 void _flushlbf (void);
32 _ELIDABLE_INLINE
size_t
33 __fbufsize (FILE *__fp
) { return (size_t) __fp
->_bf
._size
; }
36 __freading (FILE *__fp
) { return (__fp
->_flags
& __SRD
) != 0; }
39 __fwriting (FILE *__fp
) { return (__fp
->_flags
& __SWR
) != 0; }
42 __freadable (FILE *__fp
) { return (__fp
->_flags
& (__SRD
| __SRW
)) != 0; }
45 __fwritable (FILE *__fp
) { return (__fp
->_flags
& (__SWR
| __SRW
)) != 0; }
48 __flbf (FILE *__fp
) { return (__fp
->_flags
& __SLBF
) != 0; }
50 _ELIDABLE_INLINE
size_t
51 __fpending (FILE *__fp
) { return __fp
->_p
- __fp
->_bf
._base
; }
55 size_t __fbufsize (FILE *);
56 int __freading (FILE *);
57 int __fwriting (FILE *);
58 int __freadable (FILE *);
59 int __fwritable (FILE *);
61 size_t __fpending (FILE *);
65 #define __fbufsize(__fp) ((size_t) (__fp)->_bf._size)
66 #define __freading(__fp) (((__fp)->_flags & __SRD) != 0)
67 #define __fwriting(__fp) (((__fp)->_flags & __SWR) != 0)
68 #define __freadable(__fp) (((__fp)->_flags & (__SRD | __SRW)) != 0)
69 #define __fwritable(__fp) (((__fp)->_flags & (__SWR | __SRW)) != 0)
70 #define __flbf(__fp) (((__fp)->_flags & __SLBF) != 0)
71 #define __fpending(__fp) ((size_t) ((__fp)->_p - (__fp)->_bf._base))
73 #endif /* __cplusplus */
79 #endif /* _STDIO_EXT_H_ */