X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Ffilesys%2Ffile.h;h=dc05332f8b3b007d49b99214f20cfa819c3a0d20;hb=400c8c5ba0d309716ad7d347dff067ddb2f99a74;hp=8f2fbc9fb85254e8ccbbd7eb3e07507a0baa5b4a;hpb=3fc16f6e9abc98a3bd5427eb210669860609a224;p=pintos-anon diff --git a/src/filesys/file.h b/src/filesys/file.h index 8f2fbc9..dc05332 100644 --- a/src/filesys/file.h +++ b/src/filesys/file.h @@ -1,17 +1,28 @@ -#ifndef HEADER_FILE_H -#define HEADER_FILE_H 1 +#ifndef FILESYS_FILE_H +#define FILESYS_FILE_H -#include -#include +#include "filesys/off_t.h" -typedef int32_t off_t; +struct inode; -struct file; +/* Opening and closing files. */ +struct file *file_open (struct inode *); +struct file *file_reopen (struct file *); void file_close (struct file *); + +/* Reading and writing. */ 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_length (struct file *); +off_t file_write_at (struct file *, const void *, off_t size, off_t start); + +/* Preventing writes. */ +void file_deny_write (struct file *); +void file_allow_write (struct file *); + +/* File position. */ void file_seek (struct file *, off_t); off_t file_tell (struct file *); +off_t file_length (struct file *); -#endif /* file.h */ +#endif /* filesys/file.h */