c3cde121ad0b55ef6189272382019602b55ac0e8
[pintos-anon] / src / filesys / file.h
1 #ifndef HEADER_FILE_H
2 #define HEADER_FILE_H 1
3
4 #include <stdbool.h>
5 #include <stdint.h>
6 #include <stddef.h>
7 #include "disk.h"
8 #include "off_t.h"
9
10 struct file 
11   {
12     struct filehdr *hdr;
13     void *bounce;
14     off_t pos;
15   };
16
17 bool file_open (struct file *, disk_sector_t);
18 void file_close (struct file *);
19 off_t file_read (struct file *, void *, off_t);
20 off_t file_read_at (struct file *, void *, off_t size, off_t start);
21 off_t file_write (struct file *, const void *, off_t);
22 off_t file_write_at (struct file *, const void *, off_t size, off_t start);
23 off_t file_length (struct file *);
24 void file_seek (struct file *, off_t);
25 off_t file_tell (struct file *);
26
27 #endif /* file.h */