constraint.h

00001 /*
00002     libparted - a library for manipulating disk partitions
00003     Copyright (C) 1998, 1999, 2000 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 
00020 #ifndef PED_CONSTRAINT_H_INCLUDED
00021 #define PED_CONSTRAINT_H_INCLUDED
00022 
00023 typedef struct _PedConstraint   PedConstraint;
00024 
00025 #include <parted/device.h>
00026 #include <parted/natmath.h>
00027 
00028 struct _PedConstraint {
00029         PedAlignment*   start_align;
00030         PedAlignment*   end_align;
00031         PedGeometry*    start_range;
00032         PedGeometry*    end_range;
00033         PedSector       min_size;
00034         PedSector       max_size;
00035 };
00036 
00037 extern int
00038 ped_constraint_init (
00039         PedConstraint* constraint,
00040         const PedAlignment* start_align,
00041         const PedAlignment* end_align,
00042         const PedGeometry* start_range,
00043         const PedGeometry* end_range,
00044         PedSector min_size,
00045         PedSector max_size);
00046 
00047 extern PedConstraint*
00048 ped_constraint_new (
00049         const PedAlignment* start_align,
00050         const PedAlignment* end_align,
00051         const PedGeometry* start_range,
00052         const PedGeometry* end_range,
00053         PedSector min_size,
00054         PedSector max_size);
00055 
00056 extern PedConstraint*
00057 ped_constraint_new_from_min_max (
00058         const PedGeometry* min,
00059         const PedGeometry* max);
00060 
00061 extern PedConstraint*
00062 ped_constraint_new_from_min (const PedGeometry* min);
00063 
00064 extern PedConstraint*
00065 ped_constraint_new_from_max (const PedGeometry* max);
00066 
00067 extern PedConstraint*
00068 ped_constraint_duplicate (const PedConstraint* constraint);
00069 
00070 extern void
00071 ped_constraint_done (PedConstraint* constraint);
00072 
00073 extern void
00074 ped_constraint_destroy (PedConstraint* constraint);
00075 
00076 extern PedConstraint*
00077 ped_constraint_intersect (const PedConstraint* a, const PedConstraint* b);
00078 
00079 extern PedGeometry*
00080 ped_constraint_solve_max (const PedConstraint* constraint);
00081 
00082 extern PedGeometry*
00083 ped_constraint_solve_nearest (
00084         const PedConstraint* constraint, const PedGeometry* geom);
00085 
00086 extern int
00087 ped_constraint_is_solution (const PedConstraint* constraint,
00088                             const PedGeometry* geom);
00089 
00090 extern PedConstraint*
00091 ped_constraint_any (const PedDevice* dev);
00092 
00093 extern PedConstraint*
00094 ped_constraint_exact (const PedGeometry* geom);
00095 
00096 #endif /* PED_CONSTRAINT_H_INCLUDED */
00097 

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