2
libparted - a library for manipulating disk partitions
3
Copyright (C) 1998-2001, 2005, 2007, 2009-2012 Free Software Foundation,
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.
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.
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/>.
21
* \addtogroup PedGeometry
27
#ifndef PED_GEOM_H_INCLUDED
28
#define PED_GEOM_H_INCLUDED
30
typedef struct _PedGeometry PedGeometry;
33
* Geometry of the partition
42
#include <parted/device.h>
43
#include <parted/timer.h>
45
extern int ped_geometry_init (PedGeometry* geom, const PedDevice* dev,
46
PedSector start, PedSector length);
47
extern PedGeometry* ped_geometry_new (const PedDevice* dev, PedSector start,
49
extern PedGeometry* ped_geometry_duplicate (const PedGeometry* geom);
50
extern PedGeometry* ped_geometry_intersect (const PedGeometry* a,
51
const PedGeometry* b);
52
extern void ped_geometry_destroy (PedGeometry* geom);
53
extern int ped_geometry_set (PedGeometry* geom, PedSector start,
55
extern int ped_geometry_set_start (PedGeometry* geom, PedSector start);
56
extern int ped_geometry_set_end (PedGeometry* geom, PedSector end);
57
extern int ped_geometry_test_overlap (const PedGeometry* a,
58
const PedGeometry* b) _GL_ATTRIBUTE_PURE;
59
extern int ped_geometry_test_inside (const PedGeometry* a,
60
const PedGeometry* b) _GL_ATTRIBUTE_PURE;
61
extern int ped_geometry_test_equal (const PedGeometry* a, const PedGeometry* b)
63
extern int ped_geometry_test_sector_inside (const PedGeometry* geom,
64
PedSector sect) _GL_ATTRIBUTE_PURE;
66
extern int ped_geometry_read (const PedGeometry* geom, void* buffer,
67
PedSector offset, PedSector count);
68
extern int ped_geometry_read_alloc (const PedGeometry* geom, void** buffer,
69
PedSector offset, PedSector count);
70
extern int ped_geometry_write (PedGeometry* geom, const void* buffer,
71
PedSector offset, PedSector count);
72
extern PedSector ped_geometry_check (PedGeometry* geom, void* buffer,
73
PedSector buffer_size, PedSector offset,
74
PedSector granularity, PedSector count,
76
extern int ped_geometry_sync (PedGeometry* geom);
77
extern int ped_geometry_sync_fast (PedGeometry* geom);
79
/* returns -1 if "sector" is not within dest's space. */
80
extern PedSector ped_geometry_map (const PedGeometry* dst,
81
const PedGeometry* src,
82
PedSector sector) _GL_ATTRIBUTE_PURE;
84
#endif /* PED_GEOM_H_INCLUDED */