geom.h

Go to the documentation of this file.
00001 /*
00002     libparted - a library for manipulating disk partitions
00003     Copyright (C) 1998-2001, 2005 Free Software Foundation, Inc.
00004 
00005     This program is free software; you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation; either version 2 of the License, or
00008     (at your option) any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License
00016     along with this program; if not, write to the Free Software
00017     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
00018 */
00019 
00027 #ifndef PED_GEOM_H_INCLUDED
00028 #define PED_GEOM_H_INCLUDED
00029 
00030 #include <parted/device.h>
00031 #include <parted/timer.h>
00032 
00033 typedef struct _PedGeometry     PedGeometry;
00034 
00038 struct _PedGeometry {
00039         PedDevice*              dev;
00040         PedSector               start;
00041         PedSector               length;
00042         PedSector               end;
00043 };
00044 
00045 extern int ped_geometry_init (PedGeometry* geom, const PedDevice* dev,
00046                               PedSector start, PedSector length);
00047 extern PedGeometry* ped_geometry_new (const PedDevice* dev, PedSector start,
00048                                       PedSector length);
00049 extern PedGeometry* ped_geometry_duplicate (const PedGeometry* geom);
00050 extern PedGeometry* ped_geometry_intersect (const PedGeometry* a,
00051                                             const PedGeometry* b);
00052 extern void ped_geometry_destroy (PedGeometry* geom);
00053 extern int ped_geometry_set (PedGeometry* geom, PedSector start,
00054                              PedSector length);
00055 extern int ped_geometry_set_start (PedGeometry* geom, PedSector start);
00056 extern int ped_geometry_set_end (PedGeometry* geom, PedSector end);
00057 extern int ped_geometry_test_overlap (const PedGeometry* a,
00058                                       const PedGeometry* b);
00059 extern int ped_geometry_test_inside (const PedGeometry* a,
00060                                      const PedGeometry* b);
00061 extern int ped_geometry_test_equal (const PedGeometry* a, const PedGeometry* b);
00062 extern int ped_geometry_test_sector_inside (const PedGeometry* geom,
00063                                             PedSector sect);
00064 
00065 extern int ped_geometry_read (const PedGeometry* geom, void* buffer,
00066                               PedSector offset, PedSector count);
00067 extern int ped_geometry_write (PedGeometry* geom, const void* buffer,
00068                                PedSector offset, PedSector count);
00069 extern PedSector ped_geometry_check (PedGeometry* geom, void* buffer,
00070                                      PedSector buffer_size, PedSector offset,
00071                                      PedSector granularity, PedSector count,
00072                                      PedTimer* timer);
00073 extern int ped_geometry_sync (PedGeometry* geom);
00074 extern int ped_geometry_sync_fast (PedGeometry* geom);
00075 
00076 /* returns -1 if "sector" is not within dest's space. */
00077 extern PedSector ped_geometry_map (const PedGeometry* dst,
00078                                    const PedGeometry* src,
00079                                    PedSector sector);
00080 
00081 #endif /* PED_GEOM_H_INCLUDED */
00082 

Generated on Fri May 4 05:15:31 2007 for libparted by  doxygen 1.5.2