Lines Matching defs:fp
51 lflush(FILE *fp)
55 if ((fp->_flags & (__SLBF|__SWR)) == (__SLBF|__SWR)) {
56 FLOCKFILE(fp);
57 ret = __sflush(fp);
58 FUNLOCKFILE(fp);
68 __srefill(FILE *fp)
75 ORIENT(fp, -1);
77 fp->_r = 0; /* largely a convenience for callers */
80 if (fp->_flags & __SEOF)
84 if ((fp->_flags & __SRD) == 0) {
85 if ((fp->_flags & __SRW) == 0) {
87 fp->_flags |= __SERR;
91 if (fp->_flags & __SWR) {
92 if (__sflush(fp))
94 fp->_flags &= ~__SWR;
95 fp->_w = 0;
96 fp->_lbfsize = 0;
98 fp->_flags |= __SRD;
106 if (HASUB(fp)) {
107 FREEUB(fp);
108 if ((fp->_r = fp->_ur) != 0) {
109 fp->_p = fp->_up;
115 if (fp->_bf._base == NULL)
116 __smakebuf(fp);
123 if (fp->_flags & (__SLBF|__SNBF)) {
125 fp->_flags |= __SIGN;
127 fp->_flags &= ~__SIGN;
130 if ((fp->_flags & (__SLBF|__SWR)) == (__SLBF|__SWR))
131 __sflush(fp);
133 fp->_p = fp->_bf._base;
134 fp->_r = _sread(fp, (char *)fp->_p, fp->_bf._size);
135 fp->_flags &= ~__SMOD; /* buffer contents are again pristine */
136 if (fp->_r <= 0) {
137 if (fp->_r == 0)
138 fp->_flags |= __SEOF;
140 fp->_r = 0;
141 fp->_flags |= __SERR;