Loading...
Searching...
No Matches
disk.in.h
Go to the documentation of this file.
/*
libparted - a library for manipulating disk partitions
Copyright (C) 1999-2002, 2007-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_DISK_H_INCLUDED
#define PED_DISK_H_INCLUDED
/* Include these to work around gnulib redefining free, read, etc. which causes problems
* with pt-common.h
*/
#include <stdlib.h>
#include <unistd.h>
#include <stdint.h>
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) */
PED_DISK_CYLINDER_ALIGNMENT=1,
/* This flag controls whether the boot flag of a GPT PMBR is set */
PED_DISK_GPT_PMBR_BOOT=2,
};
// NOTE: DO NOT define using enums
#define PED_DISK_FIRST_FLAG 1 // PED_DISK_CYLINDER_ALIGNMENT
#define PED_DISK_LAST_FLAG 2 // PED_DISK_GPT_PMBR_BOOT
enum _PedPartitionType {
PED_PARTITION_NORMAL = 0x00,
PED_PARTITION_LOGICAL = 0x01,
PED_PARTITION_EXTENDED = 0x02,
PED_PARTITION_FREESPACE = 0x04,
PED_PARTITION_METADATA = 0x08,
PED_PARTITION_PROTECTED = 0x10
};
enum _PedPartitionFlag {
PED_PARTITION_BOOT=1,
PED_PARTITION_ROOT=2,
PED_PARTITION_SWAP=3,
PED_PARTITION_HIDDEN=4,
PED_PARTITION_RAID=5,
PED_PARTITION_LVM=6,
PED_PARTITION_LBA=7,
PED_PARTITION_HPSERVICE=8,
PED_PARTITION_PALO=9,
PED_PARTITION_PREP=10,
PED_PARTITION_MSFT_RESERVED=11,
PED_PARTITION_BIOS_GRUB=12,
PED_PARTITION_APPLE_TV_RECOVERY=13,
PED_PARTITION_DIAG=14,
PED_PARTITION_LEGACY_BOOT=15,
PED_PARTITION_MSFT_DATA=16,
PED_PARTITION_IRST=17,
PED_PARTITION_ESP=18,
PED_PARTITION_CHROMEOS_KERNEL=19,
PED_PARTITION_BLS_BOOT=20,
PED_PARTITION_LINUX_HOME=21,
PED_PARTITION_NO_AUTOMOUNT=22,
};
// NOTE: DO NOT define using enums
#define PED_PARTITION_FIRST_FLAG 1 // PED_PARTITION_BOOT
#define PED_PARTITION_LAST_FLAG 22 // PED_PARTITION_NO_AUTOMOUNT
enum _PedDiskTypeFeature {
PED_DISK_TYPE_EXTENDED=1,
PED_DISK_TYPE_PARTITION_NAME=2,
PED_DISK_TYPE_PARTITION_TYPE_ID=4,
PED_DISK_TYPE_PARTITION_TYPE_UUID=8,
PED_DISK_TYPE_DISK_UUID=16,
PED_DISK_TYPE_PARTITION_UUID=32,
};
// NOTE: DO NOT define using enums
#define PED_DISK_TYPE_FIRST_FEATURE 1 // PED_DISK_TYPE_EXTENDED
#define PED_DISK_TYPE_LAST_FEATURE 32 // PED_DISK_TYPE_PARTITION_UUID
struct _PedDisk;
struct _PedPartition;
struct _PedDiskOps;
struct _PedDiskType;
struct _PedDiskArchOps;
typedef enum _PedDiskFlag PedDiskFlag;
typedef enum _PedPartitionType PedPartitionType;
typedef enum _PedPartitionFlag PedPartitionFlag;
typedef enum _PedDiskTypeFeature PedDiskTypeFeature;
typedef struct _PedDisk PedDisk;
typedef struct _PedPartition PedPartition;
typedef const struct _PedDiskOps PedDiskOps;
typedef struct _PedDiskType PedDiskType;
typedef const struct _PedDiskArchOps PedDiskArchOps;
#include <parted/device.h>
#include <parted/filesys.h>
#include <parted/natmath.h>
#include <parted/geom.h>
#include <stdbool.h>
struct _PedPartition {
PedPartition* prev;
PedPartition* next;
PedDisk* disk;
PedGeometry geom;
int num;
PedPartitionType type;
const PedFileSystemType* fs_type;
PedPartition* part_list;
void* disk_specific;
};
struct _PedDisk {
PedDevice* dev;
const PedDiskType* type;
const int* block_sizes;
PedPartition* part_list;
void* disk_specific;
/* office use only ;-) */
int needs_clobber;
int update_mode;
};
struct _PedDiskOps {
/* disk label operations */
int (*probe) (const PedDevice *dev);
int (*clobber) (PedDevice* dev);
PedDisk* (*alloc) (const PedDevice* dev);
PedDisk* (*duplicate) (const PedDisk* disk);
void (*free) (PedDisk* disk);
int (*read) (PedDisk* disk);
int (*write) (const PedDisk* disk);
int (*disk_set_flag) (
PedDisk *disk,
PedDiskFlag flag,
int state);
int (*disk_get_flag) (
const PedDisk *disk,
PedDiskFlag flag);
int (*disk_is_flag_available) (
const PedDisk *disk,
PedDiskFlag flag);
uint8_t* (*disk_get_uuid) (const PedDisk* disk);
/* partition operations */
PedPartition* (*partition_new) (
const PedDisk* disk,
PedPartitionType part_type,
const PedFileSystemType* fs_type,
PedSector start,
PedSector end);
PedPartition* (*partition_duplicate) (const PedPartition* part);
void (*partition_destroy) (PedPartition* part);
int (*partition_set_system) (PedPartition* part,
const PedFileSystemType* fs_type);
int (*partition_set_flag) (
PedPartition* part,
PedPartitionFlag flag,
int state);
int (*partition_get_flag) (
const PedPartition* part,
PedPartitionFlag flag);
int (*partition_is_flag_available) (
const PedPartition* part,
PedPartitionFlag flag);
void (*partition_set_name) (PedPartition* part, const char* name);
const char* (*partition_get_name) (const PedPartition* part);
int (*partition_set_type_id) (PedPartition* part, uint8_t id);
uint8_t (*partition_get_type_id) (const PedPartition* part);
int (*partition_set_type_uuid) (PedPartition* part, const uint8_t* uuid);
uint8_t* (*partition_get_type_uuid) (const PedPartition* part);
uint8_t* (*partition_get_uuid) (const PedPartition* part);
int (*partition_align) (PedPartition* part,
const PedConstraint* constraint);
int (*partition_enumerate) (PedPartition* part);
bool (*partition_check) (const PedPartition* part);
/* other */
int (*alloc_metadata) (PedDisk* disk);
int (*get_max_primary_partition_count) (const PedDisk* disk);
bool (*get_max_supported_partition_count) (const PedDisk* disk,
int* supported);
PedAlignment *(*get_partition_alignment)(const PedDisk *disk);
PedSector (*max_length) (void);
PedSector (*max_start_sector) (void);
};
struct _PedDiskType {
PedDiskType* next;
const char* name;
PedDiskOps* const ops;
PedDiskTypeFeature features;
};
struct _PedDiskArchOps {
char* (*partition_get_path) (const PedPartition* part);
int (*partition_is_busy) (const PedPartition* part);
int (*disk_commit) (PedDisk* disk);
};
extern void ped_disk_type_register (PedDiskType* type);
extern void ped_disk_type_unregister (PedDiskType* type);
extern PedDiskType* ped_disk_type_get_next (PedDiskType const *type)
_GL_ATTRIBUTE_PURE;
extern PedDiskType* ped_disk_type_get (const char* name)
_GL_ATTRIBUTE_PURE;
extern int ped_disk_type_check_feature (const PedDiskType* disk_type,
PedDiskTypeFeature feature)
_GL_ATTRIBUTE_PURE;
extern PedDiskType* ped_disk_probe (PedDevice* dev);
extern int ped_disk_clobber (PedDevice* dev);
extern PedDisk* ped_disk_new (PedDevice* dev);
extern PedDisk* ped_disk_new_fresh (PedDevice* dev,
const PedDiskType* disk_type);
extern PedDisk* ped_disk_duplicate (const PedDisk* old_disk);
extern void ped_disk_destroy (PedDisk* disk);
extern int ped_disk_commit (PedDisk* disk);
extern int ped_disk_commit_to_dev (PedDisk* disk);
extern int ped_disk_commit_to_os (PedDisk* disk);
extern int ped_disk_check (const PedDisk* disk);
extern void ped_disk_print (const PedDisk* disk);
extern int ped_disk_get_primary_partition_count (const PedDisk* disk)
_GL_ATTRIBUTE_PURE;
extern int ped_disk_get_last_partition_num (const PedDisk* disk)
_GL_ATTRIBUTE_PURE;
extern int ped_disk_get_max_primary_partition_count (const PedDisk* disk);
extern bool ped_disk_get_max_supported_partition_count(const PedDisk* disk,
int* supported);
extern PedAlignment *ped_disk_get_partition_alignment(const PedDisk *disk);
extern int ped_disk_set_flag(PedDisk *disk, PedDiskFlag flag, int state);
extern int ped_disk_get_flag(const PedDisk *disk, PedDiskFlag flag);
extern int ped_disk_is_flag_available(const PedDisk *disk, PedDiskFlag flag);
extern uint8_t* ped_disk_get_uuid (const PedDisk* disk);
extern const char *ped_disk_flag_get_name(PedDiskFlag flag);
extern PedDiskFlag ped_disk_flag_get_by_name(const char *name);
extern PedDiskFlag ped_disk_flag_next(PedDiskFlag flag) _GL_ATTRIBUTE_CONST;
extern PedPartition* ped_partition_new (const PedDisk* disk,
PedPartitionType type,
const PedFileSystemType* fs_type,
PedSector start,
PedSector end);
extern void ped_partition_destroy (PedPartition* part);
extern int ped_partition_is_active (const PedPartition* part) _GL_ATTRIBUTE_PURE;
extern int ped_partition_set_flag (PedPartition* part, PedPartitionFlag flag,
int state);
extern int ped_partition_get_flag (const PedPartition* part,
PedPartitionFlag flag);
extern int ped_partition_is_flag_available (const PedPartition* part,
PedPartitionFlag flag);
extern int ped_partition_set_system (PedPartition* part,
const PedFileSystemType* fs_type);
extern int ped_partition_set_name (PedPartition* part, const char* name);
extern const char* ped_partition_get_name (const PedPartition* part);
extern int ped_partition_set_type_id (PedPartition* part, uint8_t id);
extern uint8_t ped_partition_get_type_id (const PedPartition* part);
extern int ped_partition_set_type_uuid (PedPartition* part, const uint8_t* uuid);
extern uint8_t* ped_partition_get_type_uuid (const PedPartition* part);
extern uint8_t* ped_partition_get_uuid (const PedPartition* part);
extern int ped_partition_is_busy (const PedPartition* part);
extern char* ped_partition_get_path (const PedPartition* part);
extern const char* ped_partition_type_get_name (PedPartitionType part_type)
_GL_ATTRIBUTE_CONST;
extern const char* ped_partition_flag_get_name (PedPartitionFlag flag);
extern PedPartitionFlag ped_partition_flag_get_by_name (const char* name);
extern PedPartitionFlag ped_partition_flag_next (PedPartitionFlag flag)
_GL_ATTRIBUTE_CONST;
extern int ped_disk_add_partition (PedDisk* disk, PedPartition* part,
const PedConstraint* constraint);
extern int ped_disk_remove_partition (PedDisk* disk, PedPartition* part);
extern int ped_disk_delete_partition (PedDisk* disk, PedPartition* part);
extern int ped_disk_delete_all (PedDisk* disk);
extern int ped_disk_set_partition_geom (PedDisk* disk, PedPartition* part,
const PedConstraint* constraint,
PedSector start, PedSector end);
extern int ped_disk_maximize_partition (PedDisk* disk, PedPartition* part,
const PedConstraint* constraint);
extern PedGeometry* ped_disk_get_max_partition_geometry (PedDisk* disk,
PedPartition* part, const PedConstraint* constraint);
extern int ped_disk_minimize_extended_partition (PedDisk* disk);
extern PedPartition* ped_disk_next_partition (const PedDisk* disk,
const PedPartition* part)
_GL_ATTRIBUTE_PURE;
extern PedPartition* ped_disk_get_partition (const PedDisk* disk, int num)
_GL_ATTRIBUTE_PURE;
extern PedPartition* ped_disk_get_partition_by_sector (const PedDisk* disk,
PedSector sect)
_GL_ATTRIBUTE_PURE;
extern PedPartition* ped_disk_extended_partition (const PedDisk* disk)
_GL_ATTRIBUTE_PURE;
extern PedSector ped_disk_max_partition_length (const PedDisk *disk);
extern PedSector ped_disk_max_partition_start_sector (const PedDisk *disk);
/* internal functions */
extern PedDisk* _ped_disk_alloc (const PedDevice* dev, const PedDiskType* type);
extern void _ped_disk_free (PedDisk* disk);
extern PedPartition* _ped_partition_alloc (const PedDisk* disk,
PedPartitionType type,
const PedFileSystemType* fs_type,
PedSector start,
PedSector end);
extern void _ped_partition_free (PedPartition* part);
extern int _ped_partition_attempt_align (
PedPartition* part, const PedConstraint* external,
PedConstraint* internal);
#endif /* PED_DISK_H_INCLUDED */
PedConstraint
struct _PedConstraint PedConstraint
Definition constraint.h:23
device.h
type
uint8_t type
Definition dos.c:2
start
uint32_t start
Definition dos.c:4
uuid
uint8_t uuid[16]
Definition f2fs.h:27
filesys.h
geom.h
PedAlignment
struct _PedAlignment PedAlignment
Definition natmath.h:31
PedSector
long long PedSector
We can address 2^63 sectors.
Definition device.h:31
PedDevice
struct _PedDevice PedDevice
Definition device.h:58
_ped_disk_free
void _ped_disk_free(PedDisk *disk)
Definition disk.c:423
_PedDiskFlag
_PedDiskFlag
Disk flags.
Definition disk.h:40
_PedDiskTypeFeature
_PedDiskTypeFeature
Definition disk.h:97
PedPartition
struct _PedPartition PedPartition
Definition disk.h:120
ped_disk_get_partition_by_sector
PedPartition * ped_disk_get_partition_by_sector(const PedDisk *disk, PedSector sect)
Returns the partition that contains sect.
Definition disk.c:1790
PedDiskArchOps
const struct _PedDiskArchOps PedDiskArchOps
Definition disk.h:123
ped_disk_get_max_supported_partition_count
bool ped_disk_get_max_supported_partition_count(const PedDisk *disk, int *supported)
Get the highest supported partition number on disk.
Definition disk.c:716
ped_disk_get_max_primary_partition_count
int ped_disk_get_max_primary_partition_count(const PedDisk *disk)
Get the maximum number of (primary) partitions the disk label supports.
Definition disk.c:751
ped_disk_flag_get_name
const char * ped_disk_flag_get_name(PedDiskFlag flag)
Returns a name for a flag, e.g.
Definition disk.c:843
ped_disk_max_partition_start_sector
PedSector ped_disk_max_partition_start_sector(const PedDisk *disk)
Return the maximum representable start sector of a partition on disk \disk.
Definition disk.c:1825
_PedPartitionType
_PedPartitionType
Partition types.
Definition disk.h:57
ped_disk_get_uuid
uint8_t * ped_disk_get_uuid(const PedDisk *disk)
Get the uuid of the disk disk.
Definition disk.c:915
ped_disk_extended_partition
PedPartition * ped_disk_extended_partition(const PedDisk *disk)
Definition disk.c:1694
ped_disk_type_check_feature
int ped_disk_type_check_feature(const PedDiskType *disk_type, PedDiskTypeFeature feature)
This function checks if a particular type of partition table supports a feature.
Definition disk.c:663
ped_disk_set_flag
int ped_disk_set_flag(PedDisk *disk, PedDiskFlag flag, int state)
Set the state (1 or 0) of a flag on a disk.
Definition disk.c:770
ped_disk_commit_to_dev
int ped_disk_commit_to_dev(PedDisk *disk)
Write the changes made to the in-memory description of a partition table to the device.
Definition disk.c:484
ped_disk_remove_partition
int ped_disk_remove_partition(PedDisk *disk, PedPartition *part)
Removes PedPartition part from PedDisk disk.
Definition disk.c:2193
PedPartitionFlag
enum _PedPartitionFlag PedPartitionFlag
Definition disk.h:117
ped_disk_add_partition
int ped_disk_add_partition(PedDisk *disk, PedPartition *part, const PedConstraint *constraint)
Adds PedPartition part to PedDisk disk.
Definition disk.c:2122
_ped_disk_alloc
PedDisk * _ped_disk_alloc(const PedDevice *dev, const PedDiskType *type)
Definition disk.c:403
ped_disk_check
int ped_disk_check(const PedDisk *disk)
Perform a sanity check on a partition table.
Definition disk.c:605
PedDiskType
struct _PedDiskType PedDiskType
Definition disk.h:122
ped_disk_get_max_partition_geometry
PedGeometry * ped_disk_get_max_partition_geometry(PedDisk *disk, PedPartition *part, const PedConstraint *constraint)
Get the maximum geometry part can be grown to, subject to constraint.
Definition disk.c:2424
ped_disk_get_flag
int ped_disk_get_flag(const PedDisk *disk, PedDiskFlag flag)
Get the state (1 or 0) of a flag on a disk.
Definition disk.c:804
ped_disk_get_partition_alignment
PedAlignment * ped_disk_get_partition_alignment(const PedDisk *disk)
Get the alignment needed for partition boundaries on this disk.
Definition disk.c:735
_PedPartitionFlag
_PedPartitionFlag
Partition flags.
Definition disk.h:69
ped_disk_is_flag_available
int ped_disk_is_flag_available(const PedDisk *disk, PedDiskFlag flag)
Check whether a given flag is available on a disk.
Definition disk.c:822
ped_disk_flag_get_by_name
PedDiskFlag ped_disk_flag_get_by_name(const char *name)
Returns the flag associated with name.
Definition disk.c:867
PedDiskTypeFeature
enum _PedDiskTypeFeature PedDiskTypeFeature
Definition disk.h:118
ped_disk_maximize_partition
int ped_disk_maximize_partition(PedDisk *disk, PedPartition *part, const PedConstraint *constraint)
Grow PedPartition part geometry to the maximum possible subject to constraint.
Definition disk.c:2362
ped_disk_delete_partition
int ped_disk_delete_partition(PedDisk *disk, PedPartition *part)
Removes part from disk, and destroys part.
Definition disk.c:2217
ped_disk_destroy
void ped_disk_destroy(PedDisk *disk)
Close disk.
Definition disk.c:438
ped_disk_type_get_next
PedDiskType * ped_disk_type_get_next(PedDiskType const *type)
Return the next disk type registers, after "type".
Definition disk.c:106
ped_disk_next_partition
PedPartition * ped_disk_next_partition(const PedDisk *disk, const PedPartition *part)
Return the next partition after part on disk.
Definition disk.c:1717
PedDisk
struct _PedDisk PedDisk
Definition disk.h:119
PedPartitionType
enum _PedPartitionType PedPartitionType
Definition disk.h:116
ped_disk_probe
PedDiskType * ped_disk_probe(PedDevice *dev)
Return the type of partition table detected on "dev".
Definition disk.c:140
ped_disk_max_partition_length
PedSector ped_disk_max_partition_length(const PedDisk *disk)
Return the maximum representable length (in sectors) of a partition on disk \disk.
Definition disk.c:1815
ped_disk_get_partition
PedPartition * ped_disk_get_partition(const PedDisk *disk, int num)
Returns the partition numbered num.
Definition disk.c:1769
ped_disk_get_last_partition_num
int ped_disk_get_last_partition_num(const PedDisk *disk)
Get the highest available partition number on disk.
Definition disk.c:694
ped_disk_type_unregister
void ped_disk_type_unregister(PedDiskType *type)
Definition disk.c:81
ped_disk_commit_to_os
int ped_disk_commit_to_os(PedDisk *disk)
Tell the operating system kernel about the partition table layout of disk.
Definition disk.c:460
ped_disk_duplicate
PedDisk * ped_disk_duplicate(const PedDisk *old_disk)
Clone a PedDisk object.
Definition disk.c:257
ped_disk_new
PedDisk * ped_disk_new(PedDevice *dev)
Read the partition table off a device (if one is found).
Definition disk.c:181
ped_disk_commit
int ped_disk_commit(PedDisk *disk)
Definition disk.c:528
ped_disk_flag_next
PedDiskFlag ped_disk_flag_next(PedDiskFlag flag)
Iterates through all disk flags.
Definition disk.c:890
PedDiskFlag
enum _PedDiskFlag PedDiskFlag
Definition disk.h:115
PedDiskOps
const struct _PedDiskOps PedDiskOps
Definition disk.h:121
ped_disk_clobber
int ped_disk_clobber(PedDevice *dev)
Remove all identifying signatures of a partition table,.
Definition disk.c:317
ped_disk_get_primary_partition_count
int ped_disk_get_primary_partition_count(const PedDisk *disk)
Get the number of primary partitions.
Definition disk.c:673
ped_disk_type_register
void ped_disk_type_register(PedDiskType *type)
Definition disk.c:70
ped_disk_delete_all
int ped_disk_delete_all(PedDisk *disk)
Removes and destroys all partitions on disk.
Definition disk.c:2260
ped_disk_print
void ped_disk_print(const PedDisk *disk)
Prints a summary of disk's partitions.
Definition disk.c:2663
ped_disk_set_partition_geom
int ped_disk_set_partition_geom(PedDisk *disk, PedPartition *part, const PedConstraint *constraint, PedSector start, PedSector end)
Sets the geometry of part (i.e.
Definition disk.c:2298
ped_disk_type_get
PedDiskType * ped_disk_type_get(const char *name)
Return the disk type with a name of "name".
Definition disk.c:120
ped_disk_minimize_extended_partition
int ped_disk_minimize_extended_partition(PedDisk *disk)
Reduce the size of the extended partition to a minimum while still wrapping its logical partitions.
Definition disk.c:2461
ped_disk_new_fresh
PedDisk * ped_disk_new_fresh(PedDevice *dev, const PedDiskType *disk_type)
Create a new partition table on dev.
Definition disk.c:375
PED_DISK_GPT_PMBR_BOOT
@ PED_DISK_GPT_PMBR_BOOT
Definition disk.h:48
PED_DISK_CYLINDER_ALIGNMENT
@ PED_DISK_CYLINDER_ALIGNMENT
Definition disk.h:46
PED_DISK_TYPE_PARTITION_UUID
@ PED_DISK_TYPE_PARTITION_UUID
supports partition uuids
Definition disk.h:103
PED_DISK_TYPE_PARTITION_TYPE_UUID
@ PED_DISK_TYPE_PARTITION_TYPE_UUID
supports partition type-uuids
Definition disk.h:101
PED_DISK_TYPE_PARTITION_TYPE_ID
@ PED_DISK_TYPE_PARTITION_TYPE_ID
supports partition type-ids
Definition disk.h:100
PED_DISK_TYPE_PARTITION_NAME
@ PED_DISK_TYPE_PARTITION_NAME
supports partition names
Definition disk.h:99
PED_DISK_TYPE_EXTENDED
@ PED_DISK_TYPE_EXTENDED
supports extended partitions
Definition disk.h:98
PED_DISK_TYPE_DISK_UUID
@ PED_DISK_TYPE_DISK_UUID
supports disk uuids
Definition disk.h:102
PED_PARTITION_METADATA
@ PED_PARTITION_METADATA
Definition disk.h:62
PED_PARTITION_FREESPACE
@ PED_PARTITION_FREESPACE
Definition disk.h:61
PED_PARTITION_PROTECTED
@ PED_PARTITION_PROTECTED
Definition disk.h:63
PED_PARTITION_EXTENDED
@ PED_PARTITION_EXTENDED
Definition disk.h:60
PED_PARTITION_LOGICAL
@ PED_PARTITION_LOGICAL
Definition disk.h:59
PED_PARTITION_NORMAL
@ PED_PARTITION_NORMAL
Definition disk.h:58
PED_PARTITION_SWAP
@ PED_PARTITION_SWAP
Definition disk.h:72
PED_PARTITION_MSFT_DATA
@ PED_PARTITION_MSFT_DATA
Definition disk.h:85
PED_PARTITION_PREP
@ PED_PARTITION_PREP
Definition disk.h:79
PED_PARTITION_CHROMEOS_KERNEL
@ PED_PARTITION_CHROMEOS_KERNEL
Definition disk.h:88
PED_PARTITION_RAID
@ PED_PARTITION_RAID
Definition disk.h:74
PED_PARTITION_BLS_BOOT
@ PED_PARTITION_BLS_BOOT
Definition disk.h:89
PED_PARTITION_LINUX_HOME
@ PED_PARTITION_LINUX_HOME
Definition disk.h:90
PED_PARTITION_BOOT
@ PED_PARTITION_BOOT
Definition disk.h:70
PED_PARTITION_HPSERVICE
@ PED_PARTITION_HPSERVICE
Definition disk.h:77
PED_PARTITION_HIDDEN
@ PED_PARTITION_HIDDEN
Definition disk.h:73
PED_PARTITION_MSFT_RESERVED
@ PED_PARTITION_MSFT_RESERVED
Definition disk.h:80
PED_PARTITION_DIAG
@ PED_PARTITION_DIAG
Definition disk.h:83
PED_PARTITION_NO_AUTOMOUNT
@ PED_PARTITION_NO_AUTOMOUNT
Definition disk.h:91
PED_PARTITION_LVM
@ PED_PARTITION_LVM
Definition disk.h:75
PED_PARTITION_ROOT
@ PED_PARTITION_ROOT
Definition disk.h:71
PED_PARTITION_ESP
@ PED_PARTITION_ESP
Definition disk.h:87
PED_PARTITION_BIOS_GRUB
@ PED_PARTITION_BIOS_GRUB
Definition disk.h:81
PED_PARTITION_LBA
@ PED_PARTITION_LBA
Definition disk.h:76
PED_PARTITION_LEGACY_BOOT
@ PED_PARTITION_LEGACY_BOOT
Definition disk.h:84
PED_PARTITION_PALO
@ PED_PARTITION_PALO
Definition disk.h:78
PED_PARTITION_APPLE_TV_RECOVERY
@ PED_PARTITION_APPLE_TV_RECOVERY
Definition disk.h:82
PED_PARTITION_IRST
@ PED_PARTITION_IRST
Definition disk.h:86
PedFileSystemType
struct _PedFileSystemType PedFileSystemType
Definition filesys.h:31
PedGeometry
struct _PedGeometry PedGeometry
Definition geom.h:30
ped_partition_set_name
int ped_partition_set_name(PedPartition *part, const char *name)
Sets the name of a partition.
Definition disk.c:1559
ped_partition_type_get_name
const char * ped_partition_type_get_name(PedPartitionType part_type)
Returns a name that seems mildly appropriate for a partition type type.
Definition disk.c:2523
ped_partition_flag_next
PedPartitionFlag ped_partition_flag_next(PedPartitionFlag flag)
Iterates through all flags.
Definition disk.c:2612
_ped_partition_free
void _ped_partition_free(PedPartition *part)
Definition disk.c:1259
ped_partition_is_active
int ped_partition_is_active(const PedPartition *part)
Return whether or not the partition is "active".
Definition disk.c:1372
ped_partition_is_busy
int ped_partition_is_busy(const PedPartition *part)
Check whether a partition is mounted or busy in some other way.
Definition disk.c:566
ped_partition_set_type_id
int ped_partition_set_type_id(PedPartition *part, uint8_t id)
Set the type-id of the partition part.
Definition disk.c:1600
ped_partition_new
PedPartition * ped_partition_new(const PedDisk *disk, PedPartitionType type, const PedFileSystemType *fs_type, PedSector start, PedSector end)
Create a new PedPartition on disk.
Definition disk.c:1307
ped_partition_destroy
void ped_partition_destroy(PedPartition *part)
Destroy a PedPartition object.
Definition disk.c:1355
_ped_partition_attempt_align
int _ped_partition_attempt_align(PedPartition *part, const PedConstraint *external, PedConstraint *internal)
Definition disk.c:1265
ped_partition_get_type_id
uint8_t ped_partition_get_type_id(const PedPartition *part)
Get the type-id of the partition part.
Definition disk.c:1618
_ped_partition_alloc
PedPartition * _ped_partition_alloc(const PedDisk *disk, PedPartitionType type, const PedFileSystemType *fs_type, PedSector start, PedSector end)
Definition disk.c:1226
ped_partition_set_system
int ped_partition_set_system(PedPartition *part, const PedFileSystemType *fs_type)
Sets the system type on the partition to fs_type.
Definition disk.c:1468
ped_partition_is_flag_available
int ped_partition_is_flag_available(const PedPartition *part, PedPartitionFlag flag)
Check whether a given flag is available on a partition.
Definition disk.c:1448
ped_partition_flag_get_name
const char * ped_partition_flag_get_name(PedPartitionFlag flag)
Returns a name for a flag, e.g.
Definition disk.c:2546
ped_partition_get_uuid
uint8_t * ped_partition_get_uuid(const PedPartition *part)
Get the uuid of the partition part.
Definition disk.c:1672
ped_partition_get_path
char * ped_partition_get_path(const PedPartition *part)
Return a path that can be used to address the partition in the operating system.
Definition disk.c:578
ped_partition_get_flag
int ped_partition_get_flag(const PedPartition *part, PedPartitionFlag flag)
Get the state (1 or 0) of a flag on a partition.
Definition disk.c:1432
ped_partition_get_name
const char * ped_partition_get_name(const PedPartition *part)
Returns the name of a partition part.
Definition disk.c:1582
ped_partition_set_type_uuid
int ped_partition_set_type_uuid(PedPartition *part, const uint8_t *uuid)
Set the type-uuid of the partition part.
Definition disk.c:1636
ped_partition_get_type_uuid
uint8_t * ped_partition_get_type_uuid(const PedPartition *part)
Get the type-uuid of the partition part.
Definition disk.c:1654
ped_partition_flag_get_by_name
PedPartitionFlag ped_partition_flag_get_by_name(const char *name)
Returns the flag associated with name.
Definition disk.c:2624
ped_partition_set_flag
int ped_partition_set_flag(PedPartition *part, PedPartitionFlag flag, int state)
Set the state (1 or 0) of a flag on a partition.
Definition disk.c:1399
natmath.h
name
char name[16]
Definition pc98.c:13
_PedDiskArchOps
Architecture-specific operations.
Definition disk.h:297
_PedDiskArchOps::disk_commit
int(* disk_commit)(PedDisk *disk)
Definition disk.h:300
_PedDiskArchOps::partition_is_busy
int(* partition_is_busy)(const PedPartition *part)
Definition disk.h:299
_PedDiskOps
Definition disk.h:215
_PedDiskOps::partition_set_flag
int(* partition_set_flag)(PedPartition *part, PedPartitionFlag flag, int state)
Definition disk.h:248
_PedDiskOps::disk_set_flag
int(* disk_set_flag)(PedDisk *disk, PedDiskFlag flag, int state)
Definition disk.h:224
_PedDiskOps::partition_set_name
void(* partition_set_name)(PedPartition *part, const char *name)
Definition disk.h:258
_PedDiskOps::partition_check
bool(* partition_check)(const PedPartition *part)
Definition disk.h:272
_PedDiskOps::disk_is_flag_available
int(* disk_is_flag_available)(const PedDisk *disk, PedDiskFlag flag)
Definition disk.h:231
_PedDiskOps::probe
int(* probe)(const PedDevice *dev)
Definition disk.h:217
_PedDiskOps::disk_get_flag
int(* disk_get_flag)(const PedDisk *disk, PedDiskFlag flag)
Definition disk.h:228
_PedDiskOps::free
void(* free)(PedDisk *disk)
Definition disk.h:221
_PedDiskOps::get_max_primary_partition_count
int(* get_max_primary_partition_count)(const PedDisk *disk)
Definition disk.h:276
_PedDiskOps::partition_set_type_uuid
int(* partition_set_type_uuid)(PedPartition *part, const uint8_t *uuid)
Definition disk.h:264
_PedDiskOps::max_length
PedSector(* max_length)(void)
Definition disk.h:280
_PedDiskOps::clobber
int(* clobber)(PedDevice *dev)
Definition disk.h:218
_PedDiskOps::write
int(* write)(const PedDisk *disk)
Definition disk.h:223
_PedDiskOps::partition_get_flag
int(* partition_get_flag)(const PedPartition *part, PedPartitionFlag flag)
Definition disk.h:252
_PedDiskOps::alloc_metadata
int(* alloc_metadata)(PedDisk *disk)
Definition disk.h:275
_PedDiskOps::get_max_supported_partition_count
bool(* get_max_supported_partition_count)(const PedDisk *disk, int *supported)
Definition disk.h:277
_PedDiskOps::partition_enumerate
int(* partition_enumerate)(PedPartition *part)
Definition disk.h:271
_PedDiskOps::partition_set_system
int(* partition_set_system)(PedPartition *part, const PedFileSystemType *fs_type)
Definition disk.h:246
_PedDiskOps::partition_is_flag_available
int(* partition_is_flag_available)(const PedPartition *part, PedPartitionFlag flag)
Definition disk.h:255
_PedDiskOps::read
int(* read)(PedDisk *disk)
Definition disk.h:222
_PedDiskOps::partition_set_type_id
int(* partition_set_type_id)(PedPartition *part, uint8_t id)
Definition disk.h:261
_PedDiskOps::partition_align
int(* partition_align)(PedPartition *part, const PedConstraint *constraint)
Definition disk.h:269
_PedDiskOps::partition_destroy
void(* partition_destroy)(PedPartition *part)
Definition disk.h:245
_PedDiskOps::partition_get_type_id
uint8_t(* partition_get_type_id)(const PedPartition *part)
Definition disk.h:262
_PedDiskOps::max_start_sector
PedSector(* max_start_sector)(void)
Definition disk.h:281
_PedDiskType
Definition disk.h:284
_PedDiskType::ops
PedDiskOps *const ops
Definition disk.h:288
_PedDiskType::features
PedDiskTypeFeature features
bitmap of supported features
Definition disk.h:290
_PedDiskType::next
PedDiskType * next
Definition disk.h:285
_PedDiskType::name
const char * name
the name of the partition table type.
Definition disk.h:286
_PedDisk
Represents a disk label (partition table).
Definition disk.h:197
_PedDisk::type
const PedDiskType * type
type of disk label
Definition disk.h:200
_PedDisk::needs_clobber
int needs_clobber
clobber before write?
Definition disk.h:209
_PedDisk::update_mode
int update_mode
mode without free/metadata partitions, for easier update
Definition disk.h:210
_PedDisk::disk_specific
void * disk_specific
Definition disk.h:206
_PedDisk::block_sizes
const int * block_sizes
block sizes supported by this label
Definition disk.h:201
_PedDisk::dev
PedDevice * dev
the device where the partition table lies
Definition disk.h:198
_PedDisk::part_list
PedPartition * part_list
list of partitions.
Definition disk.h:203
_PedPartition
PedPartition structure represents a partition.
Definition disk.h:144
_PedPartition::disk
PedDisk * disk
Definition disk.h:149
_PedPartition::geom
PedGeometry geom
geometry of the partition
Definition disk.h:150
_PedPartition::part_list
PedPartition * part_list
Definition disk.h:182
_PedPartition::num
int num
Definition disk.h:157
_PedPartition::fs_type
const PedFileSystemType * fs_type
Only used for an extended partition.
Definition disk.h:177
_PedPartition::disk_specific
void * disk_specific
Definition disk.h:184
_PedPartition::next
PedPartition * next
the partition table of the partition
Definition disk.h:146
_PedPartition::prev
PedPartition * prev
Definition disk.h:145