Lines Matching refs:fp
47 #define COPY(n) (void)memcpy((void *)fp->f_p, (void *)p, (size_t)(n))
58 sm_fvwrite(fp, timeout, uio)
59 register SM_FILE_T *fp;
76 if (cantwrite(fp))
82 SM_CONVERT_TIME(fp, fd, timeout, &to);
88 if (fp->f_flags & SMNBF)
95 w = (*fp->f_write)(fp, p, SM_MIN(len, SM_IO_BUFSIZ));
104 SM_IO_WR_TIMEOUT(fp, fd, timeout);
114 else if ((fp->f_flags & SMLBF) == 0)
132 if ((((fp->f_flags & (SMALC | SMSTR)) == (SMALC | SMSTR))
133 || ((fp->f_flags & SMNOW) != 0))
134 && (size_t) fp->f_w < len)
136 size_t blen = fp->f_p - fp->f_bf.smb_base;
141 tsize = fp->f_bf.smb_size;
146 tbase = (unsigned char *) sm_realloc(fp->f_bf.smb_base,
153 fp->f_w += tsize - fp->f_bf.smb_size;
154 fp->f_bf.smb_base = tbase;
155 fp->f_bf.smb_size = tsize;
156 fp->f_p = tbase + blen;
158 w = fp->f_w;
160 if (fp->f_flags & SMSTR)
165 fp->f_w -= w;
166 fp->f_p += w;
169 else if (fp->f_p > fp->f_bf.smb_base
174 fp->f_p += w;
175 if (sm_flush(fp, &timeout))
178 else if (len >= (size_t) (w = fp->f_bf.smb_size))
181 w = (*fp->f_write)(fp, p, w);
190 SM_IO_WR_TIMEOUT(fp, fd, timeout);
199 fp->f_w -= w;
200 fp->f_p += w;
206 if ((fp->f_flags & SMNOW) != 0 && sm_flush(fp, &timeout))
231 w = fp->f_w + fp->f_bf.smb_size;
233 if (fp->f_p > fp->f_bf.smb_base && s > w)
237 fp->f_p += w;
238 if (sm_flush(fp, &timeout))
241 else if (s >= (w = fp->f_bf.smb_size))
243 w = (*fp->f_write)(fp, p, w);
252 SM_IO_WR_TIMEOUT(fp, fd, timeout);
260 fp->f_w -= w;
261 fp->f_p += w;
266 if (sm_flush(fp, &timeout))
279 fp->f_flags |= SMERR;