Lines Matching refs:fp

155 	register SM_FILE_T *fp;  local
166 fp = oldfp;
172 for (fp = g->gl_iobs, n = g->gl_niobs; --n >= 0; fp++)
173 if (fp->sm_magic == NULL)
179 fp->sm_magic = SmFileMagic; /* 'fp' now valid and in-use */
180 fp->f_p = NULL; /* no current pointer */
181 fp->f_w = 0; /* nothing to write */
182 fp->f_r = 0; /* nothing to read */
183 fp->f_flags = flags;
184 fp->f_file = -1; /* no file */
185 fp->f_bf.smb_base = NULL; /* no buffer */
186 fp->f_bf.smb_size = 0; /* no buffer size with no buffer */
187 fp->f_lbfsize = 0; /* not line buffered */
188 fp->f_flushfp = NULL; /* no associated flush file */
190 fp->f_cookie = fp; /* default: *open* overrides cookie setting */
191 fp->f_close = t->f_close; /* assign close function */
192 fp->f_read = t->f_read; /* assign read function */
193 fp->f_seek = t->f_seek; /* assign seek function */
194 fp->f_write = t->f_write; /* assign write function */
195 fp->f_open = t->f_open; /* assign open function */
196 fp->f_setinfo = t->f_setinfo; /* assign setinfo function */
197 fp->f_getinfo = t->f_getinfo; /* assign getinfo function */
198 fp->f_type = t->f_type; /* file type */
200 fp->f_ub.smb_base = NULL; /* no ungetc buffer */
201 fp->f_ub.smb_size = 0; /* no size for no ungetc buffer */
203 if (fp->f_timeout == SM_TIME_DEFAULT)
204 fp->f_timeout = SM_TIME_FOREVER;
206 fp->f_timeout = t->f_timeout; /* traditional behavior */
207 fp->f_timeoutstate = SM_TIME_BLOCK; /* by default */
209 return fp;
285 sm_io_setinfo(fp, what, valp) in sm_io_setinfo() argument
286 SM_FILE_T *fp; in sm_io_setinfo()
292 SM_REQUIRE_ISA(fp, SmFileMagic);
303 fp->f_close = v->f_close;
304 fp->f_read = v->f_read;
305 fp->f_seek = v->f_seek;
306 fp->f_write = v->f_write;
307 fp->f_open = v->f_open;
308 fp->f_setinfo = v->f_setinfo;
309 fp->f_getinfo = v->f_getinfo;
310 sm_free(fp->f_type);
311 fp->f_type = sm_strdup_x(v->f_type);
314 fp->f_timeout = *((int *)valp);
319 if (fp->f_setinfo == NULL)
325 return (*fp->f_setinfo)(fp, what, valp);
358 sm_io_getinfo(fp, what, valp) in sm_io_getinfo() argument
359 SM_FILE_T *fp; in sm_io_getinfo()
365 SM_REQUIRE_ISA(fp, SmFileMagic);
377 v->f_close = fp->f_close;
378 v->f_read = fp->f_read;
379 v->f_seek = fp->f_seek;
380 v->f_write = fp->f_write;
381 v->f_open = fp->f_open;
382 v->f_setinfo = fp->f_setinfo;
383 v->f_getinfo = fp->f_getinfo;
384 v->f_type = fp->f_type;
393 valp = sm_strdup_x(fp->f_type);
402 return strcmp(fp->f_type, valp) == 0;
407 if (fp->f_r > 0)
414 *((int *) valp) = fp->f_timeout;
418 if (fp->f_file > -1)
419 return fp->f_file;
426 if (fp->f_getinfo == NULL)
431 return (*fp->f_getinfo)(fp, what, valp);