1 /* Begin include file stdiom.h */ 2 /* @(#)stdiom.h 1.1 */ 3 4 /* The following macros improve performance of the stdio by reducing the 5 number of calls to _bufsync and _wrtchk. _BUFSYNC has the same 6 effect as _bufsync, and _WRTCHK has the same effect as _wrtchk, 7 but often these functions have no effect, and in those cases the 8 macros avoid the expense of calling the functions. */ 9 10 #define _BUFSYNC(iop) if (_bufend(iop) - iop->_ptr < \ 11 ( iop->_cnt < 0 ? 0 : iop->_cnt ) ) \ 12 _bufsync(iop) 13 #define _WRTCHK(iop) ((((iop->_flag & (_IOWRT | _IOEOF)) != _IOWRT) \ 14 || (iop->_base == NULL) \ 15 || (iop->_ptr == iop->_base && iop->_cnt == 0 \ 16 && !(iop->_flag & (_IONBF | _IOLBF)))) \ 17 ? _wrtchk(iop) : 0 ) 18 19 /* End include file stdiom.h */