~youscribe/parted/3.1

« back to all changes in this revision

Viewing changes to include/parted/geom.in.h

  • Committer: Guilhem Lettron
  • Date: 2012-10-22 14:37:59 UTC
  • Revision ID: guilhem+ubuntu@lettron.fr-20121022143759-m403kecgz13sknvp
3.1 from tarball

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    libparted - a library for manipulating disk partitions
 
3
    Copyright (C) 1998-2001, 2005, 2007, 2009-2012 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
/**
 
21
 * \addtogroup PedGeometry
 
22
 * @{
 
23
 */
 
24
 
 
25
/** \file geom.h */
 
26
 
 
27
#ifndef PED_GEOM_H_INCLUDED
 
28
#define PED_GEOM_H_INCLUDED
 
29
 
 
30
typedef struct _PedGeometry     PedGeometry;
 
31
 
 
32
/**
 
33
 * Geometry of the partition
 
34
 */
 
35
struct _PedGeometry {
 
36
        PedDevice*              dev;
 
37
        PedSector               start;
 
38
        PedSector               length;
 
39
        PedSector               end;
 
40
};
 
41
 
 
42
#include <parted/device.h>
 
43
#include <parted/timer.h>
 
44
 
 
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,
 
48
                                      PedSector length);
 
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,
 
54
                             PedSector length);
 
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)
 
62
  _GL_ATTRIBUTE_PURE;
 
63
extern int ped_geometry_test_sector_inside (const PedGeometry* geom,
 
64
                                            PedSector sect) _GL_ATTRIBUTE_PURE;
 
65
 
 
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,
 
75
                                     PedTimer* timer);
 
76
extern int ped_geometry_sync (PedGeometry* geom);
 
77
extern int ped_geometry_sync_fast (PedGeometry* geom);
 
78
 
 
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;
 
83
 
 
84
#endif /* PED_GEOM_H_INCLUDED */
 
85
 
 
86
/** @} */