X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Ffilesys%2Ffile.h;h=d165e80bf427123fcd41f1634e5de9cbf117a9b6;hb=2cf38a4ba2dd965c892767b0d8ee97e67f33b274;hp=8f2fbc9fb85254e8ccbbd7eb3e07507a0baa5b4a;hpb=04584a49656ea770c77e3eee9537e1b726118cb6;p=pintos-anon diff --git a/src/filesys/file.h b/src/filesys/file.h index 8f2fbc9..d165e80 100644 --- a/src/filesys/file.h +++ b/src/filesys/file.h @@ -4,12 +4,24 @@ #include #include +#ifndef OFF_T +#define OFF_T typedef int32_t off_t; +#endif -struct file; +struct file + { + struct filehdr *hdr; + off_t pos; + }; + +bool file_open (struct file *, const char *name); +bool file_open_sector (struct file *, disk_sector_no); void file_close (struct file *); off_t file_read (struct file *, void *, off_t); +off_t file_read_at (struct file *, void *, off_t size, off_t start); off_t file_write (struct file *, const void *, off_t); +off_t file_write_at (struct file *, const void *, off_t size, off_t start); off_t file_length (struct file *); void file_seek (struct file *, off_t); off_t file_tell (struct file *);