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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18#ifndef _FH_H_
19#define _FH_H_
20
21#include <inttypes.h>
22
23struct ffsb_thread;
24struct ffsb_fs;
25
26int fhopenread(char *, struct ffsb_thread *, struct ffsb_fs *);
27int fhopenwrite(char *, struct ffsb_thread *, struct ffsb_fs *);
28int fhopencreate(char *, struct ffsb_thread *, struct ffsb_fs *);
29int fhopenappend(char *, struct ffsb_thread *, struct ffsb_fs *);
30
31void fhread(int, void *, uint64_t, struct ffsb_thread *, struct ffsb_fs *);
32
33/* can only write up to size_t bytes at a time, so size is a uint32_t */
34void fhwrite(int, void *, uint32_t, struct ffsb_thread *, struct ffsb_fs *);
35void fhseek(int, uint64_t, int, struct ffsb_thread *, struct ffsb_fs *);
36void fhclose(int, struct ffsb_thread *, struct ffsb_fs *);
37
38int writefile_helper(int, uint64_t, uint32_t, char *, struct ffsb_thread *,
39		     struct ffsb_fs *);
40
41#endif /* _FH_H_ */
42