+ rc = fops->read(buf, want, f->lbx->f);
+ f->offset += rc;
+
+ if (want < n || (rc < want && fops->eof(f->lbx->f)))
+ f->eof = 1;
+ return rc;
+}
+
+int lbx_file_seek(struct lbx_file_state *f, long offset, int whence)
+{
+ const struct lbx_file_ops *fops = f->lbx->fops;
+ unsigned long pos;
+
+ switch (whence) {
+ case SEEK_CUR:
+ pos = f->offset + offset;
+ break;
+ case SEEK_SET:
+ pos = offset;
+ break;
+ case SEEK_END:
+ pos = f->limit + offset;
+ break;