projects
/
pintos-anon
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
s/disk_sector_no/disk_sector_t/g
[pintos-anon]
/
src
/
filesys
/
file.h
diff --git
a/src/filesys/file.h
b/src/filesys/file.h
index 8f2fbc9fb85254e8ccbbd7eb3e07507a0baa5b4a..c3cde121ad0b55ef6189272382019602b55ac0e8 100644
(file)
--- a/
src/filesys/file.h
+++ b/
src/filesys/file.h
@@
-1,15
+1,25
@@
#ifndef HEADER_FILE_H
#define HEADER_FILE_H 1
#ifndef HEADER_FILE_H
#define HEADER_FILE_H 1
+#include <stdbool.h>
#include <stdint.h>
#include <stddef.h>
#include <stdint.h>
#include <stddef.h>
+#include "disk.h"
+#include "off_t.h"
-typedef int32_t off_t;
+struct file
+ {
+ struct filehdr *hdr;
+ void *bounce;
+ off_t pos;
+ };
-
struct file
;
+
bool file_open (struct file *, disk_sector_t)
;
void file_close (struct file *);
off_t file_read (struct file *, void *, off_t);
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 (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 *);
off_t file_length (struct file *);
void file_seek (struct file *, off_t);
off_t file_tell (struct file *);