libparted 3.6
Loading...
Searching...
No Matches
geom.in.h
Go to the documentation of this file.
1/*
2 libparted - a library for manipulating disk partitions
3 Copyright (C) 1998-2001, 2005, 2007, 2009-2014, 2019-2023 Free Software
4 Foundation, 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
27#ifndef PED_GEOM_H_INCLUDED
28#define PED_GEOM_H_INCLUDED
29
31
35struct _PedGeometry {
40};
41
42#include <parted/device.h>
43#include <parted/timer.h>
44
45extern int ped_geometry_init (PedGeometry* geom, const PedDevice* dev,
51 const PedGeometry* b);
52extern void ped_geometry_destroy (PedGeometry* geom);
56extern int ped_geometry_set_end (PedGeometry* geom, PedSector end);
57extern int ped_geometry_test_overlap (const PedGeometry* a,
58 const PedGeometry* b) _GL_ATTRIBUTE_PURE;
59extern int ped_geometry_test_inside (const PedGeometry* a,
60 const PedGeometry* b) _GL_ATTRIBUTE_PURE;
61extern int ped_geometry_test_equal (const PedGeometry* a, const PedGeometry* b)
62 _GL_ATTRIBUTE_PURE;
63extern int ped_geometry_test_sector_inside (const PedGeometry* geom,
64 PedSector sect) _GL_ATTRIBUTE_PURE;
65
66extern int ped_geometry_read (const PedGeometry* geom, void* buffer,
68extern int ped_geometry_read_alloc (const PedGeometry* geom, void** buffer,
70extern int ped_geometry_write (PedGeometry* geom, const void* buffer,
72extern PedSector ped_geometry_check (PedGeometry* geom, void* buffer,
73 PedSector buffer_size, PedSector offset,
74 PedSector granularity, PedSector count,
75 PedTimer* timer);
76extern int ped_geometry_sync (PedGeometry* geom);
77extern int ped_geometry_sync_fast (PedGeometry* geom);
78
79/* returns -1 if "sector" is not within dest's space. */
80extern 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
uint32_t start
Definition: dos.c:4
uint32_t length
Definition: dos.c:5
offset
Definition: fdasd.h:264
long long PedSector
We can address 2^63 sectors.
Definition: device.h:31
PedSector ped_geometry_check(PedGeometry *geom, void *buffer, PedSector buffer_size, PedSector offset, PedSector granularity, PedSector count, PedTimer *timer)
Checks for physical disk errors.
Definition: geom.c:407
PedGeometry * ped_geometry_duplicate(const PedGeometry *geom)
Duplicate a PedGeometry object.
Definition: geom.c:104
void ped_geometry_destroy(PedGeometry *geom)
Destroy a PedGeometry object.
Definition: geom.c:140
int ped_geometry_test_sector_inside(const PedGeometry *geom, PedSector sect)
Tests if sector is inside geom.
Definition: geom.c:261
int ped_geometry_test_overlap(const PedGeometry *a, const PedGeometry *b)
Test if a overlaps with b.
Definition: geom.c:205
PedSector ped_geometry_map(const PedGeometry *dst, const PedGeometry *src, PedSector sector)
This function takes a sector inside the region described by src, and returns that sector's address in...
Definition: geom.c:467
int ped_geometry_write(PedGeometry *geom, const void *buffer, PedSector offset, PedSector count)
Writes data into the region represented by geom.
Definition: geom.c:362
int ped_geometry_read_alloc(const PedGeometry *geom, void **buffer, PedSector offset, PedSector count)
Definition: geom.c:305
int ped_geometry_set(PedGeometry *geom, PedSector start, PedSector length)
Assign a new start, end (implicitly) and length to geom.
Definition: geom.c:153
PedGeometry * ped_geometry_intersect(const PedGeometry *a, const PedGeometry *b)
Return a PedGeometry object that refers to the intersection of a and b.
Definition: geom.c:120
int ped_geometry_sync(PedGeometry *geom)
Flushes the cache on geom.
Definition: geom.c:331
PedGeometry * ped_geometry_new(const PedDevice *dev, PedSector start, PedSector length)
Create a new PedGeometry object on disk, starting at start with a size of length sectors.
Definition: geom.c:74
int ped_geometry_test_equal(const PedGeometry *a, const PedGeometry *b)
Tests if a and b refer to the same physical region.
Definition: geom.c:245
int ped_geometry_test_inside(const PedGeometry *a, const PedGeometry *b)
Tests if b lies completely within a.
Definition: geom.c:227
int ped_geometry_sync_fast(PedGeometry *geom)
Flushes the cache on geom.
Definition: geom.c:348
int ped_geometry_set_start(PedGeometry *geom, PedSector start)
Assign a new start to geom without changing geom->end.
Definition: geom.c:181
int ped_geometry_read(const PedGeometry *geom, void *buffer, PedSector offset, PedSector count)
Reads data from the region represented by geom.
Definition: geom.c:283
int ped_geometry_set_end(PedGeometry *geom, PedSector end)
Assign a new end to geom without changing geom->start.
Definition: geom.c:192
int ped_geometry_init(PedGeometry *geom, const PedDevice *dev, PedSector start, PedSector length)
Initialize the previously allocated PedGeometry geom.
Definition: geom.c:57
uint8_t sector
Definition: pc98.c:7
A block device - for example, /dev/hda, not /dev/hda3.
Definition: device.h:74
Geometry of the partition.
Definition: geom.h:35
PedSector end
Definition: geom.h:39
PedSector start
Definition: geom.h:37
PedSector length
Definition: geom.h:38
PedDevice * dev
Definition: geom.h:36
Definition: timer.h:39