Merge pull request #3 from lxbsz/wip-52438
[ffsb.git] / fh.h
1 /*
2  *   Copyright (c) International Business Machines Corp., 2001-2004
3  *
4  *   This program is free software;  you can redistribute it and/or modify
5  *   it under the terms of the GNU General Public License as published by
6  *   the Free Software Foundation; either version 2 of the License, or
7  *   (at your option) any later version.
8  *
9  *   This program is distributed in the hope that it will be useful,
10  *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
11  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
12  *   the GNU General Public License for more details.
13  *
14  *   You should have received a copy of the GNU General Public License
15  *   along with this program;  if not, write to the Free Software
16  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  */
18 #ifndef _FH_H_
19 #define _FH_H_
20
21 #include <inttypes.h>
22 #include "ffsb.h"
23
24 struct ffsb_thread;
25 struct ffsb_fs;
26
27 int fhopenread(char *, struct ffsb_thread *, struct ffsb_fs *);
28 int fhopenwrite(char *, struct ffsb_thread *, struct ffsb_fs *);
29 int fhopencreate(char *, struct ffsb_thread *, struct ffsb_fs *);
30 int fhopenappend(char *, struct ffsb_thread *, struct ffsb_fs *);
31
32 void fhread(int, void *, uint64_t, struct ffsb_thread *, struct ffsb_fs *);
33
34 /* can only write up to size_t bytes at a time, so size is a uint32_t */
35 void fhwrite(int, void *, uint32_t, struct ffsb_thread *, struct ffsb_fs *);
36 void fhseek(int, uint64_t, int, struct ffsb_thread *, struct ffsb_fs *);
37 void fhclose(int, struct ffsb_thread *, struct ffsb_fs *);
38
39 int writefile_helper(int, uint64_t, uint32_t, char *, struct ffsb_thread *,
40                      struct ffsb_fs *);
41 void fhstat(char *name, ffsb_thread_t *ft, ffsb_fs_t *fs);
42
43 #endif /* _FH_H_ */