Lines Matching refs:fp
60 #define SM_IO_RD_TIMEOUT(fp, fd, to, timeout, sel_ret) \ argument
89 fp->f_r = 0; \
90 fp->f_flags |= SMERR; \
119 sm_lflush(fp, timeout) in sm_lflush() argument
120 SM_FILE_T *fp; in sm_lflush()
124 if ((fp->f_flags & (SMLBF|SMWR)) == (SMLBF|SMWR))
125 return sm_flush(fp, timeout);
142 sm_refill(fp, timeout) in sm_refill() argument
143 register SM_FILE_T *fp; in sm_refill()
151 timeout = fp->f_timeout;
161 fp->f_r = 0; /* just to be sure */
169 fp->f_r = 0; /* largely a convenience for callers */
171 if (fp->f_flags & SMFEOF)
174 SM_CONVERT_TIME(fp, fd, timeout, &to);
177 if ((fp->f_flags & SMRD) == 0)
179 if ((fp->f_flags & SMRW) == 0)
182 fp->f_flags |= SMERR;
187 if (fp->f_flags & SMWR)
189 if (sm_flush(fp, &timeout))
191 fp->f_flags &= ~SMWR;
192 fp->f_w = 0;
193 fp->f_lbfsize = 0;
195 fp->f_flags |= SMRD;
206 if (HASUB(fp))
208 FREEUB(fp);
209 if ((fp->f_r = fp->f_ur) != 0)
211 fp->f_p = fp->f_up;
219 if (fp->f_bf.smb_base == NULL)
220 sm_makebuf(fp);
227 if (fp->f_flags & (SMLBF|SMNBF))
235 if (fp->f_flushfp != NULL &&
236 (*fp->f_getinfo)(fp, SM_IO_IS_READABLE, NULL) <= 0)
237 sm_flush(fp->f_flushfp, &timeout);
239 fp->f_p = fp->f_bf.smb_base;
251 r = (*fp->f_read)(fp, (char *)fp->f_p, fp->f_bf.smb_size);
260 SM_IO_RD_TIMEOUT(fp, fd, &to, timeout, ret);
268 fp->f_flags |= SMFEOF;
270 fp->f_flags |= SMERR;
271 fp->f_r = 0;
274 fp->f_r = r;
294 sm_rget(fp, timeout) in sm_rget() argument
295 register SM_FILE_T *fp; in sm_rget()
298 if (sm_refill(fp, timeout) == 0)
300 fp->f_r--;
301 return *fp->f_p++;