1 /*
2 libparted - a library for manipulating disk partitions
3 Copyright (C) 2004, 2007 Free Software Foundation, Inc.
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 #ifndef _FILE_PLUS_H
20 #define _FILE_PLUS_H
21
22 #include <parted/parted.h>
23 #include <parted/endian.h>
24 #include <parted/debug.h>
25
26 #include "hfs.h"
27
28 HfsPPrivateFile*
29 hfsplus_file_open (PedFileSystem *fs, HfsPNodeID CNID,
30 HfsPExtDataRec ext_desc, PedSector sect_nb);
31
32 void
33 hfsplus_file_close (HfsPPrivateFile* file);
34
35 int
36 hfsplus_file_read(HfsPPrivateFile* file, void *buf,
37 PedSector sector, unsigned int nb);
38
39 int
40 hfsplus_file_write(HfsPPrivateFile* file, void *buf,
41 PedSector sector, unsigned int nb);
42
43 /* Read the nth sector of a file */
44 /* return 0 on error */
45 static __inline__ int
hfsplus_file_read_sector(HfsPPrivateFile * file,void * buf,PedSector sector)46 hfsplus_file_read_sector (HfsPPrivateFile* file, void *buf, PedSector sector)
47 {
48 return hfsplus_file_read(file, buf, sector, 1);
49 }
50
51 /* Write the nth sector of a file */
52 /* return 0 on error */
53 static __inline__ int
hfsplus_file_write_sector(HfsPPrivateFile * file,void * buf,PedSector sector)54 hfsplus_file_write_sector (HfsPPrivateFile* file, void *buf, PedSector sector)
55 {
56 return hfsplus_file_write(file, buf, sector, 1);
57 }
58
59
60 #endif /* _FILE_PLUS_H */
61