Lines Matching refs:fp
40 lflush(FILE *fp)
42 if ((fp->_flags & (__SLBF|__SWR)) == (__SLBF|__SWR))
43 return (__sflush_locked(fp)); /* ignored... */
52 __srefill(FILE *fp)
59 fp->_r = 0; /* largely a convenience for callers */
62 if (fp->_flags & __SEOF)
66 if ((fp->_flags & __SRD) == 0) {
67 if ((fp->_flags & __SRW) == 0) {
69 fp->_flags |= __SERR;
73 if (fp->_flags & __SWR) {
74 if (__sflush(fp))
76 fp->_flags &= ~__SWR;
77 fp->_w = 0;
78 fp->_lbfsize = 0;
80 fp->_flags |= __SRD;
88 if (HASUB(fp)) {
89 FREEUB(fp);
90 if ((fp->_r = fp->_ur) != 0) {
91 fp->_p = fp->_up;
97 if (fp->_bf._base == NULL)
98 __smakebuf(fp);
105 if (fp->_flags & (__SLBF|__SNBF)) {
107 fp->_flags |= __SIGN;
109 fp->_flags &= ~__SIGN;
112 if ((fp->_flags & (__SLBF|__SWR)) == (__SLBF|__SWR))
113 __sflush(fp);
115 fp->_p = fp->_bf._base;
116 fp->_r = (*fp->_read)(fp->_cookie, (char *)fp->_p, fp->_bf._size);
117 fp->_flags &= ~__SMOD; /* buffer contents are again pristine */
118 if (fp->_r <= 0) {
119 if (fp->_r == 0)
120 fp->_flags |= __SEOF;
122 fp->_r = 0;
123 fp->_flags |= __SERR;