Lines Matching refs:fp

50 **		fp -- the file pointer for the active file
51 ** fd -- raw file descriptor (from 'fp') to use for select()
60 #define SM_IO_RD_TIMEOUT(fp, fd, to, timeout, sel_ret) \
89 fp->f_r = 0; \
90 fp->f_flags |= SMERR; \
110 ** fp -- file pointer to flush
119 sm_lflush(fp, timeout)
120 SM_FILE_T *fp;
124 if ((fp->f_flags & (SMLBF|SMWR)) == (SMLBF|SMWR))
125 return sm_flush(fp, timeout);
133 ** fp -- file pointer for buffer refill
142 sm_refill(fp, timeout)
143 register SM_FILE_T *fp;
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;
285 ** fp -- file pointer to work on
294 sm_rget(fp, timeout)
295 register SM_FILE_T *fp;
298 if (sm_refill(fp, timeout) == 0)
300 fp->f_r--;
301 return *fp->f_p++;