Lines Matching refs:f
64 static int bzf_open(const char *path, struct open_file *f);
65 static int bzf_close(struct open_file *f);
66 static int bzf_read(struct open_file *f, void *buf, size_t size, size_t *resid);
67 static off_t bzf_seek(struct open_file *f, off_t offset, int where);
68 static int bzf_stat(struct open_file *f, struct stat *sb);
149 bzf_open(const char *fname, struct open_file *f) in bzf_open() argument
159 if (f->f_flags != F_READ) in bzf_open()
213 f->f_fsdata = bzf; in bzf_open()
218 bzf_close(struct open_file *f) in bzf_close() argument
220 struct bz_file *bzf = (struct bz_file *)f->f_fsdata; in bzf_close()
229 bzf_read(struct open_file *f, void *buf, size_t size, size_t *resid) in bzf_read() argument
231 struct bz_file *bzf = (struct bz_file *)f->f_fsdata; in bzf_read()
265 bzf_rewind(struct open_file *f) in bzf_rewind() argument
267 struct bz_file *bzf = (struct bz_file *)f->f_fsdata; in bzf_rewind()
303 f->f_fsdata = bzf_tmp; in bzf_rewind()
309 bzf_seek(struct open_file *f, off_t offset, int where) in bzf_seek() argument
311 struct bz_file *bzf = (struct bz_file *)f->f_fsdata; in bzf_seek()
328 if (target < bzf->bzf_bzstream.total_out_lo32 && bzf_rewind(f) != 0) { in bzf_seek()
334 bzf = (struct bz_file *)f->f_fsdata; in bzf_seek()
338 errno = bzf_read(f, discard, min(sizeof(discard), in bzf_seek()
348 bzf_stat(struct open_file *f, struct stat *sb) in bzf_stat() argument
350 struct bz_file *bzf = (struct bz_file *)f->f_fsdata; in bzf_stat()
369 struct open_file f; in main() local
374 memset(&f, '\0', sizeof(f)); in main()
375 f.f_flags = F_READ; in main()
376 err = bzf_open("test", &f); in main()
380 err = bzf_read(&f, buf, sizeof(buf), &resid); in main()