/*
libparted - a library for manipulating disk partitions
Copyright (C) 1999-2002, 2007-2010 Free Software Foundation, Inc.
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/>.
*/
/**
* \addtogroup PedDisk
* @{
*/
/** \file disk.h */
#ifndef PED_DISK_H_INCLUDED
#define PED_DISK_H_INCLUDED
/**
* Disk flags
*/
enum _PedDiskFlag {
/* This flag (which defaults to true) controls if disk types for
which cylinder alignment is optional do cylinder alignment when a
new partition gets added.
This flag is available for msdos and sun disklabels (for sun labels
it only controls the aligning of the end of the partition) */
};
/**
* Partition types
*/
enum _PedPartitionType {
};
/**
* Partition flags.
*/
enum _PedPartitionFlag {
};
enum _PedDiskTypeFeature {
};
struct _PedDisk;
struct _PedPartition;
struct _PedDiskOps;
struct _PedDiskType;
struct _PedDiskArchOps;
#include <stdbool.h>
/** @} */
/**
* \addtogroup PedPartition
*
* @{
*/
/** \file disk.h */
/**
* PedPartition structure represents a partition.
*/
struct _PedPartition {
/**< the partition table of the partition */
/**< the partition number: In Linux, this is the
same as the minor number. No assumption
should be made about "num" and "type"
- different disk labels have different rules. */
int num;
PED_PARTITION_LOGICAL, PED_PARTITION_EXTENDED,
PED_PARTITION_METADATA
and PED_PARTITION_FREESPACE.
Both the first two, and the last two are
mutually exclusive.
An extended partition is a primary
partition that may contain logical partitions.
There is at most one extended partition on
a disk.
A logical partition is like a primary
partition, except it's inside an extended
partition. Internally, pseudo partitions are
allocated to represent free space, or disk
label meta-data. These have the
PED_PARTITION_FREESPACE or
PED_PARTITION_METADATA bit set. */
/**< The type of file system on the partition. NULL if unknown. */
/**< Only used for an extended partition. The list of logical
partitions (and free space and metadata within the extended
partition). */
void* disk_specific;
};
/** @} */
/**
* \addtogroup PedDisk
* @{
*/
/**
* Represents a disk label (partition table).
*/
struct _PedDisk {
partition table lies */
by this label */
ped_disk_next_partition() */
void* disk_specific;
/* office use only ;-) */
partitions, for easier
update */
};
struct _PedDiskOps {
/* disk label operations */
int (*disk_set_flag) (
int state);
int (*disk_get_flag) (
int (*disk_is_flag_available) (
/** \todo add label guessing op here */
/* partition operations */
const PedFileSystemType* fs_type,
const PedFileSystemType* fs_type);
int (*partition_set_flag) (
int state);
int (*partition_get_flag) (
const PedPartition* part,
int (*partition_is_flag_available) (
const PedPartition* part,
const PedConstraint* constraint);
/* other */
int* supported);
};
struct _PedDiskType {
\todo not very intuitive name */
};
/**
* Architecture-specific operations. i.e. communication with kernel (or
* whatever) about changes, etc.
*/
struct _PedDiskArchOps {
};
const PedDiskType* disk_type);
int* supported);
/** @} */
/**
* \addtogroup PedPartition
*
* @{
*/
const PedFileSystemType* fs_type,
int state);
const PedFileSystemType* fs_type);
/** @} */
/**
* \addtogroup PedDisk
* @{
*/
const PedConstraint* constraint);
const PedConstraint* constraint,
const PedConstraint* constraint);
const PedPartition* part);
/* internal functions */
/** @} */
/**
* \addtogroup PedPartition
*
* @{
*/
const PedFileSystemType* fs_type,
extern int _ped_partition_attempt_align (
#endif /* PED_DISK_H_INCLUDED */
/** @} */