add file read/write stuff
[tfsprogs.git] / file.h
blob84604a958b328b2e44ebcd9dc8aafd5c9ff39ac2
1 #ifndef FILE_H
2 #define FILE_H
4 #include "tfs.h"
6 #define SEEK_SET 0
7 #define SEEK_CUR 1
8 #define SEEK_END 2
10 struct file {
11 struct tfs_sb_info *sbi; /* which fs we belong to */
12 struct inode *inode; /* the file-specific information */
13 uint32_t offset; /* for next read */
16 struct file *tfs_open(struct tfs_sb_info *, const char *);
17 int tfs_read(struct file *, void *, uint32_t);
18 int tfs_write(struct file *, void *, uint32_t);
19 int tfs_lseek(struct file *, int, int);
20 void tfs_close(struct file *);
22 #endif /* file.h */