-int bf_read (BFile bf, int no, int offset, int no, void *buf);
+int bf_read (BFile bf, int no, int offset, int num, void *buf)
+{
+ lseek(bf->fd, no * bf->block_size + offset, 0);
+ return(read(bf->fd, buf, num ? num : bf->block_size));
+}
+
+int bf_write (BFile bf, int no, int offset, int num, const void *buf)