Loading...
Searching...
No Matches
geom.in.h
Go to the documentation of this file.
/*
libparted - a library for manipulating disk partitions
Copyright (C) 1998-2001, 2005, 2007, 2009-2014, 2019-2023, 2026 Free
Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PED_GEOM_H_INCLUDED
#define PED_GEOM_H_INCLUDED
typedef struct _PedGeometry PedGeometry;
struct _PedGeometry {
PedDevice* dev;
PedSector start;
PedSector length;
PedSector end;
};
#include <parted/device.h>
#include <parted/timer.h>
extern int ped_geometry_init (PedGeometry* geom, const PedDevice* dev,
PedSector start, PedSector length);
extern PedGeometry* ped_geometry_new (const PedDevice* dev, PedSector start,
PedSector length);
extern PedGeometry* ped_geometry_duplicate (const PedGeometry* geom);
extern PedGeometry* ped_geometry_intersect (const PedGeometry* a,
const PedGeometry* b);
extern void ped_geometry_destroy (PedGeometry* geom);
extern int ped_geometry_set (PedGeometry* geom, PedSector start,
PedSector length);
extern int ped_geometry_set_start (PedGeometry* geom, PedSector start);
extern int ped_geometry_set_end (PedGeometry* geom, PedSector end);
extern int ped_geometry_test_overlap (const PedGeometry* a,
const PedGeometry* b) _GL_ATTRIBUTE_PURE;
extern int ped_geometry_test_inside (const PedGeometry* a,
const PedGeometry* b) _GL_ATTRIBUTE_PURE;
extern int ped_geometry_test_equal (const PedGeometry* a, const PedGeometry* b)
_GL_ATTRIBUTE_PURE;
extern int ped_geometry_test_sector_inside (const PedGeometry* geom,
PedSector sect) _GL_ATTRIBUTE_PURE;
extern int ped_geometry_read (const PedGeometry* geom, void* buffer,
PedSector offset, PedSector count);
extern int ped_geometry_read_alloc (const PedGeometry* geom, void** buffer,
PedSector offset, PedSector count);
extern int ped_geometry_write (PedGeometry* geom, const void* buffer,
PedSector offset, PedSector count);
extern PedSector ped_geometry_check (PedGeometry* geom, void* buffer,
PedSector buffer_size, PedSector offset,
PedSector granularity, PedSector count,
PedTimer* timer);
extern int ped_geometry_sync (PedGeometry* geom);
extern int ped_geometry_sync_fast (PedGeometry* geom);
/* returns -1 if "sector" is not within dest's space. */
extern PedSector ped_geometry_map (const PedGeometry* dst,
const PedGeometry* src,
PedSector sector) _GL_ATTRIBUTE_PURE;
#endif /* PED_GEOM_H_INCLUDED */
device.h
start
uint32_t start
Definition dos.c:4
length
uint32_t length
Definition dos.c:5
offset
offset
Definition fdasd.h:264
PedSector
long long PedSector
We can address 2^63 sectors.
Definition device.h:31
PedDevice
struct _PedDevice PedDevice
Definition device.h:58
ped_geometry_check
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
ped_geometry_duplicate
PedGeometry * ped_geometry_duplicate(const PedGeometry *geom)
Duplicate a PedGeometry object.
Definition geom.c:104
ped_geometry_destroy
void ped_geometry_destroy(PedGeometry *geom)
Destroy a PedGeometry object.
Definition geom.c:140
ped_geometry_test_sector_inside
int ped_geometry_test_sector_inside(const PedGeometry *geom, PedSector sect)
Tests if sector is inside geom.
Definition geom.c:261
ped_geometry_test_overlap
int ped_geometry_test_overlap(const PedGeometry *a, const PedGeometry *b)
Test if a overlaps with b.
Definition geom.c:205
ped_geometry_map
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
ped_geometry_write
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
ped_geometry_read_alloc
int ped_geometry_read_alloc(const PedGeometry *geom, void **buffer, PedSector offset, PedSector count)
Definition geom.c:305
ped_geometry_set
int ped_geometry_set(PedGeometry *geom, PedSector start, PedSector length)
Assign a new start, end (implicitly) and length to geom.
Definition geom.c:153
ped_geometry_intersect
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
ped_geometry_sync
int ped_geometry_sync(PedGeometry *geom)
Flushes the cache on geom.
Definition geom.c:331
ped_geometry_new
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
ped_geometry_test_equal
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
ped_geometry_test_inside
int ped_geometry_test_inside(const PedGeometry *a, const PedGeometry *b)
Tests if b lies completely within a.
Definition geom.c:227
PedGeometry
struct _PedGeometry PedGeometry
Definition geom.h:30
ped_geometry_sync_fast
int ped_geometry_sync_fast(PedGeometry *geom)
Flushes the cache on geom.
Definition geom.c:348
ped_geometry_set_start
int ped_geometry_set_start(PedGeometry *geom, PedSector start)
Assign a new start to geom without changing geom->end.
Definition geom.c:181
ped_geometry_read
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
ped_geometry_set_end
int ped_geometry_set_end(PedGeometry *geom, PedSector end)
Assign a new end to geom without changing geom->start.
Definition geom.c:192
ped_geometry_init
int ped_geometry_init(PedGeometry *geom, const PedDevice *dev, PedSector start, PedSector length)
Initialize the previously allocated PedGeometry geom.
Definition geom.c:57
PedTimer
struct _PedTimer PedTimer
Definition timer.h:32
sector
uint8_t sector
Definition pc98.c:7
_PedGeometry
Geometry of the partition.
Definition geom.h:35
_PedGeometry::end
PedSector end
Definition geom.h:39
_PedGeometry::dev
PedDevice * dev
Definition geom.h:36
timer.h