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